mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
engine: store scaling factor between physical and logical window size
This commit is contained in:
@@ -74,6 +74,9 @@ void R_SaveVideoMode( int w, int h, int render_w, int render_h, qboolean maximiz
|
||||
if( refState.width == render_w && refState.height == render_h )
|
||||
return;
|
||||
|
||||
refState.scale_x = (float)render_w / w;
|
||||
refState.scale_y = (float)render_h / h;
|
||||
|
||||
refState.width = render_w;
|
||||
refState.height = render_h;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ typedef struct ref_globals_s
|
||||
{
|
||||
qboolean developer;
|
||||
|
||||
// viewport width and height
|
||||
// viewport width and height (physical window size)
|
||||
int width;
|
||||
int height;
|
||||
|
||||
@@ -144,6 +144,10 @@ typedef struct ref_globals_s
|
||||
size_t visbytes; // cluster size
|
||||
|
||||
int desktopBitsPixel;
|
||||
|
||||
// scaling factor of physical window size compared to logical
|
||||
float scale_x;
|
||||
float scale_y;
|
||||
} ref_globals_t;
|
||||
|
||||
typedef struct ref_client_s
|
||||
|
||||
Reference in New Issue
Block a user