From f85b5e99edfb2e1b9a4563cacc96892195eee379 Mon Sep 17 00:00:00 2001 From: erorcun Date: Sat, 16 Jan 2021 16:44:59 +0300 Subject: Includes overhaul, fix some compiler warnings --- src/core/common.h | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'src/core/common.h') diff --git a/src/core/common.h b/src/core/common.h index 2391f5fb..7fdbdf69 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -11,17 +11,34 @@ #include #include -#if defined _WIN32 && defined WITHWINDOWS -#include +#if !defined RW_D3D9 && defined LIBRW +#undef WITHD3D +#undef WITHDINPUT +#endif + +#if (defined WITHD3D && !defined LIBRW) +#define WITHWINDOWS #endif -#if defined _WIN32 && defined WITHD3D +#if defined _WIN32 && defined WITHWINDOWS && !defined _INC_WINDOWS #include -#ifndef USE_D3D9 -#include -#else -#include #endif + +#ifdef WITHD3D + #ifdef LIBRW + #define WITH_D3D // librw includes d3d9 itself via this right now + #else + #ifndef USE_D3D9 + #include + #else + #include + #endif + #endif +#endif + +#ifdef WITHDINPUT +#define DIRECTINPUT_VERSION 0x0800 +#include #endif #include @@ -52,14 +69,6 @@ #define rwVENDORID_ROCKSTAR 0x0253F2 -// Get rid of bullshit windows definitions, we're not running on an 8086 -#ifdef far -#undef far -#endif -#ifdef near -#undef near -#endif - #define Max(a,b) ((a) > (b) ? (a) : (b)) #define Min(a,b) ((a) < (b) ? (a) : (b)) -- cgit v1.2.3 From 13507d422ba9cf9a17d0ae9cc0f7ec0052e1d6b6 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 23 Jan 2021 18:56:27 +0200 Subject: Add PSP scaling macros --- src/core/common.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/common.h') diff --git a/src/core/common.h b/src/core/common.h index 349392f4..fbc28225 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -200,6 +200,13 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w) #define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x) #endif +#define PSP_DEFAULT_SCREEN_WIDTH (480) +#define PSP_DEFAULT_SCREEN_HEIGHT (272) +#define PSP_SCREEN_SCALE_X(a) SCREEN_SCALE_AR(SCREEN_STRETCH_X(a * ((float)DEFAULT_SCREEN_WIDTH / PSP_DEFAULT_SCREEN_WIDTH))) +#define PSP_SCREEN_SCALE_Y(a) SCREEN_STRETCH_Y(a* ((float)DEFAULT_SCREEN_HEIGHT / PSP_DEFAULT_SCREEN_HEIGHT)) +#define PSP_SCREEN_SCALE_FROM_RIGHT(a) (SCREEN_WIDTH - PSP_SCREEN_SCALE_X(a)) +#define PSP_SCREEN_SCALE_FROM_BOTTOM(a) (SCREEN_HEIGHT - PSP_SCREEN_SCALE_Y(a)) + #include "maths.h" #include "Vector.h" #include "Vector2D.h" -- cgit v1.2.3