diff options
Diffstat (limited to 'src/tools/asm/q3asm.c')
-rw-r--r-- | src/tools/asm/q3asm.c | 12 |
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 ); |