summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a399fa)
raw | patch | inline | side by side (parent: 8a399fa)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 23 Jan 2018 13:45:31 +0000 (15:45 +0200) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Tue, 23 Jan 2018 13:46:34 +0000 (15:46 +0200) |
src/game/g_game.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 29348b28c45600e074df7fe18b3dced0bbaa2b61..4e33cad10f28e10a42aeb2709acff3725a37abbd 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
gUseChatSounds: Boolean = True;
gChatSounds: Array of TChatSound;
+ g_dbg_ignore_bounds: Boolean = false;
+
// move button values:
// bits 0-1: l/r state:
// 0: neither left, nor right pressed
px := p.GameX + PLAYER_RECT_CX;
py := p.GameY + PLAYER_RECT_CY+p.Obj.slopeUpLeft;
- if (g_dbg_scale = 1.0) then
+ if (g_dbg_scale = 1.0) and (not g_dbg_ignore_bounds) then
begin
if (px > (gPlayerScreenSize.X div 2)) then a := -px+(gPlayerScreenSize.X div 2) else a := 0;
if (py > (gPlayerScreenSize.Y div 2)) then b := -py+(gPlayerScreenSize.Y div 2) else b := 0;
//conwritefln('OLD: (%s,%s)-(%s,%s)', [sX, sY, sWidth, sHeight]);
fixViewportForScale();
//conwritefln(' (%s,%s)-(%s,%s)', [sX, sY, sWidth, sHeight]);
+ if (g_dbg_scale <> 1.0) and (not g_dbg_ignore_bounds) then
+ begin
+ if (sX+sWidth > gMapInfo.Width) then sX := gMapInfo.Width-sWidth;
+ if (sY+sHeight > gMapInfo.Height) then sY := gMapInfo.Height-sHeight;
+ if (sX < 0) then sX := 0;
+ if (sY < 0) then sY := 0;
+ end;
p.viewPortX := sX;
p.viewPortY := sY;
p.viewPortW := sWidth;
conRegVar('dbg_holmes', @g_holmes_enabled, 'enable/disable Holmes', 'Holmes', true);
- conRegVar('dbg_scale', @g_dbg_scale, 0.01, 100.0, 'experimental deBUG scale mode', '', false);
+ conRegVar('dbg_ignore_level_bounds', @g_dbg_ignore_bounds, 'ignore level bounds', '', false);
+
+ conRegVar('r_scale', @g_dbg_scale, 0.01, 100.0, 'render scale', '', false);
conRegVar('light_enabled', @gwin_k8_enable_light_experiments, 'enable/disable dynamic lighting', 'lighting');
conRegVar('light_player_halo', @g_playerLight, 'enable/disable player halo', 'player light halo');