author | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
commit | 0c74629e8f5c12a9b5a282b817f884fa10dee491 (patch) (unidiff) | |
tree | 3294663b92023f8d24d68a01022e011a3c94002d /noncore/games/minesweep/minefield.cpp | |
parent | 46ce5afcfbe7be19f4d5ac0fed6886a0759f1a25 (diff) | |
download | opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.zip opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.gz opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.bz2 |
Merge from the 1.0.x release
Diffstat (limited to 'noncore/games/minesweep/minefield.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/minesweep/minefield.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/minesweep/minefield.cpp b/noncore/games/minesweep/minefield.cpp index eca1a36..04cfb97 100644 --- a/noncore/games/minesweep/minefield.cpp +++ b/noncore/games/minesweep/minefield.cpp | |||
@@ -332,49 +332,49 @@ void MineField::setup( int level ) | |||
332 | for ( i = 0; i < numCols*numRows; i++ ) | 332 | for ( i = 0; i < numCols*numRows; i++ ) |
333 | { | 333 | { |
334 | delete mines[i]; | 334 | delete mines[i]; |
335 | } | 335 | } |
336 | delete[] mines; | 336 | delete[] mines; |
337 | } | 337 | } |
338 | 338 | ||
339 | switch( lev ) { | 339 | switch( lev ) { |
340 | case 1: | 340 | case 1: |
341 | numRows = 9 ; | 341 | numRows = 9 ; |
342 | numCols = 9 ; | 342 | numCols = 9 ; |
343 | minecount = 12; | 343 | minecount = 12; |
344 | break; | 344 | break; |
345 | case 2: | 345 | case 2: |
346 | numRows = 16; | 346 | numRows = 16; |
347 | numCols = 16; | 347 | numCols = 16; |
348 | minecount = 45; | 348 | minecount = 45; |
349 | break; | 349 | break; |
350 | case 3: | 350 | case 3: |
351 | numCols = 18; | 351 | numCols = 18; |
352 | numRows = 18; | 352 | numRows = 18; |
353 | minecount = 66 ; | 353 | minecount = 66 ; |
354 | break; | 354 | break; |
355 | } | 355 | } |
356 | mines = new (Mine*)[numRows*numCols]; | 356 | mines = new Mine*[numRows*numCols]; |
357 | for ( i = 0; i < numCols*numRows; i++ ) | 357 | for ( i = 0; i < numCols*numRows; i++ ) |
358 | mines[i] = new Mine( this ); | 358 | mines[i] = new Mine( this ); |
359 | 359 | ||
360 | 360 | ||
361 | nonminecount = numRows*numCols - minecount; | 361 | nonminecount = numRows*numCols - minecount; |
362 | mineguess = minecount; | 362 | mineguess = minecount; |
363 | emit mineCount( mineguess ); | 363 | emit mineCount( mineguess ); |
364 | Mine::paletteChange(); | 364 | Mine::paletteChange(); |
365 | 365 | ||
366 | if ( availableRect.isValid() ) | 366 | if ( availableRect.isValid() ) |
367 | setCellSize(findCellSize()); | 367 | setCellSize(findCellSize()); |
368 | // viewport()->setUpdatesEnabled( TRUE ); | 368 | // viewport()->setUpdatesEnabled( TRUE ); |
369 | //viewport()->repaint( TRUE ); | 369 | //viewport()->repaint( TRUE ); |
370 | updateContents( 0, 0, numCols*cellSize, numRows*cellSize ); | 370 | updateContents( 0, 0, numCols*cellSize, numRows*cellSize ); |
371 | updateGeometry(); | 371 | updateGeometry(); |
372 | } | 372 | } |
373 | 373 | ||
374 | void MineField::drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ) | 374 | void MineField::drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ) |
375 | { | 375 | { |
376 | int c1 = clipx / cellSize; | 376 | int c1 = clipx / cellSize; |
377 | int c2 = ( clipx + clipw - 1 ) / cellSize; | 377 | int c2 = ( clipx + clipw - 1 ) / cellSize; |
378 | int r1 = clipy / cellSize; | 378 | int r1 = clipy / cellSize; |
379 | int r2 = ( clipy + cliph - 1 ) / cellSize; | 379 | int r2 = ( clipy + cliph - 1 ) / cellSize; |
380 | 380 | ||