1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-17 18:36:43 +02:00
This commit is contained in:
XProger
2020-02-29 02:07:12 +03:00
parent d511993605
commit bb740791af

View File

@@ -1882,18 +1882,18 @@ struct Level : IGame {
s.z += 2; s.z += 2;
s.w += 2; s.w += 2;
// clamp
s.x = max(s.x, vp.x);
s.y = max(s.y, vp.y);
s.z = min(s.z, short(vp.x + vp.z));
s.w = min(s.w, short(vp.y + vp.w));
// convert from bounds to x,y,w,h // convert from bounds to x,y,w,h
s.z -= s.x; s.z -= s.x;
s.w -= s.y; s.w -= s.y;
s.x += vp.x; s.x += vp.x;
s.y += vp.y; s.y += vp.y;
// clamp
s.x = max(s.x, vp.x);
s.y = max(s.y, vp.y);
s.z = min(s.z, vp.z);
s.w = min(s.w, vp.w);
return s; return s;
} }