@ -27,6 +27,7 @@
# include "minitext.h"
# include "missiles.h"
# include "nthread.h"
# include "options.h"
# include "panels/charpanel.hpp"
# include "plrmsg.h"
# include "qol/chatlog.h"
@ -1081,7 +1082,7 @@ int tileRows;
void DrawGame ( const Surface & fullOut , Point position )
{
// Limit rendering to the view area
const Surface & out = zoomflag
const Surface & out = ! * sgOptions . Graphics . zoom
? fullOut . subregionY ( 0 , gnViewportHeight )
: fullOut . subregionY ( 0 , ( gnViewportHeight + 1 ) / 2 ) ;
@ -1100,7 +1101,7 @@ void DrawGame(const Surface &fullOut, Point position)
// Skip rendering parts covered by the panels
if ( CanPanelsCoverView ( ) ) {
if ( zoomflag ) {
if ( ! * sgOptions . Graphics . zoom ) {
if ( IsLeftPanelOpen ( ) ) {
position + = Displacement ( Direction : : East ) * 2 ;
columns - = 4 ;
@ -1175,7 +1176,7 @@ void DrawGame(const Surface &fullOut, Point position)
DrawFloor ( out , position , { sx , sy } , rows , columns ) ;
DrawTileContent ( out , position , { sx , sy } , rows , columns ) ;
if ( ! zoomflag ) {
if ( * sgOptions . Graphics . zoom ) {
Zoom ( fullOut . subregionY ( 0 , gnViewportHeight ) ) ;
}
}
@ -1209,11 +1210,11 @@ void DrawView(const Surface &out, Point startPosition)
Point pixelCoords = m . second ;
if ( megaTiles )
pixelCoords + = Displacement { 0 , TILE_HEIGHT / 2 } ;
if ( ! zoomflag )
if ( * sgOptions . Graphics . zoom )
pixelCoords * = 2 ;
if ( debugGridTextNeeded & & GetDebugGridText ( dunCoords , debugGridTextBuffer ) ) {
Size tileSize = { TILE_WIDTH , TILE_HEIGHT } ;
if ( ! zoomflag )
if ( * sgOptions . Graphics . zoom )
tileSize * = 2 ;
DrawString ( out , debugGridTextBuffer , { pixelCoords - Displacement { 0 , tileSize . height } , tileSize } , UiFlags : : ColorRed | UiFlags : : AlignCenter | UiFlags : : VerticalCenter ) ;
}
@ -1239,7 +1240,7 @@ void DrawView(const Surface &out, Point startPosition)
Displacement hor = { TILE_WIDTH / 2 , 0 } ;
Displacement ver = { 0 , TILE_HEIGHT / 2 } ;
if ( ! zoomflag ) {
if ( * sgOptions . Graphics . zoom ) {
hor * = 2 ;
ver * = 2 ;
}
@ -1453,7 +1454,7 @@ int RowsCoveredByPanel()
}
int rows = PANEL_HEIGHT / TILE_HEIGHT ;
if ( ! zoomflag ) {
if ( * sgOptions . Graphics . zoom ) {
rows / = 2 ;
}
@ -1468,7 +1469,7 @@ void CalcTileOffset(int *offsetX, int *offsetY)
int x ;
int y ;
if ( zoomflag ) {
if ( ! * sgOptions . Graphics . zoom ) {
x = screenWidth % TILE_WIDTH ;
y = viewportHeight % TILE_HEIGHT ;
} else {
@ -1499,7 +1500,7 @@ void TilesInView(int *rcolumns, int *rrows)
rows + + ;
}
if ( ! zoomflag ) {
if ( * sgOptions . Graphics . zoom ) {
// Half the number of tiles, rounded up
if ( ( columns & 1 ) ! = 0 ) {
columns + + ;
@ -1550,7 +1551,7 @@ void CalcViewportGeometry()
}
// Slightly lower the zoomed view
if ( ! zoomflag ) {
if ( * sgOptions . Graphics . zoom ) {
tileOffset . deltaY + = TILE_HEIGHT / 4 ;
if ( yo < TILE_HEIGHT / 4 )
tileRows + + ;