From: Neal Gompa Date: Wed, 12 May 2010 22:43:19 +0000 (-0500) Subject: Made initial fixes towards building in MinGW for 32-bit Windows X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=05bb66bd0e8da7c6d4ace54a6af58ce625bac2f6;p=lugaru.git Made initial fixes towards building in MinGW for 32-bit Windows --- diff --git a/Source/Game.h b/Source/Game.h index cbd7090..b915f81 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -22,6 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _GAME_H_ #define _GAME_H_ +#if USE_SDL +#include "SDL.h" +#endif + #if (defined(__APPLE__) && defined(__MACH__)) # ifdef PLATFORM_MACOSX # error Do not define PLATFORM_MACOSX for new builds. It is for the old Carbonized build. @@ -38,10 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "TGALoader.h" -#if USE_SDL -#include "SDL.h" -#endif - #if !PLATFORM_MACOSX #include "WinInput.h" #else diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 118a7b5..476a854 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -1031,7 +1031,7 @@ void Game::InitGame() char tempstring[256]; #if defined(__APPLE__) sprintf (tempstring, "%s", registrationname); - #elif defined(_MSC_VER) || defined(__linux__) + #elif defined(_WIN32) || defined(__linux__) sprintf (tempstring, "%s-windows", registrationname); #else #error Please make sure you have the right registration key stuff here! diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 691fa56..1212558 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -236,7 +236,12 @@ void Screenshot (void) struct tm *tme = localtime(&t); sprintf(temp, "Screenshots\\Screenshot_%04d_%02d_%02d--%02d_%02d_%02d.png", tme->tm_year + 1900, tme->tm_mon + 1, tme->tm_mday, tme->tm_hour, tme->tm_min, tme->tm_sec); + #if defined(_WIN32) + mkdir("Screenshots"); + #else mkdir("Screenshots", S_IRWXU); + #endif + ScreenShot(temp/*"Screenshots\\Screenshot.png"*/); /*FSSpec MAC_file; @@ -3250,7 +3255,7 @@ void Game::Tick() char tempstring[256]; #if defined(__APPLE__) sprintf (tempstring, "%s", registrationname); - #elif defined(_MSC_VER) || defined(__linux__) + #elif defined(_WIN32) || defined(__linux__) sprintf (tempstring, "%s-windows", registrationname); #else #error Please make sure you have the right registration key stuff here! diff --git a/Source/Globals.cpp b/Source/Globals.cpp index b40ace0..b7b4fc9 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if USE_SDL +#include "SDL.h" +#endif + #include "gamegl.h" #include "Quaternions.h" #include "Lights.h" @@ -35,10 +39,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Constants.h" -#if USE_SDL -#include "SDL.h" -#endif - bool visibleloading = 0; FSOUND_SAMPLE *samp[100] = {0}; FSOUND_STREAM * strm[20] = {0}; diff --git a/Source/Models.cpp b/Source/Models.cpp index b006c6d..1eae468 100644 --- a/Source/Models.cpp +++ b/Source/Models.cpp @@ -19,9 +19,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "Game.h" #include "Models.h" //#include "altivec.h" -#include "Game.h" extern float multiplier; extern float viewdistance; @@ -31,7 +31,6 @@ extern float texdetail; extern bool decals; extern int loadscreencolor; -#include "Game.h" extern Game * pgame; extern bool visibleloading; //Functions diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index fd44de1..057ea9d 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /**> HEADER FILES <**/ +#include "Game.h" #include "Skeleton.h" extern float multiplier; @@ -46,7 +47,6 @@ extern int tutoriallevel; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; -#include "Game.h" extern Game * pgame; extern bool visibleloading; extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 7a78d7b..e56f681 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -19,9 +19,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "Game.h" #include "Terrain.h" #include "Objects.h" -#include "Game.h" extern XYZ viewer; extern float viewdistance; extern float lightambient[3],lightbrightness[3];