summaryrefslogtreecommitdiffstats
path: root/src/render/Draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/Draw.cpp')
-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 ab360aac..131534a3 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -69,3 +69,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