summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ef67a1b)
raw | patch | inline | side by side (parent: ef67a1b)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 3 Sep 2017 15:26:24 +0000 (18:26 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 3 Sep 2017 15:35:43 +0000 (18:35 +0300) |
src/game/g_holmes.pas | patch | blob | history | |
src/game/g_map.pas | patch | blob | history | |
src/game/g_panel.pas | patch | blob | history |
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 9f98ca3172d7c9588605a5d5115aebe4db45f114..a534e7a3919ec48467373a5df82975b55632ed91 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
msY: Integer = -666;
msB: Word = 0; // button state
kbS: Word = 0; // keyboard modifiers state
- showGrid: Boolean = false;
+ showGrid: Boolean = {$IF DEFINED(D2F_DEBUG)}true{$ELSE}false{$ENDIF};
showMonsInfo: Boolean = false;
showMonsLOS2Plr: Boolean = false;
showAllMonsCells: Boolean = false;
showOutlineWindow: Boolean = false;
showTriggers: Boolean = {$IF DEFINED(D2F_DEBUG)}false{$ELSE}false{$ENDIF};
+
// ////////////////////////////////////////////////////////////////////////// //
{$INCLUDE g_holmes.inc}
{$INCLUDE g_holmes_ui.inc}
laserSet: Boolean = false;
laserX0, laserY0, laserX1, laserY1: Integer;
monMarkedUID: Integer = -1;
+ platMarkedGUID: Integer = -1;
procedure g_Holmes_plrView (viewPortX, viewPortY, viewPortW, viewPortH: Integer);
monsGrid.forEachBodyCell(mon.proxyId, hilightCell);
end;
+ procedure drawSelectedPlatformCells ();
+ var
+ pan: TPanel;
+ begin
+ if not showGrid then exit;
+ pan := g_Map_PanelByGUID(platMarkedGUID);
+ if (pan = nil) then exit;
+ mapGrid.forEachBodyCell(pan.proxyId, hilightCell);
+ drawRect(pan.x, pan.y, pan.width, pan.height, 0, 200, 0, 200);
+ end;
+
procedure drawTrigger (var trig: TTrigger);
procedure drawPanelDest (pguid: Integer);
end;
end;
- if showAllMonsCells then g_Mons_ForEach(highlightAllMonsterCells);
+ if showAllMonsCells and showGrid then g_Mons_ForEach(highlightAllMonsterCells);
if showTriggers then drawTriggers();
+ if showGrid then drawSelectedPlatformCells();
glPopMatrix();
// ////////////////////////////////////////////////////////////////////////// //
procedure bcOneMonsterThinkStep (); begin gmon_debug_think := false; gmon_debug_one_think_step := true; end;
+procedure bcOneMPlatThinkStep (); begin g_dbgpan_mplat_active := false; g_dbgpan_mplat_step := true; end;
+procedure bcMPlatToggle (); begin g_dbgpan_mplat_active := not g_dbgpan_mplat_active; end;
+
procedure bcToggleMonsterInfo (arg: Integer=-1); begin if (arg < 0) then showMonsInfo := not showMonsInfo else showMonsInfo := (arg > 0); end;
procedure bcToggleMonsterLOSPlr (arg: Integer=-1); begin if (arg < 0) then showMonsLOS2Plr := not showMonsLOS2Plr else showMonsLOS2Plr := (arg > 0); end;
procedure bcToggleMonsterCells (arg: Integer=-1); begin if (arg < 0) then showAllMonsCells := not showAllMonsCells else showAllMonsCells := (arg > 0); end;
function wallToggle (pan: TPanel; tag: Integer): Boolean;
begin
result := false; // don't stop
+ if (platMarkedGUID = -1) then platMarkedGUID := pan.guid;
e_LogWritefln('wall #%d(%d); enabled=%d (%d); (%d,%d)-(%d,%d)', [pan.arrIdx, pan.proxyId, Integer(pan.Enabled), Integer(mapGrid.proxyEnabled[pan.proxyId]), pan.X, pan.Y, pan.Width, pan.Height]);
dumpPublishedProperties(pan);
end;
f: Integer;
trig: PTrigger;
begin
+ platMarkedGUID := -1;
e_WriteLog('=== TOGGLE WALL ===', MSG_NOTIFY);
mapGrid.forEachAtPoint(pmsCurMapX, pmsCurMapY, wallToggle, (GridTagWall or GridTagDoor));
e_WriteLog('--- toggle wall ---', MSG_NOTIFY);
cmdAdd('mon_cells', bcToggleMonsterCells, 'toggle "show all cells occupied by monsters" (SLOW!)', 'monster control');
cmdAdd('mon_wakeup', bcMonsterWakeup, 'toggle "show all cells occupied by monsters" (SLOW!)', 'monster control');
+ cmdAdd('mplat_step', bcOneMPlatThinkStep, 'one mplat think step', 'mplat control');
+ cmdAdd('mplat_toggle', bcMPlatToggle, 'activate/deactivate moving platforms', 'mplat control');
+
cmdAdd('plr_teleport', bcPlayerTeleport, 'teleport player', 'player control');
cmdAdd('dbg_curpos', bcToggleCurPos, 'toggle "show cursor position on the map"', 'various');
keybindAdd('M-G', 'mon_cells');
keybindAdd('M-A', 'mon_wakeup');
+ keybindAdd('M-P', 'mplat_step');
+ keybindAdd('M-O', 'mplat_toggle');
+
keybindAdd('C-T', 'plr_teleport');
keybindAdd('C-P', 'dbg_curpos');
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index ae8ee105f42f3bc783b26d62a6ec4ac7ff08d70f..4b197e3ec74bf4e2ddbec3750e4624798ab307ab 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
end;
begin
+ if g_dbgpan_mplat_step then g_dbgpan_mplat_active := true;
+
UpdatePanelArray(gWalls);
UpdatePanelArray(gRenderBackgrounds);
UpdatePanelArray(gRenderForegrounds);
UpdatePanelArray(gAcid2);
UpdatePanelArray(gSteps);
+ if g_dbgpan_mplat_step then begin g_dbgpan_mplat_step := false; g_dbgpan_mplat_active := false; end;
+
if gGameSettings.GameMode = GM_CTF then
begin
for a := FLAG_RED to FLAG_BLUE do
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 041a142b3865f54926ca6b81ba14877e1b249f06..ffd7c50ffc52fa8e093598b6fb62911aafc004b8 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
TPanelArray = Array of TPanel;
+var
+ g_dbgpan_mplat_active: Boolean = {$IF DEFINED(D2F_DEBUG)}false{$ELSE}true{$ENDIF};
+ g_dbgpan_mplat_step: Boolean = false; // one step, and stop
+
+
implementation
uses
FCurFrameCount := FTextureIDs[FCurTexture].AnTex.CurrentCounter;
end;
- if mMovingActive and (not mMovingSpeed.isZero) then
+ if mMovingActive and (not mMovingSpeed.isZero) and g_dbgpan_mplat_active then
begin
monMoveListUsed := 0;
nx := X+mMovingSpeed.X;