mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 14:24:33 +01:00
Debugging code
This commit is contained in:
@@ -703,7 +703,7 @@ void FASTCALL GfxDrawSpriteRawMaskedSoftware(
|
||||
if (dpi.zoom_level != ZoomLevel{ 0 })
|
||||
{
|
||||
// TODO: Implement other zoom levels (probably not used though)
|
||||
assert(false);
|
||||
//assert(false); // TODO complete work for sofware zooming or revert change.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1138,3 +1138,23 @@ void ToggleWindowedMode()
|
||||
Config::Get().general.FullscreenMode = targetMode;
|
||||
Config::Save();
|
||||
}
|
||||
|
||||
void DebugDPI(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawPixelInfo unzoomed = dpi;
|
||||
unzoomed.zoom_level = ZoomLevel{ 0 };
|
||||
unzoomed.x = dpi.zoom_level.ApplyInversedTo(dpi.x);
|
||||
unzoomed.y = dpi.zoom_level.ApplyInversedTo(dpi.y);
|
||||
unzoomed.width = dpi.zoom_level.ApplyInversedTo(dpi.width);
|
||||
unzoomed.height = dpi.zoom_level.ApplyInversedTo(dpi.height);
|
||||
|
||||
ScreenCoordsXY topLeft = { unzoomed.x, unzoomed.y };
|
||||
ScreenCoordsXY topRight = { unzoomed.x + unzoomed.width - 1, unzoomed.y };
|
||||
ScreenCoordsXY bottomLeft = { unzoomed.x, unzoomed.y + unzoomed.height - 1 };
|
||||
ScreenCoordsXY bottomRight = { unzoomed.x + unzoomed.width - 1, unzoomed.y + unzoomed.height - 1 };
|
||||
GfxDrawLine(unzoomed, { topLeft, bottomRight }, PALETTE_INDEX_129);
|
||||
GfxDrawLine(unzoomed, { topLeft, topRight }, PALETTE_INDEX_129);
|
||||
GfxDrawLine(unzoomed, { topRight, bottomRight }, PALETTE_INDEX_129);
|
||||
GfxDrawLine(unzoomed, { bottomLeft, bottomRight }, PALETTE_INDEX_129);
|
||||
GfxDrawLine(unzoomed, { topLeft, bottomLeft }, PALETTE_INDEX_129);
|
||||
}
|
||||
@@ -633,4 +633,6 @@ void UpdatePaletteEffects();
|
||||
void RefreshVideo();
|
||||
void ToggleWindowedMode();
|
||||
|
||||
void DebugDPI(DrawPixelInfo& dpi);
|
||||
|
||||
#include "NewDrawing.h"
|
||||
|
||||
@@ -1127,6 +1127,7 @@ static void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const Sc
|
||||
else
|
||||
{
|
||||
ViewportPaintColumn(*session);
|
||||
DebugDPI(session->DPI); // TODO. Debug change. Revert.
|
||||
}
|
||||
}
|
||||
if (useParallelDrawing)
|
||||
@@ -2081,12 +2082,14 @@ void ViewportSetSavedView()
|
||||
|
||||
ZoomLevel ZoomLevel::min()
|
||||
{
|
||||
#ifndef DISABLE_OPENGL
|
||||
if (drawing_engine_get_type() == DrawingEngine::OpenGL)
|
||||
{
|
||||
return ZoomLevel{ -2 };
|
||||
}
|
||||
#endif
|
||||
|
||||
return ZoomLevel{ 0 };
|
||||
// TODO complete work for sofware zooming or revert change.
|
||||
return ZoomLevel{ -2 };
|
||||
// #ifndef DISABLE_OPENGL
|
||||
// if (drawing_engine_get_type() == DrawingEngine::OpenGL)
|
||||
// {
|
||||
// return ZoomLevel{ -2 };
|
||||
// }
|
||||
// #endif
|
||||
//
|
||||
// return ZoomLevel{ 0 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user