summaryrefslogtreecommitdiff
path: root/noncore/games
Side-by-side diff
Diffstat (limited to 'noncore/games') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.cpp16
-rw-r--r--noncore/games/backgammon/moveengine.cpp2
-rw-r--r--noncore/games/bounce/bounce.pro5
-rw-r--r--noncore/games/bounce/game.cpp15
-rw-r--r--noncore/games/go/go.pro15
-rw-r--r--noncore/games/go/gowidget.cpp9
-rw-r--r--noncore/games/kpacman/kpacman.pro4
-rw-r--r--noncore/games/kpacman/kpacmanwidget.cpp5
-rw-r--r--noncore/games/kpacman/status.cpp5
-rw-r--r--noncore/games/mindbreaker/mindbreaker.cpp2
-rw-r--r--noncore/games/oyatzee/oyatzee.cpp50
-rw-r--r--noncore/games/oyatzee/oyatzee.pro2
-rw-r--r--noncore/games/wordgame/wordgame.cpp2
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,22 +1,26 @@
#include "backgammon.h"
-
#include "aidialog.h"
#include "filedialog.h"
#include "playerdialog.h"
#include "rulesdialog.h"
#include "themedialog.h"
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qpeapplication.h>
+#include <qpe/config.h>
+#include <qpe/resource.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qfile.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qtimer.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/config.h>
#include <qmenubar.h>
-#include <qpe/resource.h>
#include <stdlib.h>
BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
: QMainWindow(parent, name, fl)
@@ -30,13 +34,13 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
move=new MoveEngine();
//load the default theme
Config conf("backgammon");
if(!conf.isValid())
{
- qDebug("config file does not exist");
+ odebug << "config file does not exist" << oendl;
conf.setGroup("general");
conf.writeEntry("theme","default");
conf.setGroup("rules");
conf.writeEntry("move_with_pieces_out",false);
conf.writeEntry("nice_dice",false);
conf.setGroup("display");
@@ -75,13 +79,13 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
//get the theme component names
Config theme(theme_file,Config::File);
if(!theme.isValid())
{
- qDebug("theme file does not exist");
+ odebug << "theme file does not exist" << oendl;
theme.setGroup("theme");
theme.writeEntry("board","casino_board_1");
theme.writeEntry("pieces1","casino_pieces_blue");
theme.writeEntry("pieces2","casino_pieces_white");
theme.writeEntry("dice1","casino_dice");
theme.writeEntry("dice2","casino_dice");
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
@@ -454,13 +454,13 @@ int MoveEngine::getPossibleMoves()
}
return total;
}
void MoveEngine::move(const int& from, int to, const int& dice)
{
- //qDebug("%d moves from %d to %d (%d) with dice %d",player,from,to,to-from,dice);
+ //odebug << "" << player << " moves from " << from << " to " << to << " (" << to-from << ") with dice " << dice << "" << oendl;
if(player==1 && to==25)
to=26;
if(player==2 && to==0)
to=27;
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 @@
-#CONFIG = qt warn_on
-CONFIG = qt warn_on quick-app
+CONFIG = qt warn_on quick-app
HEADERS = game.h kbounce.h
SOURCES = game.cpp kbounce.cpp main.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopiecore2
+LIBS += -lqpe -lopiecore2
TARGET = bounce
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
@@ -14,17 +14,24 @@
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <stdlib.h>
-#include <qtimer.h>
+#include "game.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
-#include "game.h"
+/* QT */
+#include <qtimer.h>
+
+/* STD */
+#include <stdlib.h>
#define TILE_SIZE 9
#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2))
#define TILE_FREE (TILE_FIRST + 0)
#define TILE_BORDER (TILE_FIRST + 1)
@@ -364,13 +371,13 @@ JezzGame::~JezzGame()
delete m_field;
delete m_ballPixmaps;
}
void JezzGame::display( QString text, int size )
{
- qDebug("This function \"display\" shouldn't be called!!!");
+ odebug << "This function \"display\" shouldn't be called!!!" << oendl;
if ( !text.isEmpty() )
{
QFont font( "Helvetica", size, QFont::Bold );
font.setStyleHint( QFont::Helvetica );
m_text->setFont( font );
m_text->setText( text );
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 @@
-CONFIG = qt warn_on quick-app
+CONFIG = qt warn_on quick-app
HEADERS = amigo.h \
go.h \
goplayutils.h \
gowidget.h
SOURCES = amigo.c \
- goplayer.c \
- goplayutils.c \
- killable.c \
- gowidget.cpp \
- main.cpp
-INCLUDEPATH += $(OPIEDIR)/include
+ goplayer.c \
+ goplayutils.c \
+ killable.c \
+ gowidget.cpp \
+ main.cpp
+INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopiecore2
TARGET = go
-
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
@@ -17,25 +17,26 @@
** not clear to you.
**
**********************************************************************/
#include "gowidget.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/config.h>
#include <qpe/resource.h>
+using namespace Opie::Core;
+/* QT */
#include <qpainter.h>
#include <qtoolbar.h>
#include <qmenubar.h>
#include <qaction.h>
#include <qapplication.h> //processEvents()
#include <qlabel.h>
-//#include <stdio.h>
-
-
static const enum bVal computer_color = BLACK;
static int current_handicap = 1;
static QBrush *goBrush;
//static QImage *newBlackStone;
@@ -445,13 +446,13 @@ void placestone (enum bVal c, short x, short y )
{
GoWidget::self->placeStone(c,x,y);
}
void intrMoveReport(enum bVal c ,char *coord ,char *reason )
{
- qDebug( "intrMoveReport colour %d, %s %s", c, coord, reason );
+ odebug << "intrMoveReport colour " << c << ", " << coord << " " << reason << "" << oendl;
}
void intrPrisonerReport( short blackcnt, short whitecnt )
{
GoWidget::self->reportPrisoners(blackcnt,whitecnt);
}
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,10 +1,8 @@
TEMPLATE = app
-#CONFIG = qt warn_on
CONFIG = qt warn_on
-#TMAKE_CXXFLAGS +=
HEADERS = kpacmanwidget.h \
referee.h \
status.h \
painter.h \
score.h \
pacman.h \
@@ -31,11 +29,11 @@ SOURCES = kpacmanwidget.cpp \
board.cpp \
bitfont.cpp \
kpacman.cpp \
main.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
+LIBS += -lqpe -lopiecore2
DESTDIR = $(OPIEDIR)/bin
TARGET = kpacman
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
@@ -10,13 +10,14 @@
#elif defined( QPE_PORT )
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "kpacmanwidget.h"
#endif
-
+#include <opie2/odebug.h>
+using namespace Opie::Core;
KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name)
: QWidget( parent, name )
{
score = 0l;
referee = 0l;
@@ -136,13 +137,13 @@ void KpacmanWidget::setScheme(int Scheme, int Mode)
referee->repaint(FALSE);
status->repaint(FALSE);
}
void KpacmanWidget::resizeEvent( QResizeEvent * )
{
- qWarning("Resize");
+ owarn << "Resize" << oendl;
referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height());
referee->setBackgroundColor(BLACK);
if(!status ) return;
status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(),
status->height());
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
@@ -10,20 +10,23 @@
#elif defined( QPE_PORT )
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "status.h"
#endif
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#include <qbitmap.h>
#include <qmsgbox.h>
#include <qfileinfo.h>
Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
QWidget( parent, name )
{
- qWarning("Status::Status");
+ owarn << "Status::Status" << oendl;
actualLifes = 0;
actualLevel = 0;
lifesPix = NULL;
levelPix = NULL;
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
@@ -87,13 +87,13 @@ static void setupBoardSize(int w, int h)
adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180;
adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25;
adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9);
adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size;
-// qDebug("Adjusted width %d height %d", adjusted_board_width, adjusted_board_height);
+// odebug << "Adjusted width " << adjusted_board_width << " height " << adjusted_board_height << "" << oendl;
}
/* helper class, */
class Peg : public QCanvasRectangle
{
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,13 +1,19 @@
#include "oyatzee.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qpainter.h>
#include <qlayout.h>
+/* STD */
#include <stdlib.h>
OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( parent , name , fl )
{
QWidget *thing = new QWidget( this );
setCentralWidget( thing );
@@ -38,13 +44,13 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
vbox->addWidget( sb );
vbox->addWidget( dw );
}
void OYatzee::slotEndRound( int item )
{
- qDebug( "Der User hat Nummer %d ausgewählt" , item );
+ odebug << "Der User hat Nummer " << item << " ausgewählt" << oendl;
/*
* if the user clicked on Total, Bonus or Score and thus not on a
* selectable item return and do nothing
*/
if ( item == 7 || item == 8 || item == 16 ) return;
@@ -106,13 +112,13 @@ void OYatzee::slotEndRound( int item )
points = getPoints ( Chance , numbers );
}
sb->nextRB(currentPlayer-1)->updateMap( item , points );
nextPlayer();
- qDebug( "Punkte: %d" , points );
+ odebug << "Punkte: " << points << "" << oendl;
}
void OYatzee::nextPlayer()
{
currentPlayer++;
@@ -153,13 +159,13 @@ OYatzee::~OYatzee()
{
}
void OYatzee::detectPosibilities()
{
posibilities.clear();
- qDebug( "running detectPosibilities()" );
+ odebug << "running detectPosibilities()" << oendl;
Dice *d = dw->diceList.first();
QValueListInt numbers;
for ( ; d != 0 ; d = dw->diceList.next() )
@@ -258,53 +264,53 @@ void OYatzee::detectPosibilities()
}
void OYatzee::displayPossibilites()
{
//X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it )
//X {
-//X qDebug( QString::number( *it ) );
+//X odebug << QString::number( *it ) << oendl;
//X switch ( *it )
//X {
//X case Ones:
-//X qDebug( "1er" );
+//X odebug << "1er" << oendl;
//X break;
//X case Twos:
-//X qDebug( "2er" );
+//X odebug << "2er" << oendl;
//X break;
//X case Threes:
-//X qDebug( "3er" );
+//X odebug << "3er" << oendl;
//X break;
//X case Fours:
-//X qDebug( "4er" );
+//X odebug << "4er" << oendl;
//X break;
//X case Fives:
-//X qDebug( "5er" );
+//X odebug << "5er" << oendl;
//X break;
//X case Sixes:
-//X qDebug( "6er" );
+//X odebug << "6er" << oendl;
//X break;
//X case ThreeOfAKind:
-//X qDebug( "3oaK" );
+//X odebug << "3oaK" << oendl;
//X break;
//X case FourOfAKind:
-//X qDebug( "4oaK" );
+//X odebug << "4oaK" << oendl;
//X break;
//X case FullHouse:
-//X qDebug( "Full House" );
+//X odebug << "Full House" << oendl;
//X break;
//X case SStraight:
-//X qDebug( "Short S" );
+//X odebug << "Short S" << oendl;
//X break;
//X case LStraight:
-//X qDebug( "Long S" );
+//X odebug << "Long S" << oendl;
//X break;
//X case Yatzee:
-//X qDebug( "Yatzee!" );
+//X odebug << "Yatzee!" << oendl;
//X break;
//X case Chance:
-//X qDebug( "Chance" );
+//X odebug << "Chance" << oendl;
//X break;
//X }
//X }
sb->pb->setIntlist( posibilities );
sb->pb->update();
@@ -332,13 +338,13 @@ void OYatzee::setRoundsNumber( const int num )
void OYatzee::slotStartGame()
{
}
void OYatzee::slotRollDices()
{
- qDebug( "Roll nummer: %d" , ps.at( currentPlayer-1 )->turn );
+ odebug << "Roll nummer: " << ps.at( currentPlayer-1 )->turn << "" << oendl;
if ( ps.at( currentPlayer-1 )->turn == 3 )
{
QMessageBox::information( this,
"OYatzee",
tr( "Only three rolls per turn allowed." ) );
@@ -350,15 +356,15 @@ void OYatzee::slotRollDices()
for ( ; d != 0 ; d = dw->diceList.next() )
{
if ( !d->isSelected )
d->roll();
}
-// qDebug( "Roll nummer (vorher): %d" , ps.at( currentPlayer-1 )->turn );
+// odebug << "Roll nummer (vorher): " << ps.at( currentPlayer-1 )->turn << "" << oendl;
ps.at(currentPlayer-1)->turn++;
-// qDebug( "Roll nummer (nachher): %d" , ps.at( currentPlayer-1 )->turn );
+// odebug << "Roll nummer (nachher): " << ps.at( currentPlayer-1 )->turn << "" << oendl;
detectPosibilities();
}
/*
* Scoreboard
@@ -388,13 +394,13 @@ Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWi
Resultboard* Scoreboard::nextRB( int currentPlayer )
{
Resultboard *b;
b = rbList.at( currentPlayer );
- qDebug( "Anzahl: %d" , rbList.count() );
+ odebug << "Anzahl: " << rbList.count() << "" << oendl;
return b;
}
void Scoreboard::createResultboards(const int num)
{
@@ -605,13 +611,13 @@ void Resultboard::paintEvent( QPaintEvent* )
const int cell_height = this->height()/17;
pointMap::Iterator it = pMap.begin();
for ( ; it != pMap.end() ; ++it )
{
int i = it.key();
- qDebug( "ok: %d , %d" , i , it.data() );
+ odebug << "ok: " << i << " , " << it.data() << "" << oendl;
p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) );
}
p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername
}
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
@@ -3,9 +3,9 @@ CONFIG = qt warn_on
DESTDIR = $(OPIEDIR)/bin
HEADERS = oyatzee.h
SOURCES = main.cpp oyatzee.cpp
TARGET = oyatzee
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
+LIBS += -lqpe -lopiecore2
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
@@ -672,13 +672,13 @@ void ComputerPlayer::noteChoice(const Tile** tiles, int n, const QPoint& d, cons
int s = board->score(current, tiles, n, blankvalues, d, TRUE, 0);
/*
if (s>0 || current==QPoint(5,1)){
QString st;
for ( int i=0; i<n; i++ )
st += tiles[i]->text();
-qDebug("%d,%d: %s (%d) for %d",current.x(),current.y(),st.latin1(),n,s);
+odebug << "" << current.x() << "," << current.y() << ": " << st.latin1() << " (" << n << ") for " << s << "" << oendl;
}
*/
if ( s > best_score ) {
int i;
for ( i=0; i<n; i++ )
best[i] = tiles[i];