author | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
commit | a9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (side-by-side diff) | |
tree | 13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/games | |
parent | 48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff) | |
download | opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.zip opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.gz opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.bz2 |
CONTROL files : changed version string
NS2 many changes and first release of OT2
-rw-r--r-- | noncore/games/bounce/opie-bounce.control | 2 | ||||
-rw-r--r-- | noncore/games/buzzword/opie-buzzword.control | 2 | ||||
-rw-r--r-- | noncore/games/kbill/opie-kbill.control | 2 | ||||
-rw-r--r-- | noncore/games/kcheckers/opie-kcheckers.control | 2 | ||||
-rw-r--r-- | noncore/games/kpacman/opie-kpacman.control | 2 | ||||
-rw-r--r-- | noncore/games/tetrix/ohighscoredlg.cpp | 81 | ||||
-rw-r--r-- | noncore/games/tetrix/ohighscoredlg.h | 13 | ||||
-rw-r--r-- | noncore/games/tetrix/tetrix.pro | 2 |
8 files changed, 56 insertions, 50 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,6 +1,6 @@ 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 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,6 +1,6 @@ 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 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 @@ -4,7 +4,7 @@ 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 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 @@ -4,7 +4,7 @@ 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,6 +1,6 @@ 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 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 @@ -19,6 +19,7 @@ #include <qpe/config.h> #include <qstring.h> +#include <qlist.h> #include <qhbox.h> #include <qvbox.h> #include <qlabel.h> @@ -27,20 +28,16 @@ #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() @@ -64,7 +61,7 @@ void OHighscore::getList() pPlayerData->points = temp; pPlayerData->level = cfg.readNumEntry( "Level" ); - playerData.push_back( pPlayerData ); + playerData.append( pPlayerData ); if ( (temp < lowest) ) lowest = temp; rest++; @@ -83,7 +80,7 @@ void OHighscore::getList() pPlayerData->points = 0; pPlayerData->level = 0; - playerData.push_back( pPlayerData ); + playerData.append( pPlayerData ); } } @@ -100,41 +97,41 @@ void OHighscore::checkIfItIsANewhighscore( int points) 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++; } } @@ -177,20 +174,30 @@ void OHighscoreDialog::createHighscoreListView() int pos = 10; int points_ = 0; int level_ = 0; - - std::list<t_playerData*>::reverse_iterator iListe = hs_->playerData.rbegin(); - - for ( ; iListe != hs_->playerData.rend() ; ++iListe ) - { - QListViewItem *item = new QListViewItem( list ); + QListViewItem * Prev = 0; + + for ( t_playerData * Run = hs_->playerData.first(); + Run != 0; + Run=hs_->playerData.next() ) + { + 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 ) - level_ = 0; - else level_ = ( *iListe )->level; + else points_ = Run->points; + if ( Run->level == -1 ) + level_ = 0; + 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 @@ -12,12 +12,13 @@ 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; @@ -45,7 +46,7 @@ class OHighscore : public QWidget */ 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 @@ -53,8 +54,6 @@ class OHighscore : public QWidget QString getName(); private: - list<t_playerData*>::iterator iPlayerData; - /* * the lowest score in the highscorelist */ 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 @@ -12,7 +12,7 @@ SOURCES = main.cpp \ ohighscoredlg.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -lstdc++ +LIBS += -lqpe -lopiecore2 INTERFACES = TARGET = tetrix |