-rw-r--r-- | noncore/games/backgammon/backgammon.cpp | 16 | ||||
-rw-r--r-- | noncore/games/backgammon/moveengine.cpp | 2 | ||||
-rw-r--r-- | noncore/games/bounce/bounce.pro | 5 | ||||
-rw-r--r-- | noncore/games/bounce/game.cpp | 15 | ||||
-rw-r--r-- | noncore/games/go/go.pro | 15 | ||||
-rw-r--r-- | noncore/games/go/gowidget.cpp | 9 | ||||
-rw-r--r-- | noncore/games/kpacman/kpacman.pro | 4 | ||||
-rw-r--r-- | noncore/games/kpacman/kpacmanwidget.cpp | 5 | ||||
-rw-r--r-- | noncore/games/kpacman/status.cpp | 5 | ||||
-rw-r--r-- | noncore/games/mindbreaker/mindbreaker.cpp | 2 | ||||
-rw-r--r-- | noncore/games/oyatzee/oyatzee.cpp | 50 | ||||
-rw-r--r-- | noncore/games/oyatzee/oyatzee.pro | 2 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 2 |
13 files changed, 75 insertions, 57 deletions
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp index 51020a0..bdb1c78 100644 --- a/noncore/games/backgammon/backgammon.cpp +++ b/noncore/games/backgammon/backgammon.cpp | |||
@@ -1,48 +1,52 @@ | |||
1 | #include "backgammon.h" | 1 | #include "backgammon.h" |
2 | |||
3 | #include "aidialog.h" | 2 | #include "aidialog.h" |
4 | #include "filedialog.h" | 3 | #include "filedialog.h" |
5 | #include "playerdialog.h" | 4 | #include "playerdialog.h" |
6 | #include "rulesdialog.h" | 5 | #include "rulesdialog.h" |
7 | #include "themedialog.h" | 6 | #include "themedialog.h" |
8 | 7 | ||
8 | /* OPIE */ | ||
9 | #include <opie2/odebug.h> | ||
10 | #include <qpe/qpeapplication.h> | ||
11 | #include <qpe/config.h> | ||
12 | #include <qpe/resource.h> | ||
13 | using namespace Opie::Core; | ||
14 | |||
15 | /* QT */ | ||
9 | #include <qfile.h> | 16 | #include <qfile.h> |
10 | #include <qlayout.h> | 17 | #include <qlayout.h> |
11 | #include <qmessagebox.h> | 18 | #include <qmessagebox.h> |
12 | #include <qtimer.h> | 19 | #include <qtimer.h> |
13 | #include <qpe/qpeapplication.h> | ||
14 | #include <qpe/config.h> | ||
15 | #include <qmenubar.h> | 20 | #include <qmenubar.h> |
16 | #include <qpe/resource.h> | ||
17 | 21 | ||
18 | #include <stdlib.h> | 22 | #include <stdlib.h> |
19 | 23 | ||
20 | 24 | ||
21 | BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) | 25 | BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) |
22 | : QMainWindow(parent, name, fl) | 26 | : QMainWindow(parent, name, fl) |
23 | { | 27 | { |
24 | if (!name) setName("BackGammon"); | 28 | if (!name) setName("BackGammon"); |
25 | setCaption(tr( "Backgammon") ); | 29 | setCaption(tr( "Backgammon") ); |
26 | setIcon( Resource::loadPixmap( "backgammon" ) ); | 30 | setIcon( Resource::loadPixmap( "backgammon" ) ); |
27 | //general counter varaible | 31 | //general counter varaible |
28 | int a=0; | 32 | int a=0; |
29 | //the game engine | 33 | //the game engine |
30 | move=new MoveEngine(); | 34 | move=new MoveEngine(); |
31 | 35 | ||
32 | //load the default theme | 36 | //load the default theme |
33 | Config conf("backgammon"); | 37 | Config conf("backgammon"); |
34 | if(!conf.isValid()) | 38 | if(!conf.isValid()) |
35 | { | 39 | { |
36 | qDebug("config file does not exist"); | 40 | odebug << "config file does not exist" << oendl; |
37 | conf.setGroup("general"); | 41 | conf.setGroup("general"); |
38 | conf.writeEntry("theme","default"); | 42 | conf.writeEntry("theme","default"); |
39 | conf.setGroup("rules"); | 43 | conf.setGroup("rules"); |
40 | conf.writeEntry("move_with_pieces_out",false); | 44 | conf.writeEntry("move_with_pieces_out",false); |
41 | conf.writeEntry("nice_dice",false); | 45 | conf.writeEntry("nice_dice",false); |
42 | conf.setGroup("display"); | 46 | conf.setGroup("display"); |
43 | conf.writeEntry("small",false); | 47 | conf.writeEntry("small",false); |
44 | conf.writeEntry("warning",true); | 48 | conf.writeEntry("warning",true); |
45 | conf.setGroup("ai"); | 49 | conf.setGroup("ai"); |
46 | conf.writeEntry("rescue",6); | 50 | conf.writeEntry("rescue",6); |
47 | conf.writeEntry("eliminate",4); | 51 | conf.writeEntry("eliminate",4); |
48 | conf.writeEntry("expose",1); | 52 | conf.writeEntry("expose",1); |
@@ -69,25 +73,25 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) | |||
69 | ai.eliminate=conf.readNumEntry("eliminate",4); | 73 | ai.eliminate=conf.readNumEntry("eliminate",4); |
70 | ai.expose=conf.readNumEntry("expose",1); | 74 | ai.expose=conf.readNumEntry("expose",1); |
71 | ai.protect=conf.readNumEntry("protect",5); | 75 | ai.protect=conf.readNumEntry("protect",5); |
72 | ai.safe=conf.readNumEntry("safe",3); | 76 | ai.safe=conf.readNumEntry("safe",3); |
73 | ai.empty=conf.readNumEntry("empty",2); | 77 | ai.empty=conf.readNumEntry("empty",2); |
74 | move->setAISettings(ai); | 78 | move->setAISettings(ai); |
75 | 79 | ||
76 | 80 | ||
77 | //get the theme component names | 81 | //get the theme component names |
78 | Config theme(theme_file,Config::File); | 82 | Config theme(theme_file,Config::File); |
79 | if(!theme.isValid()) | 83 | if(!theme.isValid()) |
80 | { | 84 | { |
81 | qDebug("theme file does not exist"); | 85 | odebug << "theme file does not exist" << oendl; |
82 | theme.setGroup("theme"); | 86 | theme.setGroup("theme"); |
83 | theme.writeEntry("board","casino_board_1"); | 87 | theme.writeEntry("board","casino_board_1"); |
84 | theme.writeEntry("pieces1","casino_pieces_blue"); | 88 | theme.writeEntry("pieces1","casino_pieces_blue"); |
85 | theme.writeEntry("pieces2","casino_pieces_white"); | 89 | theme.writeEntry("pieces2","casino_pieces_white"); |
86 | theme.writeEntry("dice1","casino_dice"); | 90 | theme.writeEntry("dice1","casino_dice"); |
87 | theme.writeEntry("dice2","casino_dice"); | 91 | theme.writeEntry("dice2","casino_dice"); |
88 | theme.writeEntry("table","casino_table_green"); | 92 | theme.writeEntry("table","casino_table_green"); |
89 | theme.writeEntry("odds","casino_odds"); | 93 | theme.writeEntry("odds","casino_odds"); |
90 | } | 94 | } |
91 | theme.setGroup("theme"); | 95 | theme.setGroup("theme"); |
92 | board_name=theme.readEntry("board","casino_board_1"); | 96 | board_name=theme.readEntry("board","casino_board_1"); |
93 | piecesA_name=theme.readEntry("pieces1","casino_pieces_blue"); | 97 | piecesA_name=theme.readEntry("pieces1","casino_pieces_blue"); |
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp index 7de7147..a4145cc 100644 --- a/noncore/games/backgammon/moveengine.cpp +++ b/noncore/games/backgammon/moveengine.cpp | |||
@@ -448,25 +448,25 @@ int MoveEngine::getPossibleMoves() | |||
448 | } | 448 | } |
449 | 449 | ||
450 | int total=0; | 450 | int total=0; |
451 | for(int field=0;field<26;field++) | 451 | for(int field=0;field<26;field++) |
452 | { | 452 | { |
453 | total+=moves[field].weight[0]+moves[field].weight[1]+moves[field].weight[2]+moves[field].weight[3]; | 453 | total+=moves[field].weight[0]+moves[field].weight[1]+moves[field].weight[2]+moves[field].weight[3]; |
454 | } | 454 | } |
455 | return total; | 455 | return total; |
456 | } | 456 | } |
457 | 457 | ||
458 | void MoveEngine::move(const int& from, int to, const int& dice) | 458 | void MoveEngine::move(const int& from, int to, const int& dice) |
459 | { | 459 | { |
460 | //qDebug("%d moves from %d to %d (%d) with dice %d",player,from,to,to-from,dice); | 460 | //odebug << "" << player << " moves from " << from << " to " << to << " (" << to-from << ") with dice " << dice << "" << oendl; |
461 | 461 | ||
462 | if(player==1 && to==25) | 462 | if(player==1 && to==25) |
463 | to=26; | 463 | to=26; |
464 | if(player==2 && to==0) | 464 | if(player==2 && to==0) |
465 | to=27; | 465 | to=27; |
466 | 466 | ||
467 | //if space is occupied by enemy move pieces to startzone | 467 | //if space is occupied by enemy move pieces to startzone |
468 | if(fieldColor(to)==otherplayer) | 468 | if(fieldColor(to)==otherplayer) |
469 | { | 469 | { |
470 | population[to].total=0; | 470 | population[to].total=0; |
471 | if(otherplayer==1) | 471 | if(otherplayer==1) |
472 | population[0].total++; | 472 | population[0].total++; |
diff --git a/noncore/games/bounce/bounce.pro b/noncore/games/bounce/bounce.pro index ba745c8..56a325c 100644 --- a/noncore/games/bounce/bounce.pro +++ b/noncore/games/bounce/bounce.pro | |||
@@ -1,10 +1,9 @@ | |||
1 | #CONFIG = qt warn_on | 1 | CONFIG = qt warn_on quick-app |
2 | CONFIG = qt warn_on quick-app | ||
3 | HEADERS = game.h kbounce.h | 2 | HEADERS = game.h kbounce.h |
4 | SOURCES = game.cpp kbounce.cpp main.cpp | 3 | SOURCES = game.cpp kbounce.cpp main.cpp |
5 | INCLUDEPATH+= $(OPIEDIR)/include | 4 | INCLUDEPATH+= $(OPIEDIR)/include |
6 | DEPENDPATH+= $(OPIEDIR)/include | 5 | DEPENDPATH+= $(OPIEDIR)/include |
7 | LIBS += -lqpe -lopiecore2 | 6 | LIBS += -lqpe -lopiecore2 |
8 | TARGET = bounce | 7 | TARGET = bounce |
9 | 8 | ||
10 | include ( $(OPIEDIR)/include.pro ) | 9 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp index 1f1f8cd..bbd3d0b 100644 --- a/noncore/games/bounce/game.cpp +++ b/noncore/games/bounce/game.cpp | |||
@@ -8,29 +8,36 @@ | |||
8 | * | 8 | * |
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Library General Public License for more details. | 12 | * Library General Public License for more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public |
15 | * License along with this program; if not, write to the Free | 15 | * License along with this program; if not, write to the Free |
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | 19 | ||
20 | #include <stdlib.h> | 20 | #include "game.h" |
21 | #include <qtimer.h> | 21 | |
22 | /* OPIE */ | ||
23 | #include <opie2/odebug.h> | ||
22 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | using namespace Opie::Core; | ||
23 | 26 | ||
24 | #include "game.h" | 27 | /* QT */ |
28 | #include <qtimer.h> | ||
29 | |||
30 | /* STD */ | ||
31 | #include <stdlib.h> | ||
25 | 32 | ||
26 | #define TILE_SIZE 9 | 33 | #define TILE_SIZE 9 |
27 | 34 | ||
28 | #define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2)) | 35 | #define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2)) |
29 | #define TILE_FREE (TILE_FIRST + 0) | 36 | #define TILE_FREE (TILE_FIRST + 0) |
30 | #define TILE_BORDER (TILE_FIRST + 1) | 37 | #define TILE_BORDER (TILE_FIRST + 1) |
31 | #define TILE_WALLEND (TILE_FIRST + 2) | 38 | #define TILE_WALLEND (TILE_FIRST + 2) |
32 | #define TILE_WALLUP (TILE_FIRST + 3) | 39 | #define TILE_WALLUP (TILE_FIRST + 3) |
33 | #define TILE_WALLDOWN (TILE_FIRST + 4) | 40 | #define TILE_WALLDOWN (TILE_FIRST + 4) |
34 | #define TILE_WALLLEFT (TILE_FIRST + 5) | 41 | #define TILE_WALLLEFT (TILE_FIRST + 5) |
35 | #define TILE_WALLRIGHT (TILE_FIRST + 6) | 42 | #define TILE_WALLRIGHT (TILE_FIRST + 6) |
36 | 43 | ||
@@ -358,25 +365,25 @@ JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name ) | |||
358 | } | 365 | } |
359 | 366 | ||
360 | JezzGame::~JezzGame() | 367 | JezzGame::~JezzGame() |
361 | { | 368 | { |
362 | m_balls.clear(); | 369 | m_balls.clear(); |
363 | delete m_view; | 370 | delete m_view; |
364 | delete m_field; | 371 | delete m_field; |
365 | delete m_ballPixmaps; | 372 | delete m_ballPixmaps; |
366 | } | 373 | } |
367 | 374 | ||
368 | void JezzGame::display( QString text, int size ) | 375 | void JezzGame::display( QString text, int size ) |
369 | { | 376 | { |
370 | qDebug("This function \"display\" shouldn't be called!!!"); | 377 | odebug << "This function \"display\" shouldn't be called!!!" << oendl; |
371 | if ( !text.isEmpty() ) | 378 | if ( !text.isEmpty() ) |
372 | { | 379 | { |
373 | QFont font( "Helvetica", size, QFont::Bold ); | 380 | QFont font( "Helvetica", size, QFont::Bold ); |
374 | font.setStyleHint( QFont::Helvetica ); | 381 | font.setStyleHint( QFont::Helvetica ); |
375 | m_text->setFont( font ); | 382 | m_text->setFont( font ); |
376 | m_text->setText( text ); | 383 | m_text->setText( text ); |
377 | 384 | ||
378 | QRect size = m_text->boundingRect(); | 385 | QRect size = m_text->boundingRect(); |
379 | m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2, | 386 | m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2, |
380 | ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 ); | 387 | ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 ); |
381 | 388 | ||
382 | m_text->show(); | 389 | m_text->show(); |
diff --git a/noncore/games/go/go.pro b/noncore/games/go/go.pro index b73bbb0..72425a5 100644 --- a/noncore/games/go/go.pro +++ b/noncore/games/go/go.pro | |||
@@ -1,19 +1,18 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = amigo.h \ | 2 | HEADERS = amigo.h \ |
3 | go.h \ | 3 | go.h \ |
4 | goplayutils.h \ | 4 | goplayutils.h \ |
5 | gowidget.h | 5 | gowidget.h |
6 | SOURCES = amigo.c \ | 6 | SOURCES = amigo.c \ |
7 | goplayer.c \ | 7 | goplayer.c \ |
8 | goplayutils.c \ | 8 | goplayutils.c \ |
9 | killable.c \ | 9 | killable.c \ |
10 | gowidget.cpp \ | 10 | gowidget.cpp \ |
11 | main.cpp | 11 | main.cpp |
12 | INCLUDEPATH += $(OPIEDIR)/include | 12 | INCLUDEPATH += $(OPIEDIR)/include |
13 | DEPENDPATH+= $(OPIEDIR)/include | 13 | DEPENDPATH+= $(OPIEDIR)/include |
14 | LIBS += -lqpe -lopiecore2 | 14 | LIBS += -lqpe -lopiecore2 |
15 | TARGET = go | 15 | TARGET = go |
16 | 16 | ||
17 | 17 | ||
18 | |||
19 | include ( $(OPIEDIR)/include.pro ) | 18 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp index d134540..ec03c1d 100644 --- a/noncore/games/go/gowidget.cpp +++ b/noncore/games/go/gowidget.cpp | |||
@@ -11,37 +11,38 @@ | |||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "gowidget.h" | 21 | #include "gowidget.h" |
22 | 22 | ||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
23 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
24 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | using namespace Opie::Core; | ||
25 | 28 | ||
29 | /* QT */ | ||
26 | #include <qpainter.h> | 30 | #include <qpainter.h> |
27 | #include <qtoolbar.h> | 31 | #include <qtoolbar.h> |
28 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
29 | #include <qaction.h> | 33 | #include <qaction.h> |
30 | #include <qapplication.h> //processEvents() | 34 | #include <qapplication.h> //processEvents() |
31 | #include <qlabel.h> | 35 | #include <qlabel.h> |
32 | 36 | ||
33 | //#include <stdio.h> | ||
34 | |||
35 | |||
36 | static const enum bVal computer_color = BLACK; | 37 | static const enum bVal computer_color = BLACK; |
37 | 38 | ||
38 | static int current_handicap = 1; | 39 | static int current_handicap = 1; |
39 | 40 | ||
40 | static QBrush *goBrush; | 41 | static QBrush *goBrush; |
41 | //static QImage *newBlackStone; | 42 | //static QImage *newBlackStone; |
42 | //static QImage *blackStone; | 43 | //static QImage *blackStone; |
43 | //static QImage *whiteStone; | 44 | //static QImage *whiteStone; |
44 | static QPixmap *newBlackStone; | 45 | static QPixmap *newBlackStone; |
45 | static QPixmap *blackStone; | 46 | static QPixmap *blackStone; |
46 | static QPixmap *whiteStone; | 47 | static QPixmap *whiteStone; |
47 | 48 | ||
@@ -439,22 +440,22 @@ extern "C" { | |||
439 | voidremovestone(short x, short y) | 440 | voidremovestone(short x, short y) |
440 | { | 441 | { |
441 | GoWidget::self->removeStone(x,y); | 442 | GoWidget::self->removeStone(x,y); |
442 | } | 443 | } |
443 | 444 | ||
444 | voidplacestone (enum bVal c, short x, short y ) | 445 | voidplacestone (enum bVal c, short x, short y ) |
445 | { | 446 | { |
446 | GoWidget::self->placeStone(c,x,y); | 447 | GoWidget::self->placeStone(c,x,y); |
447 | } | 448 | } |
448 | 449 | ||
449 | voidintrMoveReport(enum bVal c ,char *coord ,char *reason ) | 450 | voidintrMoveReport(enum bVal c ,char *coord ,char *reason ) |
450 | { | 451 | { |
451 | qDebug( "intrMoveReport colour %d, %s %s", c, coord, reason ); | 452 | odebug << "intrMoveReport colour " << c << ", " << coord << " " << reason << "" << oendl; |
452 | } | 453 | } |
453 | 454 | ||
454 | voidintrPrisonerReport( short blackcnt, short whitecnt ) | 455 | voidintrPrisonerReport( short blackcnt, short whitecnt ) |
455 | { | 456 | { |
456 | GoWidget::self->reportPrisoners(blackcnt,whitecnt); | 457 | GoWidget::self->reportPrisoners(blackcnt,whitecnt); |
457 | } | 458 | } |
458 | 459 | ||
459 | } | 460 | } |
460 | 461 | ||
diff --git a/noncore/games/kpacman/kpacman.pro b/noncore/games/kpacman/kpacman.pro index 8453f78..45314f9 100644 --- a/noncore/games/kpacman/kpacman.pro +++ b/noncore/games/kpacman/kpacman.pro | |||
@@ -1,16 +1,14 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | #CONFIG = qt warn_on | ||
3 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
4 | #TMAKE_CXXFLAGS+= | ||
5 | HEADERS = kpacmanwidget.h \ | 3 | HEADERS = kpacmanwidget.h \ |
6 | referee.h \ | 4 | referee.h \ |
7 | status.h \ | 5 | status.h \ |
8 | painter.h \ | 6 | painter.h \ |
9 | score.h \ | 7 | score.h \ |
10 | pacman.h \ | 8 | pacman.h \ |
11 | monster.h \ | 9 | monster.h \ |
12 | keys.h \ | 10 | keys.h \ |
13 | fruit.h \ | 11 | fruit.h \ |
14 | energizer.h \ | 12 | energizer.h \ |
15 | board.h \ | 13 | board.h \ |
16 | bitfont.h \ | 14 | bitfont.h \ |
@@ -25,17 +23,17 @@ SOURCES = kpacmanwidget.cpp \ | |||
25 | score.cpp \ | 23 | score.cpp \ |
26 | pacman.cpp \ | 24 | pacman.cpp \ |
27 | monster.cpp \ | 25 | monster.cpp \ |
28 | keys.cpp \ | 26 | keys.cpp \ |
29 | fruit.cpp \ | 27 | fruit.cpp \ |
30 | energizer.cpp \ | 28 | energizer.cpp \ |
31 | board.cpp \ | 29 | board.cpp \ |
32 | bitfont.cpp \ | 30 | bitfont.cpp \ |
33 | kpacman.cpp \ | 31 | kpacman.cpp \ |
34 | main.cpp | 32 | main.cpp |
35 | INCLUDEPATH+= $(OPIEDIR)/include | 33 | INCLUDEPATH+= $(OPIEDIR)/include |
36 | DEPENDPATH+= $(OPIEDIR)/include | 34 | DEPENDPATH+= $(OPIEDIR)/include |
37 | LIBS += -lqpe | 35 | LIBS += -lqpe -lopiecore2 |
38 | DESTDIR = $(OPIEDIR)/bin | 36 | DESTDIR = $(OPIEDIR)/bin |
39 | TARGET = kpacman | 37 | TARGET = kpacman |
40 | 38 | ||
41 | include ( $(OPIEDIR)/include.pro ) | 39 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp index 9631495..b59dd02 100644 --- a/noncore/games/kpacman/kpacmanwidget.cpp +++ b/noncore/games/kpacman/kpacmanwidget.cpp | |||
@@ -4,25 +4,26 @@ | |||
4 | #if defined( KDE2_PORT ) | 4 | #if defined( KDE2_PORT ) |
5 | #include <kapp.h> | 5 | #include <kapp.h> |
6 | #include <kconfig.h> | 6 | #include <kconfig.h> |
7 | #include <kstddirs.h> | 7 | #include <kstddirs.h> |
8 | #include <kpacmanwidget.h> | 8 | #include <kpacmanwidget.h> |
9 | #include <kpacmanwidget.moc> | 9 | #include <kpacmanwidget.moc> |
10 | #elif defined( QPE_PORT ) | 10 | #elif defined( QPE_PORT ) |
11 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
12 | #include <qpe/config.h> | 12 | #include <qpe/config.h> |
13 | #include "kpacmanwidget.h" | 13 | #include "kpacmanwidget.h" |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | 16 | #include <opie2/odebug.h> | |
17 | using namespace Opie::Core; | ||
17 | 18 | ||
18 | KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name) | 19 | KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name) |
19 | : QWidget( parent, name ) | 20 | : QWidget( parent, name ) |
20 | { | 21 | { |
21 | score = 0l; | 22 | score = 0l; |
22 | referee = 0l; | 23 | referee = 0l; |
23 | status = 0l; | 24 | status = 0l; |
24 | bitfont = NULL; | 25 | bitfont = NULL; |
25 | fontName = ""; | 26 | fontName = ""; |
26 | 27 | ||
27 | scheme = mode = -1; | 28 | scheme = mode = -1; |
28 | confScheme(); | 29 | confScheme(); |
@@ -130,24 +131,24 @@ void KpacmanWidget::setScheme(int Scheme, int Mode) | |||
130 | 131 | ||
131 | score->setScheme(Scheme, Mode, bitfont); | 132 | score->setScheme(Scheme, Mode, bitfont); |
132 | referee->setScheme(Scheme, Mode, bitfont); | 133 | referee->setScheme(Scheme, Mode, bitfont); |
133 | status->setScheme(Scheme, Mode); | 134 | status->setScheme(Scheme, Mode); |
134 | 135 | ||
135 | score->repaint(FALSE); | 136 | score->repaint(FALSE); |
136 | referee->repaint(FALSE); | 137 | referee->repaint(FALSE); |
137 | status->repaint(FALSE); | 138 | status->repaint(FALSE); |
138 | } | 139 | } |
139 | 140 | ||
140 | void KpacmanWidget::resizeEvent( QResizeEvent * ) | 141 | void KpacmanWidget::resizeEvent( QResizeEvent * ) |
141 | { | 142 | { |
142 | qWarning("Resize"); | 143 | owarn << "Resize" << oendl; |
143 | referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); | 144 | referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); |
144 | referee->setBackgroundColor(BLACK); | 145 | referee->setBackgroundColor(BLACK); |
145 | 146 | ||
146 | if(!status ) return; | 147 | if(!status ) return; |
147 | status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), | 148 | status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), |
148 | status->height()); | 149 | status->height()); |
149 | status->setBackgroundColor(BLACK); | 150 | status->setBackgroundColor(BLACK); |
150 | 151 | ||
151 | score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); | 152 | score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); |
152 | score->setBackgroundColor(BLACK); | 153 | score->setBackgroundColor(BLACK); |
153 | } | 154 | } |
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp index 02ff63d..db6938e 100644 --- a/noncore/games/kpacman/status.cpp +++ b/noncore/games/kpacman/status.cpp | |||
@@ -4,32 +4,35 @@ | |||
4 | #if defined( KDE2_PORT ) | 4 | #if defined( KDE2_PORT ) |
5 | #include <kapp.h> | 5 | #include <kapp.h> |
6 | #include <klocale.h> | 6 | #include <klocale.h> |
7 | #include <kstddirs.h> | 7 | #include <kstddirs.h> |
8 | #include <status.h> | 8 | #include <status.h> |
9 | #include <status.moc> | 9 | #include <status.moc> |
10 | #elif defined( QPE_PORT ) | 10 | #elif defined( QPE_PORT ) |
11 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
12 | #include <qpe/config.h> | 12 | #include <qpe/config.h> |
13 | #include "status.h" | 13 | #include "status.h" |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #include <opie2/odebug.h> | ||
17 | using namespace Opie::Core; | ||
18 | |||
16 | #include <qbitmap.h> | 19 | #include <qbitmap.h> |
17 | #include <qmsgbox.h> | 20 | #include <qmsgbox.h> |
18 | #include <qfileinfo.h> | 21 | #include <qfileinfo.h> |
19 | 22 | ||
20 | Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : | 23 | Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : |
21 | QWidget( parent, name ) | 24 | QWidget( parent, name ) |
22 | { | 25 | { |
23 | qWarning("Status::Status"); | 26 | owarn << "Status::Status" << oendl; |
24 | actualLifes = 0; | 27 | actualLifes = 0; |
25 | actualLevel = 0; | 28 | actualLevel = 0; |
26 | 29 | ||
27 | lifesPix = NULL; | 30 | lifesPix = NULL; |
28 | levelPix = NULL; | 31 | levelPix = NULL; |
29 | 32 | ||
30 | scheme = Scheme; | 33 | scheme = Scheme; |
31 | mode = Mode; | 34 | mode = Mode; |
32 | level = 0; | 35 | level = 0; |
33 | 36 | ||
34 | confScheme(); | 37 | confScheme(); |
35 | } | 38 | } |
diff --git a/noncore/games/mindbreaker/mindbreaker.cpp b/noncore/games/mindbreaker/mindbreaker.cpp index 2b924c6..1f554d2 100644 --- a/noncore/games/mindbreaker/mindbreaker.cpp +++ b/noncore/games/mindbreaker/mindbreaker.cpp | |||
@@ -81,25 +81,25 @@ static void setupBoardSize(int w, int h) | |||
81 | // looks a bit dodgy on larger sizes (still does though, but not as much...) | 81 | // looks a bit dodgy on larger sizes (still does though, but not as much...) |
82 | if ( adjusted_answerpeg_size > 22 ) | 82 | if ( adjusted_answerpeg_size > 22 ) |
83 | adjusted_answerpeg_size = 22; | 83 | adjusted_answerpeg_size = 22; |
84 | 84 | ||
85 | adjusted_answerpegx = adjusted_panel_width * 159/180 - adjusted_answerpeg_size/2; | 85 | adjusted_answerpegx = adjusted_panel_width * 159/180 - adjusted_answerpeg_size/2; |
86 | adjusted_answerpegy = adjusted_panel_height/3 - adjusted_answerpeg_size/2; | 86 | adjusted_answerpegy = adjusted_panel_height/3 - adjusted_answerpeg_size/2; |
87 | adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180; | 87 | adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180; |
88 | adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25; | 88 | adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25; |
89 | 89 | ||
90 | adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9); | 90 | adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9); |
91 | adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size; | 91 | adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size; |
92 | 92 | ||
93 | // qDebug("Adjusted width %d height %d", adjusted_board_width, adjusted_board_height); | 93 | // odebug << "Adjusted width " << adjusted_board_width << " height " << adjusted_board_height << "" << oendl; |
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | /* helper class, */ | 97 | /* helper class, */ |
98 | class Peg : public QCanvasRectangle | 98 | class Peg : public QCanvasRectangle |
99 | { | 99 | { |
100 | public: | 100 | public: |
101 | Peg(QCanvas *canvas, int type, int go = -1, int pos = -1); | 101 | Peg(QCanvas *canvas, int type, int go = -1, int pos = -1); |
102 | int rtti() const {return pegRTTI; } | 102 | int rtti() const {return pegRTTI; } |
103 | void advance(int phase); | 103 | void advance(int phase); |
104 | 104 | ||
105 | bool hit( const QPoint &) const; | 105 | bool hit( const QPoint &) const; |
diff --git a/noncore/games/oyatzee/oyatzee.cpp b/noncore/games/oyatzee/oyatzee.cpp index a55aa73..27c0a9f 100644 --- a/noncore/games/oyatzee/oyatzee.cpp +++ b/noncore/games/oyatzee/oyatzee.cpp | |||
@@ -1,19 +1,25 @@ | |||
1 | #include "oyatzee.h" | 1 | #include "oyatzee.h" |
2 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
3 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
4 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
5 | #include <qpainter.h> | 10 | #include <qpainter.h> |
6 | #include <qlayout.h> | 11 | #include <qlayout.h> |
7 | 12 | ||
13 | /* STD */ | ||
8 | #include <stdlib.h> | 14 | #include <stdlib.h> |
9 | 15 | ||
10 | OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( parent , name , fl ) | 16 | OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( parent , name , fl ) |
11 | { | 17 | { |
12 | QWidget *thing = new QWidget( this ); | 18 | QWidget *thing = new QWidget( this ); |
13 | setCentralWidget( thing ); | 19 | setCentralWidget( thing ); |
14 | 20 | ||
15 | setCaption( tr( "OYatzee" ) ); | 21 | setCaption( tr( "OYatzee" ) ); |
16 | 22 | ||
17 | setPlayerNumber( 4 ); | 23 | setPlayerNumber( 4 ); |
18 | setRoundsNumber( 1 ); | 24 | setRoundsNumber( 1 ); |
19 | 25 | ||
@@ -32,25 +38,25 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( | |||
32 | connect( sb->pb , SIGNAL( item(int) ), this , SLOT( slotEndRound(int) ) ); | 38 | connect( sb->pb , SIGNAL( item(int) ), this , SLOT( slotEndRound(int) ) ); |
33 | 39 | ||
34 | dw = new DiceWidget( thing , "dw" ); | 40 | dw = new DiceWidget( thing , "dw" ); |
35 | dw->setMaximumHeight( this->height()/4 ); | 41 | dw->setMaximumHeight( this->height()/4 ); |
36 | connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) ); | 42 | connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) ); |
37 | 43 | ||
38 | vbox->addWidget( sb ); | 44 | vbox->addWidget( sb ); |
39 | vbox->addWidget( dw ); | 45 | vbox->addWidget( dw ); |
40 | } | 46 | } |
41 | 47 | ||
42 | void OYatzee::slotEndRound( int item ) | 48 | void OYatzee::slotEndRound( int item ) |
43 | { | 49 | { |
44 | qDebug( "Der User hat Nummer %d ausgewählt" , item ); | 50 | odebug << "Der User hat Nummer " << item << " ausgewählt" << oendl; |
45 | 51 | ||
46 | /* | 52 | /* |
47 | * if the user clicked on Total, Bonus or Score and thus not on a | 53 | * if the user clicked on Total, Bonus or Score and thus not on a |
48 | * selectable item return and do nothing | 54 | * selectable item return and do nothing |
49 | */ | 55 | */ |
50 | if ( item == 7 || item == 8 || item == 16 ) return; | 56 | if ( item == 7 || item == 8 || item == 16 ) return; |
51 | 57 | ||
52 | /* | 58 | /* |
53 | * check if the user can really click on that item | 59 | * check if the user can really click on that item |
54 | */ | 60 | */ |
55 | if ( posibilities.find( item ) == posibilities.end() ) return; | 61 | if ( posibilities.find( item ) == posibilities.end() ) return; |
56 | 62 | ||
@@ -100,25 +106,25 @@ void OYatzee::slotEndRound( int item ) | |||
100 | points = 40; | 106 | points = 40; |
101 | break; | 107 | break; |
102 | case Yatzee: | 108 | case Yatzee: |
103 | points = 50; | 109 | points = 50; |
104 | break; | 110 | break; |
105 | case Chance: | 111 | case Chance: |
106 | points = getPoints ( Chance , numbers ); | 112 | points = getPoints ( Chance , numbers ); |
107 | } | 113 | } |
108 | 114 | ||
109 | sb->nextRB(currentPlayer-1)->updateMap( item , points ); | 115 | sb->nextRB(currentPlayer-1)->updateMap( item , points ); |
110 | nextPlayer(); | 116 | nextPlayer(); |
111 | 117 | ||
112 | qDebug( "Punkte: %d" , points ); | 118 | odebug << "Punkte: " << points << "" << oendl; |
113 | } | 119 | } |
114 | 120 | ||
115 | void OYatzee::nextPlayer() | 121 | void OYatzee::nextPlayer() |
116 | { | 122 | { |
117 | currentPlayer++; | 123 | currentPlayer++; |
118 | 124 | ||
119 | if ( currentPlayer > numOfPlayers ) | 125 | if ( currentPlayer > numOfPlayers ) |
120 | { | 126 | { |
121 | currentPlayer = 1; | 127 | currentPlayer = 1; |
122 | } | 128 | } |
123 | 129 | ||
124 | ps.at(currentPlayer-1)->turn = 0; | 130 | ps.at(currentPlayer-1)->turn = 0; |
@@ -147,25 +153,25 @@ int OYatzee::getPoints( const int num , QValueListInt l) | |||
147 | } | 153 | } |
148 | return c; | 154 | return c; |
149 | } | 155 | } |
150 | } | 156 | } |
151 | 157 | ||
152 | OYatzee::~OYatzee() | 158 | OYatzee::~OYatzee() |
153 | { | 159 | { |
154 | } | 160 | } |
155 | 161 | ||
156 | void OYatzee::detectPosibilities() | 162 | void OYatzee::detectPosibilities() |
157 | { | 163 | { |
158 | posibilities.clear(); | 164 | posibilities.clear(); |
159 | qDebug( "running detectPosibilities()" ); | 165 | odebug << "running detectPosibilities()" << oendl; |
160 | 166 | ||
161 | Dice *d = dw->diceList.first(); | 167 | Dice *d = dw->diceList.first(); |
162 | 168 | ||
163 | QValueListInt numbers; | 169 | QValueListInt numbers; |
164 | 170 | ||
165 | for ( ; d != 0 ; d = dw->diceList.next() ) | 171 | for ( ; d != 0 ; d = dw->diceList.next() ) |
166 | { | 172 | { |
167 | numbers.append( d->hasValue() ); | 173 | numbers.append( d->hasValue() ); |
168 | } | 174 | } |
169 | 175 | ||
170 | //the 6 numbers | 176 | //the 6 numbers |
171 | QValueListInt::Iterator it; | 177 | QValueListInt::Iterator it; |
@@ -252,65 +258,65 @@ void OYatzee::detectPosibilities() | |||
252 | posibilities.append( 13 ); | 258 | posibilities.append( 13 ); |
253 | } | 259 | } |
254 | 260 | ||
255 | posibilities.append( 13 ); //Chance, well, this is allways possible | 261 | posibilities.append( 13 ); //Chance, well, this is allways possible |
256 | 262 | ||
257 | displayPossibilites(); | 263 | displayPossibilites(); |
258 | } | 264 | } |
259 | 265 | ||
260 | void OYatzee::displayPossibilites() | 266 | void OYatzee::displayPossibilites() |
261 | { | 267 | { |
262 | //X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it ) | 268 | //X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it ) |
263 | //X { | 269 | //X { |
264 | //X qDebug( QString::number( *it ) ); | 270 | //X odebug << QString::number( *it ) << oendl; |
265 | //X switch ( *it ) | 271 | //X switch ( *it ) |
266 | //X { | 272 | //X { |
267 | //X case Ones: | 273 | //X case Ones: |
268 | //X qDebug( "1er" ); | 274 | //X odebug << "1er" << oendl; |
269 | //X break; | 275 | //X break; |
270 | //X case Twos: | 276 | //X case Twos: |
271 | //X qDebug( "2er" ); | 277 | //X odebug << "2er" << oendl; |
272 | //X break; | 278 | //X break; |
273 | //X case Threes: | 279 | //X case Threes: |
274 | //X qDebug( "3er" ); | 280 | //X odebug << "3er" << oendl; |
275 | //X break; | 281 | //X break; |
276 | //X case Fours: | 282 | //X case Fours: |
277 | //X qDebug( "4er" ); | 283 | //X odebug << "4er" << oendl; |
278 | //X break; | 284 | //X break; |
279 | //X case Fives: | 285 | //X case Fives: |
280 | //X qDebug( "5er" ); | 286 | //X odebug << "5er" << oendl; |
281 | //X break; | 287 | //X break; |
282 | //X case Sixes: | 288 | //X case Sixes: |
283 | //X qDebug( "6er" ); | 289 | //X odebug << "6er" << oendl; |
284 | //X break; | 290 | //X break; |
285 | //X case ThreeOfAKind: | 291 | //X case ThreeOfAKind: |
286 | //X qDebug( "3oaK" ); | 292 | //X odebug << "3oaK" << oendl; |
287 | //X break; | 293 | //X break; |
288 | //X case FourOfAKind: | 294 | //X case FourOfAKind: |
289 | //X qDebug( "4oaK" ); | 295 | //X odebug << "4oaK" << oendl; |
290 | //X break; | 296 | //X break; |
291 | //X case FullHouse: | 297 | //X case FullHouse: |
292 | //X qDebug( "Full House" ); | 298 | //X odebug << "Full House" << oendl; |
293 | //X break; | 299 | //X break; |
294 | //X case SStraight: | 300 | //X case SStraight: |
295 | //X qDebug( "Short S" ); | 301 | //X odebug << "Short S" << oendl; |
296 | //X break; | 302 | //X break; |
297 | //X case LStraight: | 303 | //X case LStraight: |
298 | //X qDebug( "Long S" ); | 304 | //X odebug << "Long S" << oendl; |
299 | //X break; | 305 | //X break; |
300 | //X case Yatzee: | 306 | //X case Yatzee: |
301 | //X qDebug( "Yatzee!" ); | 307 | //X odebug << "Yatzee!" << oendl; |
302 | //X break; | 308 | //X break; |
303 | //X case Chance: | 309 | //X case Chance: |
304 | //X qDebug( "Chance" ); | 310 | //X odebug << "Chance" << oendl; |
305 | //X break; | 311 | //X break; |
306 | //X } | 312 | //X } |
307 | //X } | 313 | //X } |
308 | 314 | ||
309 | sb->pb->setIntlist( posibilities ); | 315 | sb->pb->setIntlist( posibilities ); |
310 | sb->pb->update(); | 316 | sb->pb->update(); |
311 | } | 317 | } |
312 | 318 | ||
313 | void OYatzee::startGame() | 319 | void OYatzee::startGame() |
314 | { | 320 | { |
315 | /* | 321 | /* |
316 | * TODO | 322 | * TODO |
@@ -326,45 +332,45 @@ void OYatzee::setPlayerNumber( const int num ) | |||
326 | 332 | ||
327 | void OYatzee::setRoundsNumber( const int num ) | 333 | void OYatzee::setRoundsNumber( const int num ) |
328 | { | 334 | { |
329 | numOfRounds = num; | 335 | numOfRounds = num; |
330 | } | 336 | } |
331 | 337 | ||
332 | void OYatzee::slotStartGame() | 338 | void OYatzee::slotStartGame() |
333 | { | 339 | { |
334 | } | 340 | } |
335 | 341 | ||
336 | void OYatzee::slotRollDices() | 342 | void OYatzee::slotRollDices() |
337 | { | 343 | { |
338 | qDebug( "Roll nummer: %d" , ps.at( currentPlayer-1 )->turn ); | 344 | odebug << "Roll nummer: " << ps.at( currentPlayer-1 )->turn << "" << oendl; |
339 | 345 | ||
340 | if ( ps.at( currentPlayer-1 )->turn == 3 ) | 346 | if ( ps.at( currentPlayer-1 )->turn == 3 ) |
341 | { | 347 | { |
342 | QMessageBox::information( this, | 348 | QMessageBox::information( this, |
343 | "OYatzee", | 349 | "OYatzee", |
344 | tr( "Only three rolls per turn allowed." ) ); | 350 | tr( "Only three rolls per turn allowed." ) ); |
345 | return; | 351 | return; |
346 | } | 352 | } |
347 | 353 | ||
348 | Dice *d = dw->diceList.first(); | 354 | Dice *d = dw->diceList.first(); |
349 | 355 | ||
350 | for ( ; d != 0 ; d = dw->diceList.next() ) | 356 | for ( ; d != 0 ; d = dw->diceList.next() ) |
351 | { | 357 | { |
352 | if ( !d->isSelected ) | 358 | if ( !d->isSelected ) |
353 | d->roll(); | 359 | d->roll(); |
354 | } | 360 | } |
355 | 361 | ||
356 | //qDebug( "Roll nummer (vorher): %d" , ps.at( currentPlayer-1 )->turn ); | 362 | //odebug << "Roll nummer (vorher): " << ps.at( currentPlayer-1 )->turn << "" << oendl; |
357 | ps.at(currentPlayer-1)->turn++; | 363 | ps.at(currentPlayer-1)->turn++; |
358 | //qDebug( "Roll nummer (nachher): %d" , ps.at( currentPlayer-1 )->turn ); | 364 | //odebug << "Roll nummer (nachher): " << ps.at( currentPlayer-1 )->turn << "" << oendl; |
359 | 365 | ||
360 | detectPosibilities(); | 366 | detectPosibilities(); |
361 | } | 367 | } |
362 | 368 | ||
363 | /* | 369 | /* |
364 | * Scoreboard | 370 | * Scoreboard |
365 | */ | 371 | */ |
366 | Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWidget( parent , name ) | 372 | Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWidget( parent , name ) |
367 | { | 373 | { |
368 | ps_ = ps; | 374 | ps_ = ps; |
369 | 375 | ||
370 | pb = new Possibilityboard( this , "pb" ); | 376 | pb = new Possibilityboard( this , "pb" ); |
@@ -382,25 +388,25 @@ Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWi | |||
382 | for ( ; r != 0 ; r = rbList.next() ) | 388 | for ( ; r != 0 ; r = rbList.next() ) |
383 | { | 389 | { |
384 | hbox->addWidget( r ); | 390 | hbox->addWidget( r ); |
385 | } | 391 | } |
386 | } | 392 | } |
387 | 393 | ||
388 | Resultboard* Scoreboard::nextRB( int currentPlayer ) | 394 | Resultboard* Scoreboard::nextRB( int currentPlayer ) |
389 | { | 395 | { |
390 | Resultboard *b; | 396 | Resultboard *b; |
391 | 397 | ||
392 | b = rbList.at( currentPlayer ); | 398 | b = rbList.at( currentPlayer ); |
393 | 399 | ||
394 | qDebug( "Anzahl: %d" ,rbList.count() ); | 400 | odebug << "Anzahl: " << rbList.count() << "" << oendl; |
395 | 401 | ||
396 | return b; | 402 | return b; |
397 | } | 403 | } |
398 | 404 | ||
399 | void Scoreboard::createResultboards(const int num) | 405 | void Scoreboard::createResultboards(const int num) |
400 | { | 406 | { |
401 | Player *p = ps_.first(); | 407 | Player *p = ps_.first(); |
402 | for ( int i = 0 ; i < num ; ++i , p = ps_.next() ) | 408 | for ( int i = 0 ; i < num ; ++i , p = ps_.next() ) |
403 | { | 409 | { |
404 | QString n = p->playerName; | 410 | QString n = p->playerName; |
405 | rbList.append( new Resultboard( n , this ) ); | 411 | rbList.append( new Resultboard( n , this ) ); |
406 | } | 412 | } |
@@ -599,25 +605,25 @@ Resultboard::Resultboard( QString playerName , QWidget *parent , const char* nam | |||
599 | void Resultboard::paintEvent( QPaintEvent* ) | 605 | void Resultboard::paintEvent( QPaintEvent* ) |
600 | { | 606 | { |
601 | QPainter p; | 607 | QPainter p; |
602 | p.begin( this ); | 608 | p.begin( this ); |
603 | 609 | ||
604 | const int cell_width = this->width(); | 610 | const int cell_width = this->width(); |
605 | const int cell_height = this->height()/17; | 611 | const int cell_height = this->height()/17; |
606 | 612 | ||
607 | pointMap::Iterator it = pMap.begin(); | 613 | pointMap::Iterator it = pMap.begin(); |
608 | for ( ; it != pMap.end() ; ++it ) | 614 | for ( ; it != pMap.end() ; ++it ) |
609 | { | 615 | { |
610 | int i = it.key(); | 616 | int i = it.key(); |
611 | qDebug( "ok: %d , %d" , i , it.data() ); | 617 | odebug << "ok: " << i << " , " << it.data() << "" << oendl; |
612 | p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) ); | 618 | p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) ); |
613 | } | 619 | } |
614 | 620 | ||
615 | p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername | 621 | p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername |
616 | } | 622 | } |
617 | 623 | ||
618 | 624 | ||
619 | void Resultboard::updateMap( int item , int points ) | 625 | void Resultboard::updateMap( int item , int points ) |
620 | { | 626 | { |
621 | pMap.insert( item , points ); | 627 | pMap.insert( item , points ); |
622 | 628 | ||
623 | update(); | 629 | update(); |
diff --git a/noncore/games/oyatzee/oyatzee.pro b/noncore/games/oyatzee/oyatzee.pro index 754abd2..f505c66 100644 --- a/noncore/games/oyatzee/oyatzee.pro +++ b/noncore/games/oyatzee/oyatzee.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = oyatzee.h | 4 | HEADERS = oyatzee.h |
5 | SOURCES = main.cpp oyatzee.cpp | 5 | SOURCES = main.cpp oyatzee.cpp |
6 | TARGET = oyatzee | 6 | TARGET = oyatzee |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= $(OPIEDIR)/include | 8 | DEPENDPATH+= $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopiecore2 |
10 | 10 | ||
11 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index a80bd35..47d6725 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -666,25 +666,25 @@ void ComputerPlayer::findBest(QPoint at, const QPoint& d, const QDawg::Node* nod | |||
666 | } | 666 | } |
667 | findBest(at, d, node->next(), used, nletter, tiles, n, blankvalues, blused); | 667 | findBest(at, d, node->next(), used, nletter, tiles, n, blankvalues, blused); |
668 | } | 668 | } |
669 | 669 | ||
670 | void ComputerPlayer::noteChoice(const Tile** tiles, int n, const QPoint& d, const Tile* blankvalues, int blused) | 670 | void ComputerPlayer::noteChoice(const Tile** tiles, int n, const QPoint& d, const Tile* blankvalues, int blused) |
671 | { | 671 | { |
672 | int s = board->score(current, tiles, n, blankvalues, d, TRUE, 0); | 672 | int s = board->score(current, tiles, n, blankvalues, d, TRUE, 0); |
673 | /* | 673 | /* |
674 | if (s>0 || current==QPoint(5,1)){ | 674 | if (s>0 || current==QPoint(5,1)){ |
675 | QString st; | 675 | QString st; |
676 | for ( int i=0; i<n; i++ ) | 676 | for ( int i=0; i<n; i++ ) |
677 | st += tiles[i]->text(); | 677 | st += tiles[i]->text(); |
678 | qDebug("%d,%d: %s (%d) for %d",current.x(),current.y(),st.latin1(),n,s); | 678 | odebug << "" << current.x() << "," << current.y() << ": " << st.latin1() << " (" << n << ") for " << s << "" << oendl; |
679 | } | 679 | } |
680 | */ | 680 | */ |
681 | if ( s > best_score ) { | 681 | if ( s > best_score ) { |
682 | int i; | 682 | int i; |
683 | for ( i=0; i<n; i++ ) | 683 | for ( i=0; i<n; i++ ) |
684 | best[i] = tiles[i]; | 684 | best[i] = tiles[i]; |
685 | for ( i=0; i<blused; i++ ) | 685 | for ( i=0; i<blused; i++ ) |
686 | best_blankvalues[i] = blankvalues[i]; | 686 | best_blankvalues[i] = blankvalues[i]; |
687 | best_n = n; | 687 | best_n = n; |
688 | best_blused = blused; | 688 | best_blused = blused; |
689 | best_score = s; | 689 | best_score = s; |
690 | best_dir = d; | 690 | best_dir = d; |