summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5b991e)
raw | patch | inline | side by side (parent: d5b991e)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Mon, 11 Sep 2017 17:57:11 +0000 (20:57 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Mon, 11 Sep 2017 17:57:11 +0000 (20:57 +0300) |
src/game/Doom2DF.dpr | patch | blob | history | |
src/game/g_console.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history |
diff --git a/src/game/Doom2DF.dpr b/src/game/Doom2DF.dpr
index 97fdb669e7c5d52616e69030f7924fada08cd8be..7f0afecda37322d78a9b6cea05b136f8eb76db40 100644 (file)
--- a/src/game/Doom2DF.dpr
+++ b/src/game/Doom2DF.dpr
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*)
-{$MODE DELPHI}
+{$INCLUDE ../shared/a_modes.inc}
program Doom2DF;
{$IFNDEF HEADLESS}
{$IFDEF WINDOWS}
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 3bceba1c742bcdf4a8fbb877e38a1ebe170a9a5f..19c83b6f67c7c5ddc5269a838c295bc7643ff246 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('d_health', DebugCommands);
AddCommand('d_player', DebugCommands);
AddCommand('d_joy', DebugCommands);
+ AddCommand('d_mem', DebugCommands);
AddCommand('p1_name', GameCVars);
AddCommand('p2_name', GameCVars);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 05b824ac9f1f9814b59f80fd244e7436b037c116..d1ffd7ade5d35568897b3a5b825e0ec55a682da4 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
end;
end;
+procedure PrintHeapStats();
+var
+ hs: TFPCHeapStatus;
+begin
+ hs := GetFPCHeapStatus();
+ e_LogWriteLn ('v===== heap status =====v');
+ e_LogWriteFln('max heap size = %d k', [hs.MaxHeapSize div 1024]);
+ e_LogWriteFln('max heap used = %d k', [hs.MaxHeapUsed div 1024]);
+ e_LogWriteFln('cur heap size = %d k', [hs.CurrHeapSize div 1024]);
+ e_LogWriteFln('cur heap used = %d k', [hs.CurrHeapUsed div 1024]);
+ e_LogWriteFln('cur heap free = %d k', [hs.CurrHeapFree div 1024]);
+ e_LogWriteLn ('^=======================^');
+end;
procedure DebugCommands(P: SArray);
var
begin
for a := 1 to 8 do
g_Console_Add(e_JoystickStateToString(a));
+ end
+ else if (cmd = 'd_mem') then
+ begin
+ PrintHeapStats();
end;
end
else