summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f1ce4f)
raw | patch | inline | side by side (parent: 7f1ce4f)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 24 Aug 2017 16:16:34 +0000 (19:16 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 24 Aug 2017 16:17:05 +0000 (19:17 +0300) |
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 a2f74cdfe5c18f8b4568570408f869868916f396..02a46f2c4ab9cb90ae13a484b6b08ca7a590770f 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
if px > gMapInfo.Width-(gPlayerScreenSize.X div 2) then a := -gMapInfo.Width+gPlayerScreenSize.X;
if py > gMapInfo.Height-(gPlayerScreenSize.Y div 2) then b := -gMapInfo.Height+gPlayerScreenSize.Y;
- if gMapInfo.Width <= gPlayerScreenSize.X then a := 0;
- if gMapInfo.Height <= gPlayerScreenSize.Y then b := 0;
+ if (gMapInfo.Width = gPlayerScreenSize.X) then a := 0
+ else if (gMapInfo.Width < gPlayerScreenSize.X) then
+ begin
+ // hcenter
+ a := (gPlayerScreenSize.X-gMapInfo.Width) div 2;
+ end;
+
+ if (gMapInfo.Height = gPlayerScreenSize.Y) then b := 0
+ else if (gMapInfo.Height < gPlayerScreenSize.Y) then
+ begin
+ // vcenter
+ b := (gPlayerScreenSize.Y-gMapInfo.Height) div 2;
+ end;
if p.IncCam <> 0 then
begin
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index f0419bf49cf4314ad47ee168b1eb3fd78c87ad8a..b9da59dd6d2064a97120d49f7bca56425d8533b3 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
TPanelGrid = specialize TBodyGridBase<TPanel>;
var
- mapGrid: TPanelGrid = nil;
+ mapGrid: TPanelGrid = nil; // DO NOT USE! public for debugging only!
implementation
if (mapY1 < gMapInfo.Height-1) then mapY1 := gMapInfo.Height-1;
mapGrid := TPanelGrid.Create(mapX0-128, mapY0-128, mapX1-mapX0+1+128*2, mapY1-mapY0+1+128*2);
+ //mapGrid := TPanelGrid.Create(0, 0, gMapInfo.Width, gMapInfo.Height);
addPanelsToGrid(gWalls);
addPanelsToGrid(gRenderBackgrounds);
index 280dc56a386d93137f5a306d9037e4344b45ae74..8c2f2d7e399093feed5c4d58481ffe2ded58cf95 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
TMonsterGrid = specialize TBodyGridBase<TMonster>;
var
- monsGrid: TMonsterGrid = nil;
+ monsGrid: TMonsterGrid = nil; // DO NOT USE! public for debugging only!
var