diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 380126ee18a6a1d6ea60a876883518ce6dd53106..fc06d8925d2ab0b6cdea80280d237b865b4682bc 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
- (* Copyright (C) Doom 2D: Forever Developers
+(* Copyright (C) Doom 2D: Forever Developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
procedure g_Game_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
-{$IFDEF ENABLE_RENDER}
- procedure g_TakeScreenShot(Filename: string = '');
-{$ENDIF}
procedure g_FatalError(Text: String);
procedure g_SimpleError(Text: String);
function g_Game_IsTestMap(): Boolean;
gRC_FullScreen, gRC_Maximized: Boolean;
gLanguageChange: Boolean = False;
gDebugMode: Boolean = False;
- g_debug_Sounds: Boolean = False;
- g_debug_Frames: Boolean = False;
g_debug_WinMsgs: Boolean = False;
g_debug_MonsterOff: Boolean = False;
g_debug_BotAIOff: Byte = 0;
- g_debug_HealthBar: Boolean = False;
g_Debug_Player: Boolean = False;
gCoopMonstersKilled: Word = 0;
gCoopSecretsFound: Word = 0;
procedure ClearDebugCvars();
begin
- g_debug_Sounds := False;
- g_debug_Frames := False;
g_debug_WinMsgs := False;
g_debug_MonsterOff := False;
g_debug_BotAIOff := 0;
- g_debug_HealthBar := False;
g_Debug_Player := False;
end;
{$IFDEF ENABLE_GIBS}
g_Gibs_RemoveAll;
{$ENDIF}
- {$IFDEF ENALBE_SHELLS}
+ {$IFDEF ENABLE_SHELLS}
g_Shells_RemoveAll;
{$ENDIF}
{$IFDEF ENABLE_CORPSES}
{$IFDEF ENABLE_GIBS}
g_Gibs_RemoveAll;
{$ENDIF}
- {$IFDEF ENALBE_SHELLS}
+ {$IFDEF ENABLE_SHELLS}
g_Shells_RemoveAll;
{$ENDIF}
{$IFDEF ENABLE_CORPSES}
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;
{$IFDEF ENABLE_GIBS}
g_Gibs_RemoveAll;
{$ENDIF}
- {$IFDEF ENALBE_SHELLS}
+ {$IFDEF ENABLE_SHELLS}
g_Shells_RemoveAll;
{$ENDIF}
{$IFDEF ENABLE_CORPSES}
g_Console_Add(Format('gScreenWidth = %d, gScreenHeight = %d', [gScreenWidth, gScreenHeight]));
g_Console_Add(Format('gScreenWidth = %d, gScreenHeight = %d', [gScreenWidth, gScreenHeight]));
end
- else if cmd = 'd_sounds' then
- begin
- if (Length(P) > 1) and
- ((P[1] = '1') or (P[1] = '0')) then
- g_Debug_Sounds := (P[1][1] = '1');
-
- g_Console_Add(Format('d_sounds is %d', [Byte(g_Debug_Sounds)]));
- end
- else if cmd = 'd_frames' then
- begin
- if (Length(P) > 1) and
- ((P[1] = '1') or (P[1] = '0')) then
- g_Debug_Frames := (P[1][1] = '1');
-
- g_Console_Add(Format('d_frames is %d', [Byte(g_Debug_Frames)]));
- end
else if cmd = 'd_winmsg' then
begin
if (Length(P) > 1) and
end;
end;
end
- else if (cmd = 'd_health') then
- begin
- if (Length(P) > 1) and
- ((P[1] = '1') or (P[1] = '0')) then
- g_debug_HealthBar := (P[1][1] = '1');
-
- g_Console_Add(Format('d_health is %d', [Byte(g_debug_HealthBar)]));
- end
else if (cmd = 'd_player') then
begin
if (Length(P) > 1) and
else if cmd = 'screenshot' then
begin
{$IFDEF ENABLE_RENDER}
- g_TakeScreenShot;
+ r_Render_RequestScreenShot;
{$ENDIF}
end
else if (cmd = 'weapnext') or (cmd = 'weapprev') then
end;
end;
-{$IFDEF ENABLE_RENDER}
-procedure g_TakeScreenShot(Filename: string = '');
- var t: TDateTime; dir, date, name: String;
-begin
- if e_NoGraphics then
- Exit;
-
- dir := e_GetWriteableDir(ScreenshotDirs);
- if Filename = '' then
- begin
- t := Now;
- DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
- Filename := 'screenshot-' + date;
- end;
-
- name := e_CatPath(dir, Filename + '.png');
- if r_Render_WriteScreenShot(name) then
- g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [name]))
- else
- g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [name]));
-end;
-{$ENDIF}
-
{$IFDEF ENABLE_MENU}
procedure g_Game_InGameMenu(Show: Boolean);
begin
conRegVar('pf_coldet', @g_profile_collision, 'draw collision detection profiles', 'coldet profiles');
conRegVar('pf_los', @g_profile_los, 'draw monster LOS profiles', 'monster LOS profiles');
- conRegVar('r_sq_draw', @gdbg_map_use_accel_render, 'accelerated spatial queries in rendering', 'accelerated rendering');
conRegVar('cd_sq_enabled', @gdbg_map_use_accel_coldet, 'accelerated spatial queries in map coldet', 'accelerated map coldet');
conRegVar('mon_sq_enabled', @gmon_debug_use_sqaccel, 'accelerated spatial queries for monsters', 'accelerated monster coldet');
conRegVar('wtrace_sq_enabled', @gwep_debug_fast_trace, 'accelerated spatial queries for weapon hitscan trace', 'accelerated weapon hitscan');