From: Ketmar Dark Date: Thu, 31 Aug 2017 01:38:09 +0000 (+0300) Subject: added "dbg_scale_half" experimental deBUG mode X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=2a9dada1550aeeb1ca055fb9f88952c930a64760;p=d2df-sdl.git added "dbg_scale_half" experimental deBUG mode --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index a22912b..03be57d 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -324,6 +324,8 @@ var g_rlayer_water: Boolean = true; g_rlayer_fore: Boolean = true; + g_dbg_scale_05: Boolean = false; + procedure g_ResetDynlights (); procedure g_AddDynLight (x, y, radius: Integer; r, g, b, a: Single); @@ -2794,7 +2796,14 @@ begin profileFrameDraw.sectionBegin('collect'); if gdbg_map_use_accel_render then begin - g_Map_CollectDrawPanels(sX, sY, sWidth, sHeight); + if g_dbg_scale_05 then + begin + g_Map_CollectDrawPanels(sX, sY, sWidth*2, sHeight*2); + end + else + begin + g_Map_CollectDrawPanels(sX, sY, sWidth, sHeight); + end; end; profileFrameDraw.sectionEnd(); @@ -2802,7 +2811,18 @@ begin g_Map_DrawBack(backXOfs, backYOfs); profileFrameDraw.sectionEnd(); - if (setTransMatrix) then glTranslatef(transX, transY, 0); + if (setTransMatrix) then + begin + if g_dbg_scale_05 then + begin + glScalef(0.5, 0.5, 1.0); + glTranslatef(transX, transY, 0); + end + else + begin + glTranslatef(transX, transY, 0); + end; + end; drawPanelType('*back', PANEL_BACK, g_rlayer_back); drawPanelType('*step', PANEL_STEP, g_rlayer_step); @@ -7010,4 +7030,6 @@ begin conRegVar('mon_think', @gmon_debug_think, 'enable/disable monster thinking', 'monster thinking', true); conRegVar('dbg_holmes', @g_holmes_enabled, 'enable/disable Holmes', 'Holmes', true); + + conRegVar('dbg_scale_half', @g_dbg_scale_05, 'experimental deBUG scale*0.5 mode', 'Scale0.5', true); end. diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas index dfa8a00..6b623f0 100644 --- a/src/game/g_holmes.pas +++ b/src/game/g_holmes.pas @@ -927,6 +927,7 @@ begin glScissor(0, gWinSizeY-gPlayerScreenSize.Y-1, vpw, vph); glPushMatrix(); + if g_dbg_scale_05 then glScalef(0.5, 0.5, 1.0); glTranslatef(-vpx, -vpy, 0); if (showGrid) then drawTileGrid(); diff --git a/src/game/g_items.pas b/src/game/g_items.pas index 672e481..253a031 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -630,7 +630,7 @@ begin with ggItems[i] do begin - if g_Collide(Obj.X, Obj.Y, Obj.Rect.Width, Obj.Rect.Height, sX, sY, sWidth, sHeight) then + if g_dbg_scale_05 or g_Collide(Obj.X, Obj.Y, Obj.Rect.Width, Obj.Rect.Height, sX, sY, sWidth, sHeight) then begin if (Animation = nil) then begin diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 5ec0099..79e3be3 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -2051,9 +2051,12 @@ begin o.Y+o.Rect.Y+o.Rect.Height-128, M_NONE); // Íå â îáëàñòè ðèñîâàíèÿ íå ðåñóåì: - if not g_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y, FObj.Rect.Width, FObj.Rect.Height, - sX-128, sY-128, sWidth+256, sHeight+256) then - Exit; + if not g_dbg_scale_05 then + begin + if not g_Collide(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y, FObj.Rect.Width, FObj.Rect.Height, + sX-128, sY-128, sWidth+256, sHeight+256) then + Exit; + end; // Ýòè ìîíñòðû, óìèðàÿ, íå îñòàâëÿþò òðóïîâ: if FState = MONSTATE_DEAD then diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index c562934..c46cf8c 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -272,8 +272,7 @@ var begin if {Enabled and} (FCurTexture >= 0) and (Width > 0) and (Height > 0) and (FAlpha < 255) and - g_Collide(X, Y, Width, Height, - sX, sY, sWidth, sHeight) then + (g_dbg_scale_05 or g_Collide(X, Y, Width, Height, sX, sY, sWidth, sHeight)) then begin if FTextureIDs[FCurTexture].Anim then begin // Àíèìèðîâàííàÿ òåêñòóðà