X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Frenders%2Fopengl%2Fr_map.pas;h=26a15dc4881d3e97f1a621ae2dbd4a518794cd05;hb=92cb2a1c5eab5380829b60c0c65b3e7730d76425;hp=914087d80c504bc7cc438bd5560dfed3f708f787;hpb=34addf6031503a4d22a9c440d967ae81ffee4c6a;p=d2df-sdl.git diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index 914087d..26a15dc 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -586,24 +586,29 @@ implementation begin ASSERT(p.FCurTexture <= High(p.TextureIDs)); Texture := p.TextureIDs[p.FCurTexture].Texture; + t := nil; + ASSERT(Texture >= -1); ASSERT(Texture <= High(RenTextures)); - t := RenTextures[Texture].tex; - if (RenTextures[Texture].spec = 0) or (t <> nil) then + if Texture >= 0 then begin - count := 0; frame := 0; - if p.AnimTime <= gTime then + t := RenTextures[Texture].tex; + if (RenTextures[Texture].spec = 0) or (t <> nil) then begin - a := RenTextures[Texture].anim; - a.loop := p.AnimLoop; - g_Anim_GetFrameByTime(a, (gTime - p.AnimTime) DIV GAME_TICK, count, frame); + count := 0; frame := 0; + if p.AnimTime <= gTime then + begin + a := RenTextures[Texture].anim; + a.loop := p.AnimLoop; + g_Anim_GetFrameByTime(a, (gTime - p.AnimTime) DIV GAME_TICK, count, frame); + end; + if t <> nil then + begin + tex := t.GetTexture(frame); + r_Draw_TextureRepeat(tex, p.x, p.y, p.width, p.height, false, 255, 255, 255, 255 - p.alpha, p.blending); + end + else + r_Draw_TextureRepeat(nil, p.x, p.y, p.width, p.height, false, 255, 255, 255, 255, false); end; - if t <> nil then - begin - tex := t.GetTexture(frame); - r_Draw_TextureRepeat(tex, p.x, p.y, p.width, p.height, false, 255, 255, 255, 255 - p.alpha, p.blending); - end - else - r_Draw_TextureRepeat(nil, p.x, p.y, p.width, p.height, false, 255, 255, 255, 255, false); end; if t = nil then