summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e74c90)
raw | patch | inline | side by side (parent: 2e74c90)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 10 Sep 2017 12:36:16 +0000 (15:36 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 10 Sep 2017 13:34:36 +0000 (16:34 +0300) |
diff --git a/src/game/Doom2DF.dpr b/src/game/Doom2DF.dpr
index 806032dce301e929dcaf969d2d07692292aef34a..97fdb669e7c5d52616e69030f7924fada08cd8be 100644 (file)
--- a/src/game/Doom2DF.dpr
+++ b/src/game/Doom2DF.dpr
uses
conbuf in '../shared/conbuf.pas',
+ math,
GL,
GLExt,
SDL2 in '../lib/sdl2/sdl2.pas',
var
f: Integer;
noct: Boolean = false;
- tfo: Text;
+ //tfo: Text;
begin
+ SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); //k8: fuck off, that's why
for f := 1 to ParamCount do
begin
if ParamStr(f) = '--gdb' then noct := true
begin
e_WriteStackTrace(e.message);
//e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
+ (*
AssignFile(tfo, GameDir+'/trace.log');
{$I-}
Append(tfo);
if (IOResult <> 0) then Rewrite(tfo);
if (IOResult = 0) then begin writeln(tfo, '====================='); DumpExceptionBackTrace(tfo); CloseFile(tfo); end;
+ *)
end
else
begin
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index e75af88921d5fc2306767f98df5921c0241e76d2..2e4dc8730c400582dc59085bb1515a2cbd20ef8f 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
// tracer will return `false` if we started outside of the liquid
{$IF DEFINED(D2F_DEBUG_BUBBLES)}
- stt := curTimeMicro();
+ stt := getTimeMicro();
ptr := mapGrid.traceOrthoRayWhileIn(liquidx, liquidTopY, x, y, x, 0, GridTagWater or GridTagAcid1 or GridTagAcid2);
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_LogWritefln('traceOrthoRayWhileIn: time=%s (%s); liquidTopY=%s', [Integer(stt), ptr, liquidTopY]);
//
- stt := curTimeMicro();
+ stt := getTimeMicro();
nptr := g_Map_TraceLiquidNonPrecise(x, y, 0, -8, liquidx, liquidTopY);
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_LogWritefln('g_Map_TraceLiquidNonPrecise: time=%s (%s); liquidTopY=%s', [Integer(stt), nptr, liquidTopY]);
if not nptr then continue;
{$ELSE}
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index ac54bd535a9d82d6e3d1c00ae97795761348f24c..bac475b18901716c0c48b4007f0cc24167a60bef 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
e_LogWritefln('Loading map: %s', [mapResName], MSG_NOTIFY);
g_Game_SetLoadingText(_lc[I_LOAD_MAP], 0, False);
- stt := curTimeMicro();
+ stt := getTimeMicro();
try
mapReader := g_Map_ParseMap(Data, Len);
gMusic.SetByName('');
end;
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_LogWritefln('map loaded in %s.%s milliseconds', [Integer(stt div 1000), Integer(stt mod 1000)]);
mapOk := true;
finally
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 5ba00a7ad526f3a3e025954efc7dbd20510eefa1..4a22a3b4a827a2a93c9079348a6fafaee9321734 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
//vy := (dy*10 div d)*yi;
{$IF DEFINED(D2F_DEBUG)}
- stt := curTimeMicro();
+ stt := getTimeMicro();
{$ENDIF}
xx := x;
begin
_collide := True;
{$IF DEFINED(D2F_DEBUG)}
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_WriteLog(Format('*** old trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY);
showTime := false;
{$ENDIF}
{$IF DEFINED(D2F_DEBUG)}
if showTime then
begin
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_WriteLog(Format('*** old trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY);
end;
{$ENDIF}
{$IF DEFINED(D2F_DEBUG)}
e_WriteLog(Format('GUN TRACE: (%d,%d) to (%d,%d)', [x, y, x2, y2]), MSG_NOTIFY);
- stt := curTimeMicro();
+ stt := getTimeMicro();
{$ENDIF}
wallHitFlag := (g_Map_traceToNearestWall(x, y, x2, y2, @wallHitX, @wallHitY) <> nil);
if wallHitFlag then
begin
{$IF DEFINED(D2F_DEBUG)}
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY);
{$ENDIF}
g_GFX_Spark(wallHitX, wallHitY, 2+Random(2), 180+a, 0, 0);
else
begin
{$IF DEFINED(D2F_DEBUG)}
- stt := curTimeMicro()-stt;
+ stt := getTimeMicro()-stt;
e_WriteLog(Format('*** new trace time: %u microseconds', [LongWord(stt)]), MSG_NOTIFY);
{$ENDIF}
end;
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index ec3f1167d39f5d2709e44f06edf94ac361125bda..5f04992969bd4ace2b25683a447b5613f5caa877 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
begin
if forceUpdate then
begin
- prevLoadingUpdateTime := curTimeMilli();
+ prevLoadingUpdateTime := getTimeMilli();
end
else
begin
- stt := curTimeMilli();
+ stt := getTimeMilli();
if (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= 400) then
begin
prevLoadingUpdateTime := stt;
diff --git a/src/shared/xdynrec.pas b/src/shared/xdynrec.pas
index c992997d32ce55a4f21c73b764ad62dbbaa3cc95..4ac9db7667f375a08daa5defa0c99ff99c5bc355 100644 (file)
--- a/src/shared/xdynrec.pas
+++ b/src/shared/xdynrec.pas
begin
if (mOwner = nil) then raise TDynParseException.CreateFmt(pr, 'can''t parse record ''%s'' value without owner', [mTypeName]);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stall := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stall := getTimeMicro();{$ENDIF}
// not a header?
if not mHeader then
if mHeader then
begin
// add records with this type (if any)
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
trc := mOwner.recType[pr.tokStr];
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profFindRecType := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profFindRecType := getTimeMicro()-stt;{$ENDIF}
if (trc <> nil) then
begin
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
rec := trc.clone(mHeaderRec);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profCloneRec := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profCloneRec := getTimeMicro()-stt;{$ENDIF}
rec.mHeaderRec := mHeaderRec;
// on error, it will be freed by memowner
pr.skipToken();
rec.parseValue(pr);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
addRecordByType(rec.mTypeName, rec);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profAddRecByType := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profAddRecByType := getTimeMicro()-stt;{$ENDIF}
continue;
end;
end;
// fields
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
//writeln('0: <', mName, '.', pr.tokStr, '>');
fld := field[pr.tokStr];
//writeln('1: <', mName, '.', pr.tokStr, '>');
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profFieldSearching := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profFieldSearching := getTimeMicro()-stt;{$ENDIF}
if (fld <> nil) then
begin
//writeln('2: <', mName, '.', pr.tokStr, '>');
if fld.internal then raise TDynParseException.CreateFmt(pr, 'internal field ''%s'' in record ''%s''', [fld.mName, mTypeName]);
pr.skipToken(); // skip field name
//writeln('3: <', mName, '.', pr.tokStr, '>:', pr.tokType);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
fld.parseValue(pr);
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profFieldValParsing := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profFieldValParsing := getTimeMicro()-stt;{$ENDIF}
continue;
end;
end;
// fix field defaults
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := curTimeMicro();{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
for fld in mFields do fld.fixDefaultValue();
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profFixDefaults := curTimeMicro()-stt;{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profFixDefaults := getTimeMicro()-stt;{$ENDIF}
//writeln('done parsing record <', mName, '>');
- //{$IF DEFINED(D2D_DYNREC_PROFILER)}writeln('stall: ', curTimeMicro()-stall);{$ENDIF}
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profRecValParse := curTimeMicro()-stall;{$ENDIF}
+ //{$IF DEFINED(D2D_DYNREC_PROFILER)}writeln('stall: ', getTimeMicro()-stall);{$ENDIF}
+ {$IF DEFINED(D2D_DYNREC_PROFILER)}profRecValParse := getTimeMicro()-stall;{$ENDIF}
end;
index 6fb00357b467071a192a46556511fd86b0021780..f61b844edb9133b04ff5d01172949058729d7aae 100644 (file)
--- a/src/shared/xprofiler.pas
+++ b/src/shared/xprofiler.pas
end;
-function curTimeMicro (): UInt64; inline;
-function curTimeMilli (): UInt64; inline;
+function getTimeMicro (): UInt64; inline;
+function getTimeMilli (): UInt64; inline;
implementation
end;
-function curTimeMicro (): UInt64; inline;
+function getTimeMicro (): UInt64; inline;
var
r: THPTimeType;
begin
end;
-function curTimeMilli (): UInt64; inline;
+function getTimeMilli (): UInt64; inline;
begin
- result := curTimeMicro div 1000;
+ result := getTimeMicro div 1000;
end;
var
e: UInt64;
begin
- e := curTimeMicro();
+ e := getTimeMicro();
if (mStartPosition > e) then mStartPosition := e;
Inc(mElapsed, e-mStartPosition);
mStartPosition := e;
procedure TStopWatch.start (reset: Boolean=true);
begin
if mRunning and not reset then exit; // nothing to do
- mStartPosition := curTimeMicro();
+ mStartPosition := getTimeMicro();
mRunning := true;
if (reset) then mElapsed := 0;
end;