few instances of int float conversions i forgor

This commit is contained in:
Alug committed 2025-02-19 12:05:50 +01:00
1 parent 95df997198
commit b605c8e654
3 files changed
+26 -27

No files matched your search

+1 -1
View File
@@ -333,7 +333,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
// ok, this is a gross hack that barely works...
// but at least it doesn't overestimate too much...
clipfov = atan(1 / projMatrix[0]) * 360 / M_PIl;
clipfov = atan(1 / projMatrix[0]) * 360.0f / M_PIl;
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f;
if (floatangle >= 180.0)
return 0xffffffff;
+10 -11
View File
@@ -268,8 +268,8 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
cy = 1.0f - (cy / (vid.height / 2.0f));
// fwidth and fheight are similar
fwidth /= fvw / 2;
fheight /= fvh / 2;
fwidth /= fvw / 2.0f;
fheight /= fvh / 2.0f;
// set the polygon vertices to the right positions
v[0].x = v[3].x = cx;
@@ -442,8 +442,8 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
cy = 1.0f - (cy / (vid.height / 2.0f));
// fwidth and fheight are similar
fwidth /= fvw / 2;
fheight /= fvh / 2;
fwidth /= fvw / 2.0f;
fheight /= fvh / 2.0f;
// set the polygon vertices to the right positions
v[0].x = v[3].x = cx;
@@ -882,8 +882,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
fx = -1.0f + fx / (vid.width / 2.0f);
fy = 1.0f - fy / (vid.height / 2.0f);
fw = fw / (fvw / 2);
fh = fh / (fvh / 2);
fw = fw / (fvw / 2.0f);
fh = fh / (fvh / 2.0f);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
@@ -995,8 +995,8 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
fx = -1.0f + fx / (vid.width / 2.0f);
fy = 1.0f - fy / (vid.height / 2.0f);
fw = fw / (fvw / 2);
fh = fh / (fvh / 2);
fw = fw / (fvw / 2.0f);
fh = fh / (fvh / 2.0f);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
@@ -1084,7 +1084,6 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
if (color & V_HORZSCREEN)
fx += (FLOATBASEVIDWIDTH * dupx)/2;
}
if (fx >= vid.width || fy >= vid.height)
@@ -1109,8 +1108,8 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
fx = -1.0f + fx / (vid.width / 2.0f);
fy = 1.0f - fy / (vid.height / 2.0f);
fw = fw / (fvw / 2);
fh = fh / (fvh / 2);
fw = fw / (fvw / 2.0f);
fh = fh / (fvh / 2.0f);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
+15 -15
View File
@@ -58,11 +58,11 @@ extern sector_t *gl_backsector;
enum
{
HWR_STENCIL_NORMAL,
HWR_STENCIL_BEGIN,
HWR_STENCIL_REVERSE,
HWR_STENCIL_DEPTH,
HWR_STENCIL_SKY
HWR_STENCIL_NORMAL,
HWR_STENCIL_BEGIN,
HWR_STENCIL_REVERSE,
HWR_STENCIL_DEPTH,
HWR_STENCIL_SKY
};
// Performance stats
@@ -128,7 +128,7 @@ FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf);
// Get amount of memory used by gpu textures in bytes;
FUNCINLINE static ATTRINLINE INT32 HWR_GetTextureUsed(void)
{
return GL_GetTextureUsed();
return GL_GetTextureUsed();
}
// hw_main.c: Post-rendering
@@ -136,32 +136,32 @@ void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum);
FUNCINLINE static ATTRINLINE void HWR_StartScreenWipe(void)
{
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_START);
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_START);
}
FUNCINLINE static ATTRINLINE void HWR_EndScreenWipe(void)
{
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_END);
GL_MakeScreenTexture(HWD_SCREENTEXTURE_WIPE_END);
}
FUNCINLINE static ATTRINLINE void HWR_DrawIntermissionBG(void)
{
GL_DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC1, NULL, 0);
GL_DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC1, NULL, 0);
}
FUNCINLINE static ATTRINLINE void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
{
GL_RenderVhsEffect(upbary, downbary, updistort, downdistort, barsize);
GL_RenderVhsEffect(upbary, downbary, updistort, downdistort, barsize);
}
FUNCINLINE static ATTRINLINE void HWR_MakeScreenFinalTexture(void)
{
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
}
FUNCINLINE static ATTRINLINE void HWR_DrawScreenFinalTexture(INT32 width, INT32 height, boolean useshader)
{
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height, useshader);
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height, useshader);
}
// hw_main.c: Segs
@@ -215,17 +215,17 @@ extern consvar_t cv_glflashpal;
FUNCINLINE static ATTRINLINE boolean HWR_UseShader(void)
{
return (cv_glshaders.value && gl_shadersavailable);
return (cv_glshaders.value && gl_shadersavailable);
}
FUNCINLINE static ATTRINLINE boolean HWR_ShouldUsePaletteRendering(void)
{
return (cv_glpaletterendering.value && (pLocalPalette != NULL) && HWR_UseShader());
return (cv_glpaletterendering.value && (pLocalPalette != NULL) && HWR_UseShader());
}
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
{
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
}
#endif