index 914087d80c504bc7cc438bd5560dfed3f708f787..eff895d9b528d404a0560b035f1958efe48bf619 100644 (file)
procedure r_Map_DrawPlayerModel (pm: TPlayerModel; x, y: Integer; alpha: Byte);
{$ENDIF}
procedure r_Map_DrawPlayerModel (pm: TPlayerModel; x, y: Integer; alpha: Byte);
{$ENDIF}
+ procedure r_Map_Reset;
procedure r_Map_Update;
procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer; out acx, acy: Integer);
procedure r_Map_Update;
procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer; out acx, acy: Integer);
r_Common_FreeAndNil(Items[i].tex);
end;
r_Common_FreeAndNil(Items[i].tex);
end;
+ procedure r_Map_FreeTextures;
+ var i: Integer;
+ begin
+ plist.Clear;
+ r_Common_FreeAndNil(SkyTexture);
+ if RenTextures <> nil then
+ for i := 0 to High(RenTextures) do
+ r_Common_FreeAndNil(RenTextures[i].tex);
+ SetLength(RenTextures, 0);
+ end;
+
procedure r_Map_LoadTextures;
const DefaultAnimInfo: TAnimInfo = (loop: true; delay: 1; frames: 1; back: false);
var i, n: Integer; txt: TAnimTextInfo;
begin
procedure r_Map_LoadTextures;
const DefaultAnimInfo: TAnimInfo = (loop: true; delay: 1; frames: 1; back: false);
var i, n: Integer; txt: TAnimTextInfo;
begin
+ r_Map_FreeTextures;
if Textures <> nil then
begin
n := Length(Textures);
if Textures <> nil then
begin
n := Length(Textures);
plist.Clear;
end;
plist.Clear;
end;
- procedure r_Map_FreeTextures;
- var i: Integer;
- begin
- plist.Clear;
- r_Common_FreeAndNil(SkyTexture);
- if RenTextures <> nil then
- for i := 0 to High(RenTextures) do
- r_Common_FreeAndNil(RenTextures[i].tex);
- SetLength(RenTextures, 0);
- end;
-
procedure r_Map_DrawPanel (p: TPanel);
var Texture: Integer; t: TGLMultiTexture; tex: TGLTexture; count, frame: LongInt; a: TAnimInfo;
begin
procedure r_Map_DrawPanel (p: TPanel);
var Texture: Integer; t: TGLMultiTexture; tex: TGLTexture; count, frame: LongInt; a: TAnimInfo;
begin
begin
ASSERT(p.FCurTexture <= High(p.TextureIDs));
Texture := p.TextureIDs[p.FCurTexture].Texture;
begin
ASSERT(p.FCurTexture <= High(p.TextureIDs));
Texture := p.TextureIDs[p.FCurTexture].Texture;
+ t := nil;
+ ASSERT(Texture >= -1);
ASSERT(Texture <= High(RenTextures));
ASSERT(Texture <= High(RenTextures));
- t := RenTextures[Texture].tex;
- if (RenTextures[Texture].spec = 0) or (t <> nil) then
+ if Texture >= 0 then
begin
begin
- count := 0; frame := 0;
- if p.AnimTime <= gTime then
+ t := RenTextures[Texture].tex;
+ if (RenTextures[Texture].spec = 0) or (t <> nil) then
begin
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;
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
end;
if t = nil then
end;
end;
end;
end;
+ procedure r_Map_ResetGFX;
+ begin
+ SetLength(gfxlist, 0);
+ end;
+
procedure r_Map_UpdateGFX (tick: LongWord);
var i: Integer; count: LongInt;
begin
procedure r_Map_UpdateGFX (tick: LongWord);
var i: Integer; count: LongInt;
begin
r_Map_DrawScreenEffects(x, y, w, h, player);
end;
r_Map_DrawScreenEffects(x, y, w, h, player);
end;
+ procedure r_Map_Reset;
+ begin
+ {$IFDEF ENABLE_GFX}
+ r_Map_ResetGFX;
+ {$ENDIF}
+ end;
+
procedure r_Map_Update;
var i, count, tick: LongInt;
begin
procedure r_Map_Update;
var i, count, tick: LongInt;
begin