summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9034e63)
raw | patch | inline | side by side (parent: 9034e63)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 May 2018 20:24:30 +0000 (23:24 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 May 2018 20:25:26 +0000 (23:25 +0300) |
lol, there is no player in map view mode, and the corresponding
map profiler is not created (but is used).
map profiler is not created (but is used).
src/game/g_game.pas | patch | blob | history | |
src/game/g_map.pas | patch | blob | history | |
src/game/g_monsters.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 81eade6f2a55ab1d42b15ba88d88cc92570d7961..b2c3dc06b4533c45e59df0fb5262c79780f75ae2 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
tagmask: Integer;
pan: TPanel;
begin
- profileFrameDraw.sectionBegin(profname);
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionBegin(profname);
if gdbg_map_use_accel_render then
begin
tagmask := panelTypeToTag(panType);
begin
if doDraw then g_Map_DrawPanels(panType, hasAmbient, ambColor);
end;
- profileFrameDraw.sectionEnd();
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionEnd();
end;
procedure drawOther (profname: AnsiString; cb: TDrawCB);
begin
- profileFrameDraw.sectionBegin(profname);
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionBegin(profname);
if assigned(cb) then cb();
- profileFrameDraw.sectionEnd();
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionEnd();
end;
begin
- profileFrameDraw.sectionBegin('total');
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionBegin('total');
// our accelerated renderer will collect all panels to gDrawPanelList
// we can use panel tag to render level parts (see GridTagXXX in g_map.pas)
- profileFrameDraw.sectionBegin('collect');
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionBegin('collect');
if gdbg_map_use_accel_render then
begin
g_Map_CollectDrawPanels(sX, sY, sWidth, sHeight);
end;
- profileFrameDraw.sectionEnd();
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionEnd();
- profileFrameDraw.sectionBegin('skyback');
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionBegin('skyback');
g_Map_DrawBack(backXOfs, backYOfs);
- profileFrameDraw.sectionEnd();
+ if (profileFrameDraw <> nil) then profileFrameDraw.sectionEnd();
if setTransMatrix then
begin
g_Player_DrawHealth();
end;
- profileFrameDraw.mainEnd(); // map rendering
+ if (profileFrameDraw <> nil) then profileFrameDraw.mainEnd(); // map rendering
end;
end;
if (profileFrameDraw = nil) then profileFrameDraw := TProfiler.Create('RENDER', g_profile_history_size);
- profileFrameDraw.mainBegin(g_profile_frame_draw);
+ if (profileFrameDraw <> nil) then profileFrameDraw.mainBegin(g_profile_frame_draw);
gPlayerDrawn := p;
px: Integer = -1;
py: Integer = -1;
begin
- if g_profile_frame_draw then px := px-drawProfiles(px, py, profileFrameDraw);
- if g_profile_collision then begin px := px-drawProfiles(px, py, profMapCollision); py -= calcProfilesHeight(profMonsLOS); end;
- if g_profile_los then begin px := px-drawProfiles(px, py, profMonsLOS); py -= calcProfilesHeight(profMonsLOS); end;
+ if g_profile_frame_draw and (profileFrameDraw <> nil) then px := px-drawProfiles(px, py, profileFrameDraw);
+ if g_profile_collision and (profMapCollision <> nil) then begin px := px-drawProfiles(px, py, profMapCollision); py -= calcProfilesHeight(profMonsLOS); end;
+ if g_profile_los and (profMonsLOS <> nil) then begin px := px-drawProfiles(px, py, profMonsLOS); py -= calcProfilesHeight(profMonsLOS); end;
end;
procedure g_Game_Draw();
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 3b2ad4ca4d927e35096756e5ad702226b56664b2..4e347ef549b1aceaec2e9e27d9025e1956c8a20a 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
procedure g_Map_ProfilersBegin ();
begin
if (profMapCollision = nil) then profMapCollision := TProfiler.Create('COLSOLID', g_profile_history_size);
- profMapCollision.mainBegin(g_profile_collision);
+ if (profMapCollision <> nil) then profMapCollision.mainBegin(g_profile_collision);
// create sections
- if g_profile_collision then
+ if g_profile_collision and (profMapCollision <> nil) then
begin
profMapCollision.sectionBegin('*solids');
profMapCollision.sectionEnd();
index 4cba5acb10b21bd2487e25d577e7a4611455449a..e496521d4485a3ada649639ff4b7ebec96ae0bcf 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
procedure g_Mons_ProfilersBegin ();
begin
if (profMonsLOS = nil) then profMonsLOS := TProfiler.Create('LOS CALC', g_profile_history_size);
- profMonsLOS.mainBegin(g_profile_los);
- if g_profile_los then
+ if (profMonsLOS <> nil) then profMonsLOS.mainBegin(g_profile_los);
+ if g_profile_los and (profMonsLOS <> nil) then
begin
profMonsLOS.sectionBegin('loscalc');
profMonsLOS.sectionEnd();
procedure g_Mons_ProfilersEnd ();
begin
- if (profMonsLOS <> nil) and (g_profile_los) then profMapCollision.mainEnd();
+ if (profMonsLOS <> nil) and (g_profile_los) then profMonsLOS.mainEnd();
end;
procedure g_Mons_LOS_Start (); inline;
begin
- profMonsLOS.sectionBeginAccum('loscalc');
+ if (profMonsLOS <> nil) then profMonsLOS.sectionBeginAccum('loscalc');
end;
procedure g_Mons_LOS_End (); inline;
begin
- profMonsLOS.sectionEnd();
+ if (profMonsLOS <> nil) then profMonsLOS.sectionEnd();
end;