summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-03 19:00:18 (UTC)
committer cniehaus <cniehaus>2002-09-03 19:00:18 (UTC)
commitcf317ab123c51fb957ec35d44431e77a8b76c279 (patch) (unidiff)
treecb81fa703851995a6beb2c8b562da4d2344da47b
parentd9186e958c93df6d6363e2dc0af704e93eb0c06e (diff)
downloadopie-cf317ab123c51fb957ec35d44431e77a8b76c279.zip
opie-cf317ab123c51fb957ec35d44431e77a8b76c279.tar.gz
opie-cf317ab123c51fb957ec35d44431e77a8b76c279.tar.bz2
As KPacman didn't use tr() but KDE's i18n() is did a simple
perl -pi~ -e 's/i18n/tr/g' *.cpp
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/board.cpp6
-rw-r--r--noncore/games/kpacman/keys.cpp10
-rw-r--r--noncore/games/kpacman/kpacman.cpp30
-rw-r--r--noncore/games/kpacman/kpacmanwidget.cpp4
-rw-r--r--noncore/games/kpacman/painter.cpp6
-rw-r--r--noncore/games/kpacman/referee.cpp54
-rw-r--r--noncore/games/kpacman/score.cpp48
-rw-r--r--noncore/games/kpacman/status.cpp4
8 files changed, 81 insertions, 81 deletions
diff --git a/noncore/games/kpacman/board.cpp b/noncore/games/kpacman/board.cpp
index 849e75b..f95f699 100644
--- a/noncore/games/kpacman/board.cpp
+++ b/noncore/games/kpacman/board.cpp
@@ -28,69 +28,69 @@ Board::Board(int size) : QArray<int> (size)
28void Board::init(Image image, QString levelName) 28void Board::init(Image image, QString levelName)
29{ 29{
30 prisonEntry = OUT; 30 prisonEntry = OUT;
31 prisonExit = OUT; 31 prisonExit = OUT;
32 fruitHome = OUT; 32 fruitHome = OUT;
33 fruitPosition = OUT; 33 fruitPosition = OUT;
34 pacmanHome = OUT; 34 pacmanHome = OUT;
35 pacmanPosition = OUT; 35 pacmanPosition = OUT;
36 for (int m = 0; m < 8; m++) { 36 for (int m = 0; m < 8; m++) {
37 monsterHome[m] = OUT; 37 monsterHome[m] = OUT;
38 monsterPosition[m] = OUT; 38 monsterPosition[m] = OUT;
39 } 39 }
40 for (int e = 0; e < 8; e++) { 40 for (int e = 0; e < 8; e++) {
41 energizerPosition[e] = OUT; 41 energizerPosition[e] = OUT;
42 } 42 }
43 for (int e = 0; e < 8; e++) { 43 for (int e = 0; e < 8; e++) {
44 tunnelPosition[e] = OUT; 44 tunnelPosition[e] = OUT;
45 } 45 }
46 46
47 fill(0); 47 fill(0);
48 numPoints = 0; 48 numPoints = 0;
49 numEnergizers = 0; 49 numEnergizers = 0;
50 numMonsters = 0; 50 numMonsters = 0;
51 numTunnels = 0; 51 numTunnels = 0;
52 52
53 if (!levelName.isNull() && !levelName.isEmpty()) 53 if (!levelName.isNull() && !levelName.isEmpty())
54 if (mapName == levelName) 54 if (mapName == levelName)
55 image = File; 55 image = File;
56 else { 56 else {
57 QFile levelFile(levelName); 57 QFile levelFile(levelName);
58 if (!levelFile.open(IO_ReadOnly)) { 58 if (!levelFile.open(IO_ReadOnly)) {
59 59
60 QString msg = i18n("The levelmap could not be constructed.\n\n" 60 QString msg = "The levelmap could not be constructed.\n\n"
61 "The file '@LEVELNAME@' does not exist,\n" 61 "The file '@LEVELNAME@' does not exist,\n"
62 "or could not be opened for reading."); 62 "or could not be opened for reading.";
63 msg.replace(QRegExp("@LEVELNAME@"), levelName); 63 msg.replace(QRegExp("@LEVELNAME@"), levelName);
64 // QMessageBox::information(0, i18n("Initialization Error"), msg); 64 // QMessageBox::information(0, tr("Initialization Error"), msg);
65 printf("%s\n", msg.data()); 65 printf("%s\n", msg.data());
66 } else { 66 } else {
67 map.fill(' ', BoardHeight*BoardWidth); 67 map.fill(' ', BoardHeight*BoardWidth);
68 int height = 0; 68 int height = 0;
69 69
70 QTextStream levelStream(&levelFile); 70 QTextStream levelStream(&levelFile);
71 while (!levelStream.eof() && height < BoardHeight) { 71 while (!levelStream.eof() && height < BoardHeight) {
72 QString line = levelStream.readLine(); 72 QString line = levelStream.readLine();
73 73
74 if (line.find(QRegExp("^ *;")) == -1) { 74 if (line.find(QRegExp("^ *;")) == -1) {
75 75
76 line.replace(QRegExp(";.*"), ""); // strip off comments 76 line.replace(QRegExp(";.*"), ""); // strip off comments
77 line.replace(QRegExp("\" *$"), ""); // strip off trailing " 77 line.replace(QRegExp("\" *$"), ""); // strip off trailing "
78 line.replace(QRegExp("^ *\""), ""); // strip off leading " 78 line.replace(QRegExp("^ *\""), ""); // strip off leading "
79 79
80 map.replace(height*BoardWidth, 80 map.replace(height*BoardWidth,
81 (line.length() > BoardWidth) ? BoardWidth : line.length(), 81 (line.length() > BoardWidth) ? BoardWidth : line.length(),
82 line.data()); 82 line.data());
83 83
84 height++; 84 height++;
85 } 85 }
86 } 86 }
87 mapName = levelName; 87 mapName = levelName;
88 levelFile.close(); 88 levelFile.close();
89 image = File; 89 image = File;
90 } 90 }
91 } 91 }
92 92
93 switch (image) { 93 switch (image) {
94 case Intro : // setup(demo_bits); 94 case Intro : // setup(demo_bits);
95 break; 95 break;
96 case Demo : setup(demo_bits); 96 case Demo : setup(demo_bits);
diff --git a/noncore/games/kpacman/keys.cpp b/noncore/games/kpacman/keys.cpp
index c609373..8b17785 100644
--- a/noncore/games/kpacman/keys.cpp
+++ b/noncore/games/kpacman/keys.cpp
@@ -1,141 +1,141 @@
1 1
2#include "portable.h" 2#include "portable.h"
3 3
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 <klocale.h> 7#include <klocale.h>
8#include <kstddirs.h> 8#include <kstddirs.h>
9#include <kaccel.h> 9#include <kaccel.h>
10 10
11#include <keys.h> 11#include <keys.h>
12#include <keys.moc> 12#include <keys.moc>
13#elif defined( QPE_PORT ) 13#elif defined( QPE_PORT )
14#include <qaccel.h> 14#include <qaccel.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include "config.h" 16#include "config.h"
17#include "keys.h" 17#include "keys.h"
18#endif 18#endif
19 19
20#include <qpushbt.h> 20#include <qpushbt.h>
21#include <qlabel.h> 21#include <qlabel.h>
22#include <qframe.h> 22#include <qframe.h>
23#include <qkeycode.h> 23#include <qkeycode.h>
24#include <qpixmap.h> 24#include <qpixmap.h>
25#include <qstring.h> 25#include <qstring.h>
26 26
27Keys::Keys( QWidget *parent, const char *name) 27Keys::Keys( QWidget *parent, const char *name)
28 : QDialog( parent, name, TRUE ) 28 : QDialog( parent, name, TRUE )
29{ 29{
30 //KStandardDirs *dirs = KGlobal::dirs(); 30 //KStandardDirs *dirs = KGlobal::dirs();
31 31
32 QPushButton *okButton = new QPushButton(this); 32 QPushButton *okButton = new QPushButton(this);
33 okButton->setText(i18n("Ok")); 33 okButton->setText(tr("Ok"));
34 okButton->setFixedSize(okButton->size()); 34 okButton->setFixedSize(okButton->size());
35 connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) ); 35 connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) );
36 okButton->move(20,210); 36 okButton->move(20,210);
37 37
38 QPushButton *defaultButton = new QPushButton(this); 38 QPushButton *defaultButton = new QPushButton(this);
39 defaultButton->setText(i18n("Defaults")); 39 defaultButton->setText(tr("Defaults"));
40 defaultButton->setFixedSize(defaultButton->size()); 40 defaultButton->setFixedSize(defaultButton->size());
41 connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) ); 41 connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) );
42 defaultButton->move(140,210); 42 defaultButton->move(140,210);
43 43
44 QPushButton *cancelButton = new QPushButton(this); 44 QPushButton *cancelButton = new QPushButton(this);
45 cancelButton->setText(i18n("Cancel")); 45 cancelButton->setText(tr("Cancel"));
46 cancelButton->setFixedSize(cancelButton->size()); 46 cancelButton->setFixedSize(cancelButton->size());
47 connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) ); 47 connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) );
48 cancelButton->move(260,210); 48 cancelButton->move(260,210);
49 49
50 QFrame *separator = new QFrame(this); 50 QFrame *separator = new QFrame(this);
51 separator->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 51 separator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
52 separator->setGeometry( 20, 190, 340, 4 ); 52 separator->setGeometry( 20, 190, 340, 4 );
53 53
54 for ( int x = 0; x < 4; x++) { 54 for ( int x = 0; x < 4; x++) {
55 QLabel *l = new QLabel(this); 55 QLabel *l = new QLabel(this);
56 l->setAlignment(AlignCenter); 56 l->setAlignment(AlignCenter);
57 labels[x] = l; 57 labels[x] = l;
58 } 58 }
59 59
60 labels[0]->setGeometry(120, 20, 140, 20 ); 60 labels[0]->setGeometry(120, 20, 140, 20 );
61 labels[1]->setGeometry(120,160, 140, 20 ); 61 labels[1]->setGeometry(120,160, 140, 20 );
62 labels[2]->setGeometry( 20, 92, 100, 20 ); 62 labels[2]->setGeometry( 20, 92, 100, 20 );
63 labels[3]->setGeometry(265, 92, 100, 20 ); 63 labels[3]->setGeometry(265, 92, 100, 20 );
64 64
65 QString pixPath; 65 QString pixPath;
66 66
67 QPushButton *up = new QPushButton(this); 67 QPushButton *up = new QPushButton(this);
68 pixPath = FIND_APP_DATA( "pics/up.xpm" ); 68 pixPath = FIND_APP_DATA( "pics/up.xpm" );
69 up->setPixmap( QPixmap(pixPath)); 69 up->setPixmap( QPixmap(pixPath));
70 up->setFixedSize(up->pixmap()->size()); 70 up->setFixedSize(up->pixmap()->size());
71 connect( up, SIGNAL(clicked()),this, SLOT(butUp()) ); 71 connect( up, SIGNAL(clicked()),this, SLOT(butUp()) );
72 up->move(180, 50); 72 up->move(180, 50);
73 73
74 QPushButton *down = new QPushButton(this); 74 QPushButton *down = new QPushButton(this);
75 pixPath = FIND_APP_DATA( "pics/down.xpm"); 75 pixPath = FIND_APP_DATA( "pics/down.xpm");
76 down->setPixmap( QPixmap(pixPath)); 76 down->setPixmap( QPixmap(pixPath));
77 down->setFixedSize(down->pixmap()->size()); 77 down->setFixedSize(down->pixmap()->size());
78 connect( down, SIGNAL(clicked()),this, SLOT(butDown()) ); 78 connect( down, SIGNAL(clicked()),this, SLOT(butDown()) );
79 down->move(180, 130); 79 down->move(180, 130);
80 80
81 QPushButton *left = new QPushButton(this); 81 QPushButton *left = new QPushButton(this);
82 pixPath = FIND_APP_DATA( "pics/left.xpm"); 82 pixPath = FIND_APP_DATA( "pics/left.xpm");
83 left->setPixmap( QPixmap(pixPath)); 83 left->setPixmap( QPixmap(pixPath));
84 left->setFixedSize(left->pixmap()->size()); 84 left->setFixedSize(left->pixmap()->size());
85 connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) ); 85 connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) );
86 left->move(140, 90); 86 left->move(140, 90);
87 87
88 QPushButton *right = new QPushButton(this); 88 QPushButton *right = new QPushButton(this);
89 pixPath = FIND_APP_DATA( "pics/right.xpm"); 89 pixPath = FIND_APP_DATA( "pics/right.xpm");
90 right->setPixmap( QPixmap(pixPath)); 90 right->setPixmap( QPixmap(pixPath));
91 right->setFixedSize(right->pixmap()->size()); 91 right->setFixedSize(right->pixmap()->size());
92 connect( right, SIGNAL(clicked()),this, SLOT(butRight()) ); 92 connect( right, SIGNAL(clicked()),this, SLOT(butRight()) );
93 right->move(220, 90); 93 right->move(220, 90);
94 94
95 95
96 setCaption(i18n("Change Direction Keys")); 96 setCaption(tr("Change Direction Keys"));
97 setFixedSize(380, 260); 97 setFixedSize(380, 260);
98 lab = 0; 98 lab = 0;
99 init(); 99 init();
100} 100}
101 101
102void Keys::keyPressEvent( QKeyEvent *e ) 102void Keys::keyPressEvent( QKeyEvent *e )
103{ 103{
104 uint kCode = e->key() & ~(SHIFT | CTRL | ALT); 104 uint kCode = e->key() & ~(SHIFT | CTRL | ALT);
105 QString string = KAccel::keyToString(kCode); 105 QString string = KAccel::keyToString(kCode);
106 106
107 if (lab != 0) { 107 if (lab != 0) {
108 if ( string.isNull() ) 108 if ( string.isNull() )
109 lab->setText(i18n("Undefined key")); 109 lab->setText(tr("Undefined key"));
110 else 110 else
111 lab->setText(string); 111 lab->setText(string);
112 } 112 }
113 else if ( lab == 0 && e->key() == Key_Escape) 113 else if ( lab == 0 && e->key() == Key_Escape)
114 reject(); 114 reject();
115} 115}
116 116
117void Keys::butUp() 117void Keys::butUp()
118{ 118{
119 getKey(0); 119 getKey(0);
120} 120}
121 121
122void Keys::butDown() 122void Keys::butDown()
123{ 123{
124 getKey(1); 124 getKey(1);
125} 125}
126 126
127void Keys::butLeft() 127void Keys::butLeft()
128{ 128{
129 getKey(2); 129 getKey(2);
130} 130}
131 131
132void Keys::butRight() 132void Keys::butRight()
133{ 133{
134 getKey(3); 134 getKey(3);
135} 135}
136 136
137void Keys::getKey(int i) 137void Keys::getKey(int i)
138{ 138{
139 if ( lab != 0) 139 if ( lab != 0)
140 focusOut(lab); 140 focusOut(lab);
141 141
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index 4077085..7df6ef0 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -58,133 +58,133 @@ Kpacman::Kpacman(QWidget *parent, const char *name)
58 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE); 58 focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE);
59 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE); 59 hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE);
60 APP_CONFIG_END( cfg ); 60 APP_CONFIG_END( cfg );
61 61
62 toggleFocusOutPause(); 62 toggleFocusOutPause();
63 toggleFocusInContinue(); 63 toggleFocusInContinue();
64 toggleHideMouseCursor(); 64 toggleHideMouseCursor();
65 65
66#ifndef QWS 66#ifndef QWS
67 menuBar->show(); 67 menuBar->show();
68 view->show(); 68 view->show();
69 setMenu(menuBar); 69 setMenu(menuBar);
70 setView(view); 70 setView(view);
71#else 71#else
72 setCentralWidget( view ); 72 setCentralWidget( view );
73#endif 73#endif
74} 74}
75 75
76Kpacman::~Kpacman() 76Kpacman::~Kpacman()
77{ 77{
78 APP_CONFIG_BEGIN( cfg ); 78 APP_CONFIG_BEGIN( cfg );
79 cfg->writeEntry("FocusOutPause", focusOutPause); 79 cfg->writeEntry("FocusOutPause", focusOutPause);
80 cfg->writeEntry("FocusInContinue", focusInContinue); 80 cfg->writeEntry("FocusInContinue", focusInContinue);
81 cfg->writeEntry("HideMouseCursor", hideMouseCursor); 81 cfg->writeEntry("HideMouseCursor", hideMouseCursor);
82 APP_CONFIG_END( cfg ); 82 APP_CONFIG_END( cfg );
83 delete _menuBar; 83 delete _menuBar;
84} 84}
85 85
86void Kpacman::menu() 86void Kpacman::menu()
87{ 87{
88 gamePopup = new QPopupMenu(); 88 gamePopup = new QPopupMenu();
89 CHECK_PTR( gamePopup ); 89 CHECK_PTR( gamePopup );
90 newID = gamePopup->insertItem(i18n("&New"), this, SLOT(newKpacman()),Key_F2); 90 newID = gamePopup->insertItem(tr("&New"), this, SLOT(newKpacman()),Key_F2);
91 pauseID = gamePopup->insertItem(i18n("&Pause"), 91 pauseID = gamePopup->insertItem(tr("&Pause"),
92 this, SLOT(pauseKpacman()), Key_F3); 92 this, SLOT(pauseKpacman()), Key_F3);
93 hofID = gamePopup->insertItem(i18n("&Hall of fame"), 93 hofID = gamePopup->insertItem(tr("&Hall of fame"),
94 this, SLOT(toggleHallOfFame()), Key_F4); 94 this, SLOT(toggleHallOfFame()), Key_F4);
95 gamePopup->insertSeparator(); 95 gamePopup->insertSeparator();
96 gamePopup->insertItem(i18n("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q); 96 gamePopup->insertItem(tr("&Quit"), this, SLOT(quitKpacman()), CTRL+Key_Q);
97 gamePopup->setCheckable(TRUE); 97 gamePopup->setCheckable(TRUE);
98 98
99 optionsPopup = new QPopupMenu(); 99 optionsPopup = new QPopupMenu();
100 CHECK_PTR(optionsPopup); 100 CHECK_PTR(optionsPopup);
101 101
102 modesPopup = new QPopupMenu(); 102 modesPopup = new QPopupMenu();
103 CHECK_PTR(modesPopup); 103 CHECK_PTR(modesPopup);
104 104
105 hideMouseCursorID = optionsPopup->insertItem(i18n("&Hide Mousecursor"), 105 hideMouseCursorID = optionsPopup->insertItem(tr("&Hide Mousecursor"),
106 this, SLOT(toggleHideMouseCursor()), 106 this, SLOT(toggleHideMouseCursor()),
107 CTRL+Key_H); 107 CTRL+Key_H);
108 optionsPopup->insertSeparator(); 108 optionsPopup->insertSeparator();
109 109
110 if (lookupSchemes() > 0) { 110 if (lookupSchemes() > 0) {
111 optionsPopup->insertItem(i18n("&Select graphic scheme"), modesPopup); 111 optionsPopup->insertItem(tr("&Select graphic scheme"), modesPopup);
112 optionsPopup->insertSeparator(); 112 optionsPopup->insertSeparator();
113 } 113 }
114 114
115 focusOutPauseID = optionsPopup->insertItem(i18n("&Pause in Background"), 115 focusOutPauseID = optionsPopup->insertItem(tr("&Pause in Background"),
116 this, SLOT(toggleFocusOutPause())); 116 this, SLOT(toggleFocusOutPause()));
117 focusInContinueID = optionsPopup->insertItem(i18n("&Continue in Foreground"), 117 focusInContinueID = optionsPopup->insertItem(tr("&Continue in Foreground"),
118 this, SLOT(toggleFocusInContinue())); 118 this, SLOT(toggleFocusInContinue()));
119 optionsPopup->insertSeparator(); 119 optionsPopup->insertSeparator();
120 120
121 optionsPopup->insertItem(i18n("Change &keys..."), this, SLOT(confKeys())); 121 optionsPopup->insertItem(tr("Change &keys..."), this, SLOT(confKeys()));
122 122
123#ifndef QWS 123#ifndef QWS
124 QString aboutText = i18n("@PACKAGE@ - @VERSION@\n\n" 124 QString aboutText = tr("@PACKAGE@ - @VERSION@\n\n"
125 "Joerg Thoennissen (joe@dsite.de)\n\n" 125 "Joerg Thoennissen (joe@dsite.de)\n\n"
126 "A pacman game for the KDE Desktop\n\n" 126 "A pacman game for the KDE Desktop\n\n"
127 "The program based on the source of ksnake\n" 127 "The program based on the source of ksnake\n"
128 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" 128 "by Michel Filippi (mfilippi@sade.rhein-main.de).\n"
129 "The design was strongly influenced by the pacman\n" 129 "The design was strongly influenced by the pacman\n"
130 "(c) 1980 MIDWAY MFG.CO.\n\n" 130 "(c) 1980 MIDWAY MFG.CO.\n\n"
131 "I like to thank my girlfriend Elke Krueers for\n" 131 "I like to thank my girlfriend Elke Krueers for\n"
132 "the last 10 years of her friendship.\n"); 132 "the last 10 years of her friendship.\n");
133 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE); 133 aboutText.replace(QRegExp("@PACKAGE@"), PACKAGE);
134 aboutText.replace(QRegExp("@VERSION@"), VERSION); 134 aboutText.replace(QRegExp("@VERSION@"), VERSION);
135 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE); 135 QPopupMenu *helpPopup = helpMenu(aboutText, FALSE);
136#endif 136#endif
137 137
138 //_menuBar = new KMenuBar(this); 138 //_menuBar = new KMenuBar(this);
139 //CHECK_PTR( _menuBar ); 139 //CHECK_PTR( _menuBar );
140 //_menuBar->insertItem(i18n("&Game"), gamePopup); 140 //_menuBar->insertItem(tr("&Game"), gamePopup);
141 //_menuBar->insertItem(i18n("&Options"), optionsPopup); 141 //_menuBar->insertItem(tr("&Options"), optionsPopup);
142 //_menuBar->insertSeparator(); 142 //_menuBar->insertSeparator();
143#ifndef QWS 143#ifndef QWS
144 _menuBar->insertItem(i18n("&Help"), helpPopup); 144 _menuBar->insertItem(tr("&Help"), helpPopup);
145#endif 145#endif
146} 146}
147 147
148int Kpacman::lookupSchemes() 148int Kpacman::lookupSchemes()
149{ 149{
150 APP_CONFIG_BEGIN( cfg ); 150 APP_CONFIG_BEGIN( cfg );
151 int ModeCount = cfg->readNumEntry("ModeCount", -1); 151 int ModeCount = cfg->readNumEntry("ModeCount", -1);
152 int Mode = cfg->readNumEntry("Mode", -1); 152 int Mode = cfg->readNumEntry("Mode", -1);
153 int SchemeCount = cfg->readNumEntry("SchemeCount"); 153 int SchemeCount = cfg->readNumEntry("SchemeCount");
154 int Scheme = cfg->readNumEntry("Scheme", -1); 154 int Scheme = cfg->readNumEntry("Scheme", -1);
155 155
156 if (SchemeCount == 0 || Scheme == -1) { 156 if (SchemeCount == 0 || Scheme == -1) {
157 QMessageBox::warning(this, i18n("Configuration Error"), 157 QMessageBox::warning(this, tr("Configuration Error"),
158 i18n("There are no schemes defined,\n" 158 tr("There are no schemes defined,\n"
159 "or no scheme is selected.")); 159 "or no scheme is selected."));
160 APP_CONFIG_END( cfg ); 160 APP_CONFIG_END( cfg );
161 return 0; 161 return 0;
162 } 162 }
163 163
164 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); 164 connect(modesPopup, SIGNAL(activated(int)), this, SLOT(schemeChecked(int)));
165 modeID.resize(ModeCount > 0 ? ModeCount : 0); 165 modeID.resize(ModeCount > 0 ? ModeCount : 0);
166 166
167 if (!schemesPopup->isEmpty()) 167 if (!schemesPopup->isEmpty())
168 schemesPopup->clear(); 168 schemesPopup->clear();
169 169
170 SAVE_CONFIG_GROUP( cfg, oldgroup ); 170 SAVE_CONFIG_GROUP( cfg, oldgroup );
171 171
172 QString ModeGroup; 172 QString ModeGroup;
173 QString ModeName; 173 QString ModeName;
174 174
175 for (int m = 0; m < ModeCount; m++) { 175 for (int m = 0; m < ModeCount; m++) {
176 ModeGroup.sprintf("Mode %d", m); 176 ModeGroup.sprintf("Mode %d", m);
177 cfg->setGroup(ModeGroup); 177 cfg->setGroup(ModeGroup);
178 178
179 ModeName = cfg->readEntry("Description", ModeGroup); 179 ModeName = cfg->readEntry("Description", ModeGroup);
180 180
181 QPopupMenu *p = new QPopupMenu; 181 QPopupMenu *p = new QPopupMenu;
182 p->setCheckable(TRUE); 182 p->setCheckable(TRUE);
183 connect(p, SIGNAL(activated(int)), this, SLOT(schemeChecked(int))); 183 connect(p, SIGNAL(activated(int)), this, SLOT(schemeChecked(int)));
184 schemesPopup->append(p); 184 schemesPopup->append(p);
185 185
186 modeID[m] = modesPopup->insertItem(ModeName, schemesPopup->at(m)); 186 modeID[m] = modesPopup->insertItem(ModeName, schemesPopup->at(m));
187 modesPopup->setItemEnabled(modeID[m], FALSE); 187 modesPopup->setItemEnabled(modeID[m], FALSE);
188 modesPopup->setItemChecked(modeID[m], m == Mode); 188 modesPopup->setItemChecked(modeID[m], m == Mode);
189 } 189 }
190 190
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp
index 330c88e..215dcda 100644
--- a/noncore/games/kpacman/kpacmanwidget.cpp
+++ b/noncore/games/kpacman/kpacmanwidget.cpp
@@ -85,69 +85,69 @@ void KpacmanWidget::confScheme()
85 if (scheme != -1 || mode == -1) { 85 if (scheme != -1 || mode == -1) {
86 newgroup.sprintf("Scheme %d", scheme); 86 newgroup.sprintf("Scheme %d", scheme);
87 cfg->setGroup(newgroup); 87 cfg->setGroup(newgroup);
88 88
89 mode = cfg->readNumEntry("Mode", -1); 89 mode = cfg->readNumEntry("Mode", -1);
90 RESTORE_CONFIG_GROUP( cfg, oldgroup ); 90 RESTORE_CONFIG_GROUP( cfg, oldgroup );
91 } 91 }
92 } 92 }
93 93
94 confMisc(); 94 confMisc();
95 95
96 if (mode != -1) { 96 if (mode != -1) {
97 newgroup.sprintf("Mode %d", mode); 97 newgroup.sprintf("Mode %d", mode);
98 cfg->setGroup(newgroup); 98 cfg->setGroup(newgroup);
99 99
100 confMisc(FALSE); 100 confMisc(FALSE);
101 } 101 }
102 102
103 if (scheme != -1) { 103 if (scheme != -1) {
104 newgroup.sprintf("Scheme %d", scheme); 104 newgroup.sprintf("Scheme %d", scheme);
105 cfg->setGroup(newgroup); 105 cfg->setGroup(newgroup);
106 106
107 confMisc(FALSE); 107 confMisc(FALSE);
108 } 108 }
109 109
110 if (lastFontName != fontName) { 110 if (lastFontName != fontName) {
111 111
112 if (bitfont != 0) 112 if (bitfont != 0)
113 delete bitfont; 113 delete bitfont;
114 114
115 bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar); 115 bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar);
116 if (bitfont->width() == 0 || bitfont->height() == 0) { 116 if (bitfont->width() == 0 || bitfont->height() == 0) {
117 QString msg = i18n("The bitfont could not be contructed.\n\n" 117 QString msg = tr("The bitfont could not be contructed.\n\n"
118 "The file '@FONTNAME@' does not exist,\n" 118 "The file '@FONTNAME@' does not exist,\n"
119 "or is of an unknown format."); 119 "or is of an unknown format.");
120 msg.replace(QRegExp("@FONTNAME@"), fontName); 120 msg.replace(QRegExp("@FONTNAME@"), fontName);
121 // QMessageBox::critical(this, i18n("Initialization Error"), msg); 121 // QMessageBox::critical(this, tr("Initialization Error"), msg);
122 printf("%s\n", msg.data()); 122 printf("%s\n", msg.data());
123 } 123 }
124 } 124 }
125 125
126 RESTORE_CONFIG_GROUP( cfg, oldgroup ); 126 RESTORE_CONFIG_GROUP( cfg, oldgroup );
127 APP_CONFIG_END( cfg ); 127 APP_CONFIG_END( cfg );
128} 128}
129 129
130void KpacmanWidget::setScheme(int Scheme, int Mode) 130void KpacmanWidget::setScheme(int Scheme, int Mode)
131{ 131{
132 mode = Mode; 132 mode = Mode;
133 scheme = Scheme; 133 scheme = Scheme;
134 134
135 confScheme(); 135 confScheme();
136 136
137 score->setScheme(Scheme, Mode, bitfont); 137 score->setScheme(Scheme, Mode, bitfont);
138 referee->setScheme(Scheme, Mode, bitfont); 138 referee->setScheme(Scheme, Mode, bitfont);
139 status->setScheme(Scheme, Mode); 139 status->setScheme(Scheme, Mode);
140 140
141#ifndef QWS 141#ifndef QWS
142 setFixedSize(referee->width(), 142 setFixedSize(referee->width(),
143 bitfont->height()*3 + referee->height() + status->height()); 143 bitfont->height()*3 + referee->height() + status->height());
144#endif 144#endif
145 145
146 score->repaint(FALSE); 146 score->repaint(FALSE);
147 referee->repaint(FALSE); 147 referee->repaint(FALSE);
148 status->repaint(FALSE); 148 status->repaint(FALSE);
149} 149}
150 150
151void KpacmanWidget::resizeEvent( QResizeEvent * ) 151void KpacmanWidget::resizeEvent( QResizeEvent * )
152{ 152{
153 referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); 153 referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height());
diff --git a/noncore/games/kpacman/painter.cpp b/noncore/games/kpacman/painter.cpp
index 16fed55..80aeab0 100644
--- a/noncore/games/kpacman/painter.cpp
+++ b/noncore/games/kpacman/painter.cpp
@@ -45,69 +45,69 @@ Painter::Painter( Board *b, QWidget *parent, int Scheme, int Mode, Bitfont *font
45 lastPrisonPixmapName = ""; 45 lastPrisonPixmapName = "";
46 lastEnergizerPixmapName = ""; 46 lastEnergizerPixmapName = "";
47 lastFruitPixmapName = ""; 47 lastFruitPixmapName = "";
48 lastPacmanPixmapName = ""; 48 lastPacmanPixmapName = "";
49 lastDyingPixmapName = ""; 49 lastDyingPixmapName = "";
50 lastEyesPixmapName = ""; 50 lastEyesPixmapName = "";
51 lastMonsterPixmapName = ""; 51 lastMonsterPixmapName = "";
52 lastFruitScorePixmapName = ""; 52 lastFruitScorePixmapName = "";
53 lastMonsterScorePixmapName = ""; 53 lastMonsterScorePixmapName = "";
54 54
55 bitfont = font; 55 bitfont = font;
56 56
57 scheme = Scheme; 57 scheme = Scheme;
58 mode = Mode; 58 mode = Mode;
59 level = 0; 59 level = 0;
60 60
61 confScheme(); 61 confScheme();
62} 62}
63 63
64QList<QPixmap> *Painter::loadPixmap(QWidget*, QString pixmapName, 64QList<QPixmap> *Painter::loadPixmap(QWidget*, QString pixmapName,
65 QList<QPixmap> *pixmaps) 65 QList<QPixmap> *pixmaps)
66{ 66{
67 if (pixmaps == NULL) { 67 if (pixmaps == NULL) {
68 pixmaps = new QList<QPixmap>; 68 pixmaps = new QList<QPixmap>;
69 pixmaps->setAutoDelete(TRUE); 69 pixmaps->setAutoDelete(TRUE);
70 } 70 }
71 71
72 if (!pixmaps->isEmpty()) 72 if (!pixmaps->isEmpty())
73 pixmaps->clear(); 73 pixmaps->clear();
74 74
75 QPixmap PIXMAP(pixmapName); 75 QPixmap PIXMAP(pixmapName);
76 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { 76 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
77 QString msg = i18n("The pixmap could not be contructed.\n\n" 77 QString msg = "The pixmap could not be contructed.\n\n"
78 "The file '@PIXMAPNAME@' does not exist,\n" 78 "The file '@PIXMAPNAME@' does not exist,\n"
79 "or is of an unknown format."); 79 "or is of an unknown format.";
80 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName); 80 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
81 // QMessageBox::critical(parent, i18n("Initialization Error"), msg); 81 // QMessageBox::critical(parent, tr("Initialization Error"), msg);
82 printf("%s\n", msg.data()); 82 printf("%s\n", msg.data());
83 return 0; 83 return 0;
84 } 84 }
85 85
86 int height = PIXMAP.height(); 86 int height = PIXMAP.height();
87 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); 87 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
88 88
89 QBitmap BITMAP; 89 QBitmap BITMAP;
90 QBitmap MASK; 90 QBitmap MASK;
91 91
92 BITMAP = *PIXMAP.mask(); 92 BITMAP = *PIXMAP.mask();
93 MASK.resize(width, height); 93 MASK.resize(width, height);
94 94
95 for (int x = 0; x < PIXMAP.width()/width; x++) { 95 for (int x = 0; x < PIXMAP.width()/width; x++) {
96 QPixmap *pixmap = new QPixmap(width, height); 96 QPixmap *pixmap = new QPixmap(width, height);
97 pixmaps->append(pixmap); 97 pixmaps->append(pixmap);
98 bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE); 98 bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE);
99 bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE); 99 bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE);
100 pixmap->setMask(MASK); 100 pixmap->setMask(MASK);
101 } 101 }
102 102
103 return pixmaps; 103 return pixmaps;
104} 104}
105 105
106QList<QPixmap> *Painter::textPixmap(QStrList &str, QList<QPixmap> *pixmaps, 106QList<QPixmap> *Painter::textPixmap(QStrList &str, QList<QPixmap> *pixmaps,
107 QColor fg, QColor bg) 107 QColor fg, QColor bg)
108{ 108{
109 if (pixmaps == NULL) { 109 if (pixmaps == NULL) {
110 pixmaps = new QList<QPixmap>; 110 pixmaps = new QList<QPixmap>;
111 pixmaps->setAutoDelete(TRUE); 111 pixmaps->setAutoDelete(TRUE);
112 } 112 }
113 113
diff --git a/noncore/games/kpacman/referee.cpp b/noncore/games/kpacman/referee.cpp
index 567a8ed..9edaabd 100644
--- a/noncore/games/kpacman/referee.cpp
+++ b/noncore/games/kpacman/referee.cpp
@@ -66,136 +66,136 @@ Referee::Referee( QWidget *parent, const char *name, int Scheme, int Mode, Bitfo
66 energizerRect = new QList<QRect>; 66 energizerRect = new QList<QRect>;
67 energizerRect->setAutoDelete(TRUE); 67 energizerRect->setAutoDelete(TRUE);
68 68
69 pacmanRect.setRect(0, 0, 0, 0); 69 pacmanRect.setRect(0, 0, 0, 0);
70 fruitRect.setRect(0, 0, 0, 0); 70 fruitRect.setRect(0, 0, 0, 0);
71 71
72 QTime midnight( 0, 0, 0 ); 72 QTime midnight( 0, 0, 0 );
73 srand( midnight.secsTo(QTime::currentTime()) ); 73 srand( midnight.secsTo(QTime::currentTime()) );
74 74
75 lifes = 0; 75 lifes = 0;
76 points = 0; 76 points = 0;
77 77
78 emit setLifes(lifes); 78 emit setLifes(lifes);
79 emit setPoints(points); 79 emit setPoints(points);
80 80
81 intro(); 81 intro();
82} 82}
83 83
84void Referee::paintEvent( QPaintEvent *e) 84void Referee::paintEvent( QPaintEvent *e)
85{ 85{
86 if (gameState.testBit(HallOfFame)) 86 if (gameState.testBit(HallOfFame))
87 return; 87 return;
88 88
89 QRect rect = e->rect(); 89 QRect rect = e->rect();
90 90
91 if (!rect.isEmpty()) { 91 if (!rect.isEmpty()) {
92 QPixmap p = pix->levelPix(); 92 QPixmap p = pix->levelPix();
93 bitBlt(this, rect.x(), rect.y(), 93 bitBlt(this, rect.x(), rect.y(),
94 &p, rect.x(), rect.y(), rect.width(), rect.height()); 94 &p, rect.x(), rect.y(), rect.width(), rect.height());
95 } 95 }
96 96
97 if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) && 97 if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) &&
98 rect.intersects(pix->rect(board->position(fruithome), i18n("GAME OVER")))) 98 rect.intersects(pix->rect(board->position(fruithome), tr("GAME OVER"))))
99 pix->draw(board->position(fruithome), Widget, i18n("GAME OVER"), RED); 99 pix->draw(board->position(fruithome), Widget, tr("GAME OVER"), RED);
100 100
101 for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) { 101 for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) {
102 if (e && e->state() == on && 102 if (e && e->state() == on &&
103 rect.intersects(pix->rect(e->position(), EnergizerPix)) && 103 rect.intersects(pix->rect(e->position(), EnergizerPix)) &&
104 !(e->position() == pacman->position() && gameState.testBit(Scoring))) { 104 !(e->position() == pacman->position() && gameState.testBit(Scoring))) {
105 if (e->pix() != -1) 105 if (e->pix() != -1)
106 pix->draw(e->position(), Widget, EnergizerPix, e->pix()); 106 pix->draw(e->position(), Widget, EnergizerPix, e->pix());
107 } 107 }
108 } 108 }
109 109
110 if (!gameState.testBit(Init)) { 110 if (!gameState.testBit(Init)) {
111 111
112 if (!gameState.testBit(Dying) && (fruit->pix() != -1)) 112 if (!gameState.testBit(Dying) && (fruit->pix() != -1))
113 if (fruit->state() != active) { 113 if (fruit->state() != active) {
114 if (rect.intersects(pix->rect(fruit->position(), FruitScorePix, fruit->pix()))) 114 if (rect.intersects(pix->rect(fruit->position(), FruitScorePix, fruit->pix())))
115 pix->draw(fruit->position(), Widget, FruitScorePix, fruit->pix()); 115 pix->draw(fruit->position(), Widget, FruitScorePix, fruit->pix());
116 } else { 116 } else {
117 if (rect.intersects(pix->rect(fruit->position(), FruitPix, fruit->pix()))) 117 if (rect.intersects(pix->rect(fruit->position(), FruitPix, fruit->pix())))
118 pix->draw(fruit->position(), Widget, FruitPix, fruit->pix()); 118 pix->draw(fruit->position(), Widget, FruitPix, fruit->pix());
119 } 119 }
120 120
121 for (Monster *m = monsters->first(); m != 0; m = monsters->next()) 121 for (Monster *m = monsters->first(); m != 0; m = monsters->next())
122 if (m && m->state() == harmless && 122 if (m && m->state() == harmless &&
123 rect.intersects(pix->rect(m->position(), MonsterPix)) && 123 rect.intersects(pix->rect(m->position(), MonsterPix)) &&
124 !(m->position() == pacman->position() && gameState.testBit(Scoring))) { 124 !(m->position() == pacman->position() && gameState.testBit(Scoring))) {
125 if (m->body() != -1) 125 if (m->body() != -1)
126 pix->draw(m->position(), Widget, MonsterPix, m->body()); 126 pix->draw(m->position(), Widget, MonsterPix, m->body());
127 if (m->eyes() != -1) 127 if (m->eyes() != -1)
128 pix->draw(m->position(), Widget, EyesPix, m->eyes()); 128 pix->draw(m->position(), Widget, EyesPix, m->eyes());
129 } 129 }
130 130
131 if (!gameState.testBit(Scoring) && !gameState.testBit(LevelDone) && 131 if (!gameState.testBit(Scoring) && !gameState.testBit(LevelDone) &&
132 rect.intersects(pix->rect(pacman->position(), PacmanPix)) && pacman->pix() != -1) 132 rect.intersects(pix->rect(pacman->position(), PacmanPix)) && pacman->pix() != -1)
133 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); 133 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix());
134 134
135 for (Monster *m = monsters->first(); m != 0; m = monsters->next()) 135 for (Monster *m = monsters->first(); m != 0; m = monsters->next())
136 if (m && m->state() != harmless && 136 if (m && m->state() != harmless &&
137 rect.intersects(pix->rect(m->position(), MonsterPix)) && 137 rect.intersects(pix->rect(m->position(), MonsterPix)) &&
138 !(m->position() == pacman->position() && gameState.testBit(Scoring))) { 138 !(m->position() == pacman->position() && gameState.testBit(Scoring))) {
139 if (m->body() != -1) 139 if (m->body() != -1)
140 pix->draw(m->position(), Widget, MonsterPix, m->body()); 140 pix->draw(m->position(), Widget, MonsterPix, m->body());
141 if (m->eyes() != -1) 141 if (m->eyes() != -1)
142 pix->draw(m->position(), Widget, EyesPix, m->eyes()); 142 pix->draw(m->position(), Widget, EyesPix, m->eyes());
143 } 143 }
144 } 144 }
145 145
146 if (gameState.testBit(Scoring) && 146 if (gameState.testBit(Scoring) &&
147 rect.intersects(pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))) 147 rect.intersects(pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1)))
148 pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1); 148 pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1);
149 149
150 if (gameState.testBit(Init) && gameState.testBit(Dying) && 150 if (gameState.testBit(Init) && gameState.testBit(Dying) &&
151 timerCount < pix->maxPixmaps(DyingPix) && 151 timerCount < pix->maxPixmaps(DyingPix) &&
152 rect.intersects(pix->rect(pacman->position(), PacmanPix))) 152 rect.intersects(pix->rect(pacman->position(), PacmanPix)))
153 pix->draw(pacman->position(), Widget, DyingPix, timerCount); 153 pix->draw(pacman->position(), Widget, DyingPix, timerCount);
154 154
155 if (gameState.testBit(LevelDone) && 155 if (gameState.testBit(LevelDone) &&
156 rect.intersects(pix->rect(pacman->position(), PacmanPix))) 156 rect.intersects(pix->rect(pacman->position(), PacmanPix)))
157 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); 157 pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix());
158 158
159 if (gameState.testBit(Player) && 159 if (gameState.testBit(Player) &&
160 rect.intersects(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")))) 160 rect.intersects(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE"))))
161 pix->draw(board->position(monsterhome, 0), Widget, i18n("PLAYER ONE"), CYAN); 161 pix->draw(board->position(monsterhome, 0), Widget, tr("PLAYER ONE"), CYAN);
162 162
163 if (gameState.testBit(Ready) && 163 if (gameState.testBit(Ready) &&
164 rect.intersects(pix->rect(board->position(fruithome), i18n("READY!")))) 164 rect.intersects(pix->rect(board->position(fruithome), tr("READY!"))))
165 pix->draw(board->position(fruithome), Widget, i18n("READY!"), YELLOW); 165 pix->draw(board->position(fruithome), Widget, tr("READY!"), YELLOW);
166 166
167 if (gameState.testBit(Paused) && 167 if (gameState.testBit(Paused) &&
168 rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")))) 168 rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED"))))
169 pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, i18n("PAUSED"), RED, BLACK); 169 pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, tr("PAUSED"), RED, BLACK);
170} 170}
171 171
172void Referee::timerEvent( QTimerEvent *e ) 172void Referee::timerEvent( QTimerEvent *e )
173{ 173{
174 if (gameState.testBit(HallOfFame)) 174 if (gameState.testBit(HallOfFame))
175 return; 175 return;
176 176
177 QRect lastRect; 177 QRect lastRect;
178 int lastPix; 178 int lastPix;
179 bool moved = FALSE; 179 bool moved = FALSE;
180 int eated = 0; 180 int eated = 0;
181 181
182 if (e->timerId() == energizerTimer) { 182 if (e->timerId() == energizerTimer) {
183 for (int e = 0; e < board->energizers(); e++) { 183 for (int e = 0; e < board->energizers(); e++) {
184 lastRect = pix->rect(energizers->at(e)->position(), EnergizerPix); 184 lastRect = pix->rect(energizers->at(e)->position(), EnergizerPix);
185 lastPix = energizers->at(e)->pix(); 185 lastPix = energizers->at(e)->pix();
186 if (energizers->at(e)->move()) { 186 if (energizers->at(e)->move()) {
187 moved = TRUE; 187 moved = TRUE;
188 *energizerRect->at(e) = pix->rect(energizers->at(e)->position(), EnergizerPix); 188 *energizerRect->at(e) = pix->rect(energizers->at(e)->position(), EnergizerPix);
189 if (lastPix == energizers->at(e)->pix() && 189 if (lastPix == energizers->at(e)->pix() &&
190 lastRect == pix->rect(energizers->at(e)->position(), EnergizerPix)) 190 lastRect == pix->rect(energizers->at(e)->position(), EnergizerPix))
191 energizerRect->at(e)->setRect(0, 0, 0, 0); 191 energizerRect->at(e)->setRect(0, 0, 0, 0);
192 else 192 else
193 *energizerRect->at(e) = pix->rect(*energizerRect->at(e), lastRect); 193 *energizerRect->at(e) = pix->rect(*energizerRect->at(e), lastRect);
194 } 194 }
195 } 195 }
196 196
197 for (int e = 0; e < board->energizers(); e++) 197 for (int e = 0; e < board->energizers(); e++)
198 if (!energizerRect->at(e)->isNull()) 198 if (!energizerRect->at(e)->isNull())
199 repaint(*energizerRect->at(e), FALSE); 199 repaint(*energizerRect->at(e), FALSE);
200 200
201 return; 201 return;
@@ -811,157 +811,157 @@ void Referee::eaten()
811 for (Monster *m = monsters->first(); m != 0; m = monsters->next()) 811 for (Monster *m = monsters->first(); m != 0; m = monsters->next())
812 if (m && m->direction() == X && !gameState.testBit(Introducing)) 812 if (m && m->direction() == X && !gameState.testBit(Introducing))
813 m->setDirection(N); 813 m->setDirection(N);
814 if (monstersEaten != 4 || !gameState.testBit(Introducing)) 814 if (monstersEaten != 4 || !gameState.testBit(Introducing))
815 QTimer::singleShot( monsterScoreDurMS, this, SLOT(start())); 815 QTimer::singleShot( monsterScoreDurMS, this, SLOT(start()));
816 } 816 }
817} 817}
818 818
819void Referee::toggleHallOfFame() 819void Referee::toggleHallOfFame()
820{ 820{
821 gameState.toggleBit(HallOfFame); 821 gameState.toggleBit(HallOfFame);
822} 822}
823 823
824void Referee::hallOfFame() 824void Referee::hallOfFame()
825{ 825{
826 if (gameState.testBit(HallOfFame)) // If the HallOfFame is switched on manually, toggle the 826 if (gameState.testBit(HallOfFame)) // If the HallOfFame is switched on manually, toggle the
827 toggleHallOfFame(); // bit twice. 827 toggleHallOfFame(); // bit twice.
828 828
829 emit setLevel(0); // Clear status display for hall of fame 829 emit setLevel(0); // Clear status display for hall of fame
830 emit setScore(level, 0); 830 emit setScore(level, 0);
831 emit forcedHallOfFame(TRUE); 831 emit forcedHallOfFame(TRUE);
832} 832}
833 833
834void Referee::pause() 834void Referee::pause()
835{ 835{
836 static int pausedTimer = 0; 836 static int pausedTimer = 0;
837 837
838 if (!gameState.testBit(Paused)) { 838 if (!gameState.testBit(Paused)) {
839 pausedTimer = gameTimer; 839 pausedTimer = gameTimer;
840 stop(); 840 stop();
841 stopEnergizer(); 841 stopEnergizer();
842 gameState.setBit(Paused); 842 gameState.setBit(Paused);
843 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); 843 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED")), FALSE);
844 } else { 844 } else {
845 gameState.clearBit(Paused); 845 gameState.clearBit(Paused);
846 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); 846 repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, tr("PAUSED")), FALSE);
847 if (pausedTimer) { 847 if (pausedTimer) {
848 pausedTimer = 0; 848 pausedTimer = 0;
849 start(); 849 start();
850 } 850 }
851 } 851 }
852 emit togglePaused(); 852 emit togglePaused();
853} 853}
854 854
855void Referee::intro() 855void Referee::intro()
856{ 856{
857 stop(); 857 stop();
858 stopEnergizer(); 858 stopEnergizer();
859 bool paused = gameState.testBit(Paused); 859 bool paused = gameState.testBit(Paused);
860 860
861 gameState.fill(FALSE); 861 gameState.fill(FALSE);
862 gameState.setBit(Introducing); 862 gameState.setBit(Introducing);
863 gameState.setBit(Init); 863 gameState.setBit(Init);
864 864
865 if (paused) 865 if (paused)
866 gameState.setBit(Paused); 866 gameState.setBit(Paused);
867 867
868 level = 0; 868 level = 0;
869 emit setLevel(level); 869 emit setLevel(level);
870 870
871 board->init(Intro); 871 board->init(Intro);
872 pix->setLevel(level); 872 pix->setLevel(level);
873 873
874 initPacman(); 874 initPacman();
875 initFruit(); 875 initFruit();
876 initMonsters(); 876 initMonsters();
877 initEnergizers(); 877 initEnergizers();
878 878
879 repaint(); 879 repaint();
880 880
881 monstersEaten = 0; 881 monstersEaten = 0;
882 timerCount = 0; 882 timerCount = 0;
883 introPlay(); 883 introPlay();
884} 884}
885 885
886void Referee::introMonster(int id) 886void Referee::introMonster(int id)
887{ 887{
888 Monster *m = new Monster(board, id); 888 Monster *m = new Monster(board, id);
889 889
890 m->setPosition((10+id*6)*BoardWidth+10); 890 m->setPosition((10+id*6)*BoardWidth+10);
891 m->setDirection(E); 891 m->setDirection(E);
892 m->setDangerous(dangerousTicks[level], monsterIQ[level]); 892 m->setDangerous(dangerousTicks[level], monsterIQ[level]);
893 m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); 893 m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix));
894 894
895 if (m->body() != -1) 895 if (m->body() != -1)
896 pix->draw(m->position(), RoomPix, MonsterPix, m->body()); 896 pix->draw(m->position(), RoomPix, MonsterPix, m->body());
897 if (m->eyes() != -1) 897 if (m->eyes() != -1)
898 pix->draw(m->position(), RoomPix, EyesPix, m->eyes()); 898 pix->draw(m->position(), RoomPix, EyesPix, m->eyes());
899 899
900 repaint(pix->rect(m->position(), MonsterPix), FALSE); 900 repaint(pix->rect(m->position(), MonsterPix), FALSE);
901 m->setPosition(OUT); 901 m->setPosition(OUT);
902} 902}
903 903
904void Referee::introPaint(int t) 904void Referee::introPaint(int t)
905{ 905{
906 QString pts; 906 QString pts;
907 907
908 switch (t) { 908 switch (t) {
909 case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, QColor(), AlignLeft), FALSE); 909 case 0 : repaint(pix->draw(16, 6, RoomPix, tr("CHARACTER"), WHITE, QColor(), AlignLeft), FALSE);
910 repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, QColor(), AlignLeft), FALSE); 910 repaint(pix->draw(36, 6, RoomPix, tr("/"), WHITE, QColor(), AlignLeft), FALSE);
911 repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, QColor(), AlignLeft), FALSE); 911 repaint(pix->draw(40, 6, RoomPix, tr("NICKNAME"), WHITE, QColor(), AlignLeft), FALSE);
912 break; 912 break;
913 case 1 : introMonster(0); 913 case 1 : introMonster(0);
914 break; 914 break;
915 case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, QColor(), AlignLeft), FALSE); 915 case 2 : repaint(pix->draw(16, 10, RoomPix, tr("-SHADOW"), RED, QColor(), AlignLeft), FALSE);
916 break; 916 break;
917 case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, QColor(), AlignLeft), FALSE); 917 case 3 : repaint(pix->draw(38, 10, RoomPix, tr("\"BLINKY\""), RED, QColor(), AlignLeft), FALSE);
918 break; 918 break;
919 case 4 : introMonster(1); 919 case 4 : introMonster(1);
920 break; 920 break;
921 case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, QColor(), AlignLeft), FALSE); 921 case 5 : repaint(pix->draw(16, 16, RoomPix, tr("-SPEEDY"), PINK, QColor(), AlignLeft), FALSE);
922 break; 922 break;
923 case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, QColor(), AlignLeft), FALSE); 923 case 6 : repaint(pix->draw(38, 16, RoomPix, tr("\"PINKY\""), PINK, QColor(), AlignLeft), FALSE);
924 break; 924 break;
925 case 7 : introMonster(2); 925 case 7 : introMonster(2);
926 break; 926 break;
927 case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE); 927 case 8 : repaint(pix->draw(16, 22, RoomPix, tr("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE);
928 break; 928 break;
929 case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE); 929 case 9 : repaint(pix->draw(38, 22, RoomPix, tr("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE);
930 break; 930 break;
931 case 10 : introMonster(3); 931 case 10 : introMonster(3);
932 break; 932 break;
933 case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE); 933 case 11 : repaint(pix->draw(16, 28, RoomPix, tr("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE);
934 break; 934 break;
935 case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE); 935 case 12 : repaint(pix->draw(38, 28, RoomPix, tr("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE);
936 break; 936 break;
937 case 13 : pts.sprintf("%d", pointScore); 937 case 13 : pts.sprintf("%d", pointScore);
938 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 938 repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
939 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 939 repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
940 pts.sprintf("%d", energizerScore); 940 pts.sprintf("%d", energizerScore);
941 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE); 941 repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
942 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE); 942 repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
943 break; 943 break;
944 case 14 : // "@ 1980 MIDWAY MFG.CO." 944 case 14 : // "@ 1980 MIDWAY MFG.CO."
945#if defined( KDE2_PORT ) 945#if defined( KDE2_PORT )
946 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE); 946 repaint(pix->draw(30, 58, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE);
947#elif defined( QPE_PORT ) 947#elif defined( QPE_PORT )
948 repaint(pix->draw(30, 55, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE); 948 repaint(pix->draw(30, 55, RoomPix, "© 1998-2002 J.THÖNNISSEN", PINK), FALSE);
949 repaint(pix->draw(29, 60, RoomPix, "Qtopia port: Catalin CLIMOV", GREEN), FALSE); 949 repaint(pix->draw(29, 60, RoomPix, "Qtopia port: Catalin CLIMOV", GREEN), FALSE);
950#endif 950#endif
951 break; 951 break;
952 } 952 }
953} 953}
954 954
955void Referee::introPlay() 955void Referee::introPlay()
956{ 956{
957 if (!gameState.testBit(Introducing) || gameState.testBit(Ready)) 957 if (!gameState.testBit(Introducing) || gameState.testBit(Ready))
958 return; 958 return;
959 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 959 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
960 QTimer::singleShot(afterPauseMS, this, SLOT(introPlay())); 960 QTimer::singleShot(afterPauseMS, this, SLOT(introPlay()));
961 return; 961 return;
962 } 962 }
963 963
964 if (!gameState.testBit(Init)) { 964 if (!gameState.testBit(Init)) {
965 if (monstersEaten == 4) { 965 if (monstersEaten == 4) {
966 stop(); 966 stop();
967 QTimer::singleShot(introPostAnimationMS, this, SLOT(demo())); 967 QTimer::singleShot(introPostAnimationMS, this, SLOT(demo()));
@@ -1067,96 +1067,96 @@ void Referee::play()
1067 stop(); 1067 stop();
1068 stopEnergizer(); 1068 stopEnergizer();
1069 1069
1070 gameState.fill(FALSE); 1070 gameState.fill(FALSE);
1071 gameState.setBit(Init); 1071 gameState.setBit(Init);
1072 gameState.setBit(Playing); 1072 gameState.setBit(Playing);
1073 gameState.setBit(Player); 1073 gameState.setBit(Player);
1074 gameState.setBit(Ready); 1074 gameState.setBit(Ready);
1075 1075
1076 lifes = 3; 1076 lifes = 3;
1077 level = 1; 1077 level = 1;
1078 points = 0; 1078 points = 0;
1079 1079
1080 extraLifeScoreIndex = 0; 1080 extraLifeScoreIndex = 0;
1081 nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex]; 1081 nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex];
1082 if (nextExtraLifeScore < 0) 1082 if (nextExtraLifeScore < 0)
1083 nextExtraLifeScore *= -1; 1083 nextExtraLifeScore *= -1;
1084 1084
1085 board->init(Level, mapName.at(level)); 1085 board->init(Level, mapName.at(level));
1086 pix->setLevel(level); 1086 pix->setLevel(level);
1087 1087
1088 initPacman(); 1088 initPacman();
1089 initFruit(); 1089 initFruit();
1090 initMonsters(); 1090 initMonsters();
1091 initEnergizers(); 1091 initEnergizers();
1092 1092
1093 repaint(); 1093 repaint();
1094 emit toggleNew(); 1094 emit toggleNew();
1095 emit setLifes(lifes); 1095 emit setLifes(lifes);
1096 emit setLevel(level); 1096 emit setLevel(level);
1097 emit setPoints(points); 1097 emit setPoints(points);
1098 1098
1099 repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); 1099 repaint(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE")), FALSE);
1100 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1100 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1101 1101
1102 timerCount = 0; 1102 timerCount = 0;
1103 QTimer::singleShot(playerDurMS, this, SLOT(ready())); 1103 QTimer::singleShot(playerDurMS, this, SLOT(ready()));
1104} 1104}
1105 1105
1106void Referee::ready() 1106void Referee::ready()
1107{ 1107{
1108 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 1108 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
1109 QTimer::singleShot(afterPauseMS, this, SLOT(ready())); 1109 QTimer::singleShot(afterPauseMS, this, SLOT(ready()));
1110 return; 1110 return;
1111 } 1111 }
1112 1112
1113 if (gameState.testBit(Player)) { 1113 if (gameState.testBit(Player)) {
1114 emit setLifes(--lifes); 1114 emit setLifes(--lifes);
1115 gameState.clearBit(Player); 1115 gameState.clearBit(Player);
1116 gameState.clearBit(Init); 1116 gameState.clearBit(Init);
1117 repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); 1117 repaint(pix->rect(board->position(monsterhome, 0), tr("PLAYER ONE")), FALSE);
1118 repaintFigures(); 1118 repaintFigures();
1119 QTimer::singleShot(playerDurMS, this, SLOT(ready())); 1119 QTimer::singleShot(playerDurMS, this, SLOT(ready()));
1120 return; 1120 return;
1121 } 1121 }
1122 1122
1123 if (gameState.testBit(Ready)) { 1123 if (gameState.testBit(Ready)) {
1124 gameState.clearBit(Ready); 1124 gameState.clearBit(Ready);
1125 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1125 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1126 start(); 1126 start();
1127 } else { 1127 } else {
1128 gameState.setBit(Ready); 1128 gameState.setBit(Ready);
1129 gameState.clearBit(Init); 1129 gameState.clearBit(Init);
1130 repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); 1130 repaint(pix->rect(board->position(fruithome), tr("READY!")), FALSE);
1131 QTimer::singleShot(readyDurMS, this, SLOT(ready())); 1131 QTimer::singleShot(readyDurMS, this, SLOT(ready()));
1132 } 1132 }
1133} 1133}
1134 1134
1135 1135
1136void Referee::levelUp() 1136void Referee::levelUp()
1137{ 1137{
1138 stop(); 1138 stop();
1139 stopEnergizer(); 1139 stopEnergizer();
1140 1140
1141 gameState.setBit(LevelDone); 1141 gameState.setBit(LevelDone);
1142 pacman->setPosition(pacman->position()); // set mouthPosition to "0" 1142 pacman->setPosition(pacman->position()); // set mouthPosition to "0"
1143 repaint(pix->rect(pacman->position(), PacmanPix)); 1143 repaint(pix->rect(pacman->position(), PacmanPix));
1144 1144
1145 timerCount = 0; 1145 timerCount = 0;
1146 QTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay())); 1146 QTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay()));
1147} 1147}
1148 1148
1149void Referee::levelUpPlay() 1149void Referee::levelUpPlay()
1150{ 1150{
1151 if (gameState.testBit(Ready)) 1151 if (gameState.testBit(Ready))
1152 return; 1152 return;
1153 1153
1154 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 1154 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
1155 QTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay())); 1155 QTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay()));
1156 return; 1156 return;
1157 } 1157 }
1158 1158
1159 switch (timerCount) { 1159 switch (timerCount) {
1160 case 0 : gameState.setBit(Init); 1160 case 0 : gameState.setBit(Init);
1161 setOnEnergizers(); 1161 setOnEnergizers();
1162 repaintFigures(); 1162 repaintFigures();
@@ -1265,65 +1265,65 @@ void Referee::killed()
1265 1265
1266 timerCount = 0; 1266 timerCount = 0;
1267 killedPlay(); 1267 killedPlay();
1268 } 1268 }
1269} 1269}
1270 1270
1271void Referee::killedPlay() 1271void Referee::killedPlay()
1272{ 1272{
1273 if (!gameState.testBit(Dying) || gameState.testBit(Ready)) 1273 if (!gameState.testBit(Dying) || gameState.testBit(Ready))
1274 return; 1274 return;
1275 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { 1275 if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
1276 QTimer::singleShot(afterPauseMS, this, SLOT(killedPlay())); 1276 QTimer::singleShot(afterPauseMS, this, SLOT(killedPlay()));
1277 return; 1277 return;
1278 } 1278 }
1279 1279
1280 if (timerCount <= pix->maxPixmaps(DyingPix)) { 1280 if (timerCount <= pix->maxPixmaps(DyingPix)) {
1281 repaint(pix->rect(pacman->position(), PacmanPix), FALSE); 1281 repaint(pix->rect(pacman->position(), PacmanPix), FALSE);
1282 if (timerCount >= pix->maxPixmaps(DyingPix)-1 || timerCount == 0) 1282 if (timerCount >= pix->maxPixmaps(DyingPix)-1 || timerCount == 0)
1283 QTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay())); 1283 QTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay()));
1284 else 1284 else
1285 QTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay())); 1285 QTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay()));
1286 timerCount++; 1286 timerCount++;
1287 } else { 1287 } else {
1288 gameState.clearBit(Dying); 1288 gameState.clearBit(Dying);
1289 stopEnergizer(); 1289 stopEnergizer();
1290 if (lifes == 0) { 1290 if (lifes == 0) {
1291 gameState.setBit(GameOver); 1291 gameState.setBit(GameOver);
1292 gameState.clearBit(Playing); 1292 gameState.clearBit(Playing);
1293 for (int e = 0; e < board->energizers(); e++) { 1293 for (int e = 0; e < board->energizers(); e++) {
1294 energizers->at(e)->setOff(); 1294 energizers->at(e)->setOff();
1295 repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE); 1295 repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE);
1296 } 1296 }
1297 repaint(pix->rect(board->position(fruithome), i18n("GAME OVER")), FALSE); 1297 repaint(pix->rect(board->position(fruithome), tr("GAME OVER")), FALSE);
1298 QTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame())); 1298 QTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame()));
1299 } else { 1299 } else {
1300 gameState.clearBit(Init); 1300 gameState.clearBit(Init);
1301 initPacman(); 1301 initPacman();
1302 initFruit(); 1302 initFruit();
1303 initMonsters(); 1303 initMonsters();
1304 initEnergizers(); 1304 initEnergizers();
1305 emit setLifes(--lifes); 1305 emit setLifes(--lifes);
1306 repaintFigures(); 1306 repaintFigures();
1307 ready(); 1307 ready();
1308 } 1308 }
1309 } 1309 }
1310} 1310}
1311 1311
1312void Referee::initPacman() 1312void Referee::initPacman()
1313{ 1313{
1314 pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix)); 1314 pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix));
1315 pacman->setDemo(gameState.testBit(Demonstration)); 1315 pacman->setDemo(gameState.testBit(Demonstration));
1316 pacman->setPosition(board->position(pacmanhome)); 1316 pacman->setPosition(board->position(pacmanhome));
1317 pacman->setDirection(W, TRUE); 1317 pacman->setDirection(W, TRUE);
1318 pacman->setAlive(pacmanTicks[level]); 1318 pacman->setAlive(pacmanTicks[level]);
1319} 1319}
1320 1320
1321void Referee::initFruit(bool fullInitialization) 1321void Referee::initFruit(bool fullInitialization)
1322{ 1322{
1323 if (fullInitialization) { 1323 if (fullInitialization) {
1324 fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix)); 1324 fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix));
1325 if (fruitIndex[level] == 0) 1325 if (fruitIndex[level] == 0)
1326 fruit->setLevel(level, fruitAppearsTicks[level], 1326 fruit->setLevel(level, fruitAppearsTicks[level],
1327 fruitDurTicks[level], fruitTicks[level]); 1327 fruitDurTicks[level], fruitTicks[level]);
1328 else if (fruitIndex[level] < 0) 1328 else if (fruitIndex[level] < 0)
1329 fruit->setLevel(pix->maxPixmaps(FruitPix)+1, 1329 fruit->setLevel(pix->maxPixmaps(FruitPix)+1,
diff --git a/noncore/games/kpacman/score.cpp b/noncore/games/kpacman/score.cpp
index 6e660e8..17dbf0a 100644
--- a/noncore/games/kpacman/score.cpp
+++ b/noncore/games/kpacman/score.cpp
@@ -46,168 +46,168 @@ Score::Score(QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *f
46 46
47 initKeys(); 47 initKeys();
48 48
49 scheme = Scheme; 49 scheme = Scheme;
50 mode = Mode; 50 mode = Mode;
51 confScheme(); 51 confScheme();
52 52
53 bitfont = font; 53 bitfont = font;
54 54
55 highscoreFile.setName(locateHighscoreFilePath().filePath()); 55 highscoreFile.setName(locateHighscoreFilePath().filePath());
56 read(); 56 read();
57 57
58 for (int p = 0; p < maxPlayer; p++) { 58 for (int p = 0; p < maxPlayer; p++) {
59 playerScore[p] = 0; 59 playerScore[p] = 0;
60 playerName[p] = getenv("LOGNAME"); 60 playerName[p] = getenv("LOGNAME");
61 if (playerName[p].length() < minPlayerNameLength) 61 if (playerName[p].length() < minPlayerNameLength)
62 playerName[p].setExpand(minPlayerNameLength-1, ' '); 62 playerName[p].setExpand(minPlayerNameLength-1, ' ');
63 63
64 for (uint i = 0; i < playerName[p].length(); i++) 64 for (uint i = 0; i < playerName[p].length(); i++)
65 if (playerName[p].at(i) < bitfont->firstChar() || 65 if (playerName[p].at(i) < bitfont->firstChar() ||
66 playerName[p].at(i) > bitfont->lastChar()) 66 playerName[p].at(i) > bitfont->lastChar())
67 playerName[p].at(i) = playerName[p].at(i).upper(); 67 playerName[p].at(i) = playerName[p].at(i).upper();
68 } 68 }
69} 69}
70 70
71Score::~Score() 71Score::~Score()
72{ 72{
73 // write(); 73 // write();
74} 74}
75 75
76void Score::paintEvent( QPaintEvent *e) 76void Score::paintEvent( QPaintEvent *e)
77{ 77{
78 if (rect(1, 0, i18n(" 1UP ")).intersects(e->rect())) { 78 if (rect(1, 0, tr(" 1UP ")).intersects(e->rect())) {
79 QPixmap pix; 79 QPixmap pix;
80 QColor fg = BLACK; 80 QColor fg = BLACK;
81 if (cursor.on || paused || lastPlayer != 0) 81 if (cursor.on || paused || lastPlayer != 0)
82 fg = WHITE; 82 fg = WHITE;
83 pix = bitfont->text(i18n(" 1UP "), fg, BLACK); 83 pix = bitfont->text(tr(" 1UP "), fg, BLACK);
84 bitBlt(this, x(1), y(0), &pix); 84 bitBlt(this, x(1), y(0), &pix);
85 } 85 }
86 86
87 if (rect(8, 0, i18n(" HIGH SCORE ")).intersects(e->rect())) { 87 if (rect(8, 0, tr(" HIGH SCORE ")).intersects(e->rect())) {
88 QPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK); 88 QPixmap pix = bitfont->text(tr(" HIGH SCORE "), WHITE, BLACK);
89 bitBlt(this, x(8), y(0), &pix); 89 bitBlt(this, x(8), y(0), &pix);
90 } 90 }
91 91
92 if (maxPlayer > 1 && rect(21, 0, i18n(" 2UP ")).intersects(e->rect())) { 92 if (maxPlayer > 1 && rect(21, 0, tr(" 2UP ")).intersects(e->rect())) {
93 QPixmap pix; 93 QPixmap pix;
94 QColor fg = BLACK; 94 QColor fg = BLACK;
95 if (cursor.on || paused || lastPlayer != 1) 95 if (cursor.on || paused || lastPlayer != 1)
96 fg = WHITE; 96 fg = WHITE;
97 pix = bitfont->text(i18n(" 2UP "), fg, BLACK); 97 pix = bitfont->text(tr(" 2UP "), fg, BLACK);
98 bitBlt(this, x(21), y(0), &pix); 98 bitBlt(this, x(21), y(0), &pix);
99 } 99 }
100 100
101 QString s; 101 QString s;
102 102
103 s.sprintf("%6d0", playerScore[0]/10); 103 s.sprintf("%6d0", playerScore[0]/10);
104 if (rect(0, 1, s).intersects(e->rect())) { 104 if (rect(0, 1, s).intersects(e->rect())) {
105 QPixmap pix = bitfont->text(s, WHITE, BLACK); 105 QPixmap pix = bitfont->text(s, WHITE, BLACK);
106 bitBlt(this, x(0), y(1), &pix); 106 bitBlt(this, x(0), y(1), &pix);
107 } 107 }
108 108
109 s.sprintf("%8d0", HighScore/10); 109 s.sprintf("%8d0", HighScore/10);
110 if (rect(8, 1, s).intersects(e->rect())) { 110 if (rect(8, 1, s).intersects(e->rect())) {
111 QPixmap pix = bitfont->text(s, WHITE, BLACK); 111 QPixmap pix = bitfont->text(s, WHITE, BLACK);
112 bitBlt(this, x(8), y(1), &pix); 112 bitBlt(this, x(8), y(1), &pix);
113 } 113 }
114 114
115 if (lastScore >= 0) { 115 if (lastScore >= 0) {
116 if (rect(1, 4*1.25, i18n(" CONGRATULATIONS ")).intersects(e->rect())) { 116 if (rect(1, 4*1.25, tr(" CONGRATULATIONS ")).intersects(e->rect())) {
117 QPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK); 117 QPixmap pix = bitfont->text(tr(" CONGRATULATIONS "), YELLOW, BLACK);
118 bitBlt(this, x(1), y(4*1.25), &pix); 118 bitBlt(this, x(1), y(4*1.25), &pix);
119 } 119 }
120 if (rect(1, 6*1.25, i18n(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) { 120 if (rect(1, 6*1.25, tr(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) {
121 QPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK); 121 QPixmap pix = bitfont->text(tr(" YOU HAVE ARCHIEVED "), CYAN, BLACK);
122 bitBlt(this, x(1), y(6*1.25), &pix); 122 bitBlt(this, x(1), y(6*1.25), &pix);
123 } 123 }
124 if (rect(1, 7*1.25, i18n(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) { 124 if (rect(1, 7*1.25, tr(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) {
125 QPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK); 125 QPixmap pix = bitfont->text(tr(" A SCORE IN THE TOP 10. "), CYAN, BLACK);
126 bitBlt(this, x(1), y(7*1.25), &pix); 126 bitBlt(this, x(1), y(7*1.25), &pix);
127 } 127 }
128 if (rect(1, 8*1.25, i18n(" ")).intersects(e->rect())) { 128 if (rect(1, 8*1.25, tr(" ")).intersects(e->rect())) {
129 QPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK); 129 QPixmap pix = bitfont->text(tr(" "), CYAN, BLACK);
130 bitBlt(this, x(1), y(8*1.25), &pix); 130 bitBlt(this, x(1), y(8*1.25), &pix);
131 } 131 }
132 } 132 }
133 133
134 if (rect(1, 9.5*1.25, i18n("RNK SCORE NAME DATE")).intersects(e->rect())) { 134 if (rect(1, 9.5*1.25, tr("RNK SCORE NAME DATE")).intersects(e->rect())) {
135 QPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK); 135 QPixmap pix = bitfont->text(tr("RNK SCORE NAME DATE"), WHITE, BLACK);
136 bitBlt(this, x(1), y(9.5*1.25), &pix); 136 bitBlt(this, x(1), y(9.5*1.25), &pix);
137 } 137 }
138 138
139 for (int i = 0; i < 10; i++) { 139 for (int i = 0; i < 10; i++) {
140 s.sprintf("%2d%9d %-3.3s %-8.8s", 140 s.sprintf("%2d%9d %-3.3s %-8.8s",
141 i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(), 141 i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(),
142 formatDate(hallOfFame[i].moment.date()).data()); 142 formatDate(hallOfFame[i].moment.date()).data());
143 if (rect(1, (11+i)*1.25, s).intersects(e->rect())) { 143 if (rect(1, (11+i)*1.25, s).intersects(e->rect())) {
144 QPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK); 144 QPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK);
145 bitBlt(this, x(1), y((11+i)*1.25), &pix); 145 bitBlt(this, x(1), y((11+i)*1.25), &pix);
146 } 146 }
147 } 147 }
148 148
149 if (cursor.x != -1 && cursor.y != -1 && cursor.on) { 149 if (cursor.x != -1 && cursor.y != -1 && cursor.on) {
150 if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) { 150 if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) {
151 QPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW); 151 QPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW);
152 bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix); 152 bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix);
153 } 153 }
154 } 154 }
155 155
156 if (paused) { 156 if (paused) {
157 157
158 QPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK); 158 QPixmap pix = bitfont->text(tr("PAUSED"), RED, BLACK);
159 QRect r = bitfont->rect(i18n("PAUSED")); 159 QRect r = bitfont->rect(tr("PAUSED"));
160 r.moveCenter(QPoint(this->width()/2, this->height()/2)); 160 r.moveCenter(QPoint(this->width()/2, this->height()/2));
161 161
162 bitBlt(this, r.x(), r.y(), &pix); 162 bitBlt(this, r.x(), r.y(), &pix);
163 } 163 }
164} 164}
165 165
166void Score::timerEvent(QTimerEvent*) 166void Score::timerEvent(QTimerEvent*)
167{ 167{
168 cursor.on = !cursor.on; 168 cursor.on = !cursor.on;
169 169
170 if (paused) 170 if (paused)
171 return; 171 return;
172 172
173 if (cursor.x != -1 && cursor.y != -1) 173 if (cursor.x != -1 && cursor.y != -1)
174 repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); 174 repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE);
175 scrollRepeat = FALSE; 175 scrollRepeat = FALSE;
176 176
177 if (lastPlayer == 0) 177 if (lastPlayer == 0)
178 repaint(rect(1, 0, i18n(" 1UP ")), FALSE); 178 repaint(rect(1, 0, tr(" 1UP ")), FALSE);
179 179
180 if (lastPlayer == 1) 180 if (lastPlayer == 1)
181 repaint(rect(21, 0, i18n(" 2UP ")), FALSE); 181 repaint(rect(21, 0, tr(" 2UP ")), FALSE);
182} 182}
183 183
184void Score::keyPressEvent(QKeyEvent *k) 184void Score::keyPressEvent(QKeyEvent *k)
185{ 185{
186 if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) { 186 if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) {
187 k->ignore(); 187 k->ignore();
188 return; 188 return;
189 } 189 }
190 190
191 int x = cursor.x; 191 int x = cursor.x;
192 int y = cursor.y; 192 int y = cursor.y;
193 193
194 uint key = k->key(); 194 uint key = k->key();
195 195
196 if (scrollRepeat && (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down)) { 196 if (scrollRepeat && (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down)) {
197 k->ignore(); 197 k->ignore();
198 return; 198 return;
199 } 199 }
200 200
201 if (key != Key_Return) { 201 if (key != Key_Return) {
202 if (key == RightKey || key == Key_Right) 202 if (key == RightKey || key == Key_Right)
203 if (++cursor.x > 16) 203 if (++cursor.x > 16)
204 cursor.x = 14; 204 cursor.x = 14;
205 if (key == LeftKey || key == Key_Left) 205 if (key == LeftKey || key == Key_Left)
206 if (--cursor.x < 14) 206 if (--cursor.x < 14)
207 cursor.x = 16; 207 cursor.x = 16;
208 if (key == UpKey || key == Key_Up) 208 if (key == UpKey || key == Key_Up)
209 if (cursor.chr.unicode() < bitfont->lastChar()) 209 if (cursor.chr.unicode() < bitfont->lastChar())
210 cursor.chr = cursor.chr.unicode()+1; 210 cursor.chr = cursor.chr.unicode()+1;
211 else 211 else
212 cursor.chr = bitfont->firstChar(); 212 cursor.chr = bitfont->firstChar();
213 if (key == DownKey || key == Key_Down) 213 if (key == DownKey || key == Key_Down)
@@ -452,131 +452,131 @@ void Score::read()
452 s >> hallOfFame[i].points >> hallOfFame[i].levels >> hallOfFame[i].duration >> 452 s >> hallOfFame[i].points >> hallOfFame[i].levels >> hallOfFame[i].duration >>
453 hallOfFame[i].moment >> name; 453 hallOfFame[i].moment >> name;
454 hallOfFame[i].name = QString::fromLatin1(name); 454 hallOfFame[i].name = QString::fromLatin1(name);
455 delete(name); 455 delete(name);
456 } 456 }
457 highscoreFile.close(); 457 highscoreFile.close();
458 } 458 }
459 } else { 459 } else {
460 for (int i = 0; i < 10; i++) { 460 for (int i = 0; i < 10; i++) {
461 hallOfFame[i].points = 5000; 461 hallOfFame[i].points = 5000;
462 hallOfFame[i].levels = 0; 462 hallOfFame[i].levels = 0;
463 hallOfFame[i].duration = QTime(); 463 hallOfFame[i].duration = QTime();
464 hallOfFame[i].moment = QDateTime(); 464 hallOfFame[i].moment = QDateTime();
465 hallOfFame[i].name = "???"; 465 hallOfFame[i].name = "???";
466 } 466 }
467 // write(); 467 // write();
468 } 468 }
469 469
470 for (int i = 0; i < 10; i++) 470 for (int i = 0; i < 10; i++)
471 for (uint j = 0; j < hallOfFame[i].name.length(); j++) 471 for (uint j = 0; j < hallOfFame[i].name.length(); j++)
472 if (hallOfFame[i].name.at(j) < bitfont->firstChar() || 472 if (hallOfFame[i].name.at(j) < bitfont->firstChar() ||
473 hallOfFame[i].name.at(j) > bitfont->lastChar()) 473 hallOfFame[i].name.at(j) > bitfont->lastChar())
474 hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); 474 hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper();
475 475
476 HighScore = hallOfFame[0].points; 476 HighScore = hallOfFame[0].points;
477} 477}
478 478
479void Score::write() 479void Score::write()
480{ 480{
481#ifndef QWS 481#ifndef QWS
482 if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath()) 482 if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath())
483 KMessageBox::information(0, 483 KMessageBox::information(0,
484 i18n("You're going to create the highscore-file\n" 484 tr("You're going to create the highscore-file\n"
485 "'%1'\n" 485 "'%1'\n"
486 "for your maschine, that should be used systemwide.\n" 486 "for your maschine, that should be used systemwide.\n"
487 "\n" 487 "\n"
488 "To grant access to the other users, set the appropriate rights (a+w)\n" 488 "To grant access to the other users, set the appropriate rights (a+w)\n"
489 "on that file or ask your systemadministator for that favor.\n" 489 "on that file or ask your systemadministator for that favor.\n"
490 "\n" 490 "\n"
491 "To use a different directory or filename for the highscores," 491 "To use a different directory or filename for the highscores,"
492 "specify them in the configfile (kpacmanrc:highscoreFilePath)." 492 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
493 ).arg(systemHighscoreFileInfo.filePath())); 493 ).arg(systemHighscoreFileInfo.filePath()));
494 494
495 if (highscoreFile.name() == privateHighscoreFileInfo.filePath()) 495 if (highscoreFile.name() == privateHighscoreFileInfo.filePath())
496 KMessageBox::information(0, 496 KMessageBox::information(0,
497 i18n("You're using a private highscore-file, that's mostly because of\n" 497 tr("You're using a private highscore-file, that's mostly because of\n"
498 "missing write-access to the systemwide file\n" 498 "missing write-access to the systemwide file\n"
499 "'%1' .\n" 499 "'%1' .\n"
500 "\n" 500 "\n"
501 "Ask your systemadministrator for granting you access to that file,\n" 501 "Ask your systemadministrator for granting you access to that file,\n"
502 "by setting the appropriate rights (a+w) on it.\n" 502 "by setting the appropriate rights (a+w) on it.\n"
503 "\n" 503 "\n"
504 "To use a different directory or filename for the highscores," 504 "To use a different directory or filename for the highscores,"
505 "specify them in the configfile (kpacmanrc:highscoreFilePath)." 505 "specify them in the configfile (kpacmanrc:highscoreFilePath)."
506 ).arg(systemHighscoreFileInfo.filePath()), 506 ).arg(systemHighscoreFileInfo.filePath()),
507 QString::null, "PrivateHighscore"); 507 QString::null, "PrivateHighscore");
508#endif 508#endif
509 if (highscoreFile.open(IO_WriteOnly)) { 509 if (highscoreFile.open(IO_WriteOnly)) {
510 QDataStream s(&highscoreFile); 510 QDataStream s(&highscoreFile);
511 for (int i = 0; i < 10; i++) 511 for (int i = 0; i < 10; i++)
512 s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration << 512 s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration <<
513 hallOfFame[i].moment << hallOfFame[i].name.latin1(); 513 hallOfFame[i].moment << hallOfFame[i].name.latin1();
514 highscoreFile.close(); 514 highscoreFile.close();
515 } 515 }
516} 516}
517 517
518void Score::setPause(bool Paused) 518void Score::setPause(bool Paused)
519{ 519{
520 paused = Paused; 520 paused = Paused;
521 521
522 QRect r = bitfont->rect(i18n("PAUSED")); 522 QRect r = bitfont->rect(tr("PAUSED"));
523 r.moveCenter(QPoint(this->width()/2, this->height()/2)); 523 r.moveCenter(QPoint(this->width()/2, this->height()/2));
524 repaint(r, TRUE); 524 repaint(r, TRUE);
525 525
526 // repaint 1UP or 2UP 526 // repaint 1UP or 2UP
527 repaint(FALSE); 527 repaint(FALSE);
528} 528}
529 529
530void Score::end() 530void Score::end()
531{ 531{
532 if (paused) { 532 if (paused) {
533 QTimer::singleShot(afterPauseMS, this, SLOT(end())); 533 QTimer::singleShot(afterPauseMS, this, SLOT(end()));
534 return; 534 return;
535 } 535 }
536 536
537 // repaint 1UP or 2UP 537 // repaint 1UP or 2UP
538 lastPlayer = -1; 538 lastPlayer = -1;
539 repaint(FALSE); 539 repaint(FALSE);
540 540
541 emit forcedHallOfFame(FALSE); 541 emit forcedHallOfFame(FALSE);
542} 542}
543 543
544/* 544/*
545 * Return the date in a formatted QString. The format can be changed using internationalization 545 * Return the date in a formatted QString. The format can be changed using internationalization
546 * of the string "YY/MM/DD". Invalid QDate's where returned as "00/00/00". 546 * of the string "YY/MM/DD". Invalid QDate's where returned as "00/00/00".
547 */ 547 */
548QString Score::formatDate(QDate date) 548QString Score::formatDate(QDate date)
549{ 549{
550 QString s = i18n("@YY@/@MM@/@DD@"); 550 QString s = tr("@YY@/@MM@/@DD@");
551 551
552 QString dd; 552 QString dd;
553 dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0); 553 dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0);
554 s.replace(QRegExp("@YY@"), dd); 554 s.replace(QRegExp("@YY@"), dd);
555 dd.sprintf("%02d", date.isValid() ? date.month() : 0); 555 dd.sprintf("%02d", date.isValid() ? date.month() : 0);
556 s.replace(QRegExp("@MM@"), dd); 556 s.replace(QRegExp("@MM@"), dd);
557 dd.sprintf("%02d", date.isValid() ? date.day() : 0); 557 dd.sprintf("%02d", date.isValid() ? date.day() : 0);
558 s.replace(QRegExp("@DD@"), dd); 558 s.replace(QRegExp("@DD@"), dd);
559 559
560 return s; 560 return s;
561} 561}
562 562
563QRect Score::rect(int col, float row, QString str, int align) 563QRect Score::rect(int col, float row, QString str, int align)
564{ 564{
565 QRect r = bitfont->rect(str); 565 QRect r = bitfont->rect(str);
566 r.moveBy(x(col), y(row)); 566 r.moveBy(x(col), y(row));
567 567
568 int dx = 0; 568 int dx = 0;
569 int dy = 0; 569 int dy = 0;
570 570
571 if (align & AlignLeft || align & AlignRight) { 571 if (align & AlignLeft || align & AlignRight) {
572 dx = (str.length()-1) * (bitfont->width()/2); 572 dx = (str.length()-1) * (bitfont->width()/2);
573 if (align & AlignRight) 573 if (align & AlignRight)
574 dx *= -1; 574 dx *= -1;
575 } 575 }
576 576
577 if (align & AlignTop || align & AlignBottom) { 577 if (align & AlignTop || align & AlignBottom) {
578 dy = bitfont->height()/2; 578 dy = bitfont->height()/2;
579 if (align & AlignBottom) 579 if (align & AlignBottom)
580 dy *= -1; 580 dy *= -1;
581 } 581 }
582 582
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp
index 00d1f22..3453d37 100644
--- a/noncore/games/kpacman/status.cpp
+++ b/noncore/games/kpacman/status.cpp
@@ -19,69 +19,69 @@
19#include <qmsgbox.h> 19#include <qmsgbox.h>
20#include <qfileinfo.h> 20#include <qfileinfo.h>
21 21
22Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : 22Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
23 QWidget( parent, name ) 23 QWidget( parent, name )
24{ 24{
25 actualLifes = 0; 25 actualLifes = 0;
26 actualLevel = 0; 26 actualLevel = 0;
27 27
28 lifesPix = NULL; 28 lifesPix = NULL;
29 levelPix = NULL; 29 levelPix = NULL;
30 30
31 scheme = Scheme; 31 scheme = Scheme;
32 mode = Mode; 32 mode = Mode;
33 level = 0; 33 level = 0;
34 34
35 confScheme(); 35 confScheme();
36} 36}
37 37
38QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName, 38QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
39 QList<QPixmap> *pixmaps) 39 QList<QPixmap> *pixmaps)
40{ 40{
41 if (pixmaps == NULL) { 41 if (pixmaps == NULL) {
42 pixmaps = new QList<QPixmap>; 42 pixmaps = new QList<QPixmap>;
43 pixmaps->setAutoDelete(TRUE); 43 pixmaps->setAutoDelete(TRUE);
44 } 44 }
45 45
46 if (!pixmaps->isEmpty()) 46 if (!pixmaps->isEmpty())
47 pixmaps->clear(); 47 pixmaps->clear();
48 48
49 QPixmap PIXMAP(pixmapName); 49 QPixmap PIXMAP(pixmapName);
50 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { 50 if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
51 QString msg = i18n("The pixmap could not be contructed.\n\n" 51 QString msg = tr("The pixmap could not be contructed.\n\n"
52 "The file '@PIXMAPNAME@' does not exist,\n" 52 "The file '@PIXMAPNAME@' does not exist,\n"
53 "or is of an unknown format."); 53 "or is of an unknown format.");
54 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName); 54 msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
55 QMessageBox::information(parent, i18n("Initialization Error"), 55 QMessageBox::information(parent, tr("Initialization Error"),
56 (const char *) msg); 56 (const char *) msg);
57 return 0; 57 return 0;
58 } 58 }
59 59
60 int height = PIXMAP.height(); 60 int height = PIXMAP.height();
61 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); 61 int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
62 62
63 QBitmap BITMAP; 63 QBitmap BITMAP;
64 QBitmap MASK; 64 QBitmap MASK;
65 65
66 BITMAP = *PIXMAP.mask(); 66 BITMAP = *PIXMAP.mask();
67 MASK.resize(width, height); 67 MASK.resize(width, height);
68 68
69 for (int x = 0; x < PIXMAP.width()/width; x++) { 69 for (int x = 0; x < PIXMAP.width()/width; x++) {
70 QPixmap *pixmap = new QPixmap(width, height); 70 QPixmap *pixmap = new QPixmap(width, height);
71 pixmaps->append(pixmap); 71 pixmaps->append(pixmap);
72 bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, CopyROP, TRUE); 72 bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, CopyROP, TRUE);
73 bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, CopyROP, TRUE); 73 bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, CopyROP, TRUE);
74 pixmap->setMask(MASK); 74 pixmap->setMask(MASK);
75 } 75 }
76 76
77 return pixmaps; 77 return pixmaps;
78} 78}
79 79
80void Status::paintEvent( QPaintEvent *) 80void Status::paintEvent( QPaintEvent *)
81{ 81{
82 for (int x = 0; x < actualLifes && !lifesPix->isEmpty(); x++) 82 for (int x = 0; x < actualLifes && !lifesPix->isEmpty(); x++)
83 bitBlt(this, lifesPix->at(0)->width()+(lifesPix->at(0)->width()*x), 83 bitBlt(this, lifesPix->at(0)->width()+(lifesPix->at(0)->width()*x),
84 (height()-lifesPix->at(0)->height())/2, 84 (height()-lifesPix->at(0)->height())/2,
85 lifesPix->at(0), 0, 0, 85 lifesPix->at(0), 0, 0,
86 lifesPix->at(0)->width(), lifesPix->at(0)->height()); 86 lifesPix->at(0)->width(), lifesPix->at(0)->height());
87 87