diff --git a/src/textures/imgztexture.cpp b/src/textures/imgztexture.cpp index 3f3d4c674..5b5237d0d 100644 --- a/src/textures/imgztexture.cpp +++ b/src/textures/imgztexture.cpp @@ -217,6 +217,6 @@ uint8_t *FIMGZTexture::MakeTexture (FRenderStyle style) int FIMGZTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf) { if (!isalpha) return FTexture::CopyTrueColorPixels(bmp, x, y, rotate, inf); - else return CopyTrueColorTranslated(bmp, x, y, rotate, translationtables[TRANSLATION_Standard][isalpha ? STD_Gray : STD_Grayscale]->Palette, inf); + else return CopyTrueColorTranslated(bmp, x, y, rotate, translationtables[TRANSLATION_Standard][STD_Grayscale]->Palette, inf); } diff --git a/src/textures/patchtexture.cpp b/src/textures/patchtexture.cpp index 153d7c6f1..eeb900266 100644 --- a/src/textures/patchtexture.cpp +++ b/src/textures/patchtexture.cpp @@ -114,13 +114,13 @@ static bool CheckIfPatch(FileReader & file, bool &isalpha) return false; } } - delete [] data; if (!gapAtStart) { // only check this if the texture passed validation. // Here is a good point because we already have a valid buffer of the lump's data. isalpha = checkPatchForAlpha(data, (uint32_t)file.GetLength()); } + delete[] data; return !gapAtStart; } delete [] data; @@ -273,7 +273,7 @@ uint8_t *FPatchTexture::MakeTexture (FRenderStyle style) int FPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf) { if (!isalpha) return FTexture::CopyTrueColorPixels(bmp, x, y, rotate, inf); - else return CopyTrueColorTranslated(bmp, x, y, rotate, translationtables[TRANSLATION_Standard][isalpha ? STD_Gray : STD_Grayscale]->Palette, inf); + else return CopyTrueColorTranslated(bmp, x, y, rotate, translationtables[TRANSLATION_Standard][STD_Grayscale]->Palette, inf); } //==========================================================================