DEADSOFTWARE

gl: fix particle size with r_scale_resolution>1
[d2df-sdl.git] / src / game / renders / opengl / r_map.pas
index 1d9a0f3caed772cdf073b79d83aa559b0c968435..eb69057102cc93d82fcbc59885aaac33f8a8acf7 100644 (file)
@@ -40,7 +40,7 @@ interface
 
   procedure r_Map_Update;
 
-  procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
+  procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer; out acx, acy: Integer);
 
 implementation
 
@@ -1110,15 +1110,16 @@ implementation
   end;
 
   procedure r_Map_DrawParticles (x, y, w, h: Integer);
-    var i, fx, fy: Integer;
+    var i, fx, fy: Integer; factor: Single;
   begin
     if gpart_dbg_enabled and (Particles <> nil) then
     begin
       r_Draw_EnableTexture2D(false);
-      if (g_dbg_scale < 0.6) then
+      factor := r_pixel_scale * g_dbg_scale;
+      if factor < 0.6 then
         glPointSize(1)
-      else if (g_dbg_scale > 1.3) then
-        glPointSize(g_dbg_scale + 1)
+      else if factor > 1.3 then
+        glPointSize(factor + 1)
       else
         glPointSize(2);
       glDisable(GL_POINT_SMOOTH);
@@ -1385,7 +1386,7 @@ implementation
     end;
   end;
 
-  procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
+  procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer; out acx, acy: 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);
@@ -1415,6 +1416,9 @@ implementation
         cy := 0;
     end;
 
+    acx := cx;
+    acy := cy;
+
     (* map bounds *)
     xx := cx;
     yy := cy;
@@ -1491,6 +1495,9 @@ implementation
     r_Map_DrawPanelType(PANEL_FORE);
     // TODO draw monsters health bar
     // TODO draw players health bar
+
+    r_Draw_SetRect(x, y, x + w, y + h);
+
     if gGameSettings.GameMode <> GM_SINGLE then
       r_Map_DrawPlayerIndicators(player, cx, cy, cw, ch);
     if DebugCameraScale <> 1.0 then