summaryrefslogtreecommitdiff
path: root/noncore/games
Unidiff
Diffstat (limited to 'noncore/games') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/solitaire/canvascard.cpp2
-rw-r--r--noncore/games/tetrix/ohighscoredlg.cpp7
2 files changed, 1 insertions, 8 deletions
diff --git a/noncore/games/solitaire/canvascard.cpp b/noncore/games/solitaire/canvascard.cpp
index cd298ef..3ed9ea0 100644
--- a/noncore/games/solitaire/canvascard.cpp
+++ b/noncore/games/solitaire/canvascard.cpp
@@ -193,49 +193,49 @@ void CanvasCard::draw(QPainter &painter)
193 p->setPen( QColor( 0xFF, 0, 0 ) ); 193 p->setPen( QColor( 0xFF, 0, 0 ) );
194 else 194 else
195 p->setPen( QColor( 0, 0, 0 ) ); 195 p->setPen( QColor( 0, 0, 0 ) );
196 196
197 if ( qt_screen->deviceWidth() < 200 ) { 197 if ( qt_screen->deviceWidth() < 200 ) {
198 p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); 198 p->drawPixmap( ix + 0, iy + 0, *cardsFaces );
199 p->drawPixmap( ix + 3, iy + 3, *cardsChars, 5*(getValue()-1), 0, 5, 6 ); 199 p->drawPixmap( ix + 3, iy + 3, *cardsChars, 5*(getValue()-1), 0, 5, 6 );
200 p->drawPixmap( ix + 11, iy + 3, *cardsSuits, 5*(getSuit()-1), 0, 5, 6 ); 200 p->drawPixmap( ix + 11, iy + 3, *cardsSuits, 5*(getSuit()-1), 0, 5, 6 );
201 p->drawPixmap( ix + w-3-5, iy + h-3-6, *cardsCharsUpsideDown, 5*(12-getValue()+1), 0, 5, 6 ); 201 p->drawPixmap( ix + w-3-5, iy + h-3-6, *cardsCharsUpsideDown, 5*(12-getValue()+1), 0, 5, 6 );
202 p->drawPixmap( ix + w-11-5, iy + h-3-6, *cardsSuitsUpsideDown, 5*(3-getSuit()+1), 0, 5, 6 ); 202 p->drawPixmap( ix + w-11-5, iy + h-3-6, *cardsSuitsUpsideDown, 5*(3-getSuit()+1), 0, 5, 6 );
203 } else { 203 } else {
204 p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); 204 p->drawPixmap( ix + 0, iy + 0, *cardsFaces );
205 p->drawPixmap( ix + 4, iy + 4, *cardsChars, 7*(getValue()-1), 0, 7, 7 ); 205 p->drawPixmap( ix + 4, iy + 4, *cardsChars, 7*(getValue()-1), 0, 7, 7 );
206 p->drawPixmap( ix + 12, iy + 4, *cardsSuits, 7*(getSuit()-1), 0, 7, 8 ); 206 p->drawPixmap( ix + 12, iy + 4, *cardsSuits, 7*(getSuit()-1), 0, 7, 8 );
207 p->drawPixmap( ix + w-4-7, iy + h-4-7, *cardsCharsUpsideDown, 7*(12-getValue()+1), 0, 7, 7 ); 207 p->drawPixmap( ix + w-4-7, iy + h-4-7, *cardsCharsUpsideDown, 7*(12-getValue()+1), 0, 7, 7 );
208 p->drawPixmap( ix + w-12-7, iy + h-5-7, *cardsSuitsUpsideDown, 7*(3-getSuit()+1), 0, 7, 8 ); 208 p->drawPixmap( ix + w-12-7, iy + h-5-7, *cardsSuitsUpsideDown, 7*(3-getSuit()+1), 0, 7, 8 );
209 } 209 }
210 210
211 } else { 211 } else {
212 212
213 p->drawPixmap( ix, iy, *cardsBacks ); 213 p->drawPixmap( ix, iy, *cardsBacks );
214 214
215 } 215 }
216 216
217 if (p != &painter) 217 if (p != &painter && unscaledCard)
218 { 218 {
219 p->end(); 219 p->end();
220 QPixmap *scaledCard = CreateScaledPixmap( unscaledCard, scaleX, scaleY ); 220 QPixmap *scaledCard = CreateScaledPixmap( unscaledCard, scaleX, scaleY );
221 int xoff = scaledCard->width() / 2; 221 int xoff = scaledCard->width() / 2;
222 int yoff = scaledCard->height() / 2; 222 int yoff = scaledCard->height() / 2;
223 painter.drawPixmap( (int)x() + xOff - xoff, (int)y() + yOff - yoff, *scaledCard ); 223 painter.drawPixmap( (int)x() + xOff - xoff, (int)y() + yOff - yoff, *scaledCard );
224 delete p; 224 delete p;
225 delete unscaledCard; 225 delete unscaledCard;
226 delete scaledCard; 226 delete scaledCard;
227 } 227 }
228} 228}
229 229
230 230
231static const double flipLift = 1.5; 231static const double flipLift = 1.5;
232 232
233 233
234void CanvasCard::flipTo(int x2, int y2, int steps) 234void CanvasCard::flipTo(int x2, int y2, int steps)
235{ 235{
236 flipSteps = steps; 236 flipSteps = steps;
237 237
238#ifdef SLOW_HARDWARE 238#ifdef SLOW_HARDWARE
239 move(x2,y2); 239 move(x2,y2);
240 Card::flipTo(x2,y2,steps); 240 Card::flipTo(x2,y2,steps);
241#else 241#else
diff --git a/noncore/games/tetrix/ohighscoredlg.cpp b/noncore/games/tetrix/ohighscoredlg.cpp
index 66f4917..504385f 100644
--- a/noncore/games/tetrix/ohighscoredlg.cpp
+++ b/noncore/games/tetrix/ohighscoredlg.cpp
@@ -153,54 +153,47 @@ QString OHighscore::getName()
153 153
154OHighscoreDialog::OHighscoreDialog(OHighscore *highscore, QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) 154OHighscoreDialog::OHighscoreDialog(OHighscore *highscore, QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal)
155{ 155{
156 hs_ = highscore; 156 hs_ = highscore;
157 setCaption( tr( "Highscores" ) ); 157 setCaption( tr( "Highscores" ) );
158 vbox_layout = new QVBoxLayout( this, 4 , 4 ); 158 vbox_layout = new QVBoxLayout( this, 4 , 4 );
159 list = new QListView( this ); 159 list = new QListView( this );
160 list->setSorting( -1 ); 160 list->setSorting( -1 );
161 list->addColumn( tr( "#" )); 161 list->addColumn( tr( "#" ));
162 list->addColumn( tr( "Name" )); 162 list->addColumn( tr( "Name" ));
163 list->addColumn( tr( "Points" )); 163 list->addColumn( tr( "Points" ));
164 list->addColumn( tr( "Level" )); 164 list->addColumn( tr( "Level" ));
165 165
166 createHighscoreListView(); 166 createHighscoreListView();
167 167
168 vbox_layout->addWidget( list ); 168 vbox_layout->addWidget( list );
169 QPEApplication::showDialog( this ); 169 QPEApplication::showDialog( this );
170} 170}
171 171
172void OHighscoreDialog::createHighscoreListView() 172void OHighscoreDialog::createHighscoreListView()
173{ 173{
174 int pos = 10; 174 int pos = 10;
175 int points_ = 0; 175 int points_ = 0;
176 int level_ = 0; 176 int level_ = 0;
177 QListViewItem * Prev = 0;
178 177
179 for ( t_playerData * Run = hs_->playerData.first(); 178 for ( t_playerData * Run = hs_->playerData.first();
180 Run != 0; 179 Run != 0;
181 Run=hs_->playerData.next() ) 180 Run=hs_->playerData.next() )
182 { 181 {
183 QListViewItem *item; 182 QListViewItem *item;
184 183
185 if( Prev ) {
186 // after previous
187 item = new QListViewItem( list, Prev );
188 Prev = item;
189 } else {
190 item = new QListViewItem( list ); 184 item = new QListViewItem( list );
191 185
192 }
193 item->setText( 0 , QString::number( pos ) ); //number 186 item->setText( 0 , QString::number( pos ) ); //number
194 item->setText( 1 , Run->sName ); //name 187 item->setText( 1 , Run->sName ); //name
195 if ( Run->points == -1 ) 188 if ( Run->points == -1 )
196 points_ = 0; 189 points_ = 0;
197 else points_ = Run->points; 190 else points_ = Run->points;
198 if ( Run->level == -1 ) 191 if ( Run->level == -1 )
199 level_ = 0; 192 level_ = 0;
200 else level_ = Run->level; 193 else level_ = Run->level;
201 item->setText( 2 , QString::number( points_ ) ); //points 194 item->setText( 2 , QString::number( points_ ) ); //points
202 item->setText( 3 , QString::number( level_ ) ); //level 195 item->setText( 3 , QString::number( level_ ) ); //level
203 pos--; 196 pos--;
204 } 197 }
205} 198}
206 199