summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-26 16:20:31 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-26 16:20:31 +0200
commit3dee880c2941417c9e5ec42297da65f27ab9c5ca (patch)
tree93f0daf6f0fdc04fb2898a202157d3d9ec078ffb /src/core/common.h
parentscript 500-599 (diff)
parentFix hornPatternsArray (diff)
downloadre3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar.gz
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar.bz2
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar.lz
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar.xz
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.tar.zst
re3-3dee880c2941417c9e5ec42297da65f27ab9c5ca.zip
Diffstat (limited to 'src/core/common.h')
-rw-r--r--src/core/common.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/core/common.h b/src/core/common.h
index 920b7108..a538ddb6 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -121,7 +121,7 @@ public:
CRGBA(void) { }
CRGBA(uint8 r, uint8 g, uint8 b, uint8 a) : r(r), g(g), b(b), a(a) { }
- CRGBA &CRGBA::operator =(const CRGBA &right)
+ CRGBA &operator =(const CRGBA &right)
{
this->r = right.r;
this->g = right.g;
@@ -142,7 +142,7 @@ public:
return rwRGBA;
}
- CRGBA &CRGBA::operator =(const RwRGBA &right)
+ CRGBA &operator =(const RwRGBA &right)
{
this->r = right.red;
this->g = right.green;
@@ -197,8 +197,6 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
#define BIT(num) (1<<(num))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-#define min(a, b) (((a) < (b)) ? (a) : (b))
#define ABS(a) (((a) < 0) ? (-(a)) : (a))
#define norm(value, min, max) (((value) < (min)) ? 0 : (((value) > (max)) ? 1 : (((value) - (min)) / ((max) - (min)))))
@@ -337,7 +335,7 @@ inline void SkipSaveBuf(uint8 *&buf, int32 skip)
template<typename T>
inline const T ReadSaveBuf(uint8 *&buf)
-{
+{
T &value = *(T*)buf;
SkipSaveBuf(buf, sizeof(T));
return value;
@@ -345,8 +343,8 @@ inline const T ReadSaveBuf(uint8 *&buf)
template<typename T>
inline T *WriteSaveBuf(uint8 *&buf, const T &value)
-{
- T *p = (T*)buf;
+{
+ T *p = (T*)buf;
*p = value;
SkipSaveBuf(buf, sizeof(T));
return p;
@@ -355,11 +353,11 @@ inline T *WriteSaveBuf(uint8 *&buf, const T &value)
#define SAVE_HEADER_SIZE (4*sizeof(char)+sizeof(uint32))
-#define WriteSaveHeader(buf,a,b,c,d,size) \
- WriteSaveBuf(buf, a);\
- WriteSaveBuf(buf, b);\
- WriteSaveBuf(buf, c);\
- WriteSaveBuf(buf, d);\
+#define WriteSaveHeader(buf,a,b,c,d,size) \
+ WriteSaveBuf(buf, a);\
+ WriteSaveBuf(buf, b);\
+ WriteSaveBuf(buf, c);\
+ WriteSaveBuf(buf, d);\
WriteSaveBuf(buf, size);
#define CheckSaveHeader(buf,a,b,c,d,size)\