X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_game.pas;h=f1dd84fe5988eb8e0162adca742d0137925c5ede;hb=16e6289eea5bcd1029365aea672a92b4f5c71c19;hp=ff4006bd8dc3f3b154c33fcd2a0ca83e73b94660;hpb=ef5f8a60d55c94c5c0e0b4f556867dc0ad9c2c44;p=d2df-sdl.git diff --git a/src/game/g_game.pas b/src/game/g_game.pas index ff4006b..f1dd84f 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -313,6 +313,7 @@ var g_profile_frame_update: Boolean = false; g_profile_frame_draw: Boolean = false; g_profile_collision: Boolean = false; + g_profile_history_size: Integer = 1000; procedure g_ResetDynlights (); procedure g_AddDynLight (x, y, radius: Integer; r, g, b, a: Single); @@ -474,7 +475,7 @@ function drawProfiles (x, y: Integer; prof: TProfiler): Integer; var wdt, hgt: Integer; yy: Integer; - ii, idx: Integer; + ii: Integer; begin result := 0; if (prof = nil) then exit; @@ -2749,7 +2750,7 @@ begin Exit; end; - if (profileFrameDraw = nil) then profileFrameDraw := TProfiler.Create('MAP RENDER'); + if (profileFrameDraw = nil) then profileFrameDraw := TProfiler.Create('MAP RENDER', g_profile_history_size); profileFrameDraw.mainBegin(g_profile_frame_draw); gPlayerDrawn := p; @@ -5016,39 +5017,69 @@ var begin //if not gDebugMode then exit; cmd := LowerCase(P[0]); - if cmd = 'dpp' then + + if cmd = 'pf_draw_frame' then begin g_profile_frame_draw := not g_profile_frame_draw; exit; end; - if cmd = 'dpu' then + + if cmd = 'pf_update_frame' then begin g_profile_frame_update := not g_profile_frame_update; exit; end; - if cmd = 'dpc' then + + if cmd = 'pf_coldet' then begin g_profile_collision := not g_profile_collision; exit; end; - if cmd = 'r_draw_grid' then + + if cmd = 'r_sq_draw' then + begin + case getBool(1) of + -1: begin end; + 0: gdbg_map_use_accel_render := false; + 1: gdbg_map_use_accel_render := true; + end; + if gdbg_map_use_accel_render then g_Console_Add('accelerated rendering: tan') else g_Console_Add('accelerated rendering: ona'); + exit; + end; + + if cmd = 'dbg_sq_coldet' then begin case getBool(1) of -1: begin end; - 0: gdbg_map_use_grid_render := false; - 1: gdbg_map_use_grid_render := true; + 0: gdbg_map_use_accel_coldet := false; + 1: gdbg_map_use_accel_coldet := true; end; - if gdbg_map_use_grid_render then g_Console_Add('grid rendering: tan') else g_Console_Add('grid rendering: ona'); + if gdbg_map_use_accel_coldet then g_Console_Add('accelerated coldet: tan') else g_Console_Add('accelerated coldet: ona'); + exit; + end; + + if (cmd = 'sq_use_grid') or (cmd = 'sq_use_tree') then + begin + gdbg_map_use_tree_coldet := (cmd = 'sq_use_tree'); + if gdbg_map_use_tree_coldet then g_Console_Add('coldet acceleration: tree') else g_Console_Add('coldet acceleration: grid'); exit; end; - if cmd = 'dbg_coldet_grid' then + + if (cmd = 'r_sq_use_grid') or (cmd = 'r_sq_use_tree') then + begin + gdbg_map_use_tree_draw := (cmd = 'r_sq_use_tree'); + if gdbg_map_use_tree_draw then g_Console_Add('render acceleration: tree') else g_Console_Add('render acceleration: grid'); + exit; + end; + + if (cmd = 't_dump_node_queries') then begin case getBool(1) of -1: begin end; - 0: gdbg_map_use_grid_coldet := false; - 1: gdbg_map_use_grid_coldet := true; + 0: gdbg_map_dump_coldet_tree_queries := false; + 1: gdbg_map_dump_coldet_tree_queries := true; end; - if gdbg_map_use_grid_coldet then g_Console_Add('grid coldet: tan') else g_Console_Add('grid coldet: ona'); + if gdbg_map_dump_coldet_tree_queries then g_Console_Add('grid coldet tree queries: tan') else g_Console_Add('grid coldet tree queries: ona'); exit; end; end; @@ -6906,6 +6937,18 @@ begin Exit; end; + s := LowerCase(Find_Param_Value(pars, '-dbg-mainwad')); + if (s <> '') then + begin + gDefaultMegawadStart := s; + end; + + s := LowerCase(Find_Param_Value(pars, '-dbg-mainwad-restore')); + if (s <> '') then + begin + gDefaultMegawadStart := DF_Default_Megawad_Start; + end; + // Start map when game loads: map := LowerCase(Find_Param_Value(pars, '-map')); if isWadPath(map) then