summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-06-20 02:31:03 +0200
committer_AG <gennariarmando@outlook.com>2019-06-20 02:32:36 +0200
commit2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd (patch)
tree4cbfefeedd462f46b29d4b1c9004f17eefebc364 /src/common.h
parentfinally finished CVehicleModelInfo (diff)
downloadre3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar.gz
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar.bz2
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar.lz
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar.xz
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.tar.zst
re3-2ce7bcc405daf1b01f9220e7b584bc7c318ec5cd.zip
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/common.h b/src/common.h
index 5552a5c2..0345b65c 100644
--- a/src/common.h
+++ b/src/common.h
@@ -56,6 +56,17 @@ extern void **rwengine;
#include "skel\skeleton.h"
#include "Draw.h"
+/*
+ { SCREEN_STRETCH } Done originally by the game for most of the printed stuff.
+ Stretches everything to screen avoiding it's aspect ratio.
+ Looks good only in 4:3.
+
+ { SCREEN_SCALE } Alternative to the one above, it's used in this project to scale
+ original content to a *DEFINED aspect ratio with the possibility to
+ set a multiplier and scale content differently.
+ In theory should look good on any screen.
+*/
+
#define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio())
#define SCREENW (RsGlobal.maximumWidth)
@@ -66,15 +77,16 @@ extern void **rwengine;
#define SCREEN_WIDTH float(RsGlobal.width)
#define SCREEN_HEIGHT float(RsGlobal.height)
#define SCREEN_STRETCH_X(a) float((a) * (SCREEN_WIDTH / float(DEFAULT_SCREEN_WIDTH)))
-#define SCREEN_STRETCH_X_AR(a) float((a) * (SCREEN_WIDTH / float(DEFAULT_SCREEN_WIDTH)) * (4.0/3.0f)/SCREEN_ASPECT_RATIO)
#define SCREEN_STRETCH_Y(a) float((a) * (SCREEN_HEIGHT / float(DEFAULT_SCREEN_HEIGHT)))
-#define SCREEN_FROM_RIGHT(a) float(SCREEN_WIDTH - SCREEN_STRETCH_X(a))
-#define SCREEN_FROM_BOTTOM(a) float(SCREEN_HEIGHT - SCREEN_STRETCH_Y(a))
-
-#define HUD_STRETCH_X SCREEN_STRETCH_X_AR
-#define HUD_STRETCH_Y SCREEN_STRETCH_Y
-#define HUD_FROM_RIGHT(a) (SCREEN_WIDTH - HUD_STRETCH_X(a))
-#define HUD_FROM_BOTTOM(a) (SCREEN_HEIGHT - HUD_STRETCH_Y(a))
+#define SCREEN_STRETCH_FROM_RIGHT(a) float(SCREEN_WIDTH - SCREEN_STRETCH_X(a))
+#define SCREEN_STRETCH_FROM_BOTTOM(a) float(SCREEN_HEIGHT - SCREEN_STRETCH_Y(a))
+
+#define SCREEN_MULTIPLIER (CDraw::GetScreenMult())
+#define SCREEN_SCALE(a) float((a) * (4.0f / 3.0f) / SCREEN_ASPECT_RATIO)
+#define SCREEN_SCALE_X(a) SCREEN_SCALE(SCREEN_STRETCH_X(a) * SCREEN_MULTIPLIER)
+#define SCREEN_SCALE_Y(a) (SCREEN_STRETCH_Y(a) * SCREEN_MULTIPLIER)
+#define SCREEN_SCALE_FROM_RIGHT(a) (SCREEN_WIDTH - SCREEN_SCALE_X(a))
+#define SCREEN_SCALE_FROM_BOTTOM(a) (SCREEN_HEIGHT - SCREEN_SCALE_Y(a))
#include "math/Vector.h"
#include "math/Vector2D.h"