summaryrefslogtreecommitdiff
path: root/src/tools/asm/q3asm.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-11-03 00:06:23 +0000
committerTim Angus <tim@ngus.net>2007-11-03 00:06:23 +0000
commitc6a9027b7cf0d35401cae346b67ca95c5f55b4a1 (patch)
tree3e41bfc88a8fb845cff921ccd62f5b3489fee703 /src/tools/asm/q3asm.c
parent5c3429cb21861e253d9a80fa07f6487013c99109 (diff)
* Merge ioq3-r1204
Diffstat (limited to 'src/tools/asm/q3asm.c')
-rw-r--r--src/tools/asm/q3asm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/asm/q3asm.c b/src/tools/asm/q3asm.c
index 4f4c9a37..1ac2939e 100644
--- a/src/tools/asm/q3asm.c
+++ b/src/tools/asm/q3asm.c
@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
+#include "../../qcommon/q_platform.h"
#include "cmdlib.h"
#include "mathlib.h"
#include "../../qcommon/qfiles.h"
@@ -1401,6 +1402,17 @@ void WriteVmFile( void ) {
report( "Writing to %s\n", imageName );
+#ifdef Q3_BIG_ENDIAN
+ {
+ int i;
+
+ // byte swap the header
+ for ( i = 0 ; i < sizeof( vmHeader_t ) / 4 ; i++ ) {
+ ((int *)&header)[i] = LittleLong( ((int *)&header)[i] );
+ }
+ }
+#endif
+
CreatePath( imageName );
f = SafeOpenWrite( imageName );
SafeWrite( f, &header, headerSize );