diff options
author | aap <aap@papnet.eu> | 2019-06-17 00:16:38 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-17 00:23:19 +0200 |
commit | 0add48abf589330ae6fe11e304c111d9f52ce009 (patch) | |
tree | e9f4374bf520a2fdfb9f3d66cd4ed0aa822a020b /src/common.h | |
parent | updated guidelines (diff) | |
download | re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar.gz re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar.bz2 re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar.lz re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar.xz re3-0add48abf589330ae6fe11e304c111d9f52ce009.tar.zst re3-0add48abf589330ae6fe11e304c111d9f52ce009.zip |
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/common.h b/src/common.h index a9055391..7d7e223c 100644 --- a/src/common.h +++ b/src/common.h @@ -31,22 +31,17 @@ #undef near #endif -typedef uint8_t uint8, UInt8; -typedef int8_t int8, Int8; -typedef uint16_t uint16, UInt16; -typedef int16_t int16, Int16; -typedef uint32_t uint32, UInt32; -typedef int32_t int32, Int32; +typedef uint8_t uint8; +typedef int8_t int8; +typedef uint16_t uint16; +typedef int16_t int16; +typedef uint32_t uint32; +typedef int32_t int32; typedef uintptr_t uintptr; -typedef uint64_t uint64, UInt64; -typedef int64_t int64, Int64; +typedef uint64_t uint64; +typedef int64_t int64; // hardcode ucs-2 -typedef uint16_t wchar, WChar; - -typedef float Float; -typedef double Double; -typedef bool Bool; -typedef char Char; +typedef uint16_t wchar; #define nil NULL @@ -68,13 +63,13 @@ extern void **rwengine; #define DEFAULT_SCREEN_WIDTH (640) #define DEFAULT_SCREEN_HEIGHT (448) -#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 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 @@ -163,6 +158,6 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con #define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc) #define VALIDATE_OFFSET(struc, member, offset) static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...") -#define PERCENT(x, p) ((Float(x) * (Float(p) / 100.0f))) +#define PERCENT(x, p) ((float(x) * (float(p) / 100.0f))) #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) #define BIT(num) (1<<(num)) |