GIT
/
REPO
/
FRED-BOY
Projects
/
d2df-sdl.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c260c0
)
gl: handle map bounds
author
DeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 9 Jun 2022 21:31:28 +0000
(
00:31
+0300)
committer
DeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 9 Jun 2023 08:42:20 +0000
(11:42 +0300)
src/game/renders/opengl/r_map.pas
patch
|
blob
|
history
diff --git
a/src/game/renders/opengl/r_map.pas
b/src/game/renders/opengl/r_map.pas
index 7cac17f0713f2a5c26623656e783075a6ddd5927..3ef4979ad1fadf181c8879a2cb7106b445fb863f 100644
(file)
--- a/
src/game/renders/opengl/r_map.pas
+++ b/
src/game/renders/opengl/r_map.pas
@@
-1165,7
+1165,19
@@
implementation
ww := w;
hh := h;
- // TODO lock camera at map bounds
+ if g_dbg_ignore_bounds = false then
+ begin
+ if xx + ww > gMapInfo.Width then
+ xx := gMapInfo.Width - ww;
+ if yy + hh > gMapInfo.Height then
+ yy := gMapInfo.Height - hh;
+ if xx < 0 then
+ xx := 0;
+ if yy < 0 then
+ yy := 0;
+ cx := xx - x;
+ cy := yy - y;
+ end;
// TODO draw paralax
if SkyTexture <> nil then
DEADSOFTWARE 2012-2025