diff options
Diffstat (limited to 'src/core/common.h')
-rw-r--r-- | src/core/common.h | 22 |
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)\ |