summaryrefslogtreecommitdiff
path: root/noncore/games/sfcave-sdl/game.cpp
Unidiff
Diffstat (limited to 'noncore/games/sfcave-sdl/game.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/sfcave-sdl/game.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/noncore/games/sfcave-sdl/game.cpp b/noncore/games/sfcave-sdl/game.cpp
index a644696..e41e510 100644
--- a/noncore/games/sfcave-sdl/game.cpp
+++ b/noncore/games/sfcave-sdl/game.cpp
@@ -78,5 +78,2 @@ void Game :: handleKeys( SDL_KeyboardEvent &key )
78 press = true; 78 press = true;
79
80 // if ( thrustChannel == -1 && parent->getState() == STATE_PLAYING )
81 // thrustChannel = SoundHandler :: playSound( SND_THRUST, -1, -1, false );
82 } 79 }
@@ -88,7 +85,2 @@ void Game :: handleKeys( SDL_KeyboardEvent &key )
88 85
89 if ( thrustChannel != -1 )
90 {
91 // SoundHandler :: stopSound( thrustChannel, true, 300 );
92 // thrustChannel = -1;
93 }
94 } 86 }
@@ -99,5 +91,5 @@ void Game :: handleKeys( SDL_KeyboardEvent &key )
99 91
100QString Game :: getGameDifficultyText() 92string Game :: getGameDifficultyText()
101{ 93{
102 QString ret; 94 string ret;
103 95
@@ -109,2 +101,4 @@ QString Game :: getGameDifficultyText()
109 ret = "Hard"; 101 ret = "Hard";
102 else if ( difficulty == MENU_DIFFICULTY_CUSTOM )
103 ret = "Custom";
110 104
@@ -121,2 +115,12 @@ void Game :: setDifficulty( string diff )
121 difficulty = MENU_DIFFICULTY_HARD; 115 difficulty = MENU_DIFFICULTY_HARD;
116 else if ( diff == "Custom" )
117 difficulty = MENU_DIFFICULTY_CUSTOM;
118
119 init();
120}
121
122void Game :: setDifficulty( int diff )
123{
124 difficulty = diff;
125 init();
122} 126}
@@ -168,5 +172,4 @@ void Game :: draw( SDL_Surface *screen )
168 char tmp[100]; 172 char tmp[100];
169 QString scoreText; 173 string scoreText;
170 sprintf( tmp, "Score: %06ld High Score: %06ld", score, highScore ); 174 sprintf( tmp, "Score: %06ld High Score: %06ld", score, highScore );
171 //printf( "%s\n", (const char *)scoreText );
172 FontHandler::draw( screen, FONT_WHITE_TEXT, tmp, 3, 10 ); 175 FontHandler::draw( screen, FONT_WHITE_TEXT, tmp, 3, 10 );
@@ -175,3 +178,3 @@ void Game :: draw( SDL_Surface *screen )
175 { 178 {
176 QString crashText; 179 string crashText;
177 crashText = "Game Over"; 180 crashText = "Game Over";
@@ -225,3 +228,3 @@ void Game :: setSeed( int seed )
225 228
226void Game :: saveReplay( QString file ) 229void Game :: saveReplay( string file )
227{ 230{
@@ -238,3 +241,3 @@ void Game :: saveReplay( QString file )
238 // Format is:: <landscape seed> <game type> <difficulty> <framenr> <framenr>....... 241 // Format is:: <landscape seed> <game type> <difficulty> <framenr> <framenr>.......
239 QString val; 242 string val;
240 char tmp[20]; 243 char tmp[20];
@@ -253,3 +256,3 @@ void Game :: saveReplay( QString file )
253 256
254 QString line; 257 string line;
255 sprintf( tmp, "%d\n", val.length() ); 258 sprintf( tmp, "%d\n", val.length() );
@@ -261,8 +264,5 @@ void Game :: saveReplay( QString file )
261 fclose( out ); 264 fclose( out );
262
263 printf( "Replay saved to %s\n", (const char *)file.c_str() );
264
265} 265}
266 266
267void Game :: loadReplay( QString file ) 267void Game :: loadReplay( string file )
268{ 268{
@@ -287,5 +287,4 @@ void Game :: loadReplay( QString file )
287 fread( data, 1, length, in ); 287 fread( data, 1, length, in );
288// printf( "data - %s", data );
289 288
290 QString sep = " "; 289 string sep = " ";
291 290
@@ -310,5 +309,2 @@ void Game :: loadReplay( QString file )
310 fclose( in ); 309 fclose( in );
311
312 printf( "Replay loaded from %s\n", (const char *)file.c_str() );
313
314} 310}