aboutsummaryrefslogtreecommitdiff
path: root/sp/src
diff options
context:
space:
mode:
authorJonas 'Sortie' Termansen <[email protected]>2013-08-11 10:47:17 +0200
committerJonas 'Sortie' Termansen <[email protected]>2013-08-12 23:00:05 +0200
commit82fe37f0e65202c46a4bfb786ee7b679885f4df5 (patch)
tree904aafefd122535a6d66a459216c9b9b0edbaa5a /sp/src
parentUse Q_strncpy in utils/vbsp/detailobjects.cpp. (diff)
downloadsource-sdk-2013-82fe37f0e65202c46a4bfb786ee7b679885f4df5.tar.xz
source-sdk-2013-82fe37f0e65202c46a4bfb786ee7b679885f4df5.zip
Fix bsp lump names being declared non-portably.
gcc issues warnings when encountering multicharacter constants, so we'll simply emulate them in a manner works portably. The code assumes we are using a little-endian machine - the real solution would be using using four chars instead of an enum.
Diffstat (limited to 'sp/src')
-rw-r--r--sp/src/public/gamebspfile.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sp/src/public/gamebspfile.h b/sp/src/public/gamebspfile.h
index 242d6ca9..786e0671 100644
--- a/sp/src/public/gamebspfile.h
+++ b/sp/src/public/gamebspfile.h
@@ -21,12 +21,14 @@
//-----------------------------------------------------------------------------
// This enumerations defines all the four-CC codes for the client lump names
//-----------------------------------------------------------------------------
+// TODO: We may have some endian considerations here!
+#define GAMELUMP_MAKE_CODE(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d) << 0)
enum
{
- GAMELUMP_DETAIL_PROPS = 'dprp',
- GAMELUMP_DETAIL_PROP_LIGHTING = 'dplt',
- GAMELUMP_STATIC_PROPS = 'sprp',
- GAMELUMP_DETAIL_PROP_LIGHTING_HDR = 'dplh',
+ GAMELUMP_DETAIL_PROPS = GAMELUMP_MAKE_CODE('d', 'p', 'r', 'p'),
+ GAMELUMP_DETAIL_PROP_LIGHTING = GAMELUMP_MAKE_CODE('d', 'p', 'l', 't'),
+ GAMELUMP_STATIC_PROPS = GAMELUMP_MAKE_CODE('s', 'p', 'r', 'p'),
+ GAMELUMP_DETAIL_PROP_LIGHTING_HDR = GAMELUMP_MAKE_CODE('d', 'p', 'l', 'h'),
};
// Versions...