-#include "StdAfx.h"
-#include "./dialogs/dialogs-gtk.h"
#include "bsploader.h"
-#include "../../libs/cmdlib.h"
+#include "dialogs/dialogs-gtk.h"
+#include "cmdlib.h"
int numnodes;
int numplanes;
LoadFile
==============
*/
-qboolean LoadFile( const char *filename, byte **bufferptr ){
+bool LoadFile( const char *filename, byte **bufferptr ){
FILE *f;
int length;
byte *buffer;
return true;
}
-/*int LittleLong (int l)
- {
- return l;
- }
+int LittleLong( int l ){
+#if defined( __BIG_ENDIAN__ )
+ std::reverse( reinterpret_cast<unsigned char*>( &l ), reinterpret_cast<unsigned char*>( &l ) + sizeof( int ) );
+#endif
+ return l;
+}
- float LittleFloat (float l)
- {
- return l;
- }*/
+float LittleFloat( float l ){
+#if defined( __BIG_ENDIAN__ )
+ std::reverse( reinterpret_cast<unsigned char*>( &l ), reinterpret_cast<unsigned char*>( &l ) + sizeof( float ) );
+#endif
+ return l;
+}
/*
=============
LoadBSPFile
=============
*/
-qboolean LoadBSPFile( const char *filename ) {
+bool LoadBSPFile( const char *filename ) {
dheader_t *header;
// load the file header
SwapBlock( (int *)header, sizeof( *header ) );
if ( header->ident != BSP_IDENT ) {
- DoMessageBox( "Cant find a valid IBSP file", "Error", MB_OK );
+ DoMessageBox( "Cant find a valid IBSP file", "Error", eMB_OK );
return false;
}
if ( ( header->version != Q3_BSP_VERSION ) &&
( header->version != WOLF_BSP_VERSION ) ) {
- DoMessageBox( "File is incorrect version", "Error", MB_OK );
+ DoMessageBox( "File is incorrect version", "Error", eMB_OK );
return false;
}