summaryrefslogtreecommitdiffstats
path: root/src/render/Draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/render/Draw.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index db87e76d..4e323ec2 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -70,3 +70,14 @@ CDraw::SetFOV(float fov)
#endif
ms_fFOV = fov;
}
+
+#ifdef ASPECT_RATIO_SCALE
+float
+ScaleAndCenterX(float x)
+{
+ if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
+ return x;
+ else
+ return (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X(x);
+}
+#endif \ No newline at end of file