From: DeaDDooMER Date: Thu, 16 Feb 2023 18:31:11 +0000 (+0300) Subject: gl: reset gfx on map start X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=bd40762ed00ea73717966bb0e5a44ae73a179be0;p=d2df-sdl.git gl: reset gfx on map start --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 380126e..3ad4510 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -3513,12 +3513,13 @@ begin begin //result := g_Map_Load(gGameSettings.WAD + ':\' + ResName); result := g_Map_Load(NewWAD+':\'+ResName); - {$IFDEF ENABLE_RENDER} - r_Render_LoadTextures; - {$ENDIF} end; if Result then begin + {$IFDEF ENABLE_RENDER} + r_Render_LoadTextures; + r_Render_Reset; + {$ENDIF} g_Player_ResetAll(Force or gLastMap, gGameSettings.GameType = GT_SINGLE); gState := STATE_NONE; diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index c008f43..eff895d 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -38,6 +38,7 @@ interface 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); @@ -1077,6 +1078,11 @@ implementation end; end; + procedure r_Map_ResetGFX; + begin + SetLength(gfxlist, 0); + end; + procedure r_Map_UpdateGFX (tick: LongWord); var i: Integer; count: LongInt; begin @@ -1575,6 +1581,13 @@ implementation 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 diff --git a/src/game/renders/opengl/r_render.pas b/src/game/renders/opengl/r_render.pas index d63137e..3c2cd6f 100644 --- a/src/game/renders/opengl/r_render.pas +++ b/src/game/renders/opengl/r_render.pas @@ -39,6 +39,7 @@ interface procedure r_Render_LoadTextures; procedure r_Render_FreeTextures; + procedure r_Render_Reset; procedure r_Render_Update; procedure r_Render_Draw; @@ -247,6 +248,11 @@ implementation {$ENDIF} end; + procedure r_Render_Reset; + begin + r_Map_Reset; + end; + procedure r_Render_Update; begin r_Console_Update;