Diffstat (limited to 'noncore/games/sfcave/sfcave.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave/sfcave.cpp | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/noncore/games/sfcave/sfcave.cpp b/noncore/games/sfcave/sfcave.cpp index 9b30fe6..5dca427 100644 --- a/noncore/games/sfcave/sfcave.cpp +++ b/noncore/games/sfcave/sfcave.cpp | |||
@@ -1,17 +1,15 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <math.h> | 3 | #include <math.h> |
4 | #include <time.h> | 4 | #include <time.h> |
5 | 5 | ||
6 | #ifdef QWS | 6 | #include <opie2/oapplicationfactory.h> |
7 | #include <qpe/qpeapplication.h> | ||
8 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
9 | #else | 8 | |
10 | #include <qapplication.h> | 9 | #include <qapplication.h> |
11 | #endif | ||
12 | #include <qdir.h> | 10 | #include <qdir.h> |
13 | 11 | ||
14 | #include "helpwindow.h" | 12 | #include "helpwindow.h" |
15 | #include "sfcave.h" | 13 | #include "sfcave.h" |
16 | 14 | ||
17 | #define CAPTION "SFCave 1.13 by AndyQ" | 15 | #define CAPTION "SFCave 1.13 by AndyQ" |
@@ -129,48 +127,24 @@ int SFCave::initialGateGaps[] = { 75, 50, 25 }; | |||
129 | 127 | ||
130 | 128 | ||
131 | #define FLYSCORES( x, y ) (*(flyScores + ((x)*3) + y)) | 129 | #define FLYSCORES( x, y ) (*(flyScores + ((x)*3) + y)) |
132 | bool movel; | 130 | bool movel; |
133 | 131 | ||
134 | 132 | ||
135 | int main( int argc, char *argv[] ) | 133 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<SFCave> ) |
136 | { | ||
137 | movel = true; | ||
138 | #ifdef QWS | ||
139 | QPEApplication a( argc, argv ); | ||
140 | #else | ||
141 | QApplication a( argc, argv ); | ||
142 | #endif | ||
143 | 134 | ||
144 | int speed = 3; | 135 | SFCave :: SFCave( QWidget *w, const char *name, WFlags fl ) |
145 | for ( int i = 0 ; i < argc ; ++i ) | 136 | : QMainWindow( w, name, fl ) |
146 | { | ||
147 | if ( strcmp( argv[i], "-s" ) == 0 ) | ||
148 | { | ||
149 | if ( i+1 < argc ) | ||
150 | speed = atoi( argv[i+1] ); | ||
151 | } | ||
152 | } | ||
153 | 137 | ||
154 | SFCave app( speed ); | 138 | { |
155 | a.setMainWidget( &app ); | 139 | showMaximized(); |
156 | app.show(); | 140 | movel = true; |
157 | app.start(); | 141 | int spd = 3; |
158 | a.exec(); | ||
159 | } | ||
160 | 142 | ||
161 | SFCave :: SFCave( int spd, QWidget *w, char *name ) | ||
162 | : QMainWindow( w, name ) | ||
163 | 143 | ||
164 | { | ||
165 | replayIt = 0; | 144 | replayIt = 0; |
166 | #ifdef QWS | ||
167 | showMaximized(); | ||
168 | #else | ||
169 | resize( 240, 284 ); | ||
170 | #endif | ||
171 | 145 | ||
172 | replayFile = QDir::home().path(); | 146 | replayFile = QDir::home().path(); |
173 | replayFile += "/sfcave.replay"; | 147 | replayFile += "/sfcave.replay"; |
174 | printf( "%s\n", (const char *)replayFile ); | 148 | printf( "%s\n", (const char *)replayFile ); |
175 | 149 | ||
176 | sWidth = width(); | 150 | sWidth = width(); |
@@ -210,12 +184,14 @@ SFCave :: SFCave( int spd, QWidget *w, char *name ) | |||
210 | state = STATE_MENU; | 184 | state = STATE_MENU; |
211 | prevState = STATE_MENU; | 185 | prevState = STATE_MENU; |
212 | 186 | ||
213 | gameTimer = new QTimer( this, "game timer" ); | 187 | gameTimer = new QTimer( this, "game timer" ); |
214 | connect( gameTimer, SIGNAL( timeout() ), | 188 | connect( gameTimer, SIGNAL( timeout() ), |
215 | this, SLOT( run() ) ); | 189 | this, SLOT( run() ) ); |
190 | |||
191 | QTimer::singleShot(0, this, SLOT(start())); | ||
216 | } | 192 | } |
217 | 193 | ||
218 | SFCave :: ~SFCave() | 194 | SFCave :: ~SFCave() |
219 | { | 195 | { |
220 | } | 196 | } |
221 | 197 | ||