summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 446340c)
raw | patch | inline | side by side (parent: 446340c)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 29 Dec 2022 00:30:31 +0000 (03:30 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 09:08:37 +0000 (12:08 +0300) |
src/game/renders/opengl/r_map.pas | patch | blob | history |
index a1d781c5bf7f502aee87e3691457fa14f9c97657..6b54fa3a4273f1fd738451366082640d45f38eee 100644 (file)
var
DebugCameraScale: Single;
+ FillOutsizeArea: Boolean;
SkyTexture: TGLTexture;
RenTextures: array of record
spec: LongInt;
end;
procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
- var iter: TPanelGrid.Iter; p: PPanel; cx, cy, cw, ch, xx, yy, ww, hh: Integer; sx, sy, sw, sh: LongInt; l, t, r, b: Integer;
+ var iter: TPanelGrid.Iter; p: PPanel; cx, cy, cw, ch, xx, yy, ww, hh, ml, mt, mr, mb, mcx, mcy: Integer; sx, sy, sw, sh: LongInt; l, t, r, b: Integer;
begin
r_Draw_GetRect(l, t, r, b);
- r_Draw_SetRect(x, y, x + w, y + h);
glTranslatef(x, y, 0);
(* camera rect *)
if yy < 0 then
yy := 0;
+ (* view bounds *)
+ ml := x; mt := y; mr := x + w; mb := y + h;
+ if FillOutsizeArea and (DebugCameraScale = 1.0) then
+ begin
+ ml := MAX(cx + ml, 0) - cx;
+ mt := MAX(cy + mt, 0) - cy;
+ mr := MIN(cx + mr, gMapInfo.Width - 1) - cx;
+ mb := MIN(cy + mb, gMapInfo.Height - 1) - cy;
+ end;
+ r_Draw_SetRect(ml, mt, mr, mb);
+
plist.Clear;
iter := mapGrid.ForEachInAABB(xx, yy, ww, hh, GridDrawableMask);
for p in iter do
initialization
conRegVar('r_debug_camera_scale', @DebugCameraScale, 0.0001, 1000.0, '', '');
+ conRegVar('r_gl_fill_outside', @FillOutsizeArea, '', '');
DebugCameraScale := 1.0;
+ FillOutsizeArea := true;
end.