summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman
authorchicken <chicken>2004-03-01 20:30:56 (UTC)
committer chicken <chicken>2004-03-01 20:30:56 (UTC)
commit7b0bdb05e4ae29b2643d73e3b8f20a86a86dcccc (patch) (side-by-side diff)
tree0ec283bce345770910a2630e868afcde3d7c3dc9 /noncore/games/kpacman
parent054b3c3e032bdb0a6061a3345487b4ff877eebfd (diff)
downloadopie-7b0bdb05e4ae29b2643d73e3b8f20a86a86dcccc.zip
opie-7b0bdb05e4ae29b2643d73e3b8f20a86a86dcccc.tar.gz
opie-7b0bdb05e4ae29b2643d73e3b8f20a86a86dcccc.tar.bz2
fix includes
Diffstat (limited to 'noncore/games/kpacman') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/kpacman/board.cpp3
-rw-r--r--noncore/games/kpacman/keys.cpp5
-rw-r--r--noncore/games/kpacman/kpacman.cpp5
-rw-r--r--noncore/games/kpacman/kpacmanwidget.cpp5
-rw-r--r--noncore/games/kpacman/monster.cpp1
-rw-r--r--noncore/games/kpacman/pacman.cpp1
-rw-r--r--noncore/games/kpacman/painter.cpp10
-rw-r--r--noncore/games/kpacman/referee.cpp9
-rw-r--r--noncore/games/kpacman/score.cpp6
-rw-r--r--noncore/games/kpacman/status.cpp2
10 files changed, 1 insertions, 46 deletions
diff --git a/noncore/games/kpacman/board.cpp b/noncore/games/kpacman/board.cpp
index f95f699..f82b5f9 100644
--- a/noncore/games/kpacman/board.cpp
+++ b/noncore/games/kpacman/board.cpp
@@ -1,34 +1,31 @@
-#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <klocale.h>
#endif
-#include <qrect.h>
-#include <qregexp.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <qtextstream.h>
#include "board.h"
#include "bitmaps.h"
Board::Board(int size) : QArray<int> (size)
{
sz = size; // set size of board
map = "";
mapName = ""; // no map loaded so far
init(None); // initialize varibales
}
void Board::init(Image image, QString levelName)
{
prisonEntry = OUT;
prisonExit = OUT;
fruitHome = OUT;
fruitPosition = OUT;
pacmanHome = OUT;
diff --git a/noncore/games/kpacman/keys.cpp b/noncore/games/kpacman/keys.cpp
index 07ce135..5200bc2 100644
--- a/noncore/games/kpacman/keys.cpp
+++ b/noncore/games/kpacman/keys.cpp
@@ -1,49 +1,44 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <kconfig.h>
#include <klocale.h>
#include <kstddirs.h>
#include <kaccel.h>
#include <keys.h>
#include <keys.moc>
#elif defined( QPE_PORT )
#include <qaccel.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "keys.h"
#endif
#include <qpushbt.h>
-#include <qlabel.h>
-#include <qframe.h>
-#include <qkeycode.h>
-#include <qpixmap.h>
-#include <qstring.h>
Keys::Keys( QWidget *parent, const char *name)
: QDialog( parent, name, TRUE )
{
//KStandardDirs *dirs = KGlobal::dirs();
QPushButton *okButton = new QPushButton(this);
okButton->setText(tr("Ok"));
okButton->setFixedSize(okButton->size());
connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) );
okButton->move(20,210);
QPushButton *defaultButton = new QPushButton(this);
defaultButton->setText(tr("Defaults"));
defaultButton->setFixedSize(defaultButton->size());
connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) );
defaultButton->move(140,210);
QPushButton *cancelButton = new QPushButton(this);
cancelButton->setText(tr("Cancel"));
cancelButton->setFixedSize(cancelButton->size());
connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) );
cancelButton->move(260,210);
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index df27c76..be2e46d 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -1,43 +1,38 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kpacman.h>
#include <kpacman.moc>
#include <kcolordlg.h>
#elif defined( QPE_PORT )
#include <qmenubar.h>
#include <qpe/config.h>
#include <qapplication.h>
#include "kpacman.h"
#endif
-#include <qkeycode.h>
-#include <qcolor.h>
-#include <qstring.h>
-#include <qpopmenu.h>
-#include <qmsgbox.h>
Kpacman::Kpacman(QWidget *parent, const char *name)
: KTMainWindow(parent, name)
{
schemesPopup = new QList<QPopupMenu>;
schemesPopup->setAutoDelete(TRUE);
menu();
m_view = new QWidget( this, "m_view" );
m_view->setBackgroundColor( black );
m_layout = new QGridLayout( m_view );
m_layout->setMargin( 7 );
view = new KpacmanWidget( this, QString(name)+"widget");
m_layout->addWidget( view, 0, 0 );
setCaption( tr("KPacman") );
view->referee->setFocus();
connect(view->referee, SIGNAL(setScore(int, int)),
view->score, SLOT(setScore(int, int)));
connect(view->referee, SIGNAL(setPoints(int)),
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp
index 823d2bf..9631495 100644
--- a/noncore/games/kpacman/kpacmanwidget.cpp
+++ b/noncore/games/kpacman/kpacmanwidget.cpp
@@ -1,45 +1,40 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <kconfig.h>
#include <kstddirs.h>
#include <kpacmanwidget.h>
#include <kpacmanwidget.moc>
#elif defined( QPE_PORT )
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "kpacmanwidget.h"
#endif
-#include <qmessagebox.h>
-#include "bitfont.h"
-#include "score.h"
-#include "referee.h"
-#include "status.h"
KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name)
: QWidget( parent, name )
{
score = 0l;
referee = 0l;
status = 0l;
bitfont = NULL;
fontName = "";
scheme = mode = -1;
confScheme();
score = new Score(this, name, scheme, mode, bitfont);
referee = new Referee( this, name, scheme, mode, bitfont);
status = new Status(this, name, scheme, mode);
setBackgroundColor( black );
}
KpacmanWidget::~KpacmanWidget()
{
}
diff --git a/noncore/games/kpacman/monster.cpp b/noncore/games/kpacman/monster.cpp
index 2f402b4..80b4655 100644
--- a/noncore/games/kpacman/monster.cpp
+++ b/noncore/games/kpacman/monster.cpp
@@ -1,26 +1,25 @@
#include "monster.h"
-#include "board.h"
Monster::Monster(Board *b, int mid)
{
board = b;
ID = mid;
setREM(0);
setHarmless(0, 0, 0);
setArrested(0, 0);
setFreedom(board->position(prisonexit));
if (mid == 0)
setPrison(board->position(prisonentry));
else
setPrison(board->position(monsterhome, mid));
actualPosition = lastPosition = OUT;
feetPosition = 0;
IQ = 0;
maxBodyPixmaps = 0;
maxEyesPixmaps = 0;
}
void Monster::setMaxPixmaps(int maxBody, int maxEyes)
{
diff --git a/noncore/games/kpacman/pacman.cpp b/noncore/games/kpacman/pacman.cpp
index 40f60a8..82524b4 100644
--- a/noncore/games/kpacman/pacman.cpp
+++ b/noncore/games/kpacman/pacman.cpp
@@ -1,26 +1,25 @@
#include "pacman.h"
-#include "board.h"
Pacman::Pacman(Board *b)
{
board = b;
setDemo(FALSE);
setAlive(0);
actualPosition = lastPosition = OUT;
mouthPosition = 0;
lastPix = 0;
maxPixmaps = 0;
}
void Pacman::setMaxPixmaps(int max)
{
if (actualDirection == X && lastPix >= 0) {
actualDirection = lastPix / (maxPixmaps/4);
if (max < maxPixmaps)
mouthPosition = 0;
else
mouthPosition = lastPix % (maxPixmaps/4);
maxPixmaps = max;
lastPix = pix();
diff --git a/noncore/games/kpacman/painter.cpp b/noncore/games/kpacman/painter.cpp
index d8c7460..410d3f5 100644
--- a/noncore/games/kpacman/painter.cpp
+++ b/noncore/games/kpacman/painter.cpp
@@ -1,48 +1,40 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <kconfig.h>
#include <kstddirs.h>
#elif defined( QPE_PORT )
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#endif
-#include <qcolor.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qrect.h>
-#include <qstring.h>
-
-#include <qmessagebox.h>
+
#include <qfileinfo.h>
#include "painter.h"
-#include "board.h"
Painter::Painter( Board *b, QWidget *parent, int Scheme, int Mode, Bitfont *font)
{
w = parent;
board = b;
pointPix = NULL;
wallPix = NULL;
prisonPix = NULL;
energizerPix = NULL;
fruitPix = NULL;
pacmanPix = NULL;
dyingPix = NULL;
eyesPix = NULL;
monsterPix = NULL;
fruitScorePix = NULL;
monsterScorePix = NULL;
lastPointPixmapName = "";
lastWallPixmapName = "";
lastPrisonPixmapName = "";
lastEnergizerPixmapName = "";
lastFruitPixmapName = "";
lastPacmanPixmapName = "";
diff --git a/noncore/games/kpacman/referee.cpp b/noncore/games/kpacman/referee.cpp
index 1b810d8..2d0f3be 100644
--- a/noncore/games/kpacman/referee.cpp
+++ b/noncore/games/kpacman/referee.cpp
@@ -1,54 +1,45 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <kconfig.h>
#include <kstddirs.h>
#include <kaccel.h>
#include <referee.h>
#include <referee.moc>
#elif defined( QPE_PORT )
#include <qaccel.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "referee.h"
#endif
-#include <qdatetm.h>
#include <stdlib.h>
#include <qtimer.h>
-#include <qevent.h>
-#include <qcolor.h>
-#include <qkeycode.h>
#include <qfileinfo.h>
-#include "board.h"
-#include "pacman.h"
-#include "monster.h"
-#include "fruit.h"
-#include "painter.h"
Referee::Referee( QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font)
: QWidget( parent, name )
{
gameState.resize(12);
gameTimer = 0;
energizerTimer = 0;
focusedPause = FALSE;
setFocusPolicy(QWidget::StrongFocus);
initKeys();
scheme = Scheme;
mode = Mode;
confScheme();
board = new Board(BoardWidth*BoardHeight);
pix = new Painter(board, this, scheme, mode, font);
setFixedSize(pix->levelPix().size());
pacman = new Pacman(board);
diff --git a/noncore/games/kpacman/score.cpp b/noncore/games/kpacman/score.cpp
index e91771b..6878b81 100644
--- a/noncore/games/kpacman/score.cpp
+++ b/noncore/games/kpacman/score.cpp
@@ -1,53 +1,47 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <score.h>
#include <score.moc>
#include <kaccel.h>
#include <kapp.h>
#include <kconfig.h>
#include <kstddirs.h>
#include <kmessagebox.h>
#elif defined( QPE_PORT )
#include <qaccel.h>
#include <qpe/config.h>
#include "score.h"
#endif
#include <stdlib.h>
#include <ctype.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qdstream.h>
-#include <qkeycode.h>
#include <qtimer.h>
-#include <qfileinfo.h>
-#include "bitfont.h"
Score::Score(QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) : QWidget(parent, name)
{
setFocusPolicy(QWidget::StrongFocus);
paused = FALSE;
lastScore = -1;
lastPlayer = -1;
cursorBlinkTimer = 0;
cursorBlinkMS = -1;
cursor.x = -1;
cursor.y = -1;
cursor.on = FALSE;
cursor.chr = QChar('?');
initKeys();
scheme = Scheme;
mode = Mode;
confScheme();
bitfont = font;
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp
index 2a17c21..02ff63d 100644
--- a/noncore/games/kpacman/status.cpp
+++ b/noncore/games/kpacman/status.cpp
@@ -1,42 +1,40 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kapp.h>
#include <klocale.h>
#include <kstddirs.h>
#include <status.h>
#include <status.moc>
#elif defined( QPE_PORT )
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include "status.h"
#endif
-#include <qpixmap.h>
#include <qbitmap.h>
-#include <qstring.h>
#include <qmsgbox.h>
#include <qfileinfo.h>
Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
QWidget( parent, name )
{
qWarning("Status::Status");
actualLifes = 0;
actualLevel = 0;
lifesPix = NULL;
levelPix = NULL;
scheme = Scheme;
mode = Mode;
level = 0;
confScheme();
}
QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
QList<QPixmap> *pixmaps)
{
if (pixmaps == NULL) {