summaryrefslogtreecommitdiff
path: root/noncore/games
Unidiff
Diffstat (limited to 'noncore/games') (more/less context) (ignore 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.cpp81
-rw-r--r--noncore/games/tetrix/ohighscoredlg.h13
-rw-r--r--noncore/games/tetrix/tetrix.pro2
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,5 +1,5 @@
1Package: opie-bounce 1Package: opie-bounce
2Files: plugins/application/libbounce.so* bin/bounce apps/Games/bounce.desktop pics/bounce/*.png 2Files: plugins/application/libbounce.so* bin/bounce apps/Games/bounce.desktop pics/bounce/*.png
3Version: 0.6-$SUB_VERSION 3Version: $QPE_VERSION$EXTRAVERSION
4Depends: task-opie-minimal, libopiecore2 4Depends: task-opie-minimal, libopiecore2
5Priority: optional 5Priority: optional
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,5 +1,5 @@
1Package: opie-buzzword 1Package: opie-buzzword
2Files: plugins/application/libbuzzword.so* bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords 2Files: plugins/application/libbuzzword.so* bin/buzzword apps/Games/buzzword.desktop pics/buzzword/buzzword.png share/buzzword/buzzwords
3Version: 1.1-$SUB_VERSION 3Version: $QPE_VERSION$EXTRAVERSION
4Depends: task-opie-minimal,libopiecore2 4Depends: task-opie-minimal,libopiecore2
5Priority: optional 5Priority: optional
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
@@ -5,5 +5,5 @@ Section: opie/games
5Maintainer: Mark Westcott <mark@houseoffish.org> 5Maintainer: Mark Westcott <mark@houseoffish.org>
6Architecture: arm 6Architecture: arm
7Version: 0.8-$SUB_VERSION 7Version: $QPE_VERSION$EXTRAVERSION
8Depends: task-opie-minimal 8Depends: task-opie-minimal
9License: GPL 9License: GPL
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
@@ -5,5 +5,5 @@ Section: opie/games
5Maintainer: leseb <prudhomme@laposte.net> 5Maintainer: leseb <prudhomme@laposte.net>
6Architecture: arm 6Architecture: arm
7Version: 0.3-$SUB_VERSION 7Version: $QPE_VERSION$EXTRAVERSION
8Depends: task-opie-minimal, libopiecore2 8Depends: task-opie-minimal, libopiecore2
9Description: The game of Checkers 9Description: The game of Checkers
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,5 +1,5 @@
1Package: opie-kpacman 1Package: opie-kpacman
2Files: plugins/applications/libkpacman.so* bin/kpacman apps/Games/kpacman.desktop pics/kpacman/kpacman.png share/kpacman 2Files: plugins/applications/libkpacman.so* bin/kpacman apps/Games/kpacman.desktop pics/kpacman/kpacman.png share/kpacman
3Version: 0.3.1-$SUB_VERSION 3Version: $QPE_VERSION$EXTRAVERSION
4Depends: task-opie-minimal 4Depends: task-opie-minimal
5Priority: optional 5Priority: optional
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
@@ -20,4 +20,5 @@
20 20
21#include <qstring.h> 21#include <qstring.h>
22#include <qlist.h>
22#include <qhbox.h> 23#include <qhbox.h>
23#include <qvbox.h> 24#include <qvbox.h>
@@ -28,18 +29,14 @@
28#include "ohighscoredlg.h" 29#include "ohighscoredlg.h"
29 30
30OHighscore::OHighscore( int score , int playerLevel ) 31OHighscore::OHighscore( int score , int playerLevel ) : playerData()
31{ 32{
32 pLevel = playerLevel; 33 pLevel = playerLevel;
33 getList(); 34 getList();
34 checkIfItIsANewhighscore( score ); 35 checkIfItIsANewhighscore( score );
36 playerData.setAutoDelete( TRUE );
35} 37}
36 38
37OHighscore::~OHighscore() 39OHighscore::~OHighscore()
38{ 40{
39 std::list<t_playerData*>::iterator deleteIterator = playerData.begin();
40 for ( ; deleteIterator != playerData.end() ; deleteIterator++ )
41 {
42 delete ( *deleteIterator );
43 }
44} 41}
45 42
@@ -65,5 +62,5 @@ void OHighscore::getList()
65 pPlayerData->level = cfg.readNumEntry( "Level" ); 62 pPlayerData->level = cfg.readNumEntry( "Level" );
66 63
67 playerData.push_back( pPlayerData ); 64 playerData.append( pPlayerData );
68 65
69 if ( (temp < lowest) ) lowest = temp; 66 if ( (temp < lowest) ) lowest = temp;
@@ -84,5 +81,5 @@ void OHighscore::getList()
84 pPlayerData->level = 0; 81 pPlayerData->level = 0;
85 82
86 playerData.push_back( pPlayerData ); 83 playerData.append( pPlayerData );
87 } 84 }
88 } 85 }
@@ -101,9 +98,13 @@ void OHighscore::insertData( QString name , int punkte , int playerLevel )
101{ 98{
102 Config cfg ( "tetrix" ); 99 Config cfg ( "tetrix" );
100 t_playerData * Run;
101 int index = 0;
103 int entryNumber = 1; 102 int entryNumber = 1;
104 std::list<t_playerData*>::iterator insertIterator = playerData.begin(); 103
105 while ( insertIterator != playerData.end() ) 104 for ( Run=playerData.first();
106 { 105 Run != 0;
107 if ( punkte > ( *insertIterator )->points ) 106 index ++, Run=playerData.next() ) {
107
108 if ( punkte > Run->points )
108 { 109 {
109 t_playerData* temp = new t_playerData; 110 t_playerData* temp = new t_playerData;
@@ -111,23 +112,20 @@ void OHighscore::insertData( QString name , int punkte , int playerLevel )
111 temp->points = punkte; 112 temp->points = punkte;
112 temp->level = playerLevel; 113 temp->level = playerLevel;
113 playerData.insert( insertIterator , temp ); 114
115 playerData.insert( index, temp );
114 116
115 //now we have to delete the last entry 117 //now we have to delete the last entry
116 insertIterator = playerData.end(); 118 playerData.remove( playerData.count() );
117 insertIterator--;
118 //X delete *insertIterator; //memleak?
119 playerData.erase( insertIterator );
120 119
121 ///////////////////////////////////////// 120 /////////////////////////////////////////
122 //this block just rewrites the highscore 121 //this block just rewrites the highscore
123 insertIterator = playerData.begin(); 122 for ( t_playerData * Run2=playerData.first();
124 while ( insertIterator != playerData.end() ) 123 Run2 != 0;
125 { 124 Run2=playerData.next() ) {
126 cfg.setGroup( QString::number( entryNumber ) ); 125 cfg.setGroup( QString::number( entryNumber ) );
127 cfg.writeEntry( "Name" , ( *insertIterator )->sName ); 126 cfg.writeEntry( "Name" , Run2->sName );
128 cfg.writeEntry( "Points" , ( *insertIterator )->points ); 127 cfg.writeEntry( "Points" , Run2->points );
129 cfg.writeEntry( "Level" , ( *insertIterator )->level ); 128 cfg.writeEntry( "Level" , Run2->level );
130 entryNumber++; 129 entryNumber++;
131 insertIterator++;
132 } 130 }
133 //////////////////////////////////////// 131 ////////////////////////////////////////
@@ -135,5 +133,4 @@ void OHighscore::insertData( QString name , int punkte , int playerLevel )
135 return; 133 return;
136 } 134 }
137 insertIterator++;
138 } 135 }
139} 136}
@@ -178,18 +175,28 @@ void OHighscoreDialog::createHighscoreListView()
178 int points_ = 0; 175 int points_ = 0;
179 int level_ = 0; 176 int level_ = 0;
180 177 QListViewItem * Prev = 0;
181 std::list<t_playerData*>::reverse_iterator iListe = hs_->playerData.rbegin(); 178
182 179 for ( t_playerData * Run = hs_->playerData.first();
183 for ( ; iListe != hs_->playerData.rend() ; ++iListe ) 180 Run != 0;
184 { 181 Run=hs_->playerData.next() )
185 QListViewItem *item = new QListViewItem( list ); 182 {
183 QListViewItem *item;
184
185 if( Prev ) {
186 // after previous
187 item = new QListViewItem( list, Prev );
188 Prev = item;
189 } else {
190 item = new QListViewItem( list );
191
192 }
186 item->setText( 0 , QString::number( pos ) ); //number 193 item->setText( 0 , QString::number( pos ) ); //number
187 item->setText( 1 , ( *iListe )->sName ); //name 194 item->setText( 1 , Run->sName ); //name
188 if ( ( *iListe )->points == -1 ) 195 if ( Run->points == -1 )
189 points_ = 0; 196 points_ = 0;
190 else points_ = ( *iListe )->points; 197 else points_ = Run->points;
191 if ( ( *iListe )->level == -1 ) 198 if ( Run->level == -1 )
192 level_ = 0; 199 level_ = 0;
193 else level_ = ( *iListe )->level; 200 else level_ = Run->level;
194 item->setText( 2 , QString::number( points_ ) ); //points 201 item->setText( 2 , QString::number( points_ ) ); //points
195 item->setText( 3 , QString::number( level_ ) ); //level 202 item->setText( 3 , QString::number( level_ ) ); //level
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
@@ -13,10 +13,11 @@ class QListView;
13 13
14#include <qdialog.h> 14#include <qdialog.h>
15#include <list> 15#include <qlist.h>
16 16
17using namespace std; 17class t_playerData
18
19struct t_playerData
20{ 18{
19
20public :
21
21 QString sName; 22 QString sName;
22 int points; 23 int points;
@@ -46,5 +47,5 @@ class OHighscore : public QWidget
46 void insertData( QString , int , int ); 47 void insertData( QString , int , int );
47 48
48 list<t_playerData*> playerData; 49 QList<t_playerData> playerData;
49 50
50 /* 51 /*
@@ -54,6 +55,4 @@ class OHighscore : public QWidget
54 private: 55 private:
55 56
56 list<t_playerData*>::iterator iPlayerData;
57
58 /* 57 /*
59 * the lowest score in the highscorelist 58 * 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
@@ -13,5 +13,5 @@ SOURCES = main.cpp \
13INCLUDEPATH += $(OPIEDIR)/include 13INCLUDEPATH += $(OPIEDIR)/include
14 DEPENDPATH+= $(OPIEDIR)/include 14 DEPENDPATH+= $(OPIEDIR)/include
15LIBS += -lqpe -lopiecore2 -lstdc++ 15LIBS += -lqpe -lopiecore2
16 INTERFACES= 16 INTERFACES=
17 TARGET = tetrix 17 TARGET = tetrix