-rw-r--r-- | noncore/games/kpacman/kpacman.cpp | 4 | ||||
-rw-r--r-- | noncore/games/kpacman/kpacmanwidget.cpp | 5 | ||||
-rw-r--r-- | noncore/games/kpacman/portable.h | 5 | ||||
-rw-r--r-- | noncore/games/kpacman/status.cpp | 1 |
4 files changed, 8 insertions, 7 deletions
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp index d9d2d69..aee8eea 100644 --- a/noncore/games/kpacman/kpacman.cpp +++ b/noncore/games/kpacman/kpacman.cpp | |||
@@ -102,53 +102,53 @@ void Kpacman::menu() | |||
102 | CTRL+Key_H); | 102 | CTRL+Key_H); |
103 | optionsPopup->insertSeparator(); | 103 | optionsPopup->insertSeparator(); |
104 | 104 | ||
105 | if (lookupSchemes() > 0) { | 105 | if (lookupSchemes() > 0) { |
106 | optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup); | 106 | optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup); |
107 | optionsPopup->insertSeparator(); | 107 | optionsPopup->insertSeparator(); |
108 | } | 108 | } |
109 | 109 | ||
110 | focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"), | 110 | focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"), |
111 | this, SLOT(toggleFocusOutPause())); | 111 | this, SLOT(toggleFocusOutPause())); |
112 | focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"), | 112 | focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"), |
113 | this, SLOT(toggleFocusInContinue())); | 113 | this, SLOT(toggleFocusInContinue())); |
114 | optionsPopup->insertSeparator(); | 114 | optionsPopup->insertSeparator(); |
115 | 115 | ||
116 | optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys())); | 116 | optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys())); |
117 | 117 | ||
118 | #ifndef QWS | 118 | #ifndef QPE_PORT |
119 | QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n" | 119 | QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n" |
120 | "Joerg Thoennissen (joe@dsite.de)\n\n" | 120 | "Joerg Thoennissen (joe@dsite.de)\n\n" |
121 | "A pacman game for the KDE Desktop\n\n" | 121 | "A pacman game for the KDE Desktop\n\n" |
122 | "The program based on the source of ksnake\n" | 122 | "The program based on the source of ksnake\n" |
123 | "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" | 123 | "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" |
124 | "The design was strongly influenced by the pacman\n" | 124 | "The design was strongly influenced by the pacman\n" |
125 | "(c) 1980 MIDWAY MFG.CO.\n\n" | 125 | "(c) 1980 MIDWAY MFG.CO.\n\n" |
126 | "I like to thank my girlfriend Elke Krueers for\n" | 126 | "I like to thank my girlfriend Elke Krueers for\n" |
127 | "the last 10 years of her friendship.\n"); | 127 | "the last 10 years of her friendship.\n"); |
128 | aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); | 128 | aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); |
129 | aboutText.replace(QRegExp("@VERSION@"), VERSION); | 129 | aboutText.replace(QRegExp("@VERSION@"), VERSION); |
130 | QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); | 130 | QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); |
131 | #endif | 131 | #endif |
132 | 132 | ||
133 | //_menuBar = new KMenuBar(this); | 133 | //_menuBar = new KMenuBar(this); |
134 | //CHECK_PTR( _menuBar ); | 134 | //CHECK_PTR( _menuBar ); |
135 | //_menuBar->insertItem(tr("&Game"), gamePopup); | 135 | //_menuBar->insertItem(tr("&Game"), gamePopup); |
136 | //_menuBar->insertItem(tr("&Options"), optionsPopup); | 136 | //_menuBar->insertItem(tr("&Options"), optionsPopup); |
137 | //_menuBar->insertSeparator(); | 137 | //_menuBar->insertSeparator(); |
138 | #ifndef QWS | 138 | #ifndef QPE_PORT |
139 | _menuBar->insertItem(tr("&Help"), helpPopup); | 139 | _menuBar->insertItem(tr("&Help"), helpPopup); |
140 | #endif | 140 | #endif |
141 | } | 141 | } |
142 | 142 | ||
143 | int Kpacman::lookupSchemes() | 143 | int Kpacman::lookupSchemes() |
144 | { | 144 | { |
145 | APP_CONFIG_BEGIN( cfg ); | 145 | APP_CONFIG_BEGIN( cfg ); |
146 | int ModeCount = cfg->readNumEntry("ModeCount", -1); | 146 | int ModeCount = cfg->readNumEntry("ModeCount", -1); |
147 | int Mode = cfg->readNumEntry("Mode", -1); | 147 | int Mode = cfg->readNumEntry("Mode", -1); |
148 | int SchemeCount = cfg->readNumEntry("SchemeCount"); | 148 | int SchemeCount = cfg->readNumEntry("SchemeCount"); |
149 | int Scheme = cfg->readNumEntry("Scheme", -1); | 149 | int Scheme = cfg->readNumEntry("Scheme", -1); |
150 | 150 | ||
151 | if (SchemeCount == 0 || Scheme == -1) { | 151 | if (SchemeCount == 0 || Scheme == -1) { |
152 | QMessageBox::warning(this, tr("Configuration Error"), | 152 | QMessageBox::warning(this, tr("Configuration Error"), |
153 | tr("There are no schemes defined,\n" | 153 | tr("There are no schemes defined,\n" |
154 | "or no scheme is selected.")); | 154 | "or no scheme is selected.")); |
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp index feb782c..cf2aed9 100644 --- a/noncore/games/kpacman/kpacmanwidget.cpp +++ b/noncore/games/kpacman/kpacmanwidget.cpp | |||
@@ -10,32 +10,35 @@ | |||
10 | #elif defined( QPE_PORT ) | 10 | #elif defined( QPE_PORT ) |
11 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
12 | #include "config.h" | 12 | #include "config.h" |
13 | #include "kpacmanwidget.h" | 13 | #include "kpacmanwidget.h" |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
17 | 17 | ||
18 | #include "bitfont.h" | 18 | #include "bitfont.h" |
19 | #include "score.h" | 19 | #include "score.h" |
20 | #include "referee.h" | 20 | #include "referee.h" |
21 | #include "status.h" | 21 | #include "status.h" |
22 | 22 | ||
23 | KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name) | 23 | KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name) |
24 | : QWidget( parent, name ) | 24 | : QWidget( parent, name ) |
25 | { | 25 | { |
26 | score = 0l; | ||
27 | referee = 0l; | ||
28 | status = 0l; | ||
26 | bitfont = NULL; | 29 | bitfont = NULL; |
27 | fontName = ""; | 30 | fontName = ""; |
28 | 31 | ||
29 | scheme = mode = -1; | 32 | scheme = mode = -1; |
30 | confScheme(); | 33 | confScheme(); |
31 | 34 | ||
32 | score = new Score(this, name, scheme, mode, bitfont); | 35 | score = new Score(this, name, scheme, mode, bitfont); |
33 | referee = new Referee( this, name, scheme, mode, bitfont); | 36 | referee = new Referee( this, name, scheme, mode, bitfont); |
34 | status = new Status(this, name, scheme, mode); | 37 | status = new Status(this, name, scheme, mode); |
35 | 38 | ||
36 | setBackgroundColor( black ); | 39 | setBackgroundColor( black ); |
37 | } | 40 | } |
38 | 41 | ||
39 | KpacmanWidget::~KpacmanWidget() | 42 | KpacmanWidget::~KpacmanWidget() |
40 | { | 43 | { |
41 | } | 44 | } |
@@ -128,26 +131,28 @@ void KpacmanWidget::setScheme(int Scheme, int Mode) | |||
128 | mode = Mode; | 131 | mode = Mode; |
129 | scheme = Scheme; | 132 | scheme = Scheme; |
130 | 133 | ||
131 | confScheme(); | 134 | confScheme(); |
132 | 135 | ||
133 | score->setScheme(Scheme, Mode, bitfont); | 136 | score->setScheme(Scheme, Mode, bitfont); |
134 | referee->setScheme(Scheme, Mode, bitfont); | 137 | referee->setScheme(Scheme, Mode, bitfont); |
135 | status->setScheme(Scheme, Mode); | 138 | status->setScheme(Scheme, Mode); |
136 | 139 | ||
137 | score->repaint(FALSE); | 140 | score->repaint(FALSE); |
138 | referee->repaint(FALSE); | 141 | referee->repaint(FALSE); |
139 | status->repaint(FALSE); | 142 | status->repaint(FALSE); |
140 | } | 143 | } |
141 | 144 | ||
142 | void KpacmanWidget::resizeEvent( QResizeEvent * ) | 145 | void KpacmanWidget::resizeEvent( QResizeEvent * ) |
143 | { | 146 | { |
147 | qWarning("Resize"); | ||
144 | referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); | 148 | referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); |
145 | referee->setBackgroundColor(BLACK); | 149 | referee->setBackgroundColor(BLACK); |
146 | 150 | ||
151 | if(!status ) return; | ||
147 | status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), | 152 | status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), |
148 | status->height()); | 153 | status->height()); |
149 | status->setBackgroundColor(BLACK); | 154 | status->setBackgroundColor(BLACK); |
150 | 155 | ||
151 | score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); | 156 | score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); |
152 | score->setBackgroundColor(BLACK); | 157 | score->setBackgroundColor(BLACK); |
153 | } | 158 | } |
diff --git a/noncore/games/kpacman/portable.h b/noncore/games/kpacman/portable.h index ff0912b..b087be5 100644 --- a/noncore/games/kpacman/portable.h +++ b/noncore/games/kpacman/portable.h | |||
@@ -6,38 +6,33 @@ | |||
6 | copyright : (C) 2002 by Catalin Climov | 6 | copyright : (C) 2002 by Catalin Climov |
7 | email : catalin@climov.com | 7 | email : catalin@climov.com |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | /*************************************************************************** | 10 | /*************************************************************************** |
11 | * * | 11 | * * |
12 | * This program is free software; you can redistribute it and/or modify * | 12 | * This program is free software; you can redistribute it and/or modify * |
13 | * it under the terms of the GNU General Public License as published by * | 13 | * it under the terms of the GNU General Public License as published by * |
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | #ifndef PORTABLE_H | 19 | #ifndef PORTABLE_H |
20 | #define PORTABLE_H | 20 | #define PORTABLE_H |
21 | 21 | ||
22 | #ifdef QWS | ||
23 | #define QPE_PORT | 22 | #define QPE_PORT |
24 | #else | ||
25 | #define KDE2_PORT | ||
26 | #define KDE_PORT | ||
27 | #endif | ||
28 | 23 | ||
29 | #if defined( KDE2_PORT ) | 24 | #if defined( KDE2_PORT ) |
30 | 25 | ||
31 | #define APP kapp | 26 | #define APP kapp |
32 | 27 | ||
33 | #define APP_CONFIG_BEGIN( cfgname ) KConfig cfgname = kapp->config() | 28 | #define APP_CONFIG_BEGIN( cfgname ) KConfig cfgname = kapp->config() |
34 | #define APP_CONFIG_END( cfgname ) cfgname->sync() | 29 | #define APP_CONFIG_END( cfgname ) cfgname->sync() |
35 | #define SAVE_CONFIG_GROUP( cfgname, groupname ) QString groupname = configname->group() | 30 | #define SAVE_CONFIG_GROUP( cfgname, groupname ) QString groupname = configname->group() |
36 | #define RESTORE_CONFIG_GROUP( cfgname, groupname ) configname->setGroup( groupname ) | 31 | #define RESTORE_CONFIG_GROUP( cfgname, groupname ) configname->setGroup( groupname ) |
37 | 32 | ||
38 | #define FIND_APP_DATA( dataname ) KGlobal::dirs()->findResource( "appdata", dataname ) | 33 | #define FIND_APP_DATA( dataname ) KGlobal::dirs()->findResource( "appdata", dataname ) |
39 | 34 | ||
40 | #elif defined( QPE_PORT ) | 35 | #elif defined( QPE_PORT ) |
41 | 36 | ||
42 | #define i18n( x ) x | 37 | #define i18n( x ) x |
43 | #define KTMainWindow QMainWindow | 38 | #define KTMainWindow QMainWindow |
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp index 3453d37..1ef910d 100644 --- a/noncore/games/kpacman/status.cpp +++ b/noncore/games/kpacman/status.cpp | |||
@@ -9,32 +9,33 @@ | |||
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 "config.h" | 12 | #include "config.h" |
13 | #include "status.h" | 13 | #include "status.h" |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #include <qpixmap.h> | 16 | #include <qpixmap.h> |
17 | #include <qbitmap.h> | 17 | #include <qbitmap.h> |
18 | #include <qstring.h> | 18 | #include <qstring.h> |
19 | #include <qmsgbox.h> | 19 | #include <qmsgbox.h> |
20 | #include <qfileinfo.h> | 20 | #include <qfileinfo.h> |
21 | 21 | ||
22 | Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : | 22 | Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : |
23 | QWidget( parent, name ) | 23 | QWidget( parent, name ) |
24 | { | 24 | { |
25 | qWarning("Status::Status"); | ||
25 | actualLifes = 0; | 26 | actualLifes = 0; |
26 | actualLevel = 0; | 27 | actualLevel = 0; |
27 | 28 | ||
28 | lifesPix = NULL; | 29 | lifesPix = NULL; |
29 | levelPix = NULL; | 30 | levelPix = NULL; |
30 | 31 | ||
31 | scheme = Scheme; | 32 | scheme = Scheme; |
32 | mode = Mode; | 33 | mode = Mode; |
33 | level = 0; | 34 | level = 0; |
34 | 35 | ||
35 | confScheme(); | 36 | confScheme(); |
36 | } | 37 | } |
37 | 38 | ||
38 | QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName, | 39 | QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName, |
39 | QList<QPixmap> *pixmaps) | 40 | QList<QPixmap> *pixmaps) |
40 | { | 41 | { |