diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-04-19 18:34:08 +0200 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-04-20 18:18:46 +0200 |
commit | 370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96 (patch) | |
tree | 5f5c66a542d7a121a7db88fed66e31f2a263b206 /src/core/common.h | |
parent | Merge pull request #474 from Nick007J/master (diff) | |
download | re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.gz re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.bz2 re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.lz re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.xz re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.zst re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/common.h | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/core/common.h b/src/core/common.h index 454b848a..46b4d03a 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -12,7 +12,7 @@ #include <math.h> #ifdef WITHWINDOWS -#include <Windows.h> +#include <windows.h> #endif #ifdef WITHD3D @@ -42,12 +42,8 @@ #undef near #endif -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif +#define Max(a,b) ((a) > (b) ? (a) : (b)) +#define Min(a,b) ((a) < (b) ? (a) : (b)) typedef uint8_t uint8; typedef int8_t int8; @@ -62,7 +58,7 @@ typedef int64_t int64; typedef uint16_t wchar; #ifndef nil -#define nil nullptr +#define nil NULL #endif #include "config.h" @@ -276,7 +272,7 @@ class CTweakFunc : public CTweakVar void (*m_pFunc)(); public: CTweakFunc(void (*pFunc)(), const char *strName, const char *strPath) : - m_pFunc(pFunc), m_pVarName(strName), m_pPath(strPath) + m_pPath(strPath), m_pVarName(strName), m_pFunc(pFunc) { CTweakVars::Add(this); } @@ -290,7 +286,7 @@ class CTweakBool : public CTweakVar bool *m_pBoolVar; public: CTweakBool(bool *pBool, const char *strName, const char *strPath) : - m_pBoolVar(pBool), m_pVarName(strName), m_pPath(strPath) + m_pPath(strPath), m_pVarName(strName), m_pBoolVar(pBool) { CTweakVars::Add(this); } @@ -306,9 +302,10 @@ class CTweakSwitch : public CTweakVar const char **m_aStr; void (*m_pFunc)(); public: - CTweakSwitch(void *pInt, const char *strName, int32 nMin, int32 nMax, const char **aStr, void (*pFunc)(), const char *strPath) : - m_pVarName(strName), m_pPath(strPath), - m_aStr(aStr), m_pIntVar(pInt), m_nMin(nMin), m_nMax(nMax) + CTweakSwitch(void *pInt, const char *strName, int32 nMin, int32 nMax, const char **aStr, + void (*pFunc)(), const char *strPath) + : m_pPath(strPath), m_pVarName(strName), m_pIntVar(pInt), m_nMin(nMin), m_nMax(nMax), + m_aStr(aStr) { CTweakVars::Add(this); } @@ -316,22 +313,24 @@ public: void AddDBG(const char *path); }; -#define _TWEEKCLASS(name, type) \ -class name : public CTweakVar \ -{ \ -public: \ - const char *m_pPath, *m_pVarName; \ - type *m_pIntVar, m_nLoawerBound, m_nUpperBound, m_nStep; \ - \ - name(type *pInt, const char *strName, type nLower, type nUpper, type nStep, const char *strPath) : \ - m_pIntVar(pInt), m_nLoawerBound(nLower), m_nUpperBound(nUpper), m_nStep(nStep), \ - m_pVarName(strName), m_pPath(strPath) \ - { \ - CTweakVars::Add(this); \ - } \ - \ - void AddDBG(const char *path); \ -}; +#define _TWEEKCLASS(name, type) \ + class name : public CTweakVar \ + { \ + public: \ + const char *m_pPath, *m_pVarName; \ + type *m_pIntVar, m_nLoawerBound, m_nUpperBound, m_nStep; \ + \ + name(type *pInt, const char *strName, type nLower, type nUpper, type nStep, \ + const char *strPath) \ + : m_pPath(strPath), m_pVarName(strName), m_pIntVar(pInt), \ + m_nLoawerBound(nLower), m_nUpperBound(nUpper), m_nStep(nStep) \ + \ + { \ + CTweakVars::Add(this); \ + } \ + \ + void AddDBG(const char *path); \ + }; _TWEEKCLASS(CTweakInt8, int8); _TWEEKCLASS(CTweakUInt8, uint8); |