summaryrefslogtreecommitdiff
path: root/noncore/games/tetrix/qtetrixb.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/tetrix/qtetrixb.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/tetrix/qtetrixb.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/games/tetrix/qtetrixb.cpp b/noncore/games/tetrix/qtetrixb.cpp
index 3c179df..8c41fb2 100644
--- a/noncore/games/tetrix/qtetrixb.cpp
+++ b/noncore/games/tetrix/qtetrixb.cpp
@@ -47,24 +47,25 @@ QTetrixBoard::QTetrixBoard( QWidget *p, const char *name )
blockHeight = 20;
noGame = TRUE;
isPaused = FALSE;
waitingAfterLine = FALSE;
updateTimeoutTime(); // Sets timeoutTime
}
void QTetrixBoard::startGame(int gameType,int fillRandomLines)
{
if ( isPaused )
return; // ignore if game is paused
noGame = FALSE;
+
GenericTetrix::startGame( gameType, fillRandomLines );
// Note that the timer is started by updateLevel!
}
void QTetrixBoard::pause()
{
if ( noGame ) // game not active
return;
isPaused = !isPaused;
if ( isPaused ) {
timer->stop();
@@ -197,26 +198,29 @@ void QTetrixBoard::drawContents( QPainter *p )
y2 = 0;
if (y2 >= boardHeight())
y2 = boardHeight() - 1;
updateBoard( x1, y1, x2, y2, TRUE );
paint = 0; // reset widget painter
return;
}
void QTetrixBoard::resizeEvent(QResizeEvent *e)
{
QSize sz = e->size();
+
blockWidth = (sz.width() - 2)/10;
blockHeight = (sz.height() - 2)/22;
+/* blockWidth > blockHeight ? blockWidth = blockHeight
+ : blockHeight = blockWidth;*/
xOffset = 1;
//yOffset = 1;
yOffset = (sz.height() - 2) - (blockHeight *22);
}
void QTetrixBoard::keyPressEvent( QKeyEvent *e )
{
if ( noGame || isPaused || waitingAfterLine )
return;
switch( e->key() ) {
case Key_Left :
moveLeft();