summaryrefslogtreecommitdiff
path: root/noncore/games
Side-by-side diff
Diffstat (limited to 'noncore/games') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/bounce/opie-bounce.control2
-rw-r--r--noncore/games/buzzword/opie-buzzword.control2
-rw-r--r--noncore/games/kbill/opie-kbill.control2
-rw-r--r--noncore/games/kcheckers/opie-kcheckers.control2
-rw-r--r--noncore/games/kpacman/opie-kpacman.control2
-rw-r--r--noncore/games/tetrix/ohighscoredlg.cpp75
-rw-r--r--noncore/games/tetrix/ohighscoredlg.h13
-rw-r--r--noncore/games/tetrix/tetrix.pro2
8 files changed, 53 insertions, 47 deletions
diff --git a/noncore/games/bounce/opie-bounce.control b/noncore/games/bounce/opie-bounce.control
index dfd1bf0..0513958 100644
--- a/noncore/games/bounce/opie-bounce.control
+++ b/noncore/games/bounce/opie-bounce.control
@@ -1,9 +1,9 @@
Package: opie-bounce
Files: plugins/application/libbounce.so* bin/bounce apps/Games/bounce.desktop pics/bounce/*.png
-Version: 0.6-$SUB_VERSION
+Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal, libopiecore2
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
License: GPL
diff --git a/noncore/games/buzzword/opie-buzzword.control b/noncore/games/buzzword/opie-buzzword.control
index 3316445..f76a2c2 100644
--- a/noncore/games/buzzword/opie-buzzword.control
+++ b/noncore/games/buzzword/opie-buzzword.control
@@ -1,9 +1,9 @@
Package: opie-buzzword
Files: plugins/application/libbuzzword.so* bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords
-Version: 1.1-$SUB_VERSION
+Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal,libopiecore2
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
License: GPL
diff --git a/noncore/games/kbill/opie-kbill.control b/noncore/games/kbill/opie-kbill.control
index 3299b93..cf12bca 100644
--- a/noncore/games/kbill/opie-kbill.control
+++ b/noncore/games/kbill/opie-kbill.control
@@ -1,13 +1,13 @@
Package: opie-kbill
Files: bin/kbill apps/Games/kbill.desktop pics/kbill/*
Priority: optional
Section: opie/games
Maintainer: Mark Westcott <mark@houseoffish.org>
Architecture: arm
-Version: 0.8-$SUB_VERSION
+Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal
License: GPL
Description: The famous hit Bill game
Hit Bill as hard as you can before he
infects your network with a wannabe
OS.
diff --git a/noncore/games/kcheckers/opie-kcheckers.control b/noncore/games/kcheckers/opie-kcheckers.control
index 5bd03ae..e7c20d3 100644
--- a/noncore/games/kcheckers/opie-kcheckers.control
+++ b/noncore/games/kcheckers/opie-kcheckers.control
@@ -1,10 +1,10 @@
Package: opie-kcheckers
Files: plugins/application/libkcheckers.so* bin/kcheckers apps/Games/kcheckers.desktop pics/kcheckers
Priority: optional
Section: opie/games
Maintainer: leseb <prudhomme@laposte.net>
Architecture: arm
-Version: 0.3-$SUB_VERSION
+Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal, libopiecore2
Description: The game of Checkers
A game for the Opie environment.
diff --git a/noncore/games/kpacman/opie-kpacman.control b/noncore/games/kpacman/opie-kpacman.control
index 68487ec..97120aa 100644
--- a/noncore/games/kpacman/opie-kpacman.control
+++ b/noncore/games/kpacman/opie-kpacman.control
@@ -1,9 +1,9 @@
Package: opie-kpacman
Files: plugins/applications/libkpacman.so* bin/kpacman apps/Games/kpacman.desktop pics/kpacman/kpacman.png share/kpacman
-Version: 0.3.1-$SUB_VERSION
+Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal
Priority: optional
Section: opie/games
Maintainer: Catalin Climov <catalin@climov.com>
Architecture: arm
License: GPL
diff --git a/noncore/games/tetrix/ohighscoredlg.cpp b/noncore/games/tetrix/ohighscoredlg.cpp
index 8d8079e..66f4917 100644
--- a/noncore/games/tetrix/ohighscoredlg.cpp
+++ b/noncore/games/tetrix/ohighscoredlg.cpp
@@ -16,34 +16,31 @@
#include <qdialog.h>
#include <qlayout.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qstring.h>
+#include <qlist.h>
#include <qhbox.h>
#include <qvbox.h>
#include <qlabel.h>
#include <qlistview.h>
#include <qlineedit.h>
#include "ohighscoredlg.h"
-OHighscore::OHighscore( int score , int playerLevel )
+OHighscore::OHighscore( int score , int playerLevel ) : playerData()
{
pLevel = playerLevel;
getList();
checkIfItIsANewhighscore( score );
+ playerData.setAutoDelete( TRUE );
}
OHighscore::~OHighscore()
{
- std::list<t_playerData*>::iterator deleteIterator = playerData.begin();
- for ( ; deleteIterator != playerData.end() ; deleteIterator++ )
- {
- delete ( *deleteIterator );
- }
}
void OHighscore::getList()
{
Config cfg ( "tetrix" );
cfg.setGroup( QString::number( 1 ) );
@@ -61,13 +58,13 @@ void OHighscore::getList()
t_playerData *pPlayerData = new t_playerData;
pPlayerData->sName = cfg.readEntry( "Name" );
pPlayerData->points = temp;
pPlayerData->level = cfg.readNumEntry( "Level" );
- playerData.push_back( pPlayerData );
+ playerData.append( pPlayerData );
if ( (temp < lowest) ) lowest = temp;
rest++;
}
}
@@ -80,13 +77,13 @@ void OHighscore::getList()
{
t_playerData *pPlayerData = new t_playerData;
pPlayerData->sName = tr( "empty");
pPlayerData->points = 0;
pPlayerData->level = 0;
- playerData.push_back( pPlayerData );
+ playerData.append( pPlayerData );
}
}
}
void OHighscore::checkIfItIsANewhighscore( int points)
@@ -97,47 +94,47 @@ void OHighscore::checkIfItIsANewhighscore( int points)
isNewhighscore = false;
}
void OHighscore::insertData( QString name , int punkte , int playerLevel )
{
Config cfg ( "tetrix" );
+ t_playerData * Run;
+ int index = 0;
int entryNumber = 1;
- std::list<t_playerData*>::iterator insertIterator = playerData.begin();
- while ( insertIterator != playerData.end() )
- {
- if ( punkte > ( *insertIterator )->points )
+
+ for ( Run=playerData.first();
+ Run != 0;
+ index ++, Run=playerData.next() ) {
+
+ if ( punkte > Run->points )
{
t_playerData* temp = new t_playerData;
temp->sName = name;
temp->points = punkte;
temp->level = playerLevel;
- playerData.insert( insertIterator , temp );
+
+ playerData.insert( index, temp );
//now we have to delete the last entry
- insertIterator = playerData.end();
- insertIterator--;
-//X delete *insertIterator; //memleak?
- playerData.erase( insertIterator );
+ playerData.remove( playerData.count() );
/////////////////////////////////////////
//this block just rewrites the highscore
- insertIterator = playerData.begin();
- while ( insertIterator != playerData.end() )
- {
+ for ( t_playerData * Run2=playerData.first();
+ Run2 != 0;
+ Run2=playerData.next() ) {
cfg.setGroup( QString::number( entryNumber ) );
- cfg.writeEntry( "Name" , ( *insertIterator )->sName );
- cfg.writeEntry( "Points" , ( *insertIterator )->points );
- cfg.writeEntry( "Level" , ( *insertIterator )->level );
+ cfg.writeEntry( "Name" , Run2->sName );
+ cfg.writeEntry( "Points" , Run2->points );
+ cfg.writeEntry( "Level" , Run2->level );
entryNumber++;
- insertIterator++;
}
////////////////////////////////////////
return;
}
- insertIterator++;
}
}
QString OHighscore::getName()
{
QString name;
@@ -174,26 +171,36 @@ OHighscoreDialog::OHighscoreDialog(OHighscore *highscore, QWidget *parent, const
void OHighscoreDialog::createHighscoreListView()
{
int pos = 10;
int points_ = 0;
int level_ = 0;
+ QListViewItem * Prev = 0;
- std::list<t_playerData*>::reverse_iterator iListe = hs_->playerData.rbegin();
-
- for ( ; iListe != hs_->playerData.rend() ; ++iListe )
+ for ( t_playerData * Run = hs_->playerData.first();
+ Run != 0;
+ Run=hs_->playerData.next() )
{
- QListViewItem *item = new QListViewItem( list );
+ QListViewItem *item;
+
+ if( Prev ) {
+ // after previous
+ item = new QListViewItem( list, Prev );
+ Prev = item;
+ } else {
+ item = new QListViewItem( list );
+
+ }
item->setText( 0 , QString::number( pos ) ); //number
- item->setText( 1 , ( *iListe )->sName ); //name
- if ( ( *iListe )->points == -1 )
+ item->setText( 1 , Run->sName ); //name
+ if ( Run->points == -1 )
points_ = 0;
- else points_ = ( *iListe )->points;
- if ( ( *iListe )->level == -1 )
+ else points_ = Run->points;
+ if ( Run->level == -1 )
level_ = 0;
- else level_ = ( *iListe )->level;
+ else level_ = Run->level;
item->setText( 2 , QString::number( points_ ) ); //points
item->setText( 3 , QString::number( level_ ) ); //level
pos--;
}
}
diff --git a/noncore/games/tetrix/ohighscoredlg.h b/noncore/games/tetrix/ohighscoredlg.h
index fdbe623..845e639 100644
--- a/noncore/games/tetrix/ohighscoredlg.h
+++ b/noncore/games/tetrix/ohighscoredlg.h
@@ -9,18 +9,19 @@
class QWidget;
class QVBoxLayout;
class QListView;
#include <qdialog.h>
-#include <list>
+#include <qlist.h>
-using namespace std;
-
-struct t_playerData
+class t_playerData
{
+
+public :
+
QString sName;
int points;
int level;
};
class OHighscore : public QWidget
@@ -42,22 +43,20 @@ class OHighscore : public QWidget
/*
* this inserts the new entry at the correct position
*/
void insertData( QString , int , int );
- list<t_playerData*> playerData;
+ QList<t_playerData> playerData;
/*
* As Qt/e does not support QInputDialog I did that code myself
*/
QString getName();
private:
- list<t_playerData*>::iterator iPlayerData;
-
/*
* the lowest score in the highscorelist
*/
int lowest;
/*
diff --git a/noncore/games/tetrix/tetrix.pro b/noncore/games/tetrix/tetrix.pro
index 580a542..96f452f 100644
--- a/noncore/games/tetrix/tetrix.pro
+++ b/noncore/games/tetrix/tetrix.pro
@@ -9,13 +9,13 @@ SOURCES = main.cpp \
qtetrix.cpp \
qtetrixb.cpp \
tpiece.cpp \
ohighscoredlg.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopiecore2 -lstdc++
+LIBS += -lqpe -lopiecore2
INTERFACES =
TARGET = tetrix