diff --git a/src/gl/data/gl_setup.cpp b/src/gl/data/gl_setup.cpp index 376b4aa6d..3b72c9863 100644 --- a/src/gl/data/gl_setup.cpp +++ b/src/gl/data/gl_setup.cpp @@ -302,9 +302,9 @@ static void PrepareSectorData() static void PrepareTransparentDoors(sector_t * sector) { bool solidwall=false; - int notextures=0; - int nobtextures=0; - int selfref=0; + unsigned int notextures=0; + unsigned int nobtextures=0; + unsigned int selfref=0; sector_t * nextsec=NULL; #ifdef _DEBUG diff --git a/src/gl/dynlights/gl_glow.cpp b/src/gl/dynlights/gl_glow.cpp index e0ed6d0f6..aaf3930e6 100644 --- a/src/gl/dynlights/gl_glow.cpp +++ b/src/gl/dynlights/gl_glow.cpp @@ -125,7 +125,7 @@ int gl_CheckSpriteGlow(sector_t *sector, int lightlevel, const DVector3 &pos) } } } - else if (c != -1) + else if (uint32(-1) != c) { bottomglowcolor[0] = c.r / 255.f; bottomglowcolor[1] = c.g / 255.f; @@ -171,7 +171,7 @@ bool gl_GetWallGlow(sector_t *sector, float *topglowcolor, float *bottomglowcolo } } } - else if (c != -1) + else if (uint32(-1) != c) { topglowcolor[0] = c.r / 255.f; topglowcolor[1] = c.g / 255.f; @@ -195,7 +195,7 @@ bool gl_GetWallGlow(sector_t *sector, float *topglowcolor, float *bottomglowcolo } } } - else if (c != -1) + else if (uint32(-1) != c) { bottomglowcolor[0] = c.r / 255.f; bottomglowcolor[1] = c.g / 255.f; @@ -214,4 +214,4 @@ CCMD(setglow) auto s = players[0].mo->Sector; s->planes[sector_t::floor].GlowHeight = 128; s->planes[sector_t::floor].GlowColor = 0xff0000; -} \ No newline at end of file +} diff --git a/src/gl/renderer/gl_colormap.h b/src/gl/renderer/gl_colormap.h index 8bee402c9..2c9fb91a4 100644 --- a/src/gl/renderer/gl_colormap.h +++ b/src/gl/renderer/gl_colormap.h @@ -5,7 +5,7 @@ #include "v_palette.h" #include "r_data/colormaps.h" -extern DWORD gl_fixedcolormap; +extern int gl_fixedcolormap; struct lightlist_t; diff --git a/src/gl/renderer/gl_lightdata.h b/src/gl/renderer/gl_lightdata.h index a1abf8c82..7af5e7a4f 100644 --- a/src/gl/renderer/gl_lightdata.h +++ b/src/gl/renderer/gl_lightdata.h @@ -35,7 +35,7 @@ inline bool gl_isWhite(PalEntry color) return color.r + color.g + color.b == 3*0xff; } -extern DWORD gl_fixedcolormap; +extern int gl_fixedcolormap; inline bool gl_isFullbright(PalEntry color, int lightlevel) { @@ -61,4 +61,4 @@ inline void FColormap::CopyFrom3DLight(lightlist_t *light) -#endif \ No newline at end of file +#endif diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index f35071854..30c0000d3 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -323,7 +323,7 @@ void FGLRenderer::UpdateCameraExposure() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // Find the average value: - for (int i = 0; i + 1 < mBuffers->ExposureLevels.Size(); i++) + for (unsigned int i = 0; i + 1 < mBuffers->ExposureLevels.Size(); i++) { const auto &level = mBuffers->ExposureLevels[i]; const auto &next = mBuffers->ExposureLevels[i + 1]; diff --git a/src/gl/renderer/gl_renderbuffers.cpp b/src/gl/renderer/gl_renderbuffers.cpp index b14ee9852..77e77bf5b 100644 --- a/src/gl/renderer/gl_renderbuffers.cpp +++ b/src/gl/renderer/gl_renderbuffers.cpp @@ -448,7 +448,7 @@ void FGLRenderBuffers::CreateExposureLevels(int width, int height) void FGLRenderBuffers::CreateEyeBuffers(int eye) { - if (mEyeFBs.Size() > eye) + if (mEyeFBs.Size() > unsigned(eye)) return; GLint activeTex, textureBinding, frameBufferBinding; @@ -457,7 +457,7 @@ void FGLRenderBuffers::CreateEyeBuffers(int eye) glGetIntegerv(GL_TEXTURE_BINDING_2D, &textureBinding); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &frameBufferBinding); - while (mEyeFBs.Size() <= eye) + while (mEyeFBs.Size() <= unsigned(eye)) { GLuint texture = Create2DTexture("EyeTexture", GL_RGBA16F, mWidth, mHeight); mEyeTextures.Push(texture); diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index bedd7a7e7..b4efe736e 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -88,7 +88,7 @@ extern int viewpitch; extern bool NoInterpolateView; extern bool r_showviewer; -DWORD gl_fixedcolormap; +int gl_fixedcolormap; area_t in_area; TArray currentmapsection; int camtexcount; diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 4d258b3a0..5ac29dcad 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1245,7 +1245,7 @@ void GLWall::ClipFFloors(seg_t * seg, F3DFloor * ffloor, sector_t * frontsector, { TArray & frontffloors = frontsector->e->XFloor.ffloors; - int flags = ffloor->flags & (FF_SWIMMABLE | FF_TRANSLUCENT); + const unsigned int flags = ffloor->flags & (FF_SWIMMABLE | FF_TRANSLUCENT); for (unsigned int i = 0; i < frontffloors.Size(); i++) { diff --git a/src/gl/system/gl_debug.cpp b/src/gl/system/gl_debug.cpp index a8b1bab5d..25651721e 100644 --- a/src/gl/system/gl_debug.cpp +++ b/src/gl/system/gl_debug.cpp @@ -143,7 +143,7 @@ void FGLDebug::SetupBreakpointMode() void FGLDebug::UpdateLoggingLevel() { - int level = gl_debug_level; + const GLenum level = gl_debug_level; if (level != mCurrentLevel) { glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, level > 0); diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index 4be2e9619..8bb8ee6f0 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -285,7 +285,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla if (translation <= 0) translation = -translation; else { - alphatrans = (gl.legacyMode && translation == TRANSLATION(TRANSLATION_Standard, 8)); + alphatrans = (gl.legacyMode && DWORD(translation) == TRANSLATION(TRANSLATION_Standard, 8)); translation = GLTranslationPalette::GetInternalTranslation(translation); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index de8357764..a1422236a 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3088,7 +3088,7 @@ line_t** linebuffer; static void P_GroupLines (bool buildmap) { cycle_t times[16]; - int* linesDoneInEachSector; + unsigned int* linesDoneInEachSector; int i; int total; line_t* li; @@ -3156,7 +3156,7 @@ static void P_GroupLines (bool buildmap) times[3].Clock(); linebuffer = new line_t *[total]; line_t **lineb_p = linebuffer; - linesDoneInEachSector = new int[numsectors]; + linesDoneInEachSector = new unsigned int[numsectors]; memset (linesDoneInEachSector, 0, sizeof(int)*numsectors); for (sector = sectors, i = 0; i < numsectors; i++, sector++) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 51bd780f5..9f920d225 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1695,7 +1695,7 @@ public: sec->ceilingplane.set(n.X, n.Y, n.Z, cp[3]); } - if (lightcolor == -1 && fadecolor == -1 && desaturation == -1 && fogdensity == -1) + if (lightcolor == uint32(-1) && fadecolor == uint32(-1) && desaturation == -1 && fogdensity == -1) { // [RH] Sectors default to white light with the default fade. // If they are outside (have a sky ceiling), they use the outside fog. @@ -1714,8 +1714,8 @@ public: } else { - if (lightcolor == -1) lightcolor = PalEntry(255,255,255); - if (fadecolor == -1) + if (uint32(-1) == lightcolor) lightcolor = PalEntry(255,255,255); + if (uint32(-1) == fadecolor) { if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special & 0xff) == Sector_Outside)) fadecolor = level.outsidefog;