summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/common.h57
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);