]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Added GPL license and headers.
[lugaru.git] / Source / GameInitDispose.cpp
index 6cc47e68b49872ddb43c03afbd61ada4770bcded..00190a9fe0040e6f8a5a1bede498cf1a45274230 100644 (file)
@@ -1,3 +1,24 @@
+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+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"      
 extern float screenwidth,screenheight;
 extern float viewdistance;
@@ -89,7 +110,7 @@ extern float accountcampaigntime[10];
 extern int accountcampaignchoicesmade[10];
 extern int accountcampaignchoices[10][5000];
 
-extern FSOUND_STREAM * strm[10];
+extern FSOUND_STREAM * strm[20];
 
 extern "C"     void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
 extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
@@ -169,6 +190,9 @@ void Game::Dispose()
 
        FSOUND_StopSound(FSOUND_ALL);
 
+// this is causing problems on Linux, but we'll force an _exit() a little
+//  later in the shutdown process.  --ryan.
+#if !PLATFORM_LINUX
 #define streamcount 20
 #define samplecount 100
 
@@ -188,6 +212,7 @@ void Game::Dispose()
                free(texture.data);
        }
        texture.data = 0;
+#endif
 }
 
 
@@ -1004,8 +1029,14 @@ void Game::InitGame()
                                longnum=num2+num1*100000000;
 
                                char tempstring[256];
+                               #if defined(__APPLE__)
+                               sprintf (tempstring, "%s", registrationname);
+                               #elif defined(_MSC_VER) || defined(__linux__)
                                sprintf (tempstring, "%s-windows", registrationname);
-                               longnuma = MD5_string ( tempstring);    
+                               #else
+                               #error Please make sure you have the right registration key stuff here!
+                               #endif
+                               longnuma = MD5_string ( tempstring);
                                num1a = longnuma/100000000;
                                num2a = longnuma%100000000;
                                //if(num1a==num1&&num2a==num2)registered=1;