summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/sfcave/opie-sfcave.control2
-rw-r--r--noncore/games/sfcave/sfcave.cpp48
-rw-r--r--noncore/games/sfcave/sfcave.h8
-rw-r--r--noncore/games/sfcave/sfcave.pro5
4 files changed, 21 insertions, 42 deletions
diff --git a/noncore/games/sfcave/opie-sfcave.control b/noncore/games/sfcave/opie-sfcave.control
index 0ff3e2c..1d98a19 100644
--- a/noncore/games/sfcave/opie-sfcave.control
+++ b/noncore/games/sfcave/opie-sfcave.control
@@ -1,5 +1,5 @@
1Package: opie-sfcave 1Package: opie-sfcave
2Files: bin/sfcave apps/Games/sfcave.desktop pics/sfcave 2Files: plugins/applications/libsfcave.so* bin/sfcave apps/Games/sfcave.desktop pics/sfcave
3Priority: optional 3Priority: optional
4Section: opie/games 4Section: opie/games
5Maintainer: Andy Qua <andy.qua@blueyonder.co.uk> 5Maintainer: Andy Qua <andy.qua@blueyonder.co.uk>
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
@@ -3,12 +3,10 @@
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"
@@ -132,42 +130,18 @@ int SFCave::initialGateGaps[] = { 75, 50, 25 };
132bool movel; 130bool movel;
133 131
134 132
135int main( int argc, char *argv[] ) 133OPIE_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; 135SFCave :: 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
154 SFCave app( speed );
155 a.setMainWidget( &app );
156 app.show();
157 app.start();
158 a.exec();
159}
160
161SFCave :: SFCave( int spd, QWidget *w, char *name )
162 : QMainWindow( w, name )
163 137
164{ 138{
165 replayIt = 0;
166#ifdef QWS
167 showMaximized(); 139 showMaximized();
168#else 140 movel = true;
169 resize( 240, 284 ); 141 int spd = 3;
170#endif 142
143
144 replayIt = 0;
171 145
172 replayFile = QDir::home().path(); 146 replayFile = QDir::home().path();
173 replayFile += "/sfcave.replay"; 147 replayFile += "/sfcave.replay";
@@ -213,6 +187,8 @@ SFCave :: SFCave( int spd, QWidget *w, char *name )
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
218SFCave :: ~SFCave() 194SFCave :: ~SFCave()
diff --git a/noncore/games/sfcave/sfcave.h b/noncore/games/sfcave/sfcave.h
index b1fe819..7bdf881 100644
--- a/noncore/games/sfcave/sfcave.h
+++ b/noncore/games/sfcave/sfcave.h
@@ -95,9 +95,15 @@ public:
95 double thrust; 95 double thrust;
96 bool running; 96 bool running;
97 97
98 SFCave( int speed = 3, QWidget *p = 0, char *name = 0 ); 98 SFCave( QWidget *p = 0, const char *name = 0, WFlags fl = 0 );
99 ~SFCave(); 99 ~SFCave();
100
101 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }
102
103public slots:
100 void start(); 104 void start();
105public:
106
101 void setSeed( int seed ); 107 void setSeed( int seed );
102 int nextInt( int range ); 108 int nextInt( int range );
103 void setUp(); 109 void setUp();
diff --git a/noncore/games/sfcave/sfcave.pro b/noncore/games/sfcave/sfcave.pro
index a0df828..3a26a79 100644
--- a/noncore/games/sfcave/sfcave.pro
+++ b/noncore/games/sfcave/sfcave.pro
@@ -1,6 +1,4 @@
1 TEMPLATE= app 1 CONFIG += qt quick-app
2 CONFIG += qt warn_on
3 DESTDIR = $(OPIEDIR)/bin
4 SOURCES = sfcave.cpp helpwindow.cpp random.cpp 2 SOURCES = sfcave.cpp helpwindow.cpp random.cpp
5 HEADERS = sfcave.h helpwindow.h random.h 3 HEADERS = sfcave.h helpwindow.h random.h
6 TARGET = sfcave 4 TARGET = sfcave
@@ -9,5 +7,4 @@ DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 7LIBS += -lqpe
10 8
11 9
12
13include ( $(OPIEDIR)/include.pro ) 10include ( $(OPIEDIR)/include.pro )