mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-17 02:24:07 +02:00
fixed #243
This commit is contained in:
12
src/level.h
12
src/level.h
@@ -1882,18 +1882,18 @@ struct Level : IGame {
|
||||
s.z += 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
|
||||
s.z -= s.x;
|
||||
s.w -= s.y;
|
||||
s.x += vp.x;
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user