diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a6391a71be..e70f3cc0a3 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -911,7 +911,7 @@ bool AActor::IsVisibleToPlayer() const return true; if (VisibleToTeam != 0 && teamplay && - VisibleToTeam-1 != players[consoleplayer].userinfo.GetTeam()) + (signed)(VisibleToTeam-1) != players[consoleplayer].userinfo.GetTeam()) return false; const player_t* pPlayer = players[consoleplayer].camera->player; diff --git a/src/textures/pngtexture.cpp b/src/textures/pngtexture.cpp index 7927c0a93c..8120df9688 100644 --- a/src/textures/pngtexture.cpp +++ b/src/textures/pngtexture.cpp @@ -297,17 +297,33 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, const FString &filename case 0: // Grayscale if (!bAlphaTexture) { + BYTE *GrayMapSrc; + switch(BitDepth) + { + default: + GrayMapSrc = GrayMap; + break; + case 4: + GrayMapSrc = GrayMap4bit; + break; + case 2: + GrayMapSrc = GrayMap2bit; + break; + case 1: + GrayMapSrc = GrayMap1bit; + break; + } if (colortype == 0 && havetRNS && trans[0] != 0) { bMasked = true; - PaletteSize = 256; - PaletteMap = new BYTE[256]; - memcpy (PaletteMap, GrayMap, 256); + PaletteSize = 1<