summaryrefslogtreecommitdiff
path: root/noncore
authorharlekin <harlekin>2002-03-05 19:03:08 (UTC)
committer harlekin <harlekin>2002-03-05 19:03:08 (UTC)
commit3ccfa79645d8bd99c7b559f9fa315d028db2c75d (patch) (side-by-side diff)
tree54f422c70dd85e16d10d98696c7cdd9ddc8b916f /noncore
parent7f0e92c12b41207fa75c82bc0b6f30fc57e7e77d (diff)
downloadopie-3ccfa79645d8bd99c7b559f9fa315d028db2c75d.zip
opie-3ccfa79645d8bd99c7b559f9fa315d028db2c75d.tar.gz
opie-3ccfa79645d8bd99c7b559f9fa315d028db2c75d.tar.bz2
the launch key on ipaq is now the fire button
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/qasteroids/toplevel.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/noncore/games/qasteroids/toplevel.cpp b/noncore/games/qasteroids/toplevel.cpp
index 57242a0..090099f 100644
--- a/noncore/games/qasteroids/toplevel.cpp
+++ b/noncore/games/qasteroids/toplevel.cpp
@@ -26,24 +26,26 @@
#include "toplevel.h"
#include "ledmeter.h"
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qaccel.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlcdnumber.h>
#include <qpushbutton.h>
+#include <sys/utsname.h>
+
#define SB_SCORE 1
#define SB_LEVEL 2
#define SB_SHIPS 3
struct SLevel
{
int nrocks;
double rockSpeed;
};
#define MAX_LEVELS 16
@@ -244,27 +246,43 @@ KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
hbd->addWidget( powerMeter );
shipsRemain = 3;
showHiscores = FALSE;
actions.insert( Qt::Key_Up, Thrust );
actions.insert( Qt::Key_Left, RotateLeft );
actions.insert( Qt::Key_Right, RotateRight );
actions.insert( Qt::Key_Enter, Shoot );
actions.insert( Qt::Key_Z, Teleport );
actions.insert( Qt::Key_Down, Brake );
actions.insert( Qt::Key_P, Pause );
- actions.insert( Key_F12, Launch );
- actions.insert( Key_F11, Shield );
- actions.insert( Key_F9, NewGame );
+
+
+ struct utsname name; /* check for embedix kernel running on the zaurus, if
+ lineo change string, this break
+ */
+ if (uname(&name) != -1) {
+ QString release=name.release;
+ if(release.find("embedix",0,TRUE) !=-1) {
+ actions.insert( Key_F12, Launch );
+ actions.insert( Key_F11, Shield );
+ actions.insert( Key_F9, NewGame );
+ } else {
+ // ipaq
+ actions.insert( Key_F12, Shoot );
+ actions.insert( Key_F11, Shield );
+ actions.insert( Key_F10, Launch );
+ actions.insert( Key_F9, NewGame );
+ }
+ }
// actions.insert( Qt::Key_S, Shield );
// actions.insert( Qt::Key_X, Brake );
// actions.insert( Qt::Key_L, Launch );
actions.insert( Qt::Key_Space, Shoot );
view->showText( tr( "Press Calendar to start playing" ), yellow );
setFocusPolicy( StrongFocus );
slotNewGame();
}
@@ -442,25 +460,25 @@ void KAstTopLevel::slotNewGame()
}
void KAstTopLevel::slotShipKilled()
{
shipsRemain--;
shipsLCD->display( shipsRemain-1 );
playSound( "ShipDestroyed" );
if ( shipsRemain > 0 )
{
waitShip = TRUE;
- view->showText( tr( "Ship Destroyed.\nPress Launch/Home key."), yellow );
+ view->showText( tr( "Ship Destroyed.\nPress Contacts/Home key."), yellow );
}
else
{
view->endGame();
doStats();
}
}
void KAstTopLevel::slotRockHit( int size )
{
switch ( size )
{