summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e20ff8)
raw | patch | inline | side by side (parent: 4e20ff8)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 26 Jan 2018 18:38:34 +0000 (20:38 +0200) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 26 Jan 2018 18:39:38 +0000 (20:39 +0200) |
src/game/g_game.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 4e33cad10f28e10a42aeb2709acff3725a37abbd..fcb43f319d324f9cf568c3d6abd04837aabd3ebe 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
if (sY+sHeight > gMapInfo.Height) then sY := gMapInfo.Height-sHeight;
if (sX < 0) then sX := 0;
if (sY < 0) then sY := 0;
+
+ if (gBackSize.X <= gPlayerScreenSize.X) or (gMapInfo.Width <= sWidth) then c := 0 else c := trunc((gBackSize.X-gPlayerScreenSize.X)*sX/(gMapInfo.Width-sWidth));
+ if (gBackSize.Y <= gPlayerScreenSize.Y) or (gMapInfo.Height <= sHeight) then d := 0 else d := trunc((gBackSize.Y-gPlayerScreenSize.Y)*sY/(gMapInfo.Height-sHeight));
end;
p.viewPortX := sX;
p.viewPortY := sY;