From bbd0114acfb503160d3b5cdc4524ca01d4626433 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Thu, 7 Apr 2016 10:40:01 +0300 Subject: [PATCH] cosmetix in targa loader --- src/engine/e_textures.pas | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/engine/e_textures.pas b/src/engine/e_textures.pas index e7bcbcf..ef9b660 100644 --- a/src/engine/e_textures.pas +++ b/src/engine/e_textures.pas @@ -192,6 +192,12 @@ begin Exit; end; + if (TGAHeader.ImageInfo and $c0) <> 0 then + begin + e_WriteLog('Error loading texture: interleaved TGA', MSG_WARNING); + Exit; + end; + Width := TGAHeader.Width[0] + TGAHeader.Width[1] * 256; Height := TGAHeader.Height[0] + TGAHeader.Height[1] * 256; BPP := TGAHeader.BPP; @@ -210,6 +216,8 @@ begin Back^ := Temp; end; + //if (TGAHeader.ImageInfo and $20) <> 0 then UpsideDown(Image, Width, Height); + if ( BPP = 24 ) then TFmt := GL_RGB else @@ -265,6 +273,12 @@ begin Exit; end; + if (TGAHeader.ImageInfo and $c0) <> 0 then + begin + e_WriteLog('Error loading texture: interleaved TGA', MSG_WARNING); + Exit; + end; + Width := TGAHeader.Width[0] + TGAHeader.Width[1] * 256; Height := TGAHeader.Height[0] + TGAHeader.Height[1] * 256; BPP := TGAHeader.BPP; @@ -301,6 +315,8 @@ begin for i := 0 to fHeight-1 do CopyMemory( PByte(image) + a*i, Base + b*i, a ); + //if (TGAHeader.ImageInfo and $20) <> 0 then UpsideDown(Image, Width, Height); + if ( BPP = 24 ) then TFmt := GL_RGB else -- 2.29.2