diff --git a/src/gl/dynlights/gl_glow.cpp b/src/gl/dynlights/gl_glow.cpp index aaf3930e6..2e324b63e 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 (uint32(-1) != c) + else if (c != ~0u) { 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 (uint32(-1) != c) + else if (c != ~0u) { 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 (uint32(-1) != c) + else if (c != ~0u) { bottomglowcolor[0] = c.r / 255.f; bottomglowcolor[1] = c.g / 255.f; diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 9f920d225..1650a33b7 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 == uint32(-1) && fadecolor == uint32(-1) && desaturation == -1 && fogdensity == -1) + if (lightcolor == ~0u && fadecolor == ~0u && 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 (uint32(-1) == lightcolor) lightcolor = PalEntry(255,255,255); - if (uint32(-1) == fadecolor) + if (lightcolor == ~0u) lightcolor = PalEntry(255,255,255); + if (fadecolor == ~0u) { if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special & 0xff) == Sector_Outside)) fadecolor = level.outsidefog;