author | andyq <andyq> | 2003-01-21 20:37:00 (UTC) |
---|---|---|
committer | andyq <andyq> | 2003-01-21 20:37:00 (UTC) |
commit | 0a6563fcc2f49857c581d9def24407a3a4ef526c (patch) (unidiff) | |
tree | f1b82a4bd7582ef2cb722cffb87eecff1e1f96e6 /noncore/games/sfcave-sdl/game.h | |
parent | 50b5915b48fc5cbacf23e4d2b75d7a266f141a4a (diff) | |
download | opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.zip opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.gz opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.bz2 |
Clean up of code - fixed memory leaks (most of them) and added new custom config menu
Diffstat (limited to 'noncore/games/sfcave-sdl/game.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/game.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/noncore/games/sfcave-sdl/game.h b/noncore/games/sfcave-sdl/game.h index 56fa6a1..087f848 100644 --- a/noncore/games/sfcave-sdl/game.h +++ b/noncore/games/sfcave-sdl/game.h | |||
@@ -16,67 +16,66 @@ public: | |||
16 | virtual ~Game(); | 16 | virtual ~Game(); |
17 | 17 | ||
18 | virtual void init( ); | 18 | virtual void init( ); |
19 | virtual void update( int state ); | 19 | virtual void update( int state ); |
20 | virtual void preDraw( SDL_Surface * ); | 20 | virtual void preDraw( SDL_Surface * ); |
21 | virtual void draw( SDL_Surface * ); | 21 | virtual void draw( SDL_Surface * ); |
22 | 22 | ||
23 | virtual void stateChanged( int from, int to ); | 23 | virtual void stateChanged( int from, int to ); |
24 | 24 | ||
25 | void setReplay( bool val ) { replay = val; } | 25 | void setReplay( bool val ) { replay = val; } |
26 | 26 | ||
27 | void handleKeys( SDL_KeyboardEvent &key ); | 27 | void handleKeys( SDL_KeyboardEvent &key ); |
28 | QString getGameName() { return gameName; } | 28 | string getGameName() { return gameName; } |
29 | int getDifficulty() { return difficulty; } | 29 | int getDifficulty() { return difficulty; } |
30 | QString getGameDifficultyText(); | 30 | string getGameDifficultyText(); |
31 | void setDifficulty( int diff ) { difficulty = diff; } | 31 | void setDifficulty( int diff ); |
32 | void setDifficulty( string diff ); | 32 | void setDifficulty( string diff ); |
33 | 33 | ||
34 | long getScore() { return score; } | 34 | long getScore() { return score; } |
35 | long getHighScore() { return highScore; } | 35 | long getHighScore() { return highScore; } |
36 | void increaseScore( long val ) { score += val; } | 36 | void increaseScore( long val ) { score += val; } |
37 | void clearScore() { score = 0; } | 37 | void clearScore() { score = 0; } |
38 | bool gotHighScore() { return (score >= highScore); } | 38 | bool gotHighScore() { return (score >= highScore); } |
39 | bool isReplayAvailable() { return replayList.size() > 0; } | 39 | bool isReplayAvailable() { return replayList.size() > 0; } |
40 | 40 | ||
41 | Terrain *getTerrain() { return terrain; } | 41 | Terrain *getTerrain() { return terrain; } |
42 | Player *getPlayer() { return player; } | ||
42 | 43 | ||
43 | void setSeed( int seed ); | 44 | void setSeed( int seed ); |
44 | void loadReplay( QString file ); | 45 | void loadReplay( string file ); |
45 | void saveReplay( QString file ); | 46 | void saveReplay( string file ); |
46 | 47 | ||
47 | static Game *createGame( SFCave *p, int w, int h, string game, string difficulty ); | 48 | static Game *createGame( SFCave *p, int w, int h, string game, string difficulty ); |
48 | 49 | ||
49 | protected: | 50 | protected: |
50 | QString gameName; | 51 | string gameName; |
51 | 52 | ||
52 | int thrustChannel; | 53 | int thrustChannel; |
53 | 54 | ||
54 | int difficulty; | 55 | int difficulty; |
55 | 56 | ||
56 | SFCave *parent; | 57 | SFCave *parent; |
57 | Terrain *terrain; | 58 | Terrain *terrain; |
58 | Player *player; | 59 | Player *player; |
59 | 60 | ||
60 | int nrFrames; | 61 | int nrFrames; |
61 | 62 | ||
62 | bool press; | 63 | bool press; |
63 | 64 | ||
64 | int sHeight; | 65 | int sHeight; |
65 | int sWidth; | 66 | int sWidth; |
66 | long score; | 67 | long score; |
67 | long highScore; | 68 | long highScore; |
68 | 69 | ||
69 | // Stuff for the replays | 70 | // Stuff for the replays |
70 | int currentSeed; | 71 | int currentSeed; |
71 | 72 | ||
72 | // QListIterator<int> *replayIt; | ||
73 | list<int> replayList; | 73 | list<int> replayList; |
74 | list<int>::iterator replayIt; | 74 | list<int>::iterator replayIt; |
75 | //QList<int> replayList; | ||
76 | bool replay; | 75 | bool replay; |
77 | QString replayFile; | 76 | string replayFile; |
78 | 77 | ||
79 | private: | 78 | private: |
80 | }; | 79 | }; |
81 | 80 | ||
82 | #endif | 81 | #endif |