From 37aaa67152936f4fefff22d559c03e943a86ae69 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 5 Sep 2020 01:09:44 +0900 Subject: Renamed kpacman -> tdepacman. Signed-off-by: Michele Calgaro --- CMakeLists.txt | 4 +- ChangeLog | 12 +- INSTALL | 2 +- README | 6 +- config.h.cmake | 2 +- doc/de/CMakeLists.txt | 2 +- doc/de/index.html | 42 +- doc/de/kpacman-1.html | 276 ---- doc/de/kpacman-2.html | 62 - doc/de/kpacman-3.html | 543 -------- doc/de/kpacman-4.html | 58 - doc/de/kpacman.gif | Bin 481 -> 0 bytes doc/de/tdepacman-1.html | 276 ++++ doc/de/tdepacman-2.html | 62 + doc/de/tdepacman-3.html | 543 ++++++++ doc/de/tdepacman-4.html | 58 + doc/de/tdepacman.gif | Bin 0 -> 481 bytes doc/en/CMakeLists.txt | 2 +- doc/en/index.docbook | 38 +- doc/en/index.html | 42 +- doc/en/kpacman-1.html | 274 ---- doc/en/kpacman-2.html | 61 - doc/en/kpacman-3.html | 564 -------- doc/en/kpacman-4.html | 55 - doc/en/kpacman.gif | Bin 481 -> 0 bytes doc/en/tdepacman-1.html | 274 ++++ doc/en/tdepacman-2.html | 61 + doc/en/tdepacman-3.html | 564 ++++++++ doc/en/tdepacman-4.html | 55 + doc/en/tdepacman.gif | Bin 0 -> 481 bytes doc/kpacman-api/Kpacman.html | 54 - doc/kpacman-api/all-globals.html | 34 - doc/kpacman-api/full-list-Kpacman.html | 238 ---- doc/kpacman-api/header-list.html | 35 - doc/kpacman-api/hier.html | 37 - doc/kpacman-api/index-long.html | 38 - doc/kpacman-api/index.html | 34 - doc/kpacman-api/kpacman_h.html | 74 -- doc/man/kpacman.1 | 42 - doc/man/tdepacman.1 | 42 + doc/tdepacman-api/TDEpacman.html | 54 + doc/tdepacman-api/all-globals.html | 34 + doc/tdepacman-api/full-list-TDEpacman.html | 238 ++++ doc/tdepacman-api/header-list.html | 35 + doc/tdepacman-api/hier.html | 37 + doc/tdepacman-api/index-long.html | 38 + doc/tdepacman-api/index.html | 34 + doc/tdepacman-api/tdepacman_h.html | 74 ++ kpacman.kdevprj | 993 -------------- kpacman.kdevses | 80 -- kpacman.lsm | 14 - kpacman/CMakeL10n.txt | 8 - kpacman/CMakeLists.txt | 63 - kpacman/bitfont.cpp | 71 - kpacman/bitfont.h | 30 - kpacman/bitmaps.h | 67 - kpacman/board.cpp | 421 ------ kpacman/board.h | 102 -- kpacman/colors.h | 21 - kpacman/energizer.cpp | 61 - kpacman/energizer.h | 30 - kpacman/fruit.cpp | 176 --- kpacman/fruit.h | 53 - kpacman/hi16-app-kpacman.png | Bin 325 -> 0 bytes kpacman/hi32-app-kpacman.png | Bin 535 -> 0 bytes kpacman/keys.cpp | 192 --- kpacman/keys.h | 44 - kpacman/kpacman.cpp | 476 ------- kpacman/kpacman.desktop | 16 - kpacman/kpacman.h | 185 --- kpacman/kpacmanrc | 70 - kpacman/kpacmanui.rc | 18 - kpacman/kpacmanview.cpp | 163 --- kpacman/kpacmanview.h | 68 - kpacman/lo16-app-kpacman.png | Bin 325 -> 0 bytes kpacman/lo32-app-kpacman.png | Bin 535 -> 0 bytes kpacman/main.cpp | 56 - kpacman/monster.cpp | 262 ---- kpacman/monster.h | 62 - kpacman/pacman.cpp | 147 --- kpacman/pacman.h | 47 - kpacman/painter.cpp | 955 -------------- kpacman/painter.h | 144 -- kpacman/referee.cpp | 1393 -------------------- kpacman/referee.h | 191 --- kpacman/score.cpp | 628 --------- kpacman/score.h | 124 -- kpacman/status.cpp | 353 ----- kpacman/status.h | 74 -- tdepacman/CMakeL10n.txt | 8 + tdepacman/CMakeLists.txt | 63 + tdepacman/bitfont.cpp | 71 + tdepacman/bitfont.h | 30 + tdepacman/bitmaps.h | 67 + tdepacman/board.cpp | 421 ++++++ tdepacman/board.h | 102 ++ tdepacman/colors.h | 21 + tdepacman/energizer.cpp | 61 + tdepacman/energizer.h | 30 + tdepacman/fruit.cpp | 176 +++ tdepacman/fruit.h | 53 + tdepacman/hi16-app-tdepacman.png | Bin 0 -> 325 bytes tdepacman/hi32-app-tdepacman.png | Bin 0 -> 535 bytes tdepacman/keys.cpp | 192 +++ tdepacman/keys.h | 44 + tdepacman/lo16-app-tdepacman.png | Bin 0 -> 325 bytes tdepacman/lo32-app-tdepacman.png | Bin 0 -> 535 bytes tdepacman/main.cpp | 56 + tdepacman/monster.cpp | 262 ++++ tdepacman/monster.h | 62 + tdepacman/pacman.cpp | 147 +++ tdepacman/pacman.h | 47 + tdepacman/painter.cpp | 955 ++++++++++++++ tdepacman/painter.h | 144 ++ tdepacman/referee.cpp | 1393 ++++++++++++++++++++ tdepacman/referee.h | 191 +++ tdepacman/score.cpp | 628 +++++++++ tdepacman/score.h | 124 ++ tdepacman/status.cpp | 353 +++++ tdepacman/status.h | 74 ++ tdepacman/tdepacman.cpp | 476 +++++++ tdepacman/tdepacman.desktop | 16 + tdepacman/tdepacman.h | 185 +++ tdepacman/tdepacmanrc | 70 + tdepacman/tdepacmanui.rc | 18 + tdepacman/tdepacmanview.cpp | 163 +++ tdepacman/tdepacmanview.h | 68 + translations/desktop_files/kpacman.desktop/de.po | 37 - translations/desktop_files/kpacman.desktop/fr.po | 37 - .../kpacman.desktop/kpacman.desktop.pot | 37 - translations/desktop_files/tdepacman.desktop/de.po | 37 + translations/desktop_files/tdepacman.desktop/fr.po | 37 + .../tdepacman.desktop/tdepacman.desktop.pot | 37 + translations/messages/de.po | 64 +- translations/messages/es.po | 66 +- translations/messages/kpacman.pot | 302 ----- translations/messages/pt.po | 60 +- translations/messages/sv.po | 56 +- translations/messages/tdepacman.pot | 302 +++++ 139 files changed, 9862 insertions(+), 10949 deletions(-) delete mode 100644 doc/de/kpacman-1.html delete mode 100644 doc/de/kpacman-2.html delete mode 100644 doc/de/kpacman-3.html delete mode 100644 doc/de/kpacman-4.html delete mode 100644 doc/de/kpacman.gif create mode 100644 doc/de/tdepacman-1.html create mode 100644 doc/de/tdepacman-2.html create mode 100644 doc/de/tdepacman-3.html create mode 100644 doc/de/tdepacman-4.html create mode 100644 doc/de/tdepacman.gif delete mode 100644 doc/en/kpacman-1.html delete mode 100644 doc/en/kpacman-2.html delete mode 100644 doc/en/kpacman-3.html delete mode 100644 doc/en/kpacman-4.html delete mode 100644 doc/en/kpacman.gif create mode 100644 doc/en/tdepacman-1.html create mode 100644 doc/en/tdepacman-2.html create mode 100644 doc/en/tdepacman-3.html create mode 100644 doc/en/tdepacman-4.html create mode 100644 doc/en/tdepacman.gif delete mode 100644 doc/kpacman-api/Kpacman.html delete mode 100644 doc/kpacman-api/all-globals.html delete mode 100644 doc/kpacman-api/full-list-Kpacman.html delete mode 100644 doc/kpacman-api/header-list.html delete mode 100644 doc/kpacman-api/hier.html delete mode 100644 doc/kpacman-api/index-long.html delete mode 100644 doc/kpacman-api/index.html delete mode 100644 doc/kpacman-api/kpacman_h.html delete mode 100644 doc/man/kpacman.1 create mode 100644 doc/man/tdepacman.1 create mode 100644 doc/tdepacman-api/TDEpacman.html create mode 100644 doc/tdepacman-api/all-globals.html create mode 100644 doc/tdepacman-api/full-list-TDEpacman.html create mode 100644 doc/tdepacman-api/header-list.html create mode 100644 doc/tdepacman-api/hier.html create mode 100644 doc/tdepacman-api/index-long.html create mode 100644 doc/tdepacman-api/index.html create mode 100644 doc/tdepacman-api/tdepacman_h.html delete mode 100644 kpacman.kdevprj delete mode 100644 kpacman.kdevses delete mode 100644 kpacman.lsm delete mode 100644 kpacman/CMakeL10n.txt delete mode 100644 kpacman/CMakeLists.txt delete mode 100644 kpacman/bitfont.cpp delete mode 100644 kpacman/bitfont.h delete mode 100644 kpacman/bitmaps.h delete mode 100644 kpacman/board.cpp delete mode 100644 kpacman/board.h delete mode 100644 kpacman/colors.h delete mode 100644 kpacman/energizer.cpp delete mode 100644 kpacman/energizer.h delete mode 100644 kpacman/fruit.cpp delete mode 100644 kpacman/fruit.h delete mode 100644 kpacman/hi16-app-kpacman.png delete mode 100644 kpacman/hi32-app-kpacman.png delete mode 100644 kpacman/keys.cpp delete mode 100644 kpacman/keys.h delete mode 100644 kpacman/kpacman.cpp delete mode 100644 kpacman/kpacman.desktop delete mode 100644 kpacman/kpacman.h delete mode 100644 kpacman/kpacmanrc delete mode 100644 kpacman/kpacmanui.rc delete mode 100644 kpacman/kpacmanview.cpp delete mode 100644 kpacman/kpacmanview.h delete mode 100644 kpacman/lo16-app-kpacman.png delete mode 100644 kpacman/lo32-app-kpacman.png delete mode 100644 kpacman/main.cpp delete mode 100644 kpacman/monster.cpp delete mode 100644 kpacman/monster.h delete mode 100644 kpacman/pacman.cpp delete mode 100644 kpacman/pacman.h delete mode 100644 kpacman/painter.cpp delete mode 100644 kpacman/painter.h delete mode 100644 kpacman/referee.cpp delete mode 100644 kpacman/referee.h delete mode 100644 kpacman/score.cpp delete mode 100644 kpacman/score.h delete mode 100644 kpacman/status.cpp delete mode 100644 kpacman/status.h create mode 100644 tdepacman/CMakeL10n.txt create mode 100644 tdepacman/CMakeLists.txt create mode 100644 tdepacman/bitfont.cpp create mode 100644 tdepacman/bitfont.h create mode 100644 tdepacman/bitmaps.h create mode 100644 tdepacman/board.cpp create mode 100644 tdepacman/board.h create mode 100644 tdepacman/colors.h create mode 100644 tdepacman/energizer.cpp create mode 100644 tdepacman/energizer.h create mode 100644 tdepacman/fruit.cpp create mode 100644 tdepacman/fruit.h create mode 100644 tdepacman/hi16-app-tdepacman.png create mode 100644 tdepacman/hi32-app-tdepacman.png create mode 100644 tdepacman/keys.cpp create mode 100644 tdepacman/keys.h create mode 100644 tdepacman/lo16-app-tdepacman.png create mode 100644 tdepacman/lo32-app-tdepacman.png create mode 100644 tdepacman/main.cpp create mode 100644 tdepacman/monster.cpp create mode 100644 tdepacman/monster.h create mode 100644 tdepacman/pacman.cpp create mode 100644 tdepacman/pacman.h create mode 100644 tdepacman/painter.cpp create mode 100644 tdepacman/painter.h create mode 100644 tdepacman/referee.cpp create mode 100644 tdepacman/referee.h create mode 100644 tdepacman/score.cpp create mode 100644 tdepacman/score.h create mode 100644 tdepacman/status.cpp create mode 100644 tdepacman/status.h create mode 100644 tdepacman/tdepacman.cpp create mode 100644 tdepacman/tdepacman.desktop create mode 100644 tdepacman/tdepacman.h create mode 100644 tdepacman/tdepacmanrc create mode 100644 tdepacman/tdepacmanui.rc create mode 100644 tdepacman/tdepacmanview.cpp create mode 100644 tdepacman/tdepacmanview.h delete mode 100644 translations/desktop_files/kpacman.desktop/de.po delete mode 100644 translations/desktop_files/kpacman.desktop/fr.po delete mode 100644 translations/desktop_files/kpacman.desktop/kpacman.desktop.pot create mode 100644 translations/desktop_files/tdepacman.desktop/de.po create mode 100644 translations/desktop_files/tdepacman.desktop/fr.po create mode 100644 translations/desktop_files/tdepacman.desktop/tdepacman.desktop.pot delete mode 100644 translations/messages/kpacman.pot create mode 100644 translations/messages/tdepacman.pot diff --git a/CMakeLists.txt b/CMakeLists.txt index afd371c..80b6d5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_minimum_required( VERSION 2.8 ) #### general package setup -project( kpacman ) +project( tdepacman ) set( VERSION R14.1.0 ) @@ -71,7 +71,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" add_subdirectory( maps ) add_subdirectory( pics ) add_subdirectory( fonts ) -add_subdirectory( kpacman ) +add_subdirectory( tdepacman ) tde_conditional_add_subdirectory( BUILD_DOC doc ) tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations ) diff --git a/ChangeLog b/ChangeLog index ad1a560..58d9e71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ Version 0.3.2 (30. June 2003) - Almost a real KDE3 application. + Almost a real TDE3 application. Version 0.3.1 (31. January 2002) - Prerelease for KDE2 (Documentation not fully adjusted). + Prerelease for TDE2 (Documentation not fully adjusted). The "highscore"-file is no longer been created by the installation, but as soon as the hall of fame has been entered. The path (directory/filename) could be specified in the configfile. If the systemwide "highscore"-file is not @@ -24,7 +24,7 @@ Version 0.3.0 (June 2000, not released) The mousecursor could be hidden/shown while over the playground, thru the menubar. The boardlayout (map) could be placed in external textfiles and selected thru - the configfile (kpacmanrc) if needed. + the configfile (tdepacmanrc) if needed. Duplicate pixmaps removed. Because all pixmapfiles could be specified thru the configfile now, pixmaps could be placed in foreign (scheme)-directories (EyesPixmapName=../tiny/eyes.xpm), or have different names (e.g.: @@ -86,9 +86,9 @@ Version 0.2.4 (January 26th, 1999 - today linux v2.2 was released) Version 0.2.3a (January 15th, 1999) - Keyboard-routines changed to be compatible with the KDE 1.1 libraries + Keyboard-routines changed to be compatible with the TDE 1.1 libraries (compiles with 1.0 and 1.1). - A small bug fixed in kpacman.cpp (CHECK_PTR( menuBar )). + A small bug fixed in tdepacman.cpp (CHECK_PTR( menuBar )). Version 0.2.3 (September 12th, 1998) @@ -98,7 +98,7 @@ Version 0.2.3 (September 12th, 1998) Added a new font "font-smooth" and smoothed the pixmap "wall.xpm" for the Zacman-scheme. Enhanced configuration of all timing-parameters using the configuration file. - Changed Help-function (kapp->getHelpMenu) to reflect the KDE-Standard. + Changed Help-function (kapp->getHelpMenu) to reflect the TDE-Standard. Improved the documentation (Many thanks to Andreas Pour). Version 0.2.2 (August 24th, 1998) diff --git a/INSTALL b/INSTALL index fa66f55..b16b514 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ Basic Installation ================== -kpacman relies on cmake to build. +tdepacman relies on cmake to build. Here are suggested default options: diff --git a/README b/README index caa4ce8..c8f3677 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ - kpacman - A pacman clone game for TDE. + tdepacman - A pacman clone game for TDE. -Kpacman is a classic arcade game. +TDEpacman is a classic arcade game. Pac-Man was designed by Toru Iwatani, Namco first released the game in Japan in May 1980. @@ -11,7 +11,7 @@ Japan in May 1980. CONTRIBUTING ============== -If you wish to contribute to Kpacman (TDE), you might do so: +If you wish to contribute to TDEpacman (TDE), you might do so: - TDE Gitea Workspace (TGW) collaboration tool. https://mirror.git.trinitydesktop.org/gitea diff --git a/config.h.cmake b/config.h.cmake index 61ede3a..4064b66 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,7 +1,7 @@ #define VERSION "@VERSION@" // Defined if you have fvisibility and fvisibility-inlines-hidden support. -#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 +#cmakedefine __TDE_HAVE_GCC_VISIBILITY 1 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/doc/de/CMakeLists.txt b/doc/de/CMakeLists.txt index beff083..0e17c6c 100644 --- a/doc/de/CMakeLists.txt +++ b/doc/de/CMakeLists.txt @@ -1,6 +1,6 @@ file( GLOB _files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.html ) install( - FILES ${_files} kpacman.gif + FILES ${_files} tdepacman.gif DESTINATION ${HTML_INSTALL_DIR}/de/${PROJECT_NAME} ) diff --git a/doc/de/index.html b/doc/de/index.html index be6da62..b939955 100644 --- a/doc/de/index.html +++ b/doc/de/index.html @@ -3,17 +3,17 @@ - - - Das KPacman Handbuch + + + Das TDEPacman Handbuch   - + -
KPacmanTDEPacmanKPacman +TDEPacman
Version 0.3.2
@@ -22,59 +22,59 @@ diff --git a/doc/de/kpacman-1.html b/doc/de/kpacman-1.html deleted file mode 100644 index 59407bd..0000000 --- a/doc/de/kpacman-1.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - Das KPacman Handbuch: Einführung - - -  -
-
Weiter Zurück Inhaltverzeichnis
+
Weiter Zurück Inhaltverzeichnis

-Das KPacman-Handbuch

+Das TDEPacman-Handbuch Jörg Thönnissen, <joe@dsite.de>
Version 0.3.2, 30. Juni 2003

-


Dieses Handbuch beschreibt die KPacman-Version 0.3.2  +
Dieses Handbuch beschreibt die TDEPacman-Version 0.3.2 

-1. Einführung

+1. Einführung

-2. Installation

+2. Installation

-3. Konfiguration

+3. Konfiguration

-4. Copyright

+4. Copyright -
Weiter Zurück Inhaltsverzeichnis
+
Weiter Zurück Inhaltsverzeichnis

- - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - - - - - -
- - -

-1. Einführung

- -

-1.1 Änderungen 

- -

-Version 0.3.2 (30. Juni 2003)

- -
    -
  • Ein beinahe vollwertige KDE3 Anwendung.
  • -
- -

-Version 0.3.1 (31. Januar 2002)

- -
    -
  • Vorabversion für KDE2 (Dokumentation nicht vollständig angepasst).
  • - -
  • Die "highscore"-Datei wird nicht mehr bei Installation anlegt, sondern erst bei -Erreichen eines Eintrages in der Ruhmeshalle. -Der Pfad (Verzeichnis/Dateiname) kann über die Konfigurationsdatei -angegeben werden. -Ist die systemweite "highscore"-Datei nicht schreibbar, wird eine private Datei im -Heimatsverzeichnis des Benutzers angelegt und benutzt und es erscheint ein entsprechender -Hinweis.
  • -
- -

-Version 0.3.0 (Juni 2000, nicht freigegeben)

- -
    -
  • Ms.Pacman Modus eingebaut (gewaltige Änderung) !
  • - -
  • Automatische Pause/Fortsetzung im Hinter/Vordergrund, für Kevin Forge -(er hatte auch die Ms.Pacman Idee) eingebaut. Diese Optionen sind über -Menuepunkte anwählbar.
  • - -
  • Portugesische Übersetzung von Sérgio Fernandes.
  • - -
  • Animation der Energizer und Blinken des aktiven Spielers ("1UP") hinzugefügt.
  • - -
  • Das Flackern im Editiermodus der Ruhmeshalle bei Fokuswechsel -beseitigt (FocusEvents).
  • - -
  • Der Mauszeiger im Spielfeld, kann über einen Menupunkt aus- bzw. -eingeblendet werden.
  • - -
  • Die Spielfläche (Map) kann in einer externen Textdatei hinterlegt -werden, und bei Bedarf über die Konfigdatei angewählt werden.
  • - -
  • Doppelte Pixmaps entfernt. Da jetzt alle Pixmapdateien über -die Konfigdatei definiert werden können, können die Pixmaps auch in -anderen (Schemen)-Verzeichnissen liegen (EyesPixmapName=../tiny/eyes.xpm), -oder einen anderen Namen haben (z.B.: LevelPixmapName=fruit.xpm).
  • - -
  • Nach dem Fressen des letzten Punktes, erfolgt die Anzeige des ersten -Pixmaps der letzten/momentanen Richtung. Bisher wurde dann immer die erste -Pixmap der Bewegung nach Norden/Oben angezeigt.
  • -
- -

-Version 0.2.6 (11. Dezember 1999)

- -
    -
  • -Schwedische Übersetzung einiger Texte (leider unvollständig) -von Johne.
  • - -
  • -Durch die Verwendung von Sonderzeichen in der Schweden-Version, musste -die gesamte Zeichensatzbehandlung überarbeitet werden.
  • - -
  • -Die Fonts enhalten jetzt einen (fast) kompletten ISO-Latin1 Zeichensatz -(keine Kleinbuchstaben).
  • - -
  • -Ausrichtungsfunktionalität bei den Textausgabefunktionen eingebaut.
  • - -
  • -Er wird nicht mehr mit xbm-, sondern mit pbm-Dateien als Zeichensatzdateien -gearbeitet (die benötigen sogar weniger Platz, obwohl vielmehr Zeichen -in ihnen enthalten sind).
  • - -
  • -Alle Textelemente in die Lokalisierung (i18n) aufgenommen. Wär's mag -- kann jetzt auch Meldungen wie "GAME OVER" oder "READY!" in seine Landessprache -übersetzen. (Ein auskommentierer Versuch befindet sich in "/po/de/kpacman.po".)
  • - -
  • -Dokumentation und Programm wieder einmal auf eine neue email-Adresse umgestellt.
  • -
- -

-Version 0.2.5 (20. Juni 1999)

- -
    -
  • -Die Anzeige (Anwahl) der Ruhmeshalle geändert, um so hoffentlich einige -selten auftretene Fehler zu beheben. Umschaltung der Anzeige durch lower/raise -anstelle der bislang genutzen hide/show-Funktionen. 
  • - -
  • -Bei der Installation, wird die Datei zur Speicherung der HighScores auf -worldwritable (chmod 666) gesetzt. Dadurch können auch "normale" Benutzer -ihre Höchstleistungen dauerhaft speichern.
  • - -
  • -Die Levels auf 13 erweitert (LevelPixmaps, Score) durch die höheren -Punktzahlen mußten auch die Fonts (zur Darstellung der erzielten -Punkte) erweitert werden. In diesem Zuge wurde die Anzeige der Punkte variabel -gestalten (im Rahmen von 10 bis 9000, wobei nur die führende Ziffer -nicht 0 sein darf. Ausnahme 1600). Da für die Anzeige der hohen Punktzahlen -mehr Platz benötigt wird als für die eigentliche Spielfigur, -mußte auch das gewährleistet werden.
  • - -
  • -Da in der Statusanzeige eigentlich kein Platz für 13 Levels ist, kann -die Anzeigeposition des Levelsymbols wahlfrei durch LevelPosition -angegeben werden. Jetzt wird auch das letzte Symbol anzeigt.
  • - -
  • -Die Standard-Geschwindigkeit der Monster bleibt, auf Wunsch von Gerald -Williams auch in den höheren Spielstufen konstant.
  • - -
  • -Routinen zur Bildschirmaktualisieren optimiert.
  • - -
  • -Dokumentation und Programm auf neue email-Adresse umgestellt.
  • -
- -

-Version 0.2.4 (26. Januar 1999 - heute wurde linux v2.2 freigegeben)

- -
    -
  • -Speicherung der "Höchsten Punktzahlen" in der Ruhmeshalle eingebaut. -Zu diesem Zweck wurde die Struktur der Bitfont-Zeichensätze um zusätzliche -Zeichen erweitert, die Sonderzeichen (kleine Punktzahlen während des -Spieles) in den Steuerungszeichenbereich verlagert und die Behandlung dieser -verbessert (FontFirstChar und FontLastChar über Konfigdatei).
  • - -
  • -Die Größe der Labels im Steuerungstasten-Dialog wird manuell -gesetzt, da die autoResize-Funktionen der qt-Libraries nicht in allen Version -sauber arbeiten.
  • - -
  • -Die Menüanzeige wird besser auf die aktuell verfügbaren Funktionen -angepaßt (disabled/enabled und checked).
  • - -
  • -Standardmäßig wird jetzt auch im "MIDWAY (groß)"-Schema -die glättere font-smooth.xbm Schrift verwendet.
  • - -
  • -Dateien zur Internationalisierung an neue Verzeichnisstruktur angepaßt.
  • -
- -

-Version 0.2.3a (15. Januar 1999)

- -
    -
  • -Anpassungen der Tastaturroutinen an die KDE 1.1 Bibliotheken (kompiliert -mit 1.0 und 1.1).
  • - -
  • -Winziges Bugfix in kpacman.cpp (CHECK_PTR( menuBar )).
  • -
- -

-Version 0.2.3 (12. September 1998)

- -
    -
  • -Bewegungen der Monster im Gefängnis verlangsamt, dabei Fehler nach -der "harmlos"-Phase der Monster (sie blieben langsam) korrigiert.
  • - -
  • -Neue Font "font-smooth" und Pixmap "wall.xpm" für Zacman-Schema geglättet.
  • - -
  • -Alle Zeiten des Programmablaufes können über die Konfigdatei -geändert werden.
  • - -
  • -Hilfefunktion an KDE-Standard angepaßt (kapp->getHelpMenu).
  • -
- -

-Version 0.2.2 (24. August 1998)

- -
    -
  • -Lokalisation des Quellcodes und deutsche Übersetzung hinzugefügt.
  • - -
  • -kde_datadir Fehler in keys.cpp (Tastatusbelegung...) korrigiert, so das -Pixmaps und Bitfonts nach der Benutzung des "Tastaturbelegung..."-Dialogs -korrekt gefunden werden können.
  • - -
  • -Die Lage der Dateien (Quelldateien, Pixmaps, Dokumente usw.) geändert, -um der Beispielstruktur von kapptemplate v0.1 zu entsprechen.
  • -
- -

-Version 0.2.1 (18. August 1998)

- -
    -
  • -Zeitabläufe geändert (noch nicht perfekt), aber ich hoffe Andreas -Pour wird mehr Freude beim Testen der nächsten Versionen haben.
  • - -
  • -Das Handhabung der Pixmaps ist nicht mehr so strikt.
  • -
- -

-Version 0.2.0 (13. August 1998)

- -
    -
  • -(Vorläufige)Unterstützung von Grafikschemen hinzugefügt.
  • -
- -

-Version 0.1.1 (8. August 1998) 

- -
    -
  • -Erste öffentliche Version.
  • -
- - - -
-
-
- - - diff --git a/doc/de/kpacman-2.html b/doc/de/kpacman-2.html deleted file mode 100644 index c051b53..0000000 --- a/doc/de/kpacman-2.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - Das KPacman Handbuch: Installation - - -  - - - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - -
- - -

-2. Installation

- -

-2.1 Wie Sie KPacman bekommen

-Sie finden KPacman auf  ftp://ftp.kde.org/pub/kde/unstable/latest/apps/games -,dem Haupt-FTP-Server des KDE Projekts. -

-2.2 Anforderungen

-Um KPacman erfolgreich compileren zu können, benötigen Sie die -Version 1.0 der KDE Libraries oder spätere und die Version 1.33 der -TQt Libraries oder spätere. Alle benötigten Libraries für -Ihr spefizisches System finden Sie auf  ftp://ftp.kde.org/pub/kde/stable/latest/distribution -und ftp::/ftp.kde.org/pub/qt.  -

-2.3 Übersetzung und Installation

-Sofern Sie KPacman selbst übersetzen und installieren wollen, erfolgt -dies auf die übliche Weise im Verzeichnis der KPacman Quelldateien:  -
-
% ./configure && make && make install
-
-KPacman benutzt autoconf, daher sollten keine Probleme bestehen. -Sofern doch Fehlerhinweise erscheinen, berichten Sie diese bitte an den -Autor Jörg Thönnissen.  -
  - - -
-
-
- - - diff --git a/doc/de/kpacman-3.html b/doc/de/kpacman-3.html deleted file mode 100644 index fb3eafe..0000000 --- a/doc/de/kpacman-3.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - - Das KPacman Handbuch: Konfiguration - - -  - - - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - -
- - -

-3. Konfiguration

-Bis alle (sinnvollen) Parameter über Dialoge eingestellt werden können, -müssen bei Bedarf die entsprechenden Parameter in der Konfigdatei -~/.kde/share/config/kpacmanrc -angepaßt oder hinzugefügt werden. Wenn Sie Änderungen für -alle Benutzer vornehmen möchten, müssen Sie die globale Konfigdatei -/opt/kde/share/config/kpacmanrc -benutzen.  -

-3.1 Spielabläufe (Zeitsteuerung)

-Die Parameter unter der Standardgruppe [KDE Setup] in die der -nachfolgenden Tabelle aufgeführt sind, steuern die Zeitabläufe -des Spiels. Bei Schlüssel die mit "MS" enden (z.B. DyingAnimationMS), -werden die Werte in Millisekunden angegeben. Enden die Schlüssel mit -"Ticks" werden die Werte in Spielschritten angegeben.  -

Einige der unten aufgeführten Werte sind Listen von Zahlen . Die -einzelnen Werte der Liste werden durch Kommas getrennt. Wenn in den Standardwerten -mehrere Zahlen stehen oder der Zahl ein Komma folgt, entspricht dieser -Wert einer Liste. Diese Listen werden für unterschiedliche Spielstufen -(Level) benutzt. Dabei steht der erste Wert dieser Liste für die Demonstration, -die folgenden Werte für die wirklichen Spielstufen (also der zweite -Wert gilt für Stufe 1, der dritte für Stufe 2 usw.).  -
Die größte Spielstufe wird durch den Wert des Schlüssel -"Levels" festgelegt.  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SchlüsselBeschreibungStandardwert
SpeedMSLänge der Spielschritte (Ticks) in Millisekunden. Definiert die -kleinste Zeiteinheit. Verkleinerung des Wertes beschleunigt das Spiel und -Vergrößerung des Wertes verlangsamt den Spielablauf.20,
PacmanTicksAnzahl der Ticks (siehe speed) bis zur nächsten Bewegung des Pacmans. -Vergrößerung des Wertes macht die Bewegungen des Pacman langsamer -und Verkleinerung des Wertes machen den Pacman schneller.3,
RemTicksAnzahl der Spielschritte während der R.E.M. (Rapid Eye Movement)-Phase. -Das ist die Phase, wenn ein Monster gefressen wurde und zurück ins -Gefängnis muß. Erhöhung des Wertes erhöht die Zeit -bis ein gefressenes Monster im Gefängnis ist, und Verkleinerung des -Wertes verkürzt diese Zeit.1,
DangerousTicksSpielschritte in der Phase, in der die Monster gefährlich sind. -Eine Vergrößerung des Wertes, läßt die Monster sich -langsamer bewegen und eine Verkleinerung des Wertes, läßt die -Monster sich schneller bewegen.3,
HarmlessTicksAnzahl der Zeiteinheiten zwischen den Monsterbewegungen in der Phase, -in der die Monster gefressen werden können.7,6,,5,,4,
HarmlessDurationTicksLänge der Zeit, in der die Monster gefressen werden können -(in Spielschritten, siehe Speed).375,,,300,,250,200,150,
HarmlessWarningTicksAnzahl der Zeiteinheiten vor dem Ende der Harmlos-Phase. In dieser -Zeit wird durch Blinken der Monster das bevorstehende Ende dieser Phase -angezeigt.135,
ArrestTicksZeitabstände der Monsterbewegungen während der Zeit im Gefängnis.6,
ArrestDurationTicksLänge des Gefängnisaufenthalts. Diese Zeitspanne wird mit -der Monster-ID (0 = Erstes, 1 = Zweites, ...) multipliziert. Aus diesem -Grund wird das erste Monster direkt freigelassen. (Ausnahmeweise wird auch -Monster #2 beim ersten Start sofort entlassen.)200,,,150,
FruitAppearsTicksZeitspanne zwischen dem Erscheinen der Früchte (in Spieleinheiten).1000,,1500,2000,2500,  -
3000,3500,4000,
FruitDurationTicksDauer der Erscheinung in Spielschritten.500,,,400,350,300,,250,  -
200,150,
FruitScoreDurationTicksLänge der Zeitspanne, in der beim Essen einer Frucht, die Höhe -der Punkte (für den Verzehr der Frucht) angezeigt wird.150,
MonsterScoreDurationMSZeitdauer der Punktanzeige, wenn ein Monster gefressen wird (in Millisekunden).1000
PlayerDurationMSZeitdauer der "PLAYER ONE" -Einblendung (in ms). Momentan wird nur -ein Spieler unterstützt3000
ReadyDurationMSLänge der "READY!"-Anzeige.2000
GameOverDurationMSLänge der "GAME OVER"-Anzeige, bevor wieder die Vorstellung der -Spielfiguren aufgerufen wird. 3000
AfterPauseMSDiese Zeit wird nach einer PAUSE gewartet, bis die unterbrochene Funktion -fortgesetzt wird.1000
DyingPreAnimationMSDieser Wert steuert die Länge des Freundentanz der Monster, wenn -sie den Pacman erwischt haben.1000
DyingAnimationMSAbstände zwischen den einzelnen Grafiken, die den Tod des Pacman's -darstellen.100
DyingPostAnimationMSDie Länge der Zeit, in der die erste und letzte Teilgrafik der -Sterbesequenz angezeigt wird, um diese hervorzuheben.500
IntroAnimationMSZeiträume zwischen den einzelnen Schritten der Vorstellung.800
IntroPostAnimationMSMillisekunden zwischen der Vorstellung und dem Beginn der Demonstration.1000
LevelUpPreAnimationMSZeit zwischen dem Erreichen des Spielzieles (Fressen aller Punkte) -und der Spielstufenwechsel-Animation.2000
LevelUpAnimationMSZeit der primitiven Spielstufenwechsel-  -
Animation (in Millisekunden).
2000
MonsterIQIQ der Monster, dieser spiegelt sich in der Bewegung der Monster wieder. -Momentan wird dieser noch nicht besonders gut ausgewertet.0,170,180,170,180,  -
170,180,
LevelsAnzahl der unterschiedlichen Spielstufen (ohne die Demonstration).13
HallOfFameMSDie Zeit wie lange die Ruhmeshalle angezeigt wird (in ms).7000
CursorBlinkMSDer Cursor zur Eingabe des Namens in die HighScore-Liste wechselt in -dieser Zeit zwischen seinen Zuständen (an und aus). Hierdurch wird -auch die Tastenwiederholung der Blätterfunktion (Pfeil hoch und Pfeil -runter) gesteuert.250
- -

Sind weniger Werte in der Zahlenliste als Werte für die Spielstufen+Demo -notwendig sind, oder sind ungültige Zahlenwerte oder fehlende Werte -(,,) in dieser Liste, wird der vorherige (gültige) Wert (bzw. 0 falls -noch kein Wert angegeben wurde) an diese Stelle eingefügt.  -
Zum Beispiel wird (bei Levels=7) aus HarmlessTicks=7,6,,5,,4 - HarmlessTicks=7,6,6,5,5,4,4,4 -(7 Ticks für Demonstration, 6 Ticks für Level #1 usw.).  -

-3.2 Punkte

-Die Punktevergabe während des Spiels wird durch folgende Schlüssel/Werte-Paare -in der Standardgruppe [KDE Setup] gesteuert (siehe Abschnitt Zeitsteuerung -für Informationen über die Interpretation der Zahlenlisten):  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SchlüsselBeschreibungStandard
PointScoreAnzahl Punkte die für das Fressen der kleinen Punkte gegeben werden.10
SwitchScorePunkte für das Fressen der größeren Punkte (diese Punkte -lassen die Monster von den Jägern zu den Gejadgen werden).50
FruitScoreBeim Fressen der Früchte wird diese Anzahl der Punkte vergeben. -Abhängig vom Level und damit von der Art der Frucht wird der Wert -aus der Liste benutzt.100,300,500,,700,, -
1000,,2000,,3000,5000,
MonsterScoreHöhe der Punktanzahl für das Fressen der Monster. Innerhalb -der Zeit nach Fressen eines Schalters ist die Anzahl der gefressenen Monster -entscheidend für die Höhe der Punkte. Aus diesem Grund wird hier -auch eine Werteliste angegeben, die der Anzahl gefressener Monster entspricht. -In unserem Beispiel gibt es für das erste Monster 200 Punkte, für -das zweite 400 Punkte usw.200,400,800,1600
ExtraLifeScoreAnzahl der Punkte, die erreicht werden muß, damit es ein zusätzliches -Leben gibt.10000
- -

-3.3 Grafikschemen

-Die Grafikschemen werden über die folgenden zwei Schlüssel/Werte-Paare -der Standardgruppe [KDE Setup] gesteuert:  -
  - - - - - - - - - - - - - - - - - - - - - - - - -
SchlüsselBeschreibungBeispiel
SchemeCountAnzahl der definierten Schemen. Für jedes Schema existiert eine -einige Gruppe mit dem Namen [Scheme n]. Wobei n durch -eine Zahl von 0 bis SchemeCount-1 steht.3
SchemeAusgewähltes Schema. Mögliche Werte sind 0 bis SchemeCount-1 -(dieser Wert wird auch durch die Schemenauswahl aus dem Menu gesetzt).0
- -

Wie schon oben kurz angesprochen, werden die Grafikschemen in eigenen -Schemen-Gruppen (z.B.: [Scheme 0]) definiert. Momentan werden -nur folgende Schlüssel/Wert-Paare ausgewertet:  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SchlüsselBeschreibungBeispiel
FontDateiname der xbm-Fontdatei. Wird der Name ohne absolute Pfadangabe -(führendes "/" oder "~") spezifiziert, bezieht er sich relativ auf -das Verzeichnis $TDEDIR/share/apps/kpacman/fonts . Der Aufbau -dieser Fontdatei wird in einer der nächsten Versionen beschrieben, -wenn Sie sich die Datei allerdings mit einem Bitmap-Editor ansehen wird -Ihnen aber bestimmt schon alles klar.font.xbm
FontFirstCharDas erste Zeichen im Zeichensatz der Bildschirmschrift wird hier durch -seinen numerischen Wert festgelegt.14
FontLastCharDieser Wert definiert den Zahlenwert des letzen Zeichen in der angegebenen -Schriftart. Wenn die Standardfonts zum Beispiel um Kleinbuchstaben erweitert -werden, wird hier der numerische Wert des letzten Buchstabens definiert.95
PixmapDirectoryVerzeichnis in dem sich die Pixmap-Dateien für die Spielfiguren, -die Punkte, die Wände usw. befinden. Die Namen der einzelnen xpm-Dateien -sind momentan noch fest codiert (wird sich auch noch ändern). Der -Pfad bezieht sich, falls nicht absolut angegeben, auf das Verzeichnis $TDEDIR/share/apps/kpacman/pics. -Wird hier kein Wert angegeben, werden die Pixmaps in diesem Verzeichnis -gesucht.tiny
DescriptionDiese Zeichenkette wird im Menü zur Anwahl des Grafikschemas angezeigt. -Über das '&'-Zeichen wird die Kurztastenanwahl gesteuert (d.h. -das Beispielschema kann durch betätigen der 'T'-Taste angewählt -werden). Über das Anhänger des Sprachkürzels an den Schlüssel -(z.B.: Description[de]) kann der Wert an die entsprechene Landessprache -angepaßt werden.MIDWAY MFG.CO. (&tiny)
- -

-3.4 Sonstiges

- - - - - - - - - - - - - - - - - - - - - - - - - - -
SchlüsselBeschreibungBeispiel
LevelPositionDefiniert die Position der Level (Früchte) innerhalb der Statuszeile. -Hiermit können zum Beispiel mehrere Level an derselben Position angezeigt -werden, um so Platz zu sparen. Die erste mögliche Position (ganz rechts) -wird durch den Wert 0 dargestellt.0,1,2,3,,4,,5,,6,,7,
HighscoreFilePathLegt den Pfad (Verzeichnis und Dateiname) zur "highscore"-Datei fest. -Wird nur ein Verzeichnis (".../") angegeben, wird der Standard-Dateiname -("highscore") verwendet./tmp/kpacman.highscore
- -
  - - -
-
-
- - - diff --git a/doc/de/kpacman-4.html b/doc/de/kpacman-4.html deleted file mode 100644 index 3353786..0000000 --- a/doc/de/kpacman-4.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Das KPacman Handbuch: Copyright - - -  - - - - - - -
KPacman KPacman  -
Version 0.3.2
- -
- - - - - - - - -
- - -

-4. Copyright

-KPacman Copyright © 1998-2003 Jörg Thönnissen, <joe@dsite.de>  - -

Dieses Programm (inklusive dieser Dokumentation) ist freie Software. -Sie können es verbreiten und/oder verändern unter den Bedingungen -der GNU General Public License, wie sie von der Free Software Foundation -veröffenticht wurde, entweder Version 2 der Lizenz oder (wie Sie möchten) -einer neueren Version.  - -

Dieses Programm wird in der Hoffnung verbreitet, es sei nützlich, -aber ohne jegliche Garantie, auch ohne die stillschweigende Garantie -der Funktionsfähigkeit oder Eignung für einen bestimmten -Zweck. Sehen Sie in der GNU General Public License für Detail -nach.  - -

Sie sollten eine Kopie der GNU General Public License mit diesem Programm -erhalten haben, falls nicht, schreiben Sie an die Free Software Foundation, -Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  -
  -

- -
-
-
-  - - diff --git a/doc/de/kpacman.gif b/doc/de/kpacman.gif deleted file mode 100644 index 4fa3926..0000000 Binary files a/doc/de/kpacman.gif and /dev/null differ diff --git a/doc/de/tdepacman-1.html b/doc/de/tdepacman-1.html new file mode 100644 index 0000000..c362d88 --- /dev/null +++ b/doc/de/tdepacman-1.html @@ -0,0 +1,276 @@ + + + + + + + Das TDEPacman Handbuch: Einführung + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + + + + + +
+ + +

+1. Einführung

+ +

+1.1 Änderungen 

+ +

+Version 0.3.2 (30. Juni 2003)

+ +
    +
  • Ein beinahe vollwertige TDE3 Anwendung.
  • +
+ +

+Version 0.3.1 (31. Januar 2002)

+ +
    +
  • Vorabversion für TDE2 (Dokumentation nicht vollständig angepasst).
  • + +
  • Die "highscore"-Datei wird nicht mehr bei Installation anlegt, sondern erst bei +Erreichen eines Eintrages in der Ruhmeshalle. +Der Pfad (Verzeichnis/Dateiname) kann über die Konfigurationsdatei +angegeben werden. +Ist die systemweite "highscore"-Datei nicht schreibbar, wird eine private Datei im +Heimatsverzeichnis des Benutzers angelegt und benutzt und es erscheint ein entsprechender +Hinweis.
  • +
+ +

+Version 0.3.0 (Juni 2000, nicht freigegeben)

+ +
    +
  • Ms.Pacman Modus eingebaut (gewaltige Änderung) !
  • + +
  • Automatische Pause/Fortsetzung im Hinter/Vordergrund, für Kevin Forge +(er hatte auch die Ms.Pacman Idee) eingebaut. Diese Optionen sind über +Menuepunkte anwählbar.
  • + +
  • Portugesische Übersetzung von Sérgio Fernandes.
  • + +
  • Animation der Energizer und Blinken des aktiven Spielers ("1UP") hinzugefügt.
  • + +
  • Das Flackern im Editiermodus der Ruhmeshalle bei Fokuswechsel +beseitigt (FocusEvents).
  • + +
  • Der Mauszeiger im Spielfeld, kann über einen Menupunkt aus- bzw. +eingeblendet werden.
  • + +
  • Die Spielfläche (Map) kann in einer externen Textdatei hinterlegt +werden, und bei Bedarf über die Konfigdatei angewählt werden.
  • + +
  • Doppelte Pixmaps entfernt. Da jetzt alle Pixmapdateien über +die Konfigdatei definiert werden können, können die Pixmaps auch in +anderen (Schemen)-Verzeichnissen liegen (EyesPixmapName=../tiny/eyes.xpm), +oder einen anderen Namen haben (z.B.: LevelPixmapName=fruit.xpm).
  • + +
  • Nach dem Fressen des letzten Punktes, erfolgt die Anzeige des ersten +Pixmaps der letzten/momentanen Richtung. Bisher wurde dann immer die erste +Pixmap der Bewegung nach Norden/Oben angezeigt.
  • +
+ +

+Version 0.2.6 (11. Dezember 1999)

+ +
    +
  • +Schwedische Übersetzung einiger Texte (leider unvollständig) +von Johne.
  • + +
  • +Durch die Verwendung von Sonderzeichen in der Schweden-Version, musste +die gesamte Zeichensatzbehandlung überarbeitet werden.
  • + +
  • +Die Fonts enhalten jetzt einen (fast) kompletten ISO-Latin1 Zeichensatz +(keine Kleinbuchstaben).
  • + +
  • +Ausrichtungsfunktionalität bei den Textausgabefunktionen eingebaut.
  • + +
  • +Er wird nicht mehr mit xbm-, sondern mit pbm-Dateien als Zeichensatzdateien +gearbeitet (die benötigen sogar weniger Platz, obwohl vielmehr Zeichen +in ihnen enthalten sind).
  • + +
  • +Alle Textelemente in die Lokalisierung (i18n) aufgenommen. Wär's mag +- kann jetzt auch Meldungen wie "GAME OVER" oder "READY!" in seine Landessprache +übersetzen. (Ein auskommentierer Versuch befindet sich in "/po/de/tdepacman.po".)
  • + +
  • +Dokumentation und Programm wieder einmal auf eine neue email-Adresse umgestellt.
  • +
+ +

+Version 0.2.5 (20. Juni 1999)

+ +
    +
  • +Die Anzeige (Anwahl) der Ruhmeshalle geändert, um so hoffentlich einige +selten auftretene Fehler zu beheben. Umschaltung der Anzeige durch lower/raise +anstelle der bislang genutzen hide/show-Funktionen. 
  • + +
  • +Bei der Installation, wird die Datei zur Speicherung der HighScores auf +worldwritable (chmod 666) gesetzt. Dadurch können auch "normale" Benutzer +ihre Höchstleistungen dauerhaft speichern.
  • + +
  • +Die Levels auf 13 erweitert (LevelPixmaps, Score) durch die höheren +Punktzahlen mußten auch die Fonts (zur Darstellung der erzielten +Punkte) erweitert werden. In diesem Zuge wurde die Anzeige der Punkte variabel +gestalten (im Rahmen von 10 bis 9000, wobei nur die führende Ziffer +nicht 0 sein darf. Ausnahme 1600). Da für die Anzeige der hohen Punktzahlen +mehr Platz benötigt wird als für die eigentliche Spielfigur, +mußte auch das gewährleistet werden.
  • + +
  • +Da in der Statusanzeige eigentlich kein Platz für 13 Levels ist, kann +die Anzeigeposition des Levelsymbols wahlfrei durch LevelPosition +angegeben werden. Jetzt wird auch das letzte Symbol anzeigt.
  • + +
  • +Die Standard-Geschwindigkeit der Monster bleibt, auf Wunsch von Gerald +Williams auch in den höheren Spielstufen konstant.
  • + +
  • +Routinen zur Bildschirmaktualisieren optimiert.
  • + +
  • +Dokumentation und Programm auf neue email-Adresse umgestellt.
  • +
+ +

+Version 0.2.4 (26. Januar 1999 - heute wurde linux v2.2 freigegeben)

+ +
    +
  • +Speicherung der "Höchsten Punktzahlen" in der Ruhmeshalle eingebaut. +Zu diesem Zweck wurde die Struktur der Bitfont-Zeichensätze um zusätzliche +Zeichen erweitert, die Sonderzeichen (kleine Punktzahlen während des +Spieles) in den Steuerungszeichenbereich verlagert und die Behandlung dieser +verbessert (FontFirstChar und FontLastChar über Konfigdatei).
  • + +
  • +Die Größe der Labels im Steuerungstasten-Dialog wird manuell +gesetzt, da die autoResize-Funktionen der qt-Libraries nicht in allen Version +sauber arbeiten.
  • + +
  • +Die Menüanzeige wird besser auf die aktuell verfügbaren Funktionen +angepaßt (disabled/enabled und checked).
  • + +
  • +Standardmäßig wird jetzt auch im "MIDWAY (groß)"-Schema +die glättere font-smooth.xbm Schrift verwendet.
  • + +
  • +Dateien zur Internationalisierung an neue Verzeichnisstruktur angepaßt.
  • +
+ +

+Version 0.2.3a (15. Januar 1999)

+ +
    +
  • +Anpassungen der Tastaturroutinen an die TDE 1.1 Bibliotheken (kompiliert +mit 1.0 und 1.1).
  • + +
  • +Winziges Bugfix in tdepacman.cpp (CHECK_PTR( menuBar )).
  • +
+ +

+Version 0.2.3 (12. September 1998)

+ +
    +
  • +Bewegungen der Monster im Gefängnis verlangsamt, dabei Fehler nach +der "harmlos"-Phase der Monster (sie blieben langsam) korrigiert.
  • + +
  • +Neue Font "font-smooth" und Pixmap "wall.xpm" für Zacman-Schema geglättet.
  • + +
  • +Alle Zeiten des Programmablaufes können über die Konfigdatei +geändert werden.
  • + +
  • +Hilfefunktion an TDE-Standard angepaßt (kapp->getHelpMenu).
  • +
+ +

+Version 0.2.2 (24. August 1998)

+ +
    +
  • +Lokalisation des Quellcodes und deutsche Übersetzung hinzugefügt.
  • + +
  • +kde_datadir Fehler in keys.cpp (Tastatusbelegung...) korrigiert, so das +Pixmaps und Bitfonts nach der Benutzung des "Tastaturbelegung..."-Dialogs +korrekt gefunden werden können.
  • + +
  • +Die Lage der Dateien (Quelldateien, Pixmaps, Dokumente usw.) geändert, +um der Beispielstruktur von kapptemplate v0.1 zu entsprechen.
  • +
+ +

+Version 0.2.1 (18. August 1998)

+ +
    +
  • +Zeitabläufe geändert (noch nicht perfekt), aber ich hoffe Andreas +Pour wird mehr Freude beim Testen der nächsten Versionen haben.
  • + +
  • +Das Handhabung der Pixmaps ist nicht mehr so strikt.
  • +
+ +

+Version 0.2.0 (13. August 1998)

+ +
    +
  • +(Vorläufige)Unterstützung von Grafikschemen hinzugefügt.
  • +
+ +

+Version 0.1.1 (8. August 1998) 

+ +
    +
  • +Erste öffentliche Version.
  • +
+ + + +
+
+
+ + + diff --git a/doc/de/tdepacman-2.html b/doc/de/tdepacman-2.html new file mode 100644 index 0000000..6c41d19 --- /dev/null +++ b/doc/de/tdepacman-2.html @@ -0,0 +1,62 @@ + + + + + + + Das TDEPacman Handbuch: Installation + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + +
+ + +

+2. Installation

+ +

+2.1 Wie Sie TDEPacman bekommen

+Sie finden TDEPacman auf  ftp://ftp.kde.org/pub/kde/unstable/latest/apps/games +,dem Haupt-FTP-Server des TDE Projekts. +

+2.2 Anforderungen

+Um TDEPacman erfolgreich compileren zu können, benötigen Sie die +Version 1.0 der TDE Libraries oder spätere und die Version 1.33 der +TQt Libraries oder spätere. Alle benötigten Libraries für +Ihr spefizisches System finden Sie auf  ftp://ftp.kde.org/pub/kde/stable/latest/distribution +und ftp::/ftp.kde.org/pub/qt.  +

+2.3 Übersetzung und Installation

+Sofern Sie TDEPacman selbst übersetzen und installieren wollen, erfolgt +dies auf die übliche Weise im Verzeichnis der TDEPacman Quelldateien:  +
+
% ./configure && make && make install
+
+TDEPacman benutzt autoconf, daher sollten keine Probleme bestehen. +Sofern doch Fehlerhinweise erscheinen, berichten Sie diese bitte an den +Autor Jörg Thönnissen.  +
  + + +
+
+
+ + + diff --git a/doc/de/tdepacman-3.html b/doc/de/tdepacman-3.html new file mode 100644 index 0000000..3f8b7ef --- /dev/null +++ b/doc/de/tdepacman-3.html @@ -0,0 +1,543 @@ + + + + + + + Das TDEPacman Handbuch: Konfiguration + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + +
+ + +

+3. Konfiguration

+Bis alle (sinnvollen) Parameter über Dialoge eingestellt werden können, +müssen bei Bedarf die entsprechenden Parameter in der Konfigdatei +~/.trinity/share/config/tdepacmanrc +angepaßt oder hinzugefügt werden. Wenn Sie Änderungen für +alle Benutzer vornehmen möchten, müssen Sie die globale Konfigdatei +/opt/trinity/share/config/tdepacmanrc +benutzen.  +

+3.1 Spielabläufe (Zeitsteuerung)

+Die Parameter unter der Standardgruppe [TDE Setup] in die der +nachfolgenden Tabelle aufgeführt sind, steuern die Zeitabläufe +des Spiels. Bei Schlüssel die mit "MS" enden (z.B. DyingAnimationMS), +werden die Werte in Millisekunden angegeben. Enden die Schlüssel mit +"Ticks" werden die Werte in Spielschritten angegeben.  +

Einige der unten aufgeführten Werte sind Listen von Zahlen . Die +einzelnen Werte der Liste werden durch Kommas getrennt. Wenn in den Standardwerten +mehrere Zahlen stehen oder der Zahl ein Komma folgt, entspricht dieser +Wert einer Liste. Diese Listen werden für unterschiedliche Spielstufen +(Level) benutzt. Dabei steht der erste Wert dieser Liste für die Demonstration, +die folgenden Werte für die wirklichen Spielstufen (also der zweite +Wert gilt für Stufe 1, der dritte für Stufe 2 usw.).  +
Die größte Spielstufe wird durch den Wert des Schlüssel +"Levels" festgelegt.  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SchlüsselBeschreibungStandardwert
SpeedMSLänge der Spielschritte (Ticks) in Millisekunden. Definiert die +kleinste Zeiteinheit. Verkleinerung des Wertes beschleunigt das Spiel und +Vergrößerung des Wertes verlangsamt den Spielablauf.20,
PacmanTicksAnzahl der Ticks (siehe speed) bis zur nächsten Bewegung des Pacmans. +Vergrößerung des Wertes macht die Bewegungen des Pacman langsamer +und Verkleinerung des Wertes machen den Pacman schneller.3,
RemTicksAnzahl der Spielschritte während der R.E.M. (Rapid Eye Movement)-Phase. +Das ist die Phase, wenn ein Monster gefressen wurde und zurück ins +Gefängnis muß. Erhöhung des Wertes erhöht die Zeit +bis ein gefressenes Monster im Gefängnis ist, und Verkleinerung des +Wertes verkürzt diese Zeit.1,
DangerousTicksSpielschritte in der Phase, in der die Monster gefährlich sind. +Eine Vergrößerung des Wertes, läßt die Monster sich +langsamer bewegen und eine Verkleinerung des Wertes, läßt die +Monster sich schneller bewegen.3,
HarmlessTicksAnzahl der Zeiteinheiten zwischen den Monsterbewegungen in der Phase, +in der die Monster gefressen werden können.7,6,,5,,4,
HarmlessDurationTicksLänge der Zeit, in der die Monster gefressen werden können +(in Spielschritten, siehe Speed).375,,,300,,250,200,150,
HarmlessWarningTicksAnzahl der Zeiteinheiten vor dem Ende der Harmlos-Phase. In dieser +Zeit wird durch Blinken der Monster das bevorstehende Ende dieser Phase +angezeigt.135,
ArrestTicksZeitabstände der Monsterbewegungen während der Zeit im Gefängnis.6,
ArrestDurationTicksLänge des Gefängnisaufenthalts. Diese Zeitspanne wird mit +der Monster-ID (0 = Erstes, 1 = Zweites, ...) multipliziert. Aus diesem +Grund wird das erste Monster direkt freigelassen. (Ausnahmeweise wird auch +Monster #2 beim ersten Start sofort entlassen.)200,,,150,
FruitAppearsTicksZeitspanne zwischen dem Erscheinen der Früchte (in Spieleinheiten).1000,,1500,2000,2500,  +
3000,3500,4000,
FruitDurationTicksDauer der Erscheinung in Spielschritten.500,,,400,350,300,,250,  +
200,150,
FruitScoreDurationTicksLänge der Zeitspanne, in der beim Essen einer Frucht, die Höhe +der Punkte (für den Verzehr der Frucht) angezeigt wird.150,
MonsterScoreDurationMSZeitdauer der Punktanzeige, wenn ein Monster gefressen wird (in Millisekunden).1000
PlayerDurationMSZeitdauer der "PLAYER ONE" -Einblendung (in ms). Momentan wird nur +ein Spieler unterstützt3000
ReadyDurationMSLänge der "READY!"-Anzeige.2000
GameOverDurationMSLänge der "GAME OVER"-Anzeige, bevor wieder die Vorstellung der +Spielfiguren aufgerufen wird. 3000
AfterPauseMSDiese Zeit wird nach einer PAUSE gewartet, bis die unterbrochene Funktion +fortgesetzt wird.1000
DyingPreAnimationMSDieser Wert steuert die Länge des Freundentanz der Monster, wenn +sie den Pacman erwischt haben.1000
DyingAnimationMSAbstände zwischen den einzelnen Grafiken, die den Tod des Pacman's +darstellen.100
DyingPostAnimationMSDie Länge der Zeit, in der die erste und letzte Teilgrafik der +Sterbesequenz angezeigt wird, um diese hervorzuheben.500
IntroAnimationMSZeiträume zwischen den einzelnen Schritten der Vorstellung.800
IntroPostAnimationMSMillisekunden zwischen der Vorstellung und dem Beginn der Demonstration.1000
LevelUpPreAnimationMSZeit zwischen dem Erreichen des Spielzieles (Fressen aller Punkte) +und der Spielstufenwechsel-Animation.2000
LevelUpAnimationMSZeit der primitiven Spielstufenwechsel-  +
Animation (in Millisekunden).
2000
MonsterIQIQ der Monster, dieser spiegelt sich in der Bewegung der Monster wieder. +Momentan wird dieser noch nicht besonders gut ausgewertet.0,170,180,170,180,  +
170,180,
LevelsAnzahl der unterschiedlichen Spielstufen (ohne die Demonstration).13
HallOfFameMSDie Zeit wie lange die Ruhmeshalle angezeigt wird (in ms).7000
CursorBlinkMSDer Cursor zur Eingabe des Namens in die HighScore-Liste wechselt in +dieser Zeit zwischen seinen Zuständen (an und aus). Hierdurch wird +auch die Tastenwiederholung der Blätterfunktion (Pfeil hoch und Pfeil +runter) gesteuert.250
+ +

Sind weniger Werte in der Zahlenliste als Werte für die Spielstufen+Demo +notwendig sind, oder sind ungültige Zahlenwerte oder fehlende Werte +(,,) in dieser Liste, wird der vorherige (gültige) Wert (bzw. 0 falls +noch kein Wert angegeben wurde) an diese Stelle eingefügt.  +
Zum Beispiel wird (bei Levels=7) aus HarmlessTicks=7,6,,5,,4 - HarmlessTicks=7,6,6,5,5,4,4,4 +(7 Ticks für Demonstration, 6 Ticks für Level #1 usw.).  +

+3.2 Punkte

+Die Punktevergabe während des Spiels wird durch folgende Schlüssel/Werte-Paare +in der Standardgruppe [TDE Setup] gesteuert (siehe Abschnitt Zeitsteuerung +für Informationen über die Interpretation der Zahlenlisten):  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SchlüsselBeschreibungStandard
PointScoreAnzahl Punkte die für das Fressen der kleinen Punkte gegeben werden.10
SwitchScorePunkte für das Fressen der größeren Punkte (diese Punkte +lassen die Monster von den Jägern zu den Gejadgen werden).50
FruitScoreBeim Fressen der Früchte wird diese Anzahl der Punkte vergeben. +Abhängig vom Level und damit von der Art der Frucht wird der Wert +aus der Liste benutzt.100,300,500,,700,, +
1000,,2000,,3000,5000,
MonsterScoreHöhe der Punktanzahl für das Fressen der Monster. Innerhalb +der Zeit nach Fressen eines Schalters ist die Anzahl der gefressenen Monster +entscheidend für die Höhe der Punkte. Aus diesem Grund wird hier +auch eine Werteliste angegeben, die der Anzahl gefressener Monster entspricht. +In unserem Beispiel gibt es für das erste Monster 200 Punkte, für +das zweite 400 Punkte usw.200,400,800,1600
ExtraLifeScoreAnzahl der Punkte, die erreicht werden muß, damit es ein zusätzliches +Leben gibt.10000
+ +

+3.3 Grafikschemen

+Die Grafikschemen werden über die folgenden zwei Schlüssel/Werte-Paare +der Standardgruppe [TDE Setup] gesteuert:  +
  + + + + + + + + + + + + + + + + + + + + + + + + +
SchlüsselBeschreibungBeispiel
SchemeCountAnzahl der definierten Schemen. Für jedes Schema existiert eine +einige Gruppe mit dem Namen [Scheme n]. Wobei n durch +eine Zahl von 0 bis SchemeCount-1 steht.3
SchemeAusgewähltes Schema. Mögliche Werte sind 0 bis SchemeCount-1 +(dieser Wert wird auch durch die Schemenauswahl aus dem Menu gesetzt).0
+ +

Wie schon oben kurz angesprochen, werden die Grafikschemen in eigenen +Schemen-Gruppen (z.B.: [Scheme 0]) definiert. Momentan werden +nur folgende Schlüssel/Wert-Paare ausgewertet:  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SchlüsselBeschreibungBeispiel
FontDateiname der xbm-Fontdatei. Wird der Name ohne absolute Pfadangabe +(führendes "/" oder "~") spezifiziert, bezieht er sich relativ auf +das Verzeichnis $TDEDIR/share/apps/tdepacman/fonts . Der Aufbau +dieser Fontdatei wird in einer der nächsten Versionen beschrieben, +wenn Sie sich die Datei allerdings mit einem Bitmap-Editor ansehen wird +Ihnen aber bestimmt schon alles klar.font.xbm
FontFirstCharDas erste Zeichen im Zeichensatz der Bildschirmschrift wird hier durch +seinen numerischen Wert festgelegt.14
FontLastCharDieser Wert definiert den Zahlenwert des letzen Zeichen in der angegebenen +Schriftart. Wenn die Standardfonts zum Beispiel um Kleinbuchstaben erweitert +werden, wird hier der numerische Wert des letzten Buchstabens definiert.95
PixmapDirectoryVerzeichnis in dem sich die Pixmap-Dateien für die Spielfiguren, +die Punkte, die Wände usw. befinden. Die Namen der einzelnen xpm-Dateien +sind momentan noch fest codiert (wird sich auch noch ändern). Der +Pfad bezieht sich, falls nicht absolut angegeben, auf das Verzeichnis $TDEDIR/share/apps/tdepacman/pics. +Wird hier kein Wert angegeben, werden die Pixmaps in diesem Verzeichnis +gesucht.tiny
DescriptionDiese Zeichenkette wird im Menü zur Anwahl des Grafikschemas angezeigt. +Über das '&'-Zeichen wird die Kurztastenanwahl gesteuert (d.h. +das Beispielschema kann durch betätigen der 'T'-Taste angewählt +werden). Über das Anhänger des Sprachkürzels an den Schlüssel +(z.B.: Description[de]) kann der Wert an die entsprechene Landessprache +angepaßt werden.MIDWAY MFG.CO. (&tiny)
+ +

+3.4 Sonstiges

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SchlüsselBeschreibungBeispiel
LevelPositionDefiniert die Position der Level (Früchte) innerhalb der Statuszeile. +Hiermit können zum Beispiel mehrere Level an derselben Position angezeigt +werden, um so Platz zu sparen. Die erste mögliche Position (ganz rechts) +wird durch den Wert 0 dargestellt.0,1,2,3,,4,,5,,6,,7,
HighscoreFilePathLegt den Pfad (Verzeichnis und Dateiname) zur "highscore"-Datei fest. +Wird nur ein Verzeichnis (".../") angegeben, wird der Standard-Dateiname +("highscore") verwendet./tmp/tdepacman.highscore
+ +
  + + +
+
+
+ + + diff --git a/doc/de/tdepacman-4.html b/doc/de/tdepacman-4.html new file mode 100644 index 0000000..297cc96 --- /dev/null +++ b/doc/de/tdepacman-4.html @@ -0,0 +1,58 @@ + + + + + + Das TDEPacman Handbuch: Copyright + + +  + + + + + + +
TDEPacman TDEPacman  +
Version 0.3.2
+ +
+ + + + + + + + +
+ + +

+4. Copyright

+TDEPacman Copyright © 1998-2003 Jörg Thönnissen, <joe@dsite.de>  + +

Dieses Programm (inklusive dieser Dokumentation) ist freie Software. +Sie können es verbreiten und/oder verändern unter den Bedingungen +der GNU General Public License, wie sie von der Free Software Foundation +veröffenticht wurde, entweder Version 2 der Lizenz oder (wie Sie möchten) +einer neueren Version.  + +

Dieses Programm wird in der Hoffnung verbreitet, es sei nützlich, +aber ohne jegliche Garantie, auch ohne die stillschweigende Garantie +der Funktionsfähigkeit oder Eignung für einen bestimmten +Zweck. Sehen Sie in der GNU General Public License für Detail +nach.  + +

Sie sollten eine Kopie der GNU General Public License mit diesem Programm +erhalten haben, falls nicht, schreiben Sie an die Free Software Foundation, +Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  +
  +

+ +
+
+
+  + + diff --git a/doc/de/tdepacman.gif b/doc/de/tdepacman.gif new file mode 100644 index 0000000..4fa3926 Binary files /dev/null and b/doc/de/tdepacman.gif differ diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt index 192dddc..94201a1 100644 --- a/doc/en/CMakeLists.txt +++ b/doc/en/CMakeLists.txt @@ -1,7 +1,7 @@ file( GLOB _files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.html ) install( - FILES ${_files} kpacman.gif screenshot.png + FILES ${_files} tdepacman.gif screenshot.png DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME} ) diff --git a/doc/en/index.docbook b/doc/en/index.docbook index d70e3b1..031072a 100644 --- a/doc/en/index.docbook +++ b/doc/en/index.docbook @@ -1,7 +1,7 @@ Kpacman'> - + TDEpacman'> + @@ -17,9 +17,9 @@ This template was designed by: David Rugge davidrugge@mindspring.com with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de -of the KDE DocBook team. +of the TDE DocBook team. -You may freely use this template for writing any sort of KDE documentation. +You may freely use this template for writing any sort of TDE documentation. If you have any changes or improvements, please let us know. In the future, we may want to change from SGML-based DocBook to XML-based @@ -41,7 +41,7 @@ thanks ;-). as Authors, publish date, the abstract, and Keywords --> -The Kpacman Handbook +The TDEpacman Handbook @@ -80,17 +80,17 @@ Do NOT change these in the translation. --> -&kpacman; is an application specially designed to do nothing you would +&tdepacman; is an application specially designed to do nothing you would ever want. -KDE +TDE tdeutils Kapp nothing @@ -106,7 +106,7 @@ document, and if there is no ID, the name of the generated HTML files will vary from time to time making it hard to manage for maintainers and for the CVS system. Any chapter labelled (OPTIONAL) may be left out at the author's discretion. Other chapters should not be left out in order to maintain a -consistent documentation style across all KDE apps. --> +consistent documentation style across all TDE apps. --> Introduction @@ -127,7 +127,7 @@ You can eat the big spot when needed and eat the ghosts when the color changes. -Using Kpacman +Using TDEpacman -The main Kpacman window +The main TDEpacman window @@ -210,7 +210,7 @@ or menu bars. --> -Developer's Guide to Kpacman +Developer's Guide to TDEpacman Credits and License @@ -273,7 +273,7 @@ Program copyright 1997 John Q. Hacker jqh@kde.org Contributors: -Kontqui the KDE Dragon konqui@kde.org +Kontqui the TDE Dragon konqui@kde.org Tux the Linux Penguin tux@linux.org @@ -305,12 +305,12 @@ Documentation copyright 1999 George N. Ugnacious gnu@kde.org Installation - -How to obtain Kpacman + +How to obtain TDEpacman -&kpacman; is part of the TDE project -https://mirror.git.trinitydesktop.org/gitea/TDE/kpacman. +&tdepacman; is part of the TDE project +https://mirror.git.trinitydesktop.org/gitea/TDE/tdepacman. @@ -341,7 +341,7 @@ on The TD or the ChangeLog file, or ... --> You can find a list of changes (not currently updated) at Changelog. +url="https://mirror.git.trinitydesktop.org/gitea/TDE/tdepacman/src/branch/master/ChangeLog">Changelog. diff --git a/doc/en/index.html b/doc/en/index.html index 16ab587..aabb2b7 100644 --- a/doc/en/index.html +++ b/doc/en/index.html @@ -2,17 +2,17 @@ - - - The KPacman Handbook + + + The TDEPacman Handbook   - + -
KPacmanTDEPacmanKPacman +TDEPacman
Version 0.3.2
@@ -21,59 +21,59 @@ diff --git a/doc/en/kpacman-1.html b/doc/en/kpacman-1.html deleted file mode 100644 index 702ba7e..0000000 --- a/doc/en/kpacman-1.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - The KPacman Handbook: Introduction - - -  -
-
Next Previous Table of Contents
+
Next Previous Table of Contents

-The KPacman Handbook

+The TDEPacman Handbook Jörg Thönnissen, <joe@dsite.de>
Version 0.3.2, June 30th, 2003

-


This Handbook describes KPacman Version 0.3.2  +
This Handbook describes TDEPacman Version 0.3.2 

-1. Introduction

+1. Introduction

-2. Installation

+2. Installation

-3. Configuration

+3. Configuration

-4. Copyright 

+4. Copyright  -
Next Previous Table of Contents
+
Next Previous Table of Contents

- - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - - - - - -
- - -

-1. Introduction

- -

-1.1 Changes 

- -

-Version 0.3.2 (30. June 2003)

- -
    -
  • Almost a real KDE3 application.
  • -
- -

-Version 0.3.1 (31. January 2002)

- -
    -
  • Prerelease for KDE2 (Documentation not fully adjusted).
  • - -
  • The "highscore"-file is no longer been created by the installation, but as soon as -the hall of fame has been entered. -The path (directory/filename) could be specified in the configfile. -If the systemwide "highscore"-file is not writable, a private file in the -home-directory of the user is used and a corresponding message is shown.
  • -
- -

-Version 0.3.0 (June 2000, not released)

- -
    -
  • Ms.Pacman mode implemented (mighty modification) !
  • - -
  • Automatic Pause/Continue in Back/Foreground, for Kevin Forge -(he has the idea for Ms.Pacman too) integrated. This options can be changed using -the menu.
  • - -
  • Portuguese translation by Sérgio Fernandes.
  • - -
  • Animation of the energizers und blinking of active player ("1UP") added.
  • - -
  • Flickering during editing the hall of fame by changing the focus -removed (FocusEvents).
  • - -
  • The mousecursor could be hidden/shown while over the playground, -thru the menubar.
  • - -
  • The boardlayout (map) could be placed in external textfiles and selected -thru the configfile (kpacmanrc) if needed.
  • - -
  • Duplicate pixmaps removed. Because all pixmapfiles could be specified -thru the configfile now, pixmaps could be placed in foreign (scheme)-directories -(EyesPixmapName=../tiny/eyes.xpm), or have different names -(e.g.: LevelPixmapName=fruit.xpm).
  • - -
  • After eating the last dot, the first pixmap of the last/current direction -is shown. The initial pixmap of the north/up-direction was displayed so far.
  • -
- -

-Version 0.2.6 (December 11th, 1999)

- -
    -
  • -Swedish translation of some text (unfortunately incomplete) by Johne.
  • - -
  • -By the use of special charaters (umlauts) in the swedish version, the whole -font-handling had to be rearranged.
  • - -
  • -The fonts contains (nearly) the full ISO-Latin1 characterset (no lowercase -characters).
  • - -
  • -Alignment functions built into the display routines.
  • - -
  • -No further use of xbm-fonts, therefore pbm-files were used as fonts (they -need less space, even they contains much more characters).
  • - -
  • -All textelements added to the localisation (i18n). So strings like "GAME -OVER" or "READY!" could be translated into any language.
  • - -
  • -The documentation and programm now contains my brandnew email-address.
  • -
- -

-Version 0.2.5 (June 20th, 1999)

- -
    -
  • -Displaying of the hall of fame changed, hopefully this fix some rare bugs. -Use lower/raise- instead of former used hide/show-functions to switch display.
  • - -
  • -The file used for HighScore storage, will be set to worldwriteable (chmod -666) during installation. Thru this "normal" users could store their highscores -permanently.
  • - -
  • -Levels entended upto 13 (LevelPixmaps, Score), by the higher scores, the -fonts (for displaying the scored points) had to be extended too. The scores -could be variable (in the range from 10 to 9000, only the leading digit -can be not 0. exception 1600 ) now. The pixmap for the score could be larger -than the actual figure itself.
  • - -
  • -Because there is not enough room to show 13 levelsymbols in the statusline, -the position of the symbol can be specified by the LevelPosition -value(s).
  • - -
  • -The default-Speed of the monsters kept constant althrough higher levels, -requested by Gerald Williams.
  • - -
  • -Update-routines (display) optimized.
  • - -
  • -The documentation and programm now contains my new email-address.
  • -
- -

-Version 0.2.4 (January 26th, 1999 - today linux v2.2 was released)

- -
    -
  • -Added the hall of fame to store the highscores. For this, the structure -of the bitfonts was extented to contain furthermore characters, the special-characters -(small scores during the game) moved to the control-character-region and -the fonthandling was enhanced (FontFirstChar and FontLastChar can be stored -in the Configfile).
  • - -
  • -The size of the labels in the "Change Keys..."-dialog were set manually, -cause the autoResize-function in the qt-libs didn't work correctly in all -versions.
  • - -
  • -The menuitems are more sensitive to the actual availiable functions (disabled/enabled -and checked).
  • - -
  • -Now, also in the "MIDWAY (large)"-scheme the smoother font-smooth.xbm font -is used by default.
  • - -
  • -The files for the internationalization moved to represent the new standard -locations.
  • -
- -

-Version 0.2.3a (January 15th, 1999)

- -
    -
  • -Keyboard-routines changed to be compatible with the KDE 1.1 libraries (compiles -with 1.0 and 1.1).
  • - -
  • -A small bug fixed in kpacman.cpp (CHECK_PTR( menuBar )).
  • -
- -

-Version 0.2.3 (September 12th, 1998)

- -
    -
  • -Slowed down the movement of the monsters in the prison, and fixed a bug -that kept the monsters moving slowly after the "harmless"-phase of the -monsters.
  • - -
  • -Added a new font "font-smooth" and smoothed the pixmap "wall.xpm" for the -Zacman-scheme.
  • - -
  • -Enhanced configuration of all timing-parameters using the configuration -file.
  • - -
  • -Changed Help-function (kapp->getHelpMenu) to reflect the KDE-Standard.
  • - -
  • -Improved the documentation (Many thanks to Andreas Pour).
  • -
- -

-Version 0.2.2 (August 24th, 1998)

- -
    -
  • -Localized the sources and added a German translation of the documentation.
  • - -
  • -Fixed bug so pixmaps and bitfonts could located correctly after using the -"Change keys..."-dialog.
  • - -
  • -Changed the location of the files (sources, pixmaps, docs etc.) to reflect -the recommeded structure of kapptemplate v0.1.
  • -
- -

-Version 0.2.1 (August 18th, 1998)

- -
    -
  • -Improved the timing (it's not perfect yet), and I hope Andreas Pour will -have more fun testing the next version.
  • - -
  • -Increased flexibility in handling the pixmaps.
  • -
- -

-Version 0.2.0 (August 13th, 1998)

- -
    -
  • -Added (preliminary) graphic scheme support.
  • -
- -

-Version 0.1.1 (August 8th, 1998) 

- -
    -
  • -First public release.
  • -
- - - -
-
-
- - - diff --git a/doc/en/kpacman-2.html b/doc/en/kpacman-2.html deleted file mode 100644 index 7a1f3ee..0000000 --- a/doc/en/kpacman-2.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - The KPacman Handbook: Installation - - -  - - - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - -
- - -

-2. Installation

- -

-2.1 How to obtain KPacman

-KPacman can be found on ftp://ftp.kde.org/pub/kde/unstable/latest/apps/games/, -the main ftp site of the KDE project.  -

-2.2 Requirements

-In order to compile KPacman successfully, you will need the version 1.0 -of the kde libraries or later and version 1.33 of the qt libraries or later. -Look for the version of the libraries appropriate for your system at ftp://ftp.kde.org/pub/kde/stable/latest/distribution/ -and  ftp://ftp.kde.org/pub/qt.  -

-2.3 Compilation and installation

-In order to compile and install KPacman on your system, type the following -in the base directory of the KPacman distribution:  -
-
% ./configure && make && make install
-
-Since KPacman uses autoconf you should have no trouble compiling -it. Should you run into any problems, please report them to the the author -at Jörg Thönnissen.  -
  - - -
-
-
- - - diff --git a/doc/en/kpacman-3.html b/doc/en/kpacman-3.html deleted file mode 100644 index 7abb5bd..0000000 --- a/doc/en/kpacman-3.html +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - - The KPacman Handbook: Configuration - - -  - - - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - -
- - -

-3. Configuration

-At this juncture all of KPacman's parameters cannot be configured graphically. -To change those parameters for an individual user you should edit the user's -KPacman configuration file (this file should be located at ~/.kde/share/config/kpacmanrc). -Alternatively, you can affect the default configuration of all users by -editing the global KPacman configuration file (this file should be located -at /opt/kde/share/config/kpacmanrc).  -

-3.1 Timings

-The parameters under the standardgroup heading [KDE Setup] listed -in the table below control the timing of the game.  Keys ending in -"MS" (e.g., "DyingAnimationMS") have their values expressed in milliseconds, -whereas Keys ending in "Ticks" have their values expressed in cycles.  -

Some values below are expressed as a comma-separated list of numbers, -each of which corresponds to a different level. Keys which have a default -value of more than one number or of a number followed by a comma may be -set for each level.  The first number in a list is used for the demonstration -level, and the following numbers are for the interactive game levels (the -second value is used for level 1, the third for level 2 and so on). The -maximum number of levels is defined by the value of the key "Levels".  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionDefault Value
SpeedMSDuration of a single cycle (a "Tick"), in milliseconds. All other timings -in the game are multiples of the single cycle duration.  Decreasing -the value speeds up the game and increasing the value slows down the game.20,
PacmanTicksNumber of cycles until the next move of the pacman.  Increasing -the value makes the pacman move slower and decreasing the value makes the -pacman move faster.3,
RemTicksNumber of cycles for a monster to return to prison after being eaten -by the pacman (the R.E.M. -- rapid eye movement -- phase).  Increasing -the value increases the time until a eaten monster returns to prison and -decreasing the value decreases the time until a monster returns to prison.1,
DangerousTicksNumber of cycles until the next move of the monsters when they are -dangerous and will eat the pacman.  Increasing the value makes the -monsters move slower and decreasing the value makes the monsters move faster.3,
HarmlessTicksNumber of cycles until the next move of the monsters when they are -harmless and can be eaten by the pacman.  Increasing the value makes -the monsters move slower and decreasing the value makes the monsters move -faster.7,6,,5,,4,
HarmlessDurationTicksNumber of cycles during which the monsters remain harmless and can -be eaten by the pacman after the pacman eats a switch.  Increasing -this value makes the monsters stay harmless longer and decreasing this -value makes the monsters return to being dangerous sooner.375,,,300,,250,200,150,
HarmlessWarningTicksNumber of cycles in which the user is warned of the upcoming end of -the harmless-phase by the monsters blinking. This value must be less at -each level than the corresponding "HarmlessDurationTicks".  Increasing -this value increases the length of the warning and decreasing this value -shortens the length of the warning.135,
ArrestTicksNumber of cycles until the next move of the monsters when they are -in prision.6,
ArrestDurationTicksNumber of cycles in which monsters remain in prison after being eaten. -This value will be multiplied by the id of the monster eaten ( 0 for first -monster eaten after the pacman eats a switch, 1 for the second, and so -on), so that the first monster will be freed immediatly and the other monsters -have to wait longer (by way of exception the second monster is also freed -immediatly during the initial stage of the game).  Increasing this -value increases the prison time of the monsters, and decreasing this value -frees the monsters sooner.200,,,150,
FruitAppearsTicksNumber of cycles between the appearence of fruit.  Increasing -this value causes fruit to appear less frequently and decreasing this value -causes fruit to appear more frequently.1000,,1500,2000,2500,  -
3000,3500,4000,
FruitDurationTicksNumber of cyles for which fruit remains.  Increasing this value -causes the fruit to be available for consumption longer and decreasing -this value causes the fruit to disappear sooner.500,,,400,350,300,,250,  -
200,150,
FruitScoreDurationTicksNumber of cycles for which the score for eating a fruit is displayed -after a fruit is eaten.150,
MonsterScoreDurationMSNumber of milliseconds for which the score for eating a monster is -displayed after a monster is eaten.1000
PlayerDurationMSNumber of milliseconds for displaying "PLAYER ONE" at the start of -the game. At the moment only one player is supported.3000
ReadyDurationMSNumber of milliseconds for displaying "READY!" at the start of the -game.2000
GameOverDurationMSNumber of milliseconds for displaying "GAME OVER" at the end of the -game.3000
AfterPauseMSNumber of milliseconds until play is resumed after cancelling a "Pause".1000
DyingPreAnimationMSNumber of milliseconds for which the monsters dance after catching -the pacman.1000
DyingAnimationMSNumber of milliseconds in which the scenes (other than the first and -last scenes) of the pacman's death are displayed after he is caught by -a monster.100
DyingPostAnimationMSNumber of milliseconds in which the first and last scenes of the pacman's -death are displayed after he is caught by a monster (this permits emphasis -of these scenes).500
IntroAnimationMSNumber of milliseconds between the scenes of the introduction.800
IntroPostAnimationMSNumber of milliseconds between the introduction and the beginning of -the demonstration.1000
LevelUpPreAnimationMSNumber of milliseconds between completing a level and the beginning -of the animation for the next level.2000
LevelUpAnimationMSNumber of milliseconds for which the animation for changing levels -is displayed.2000
MonsterIQThe intelligence of the monster (currently not fully implemented).  -Increasing the value makes the monsters more clever and decreasing the -value makes them dumber.0,170,180,170,180,  -
170,180,
LevelsNumber of different levels (without the demonstration).  If you -increase this value be sure all the parameters for that level are defined -above!13
HallOfFameMSThe hall of fame is displayed this amount of milliseconds.7000
CursorBlinkMSNumber of milliseconds the cursor, used for editing your name in the -hall of fame, keeps his states (on or off). The repeating of keystrokes -for scrolling (Key_Up and Key_Down) also depends of this value.250
- -

If there are insufficient values in a list for the number of levels -(including the demonstration level), or if there is an invalid or missing -(e.g., ",,") in the list, then the previous (valid) value is used for that -position. If no valid values are listed, the value will be 0.  For -example "HarmlessTicks=7,6,,5,,4" is equivalent to "HarmlessTicks=7,6,6,5,5,4,4,4 -(if Levels=7)". That means 7 cycles for the demonstration, 6 cycles for -level 1 and so on.  -

-3.2 Points (Scoring)

-Scoring during the game is controlled by the following key/value-pairs -in the standardgroup [KDE Setup] (see the section Timings -for information on how to interpret comma-separated values):  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionDefault
PointScoreNumber of points awarded for eating a small point.10
SwitchScoreNumber of points awarded for eating a switch (the large points that -convert the monsters from hunters to the hunted!)50
FruitScoreNumber of points awarded for eating a fruit.100,300,500,,700,, -
1000,,2000,,3000,,5000,
MonsterScoreNumber of points awarded for eating a monster, with each point value -in the list being awarded for each successive monster eaten after eating -a switch (the values are reset if a new switch is eaten even if the prior -switch has not expired yet). Since there are four monsters you should include -four values.  Using the default values specified at right, 200 points -are awarded for eating the first monster, 400 for the second monster, and -so on.200,400,800,1600
ExtraLifeScoreNumber of points needed to earn another pacman life. 10000
- -

-3.3 Graphic schemes

-The graphics schemes are controlled by the following two key/value-pairs -of the standardgroup [KDE Setup]:  -
  - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionExample
SchemeCountNumber of defined schemes. For every scheme a separate group with the -name [Scheme n] exists. n stands for a number between 0 and SchemeCount-1.3
SchemeSelected scheme. Possible values are between 0 and SchemeCount-1 (this -value can also be set using the game's menu).0
- -

Each graphic scheme is defined in a seperate scheme-group using the -group designation [Scheme N], where N is the number of -the scheme being defined.  Each scheme-group may have the following -keys:  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionExample
FontFilename of the xbm-font. Names without an absolute path (a leading -"/" or "~") are relative to $TDEDIR/share/apps/kpacman/fonts.  -The structure of the fontfile will be explained in one of the next releases, -but you should be able to figure it out by opening one of the fontfiles -included with KPacman using a bitmap-editor.font.xbm
FontFirstCharDefines the numeric value of the first character in the bitfont.14
FontLastCharThe last character in the bitfont, is giving here by its numeric code. -If you extent the fonts by adding the lowercase characters, this value -must be changed.95
PixmapDirectoryDirectory in which the pixmap-files for the figures are located.  -Direcotry names without an absolute path (a leading "/" or "~") are relative -to $TDEDIR/share/apps/kpacman/pics. The names of the individual -xpm-files are fixed in the code at the moment (this will be changed) and -are ''down.xpm" for an arrow pointing down, "fruit.xpm" for the series -of fruit for the various levels, "lifes.xpm" for the image to display at -the bottom of the screen for each pacman life remaining, "point.xpm" for -the small points which the pacman eats, "switch.xpm" for the switch points, -"dying.xpm" for the sequence of images for a dying pacman, "left.xpm" for -an arrow pointing left, "monster.xpm" for the various monsters, including -their appearance during the "switch" and "warning" cycles, "prison.xpm" -for a series of images put together to draw the prison walls, "up.xpm" -for , "eyes.xpm" for the series of eyes for the monsters when they move -up, down, right and left, respectively, "level.xpm" for the row of fruit -at the bottom of the screen indicating the current level, "pacman.xpm" -for the series of pacman images (gobbling and normal x moving up, down, -left and right), "right.xpm for a right arrow, and "wall.xpm" for a series -of images put together to draw the non-prison walls.tiny
DescriptionThe name of the scheme, which will be displayed in the menu "Select -Graphic Scheme". Use the '&'-character in front of a character in the -name to set the accelerator-key to that character (that means pressing -that key when the Select Graphic Scheme menu is down will select that scheme). -You may add a location tag to the key (e.g., Description[de] to indicate -that the description is in German).MIDWAY MFG.CO. (&tiny)
- -

-3.4 Miscellaneous

-  - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionExample
LevelPositionDefines the position of the levelsymbols (fruits) on the statusline. -It is possible to show to different levels on the same position to save -room. The first position (rightmost) has the value 0.0,1,2,3,,4,,5,,6,7,
HighscoreFilePathSpecifies the path (directory and filename) to the "highscore"-file. -If only a directory (".../") is given, the default-filename ("highscore") -will be used./tmp/kpacman.highscore
- -
  - -
- - - diff --git a/doc/en/kpacman-4.html b/doc/en/kpacman-4.html deleted file mode 100644 index 3803f53..0000000 --- a/doc/en/kpacman-4.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - The KPacman Handbook: Copyright - - -  - - - - - - -
KPacmanKPacman -
Version 0.3.2
- -
- - - - - - - - -
- - -

-4. Copyright

-KPacman Copyright (c) 1998-2003 Jörg Thönnissen, <joe@dsite.de> -

This program (including this documentation) is free software; you can -redistribute it and/or modify it under the terms of the GNU General Public -License as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version.  -

This program is disttributed in the hope that it will be useful, but -without -any warranty; without even the implied warranty of merchantability -or fitness for a particular purpose. See the GNU General Public -License for more details.  -

You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -675 Mass Ave, Cabridge, MA 02139, USA.  -
  -

- -
-
-
- - - diff --git a/doc/en/kpacman.gif b/doc/en/kpacman.gif deleted file mode 100644 index 4fa3926..0000000 Binary files a/doc/en/kpacman.gif and /dev/null differ diff --git a/doc/en/tdepacman-1.html b/doc/en/tdepacman-1.html new file mode 100644 index 0000000..e232930 --- /dev/null +++ b/doc/en/tdepacman-1.html @@ -0,0 +1,274 @@ + + + + + + + The TDEPacman Handbook: Introduction + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + + + + + +
+ + +

+1. Introduction

+ +

+1.1 Changes 

+ +

+Version 0.3.2 (30. June 2003)

+ +
    +
  • Almost a real TDE3 application.
  • +
+ +

+Version 0.3.1 (31. January 2002)

+ +
    +
  • Prerelease for TDE2 (Documentation not fully adjusted).
  • + +
  • The "highscore"-file is no longer been created by the installation, but as soon as +the hall of fame has been entered. +The path (directory/filename) could be specified in the configfile. +If the systemwide "highscore"-file is not writable, a private file in the +home-directory of the user is used and a corresponding message is shown.
  • +
+ +

+Version 0.3.0 (June 2000, not released)

+ +
    +
  • Ms.Pacman mode implemented (mighty modification) !
  • + +
  • Automatic Pause/Continue in Back/Foreground, for Kevin Forge +(he has the idea for Ms.Pacman too) integrated. This options can be changed using +the menu.
  • + +
  • Portuguese translation by Sérgio Fernandes.
  • + +
  • Animation of the energizers und blinking of active player ("1UP") added.
  • + +
  • Flickering during editing the hall of fame by changing the focus +removed (FocusEvents).
  • + +
  • The mousecursor could be hidden/shown while over the playground, +thru the menubar.
  • + +
  • The boardlayout (map) could be placed in external textfiles and selected +thru the configfile (tdepacmanrc) if needed.
  • + +
  • Duplicate pixmaps removed. Because all pixmapfiles could be specified +thru the configfile now, pixmaps could be placed in foreign (scheme)-directories +(EyesPixmapName=../tiny/eyes.xpm), or have different names +(e.g.: LevelPixmapName=fruit.xpm).
  • + +
  • After eating the last dot, the first pixmap of the last/current direction +is shown. The initial pixmap of the north/up-direction was displayed so far.
  • +
+ +

+Version 0.2.6 (December 11th, 1999)

+ +
    +
  • +Swedish translation of some text (unfortunately incomplete) by Johne.
  • + +
  • +By the use of special charaters (umlauts) in the swedish version, the whole +font-handling had to be rearranged.
  • + +
  • +The fonts contains (nearly) the full ISO-Latin1 characterset (no lowercase +characters).
  • + +
  • +Alignment functions built into the display routines.
  • + +
  • +No further use of xbm-fonts, therefore pbm-files were used as fonts (they +need less space, even they contains much more characters).
  • + +
  • +All textelements added to the localisation (i18n). So strings like "GAME +OVER" or "READY!" could be translated into any language.
  • + +
  • +The documentation and programm now contains my brandnew email-address.
  • +
+ +

+Version 0.2.5 (June 20th, 1999)

+ +
    +
  • +Displaying of the hall of fame changed, hopefully this fix some rare bugs. +Use lower/raise- instead of former used hide/show-functions to switch display.
  • + +
  • +The file used for HighScore storage, will be set to worldwriteable (chmod +666) during installation. Thru this "normal" users could store their highscores +permanently.
  • + +
  • +Levels entended upto 13 (LevelPixmaps, Score), by the higher scores, the +fonts (for displaying the scored points) had to be extended too. The scores +could be variable (in the range from 10 to 9000, only the leading digit +can be not 0. exception 1600 ) now. The pixmap for the score could be larger +than the actual figure itself.
  • + +
  • +Because there is not enough room to show 13 levelsymbols in the statusline, +the position of the symbol can be specified by the LevelPosition +value(s).
  • + +
  • +The default-Speed of the monsters kept constant althrough higher levels, +requested by Gerald Williams.
  • + +
  • +Update-routines (display) optimized.
  • + +
  • +The documentation and programm now contains my new email-address.
  • +
+ +

+Version 0.2.4 (January 26th, 1999 - today linux v2.2 was released)

+ +
    +
  • +Added the hall of fame to store the highscores. For this, the structure +of the bitfonts was extented to contain furthermore characters, the special-characters +(small scores during the game) moved to the control-character-region and +the fonthandling was enhanced (FontFirstChar and FontLastChar can be stored +in the Configfile).
  • + +
  • +The size of the labels in the "Change Keys..."-dialog were set manually, +cause the autoResize-function in the qt-libs didn't work correctly in all +versions.
  • + +
  • +The menuitems are more sensitive to the actual availiable functions (disabled/enabled +and checked).
  • + +
  • +Now, also in the "MIDWAY (large)"-scheme the smoother font-smooth.xbm font +is used by default.
  • + +
  • +The files for the internationalization moved to represent the new standard +locations.
  • +
+ +

+Version 0.2.3a (January 15th, 1999)

+ +
    +
  • +Keyboard-routines changed to be compatible with the TDE 1.1 libraries (compiles +with 1.0 and 1.1).
  • + +
  • +A small bug fixed in tdepacman.cpp (CHECK_PTR( menuBar )).
  • +
+ +

+Version 0.2.3 (September 12th, 1998)

+ +
    +
  • +Slowed down the movement of the monsters in the prison, and fixed a bug +that kept the monsters moving slowly after the "harmless"-phase of the +monsters.
  • + +
  • +Added a new font "font-smooth" and smoothed the pixmap "wall.xpm" for the +Zacman-scheme.
  • + +
  • +Enhanced configuration of all timing-parameters using the configuration +file.
  • + +
  • +Changed Help-function (kapp->getHelpMenu) to reflect the TDE-Standard.
  • + +
  • +Improved the documentation (Many thanks to Andreas Pour).
  • +
+ +

+Version 0.2.2 (August 24th, 1998)

+ +
    +
  • +Localized the sources and added a German translation of the documentation.
  • + +
  • +Fixed bug so pixmaps and bitfonts could located correctly after using the +"Change keys..."-dialog.
  • + +
  • +Changed the location of the files (sources, pixmaps, docs etc.) to reflect +the recommeded structure of kapptemplate v0.1.
  • +
+ +

+Version 0.2.1 (August 18th, 1998)

+ +
    +
  • +Improved the timing (it's not perfect yet), and I hope Andreas Pour will +have more fun testing the next version.
  • + +
  • +Increased flexibility in handling the pixmaps.
  • +
+ +

+Version 0.2.0 (August 13th, 1998)

+ +
    +
  • +Added (preliminary) graphic scheme support.
  • +
+ +

+Version 0.1.1 (August 8th, 1998) 

+ +
    +
  • +First public release.
  • +
+ + + +
+
+
+ + + diff --git a/doc/en/tdepacman-2.html b/doc/en/tdepacman-2.html new file mode 100644 index 0000000..012cb4c --- /dev/null +++ b/doc/en/tdepacman-2.html @@ -0,0 +1,61 @@ + + + + + + + The TDEPacman Handbook: Installation + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + +
+ + +

+2. Installation

+ +

+2.1 How to obtain TDEPacman

+TDEPacman can be found on ftp://ftp.kde.org/pub/kde/unstable/latest/apps/games/, +the main ftp site of the TDE project.  +

+2.2 Requirements

+In order to compile TDEPacman successfully, you will need the version 1.0 +of the kde libraries or later and version 1.33 of the qt libraries or later. +Look for the version of the libraries appropriate for your system at ftp://ftp.kde.org/pub/kde/stable/latest/distribution/ +and  ftp://ftp.kde.org/pub/qt.  +

+2.3 Compilation and installation

+In order to compile and install TDEPacman on your system, type the following +in the base directory of the TDEPacman distribution:  +
+
% ./configure && make && make install
+
+Since TDEPacman uses autoconf you should have no trouble compiling +it. Should you run into any problems, please report them to the the author +at Jörg Thönnissen.  +
  + + +
+
+
+ + + diff --git a/doc/en/tdepacman-3.html b/doc/en/tdepacman-3.html new file mode 100644 index 0000000..065fd05 --- /dev/null +++ b/doc/en/tdepacman-3.html @@ -0,0 +1,564 @@ + + + + + + + The TDEPacman Handbook: Configuration + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + +
+ + +

+3. Configuration

+At this juncture all of TDEPacman's parameters cannot be configured graphically. +To change those parameters for an individual user you should edit the user's +TDEPacman configuration file (this file should be located at ~/.trinity/share/config/tdepacmanrc). +Alternatively, you can affect the default configuration of all users by +editing the global TDEPacman configuration file (this file should be located +at /opt/trinity/share/config/tdepacmanrc).  +

+3.1 Timings

+The parameters under the standardgroup heading [TDE Setup] listed +in the table below control the timing of the game.  Keys ending in +"MS" (e.g., "DyingAnimationMS") have their values expressed in milliseconds, +whereas Keys ending in "Ticks" have their values expressed in cycles.  +

Some values below are expressed as a comma-separated list of numbers, +each of which corresponds to a different level. Keys which have a default +value of more than one number or of a number followed by a comma may be +set for each level.  The first number in a list is used for the demonstration +level, and the following numbers are for the interactive game levels (the +second value is used for level 1, the third for level 2 and so on). The +maximum number of levels is defined by the value of the key "Levels".  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionDefault Value
SpeedMSDuration of a single cycle (a "Tick"), in milliseconds. All other timings +in the game are multiples of the single cycle duration.  Decreasing +the value speeds up the game and increasing the value slows down the game.20,
PacmanTicksNumber of cycles until the next move of the pacman.  Increasing +the value makes the pacman move slower and decreasing the value makes the +pacman move faster.3,
RemTicksNumber of cycles for a monster to return to prison after being eaten +by the pacman (the R.E.M. -- rapid eye movement -- phase).  Increasing +the value increases the time until a eaten monster returns to prison and +decreasing the value decreases the time until a monster returns to prison.1,
DangerousTicksNumber of cycles until the next move of the monsters when they are +dangerous and will eat the pacman.  Increasing the value makes the +monsters move slower and decreasing the value makes the monsters move faster.3,
HarmlessTicksNumber of cycles until the next move of the monsters when they are +harmless and can be eaten by the pacman.  Increasing the value makes +the monsters move slower and decreasing the value makes the monsters move +faster.7,6,,5,,4,
HarmlessDurationTicksNumber of cycles during which the monsters remain harmless and can +be eaten by the pacman after the pacman eats a switch.  Increasing +this value makes the monsters stay harmless longer and decreasing this +value makes the monsters return to being dangerous sooner.375,,,300,,250,200,150,
HarmlessWarningTicksNumber of cycles in which the user is warned of the upcoming end of +the harmless-phase by the monsters blinking. This value must be less at +each level than the corresponding "HarmlessDurationTicks".  Increasing +this value increases the length of the warning and decreasing this value +shortens the length of the warning.135,
ArrestTicksNumber of cycles until the next move of the monsters when they are +in prision.6,
ArrestDurationTicksNumber of cycles in which monsters remain in prison after being eaten. +This value will be multiplied by the id of the monster eaten ( 0 for first +monster eaten after the pacman eats a switch, 1 for the second, and so +on), so that the first monster will be freed immediatly and the other monsters +have to wait longer (by way of exception the second monster is also freed +immediatly during the initial stage of the game).  Increasing this +value increases the prison time of the monsters, and decreasing this value +frees the monsters sooner.200,,,150,
FruitAppearsTicksNumber of cycles between the appearence of fruit.  Increasing +this value causes fruit to appear less frequently and decreasing this value +causes fruit to appear more frequently.1000,,1500,2000,2500,  +
3000,3500,4000,
FruitDurationTicksNumber of cyles for which fruit remains.  Increasing this value +causes the fruit to be available for consumption longer and decreasing +this value causes the fruit to disappear sooner.500,,,400,350,300,,250,  +
200,150,
FruitScoreDurationTicksNumber of cycles for which the score for eating a fruit is displayed +after a fruit is eaten.150,
MonsterScoreDurationMSNumber of milliseconds for which the score for eating a monster is +displayed after a monster is eaten.1000
PlayerDurationMSNumber of milliseconds for displaying "PLAYER ONE" at the start of +the game. At the moment only one player is supported.3000
ReadyDurationMSNumber of milliseconds for displaying "READY!" at the start of the +game.2000
GameOverDurationMSNumber of milliseconds for displaying "GAME OVER" at the end of the +game.3000
AfterPauseMSNumber of milliseconds until play is resumed after cancelling a "Pause".1000
DyingPreAnimationMSNumber of milliseconds for which the monsters dance after catching +the pacman.1000
DyingAnimationMSNumber of milliseconds in which the scenes (other than the first and +last scenes) of the pacman's death are displayed after he is caught by +a monster.100
DyingPostAnimationMSNumber of milliseconds in which the first and last scenes of the pacman's +death are displayed after he is caught by a monster (this permits emphasis +of these scenes).500
IntroAnimationMSNumber of milliseconds between the scenes of the introduction.800
IntroPostAnimationMSNumber of milliseconds between the introduction and the beginning of +the demonstration.1000
LevelUpPreAnimationMSNumber of milliseconds between completing a level and the beginning +of the animation for the next level.2000
LevelUpAnimationMSNumber of milliseconds for which the animation for changing levels +is displayed.2000
MonsterIQThe intelligence of the monster (currently not fully implemented).  +Increasing the value makes the monsters more clever and decreasing the +value makes them dumber.0,170,180,170,180,  +
170,180,
LevelsNumber of different levels (without the demonstration).  If you +increase this value be sure all the parameters for that level are defined +above!13
HallOfFameMSThe hall of fame is displayed this amount of milliseconds.7000
CursorBlinkMSNumber of milliseconds the cursor, used for editing your name in the +hall of fame, keeps his states (on or off). The repeating of keystrokes +for scrolling (Key_Up and Key_Down) also depends of this value.250
+ +

If there are insufficient values in a list for the number of levels +(including the demonstration level), or if there is an invalid or missing +(e.g., ",,") in the list, then the previous (valid) value is used for that +position. If no valid values are listed, the value will be 0.  For +example "HarmlessTicks=7,6,,5,,4" is equivalent to "HarmlessTicks=7,6,6,5,5,4,4,4 +(if Levels=7)". That means 7 cycles for the demonstration, 6 cycles for +level 1 and so on.  +

+3.2 Points (Scoring)

+Scoring during the game is controlled by the following key/value-pairs +in the standardgroup [TDE Setup] (see the section Timings +for information on how to interpret comma-separated values):  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionDefault
PointScoreNumber of points awarded for eating a small point.10
SwitchScoreNumber of points awarded for eating a switch (the large points that +convert the monsters from hunters to the hunted!)50
FruitScoreNumber of points awarded for eating a fruit.100,300,500,,700,, +
1000,,2000,,3000,,5000,
MonsterScoreNumber of points awarded for eating a monster, with each point value +in the list being awarded for each successive monster eaten after eating +a switch (the values are reset if a new switch is eaten even if the prior +switch has not expired yet). Since there are four monsters you should include +four values.  Using the default values specified at right, 200 points +are awarded for eating the first monster, 400 for the second monster, and +so on.200,400,800,1600
ExtraLifeScoreNumber of points needed to earn another pacman life. 10000
+ +

+3.3 Graphic schemes

+The graphics schemes are controlled by the following two key/value-pairs +of the standardgroup [TDE Setup]:  +
  + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionExample
SchemeCountNumber of defined schemes. For every scheme a separate group with the +name [Scheme n] exists. n stands for a number between 0 and SchemeCount-1.3
SchemeSelected scheme. Possible values are between 0 and SchemeCount-1 (this +value can also be set using the game's menu).0
+ +

Each graphic scheme is defined in a seperate scheme-group using the +group designation [Scheme N], where N is the number of +the scheme being defined.  Each scheme-group may have the following +keys:  +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionExample
FontFilename of the xbm-font. Names without an absolute path (a leading +"/" or "~") are relative to $TDEDIR/share/apps/tdepacman/fonts.  +The structure of the fontfile will be explained in one of the next releases, +but you should be able to figure it out by opening one of the fontfiles +included with TDEPacman using a bitmap-editor.font.xbm
FontFirstCharDefines the numeric value of the first character in the bitfont.14
FontLastCharThe last character in the bitfont, is giving here by its numeric code. +If you extent the fonts by adding the lowercase characters, this value +must be changed.95
PixmapDirectoryDirectory in which the pixmap-files for the figures are located.  +Direcotry names without an absolute path (a leading "/" or "~") are relative +to $TDEDIR/share/apps/tdepacman/pics. The names of the individual +xpm-files are fixed in the code at the moment (this will be changed) and +are ''down.xpm" for an arrow pointing down, "fruit.xpm" for the series +of fruit for the various levels, "lifes.xpm" for the image to display at +the bottom of the screen for each pacman life remaining, "point.xpm" for +the small points which the pacman eats, "switch.xpm" for the switch points, +"dying.xpm" for the sequence of images for a dying pacman, "left.xpm" for +an arrow pointing left, "monster.xpm" for the various monsters, including +their appearance during the "switch" and "warning" cycles, "prison.xpm" +for a series of images put together to draw the prison walls, "up.xpm" +for , "eyes.xpm" for the series of eyes for the monsters when they move +up, down, right and left, respectively, "level.xpm" for the row of fruit +at the bottom of the screen indicating the current level, "pacman.xpm" +for the series of pacman images (gobbling and normal x moving up, down, +left and right), "right.xpm for a right arrow, and "wall.xpm" for a series +of images put together to draw the non-prison walls.tiny
DescriptionThe name of the scheme, which will be displayed in the menu "Select +Graphic Scheme". Use the '&'-character in front of a character in the +name to set the accelerator-key to that character (that means pressing +that key when the Select Graphic Scheme menu is down will select that scheme). +You may add a location tag to the key (e.g., Description[de] to indicate +that the description is in German).MIDWAY MFG.CO. (&tiny)
+ +

+3.4 Miscellaneous

+  + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionExample
LevelPositionDefines the position of the levelsymbols (fruits) on the statusline. +It is possible to show to different levels on the same position to save +room. The first position (rightmost) has the value 0.0,1,2,3,,4,,5,,6,7,
HighscoreFilePathSpecifies the path (directory and filename) to the "highscore"-file. +If only a directory (".../") is given, the default-filename ("highscore") +will be used./tmp/tdepacman.highscore
+ +
  + +
+ + + diff --git a/doc/en/tdepacman-4.html b/doc/en/tdepacman-4.html new file mode 100644 index 0000000..2feb5de --- /dev/null +++ b/doc/en/tdepacman-4.html @@ -0,0 +1,55 @@ + + + + + + + The TDEPacman Handbook: Copyright + + +  + + + + + + +
TDEPacmanTDEPacman +
Version 0.3.2
+ +
+ + + + + + + + +
+ + +

+4. Copyright

+TDEPacman Copyright (c) 1998-2003 Jörg Thönnissen, <joe@dsite.de> +

This program (including this documentation) is free software; you can +redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version.  +

This program is disttributed in the hope that it will be useful, but +without +any warranty; without even the implied warranty of merchantability +or fitness for a particular purpose. See the GNU General Public +License for more details.  +

You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +675 Mass Ave, Cabridge, MA 02139, USA.  +
  +

+ +
+
+
+ + + diff --git a/doc/en/tdepacman.gif b/doc/en/tdepacman.gif new file mode 100644 index 0000000..4fa3926 Binary files /dev/null and b/doc/en/tdepacman.gif differ diff --git a/doc/kpacman-api/Kpacman.html b/doc/kpacman-api/Kpacman.html deleted file mode 100644 index 5127d4b..0000000 --- a/doc/kpacman-api/Kpacman.html +++ /dev/null @@ -1,54 +0,0 @@ - - -class Kpacman - - - - - - - -
- - - -
-

class Kpacman

-
- * - This program is free software; you can redistribute it and/or modify * - it under the terms of the GNU General Public License as published by * - the Free Software Foundation; either version 2 of the License, or * - (at your option) any later version. More...
-
- - - - -
Definition#include <kpacman.h>
InheritsTQWidget (qt) [public ]
List of all Methods
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-

Public Methods


Detailed Description

- * - This program is free software; you can redistribute it and/or modify * - it under the terms of the GNU General Public License as published by * - the Free Software Foundation; either version 2 of the License, or * - (at your option) any later version. * - * -*************************************************************************

-
 Kpacman (TQWidget* parent=0, const char *name=0) -

Kpacman

 ~Kpacman () -

~Kpacman


- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/all-globals.html b/doc/kpacman-api/all-globals.html deleted file mode 100644 index a65f90c..0000000 --- a/doc/kpacman-api/all-globals.html +++ /dev/null @@ -1,34 +0,0 @@ - - - Globals - - - - - - - -
- - - -
-

Globals

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-

Global member Documentation

-
- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/full-list-Kpacman.html b/doc/kpacman-api/full-list-Kpacman.html deleted file mode 100644 index 12b336a..0000000 --- a/doc/kpacman-api/full-list-Kpacman.html +++ /dev/null @@ -1,238 +0,0 @@ - - -class Kpacman: All methods - - - - - - - -
- - - -
-

class Kpacman: All methods

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Kpacman - isEnabled
Kpacman::Kpacman
TQWidget::acceptDrops
TQWidget::adjustSize
TQWidget::autoMask
TQWidget::backgroundColor
TQWidget::backgroundColorChange
TQWidget::backgroundMode
TQWidget::backgroundOrigin
TQWidget::backgroundPixmap
TQWidget::backgroundPixmapChange
TQWidget::baseSize
TQWidget::caption
TQWidget::childrenRect
TQWidget::childrenRegion
TQWidget::clearFocus
TQWidget::clearMask
TQWidget::clearWFlags
TQWidget::clearWState
TQWidget::close
TQWidget::closeEvent
TQWidget::colorGroup
TQWidget::constPolish
TQWidget::create
TQWidget::cursor
TQWidget::customEvent
TQWidget::customWhatsThis
TQWidget::destroy
TQWidget::dragEnterEvent
TQWidget::dragLeaveEvent
TQWidget::dragMoveEvent
TQWidget::drawText
TQWidget::dropEvent
TQWidget::enabledChange
TQWidget::enterEvent
TQWidget::erase
TQWidget::event
TQWidget::extraData
TQWidget::find
TQWidget::focusData
TQWidget::focusInEvent
TQWidget::focusNextPrevChild
TQWidget::focusOutEvent
TQWidget::focusPolicy
TQWidget::focusProxy
TQWidget::focusWidget
TQWidget::font
TQWidget::fontChange
TQWidget::fontInfo
TQWidget::fontMetrics
TQWidget::fontPropagation
TQWidget::foregroundColor
TQWidget::frameGeometry
TQWidget::frameSize
TQWidget::geometry
TQWidget::getWFlags
TQWidget::getWState
TQWidget::grabKeyboard
TQWidget::grabMouse
TQWidget::hasFocus
TQWidget::hasMouseTracking
TQWidget::height
TQWidget::heightForWidth
TQWidget::hide
TQWidget::hideEvent
TQWidget::icon
TQWidget::iconText
TQWidget::isActiveWindow
TQWidget::isDesktop
TQWidget::isEnabled
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
isEnabledTo - setCRect
TQWidget::isEnabledTo
TQWidget::isEnabledToTLW
TQWidget::isFocusEnabled
TQWidget::isHidden
TQWidget::isMaximized
TQWidget::isMinimized
TQWidget::isModal
TQWidget::isPopup
TQWidget::isTopLevel
TQWidget::isUpdatesEnabled
TQWidget::isVisible
TQWidget::isVisibleTo
TQWidget::isVisibleToTLW
TQWidget::keyPressEvent
TQWidget::keyReleaseEvent
TQWidget::keyboardGrabber
TQWidget::layout
TQWidget::leaveEvent
TQWidget::lower
TQWidget::mapFrom
TQWidget::mapFromGlobal
TQWidget::mapFromParent
TQWidget::mapTo
TQWidget::mapToGlobal
TQWidget::mapToParent
TQWidget::maximumHeight
TQWidget::maximumSize
TQWidget::maximumWidth
TQWidget::metric
TQWidget::microFocusHint
TQWidget::minimumHeight
TQWidget::minimumSize
TQWidget::minimumSizeHint
TQWidget::minimumWidth
TQWidget::mouseDoubleClickEvent
TQWidget::mouseGrabber
TQWidget::mouseMoveEvent
TQWidget::mousePressEvent
TQWidget::mouseReleaseEvent
TQWidget::move
TQWidget::moveEvent
TQWidget::ownCursor
TQWidget::ownFont
TQWidget::ownPalette
TQWidget::paintEvent
TQWidget::palette
TQWidget::paletteChange
TQWidget::palettePropagation
TQWidget::parentWidget
TQWidget::polish
TQWidget::pos
TQWidget::raise
TQWidget::rect
TQWidget::releaseKeyboard
TQWidget::releaseMouse
TQWidget::repaint
TQWidget::reparent
TQWidget::resize
TQWidget::resizeEvent
TQWidget::scroll
TQWidget::setAcceptDrops
TQWidget::setActiveWindow
TQWidget::setAutoMask
TQWidget::setBackgroundColor
TQWidget::setBackgroundMode
TQWidget::setBackgroundOrigin
TQWidget::setBackgroundPixmap
TQWidget::setBaseSize
TQWidget::setCRect
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
setCaption - ~Kpacman
TQWidget::setCaption
TQWidget::setCursor
TQWidget::setDisabled
TQWidget::setEnabled
TQWidget::setFRect
TQWidget::setFixedHeight
TQWidget::setFixedSize
TQWidget::setFixedWidth
TQWidget::setFocus
TQWidget::setFocusPolicy
TQWidget::setFocusProxy
TQWidget::setFont
TQWidget::setFontPropagation
TQWidget::setGeometry
TQWidget::setIcon
TQWidget::setIconText
TQWidget::setKeyCompression
TQWidget::setMask
TQWidget::setMaximumHeight
TQWidget::setMaximumSize
TQWidget::setMaximumWidth
TQWidget::setMicroFocusHint
TQWidget::setMinimumHeight
TQWidget::setMinimumSize
TQWidget::setMinimumWidth
TQWidget::setMouseTracking
TQWidget::setName
TQWidget::setPalette
TQWidget::setPalettePropagation
TQWidget::setSizeIncrement
TQWidget::setSizePolicy
TQWidget::setStyle
TQWidget::setTabOrder
TQWidget::setUpdatesEnabled
TQWidget::setWFlags
TQWidget::setWState
TQWidget::show
TQWidget::showEvent
TQWidget::showFullScreen
TQWidget::showMaximized
TQWidget::showMinimized
TQWidget::showNormal
TQWidget::size
TQWidget::sizeHint
TQWidget::sizeIncrement
TQWidget::sizePolicy
TQWidget::stackUnder
TQWidget::style
TQWidget::styleChange
TQWidget::testWFlags
TQWidget::testWState
TQWidget::topData
TQWidget::topLevelWidget
TQWidget::unsetCursor
TQWidget::unsetFont
TQWidget::unsetPalette
TQWidget::update
TQWidget::updateGeometry
TQWidget::updateMask
TQWidget::visibleRect
TQWidget::wheelEvent
TQWidget::width
TQWidget::winId
TQWidget::wmapper
TQWidget::x
TQWidget::y
Kpacman::~Kpacman

- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/header-list.html b/doc/kpacman-api/header-list.html deleted file mode 100644 index c463cc9..0000000 --- a/doc/kpacman-api/header-list.html +++ /dev/null @@ -1,35 +0,0 @@ - - - File Index - - - - - - - -
- - - -
-

File Index

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-
-
kpacman.h - kpacman.h
kpacman.h
-
- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/hier.html b/doc/kpacman-api/hier.html deleted file mode 100644 index 2698a4a..0000000 --- a/doc/kpacman-api/hier.html +++ /dev/null @@ -1,37 +0,0 @@ - - - Class Hierarchy - - - - - - - -
- - - -
-

Class Hierarchy

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
- -
- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/index-long.html b/doc/kpacman-api/index-long.html deleted file mode 100644 index 6d2a179..0000000 --- a/doc/kpacman-api/index-long.html +++ /dev/null @@ -1,38 +0,0 @@ - - - Annotated List - - - - - - - -
- - - -
-

Annotated List

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-
Kpacman - * - This program is free software; you can redistribute it and/or modify * - it under the terms of the GNU General Public License as published by * - the Free Software Foundation; either version 2 of the License, or * - (at your option) any later version.

- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/index.html b/doc/kpacman-api/index.html deleted file mode 100644 index d90c367..0000000 --- a/doc/kpacman-api/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - Class Index - - - - - - - -
- - - -
-

Class Index

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-
-
Kpacman - Kpacman
Kpacman

- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/kpacman-api/kpacman_h.html b/doc/kpacman-api/kpacman_h.html deleted file mode 100644 index ecd4846..0000000 --- a/doc/kpacman-api/kpacman_h.html +++ /dev/null @@ -1,74 +0,0 @@ - - -Source: kpacman.h - - - - - - - -
- - - -
-

Source: kpacman.h

-
-
- - -
-
- - - - -
Annotated List
Files
Globals
Hierarchy
Index
-
-/***************************************************************************
-                          kpacman.h  -  description
-                             -------------------
-    begin                : Sam Jan 19 13:37:57 CET 2002
-    copyright            : (C) 1998-2003 by Jörg Thönnissen
-    email                : joe@dsite.de
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-
-#ifndef KPACMAN_H
-#define KPACMAN_H
-
-#ifdef HAVE_CONFIG_H
-#include 
-#endif
-
-#include 
-#include 
-
-/** Kpacman is the base class of the project */
-class Kpacman : public TQWidget
-{
-  Q_OBJECT 
-  public:
-    /** construtor */
-    Kpacman(TQWidget* parent=0, const char *name=0);
-    /** destructor */
-    ~Kpacman();
-};
-
-#endif
-
-
- - -
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
- - diff --git a/doc/man/kpacman.1 b/doc/man/kpacman.1 deleted file mode 100644 index 57476ca..0000000 --- a/doc/man/kpacman.1 +++ /dev/null @@ -1,42 +0,0 @@ -.TH kpacman 1 "August 20, 2020" -.SH NAME -kpacman \- A pacman clone game for TDE. -.SH SYNOPSIS -.B kpacman -.RI [Qt-options] [TDE-options] [URL] -.SH DESCRIPTION -Kpacman is a classic arcade game from the 80s in which you have -to finish the tables by eating all the pac-gums to score as many points -as possible. -.PP -.SH OPTIONS -.SS -.SS Generic Options: -.TP -.B --help -Show help about options -.TP -.B --help-qt -Show Qt specific options -.TP -.B --help-tde -Show TDE specific options -.TP -.B --help-all -Show all options -.TP -.B --author -Show author information -.TP -.B -v, --version -Show version information -.TP -.B --license -Show license information -.SS -.PP -.SH HOMEPAGE -Homepage: https://mirror.git.trinitydesktop.org/gitea/TDE/kpacman -.SH AUTHOR -This manual page was written by gregory guy , -for the Trinity Desktop Environment project (but may be used by others). diff --git a/doc/man/tdepacman.1 b/doc/man/tdepacman.1 new file mode 100644 index 0000000..6171a12 --- /dev/null +++ b/doc/man/tdepacman.1 @@ -0,0 +1,42 @@ +.TH tdepacman 1 "August 20, 2020" +.SH NAME +tdepacman \- A pacman clone game for TDE. +.SH SYNOPSIS +.B tdepacman +.RI [Qt-options] [TDE-options] [URL] +.SH DESCRIPTION +TDEpacman is a classic arcade game from the 80s in which you have +to finish the tables by eating all the pac-gums to score as many points +as possible. +.PP +.SH OPTIONS +.SS +.SS Generic Options: +.TP +.B --help +Show help about options +.TP +.B --help-qt +Show Qt specific options +.TP +.B --help-tde +Show TDE specific options +.TP +.B --help-all +Show all options +.TP +.B --author +Show author information +.TP +.B -v, --version +Show version information +.TP +.B --license +Show license information +.SS +.PP +.SH HOMEPAGE +Homepage: https://mirror.git.trinitydesktop.org/gitea/TDE/tdepacman +.SH AUTHOR +This manual page was written by gregory guy , +for the Trinity Desktop Environment project (but may be used by others). diff --git a/doc/tdepacman-api/TDEpacman.html b/doc/tdepacman-api/TDEpacman.html new file mode 100644 index 0000000..9ab446d --- /dev/null +++ b/doc/tdepacman-api/TDEpacman.html @@ -0,0 +1,54 @@ + + +class TDEpacman + + + + + + + +
+ + + +
+

class TDEpacman

+
+ * + This program is free software; you can redistribute it and/or modify * + it under the terms of the GNU General Public License as published by * + the Free Software Foundation; either version 2 of the License, or * + (at your option) any later version. More...
+
+ + + + +
Definition#include <tdepacman.h>
InheritsTQWidget (qt) [public ]
List of all Methods
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+

Public Methods


Detailed Description

+ * + This program is free software; you can redistribute it and/or modify * + it under the terms of the GNU General Public License as published by * + the Free Software Foundation; either version 2 of the License, or * + (at your option) any later version. * + * +*************************************************************************

+
 TDEpacman (TQWidget* parent=0, const char *name=0) +

TDEpacman

 ~TDEpacman () +

~TDEpacman


+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/all-globals.html b/doc/tdepacman-api/all-globals.html new file mode 100644 index 0000000..a65f90c --- /dev/null +++ b/doc/tdepacman-api/all-globals.html @@ -0,0 +1,34 @@ + + + Globals + + + + + + + +
+ + + +
+

Globals

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+

Global member Documentation

+
+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/full-list-TDEpacman.html b/doc/tdepacman-api/full-list-TDEpacman.html new file mode 100644 index 0000000..4aafbfb --- /dev/null +++ b/doc/tdepacman-api/full-list-TDEpacman.html @@ -0,0 +1,238 @@ + + +class TDEpacman: All methods + + + + + + + +
+ + + +
+

class TDEpacman: All methods

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TDEpacman - isEnabled
TDEpacman::TDEpacman
TQWidget::acceptDrops
TQWidget::adjustSize
TQWidget::autoMask
TQWidget::backgroundColor
TQWidget::backgroundColorChange
TQWidget::backgroundMode
TQWidget::backgroundOrigin
TQWidget::backgroundPixmap
TQWidget::backgroundPixmapChange
TQWidget::baseSize
TQWidget::caption
TQWidget::childrenRect
TQWidget::childrenRegion
TQWidget::clearFocus
TQWidget::clearMask
TQWidget::clearWFlags
TQWidget::clearWState
TQWidget::close
TQWidget::closeEvent
TQWidget::colorGroup
TQWidget::constPolish
TQWidget::create
TQWidget::cursor
TQWidget::customEvent
TQWidget::customWhatsThis
TQWidget::destroy
TQWidget::dragEnterEvent
TQWidget::dragLeaveEvent
TQWidget::dragMoveEvent
TQWidget::drawText
TQWidget::dropEvent
TQWidget::enabledChange
TQWidget::enterEvent
TQWidget::erase
TQWidget::event
TQWidget::extraData
TQWidget::find
TQWidget::focusData
TQWidget::focusInEvent
TQWidget::focusNextPrevChild
TQWidget::focusOutEvent
TQWidget::focusPolicy
TQWidget::focusProxy
TQWidget::focusWidget
TQWidget::font
TQWidget::fontChange
TQWidget::fontInfo
TQWidget::fontMetrics
TQWidget::fontPropagation
TQWidget::foregroundColor
TQWidget::frameGeometry
TQWidget::frameSize
TQWidget::geometry
TQWidget::getWFlags
TQWidget::getWState
TQWidget::grabKeyboard
TQWidget::grabMouse
TQWidget::hasFocus
TQWidget::hasMouseTracking
TQWidget::height
TQWidget::heightForWidth
TQWidget::hide
TQWidget::hideEvent
TQWidget::icon
TQWidget::iconText
TQWidget::isActiveWindow
TQWidget::isDesktop
TQWidget::isEnabled
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
isEnabledTo - setCRect
TQWidget::isEnabledTo
TQWidget::isEnabledToTLW
TQWidget::isFocusEnabled
TQWidget::isHidden
TQWidget::isMaximized
TQWidget::isMinimized
TQWidget::isModal
TQWidget::isPopup
TQWidget::isTopLevel
TQWidget::isUpdatesEnabled
TQWidget::isVisible
TQWidget::isVisibleTo
TQWidget::isVisibleToTLW
TQWidget::keyPressEvent
TQWidget::keyReleaseEvent
TQWidget::keyboardGrabber
TQWidget::layout
TQWidget::leaveEvent
TQWidget::lower
TQWidget::mapFrom
TQWidget::mapFromGlobal
TQWidget::mapFromParent
TQWidget::mapTo
TQWidget::mapToGlobal
TQWidget::mapToParent
TQWidget::maximumHeight
TQWidget::maximumSize
TQWidget::maximumWidth
TQWidget::metric
TQWidget::microFocusHint
TQWidget::minimumHeight
TQWidget::minimumSize
TQWidget::minimumSizeHint
TQWidget::minimumWidth
TQWidget::mouseDoubleClickEvent
TQWidget::mouseGrabber
TQWidget::mouseMoveEvent
TQWidget::mousePressEvent
TQWidget::mouseReleaseEvent
TQWidget::move
TQWidget::moveEvent
TQWidget::ownCursor
TQWidget::ownFont
TQWidget::ownPalette
TQWidget::paintEvent
TQWidget::palette
TQWidget::paletteChange
TQWidget::palettePropagation
TQWidget::parentWidget
TQWidget::polish
TQWidget::pos
TQWidget::raise
TQWidget::rect
TQWidget::releaseKeyboard
TQWidget::releaseMouse
TQWidget::repaint
TQWidget::reparent
TQWidget::resize
TQWidget::resizeEvent
TQWidget::scroll
TQWidget::setAcceptDrops
TQWidget::setActiveWindow
TQWidget::setAutoMask
TQWidget::setBackgroundColor
TQWidget::setBackgroundMode
TQWidget::setBackgroundOrigin
TQWidget::setBackgroundPixmap
TQWidget::setBaseSize
TQWidget::setCRect
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
setCaption - ~TDEpacman
TQWidget::setCaption
TQWidget::setCursor
TQWidget::setDisabled
TQWidget::setEnabled
TQWidget::setFRect
TQWidget::setFixedHeight
TQWidget::setFixedSize
TQWidget::setFixedWidth
TQWidget::setFocus
TQWidget::setFocusPolicy
TQWidget::setFocusProxy
TQWidget::setFont
TQWidget::setFontPropagation
TQWidget::setGeometry
TQWidget::setIcon
TQWidget::setIconText
TQWidget::setKeyCompression
TQWidget::setMask
TQWidget::setMaximumHeight
TQWidget::setMaximumSize
TQWidget::setMaximumWidth
TQWidget::setMicroFocusHint
TQWidget::setMinimumHeight
TQWidget::setMinimumSize
TQWidget::setMinimumWidth
TQWidget::setMouseTracking
TQWidget::setName
TQWidget::setPalette
TQWidget::setPalettePropagation
TQWidget::setSizeIncrement
TQWidget::setSizePolicy
TQWidget::setStyle
TQWidget::setTabOrder
TQWidget::setUpdatesEnabled
TQWidget::setWFlags
TQWidget::setWState
TQWidget::show
TQWidget::showEvent
TQWidget::showFullScreen
TQWidget::showMaximized
TQWidget::showMinimized
TQWidget::showNormal
TQWidget::size
TQWidget::sizeHint
TQWidget::sizeIncrement
TQWidget::sizePolicy
TQWidget::stackUnder
TQWidget::style
TQWidget::styleChange
TQWidget::testWFlags
TQWidget::testWState
TQWidget::topData
TQWidget::topLevelWidget
TQWidget::unsetCursor
TQWidget::unsetFont
TQWidget::unsetPalette
TQWidget::update
TQWidget::updateGeometry
TQWidget::updateMask
TQWidget::visibleRect
TQWidget::wheelEvent
TQWidget::width
TQWidget::winId
TQWidget::wmapper
TQWidget::x
TQWidget::y
TDEpacman::~TDEpacman

+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/header-list.html b/doc/tdepacman-api/header-list.html new file mode 100644 index 0000000..041d5cf --- /dev/null +++ b/doc/tdepacman-api/header-list.html @@ -0,0 +1,35 @@ + + + File Index + + + + + + + +
+ + + +
+

File Index

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+
+
tdepacman.h - tdepacman.h
tdepacman.h
+
+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/hier.html b/doc/tdepacman-api/hier.html new file mode 100644 index 0000000..54561c5 --- /dev/null +++ b/doc/tdepacman-api/hier.html @@ -0,0 +1,37 @@ + + + Class Hierarchy + + + + + + + +
+ + + +
+

Class Hierarchy

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+ +
+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/index-long.html b/doc/tdepacman-api/index-long.html new file mode 100644 index 0000000..6b03674 --- /dev/null +++ b/doc/tdepacman-api/index-long.html @@ -0,0 +1,38 @@ + + + Annotated List + + + + + + + +
+ + + +
+

Annotated List

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+
TDEpacman + * + This program is free software; you can redistribute it and/or modify * + it under the terms of the GNU General Public License as published by * + the Free Software Foundation; either version 2 of the License, or * + (at your option) any later version.

+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/index.html b/doc/tdepacman-api/index.html new file mode 100644 index 0000000..f4e03d6 --- /dev/null +++ b/doc/tdepacman-api/index.html @@ -0,0 +1,34 @@ + + + Class Index + + + + + + + +
+ + + +
+

Class Index

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+
+
TDEpacman - TDEpacman
TDEpacman

+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/doc/tdepacman-api/tdepacman_h.html b/doc/tdepacman-api/tdepacman_h.html new file mode 100644 index 0000000..b8368f0 --- /dev/null +++ b/doc/tdepacman-api/tdepacman_h.html @@ -0,0 +1,74 @@ + + +Source: tdepacman.h + + + + + + + +
+ + + +
+

Source: tdepacman.h

+
+
+ + +
+
+ + + + +
Annotated List
Files
Globals
Hierarchy
Index
+
+/***************************************************************************
+                          tdepacman.h  -  description
+                             -------------------
+    begin                : Sam Jan 19 13:37:57 CET 2002
+    copyright            : (C) 1998-2003 by Jörg Thönnissen
+    email                : joe@dsite.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef TDEPACMAN_H
+#define TDEPACMAN_H
+
+#ifdef HAVE_CONFIG_H
+#include 
+#endif
+
+#include 
+#include 
+
+/** TDEpacman is the base class of the project */
+class TDEpacman : public TQWidget
+{
+  Q_OBJECT 
+  public:
+    /** construtor */
+    TDEpacman(TQWidget* parent=0, const char *name=0);
+    /** destructor */
+    ~TDEpacman();
+};
+
+#endif
+
+
+ + +
Generated by: jth on tim on Sat Jan 19 13:38:55 2002, using kdoc 2.0a53.
+ + diff --git a/kpacman.kdevprj b/kpacman.kdevprj deleted file mode 100644 index 1c1ea9c..0000000 --- a/kpacman.kdevprj +++ /dev/null @@ -1,993 +0,0 @@ -[AUTHORS] -dist=true -install=false -install_location= -type=DATA - -[COPYING] -dist=true -install=false -install_location= -type=DATA - -[ChangeLog] -dist=true -install=false -install_location= -type=DATA - -[Config for BinMakefileAm] -addcxxflags= -bin_program=kpacman -cxxflags=\s-O0 -g3 -Wall -ldadd=-ltdegames $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_QT) -ldflags= - -[General] -AMChanged=true -author=Jörg Thönnissen -configure_args=--prefix /opt/kde3 -email=joe@dsite.de -kdevprj_version=1.3 -lfv_open_groups=Andere,Header,Quellen -make_options=\s-j1 -makefiles=Makefile.am,kpacman/Makefile.am,doc/Makefile.am,doc/en/Makefile.am,po/Makefile.am,fonts/Makefile.am,maps/mspacman/Makefile.am,maps/Makefile.am,pics/Makefile.am,pics/mspacman/Makefile.am,pics/mspacman-tiny/Makefile.am,pics/tiny/Makefile.am,pics/zacman/Makefile.am,doc/de/Makefile.am -modifyMakefiles=true -project_name=Kpacman -project_type=mini_kde2 -sgml_file=/home/jth/src/kde/kpacman-0.3.1/doc/en/index.docbook -short_info= -sub_dir=kpacman/ -version=0.3.2 -version_control=None -workspace=1 - -[INSTALL] -dist=true -install=false -install_location= -type=DATA - -[KPP] -kpp_appgrp= -kpp_bldroot= -kpp_icon=0 -kpp_license=5 -kpp_summary= -kpp_url= -kpp_version=0.3.1 - -[LFV Groups] -Andere=* -Benutzerschnittstelle=*.kdevdlg,*.ui,*.rc -GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS -Header=*.h,*.hh,*.hxx,*.hpp,*.H -Quellen=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l -groups=Header,Quellen,Benutzerschnittstelle,Ãœbersetzungen,GNU,Andere -Ãœbersetzungen=*.po - -[Makefile.am] -files=kpacman.kdevprj,admin,AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,kpacman.lsm -sub_dirs=kpacman,po,doc,fonts,maps,pics -type=normal - -[README] -dist=true -install=false -install_location= -type=DATA - -[TODO] -dist=true -install=false -install_location= -type=DATA - -[admin] -dist=true -install=false -install_location= -type=DATA - -[doc/Makefile.am] -sub_dirs=en,de -type=normal - -[doc/de/Makefile.am] -files=doc/de/index.html,doc/de/kpacman-1.html,doc/de/kpacman-2.html,doc/de/kpacman-3.html,doc/de/kpacman-4.html,doc/de/kpacman.gif -sub_dirs= -type=normal - -[doc/de/index.html] -dist=true -install=false -install_location= -type=DATA - -[doc/de/kpacman-1.html] -dist=true -install=false -install_location= -type=DATA - -[doc/de/kpacman-2.html] -dist=true -install=false -install_location= -type=DATA - -[doc/de/kpacman-3.html] -dist=true -install=false -install_location= -type=DATA - -[doc/de/kpacman-4.html] -dist=true -install=false -install_location= -type=DATA - -[doc/de/kpacman.gif] -dist=true -install=false -install_location= -type=DATA - -[doc/en/Makefile.am] -files=doc/en/index.docbook,doc/en/index.html,doc/en/kpacman-1.html,doc/en/kpacman-2.html,doc/en/kpacman-3.html,doc/en/kpacman-4.html,doc/en/kpacman.gif -sub_dirs= -type=normal - -[doc/en/index.docbook] -dist=true -install=false -install_location=$$(kde_icondir)/locolor/16x16/apps/kpacman.png -type=DATA - -[doc/en/index.html] -dist=true -install=false -install_location= -type=DATA - -[doc/en/kpacman-1.html] -dist=true -install=false -install_location= -type=DATA - -[doc/en/kpacman-2.html] -dist=true -install=false -install_location= -type=DATA - -[doc/en/kpacman-3.html] -dist=true -install=false -install_location= -type=DATA - -[doc/en/kpacman-4.html] -dist=true -install=false -install_location= -type=DATA - -[doc/en/kpacman.gif] -dist=true -install=false -install_location= -type=DATA - -[fonts/Makefile.am] -files=fonts/font-small.pbm,fonts/font-smooth.pbm,fonts/font.pbm -sub_dirs= -type=normal - -[fonts/font-small.pbm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/fonts/font-small.pbm -type=DATA - -[fonts/font-smooth.pbm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/fonts/font-smooth.pbm -type=DATA - -[fonts/font.pbm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/fonts/font.pbm -type=DATA - -[kpacman.kdevprj] -dist=true -install=false -install_location= -type=DATA - -[kpacman.lsm] -dist=true -install=false -install_location= -type=DATA - -[kpacman/Makefile.am] -files=kpacman/main.cpp,kpacman/kpacman.cpp,kpacman/kpacman.h,kpacman/kpacman.desktop,kpacman/lo32-app-kpacman.png,kpacman/lo16-app-kpacman.png,kpacman/bitfont.cpp,kpacman/bitfont.h,kpacman/colors.h,kpacman/bitmaps.h,kpacman/board.cpp,kpacman/board.h,kpacman/energizer.cpp,kpacman/energizer.h,kpacman/fruit.cpp,kpacman/fruit.h,kpacman/keys.cpp,kpacman/keys.h,kpacman/monster.cpp,kpacman/monster.h,kpacman/pacman.cpp,kpacman/pacman.h,kpacman/score.cpp,kpacman/score.h,kpacman/painter.cpp,kpacman/painter.h,kpacman/status.cpp,kpacman/status.h,kpacman/referee.cpp,kpacman/referee.h,kpacman/kpacmanrc,kpacman/kpacmanview.h,kpacman/kpacmanview.cpp,kpacman/kpacmanui.rc,kpacman/hi16-app-kpacman.png,kpacman/hi32-app-kpacman.png -sub_dirs= -type=prog_main - -[kpacman/bitfont.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/bitfont.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/bitmaps.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/board.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/board.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/colors.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/energizer.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/energizer.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/fruit.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/fruit.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/hi16-app-kpacman.png] -dist=true -install=true -install_location=$$(kde_icondir)/hicolor/16x16/apps/kpacman.png -type=DATA - -[kpacman/hi32-app-kpacman.png] -dist=true -install=true -install_location=$$(kde_icondir)/hicolor/32x32/apps/kpacman.png -type=DATA - -[kpacman/keys.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/keys.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/kpacman.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/kpacman.desktop] -dist=true -install=true -install_location=$$(kde_appsdir)/Games/kpacman.desktop -type=DATA - -[kpacman/kpacman.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/kpacmanrc] -dist=true -install=true -install_location=$$(kde_confdir)/kpacmanrc -type=DATA - -[kpacman/kpacmanui.rc] -dist=true -install=false -install_location= -type=DATA - -[kpacman/kpacmanview.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/kpacmanview.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/lo16-app-kpacman.png] -dist=true -install=true -install_location=$$(kde_icondir)/locolor/16x16/apps/kpacman.png -type=DATA - -[kpacman/lo32-app-kpacman.png] -dist=true -install=true -install_location=$$(kde_icondir)/locolor/32x32/apps/kpacman.png -type=DATA - -[kpacman/main.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/monster.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/monster.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/pacman.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/pacman.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/painter.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/painter.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/referee.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/referee.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/score.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/score.h] -dist=true -install=false -install_location= -type=HEADER - -[kpacman/status.cpp] -dist=true -install=false -install_location= -type=SOURCE - -[kpacman/status.h] -dist=true -install=false -install_location= -type=HEADER - -[maps/Makefile.am] -sub_dirs=mspacman -type=normal - -[maps/mspacman/Makefile.am] -files=maps/mspacman/map01,maps/mspacman/map02,maps/mspacman/map03,maps/mspacman/map04 -sub_dirs= -type=normal - -[maps/mspacman/map01] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/maps/mspacman/map01 -type=DATA - -[maps/mspacman/map02] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/maps/mspacman/map02 -type=DATA - -[maps/mspacman/map03] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/maps/mspacman/map03 -type=DATA - -[maps/mspacman/map04] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/maps/mspacman/map04 -type=DATA - -[pics/Makefile.am] -files=pics/down.xpm,pics/dying.xpm,pics/eyes.xpm,pics/fruit.xpm,pics/left.xpm,pics/lifes.xpm,pics/monster.xpm,pics/pacman.xpm,pics/point.xpm,pics/prison.xpm,pics/right.xpm,pics/switch.xpm,pics/up.xpm,pics/wall.xpm -sub_dirs=mspacman,mspacman-tiny,tiny,zacman -type=normal - -[pics/down.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/down.xpm -type=DATA - -[pics/dying.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/dying.xpm -type=DATA - -[pics/eyes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/eyes.xpm -type=DATA - -[pics/fruit.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/fruit.xpm -type=DATA - -[pics/left.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/left.xpm -type=DATA - -[pics/lifes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/lifes.xpm -type=DATA - -[pics/monster.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/monster.xpm -type=DATA - -[pics/mspacman-tiny/Makefile.am] -files=pics/mspacman-tiny/dying.xpm,pics/mspacman-tiny/fruit.xpm,pics/mspacman-tiny/fruitscore.xpm,pics/mspacman-tiny/lifes.xpm,pics/mspacman-tiny/pacman.xpm,pics/mspacman-tiny/point.xpm,pics/mspacman-tiny/point02.xpm,pics/mspacman-tiny/point03.xpm,pics/mspacman-tiny/prison.xpm,pics/mspacman-tiny/prison02.xpm,pics/mspacman-tiny/prison03.xpm,pics/mspacman-tiny/prison04.xpm,pics/mspacman-tiny/prison05.xpm,pics/mspacman-tiny/prison06.xpm,pics/mspacman-tiny/switch.xpm,pics/mspacman-tiny/switch02.xpm,pics/mspacman-tiny/switch03.xpm,pics/mspacman-tiny/wall.xpm,pics/mspacman-tiny/wall02.xpm,pics/mspacman-tiny/wall03.xpm,pics/mspacman-tiny/wall04.xpm,pics/mspacman-tiny/wall05.xpm,pics/mspacman-tiny/wall06.xpm -sub_dirs= -type=normal - -[pics/mspacman-tiny/dying.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/dying.xpm -type=DATA - -[pics/mspacman-tiny/fruit.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/fruit.xpm -type=DATA - -[pics/mspacman-tiny/fruitscore.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/fruitscore.xpm -type=DATA - -[pics/mspacman-tiny/lifes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/lifes.xpm -type=DATA - -[pics/mspacman-tiny/pacman.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/pacman.xpm -type=DATA - -[pics/mspacman-tiny/point.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/point.xpm -type=DATA - -[pics/mspacman-tiny/point02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/point02.xpm -type=DATA - -[pics/mspacman-tiny/point03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/point03.xpm -type=DATA - -[pics/mspacman-tiny/prison.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison.xpm -type=DATA - -[pics/mspacman-tiny/prison02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison02.xpm -type=DATA - -[pics/mspacman-tiny/prison03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison03.xpm -type=DATA - -[pics/mspacman-tiny/prison04.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison04.xpm -type=DATA - -[pics/mspacman-tiny/prison05.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison05.xpm -type=DATA - -[pics/mspacman-tiny/prison06.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/prison06.xpm -type=DATA - -[pics/mspacman-tiny/switch.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/switch.xpm -type=DATA - -[pics/mspacman-tiny/switch02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/switch02.xpm -type=DATA - -[pics/mspacman-tiny/switch03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/switch03.xpm -type=DATA - -[pics/mspacman-tiny/wall.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall.xpm -type=DATA - -[pics/mspacman-tiny/wall02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall02.xpm -type=DATA - -[pics/mspacman-tiny/wall03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall03.xpm -type=DATA - -[pics/mspacman-tiny/wall04.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall04.xpm -type=DATA - -[pics/mspacman-tiny/wall05.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall05.xpm -type=DATA - -[pics/mspacman-tiny/wall06.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman-tiny/wall06.xpm -type=DATA - -[pics/mspacman/Makefile.am] -files=pics/mspacman/dying.xpm,pics/mspacman/fruit.xpm,pics/mspacman/fruitscore.xpm,pics/mspacman/lifes.xpm,pics/mspacman/pacman.xpm,pics/mspacman/point.xpm,pics/mspacman/point02.xpm,pics/mspacman/point03.xpm,pics/mspacman/prison.xpm,pics/mspacman/prison02.xpm,pics/mspacman/prison03.xpm,pics/mspacman/prison04.xpm,pics/mspacman/prison05.xpm,pics/mspacman/prison06.xpm,pics/mspacman/switch.xpm,pics/mspacman/switch02.xpm,pics/mspacman/switch03.xpm,pics/mspacman/wall.xpm,pics/mspacman/wall02.xpm,pics/mspacman/wall03.xpm,pics/mspacman/wall04.xpm,pics/mspacman/wall05.xpm,pics/mspacman/wall06.xpm -sub_dirs= -type=normal - -[pics/mspacman/dying.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/dying.xpm -type=DATA - -[pics/mspacman/fruit.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/fruit.xpm -type=DATA - -[pics/mspacman/fruitscore.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/fruitscore.xpm -type=DATA - -[pics/mspacman/lifes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/lifes.xpm -type=DATA - -[pics/mspacman/pacman.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/pacman.xpm -type=DATA - -[pics/mspacman/point.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/point.xpm -type=DATA - -[pics/mspacman/point02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/point02.xpm -type=DATA - -[pics/mspacman/point03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/point03.xpm -type=DATA - -[pics/mspacman/prison.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison.xpm -type=DATA - -[pics/mspacman/prison02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison02.xpm -type=DATA - -[pics/mspacman/prison03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison03.xpm -type=DATA - -[pics/mspacman/prison04.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison04.xpm -type=DATA - -[pics/mspacman/prison05.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison05.xpm -type=DATA - -[pics/mspacman/prison06.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/prison06.xpm -type=DATA - -[pics/mspacman/switch.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/switch.xpm -type=DATA - -[pics/mspacman/switch02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/switch02.xpm -type=DATA - -[pics/mspacman/switch03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/switch03.xpm -type=DATA - -[pics/mspacman/wall.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall.xpm -type=DATA - -[pics/mspacman/wall02.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall02.xpm -type=DATA - -[pics/mspacman/wall03.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall03.xpm -type=DATA - -[pics/mspacman/wall04.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall04.xpm -type=DATA - -[pics/mspacman/wall05.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall05.xpm -type=DATA - -[pics/mspacman/wall06.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/mspacman/wall06.xpm -type=DATA - -[pics/pacman.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/pacman.xpm -type=DATA - -[pics/point.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/point.xpm -type=DATA - -[pics/prison.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/prison.xpm -type=DATA - -[pics/right.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/right.xpm -type=DATA - -[pics/switch.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/switch.xpm -type=DATA - -[pics/tiny/Makefile.am] -files=pics/tiny/dying.xpm,pics/tiny/eyes.xpm,pics/tiny/fruit.xpm,pics/tiny/lifes.xpm,pics/tiny/monster.xpm,pics/tiny/pacman.xpm,pics/tiny/point.xpm,pics/tiny/prison.xpm,pics/tiny/switch.xpm,pics/tiny/wall.xpm -sub_dirs= -type=normal - -[pics/tiny/dying.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/dying.xpm -type=DATA - -[pics/tiny/eyes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/eyes.xpm -type=DATA - -[pics/tiny/fruit.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/fruit.xpm -type=DATA - -[pics/tiny/lifes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/lifes.xpm -type=DATA - -[pics/tiny/monster.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/monster.xpm -type=DATA - -[pics/tiny/pacman.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/pacman.xpm -type=DATA - -[pics/tiny/point.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/point.xpm -type=DATA - -[pics/tiny/prison.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/prison.xpm -type=DATA - -[pics/tiny/switch.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/switch.xpm -type=DATA - -[pics/tiny/wall.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/tiny/wall.xpm -type=DATA - -[pics/up.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/up.xpm -type=DATA - -[pics/wall.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/wall.xpm -type=DATA - -[pics/zacman/Makefile.am] -files=pics/zacman/dying.xpm,pics/zacman/eyes.xpm,pics/zacman/lifes.xpm,pics/zacman/monster.xpm,pics/zacman/pacman.xpm,pics/zacman/point.xpm,pics/zacman/switch.xpm,pics/zacman/wall.xpm -sub_dirs= -type=normal - -[pics/zacman/dying.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/dying.xpm -type=DATA - -[pics/zacman/eyes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/eyes.xpm -type=DATA - -[pics/zacman/lifes.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/lifes.xpm -type=DATA - -[pics/zacman/monster.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/monster.xpm -type=DATA - -[pics/zacman/pacman.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/pacman.xpm -type=DATA - -[pics/zacman/point.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/point.xpm -type=DATA - -[pics/zacman/switch.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/switch.xpm -type=DATA - -[pics/zacman/wall.xpm] -dist=true -install=true -install_location=$$(kde_datadir)/kpacman/pics/zacman/wall.xpm -type=DATA - -[po/Makefile.am] -files=po/de.po,po/pt.po,po/sv.po,po/es.po -sub_dirs= -type=po - -[po/de.po] -dist=false -install=false -install_location= -type=PO - -[po/es.po] -dist=false -install=false -install_location= -type=PO - -[po/pt.po] -dist=false -install=false -install_location= -type=PO - -[po/sv.po] -dist=false -install=false -install_location= -type=PO diff --git a/kpacman.kdevses b/kpacman.kdevses deleted file mode 100644 index 650fb88..0000000 --- a/kpacman.kdevses +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Default) - diff --git a/kpacman.lsm b/kpacman.lsm deleted file mode 100644 index 6a57c7d..0000000 --- a/kpacman.lsm +++ /dev/null @@ -1,14 +0,0 @@ -Begin3 -Title: Kpacman -Version: 0.3.2 -Entered-date: 30JUN2003 -Description: Pacman game for the KDE -Keywords: Pacmac Game KDE Qt -Author: Jörg Thönnissen -Maintained-by: Jörg Thönnissen -Primary-site: http://sourceforge.net/projects/kpacman/ -Home-page: http://kpacman.sourceforge.net/ -Original-site: -Platforms: Linux and other Unices -Copying-policy: GNU Public License -End diff --git a/kpacman/CMakeL10n.txt b/kpacman/CMakeL10n.txt deleted file mode 100644 index e42ac1c..0000000 --- a/kpacman/CMakeL10n.txt +++ /dev/null @@ -1,8 +0,0 @@ -##### create translation templates ############## - -tde_l10n_create_template( "messages/kpacman" ) - -tde_l10n_create_template( - CATALOG "desktop_files/kpacman.desktop/" - SOURCES kpacman.desktop -) diff --git a/kpacman/CMakeLists.txt b/kpacman/CMakeLists.txt deleted file mode 100644 index c4dae7a..0000000 --- a/kpacman/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} - ${TDEGAMES_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} - ${TDE_LIB_DIR} - ${TDEGAMES_LIBRARY_DIRS} -) - - -##### kpacman (executable) - -tde_add_executable( ${PROJECT_NAME} AUTOMOC - - SOURCES - kpacmanview.cpp - referee.cpp - status.cpp - painter.cpp - score.cpp - pacman.cpp - monster.cpp - keys.cpp - fruit.cpp - energizer.cpp - board.cpp - bitfont.cpp - kpacman.cpp - main.cpp - LINK - tdeui-shared - tdecore-shared - ${TDEGAMES_LIBRARIES} - - DESTINATION ${BIN_INSTALL_DIR} -) - - -##### other data - -install( - FILES kpacmanui.rc - DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} -) - -install( - FILES kpacmanrc - DESTINATION ${CONFIG_INSTALL_DIR} -) - - -tde_create_translated_desktop( ${PROJECT_NAME}.desktop ) - - -##### icons - -tde_install_icons( ${PROJECT_NAME} ) diff --git a/kpacman/bitfont.cpp b/kpacman/bitfont.cpp deleted file mode 100644 index f1535fb..0000000 --- a/kpacman/bitfont.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "bitfont.h" - -Bitfont::Bitfont(TQString fontname, uchar firstChar, uchar lastChar) -{ - if (!fontname.isEmpty()) - font.load(fontname); - if (font.width() == font.height()) { - fontWidth = fontHeight = font.width() / 16; - fontFirstChar = 1; - fontLastChar = 255; - } else { - fontWidth = font.width()/(lastChar-firstChar+1); - fontHeight = font.height(); - fontFirstChar = firstChar; - fontLastChar = lastChar; - } -} - -TQRect Bitfont::rect(TQString str) -{ - return TQRect(0, 0, str.length()*fontWidth, fontHeight); -} - -TQPixmap Bitfont::text(TQString str, TQColor fg, TQColor bg) -{ - TQPixmap FG(str.length()*fontWidth, fontHeight); - TQBitmap MASK(str.length()*fontWidth, fontHeight, TRUE); - - const uchar *s = reinterpret_cast(str.latin1()); - for (uint i = 0; i < str.length(); i++) { - if (font.width() == font.height()) - bitBlt(&MASK, i*fontWidth, 0, &font, - (*s%16)*fontWidth, (*s/16)*fontWidth, fontWidth, fontHeight); - else - if (*s >= fontFirstChar && *s <= fontLastChar) - bitBlt(&MASK, i*fontWidth, 0, &font, - (*s-fontFirstChar)*fontWidth, 0, fontWidth, fontHeight); - s++; - } - - FG.fill(fg); - FG.setMask(MASK); - - if (bg.isValid()) { - TQPixmap BG(str.length()*fontWidth, fontHeight); - BG.fill(bg); - bitBlt(&BG, 0, 0, &FG); - return BG; - } else - return FG; -} - -uchar Bitfont::firstChar() -{ - return fontFirstChar; -} - -uchar Bitfont::lastChar() -{ - return fontLastChar; -} - -int Bitfont::width() -{ - return fontWidth; -} - -int Bitfont::height() -{ - return fontHeight; -} diff --git a/kpacman/bitfont.h b/kpacman/bitfont.h deleted file mode 100644 index 029383e..0000000 --- a/kpacman/bitfont.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef BITFONT_H -#define BITFONT_H - -#include -#include -#include -#include - -#include "colors.h" - -class Bitfont -{ -public: - Bitfont(TQString fontname, uchar firstChar, uchar lastChar); - - TQPixmap text(TQString str, TQColor fg = BLACK, TQColor bg = TQColor()); - TQRect rect(TQString str); - int width(); - int height(); - uchar firstChar(); - uchar lastChar(); -private: - TQBitmap font; - int fontWidth; - int fontHeight; - uchar fontFirstChar; - uchar fontLastChar; -}; - -#endif // BITFONT_H diff --git a/kpacman/bitmaps.h b/kpacman/bitmaps.h deleted file mode 100644 index f430384..0000000 --- a/kpacman/bitmaps.h +++ /dev/null @@ -1,67 +0,0 @@ -static unsigned char demo_bits[] = { - "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - "++*******************************************************++" - "+*********************************************************+" - "+** *** **+" - "+** . . . . . . . . . . . . *** . . . . . . . . . . . . **+" - "+** *** **+" - "+** . ******* . ********* . *** . ********* . ******* . **+" - "+** ******* ********* *** ********* ******* **+" - "+** o ******* . ********* . *** . ********* . ******* o **+" - "+** ******* ********* *** ********* ******* **+" - "+** . ******* . ********* . *** . ********* . ******* . **+" - "+** **+" - "+** . . . . . . . . . . . . . . . . . . . . . . . . . . **+" - "+** **+" - "+** . ******* . *** . *************** . *** . ******* . **+" - "+** ******* *** *************** *** ******* **+" - "+** . ******* . *** . *************** . *** . ******* . **+" - "+** *** *** *** **+" - "+** . . . . . . *** . . . . *** . . . . *** . . . . . . **+" - "+** *** *** *** **+" - "+************ . ********* *** ********* . ************+" - "++*********** ********* *** ********* ***********++" - "+++++++++++** . ********* *** ********* . **+++++++++++" - "+++++++++++** *** *** **+++++++++++" - "+++++++++++** . *** 0 *** . **+++++++++++" - "+++++++++++** *** *** **+++++++++++" - "+++++++++++** . *** ######---###### *** . **+++++++++++" - "+************ *** ######---###### *** ************+" - "+************ . *** ## ## *** . ************+" - " ## ## " - " . ## 2 1 3 ## . " - " ## ## " - "+************ . *** ## ## *** . ************+" - "+************ *** ############### *** ************+" - "+++++++++++** . *** ############### *** . **+++++++++++" - "+++++++++++** *** *** **+++++++++++" - "+++++++++++** . *** F *** . **+++++++++++" - "+++++++++++** *** *** **+++++++++++" - "+++++++++++** . *** *************** *** . **+++++++++++" - "++*********** *** *************** *** ***********++" - "+************ . *** *************** *** . ************+" - "+** *** **+" - "+** . . . . . . . . . . . . *** . . . . . . . . . . . . **+" - "+** *** **+" - "+** . ******* . ********* . *** . ********* . ******* . **+" - "+** ******* ********* *** ********* ******* **+" - "+** . ******* . ********* . *** . ********* . ******* . **+" - "+** *** *** **+" - "+** o . . *** . . . . . . . P . . . . . . . *** . . o **+" - "+** *** *** **+" - "+****** . *** . *** . *************** . *** . *** . ******+" - "+****** *** *** *************** *** *** ******+" - "+****** . *** . *** . *************** . *** . *** . ******+" - "+** *** *** *** **+" - "+** . . . . . . *** . . . . *** . . . . *** . . . . . . **+" - "+** *** *** *** **+" - "+** . ******************* . *** . ******************* . **+" - "+** ******************* *** ******************* **+" - "+** . ******************* . *** . ******************* . **+" - "+** **+" - "+** . . . . . . . . . . . . . . . . . . . . . . . . . . **+" - "+** **+" - "+*********************************************************+" - "++*******************************************************++" - "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" -}; diff --git a/kpacman/board.cpp b/kpacman/board.cpp deleted file mode 100644 index 621a086..0000000 --- a/kpacman/board.cpp +++ /dev/null @@ -1,421 +0,0 @@ -#include - -#include - -#include -#include -#include -#include -#include - -#include "board.h" -#include "bitmaps.h" - -Board::Board(int size) : TQMemArray (size) -{ - sz = size; // set size of board - - map = ""; - mapName = ""; // no map loaded so far - - init(None); // initialize varibales -} - -void Board::init(Image image, TQString levelName) -{ - prisonEntry = OUT; - prisonExit = OUT; - fruitHome = OUT; - fruitPosition = OUT; - pacmanHome = OUT; - pacmanPosition = OUT; - for (int m = 0; m < 8; m++) { - monsterHome[m] = OUT; - monsterPosition[m] = OUT; - } - for (int e = 0; e < 8; e++) { - energizerPosition[e] = OUT; - } - for (int e = 0; e < 8; e++) { - tunnelPosition[e] = OUT; - } - - fill(0); - numPoints = 0; - numEnergizers = 0; - numMonsters = 0; - numTunnels = 0; - - if (!levelName.isNull() && !levelName.isEmpty()) - if (mapName == levelName) - image = File; - else { - TQFile levelFile(levelName); - if (!levelFile.open(IO_ReadOnly)) { - - TQString msg = i18n("The levelmap could not be constructed.\n\n" - "The file '@LEVELNAME@' does not exist,\n" - "or could not be opened for reading."); - msg.replace(TQRegExp("@LEVELNAME@"), levelName); - // TQMessageBox::information(0, i18n("Initialization Error"), msg); - printf("%s\n", msg.local8Bit().data()); - } else { - map.fill(' ', BoardHeight*BoardWidth); - int height = 0; - - TQTextStream levelStream(&levelFile); - while (!levelStream.eof() && height < BoardHeight) { - TQString line = levelStream.readLine(); - - if (line.find(TQRegExp("^ *;")) == -1) { - - line.replace(TQRegExp(";.*"), ""); // strip off comments - line.replace(TQRegExp("\" *$"), ""); // strip off trailing " - line.replace(TQRegExp("^ *\""), ""); // strip off leading " - - map.replace(height*BoardWidth, - (line.length() > BoardWidth) ? BoardWidth : line.length(), - line.latin1()); - - height++; - } - } - mapName = levelName; - levelFile.close(); - image = File; - } - } - - switch (image) { - case Intro : // setup(demo_bits); - break; - case Demo : setup(demo_bits); - break; - case Level : setup(demo_bits); - break; - case File : setup(reinterpret_cast(map.latin1())); - break; - default : break; - } -} - -void Board::setup(const uchar *buf) -{ - for ( int index = 0; buf[index] != 0 && index < BoardWidth*BoardHeight; index++ ) { - switch (buf[index]) { - case '*' : set(index, brick); break; - case '+' : set(index, out); break; - case '#' : set(index, prison); break; - case '-' : set(index, gate); break; - case 'E' : set(index, tunnel); break; - case '.' : set(index, Point); break; - case 'o' : set(index, energizer); break; - case 'I' : set(index, prisonentry); break; - case 'O' : set(index, prisonexit); break; - case 'F' : set(index, fruithome); break; - case 'P' : set(index, pacmanhome); break; - default : if (buf[index] >= '0' && buf[index] <= '7') { - set(index, monsterhome, buf[index]-(uchar)'0'); - } - } - } -} - -bool Board::inBounds(int pos) -{ - return ( pos < 0 || pos > sz-1 ? FALSE : TRUE); -} - -void Board::set(int pos, Square sq, int m) -{ - if (inBounds(pos)) - switch (sq) { - case out : at(pos) = OUT; break; - case Point : at(pos) |= pointBit; numPoints++; break; - case tunnel : at(pos) = sq; - for (int e = 0; e < numTunnels; e++) { // if tunnel is already on board - if (tunnelPosition[e] == pos) // don't do it again. - pos = OUT; - } - if (pos != OUT) { - tunnelPosition[numTunnels] = pos; - numTunnels++; - } - break; - case energizer : at(pos) |= energizerBit; - for (int e = 0; e < numEnergizers; e++) { - if (energizerPosition[e] == pos) - pos = OUT; - } - if (pos != OUT) { - energizerPosition[numEnergizers] = pos; - numEnergizers++; - } - break; - case fruit : at(pos) |= fruitBit; fruitPosition = pos; break; - case pacman : at(pos) |= pacmanBit; pacmanPosition = pos; break; - case monster : at(pos) |= (monsterBit << m); - monsterPosition[m] = pos; break; - case prisonentry : prisonEntry = pos; at(pos) = empty; break; - case prisonexit : prisonExit = pos; at(pos) = empty; break; - case fruithome : fruitHome = pos; at(pos) = empty; break; - case pacmanhome : pacmanHome = pos; at(pos) = empty; break; - case monsterhome : monsterHome[m] = pos; at(pos) = empty; - if (m == 0 && prisonExit == OUT) - prisonExit = pos; - if (m == 1 && prisonEntry == OUT) - prisonEntry = pos; - numMonsters++; - break; - default : at(pos) = sq; - } -} - -void Board::reset(int pos, Square sq, int m) -{ - bool found = FALSE; - if (inBounds(pos)) - switch (sq) { - case out : at(pos) = empty; break; - case Point : at(pos) &= ~ pointBit; numPoints--; break; - case energizer : at(pos) &= ~ energizerBit; - for (int e = 0; e < numEnergizers; e++) { // delete the position of the eaten - if (found) // energizer in the position array - energizerPosition[e-1] = energizerPosition[e]; - if (energizerPosition[e] == pos) - found = TRUE; - } - energizerPosition[numEnergizers--] = OUT; - break; - case fruit : at(pos) &= ~ fruitBit; fruitPosition = OUT; break; - case pacman : at(pos) &= ~ pacmanBit; pacmanPosition = OUT; break; - case monster : at(pos) &= ~ (monsterBit << m); - monsterPosition[m] = OUT; break; - default : at(pos) = at(pos) & varBits; - } -} - -int Board::position(Square sq, int m) -{ - switch(sq) { - case prisonentry : return prisonEntry; - case prisonexit : return prisonExit; - case fruit : return fruitPosition; - case fruithome : return fruitHome; - case pacman : return pacmanPosition; - case pacmanhome : return pacmanHome; - case monster : return monsterPosition[m]; - case monsterhome : return monsterHome[m]; - case energizer : return energizerPosition[m]; - case tunnel : return tunnelPosition[m]; - default : return OUT; - } -} - -bool Board::isOut(int pos) -{ - if (inBounds(pos)) - return (at(pos) == OUT ? TRUE : FALSE); - return TRUE; -} - -bool Board::isEmpty(int pos) -{ - if (inBounds(pos)) - return ((at(pos) & fixBits) == empty ? TRUE : FALSE); - return TRUE; -} - -bool Board::isBrick(int pos) -{ - if (inBounds(pos)) - return ((at(pos) & fixBits) == brick ? TRUE : FALSE); - return FALSE; -} - -bool Board::isPrison(int pos) -{ - if (inBounds(pos)) - return ((at(pos) & fixBits) == prison ? TRUE : FALSE); - return FALSE; -} - -bool Board::isGate(int pos) -{ - if (inBounds(pos)) - return ((at(pos) & fixBits) == gate ? TRUE : FALSE); - return FALSE; -} - -bool Board::isTunnel(int pos) -{ - if (inBounds(pos)) - return ((at(pos) & fixBits) == tunnel ? TRUE : FALSE); - return FALSE; -} - -bool Board::isPoint(int pos) -{ - if (inBounds(pos) && at(pos) != OUT) - return ((at(pos) & pointBit) != 0 ? TRUE : FALSE); - return FALSE; -} - -bool Board::isEnergizer(int pos) -{ - if (inBounds(pos) && at(pos) != OUT) - return ((at(pos) & energizerBit) != 0 ? TRUE : FALSE); - return FALSE; -} - -bool Board::isFruit(int pos) -{ - if (inBounds(pos) && at(pos) != OUT) - return ((at(pos) & fruitBit) != 0 ? TRUE : FALSE); - return FALSE; -} - -bool Board::isPacman(int pos) -{ - if (inBounds(pos) && at(pos) != OUT) - return ((at(pos) & pacmanBit) != 0 ? TRUE : FALSE); - return FALSE; -} - -bool Board::isMonster(int pos) -{ - if (inBounds(pos) && at(pos) != OUT) - return ((at(pos) & monsterBits) != 0 ? TRUE : FALSE); - return FALSE; -} - -bool Board::isWay(int pos, int dir, Square sq) { - int p1 = move(pos, dir, 2); - if (p1 == OUT) - return (sq == out ? TRUE : FALSE); - int p2, p3; - if (dir == N || dir == S) { - p2 = move(p1, E); - p3 = move(p1, W); - } else { - p2 = move(p1, N); - p3 = move(p1, S); - } - switch (sq) { - case out : return isOut(p1) | isOut(p2) | isOut(p3); - case empty : return isEmpty(p1) & isEmpty(p2) & isEmpty(p3); - case brick : return isBrick(p1) | isBrick(p2) | isBrick(p3); - case prison : return isPrison(p1) | isPrison(p2) | isPrison(p3); - case gate : return isGate(p1) & isGate(p2) & isGate(p3); - case tunnel : return isTunnel(p1) & - (isTunnel(p2) || isEmpty(p2)) & - (isTunnel(p3) || isEmpty(p3)); - default : return FALSE; - } -} - -bool Board::isJump(int pos, int dir) { - switch (dir) { - case NW: return pos < BoardWidth || x(pos) == 0; - case N: return pos < BoardWidth; - case NE: return pos < BoardWidth || x(pos) == BoardWidth-1; - case W: return x(pos) == 0; - case E: return x(pos) == BoardWidth-1; - case SW: return pos >= sz-BoardWidth || x(pos) == 0; - case S: return pos >= sz-BoardWidth; - case SE: return pos >= sz-BoardWidth || x(pos) == BoardWidth-1; - } - return FALSE; -} - -int Board::move(int pos, int dir, int steps) -{ - if (steps < 0) { // move backwards - dir = turn(dir); // turn around and do your steps - steps *= -1; - } - - while (steps-- != 0) { // until all steps are gone - switch (dir) { - case NW: pos = pos >= BoardWidth && x(pos) > 0 ? (pos-BoardWidth)-1 : sz-1; - break; - case N: pos = pos >= BoardWidth ? pos-BoardWidth : (sz-BoardWidth)+x(pos); - break; - case NE: pos = pos >= BoardWidth && x(pos) < BoardWidth-1 ? - (pos-BoardWidth)+1 : sz-BoardWidth; - break; - case W: pos = x(pos) > 0 ? pos-1 : pos+(BoardWidth-1); - break; - case E: pos = x(pos) < BoardWidth-1 ? pos+1 : pos-(BoardWidth-1); - break; - case SW: pos = pos < sz-BoardWidth && x(pos) > 0 ? (pos+BoardWidth)-1 : BoardWidth-1; - break; - case S: pos = pos < sz-BoardWidth ? pos+BoardWidth : x(pos); - break; - case SE: pos = pos < sz-BoardWidth && x(pos) < BoardWidth-1 ? (pos+BoardWidth)+1 : 0; - break; - } - } - return pos; // here we are -} - -int Board::closeup(int pos, int dir, int target) -{ - if (dir == N || dir == S) { - if (x(target) < x(pos)) - return W; - if (x(target) > x(pos)) - return E; - } else { - if (y(target) < y(pos)) - return N; - if (y(target) > y(pos)) - return S; - } - return dir; -} - -int Board::x(int pos) -{ - return pos % BoardWidth; -} - -int Board::y(int pos) -{ - return pos/BoardWidth; -} - -int Board::turn(int dir) -{ - switch (dir) { - case N : return S; - case NE : return SW; - case E : return W; - case SE : return NW; - case S : return N; - case SW : return NE; - case W : return E; - case NW : return SE; - default : return dir; - } -} - -int Board::points() -{ - return numPoints; -} - -int Board::energizers() -{ - return numEnergizers; -} - -int Board::monsters() -{ - return numMonsters; -} - -int Board::tunnels() -{ - return numTunnels; -} diff --git a/kpacman/board.h b/kpacman/board.h deleted file mode 100644 index 3b56973..0000000 --- a/kpacman/board.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef BOARD_H -#define BOARD_H - -#include -#include -#include -#include - -#define OUT -1 - -enum Square {out = OUT, empty, brick, prison, gate, tunnel, prisonentry, prisonexit, - Point, energizer, fruit, pacman, monster, - fruithome, pacmanhome, monsterhome}; - -enum Image { None, Intro, Demo, Level, File }; - -#define X -1 -#define N 0 -#define S 1 -#define E 2 -#define W 3 -#define NE 4 -#define SE 5 -#define NW 6 -#define SW 7 - -#define BoardWidth 59 -#define BoardHeight 65 - -#define fixBits 0x0007 -#define varBits 0xFFF8 -#define monsterBits 0xFF00 - -#define pointBit 0x0008 -#define energizerBit 0x0010 -#define fruitBit 0x0020 -#define pacmanBit 0x0040 -#define monsterBit 0x0100 - -class Board : public TQMemArray -{ -public: - Board (int size); - ~Board() {}; - void init(Image image, TQString levelName=0); - void setup(const uchar *buf); - - void set(int pos, Square sq, int m = 0); - void reset(int pos, Square sq, int m = 0); - int position(Square sq, int m = 0); - - bool isOut(int pos); - bool isEmpty(int pos); - bool isBrick(int pos); - bool isPrison(int pos); - bool isGate(int pos); - bool isTunnel(int pos); - bool isPoint(int pos); - bool isEnergizer(int pos); - bool isFruit(int pos); - bool isPacman(int pos); - bool isMonster(int pos); - bool isWay(int pos, int dir, Square sq); - bool isJump(int pos, int dir); - - int move(int pos, int dir, int steps = 1); - int closeup(int pos, int dir, int target); - int x(int pos); - int y(int pos); - int turn(int dir); - - int points(); - int energizers(); - int monsters(); - int tunnels(); - -private: - bool inBounds(int pos); - int sz; // size of board - - TQString map; - TQString mapName; // Filename of the latest loaded map - - int prisonEntry; // position of prisonentry - int prisonExit; // position of prisonexit - int pacmanHome; // startposition of pacman - int monsterHome[8]; // startposition of monsters - int fruitHome; // startposition of fruit - - int pacmanPosition; // actual position of pacman - int monsterPosition[8]; // actual position of monsters - int fruitPosition; // actual position of fruit - int energizerPosition[8]; // actual position of energizers - int tunnelPosition[8]; // position of tunnels - - int numMonsters; // number of monsters on the board - int numPoints; // number of points (left) on the board - int numEnergizers; // number of energizers (left) - int numTunnels; // number of tunnels on the board -}; - -#endif // BOARD_H diff --git a/kpacman/colors.h b/kpacman/colors.h deleted file mode 100644 index 33beae2..0000000 --- a/kpacman/colors.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef COLORS_H -#define COLORS_H - -#include - -#define BLACK TQColor(TQt::black) -#define RED TQColor(TQt::red) -#define BROWN TQColor(0xde, 0x95, 0x41) -#define PINK TQColor(0xff, 0xba, 0xde) -#define CYAN TQColor(0x00, 0xff, 0xde) -#define LIGHTBLUE TQColor(0x41, 0xba, 0xde) -#define ORANGE TQColor(0xff, 0xba, 0x41) -#define YELLOW TQColor(TQt::yellow) -#define BLUE TQColor(0x20, 0x20, 0xde) -#define GREEN TQColor(TQt::green) -#define LIGHTGREEN TQColor(0x41, 0xba, 0x94) -#define FLESH TQColor(0xff, 0xba, 0x94) -#define WHITE TQColor(0xd8, 0xdc, 0xd8) - -#endif // COLORS_H - diff --git a/kpacman/energizer.cpp b/kpacman/energizer.cpp deleted file mode 100644 index ca08f3b..0000000 --- a/kpacman/energizer.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "energizer.h" - -Energizer::Energizer(Board *b) -{ - board = b; - setOn(); - actualPosition = OUT; - maxPixmaps = 0; -} - -void Energizer::setMaxPixmaps(int max) -{ - maxPixmaps = max; -} - -void Energizer::setOff() -{ - actualState = off; -} - -void Energizer::setOn() -{ - actualState = on; - actualPix = 0; -} - -void Energizer::setPosition(int pos) -{ - board->reset(actualPosition, energizer); - actualPosition = pos; - board->set(actualPosition, energizer); -} - -energizerState Energizer::state() -{ - return actualState; -} - -int Energizer::position() -{ - return actualPosition; -} - -bool Energizer::move() -{ - if (actualPosition == OUT) - return FALSE; - - if (++actualPix >= maxPixmaps) - actualPix = 0; - - return TRUE; -} - -int Energizer::pix() -{ - if (actualPosition == OUT || actualState == off) - return -1; - - return actualPix; -} diff --git a/kpacman/energizer.h b/kpacman/energizer.h deleted file mode 100644 index 377cd02..0000000 --- a/kpacman/energizer.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ENERGIZER_H -#define ENERGIZER_H - -#include "board.h" - -enum energizerState { on, off }; - -class Energizer { -public: - Energizer(Board *b); - void setMaxPixmaps(int max); - void setOff(); - void setOn(); - void setPosition(int pos); - energizerState state(); - int position(); - bool move(); - int pix(); - -private: - Board *board; - - energizerState actualState; // the state of energizer - - int actualPix; // last Pixmap-index - int maxPixmaps; // Number of Pixmaps (1..) - int actualPosition; // actual position on board -}; - -#endif // ENERGIZER_H diff --git a/kpacman/fruit.cpp b/kpacman/fruit.cpp deleted file mode 100644 index e6ad2d5..0000000 --- a/kpacman/fruit.cpp +++ /dev/null @@ -1,176 +0,0 @@ -#include - -#include "fruit.h" - -Fruit::Fruit(Board *b) -{ - board = b; - maxPixmaps = 0; - setLevel(0, 0, 0, 0); -} - -void Fruit::setEaten(int duration) -{ - actualState = eaten; - timeLeft = duration; - actualDirection = X; -} - -void Fruit::setLevel(int level, int wDuration, int fDuration, int ticks) -{ - actualLevel = level; - waitDuration = wDuration; - fruitDuration = fDuration; - pauseDuration = ticks; - pause = 0; - actualState = inactive; - timeLeft = waitDuration; - lastPosition = OUT; - setPosition(OUT); - setMovement(OUT, OUT, 0); - actualDirection = X; - setMaxPixmaps(maxPixmaps); -} - -void Fruit::setMaxPixmaps(int max) -{ - maxPixmaps = max; - if (actualLevel-1 < maxPixmaps) - actualPix = actualLevel == 0 ? 0 : actualLevel-1; - else if (maxPixmaps > 0) - actualPix = rand() % maxPixmaps; - else - actualPix = -1; -} - -void Fruit::setMovement(int entry, int tunnel, int iq) -{ - homePosition = board->position(fruithome); - entryPosition = entry; - tunnelPosition = tunnel; - IQ = iq; -} - -void Fruit::setPosition(int pos) -{ - board->reset(lastPosition, fruit); - actualPosition = lastPosition = pos; - board->set(actualPosition, fruit); -} - -void Fruit::setDirection(int dir) -{ - actualDirection = dir; -} - -fruitState Fruit::state() -{ - return actualState; -} - -int Fruit::position() -{ - return actualPosition; -} - -int Fruit::direction() -{ - return actualDirection; -} - -bool Fruit::move(bool activate) -{ - if (timeLeft > 0) { - timeLeft--; - } - - if (actualDirection == X || actualState == inactive) { - if (timeLeft == 0 || (activate && actualState == inactive)) { - if (actualState == inactive) { - if (entryPosition == OUT || tunnelPosition == OUT) { - setPosition(board->position(fruithome)); - } else { - setPosition(entryPosition); - actualDirection = 0; - while (!board->isWay(actualPosition, actualDirection, empty) || - board->isJump(actualPosition, actualDirection)) - actualDirection++; - } - timeLeft = fruitDuration; - setMaxPixmaps(maxPixmaps); - actualState = active; - } else { - actualState = inactive; - setPosition(OUT); - timeLeft = waitDuration; - actualDirection = X; - } - return TRUE; - } - return FALSE; - } - - if (pause-- > 0) - return FALSE; - else - pause = pauseDuration; - - if (actualPosition == OUT) - return FALSE; - - if (actualDirection == X) - return TRUE; - - int d = actualDirection; - - if (rand() % (int) ((190-IQ)/10) == 0) - if (timeLeft > 0) // coming home or leaving again - d = board->closeup(actualPosition, d, homePosition); - else - d = board->closeup(actualPosition, d, tunnelPosition); - else - do // try new direction, but not the opposite - d = rand() % 4; // direction, to prevent hectic movement. - while (d == board->turn(actualDirection)); - - while ((!board->isWay(actualPosition, d, empty) && - !board->isWay(actualPosition, d, tunnel)) || - d == board->turn(actualDirection)) { - if (d != actualDirection) // if new direction is not possible, - d = actualDirection; // try current direction first. - else - d = rand() % 4; - } - - actualDirection = d; - actualPosition = board->move(actualPosition, actualDirection); - - if (actualPosition == homePosition) { - timeLeft = 0; - } - - if (board->isTunnel(actualPosition)) { - setPosition(OUT); - timeLeft = waitDuration; - actualState = inactive; - actualDirection = X; - if (board->tunnels() > 0) { - entryPosition = board->position(tunnel, rand() % board->tunnels()); - tunnelPosition = board->position(tunnel, rand() % board->tunnels()); - } - } - - if (actualPosition != lastPosition) { - setPosition(actualPosition); - } - - return TRUE; -} - -int Fruit::pix() -{ - if (actualPosition == OUT || actualState == inactive) - return -1; - else - return actualPix; -} diff --git a/kpacman/fruit.h b/kpacman/fruit.h deleted file mode 100644 index fbbd9c0..0000000 --- a/kpacman/fruit.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef FRUIT_H -#define FRUIT_H - -#include - -#include "board.h" - -enum fruitState { inactive, active, eaten }; - -class Fruit { -public: - Fruit(Board *b); - void setEaten(int duration); - void setLevel(int level, int wDuration, int fDuration, int ticks = -1); - void setMaxPixmaps(int max); - void setMovement(int entry, int tunnel, int iq); - void setPosition(int pos); - void setDirection(int dir); - fruitState state(); - int position(); - int direction(); - bool move(bool activate=FALSE); - int pix(); - -private: - Board *board; - - int IQ; // Intelligence of movement (0 = dumb..180=smart) - - fruitState actualState; // the state of fruit - - int pauseDuration; // number of ticks before next movement - int pause; // actual ticks before movement (0 = move) - - int timeLeft; // Ticks remaining of current state - - int waitDuration; // Time before fruit appears - int fruitDuration; // Length of active-time in ticks - - int actualDirection; // actual direction of the fruit - int actualPosition; // actual position on board - int lastPosition; // the last position of the fruit - int actualLevel; // level for kind of fruit and score - int actualPix; - int maxPixmaps; // Number of Pixmaps (1..) - - int entryPosition; // where to come in - int homePosition; // where to go, on the way in - int tunnelPosition; // where to exit -}; - -#endif // FRUIT_H - diff --git a/kpacman/hi16-app-kpacman.png b/kpacman/hi16-app-kpacman.png deleted file mode 100644 index 7dc8172..0000000 Binary files a/kpacman/hi16-app-kpacman.png and /dev/null differ diff --git a/kpacman/hi32-app-kpacman.png b/kpacman/hi32-app-kpacman.png deleted file mode 100644 index 2c2d2e6..0000000 Binary files a/kpacman/hi32-app-kpacman.png and /dev/null differ diff --git a/kpacman/keys.cpp b/kpacman/keys.cpp deleted file mode 100644 index df8f980..0000000 --- a/kpacman/keys.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "keys.h" - -PKeys::PKeys( TQWidget *parent, const char *name) - : TQDialog( parent, name, TRUE, 0 ) -{ - TDEStandardDirs *dirs = TDEGlobal::dirs(); - - TQPushButton *okButton = new TQPushButton(this); - okButton->setText(i18n("Ok")); - okButton->setFixedSize(okButton->size()); - connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) ); - okButton->move(20,210); - - TQPushButton *defaultButton = new TQPushButton(this); - defaultButton->setText(i18n("Defaults")); - defaultButton->setFixedSize(defaultButton->size()); - connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) ); - defaultButton->move(140,210); - - TQPushButton *cancelButton = new TQPushButton(this); - cancelButton->setText(i18n("Cancel")); - cancelButton->setFixedSize(cancelButton->size()); - connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) ); - cancelButton->move(260,210); - - TQFrame *separator = new TQFrame(this); - separator->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); - separator->setGeometry( 20, 190, 340, 4 ); - - for ( int x = 0; x < 4; x++) { - TQLabel *l = new TQLabel(this); - l->setAlignment(AlignCenter); - labels[x] = l; - } - - labels[0]->setGeometry(120, 20, 140, 20 ); - labels[1]->setGeometry(120,160, 140, 20 ); - labels[2]->setGeometry( 20, 92, 100, 20 ); - labels[3]->setGeometry(265, 92, 100, 20 ); - - TQString pixPath; - - TQPushButton *up = new TQPushButton(this); - pixPath = dirs->findResource("appdata", "pics/up.xpm"); - up->setPixmap( TQPixmap(pixPath)); - up->setFixedSize(up->pixmap()->size()); - connect( up, SIGNAL(clicked()),this, SLOT(butUp()) ); - up->move(180, 50); - - TQPushButton *down = new TQPushButton(this); - pixPath = dirs->findResource("appdata", "pics/down.xpm"); - down->setPixmap( TQPixmap(pixPath)); - down->setFixedSize(down->pixmap()->size()); - connect( down, SIGNAL(clicked()),this, SLOT(butDown()) ); - down->move(180, 130); - - TQPushButton *left = new TQPushButton(this); - pixPath = dirs->findResource("appdata", "pics/left.xpm"); - left->setPixmap( TQPixmap(pixPath)); - left->setFixedSize(left->pixmap()->size()); - connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) ); - left->move(140, 90); - - TQPushButton *right = new TQPushButton(this); - pixPath = dirs->findResource("appdata", "pics/right.xpm"); - right->setPixmap( TQPixmap(pixPath)); - right->setFixedSize(right->pixmap()->size()); - connect( right, SIGNAL(clicked()),this, SLOT(butRight()) ); - right->move(220, 90); - - - setCaption(i18n("Change Direction Keys")); - setFixedSize(380, 260); - lab = 0; - init(); -} - -void PKeys::keyPressEvent( TQKeyEvent *e ) -{ - uint kCode = e->key() & ~(SHIFT | CTRL | ALT); - TQString string = TDEAccel::keyToString(kCode); - - if (lab != 0) { - if ( string.isNull() ) - lab->setText(i18n("Undefined key")); - else - lab->setText(string); - } - else if ( lab == 0 && e->key() == Key_Escape) - reject(); -} - -void PKeys::butUp() -{ - getKey(0); -} - -void PKeys::butDown() -{ - getKey(1); -} - -void PKeys::butLeft() -{ - getKey(2); -} - -void PKeys::butRight() -{ - getKey(3); -} - -void PKeys::getKey(int i) -{ - if ( lab != 0) - focusOut(lab); - - focusIn(labels[i]); -} - -void PKeys::focusOut(TQLabel *l) -{ - l->setFrameStyle( TQFrame::NoFrame ); - l->setBackgroundColor(backgroundColor()); - l->repaint(); -} - -void PKeys::focusIn(TQLabel *l) -{ - lab = l; - lab->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - lab->setBackgroundColor(white); - lab->repaint(); -} - -void PKeys::defaults() -{ - if ( lab != 0) - focusOut(lab); - - lab = 0; - - labels[0]->setText("Up"); - labels[1]->setText("Down"); - labels[2]->setText("Left"); - labels[3]->setText("Right"); -} - -void PKeys::init() -{ - TQString up("Up"); - up = kapp->config()->readEntry("upKey", up); - labels[0]->setText(up); - - TQString down("Down"); - down = kapp->config()->readEntry("downKey", down); - labels[1]->setText(down); - - TQString left("Left"); - left = kapp->config()->readEntry("leftKey", left); - labels[2]->setText(left); - - TQString right("Right"); - right = kapp->config()->readEntry("rightKey", right); - labels[3]->setText(right); -} - -void PKeys::ok() -{ - kapp->config()->writeEntry("upKey", labels[0]->text() ); - kapp->config()->writeEntry("downKey", labels[1]->text() ); - kapp->config()->writeEntry("leftKey", labels[2]->text() ); - kapp->config()->writeEntry("rightKey", labels[3]->text() ); - kapp->config()->sync(); - - accept(); -} - -#include "keys.moc" diff --git a/kpacman/keys.h b/kpacman/keys.h deleted file mode 100644 index f1c822a..0000000 --- a/kpacman/keys.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef KEYS_H -#define KEYS_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include - -class PKeys : public TQDialog -{ - Q_OBJECT -public: - PKeys( TQWidget *parent=0, const char *name=0 ); - -private slots: - void butRight(); - void butLeft(); - void butUp(); - void butDown(); - - void getKey(int); - void defaults(); - void focusIn(TQLabel *); - void focusOut(TQLabel *); - - void ok(); - -protected: - void keyPressEvent( TQKeyEvent * ); - -private: - void init(); - - TQLabel *labels[4]; - TQLabel *lab; -}; - -#endif // KEYS_H diff --git a/kpacman/kpacman.cpp b/kpacman/kpacman.cpp deleted file mode 100644 index 9083728..0000000 --- a/kpacman/kpacman.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/*************************************************************************** - kpacman.cpp - description - ------------------- - begin : Sam Jan 19 13:37:57 CET 2002 - copyright : (C) 1998-2003 by Jörg Thönnissen - email : joe@dsite.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -// include files for TQt -#include -#include -#include -#include - -// include files for KDE -#include -#include -#include -#include - -// application specific includes -#include "kpacman.h" - -#define ID_STATUS_MSG 1 - -KpacmanApp::KpacmanApp(TQWidget *, const char *name) : TDEMainWindow(0, name) -{ - config=kapp->config(); - - /////////////////////////////////////////////////////////////////// - // call inits to invoke all other construction parts - initStatusBar(); - initActions(); - initView(); - - readOptions(); - - highscoresChecked = false; - focusedPause = false; - - connect(view->referee, SIGNAL(setScore(int, int)), view->score, SLOT(setScore(int, int))); - connect(view->referee, SIGNAL(setPoints(int)), view->score, SLOT(set(int))); - connect(view->referee, SIGNAL(setLifes(int)), view->status, SLOT(setLifes(int))); - connect(view->referee, SIGNAL(setLevel(int)), view->status, SLOT(setLevel(int))); - - connect(view->referee, SIGNAL(focusedGamePause()), this, SLOT(slotFocusedGamePause())); - connect(view->referee, SIGNAL(forcedGameHighscores()), this, SLOT(slotForcedGameHighscores())); - - connect(view->score, SIGNAL(gameHighscores()), this, SLOT(slotGameHighscores())); - connect(view->score, SIGNAL(gameFinished()), this, SLOT(slotGameFinished())); -} - -KpacmanApp::~KpacmanApp() -{ - -} - - -void KpacmanApp::initActions() -{ - gameNew = KStdGameAction::gameNew(this, SLOT(slotGameNew()), actionCollection()); - gamePause = KStdGameAction::pause(this, SLOT(slotGamePause()), actionCollection()); - gamePause->setAccel(Key_F3); - gameQuit = KStdGameAction::quit(this, SLOT(slotGameQuit()), actionCollection()); - gameHighscores = KStdGameAction::highscores(this, SLOT(slotGameHighscores()), actionCollection()); - showMenuBar = KStdAction::showMenubar(this, SLOT(slotShowMenuBar()), actionCollection()); - showToolBar = KStdAction::showToolbar(this, SLOT(slotShowToolBar()), actionCollection()); - showStatusBar = KStdAction::showStatusbar(this, SLOT(slotShowStatusBar()), actionCollection()); - showMouseCursor = new TDEToggleAction(i18n("Show Mouse&cursor"), 0, - this, SLOT(slotShowMouseCursor()), actionCollection(), - "options_show_mousecursor"); - selectGraphicScheme = new TDEActionMenu(i18n("&Select graphic scheme"), actionCollection(), - "options_select_graphic_scheme"); - KStdAction::keyBindings(this, SLOT(slotKeyBindings()), actionCollection()); - focusOutPause = new TDEToggleAction(i18n("Pause in &Background"), 0, - this, SLOT(slotFocusOutPause()), actionCollection(), - "options_focus_out_pause"); - focusInContinue = new TDEToggleAction(i18n("Continue in &Foreground"), 0, - this, SLOT(slotFocusInContinue()), actionCollection(), - "options_focus_in_continue"); - - showMenuBar->setStatusText(i18n("Enables/disables the menubar")); - showToolBar->setStatusText(i18n("Enables/disables the toolbar")); - showStatusBar->setStatusText(i18n("Enables/disables the statusbar")); - showMouseCursor->setStatusText(i18n("Enable/disables the mousecursor")); - - // use the absolute path to your kpacmanui.rc file for testing purpose in createGUI(); - createGUI(); -} - - -void KpacmanApp::initStatusBar() -{ - /////////////////////////////////////////////////////////////////// - // STATUSBAR - // TODO: add your own items you need for displaying current application status. - statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG); -} - -void KpacmanApp::initView() -{ - //////////////////////////////////////////////////////////////////// - // create the main widget here that is managed by TDEMainWindow's view-region and - // connect the widget. - - view = new KpacmanView(this); - setCentralWidget(view); - - setFixedSize(view->width(), view->height()); - view->referee->setFocus(); -} - -void KpacmanApp::saveOptions() -{ - // config->setGroup("General Options"); - config->writeEntry("Geometry", size()); - config->writeEntry("ShowMenubar", showMenuBar->isChecked()); - config->writeEntry("ShowToolbar", showToolBar->isChecked()); - config->writeEntry("ShowStatusbar", showStatusBar->isChecked()); - config->writeEntry("ShowMousecursor", showMouseCursor->isChecked()); - config->writeEntry("FocusOutPause", focusOutPause->isChecked()); - config->writeEntry("FocusInContinue", focusInContinue->isChecked()); - config->writeEntry("ToolBarPos", (int) toolBar("mainToolBar")->barPos()); - config->writeEntry("Scheme", scheme); - config->writeEntry("Mode", mode); -} - -void KpacmanApp::readOptions() -{ - - // config->setGroup("General Options"); - - // bar status settings - bool bShowMenubar = config->readBoolEntry("ShowMenubar", true); - showMenuBar->setChecked(bShowMenubar); - slotShowMenuBar(); - - bool bShowToolbar = config->readBoolEntry("ShowToolbar", true); - showToolBar->setChecked(bShowToolbar); - slotShowToolBar(); - - bool bShowStatusbar = config->readBoolEntry("ShowStatusbar", false); - showStatusBar->setChecked(bShowStatusbar); - slotShowStatusBar(); - - // cursor status settings - bool bShowMousecursor = config->readBoolEntry("ShowMousecursor", false); - showMouseCursor->setChecked(bShowMousecursor); - slotShowMouseCursor(); - - // focus status settings - bool bFocusOutPause = config->readBoolEntry("FocusOutPause", false); - focusOutPause->setChecked(bFocusOutPause); - slotFocusOutPause(); - - bool bFocusInContinue = config->readBoolEntry("FocusInContinue", false); - focusInContinue->setChecked(bFocusInContinue); - slotFocusInContinue(); - - // bar position settings - TDEToolBar::BarPosition toolBarPos; - toolBarPos = (TDEToolBar::BarPosition) config->readNumEntry("ToolBarPos", TDEToolBar::Top); - toolBar("mainToolBar")->setBarPos(toolBarPos); - - TQSize size = config->readSizeEntry("Geometry"); - if (!size.isEmpty()) - { - resize(size); - } - - // scheme and mode - scheme = config->readNumEntry("Scheme", -1); - mode = config->readNumEntry("Mode", -1); - readSchemes(); -} - -void KpacmanApp::readSchemes() -{ - TQString saveGroup = config->group(); - TQString group; - TQString description; - - int modeCount = config->readNumEntry("ModeCount", -1); - int schemeCount = config->readNumEntry("SchemeCount"); - - modeID.resize(modeCount > 0 ? modeCount : 0); - schemeID.resize(schemeCount); - schemeMode.resize(schemeCount); - - schemesPopup = new TQPtrList; - schemesPopup->setAutoDelete(true); - - modesPopup = selectGraphicScheme->popupMenu(); - connect(modesPopup, SIGNAL(activated(int)), this, SLOT(slotSchemeActivated(int))); - - if (schemeCount == 0 || scheme == -1) { - TQMessageBox::warning(this, i18n("Configuration Error"), - i18n("There are no schemes defined,\n" - "or no scheme is selected.")); - return; - } - - // create submenus (TQPopupMenu) for graphic-modes - for (int m = 0; m < modeCount; m++) { - group.sprintf("Mode %d", m); - config->setGroup(group); - - description = config->readEntry("Description", group); - - TDEPopupMenu *p = new TDEPopupMenu; - p->setCheckable(true); - connect(p, SIGNAL(activated(int)), this, SLOT(slotSchemeActivated(int))); - schemesPopup->append(p); - - modeID[m] = modesPopup->insertItem(description, schemesPopup->at(m)); - modesPopup->setItemEnabled(modeID[m], false); - modesPopup->setItemChecked(modeID[m], m == mode); - } - - // create menuitems (insertItem) for graphic-schemes - for (int i = 0; i < schemeCount; i++) { - group.sprintf("Scheme %d", i); - config->setGroup(group); - - description = config->readEntry("Description", group); - schemeMode[i] = config->readNumEntry("Mode", -1); - - if (schemeMode[i] == -1) { - schemeID[i] = modesPopup->insertItem(description); - modesPopup->setItemChecked(schemeID[i], i == scheme); - } else { - schemeID[i] = schemesPopup->at(schemeMode[i])->insertItem(description); - schemesPopup->at(schemeMode[i])->setItemChecked(schemeID[i], i == scheme); - modesPopup->setItemEnabled(modeID[schemeMode[i]], true); - } - } - - config->setGroup(saveGroup); -} - -bool KpacmanApp::queryExit() -{ - saveOptions(); - return true; -} - - -///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION -///////////////////////////////////////////////////////////////////// - -void KpacmanApp::slotGameNew() -{ - // enable the gameHighscores action, if disabled by forced highscores mode - if (!gameHighscores->isEnabled()) - gameHighscores->setEnabled(true); - - // hide highscores and show board again, if in highscores mode - if (highscoresChecked) - slotGameHighscores(); - - // deactivate pause and uncheck the menuitem, if in pause state - if (gamePause->isChecked()) { - gamePause->setChecked(false); - slotGamePause(); - } - // disable menuitem to prevent interruption of the game - gameNew->setEnabled(false); - - view->referee->play(); -} - -void KpacmanApp::slotGamePause() -{ - view->referee->pause(); - view->score->setPause(gamePause->isChecked()); -} - -void KpacmanApp::slotFocusedGamePause() -{ - // if an focus-event triggers the pause, toggle the gamePause checked - gamePause->setChecked(!gamePause->isChecked()); - focusedPause = !focusedPause; - - slotGamePause(); -} - -void KpacmanApp::slotGameHighscores() -{ - // toggle highscores mode flag - highscoresChecked = !highscoresChecked; - - view->referee->toggleHallOfFame(); - - // show highscore (by lowering referee and status) or return to play (by raising them again) - if (highscoresChecked) { - view->referee->lower(); - view->status->lower(); - } else { - view->status->raise(); - view->referee->raise(); - view->referee->setFocus(); - - // after forced highscores comes the intro again - if (!gameHighscores->isEnabled()) { - gameHighscores->setEnabled(true); - view->referee->intro(); - } - } -} - -void KpacmanApp::slotForcedGameHighscores() -{ - // disable menuitem to prevent closing highscores display - gameHighscores->setEnabled(false); - - slotGameHighscores(); -} - -void KpacmanApp::slotGameQuit() -{ - slotStatusMsg(i18n("Exiting...")); - saveOptions(); - kapp->quit(); -} - -void KpacmanApp::slotShowMenuBar() -{ - slotStatusMsg(i18n("Toggling menubar...")); - /////////////////////////////////////////////////////////////////// - // turn Menubar on or off - if(!showMenuBar->isChecked()) { - menuBar()->hide(); - setFixedSize(view->width(), view->height()); - } else { - menuBar()->show(); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotShowToolBar() -{ - slotStatusMsg(i18n("Toggling toolbar...")); - /////////////////////////////////////////////////////////////////// - // turn Toolbar on or off - if(!showToolBar->isChecked()) { - toolBar("mainToolBar")->hide(); - setFixedSize(view->width(), view->height()); - } else { - toolBar("mainToolBar")->show(); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotShowStatusBar() -{ - slotStatusMsg(i18n("Toggle the statusbar...")); - /////////////////////////////////////////////////////////////////// - // turn Statusbar on or off - if(!showStatusBar->isChecked()) { - statusBar()->hide(); - setFixedSize(view->width(), view->height()); - } else { - statusBar()->show(); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotShowMouseCursor() -{ - slotStatusMsg(i18n("Toggle the mousecursor...")); - /////////////////////////////////////////////////////////////////// - // turn Mousecursor on or off - if(!showMouseCursor->isChecked()) { - view->setCursor(blankCursor); - } else { - view->setCursor(arrowCursor); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotSchemeActivated(int id) -{ - slotStatusMsg(i18n("Graphic scheme selected...")); - /////////////////////////////////////////////////////////////////// - // select activated scheme/mode - - mode = -1; - scheme = -1; - - for (uint s = 0; s < schemeID.size(); s++) { - if (schemeID[s] == id) { - scheme = s; - mode = schemeMode[s]; - } - if (schemeMode[s] == -1) { - modesPopup->setItemChecked(schemeID[s], schemeID[s] == id); - } else { - modesPopup->setItemChecked(modeID[schemeMode[s]], schemeMode[s] == mode); - schemesPopup->at(schemeMode[s])->setItemChecked(schemeID[s], schemeID[s] == id); - } - } - - view->setScheme(scheme, mode); - setFixedSize(view->width(), view->height()); - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotFocusOutPause() -{ - slotStatusMsg(i18n("Toggle focusOutPause...")); - /////////////////////////////////////////////////////////////////// - // turn focusOutPause on or off - view->referee->setFocusOutPause(focusOutPause->isChecked()); - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotFocusInContinue() -{ - slotStatusMsg(i18n("Toggle focusInContinue...")); - /////////////////////////////////////////////////////////////////// - // turn focusInContinue on or off - view->referee->setFocusInContinue(focusInContinue->isChecked()); - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotKeyBindings() -{ - slotStatusMsg(i18n("Configure key bindings...")); - /////////////////////////////////////////////////////////////////// - // configure key bindings - PKeys *keys = new PKeys(); - if (keys->exec() == TQDialog::Accepted) { - view->referee->initKeys(); - view->score->initKeys(); - } - delete keys; - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotGameFinished() -{ - slotStatusMsg(i18n("Game finished...")); - /////////////////////////////////////////////////////////////////// - // enable/disable the menuitem - gameNew->setEnabled(true); - - slotStatusMsg(i18n("Ready.")); -} - -void KpacmanApp::slotStatusMsg(const TQString &text) -{ - /////////////////////////////////////////////////////////////////// - // change status message permanently - statusBar()->clear(); - statusBar()->changeItem(text, ID_STATUS_MSG); -} - -#include "kpacman.moc" diff --git a/kpacman/kpacman.desktop b/kpacman/kpacman.desktop deleted file mode 100644 index d357242..0000000 --- a/kpacman/kpacman.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Name=Kpacman - -GenericName=Arcade Game - -Comment=A simple clone of the classic arcade game Pac-Man - -Keywords=arcade;pacman;dots;ghosts;level; - -Type=Application -Exec=kpacman -caption "%c" %i %m -Icon=kpacman.png -MiniIcon=kpacman.png -Terminal=false -X-DocPath=kpacman/index.html -Categories=Qt;TDE;Game;ArcadeGame; diff --git a/kpacman/kpacman.h b/kpacman/kpacman.h deleted file mode 100644 index e577f38..0000000 --- a/kpacman/kpacman.h +++ /dev/null @@ -1,185 +0,0 @@ -/*************************************************************************** - kpacman.h - description - ------------------- - begin : Sam Jan 19 13:37:57 CET 2002 - copyright : (C) 1998-2003 by Jörg Thönnissen - email : joe@dsite.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef KPACMAN_H -#define KPACMAN_H - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -// include files for TQt -#include -#include -#include - -//include files for KDE -#include -#include -#include -#include -#include -#include - -// application specific includes -#include "kpacmanview.h" -#include "referee.h" -#include "status.h" -#include "score.h" -#include "keys.h" - -// forward declaration of the Kpacman classes -class KpacmanView; - -/** - * The base class for Kpacman application. - */ -class KpacmanApp : public TDEMainWindow -{ - Q_OBJECT - - friend class KpacmanView; - - public: - /** constructor of KpacmanApp, calls all init functions to create the application. - */ - KpacmanApp(TQWidget *parent = 0, const char *name = 0); - virtual ~KpacmanApp(); - - protected: - /** save general Options like all bar positions and status as well as the application specific - * Options to the configuration file - */ - void saveOptions(); - /** read general Options again and initialize all variables - */ - void readOptions(); - /** read graphic schemes and build menu items for selection - */ - void readSchemes(); - /** initializes the TDEActions of the application */ - void initActions(); - /** sets up the statusbar for the main window by initialzing a statuslabel. - */ - void initStatusBar(); - /** creates the centerwidget of the KTMainWindow instance and sets it as the view - */ - void initView(); - /** queryExit is called by KTMainWindow when the last window of the application is going to be closed - * during the closeEvent(). - * Against the default implementation that just returns true, this calls saveOptions() to save the - * settings of the window's properties. - * @see KTMainWindow#queryExit - * @see KTMainWindow#closeEvent - */ - virtual bool queryExit(); - - - public slots: - /** play new game - */ - void slotGameNew(); - /** pause (continue) game - */ - void slotGamePause(); - /** pause (continue) game triggered by focus events - */ - void slotFocusedGamePause(); - /** toggle the highscores - */ - void slotGameHighscores(); - /** toggle the highscores, forced by the referee - */ - void slotForcedGameHighscores(); - /** save the options, then quits the application. - */ - void slotGameQuit(); - /** toggles the menubar - */ - void slotShowMenuBar(); - /** toggles the toolbar - */ - void slotShowToolBar(); - /** toggles the statusbar - */ - void slotShowStatusBar(); - /** toggles the mousecursor - */ - void slotShowMouseCursor(); - /** graphic scheme activated - * @param id the id of the activated/selected menuitem - */ - void slotSchemeActivated(int id); - /** toggles the focus out pause - */ - void slotFocusOutPause(); - /** toggles the focus in continue - */ - void slotFocusInContinue(); - /** changes the statusbar contents for the standard label permanently, used to indicate current actions. - * @param text the text that is displayed in the statusbar - */ - void slotStatusMsg(const TQString &text); - /** configure keysbindings dialog - */ - void slotKeyBindings(); - /** game (including highscores displayed) has been finished - */ - void slotGameFinished(); - - private: - /** the configuration object of the application */ - TDEConfig *config; - /** view is the main widget which represents your working area. The View - * class should handle all events of the view widget. It is kept empty so - * you can create your view according to your application's needs by - * changing the view class. - */ - KpacmanView *view; - - // TDEAction pointers to enable/disable actions - TDEAction* gameNew; - TDEToggleAction* gamePause; - TDEAction* gameHighscores; - TDEAction* gameQuit; - TDEToggleAction* showMenuBar; - TDEToggleAction* showToolBar; - TDEToggleAction* showStatusBar; - TDEToggleAction* showMouseCursor; - TDEToggleAction* focusOutPause; - TDEToggleAction* focusInContinue; - TDEActionMenu* selectGraphicScheme; - - // active scheme/mode - int scheme; - int mode; - - TDEPopupMenu *modesPopup; // TDEAction main scheme selection menu - TQPtrList *schemesPopup; // submenus for selecting scheme - - // ID's of the menuitem(s) for finding/selecting scheme by id - TQMemArray modeID; - TQMemArray schemeID; - - TQMemArray schemeMode; // mode(group) of the schemes, -1 if no group - - bool highscoresChecked; // highscores display active - bool focusedPause; // Pause caused by focusEvents -}; - -#endif // KPACMAN_H diff --git a/kpacman/kpacmanrc b/kpacman/kpacmanrc deleted file mode 100644 index 156c455..0000000 --- a/kpacman/kpacmanrc +++ /dev/null @@ -1,70 +0,0 @@ -FocusInContinue=true -FocusOutPause=true -HideMouseCursor=false -LevelPixmapName=fruit.xpm -Mode=0 -ModeCount=2 -Scheme=0 -SchemeCount=5 -downKey=Down -leftKey=Left -rightKey=Right -upKey=Up - -[Mode 0] -Description=&Pacman - -[Mode 1] -Description=&Ms.Pacman -DyingAnimationMS=150 -EnergizerPixmapName=switch.xpm,,,switch02.xpm,,,switch03.xpm,,,,switch.xpm,,,,,,,,,,,,switch03.xpm,,,,switch.xpm -ExtraLifeScore=-10000,-30000,-50000,30000 -FruitScore=100,200,500,700,1000,2000,5000 -FruitScorePixmapName=fruitscore.xpm -LevelPosition=0,1,2,3,4,5,6 -Levels=29 -MapDirectory=mspacman -MapName=map01,,,map02,,,map03,,,,map04,,,,map03,,,,map04,,,,map03,,,,map04 -PointPixmapName=point.xpm,,,point02.xpm,,,point03.xpm,,,,point.xpm,,,,,,,,,,,,point03.xpm,,,,point.xpm -PrisonPixmapName=prison.xpm,,,prison02.xpm,,,prison03.xpm,,,,prison04.xpm,,,,prison05.xpm,,,,prison06.xpm,,,,prison03.xpm,,,,prison04.xpm -WallPixmapName=wall.xpm,,,wall02.xpm,,,wall03.xpm,,,,wall04.xpm,,,,wall05.xpm,,,,wall06.xpm,,,,wall03.xpm,,,,wall04.xpm - -[Scheme 0] -Description=&MIDWAY MFG.CO. -Description[de]=&MIDWAY MFG.CO. -Font=font-smooth.pbm -Mode=0 -PixmapDirectory= - -[Scheme 1] -Description=MIDWAY MFG.CO. (&tiny) -Description[de]=MIDWAY MFG.CO. (&klein) -Font=font-small.pbm -Mode=0 -PixmapDirectory=tiny - -[Scheme 2] -Description=K&Zacman (incomplete) -Description[de]=K&Zacman (unvollständig) -Font=font-smooth.pbm -FruitPixmapName=../fruit.xpm -LevelPixmapName=../fruit.xpm -PixmapDirectory=zacman -PrisonPixmapName=../prison.xpm - -[Scheme 3] -Description=&MIDWAY MFG.CO. -EyesPixmapName=../eyes.xpm -Font=font-smooth.pbm -Mode=1 -MonsterPixmapName=../monster.xpm -PixmapDirectory=mspacman - -[Scheme 4] -Description=MIDWAY MFG.CO. (&tiny) -Description[de]=MIDWAY MFG.CO. (&klein) -EyesPixmapName=../tiny/eyes.xpm -Font=font-small.pbm -Mode=1 -MonsterPixmapName=../tiny/monster.xpm -PixmapDirectory=mspacman-tiny diff --git a/kpacman/kpacmanui.rc b/kpacman/kpacmanui.rc deleted file mode 100644 index 34c3ded..0000000 --- a/kpacman/kpacmanui.rc +++ /dev/null @@ -1,18 +0,0 @@ - - - - &Game - - &Settings - - - - - - - -Main Toolbar - - - - diff --git a/kpacman/kpacmanview.cpp b/kpacman/kpacmanview.cpp deleted file mode 100644 index 40d23e1..0000000 --- a/kpacman/kpacmanview.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - kpacmanview.cpp - description - ------------------- - begin : Sam Jan 19 13:37:57 CET 2002 - copyright : (C) 1998-2003 by Jörg Thönnissen - email : joe@dsite.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -// include files for TQt -#include - -// include files for KDE -#include -#include -#include - -// application specific includes -#include "kpacmanview.h" -#include "bitfont.h" -#include "score.h" -#include "referee.h" -#include "status.h" - -KpacmanView::KpacmanView( TQWidget *parent, const char *name) : TQWidget( parent, name ) -{ - bitfont = NULL; - fontName = ""; - - scheme = mode = -1; - confScheme(); - - score = new Score(this, name, scheme, mode, bitfont); - referee = new Referee( this, name, scheme, mode, bitfont); - status = new Status(this, name, scheme, mode); - - setFixedSize(referee->width(), bitfont->height()*3 + referee->height() + status->height()); -} - -KpacmanView::~KpacmanView() -{ -} - -void KpacmanView::confMisc(bool defGroup) -{ - TDEStandardDirs *dirs = TDEGlobal::dirs(); - TQString findPath; - - if (defGroup || kapp->config()->hasKey("Font")) { - fontName = kapp->config()->readEntry("Font"); - - if (fontName.left(1) != "/" && fontName.left(1) != "~") - fontName.insert(0, "fonts/"); - if (fontName.right(1) == "/") - fontName.append("font.xbm"); - - findPath = dirs->findResource("appdata", fontName); - if (!findPath.isEmpty()) - fontName = findPath; - - bitfontFirstChar = kapp->config()->readNumEntry("FontFirstChar", 0x0e); - bitfontLastChar = kapp->config()->readNumEntry("FontLastChar", 0x5f); - } -} - -void KpacmanView::confScheme() -{ - TQString lastFontName = fontName; - TQString oldgroup = kapp->config()->group(); - TQString newgroup; - - // if not set, read mode and scheme from the configfile - if (mode == -1 && scheme == -1) { - scheme = kapp->config()->readNumEntry("Scheme", -1); - mode = kapp->config()->readNumEntry("Mode", -1); - - // if mode is not set in the defGroup-group, lookup the scheme group - if (scheme != -1 || mode == -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - mode = kapp->config()->readNumEntry("Mode", -1); - kapp->config()->setGroup(oldgroup); - } - } - - confMisc(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - } - - if (lastFontName != fontName) { - - if (bitfont != 0) - delete bitfont; - - bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar); - if (bitfont->width() == 0 || bitfont->height() == 0) { - TQString msg = i18n("The bitfont could not be contructed.\n\n" - "The file '@FONTNAME@' does not exist,\n" - "or is of an unknown format."); - msg.replace(TQRegExp("@FONTNAME@"), fontName); - // TQMessageBox::critical(this, i18n("Initialization Error"), msg); - printf("%s\n", msg.local8Bit().data()); - } - } - - kapp->config()->setGroup(oldgroup); -} - -void KpacmanView::setScheme(int Scheme, int Mode) -{ - mode = Mode; - scheme = Scheme; - - confScheme(); - - score->setScheme(Scheme, Mode, bitfont); - referee->setScheme(Scheme, Mode, bitfont); - status->setScheme(Scheme, Mode); - - setFixedSize(referee->width(), - bitfont->height()*3 + referee->height() + status->height()); - updateGeometry(); - - score->repaint(FALSE); - referee->repaint(FALSE); - status->repaint(FALSE); -} - -void KpacmanView::resizeEvent( TQResizeEvent * ) -{ - referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); - referee->setBackgroundColor(BLACK); - - status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), - status->height()); - status->setBackgroundColor(BLACK); - - score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); - score->setBackgroundColor(BLACK); -} - -#include "kpacmanview.moc" diff --git a/kpacman/kpacmanview.h b/kpacman/kpacmanview.h deleted file mode 100644 index c94349f..0000000 --- a/kpacman/kpacmanview.h +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - kpacmanview.h - description - ------------------- - begin : Sam Jan 19 13:37:57 CET 2002 - copyright : (C) 1998-2003 by Jörg Thönnissen - email : joe@dsite.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef KPACMANVIEW_H -#define KPACMANVIEW_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -//include files for TQt -#include -#include - -// application specific includes -#include "score.h" -#include "referee.h" -#include "status.h" -#include "painter.h" - -/** The KpacmanView class provides the view widget for the KpacmanApp instance. - * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. - */ -class KpacmanView : public TQWidget -{ - Q_OBJECT -public: - /** Constructor for the main view */ - KpacmanView ( TQWidget *parent = 0, const char *name = 0); - /** Destructor for the main view */ - virtual ~KpacmanView(); - - void setScheme(int scheme=-1, int mode=-1); - Score *score; - Referee *referee; - Status *status; - -protected: - void confScheme(); - void confMisc(bool defGroup=TRUE); - void resizeEvent( TQResizeEvent * ); - -private: - Bitfont *bitfont; - uchar bitfontFirstChar; - uchar bitfontLastChar; - - TQString fontName; - - int scheme; - int mode; -}; - -#endif // KPACMANVIEW_H diff --git a/kpacman/lo16-app-kpacman.png b/kpacman/lo16-app-kpacman.png deleted file mode 100644 index 7dc8172..0000000 Binary files a/kpacman/lo16-app-kpacman.png and /dev/null differ diff --git a/kpacman/lo32-app-kpacman.png b/kpacman/lo32-app-kpacman.png deleted file mode 100644 index 2c2d2e6..0000000 Binary files a/kpacman/lo32-app-kpacman.png and /dev/null differ diff --git a/kpacman/main.cpp b/kpacman/main.cpp deleted file mode 100644 index 14ac8e0..0000000 --- a/kpacman/main.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - main.cpp - description - ------------------- - begin : Sam Jan 19 13:37:57 CET 2002 - copyright : (C) 1998-2003 by Jörg Thönnissen - email : joe@dsite.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include -#include -#include - -#include "kpacman.h" - -static const char *description = - I18N_NOOP("A pacman game for the KDE Desktop\n\n" - "The program based on the source of ksnake\n" - "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" - "The design was strongly influenced by the pacman\n" - "(c) 1980 MIDWAY MFG.CO.\n\n" - "I like to thank my girlfriend Elke Krueers for\n" - "the last 14 years of her friendship\n" - "and Christine Nickel for the 'K' in my life."); - -static TDECmdLineOptions options[] = -{ - { 0, 0, 0 } - // INSERT YOUR COMMANDLINE OPTIONS HERE -}; - -int main(int argc, char *argv[]) -{ - - TDEAboutData aboutData( "kpacman", I18N_NOOP("Kpacman"), - VERSION, description, TDEAboutData::License_GPL, - "(c) 1998-2003, Jörg Thönnissen", 0, 0, "joe@dsite.de"); - aboutData.addAuthor("Jörg Thönnissen",0, "joe@dsite.de"); - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options. - - TDEApplication app; - - KpacmanApp *kpacman = new KpacmanApp(); - kpacman->show(); - - return app.exec(); -} diff --git a/kpacman/monster.cpp b/kpacman/monster.cpp deleted file mode 100644 index 2f402b4..0000000 --- a/kpacman/monster.cpp +++ /dev/null @@ -1,262 +0,0 @@ -#include "monster.h" -#include "board.h" - -Monster::Monster(Board *b, int mid) -{ - board = b; - ID = mid; - - setREM(0); - setHarmless(0, 0, 0); - setArrested(0, 0); - setFreedom(board->position(prisonexit)); - if (mid == 0) - setPrison(board->position(prisonentry)); - else - setPrison(board->position(monsterhome, mid)); - - actualPosition = lastPosition = OUT; - feetPosition = 0; - IQ = 0; - maxBodyPixmaps = 0; - maxEyesPixmaps = 0; -} - -void Monster::setMaxPixmaps(int maxBody, int maxEyes) -{ - if (feetPosition >= (maxBody/10)) - feetPosition = 0; - maxBodyPixmaps = maxBody; - maxEyesPixmaps = maxEyes; -} - -void Monster::setArrested(int ticks, int duration) -{ - actualState = dangerous; - pauseDuration = ticks; - pause = 0; - arrestDuration = arrestLeft = duration; - arrestPause = ticks; - harmlessLeft = 0; -} - -void Monster::setDangerous(int ticks, int iq) -{ - actualState = dangerous; - pauseDuration = ticks; - pause = 0; - dangerousPause = ticks; - harmlessLeft = 0; - IQ = iq; -} - -void Monster::setHarmless(int ticks, int hDuration, int wDuration) -{ - actualState = harmless; - pauseDuration = ticks; - pause = 0; - harmlessDuration = harmlessLeft = hDuration; - warningDuration = wDuration; -} - -void Monster::setREM(int ticks) -{ - actualState = rem; - pauseDuration = ticks; - pause = 0; -} - -void Monster::setPosition(int pos) -{ - board->reset(lastPosition, monster, ID); // reset old position on the board - actualPosition = lastPosition = pos; // set position of monster - board->set(actualPosition, monster, ID); - feetPosition = 0; -} - -void Monster::setPrison(int pos) -{ - prisonPosition = pos; -} - -void Monster::setFreedom(int pos) -{ - freedomPosition = pos; -} - -void Monster::setDirection(int dir) -{ - if (dir == X) - lastDirection = actualDirection; - actualDirection = dir; -} - -monsterState Monster::state() -{ - return actualState; -} - -int Monster::position() -{ - return actualPosition; -} - -int Monster::direction() -{ - return actualDirection; -} - -int Monster::id() -{ - return ID; -} - -bool Monster::move() -{ - if (arrestLeft > 1) - arrestLeft--; - - if (harmlessLeft > 0) { - harmlessLeft--; - if (harmlessLeft == 0 && actualState == harmless) { - actualState = dangerous; - pauseDuration = dangerousPause; - } - } - - if (pause-- > 0) - return FALSE; - else - pause = pauseDuration; - - if (actualPosition == OUT) - return FALSE; - - if (actualDirection == X) { - if (++feetPosition >= (maxBodyPixmaps/10)) - feetPosition = 0; - return TRUE; - } - - lastPosition = actualPosition; - int d = actualDirection; - - if (arrestLeft > 1) { // during the arrest, only up and down - if (!board->isWay(actualPosition, d, empty) && - !board->isWay(actualPosition, d, tunnel)) - d = board->turn(actualDirection); - } - - if (arrestLeft == 1) { // going out of the prison - if (((d == W || d == E) && - board->x(actualPosition) == board->x(freedomPosition)) || - ((d == S || d == N) && - board->y(actualPosition) == board->y(freedomPosition)) || - board->isWay(actualPosition, d, brick) || - board->isWay(actualPosition, d, prison)) { - d = board->closeup(actualPosition, d, freedomPosition); - } - while (board->isWay(actualPosition, d, brick) || - board->isWay(actualPosition, d, prison)) { - if (d == actualDirection) - d = rand() % 4; - else - d = actualDirection; - } - if (actualState == dangerous) - pauseDuration = dangerousPause; - - } - - if (arrestLeft == 0) - if (actualState == rem) { // on the way to prison - - d = board->closeup(actualPosition, d, prisonPosition); - - while (board->isWay(actualPosition, d, brick) || - board->isWay(actualPosition, d, prison)) { - if (d != actualDirection) // if new direction is not possible, - d = actualDirection; // try current direction first. - else - d = rand() % 4; - } - - } else { // dangerous or harmless movement - if (rand() % (int) ((190-IQ)/10) == 0) { - d = board->closeup(actualPosition, d, board->position(pacman)); - if (actualState == harmless) - d = board->turn(d); - } else - do // try new direction, but not the opposite - d = rand() % 4; // direction, to prevent hectic movement. - while (d == board->turn(actualDirection)); - - while ((!board->isWay(actualPosition, d, empty) && - !board->isWay(actualPosition, d, tunnel)) || - d == board->turn(actualDirection)) { - if (d != actualDirection) // if new direction is not possible, - d = actualDirection; // try current direction first. - else - d = rand() % 4; - } - } - - actualDirection = d; - actualPosition = board->move(actualPosition, actualDirection); - - if (arrestLeft == 1 && actualPosition == freedomPosition) - arrestLeft = 0; - - if (actualState == rem && actualPosition == prisonPosition) { - actualState = dangerous; - pauseDuration = arrestPause; - arrestLeft = arrestDuration+1; - actualDirection = S; - } - - if (actualPosition != lastPosition) { - board->reset(lastPosition, monster, ID); - board->set(actualPosition, monster, ID); - } - - if (++feetPosition >= (maxBodyPixmaps/10)) - feetPosition = 0; - - return TRUE; -} - -int Monster::body() -{ - if (actualState == rem || actualPosition == OUT) - return -1; - else - if (actualState == harmless) - if (harmlessLeft > warningDuration || - harmlessLeft % (int) (warningDuration/4.5) > (int) (warningDuration/9)) - return ((maxBodyPixmaps/10)*8)+feetPosition; - else - return ((maxBodyPixmaps/10)*9)+feetPosition; - else - return ((maxBodyPixmaps/10)*ID)+feetPosition; -} - -int Monster::eyes() -{ - if (actualState == harmless || actualPosition == OUT) - return -1; - else - switch (actualDirection) { - case N : return 0; - case E : return 1; - case S : return 2; - case W : return 3; - case X : switch (lastDirection) { - case N : return 0; - case E : return 1; - case S : return 2; - default : return 3; - } - default : return -1; - } -} - diff --git a/kpacman/monster.h b/kpacman/monster.h deleted file mode 100644 index 385c513..0000000 --- a/kpacman/monster.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef MONSTER_H -#define MONSTER_H - -#include -#include -#include - -#include "board.h" - -enum monsterState { dangerous, harmless, rem, arrested }; - -class Monster { -public: - Monster(Board *b, int mid = 0); - void setMaxPixmaps(int maxBody, int maxEyes); - void setArrested(int ticks, int duration); - void setDangerous(int ticks, int IQ); - void setHarmless(int ticks, int hDuration, int wDuration); - void setREM(int ticks); - void setPosition(int pos); - void setPrison(int pos); - void setFreedom(int pos); - void setDirection(int dir); - monsterState state(); - int position(); - int direction(); - int id(); - bool move(); - int body(); - int eyes(); -private: - Board *board; - int ID; // ID of monster (0 = 1st, 1 = 2nd ... 7 = last) - int IQ; // Intelligence of movement (0 = dumb..180 = smart) - - monsterState actualState; // The state of the monster - - int pauseDuration; // Number of ticks before movement - int pause; // actual ticks before moevment (0 = move) - int dangerousPause; // pause in dangerous-state - - int harmlessDuration; // Length of harmless-time in ticks - int harmlessLeft; // rest of the time in harmless-state - int warningDuration; // warningtime before monster get dangerous again - - int arrestDuration; // Length of arrest in ticks - int arrestLeft; // time left of arrest - int arrestPause; // pause in arrest-state - - int actualDirection; // actual direction of monster - int lastDirection; // last direction, before no movement (X) - int actualPosition; // actual position on board - int lastPosition; // the last position of the monster - int feetPosition; // left, right, left, right, ... - int maxBodyPixmaps; - int maxEyesPixmaps; - int prisonPosition; // where to go, if arrested - int freedomPosition; // where to go, if released from prison -}; - -#endif // MONSTER_H - diff --git a/kpacman/pacman.cpp b/kpacman/pacman.cpp deleted file mode 100644 index 40f60a8..0000000 --- a/kpacman/pacman.cpp +++ /dev/null @@ -1,147 +0,0 @@ -#include "pacman.h" -#include "board.h" - -Pacman::Pacman(Board *b) -{ - board = b; - setDemo(FALSE); - setAlive(0); - actualPosition = lastPosition = OUT; - mouthPosition = 0; - lastPix = 0; - maxPixmaps = 0; -} - -void Pacman::setMaxPixmaps(int max) -{ - if (actualDirection == X && lastPix >= 0) { - actualDirection = lastPix / (maxPixmaps/4); - if (max < maxPixmaps) - mouthPosition = 0; - else - mouthPosition = lastPix % (maxPixmaps/4); - maxPixmaps = max; - - lastPix = pix(); - - actualDirection = X; - } else - maxPixmaps = max; -} - -void Pacman::setAlive(int ticks) -{ - actualState = alive; - pauseDuration = ticks; - pause = 0; -} - -void Pacman::setPosition(int pos) -{ - board->reset(lastPosition, pacman); - actualPosition = lastPosition = pos; - board->set(actualPosition, pacman); - mouthPosition = 0; -} - -void Pacman::setDirection(int dir, bool forced) -{ - if (forced || - board->isWay(actualPosition, dir, empty) || - board->isWay(actualPosition, dir, tunnel)) { - if (dir == X) - lastPix = pix(); - actualDirection = dir; - nextDirection = X; - } else - nextDirection = dir; -} - -void Pacman::setDemo(bool yes) -{ - demo = yes; -} - -pacmanState Pacman::state() -{ - return actualState; -} - -int Pacman::position() -{ - return actualPosition; -} - -int Pacman::direction() -{ - return actualDirection; -} - -bool Pacman::move() -{ - if (pause-- > 0) - return FALSE; - else - pause = pauseDuration; - - if (actualDirection == X || actualPosition == OUT) - return FALSE; - - lastPosition = actualPosition; - - if (demo) { - int d = actualDirection; - - do // try new direction, but not the opposite - d = rand() % 4; // direction, to prevent hectic movement. - while (d == board->turn(actualDirection)); - - while (!board->isWay(actualPosition, d, empty) && - !board->isWay(actualPosition, d, tunnel)) { - if (d != actualDirection) // if new actualDirection is not possible, - d = actualDirection; // try current actualDirection first. - else - d = rand() % 4; - } - - actualDirection = d; - actualPosition = board->move(actualPosition, actualDirection); - - } else { - - if (nextDirection != X) - if (board->isWay(actualPosition, nextDirection, empty) || - board->isWay(actualPosition, nextDirection, tunnel)) { - actualDirection = nextDirection; - nextDirection = X; - } - - if (board->isWay(actualPosition, actualDirection, empty) || - board->isWay(actualPosition, actualDirection, tunnel)) - actualPosition = board->move(actualPosition, actualDirection); - } - - if (actualPosition != lastPosition) { - board->reset(lastPosition, pacman); - board->set(actualPosition, pacman); - - if (++mouthPosition >= (maxPixmaps/4)) - mouthPosition = 0; - } - return TRUE; -} - -int Pacman::pix() -{ - if (actualPosition != OUT && maxPixmaps > 0) - switch (actualDirection) { - case N : return ((maxPixmaps/4)*0)+mouthPosition; - case E : return ((maxPixmaps/4)*1)+mouthPosition; - case S : return ((maxPixmaps/4)*2)+mouthPosition; - case W : return ((maxPixmaps/4)*3)+mouthPosition; - case X : return lastPix; - } - - return -1; -} - diff --git a/kpacman/pacman.h b/kpacman/pacman.h deleted file mode 100644 index 6f1a7c1..0000000 --- a/kpacman/pacman.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef PACMAN_H -#define PACMAN_H - -#include -#include -#include - -#include "board.h" - -enum pacmanState { alive }; - -class Pacman { -public: - Pacman(Board *b); - void init(bool Demo = FALSE); - void setMaxPixmaps(int max); - void setAlive(int ticks); - void setPosition(int pos); - void setDirection(int dir, bool forced = FALSE); - void setDemo(bool yes); - pacmanState state(); - int position(); - int direction(); - bool move(); - int pix(); - -private: - Board *board; - - pacmanState actualState; // the state of pacman - bool demo; // real life or just demo - - int pauseDuration; // number of ticks before next movement - int pause; // actual ticks before movement (0=move) - - int actualDirection; // actual direction of pacman - int nextDirection; // where he wants to go - int lastPix; // last Pixmap-index before no movement - int maxPixmaps; // Number of Pixmaps (1..) - int actualPosition; // actual position on board - int lastPosition; // the last position of pacman - int mouthPosition; // eating - -}; - -#endif // PACMAN_H - diff --git a/kpacman/painter.cpp b/kpacman/painter.cpp deleted file mode 100644 index 4c897c8..0000000 --- a/kpacman/painter.cpp +++ /dev/null @@ -1,955 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "painter.h" -#include "board.h" - -Painter::Painter( Board *b, TQWidget *parent, int Scheme, int Mode, Bitfont *font) -{ - w = parent; - board = b; - - pointPix = NULL; - wallPix = NULL; - prisonPix = NULL; - energizerPix = NULL; - fruitPix = NULL; - pacmanPix = NULL; - dyingPix = NULL; - eyesPix = NULL; - monsterPix = NULL; - fruitScorePix = NULL; - monsterScorePix = NULL; - - lastPointPixmapName = ""; - lastWallPixmapName = ""; - lastPrisonPixmapName = ""; - lastEnergizerPixmapName = ""; - lastFruitPixmapName = ""; - lastPacmanPixmapName = ""; - lastDyingPixmapName = ""; - lastEyesPixmapName = ""; - lastMonsterPixmapName = ""; - lastFruitScorePixmapName = ""; - lastMonsterScorePixmapName = ""; - - bitfont = font; - - scheme = Scheme; - mode = Mode; - level = 0; - - confScheme(); -} - -TQPtrList *Painter::loadPixmap(TQWidget *parent, TQString pixmapName, - TQPtrList *pixmaps) -{ - if (pixmaps == NULL) { - pixmaps = new TQPtrList; - pixmaps->setAutoDelete(TRUE); - } - - if (!pixmaps->isEmpty()) - pixmaps->clear(); - - TQPixmap PIXMAP(pixmapName); - if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { - TQString msg = i18n("The pixmap could not be contructed.\n\n" - "The file '@PIXMAPNAME@' does not exist,\n" - "or is of an unknown format."); - msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName); - // TQMessageBox::critical(parent, i18n("Initialization Error"), msg); - printf("%s\n", msg.local8Bit().data()); - return 0; - } - - int height = PIXMAP.height(); - int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); - - TQBitmap BITMAP; - TQBitmap MASK; - - BITMAP = *PIXMAP.mask(); - MASK.resize(width, height); - - for (int x = 0; x < PIXMAP.width()/width; x++) { - TQPixmap *pixmap = new TQPixmap(width, height); - pixmaps->append(pixmap); - bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE); - bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE); - pixmap->setMask(MASK); - } - - return pixmaps; -} - -TQPtrList *Painter::textPixmap(TQStrList &str, TQPtrList *pixmaps, - TQColor fg, TQColor bg) -{ - if (pixmaps == NULL) { - pixmaps = new TQPtrList; - pixmaps->setAutoDelete(TRUE); - } - - if (!pixmaps->isEmpty()) - pixmaps->clear(); - - for (uint s = 0; s < str.count(); s++) { - TQPixmap *pixmap = new TQPixmap(bitfont->text(str.at(s), fg, bg)); - pixmaps->append(pixmap); - } - - return pixmaps; -} - -TQPtrList *Painter::textPixmap(TQString str, TQPtrList *pixmaps, - TQColor fg, TQColor bg) -{ - if (pixmaps == NULL) { - pixmaps = new TQPtrList; - pixmaps->setAutoDelete(TRUE); - } - - if (!pixmaps->isEmpty()) - pixmaps->clear(); - - TQPixmap *pixmap = new TQPixmap(bitfont->text(str, fg, bg)); - pixmaps->append(pixmap); - - return pixmaps; -} - -/* Return the point of the upperleft pixel of the block representing that position - * on the board. - */ -TQPoint Painter::point(int pos) -{ - return TQPoint((board->x(pos)-1)*BlockWidth, (board->y(pos)-1)*BlockHeight); -} - - -TQRect Painter::rect(int pos, PixMap pix, uint i) -{ - if (pos == OUT) - return TQRect(); - - TQPixmap *PIXMAP = NULL; - switch (pix) { - case PacmanPix : PIXMAP = pacmanPix-> - at(checkRange(i, pacmanPix->count()-1)); - break; - case DyingPix : PIXMAP = dyingPix-> - at(checkRange(i, dyingPix->count()-1)); - break; - case MonsterPix : PIXMAP = monsterPix-> - at(checkRange(i, monsterPix->count()-1)); - break; - case EyesPix : PIXMAP = eyesPix-> - at(checkRange(i, eyesPix->count()-1)); - break; - case FruitPix : PIXMAP = fruitPix-> - at(checkRange(i, fruitPix->count()-1)); - break; - case PointPix : PIXMAP = pointPix-> - at(checkRange(i, pointPix->count()-1)); - break; - case EnergizerPix : PIXMAP = energizerPix-> - at(checkRange(i, energizerPix->count()-1)); - break; - case FruitScorePix : PIXMAP = fruitScorePix-> - at(checkRange(i, fruitScorePix->count()-1)); - break; - case MonsterScorePix : PIXMAP = monsterScorePix-> - at(checkRange(i,monsterScorePix->count()-1)); - break; - default : PIXMAP = wallPix-> - at(checkRange(i, wallPix->count()-1)); - } - if (PIXMAP == NULL) - return TQRect(); - - TQRect rect = PIXMAP->rect(); - TQPoint point = this->point(pos); - rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); - - return rect; -} - -TQRect Painter::rect(int pos, TQString str, int align) -{ - if (pos == OUT) // return an empty rect if the position - return TQRect(); // is invalid - TQPoint point = this->point(pos); - TQRect rect = bitfont->rect(str); - - rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); - - int dx = 0; - int dy = 0; - - if (align & TQLabel::AlignLeft || align & TQLabel::AlignRight) { - dx = (str.length()-1) * (bitfont->width()/2); - if (align & TQLabel::AlignRight) - dx *= -1; - } - - if (align & TQLabel::AlignTop || align & TQLabel::AlignBottom) { - dy = bitfont->height()/2; - if (align & TQLabel::AlignBottom) - dy *= -1; - } - - if (dx != 0 || dy != 0) - rect.moveBy(dx, dy); - - return rect; -} - -TQRect Painter::rect(TQRect r1, TQRect r2) -{ - TQRect rect; - rect.setLeft(r1.left() < r2.left() ? r1.left() : r2.left()); - rect.setTop(r1.top() < r2.top() ? r1.top() : r2.top()); - rect.setRight(r1.right() > r2.right() ? r1.right() : r2.right()); - rect.setBottom(r1.bottom() > r2.bottom() ? r1.bottom() : r2.bottom()); - - return rect; -} - -void Painter::erase(int pos, PixMap pix, uint i) -{ - if (pos == OUT) - return; - TQRect rect = this->rect(pos, pix, i); - bitBlt(&roomPix, rect.x(), rect.y(), &backPix, - rect.x(), rect.y(), rect.width(), rect.height()); -} - -int Painter::maxPixmaps(PixMap pix) -{ - switch (pix) { - case WallPix : return (int) wallPix->count(); - case PrisonPix : return (int) prisonPix->count(); - case PointPix : return (int) pointPix->count(); - case EnergizerPix : return (int) energizerPix->count(); - case FruitPix : return (int) fruitPix->count(); - case PacmanPix : return (int) pacmanPix->count(); - case DyingPix : return (int) dyingPix->count(); - case EyesPix : return (int) eyesPix->count(); - case MonsterPix : return (int) monsterPix->count(); - case FruitScorePix : return (int) fruitScorePix->count(); - case MonsterScorePix : return (int) monsterScorePix->count(); - default : return 0; - } -} - -void Painter::draw(TQPoint point, DrawWidget where, TQPixmap pix) -{ - switch (where) { - case Widget : bitBlt(w, point.x(), point.y(), &pix); - break; - case RoomPix : bitBlt(&roomPix, point.x(), point.y(), &pix); - break; - case BackPix : bitBlt(&backPix, point.x(), point.y(), &pix); - break; - } -} - -void Painter::draw(TQRect rect, DrawWidget where, TQPixmap pix) -{ - draw(TQPoint(rect.x(), rect.y()), where, pix); -} - -void Painter::draw(int pos, DrawWidget where, PixMap pix, uint i) -{ - TQPixmap *PIXMAP = NULL; - switch (pix) { - case PacmanPix : PIXMAP = pacmanPix-> - at(checkRange(i, pacmanPix->count()-1)); - break; - case DyingPix : PIXMAP = dyingPix-> - at(checkRange(i, dyingPix->count()-1)); - break; - case MonsterPix : PIXMAP = monsterPix-> - at(checkRange(i, monsterPix->count()-1)); - break; - case EyesPix : PIXMAP = eyesPix-> - at(checkRange(i, eyesPix->count()-1)); - break; - case FruitPix : PIXMAP = fruitPix-> - at(checkRange(i, fruitPix->count()-1)); - break; - case EnergizerPix : PIXMAP = energizerPix-> - at(checkRange(i, energizerPix->count()-1)); - break; - case FruitScorePix : PIXMAP = fruitScorePix-> - at(checkRange(i, fruitScorePix->count()-1)); - break; - case MonsterScorePix : PIXMAP = monsterScorePix-> - at(checkRange(i,monsterScorePix->count()-1)); - break; - default : ; - } - - if (PIXMAP == NULL) - return; - - TQRect rect = PIXMAP->rect(); - TQPoint point = this->point(pos); - rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); - - switch (where) { - case Widget : bitBlt(w, rect.x(), rect.y(), PIXMAP); - break; - case RoomPix : bitBlt(&roomPix, rect.x(), rect.y(), PIXMAP); - break; - case BackPix : bitBlt(&backPix, rect.x(), rect.y(), PIXMAP); - break; - } -} - -TQPixmap Painter::draw(int pos, DrawWidget where, - TQString str, TQColor fg, TQColor bg, int align) -{ - TQPixmap TEXT = bitfont->text(str, fg, bg); - - TQRect rect = this->rect(pos, str, align); - TQPixmap SAVE = TQPixmap(rect.width(), rect.height()); - - switch (where) { - case Widget : bitBlt(&SAVE, 0, 0, w, rect.x(), rect.y()); - bitBlt(w, rect.x(), rect.y(), &TEXT); - break; - case RoomPix : bitBlt(&SAVE, 0, 0, &roomPix, rect.x(), rect.y()); - bitBlt(&roomPix, rect.x(), rect.y(), &TEXT); - break; - case BackPix : bitBlt(&SAVE, 0, 0, &backPix, rect.x(), rect.y()); - bitBlt(&backPix, rect.x(), rect.y(), &TEXT); - break; - } - - return SAVE; -} - -TQRect Painter::draw(int col, int row, DrawWidget where, - TQString str, TQColor fg, TQColor bg, int align) -{ - TQPixmap TEXT = bitfont->text(str, fg, bg); - - TQRect rect = this->rect(row*BoardWidth+col, str, align); - draw(rect, where, TEXT); - - return rect; -} - -void Painter::initPixmaps() -{ - if (lastPointPixmapName != pointPixmapName.at(level)) { - pointPix = loadPixmap(w, pointPixmapName.at(level), pointPix); - lastPointPixmapName = pointPixmapName.at(level); - } - if (lastPrisonPixmapName != prisonPixmapName.at(level)) { - prisonPix = loadPixmap(w, prisonPixmapName.at(level), prisonPix); - lastPrisonPixmapName = prisonPixmapName.at(level); - } - if (lastEnergizerPixmapName != energizerPixmapName.at(level)) { - energizerPix = loadPixmap(w, energizerPixmapName.at(level), energizerPix); - lastEnergizerPixmapName = energizerPixmapName.at(level); - } - if (lastFruitPixmapName != fruitPixmapName.at(level)) { - fruitPix = loadPixmap(w, fruitPixmapName.at(level), fruitPix); - lastFruitPixmapName = fruitPixmapName.at(level); - } - if (lastPacmanPixmapName != pacmanPixmapName.at(level)) { - pacmanPix = loadPixmap(w, pacmanPixmapName.at(level), pacmanPix); - lastPacmanPixmapName = pacmanPixmapName.at(level); - } - if (lastDyingPixmapName != dyingPixmapName.at(level)) { - dyingPix = loadPixmap(w, dyingPixmapName.at(level), dyingPix); - lastDyingPixmapName = dyingPixmapName.at(level); - } - if (lastEyesPixmapName != eyesPixmapName.at(level)) { - eyesPix = loadPixmap(w, eyesPixmapName.at(level), eyesPix); - lastEyesPixmapName = eyesPixmapName.at(level); - } - if (lastMonsterPixmapName != monsterPixmapName.at(level)) { - monsterPix = loadPixmap(w, monsterPixmapName.at(level), monsterPix); - lastMonsterPixmapName = monsterPixmapName.at(level); - } - - if (lastFruitScorePixmapName != fruitScorePixmapName.at(level) || - *fruitScorePixmapName.at(level) == '\0') { - if (*fruitScorePixmapName.at(level) == '\0') { - fruitScorePix = textPixmap(fruitScoreString, fruitScorePix, PINK); - } else { - fruitScorePix = loadPixmap(w, fruitScorePixmapName.at(level), - fruitScorePix); - lastFruitScorePixmapName = fruitScorePixmapName.at(level); - } - } - - if (lastMonsterScorePixmapName != monsterScorePixmapName.at(level) || - *monsterScorePixmapName.at(level) == '\0') { - if (*monsterScorePixmapName.at(level) == '\0') { - monsterScorePix = textPixmap(monsterScoreString, monsterScorePix, CYAN); - } else { - monsterScorePix = loadPixmap(w, monsterScorePixmapName.at(level), - monsterScorePix); - lastMonsterScorePixmapName = monsterScorePixmapName.at(level); - } - } - - if (lastWallPixmapName != wallPixmapName.at(level)) { - wallPix = loadPixmap(w, wallPixmapName.at(level), wallPix); - if (wallPix->isEmpty()) { - BlockWidth = 0; - BlockHeight = 0; - } else { - BlockWidth = wallPix->at(0)->width(); - BlockHeight = wallPix->at(0)->height(); - } - lastWallPixmapName = wallPixmapName.at(level); - } -} - -void Painter::initbackPixmaps() -{ - backgroundColor = BLACK; - - backPix.resize((BoardWidth-3)*BlockWidth, (BoardHeight-3)*BlockHeight ); - backPix.fill(backgroundColor); -} - -void Painter::initRoomPixmap() -{ - roomPix.resize((BoardWidth-3)*BlockWidth, (BoardHeight-3)*BlockHeight ); - bitBlt(&roomPix,0,0, &backPix); - - for (unsigned int x = 0; x < board->size(); x++) { - if (board->isBrick(x)) - drawBrick(x); - if (board->isPrison(x) || board->isGate(x)) - drawPrison(x); - if (board->isPoint(x)) - drawPoint(x); - } -} - -void Painter::drawBrick(int pos) -{ - int border = 0; - if (board->isBrick(board->move(pos, N ))) border |= (1 << 0); - if (board->isBrick(board->move(pos, NE))) border |= (1 << 1); - if (board->isBrick(board->move(pos, E ))) border |= (1 << 2); - if (board->isBrick(board->move(pos, SE))) border |= (1 << 3); - if (board->isBrick(board->move(pos, S ))) border |= (1 << 4); - if (board->isBrick(board->move(pos, SW))) border |= (1 << 5); - if (board->isBrick(board->move(pos, W ))) border |= (1 << 6); - if (board->isBrick(board->move(pos, NW))) border |= (1 << 7); - - if (board->isOut(board->move(pos, N ))) border |= (1 << 8); - if (board->isOut(board->move(pos, NE))) border |= (1 << 9); - if (board->isOut(board->move(pos, E ))) border |= (1 << 10); - if (board->isOut(board->move(pos, SE))) border |= (1 << 11); - if (board->isOut(board->move(pos, S ))) border |= (1 << 12); - if (board->isOut(board->move(pos, SW))) border |= (1 << 13); - if (board->isOut(board->move(pos, W ))) border |= (1 << 14); - if (board->isOut(board->move(pos, NW))) border |= (1 << 15); - - switch (border & 0xFF) { - case 31 : border = 0; break; - case 159 : border = 0; break; - case 63 : border = 0; break; - case 191 : border = 0; break; - case 241 : border = 1; break; - case 249 : border = 1; break; - case 243 : border = 1; break; - case 251 : border = 1; break; - case 124 : border = 2; break; - case 252 : border = 2; break; - case 126 : border = 2; break; - case 199 : border = 3; break; - case 231 : border = 3; break; - case 207 : border = 3; break; - case 28 : if ((border >> 8) > 0) - border = 24; - else - border = 4; - break; - case 112 : if ((border >> 8) > 0) - border = 27; - else - border = 5; - break; - case 7 : if ((border >> 8) > 0) - border = 25; - else - border = 6; - break; - case 193 : if ((border >> 8) > 0) - border = 26; - else - border = 7; - break; - case 247 : if ((border & (1 << 11)) > 0) - border = 23; - else - border = 8; - break; - case 119 : if ((border & (1 << 15)) > 0) - border = 8; - if ((border & (1 << 11)) > 0) - border = 11; - break; - case 223 : if ((border & (1 << 13)) > 0) - border = 20; - else - border = 9; - break; - case 221 : if ((border & (1 << 13)) > 0) - border = 10; - if ((border & (1 << 9)) > 0) - border = 9; - break; - case 253 : if ((border & (1 << 9)) > 0) - border = 21; - else - border = 10; - break; - case 127 : if ((border & (1 << 15)) > 0) - border = 22; - else - border = 11; - break; - case 30 : border = 12; break; - case 240 : border = 13; break; - case 15 : border = 14; break; - case 225 : border = 15; break; - case 135 : border = 16; break; - case 195 : border = 17; break; - case 60 : border = 18; break; - case 120 : border = 19; break; - case 255 : border = 28; break; - default : border = -1; - } - if (border != -1 && border < (int) wallPix->count()) { - TQRect rect = this->rect(pos, WallPix); - bitBlt(&roomPix, rect.x(), rect.y(), wallPix->at((uint) border)); - } -} - -void Painter::drawPrison(int pos) -{ - int border = 0; - if (board->isPrison(board->move(pos, N ))) border |= (1 << 0); - if (board->isPrison(board->move(pos, NE))) border |= (1 << 1); - if (board->isPrison(board->move(pos, E ))) border |= (1 << 2); - if (board->isPrison(board->move(pos, SE))) border |= (1 << 3); - if (board->isPrison(board->move(pos, S ))) border |= (1 << 4); - if (board->isPrison(board->move(pos, SW))) border |= (1 << 5); - if (board->isPrison(board->move(pos, W ))) border |= (1 << 6); - if (board->isPrison(board->move(pos, NW))) border |= (1 << 7); - - if (board->isGate(board->move(pos, N ))) border |= (1 << 8); - if (board->isGate(board->move(pos, NE))) border |= (1 << 9); - if (board->isGate(board->move(pos, E ))) border |= (1 << 10); - if (board->isGate(board->move(pos, SE))) border |= (1 << 11); - if (board->isGate(board->move(pos, S ))) border |= (1 << 12); - if (board->isGate(board->move(pos, SW))) border |= (1 << 13); - if (board->isGate(board->move(pos, W ))) border |= (1 << 14); - if (board->isGate(board->move(pos, NW))) border |= (1 << 15); - - switch (border & 0xFF) { - case 31 : border = 0; break; - case 159 : border = 0; break; - case 63 : border = 0; break; - case 241 : border = 1; break; - case 249 : border = 1; break; - case 243 : border = 1; break; - case 124 : border = 2; break; - case 252 : border = 2; break; - case 126 : border = 2; break; - case 199 : border = 3; break; - case 231 : border = 3; break; - case 207 : border = 3; break; - case 28 : if ((border >> 8) != 0) - border = 12; - else - border = 4; - break; - case 112 : if ((border >> 8) != 0) - border = 13; - else - border = 5; - break; - case 7 : if ((border >> 8) != 0) - border = 14; - else - border = 6; - break; - case 193 : if ((border >> 8) != 0) - border = 15; - else - border = 7; - break; - case 247 : border = 8; break; - case 223 : border = 9; break; - case 253 : border = 10; break; - case 127 : border = 11; break; - default : border = -1; - } - if (board->isGate(pos)) { - if (board->isGate(board->move(pos, N))) - border = 17; - else - border = 16; - } - - if (border != -1 && border < (int) prisonPix->count()) { - TQRect rect = this->rect(pos, PrisonPix); - bitBlt(&roomPix, rect.x(), rect.y(), prisonPix->at((uint) border)); - } -} - -void Painter::drawPoint(int pos) -{ - if (!pointPix->isEmpty()) { - TQRect rect = this->rect(pos, PointPix); - bitBlt(&roomPix, rect.x(), rect.y(), pointPix->at(0)); - } -} - -TQString Painter::decodeHexOctString(TQString s) -{ - TQString value; - TQString valids; - int pos, xpos = 0, opos = 0; - int v, len, leadin; - const char *ptr; - uchar c; - - while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) || - ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) { - if (xpos != -1) { - valids = "0123456789abcdef"; - leadin = 2; - pos = xpos; - } else { - valids = "01234567"; - leadin = 1; - pos = opos; - } - - c = '\0'; - len = 0; - value = s.mid(pos+leadin, 3); - ptr = value.latin1(); - - while (*ptr != '\0' && (v = valids.find(*ptr++, 0, FALSE)) != -1) { - c = (c * valids.length()) + v; - len++; - } - - value.fill(c, 1); - s.replace(pos, len+leadin, value); - } - - return s; -} - -void Painter::fillScoreString(TQStrList &list, TQMemArray &values) -{ - if( !list.isEmpty()) - list.clear(); - - TQString s; - - for (uint i = 0; i < values.size(); i++) { - - if (values[i] < 10 || values[i] > 10000) - s = "?"; - else if (values[i] == 1600) - s = "\x1a\x1b"; - else if (values[i] < 100) { - s = "\x0e"; - s.insert(0, char (values[i] / 10 + 0x10)); - } else if (values[i] < 1000) { - s = "\x0f"; - s.insert(0, char (values[i] / 100 + 0x10)); - } else { - s = "\x0f\x10"; - s.insert(0, char (values[i] / 1000 + 0x10)); - } - - list.append(s.latin1()); - } -} - -void Painter::fillArray(TQMemArray &array, TQString values, int max) -{ - array.resize(max); - int last = 0; - bool ok; - TQString value; - - for (uint i = 0; i < array.size(); i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - array[i] = value.toInt(&ok); - if (ok) - last = array[i]; - else - array[i] = last; - } -} - -void Painter::fillStrList(TQStrList &list, TQString values, int max) -{ - if (!list.isEmpty()) - list.clear(); - - TQString last = ""; - TQString value; - - for (uint i = 0; i < (uint) max; i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - if (!value.isEmpty()) - last = decodeHexOctString(value); - list.append(last.latin1()); - } -} - -void Painter::fillPixmapName(TQStrList &pixmapName) -{ - TQStrList list = pixmapName; - - if (!pixmapName.isEmpty()) - pixmapName.clear(); - - TQString pixmap; - - TQFileInfo fileInfo; - - for (uint i = 0; i < list.count(); i++) { - pixmap = list.at(i); - - if (pixmap.left(1) != "/" && pixmap.left(1) != "~") - pixmap = TDEGlobal::dirs()->findResource("appdata", pixmapDirectory+pixmap); - - fileInfo.setFile(pixmap); - if (!fileInfo.isReadable() || !fileInfo.isFile()) - pixmap = ""; - - pixmapName.append(pixmap.utf8()); - } -} - -void Painter::confLevels(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("Levels")) - maxLevel = kapp->config()->readNumEntry("Levels", 13); -} - -void Painter::confMisc(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { - pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); - - if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") - pixmapDirectory.insert(0, "pics/"); - if (pixmapDirectory.right(1) != "/") - pixmapDirectory.append("/"); - } - - if (defGroup || kapp->config()->hasKey("PointPixmapName")) - fillStrList(pointPixmapName, - kapp->config()->readEntry("PointPixmapName", "point.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("WallPixmapName")) - fillStrList(wallPixmapName, - kapp->config()->readEntry("WallPixmapName", "wall.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("PrisonPixmapName")) - fillStrList(prisonPixmapName, - kapp->config()->readEntry("PrisonPixmapName", "prison.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("EnergizerPixmapName")) - fillStrList(energizerPixmapName, - kapp->config()->readEntry("EnergizerPixmapName", "switch.xpm"),maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitPixmapName")) - fillStrList(fruitPixmapName, - kapp->config()->readEntry("FruitPixmapName", "fruit.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("PacmanPixmapName")) - fillStrList(pacmanPixmapName, - kapp->config()->readEntry("PacmanPixmapName", "pacman.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("DyingPixmapName")) - fillStrList(dyingPixmapName, - kapp->config()->readEntry("DyingPixmapName", "dying.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("EyesPixmapName")) - fillStrList(eyesPixmapName, - kapp->config()->readEntry("EyesPixmapName", "eyes.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("MonsterPixmapName")) - fillStrList(monsterPixmapName, - kapp->config()->readEntry("MonsterPixmapName", "monster.xpm"), maxLevel+1); - - if (defGroup || kapp->config()->hasKey("FruitScorePixmapName")) - fillStrList(fruitScorePixmapName, - kapp->config()->readEntry("FruitScorePixmapName"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("MonsterScorePixmapName")) - fillStrList(monsterScorePixmapName, - kapp->config()->readEntry("MonsterScorePixmapName"), maxLevel+1); -} - -void Painter::confScoring(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("FruitScore")) - fillArray(fruitScore, - kapp->config()->readEntry("FruitScore", - "100,300,500,,700,,1000,,2000,,3000,,5000"), - maxLevel+1); - if (defGroup || kapp->config()->hasKey("MonsterScore")) - fillArray(monsterScore, - kapp->config()->readEntry("MonsterScore", "200,400,800,1600"), 4); - - if (defGroup || kapp->config()->hasKey("FruitScoreString")) - fillStrList(fruitScoreString, - kapp->config()->readEntry("FruitScoreString"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("MonsterScoreString")) - fillStrList(monsterScoreString, - kapp->config()->readEntry("MonsterScoreString"), 4); -} - -void Painter::confScheme() -{ - TQString oldgroup = kapp->config()->group(); - TQString newgroup; - - // if not set, read mode and scheme from the configfile - if (mode == -1 && scheme == -1) { - scheme = kapp->config()->readNumEntry("Scheme", -1); - mode = kapp->config()->readNumEntry("Mode", -1); - - // if mode is not set in the defGroup-group, lookup the scheme group - if (scheme != -1 || mode == -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - mode = kapp->config()->readNumEntry("Mode", -1); - kapp->config()->setGroup(oldgroup); - } - } - - confLevels(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - kapp->config()->setGroup(oldgroup); - - confMisc(); - confScoring(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - confScoring(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - confScoring(FALSE); - } - - if (*fruitScoreString.at(0) == '\0') - fillScoreString(fruitScoreString, fruitScore); - if (*monsterScoreString.at(0) == '\0') - fillScoreString(monsterScoreString, monsterScore); - - fillPixmapName(pointPixmapName); - fillPixmapName(wallPixmapName); - fillPixmapName(prisonPixmapName); - fillPixmapName(energizerPixmapName); - fillPixmapName(fruitPixmapName); - fillPixmapName(pacmanPixmapName); - fillPixmapName(dyingPixmapName); - fillPixmapName(eyesPixmapName); - fillPixmapName(monsterPixmapName); - fillPixmapName(fruitScorePixmapName); - fillPixmapName(monsterScorePixmapName); - - initPixmaps(); - initbackPixmaps(); - initRoomPixmap(); - - kapp->config()->setGroup(oldgroup); -} - -void Painter::setScheme(int Scheme, int Mode, Bitfont *font) -{ - bitfont = font; - - mode = Mode; - scheme = Scheme; - - confScheme(); -} - -void Painter::setLevel(int Level) -{ - level = Level; - - initPixmaps(); - initbackPixmaps(); - initRoomPixmap(); -} - -int Painter::checkRange(int value, int max, int min) -{ - if (value < min) { - printf("Painter::checkRange (value = %d, max = %d, min = %d)\n", - value, max, min); - return min; - } else if (value > max) { - printf("Painter::checkRange (value = %d, max = %d, min = %d)\n", - value, max, min); - return max; - } else - return value; -} diff --git a/kpacman/painter.h b/kpacman/painter.h deleted file mode 100644 index a15c615..0000000 --- a/kpacman/painter.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef PAINTER_H -#define PAINTER_H - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "board.h" -#include "bitfont.h" -#include "colors.h" - -enum PixMap { PacmanPix, DyingPix, MonsterPix, EyesPix, FruitPix, - PointPix, EnergizerPix, WallPix, PrisonPix, - FruitScorePix, MonsterScorePix }; -enum DrawWidget { Widget, RoomPix, BackPix }; - -class Painter -{ -public: - Painter (Board *, TQWidget *parent=0, int scheme=-1, int mode=-1,Bitfont *font=0); - TQPixmap levelPix() { return roomPix; } - - void setScheme(int scheme=-1, int mode=-1, Bitfont *font=0); - void setLevel(int level=0); - - TQRect rect(int pos, PixMap pix, uint i = 0); - TQRect rect(int pos, TQString str, int align = TQLabel::AlignCenter ); - TQRect rect(TQRect r1, TQRect r2); - - void draw(TQPoint point, DrawWidget where, TQPixmap pix); - void draw(TQRect rect, DrawWidget where, TQPixmap pix); - void draw(int pos, DrawWidget where, PixMap pix, uint i = 0); - TQPixmap draw(int pos, DrawWidget where, TQString str, - TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter); - TQRect draw(int col, int row, DrawWidget where, TQString str, - TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter); - - void drawBrick(int pos); - void drawPrison(int pos); - void drawPoint(int pos); - - void erase(int pos, PixMap pix, uint i = 0); - - int maxPixmaps(PixMap pix); - -protected: - TQString decodeHexOctString(TQString str); - - void fillScoreString(TQStrList &, TQMemArray &); - void fillArray(TQMemArray &, TQString, int); - void fillStrList(TQStrList &, TQString, int); - void fillPixmapName(TQStrList &); - - void confScheme(); - void confLevels(bool defGroup=TRUE); - void confMisc(bool defGroup=TRUE); - void confScoring(bool defGroup=TRUE); - - void initPixmaps(); - void initRoomPixmap(); - void initbackPixmaps(); - -private: - TQWidget *w; - Board *board; - Bitfont *bitfont; - - int BlockWidth; - int BlockHeight; - - TQMemArray fruitScore; - TQStrList fruitScoreString; - TQMemArray monsterScore; - TQStrList monsterScoreString; - - TQString pixmapDirectory; - - TQStrList pointPixmapName; - TQStrList wallPixmapName; - TQStrList prisonPixmapName; - TQStrList energizerPixmapName; - TQStrList fruitPixmapName; - TQStrList pacmanPixmapName; - TQStrList dyingPixmapName; - TQStrList eyesPixmapName; - TQStrList monsterPixmapName; - TQStrList fruitScorePixmapName; - TQStrList monsterScorePixmapName; - - TQString lastPointPixmapName; - TQString lastWallPixmapName; - TQString lastPrisonPixmapName; - TQString lastEnergizerPixmapName; - TQString lastFruitPixmapName; - TQString lastPacmanPixmapName; - TQString lastDyingPixmapName; - TQString lastEyesPixmapName; - TQString lastMonsterPixmapName; - TQString lastFruitScorePixmapName; - TQString lastMonsterScorePixmapName; - - TQPtrList *loadPixmap(TQWidget *parent, TQString pixmapName, - TQPtrList *pixmaps=0); - TQPtrList *textPixmap(TQStrList &, TQPtrList *pixmaps=0, - TQColor fg = BLACK, TQColor bg = TQColor()); - TQPtrList *textPixmap(TQString str, TQPtrList *pixmaps=0, - TQColor fg = BLACK, TQColor bg = TQColor()); - - TQPoint point(int pos); - int checkRange(int value, int max, int min=0); - - TQPtrList *wallPix; - TQPtrList *prisonPix; - TQPtrList *pointPix; - TQPtrList *energizerPix; - TQPtrList *fruitPix; - TQPtrList *pacmanPix; - TQPtrList *dyingPix; - TQPtrList *eyesPix; - TQPtrList *monsterPix; - TQPtrList *fruitScorePix; - TQPtrList *monsterScorePix; - - TQPixmap roomPix; - TQPixmap backPix; - - bool plainColor; - TQColor backgroundColor; - - int maxLevel; - int level; - - int scheme; - int mode; -}; - -#endif // PAINTER_H diff --git a/kpacman/referee.cpp b/kpacman/referee.cpp deleted file mode 100644 index 1f4e2bc..0000000 --- a/kpacman/referee.cpp +++ /dev/null @@ -1,1393 +0,0 @@ -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "referee.h" -#include "board.h" -#include "pacman.h" -#include "monster.h" -#include "fruit.h" -#include "painter.h" - -Referee::Referee( TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) - : TQWidget( parent, name ) -{ - gameState.resize(12); - gameTimer = 0; - energizerTimer = 0; - - focusedPause = false; - setFocusPolicy(TQWidget::StrongFocus); - - initKeys(); - - scheme = Scheme; - mode = Mode; - confScheme(); - - board = new Board(BoardWidth*BoardHeight); - - pix = new Painter(board, this, scheme, mode, font); - setFixedSize(pix->levelPix().size()); - - pacman = new Pacman(board); - - fruit = new Fruit(board); - - monsters = new TQPtrList; - monsters->setAutoDelete(TRUE); - - monsterRect = new TQPtrList; - monsterRect->setAutoDelete(TRUE); - - energizers = new TQPtrList; - energizers->setAutoDelete(TRUE); - - energizerRect = new TQPtrList; - energizerRect->setAutoDelete(TRUE); - - pacmanRect.setRect(0, 0, 0, 0); - fruitRect.setRect(0, 0, 0, 0); - - TQTime midnight( 0, 0, 0 ); - srand( midnight.secsTo(TQTime::currentTime()) ); - - lifes = 0; - points = 0; - - emit setLifes(lifes); - emit setPoints(points); - - intro(); -} - -void Referee::paintEvent( TQPaintEvent *e) -{ - if (gameState.testBit(HallOfFame)) - return; - - TQRect rect = e->rect(); - - if (!rect.isEmpty()) { - TQPixmap p = pix->levelPix(); - bitBlt(this, rect.x(), rect.y(), - &p, rect.x(), rect.y(), rect.width(), rect.height()); - } - - if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) && - rect.intersects(pix->rect(board->position(fruithome), i18n("GAME OVER")))) - pix->draw(board->position(fruithome), Widget, i18n("GAME OVER"), RED); - - for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) { - if (e && e->state() == on && - rect.intersects(pix->rect(e->position(), EnergizerPix)) && - !(e->position() == pacman->position() && gameState.testBit(Scoring))) { - if (e->pix() != -1) - pix->draw(e->position(), Widget, EnergizerPix, e->pix()); - } - } - - if (!gameState.testBit(Init)) { - - if (!gameState.testBit(Dying) && (fruit->pix() != -1)) - if (fruit->state() != active) { - if (rect.intersects(pix->rect(fruit->position(), FruitScorePix, fruit->pix()))) - pix->draw(fruit->position(), Widget, FruitScorePix, fruit->pix()); - } else { - if (rect.intersects(pix->rect(fruit->position(), FruitPix, fruit->pix()))) - pix->draw(fruit->position(), Widget, FruitPix, fruit->pix()); - } - - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->state() == harmless && - rect.intersects(pix->rect(m->position(), MonsterPix)) && - !(m->position() == pacman->position() && gameState.testBit(Scoring))) { - if (m->body() != -1) - pix->draw(m->position(), Widget, MonsterPix, m->body()); - if (m->eyes() != -1) - pix->draw(m->position(), Widget, EyesPix, m->eyes()); - } - - if (!gameState.testBit(Scoring) && !gameState.testBit(LevelDone) && - rect.intersects(pix->rect(pacman->position(), PacmanPix)) && pacman->pix() != -1) - pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); - - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->state() != harmless && - rect.intersects(pix->rect(m->position(), MonsterPix)) && - !(m->position() == pacman->position() && gameState.testBit(Scoring))) { - if (m->body() != -1) - pix->draw(m->position(), Widget, MonsterPix, m->body()); - if (m->eyes() != -1) - pix->draw(m->position(), Widget, EyesPix, m->eyes()); - } - } - - if (gameState.testBit(Scoring) && - rect.intersects(pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))) - pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1); - - if (gameState.testBit(Init) && gameState.testBit(Dying) && - timerCount < pix->maxPixmaps(DyingPix) && - rect.intersects(pix->rect(pacman->position(), PacmanPix))) - pix->draw(pacman->position(), Widget, DyingPix, timerCount); - - if (gameState.testBit(LevelDone) && - rect.intersects(pix->rect(pacman->position(), PacmanPix))) - pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); - - if (gameState.testBit(Player) && - rect.intersects(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")))) - pix->draw(board->position(monsterhome, 0), Widget, i18n("PLAYER ONE"), CYAN); - - if (gameState.testBit(Ready) && - rect.intersects(pix->rect(board->position(fruithome), i18n("READY!")))) - pix->draw(board->position(fruithome), Widget, i18n("READY!"), YELLOW); - - if (gameState.testBit(Paused) && - rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")))) - pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, i18n("PAUSED"), RED, BLACK); -} - -void Referee::timerEvent( TQTimerEvent *e ) -{ - if (gameState.testBit(HallOfFame)) - return; - - TQRect lastRect; - int lastPix; - bool moved = FALSE; - int eated = 0; - - if (e->timerId() == energizerTimer) { - for (int e = 0; e < board->energizers(); e++) { - lastRect = pix->rect(energizers->at(e)->position(), EnergizerPix); - lastPix = energizers->at(e)->pix(); - if (energizers->at(e)->move()) { - moved = TRUE; - *energizerRect->at(e) = pix->rect(energizers->at(e)->position(), EnergizerPix); - if (lastPix == energizers->at(e)->pix() && - lastRect == pix->rect(energizers->at(e)->position(), EnergizerPix)) - energizerRect->at(e)->setRect(0, 0, 0, 0); - else - *energizerRect->at(e) = pix->rect(*energizerRect->at(e), lastRect); - } - } - - for (int e = 0; e < board->energizers(); e++) - if (!energizerRect->at(e)->isNull()) - repaint(*energizerRect->at(e), FALSE); - - return; - } - - timerCount++; - - lastRect = pix->rect(pacman->position(), PacmanPix); - lastPix = pacman->pix(); - - if (moved = pacman->move()) { // pacman really moved - pacmanRect = pix->rect(pacman->position(), PacmanPix); - if (lastPix == pacman->pix() && - lastRect == pix->rect(pacman->position(), PacmanPix)) - pacmanRect.setRect(0, 0, 0, 0); // nothing to do, because the pixmap - else // and the position isn't changed. - pacmanRect = pix->rect(pacmanRect, lastRect); - } else - pacmanRect.setRect(0, 0, 0, 0); - - int pos = pacman->position(); - - if (moved && board->isMonster(pos) && !gameState.testBit(Dying)) { - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->position() == pos) { - if (m->state() == harmless && !gameState.testBit(Dying)) { - m->setREM(remTicks[level]); - m->setDirection(X); // prevent movement before eaten() - eated++; - if (gameState.testBit(Introducing)) - m->setPosition(OUT); - } - if (m->state() == dangerous && !gameState.testBit(Dying)) - killed(); - } - } - - if (moved && !gameState.testBit(Dying)) { - if (board->isPoint(pos)) { - board->reset(pos, Point); - score(pointScore); - pix->erase(pos, PointPix); - } - if (board->isEnergizer(pos)) { - for (int e = 0; e < board->energizers();e++) { - if (energizers->at(e)->position() == pos) { - energizers->at(e)->setOff(); - energizers->remove(e); - energizerRect->remove(e); - e = board->energizers(); - } - } - board->reset(pos, energizer); - score(energizerScore); - monstersEaten = 0; - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->state() != rem) { - m->setHarmless(harmlessTicks[level], harmlessDurTicks[level], - harmlessWarnTicks[level]); - if (gameState.testBit(Introducing)) - m->setDirection(board->turn(m->direction())); - } - } - if (pos == fruit->position() && fruit->state() == active) { - fruit->setEaten(fruitScoreDurTicks[level]); - initFruit(FALSE); - score(fruitScore[fruit->pix()]); - } - } - - if (!gameState.testBit(Introducing)) { - if (fruit->state() != active && fruit->pix() >= 0) - lastRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); - else - lastRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); - - lastPix = fruit->pix(); - if (fruit->move()) { - if (pos == fruit->position() && fruit->state() == active) { - fruit->setEaten(fruitScoreDurTicks[level]); - initFruit(FALSE); - score(fruitScore[fruit->pix()]); - } - if (fruit->state() != active && fruit->pix() >= 0) - fruitRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); - else - fruitRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); - if (lastPix == fruit->pix() && lastRect == fruitRect) - fruitRect.setRect(0, 0, 0, 0); - else - fruitRect = pix->rect(fruitRect, lastRect); - } else - fruitRect.setRect(0, 0, 0, 0); - } else - fruitRect.setRect(0, 0, 0, 0); - - int lastBodyPix; - int lastEyesPix; - - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m) { - lastRect = pix->rect(m->position(), MonsterPix); - lastBodyPix = m->body(); - lastEyesPix = m->eyes(); - if (m->move()) { - moved = TRUE; - *monsterRect->at(m->id()) = pix->rect(m->position(), MonsterPix); - if (lastBodyPix == m->body() && lastEyesPix == m->eyes() && - lastRect == pix->rect(m->position(), MonsterPix)) - monsterRect->at(m->id())->setRect(0, 0, 0, 0); - else - *monsterRect->at(m->id()) = pix->rect(*monsterRect->at(m->id()), lastRect); - if (m->position() == pos && !gameState.testBit(Dying)) { - if (m->state() == harmless && !gameState.testBit(Dying)) { - m->setREM(remTicks[level]); - eated++; - if (gameState.testBit(Introducing)) { - m->setPosition(OUT); - m->setDirection(X); - } - } - if (m->state() == dangerous && !gameState.testBit(Dying)) - killed(); - } - } else - monsterRect->at(m->id())->setRect(0, 0, 0, 0); - } - - for (int m = 0; m < board->monsters(); m++) - if (pacmanRect.intersects(*monsterRect->at(m))) { - pacmanRect = pix->rect(pacmanRect, *monsterRect->at(m)); - monsterRect->at(m)->setRect(0, 0, 0, 0); - } else - for (int im = m+1; im < board->monsters(); im++) - if (monsterRect->at(m)->intersects(*monsterRect->at(im))) { - *monsterRect->at(m) = pix->rect(*monsterRect->at(m), *monsterRect->at(im)); - monsterRect->at(im)->setRect(0, 0, 0, 0); - } - - if (!pacmanRect.isNull()) - repaint(pacmanRect, FALSE); - - if (!fruitRect.isNull()) - repaint(fruitRect, FALSE); - - for (int m = 0; m < board->monsters(); m++) - if (!monsterRect->at(m)->isNull()) - repaint(*monsterRect->at(m), FALSE); - - if (board->points() == 0 && !gameState.testBit(Dying)) - levelUp(); - - if (eated > 0 && !gameState.testBit(Dying)) { - timerCount = eated; - eaten(); - } - - if (gameState.testBit(Introducing) && moved) - introPlay(); -} - -void Referee::repaintFigures() -{ - pacmanRect = pix->rect(pacman->position(), PacmanPix); - - for (int e = 0; e < board->energizers(); e++) { - *energizerRect->at(e) = pix->rect(board->position(energizer, e), EnergizerPix); - - if (pacmanRect.intersects(*energizerRect->at(e))) { - pacmanRect = pix->rect(pacmanRect, *energizerRect->at(e)); - energizerRect->at(e)->setRect(0, 0, 0, 0); - } else - for (int ie = e+1; ie < board->energizers(); ie++) - if (energizerRect->at(e)->intersects(*energizerRect->at(ie))) { - *energizerRect->at(e) = pix->rect(*energizerRect->at(e), *energizerRect->at(ie)); - energizerRect->at(ie)->setRect(0, 0, 0, 0); - } - } - - if (fruit->pix() != -1 && fruit->state() != active) - fruitRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); - else - fruitRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); - - if (pacmanRect.intersects(fruitRect)) { - pacmanRect = pix->rect(pacmanRect, fruitRect); - fruitRect.setRect(0, 0, 0, 0); - } - - for (int m = 0; m < board->monsters(); m++) { - *monsterRect->at(m) = pix->rect(board->position(monster, m), MonsterPix); - - if (pacmanRect.intersects(*monsterRect->at(m))) { - pacmanRect = pix->rect(pacmanRect, *monsterRect->at(m)); - monsterRect->at(m)->setRect(0, 0, 0, 0); - } else - for (int im = m+1; im < board->monsters(); im++) - if (monsterRect->at(m)->intersects(*monsterRect->at(im))) { - *monsterRect->at(m) = pix->rect(*monsterRect->at(m), *monsterRect->at(im)); - monsterRect->at(im)->setRect(0, 0, 0, 0); - } - } - - if (!pacmanRect.isNull()) - repaint(pacmanRect, FALSE); - - if (!fruitRect.isNull()) - repaint(fruitRect, FALSE); - - for (int m = 0; m < board->monsters(); m++) - if (!monsterRect->at(m)->isNull()) - repaint(*monsterRect->at(m), FALSE); - - for (int e = 0; e < board->energizers(); e++) - if (!energizerRect->at(e)->isNull()) - repaint(*energizerRect->at(e), FALSE); - -} - -void Referee::initKeys() -{ - TQString up("Up"); - up = kapp->config()->readEntry("upKey", up); - UpKey = TDEShortcut(up); - - TQString down("Down"); - down = kapp->config()->readEntry("downKey", down); - DownKey = TDEShortcut(down); - - TQString left("Left"); - left = kapp->config()->readEntry("leftKey", left); - LeftKey = TDEShortcut(left); - - TQString right("Right"); - right = kapp->config()->readEntry("rightKey", right); - RightKey = TDEShortcut(right); -} - -void Referee::fillArray(TQMemArray &array, TQString values, int max) -{ - if (max < 0) - max = values.contains(',')+1; - - array.resize(max); - int last = 0; - bool ok; - TQString value; - - for (uint i = 0; i < array.size(); i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - array[i] = value.toInt(&ok); - if (ok) - last = array[i]; - else - array[i] = last; - } -} - -void Referee::fillStrList(TQStrList &list, TQString values, int max) -{ - if (!list.isEmpty()) - list.clear(); - - TQString last = ""; - TQString value; - - for (uint i = 0; i < (uint) max; i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - if (!value.isEmpty()) - last = value; - - list.append(last.latin1()); - } -} - -void Referee::fillMapName() -{ - TQStrList list = mapName; - - if (!mapName.isEmpty()) - mapName.clear(); - - TQString map; - - TQFileInfo fileInfo; - - for (uint i = 0; i < list.count(); i++) { - map = list.at(i); - - if (map.left(1) != "/" && map.left(1) != "~") - map = TDEGlobal::dirs()->findResource("appdata", mapDirectory+map); - - fileInfo.setFile(map); - if (!fileInfo.isReadable()) - map = ""; - - mapName.append(map.utf8()); - } -} - -void Referee::confLevels(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("Levels")) - maxLevel = kapp->config()->readNumEntry("Levels", 13); -} - -void Referee::confMisc(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { - pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); - - if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") - pixmapDirectory.insert(0, "pics/"); - if (pixmapDirectory.right(1) != "/") - pixmapDirectory.append("/"); - } - - if (defGroup || kapp->config()->hasKey("MapDirectory")) { - mapDirectory = kapp->config()->readEntry("MapDirectory"); - - if (mapDirectory.left(1) != "/" && mapDirectory.left(1) != "~") - mapDirectory.insert(0, "maps/"); - if (mapDirectory.right(1) != "/") - mapDirectory.append("/"); - } - - if (defGroup || kapp->config()->hasKey("MapName")) - fillStrList(mapName, kapp->config()->readEntry("MapName", "map"), maxLevel+1); - - if (defGroup || kapp->config()->hasKey("MonsterIQ")) - fillArray(monsterIQ, kapp->config()->readEntry("MonsterIQ", "0,170,180,170,180,170,180"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitIQ")) - fillArray(fruitIQ, kapp->config()->readEntry("FruitIQ", "0,170,180,170,180,170,180"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitIndex")) - fillArray(fruitIndex, kapp->config()->readEntry("FruitIndex", "0"), maxLevel+1); -} - -void Referee::confTiming(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("SpeedMS")) - fillArray(speed, kapp->config()->readEntry("SpeedMS", "20"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("PacmanTicks")) - fillArray(pacmanTicks,kapp->config()->readEntry("PacmanTicks", "3"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("RemTicks")) - fillArray(remTicks, kapp->config()->readEntry("RemTicks", "1"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("DangerousTicks")) - fillArray(dangerousTicks, kapp->config()->readEntry("DangerousTicks", "3"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("HarmlessTicks")) - fillArray(harmlessTicks, kapp->config()->readEntry("HarmlessTicks", "7,6,,5,,4"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("HarmlessDurationTicks")) - fillArray(harmlessDurTicks, kapp->config()->readEntry("HarmlessDurationTicks", "375,,,300,,250,200,150"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("HarmlessWarningTicks")) - fillArray(harmlessWarnTicks, kapp->config()->readEntry("HarmlessWarningTicks", "135"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("ArrestTicks")) - fillArray(arrestTicks, kapp->config()->readEntry("ArrestTicks", "6"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("ArrestDurationTicks")) - fillArray(arrestDurTicks, kapp->config()->readEntry("ArrestDurationTicks", "200,,,150"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitTicks")) - fillArray(fruitTicks, kapp->config()->readEntry("FruitTicks", "7,6,,5,,4"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitAppearsTicks")) - fillArray(fruitAppearsTicks, kapp->config()->readEntry("FruitAppearsTicks", "1000,,1500,2000,2500,3000,3500,4000"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitDurationTicks")) - fillArray(fruitDurTicks, kapp->config()->readEntry("FruitDurationTicks", "500,,,400,350,300,,250,200,150"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("FruitScoreDurationTicks")) - fillArray(fruitScoreDurTicks, kapp->config()->readEntry("FruitScoreDurationTicks", "150"), maxLevel+1); - - if (defGroup || kapp->config()->hasKey("MonsterScoreDurationMS")) - monsterScoreDurMS = kapp->config()->readNumEntry("MonsterScoreDurationMS", 1000); - if (defGroup || kapp->config()->hasKey("PlayerDurationMS")) - playerDurMS = kapp->config()->readNumEntry("PlayerDurationMS", 3000); - if (defGroup || kapp->config()->hasKey("ReadyDurationMS")) - readyDurMS = kapp->config()->readNumEntry("ReadyDurationMS", 2000); - if (defGroup || kapp->config()->hasKey("GameOverDurationMS")) - gameOverDurMS = kapp->config()->readNumEntry("GameOverDurationMS", 3000); - if (defGroup || kapp->config()->hasKey("AfterPauseMS")) - afterPauseMS = kapp->config()->readNumEntry("AfterPauseMS", 1000); - if (defGroup || kapp->config()->hasKey("DyingPreAnimationMS")) - dyingPreAnimationMS = kapp->config()->readNumEntry("DyingPreAnimationMS", 1000); - if (defGroup || kapp->config()->hasKey("DyingAnimationMS")) - dyingAnimationMS = kapp->config()->readNumEntry("DyingAnimationMS", 100); - if (defGroup || kapp->config()->hasKey("DyingPostAnimationMS")) - dyingPostAnimationMS = kapp->config()->readNumEntry("DyingPostAnimationMS", 500); - if (defGroup || kapp->config()->hasKey("IntroAnimationMS")) - introAnimationMS = kapp->config()->readNumEntry("IntroAnimationMS", 800); - if (defGroup || kapp->config()->hasKey("IntroPostAnimationMS")) - introPostAnimationMS = kapp->config()->readNumEntry("IntroPostAnimationMS", 1000); - if (defGroup || kapp->config()->hasKey("LevelUpPreAnimationMS")) - levelUpPreAnimationMS = kapp->config()->readNumEntry("LevelUpPreAnimationMS", 2000); - if (defGroup || kapp->config()->hasKey("LevelUpAnimationMS")) - levelUpAnimationMS = kapp->config()->readNumEntry("LevelUpAnimationMS", 2000); - if (defGroup || kapp->config()->hasKey("EnergizerAnimationMS")) - energizerAnimationMS = kapp->config()->readNumEntry("EnergizerAnimationMS", 200); -} - -void Referee::confScoring(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("PointScore")) - pointScore = kapp->config()->readNumEntry("PointScore", 10); - if (defGroup || kapp->config()->hasKey("EnergizerScore")) - energizerScore = kapp->config()->readNumEntry("EnergizerScore", 50); - if (defGroup || kapp->config()->hasKey("FruitScore")) - fillArray(fruitScore, kapp->config()->readEntry("FruitScore", "100,300,500,,700,,1000,,2000,,3000,,5000"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("MonsterScore")) - fillArray(monsterScore, kapp->config()->readEntry("MonsterScore", "200,400,800,1600"), 4); - if (defGroup || kapp->config()->hasKey("ExtraLifeScore")) - fillArray(extraLifeScore, kapp->config()->readEntry("ExtraLifeScore", "10000"), -1); -} - -void Referee::confScheme() -{ - TQString oldgroup = kapp->config()->group(); - TQString newgroup; - - // if not set, read mode and scheme from the configfile - if (mode == -1 && scheme == -1) { - scheme = kapp->config()->readNumEntry("Scheme", -1); - mode = kapp->config()->readNumEntry("Mode", -1); - - // if mode is not set in the defGroup-group, lookup the scheme group - if (scheme != -1 || mode == -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - mode = kapp->config()->readNumEntry("Mode", -1); - kapp->config()->setGroup(oldgroup); - } - } - - confLevels(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - kapp->config()->setGroup(oldgroup); - - confMisc(); - confTiming(); - confScoring(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - confTiming(FALSE); - confScoring(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - confTiming(FALSE); - confScoring(FALSE); - } - - fillMapName(); - - kapp->config()->setGroup(oldgroup); -} - -void Referee::setScheme(int Scheme, int Mode, Bitfont *font) -{ - mode = Mode; - scheme = Scheme; - - confScheme(); - - pix->setScheme(scheme, mode, font); - - pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix)); - fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix)); - - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m) - m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); - - for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) - if (e) - e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix)); - - if (gameState.testBit(Introducing)) - for (int i = 0; i < (gameState.testBit(Init) ? timerCount : 15); i++) - introPaint(i); - - setFixedSize(pix->levelPix().size()); - repaint(); -} - -void Referee::keyPressEvent( TQKeyEvent *k ) -{ - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame) || - gameState.testBit(Demonstration) || gameState.testBit(Dying) || - gameState.testBit(Ready) || gameState.testBit(LevelDone) || - !gameState.testBit(Playing)) - return; - - uint key = k->key(); - if (key == UpKey) - pacman->setDirection(N); - else if (key == DownKey) - pacman->setDirection(S); - else if (key == RightKey) - pacman->setDirection(E); - else if (key == LeftKey) - pacman->setDirection(W); - -#ifdef CHEATS - else if (key == Key_L) { printf("levelUp()\n"); levelUp(); } - else if (key == Key_F) { printf("fruit->move(TRUE)\n"); fruit->move(TRUE); repaint(FALSE); } - else if (key == Key_E) { printf("setLifes(++lifes)\n"); emit setLifes(++lifes); } -#endif - - else { - k->ignore(); - return; - } - k->accept(); -} - -void Referee::score(int p) -{ - if (!gameState.testBit(Playing)) - return; - - if ((points += p) < 0) - points = 0; - - emit setPoints(points); - - if (points >= nextExtraLifeScore) { - emit setLifes(++lifes); - if (extraLifeScoreIndex < (int) extraLifeScore.size()-1) - extraLifeScoreIndex++; - if (extraLifeScore[extraLifeScoreIndex] < 0) - nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex] * -1; - else - nextExtraLifeScore += extraLifeScore[extraLifeScoreIndex]; - } -} - -void Referee::eaten() -{ - if (gameState.testBit(Ready)) - return; - - stop(); - - if (monstersEaten < 4) - monstersEaten++; - - gameState.setBit(Scoring); - score(monsterScore[monstersEaten-1]); - - repaint(pix->rect(pix->rect(pacman->position(), MonsterPix), - pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))); - - if (--timerCount > 0) - TQTimer::singleShot( monsterScoreDurMS, this, SLOT(eaten())); - else { - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->direction() == X && !gameState.testBit(Introducing)) - m->setDirection(N); - if (monstersEaten != 4 || !gameState.testBit(Introducing)) - TQTimer::singleShot( monsterScoreDurMS, this, SLOT(start())); - } -} - -void Referee::toggleHallOfFame() -{ - gameState.toggleBit(HallOfFame); -} - -void Referee::hallOfFame() -{ - if (gameState.testBit(HallOfFame)) // If the HallOfFame is switched on manually, toggle the - toggleHallOfFame(); // bit twice. - - emit setLevel(0); // Clear status display for hall of fame - emit setScore(level, 0); - emit forcedGameHighscores(); -} - -void Referee::pause() -{ - static int pausedTimer = 0; - - if (!gameState.testBit(Paused)) { - pausedTimer = gameTimer; - stop(); - stopEnergizer(); - gameState.setBit(Paused); - repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); - } else { - gameState.clearBit(Paused); - repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); - if (pausedTimer) { - pausedTimer = 0; - start(); - } - // manual pause deactivating (also) deactivates a focusedPause - focusedPause = false; - } - //0.3.2 emit gamePause(); -} - -void Referee::intro() -{ - stop(); - stopEnergizer(); - bool paused = gameState.testBit(Paused); - - gameState.fill(FALSE); - gameState.setBit(Introducing); - gameState.setBit(Init); - - if (paused) - gameState.setBit(Paused); - - level = 0; - emit setLevel(level); - - board->init(Intro); - pix->setLevel(level); - - initPacman(); - initFruit(); - initMonsters(); - initEnergizers(); - - repaint(); - - monstersEaten = 0; - timerCount = 0; - introPlay(); -} - -void Referee::introMonster(int id) -{ - Monster *m = new Monster(board, id); - - m->setPosition((10+id*6)*BoardWidth+10); - m->setDirection(E); - m->setDangerous(dangerousTicks[level], monsterIQ[level]); - m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); - - if (m->body() != -1) - pix->draw(m->position(), RoomPix, MonsterPix, m->body()); - if (m->eyes() != -1) - pix->draw(m->position(), RoomPix, EyesPix, m->eyes()); - - repaint(pix->rect(m->position(), MonsterPix), FALSE); - m->setPosition(OUT); -} - -void Referee::introPaint(int t) -{ - TQString pts; - - switch (t) { - case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, TQColor(), AlignLeft), FALSE); - repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, TQColor(), AlignLeft), FALSE); - repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, TQColor(), AlignLeft), FALSE); - break; - case 1 : introMonster(0); - break; - case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, TQColor(), AlignLeft), FALSE); - break; - case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, TQColor(), AlignLeft), FALSE); - break; - case 4 : introMonster(1); - break; - case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, TQColor(), AlignLeft), FALSE); - break; - case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, TQColor(), AlignLeft), FALSE); - break; - case 7 : introMonster(2); - break; - case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, TQColor(), AlignLeft), FALSE); - break; - case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, TQColor(), AlignLeft), FALSE); - break; - case 10 : introMonster(3); - break; - case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, TQColor(), AlignLeft), FALSE); - break; - case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, TQColor(), AlignLeft), FALSE); - break; - case 13 : pts.sprintf("%d", pointScore); - repaint(pix->draw(28, 44, RoomPix, pts, WHITE, TQColor(), AlignRight), FALSE); - repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE); - pts.sprintf("%d", energizerScore); - repaint(pix->draw(28, 48, RoomPix, pts, WHITE, TQColor(), AlignRight), FALSE); - repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE); - break; - case 14 : // "@ 1980 MIDWAY MFG.CO." - repaint(pix->draw(30, 58, RoomPix, "© 1998-2003 J.THÖNNISSEN", PINK), FALSE); - break; - } -} - -void Referee::introPlay() -{ - if (!gameState.testBit(Introducing) || gameState.testBit(Ready)) - return; - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(introPlay())); - return; - } - - if (!gameState.testBit(Init)) { - if (monstersEaten == 4) { - stop(); - TQTimer::singleShot(introPostAnimationMS, this, SLOT(demo())); - } - if (pacman->direction() == W) { - int id = -1; - if (pacman->position() == 37*BoardWidth-6) - id = 0; - else - if (board->isMonster(37*BoardWidth-6)) - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->position() == 37*BoardWidth-6) { - id = m->id(); - id++; - break; - } - - if (id >= 0 && id <= 4) - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m && m->id() == id && m->position() == OUT) { - m->setPosition(37*BoardWidth-1); - m->setDirection(W); - m->setDangerous(dangerousTicks[level], monsterIQ[level]); - board->set(37*BoardWidth-1, monsterhome, id); - repaint(pix->rect(m->position(), MonsterPix)); - break; - } - } - return; - } - - if (timerCount < 15) - introPaint(timerCount); - - switch (timerCount) { - case 13 : board->set(44*BoardWidth+22, Point); - pix->drawPoint(44*BoardWidth+22); - repaint(pix->rect(44*BoardWidth+22, PointPix), FALSE); - energizers->at(0)->setPosition(48*BoardWidth+22); - energizers->at(0)->setOn(); - repaint(pix->rect(48*BoardWidth+22, EnergizerPix), FALSE); - break; - case 14 : energizers->at(1)->setPosition(36*BoardWidth+10); - energizers->at(1)->setOn(); - repaint(pix->rect(36*BoardWidth+10, EnergizerPix), FALSE); - for (int pos = 8; pos < BoardWidth; pos++) { - board->set(34*BoardWidth+pos, out); - board->set(38*BoardWidth+pos, out); - } - board->set(36*BoardWidth+8, out); - break; - case 15 : gameState.clearBit(Init); - initPacman(); - pacman->setDemo(TRUE); - pacman->setPosition(37*BoardWidth-1); - repaintFigures(); - start(); - return; - } - - if (timerCount++ < 15) - TQTimer::singleShot(introAnimationMS, this, SLOT(introPlay())); -} - -void Referee::demo() -{ - if (gameState.testBit(Ready)) - return; - - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(demo())); - return; - } - - stop(); - stopEnergizer(); - - gameState.fill(FALSE); - gameState.setBit(Init); - gameState.setBit(Demonstration); - - level = 0; - emit setLevel(level); - - board->init(Demo, mapName.at(0)); - pix->setLevel(level); - - initPacman(); - initFruit(); - initMonsters(); - initEnergizers(); - - gameState.clearBit(Init); - - repaint(); - - timerCount = 0; - TQTimer::singleShot(playerDurMS, this, SLOT(start())); -} - -void Referee::play() -{ - stop(); - stopEnergizer(); - - gameState.fill(FALSE); - gameState.setBit(Init); - gameState.setBit(Playing); - gameState.setBit(Player); - gameState.setBit(Ready); - - lifes = 3; - level = 1; - points = 0; - - extraLifeScoreIndex = 0; - nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex]; - if (nextExtraLifeScore < 0) - nextExtraLifeScore *= -1; - - board->init(Level, mapName.at(level)); - pix->setLevel(level); - - initPacman(); - initFruit(); - initMonsters(); - initEnergizers(); - - repaint(); - //0.3.2 emit toggleNew(); - emit setLifes(lifes); - emit setLevel(level); - emit setPoints(points); - - repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); - repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); - - timerCount = 0; - TQTimer::singleShot(playerDurMS, this, SLOT(ready())); -} - -void Referee::ready() -{ - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(ready())); - return; - } - - if (gameState.testBit(Player)) { - emit setLifes(--lifes); - gameState.clearBit(Player); - gameState.clearBit(Init); - repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); - repaintFigures(); - TQTimer::singleShot(playerDurMS, this, SLOT(ready())); - return; - } - - if (gameState.testBit(Ready)) { - gameState.clearBit(Ready); - repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); - start(); - } else { - gameState.setBit(Ready); - gameState.clearBit(Init); - repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); - TQTimer::singleShot(readyDurMS, this, SLOT(ready())); - } -} - - -void Referee::levelUp() -{ - stop(); - stopEnergizer(); - - gameState.setBit(LevelDone); - pacman->setPosition(pacman->position()); // set mouthPosition to "0" - repaint(pix->rect(pacman->position(), PacmanPix)); - - timerCount = 0; - TQTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay())); -} - -void Referee::levelUpPlay() -{ - if (gameState.testBit(Ready)) - return; - - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay())); - return; - } - - switch (timerCount) { - case 0 : gameState.setBit(Init); - setOnEnergizers(); - repaintFigures(); - break; - case 1 : gameState.clearBit(LevelDone); - repaint(pix->rect(pacman->position(), PacmanPix)); - break; - } - - if (timerCount++ < 2) { - TQTimer::singleShot(levelUpAnimationMS, this, SLOT(levelUpPlay())); - return; - } - - gameState.clearBit(Init); - - if (gameState.testBit(Demonstration)) { - hallOfFame(); - return; - } - - if (level < maxLevel) - level++; - - board->init(Level, mapName.at(level)); - pix->setLevel(level); - - initPacman(); - initFruit(); - initMonsters(); - initEnergizers(); - - repaint(); - emit setLevel(level); - - ready(); -} - -void Referee::start() -{ - if (gameState.testBit(Ready)) - return; - - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(start())); - return; - } - - if (gameState.testBit(Scoring)) { - gameState.clearBit(Scoring); - repaint(pix->rect(pix->rect(pacman->position(), MonsterPix), - pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))); - } - - if (!gameTimer) - gameTimer = startTimer( speed [level] ); - - if (!energizerTimer) - energizerTimer = startTimer( energizerAnimationMS ); -} - -void Referee::start(int t) -{ - gameTimer = startTimer(t); -} - -void Referee::stop() -{ - if (gameTimer) { - killTimer (gameTimer); - gameTimer = 0; - } -} - -void Referee::stopEnergizer() -{ - if (energizerTimer) { - killTimer (energizerTimer); - energizerTimer = 0; - } -} - -void Referee::killed() -{ - if (gameState.testBit(Ready)) - return; - - if (!gameState.testBit(Dying)) { - gameState.setBit(Dying); - - pacman->setDirection(X, TRUE); - for (Monster *m = monsters->first(); m != 0; m = monsters->next()) - if (m) - m->setDirection(X); - TQTimer::singleShot(dyingPreAnimationMS, this, SLOT(killed())); - } else { - stop(); - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(killed())); - return; - } - - gameState.setBit(Init); - - repaintFigures(); - - timerCount = 0; - killedPlay(); - } -} - -void Referee::killedPlay() -{ - if (!gameState.testBit(Dying) || gameState.testBit(Ready)) - return; - if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { - TQTimer::singleShot(afterPauseMS, this, SLOT(killedPlay())); - return; - } - - if (timerCount <= pix->maxPixmaps(DyingPix)) { - repaint(pix->rect(pacman->position(), PacmanPix), FALSE); - if (timerCount >= pix->maxPixmaps(DyingPix)-1 || timerCount == 0) - TQTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay())); - else - TQTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay())); - timerCount++; - } else { - gameState.clearBit(Dying); - stopEnergizer(); - if (lifes == 0) { - gameState.setBit(GameOver); - gameState.clearBit(Playing); - for (int e = 0; e < board->energizers(); e++) { - energizers->at(e)->setOff(); - repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE); - } - repaint(pix->rect(board->position(fruithome), i18n("GAME OVER")), FALSE); - TQTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame())); - } else { - gameState.clearBit(Init); - initPacman(); - initFruit(); - initMonsters(); - initEnergizers(); - emit setLifes(--lifes); - repaintFigures(); - ready(); - } - } -} - -void Referee::initPacman() -{ - pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix)); - pacman->setDemo(gameState.testBit(Demonstration)); - pacman->setPosition(board->position(pacmanhome)); - pacman->setDirection(W, TRUE); - pacman->setAlive(pacmanTicks[level]); -} - -void Referee::initFruit(bool fullInitialization) -{ - if (fullInitialization) { - fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix)); - if (fruitIndex[level] == 0) - fruit->setLevel(level, fruitAppearsTicks[level], - fruitDurTicks[level], fruitTicks[level]); - else if (fruitIndex[level] < 0) - fruit->setLevel(pix->maxPixmaps(FruitPix)+1, - fruitAppearsTicks[level], - fruitDurTicks[level], fruitTicks[level]); - else - fruit->setLevel(fruitIndex[level], fruitAppearsTicks[level], - fruitDurTicks[level], fruitTicks[level]); - } - - if (board->tunnels() > 0) - fruit->setMovement(board->position(tunnel, rand() % board->tunnels()), - board->position(tunnel, rand() % board->tunnels()), - fruitIQ[level]); -} - -void Referee::initMonsters() -{ - if( !monsters->isEmpty()) - monsters->clear(); - if( !monsterRect->isEmpty()) - monsterRect->clear(); - - for (int id = 0; id < (gameState.testBit(Introducing) ? 4 : board->monsters()); id++) { - Monster *m = new Monster(board, id); - monsters->append(m); - TQRect *r = new TQRect(); - monsterRect->append(r); - if (!gameState.testBit(Introducing)) { - m->setFreedom(board->position(prisonexit)); - m->setDangerous(dangerousTicks[level], monsterIQ[level]); - if (id == 0) - m->setPrison(board->position(prisonentry)); - else { - m->setPrison(board->position(monsterhome, id)); - m->setArrested(arrestTicks[level], arrestDurTicks[level]*id); - } - m->setPosition(board->position(monsterhome, id)); - switch(id) { - case 0 : m->setDirection(W); break; - case 1 : m->setDirection(N); break; - default : m->setDirection(S); - } - } - m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); - } -} - -void Referee::initEnergizers() -{ - if( !energizers->isEmpty()) - energizers->clear(); - if( !energizerRect->isEmpty()) - energizerRect->clear(); - - for (int id = 0; id < (gameState.testBit(Introducing) ? 2 : board->energizers()); id++) { - Energizer *e = new Energizer(board); - energizers->append(e); - TQRect *r = new TQRect(); - energizerRect->append(r); - if (!gameState.testBit(Introducing)) { - e->setPosition(board->position(energizer, id)); - e->setOn(); - } - e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix)); - } -} - -void Referee::setOnEnergizers() -{ - for (int e = 0; e < board->energizers(); e++) { - energizers->at(e)->setOn(); - } -} - -void Referee::setFocusOutPause(bool FocusOutPause) -{ - focusOutPause = FocusOutPause; -} - -void Referee::setFocusInContinue(bool FocusInContinue) -{ - focusInContinue = FocusInContinue; -} - -void Referee::focusInEvent(TQFocusEvent *) -{ - if (focusInContinue && focusedPause && - gameState.testBit(Paused) && gameState.testBit(Playing)) { - focusedPause = false; - // this also calls the Referee::pause() function - emit focusedGamePause(); - } -} - -void Referee::focusOutEvent(TQFocusEvent *) -{ - if (focusOutPause && !focusedPause && - !gameState.testBit(Paused) && gameState.testBit(Playing)) { - focusedPause = true; - // this also calls the Referee::pause() function - emit focusedGamePause(); - } -} - -#include "referee.moc" diff --git a/kpacman/referee.h b/kpacman/referee.h deleted file mode 100644 index c147d18..0000000 --- a/kpacman/referee.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef REFEREE_H -#define REFEREE_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include "board.h" -#include "pacman.h" -#include "monster.h" -#include "fruit.h" -#include "energizer.h" -#include "bitfont.h" -#include "painter.h" - -enum { Init, Introducing, Playing, Demonstration, Paused, Player, Ready, - Scoring, LevelDone, Dying, GameOver, HallOfFame }; - - -class Referee : public TQWidget -{ - Q_OBJECT -public: - Referee (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0); - - void setSkill(int); - void setRoom(int); - -public slots: - void setScheme(int scheme, int mode, Bitfont *font=0); - - void levelUp(); - void levelUpPlay(); - - void pause(); - void ready(); - void intro(); - void introPlay(); - void hallOfFame(); - void demo(); - void play(); - void killed(); - void killedPlay(); - void eaten(); - void toggleHallOfFame(); - - void setFocusOutPause(bool focusOutPause); - void setFocusInContinue(bool focusInContinue); - void initKeys(); - - void repaintFigures(); - -private slots: - void start(); - void stop(); - void stopEnergizer(); - -signals: - void setScore(int, int); - void setPoints(int); - void setLevel(int); - void setLifes(int); - - void focusedGamePause(); - void forcedGameHighscores(); - -protected: - void timerEvent(TQTimerEvent *); - void paintEvent(TQPaintEvent *); - void keyPressEvent(TQKeyEvent *); - - void focusOutEvent(TQFocusEvent *); - void focusInEvent(TQFocusEvent *); - - void fillArray(TQMemArray &, TQString, int); - void fillStrList(TQStrList &, TQString, int); - void fillMapName(); - - void confScheme(); - void confLevels(bool defGroup=TRUE); - void confMisc(bool defGroup=TRUE); - void confTiming(bool defGroup=TRUE); - void confScoring(bool defGroup=TRUE); - -private: - TQBitArray gameState; - int timerCount; - int maxLevel; - - int scheme; - int mode; - - TQString pixmapDirectory; - TQString mapDirectory; - TQStrList mapName; - - TQMemArray speed; - TQMemArray monsterIQ; - TQMemArray fruitIQ; - TQMemArray fruitIndex; - TQMemArray pacmanTicks; - TQMemArray remTicks; - TQMemArray dangerousTicks; - TQMemArray harmlessTicks; - TQMemArray harmlessDurTicks; - TQMemArray harmlessWarnTicks; - TQMemArray arrestTicks; - TQMemArray arrestDurTicks; - TQMemArray fruitTicks; - TQMemArray fruitAppearsTicks; - TQMemArray fruitDurTicks; - TQMemArray fruitScoreDurTicks; - - int monsterScoreDurMS; - int playerDurMS; - int readyDurMS; - int gameOverDurMS; - int afterPauseMS; - int dyingPreAnimationMS; - int dyingAnimationMS; - int dyingPostAnimationMS; - int introAnimationMS; - int introPostAnimationMS; - int levelUpPreAnimationMS; - int levelUpAnimationMS; - int energizerAnimationMS; - - int pointScore; - int energizerScore; - TQMemArray fruitScore; - TQMemArray monsterScore; - TQMemArray extraLifeScore; - - int extraLifeScoreIndex; - int nextExtraLifeScore; - - int monstersEaten; - int points; - int lifes; - int level; - - bool focusedPause; - bool focusOutPause; - bool focusInContinue; - - Board *board; - Painter *pix; - Pacman *pacman; - Fruit *fruit; - - TQPtrList *monsters; - TQPtrList *monsterRect; - - TQPtrList *energizers; - TQPtrList *energizerRect; - - TQRect pacmanRect; - TQRect fruitRect; - - void introMonster(int id); - void introPaint(int t); - - void initMonsters(); - void initPacman(); - void initFruit(bool fullInitialization=TRUE); - void initEnergizers(); - - void setOnEnergizers(); - - int gameTimer; - int energizerTimer; - void start(int); - void init(bool); - - void score(int); - - uint UpKey; - uint DownKey; - uint RightKey; - uint LeftKey; -}; - -#endif // REFEREE_H diff --git a/kpacman/score.cpp b/kpacman/score.cpp deleted file mode 100644 index c87bb96..0000000 --- a/kpacman/score.cpp +++ /dev/null @@ -1,628 +0,0 @@ -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "bitfont.h" -#include "score.h" - -Score::Score(TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) : TQWidget(parent, name) -{ - setFocusPolicy(TQWidget::StrongFocus); - - paused = FALSE; - - lastScore = -1; - lastPlayer = -1; - - cursorBlinkTimer = 0; - cursorBlinkMS = -1; - cursor.x = -1; - cursor.y = -1; - cursor.on = FALSE; - cursor.chr = TQChar('?'); - - initKeys(); - - scheme = Scheme; - mode = Mode; - confScheme(); - - bitfont = font; - - highscoreFile.setName(locateHighscoreFilePath().filePath()); - read(); - - for (int p = 0; p < maxPlayer; p++) { - playerScore[p] = 0; - playerName[p] = getenv("LOGNAME"); - if (playerName[p].length() < minPlayerNameLength) - playerName[p].setExpand(minPlayerNameLength-1, ' '); - - for (uint i = 0; i < playerName[p].length(); i++) - if (playerName[p].at(i) < bitfont->firstChar() || - playerName[p].at(i) > bitfont->lastChar()) - playerName[p].at(i) = playerName[p].at(i).upper(); - } -} - -Score::~Score() -{ - // write(); -} - -void Score::paintEvent( TQPaintEvent *e) -{ - if (rect(1, 0, i18n(" 1UP ")).intersects(e->rect())) { - TQPixmap pix; - TQColor fg = BLACK; - if (cursor.on || paused || lastPlayer != 0) - fg = WHITE; - pix = bitfont->text(i18n(" 1UP "), fg, BLACK); - bitBlt(this, x(1), y(0), &pix); - } - - if (rect(8, 0, i18n(" HIGH SCORE ")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK); - bitBlt(this, x(8), y(0), &pix); - } - - if (maxPlayer > 1 && rect(21, 0, i18n(" 2UP ")).intersects(e->rect())) { - TQPixmap pix; - TQColor fg = BLACK; - if (cursor.on || paused || lastPlayer != 1) - fg = WHITE; - pix = bitfont->text(i18n(" 2UP "), fg, BLACK); - bitBlt(this, x(21), y(0), &pix); - } - - TQString s; - - s.sprintf("%6d0", playerScore[0]/10); - if (rect(0, 1, s).intersects(e->rect())) { - TQPixmap pix = bitfont->text(s, WHITE, BLACK); - bitBlt(this, x(0), y(1), &pix); - } - - s.sprintf("%8d0", HighScore/10); - if (rect(8, 1, s).intersects(e->rect())) { - TQPixmap pix = bitfont->text(s, WHITE, BLACK); - bitBlt(this, x(8), y(1), &pix); - } - - if (lastScore >= 0) { - if (rect(1, 4*1.25, i18n(" CONGRATULATIONS ")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK); - bitBlt(this, x(1), y(4*1.25), &pix); - } - if (rect(1, 6*1.25, i18n(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK); - bitBlt(this, x(1), y(6*1.25), &pix); - } - if (rect(1, 7*1.25, i18n(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK); - bitBlt(this, x(1), y(7*1.25), &pix); - } - if (rect(1, 8*1.25, i18n(" ")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK); - bitBlt(this, x(1), y(8*1.25), &pix); - } - } - - if (rect(1, 9.5*1.25, i18n("RNK SCORE NAME DATE")).intersects(e->rect())) { - TQPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK); - bitBlt(this, x(1), y(9.5*1.25), &pix); - } - - for (int i = 0; i < 10; i++) { - s.sprintf("%2d%9d %-3.3s %-8.8s", - i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(), - formatDate(hallOfFame[i].moment.date()).utf8().data()); - if (rect(1, (11+i)*1.25, s).intersects(e->rect())) { - TQPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK); - bitBlt(this, x(1), y((11+i)*1.25), &pix); - } - } - - if (cursor.x != -1 && cursor.y != -1 && cursor.on) { - if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) { - TQPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW); - bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix); - } - } - - if (paused) { - - TQPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK); - TQRect r = bitfont->rect(i18n("PAUSED")); - r.moveCenter(TQPoint(this->width()/2, this->height()/2)); - - bitBlt(this, r.x(), r.y(), &pix); - } -} - -void Score::timerEvent(TQTimerEvent *e) -{ - cursor.on = !cursor.on; - - if (paused) - return; - - if (cursor.x != -1 && cursor.y != -1) - repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); - scrollRepeat = FALSE; - - if (lastPlayer == 0) - repaint(rect(1, 0, i18n(" 1UP ")), FALSE); - - if (lastPlayer == 1) - repaint(rect(21, 0, i18n(" 2UP ")), FALSE); -} - -void Score::keyPressEvent(TQKeyEvent *k) -{ - if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) { - k->ignore(); - return; - } - - int x = cursor.x; - int y = cursor.y; - - uint key = k->key(); - - if (scrollRepeat && (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down)) { - k->ignore(); - return; - } - - if (key != Key_Return) { - if (key == RightKey || key == Key_Right) - if (++cursor.x > 16) - cursor.x = 14; - if (key == LeftKey || key == Key_Left) - if (--cursor.x < 14) - cursor.x = 16; - if (key == UpKey || key == Key_Up) - if (cursor.chr.unicode() < bitfont->lastChar()) - cursor.chr = cursor.chr.unicode()+1; - else - cursor.chr = bitfont->firstChar(); - if (key == DownKey || key == Key_Down) - if (cursor.chr.unicode() > bitfont->firstChar()) - cursor.chr = cursor.chr.unicode()-1; - else - cursor.chr = bitfont->lastChar(); - - if (cursor.x == x && cursor.y == y && - cursor.chr == hallOfFame[lastScore].name.at(cursor.x-14)) { - uint ascii = k->ascii(); - - if (ascii < bitfont->firstChar() || ascii > bitfont->lastChar()) - ascii = toupper(ascii); - - if (ascii >= bitfont->firstChar() && ascii <= bitfont->lastChar()) { - cursor.chr = ascii; - hallOfFame[lastScore].name.at(cursor.x-14) = cursor.chr; - if (++cursor.x > 16) - cursor.x = 14; - } - } - } - - if (key == Key_Return) { - playerName[lastPlayer] = hallOfFame[lastScore].name; - write(); - read(); - lastScore = -1; - lastPlayer = -1; - cursor.x = -1; - cursor.y = -1; - emit gameFinished(); - end(); - } - - if (x != cursor.x || y != cursor.y) { - if (cursor.x != -1) - cursor.chr = hallOfFame[lastScore].name.at(cursor.x-14); - scrollRepeat = FALSE; - repaint(rect(x, y*1.25, cursor.chr), FALSE); - } else - hallOfFame[lastScore].name.at(cursor.x-14) = cursor.chr; - - if (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down) - scrollRepeat = TRUE; - else - repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); -} - -void Score::initKeys() -{ - TQString up("Up"); - up = kapp->config()->readEntry("upKey", up); - UpKey = TDEShortcut(up); - - TQString down("Down"); - down = kapp->config()->readEntry("downKey", down); - DownKey = TDEShortcut(down); - - TQString left("Left"); - left = kapp->config()->readEntry("leftKey", left); - LeftKey = TDEShortcut(left); - - TQString right("Right"); - right = kapp->config()->readEntry("rightKey", right); - RightKey = TDEShortcut(right); -} - -void Score::confTiming(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("CursorBlinkMS")) - cursorBlinkMS = kapp->config()->readNumEntry("CursorBlinkMS", 250); - if (defGroup || kapp->config()->hasKey("HallOfFameMS")) - hallOfFameMS = kapp->config()->readNumEntry("HallOfFameMS", 7000); - if (defGroup || kapp->config()->hasKey("AfterPauseMS")) - afterPauseMS = kapp->config()->readNumEntry("AfterPauseMS", 1000); -} - -void Score::confScheme() -{ - TQString oldgroup = kapp->config()->group(); - TQString newgroup; - - // if not set, read mode and scheme from the configfile - if (mode == -1 && scheme == -1) { - scheme = kapp->config()->readNumEntry("Scheme", -1); - mode = kapp->config()->readNumEntry("Mode", -1); - - // if mode is not set in the defGroup-group, lookup the scheme group - if (scheme != -1 || mode == -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - mode = kapp->config()->readNumEntry("Mode", -1); - kapp->config()->setGroup(oldgroup); - } - } - - int oldCursorBlinkMS = cursorBlinkMS; - - confTiming(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confTiming(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confTiming(FALSE); - } - - if (cursorBlinkMS != oldCursorBlinkMS) { - if (cursorBlinkTimer) - killTimer(cursorBlinkTimer); - cursorBlinkTimer = startTimer(cursorBlinkMS); - } - - kapp->config()->setGroup(oldgroup); -} - -void Score::setScheme(int Scheme, int Mode, Bitfont *font) -{ - mode = Mode; - scheme = Scheme; - - confScheme(); - - bitfont = font; - - for (int p = 0; p < maxPlayer; p++) - for (uint i = 0; i < playerName[p].length(); i++) - if (playerName[p].at(i) < bitfont->firstChar() || - playerName[p].at(i) > bitfont->lastChar()) - playerName[p].at(i) = playerName[p].at(i).upper(); - - for (int i = 0; i < 10; i++) - for (uint j = 0; j < hallOfFame[i].name.length(); j++) - if (hallOfFame[i].name.at(j) < bitfont->firstChar() || - hallOfFame[i].name.at(j) > bitfont->lastChar()) - hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); - - if (cursor.chr.unicode() < bitfont->firstChar() || - cursor.chr.unicode() > bitfont->lastChar()) - cursor.chr = cursor.chr.upper(); -} - -void Score::set(int score) -{ - set(score, 0); -} - -void Score::set(int score, int player) -{ - if (player < 0 || player >= maxPlayer) - return; - - lastPlayer = player; - playerScore[lastPlayer] = score; - - TQString s; - - s.sprintf("%6d0", playerScore[lastPlayer]/10); - repaint(rect(0, 1, s), FALSE); - - if (score > HighScore) { - HighScore = score; - s.sprintf("%8d0", HighScore/10); - repaint(rect(8, 1, s), FALSE); - } -} - -/* - * Set the score for player after the game if over. If the score is in the - * high scores then the hall of fame is updated (shifted) and the scoreboard - * is shown. - */ - -void Score::setScore(int level, int player) -{ - // pointer to the array-position of a new archived top score - lastScore = -1; - - // was it a real game or just a demo (level == 0) - if (player >= 0 && player < maxPlayer && level != 0) { - - lastPlayer = player; - - for (int i = 0; i < 10; i++) - if ( playerScore[lastPlayer] > hallOfFame[i].points) { - lastScore = i; - break; - } - } - - // no new highscore archived, finish after specified time - if (lastScore < 0) { - // enable gameNew directly for an immediate next try - emit gameFinished(); - lastPlayer = -1; - TQTimer::singleShot(hallOfFameMS, this, SLOT(end())); - return; - } - - // shift old (lower) scores to make place for the new one - for (int i = 9; i > lastScore && i > 0; i--) - hallOfFame[i] = hallOfFame[i-1]; - - hallOfFame[lastScore].points = playerScore[lastPlayer]; - hallOfFame[lastScore].levels = level; - hallOfFame[lastScore].moment = TQDateTime::currentDateTime(); - hallOfFame[lastScore].name = playerName[lastPlayer]; - - cursor.x = 14; - cursor.y = 11+lastScore; - cursor.chr = hallOfFame[lastScore].name.at(cursor.x-14); - -// startTimer(cursorBlinkMS); - setFocus(); -} - -/* - * Read the highscores, if no file or a file shorter than 4 bytes (versions before 0.2.4 stores only - * the points of one highscore) exists - the highscores were initialized with default values. - */ -void Score::read() -{ - if (highscoreFile.exists() && highscoreFile.size() > 4) { - if (highscoreFile.open(IO_ReadOnly)) { - TQDataStream s(&highscoreFile); - char *name; - for (int i = 0; i < 10; i++) { - s >> hallOfFame[i].points >> hallOfFame[i].levels >> hallOfFame[i].duration >> - hallOfFame[i].moment >> name; - hallOfFame[i].name = TQString::fromLatin1(name); - delete(name); - } - highscoreFile.close(); - } - } else { - for (int i = 0; i < 10; i++) { - hallOfFame[i].points = 5000; - hallOfFame[i].levels = 0; - hallOfFame[i].duration = TQTime(); - hallOfFame[i].moment = TQDateTime(); - hallOfFame[i].name = "???"; - } - // write(); - } - - for (int i = 0; i < 10; i++) - for (uint j = 0; j < hallOfFame[i].name.length(); j++) - if (hallOfFame[i].name.at(j) < bitfont->firstChar() || - hallOfFame[i].name.at(j) > bitfont->lastChar()) - hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); - - HighScore = hallOfFame[0].points; -} - -void Score::write() -{ - if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath()) - KMessageBox::information(0, - i18n("You're going to create the highscore-file\n" - "'%1'\n" - "for your maschine, that should be used systemwide.\n" - "\n" - "To grant access to the other users, set the appropriate rights (a+w)\n" - "on that file or ask your systemadministator for that favor.\n" - "\n" - "To use a different directory or filename for the highscores," - "specify them in the configfile (kpacmanrc:highscoreFilePath)." - ).arg(systemHighscoreFileInfo.filePath())); - - if (highscoreFile.name() == privateHighscoreFileInfo.filePath()) - KMessageBox::information(0, - i18n("You're using a private highscore-file, that's mostly because of\n" - "missing write-access to the systemwide file\n" - "'%1' .\n" - "\n" - "Ask your systemadministrator for granting you access to that file,\n" - "by setting the appropriate rights (a+w) on it.\n" - "\n" - "To use a different directory or filename for the highscores," - "specify them in the configfile (kpacmanrc:highscoreFilePath)." - ).arg(systemHighscoreFileInfo.filePath()), - TQString::null, "PrivateHighscore"); - - if (highscoreFile.open(IO_WriteOnly)) { - TQDataStream s(&highscoreFile); - for (int i = 0; i < 10; i++) - s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration << - hallOfFame[i].moment << hallOfFame[i].name.latin1(); - highscoreFile.close(); - } -} - -void Score::setPause(bool Paused) -{ - paused = Paused; - - TQRect r = bitfont->rect(i18n("PAUSED")); - r.moveCenter(TQPoint(this->width()/2, this->height()/2)); - repaint(r, TRUE); - - // repaint 1UP or 2UP - repaint(FALSE); -} - -void Score::end() -{ - if (paused) { - TQTimer::singleShot(afterPauseMS, this, SLOT(end())); - return; - } - - // repaint 1UP or 2UP - repaint(FALSE); - - // if lastPlayer != -1 we're already in playing mode - if (lastPlayer == -1) - emit gameHighscores(); -} - -/* - * Return the date in a formatted TQString. The format can be changed using internationalization - * of the string "YY/MM/DD". Invalid TQDate's where returned as "00/00/00". - */ -TQString Score::formatDate(TQDate date) -{ - TQString s = i18n("@YY@/@MM@/@DD@"); - - TQString dd; - dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0); - s.replace(TQRegExp("@YY@"), dd); - dd.sprintf("%02d", date.isValid() ? date.month() : 0); - s.replace(TQRegExp("@MM@"), dd); - dd.sprintf("%02d", date.isValid() ? date.day() : 0); - s.replace(TQRegExp("@DD@"), dd); - - return s; -} - -TQRect Score::rect(int col, float row, TQString str, int align) -{ - TQRect r = bitfont->rect(str); - r.moveBy(x(col), y(row)); - - int dx = 0; - int dy = 0; - - if (align & AlignLeft || align & AlignRight) { - dx = (str.length()-1) * (bitfont->width()/2); - if (align & AlignRight) - dx *= -1; - } - - if (align & AlignTop || align & AlignBottom) { - dy = bitfont->height()/2; - if (align & AlignBottom) - dy *= -1; - } - - if (dx != 0 || dy != 0) - r.moveBy(dx, dy); - - return r; -} - -int Score::x(int col) -{ - return col*bitfont->width(); -} - -int Score::y(float row) -{ - return (int) (row*(bitfont->height()+bitfont->height()/4)); -} - -/** - * Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann. - * Über den "highscoreFilePath"-TDEConfig-Eintrag, kann abweichend von der Standardlokation - * der Standort der "highscore"-Datei spezifiziert werden. - * Wenn die systemweite "highscore"-Datei nicht beschrieben werden kann, wird mit einer - * privaten Datei gearbeitet. - */ -TQFileInfo Score::locateHighscoreFilePath() -{ - TQFileInfo systemHighscoreDirPath; - TQStringList systemHighscoreDirs; - - // Schreibfähige "private" highscore-Datei ermitteln für den fallback. - privateHighscoreFileInfo.setFile(TDEGlobal::dirs()->saveLocation("appdata")+highscoreName); - - // FilePath aus der Konfigurationsdatei benutzen - systemHighscoreFileInfo.setFile(kapp->config()->readEntry("HighscoreFilePath")); - - // Kein Wert aus der Konfiguration erhalten, dann die "system"-Datei suchen. - if (systemHighscoreFileInfo.filePath().isEmpty()) - systemHighscoreDirs = TDEGlobal::dirs()->resourceDirs("appdata"); - else - systemHighscoreDirs = TQStringList(systemHighscoreFileInfo.filePath()); - - for (TQStringList::Iterator i = systemHighscoreDirs.begin(); i != systemHighscoreDirs.end(); ++i) { - - systemHighscoreFileInfo.setFile(*i); - if (systemHighscoreFileInfo.fileName().isEmpty()) - systemHighscoreFileInfo.setFile(systemHighscoreFileInfo.dirPath()+"/"+highscoreName); - - // privateHighscoreFileInfo für die "system" Suche ignorieren - if (systemHighscoreFileInfo.filePath() != privateHighscoreFileInfo.filePath()) - if (!systemHighscoreFileInfo.exists()) { - systemHighscoreDirPath.setFile(systemHighscoreFileInfo.dirPath()); - if (systemHighscoreDirPath.exists() && systemHighscoreDirPath.isWritable()) - return systemHighscoreFileInfo; - } else - if (systemHighscoreFileInfo.isWritable()) - return systemHighscoreFileInfo; - } - - return privateHighscoreFileInfo; -} - -#include "score.moc" diff --git a/kpacman/score.h b/kpacman/score.h deleted file mode 100644 index fc0da45..0000000 --- a/kpacman/score.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef SCORE_H -#define SCORE_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "painter.h" -#include "bitfont.h" - -#define maxPlayer 1 -#define minPlayerNameLength 3 -#define highscoreName "highscore" - -class Score : public TQWidget -{ - Q_OBJECT -public: - Score (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0); - ~Score(); - -public slots: - void setScheme(int scheme, int mode, Bitfont *font=0); - - void set(int score); - void set(int score, int player); - void setScore(int level, int player); - void setPause(bool paused); - - void initKeys(); - -private slots: - void read(); - void write(); - void end(); - -signals: - void gameFinished(); - void gameHighscores(); - -protected: - void timerEvent(TQTimerEvent *); - void paintEvent(TQPaintEvent *); - void keyPressEvent(TQKeyEvent *); - - void focusInEvent(TQFocusEvent *) { ; } - void focusOutEvent(TQFocusEvent *) { ; } - - void confScheme(); - void confTiming(bool defGroup=TRUE); - -private: - Bitfont *bitfont; - - TQRect rect(int col, float row, TQString str, int align = AlignCenter); - int x(int col); - int y(float row); - - TQString formatDate(TQDate date); - - /** - * Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann. - * Über den "highscoreFilePath"-TDEConfig-Eintrag, kann abweichend von der Standardlokation - * der Standort der "highscore"-Datei spezifiziert werden. - * Wenn die systemweite "globale" Datei nicht beschrieben werden kann, wird mit einer - * privaten Datei gearbeitet. - */ - TQFileInfo locateHighscoreFilePath(); - - int cursorBlinkMS; - int hallOfFameMS; - int afterPauseMS; - - bool paused; - - uint UpKey; - uint DownKey; - uint RightKey; - uint LeftKey; - - int lastScore; - int lastPlayer; - int HighScore; - int playerScore[maxPlayer]; - TQString playerName[maxPlayer]; - - struct { - int x; - int y; - TQChar chr; - bool on; - } cursor; - - int cursorBlinkTimer; - bool scrollRepeat; - - struct { - int points; - int levels; - TQTime duration; - TQDateTime moment; - TQString name; - } hallOfFame[10]; - - TQFileInfo systemHighscoreFileInfo; - TQFileInfo privateHighscoreFileInfo; - - TQFile highscoreFile; - - int scheme; - int mode; -}; - -#endif // SCORE_H diff --git a/kpacman/status.cpp b/kpacman/status.cpp deleted file mode 100644 index 12f01b7..0000000 --- a/kpacman/status.cpp +++ /dev/null @@ -1,353 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include - -#include "status.h" - -Status::Status( TQWidget *parent, const char *name, int Scheme, int Mode ) : - TQWidget( parent, name ) -{ - actualLifes = 0; - actualLevel = 0; - - lifesPix = NULL; - levelPix = NULL; - - scheme = Scheme; - mode = Mode; - level = 0; - - confScheme(); -} - -TQPtrList *Status::loadPixmap(TQWidget *parent, TQString pixmapName, - TQPtrList *pixmaps) -{ - if (pixmaps == NULL) { - pixmaps = new TQPtrList; - pixmaps->setAutoDelete(TRUE); - } - - if (!pixmaps->isEmpty()) - pixmaps->clear(); - - TQPixmap PIXMAP(pixmapName); - if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { - TQString msg = i18n("The pixmap could not be contructed.\n\n" - "The file '@PIXMAPNAME@' does not exist,\n" - "or is of an unknown format."); - msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName); - TQMessageBox::information(parent, i18n("Initialization Error"), msg); - return 0; - } - - int height = PIXMAP.height(); - int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); - - TQBitmap BITMAP; - TQBitmap MASK; - - BITMAP = *PIXMAP.mask(); - MASK.resize(width, height); - - for (int x = 0; x < PIXMAP.width()/width; x++) { - TQPixmap *pixmap = new TQPixmap(width, height); - pixmaps->append(pixmap); - bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, CopyROP, TRUE); - bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, CopyROP, TRUE); - pixmap->setMask(MASK); - } - - return pixmaps; -} - -void Status::paintEvent( TQPaintEvent *) -{ - for (int x = 0; x < actualLifes && !lifesPix->isEmpty(); x++) - bitBlt(this, lifesPix->at(0)->width()+(lifesPix->at(0)->width()*x), - (height()-lifesPix->at(0)->height())/2, - lifesPix->at(0), 0, 0, - lifesPix->at(0)->width(), lifesPix->at(0)->height()); - - for (int x = 0; x < actualLevel && !levelPix->isEmpty(); x++) { - erase((width()-levelPix->at(x)->width()*2)-(levelPix->at(x)->width()*levelPos[x]), - (height()-levelPix->at(x)->height())/2, - levelPix->at(x)->width(), levelPix->at(x)->height()); - bitBlt(this, (width()-levelPix->at(x)->width()*2)-(levelPix->at(x)->width()*levelPos[x]), - (height()-levelPix->at(x)->height())/2, - levelPix->at(x), 0, 0, - levelPix->at(x)->width(), levelPix->at(x)->height()); - } -} - -void Status::initPixmaps() -{ - if (lastLifesPixmapName != lifesPixmapName.at(level)) { - lifesPix = loadPixmap(this, lifesPixmapName.at(level), lifesPix); - lastLifesPixmapName = lifesPixmapName.at(level); - } - if (lastLevelPixmapName != levelPixmapName.at(level)) { - levelPix = loadPixmap(this, levelPixmapName.at(level), levelPix); - lastLevelPixmapName = levelPixmapName.at(level); - } -} - -TQString Status::decodeHexOctString(TQString s) -{ - TQString value; - TQString valids; - int pos, xpos = 0, opos = 0; - int v, len, leadin; - const char *ptr; - uchar c; - - while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) || - ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) { - if (xpos != -1) { - valids = "0123456789abcdef"; - leadin = 2; - pos = xpos; - } else { - valids = "01234567"; - leadin = 1; - pos = opos; - } - - c = '\0'; - len = 0; - value = s.mid(pos+leadin, 3); - ptr = value.latin1(); - - while (*ptr != '\0' && (v = valids.find(*ptr++, 0, FALSE)) != -1) { - c = (c * valids.length()) + v; - len++; - } - - value.fill(c, 1); - s.replace(pos, len+leadin, value); - } - - return s; -} - -void Status::fillArray(TQMemArray &array, TQString values, int max) -{ - array.resize(max); - int last = 0; - bool ok; - TQString value; - - for (uint i = 0; i < array.size(); i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - array[i] = value.toInt(&ok); - if (ok) - last = array[i]; - else - array[i] = last; - } -} - -void Status::fillStrList(TQStrList &list, TQString values, int max) -{ - if (!list.isEmpty()) - list.clear(); - - TQString last = ""; - TQString value; - - for (uint i = 0; i < (uint) max; i++) { - if (values.find(',') < 0 && values.length() > 0) { - value = values; - values = ""; - } - if (values.find(',') >= 0) { - value = values.left(values.find(',')); - values.remove(0,values.find(',')+1); - } - if (!value.isEmpty()) - last = decodeHexOctString(value); - list.append(last.latin1()); - } -} - -void Status::fillPixmapName(TQStrList &pixmapName) -{ - TQStrList list = pixmapName; - - if (!pixmapName.isEmpty()) - pixmapName.clear(); - - TQString pixmap; - - TQFileInfo fileInfo; - - for (uint i = 0; i < list.count(); i++) { - pixmap = list.at(i); - - if (pixmap.left(1) != "/" && pixmap.left(1) != "~") - pixmap = TDEGlobal::dirs()->findResource("appdata", pixmapDirectory+pixmap); - - fileInfo.setFile(pixmap); - if (!fileInfo.isReadable() || !fileInfo.isFile()) - pixmap = ""; - - pixmapName.append(pixmap.utf8()); - } -} - -void Status::confLevels(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("Levels")) - maxLevel = kapp->config()->readNumEntry("Levels", 13); -} - -void Status::confMisc(bool defGroup) -{ - if (defGroup || kapp->config()->hasKey("LevelPosition")) - fillArray(levelPos, kapp->config()->readEntry("LevelPosition", "0,1,2,3,,4,,5,,6,,7"), maxLevel); - - if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { - pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); - - if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") - pixmapDirectory.insert(0, "pics/"); - if (pixmapDirectory.right(1) != "/") - pixmapDirectory.append("/"); - } - - if (defGroup || kapp->config()->hasKey("LifesPixmapName")) - fillStrList(lifesPixmapName, - kapp->config()->readEntry("LifesPixmapName", "lifes.xpm"), maxLevel+1); - if (defGroup || kapp->config()->hasKey("LevelPixmapName")) - fillStrList(levelPixmapName, - kapp->config()->readEntry("LevelPixmapName", "level.xpm"), maxLevel+1); - -} - -void Status::confScheme() -{ - TQString oldgroup = kapp->config()->group(); - TQString newgroup; - - // if not set, read mode and scheme from the configfile - if (mode == -1 && scheme == -1) { - scheme = kapp->config()->readNumEntry("Scheme", -1); - mode = kapp->config()->readNumEntry("Mode", -1); - - // if mode is not set in the defGroup-group, lookup the scheme group - if (scheme != -1 || mode == -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - mode = kapp->config()->readNumEntry("Mode", -1); - kapp->config()->setGroup(oldgroup); - } - } - - confLevels(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confLevels(FALSE); - } - - kapp->config()->setGroup(oldgroup); - - confMisc(); - - if (mode != -1) { - newgroup.sprintf("Mode %d", mode); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - } - - if (scheme != -1) { - newgroup.sprintf("Scheme %d", scheme); - kapp->config()->setGroup(newgroup); - - confMisc(FALSE); - } - - fillPixmapName(lifesPixmapName); - fillPixmapName(levelPixmapName); - - initPixmaps(); - - setFixedHeight(minHeight()); - - kapp->config()->setGroup(oldgroup); -} - -void Status::setScheme(int Scheme, int Mode) -{ - mode = Mode; - scheme = Scheme; - - confScheme(); - - repaint(); -} - -int Status::minHeight() -{ - if (lifesPix->isEmpty() && levelPix->isEmpty()) - return 0; - if (levelPix->isEmpty()) - return lifesPix->at(0)->height(); - if (lifesPix->isEmpty()) - return levelPix->at(0)->height(); - return (lifesPix->at(0)->height() > levelPix->at(0)->height()) ? - lifesPix->at(0)->height() : levelPix->at(0)->height(); -} - -int Status::minWidth() -{ - if (lifesPix->isEmpty() && levelPix->isEmpty()) - return 0; - if (levelPix->isEmpty()) - return lifesPix->at(0)->width(); - if (lifesPix->isEmpty()) - return levelPix->at(0)->width(); - return (lifesPix->at(0)->width() > levelPix->at(0)->width()) ? - lifesPix->at(0)->width() : levelPix->at(0)->width(); -} - -void Status::setLifes(int lifes) -{ - actualLifes = lifes; - repaint(); -} - -void Status::setLevel(int Level) -{ - level = Level; - - initPixmaps(); - - actualLevel = (level > (int) levelPix->count()) ? (int) levelPix->count() : level; - repaint(); -} - -#include "status.moc" diff --git a/kpacman/status.h b/kpacman/status.h deleted file mode 100644 index 6cbf759..0000000 --- a/kpacman/status.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef STATUS_H -#define STATUS_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -class Status : public TQWidget -{ - Q_OBJECT -public: - Status(TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1); - ~Status() {}; - -public slots: - void setScheme(int scheme, int mode); - void setLevel(int level); - void setLifes(int lifes); - -protected: - void paintEvent(TQPaintEvent *); - int minHeight(); - int minWidth(); - - TQString decodeHexOctString(TQString str); - - void fillArray(TQMemArray &, TQString, int); - void fillStrList(TQStrList &, TQString, int); - void fillPixmapName(TQStrList &); - - void confScheme(); - void confLevels(bool defGroup=TRUE); - void confMisc(bool defGroup=TRUE); - - void initPixmaps(); - -private: - TQMemArray levelPos; - int actualLifes; - int actualLevel; - - TQString pixmapDirectory; - - TQStrList lifesPixmapName; - TQStrList levelPixmapName; - - TQString lastLifesPixmapName; - TQString lastLevelPixmapName; - - TQPtrList *loadPixmap(TQWidget *parent, TQString pixmapName, - TQPtrList *pixmaps=0); - - TQPtrList *lifesPix; - TQPtrList *levelPix; - - int maxLevel; - int level; - - int scheme; - int mode; -}; - -#endif // STATUS_H diff --git a/tdepacman/CMakeL10n.txt b/tdepacman/CMakeL10n.txt new file mode 100644 index 0000000..3e90f50 --- /dev/null +++ b/tdepacman/CMakeL10n.txt @@ -0,0 +1,8 @@ +##### create translation templates ############## + +tde_l10n_create_template( "messages/tdepacman" ) + +tde_l10n_create_template( + CATALOG "desktop_files/tdepacman.desktop/" + SOURCES tdepacman.desktop +) diff --git a/tdepacman/CMakeLists.txt b/tdepacman/CMakeLists.txt new file mode 100644 index 0000000..f01bedd --- /dev/null +++ b/tdepacman/CMakeLists.txt @@ -0,0 +1,63 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${TDEGAMES_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} + ${TDEGAMES_LIBRARY_DIRS} +) + + +##### tdepacman (executable) + +tde_add_executable( ${PROJECT_NAME} AUTOMOC + + SOURCES + tdepacmanview.cpp + referee.cpp + status.cpp + painter.cpp + score.cpp + pacman.cpp + monster.cpp + keys.cpp + fruit.cpp + energizer.cpp + board.cpp + bitfont.cpp + tdepacman.cpp + main.cpp + LINK + tdeui-shared + tdecore-shared + ${TDEGAMES_LIBRARIES} + + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### other data + +install( + FILES tdepacmanui.rc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +install( + FILES tdepacmanrc + DESTINATION ${CONFIG_INSTALL_DIR} +) + + +tde_create_translated_desktop( ${PROJECT_NAME}.desktop ) + + +##### icons + +tde_install_icons( ${PROJECT_NAME} ) diff --git a/tdepacman/bitfont.cpp b/tdepacman/bitfont.cpp new file mode 100644 index 0000000..f1535fb --- /dev/null +++ b/tdepacman/bitfont.cpp @@ -0,0 +1,71 @@ +#include "bitfont.h" + +Bitfont::Bitfont(TQString fontname, uchar firstChar, uchar lastChar) +{ + if (!fontname.isEmpty()) + font.load(fontname); + if (font.width() == font.height()) { + fontWidth = fontHeight = font.width() / 16; + fontFirstChar = 1; + fontLastChar = 255; + } else { + fontWidth = font.width()/(lastChar-firstChar+1); + fontHeight = font.height(); + fontFirstChar = firstChar; + fontLastChar = lastChar; + } +} + +TQRect Bitfont::rect(TQString str) +{ + return TQRect(0, 0, str.length()*fontWidth, fontHeight); +} + +TQPixmap Bitfont::text(TQString str, TQColor fg, TQColor bg) +{ + TQPixmap FG(str.length()*fontWidth, fontHeight); + TQBitmap MASK(str.length()*fontWidth, fontHeight, TRUE); + + const uchar *s = reinterpret_cast(str.latin1()); + for (uint i = 0; i < str.length(); i++) { + if (font.width() == font.height()) + bitBlt(&MASK, i*fontWidth, 0, &font, + (*s%16)*fontWidth, (*s/16)*fontWidth, fontWidth, fontHeight); + else + if (*s >= fontFirstChar && *s <= fontLastChar) + bitBlt(&MASK, i*fontWidth, 0, &font, + (*s-fontFirstChar)*fontWidth, 0, fontWidth, fontHeight); + s++; + } + + FG.fill(fg); + FG.setMask(MASK); + + if (bg.isValid()) { + TQPixmap BG(str.length()*fontWidth, fontHeight); + BG.fill(bg); + bitBlt(&BG, 0, 0, &FG); + return BG; + } else + return FG; +} + +uchar Bitfont::firstChar() +{ + return fontFirstChar; +} + +uchar Bitfont::lastChar() +{ + return fontLastChar; +} + +int Bitfont::width() +{ + return fontWidth; +} + +int Bitfont::height() +{ + return fontHeight; +} diff --git a/tdepacman/bitfont.h b/tdepacman/bitfont.h new file mode 100644 index 0000000..029383e --- /dev/null +++ b/tdepacman/bitfont.h @@ -0,0 +1,30 @@ +#ifndef BITFONT_H +#define BITFONT_H + +#include +#include +#include +#include + +#include "colors.h" + +class Bitfont +{ +public: + Bitfont(TQString fontname, uchar firstChar, uchar lastChar); + + TQPixmap text(TQString str, TQColor fg = BLACK, TQColor bg = TQColor()); + TQRect rect(TQString str); + int width(); + int height(); + uchar firstChar(); + uchar lastChar(); +private: + TQBitmap font; + int fontWidth; + int fontHeight; + uchar fontFirstChar; + uchar fontLastChar; +}; + +#endif // BITFONT_H diff --git a/tdepacman/bitmaps.h b/tdepacman/bitmaps.h new file mode 100644 index 0000000..f430384 --- /dev/null +++ b/tdepacman/bitmaps.h @@ -0,0 +1,67 @@ +static unsigned char demo_bits[] = { + "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + "++*******************************************************++" + "+*********************************************************+" + "+** *** **+" + "+** . . . . . . . . . . . . *** . . . . . . . . . . . . **+" + "+** *** **+" + "+** . ******* . ********* . *** . ********* . ******* . **+" + "+** ******* ********* *** ********* ******* **+" + "+** o ******* . ********* . *** . ********* . ******* o **+" + "+** ******* ********* *** ********* ******* **+" + "+** . ******* . ********* . *** . ********* . ******* . **+" + "+** **+" + "+** . . . . . . . . . . . . . . . . . . . . . . . . . . **+" + "+** **+" + "+** . ******* . *** . *************** . *** . ******* . **+" + "+** ******* *** *************** *** ******* **+" + "+** . ******* . *** . *************** . *** . ******* . **+" + "+** *** *** *** **+" + "+** . . . . . . *** . . . . *** . . . . *** . . . . . . **+" + "+** *** *** *** **+" + "+************ . ********* *** ********* . ************+" + "++*********** ********* *** ********* ***********++" + "+++++++++++** . ********* *** ********* . **+++++++++++" + "+++++++++++** *** *** **+++++++++++" + "+++++++++++** . *** 0 *** . **+++++++++++" + "+++++++++++** *** *** **+++++++++++" + "+++++++++++** . *** ######---###### *** . **+++++++++++" + "+************ *** ######---###### *** ************+" + "+************ . *** ## ## *** . ************+" + " ## ## " + " . ## 2 1 3 ## . " + " ## ## " + "+************ . *** ## ## *** . ************+" + "+************ *** ############### *** ************+" + "+++++++++++** . *** ############### *** . **+++++++++++" + "+++++++++++** *** *** **+++++++++++" + "+++++++++++** . *** F *** . **+++++++++++" + "+++++++++++** *** *** **+++++++++++" + "+++++++++++** . *** *************** *** . **+++++++++++" + "++*********** *** *************** *** ***********++" + "+************ . *** *************** *** . ************+" + "+** *** **+" + "+** . . . . . . . . . . . . *** . . . . . . . . . . . . **+" + "+** *** **+" + "+** . ******* . ********* . *** . ********* . ******* . **+" + "+** ******* ********* *** ********* ******* **+" + "+** . ******* . ********* . *** . ********* . ******* . **+" + "+** *** *** **+" + "+** o . . *** . . . . . . . P . . . . . . . *** . . o **+" + "+** *** *** **+" + "+****** . *** . *** . *************** . *** . *** . ******+" + "+****** *** *** *************** *** *** ******+" + "+****** . *** . *** . *************** . *** . *** . ******+" + "+** *** *** *** **+" + "+** . . . . . . *** . . . . *** . . . . *** . . . . . . **+" + "+** *** *** *** **+" + "+** . ******************* . *** . ******************* . **+" + "+** ******************* *** ******************* **+" + "+** . ******************* . *** . ******************* . **+" + "+** **+" + "+** . . . . . . . . . . . . . . . . . . . . . . . . . . **+" + "+** **+" + "+*********************************************************+" + "++*******************************************************++" + "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" +}; diff --git a/tdepacman/board.cpp b/tdepacman/board.cpp new file mode 100644 index 0000000..621a086 --- /dev/null +++ b/tdepacman/board.cpp @@ -0,0 +1,421 @@ +#include + +#include + +#include +#include +#include +#include +#include + +#include "board.h" +#include "bitmaps.h" + +Board::Board(int size) : TQMemArray (size) +{ + sz = size; // set size of board + + map = ""; + mapName = ""; // no map loaded so far + + init(None); // initialize varibales +} + +void Board::init(Image image, TQString levelName) +{ + prisonEntry = OUT; + prisonExit = OUT; + fruitHome = OUT; + fruitPosition = OUT; + pacmanHome = OUT; + pacmanPosition = OUT; + for (int m = 0; m < 8; m++) { + monsterHome[m] = OUT; + monsterPosition[m] = OUT; + } + for (int e = 0; e < 8; e++) { + energizerPosition[e] = OUT; + } + for (int e = 0; e < 8; e++) { + tunnelPosition[e] = OUT; + } + + fill(0); + numPoints = 0; + numEnergizers = 0; + numMonsters = 0; + numTunnels = 0; + + if (!levelName.isNull() && !levelName.isEmpty()) + if (mapName == levelName) + image = File; + else { + TQFile levelFile(levelName); + if (!levelFile.open(IO_ReadOnly)) { + + TQString msg = i18n("The levelmap could not be constructed.\n\n" + "The file '@LEVELNAME@' does not exist,\n" + "or could not be opened for reading."); + msg.replace(TQRegExp("@LEVELNAME@"), levelName); + // TQMessageBox::information(0, i18n("Initialization Error"), msg); + printf("%s\n", msg.local8Bit().data()); + } else { + map.fill(' ', BoardHeight*BoardWidth); + int height = 0; + + TQTextStream levelStream(&levelFile); + while (!levelStream.eof() && height < BoardHeight) { + TQString line = levelStream.readLine(); + + if (line.find(TQRegExp("^ *;")) == -1) { + + line.replace(TQRegExp(";.*"), ""); // strip off comments + line.replace(TQRegExp("\" *$"), ""); // strip off trailing " + line.replace(TQRegExp("^ *\""), ""); // strip off leading " + + map.replace(height*BoardWidth, + (line.length() > BoardWidth) ? BoardWidth : line.length(), + line.latin1()); + + height++; + } + } + mapName = levelName; + levelFile.close(); + image = File; + } + } + + switch (image) { + case Intro : // setup(demo_bits); + break; + case Demo : setup(demo_bits); + break; + case Level : setup(demo_bits); + break; + case File : setup(reinterpret_cast(map.latin1())); + break; + default : break; + } +} + +void Board::setup(const uchar *buf) +{ + for ( int index = 0; buf[index] != 0 && index < BoardWidth*BoardHeight; index++ ) { + switch (buf[index]) { + case '*' : set(index, brick); break; + case '+' : set(index, out); break; + case '#' : set(index, prison); break; + case '-' : set(index, gate); break; + case 'E' : set(index, tunnel); break; + case '.' : set(index, Point); break; + case 'o' : set(index, energizer); break; + case 'I' : set(index, prisonentry); break; + case 'O' : set(index, prisonexit); break; + case 'F' : set(index, fruithome); break; + case 'P' : set(index, pacmanhome); break; + default : if (buf[index] >= '0' && buf[index] <= '7') { + set(index, monsterhome, buf[index]-(uchar)'0'); + } + } + } +} + +bool Board::inBounds(int pos) +{ + return ( pos < 0 || pos > sz-1 ? FALSE : TRUE); +} + +void Board::set(int pos, Square sq, int m) +{ + if (inBounds(pos)) + switch (sq) { + case out : at(pos) = OUT; break; + case Point : at(pos) |= pointBit; numPoints++; break; + case tunnel : at(pos) = sq; + for (int e = 0; e < numTunnels; e++) { // if tunnel is already on board + if (tunnelPosition[e] == pos) // don't do it again. + pos = OUT; + } + if (pos != OUT) { + tunnelPosition[numTunnels] = pos; + numTunnels++; + } + break; + case energizer : at(pos) |= energizerBit; + for (int e = 0; e < numEnergizers; e++) { + if (energizerPosition[e] == pos) + pos = OUT; + } + if (pos != OUT) { + energizerPosition[numEnergizers] = pos; + numEnergizers++; + } + break; + case fruit : at(pos) |= fruitBit; fruitPosition = pos; break; + case pacman : at(pos) |= pacmanBit; pacmanPosition = pos; break; + case monster : at(pos) |= (monsterBit << m); + monsterPosition[m] = pos; break; + case prisonentry : prisonEntry = pos; at(pos) = empty; break; + case prisonexit : prisonExit = pos; at(pos) = empty; break; + case fruithome : fruitHome = pos; at(pos) = empty; break; + case pacmanhome : pacmanHome = pos; at(pos) = empty; break; + case monsterhome : monsterHome[m] = pos; at(pos) = empty; + if (m == 0 && prisonExit == OUT) + prisonExit = pos; + if (m == 1 && prisonEntry == OUT) + prisonEntry = pos; + numMonsters++; + break; + default : at(pos) = sq; + } +} + +void Board::reset(int pos, Square sq, int m) +{ + bool found = FALSE; + if (inBounds(pos)) + switch (sq) { + case out : at(pos) = empty; break; + case Point : at(pos) &= ~ pointBit; numPoints--; break; + case energizer : at(pos) &= ~ energizerBit; + for (int e = 0; e < numEnergizers; e++) { // delete the position of the eaten + if (found) // energizer in the position array + energizerPosition[e-1] = energizerPosition[e]; + if (energizerPosition[e] == pos) + found = TRUE; + } + energizerPosition[numEnergizers--] = OUT; + break; + case fruit : at(pos) &= ~ fruitBit; fruitPosition = OUT; break; + case pacman : at(pos) &= ~ pacmanBit; pacmanPosition = OUT; break; + case monster : at(pos) &= ~ (monsterBit << m); + monsterPosition[m] = OUT; break; + default : at(pos) = at(pos) & varBits; + } +} + +int Board::position(Square sq, int m) +{ + switch(sq) { + case prisonentry : return prisonEntry; + case prisonexit : return prisonExit; + case fruit : return fruitPosition; + case fruithome : return fruitHome; + case pacman : return pacmanPosition; + case pacmanhome : return pacmanHome; + case monster : return monsterPosition[m]; + case monsterhome : return monsterHome[m]; + case energizer : return energizerPosition[m]; + case tunnel : return tunnelPosition[m]; + default : return OUT; + } +} + +bool Board::isOut(int pos) +{ + if (inBounds(pos)) + return (at(pos) == OUT ? TRUE : FALSE); + return TRUE; +} + +bool Board::isEmpty(int pos) +{ + if (inBounds(pos)) + return ((at(pos) & fixBits) == empty ? TRUE : FALSE); + return TRUE; +} + +bool Board::isBrick(int pos) +{ + if (inBounds(pos)) + return ((at(pos) & fixBits) == brick ? TRUE : FALSE); + return FALSE; +} + +bool Board::isPrison(int pos) +{ + if (inBounds(pos)) + return ((at(pos) & fixBits) == prison ? TRUE : FALSE); + return FALSE; +} + +bool Board::isGate(int pos) +{ + if (inBounds(pos)) + return ((at(pos) & fixBits) == gate ? TRUE : FALSE); + return FALSE; +} + +bool Board::isTunnel(int pos) +{ + if (inBounds(pos)) + return ((at(pos) & fixBits) == tunnel ? TRUE : FALSE); + return FALSE; +} + +bool Board::isPoint(int pos) +{ + if (inBounds(pos) && at(pos) != OUT) + return ((at(pos) & pointBit) != 0 ? TRUE : FALSE); + return FALSE; +} + +bool Board::isEnergizer(int pos) +{ + if (inBounds(pos) && at(pos) != OUT) + return ((at(pos) & energizerBit) != 0 ? TRUE : FALSE); + return FALSE; +} + +bool Board::isFruit(int pos) +{ + if (inBounds(pos) && at(pos) != OUT) + return ((at(pos) & fruitBit) != 0 ? TRUE : FALSE); + return FALSE; +} + +bool Board::isPacman(int pos) +{ + if (inBounds(pos) && at(pos) != OUT) + return ((at(pos) & pacmanBit) != 0 ? TRUE : FALSE); + return FALSE; +} + +bool Board::isMonster(int pos) +{ + if (inBounds(pos) && at(pos) != OUT) + return ((at(pos) & monsterBits) != 0 ? TRUE : FALSE); + return FALSE; +} + +bool Board::isWay(int pos, int dir, Square sq) { + int p1 = move(pos, dir, 2); + if (p1 == OUT) + return (sq == out ? TRUE : FALSE); + int p2, p3; + if (dir == N || dir == S) { + p2 = move(p1, E); + p3 = move(p1, W); + } else { + p2 = move(p1, N); + p3 = move(p1, S); + } + switch (sq) { + case out : return isOut(p1) | isOut(p2) | isOut(p3); + case empty : return isEmpty(p1) & isEmpty(p2) & isEmpty(p3); + case brick : return isBrick(p1) | isBrick(p2) | isBrick(p3); + case prison : return isPrison(p1) | isPrison(p2) | isPrison(p3); + case gate : return isGate(p1) & isGate(p2) & isGate(p3); + case tunnel : return isTunnel(p1) & + (isTunnel(p2) || isEmpty(p2)) & + (isTunnel(p3) || isEmpty(p3)); + default : return FALSE; + } +} + +bool Board::isJump(int pos, int dir) { + switch (dir) { + case NW: return pos < BoardWidth || x(pos) == 0; + case N: return pos < BoardWidth; + case NE: return pos < BoardWidth || x(pos) == BoardWidth-1; + case W: return x(pos) == 0; + case E: return x(pos) == BoardWidth-1; + case SW: return pos >= sz-BoardWidth || x(pos) == 0; + case S: return pos >= sz-BoardWidth; + case SE: return pos >= sz-BoardWidth || x(pos) == BoardWidth-1; + } + return FALSE; +} + +int Board::move(int pos, int dir, int steps) +{ + if (steps < 0) { // move backwards + dir = turn(dir); // turn around and do your steps + steps *= -1; + } + + while (steps-- != 0) { // until all steps are gone + switch (dir) { + case NW: pos = pos >= BoardWidth && x(pos) > 0 ? (pos-BoardWidth)-1 : sz-1; + break; + case N: pos = pos >= BoardWidth ? pos-BoardWidth : (sz-BoardWidth)+x(pos); + break; + case NE: pos = pos >= BoardWidth && x(pos) < BoardWidth-1 ? + (pos-BoardWidth)+1 : sz-BoardWidth; + break; + case W: pos = x(pos) > 0 ? pos-1 : pos+(BoardWidth-1); + break; + case E: pos = x(pos) < BoardWidth-1 ? pos+1 : pos-(BoardWidth-1); + break; + case SW: pos = pos < sz-BoardWidth && x(pos) > 0 ? (pos+BoardWidth)-1 : BoardWidth-1; + break; + case S: pos = pos < sz-BoardWidth ? pos+BoardWidth : x(pos); + break; + case SE: pos = pos < sz-BoardWidth && x(pos) < BoardWidth-1 ? (pos+BoardWidth)+1 : 0; + break; + } + } + return pos; // here we are +} + +int Board::closeup(int pos, int dir, int target) +{ + if (dir == N || dir == S) { + if (x(target) < x(pos)) + return W; + if (x(target) > x(pos)) + return E; + } else { + if (y(target) < y(pos)) + return N; + if (y(target) > y(pos)) + return S; + } + return dir; +} + +int Board::x(int pos) +{ + return pos % BoardWidth; +} + +int Board::y(int pos) +{ + return pos/BoardWidth; +} + +int Board::turn(int dir) +{ + switch (dir) { + case N : return S; + case NE : return SW; + case E : return W; + case SE : return NW; + case S : return N; + case SW : return NE; + case W : return E; + case NW : return SE; + default : return dir; + } +} + +int Board::points() +{ + return numPoints; +} + +int Board::energizers() +{ + return numEnergizers; +} + +int Board::monsters() +{ + return numMonsters; +} + +int Board::tunnels() +{ + return numTunnels; +} diff --git a/tdepacman/board.h b/tdepacman/board.h new file mode 100644 index 0000000..3b56973 --- /dev/null +++ b/tdepacman/board.h @@ -0,0 +1,102 @@ +#ifndef BOARD_H +#define BOARD_H + +#include +#include +#include +#include + +#define OUT -1 + +enum Square {out = OUT, empty, brick, prison, gate, tunnel, prisonentry, prisonexit, + Point, energizer, fruit, pacman, monster, + fruithome, pacmanhome, monsterhome}; + +enum Image { None, Intro, Demo, Level, File }; + +#define X -1 +#define N 0 +#define S 1 +#define E 2 +#define W 3 +#define NE 4 +#define SE 5 +#define NW 6 +#define SW 7 + +#define BoardWidth 59 +#define BoardHeight 65 + +#define fixBits 0x0007 +#define varBits 0xFFF8 +#define monsterBits 0xFF00 + +#define pointBit 0x0008 +#define energizerBit 0x0010 +#define fruitBit 0x0020 +#define pacmanBit 0x0040 +#define monsterBit 0x0100 + +class Board : public TQMemArray +{ +public: + Board (int size); + ~Board() {}; + void init(Image image, TQString levelName=0); + void setup(const uchar *buf); + + void set(int pos, Square sq, int m = 0); + void reset(int pos, Square sq, int m = 0); + int position(Square sq, int m = 0); + + bool isOut(int pos); + bool isEmpty(int pos); + bool isBrick(int pos); + bool isPrison(int pos); + bool isGate(int pos); + bool isTunnel(int pos); + bool isPoint(int pos); + bool isEnergizer(int pos); + bool isFruit(int pos); + bool isPacman(int pos); + bool isMonster(int pos); + bool isWay(int pos, int dir, Square sq); + bool isJump(int pos, int dir); + + int move(int pos, int dir, int steps = 1); + int closeup(int pos, int dir, int target); + int x(int pos); + int y(int pos); + int turn(int dir); + + int points(); + int energizers(); + int monsters(); + int tunnels(); + +private: + bool inBounds(int pos); + int sz; // size of board + + TQString map; + TQString mapName; // Filename of the latest loaded map + + int prisonEntry; // position of prisonentry + int prisonExit; // position of prisonexit + int pacmanHome; // startposition of pacman + int monsterHome[8]; // startposition of monsters + int fruitHome; // startposition of fruit + + int pacmanPosition; // actual position of pacman + int monsterPosition[8]; // actual position of monsters + int fruitPosition; // actual position of fruit + int energizerPosition[8]; // actual position of energizers + int tunnelPosition[8]; // position of tunnels + + int numMonsters; // number of monsters on the board + int numPoints; // number of points (left) on the board + int numEnergizers; // number of energizers (left) + int numTunnels; // number of tunnels on the board +}; + +#endif // BOARD_H diff --git a/tdepacman/colors.h b/tdepacman/colors.h new file mode 100644 index 0000000..33beae2 --- /dev/null +++ b/tdepacman/colors.h @@ -0,0 +1,21 @@ +#ifndef COLORS_H +#define COLORS_H + +#include + +#define BLACK TQColor(TQt::black) +#define RED TQColor(TQt::red) +#define BROWN TQColor(0xde, 0x95, 0x41) +#define PINK TQColor(0xff, 0xba, 0xde) +#define CYAN TQColor(0x00, 0xff, 0xde) +#define LIGHTBLUE TQColor(0x41, 0xba, 0xde) +#define ORANGE TQColor(0xff, 0xba, 0x41) +#define YELLOW TQColor(TQt::yellow) +#define BLUE TQColor(0x20, 0x20, 0xde) +#define GREEN TQColor(TQt::green) +#define LIGHTGREEN TQColor(0x41, 0xba, 0x94) +#define FLESH TQColor(0xff, 0xba, 0x94) +#define WHITE TQColor(0xd8, 0xdc, 0xd8) + +#endif // COLORS_H + diff --git a/tdepacman/energizer.cpp b/tdepacman/energizer.cpp new file mode 100644 index 0000000..ca08f3b --- /dev/null +++ b/tdepacman/energizer.cpp @@ -0,0 +1,61 @@ +#include "energizer.h" + +Energizer::Energizer(Board *b) +{ + board = b; + setOn(); + actualPosition = OUT; + maxPixmaps = 0; +} + +void Energizer::setMaxPixmaps(int max) +{ + maxPixmaps = max; +} + +void Energizer::setOff() +{ + actualState = off; +} + +void Energizer::setOn() +{ + actualState = on; + actualPix = 0; +} + +void Energizer::setPosition(int pos) +{ + board->reset(actualPosition, energizer); + actualPosition = pos; + board->set(actualPosition, energizer); +} + +energizerState Energizer::state() +{ + return actualState; +} + +int Energizer::position() +{ + return actualPosition; +} + +bool Energizer::move() +{ + if (actualPosition == OUT) + return FALSE; + + if (++actualPix >= maxPixmaps) + actualPix = 0; + + return TRUE; +} + +int Energizer::pix() +{ + if (actualPosition == OUT || actualState == off) + return -1; + + return actualPix; +} diff --git a/tdepacman/energizer.h b/tdepacman/energizer.h new file mode 100644 index 0000000..377cd02 --- /dev/null +++ b/tdepacman/energizer.h @@ -0,0 +1,30 @@ +#ifndef ENERGIZER_H +#define ENERGIZER_H + +#include "board.h" + +enum energizerState { on, off }; + +class Energizer { +public: + Energizer(Board *b); + void setMaxPixmaps(int max); + void setOff(); + void setOn(); + void setPosition(int pos); + energizerState state(); + int position(); + bool move(); + int pix(); + +private: + Board *board; + + energizerState actualState; // the state of energizer + + int actualPix; // last Pixmap-index + int maxPixmaps; // Number of Pixmaps (1..) + int actualPosition; // actual position on board +}; + +#endif // ENERGIZER_H diff --git a/tdepacman/fruit.cpp b/tdepacman/fruit.cpp new file mode 100644 index 0000000..e6ad2d5 --- /dev/null +++ b/tdepacman/fruit.cpp @@ -0,0 +1,176 @@ +#include + +#include "fruit.h" + +Fruit::Fruit(Board *b) +{ + board = b; + maxPixmaps = 0; + setLevel(0, 0, 0, 0); +} + +void Fruit::setEaten(int duration) +{ + actualState = eaten; + timeLeft = duration; + actualDirection = X; +} + +void Fruit::setLevel(int level, int wDuration, int fDuration, int ticks) +{ + actualLevel = level; + waitDuration = wDuration; + fruitDuration = fDuration; + pauseDuration = ticks; + pause = 0; + actualState = inactive; + timeLeft = waitDuration; + lastPosition = OUT; + setPosition(OUT); + setMovement(OUT, OUT, 0); + actualDirection = X; + setMaxPixmaps(maxPixmaps); +} + +void Fruit::setMaxPixmaps(int max) +{ + maxPixmaps = max; + if (actualLevel-1 < maxPixmaps) + actualPix = actualLevel == 0 ? 0 : actualLevel-1; + else if (maxPixmaps > 0) + actualPix = rand() % maxPixmaps; + else + actualPix = -1; +} + +void Fruit::setMovement(int entry, int tunnel, int iq) +{ + homePosition = board->position(fruithome); + entryPosition = entry; + tunnelPosition = tunnel; + IQ = iq; +} + +void Fruit::setPosition(int pos) +{ + board->reset(lastPosition, fruit); + actualPosition = lastPosition = pos; + board->set(actualPosition, fruit); +} + +void Fruit::setDirection(int dir) +{ + actualDirection = dir; +} + +fruitState Fruit::state() +{ + return actualState; +} + +int Fruit::position() +{ + return actualPosition; +} + +int Fruit::direction() +{ + return actualDirection; +} + +bool Fruit::move(bool activate) +{ + if (timeLeft > 0) { + timeLeft--; + } + + if (actualDirection == X || actualState == inactive) { + if (timeLeft == 0 || (activate && actualState == inactive)) { + if (actualState == inactive) { + if (entryPosition == OUT || tunnelPosition == OUT) { + setPosition(board->position(fruithome)); + } else { + setPosition(entryPosition); + actualDirection = 0; + while (!board->isWay(actualPosition, actualDirection, empty) || + board->isJump(actualPosition, actualDirection)) + actualDirection++; + } + timeLeft = fruitDuration; + setMaxPixmaps(maxPixmaps); + actualState = active; + } else { + actualState = inactive; + setPosition(OUT); + timeLeft = waitDuration; + actualDirection = X; + } + return TRUE; + } + return FALSE; + } + + if (pause-- > 0) + return FALSE; + else + pause = pauseDuration; + + if (actualPosition == OUT) + return FALSE; + + if (actualDirection == X) + return TRUE; + + int d = actualDirection; + + if (rand() % (int) ((190-IQ)/10) == 0) + if (timeLeft > 0) // coming home or leaving again + d = board->closeup(actualPosition, d, homePosition); + else + d = board->closeup(actualPosition, d, tunnelPosition); + else + do // try new direction, but not the opposite + d = rand() % 4; // direction, to prevent hectic movement. + while (d == board->turn(actualDirection)); + + while ((!board->isWay(actualPosition, d, empty) && + !board->isWay(actualPosition, d, tunnel)) || + d == board->turn(actualDirection)) { + if (d != actualDirection) // if new direction is not possible, + d = actualDirection; // try current direction first. + else + d = rand() % 4; + } + + actualDirection = d; + actualPosition = board->move(actualPosition, actualDirection); + + if (actualPosition == homePosition) { + timeLeft = 0; + } + + if (board->isTunnel(actualPosition)) { + setPosition(OUT); + timeLeft = waitDuration; + actualState = inactive; + actualDirection = X; + if (board->tunnels() > 0) { + entryPosition = board->position(tunnel, rand() % board->tunnels()); + tunnelPosition = board->position(tunnel, rand() % board->tunnels()); + } + } + + if (actualPosition != lastPosition) { + setPosition(actualPosition); + } + + return TRUE; +} + +int Fruit::pix() +{ + if (actualPosition == OUT || actualState == inactive) + return -1; + else + return actualPix; +} diff --git a/tdepacman/fruit.h b/tdepacman/fruit.h new file mode 100644 index 0000000..fbbd9c0 --- /dev/null +++ b/tdepacman/fruit.h @@ -0,0 +1,53 @@ +#ifndef FRUIT_H +#define FRUIT_H + +#include + +#include "board.h" + +enum fruitState { inactive, active, eaten }; + +class Fruit { +public: + Fruit(Board *b); + void setEaten(int duration); + void setLevel(int level, int wDuration, int fDuration, int ticks = -1); + void setMaxPixmaps(int max); + void setMovement(int entry, int tunnel, int iq); + void setPosition(int pos); + void setDirection(int dir); + fruitState state(); + int position(); + int direction(); + bool move(bool activate=FALSE); + int pix(); + +private: + Board *board; + + int IQ; // Intelligence of movement (0 = dumb..180=smart) + + fruitState actualState; // the state of fruit + + int pauseDuration; // number of ticks before next movement + int pause; // actual ticks before movement (0 = move) + + int timeLeft; // Ticks remaining of current state + + int waitDuration; // Time before fruit appears + int fruitDuration; // Length of active-time in ticks + + int actualDirection; // actual direction of the fruit + int actualPosition; // actual position on board + int lastPosition; // the last position of the fruit + int actualLevel; // level for kind of fruit and score + int actualPix; + int maxPixmaps; // Number of Pixmaps (1..) + + int entryPosition; // where to come in + int homePosition; // where to go, on the way in + int tunnelPosition; // where to exit +}; + +#endif // FRUIT_H + diff --git a/tdepacman/hi16-app-tdepacman.png b/tdepacman/hi16-app-tdepacman.png new file mode 100644 index 0000000..7dc8172 Binary files /dev/null and b/tdepacman/hi16-app-tdepacman.png differ diff --git a/tdepacman/hi32-app-tdepacman.png b/tdepacman/hi32-app-tdepacman.png new file mode 100644 index 0000000..2c2d2e6 Binary files /dev/null and b/tdepacman/hi32-app-tdepacman.png differ diff --git a/tdepacman/keys.cpp b/tdepacman/keys.cpp new file mode 100644 index 0000000..df8f980 --- /dev/null +++ b/tdepacman/keys.cpp @@ -0,0 +1,192 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "keys.h" + +PKeys::PKeys( TQWidget *parent, const char *name) + : TQDialog( parent, name, TRUE, 0 ) +{ + TDEStandardDirs *dirs = TDEGlobal::dirs(); + + TQPushButton *okButton = new TQPushButton(this); + okButton->setText(i18n("Ok")); + okButton->setFixedSize(okButton->size()); + connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) ); + okButton->move(20,210); + + TQPushButton *defaultButton = new TQPushButton(this); + defaultButton->setText(i18n("Defaults")); + defaultButton->setFixedSize(defaultButton->size()); + connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) ); + defaultButton->move(140,210); + + TQPushButton *cancelButton = new TQPushButton(this); + cancelButton->setText(i18n("Cancel")); + cancelButton->setFixedSize(cancelButton->size()); + connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) ); + cancelButton->move(260,210); + + TQFrame *separator = new TQFrame(this); + separator->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); + separator->setGeometry( 20, 190, 340, 4 ); + + for ( int x = 0; x < 4; x++) { + TQLabel *l = new TQLabel(this); + l->setAlignment(AlignCenter); + labels[x] = l; + } + + labels[0]->setGeometry(120, 20, 140, 20 ); + labels[1]->setGeometry(120,160, 140, 20 ); + labels[2]->setGeometry( 20, 92, 100, 20 ); + labels[3]->setGeometry(265, 92, 100, 20 ); + + TQString pixPath; + + TQPushButton *up = new TQPushButton(this); + pixPath = dirs->findResource("appdata", "pics/up.xpm"); + up->setPixmap( TQPixmap(pixPath)); + up->setFixedSize(up->pixmap()->size()); + connect( up, SIGNAL(clicked()),this, SLOT(butUp()) ); + up->move(180, 50); + + TQPushButton *down = new TQPushButton(this); + pixPath = dirs->findResource("appdata", "pics/down.xpm"); + down->setPixmap( TQPixmap(pixPath)); + down->setFixedSize(down->pixmap()->size()); + connect( down, SIGNAL(clicked()),this, SLOT(butDown()) ); + down->move(180, 130); + + TQPushButton *left = new TQPushButton(this); + pixPath = dirs->findResource("appdata", "pics/left.xpm"); + left->setPixmap( TQPixmap(pixPath)); + left->setFixedSize(left->pixmap()->size()); + connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) ); + left->move(140, 90); + + TQPushButton *right = new TQPushButton(this); + pixPath = dirs->findResource("appdata", "pics/right.xpm"); + right->setPixmap( TQPixmap(pixPath)); + right->setFixedSize(right->pixmap()->size()); + connect( right, SIGNAL(clicked()),this, SLOT(butRight()) ); + right->move(220, 90); + + + setCaption(i18n("Change Direction Keys")); + setFixedSize(380, 260); + lab = 0; + init(); +} + +void PKeys::keyPressEvent( TQKeyEvent *e ) +{ + uint kCode = e->key() & ~(SHIFT | CTRL | ALT); + TQString string = TDEAccel::keyToString(kCode); + + if (lab != 0) { + if ( string.isNull() ) + lab->setText(i18n("Undefined key")); + else + lab->setText(string); + } + else if ( lab == 0 && e->key() == Key_Escape) + reject(); +} + +void PKeys::butUp() +{ + getKey(0); +} + +void PKeys::butDown() +{ + getKey(1); +} + +void PKeys::butLeft() +{ + getKey(2); +} + +void PKeys::butRight() +{ + getKey(3); +} + +void PKeys::getKey(int i) +{ + if ( lab != 0) + focusOut(lab); + + focusIn(labels[i]); +} + +void PKeys::focusOut(TQLabel *l) +{ + l->setFrameStyle( TQFrame::NoFrame ); + l->setBackgroundColor(backgroundColor()); + l->repaint(); +} + +void PKeys::focusIn(TQLabel *l) +{ + lab = l; + lab->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + lab->setBackgroundColor(white); + lab->repaint(); +} + +void PKeys::defaults() +{ + if ( lab != 0) + focusOut(lab); + + lab = 0; + + labels[0]->setText("Up"); + labels[1]->setText("Down"); + labels[2]->setText("Left"); + labels[3]->setText("Right"); +} + +void PKeys::init() +{ + TQString up("Up"); + up = kapp->config()->readEntry("upKey", up); + labels[0]->setText(up); + + TQString down("Down"); + down = kapp->config()->readEntry("downKey", down); + labels[1]->setText(down); + + TQString left("Left"); + left = kapp->config()->readEntry("leftKey", left); + labels[2]->setText(left); + + TQString right("Right"); + right = kapp->config()->readEntry("rightKey", right); + labels[3]->setText(right); +} + +void PKeys::ok() +{ + kapp->config()->writeEntry("upKey", labels[0]->text() ); + kapp->config()->writeEntry("downKey", labels[1]->text() ); + kapp->config()->writeEntry("leftKey", labels[2]->text() ); + kapp->config()->writeEntry("rightKey", labels[3]->text() ); + kapp->config()->sync(); + + accept(); +} + +#include "keys.moc" diff --git a/tdepacman/keys.h b/tdepacman/keys.h new file mode 100644 index 0000000..f1c822a --- /dev/null +++ b/tdepacman/keys.h @@ -0,0 +1,44 @@ +#ifndef KEYS_H +#define KEYS_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include + +class PKeys : public TQDialog +{ + Q_OBJECT +public: + PKeys( TQWidget *parent=0, const char *name=0 ); + +private slots: + void butRight(); + void butLeft(); + void butUp(); + void butDown(); + + void getKey(int); + void defaults(); + void focusIn(TQLabel *); + void focusOut(TQLabel *); + + void ok(); + +protected: + void keyPressEvent( TQKeyEvent * ); + +private: + void init(); + + TQLabel *labels[4]; + TQLabel *lab; +}; + +#endif // KEYS_H diff --git a/tdepacman/lo16-app-tdepacman.png b/tdepacman/lo16-app-tdepacman.png new file mode 100644 index 0000000..7dc8172 Binary files /dev/null and b/tdepacman/lo16-app-tdepacman.png differ diff --git a/tdepacman/lo32-app-tdepacman.png b/tdepacman/lo32-app-tdepacman.png new file mode 100644 index 0000000..2c2d2e6 Binary files /dev/null and b/tdepacman/lo32-app-tdepacman.png differ diff --git a/tdepacman/main.cpp b/tdepacman/main.cpp new file mode 100644 index 0000000..e80c93e --- /dev/null +++ b/tdepacman/main.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : Sam Jan 19 13:37:57 CET 2002 + copyright : (C) 1998-2003 by Jörg Thönnissen + email : joe@dsite.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include + +#include "tdepacman.h" + +static const char *description = + I18N_NOOP("A pacman game for the TDE Desktop\n\n" + "The program based on the source of ksnake\n" + "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" + "The design was strongly influenced by the pacman\n" + "(c) 1980 MIDWAY MFG.CO.\n\n" + "I like to thank my girlfriend Elke Krueers for\n" + "the last 14 years of her friendship\n" + "and Christine Nickel for the 'K' in my life."); + +static TDECmdLineOptions options[] = +{ + { 0, 0, 0 } + // INSERT YOUR COMMANDLINE OPTIONS HERE +}; + +int main(int argc, char *argv[]) +{ + + TDEAboutData aboutData( "tdepacman", I18N_NOOP("TDEpacman"), + VERSION, description, TDEAboutData::License_GPL, + "(c) 1998-2003, Jörg Thönnissen", 0, 0, "joe@dsite.de"); + aboutData.addAuthor("Jörg Thönnissen",0, "joe@dsite.de"); + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options. + + TDEApplication app; + + TDEpacmanApp *tdepacman = new TDEpacmanApp(); + tdepacman->show(); + + return app.exec(); +} diff --git a/tdepacman/monster.cpp b/tdepacman/monster.cpp new file mode 100644 index 0000000..2f402b4 --- /dev/null +++ b/tdepacman/monster.cpp @@ -0,0 +1,262 @@ +#include "monster.h" +#include "board.h" + +Monster::Monster(Board *b, int mid) +{ + board = b; + ID = mid; + + setREM(0); + setHarmless(0, 0, 0); + setArrested(0, 0); + setFreedom(board->position(prisonexit)); + if (mid == 0) + setPrison(board->position(prisonentry)); + else + setPrison(board->position(monsterhome, mid)); + + actualPosition = lastPosition = OUT; + feetPosition = 0; + IQ = 0; + maxBodyPixmaps = 0; + maxEyesPixmaps = 0; +} + +void Monster::setMaxPixmaps(int maxBody, int maxEyes) +{ + if (feetPosition >= (maxBody/10)) + feetPosition = 0; + maxBodyPixmaps = maxBody; + maxEyesPixmaps = maxEyes; +} + +void Monster::setArrested(int ticks, int duration) +{ + actualState = dangerous; + pauseDuration = ticks; + pause = 0; + arrestDuration = arrestLeft = duration; + arrestPause = ticks; + harmlessLeft = 0; +} + +void Monster::setDangerous(int ticks, int iq) +{ + actualState = dangerous; + pauseDuration = ticks; + pause = 0; + dangerousPause = ticks; + harmlessLeft = 0; + IQ = iq; +} + +void Monster::setHarmless(int ticks, int hDuration, int wDuration) +{ + actualState = harmless; + pauseDuration = ticks; + pause = 0; + harmlessDuration = harmlessLeft = hDuration; + warningDuration = wDuration; +} + +void Monster::setREM(int ticks) +{ + actualState = rem; + pauseDuration = ticks; + pause = 0; +} + +void Monster::setPosition(int pos) +{ + board->reset(lastPosition, monster, ID); // reset old position on the board + actualPosition = lastPosition = pos; // set position of monster + board->set(actualPosition, monster, ID); + feetPosition = 0; +} + +void Monster::setPrison(int pos) +{ + prisonPosition = pos; +} + +void Monster::setFreedom(int pos) +{ + freedomPosition = pos; +} + +void Monster::setDirection(int dir) +{ + if (dir == X) + lastDirection = actualDirection; + actualDirection = dir; +} + +monsterState Monster::state() +{ + return actualState; +} + +int Monster::position() +{ + return actualPosition; +} + +int Monster::direction() +{ + return actualDirection; +} + +int Monster::id() +{ + return ID; +} + +bool Monster::move() +{ + if (arrestLeft > 1) + arrestLeft--; + + if (harmlessLeft > 0) { + harmlessLeft--; + if (harmlessLeft == 0 && actualState == harmless) { + actualState = dangerous; + pauseDuration = dangerousPause; + } + } + + if (pause-- > 0) + return FALSE; + else + pause = pauseDuration; + + if (actualPosition == OUT) + return FALSE; + + if (actualDirection == X) { + if (++feetPosition >= (maxBodyPixmaps/10)) + feetPosition = 0; + return TRUE; + } + + lastPosition = actualPosition; + int d = actualDirection; + + if (arrestLeft > 1) { // during the arrest, only up and down + if (!board->isWay(actualPosition, d, empty) && + !board->isWay(actualPosition, d, tunnel)) + d = board->turn(actualDirection); + } + + if (arrestLeft == 1) { // going out of the prison + if (((d == W || d == E) && + board->x(actualPosition) == board->x(freedomPosition)) || + ((d == S || d == N) && + board->y(actualPosition) == board->y(freedomPosition)) || + board->isWay(actualPosition, d, brick) || + board->isWay(actualPosition, d, prison)) { + d = board->closeup(actualPosition, d, freedomPosition); + } + while (board->isWay(actualPosition, d, brick) || + board->isWay(actualPosition, d, prison)) { + if (d == actualDirection) + d = rand() % 4; + else + d = actualDirection; + } + if (actualState == dangerous) + pauseDuration = dangerousPause; + + } + + if (arrestLeft == 0) + if (actualState == rem) { // on the way to prison + + d = board->closeup(actualPosition, d, prisonPosition); + + while (board->isWay(actualPosition, d, brick) || + board->isWay(actualPosition, d, prison)) { + if (d != actualDirection) // if new direction is not possible, + d = actualDirection; // try current direction first. + else + d = rand() % 4; + } + + } else { // dangerous or harmless movement + if (rand() % (int) ((190-IQ)/10) == 0) { + d = board->closeup(actualPosition, d, board->position(pacman)); + if (actualState == harmless) + d = board->turn(d); + } else + do // try new direction, but not the opposite + d = rand() % 4; // direction, to prevent hectic movement. + while (d == board->turn(actualDirection)); + + while ((!board->isWay(actualPosition, d, empty) && + !board->isWay(actualPosition, d, tunnel)) || + d == board->turn(actualDirection)) { + if (d != actualDirection) // if new direction is not possible, + d = actualDirection; // try current direction first. + else + d = rand() % 4; + } + } + + actualDirection = d; + actualPosition = board->move(actualPosition, actualDirection); + + if (arrestLeft == 1 && actualPosition == freedomPosition) + arrestLeft = 0; + + if (actualState == rem && actualPosition == prisonPosition) { + actualState = dangerous; + pauseDuration = arrestPause; + arrestLeft = arrestDuration+1; + actualDirection = S; + } + + if (actualPosition != lastPosition) { + board->reset(lastPosition, monster, ID); + board->set(actualPosition, monster, ID); + } + + if (++feetPosition >= (maxBodyPixmaps/10)) + feetPosition = 0; + + return TRUE; +} + +int Monster::body() +{ + if (actualState == rem || actualPosition == OUT) + return -1; + else + if (actualState == harmless) + if (harmlessLeft > warningDuration || + harmlessLeft % (int) (warningDuration/4.5) > (int) (warningDuration/9)) + return ((maxBodyPixmaps/10)*8)+feetPosition; + else + return ((maxBodyPixmaps/10)*9)+feetPosition; + else + return ((maxBodyPixmaps/10)*ID)+feetPosition; +} + +int Monster::eyes() +{ + if (actualState == harmless || actualPosition == OUT) + return -1; + else + switch (actualDirection) { + case N : return 0; + case E : return 1; + case S : return 2; + case W : return 3; + case X : switch (lastDirection) { + case N : return 0; + case E : return 1; + case S : return 2; + default : return 3; + } + default : return -1; + } +} + diff --git a/tdepacman/monster.h b/tdepacman/monster.h new file mode 100644 index 0000000..385c513 --- /dev/null +++ b/tdepacman/monster.h @@ -0,0 +1,62 @@ +#ifndef MONSTER_H +#define MONSTER_H + +#include +#include +#include + +#include "board.h" + +enum monsterState { dangerous, harmless, rem, arrested }; + +class Monster { +public: + Monster(Board *b, int mid = 0); + void setMaxPixmaps(int maxBody, int maxEyes); + void setArrested(int ticks, int duration); + void setDangerous(int ticks, int IQ); + void setHarmless(int ticks, int hDuration, int wDuration); + void setREM(int ticks); + void setPosition(int pos); + void setPrison(int pos); + void setFreedom(int pos); + void setDirection(int dir); + monsterState state(); + int position(); + int direction(); + int id(); + bool move(); + int body(); + int eyes(); +private: + Board *board; + int ID; // ID of monster (0 = 1st, 1 = 2nd ... 7 = last) + int IQ; // Intelligence of movement (0 = dumb..180 = smart) + + monsterState actualState; // The state of the monster + + int pauseDuration; // Number of ticks before movement + int pause; // actual ticks before moevment (0 = move) + int dangerousPause; // pause in dangerous-state + + int harmlessDuration; // Length of harmless-time in ticks + int harmlessLeft; // rest of the time in harmless-state + int warningDuration; // warningtime before monster get dangerous again + + int arrestDuration; // Length of arrest in ticks + int arrestLeft; // time left of arrest + int arrestPause; // pause in arrest-state + + int actualDirection; // actual direction of monster + int lastDirection; // last direction, before no movement (X) + int actualPosition; // actual position on board + int lastPosition; // the last position of the monster + int feetPosition; // left, right, left, right, ... + int maxBodyPixmaps; + int maxEyesPixmaps; + int prisonPosition; // where to go, if arrested + int freedomPosition; // where to go, if released from prison +}; + +#endif // MONSTER_H + diff --git a/tdepacman/pacman.cpp b/tdepacman/pacman.cpp new file mode 100644 index 0000000..40f60a8 --- /dev/null +++ b/tdepacman/pacman.cpp @@ -0,0 +1,147 @@ +#include "pacman.h" +#include "board.h" + +Pacman::Pacman(Board *b) +{ + board = b; + setDemo(FALSE); + setAlive(0); + actualPosition = lastPosition = OUT; + mouthPosition = 0; + lastPix = 0; + maxPixmaps = 0; +} + +void Pacman::setMaxPixmaps(int max) +{ + if (actualDirection == X && lastPix >= 0) { + actualDirection = lastPix / (maxPixmaps/4); + if (max < maxPixmaps) + mouthPosition = 0; + else + mouthPosition = lastPix % (maxPixmaps/4); + maxPixmaps = max; + + lastPix = pix(); + + actualDirection = X; + } else + maxPixmaps = max; +} + +void Pacman::setAlive(int ticks) +{ + actualState = alive; + pauseDuration = ticks; + pause = 0; +} + +void Pacman::setPosition(int pos) +{ + board->reset(lastPosition, pacman); + actualPosition = lastPosition = pos; + board->set(actualPosition, pacman); + mouthPosition = 0; +} + +void Pacman::setDirection(int dir, bool forced) +{ + if (forced || + board->isWay(actualPosition, dir, empty) || + board->isWay(actualPosition, dir, tunnel)) { + if (dir == X) + lastPix = pix(); + actualDirection = dir; + nextDirection = X; + } else + nextDirection = dir; +} + +void Pacman::setDemo(bool yes) +{ + demo = yes; +} + +pacmanState Pacman::state() +{ + return actualState; +} + +int Pacman::position() +{ + return actualPosition; +} + +int Pacman::direction() +{ + return actualDirection; +} + +bool Pacman::move() +{ + if (pause-- > 0) + return FALSE; + else + pause = pauseDuration; + + if (actualDirection == X || actualPosition == OUT) + return FALSE; + + lastPosition = actualPosition; + + if (demo) { + int d = actualDirection; + + do // try new direction, but not the opposite + d = rand() % 4; // direction, to prevent hectic movement. + while (d == board->turn(actualDirection)); + + while (!board->isWay(actualPosition, d, empty) && + !board->isWay(actualPosition, d, tunnel)) { + if (d != actualDirection) // if new actualDirection is not possible, + d = actualDirection; // try current actualDirection first. + else + d = rand() % 4; + } + + actualDirection = d; + actualPosition = board->move(actualPosition, actualDirection); + + } else { + + if (nextDirection != X) + if (board->isWay(actualPosition, nextDirection, empty) || + board->isWay(actualPosition, nextDirection, tunnel)) { + actualDirection = nextDirection; + nextDirection = X; + } + + if (board->isWay(actualPosition, actualDirection, empty) || + board->isWay(actualPosition, actualDirection, tunnel)) + actualPosition = board->move(actualPosition, actualDirection); + } + + if (actualPosition != lastPosition) { + board->reset(lastPosition, pacman); + board->set(actualPosition, pacman); + + if (++mouthPosition >= (maxPixmaps/4)) + mouthPosition = 0; + } + return TRUE; +} + +int Pacman::pix() +{ + if (actualPosition != OUT && maxPixmaps > 0) + switch (actualDirection) { + case N : return ((maxPixmaps/4)*0)+mouthPosition; + case E : return ((maxPixmaps/4)*1)+mouthPosition; + case S : return ((maxPixmaps/4)*2)+mouthPosition; + case W : return ((maxPixmaps/4)*3)+mouthPosition; + case X : return lastPix; + } + + return -1; +} + diff --git a/tdepacman/pacman.h b/tdepacman/pacman.h new file mode 100644 index 0000000..6f1a7c1 --- /dev/null +++ b/tdepacman/pacman.h @@ -0,0 +1,47 @@ +#ifndef PACMAN_H +#define PACMAN_H + +#include +#include +#include + +#include "board.h" + +enum pacmanState { alive }; + +class Pacman { +public: + Pacman(Board *b); + void init(bool Demo = FALSE); + void setMaxPixmaps(int max); + void setAlive(int ticks); + void setPosition(int pos); + void setDirection(int dir, bool forced = FALSE); + void setDemo(bool yes); + pacmanState state(); + int position(); + int direction(); + bool move(); + int pix(); + +private: + Board *board; + + pacmanState actualState; // the state of pacman + bool demo; // real life or just demo + + int pauseDuration; // number of ticks before next movement + int pause; // actual ticks before movement (0=move) + + int actualDirection; // actual direction of pacman + int nextDirection; // where he wants to go + int lastPix; // last Pixmap-index before no movement + int maxPixmaps; // Number of Pixmaps (1..) + int actualPosition; // actual position on board + int lastPosition; // the last position of pacman + int mouthPosition; // eating + +}; + +#endif // PACMAN_H + diff --git a/tdepacman/painter.cpp b/tdepacman/painter.cpp new file mode 100644 index 0000000..4c897c8 --- /dev/null +++ b/tdepacman/painter.cpp @@ -0,0 +1,955 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "painter.h" +#include "board.h" + +Painter::Painter( Board *b, TQWidget *parent, int Scheme, int Mode, Bitfont *font) +{ + w = parent; + board = b; + + pointPix = NULL; + wallPix = NULL; + prisonPix = NULL; + energizerPix = NULL; + fruitPix = NULL; + pacmanPix = NULL; + dyingPix = NULL; + eyesPix = NULL; + monsterPix = NULL; + fruitScorePix = NULL; + monsterScorePix = NULL; + + lastPointPixmapName = ""; + lastWallPixmapName = ""; + lastPrisonPixmapName = ""; + lastEnergizerPixmapName = ""; + lastFruitPixmapName = ""; + lastPacmanPixmapName = ""; + lastDyingPixmapName = ""; + lastEyesPixmapName = ""; + lastMonsterPixmapName = ""; + lastFruitScorePixmapName = ""; + lastMonsterScorePixmapName = ""; + + bitfont = font; + + scheme = Scheme; + mode = Mode; + level = 0; + + confScheme(); +} + +TQPtrList *Painter::loadPixmap(TQWidget *parent, TQString pixmapName, + TQPtrList *pixmaps) +{ + if (pixmaps == NULL) { + pixmaps = new TQPtrList; + pixmaps->setAutoDelete(TRUE); + } + + if (!pixmaps->isEmpty()) + pixmaps->clear(); + + TQPixmap PIXMAP(pixmapName); + if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { + TQString msg = i18n("The pixmap could not be contructed.\n\n" + "The file '@PIXMAPNAME@' does not exist,\n" + "or is of an unknown format."); + msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName); + // TQMessageBox::critical(parent, i18n("Initialization Error"), msg); + printf("%s\n", msg.local8Bit().data()); + return 0; + } + + int height = PIXMAP.height(); + int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); + + TQBitmap BITMAP; + TQBitmap MASK; + + BITMAP = *PIXMAP.mask(); + MASK.resize(width, height); + + for (int x = 0; x < PIXMAP.width()/width; x++) { + TQPixmap *pixmap = new TQPixmap(width, height); + pixmaps->append(pixmap); + bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE); + bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE); + pixmap->setMask(MASK); + } + + return pixmaps; +} + +TQPtrList *Painter::textPixmap(TQStrList &str, TQPtrList *pixmaps, + TQColor fg, TQColor bg) +{ + if (pixmaps == NULL) { + pixmaps = new TQPtrList; + pixmaps->setAutoDelete(TRUE); + } + + if (!pixmaps->isEmpty()) + pixmaps->clear(); + + for (uint s = 0; s < str.count(); s++) { + TQPixmap *pixmap = new TQPixmap(bitfont->text(str.at(s), fg, bg)); + pixmaps->append(pixmap); + } + + return pixmaps; +} + +TQPtrList *Painter::textPixmap(TQString str, TQPtrList *pixmaps, + TQColor fg, TQColor bg) +{ + if (pixmaps == NULL) { + pixmaps = new TQPtrList; + pixmaps->setAutoDelete(TRUE); + } + + if (!pixmaps->isEmpty()) + pixmaps->clear(); + + TQPixmap *pixmap = new TQPixmap(bitfont->text(str, fg, bg)); + pixmaps->append(pixmap); + + return pixmaps; +} + +/* Return the point of the upperleft pixel of the block representing that position + * on the board. + */ +TQPoint Painter::point(int pos) +{ + return TQPoint((board->x(pos)-1)*BlockWidth, (board->y(pos)-1)*BlockHeight); +} + + +TQRect Painter::rect(int pos, PixMap pix, uint i) +{ + if (pos == OUT) + return TQRect(); + + TQPixmap *PIXMAP = NULL; + switch (pix) { + case PacmanPix : PIXMAP = pacmanPix-> + at(checkRange(i, pacmanPix->count()-1)); + break; + case DyingPix : PIXMAP = dyingPix-> + at(checkRange(i, dyingPix->count()-1)); + break; + case MonsterPix : PIXMAP = monsterPix-> + at(checkRange(i, monsterPix->count()-1)); + break; + case EyesPix : PIXMAP = eyesPix-> + at(checkRange(i, eyesPix->count()-1)); + break; + case FruitPix : PIXMAP = fruitPix-> + at(checkRange(i, fruitPix->count()-1)); + break; + case PointPix : PIXMAP = pointPix-> + at(checkRange(i, pointPix->count()-1)); + break; + case EnergizerPix : PIXMAP = energizerPix-> + at(checkRange(i, energizerPix->count()-1)); + break; + case FruitScorePix : PIXMAP = fruitScorePix-> + at(checkRange(i, fruitScorePix->count()-1)); + break; + case MonsterScorePix : PIXMAP = monsterScorePix-> + at(checkRange(i,monsterScorePix->count()-1)); + break; + default : PIXMAP = wallPix-> + at(checkRange(i, wallPix->count()-1)); + } + if (PIXMAP == NULL) + return TQRect(); + + TQRect rect = PIXMAP->rect(); + TQPoint point = this->point(pos); + rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); + + return rect; +} + +TQRect Painter::rect(int pos, TQString str, int align) +{ + if (pos == OUT) // return an empty rect if the position + return TQRect(); // is invalid + TQPoint point = this->point(pos); + TQRect rect = bitfont->rect(str); + + rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); + + int dx = 0; + int dy = 0; + + if (align & TQLabel::AlignLeft || align & TQLabel::AlignRight) { + dx = (str.length()-1) * (bitfont->width()/2); + if (align & TQLabel::AlignRight) + dx *= -1; + } + + if (align & TQLabel::AlignTop || align & TQLabel::AlignBottom) { + dy = bitfont->height()/2; + if (align & TQLabel::AlignBottom) + dy *= -1; + } + + if (dx != 0 || dy != 0) + rect.moveBy(dx, dy); + + return rect; +} + +TQRect Painter::rect(TQRect r1, TQRect r2) +{ + TQRect rect; + rect.setLeft(r1.left() < r2.left() ? r1.left() : r2.left()); + rect.setTop(r1.top() < r2.top() ? r1.top() : r2.top()); + rect.setRight(r1.right() > r2.right() ? r1.right() : r2.right()); + rect.setBottom(r1.bottom() > r2.bottom() ? r1.bottom() : r2.bottom()); + + return rect; +} + +void Painter::erase(int pos, PixMap pix, uint i) +{ + if (pos == OUT) + return; + TQRect rect = this->rect(pos, pix, i); + bitBlt(&roomPix, rect.x(), rect.y(), &backPix, + rect.x(), rect.y(), rect.width(), rect.height()); +} + +int Painter::maxPixmaps(PixMap pix) +{ + switch (pix) { + case WallPix : return (int) wallPix->count(); + case PrisonPix : return (int) prisonPix->count(); + case PointPix : return (int) pointPix->count(); + case EnergizerPix : return (int) energizerPix->count(); + case FruitPix : return (int) fruitPix->count(); + case PacmanPix : return (int) pacmanPix->count(); + case DyingPix : return (int) dyingPix->count(); + case EyesPix : return (int) eyesPix->count(); + case MonsterPix : return (int) monsterPix->count(); + case FruitScorePix : return (int) fruitScorePix->count(); + case MonsterScorePix : return (int) monsterScorePix->count(); + default : return 0; + } +} + +void Painter::draw(TQPoint point, DrawWidget where, TQPixmap pix) +{ + switch (where) { + case Widget : bitBlt(w, point.x(), point.y(), &pix); + break; + case RoomPix : bitBlt(&roomPix, point.x(), point.y(), &pix); + break; + case BackPix : bitBlt(&backPix, point.x(), point.y(), &pix); + break; + } +} + +void Painter::draw(TQRect rect, DrawWidget where, TQPixmap pix) +{ + draw(TQPoint(rect.x(), rect.y()), where, pix); +} + +void Painter::draw(int pos, DrawWidget where, PixMap pix, uint i) +{ + TQPixmap *PIXMAP = NULL; + switch (pix) { + case PacmanPix : PIXMAP = pacmanPix-> + at(checkRange(i, pacmanPix->count()-1)); + break; + case DyingPix : PIXMAP = dyingPix-> + at(checkRange(i, dyingPix->count()-1)); + break; + case MonsterPix : PIXMAP = monsterPix-> + at(checkRange(i, monsterPix->count()-1)); + break; + case EyesPix : PIXMAP = eyesPix-> + at(checkRange(i, eyesPix->count()-1)); + break; + case FruitPix : PIXMAP = fruitPix-> + at(checkRange(i, fruitPix->count()-1)); + break; + case EnergizerPix : PIXMAP = energizerPix-> + at(checkRange(i, energizerPix->count()-1)); + break; + case FruitScorePix : PIXMAP = fruitScorePix-> + at(checkRange(i, fruitScorePix->count()-1)); + break; + case MonsterScorePix : PIXMAP = monsterScorePix-> + at(checkRange(i,monsterScorePix->count()-1)); + break; + default : ; + } + + if (PIXMAP == NULL) + return; + + TQRect rect = PIXMAP->rect(); + TQPoint point = this->point(pos); + rect.moveCenter(TQPoint(point.x()-1, point.y()-1)); + + switch (where) { + case Widget : bitBlt(w, rect.x(), rect.y(), PIXMAP); + break; + case RoomPix : bitBlt(&roomPix, rect.x(), rect.y(), PIXMAP); + break; + case BackPix : bitBlt(&backPix, rect.x(), rect.y(), PIXMAP); + break; + } +} + +TQPixmap Painter::draw(int pos, DrawWidget where, + TQString str, TQColor fg, TQColor bg, int align) +{ + TQPixmap TEXT = bitfont->text(str, fg, bg); + + TQRect rect = this->rect(pos, str, align); + TQPixmap SAVE = TQPixmap(rect.width(), rect.height()); + + switch (where) { + case Widget : bitBlt(&SAVE, 0, 0, w, rect.x(), rect.y()); + bitBlt(w, rect.x(), rect.y(), &TEXT); + break; + case RoomPix : bitBlt(&SAVE, 0, 0, &roomPix, rect.x(), rect.y()); + bitBlt(&roomPix, rect.x(), rect.y(), &TEXT); + break; + case BackPix : bitBlt(&SAVE, 0, 0, &backPix, rect.x(), rect.y()); + bitBlt(&backPix, rect.x(), rect.y(), &TEXT); + break; + } + + return SAVE; +} + +TQRect Painter::draw(int col, int row, DrawWidget where, + TQString str, TQColor fg, TQColor bg, int align) +{ + TQPixmap TEXT = bitfont->text(str, fg, bg); + + TQRect rect = this->rect(row*BoardWidth+col, str, align); + draw(rect, where, TEXT); + + return rect; +} + +void Painter::initPixmaps() +{ + if (lastPointPixmapName != pointPixmapName.at(level)) { + pointPix = loadPixmap(w, pointPixmapName.at(level), pointPix); + lastPointPixmapName = pointPixmapName.at(level); + } + if (lastPrisonPixmapName != prisonPixmapName.at(level)) { + prisonPix = loadPixmap(w, prisonPixmapName.at(level), prisonPix); + lastPrisonPixmapName = prisonPixmapName.at(level); + } + if (lastEnergizerPixmapName != energizerPixmapName.at(level)) { + energizerPix = loadPixmap(w, energizerPixmapName.at(level), energizerPix); + lastEnergizerPixmapName = energizerPixmapName.at(level); + } + if (lastFruitPixmapName != fruitPixmapName.at(level)) { + fruitPix = loadPixmap(w, fruitPixmapName.at(level), fruitPix); + lastFruitPixmapName = fruitPixmapName.at(level); + } + if (lastPacmanPixmapName != pacmanPixmapName.at(level)) { + pacmanPix = loadPixmap(w, pacmanPixmapName.at(level), pacmanPix); + lastPacmanPixmapName = pacmanPixmapName.at(level); + } + if (lastDyingPixmapName != dyingPixmapName.at(level)) { + dyingPix = loadPixmap(w, dyingPixmapName.at(level), dyingPix); + lastDyingPixmapName = dyingPixmapName.at(level); + } + if (lastEyesPixmapName != eyesPixmapName.at(level)) { + eyesPix = loadPixmap(w, eyesPixmapName.at(level), eyesPix); + lastEyesPixmapName = eyesPixmapName.at(level); + } + if (lastMonsterPixmapName != monsterPixmapName.at(level)) { + monsterPix = loadPixmap(w, monsterPixmapName.at(level), monsterPix); + lastMonsterPixmapName = monsterPixmapName.at(level); + } + + if (lastFruitScorePixmapName != fruitScorePixmapName.at(level) || + *fruitScorePixmapName.at(level) == '\0') { + if (*fruitScorePixmapName.at(level) == '\0') { + fruitScorePix = textPixmap(fruitScoreString, fruitScorePix, PINK); + } else { + fruitScorePix = loadPixmap(w, fruitScorePixmapName.at(level), + fruitScorePix); + lastFruitScorePixmapName = fruitScorePixmapName.at(level); + } + } + + if (lastMonsterScorePixmapName != monsterScorePixmapName.at(level) || + *monsterScorePixmapName.at(level) == '\0') { + if (*monsterScorePixmapName.at(level) == '\0') { + monsterScorePix = textPixmap(monsterScoreString, monsterScorePix, CYAN); + } else { + monsterScorePix = loadPixmap(w, monsterScorePixmapName.at(level), + monsterScorePix); + lastMonsterScorePixmapName = monsterScorePixmapName.at(level); + } + } + + if (lastWallPixmapName != wallPixmapName.at(level)) { + wallPix = loadPixmap(w, wallPixmapName.at(level), wallPix); + if (wallPix->isEmpty()) { + BlockWidth = 0; + BlockHeight = 0; + } else { + BlockWidth = wallPix->at(0)->width(); + BlockHeight = wallPix->at(0)->height(); + } + lastWallPixmapName = wallPixmapName.at(level); + } +} + +void Painter::initbackPixmaps() +{ + backgroundColor = BLACK; + + backPix.resize((BoardWidth-3)*BlockWidth, (BoardHeight-3)*BlockHeight ); + backPix.fill(backgroundColor); +} + +void Painter::initRoomPixmap() +{ + roomPix.resize((BoardWidth-3)*BlockWidth, (BoardHeight-3)*BlockHeight ); + bitBlt(&roomPix,0,0, &backPix); + + for (unsigned int x = 0; x < board->size(); x++) { + if (board->isBrick(x)) + drawBrick(x); + if (board->isPrison(x) || board->isGate(x)) + drawPrison(x); + if (board->isPoint(x)) + drawPoint(x); + } +} + +void Painter::drawBrick(int pos) +{ + int border = 0; + if (board->isBrick(board->move(pos, N ))) border |= (1 << 0); + if (board->isBrick(board->move(pos, NE))) border |= (1 << 1); + if (board->isBrick(board->move(pos, E ))) border |= (1 << 2); + if (board->isBrick(board->move(pos, SE))) border |= (1 << 3); + if (board->isBrick(board->move(pos, S ))) border |= (1 << 4); + if (board->isBrick(board->move(pos, SW))) border |= (1 << 5); + if (board->isBrick(board->move(pos, W ))) border |= (1 << 6); + if (board->isBrick(board->move(pos, NW))) border |= (1 << 7); + + if (board->isOut(board->move(pos, N ))) border |= (1 << 8); + if (board->isOut(board->move(pos, NE))) border |= (1 << 9); + if (board->isOut(board->move(pos, E ))) border |= (1 << 10); + if (board->isOut(board->move(pos, SE))) border |= (1 << 11); + if (board->isOut(board->move(pos, S ))) border |= (1 << 12); + if (board->isOut(board->move(pos, SW))) border |= (1 << 13); + if (board->isOut(board->move(pos, W ))) border |= (1 << 14); + if (board->isOut(board->move(pos, NW))) border |= (1 << 15); + + switch (border & 0xFF) { + case 31 : border = 0; break; + case 159 : border = 0; break; + case 63 : border = 0; break; + case 191 : border = 0; break; + case 241 : border = 1; break; + case 249 : border = 1; break; + case 243 : border = 1; break; + case 251 : border = 1; break; + case 124 : border = 2; break; + case 252 : border = 2; break; + case 126 : border = 2; break; + case 199 : border = 3; break; + case 231 : border = 3; break; + case 207 : border = 3; break; + case 28 : if ((border >> 8) > 0) + border = 24; + else + border = 4; + break; + case 112 : if ((border >> 8) > 0) + border = 27; + else + border = 5; + break; + case 7 : if ((border >> 8) > 0) + border = 25; + else + border = 6; + break; + case 193 : if ((border >> 8) > 0) + border = 26; + else + border = 7; + break; + case 247 : if ((border & (1 << 11)) > 0) + border = 23; + else + border = 8; + break; + case 119 : if ((border & (1 << 15)) > 0) + border = 8; + if ((border & (1 << 11)) > 0) + border = 11; + break; + case 223 : if ((border & (1 << 13)) > 0) + border = 20; + else + border = 9; + break; + case 221 : if ((border & (1 << 13)) > 0) + border = 10; + if ((border & (1 << 9)) > 0) + border = 9; + break; + case 253 : if ((border & (1 << 9)) > 0) + border = 21; + else + border = 10; + break; + case 127 : if ((border & (1 << 15)) > 0) + border = 22; + else + border = 11; + break; + case 30 : border = 12; break; + case 240 : border = 13; break; + case 15 : border = 14; break; + case 225 : border = 15; break; + case 135 : border = 16; break; + case 195 : border = 17; break; + case 60 : border = 18; break; + case 120 : border = 19; break; + case 255 : border = 28; break; + default : border = -1; + } + if (border != -1 && border < (int) wallPix->count()) { + TQRect rect = this->rect(pos, WallPix); + bitBlt(&roomPix, rect.x(), rect.y(), wallPix->at((uint) border)); + } +} + +void Painter::drawPrison(int pos) +{ + int border = 0; + if (board->isPrison(board->move(pos, N ))) border |= (1 << 0); + if (board->isPrison(board->move(pos, NE))) border |= (1 << 1); + if (board->isPrison(board->move(pos, E ))) border |= (1 << 2); + if (board->isPrison(board->move(pos, SE))) border |= (1 << 3); + if (board->isPrison(board->move(pos, S ))) border |= (1 << 4); + if (board->isPrison(board->move(pos, SW))) border |= (1 << 5); + if (board->isPrison(board->move(pos, W ))) border |= (1 << 6); + if (board->isPrison(board->move(pos, NW))) border |= (1 << 7); + + if (board->isGate(board->move(pos, N ))) border |= (1 << 8); + if (board->isGate(board->move(pos, NE))) border |= (1 << 9); + if (board->isGate(board->move(pos, E ))) border |= (1 << 10); + if (board->isGate(board->move(pos, SE))) border |= (1 << 11); + if (board->isGate(board->move(pos, S ))) border |= (1 << 12); + if (board->isGate(board->move(pos, SW))) border |= (1 << 13); + if (board->isGate(board->move(pos, W ))) border |= (1 << 14); + if (board->isGate(board->move(pos, NW))) border |= (1 << 15); + + switch (border & 0xFF) { + case 31 : border = 0; break; + case 159 : border = 0; break; + case 63 : border = 0; break; + case 241 : border = 1; break; + case 249 : border = 1; break; + case 243 : border = 1; break; + case 124 : border = 2; break; + case 252 : border = 2; break; + case 126 : border = 2; break; + case 199 : border = 3; break; + case 231 : border = 3; break; + case 207 : border = 3; break; + case 28 : if ((border >> 8) != 0) + border = 12; + else + border = 4; + break; + case 112 : if ((border >> 8) != 0) + border = 13; + else + border = 5; + break; + case 7 : if ((border >> 8) != 0) + border = 14; + else + border = 6; + break; + case 193 : if ((border >> 8) != 0) + border = 15; + else + border = 7; + break; + case 247 : border = 8; break; + case 223 : border = 9; break; + case 253 : border = 10; break; + case 127 : border = 11; break; + default : border = -1; + } + if (board->isGate(pos)) { + if (board->isGate(board->move(pos, N))) + border = 17; + else + border = 16; + } + + if (border != -1 && border < (int) prisonPix->count()) { + TQRect rect = this->rect(pos, PrisonPix); + bitBlt(&roomPix, rect.x(), rect.y(), prisonPix->at((uint) border)); + } +} + +void Painter::drawPoint(int pos) +{ + if (!pointPix->isEmpty()) { + TQRect rect = this->rect(pos, PointPix); + bitBlt(&roomPix, rect.x(), rect.y(), pointPix->at(0)); + } +} + +TQString Painter::decodeHexOctString(TQString s) +{ + TQString value; + TQString valids; + int pos, xpos = 0, opos = 0; + int v, len, leadin; + const char *ptr; + uchar c; + + while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) || + ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) { + if (xpos != -1) { + valids = "0123456789abcdef"; + leadin = 2; + pos = xpos; + } else { + valids = "01234567"; + leadin = 1; + pos = opos; + } + + c = '\0'; + len = 0; + value = s.mid(pos+leadin, 3); + ptr = value.latin1(); + + while (*ptr != '\0' && (v = valids.find(*ptr++, 0, FALSE)) != -1) { + c = (c * valids.length()) + v; + len++; + } + + value.fill(c, 1); + s.replace(pos, len+leadin, value); + } + + return s; +} + +void Painter::fillScoreString(TQStrList &list, TQMemArray &values) +{ + if( !list.isEmpty()) + list.clear(); + + TQString s; + + for (uint i = 0; i < values.size(); i++) { + + if (values[i] < 10 || values[i] > 10000) + s = "?"; + else if (values[i] == 1600) + s = "\x1a\x1b"; + else if (values[i] < 100) { + s = "\x0e"; + s.insert(0, char (values[i] / 10 + 0x10)); + } else if (values[i] < 1000) { + s = "\x0f"; + s.insert(0, char (values[i] / 100 + 0x10)); + } else { + s = "\x0f\x10"; + s.insert(0, char (values[i] / 1000 + 0x10)); + } + + list.append(s.latin1()); + } +} + +void Painter::fillArray(TQMemArray &array, TQString values, int max) +{ + array.resize(max); + int last = 0; + bool ok; + TQString value; + + for (uint i = 0; i < array.size(); i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + array[i] = value.toInt(&ok); + if (ok) + last = array[i]; + else + array[i] = last; + } +} + +void Painter::fillStrList(TQStrList &list, TQString values, int max) +{ + if (!list.isEmpty()) + list.clear(); + + TQString last = ""; + TQString value; + + for (uint i = 0; i < (uint) max; i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + if (!value.isEmpty()) + last = decodeHexOctString(value); + list.append(last.latin1()); + } +} + +void Painter::fillPixmapName(TQStrList &pixmapName) +{ + TQStrList list = pixmapName; + + if (!pixmapName.isEmpty()) + pixmapName.clear(); + + TQString pixmap; + + TQFileInfo fileInfo; + + for (uint i = 0; i < list.count(); i++) { + pixmap = list.at(i); + + if (pixmap.left(1) != "/" && pixmap.left(1) != "~") + pixmap = TDEGlobal::dirs()->findResource("appdata", pixmapDirectory+pixmap); + + fileInfo.setFile(pixmap); + if (!fileInfo.isReadable() || !fileInfo.isFile()) + pixmap = ""; + + pixmapName.append(pixmap.utf8()); + } +} + +void Painter::confLevels(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("Levels")) + maxLevel = kapp->config()->readNumEntry("Levels", 13); +} + +void Painter::confMisc(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { + pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); + + if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") + pixmapDirectory.insert(0, "pics/"); + if (pixmapDirectory.right(1) != "/") + pixmapDirectory.append("/"); + } + + if (defGroup || kapp->config()->hasKey("PointPixmapName")) + fillStrList(pointPixmapName, + kapp->config()->readEntry("PointPixmapName", "point.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("WallPixmapName")) + fillStrList(wallPixmapName, + kapp->config()->readEntry("WallPixmapName", "wall.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("PrisonPixmapName")) + fillStrList(prisonPixmapName, + kapp->config()->readEntry("PrisonPixmapName", "prison.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("EnergizerPixmapName")) + fillStrList(energizerPixmapName, + kapp->config()->readEntry("EnergizerPixmapName", "switch.xpm"),maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitPixmapName")) + fillStrList(fruitPixmapName, + kapp->config()->readEntry("FruitPixmapName", "fruit.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("PacmanPixmapName")) + fillStrList(pacmanPixmapName, + kapp->config()->readEntry("PacmanPixmapName", "pacman.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("DyingPixmapName")) + fillStrList(dyingPixmapName, + kapp->config()->readEntry("DyingPixmapName", "dying.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("EyesPixmapName")) + fillStrList(eyesPixmapName, + kapp->config()->readEntry("EyesPixmapName", "eyes.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("MonsterPixmapName")) + fillStrList(monsterPixmapName, + kapp->config()->readEntry("MonsterPixmapName", "monster.xpm"), maxLevel+1); + + if (defGroup || kapp->config()->hasKey("FruitScorePixmapName")) + fillStrList(fruitScorePixmapName, + kapp->config()->readEntry("FruitScorePixmapName"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("MonsterScorePixmapName")) + fillStrList(monsterScorePixmapName, + kapp->config()->readEntry("MonsterScorePixmapName"), maxLevel+1); +} + +void Painter::confScoring(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("FruitScore")) + fillArray(fruitScore, + kapp->config()->readEntry("FruitScore", + "100,300,500,,700,,1000,,2000,,3000,,5000"), + maxLevel+1); + if (defGroup || kapp->config()->hasKey("MonsterScore")) + fillArray(monsterScore, + kapp->config()->readEntry("MonsterScore", "200,400,800,1600"), 4); + + if (defGroup || kapp->config()->hasKey("FruitScoreString")) + fillStrList(fruitScoreString, + kapp->config()->readEntry("FruitScoreString"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("MonsterScoreString")) + fillStrList(monsterScoreString, + kapp->config()->readEntry("MonsterScoreString"), 4); +} + +void Painter::confScheme() +{ + TQString oldgroup = kapp->config()->group(); + TQString newgroup; + + // if not set, read mode and scheme from the configfile + if (mode == -1 && scheme == -1) { + scheme = kapp->config()->readNumEntry("Scheme", -1); + mode = kapp->config()->readNumEntry("Mode", -1); + + // if mode is not set in the defGroup-group, lookup the scheme group + if (scheme != -1 || mode == -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + mode = kapp->config()->readNumEntry("Mode", -1); + kapp->config()->setGroup(oldgroup); + } + } + + confLevels(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + kapp->config()->setGroup(oldgroup); + + confMisc(); + confScoring(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + confScoring(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + confScoring(FALSE); + } + + if (*fruitScoreString.at(0) == '\0') + fillScoreString(fruitScoreString, fruitScore); + if (*monsterScoreString.at(0) == '\0') + fillScoreString(monsterScoreString, monsterScore); + + fillPixmapName(pointPixmapName); + fillPixmapName(wallPixmapName); + fillPixmapName(prisonPixmapName); + fillPixmapName(energizerPixmapName); + fillPixmapName(fruitPixmapName); + fillPixmapName(pacmanPixmapName); + fillPixmapName(dyingPixmapName); + fillPixmapName(eyesPixmapName); + fillPixmapName(monsterPixmapName); + fillPixmapName(fruitScorePixmapName); + fillPixmapName(monsterScorePixmapName); + + initPixmaps(); + initbackPixmaps(); + initRoomPixmap(); + + kapp->config()->setGroup(oldgroup); +} + +void Painter::setScheme(int Scheme, int Mode, Bitfont *font) +{ + bitfont = font; + + mode = Mode; + scheme = Scheme; + + confScheme(); +} + +void Painter::setLevel(int Level) +{ + level = Level; + + initPixmaps(); + initbackPixmaps(); + initRoomPixmap(); +} + +int Painter::checkRange(int value, int max, int min) +{ + if (value < min) { + printf("Painter::checkRange (value = %d, max = %d, min = %d)\n", + value, max, min); + return min; + } else if (value > max) { + printf("Painter::checkRange (value = %d, max = %d, min = %d)\n", + value, max, min); + return max; + } else + return value; +} diff --git a/tdepacman/painter.h b/tdepacman/painter.h new file mode 100644 index 0000000..a15c615 --- /dev/null +++ b/tdepacman/painter.h @@ -0,0 +1,144 @@ +#ifndef PAINTER_H +#define PAINTER_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "board.h" +#include "bitfont.h" +#include "colors.h" + +enum PixMap { PacmanPix, DyingPix, MonsterPix, EyesPix, FruitPix, + PointPix, EnergizerPix, WallPix, PrisonPix, + FruitScorePix, MonsterScorePix }; +enum DrawWidget { Widget, RoomPix, BackPix }; + +class Painter +{ +public: + Painter (Board *, TQWidget *parent=0, int scheme=-1, int mode=-1,Bitfont *font=0); + TQPixmap levelPix() { return roomPix; } + + void setScheme(int scheme=-1, int mode=-1, Bitfont *font=0); + void setLevel(int level=0); + + TQRect rect(int pos, PixMap pix, uint i = 0); + TQRect rect(int pos, TQString str, int align = TQLabel::AlignCenter ); + TQRect rect(TQRect r1, TQRect r2); + + void draw(TQPoint point, DrawWidget where, TQPixmap pix); + void draw(TQRect rect, DrawWidget where, TQPixmap pix); + void draw(int pos, DrawWidget where, PixMap pix, uint i = 0); + TQPixmap draw(int pos, DrawWidget where, TQString str, + TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter); + TQRect draw(int col, int row, DrawWidget where, TQString str, + TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter); + + void drawBrick(int pos); + void drawPrison(int pos); + void drawPoint(int pos); + + void erase(int pos, PixMap pix, uint i = 0); + + int maxPixmaps(PixMap pix); + +protected: + TQString decodeHexOctString(TQString str); + + void fillScoreString(TQStrList &, TQMemArray &); + void fillArray(TQMemArray &, TQString, int); + void fillStrList(TQStrList &, TQString, int); + void fillPixmapName(TQStrList &); + + void confScheme(); + void confLevels(bool defGroup=TRUE); + void confMisc(bool defGroup=TRUE); + void confScoring(bool defGroup=TRUE); + + void initPixmaps(); + void initRoomPixmap(); + void initbackPixmaps(); + +private: + TQWidget *w; + Board *board; + Bitfont *bitfont; + + int BlockWidth; + int BlockHeight; + + TQMemArray fruitScore; + TQStrList fruitScoreString; + TQMemArray monsterScore; + TQStrList monsterScoreString; + + TQString pixmapDirectory; + + TQStrList pointPixmapName; + TQStrList wallPixmapName; + TQStrList prisonPixmapName; + TQStrList energizerPixmapName; + TQStrList fruitPixmapName; + TQStrList pacmanPixmapName; + TQStrList dyingPixmapName; + TQStrList eyesPixmapName; + TQStrList monsterPixmapName; + TQStrList fruitScorePixmapName; + TQStrList monsterScorePixmapName; + + TQString lastPointPixmapName; + TQString lastWallPixmapName; + TQString lastPrisonPixmapName; + TQString lastEnergizerPixmapName; + TQString lastFruitPixmapName; + TQString lastPacmanPixmapName; + TQString lastDyingPixmapName; + TQString lastEyesPixmapName; + TQString lastMonsterPixmapName; + TQString lastFruitScorePixmapName; + TQString lastMonsterScorePixmapName; + + TQPtrList *loadPixmap(TQWidget *parent, TQString pixmapName, + TQPtrList *pixmaps=0); + TQPtrList *textPixmap(TQStrList &, TQPtrList *pixmaps=0, + TQColor fg = BLACK, TQColor bg = TQColor()); + TQPtrList *textPixmap(TQString str, TQPtrList *pixmaps=0, + TQColor fg = BLACK, TQColor bg = TQColor()); + + TQPoint point(int pos); + int checkRange(int value, int max, int min=0); + + TQPtrList *wallPix; + TQPtrList *prisonPix; + TQPtrList *pointPix; + TQPtrList *energizerPix; + TQPtrList *fruitPix; + TQPtrList *pacmanPix; + TQPtrList *dyingPix; + TQPtrList *eyesPix; + TQPtrList *monsterPix; + TQPtrList *fruitScorePix; + TQPtrList *monsterScorePix; + + TQPixmap roomPix; + TQPixmap backPix; + + bool plainColor; + TQColor backgroundColor; + + int maxLevel; + int level; + + int scheme; + int mode; +}; + +#endif // PAINTER_H diff --git a/tdepacman/referee.cpp b/tdepacman/referee.cpp new file mode 100644 index 0000000..1f4e2bc --- /dev/null +++ b/tdepacman/referee.cpp @@ -0,0 +1,1393 @@ +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "referee.h" +#include "board.h" +#include "pacman.h" +#include "monster.h" +#include "fruit.h" +#include "painter.h" + +Referee::Referee( TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) + : TQWidget( parent, name ) +{ + gameState.resize(12); + gameTimer = 0; + energizerTimer = 0; + + focusedPause = false; + setFocusPolicy(TQWidget::StrongFocus); + + initKeys(); + + scheme = Scheme; + mode = Mode; + confScheme(); + + board = new Board(BoardWidth*BoardHeight); + + pix = new Painter(board, this, scheme, mode, font); + setFixedSize(pix->levelPix().size()); + + pacman = new Pacman(board); + + fruit = new Fruit(board); + + monsters = new TQPtrList; + monsters->setAutoDelete(TRUE); + + monsterRect = new TQPtrList; + monsterRect->setAutoDelete(TRUE); + + energizers = new TQPtrList; + energizers->setAutoDelete(TRUE); + + energizerRect = new TQPtrList; + energizerRect->setAutoDelete(TRUE); + + pacmanRect.setRect(0, 0, 0, 0); + fruitRect.setRect(0, 0, 0, 0); + + TQTime midnight( 0, 0, 0 ); + srand( midnight.secsTo(TQTime::currentTime()) ); + + lifes = 0; + points = 0; + + emit setLifes(lifes); + emit setPoints(points); + + intro(); +} + +void Referee::paintEvent( TQPaintEvent *e) +{ + if (gameState.testBit(HallOfFame)) + return; + + TQRect rect = e->rect(); + + if (!rect.isEmpty()) { + TQPixmap p = pix->levelPix(); + bitBlt(this, rect.x(), rect.y(), + &p, rect.x(), rect.y(), rect.width(), rect.height()); + } + + if ((gameState.testBit(GameOver) || gameState.testBit(Demonstration)) && + rect.intersects(pix->rect(board->position(fruithome), i18n("GAME OVER")))) + pix->draw(board->position(fruithome), Widget, i18n("GAME OVER"), RED); + + for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) { + if (e && e->state() == on && + rect.intersects(pix->rect(e->position(), EnergizerPix)) && + !(e->position() == pacman->position() && gameState.testBit(Scoring))) { + if (e->pix() != -1) + pix->draw(e->position(), Widget, EnergizerPix, e->pix()); + } + } + + if (!gameState.testBit(Init)) { + + if (!gameState.testBit(Dying) && (fruit->pix() != -1)) + if (fruit->state() != active) { + if (rect.intersects(pix->rect(fruit->position(), FruitScorePix, fruit->pix()))) + pix->draw(fruit->position(), Widget, FruitScorePix, fruit->pix()); + } else { + if (rect.intersects(pix->rect(fruit->position(), FruitPix, fruit->pix()))) + pix->draw(fruit->position(), Widget, FruitPix, fruit->pix()); + } + + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->state() == harmless && + rect.intersects(pix->rect(m->position(), MonsterPix)) && + !(m->position() == pacman->position() && gameState.testBit(Scoring))) { + if (m->body() != -1) + pix->draw(m->position(), Widget, MonsterPix, m->body()); + if (m->eyes() != -1) + pix->draw(m->position(), Widget, EyesPix, m->eyes()); + } + + if (!gameState.testBit(Scoring) && !gameState.testBit(LevelDone) && + rect.intersects(pix->rect(pacman->position(), PacmanPix)) && pacman->pix() != -1) + pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); + + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->state() != harmless && + rect.intersects(pix->rect(m->position(), MonsterPix)) && + !(m->position() == pacman->position() && gameState.testBit(Scoring))) { + if (m->body() != -1) + pix->draw(m->position(), Widget, MonsterPix, m->body()); + if (m->eyes() != -1) + pix->draw(m->position(), Widget, EyesPix, m->eyes()); + } + } + + if (gameState.testBit(Scoring) && + rect.intersects(pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))) + pix->draw(pacman->position(), Widget, MonsterScorePix, monstersEaten-1); + + if (gameState.testBit(Init) && gameState.testBit(Dying) && + timerCount < pix->maxPixmaps(DyingPix) && + rect.intersects(pix->rect(pacman->position(), PacmanPix))) + pix->draw(pacman->position(), Widget, DyingPix, timerCount); + + if (gameState.testBit(LevelDone) && + rect.intersects(pix->rect(pacman->position(), PacmanPix))) + pix->draw(pacman->position(), Widget, PacmanPix, pacman->pix()); + + if (gameState.testBit(Player) && + rect.intersects(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")))) + pix->draw(board->position(monsterhome, 0), Widget, i18n("PLAYER ONE"), CYAN); + + if (gameState.testBit(Ready) && + rect.intersects(pix->rect(board->position(fruithome), i18n("READY!")))) + pix->draw(board->position(fruithome), Widget, i18n("READY!"), YELLOW); + + if (gameState.testBit(Paused) && + rect.intersects(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")))) + pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, i18n("PAUSED"), RED, BLACK); +} + +void Referee::timerEvent( TQTimerEvent *e ) +{ + if (gameState.testBit(HallOfFame)) + return; + + TQRect lastRect; + int lastPix; + bool moved = FALSE; + int eated = 0; + + if (e->timerId() == energizerTimer) { + for (int e = 0; e < board->energizers(); e++) { + lastRect = pix->rect(energizers->at(e)->position(), EnergizerPix); + lastPix = energizers->at(e)->pix(); + if (energizers->at(e)->move()) { + moved = TRUE; + *energizerRect->at(e) = pix->rect(energizers->at(e)->position(), EnergizerPix); + if (lastPix == energizers->at(e)->pix() && + lastRect == pix->rect(energizers->at(e)->position(), EnergizerPix)) + energizerRect->at(e)->setRect(0, 0, 0, 0); + else + *energizerRect->at(e) = pix->rect(*energizerRect->at(e), lastRect); + } + } + + for (int e = 0; e < board->energizers(); e++) + if (!energizerRect->at(e)->isNull()) + repaint(*energizerRect->at(e), FALSE); + + return; + } + + timerCount++; + + lastRect = pix->rect(pacman->position(), PacmanPix); + lastPix = pacman->pix(); + + if (moved = pacman->move()) { // pacman really moved + pacmanRect = pix->rect(pacman->position(), PacmanPix); + if (lastPix == pacman->pix() && + lastRect == pix->rect(pacman->position(), PacmanPix)) + pacmanRect.setRect(0, 0, 0, 0); // nothing to do, because the pixmap + else // and the position isn't changed. + pacmanRect = pix->rect(pacmanRect, lastRect); + } else + pacmanRect.setRect(0, 0, 0, 0); + + int pos = pacman->position(); + + if (moved && board->isMonster(pos) && !gameState.testBit(Dying)) { + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->position() == pos) { + if (m->state() == harmless && !gameState.testBit(Dying)) { + m->setREM(remTicks[level]); + m->setDirection(X); // prevent movement before eaten() + eated++; + if (gameState.testBit(Introducing)) + m->setPosition(OUT); + } + if (m->state() == dangerous && !gameState.testBit(Dying)) + killed(); + } + } + + if (moved && !gameState.testBit(Dying)) { + if (board->isPoint(pos)) { + board->reset(pos, Point); + score(pointScore); + pix->erase(pos, PointPix); + } + if (board->isEnergizer(pos)) { + for (int e = 0; e < board->energizers();e++) { + if (energizers->at(e)->position() == pos) { + energizers->at(e)->setOff(); + energizers->remove(e); + energizerRect->remove(e); + e = board->energizers(); + } + } + board->reset(pos, energizer); + score(energizerScore); + monstersEaten = 0; + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->state() != rem) { + m->setHarmless(harmlessTicks[level], harmlessDurTicks[level], + harmlessWarnTicks[level]); + if (gameState.testBit(Introducing)) + m->setDirection(board->turn(m->direction())); + } + } + if (pos == fruit->position() && fruit->state() == active) { + fruit->setEaten(fruitScoreDurTicks[level]); + initFruit(FALSE); + score(fruitScore[fruit->pix()]); + } + } + + if (!gameState.testBit(Introducing)) { + if (fruit->state() != active && fruit->pix() >= 0) + lastRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); + else + lastRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); + + lastPix = fruit->pix(); + if (fruit->move()) { + if (pos == fruit->position() && fruit->state() == active) { + fruit->setEaten(fruitScoreDurTicks[level]); + initFruit(FALSE); + score(fruitScore[fruit->pix()]); + } + if (fruit->state() != active && fruit->pix() >= 0) + fruitRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); + else + fruitRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); + if (lastPix == fruit->pix() && lastRect == fruitRect) + fruitRect.setRect(0, 0, 0, 0); + else + fruitRect = pix->rect(fruitRect, lastRect); + } else + fruitRect.setRect(0, 0, 0, 0); + } else + fruitRect.setRect(0, 0, 0, 0); + + int lastBodyPix; + int lastEyesPix; + + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m) { + lastRect = pix->rect(m->position(), MonsterPix); + lastBodyPix = m->body(); + lastEyesPix = m->eyes(); + if (m->move()) { + moved = TRUE; + *monsterRect->at(m->id()) = pix->rect(m->position(), MonsterPix); + if (lastBodyPix == m->body() && lastEyesPix == m->eyes() && + lastRect == pix->rect(m->position(), MonsterPix)) + monsterRect->at(m->id())->setRect(0, 0, 0, 0); + else + *monsterRect->at(m->id()) = pix->rect(*monsterRect->at(m->id()), lastRect); + if (m->position() == pos && !gameState.testBit(Dying)) { + if (m->state() == harmless && !gameState.testBit(Dying)) { + m->setREM(remTicks[level]); + eated++; + if (gameState.testBit(Introducing)) { + m->setPosition(OUT); + m->setDirection(X); + } + } + if (m->state() == dangerous && !gameState.testBit(Dying)) + killed(); + } + } else + monsterRect->at(m->id())->setRect(0, 0, 0, 0); + } + + for (int m = 0; m < board->monsters(); m++) + if (pacmanRect.intersects(*monsterRect->at(m))) { + pacmanRect = pix->rect(pacmanRect, *monsterRect->at(m)); + monsterRect->at(m)->setRect(0, 0, 0, 0); + } else + for (int im = m+1; im < board->monsters(); im++) + if (monsterRect->at(m)->intersects(*monsterRect->at(im))) { + *monsterRect->at(m) = pix->rect(*monsterRect->at(m), *monsterRect->at(im)); + monsterRect->at(im)->setRect(0, 0, 0, 0); + } + + if (!pacmanRect.isNull()) + repaint(pacmanRect, FALSE); + + if (!fruitRect.isNull()) + repaint(fruitRect, FALSE); + + for (int m = 0; m < board->monsters(); m++) + if (!monsterRect->at(m)->isNull()) + repaint(*monsterRect->at(m), FALSE); + + if (board->points() == 0 && !gameState.testBit(Dying)) + levelUp(); + + if (eated > 0 && !gameState.testBit(Dying)) { + timerCount = eated; + eaten(); + } + + if (gameState.testBit(Introducing) && moved) + introPlay(); +} + +void Referee::repaintFigures() +{ + pacmanRect = pix->rect(pacman->position(), PacmanPix); + + for (int e = 0; e < board->energizers(); e++) { + *energizerRect->at(e) = pix->rect(board->position(energizer, e), EnergizerPix); + + if (pacmanRect.intersects(*energizerRect->at(e))) { + pacmanRect = pix->rect(pacmanRect, *energizerRect->at(e)); + energizerRect->at(e)->setRect(0, 0, 0, 0); + } else + for (int ie = e+1; ie < board->energizers(); ie++) + if (energizerRect->at(e)->intersects(*energizerRect->at(ie))) { + *energizerRect->at(e) = pix->rect(*energizerRect->at(e), *energizerRect->at(ie)); + energizerRect->at(ie)->setRect(0, 0, 0, 0); + } + } + + if (fruit->pix() != -1 && fruit->state() != active) + fruitRect = pix->rect(fruit->position(), FruitScorePix, fruit->pix()); + else + fruitRect = pix->rect(fruit->position(), FruitPix, fruit->pix()); + + if (pacmanRect.intersects(fruitRect)) { + pacmanRect = pix->rect(pacmanRect, fruitRect); + fruitRect.setRect(0, 0, 0, 0); + } + + for (int m = 0; m < board->monsters(); m++) { + *monsterRect->at(m) = pix->rect(board->position(monster, m), MonsterPix); + + if (pacmanRect.intersects(*monsterRect->at(m))) { + pacmanRect = pix->rect(pacmanRect, *monsterRect->at(m)); + monsterRect->at(m)->setRect(0, 0, 0, 0); + } else + for (int im = m+1; im < board->monsters(); im++) + if (monsterRect->at(m)->intersects(*monsterRect->at(im))) { + *monsterRect->at(m) = pix->rect(*monsterRect->at(m), *monsterRect->at(im)); + monsterRect->at(im)->setRect(0, 0, 0, 0); + } + } + + if (!pacmanRect.isNull()) + repaint(pacmanRect, FALSE); + + if (!fruitRect.isNull()) + repaint(fruitRect, FALSE); + + for (int m = 0; m < board->monsters(); m++) + if (!monsterRect->at(m)->isNull()) + repaint(*monsterRect->at(m), FALSE); + + for (int e = 0; e < board->energizers(); e++) + if (!energizerRect->at(e)->isNull()) + repaint(*energizerRect->at(e), FALSE); + +} + +void Referee::initKeys() +{ + TQString up("Up"); + up = kapp->config()->readEntry("upKey", up); + UpKey = TDEShortcut(up); + + TQString down("Down"); + down = kapp->config()->readEntry("downKey", down); + DownKey = TDEShortcut(down); + + TQString left("Left"); + left = kapp->config()->readEntry("leftKey", left); + LeftKey = TDEShortcut(left); + + TQString right("Right"); + right = kapp->config()->readEntry("rightKey", right); + RightKey = TDEShortcut(right); +} + +void Referee::fillArray(TQMemArray &array, TQString values, int max) +{ + if (max < 0) + max = values.contains(',')+1; + + array.resize(max); + int last = 0; + bool ok; + TQString value; + + for (uint i = 0; i < array.size(); i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + array[i] = value.toInt(&ok); + if (ok) + last = array[i]; + else + array[i] = last; + } +} + +void Referee::fillStrList(TQStrList &list, TQString values, int max) +{ + if (!list.isEmpty()) + list.clear(); + + TQString last = ""; + TQString value; + + for (uint i = 0; i < (uint) max; i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + if (!value.isEmpty()) + last = value; + + list.append(last.latin1()); + } +} + +void Referee::fillMapName() +{ + TQStrList list = mapName; + + if (!mapName.isEmpty()) + mapName.clear(); + + TQString map; + + TQFileInfo fileInfo; + + for (uint i = 0; i < list.count(); i++) { + map = list.at(i); + + if (map.left(1) != "/" && map.left(1) != "~") + map = TDEGlobal::dirs()->findResource("appdata", mapDirectory+map); + + fileInfo.setFile(map); + if (!fileInfo.isReadable()) + map = ""; + + mapName.append(map.utf8()); + } +} + +void Referee::confLevels(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("Levels")) + maxLevel = kapp->config()->readNumEntry("Levels", 13); +} + +void Referee::confMisc(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { + pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); + + if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") + pixmapDirectory.insert(0, "pics/"); + if (pixmapDirectory.right(1) != "/") + pixmapDirectory.append("/"); + } + + if (defGroup || kapp->config()->hasKey("MapDirectory")) { + mapDirectory = kapp->config()->readEntry("MapDirectory"); + + if (mapDirectory.left(1) != "/" && mapDirectory.left(1) != "~") + mapDirectory.insert(0, "maps/"); + if (mapDirectory.right(1) != "/") + mapDirectory.append("/"); + } + + if (defGroup || kapp->config()->hasKey("MapName")) + fillStrList(mapName, kapp->config()->readEntry("MapName", "map"), maxLevel+1); + + if (defGroup || kapp->config()->hasKey("MonsterIQ")) + fillArray(monsterIQ, kapp->config()->readEntry("MonsterIQ", "0,170,180,170,180,170,180"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitIQ")) + fillArray(fruitIQ, kapp->config()->readEntry("FruitIQ", "0,170,180,170,180,170,180"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitIndex")) + fillArray(fruitIndex, kapp->config()->readEntry("FruitIndex", "0"), maxLevel+1); +} + +void Referee::confTiming(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("SpeedMS")) + fillArray(speed, kapp->config()->readEntry("SpeedMS", "20"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("PacmanTicks")) + fillArray(pacmanTicks,kapp->config()->readEntry("PacmanTicks", "3"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("RemTicks")) + fillArray(remTicks, kapp->config()->readEntry("RemTicks", "1"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("DangerousTicks")) + fillArray(dangerousTicks, kapp->config()->readEntry("DangerousTicks", "3"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("HarmlessTicks")) + fillArray(harmlessTicks, kapp->config()->readEntry("HarmlessTicks", "7,6,,5,,4"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("HarmlessDurationTicks")) + fillArray(harmlessDurTicks, kapp->config()->readEntry("HarmlessDurationTicks", "375,,,300,,250,200,150"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("HarmlessWarningTicks")) + fillArray(harmlessWarnTicks, kapp->config()->readEntry("HarmlessWarningTicks", "135"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("ArrestTicks")) + fillArray(arrestTicks, kapp->config()->readEntry("ArrestTicks", "6"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("ArrestDurationTicks")) + fillArray(arrestDurTicks, kapp->config()->readEntry("ArrestDurationTicks", "200,,,150"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitTicks")) + fillArray(fruitTicks, kapp->config()->readEntry("FruitTicks", "7,6,,5,,4"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitAppearsTicks")) + fillArray(fruitAppearsTicks, kapp->config()->readEntry("FruitAppearsTicks", "1000,,1500,2000,2500,3000,3500,4000"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitDurationTicks")) + fillArray(fruitDurTicks, kapp->config()->readEntry("FruitDurationTicks", "500,,,400,350,300,,250,200,150"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("FruitScoreDurationTicks")) + fillArray(fruitScoreDurTicks, kapp->config()->readEntry("FruitScoreDurationTicks", "150"), maxLevel+1); + + if (defGroup || kapp->config()->hasKey("MonsterScoreDurationMS")) + monsterScoreDurMS = kapp->config()->readNumEntry("MonsterScoreDurationMS", 1000); + if (defGroup || kapp->config()->hasKey("PlayerDurationMS")) + playerDurMS = kapp->config()->readNumEntry("PlayerDurationMS", 3000); + if (defGroup || kapp->config()->hasKey("ReadyDurationMS")) + readyDurMS = kapp->config()->readNumEntry("ReadyDurationMS", 2000); + if (defGroup || kapp->config()->hasKey("GameOverDurationMS")) + gameOverDurMS = kapp->config()->readNumEntry("GameOverDurationMS", 3000); + if (defGroup || kapp->config()->hasKey("AfterPauseMS")) + afterPauseMS = kapp->config()->readNumEntry("AfterPauseMS", 1000); + if (defGroup || kapp->config()->hasKey("DyingPreAnimationMS")) + dyingPreAnimationMS = kapp->config()->readNumEntry("DyingPreAnimationMS", 1000); + if (defGroup || kapp->config()->hasKey("DyingAnimationMS")) + dyingAnimationMS = kapp->config()->readNumEntry("DyingAnimationMS", 100); + if (defGroup || kapp->config()->hasKey("DyingPostAnimationMS")) + dyingPostAnimationMS = kapp->config()->readNumEntry("DyingPostAnimationMS", 500); + if (defGroup || kapp->config()->hasKey("IntroAnimationMS")) + introAnimationMS = kapp->config()->readNumEntry("IntroAnimationMS", 800); + if (defGroup || kapp->config()->hasKey("IntroPostAnimationMS")) + introPostAnimationMS = kapp->config()->readNumEntry("IntroPostAnimationMS", 1000); + if (defGroup || kapp->config()->hasKey("LevelUpPreAnimationMS")) + levelUpPreAnimationMS = kapp->config()->readNumEntry("LevelUpPreAnimationMS", 2000); + if (defGroup || kapp->config()->hasKey("LevelUpAnimationMS")) + levelUpAnimationMS = kapp->config()->readNumEntry("LevelUpAnimationMS", 2000); + if (defGroup || kapp->config()->hasKey("EnergizerAnimationMS")) + energizerAnimationMS = kapp->config()->readNumEntry("EnergizerAnimationMS", 200); +} + +void Referee::confScoring(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("PointScore")) + pointScore = kapp->config()->readNumEntry("PointScore", 10); + if (defGroup || kapp->config()->hasKey("EnergizerScore")) + energizerScore = kapp->config()->readNumEntry("EnergizerScore", 50); + if (defGroup || kapp->config()->hasKey("FruitScore")) + fillArray(fruitScore, kapp->config()->readEntry("FruitScore", "100,300,500,,700,,1000,,2000,,3000,,5000"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("MonsterScore")) + fillArray(monsterScore, kapp->config()->readEntry("MonsterScore", "200,400,800,1600"), 4); + if (defGroup || kapp->config()->hasKey("ExtraLifeScore")) + fillArray(extraLifeScore, kapp->config()->readEntry("ExtraLifeScore", "10000"), -1); +} + +void Referee::confScheme() +{ + TQString oldgroup = kapp->config()->group(); + TQString newgroup; + + // if not set, read mode and scheme from the configfile + if (mode == -1 && scheme == -1) { + scheme = kapp->config()->readNumEntry("Scheme", -1); + mode = kapp->config()->readNumEntry("Mode", -1); + + // if mode is not set in the defGroup-group, lookup the scheme group + if (scheme != -1 || mode == -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + mode = kapp->config()->readNumEntry("Mode", -1); + kapp->config()->setGroup(oldgroup); + } + } + + confLevels(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + kapp->config()->setGroup(oldgroup); + + confMisc(); + confTiming(); + confScoring(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + confTiming(FALSE); + confScoring(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + confTiming(FALSE); + confScoring(FALSE); + } + + fillMapName(); + + kapp->config()->setGroup(oldgroup); +} + +void Referee::setScheme(int Scheme, int Mode, Bitfont *font) +{ + mode = Mode; + scheme = Scheme; + + confScheme(); + + pix->setScheme(scheme, mode, font); + + pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix)); + fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix)); + + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m) + m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); + + for (Energizer *e = energizers->first(); e != 0; e = energizers->next()) + if (e) + e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix)); + + if (gameState.testBit(Introducing)) + for (int i = 0; i < (gameState.testBit(Init) ? timerCount : 15); i++) + introPaint(i); + + setFixedSize(pix->levelPix().size()); + repaint(); +} + +void Referee::keyPressEvent( TQKeyEvent *k ) +{ + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame) || + gameState.testBit(Demonstration) || gameState.testBit(Dying) || + gameState.testBit(Ready) || gameState.testBit(LevelDone) || + !gameState.testBit(Playing)) + return; + + uint key = k->key(); + if (key == UpKey) + pacman->setDirection(N); + else if (key == DownKey) + pacman->setDirection(S); + else if (key == RightKey) + pacman->setDirection(E); + else if (key == LeftKey) + pacman->setDirection(W); + +#ifdef CHEATS + else if (key == Key_L) { printf("levelUp()\n"); levelUp(); } + else if (key == Key_F) { printf("fruit->move(TRUE)\n"); fruit->move(TRUE); repaint(FALSE); } + else if (key == Key_E) { printf("setLifes(++lifes)\n"); emit setLifes(++lifes); } +#endif + + else { + k->ignore(); + return; + } + k->accept(); +} + +void Referee::score(int p) +{ + if (!gameState.testBit(Playing)) + return; + + if ((points += p) < 0) + points = 0; + + emit setPoints(points); + + if (points >= nextExtraLifeScore) { + emit setLifes(++lifes); + if (extraLifeScoreIndex < (int) extraLifeScore.size()-1) + extraLifeScoreIndex++; + if (extraLifeScore[extraLifeScoreIndex] < 0) + nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex] * -1; + else + nextExtraLifeScore += extraLifeScore[extraLifeScoreIndex]; + } +} + +void Referee::eaten() +{ + if (gameState.testBit(Ready)) + return; + + stop(); + + if (monstersEaten < 4) + monstersEaten++; + + gameState.setBit(Scoring); + score(monsterScore[monstersEaten-1]); + + repaint(pix->rect(pix->rect(pacman->position(), MonsterPix), + pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))); + + if (--timerCount > 0) + TQTimer::singleShot( monsterScoreDurMS, this, SLOT(eaten())); + else { + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->direction() == X && !gameState.testBit(Introducing)) + m->setDirection(N); + if (monstersEaten != 4 || !gameState.testBit(Introducing)) + TQTimer::singleShot( monsterScoreDurMS, this, SLOT(start())); + } +} + +void Referee::toggleHallOfFame() +{ + gameState.toggleBit(HallOfFame); +} + +void Referee::hallOfFame() +{ + if (gameState.testBit(HallOfFame)) // If the HallOfFame is switched on manually, toggle the + toggleHallOfFame(); // bit twice. + + emit setLevel(0); // Clear status display for hall of fame + emit setScore(level, 0); + emit forcedGameHighscores(); +} + +void Referee::pause() +{ + static int pausedTimer = 0; + + if (!gameState.testBit(Paused)) { + pausedTimer = gameTimer; + stop(); + stopEnergizer(); + gameState.setBit(Paused); + repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); + } else { + gameState.clearBit(Paused); + repaint(pix->rect((BoardWidth*BoardHeight)/2-BoardWidth, i18n("PAUSED")), FALSE); + if (pausedTimer) { + pausedTimer = 0; + start(); + } + // manual pause deactivating (also) deactivates a focusedPause + focusedPause = false; + } + //0.3.2 emit gamePause(); +} + +void Referee::intro() +{ + stop(); + stopEnergizer(); + bool paused = gameState.testBit(Paused); + + gameState.fill(FALSE); + gameState.setBit(Introducing); + gameState.setBit(Init); + + if (paused) + gameState.setBit(Paused); + + level = 0; + emit setLevel(level); + + board->init(Intro); + pix->setLevel(level); + + initPacman(); + initFruit(); + initMonsters(); + initEnergizers(); + + repaint(); + + monstersEaten = 0; + timerCount = 0; + introPlay(); +} + +void Referee::introMonster(int id) +{ + Monster *m = new Monster(board, id); + + m->setPosition((10+id*6)*BoardWidth+10); + m->setDirection(E); + m->setDangerous(dangerousTicks[level], monsterIQ[level]); + m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); + + if (m->body() != -1) + pix->draw(m->position(), RoomPix, MonsterPix, m->body()); + if (m->eyes() != -1) + pix->draw(m->position(), RoomPix, EyesPix, m->eyes()); + + repaint(pix->rect(m->position(), MonsterPix), FALSE); + m->setPosition(OUT); +} + +void Referee::introPaint(int t) +{ + TQString pts; + + switch (t) { + case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, TQColor(), AlignLeft), FALSE); + repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, TQColor(), AlignLeft), FALSE); + repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, TQColor(), AlignLeft), FALSE); + break; + case 1 : introMonster(0); + break; + case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, TQColor(), AlignLeft), FALSE); + break; + case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, TQColor(), AlignLeft), FALSE); + break; + case 4 : introMonster(1); + break; + case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, TQColor(), AlignLeft), FALSE); + break; + case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, TQColor(), AlignLeft), FALSE); + break; + case 7 : introMonster(2); + break; + case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, TQColor(), AlignLeft), FALSE); + break; + case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, TQColor(), AlignLeft), FALSE); + break; + case 10 : introMonster(3); + break; + case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, TQColor(), AlignLeft), FALSE); + break; + case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, TQColor(), AlignLeft), FALSE); + break; + case 13 : pts.sprintf("%d", pointScore); + repaint(pix->draw(28, 44, RoomPix, pts, WHITE, TQColor(), AlignRight), FALSE); + repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE); + pts.sprintf("%d", energizerScore); + repaint(pix->draw(28, 48, RoomPix, pts, WHITE, TQColor(), AlignRight), FALSE); + repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE); + break; + case 14 : // "@ 1980 MIDWAY MFG.CO." + repaint(pix->draw(30, 58, RoomPix, "© 1998-2003 J.THÖNNISSEN", PINK), FALSE); + break; + } +} + +void Referee::introPlay() +{ + if (!gameState.testBit(Introducing) || gameState.testBit(Ready)) + return; + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(introPlay())); + return; + } + + if (!gameState.testBit(Init)) { + if (monstersEaten == 4) { + stop(); + TQTimer::singleShot(introPostAnimationMS, this, SLOT(demo())); + } + if (pacman->direction() == W) { + int id = -1; + if (pacman->position() == 37*BoardWidth-6) + id = 0; + else + if (board->isMonster(37*BoardWidth-6)) + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->position() == 37*BoardWidth-6) { + id = m->id(); + id++; + break; + } + + if (id >= 0 && id <= 4) + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m && m->id() == id && m->position() == OUT) { + m->setPosition(37*BoardWidth-1); + m->setDirection(W); + m->setDangerous(dangerousTicks[level], monsterIQ[level]); + board->set(37*BoardWidth-1, monsterhome, id); + repaint(pix->rect(m->position(), MonsterPix)); + break; + } + } + return; + } + + if (timerCount < 15) + introPaint(timerCount); + + switch (timerCount) { + case 13 : board->set(44*BoardWidth+22, Point); + pix->drawPoint(44*BoardWidth+22); + repaint(pix->rect(44*BoardWidth+22, PointPix), FALSE); + energizers->at(0)->setPosition(48*BoardWidth+22); + energizers->at(0)->setOn(); + repaint(pix->rect(48*BoardWidth+22, EnergizerPix), FALSE); + break; + case 14 : energizers->at(1)->setPosition(36*BoardWidth+10); + energizers->at(1)->setOn(); + repaint(pix->rect(36*BoardWidth+10, EnergizerPix), FALSE); + for (int pos = 8; pos < BoardWidth; pos++) { + board->set(34*BoardWidth+pos, out); + board->set(38*BoardWidth+pos, out); + } + board->set(36*BoardWidth+8, out); + break; + case 15 : gameState.clearBit(Init); + initPacman(); + pacman->setDemo(TRUE); + pacman->setPosition(37*BoardWidth-1); + repaintFigures(); + start(); + return; + } + + if (timerCount++ < 15) + TQTimer::singleShot(introAnimationMS, this, SLOT(introPlay())); +} + +void Referee::demo() +{ + if (gameState.testBit(Ready)) + return; + + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(demo())); + return; + } + + stop(); + stopEnergizer(); + + gameState.fill(FALSE); + gameState.setBit(Init); + gameState.setBit(Demonstration); + + level = 0; + emit setLevel(level); + + board->init(Demo, mapName.at(0)); + pix->setLevel(level); + + initPacman(); + initFruit(); + initMonsters(); + initEnergizers(); + + gameState.clearBit(Init); + + repaint(); + + timerCount = 0; + TQTimer::singleShot(playerDurMS, this, SLOT(start())); +} + +void Referee::play() +{ + stop(); + stopEnergizer(); + + gameState.fill(FALSE); + gameState.setBit(Init); + gameState.setBit(Playing); + gameState.setBit(Player); + gameState.setBit(Ready); + + lifes = 3; + level = 1; + points = 0; + + extraLifeScoreIndex = 0; + nextExtraLifeScore = extraLifeScore[extraLifeScoreIndex]; + if (nextExtraLifeScore < 0) + nextExtraLifeScore *= -1; + + board->init(Level, mapName.at(level)); + pix->setLevel(level); + + initPacman(); + initFruit(); + initMonsters(); + initEnergizers(); + + repaint(); + //0.3.2 emit toggleNew(); + emit setLifes(lifes); + emit setLevel(level); + emit setPoints(points); + + repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); + repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); + + timerCount = 0; + TQTimer::singleShot(playerDurMS, this, SLOT(ready())); +} + +void Referee::ready() +{ + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(ready())); + return; + } + + if (gameState.testBit(Player)) { + emit setLifes(--lifes); + gameState.clearBit(Player); + gameState.clearBit(Init); + repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE); + repaintFigures(); + TQTimer::singleShot(playerDurMS, this, SLOT(ready())); + return; + } + + if (gameState.testBit(Ready)) { + gameState.clearBit(Ready); + repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); + start(); + } else { + gameState.setBit(Ready); + gameState.clearBit(Init); + repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE); + TQTimer::singleShot(readyDurMS, this, SLOT(ready())); + } +} + + +void Referee::levelUp() +{ + stop(); + stopEnergizer(); + + gameState.setBit(LevelDone); + pacman->setPosition(pacman->position()); // set mouthPosition to "0" + repaint(pix->rect(pacman->position(), PacmanPix)); + + timerCount = 0; + TQTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay())); +} + +void Referee::levelUpPlay() +{ + if (gameState.testBit(Ready)) + return; + + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay())); + return; + } + + switch (timerCount) { + case 0 : gameState.setBit(Init); + setOnEnergizers(); + repaintFigures(); + break; + case 1 : gameState.clearBit(LevelDone); + repaint(pix->rect(pacman->position(), PacmanPix)); + break; + } + + if (timerCount++ < 2) { + TQTimer::singleShot(levelUpAnimationMS, this, SLOT(levelUpPlay())); + return; + } + + gameState.clearBit(Init); + + if (gameState.testBit(Demonstration)) { + hallOfFame(); + return; + } + + if (level < maxLevel) + level++; + + board->init(Level, mapName.at(level)); + pix->setLevel(level); + + initPacman(); + initFruit(); + initMonsters(); + initEnergizers(); + + repaint(); + emit setLevel(level); + + ready(); +} + +void Referee::start() +{ + if (gameState.testBit(Ready)) + return; + + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(start())); + return; + } + + if (gameState.testBit(Scoring)) { + gameState.clearBit(Scoring); + repaint(pix->rect(pix->rect(pacman->position(), MonsterPix), + pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1))); + } + + if (!gameTimer) + gameTimer = startTimer( speed [level] ); + + if (!energizerTimer) + energizerTimer = startTimer( energizerAnimationMS ); +} + +void Referee::start(int t) +{ + gameTimer = startTimer(t); +} + +void Referee::stop() +{ + if (gameTimer) { + killTimer (gameTimer); + gameTimer = 0; + } +} + +void Referee::stopEnergizer() +{ + if (energizerTimer) { + killTimer (energizerTimer); + energizerTimer = 0; + } +} + +void Referee::killed() +{ + if (gameState.testBit(Ready)) + return; + + if (!gameState.testBit(Dying)) { + gameState.setBit(Dying); + + pacman->setDirection(X, TRUE); + for (Monster *m = monsters->first(); m != 0; m = monsters->next()) + if (m) + m->setDirection(X); + TQTimer::singleShot(dyingPreAnimationMS, this, SLOT(killed())); + } else { + stop(); + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(killed())); + return; + } + + gameState.setBit(Init); + + repaintFigures(); + + timerCount = 0; + killedPlay(); + } +} + +void Referee::killedPlay() +{ + if (!gameState.testBit(Dying) || gameState.testBit(Ready)) + return; + if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) { + TQTimer::singleShot(afterPauseMS, this, SLOT(killedPlay())); + return; + } + + if (timerCount <= pix->maxPixmaps(DyingPix)) { + repaint(pix->rect(pacman->position(), PacmanPix), FALSE); + if (timerCount >= pix->maxPixmaps(DyingPix)-1 || timerCount == 0) + TQTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay())); + else + TQTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay())); + timerCount++; + } else { + gameState.clearBit(Dying); + stopEnergizer(); + if (lifes == 0) { + gameState.setBit(GameOver); + gameState.clearBit(Playing); + for (int e = 0; e < board->energizers(); e++) { + energizers->at(e)->setOff(); + repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE); + } + repaint(pix->rect(board->position(fruithome), i18n("GAME OVER")), FALSE); + TQTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame())); + } else { + gameState.clearBit(Init); + initPacman(); + initFruit(); + initMonsters(); + initEnergizers(); + emit setLifes(--lifes); + repaintFigures(); + ready(); + } + } +} + +void Referee::initPacman() +{ + pacman->setMaxPixmaps(pix->maxPixmaps(PacmanPix)); + pacman->setDemo(gameState.testBit(Demonstration)); + pacman->setPosition(board->position(pacmanhome)); + pacman->setDirection(W, TRUE); + pacman->setAlive(pacmanTicks[level]); +} + +void Referee::initFruit(bool fullInitialization) +{ + if (fullInitialization) { + fruit->setMaxPixmaps(pix->maxPixmaps(FruitPix)); + if (fruitIndex[level] == 0) + fruit->setLevel(level, fruitAppearsTicks[level], + fruitDurTicks[level], fruitTicks[level]); + else if (fruitIndex[level] < 0) + fruit->setLevel(pix->maxPixmaps(FruitPix)+1, + fruitAppearsTicks[level], + fruitDurTicks[level], fruitTicks[level]); + else + fruit->setLevel(fruitIndex[level], fruitAppearsTicks[level], + fruitDurTicks[level], fruitTicks[level]); + } + + if (board->tunnels() > 0) + fruit->setMovement(board->position(tunnel, rand() % board->tunnels()), + board->position(tunnel, rand() % board->tunnels()), + fruitIQ[level]); +} + +void Referee::initMonsters() +{ + if( !monsters->isEmpty()) + monsters->clear(); + if( !monsterRect->isEmpty()) + monsterRect->clear(); + + for (int id = 0; id < (gameState.testBit(Introducing) ? 4 : board->monsters()); id++) { + Monster *m = new Monster(board, id); + monsters->append(m); + TQRect *r = new TQRect(); + monsterRect->append(r); + if (!gameState.testBit(Introducing)) { + m->setFreedom(board->position(prisonexit)); + m->setDangerous(dangerousTicks[level], monsterIQ[level]); + if (id == 0) + m->setPrison(board->position(prisonentry)); + else { + m->setPrison(board->position(monsterhome, id)); + m->setArrested(arrestTicks[level], arrestDurTicks[level]*id); + } + m->setPosition(board->position(monsterhome, id)); + switch(id) { + case 0 : m->setDirection(W); break; + case 1 : m->setDirection(N); break; + default : m->setDirection(S); + } + } + m->setMaxPixmaps(pix->maxPixmaps(MonsterPix), pix->maxPixmaps(EyesPix)); + } +} + +void Referee::initEnergizers() +{ + if( !energizers->isEmpty()) + energizers->clear(); + if( !energizerRect->isEmpty()) + energizerRect->clear(); + + for (int id = 0; id < (gameState.testBit(Introducing) ? 2 : board->energizers()); id++) { + Energizer *e = new Energizer(board); + energizers->append(e); + TQRect *r = new TQRect(); + energizerRect->append(r); + if (!gameState.testBit(Introducing)) { + e->setPosition(board->position(energizer, id)); + e->setOn(); + } + e->setMaxPixmaps(pix->maxPixmaps(EnergizerPix)); + } +} + +void Referee::setOnEnergizers() +{ + for (int e = 0; e < board->energizers(); e++) { + energizers->at(e)->setOn(); + } +} + +void Referee::setFocusOutPause(bool FocusOutPause) +{ + focusOutPause = FocusOutPause; +} + +void Referee::setFocusInContinue(bool FocusInContinue) +{ + focusInContinue = FocusInContinue; +} + +void Referee::focusInEvent(TQFocusEvent *) +{ + if (focusInContinue && focusedPause && + gameState.testBit(Paused) && gameState.testBit(Playing)) { + focusedPause = false; + // this also calls the Referee::pause() function + emit focusedGamePause(); + } +} + +void Referee::focusOutEvent(TQFocusEvent *) +{ + if (focusOutPause && !focusedPause && + !gameState.testBit(Paused) && gameState.testBit(Playing)) { + focusedPause = true; + // this also calls the Referee::pause() function + emit focusedGamePause(); + } +} + +#include "referee.moc" diff --git a/tdepacman/referee.h b/tdepacman/referee.h new file mode 100644 index 0000000..c147d18 --- /dev/null +++ b/tdepacman/referee.h @@ -0,0 +1,191 @@ +#ifndef REFEREE_H +#define REFEREE_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#include "board.h" +#include "pacman.h" +#include "monster.h" +#include "fruit.h" +#include "energizer.h" +#include "bitfont.h" +#include "painter.h" + +enum { Init, Introducing, Playing, Demonstration, Paused, Player, Ready, + Scoring, LevelDone, Dying, GameOver, HallOfFame }; + + +class Referee : public TQWidget +{ + Q_OBJECT +public: + Referee (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0); + + void setSkill(int); + void setRoom(int); + +public slots: + void setScheme(int scheme, int mode, Bitfont *font=0); + + void levelUp(); + void levelUpPlay(); + + void pause(); + void ready(); + void intro(); + void introPlay(); + void hallOfFame(); + void demo(); + void play(); + void killed(); + void killedPlay(); + void eaten(); + void toggleHallOfFame(); + + void setFocusOutPause(bool focusOutPause); + void setFocusInContinue(bool focusInContinue); + void initKeys(); + + void repaintFigures(); + +private slots: + void start(); + void stop(); + void stopEnergizer(); + +signals: + void setScore(int, int); + void setPoints(int); + void setLevel(int); + void setLifes(int); + + void focusedGamePause(); + void forcedGameHighscores(); + +protected: + void timerEvent(TQTimerEvent *); + void paintEvent(TQPaintEvent *); + void keyPressEvent(TQKeyEvent *); + + void focusOutEvent(TQFocusEvent *); + void focusInEvent(TQFocusEvent *); + + void fillArray(TQMemArray &, TQString, int); + void fillStrList(TQStrList &, TQString, int); + void fillMapName(); + + void confScheme(); + void confLevels(bool defGroup=TRUE); + void confMisc(bool defGroup=TRUE); + void confTiming(bool defGroup=TRUE); + void confScoring(bool defGroup=TRUE); + +private: + TQBitArray gameState; + int timerCount; + int maxLevel; + + int scheme; + int mode; + + TQString pixmapDirectory; + TQString mapDirectory; + TQStrList mapName; + + TQMemArray speed; + TQMemArray monsterIQ; + TQMemArray fruitIQ; + TQMemArray fruitIndex; + TQMemArray pacmanTicks; + TQMemArray remTicks; + TQMemArray dangerousTicks; + TQMemArray harmlessTicks; + TQMemArray harmlessDurTicks; + TQMemArray harmlessWarnTicks; + TQMemArray arrestTicks; + TQMemArray arrestDurTicks; + TQMemArray fruitTicks; + TQMemArray fruitAppearsTicks; + TQMemArray fruitDurTicks; + TQMemArray fruitScoreDurTicks; + + int monsterScoreDurMS; + int playerDurMS; + int readyDurMS; + int gameOverDurMS; + int afterPauseMS; + int dyingPreAnimationMS; + int dyingAnimationMS; + int dyingPostAnimationMS; + int introAnimationMS; + int introPostAnimationMS; + int levelUpPreAnimationMS; + int levelUpAnimationMS; + int energizerAnimationMS; + + int pointScore; + int energizerScore; + TQMemArray fruitScore; + TQMemArray monsterScore; + TQMemArray extraLifeScore; + + int extraLifeScoreIndex; + int nextExtraLifeScore; + + int monstersEaten; + int points; + int lifes; + int level; + + bool focusedPause; + bool focusOutPause; + bool focusInContinue; + + Board *board; + Painter *pix; + Pacman *pacman; + Fruit *fruit; + + TQPtrList *monsters; + TQPtrList *monsterRect; + + TQPtrList *energizers; + TQPtrList *energizerRect; + + TQRect pacmanRect; + TQRect fruitRect; + + void introMonster(int id); + void introPaint(int t); + + void initMonsters(); + void initPacman(); + void initFruit(bool fullInitialization=TRUE); + void initEnergizers(); + + void setOnEnergizers(); + + int gameTimer; + int energizerTimer; + void start(int); + void init(bool); + + void score(int); + + uint UpKey; + uint DownKey; + uint RightKey; + uint LeftKey; +}; + +#endif // REFEREE_H diff --git a/tdepacman/score.cpp b/tdepacman/score.cpp new file mode 100644 index 0000000..77c87d8 --- /dev/null +++ b/tdepacman/score.cpp @@ -0,0 +1,628 @@ +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bitfont.h" +#include "score.h" + +Score::Score(TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) : TQWidget(parent, name) +{ + setFocusPolicy(TQWidget::StrongFocus); + + paused = FALSE; + + lastScore = -1; + lastPlayer = -1; + + cursorBlinkTimer = 0; + cursorBlinkMS = -1; + cursor.x = -1; + cursor.y = -1; + cursor.on = FALSE; + cursor.chr = TQChar('?'); + + initKeys(); + + scheme = Scheme; + mode = Mode; + confScheme(); + + bitfont = font; + + highscoreFile.setName(locateHighscoreFilePath().filePath()); + read(); + + for (int p = 0; p < maxPlayer; p++) { + playerScore[p] = 0; + playerName[p] = getenv("LOGNAME"); + if (playerName[p].length() < minPlayerNameLength) + playerName[p].setExpand(minPlayerNameLength-1, ' '); + + for (uint i = 0; i < playerName[p].length(); i++) + if (playerName[p].at(i) < bitfont->firstChar() || + playerName[p].at(i) > bitfont->lastChar()) + playerName[p].at(i) = playerName[p].at(i).upper(); + } +} + +Score::~Score() +{ + // write(); +} + +void Score::paintEvent( TQPaintEvent *e) +{ + if (rect(1, 0, i18n(" 1UP ")).intersects(e->rect())) { + TQPixmap pix; + TQColor fg = BLACK; + if (cursor.on || paused || lastPlayer != 0) + fg = WHITE; + pix = bitfont->text(i18n(" 1UP "), fg, BLACK); + bitBlt(this, x(1), y(0), &pix); + } + + if (rect(8, 0, i18n(" HIGH SCORE ")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK); + bitBlt(this, x(8), y(0), &pix); + } + + if (maxPlayer > 1 && rect(21, 0, i18n(" 2UP ")).intersects(e->rect())) { + TQPixmap pix; + TQColor fg = BLACK; + if (cursor.on || paused || lastPlayer != 1) + fg = WHITE; + pix = bitfont->text(i18n(" 2UP "), fg, BLACK); + bitBlt(this, x(21), y(0), &pix); + } + + TQString s; + + s.sprintf("%6d0", playerScore[0]/10); + if (rect(0, 1, s).intersects(e->rect())) { + TQPixmap pix = bitfont->text(s, WHITE, BLACK); + bitBlt(this, x(0), y(1), &pix); + } + + s.sprintf("%8d0", HighScore/10); + if (rect(8, 1, s).intersects(e->rect())) { + TQPixmap pix = bitfont->text(s, WHITE, BLACK); + bitBlt(this, x(8), y(1), &pix); + } + + if (lastScore >= 0) { + if (rect(1, 4*1.25, i18n(" CONGRATULATIONS ")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK); + bitBlt(this, x(1), y(4*1.25), &pix); + } + if (rect(1, 6*1.25, i18n(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK); + bitBlt(this, x(1), y(6*1.25), &pix); + } + if (rect(1, 7*1.25, i18n(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK); + bitBlt(this, x(1), y(7*1.25), &pix); + } + if (rect(1, 8*1.25, i18n(" ")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK); + bitBlt(this, x(1), y(8*1.25), &pix); + } + } + + if (rect(1, 9.5*1.25, i18n("RNK SCORE NAME DATE")).intersects(e->rect())) { + TQPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK); + bitBlt(this, x(1), y(9.5*1.25), &pix); + } + + for (int i = 0; i < 10; i++) { + s.sprintf("%2d%9d %-3.3s %-8.8s", + i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(), + formatDate(hallOfFame[i].moment.date()).utf8().data()); + if (rect(1, (11+i)*1.25, s).intersects(e->rect())) { + TQPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK); + bitBlt(this, x(1), y((11+i)*1.25), &pix); + } + } + + if (cursor.x != -1 && cursor.y != -1 && cursor.on) { + if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) { + TQPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW); + bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix); + } + } + + if (paused) { + + TQPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK); + TQRect r = bitfont->rect(i18n("PAUSED")); + r.moveCenter(TQPoint(this->width()/2, this->height()/2)); + + bitBlt(this, r.x(), r.y(), &pix); + } +} + +void Score::timerEvent(TQTimerEvent *e) +{ + cursor.on = !cursor.on; + + if (paused) + return; + + if (cursor.x != -1 && cursor.y != -1) + repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); + scrollRepeat = FALSE; + + if (lastPlayer == 0) + repaint(rect(1, 0, i18n(" 1UP ")), FALSE); + + if (lastPlayer == 1) + repaint(rect(21, 0, i18n(" 2UP ")), FALSE); +} + +void Score::keyPressEvent(TQKeyEvent *k) +{ + if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) { + k->ignore(); + return; + } + + int x = cursor.x; + int y = cursor.y; + + uint key = k->key(); + + if (scrollRepeat && (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down)) { + k->ignore(); + return; + } + + if (key != Key_Return) { + if (key == RightKey || key == Key_Right) + if (++cursor.x > 16) + cursor.x = 14; + if (key == LeftKey || key == Key_Left) + if (--cursor.x < 14) + cursor.x = 16; + if (key == UpKey || key == Key_Up) + if (cursor.chr.unicode() < bitfont->lastChar()) + cursor.chr = cursor.chr.unicode()+1; + else + cursor.chr = bitfont->firstChar(); + if (key == DownKey || key == Key_Down) + if (cursor.chr.unicode() > bitfont->firstChar()) + cursor.chr = cursor.chr.unicode()-1; + else + cursor.chr = bitfont->lastChar(); + + if (cursor.x == x && cursor.y == y && + cursor.chr == hallOfFame[lastScore].name.at(cursor.x-14)) { + uint ascii = k->ascii(); + + if (ascii < bitfont->firstChar() || ascii > bitfont->lastChar()) + ascii = toupper(ascii); + + if (ascii >= bitfont->firstChar() && ascii <= bitfont->lastChar()) { + cursor.chr = ascii; + hallOfFame[lastScore].name.at(cursor.x-14) = cursor.chr; + if (++cursor.x > 16) + cursor.x = 14; + } + } + } + + if (key == Key_Return) { + playerName[lastPlayer] = hallOfFame[lastScore].name; + write(); + read(); + lastScore = -1; + lastPlayer = -1; + cursor.x = -1; + cursor.y = -1; + emit gameFinished(); + end(); + } + + if (x != cursor.x || y != cursor.y) { + if (cursor.x != -1) + cursor.chr = hallOfFame[lastScore].name.at(cursor.x-14); + scrollRepeat = FALSE; + repaint(rect(x, y*1.25, cursor.chr), FALSE); + } else + hallOfFame[lastScore].name.at(cursor.x-14) = cursor.chr; + + if (key == UpKey || key == Key_Up || key == DownKey || key == Key_Down) + scrollRepeat = TRUE; + else + repaint(rect(cursor.x, cursor.y*1.25, cursor.chr), FALSE); +} + +void Score::initKeys() +{ + TQString up("Up"); + up = kapp->config()->readEntry("upKey", up); + UpKey = TDEShortcut(up); + + TQString down("Down"); + down = kapp->config()->readEntry("downKey", down); + DownKey = TDEShortcut(down); + + TQString left("Left"); + left = kapp->config()->readEntry("leftKey", left); + LeftKey = TDEShortcut(left); + + TQString right("Right"); + right = kapp->config()->readEntry("rightKey", right); + RightKey = TDEShortcut(right); +} + +void Score::confTiming(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("CursorBlinkMS")) + cursorBlinkMS = kapp->config()->readNumEntry("CursorBlinkMS", 250); + if (defGroup || kapp->config()->hasKey("HallOfFameMS")) + hallOfFameMS = kapp->config()->readNumEntry("HallOfFameMS", 7000); + if (defGroup || kapp->config()->hasKey("AfterPauseMS")) + afterPauseMS = kapp->config()->readNumEntry("AfterPauseMS", 1000); +} + +void Score::confScheme() +{ + TQString oldgroup = kapp->config()->group(); + TQString newgroup; + + // if not set, read mode and scheme from the configfile + if (mode == -1 && scheme == -1) { + scheme = kapp->config()->readNumEntry("Scheme", -1); + mode = kapp->config()->readNumEntry("Mode", -1); + + // if mode is not set in the defGroup-group, lookup the scheme group + if (scheme != -1 || mode == -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + mode = kapp->config()->readNumEntry("Mode", -1); + kapp->config()->setGroup(oldgroup); + } + } + + int oldCursorBlinkMS = cursorBlinkMS; + + confTiming(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confTiming(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confTiming(FALSE); + } + + if (cursorBlinkMS != oldCursorBlinkMS) { + if (cursorBlinkTimer) + killTimer(cursorBlinkTimer); + cursorBlinkTimer = startTimer(cursorBlinkMS); + } + + kapp->config()->setGroup(oldgroup); +} + +void Score::setScheme(int Scheme, int Mode, Bitfont *font) +{ + mode = Mode; + scheme = Scheme; + + confScheme(); + + bitfont = font; + + for (int p = 0; p < maxPlayer; p++) + for (uint i = 0; i < playerName[p].length(); i++) + if (playerName[p].at(i) < bitfont->firstChar() || + playerName[p].at(i) > bitfont->lastChar()) + playerName[p].at(i) = playerName[p].at(i).upper(); + + for (int i = 0; i < 10; i++) + for (uint j = 0; j < hallOfFame[i].name.length(); j++) + if (hallOfFame[i].name.at(j) < bitfont->firstChar() || + hallOfFame[i].name.at(j) > bitfont->lastChar()) + hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); + + if (cursor.chr.unicode() < bitfont->firstChar() || + cursor.chr.unicode() > bitfont->lastChar()) + cursor.chr = cursor.chr.upper(); +} + +void Score::set(int score) +{ + set(score, 0); +} + +void Score::set(int score, int player) +{ + if (player < 0 || player >= maxPlayer) + return; + + lastPlayer = player; + playerScore[lastPlayer] = score; + + TQString s; + + s.sprintf("%6d0", playerScore[lastPlayer]/10); + repaint(rect(0, 1, s), FALSE); + + if (score > HighScore) { + HighScore = score; + s.sprintf("%8d0", HighScore/10); + repaint(rect(8, 1, s), FALSE); + } +} + +/* + * Set the score for player after the game if over. If the score is in the + * high scores then the hall of fame is updated (shifted) and the scoreboard + * is shown. + */ + +void Score::setScore(int level, int player) +{ + // pointer to the array-position of a new archived top score + lastScore = -1; + + // was it a real game or just a demo (level == 0) + if (player >= 0 && player < maxPlayer && level != 0) { + + lastPlayer = player; + + for (int i = 0; i < 10; i++) + if ( playerScore[lastPlayer] > hallOfFame[i].points) { + lastScore = i; + break; + } + } + + // no new highscore archived, finish after specified time + if (lastScore < 0) { + // enable gameNew directly for an immediate next try + emit gameFinished(); + lastPlayer = -1; + TQTimer::singleShot(hallOfFameMS, this, SLOT(end())); + return; + } + + // shift old (lower) scores to make place for the new one + for (int i = 9; i > lastScore && i > 0; i--) + hallOfFame[i] = hallOfFame[i-1]; + + hallOfFame[lastScore].points = playerScore[lastPlayer]; + hallOfFame[lastScore].levels = level; + hallOfFame[lastScore].moment = TQDateTime::currentDateTime(); + hallOfFame[lastScore].name = playerName[lastPlayer]; + + cursor.x = 14; + cursor.y = 11+lastScore; + cursor.chr = hallOfFame[lastScore].name.at(cursor.x-14); + +// startTimer(cursorBlinkMS); + setFocus(); +} + +/* + * Read the highscores, if no file or a file shorter than 4 bytes (versions before 0.2.4 stores only + * the points of one highscore) exists - the highscores were initialized with default values. + */ +void Score::read() +{ + if (highscoreFile.exists() && highscoreFile.size() > 4) { + if (highscoreFile.open(IO_ReadOnly)) { + TQDataStream s(&highscoreFile); + char *name; + for (int i = 0; i < 10; i++) { + s >> hallOfFame[i].points >> hallOfFame[i].levels >> hallOfFame[i].duration >> + hallOfFame[i].moment >> name; + hallOfFame[i].name = TQString::fromLatin1(name); + delete(name); + } + highscoreFile.close(); + } + } else { + for (int i = 0; i < 10; i++) { + hallOfFame[i].points = 5000; + hallOfFame[i].levels = 0; + hallOfFame[i].duration = TQTime(); + hallOfFame[i].moment = TQDateTime(); + hallOfFame[i].name = "???"; + } + // write(); + } + + for (int i = 0; i < 10; i++) + for (uint j = 0; j < hallOfFame[i].name.length(); j++) + if (hallOfFame[i].name.at(j) < bitfont->firstChar() || + hallOfFame[i].name.at(j) > bitfont->lastChar()) + hallOfFame[i].name.at(j) = hallOfFame[i].name.at(j).upper(); + + HighScore = hallOfFame[0].points; +} + +void Score::write() +{ + if (!highscoreFile.exists() && highscoreFile.name() == systemHighscoreFileInfo.filePath()) + KMessageBox::information(0, + i18n("You're going to create the highscore-file\n" + "'%1'\n" + "for your maschine, that should be used systemwide.\n" + "\n" + "To grant access to the other users, set the appropriate rights (a+w)\n" + "on that file or ask your systemadministator for that favor.\n" + "\n" + "To use a different directory or filename for the highscores," + "specify them in the configfile (tdepacmanrc:highscoreFilePath)." + ).arg(systemHighscoreFileInfo.filePath())); + + if (highscoreFile.name() == privateHighscoreFileInfo.filePath()) + KMessageBox::information(0, + i18n("You're using a private highscore-file, that's mostly because of\n" + "missing write-access to the systemwide file\n" + "'%1' .\n" + "\n" + "Ask your systemadministrator for granting you access to that file,\n" + "by setting the appropriate rights (a+w) on it.\n" + "\n" + "To use a different directory or filename for the highscores," + "specify them in the configfile (tdepacmanrc:highscoreFilePath)." + ).arg(systemHighscoreFileInfo.filePath()), + TQString::null, "PrivateHighscore"); + + if (highscoreFile.open(IO_WriteOnly)) { + TQDataStream s(&highscoreFile); + for (int i = 0; i < 10; i++) + s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration << + hallOfFame[i].moment << hallOfFame[i].name.latin1(); + highscoreFile.close(); + } +} + +void Score::setPause(bool Paused) +{ + paused = Paused; + + TQRect r = bitfont->rect(i18n("PAUSED")); + r.moveCenter(TQPoint(this->width()/2, this->height()/2)); + repaint(r, TRUE); + + // repaint 1UP or 2UP + repaint(FALSE); +} + +void Score::end() +{ + if (paused) { + TQTimer::singleShot(afterPauseMS, this, SLOT(end())); + return; + } + + // repaint 1UP or 2UP + repaint(FALSE); + + // if lastPlayer != -1 we're already in playing mode + if (lastPlayer == -1) + emit gameHighscores(); +} + +/* + * Return the date in a formatted TQString. The format can be changed using internationalization + * of the string "YY/MM/DD". Invalid TQDate's where returned as "00/00/00". + */ +TQString Score::formatDate(TQDate date) +{ + TQString s = i18n("@YY@/@MM@/@DD@"); + + TQString dd; + dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0); + s.replace(TQRegExp("@YY@"), dd); + dd.sprintf("%02d", date.isValid() ? date.month() : 0); + s.replace(TQRegExp("@MM@"), dd); + dd.sprintf("%02d", date.isValid() ? date.day() : 0); + s.replace(TQRegExp("@DD@"), dd); + + return s; +} + +TQRect Score::rect(int col, float row, TQString str, int align) +{ + TQRect r = bitfont->rect(str); + r.moveBy(x(col), y(row)); + + int dx = 0; + int dy = 0; + + if (align & AlignLeft || align & AlignRight) { + dx = (str.length()-1) * (bitfont->width()/2); + if (align & AlignRight) + dx *= -1; + } + + if (align & AlignTop || align & AlignBottom) { + dy = bitfont->height()/2; + if (align & AlignBottom) + dy *= -1; + } + + if (dx != 0 || dy != 0) + r.moveBy(dx, dy); + + return r; +} + +int Score::x(int col) +{ + return col*bitfont->width(); +} + +int Score::y(float row) +{ + return (int) (row*(bitfont->height()+bitfont->height()/4)); +} + +/** + * Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann. + * Über den "highscoreFilePath"-TDEConfig-Eintrag, kann abweichend von der Standardlokation + * der Standort der "highscore"-Datei spezifiziert werden. + * Wenn die systemweite "highscore"-Datei nicht beschrieben werden kann, wird mit einer + * privaten Datei gearbeitet. + */ +TQFileInfo Score::locateHighscoreFilePath() +{ + TQFileInfo systemHighscoreDirPath; + TQStringList systemHighscoreDirs; + + // Schreibfähige "private" highscore-Datei ermitteln für den fallback. + privateHighscoreFileInfo.setFile(TDEGlobal::dirs()->saveLocation("appdata")+highscoreName); + + // FilePath aus der Konfigurationsdatei benutzen + systemHighscoreFileInfo.setFile(kapp->config()->readEntry("HighscoreFilePath")); + + // Kein Wert aus der Konfiguration erhalten, dann die "system"-Datei suchen. + if (systemHighscoreFileInfo.filePath().isEmpty()) + systemHighscoreDirs = TDEGlobal::dirs()->resourceDirs("appdata"); + else + systemHighscoreDirs = TQStringList(systemHighscoreFileInfo.filePath()); + + for (TQStringList::Iterator i = systemHighscoreDirs.begin(); i != systemHighscoreDirs.end(); ++i) { + + systemHighscoreFileInfo.setFile(*i); + if (systemHighscoreFileInfo.fileName().isEmpty()) + systemHighscoreFileInfo.setFile(systemHighscoreFileInfo.dirPath()+"/"+highscoreName); + + // privateHighscoreFileInfo für die "system" Suche ignorieren + if (systemHighscoreFileInfo.filePath() != privateHighscoreFileInfo.filePath()) + if (!systemHighscoreFileInfo.exists()) { + systemHighscoreDirPath.setFile(systemHighscoreFileInfo.dirPath()); + if (systemHighscoreDirPath.exists() && systemHighscoreDirPath.isWritable()) + return systemHighscoreFileInfo; + } else + if (systemHighscoreFileInfo.isWritable()) + return systemHighscoreFileInfo; + } + + return privateHighscoreFileInfo; +} + +#include "score.moc" diff --git a/tdepacman/score.h b/tdepacman/score.h new file mode 100644 index 0000000..fc0da45 --- /dev/null +++ b/tdepacman/score.h @@ -0,0 +1,124 @@ +#ifndef SCORE_H +#define SCORE_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "painter.h" +#include "bitfont.h" + +#define maxPlayer 1 +#define minPlayerNameLength 3 +#define highscoreName "highscore" + +class Score : public TQWidget +{ + Q_OBJECT +public: + Score (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0); + ~Score(); + +public slots: + void setScheme(int scheme, int mode, Bitfont *font=0); + + void set(int score); + void set(int score, int player); + void setScore(int level, int player); + void setPause(bool paused); + + void initKeys(); + +private slots: + void read(); + void write(); + void end(); + +signals: + void gameFinished(); + void gameHighscores(); + +protected: + void timerEvent(TQTimerEvent *); + void paintEvent(TQPaintEvent *); + void keyPressEvent(TQKeyEvent *); + + void focusInEvent(TQFocusEvent *) { ; } + void focusOutEvent(TQFocusEvent *) { ; } + + void confScheme(); + void confTiming(bool defGroup=TRUE); + +private: + Bitfont *bitfont; + + TQRect rect(int col, float row, TQString str, int align = AlignCenter); + int x(int col); + int y(float row); + + TQString formatDate(TQDate date); + + /** + * Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann. + * Über den "highscoreFilePath"-TDEConfig-Eintrag, kann abweichend von der Standardlokation + * der Standort der "highscore"-Datei spezifiziert werden. + * Wenn die systemweite "globale" Datei nicht beschrieben werden kann, wird mit einer + * privaten Datei gearbeitet. + */ + TQFileInfo locateHighscoreFilePath(); + + int cursorBlinkMS; + int hallOfFameMS; + int afterPauseMS; + + bool paused; + + uint UpKey; + uint DownKey; + uint RightKey; + uint LeftKey; + + int lastScore; + int lastPlayer; + int HighScore; + int playerScore[maxPlayer]; + TQString playerName[maxPlayer]; + + struct { + int x; + int y; + TQChar chr; + bool on; + } cursor; + + int cursorBlinkTimer; + bool scrollRepeat; + + struct { + int points; + int levels; + TQTime duration; + TQDateTime moment; + TQString name; + } hallOfFame[10]; + + TQFileInfo systemHighscoreFileInfo; + TQFileInfo privateHighscoreFileInfo; + + TQFile highscoreFile; + + int scheme; + int mode; +}; + +#endif // SCORE_H diff --git a/tdepacman/status.cpp b/tdepacman/status.cpp new file mode 100644 index 0000000..12f01b7 --- /dev/null +++ b/tdepacman/status.cpp @@ -0,0 +1,353 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "status.h" + +Status::Status( TQWidget *parent, const char *name, int Scheme, int Mode ) : + TQWidget( parent, name ) +{ + actualLifes = 0; + actualLevel = 0; + + lifesPix = NULL; + levelPix = NULL; + + scheme = Scheme; + mode = Mode; + level = 0; + + confScheme(); +} + +TQPtrList *Status::loadPixmap(TQWidget *parent, TQString pixmapName, + TQPtrList *pixmaps) +{ + if (pixmaps == NULL) { + pixmaps = new TQPtrList; + pixmaps->setAutoDelete(TRUE); + } + + if (!pixmaps->isEmpty()) + pixmaps->clear(); + + TQPixmap PIXMAP(pixmapName); + if (PIXMAP.isNull() || PIXMAP.mask() == NULL) { + TQString msg = i18n("The pixmap could not be contructed.\n\n" + "The file '@PIXMAPNAME@' does not exist,\n" + "or is of an unknown format."); + msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName); + TQMessageBox::information(parent, i18n("Initialization Error"), msg); + return 0; + } + + int height = PIXMAP.height(); + int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height); + + TQBitmap BITMAP; + TQBitmap MASK; + + BITMAP = *PIXMAP.mask(); + MASK.resize(width, height); + + for (int x = 0; x < PIXMAP.width()/width; x++) { + TQPixmap *pixmap = new TQPixmap(width, height); + pixmaps->append(pixmap); + bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, CopyROP, TRUE); + bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, CopyROP, TRUE); + pixmap->setMask(MASK); + } + + return pixmaps; +} + +void Status::paintEvent( TQPaintEvent *) +{ + for (int x = 0; x < actualLifes && !lifesPix->isEmpty(); x++) + bitBlt(this, lifesPix->at(0)->width()+(lifesPix->at(0)->width()*x), + (height()-lifesPix->at(0)->height())/2, + lifesPix->at(0), 0, 0, + lifesPix->at(0)->width(), lifesPix->at(0)->height()); + + for (int x = 0; x < actualLevel && !levelPix->isEmpty(); x++) { + erase((width()-levelPix->at(x)->width()*2)-(levelPix->at(x)->width()*levelPos[x]), + (height()-levelPix->at(x)->height())/2, + levelPix->at(x)->width(), levelPix->at(x)->height()); + bitBlt(this, (width()-levelPix->at(x)->width()*2)-(levelPix->at(x)->width()*levelPos[x]), + (height()-levelPix->at(x)->height())/2, + levelPix->at(x), 0, 0, + levelPix->at(x)->width(), levelPix->at(x)->height()); + } +} + +void Status::initPixmaps() +{ + if (lastLifesPixmapName != lifesPixmapName.at(level)) { + lifesPix = loadPixmap(this, lifesPixmapName.at(level), lifesPix); + lastLifesPixmapName = lifesPixmapName.at(level); + } + if (lastLevelPixmapName != levelPixmapName.at(level)) { + levelPix = loadPixmap(this, levelPixmapName.at(level), levelPix); + lastLevelPixmapName = levelPixmapName.at(level); + } +} + +TQString Status::decodeHexOctString(TQString s) +{ + TQString value; + TQString valids; + int pos, xpos = 0, opos = 0; + int v, len, leadin; + const char *ptr; + uchar c; + + while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) || + ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) { + if (xpos != -1) { + valids = "0123456789abcdef"; + leadin = 2; + pos = xpos; + } else { + valids = "01234567"; + leadin = 1; + pos = opos; + } + + c = '\0'; + len = 0; + value = s.mid(pos+leadin, 3); + ptr = value.latin1(); + + while (*ptr != '\0' && (v = valids.find(*ptr++, 0, FALSE)) != -1) { + c = (c * valids.length()) + v; + len++; + } + + value.fill(c, 1); + s.replace(pos, len+leadin, value); + } + + return s; +} + +void Status::fillArray(TQMemArray &array, TQString values, int max) +{ + array.resize(max); + int last = 0; + bool ok; + TQString value; + + for (uint i = 0; i < array.size(); i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + array[i] = value.toInt(&ok); + if (ok) + last = array[i]; + else + array[i] = last; + } +} + +void Status::fillStrList(TQStrList &list, TQString values, int max) +{ + if (!list.isEmpty()) + list.clear(); + + TQString last = ""; + TQString value; + + for (uint i = 0; i < (uint) max; i++) { + if (values.find(',') < 0 && values.length() > 0) { + value = values; + values = ""; + } + if (values.find(',') >= 0) { + value = values.left(values.find(',')); + values.remove(0,values.find(',')+1); + } + if (!value.isEmpty()) + last = decodeHexOctString(value); + list.append(last.latin1()); + } +} + +void Status::fillPixmapName(TQStrList &pixmapName) +{ + TQStrList list = pixmapName; + + if (!pixmapName.isEmpty()) + pixmapName.clear(); + + TQString pixmap; + + TQFileInfo fileInfo; + + for (uint i = 0; i < list.count(); i++) { + pixmap = list.at(i); + + if (pixmap.left(1) != "/" && pixmap.left(1) != "~") + pixmap = TDEGlobal::dirs()->findResource("appdata", pixmapDirectory+pixmap); + + fileInfo.setFile(pixmap); + if (!fileInfo.isReadable() || !fileInfo.isFile()) + pixmap = ""; + + pixmapName.append(pixmap.utf8()); + } +} + +void Status::confLevels(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("Levels")) + maxLevel = kapp->config()->readNumEntry("Levels", 13); +} + +void Status::confMisc(bool defGroup) +{ + if (defGroup || kapp->config()->hasKey("LevelPosition")) + fillArray(levelPos, kapp->config()->readEntry("LevelPosition", "0,1,2,3,,4,,5,,6,,7"), maxLevel); + + if (defGroup || kapp->config()->hasKey("PixmapDirectory")) { + pixmapDirectory = kapp->config()->readEntry("PixmapDirectory"); + + if (pixmapDirectory.left(1) != "/" && pixmapDirectory.left(1) != "~") + pixmapDirectory.insert(0, "pics/"); + if (pixmapDirectory.right(1) != "/") + pixmapDirectory.append("/"); + } + + if (defGroup || kapp->config()->hasKey("LifesPixmapName")) + fillStrList(lifesPixmapName, + kapp->config()->readEntry("LifesPixmapName", "lifes.xpm"), maxLevel+1); + if (defGroup || kapp->config()->hasKey("LevelPixmapName")) + fillStrList(levelPixmapName, + kapp->config()->readEntry("LevelPixmapName", "level.xpm"), maxLevel+1); + +} + +void Status::confScheme() +{ + TQString oldgroup = kapp->config()->group(); + TQString newgroup; + + // if not set, read mode and scheme from the configfile + if (mode == -1 && scheme == -1) { + scheme = kapp->config()->readNumEntry("Scheme", -1); + mode = kapp->config()->readNumEntry("Mode", -1); + + // if mode is not set in the defGroup-group, lookup the scheme group + if (scheme != -1 || mode == -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + mode = kapp->config()->readNumEntry("Mode", -1); + kapp->config()->setGroup(oldgroup); + } + } + + confLevels(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confLevels(FALSE); + } + + kapp->config()->setGroup(oldgroup); + + confMisc(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + } + + fillPixmapName(lifesPixmapName); + fillPixmapName(levelPixmapName); + + initPixmaps(); + + setFixedHeight(minHeight()); + + kapp->config()->setGroup(oldgroup); +} + +void Status::setScheme(int Scheme, int Mode) +{ + mode = Mode; + scheme = Scheme; + + confScheme(); + + repaint(); +} + +int Status::minHeight() +{ + if (lifesPix->isEmpty() && levelPix->isEmpty()) + return 0; + if (levelPix->isEmpty()) + return lifesPix->at(0)->height(); + if (lifesPix->isEmpty()) + return levelPix->at(0)->height(); + return (lifesPix->at(0)->height() > levelPix->at(0)->height()) ? + lifesPix->at(0)->height() : levelPix->at(0)->height(); +} + +int Status::minWidth() +{ + if (lifesPix->isEmpty() && levelPix->isEmpty()) + return 0; + if (levelPix->isEmpty()) + return lifesPix->at(0)->width(); + if (lifesPix->isEmpty()) + return levelPix->at(0)->width(); + return (lifesPix->at(0)->width() > levelPix->at(0)->width()) ? + lifesPix->at(0)->width() : levelPix->at(0)->width(); +} + +void Status::setLifes(int lifes) +{ + actualLifes = lifes; + repaint(); +} + +void Status::setLevel(int Level) +{ + level = Level; + + initPixmaps(); + + actualLevel = (level > (int) levelPix->count()) ? (int) levelPix->count() : level; + repaint(); +} + +#include "status.moc" diff --git a/tdepacman/status.h b/tdepacman/status.h new file mode 100644 index 0000000..6cbf759 --- /dev/null +++ b/tdepacman/status.h @@ -0,0 +1,74 @@ +#ifndef STATUS_H +#define STATUS_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +class Status : public TQWidget +{ + Q_OBJECT +public: + Status(TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1); + ~Status() {}; + +public slots: + void setScheme(int scheme, int mode); + void setLevel(int level); + void setLifes(int lifes); + +protected: + void paintEvent(TQPaintEvent *); + int minHeight(); + int minWidth(); + + TQString decodeHexOctString(TQString str); + + void fillArray(TQMemArray &, TQString, int); + void fillStrList(TQStrList &, TQString, int); + void fillPixmapName(TQStrList &); + + void confScheme(); + void confLevels(bool defGroup=TRUE); + void confMisc(bool defGroup=TRUE); + + void initPixmaps(); + +private: + TQMemArray levelPos; + int actualLifes; + int actualLevel; + + TQString pixmapDirectory; + + TQStrList lifesPixmapName; + TQStrList levelPixmapName; + + TQString lastLifesPixmapName; + TQString lastLevelPixmapName; + + TQPtrList *loadPixmap(TQWidget *parent, TQString pixmapName, + TQPtrList *pixmaps=0); + + TQPtrList *lifesPix; + TQPtrList *levelPix; + + int maxLevel; + int level; + + int scheme; + int mode; +}; + +#endif // STATUS_H diff --git a/tdepacman/tdepacman.cpp b/tdepacman/tdepacman.cpp new file mode 100644 index 0000000..351d56f --- /dev/null +++ b/tdepacman/tdepacman.cpp @@ -0,0 +1,476 @@ +/*************************************************************************** + tdepacman.cpp - description + ------------------- + begin : Sam Jan 19 13:37:57 CET 2002 + copyright : (C) 1998-2003 by Jörg Thönnissen + email : joe@dsite.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// include files for TQt +#include +#include +#include +#include + +// include files for TDE +#include +#include +#include +#include + +// application specific includes +#include "tdepacman.h" + +#define ID_STATUS_MSG 1 + +TDEpacmanApp::TDEpacmanApp(TQWidget *, const char *name) : TDEMainWindow(0, name) +{ + config=kapp->config(); + + /////////////////////////////////////////////////////////////////// + // call inits to invoke all other construction parts + initStatusBar(); + initActions(); + initView(); + + readOptions(); + + highscoresChecked = false; + focusedPause = false; + + connect(view->referee, SIGNAL(setScore(int, int)), view->score, SLOT(setScore(int, int))); + connect(view->referee, SIGNAL(setPoints(int)), view->score, SLOT(set(int))); + connect(view->referee, SIGNAL(setLifes(int)), view->status, SLOT(setLifes(int))); + connect(view->referee, SIGNAL(setLevel(int)), view->status, SLOT(setLevel(int))); + + connect(view->referee, SIGNAL(focusedGamePause()), this, SLOT(slotFocusedGamePause())); + connect(view->referee, SIGNAL(forcedGameHighscores()), this, SLOT(slotForcedGameHighscores())); + + connect(view->score, SIGNAL(gameHighscores()), this, SLOT(slotGameHighscores())); + connect(view->score, SIGNAL(gameFinished()), this, SLOT(slotGameFinished())); +} + +TDEpacmanApp::~TDEpacmanApp() +{ + +} + + +void TDEpacmanApp::initActions() +{ + gameNew = KStdGameAction::gameNew(this, SLOT(slotGameNew()), actionCollection()); + gamePause = KStdGameAction::pause(this, SLOT(slotGamePause()), actionCollection()); + gamePause->setAccel(Key_F3); + gameQuit = KStdGameAction::quit(this, SLOT(slotGameQuit()), actionCollection()); + gameHighscores = KStdGameAction::highscores(this, SLOT(slotGameHighscores()), actionCollection()); + showMenuBar = KStdAction::showMenubar(this, SLOT(slotShowMenuBar()), actionCollection()); + showToolBar = KStdAction::showToolbar(this, SLOT(slotShowToolBar()), actionCollection()); + showStatusBar = KStdAction::showStatusbar(this, SLOT(slotShowStatusBar()), actionCollection()); + showMouseCursor = new TDEToggleAction(i18n("Show Mouse&cursor"), 0, + this, SLOT(slotShowMouseCursor()), actionCollection(), + "options_show_mousecursor"); + selectGraphicScheme = new TDEActionMenu(i18n("&Select graphic scheme"), actionCollection(), + "options_select_graphic_scheme"); + KStdAction::keyBindings(this, SLOT(slotKeyBindings()), actionCollection()); + focusOutPause = new TDEToggleAction(i18n("Pause in &Background"), 0, + this, SLOT(slotFocusOutPause()), actionCollection(), + "options_focus_out_pause"); + focusInContinue = new TDEToggleAction(i18n("Continue in &Foreground"), 0, + this, SLOT(slotFocusInContinue()), actionCollection(), + "options_focus_in_continue"); + + showMenuBar->setStatusText(i18n("Enables/disables the menubar")); + showToolBar->setStatusText(i18n("Enables/disables the toolbar")); + showStatusBar->setStatusText(i18n("Enables/disables the statusbar")); + showMouseCursor->setStatusText(i18n("Enable/disables the mousecursor")); + + // use the absolute path to your tdepacmanui.rc file for testing purpose in createGUI(); + createGUI(); +} + + +void TDEpacmanApp::initStatusBar() +{ + /////////////////////////////////////////////////////////////////// + // STATUSBAR + // TODO: add your own items you need for displaying current application status. + statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG); +} + +void TDEpacmanApp::initView() +{ + //////////////////////////////////////////////////////////////////// + // create the main widget here that is managed by TDEMainWindow's view-region and + // connect the widget. + + view = new TDEpacmanView(this); + setCentralWidget(view); + + setFixedSize(view->width(), view->height()); + view->referee->setFocus(); +} + +void TDEpacmanApp::saveOptions() +{ + // config->setGroup("General Options"); + config->writeEntry("Geometry", size()); + config->writeEntry("ShowMenubar", showMenuBar->isChecked()); + config->writeEntry("ShowToolbar", showToolBar->isChecked()); + config->writeEntry("ShowStatusbar", showStatusBar->isChecked()); + config->writeEntry("ShowMousecursor", showMouseCursor->isChecked()); + config->writeEntry("FocusOutPause", focusOutPause->isChecked()); + config->writeEntry("FocusInContinue", focusInContinue->isChecked()); + config->writeEntry("ToolBarPos", (int) toolBar("mainToolBar")->barPos()); + config->writeEntry("Scheme", scheme); + config->writeEntry("Mode", mode); +} + +void TDEpacmanApp::readOptions() +{ + + // config->setGroup("General Options"); + + // bar status settings + bool bShowMenubar = config->readBoolEntry("ShowMenubar", true); + showMenuBar->setChecked(bShowMenubar); + slotShowMenuBar(); + + bool bShowToolbar = config->readBoolEntry("ShowToolbar", true); + showToolBar->setChecked(bShowToolbar); + slotShowToolBar(); + + bool bShowStatusbar = config->readBoolEntry("ShowStatusbar", false); + showStatusBar->setChecked(bShowStatusbar); + slotShowStatusBar(); + + // cursor status settings + bool bShowMousecursor = config->readBoolEntry("ShowMousecursor", false); + showMouseCursor->setChecked(bShowMousecursor); + slotShowMouseCursor(); + + // focus status settings + bool bFocusOutPause = config->readBoolEntry("FocusOutPause", false); + focusOutPause->setChecked(bFocusOutPause); + slotFocusOutPause(); + + bool bFocusInContinue = config->readBoolEntry("FocusInContinue", false); + focusInContinue->setChecked(bFocusInContinue); + slotFocusInContinue(); + + // bar position settings + TDEToolBar::BarPosition toolBarPos; + toolBarPos = (TDEToolBar::BarPosition) config->readNumEntry("ToolBarPos", TDEToolBar::Top); + toolBar("mainToolBar")->setBarPos(toolBarPos); + + TQSize size = config->readSizeEntry("Geometry"); + if (!size.isEmpty()) + { + resize(size); + } + + // scheme and mode + scheme = config->readNumEntry("Scheme", -1); + mode = config->readNumEntry("Mode", -1); + readSchemes(); +} + +void TDEpacmanApp::readSchemes() +{ + TQString saveGroup = config->group(); + TQString group; + TQString description; + + int modeCount = config->readNumEntry("ModeCount", -1); + int schemeCount = config->readNumEntry("SchemeCount"); + + modeID.resize(modeCount > 0 ? modeCount : 0); + schemeID.resize(schemeCount); + schemeMode.resize(schemeCount); + + schemesPopup = new TQPtrList; + schemesPopup->setAutoDelete(true); + + modesPopup = selectGraphicScheme->popupMenu(); + connect(modesPopup, SIGNAL(activated(int)), this, SLOT(slotSchemeActivated(int))); + + if (schemeCount == 0 || scheme == -1) { + TQMessageBox::warning(this, i18n("Configuration Error"), + i18n("There are no schemes defined,\n" + "or no scheme is selected.")); + return; + } + + // create submenus (TQPopupMenu) for graphic-modes + for (int m = 0; m < modeCount; m++) { + group.sprintf("Mode %d", m); + config->setGroup(group); + + description = config->readEntry("Description", group); + + TDEPopupMenu *p = new TDEPopupMenu; + p->setCheckable(true); + connect(p, SIGNAL(activated(int)), this, SLOT(slotSchemeActivated(int))); + schemesPopup->append(p); + + modeID[m] = modesPopup->insertItem(description, schemesPopup->at(m)); + modesPopup->setItemEnabled(modeID[m], false); + modesPopup->setItemChecked(modeID[m], m == mode); + } + + // create menuitems (insertItem) for graphic-schemes + for (int i = 0; i < schemeCount; i++) { + group.sprintf("Scheme %d", i); + config->setGroup(group); + + description = config->readEntry("Description", group); + schemeMode[i] = config->readNumEntry("Mode", -1); + + if (schemeMode[i] == -1) { + schemeID[i] = modesPopup->insertItem(description); + modesPopup->setItemChecked(schemeID[i], i == scheme); + } else { + schemeID[i] = schemesPopup->at(schemeMode[i])->insertItem(description); + schemesPopup->at(schemeMode[i])->setItemChecked(schemeID[i], i == scheme); + modesPopup->setItemEnabled(modeID[schemeMode[i]], true); + } + } + + config->setGroup(saveGroup); +} + +bool TDEpacmanApp::queryExit() +{ + saveOptions(); + return true; +} + + +///////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATION +///////////////////////////////////////////////////////////////////// + +void TDEpacmanApp::slotGameNew() +{ + // enable the gameHighscores action, if disabled by forced highscores mode + if (!gameHighscores->isEnabled()) + gameHighscores->setEnabled(true); + + // hide highscores and show board again, if in highscores mode + if (highscoresChecked) + slotGameHighscores(); + + // deactivate pause and uncheck the menuitem, if in pause state + if (gamePause->isChecked()) { + gamePause->setChecked(false); + slotGamePause(); + } + // disable menuitem to prevent interruption of the game + gameNew->setEnabled(false); + + view->referee->play(); +} + +void TDEpacmanApp::slotGamePause() +{ + view->referee->pause(); + view->score->setPause(gamePause->isChecked()); +} + +void TDEpacmanApp::slotFocusedGamePause() +{ + // if an focus-event triggers the pause, toggle the gamePause checked + gamePause->setChecked(!gamePause->isChecked()); + focusedPause = !focusedPause; + + slotGamePause(); +} + +void TDEpacmanApp::slotGameHighscores() +{ + // toggle highscores mode flag + highscoresChecked = !highscoresChecked; + + view->referee->toggleHallOfFame(); + + // show highscore (by lowering referee and status) or return to play (by raising them again) + if (highscoresChecked) { + view->referee->lower(); + view->status->lower(); + } else { + view->status->raise(); + view->referee->raise(); + view->referee->setFocus(); + + // after forced highscores comes the intro again + if (!gameHighscores->isEnabled()) { + gameHighscores->setEnabled(true); + view->referee->intro(); + } + } +} + +void TDEpacmanApp::slotForcedGameHighscores() +{ + // disable menuitem to prevent closing highscores display + gameHighscores->setEnabled(false); + + slotGameHighscores(); +} + +void TDEpacmanApp::slotGameQuit() +{ + slotStatusMsg(i18n("Exiting...")); + saveOptions(); + kapp->quit(); +} + +void TDEpacmanApp::slotShowMenuBar() +{ + slotStatusMsg(i18n("Toggling menubar...")); + /////////////////////////////////////////////////////////////////// + // turn Menubar on or off + if(!showMenuBar->isChecked()) { + menuBar()->hide(); + setFixedSize(view->width(), view->height()); + } else { + menuBar()->show(); + } + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotShowToolBar() +{ + slotStatusMsg(i18n("Toggling toolbar...")); + /////////////////////////////////////////////////////////////////// + // turn Toolbar on or off + if(!showToolBar->isChecked()) { + toolBar("mainToolBar")->hide(); + setFixedSize(view->width(), view->height()); + } else { + toolBar("mainToolBar")->show(); + } + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotShowStatusBar() +{ + slotStatusMsg(i18n("Toggle the statusbar...")); + /////////////////////////////////////////////////////////////////// + // turn Statusbar on or off + if(!showStatusBar->isChecked()) { + statusBar()->hide(); + setFixedSize(view->width(), view->height()); + } else { + statusBar()->show(); + } + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotShowMouseCursor() +{ + slotStatusMsg(i18n("Toggle the mousecursor...")); + /////////////////////////////////////////////////////////////////// + // turn Mousecursor on or off + if(!showMouseCursor->isChecked()) { + view->setCursor(blankCursor); + } else { + view->setCursor(arrowCursor); + } + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotSchemeActivated(int id) +{ + slotStatusMsg(i18n("Graphic scheme selected...")); + /////////////////////////////////////////////////////////////////// + // select activated scheme/mode + + mode = -1; + scheme = -1; + + for (uint s = 0; s < schemeID.size(); s++) { + if (schemeID[s] == id) { + scheme = s; + mode = schemeMode[s]; + } + if (schemeMode[s] == -1) { + modesPopup->setItemChecked(schemeID[s], schemeID[s] == id); + } else { + modesPopup->setItemChecked(modeID[schemeMode[s]], schemeMode[s] == mode); + schemesPopup->at(schemeMode[s])->setItemChecked(schemeID[s], schemeID[s] == id); + } + } + + view->setScheme(scheme, mode); + setFixedSize(view->width(), view->height()); + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotFocusOutPause() +{ + slotStatusMsg(i18n("Toggle focusOutPause...")); + /////////////////////////////////////////////////////////////////// + // turn focusOutPause on or off + view->referee->setFocusOutPause(focusOutPause->isChecked()); + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotFocusInContinue() +{ + slotStatusMsg(i18n("Toggle focusInContinue...")); + /////////////////////////////////////////////////////////////////// + // turn focusInContinue on or off + view->referee->setFocusInContinue(focusInContinue->isChecked()); + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotKeyBindings() +{ + slotStatusMsg(i18n("Configure key bindings...")); + /////////////////////////////////////////////////////////////////// + // configure key bindings + PKeys *keys = new PKeys(); + if (keys->exec() == TQDialog::Accepted) { + view->referee->initKeys(); + view->score->initKeys(); + } + delete keys; + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotGameFinished() +{ + slotStatusMsg(i18n("Game finished...")); + /////////////////////////////////////////////////////////////////// + // enable/disable the menuitem + gameNew->setEnabled(true); + + slotStatusMsg(i18n("Ready.")); +} + +void TDEpacmanApp::slotStatusMsg(const TQString &text) +{ + /////////////////////////////////////////////////////////////////// + // change status message permanently + statusBar()->clear(); + statusBar()->changeItem(text, ID_STATUS_MSG); +} + +#include "tdepacman.moc" diff --git a/tdepacman/tdepacman.desktop b/tdepacman/tdepacman.desktop new file mode 100644 index 0000000..8d69824 --- /dev/null +++ b/tdepacman/tdepacman.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Name=TDEpacman + +GenericName=Arcade Game + +Comment=A simple clone of the classic arcade game Pac-Man + +Keywords=arcade;pacman;dots;ghosts;level; + +Type=Application +Exec=tdepacman -caption "%c" %i %m +Icon=tdepacman.png +MiniIcon=tdepacman.png +Terminal=false +X-DocPath=tdepacman/index.html +Categories=Qt;TDE;Game;ArcadeGame; diff --git a/tdepacman/tdepacman.h b/tdepacman/tdepacman.h new file mode 100644 index 0000000..65740ed --- /dev/null +++ b/tdepacman/tdepacman.h @@ -0,0 +1,185 @@ +/*************************************************************************** + tdepacman.h - description + ------------------- + begin : Sam Jan 19 13:37:57 CET 2002 + copyright : (C) 1998-2003 by Jörg Thönnissen + email : joe@dsite.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TDEPACMAN_H +#define TDEPACMAN_H + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +// include files for TQt +#include +#include +#include + +//include files for TDE +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "tdepacmanview.h" +#include "referee.h" +#include "status.h" +#include "score.h" +#include "keys.h" + +// forward declaration of the TDEpacman classes +class TDEpacmanView; + +/** + * The base class for TDEpacman application. + */ +class TDEpacmanApp : public TDEMainWindow +{ + Q_OBJECT + + friend class TDEpacmanView; + + public: + /** constructor of TDEpacmanApp, calls all init functions to create the application. + */ + TDEpacmanApp(TQWidget *parent = 0, const char *name = 0); + virtual ~TDEpacmanApp(); + + protected: + /** save general Options like all bar positions and status as well as the application specific + * Options to the configuration file + */ + void saveOptions(); + /** read general Options again and initialize all variables + */ + void readOptions(); + /** read graphic schemes and build menu items for selection + */ + void readSchemes(); + /** initializes the TDEActions of the application */ + void initActions(); + /** sets up the statusbar for the main window by initialzing a statuslabel. + */ + void initStatusBar(); + /** creates the centerwidget of the KTMainWindow instance and sets it as the view + */ + void initView(); + /** queryExit is called by KTMainWindow when the last window of the application is going to be closed + * during the closeEvent(). + * Against the default implementation that just returns true, this calls saveOptions() to save the + * settings of the window's properties. + * @see KTMainWindow#queryExit + * @see KTMainWindow#closeEvent + */ + virtual bool queryExit(); + + + public slots: + /** play new game + */ + void slotGameNew(); + /** pause (continue) game + */ + void slotGamePause(); + /** pause (continue) game triggered by focus events + */ + void slotFocusedGamePause(); + /** toggle the highscores + */ + void slotGameHighscores(); + /** toggle the highscores, forced by the referee + */ + void slotForcedGameHighscores(); + /** save the options, then quits the application. + */ + void slotGameQuit(); + /** toggles the menubar + */ + void slotShowMenuBar(); + /** toggles the toolbar + */ + void slotShowToolBar(); + /** toggles the statusbar + */ + void slotShowStatusBar(); + /** toggles the mousecursor + */ + void slotShowMouseCursor(); + /** graphic scheme activated + * @param id the id of the activated/selected menuitem + */ + void slotSchemeActivated(int id); + /** toggles the focus out pause + */ + void slotFocusOutPause(); + /** toggles the focus in continue + */ + void slotFocusInContinue(); + /** changes the statusbar contents for the standard label permanently, used to indicate current actions. + * @param text the text that is displayed in the statusbar + */ + void slotStatusMsg(const TQString &text); + /** configure keysbindings dialog + */ + void slotKeyBindings(); + /** game (including highscores displayed) has been finished + */ + void slotGameFinished(); + + private: + /** the configuration object of the application */ + TDEConfig *config; + /** view is the main widget which represents your working area. The View + * class should handle all events of the view widget. It is kept empty so + * you can create your view according to your application's needs by + * changing the view class. + */ + TDEpacmanView *view; + + // TDEAction pointers to enable/disable actions + TDEAction* gameNew; + TDEToggleAction* gamePause; + TDEAction* gameHighscores; + TDEAction* gameQuit; + TDEToggleAction* showMenuBar; + TDEToggleAction* showToolBar; + TDEToggleAction* showStatusBar; + TDEToggleAction* showMouseCursor; + TDEToggleAction* focusOutPause; + TDEToggleAction* focusInContinue; + TDEActionMenu* selectGraphicScheme; + + // active scheme/mode + int scheme; + int mode; + + TDEPopupMenu *modesPopup; // TDEAction main scheme selection menu + TQPtrList *schemesPopup; // submenus for selecting scheme + + // ID's of the menuitem(s) for finding/selecting scheme by id + TQMemArray modeID; + TQMemArray schemeID; + + TQMemArray schemeMode; // mode(group) of the schemes, -1 if no group + + bool highscoresChecked; // highscores display active + bool focusedPause; // Pause caused by focusEvents +}; + +#endif // TDEPACMAN_H diff --git a/tdepacman/tdepacmanrc b/tdepacman/tdepacmanrc new file mode 100644 index 0000000..156c455 --- /dev/null +++ b/tdepacman/tdepacmanrc @@ -0,0 +1,70 @@ +FocusInContinue=true +FocusOutPause=true +HideMouseCursor=false +LevelPixmapName=fruit.xpm +Mode=0 +ModeCount=2 +Scheme=0 +SchemeCount=5 +downKey=Down +leftKey=Left +rightKey=Right +upKey=Up + +[Mode 0] +Description=&Pacman + +[Mode 1] +Description=&Ms.Pacman +DyingAnimationMS=150 +EnergizerPixmapName=switch.xpm,,,switch02.xpm,,,switch03.xpm,,,,switch.xpm,,,,,,,,,,,,switch03.xpm,,,,switch.xpm +ExtraLifeScore=-10000,-30000,-50000,30000 +FruitScore=100,200,500,700,1000,2000,5000 +FruitScorePixmapName=fruitscore.xpm +LevelPosition=0,1,2,3,4,5,6 +Levels=29 +MapDirectory=mspacman +MapName=map01,,,map02,,,map03,,,,map04,,,,map03,,,,map04,,,,map03,,,,map04 +PointPixmapName=point.xpm,,,point02.xpm,,,point03.xpm,,,,point.xpm,,,,,,,,,,,,point03.xpm,,,,point.xpm +PrisonPixmapName=prison.xpm,,,prison02.xpm,,,prison03.xpm,,,,prison04.xpm,,,,prison05.xpm,,,,prison06.xpm,,,,prison03.xpm,,,,prison04.xpm +WallPixmapName=wall.xpm,,,wall02.xpm,,,wall03.xpm,,,,wall04.xpm,,,,wall05.xpm,,,,wall06.xpm,,,,wall03.xpm,,,,wall04.xpm + +[Scheme 0] +Description=&MIDWAY MFG.CO. +Description[de]=&MIDWAY MFG.CO. +Font=font-smooth.pbm +Mode=0 +PixmapDirectory= + +[Scheme 1] +Description=MIDWAY MFG.CO. (&tiny) +Description[de]=MIDWAY MFG.CO. (&klein) +Font=font-small.pbm +Mode=0 +PixmapDirectory=tiny + +[Scheme 2] +Description=K&Zacman (incomplete) +Description[de]=K&Zacman (unvollständig) +Font=font-smooth.pbm +FruitPixmapName=../fruit.xpm +LevelPixmapName=../fruit.xpm +PixmapDirectory=zacman +PrisonPixmapName=../prison.xpm + +[Scheme 3] +Description=&MIDWAY MFG.CO. +EyesPixmapName=../eyes.xpm +Font=font-smooth.pbm +Mode=1 +MonsterPixmapName=../monster.xpm +PixmapDirectory=mspacman + +[Scheme 4] +Description=MIDWAY MFG.CO. (&tiny) +Description[de]=MIDWAY MFG.CO. (&klein) +EyesPixmapName=../tiny/eyes.xpm +Font=font-small.pbm +Mode=1 +MonsterPixmapName=../tiny/monster.xpm +PixmapDirectory=mspacman-tiny diff --git a/tdepacman/tdepacmanui.rc b/tdepacman/tdepacmanui.rc new file mode 100644 index 0000000..9228ab9 --- /dev/null +++ b/tdepacman/tdepacmanui.rc @@ -0,0 +1,18 @@ + + + + &Game + + &Settings + + + + + + + +Main Toolbar + + + + diff --git a/tdepacman/tdepacmanview.cpp b/tdepacman/tdepacmanview.cpp new file mode 100644 index 0000000..1a9d3e4 --- /dev/null +++ b/tdepacman/tdepacmanview.cpp @@ -0,0 +1,163 @@ +/*************************************************************************** + tdepacmanview.cpp - description + ------------------- + begin : Sam Jan 19 13:37:57 CET 2002 + copyright : (C) 1998-2003 by Jörg Thönnissen + email : joe@dsite.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// include files for TQt +#include + +// include files for TDE +#include +#include +#include + +// application specific includes +#include "tdepacmanview.h" +#include "bitfont.h" +#include "score.h" +#include "referee.h" +#include "status.h" + +TDEpacmanView::TDEpacmanView( TQWidget *parent, const char *name) : TQWidget( parent, name ) +{ + bitfont = NULL; + fontName = ""; + + scheme = mode = -1; + confScheme(); + + score = new Score(this, name, scheme, mode, bitfont); + referee = new Referee( this, name, scheme, mode, bitfont); + status = new Status(this, name, scheme, mode); + + setFixedSize(referee->width(), bitfont->height()*3 + referee->height() + status->height()); +} + +TDEpacmanView::~TDEpacmanView() +{ +} + +void TDEpacmanView::confMisc(bool defGroup) +{ + TDEStandardDirs *dirs = TDEGlobal::dirs(); + TQString findPath; + + if (defGroup || kapp->config()->hasKey("Font")) { + fontName = kapp->config()->readEntry("Font"); + + if (fontName.left(1) != "/" && fontName.left(1) != "~") + fontName.insert(0, "fonts/"); + if (fontName.right(1) == "/") + fontName.append("font.xbm"); + + findPath = dirs->findResource("appdata", fontName); + if (!findPath.isEmpty()) + fontName = findPath; + + bitfontFirstChar = kapp->config()->readNumEntry("FontFirstChar", 0x0e); + bitfontLastChar = kapp->config()->readNumEntry("FontLastChar", 0x5f); + } +} + +void TDEpacmanView::confScheme() +{ + TQString lastFontName = fontName; + TQString oldgroup = kapp->config()->group(); + TQString newgroup; + + // if not set, read mode and scheme from the configfile + if (mode == -1 && scheme == -1) { + scheme = kapp->config()->readNumEntry("Scheme", -1); + mode = kapp->config()->readNumEntry("Mode", -1); + + // if mode is not set in the defGroup-group, lookup the scheme group + if (scheme != -1 || mode == -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + mode = kapp->config()->readNumEntry("Mode", -1); + kapp->config()->setGroup(oldgroup); + } + } + + confMisc(); + + if (mode != -1) { + newgroup.sprintf("Mode %d", mode); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + } + + if (scheme != -1) { + newgroup.sprintf("Scheme %d", scheme); + kapp->config()->setGroup(newgroup); + + confMisc(FALSE); + } + + if (lastFontName != fontName) { + + if (bitfont != 0) + delete bitfont; + + bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar); + if (bitfont->width() == 0 || bitfont->height() == 0) { + TQString msg = i18n("The bitfont could not be contructed.\n\n" + "The file '@FONTNAME@' does not exist,\n" + "or is of an unknown format."); + msg.replace(TQRegExp("@FONTNAME@"), fontName); + // TQMessageBox::critical(this, i18n("Initialization Error"), msg); + printf("%s\n", msg.local8Bit().data()); + } + } + + kapp->config()->setGroup(oldgroup); +} + +void TDEpacmanView::setScheme(int Scheme, int Mode) +{ + mode = Mode; + scheme = Scheme; + + confScheme(); + + score->setScheme(Scheme, Mode, bitfont); + referee->setScheme(Scheme, Mode, bitfont); + status->setScheme(Scheme, Mode); + + setFixedSize(referee->width(), + bitfont->height()*3 + referee->height() + status->height()); + updateGeometry(); + + score->repaint(FALSE); + referee->repaint(FALSE); + status->repaint(FALSE); +} + +void TDEpacmanView::resizeEvent( TQResizeEvent * ) +{ + referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); + referee->setBackgroundColor(BLACK); + + status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), + status->height()); + status->setBackgroundColor(BLACK); + + score->setGeometry(0, 0, referee->width(), bitfont->height()*3+referee->height()+status->height()); + score->setBackgroundColor(BLACK); +} + +#include "tdepacmanview.moc" diff --git a/tdepacman/tdepacmanview.h b/tdepacman/tdepacmanview.h new file mode 100644 index 0000000..a7792df --- /dev/null +++ b/tdepacman/tdepacmanview.h @@ -0,0 +1,68 @@ +/*************************************************************************** + tdepacmanview.h - description + ------------------- + begin : Sam Jan 19 13:37:57 CET 2002 + copyright : (C) 1998-2003 by Jörg Thönnissen + email : joe@dsite.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TDEPACMANVIEW_H +#define TDEPACMANVIEW_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +//include files for TQt +#include +#include + +// application specific includes +#include "score.h" +#include "referee.h" +#include "status.h" +#include "painter.h" + +/** The TDEpacmanView class provides the view widget for the TDEpacmanApp instance. + * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. + */ +class TDEpacmanView : public TQWidget +{ + Q_OBJECT +public: + /** Constructor for the main view */ + TDEpacmanView ( TQWidget *parent = 0, const char *name = 0); + /** Destructor for the main view */ + virtual ~TDEpacmanView(); + + void setScheme(int scheme=-1, int mode=-1); + Score *score; + Referee *referee; + Status *status; + +protected: + void confScheme(); + void confMisc(bool defGroup=TRUE); + void resizeEvent( TQResizeEvent * ); + +private: + Bitfont *bitfont; + uchar bitfontFirstChar; + uchar bitfontLastChar; + + TQString fontName; + + int scheme; + int mode; +}; + +#endif // TDEPACMANVIEW_H diff --git a/translations/desktop_files/kpacman.desktop/de.po b/translations/desktop_files/kpacman.desktop/de.po deleted file mode 100644 index 674837f..0000000 --- a/translations/desktop_files/kpacman.desktop/de.po +++ /dev/null @@ -1,37 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# This file is put in the public domain. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-01 12:40+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Name -#: kpacman.desktop:2 -msgid "Kpacman" -msgstr "Kpacman" - -#. GenericName -#: kpacman.desktop:4 -msgid "Arcade Game" -msgstr "" - -#. Comment -#: kpacman.desktop:6 -msgid "A simple clone of the classic arcade game Pac-Man" -msgstr "" - -#. Keywords -#: kpacman.desktop:8 -msgid "arcade;pacman;dots;ghosts;level;" -msgstr "" diff --git a/translations/desktop_files/kpacman.desktop/fr.po b/translations/desktop_files/kpacman.desktop/fr.po deleted file mode 100644 index 97b500e..0000000 --- a/translations/desktop_files/kpacman.desktop/fr.po +++ /dev/null @@ -1,37 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# This file is put in the public domain. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-01 12:40+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Name -#: kpacman.desktop:2 -msgid "Kpacman" -msgstr "Kpacman" - -#. GenericName -#: kpacman.desktop:4 -msgid "Arcade Game" -msgstr "Jeux d'arcade" - -#. Comment -#: kpacman.desktop:6 -msgid "A simple clone of the classic arcade game Pac-Man" -msgstr "" - -#. Keywords -#: kpacman.desktop:8 -msgid "arcade;pacman;dots;ghosts;level;" -msgstr "" diff --git a/translations/desktop_files/kpacman.desktop/kpacman.desktop.pot b/translations/desktop_files/kpacman.desktop/kpacman.desktop.pot deleted file mode 100644 index a1b62be..0000000 --- a/translations/desktop_files/kpacman.desktop/kpacman.desktop.pot +++ /dev/null @@ -1,37 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# This file is put in the public domain. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-01 12:40+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Name -#: kpacman.desktop:2 -msgid "Kpacman" -msgstr "" - -#. GenericName -#: kpacman.desktop:4 -msgid "Arcade Game" -msgstr "" - -#. Comment -#: kpacman.desktop:6 -msgid "A simple clone of the classic arcade game Pac-Man" -msgstr "" - -#. Keywords -#: kpacman.desktop:8 -msgid "arcade;pacman;dots;ghosts;level;" -msgstr "" diff --git a/translations/desktop_files/tdepacman.desktop/de.po b/translations/desktop_files/tdepacman.desktop/de.po new file mode 100644 index 0000000..e3ef382 --- /dev/null +++ b/translations/desktop_files/tdepacman.desktop/de.po @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-01 12:40+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Name +#: tdepacman.desktop:2 +msgid "TDEpacman" +msgstr "TDEpacman" + +#. GenericName +#: tdepacman.desktop:4 +msgid "Arcade Game" +msgstr "" + +#. Comment +#: tdepacman.desktop:6 +msgid "A simple clone of the classic arcade game Pac-Man" +msgstr "" + +#. Keywords +#: tdepacman.desktop:8 +msgid "arcade;pacman;dots;ghosts;level;" +msgstr "" diff --git a/translations/desktop_files/tdepacman.desktop/fr.po b/translations/desktop_files/tdepacman.desktop/fr.po new file mode 100644 index 0000000..b78c0eb --- /dev/null +++ b/translations/desktop_files/tdepacman.desktop/fr.po @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-01 12:40+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Name +#: tdepacman.desktop:2 +msgid "TDEpacman" +msgstr "TDEpacman" + +#. GenericName +#: tdepacman.desktop:4 +msgid "Arcade Game" +msgstr "Jeux d'arcade" + +#. Comment +#: tdepacman.desktop:6 +msgid "A simple clone of the classic arcade game Pac-Man" +msgstr "" + +#. Keywords +#: tdepacman.desktop:8 +msgid "arcade;pacman;dots;ghosts;level;" +msgstr "" diff --git a/translations/desktop_files/tdepacman.desktop/tdepacman.desktop.pot b/translations/desktop_files/tdepacman.desktop/tdepacman.desktop.pot new file mode 100644 index 0000000..eceabc7 --- /dev/null +++ b/translations/desktop_files/tdepacman.desktop/tdepacman.desktop.pot @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-01 12:40+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Name +#: tdepacman.desktop:2 +msgid "TDEpacman" +msgstr "" + +#. GenericName +#: tdepacman.desktop:4 +msgid "Arcade Game" +msgstr "" + +#. Comment +#: tdepacman.desktop:6 +msgid "A simple clone of the classic arcade game Pac-Man" +msgstr "" + +#. Keywords +#: tdepacman.desktop:8 +msgid "arcade;pacman;dots;ghosts;level;" +msgstr "" diff --git a/translations/messages/de.po b/translations/messages/de.po index c40b111..47bcba9 100644 --- a/translations/messages/de.po +++ b/translations/messages/de.po @@ -20,7 +20,7 @@ msgstr "" "From: Joerg Thoennissen \n" "Xgettext-Options: -C -ki18n\n" "Files: bitfont.cpp pacman.cpp monster.cpp fruit.cpp board.cpp painter.cpp " -"referee.cpp status.cpp score.cpp keys.cpp kpacman.cpp kpacmanwidget.cpp main." +"referee.cpp status.cpp score.cpp keys.cpp tdepacman.cpp tdepacmanwidget.cpp main." "cpp\n" "X-Generator: KBabel 1.0.1\n" @@ -64,49 +64,49 @@ msgstr "Tastaturbelegung ändern" msgid "Undefined key" msgstr "Undefinierte Taste" -#: kpacman.cpp:78 +#: tdepacman.cpp:78 msgid "Show Mouse&cursor" msgstr "Maus&cursor anzeigen" -#: kpacman.cpp:81 +#: tdepacman.cpp:81 msgid "&Select graphic scheme" msgstr "Grafik&schema auswählen" -#: kpacman.cpp:84 +#: tdepacman.cpp:84 msgid "Pause in &Background" msgstr "&Anhalten im Hintergrund" -#: kpacman.cpp:87 +#: tdepacman.cpp:87 msgid "Continue in &Foreground" msgstr "&Fortsetzen im Vordergrund" -#: kpacman.cpp:91 +#: tdepacman.cpp:91 msgid "Enables/disables the menubar" msgstr "Menüzeile ein/ausschalten" -#: kpacman.cpp:92 +#: tdepacman.cpp:92 msgid "Enables/disables the toolbar" msgstr "Werkzeugleiste ein/ausschalten" -#: kpacman.cpp:93 +#: tdepacman.cpp:93 msgid "Enables/disables the statusbar" msgstr "Statuszeile ein/ausschalten" -#: kpacman.cpp:94 +#: tdepacman.cpp:94 msgid "Enable/disables the mousecursor" msgstr "Mauszeiger ein/ausschalten" -#: kpacman.cpp:106 kpacman.cpp:348 kpacman.cpp:363 kpacman.cpp:378 -#: kpacman.cpp:392 kpacman.cpp:420 kpacman.cpp:430 kpacman.cpp:440 -#: kpacman.cpp:455 kpacman.cpp:465 +#: tdepacman.cpp:106 tdepacman.cpp:348 tdepacman.cpp:363 tdepacman.cpp:378 +#: tdepacman.cpp:392 tdepacman.cpp:420 tdepacman.cpp:430 tdepacman.cpp:440 +#: tdepacman.cpp:455 tdepacman.cpp:465 msgid "Ready." msgstr "Fertig." -#: kpacman.cpp:206 +#: tdepacman.cpp:206 msgid "Configuration Error" msgstr "Konfigurationsfehler" -#: kpacman.cpp:207 +#: tdepacman.cpp:207 msgid "" "There are no schemes defined,\n" "or no scheme is selected." @@ -114,47 +114,47 @@ msgstr "" "Es sind keine Schemen definiert,\n" "oder kein Schema ausgewählt." -#: kpacman.cpp:331 +#: tdepacman.cpp:331 msgid "Exiting..." msgstr "Beenden..." -#: kpacman.cpp:338 +#: tdepacman.cpp:338 msgid "Toggling menubar..." msgstr "Menüzeile umschalten..." -#: kpacman.cpp:353 +#: tdepacman.cpp:353 msgid "Toggling toolbar..." msgstr "Werkzeugleiste umschalten..." -#: kpacman.cpp:368 +#: tdepacman.cpp:368 msgid "Toggle the statusbar..." msgstr "Statuszeile umschalten..." -#: kpacman.cpp:383 +#: tdepacman.cpp:383 msgid "Toggle the mousecursor..." msgstr "Mauszeiger umschalten..." -#: kpacman.cpp:397 +#: tdepacman.cpp:397 msgid "Graphic scheme selected..." msgstr "Grafikschema ausgewählt..." -#: kpacman.cpp:425 +#: tdepacman.cpp:425 msgid "Toggle focusOutPause..." msgstr "Pause im Hintergrund umschalten..." -#: kpacman.cpp:435 +#: tdepacman.cpp:435 msgid "Toggle focusInContinue..." msgstr "Fortsetzen im Vordergrund umschalten..." -#: kpacman.cpp:445 +#: tdepacman.cpp:445 msgid "Configure key bindings..." msgstr "Tastaturbelegung ändern..." -#: kpacman.cpp:460 +#: tdepacman.cpp:460 msgid "Game finished..." msgstr "Spiel beendet..." -#: kpacmanview.cpp:118 +#: tdepacmanview.cpp:118 msgid "" "The bitfont could not be contructed.\n" "\n" @@ -168,7 +168,7 @@ msgstr "" #: main.cpp:25 msgid "" -"A pacman game for the KDE Desktop\n" +"A pacman game for the TDE Desktop\n" "\n" "The program based on the source of ksnake\n" "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -179,7 +179,7 @@ msgid "" "the last 14 years of her friendship\n" "and Christine Nickel for the 'K' in my life." msgstr "" -"Ein Pacman Spiel für den KDE Desktop\n" +"Ein Pacman Spiel für den TDE Desktop\n" "\n" "Das Programm basiert auf dem Quellcode von ksnake\n" "von Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -192,7 +192,7 @@ msgstr "" "Leben danken." #: main.cpp:43 -msgid "Kpacman" +msgid "TDEpacman" msgstr "" #: painter.cpp:68 status.cpp:41 @@ -315,7 +315,7 @@ msgid "" "on that file or ask your systemadministator for that favor.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" "Sie sind gerade dabei die highscore-Datei\n" "'%1'\n" @@ -327,7 +327,7 @@ msgstr "" "um diesen Gefallen.\n" "\n" "Um ein anderes Verzeichnis oder einen Dateinamen für die highscores zu\n" -"benutzen, geben Sie diese in der Konfigurationsdatei (kpacmanrc:" +"benutzen, geben Sie diese in der Konfigurationsdatei (tdepacmanrc:" "highscoreFilePath)\n" "an." @@ -341,7 +341,7 @@ msgid "" "by setting the appropriate rights (a+w) on it.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" "Sie benutzen eine private highscore-Datei, das liegt meistens an fehlenden\n" "Schreibrechten auf die systemweite Datei\n" @@ -351,7 +351,7 @@ msgstr "" "indem er Ihnen die erforderlichen Rechte (a+w) an Dieser erteilt.\n" "\n" "Um ein anderes Verzeichnis oder einen Dateinamen für die highscores zu\n" -"benutzen, geben Sie diese in der Konfigurationsdatei (kpacmanrc:" +"benutzen, geben Sie diese in der Konfigurationsdatei (tdepacmanrc:" "highscoreFilePath)\n" "an." diff --git a/translations/messages/es.po b/translations/messages/es.po index bbf42a8..8d17f8b 100644 --- a/translations/messages/es.po +++ b/translations/messages/es.po @@ -1,4 +1,4 @@ -# Translation of Kpacman to Spanish +# Translation of TDEpacman to Spanish # Copyright (C) 2003 Quique # Quique , 2003 # @@ -55,52 +55,52 @@ msgstr "Cambiar las teclas de dirección" msgid "Undefined key" msgstr "Tecla sin definir" -#: kpacman.cpp:78 +#: tdepacman.cpp:78 #, fuzzy msgid "Show Mouse&cursor" msgstr "&Ocultar puntero del ratón" -#: kpacman.cpp:81 +#: tdepacman.cpp:81 msgid "&Select graphic scheme" msgstr "&Seleccionar el esquema gráfico" -#: kpacman.cpp:84 +#: tdepacman.cpp:84 #, fuzzy msgid "Pause in &Background" msgstr "&Pausar a segundo plano" -#: kpacman.cpp:87 +#: tdepacman.cpp:87 #, fuzzy msgid "Continue in &Foreground" msgstr "&Continuar en primer plano" -#: kpacman.cpp:91 +#: tdepacman.cpp:91 msgid "Enables/disables the menubar" msgstr "" -#: kpacman.cpp:92 +#: tdepacman.cpp:92 msgid "Enables/disables the toolbar" msgstr "" -#: kpacman.cpp:93 +#: tdepacman.cpp:93 msgid "Enables/disables the statusbar" msgstr "" -#: kpacman.cpp:94 +#: tdepacman.cpp:94 msgid "Enable/disables the mousecursor" msgstr "" -#: kpacman.cpp:106 kpacman.cpp:348 kpacman.cpp:363 kpacman.cpp:378 -#: kpacman.cpp:392 kpacman.cpp:420 kpacman.cpp:430 kpacman.cpp:440 -#: kpacman.cpp:455 kpacman.cpp:465 +#: tdepacman.cpp:106 tdepacman.cpp:348 tdepacman.cpp:363 tdepacman.cpp:378 +#: tdepacman.cpp:392 tdepacman.cpp:420 tdepacman.cpp:430 tdepacman.cpp:440 +#: tdepacman.cpp:455 tdepacman.cpp:465 msgid "Ready." msgstr "" -#: kpacman.cpp:206 +#: tdepacman.cpp:206 msgid "Configuration Error" msgstr "Error de configuración" -#: kpacman.cpp:207 +#: tdepacman.cpp:207 msgid "" "There are no schemes defined,\n" "or no scheme is selected." @@ -108,48 +108,48 @@ msgstr "" "No hay esquemas definidos,\n" "o no se ha seleccionado ninguno." -#: kpacman.cpp:331 +#: tdepacman.cpp:331 msgid "Exiting..." msgstr "" -#: kpacman.cpp:338 +#: tdepacman.cpp:338 msgid "Toggling menubar..." msgstr "" -#: kpacman.cpp:353 +#: tdepacman.cpp:353 msgid "Toggling toolbar..." msgstr "" -#: kpacman.cpp:368 +#: tdepacman.cpp:368 msgid "Toggle the statusbar..." msgstr "" -#: kpacman.cpp:383 +#: tdepacman.cpp:383 msgid "Toggle the mousecursor..." msgstr "" -#: kpacman.cpp:397 +#: tdepacman.cpp:397 msgid "Graphic scheme selected..." msgstr "" -#: kpacman.cpp:425 +#: tdepacman.cpp:425 msgid "Toggle focusOutPause..." msgstr "" -#: kpacman.cpp:435 +#: tdepacman.cpp:435 msgid "Toggle focusInContinue..." msgstr "" -#: kpacman.cpp:445 +#: tdepacman.cpp:445 #, fuzzy msgid "Configure key bindings..." msgstr "Cambiar &teclas..." -#: kpacman.cpp:460 +#: tdepacman.cpp:460 msgid "Game finished..." msgstr "" -#: kpacmanview.cpp:118 +#: tdepacmanview.cpp:118 msgid "" "The bitfont could not be contructed.\n" "\n" @@ -164,7 +164,7 @@ msgstr "" #: main.cpp:25 #, fuzzy msgid "" -"A pacman game for the KDE Desktop\n" +"A pacman game for the TDE Desktop\n" "\n" "The program based on the source of ksnake\n" "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -179,7 +179,7 @@ msgstr "" "\n" "Joerg Thoennissen (joe@dsite.de)\n" "\n" -"Juego de pacman para el entorno de escritorio KDE\n" +"Juego de pacman para el entorno de escritorio TDE\n" "\n" "El programa está basado en el código fuente de ksnake\n" "de Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -190,8 +190,8 @@ msgstr "" "los últimos 10 años de amistad.\n" #: main.cpp:43 -msgid "Kpacman" -msgstr "Kpacman" +msgid "TDEpacman" +msgstr "TDEpacman" #: painter.cpp:68 status.cpp:41 msgid "" @@ -309,7 +309,7 @@ msgid "" "on that file or ask your systemadministator for that favor.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" "Va a crear un fichero de máximas puntuaciones\n" "'%1'\n" @@ -320,7 +320,7 @@ msgstr "" "a ese fichero, o pídaselo a su administrador de sistema.\n" "\n" "Para usar un directorio o nombre de fichero diferente, especifíquelo en el " -"fichero de configuración (kpacmanrc:highscoreFilePath)." +"fichero de configuración (tdepacmanrc:highscoreFilePath)." #: score.cpp:481 msgid "" @@ -332,7 +332,7 @@ msgid "" "by setting the appropriate rights (a+w) on it.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" "Está usando un fichero de máximas puntuaciones privado, debido " "principalmente de que no hay permisos de escritura para el fichero global\n" @@ -343,7 +343,7 @@ msgstr "" "asignándole los permisos adecuados (a+w).\n" "\n" "Para usar un directorio o nombre de fichero diferente, especifíquelos en el " -"fichero de configuración (kpacmanrc:highscoreFilePath)." +"fichero de configuración (tdepacmanrc:highscoreFilePath)." #: score.cpp:535 msgid "@YY@/@MM@/@DD@" diff --git a/translations/messages/kpacman.pot b/translations/messages/kpacman.pot deleted file mode 100644 index b9fc38f..0000000 --- a/translations/messages/kpacman.pot +++ /dev/null @@ -1,302 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-09-01 12:41+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Instead of a literal translation, add your name to the end of the list (separated by a comma). -#, ignore-inconsistent -msgid "" -"_: NAME OF TRANSLATORS\n" -"Your names" -msgstr "" - -#. Instead of a literal translation, add your email to the end of the list (separated by a comma). -#, ignore-inconsistent -msgid "" -"_: EMAIL OF TRANSLATORS\n" -"Your emails" -msgstr "" - -#: board.cpp:56 -msgid "" -"The levelmap could not be constructed.\n" -"\n" -"The file '@LEVELNAME@' does not exist,\n" -"or could not be opened for reading." -msgstr "" - -#: keys.cpp:22 -msgid "Ok" -msgstr "" - -#: keys.cpp:28 -msgid "Defaults" -msgstr "" - -#: keys.cpp:85 -msgid "Change Direction Keys" -msgstr "" - -#: keys.cpp:98 -msgid "Undefined key" -msgstr "" - -#: kpacman.cpp:78 -msgid "Show Mouse&cursor" -msgstr "" - -#: kpacman.cpp:81 -msgid "&Select graphic scheme" -msgstr "" - -#: kpacman.cpp:84 -msgid "Pause in &Background" -msgstr "" - -#: kpacman.cpp:87 -msgid "Continue in &Foreground" -msgstr "" - -#: kpacman.cpp:91 -msgid "Enables/disables the menubar" -msgstr "" - -#: kpacman.cpp:92 -msgid "Enables/disables the toolbar" -msgstr "" - -#: kpacman.cpp:93 -msgid "Enables/disables the statusbar" -msgstr "" - -#: kpacman.cpp:94 -msgid "Enable/disables the mousecursor" -msgstr "" - -#: kpacman.cpp:106 kpacman.cpp:348 kpacman.cpp:363 kpacman.cpp:378 -#: kpacman.cpp:392 kpacman.cpp:420 kpacman.cpp:430 kpacman.cpp:440 -#: kpacman.cpp:455 kpacman.cpp:465 -msgid "Ready." -msgstr "" - -#: kpacman.cpp:206 -msgid "Configuration Error" -msgstr "" - -#: kpacman.cpp:207 -msgid "" -"There are no schemes defined,\n" -"or no scheme is selected." -msgstr "" - -#: kpacman.cpp:331 -msgid "Exiting..." -msgstr "" - -#: kpacman.cpp:338 -msgid "Toggling menubar..." -msgstr "" - -#: kpacman.cpp:353 -msgid "Toggling toolbar..." -msgstr "" - -#: kpacman.cpp:368 -msgid "Toggle the statusbar..." -msgstr "" - -#: kpacman.cpp:383 -msgid "Toggle the mousecursor..." -msgstr "" - -#: kpacman.cpp:397 -msgid "Graphic scheme selected..." -msgstr "" - -#: kpacman.cpp:425 -msgid "Toggle focusOutPause..." -msgstr "" - -#: kpacman.cpp:435 -msgid "Toggle focusInContinue..." -msgstr "" - -#: kpacman.cpp:445 -msgid "Configure key bindings..." -msgstr "" - -#: kpacman.cpp:460 -msgid "Game finished..." -msgstr "" - -#: kpacmanview.cpp:118 -msgid "" -"The bitfont could not be contructed.\n" -"\n" -"The file '@FONTNAME@' does not exist,\n" -"or is of an unknown format." -msgstr "" - -#: main.cpp:25 -msgid "" -"A pacman game for the KDE Desktop\n" -"\n" -"The program based on the source of ksnake\n" -"by Michel Filippi (mfilippi@sade.rhein-main.de).\n" -"The design was strongly influenced by the pacman\n" -"(c) 1980 MIDWAY MFG.CO.\n" -"\n" -"I like to thank my girlfriend Elke Krueers for\n" -"the last 14 years of her friendship\n" -"and Christine Nickel for the 'K' in my life." -msgstr "" - -#: main.cpp:43 -msgid "Kpacman" -msgstr "" - -#: painter.cpp:68 status.cpp:41 -msgid "" -"The pixmap could not be contructed.\n" -"\n" -"The file '@PIXMAPNAME@' does not exist,\n" -"or is of an unknown format." -msgstr "" - -#: referee.cpp:88 referee.cpp:89 referee.cpp:1258 -msgid "GAME OVER" -msgstr "" - -#: referee.cpp:150 referee.cpp:151 referee.cpp:1060 referee.cpp:1078 -msgid "PLAYER ONE" -msgstr "" - -#: referee.cpp:154 referee.cpp:155 referee.cpp:1061 referee.cpp:1086 -#: referee.cpp:1091 -msgid "READY!" -msgstr "" - -#: referee.cpp:158 referee.cpp:159 referee.cpp:807 referee.cpp:810 -#: score.cpp:147 score.cpp:148 score.cpp:506 -msgid "PAUSED" -msgstr "" - -#: referee.cpp:875 -msgid "CHARACTER" -msgstr "" - -#: referee.cpp:876 -msgid "/" -msgstr "" - -#: referee.cpp:877 -msgid "NICKNAME" -msgstr "" - -#: referee.cpp:881 -msgid "-SHADOW" -msgstr "" - -#: referee.cpp:883 -msgid "\"BLINKY\"" -msgstr "" - -#: referee.cpp:887 -msgid "-SPEEDY" -msgstr "" - -#: referee.cpp:889 -msgid "\"PINKY\"" -msgstr "" - -#: referee.cpp:893 -msgid "-BASHFUL" -msgstr "" - -#: referee.cpp:895 -msgid "\"INKY\"" -msgstr "" - -#: referee.cpp:899 -msgid "-POKEY" -msgstr "" - -#: referee.cpp:901 -msgid "\"CLYDE\"" -msgstr "" - -#: score.cpp:67 score.cpp:72 score.cpp:167 -msgid " 1UP " -msgstr "" - -#: score.cpp:76 score.cpp:77 -msgid " HIGH SCORE " -msgstr "" - -#: score.cpp:81 score.cpp:86 score.cpp:170 -msgid " 2UP " -msgstr "" - -#: score.cpp:105 score.cpp:106 -msgid " CONGRATULATIONS " -msgstr "" - -#: score.cpp:109 score.cpp:110 -msgid " YOU HAVE ARCHIEVED " -msgstr "" - -#: score.cpp:113 score.cpp:114 -msgid " A SCORE IN THE TOP 10. " -msgstr "" - -#: score.cpp:117 score.cpp:118 -msgid " " -msgstr "" - -#: score.cpp:123 score.cpp:124 -msgid "RNK SCORE NAME DATE" -msgstr "" - -#: score.cpp:468 -msgid "" -"You're going to create the highscore-file\n" -"'%1'\n" -"for your maschine, that should be used systemwide.\n" -"\n" -"To grant access to the other users, set the appropriate rights (a+w)\n" -"on that file or ask your systemadministator for that favor.\n" -"\n" -"To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." -msgstr "" - -#: score.cpp:481 -msgid "" -"You're using a private highscore-file, that's mostly because of\n" -"missing write-access to the systemwide file\n" -"'%1' .\n" -"\n" -"Ask your systemadministrator for granting you access to that file,\n" -"by setting the appropriate rights (a+w) on it.\n" -"\n" -"To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." -msgstr "" - -#: score.cpp:535 -msgid "@YY@/@MM@/@DD@" -msgstr "" - -#: status.cpp:45 -msgid "Initialization Error" -msgstr "" diff --git a/translations/messages/pt.po b/translations/messages/pt.po index ff2da5a..15d64c9 100644 --- a/translations/messages/pt.po +++ b/translations/messages/pt.po @@ -5,7 +5,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Kpacman 0.2.6\n" +"Project-Id-Version: TDEpacman 0.2.6\n" "POT-Creation-Date: 2020-09-01 12:41+0200\n" "PO-Revision-Date: 2000-05-01 22:39-0100\n" "Last-Translator: Srgio Fernandes \n" @@ -55,49 +55,49 @@ msgstr "Mudar Teclas de Direco" msgid "Undefined key" msgstr "" -#: kpacman.cpp:78 +#: tdepacman.cpp:78 msgid "Show Mouse&cursor" msgstr "" -#: kpacman.cpp:81 +#: tdepacman.cpp:81 msgid "&Select graphic scheme" msgstr "&Seleccione o esquema grfico" -#: kpacman.cpp:84 +#: tdepacman.cpp:84 msgid "Pause in &Background" msgstr "" -#: kpacman.cpp:87 +#: tdepacman.cpp:87 msgid "Continue in &Foreground" msgstr "" -#: kpacman.cpp:91 +#: tdepacman.cpp:91 msgid "Enables/disables the menubar" msgstr "" -#: kpacman.cpp:92 +#: tdepacman.cpp:92 msgid "Enables/disables the toolbar" msgstr "" -#: kpacman.cpp:93 +#: tdepacman.cpp:93 msgid "Enables/disables the statusbar" msgstr "" -#: kpacman.cpp:94 +#: tdepacman.cpp:94 msgid "Enable/disables the mousecursor" msgstr "" -#: kpacman.cpp:106 kpacman.cpp:348 kpacman.cpp:363 kpacman.cpp:378 -#: kpacman.cpp:392 kpacman.cpp:420 kpacman.cpp:430 kpacman.cpp:440 -#: kpacman.cpp:455 kpacman.cpp:465 +#: tdepacman.cpp:106 tdepacman.cpp:348 tdepacman.cpp:363 tdepacman.cpp:378 +#: tdepacman.cpp:392 tdepacman.cpp:420 tdepacman.cpp:430 tdepacman.cpp:440 +#: tdepacman.cpp:455 tdepacman.cpp:465 msgid "Ready." msgstr "" -#: kpacman.cpp:206 +#: tdepacman.cpp:206 msgid "Configuration Error" msgstr "Erro de Configurao" -#: kpacman.cpp:207 +#: tdepacman.cpp:207 msgid "" "There are no schemes defined,\n" "or no scheme is selected." @@ -105,48 +105,48 @@ msgstr "" "No h esquemas definidos,ou no\n" "h esquemas seleccionados." -#: kpacman.cpp:331 +#: tdepacman.cpp:331 msgid "Exiting..." msgstr "" -#: kpacman.cpp:338 +#: tdepacman.cpp:338 msgid "Toggling menubar..." msgstr "" -#: kpacman.cpp:353 +#: tdepacman.cpp:353 msgid "Toggling toolbar..." msgstr "" -#: kpacman.cpp:368 +#: tdepacman.cpp:368 msgid "Toggle the statusbar..." msgstr "" -#: kpacman.cpp:383 +#: tdepacman.cpp:383 msgid "Toggle the mousecursor..." msgstr "" -#: kpacman.cpp:397 +#: tdepacman.cpp:397 msgid "Graphic scheme selected..." msgstr "" -#: kpacman.cpp:425 +#: tdepacman.cpp:425 msgid "Toggle focusOutPause..." msgstr "" -#: kpacman.cpp:435 +#: tdepacman.cpp:435 msgid "Toggle focusInContinue..." msgstr "" -#: kpacman.cpp:445 +#: tdepacman.cpp:445 #, fuzzy msgid "Configure key bindings..." msgstr "Mudar &teclas..." -#: kpacman.cpp:460 +#: tdepacman.cpp:460 msgid "Game finished..." msgstr "" -#: kpacmanview.cpp:118 +#: tdepacmanview.cpp:118 msgid "" "The bitfont could not be contructed.\n" "\n" @@ -161,7 +161,7 @@ msgstr "" #: main.cpp:25 #, fuzzy msgid "" -"A pacman game for the KDE Desktop\n" +"A pacman game for the TDE Desktop\n" "\n" "The program based on the source of ksnake\n" "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -176,7 +176,7 @@ msgstr "" "\n" "Joerg Thoennissen (joe@dsite.de)\n" "\n" -"Jogo de pacman para o ambiente de trabalho KDE\n" +"Jogo de pacman para o ambiente de trabalho TDE\n" "\n" "O programa foi baseado na fonte do ksnake\n" "de Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -187,7 +187,7 @@ msgstr "" "ltimos 10 anos de amizade.\n" #: main.cpp:43 -msgid "Kpacman" +msgid "TDEpacman" msgstr "" #: painter.cpp:68 status.cpp:41 @@ -306,7 +306,7 @@ msgid "" "on that file or ask your systemadministator for that favor.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" #: score.cpp:481 @@ -319,7 +319,7 @@ msgid "" "by setting the appropriate rights (a+w) on it.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" #: score.cpp:535 diff --git a/translations/messages/sv.po b/translations/messages/sv.po index 8f13e6a..4c170c9 100644 --- a/translations/messages/sv.po +++ b/translations/messages/sv.po @@ -54,96 +54,96 @@ msgstr "Byt Tangenter" msgid "Undefined key" msgstr "Ingen Tangent" -#: kpacman.cpp:78 +#: tdepacman.cpp:78 msgid "Show Mouse&cursor" msgstr "" -#: kpacman.cpp:81 +#: tdepacman.cpp:81 msgid "&Select graphic scheme" msgstr "&Vlj grafikschema" -#: kpacman.cpp:84 +#: tdepacman.cpp:84 msgid "Pause in &Background" msgstr "" -#: kpacman.cpp:87 +#: tdepacman.cpp:87 msgid "Continue in &Foreground" msgstr "" -#: kpacman.cpp:91 +#: tdepacman.cpp:91 msgid "Enables/disables the menubar" msgstr "" -#: kpacman.cpp:92 +#: tdepacman.cpp:92 msgid "Enables/disables the toolbar" msgstr "" -#: kpacman.cpp:93 +#: tdepacman.cpp:93 msgid "Enables/disables the statusbar" msgstr "" -#: kpacman.cpp:94 +#: tdepacman.cpp:94 msgid "Enable/disables the mousecursor" msgstr "" -#: kpacman.cpp:106 kpacman.cpp:348 kpacman.cpp:363 kpacman.cpp:378 -#: kpacman.cpp:392 kpacman.cpp:420 kpacman.cpp:430 kpacman.cpp:440 -#: kpacman.cpp:455 kpacman.cpp:465 +#: tdepacman.cpp:106 tdepacman.cpp:348 tdepacman.cpp:363 tdepacman.cpp:378 +#: tdepacman.cpp:392 tdepacman.cpp:420 tdepacman.cpp:430 tdepacman.cpp:440 +#: tdepacman.cpp:455 tdepacman.cpp:465 msgid "Ready." msgstr "" -#: kpacman.cpp:206 +#: tdepacman.cpp:206 msgid "Configuration Error" msgstr "Konfigurationsproblem" -#: kpacman.cpp:207 +#: tdepacman.cpp:207 msgid "" "There are no schemes defined,\n" "or no scheme is selected." msgstr "" -#: kpacman.cpp:331 +#: tdepacman.cpp:331 msgid "Exiting..." msgstr "" -#: kpacman.cpp:338 +#: tdepacman.cpp:338 msgid "Toggling menubar..." msgstr "" -#: kpacman.cpp:353 +#: tdepacman.cpp:353 msgid "Toggling toolbar..." msgstr "" -#: kpacman.cpp:368 +#: tdepacman.cpp:368 msgid "Toggle the statusbar..." msgstr "" -#: kpacman.cpp:383 +#: tdepacman.cpp:383 msgid "Toggle the mousecursor..." msgstr "" -#: kpacman.cpp:397 +#: tdepacman.cpp:397 msgid "Graphic scheme selected..." msgstr "" -#: kpacman.cpp:425 +#: tdepacman.cpp:425 msgid "Toggle focusOutPause..." msgstr "" -#: kpacman.cpp:435 +#: tdepacman.cpp:435 msgid "Toggle focusInContinue..." msgstr "" -#: kpacman.cpp:445 +#: tdepacman.cpp:445 #, fuzzy msgid "Configure key bindings..." msgstr "&Byt tangenter..." -#: kpacman.cpp:460 +#: tdepacman.cpp:460 msgid "Game finished..." msgstr "" -#: kpacmanview.cpp:118 +#: tdepacmanview.cpp:118 msgid "" "The bitfont could not be contructed.\n" "\n" @@ -157,7 +157,7 @@ msgstr "" #: main.cpp:25 msgid "" -"A pacman game for the KDE Desktop\n" +"A pacman game for the TDE Desktop\n" "\n" "The program based on the source of ksnake\n" "by Michel Filippi (mfilippi@sade.rhein-main.de).\n" @@ -170,7 +170,7 @@ msgid "" msgstr "" #: main.cpp:43 -msgid "Kpacman" +msgid "TDEpacman" msgstr "" #: painter.cpp:68 status.cpp:41 @@ -289,7 +289,7 @@ msgid "" "on that file or ask your systemadministator for that favor.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" #: score.cpp:481 @@ -302,7 +302,7 @@ msgid "" "by setting the appropriate rights (a+w) on it.\n" "\n" "To use a different directory or filename for the highscores,specify them in " -"the configfile (kpacmanrc:highscoreFilePath)." +"the configfile (tdepacmanrc:highscoreFilePath)." msgstr "" #: score.cpp:535 diff --git a/translations/messages/tdepacman.pot b/translations/messages/tdepacman.pot new file mode 100644 index 0000000..144281b --- /dev/null +++ b/translations/messages/tdepacman.pot @@ -0,0 +1,302 @@ +# SOME DESCRIPTIVE TITLE. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2020-09-01 12:41+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Instead of a literal translation, add your name to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" + +#. Instead of a literal translation, add your email to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" + +#: board.cpp:56 +msgid "" +"The levelmap could not be constructed.\n" +"\n" +"The file '@LEVELNAME@' does not exist,\n" +"or could not be opened for reading." +msgstr "" + +#: keys.cpp:22 +msgid "Ok" +msgstr "" + +#: keys.cpp:28 +msgid "Defaults" +msgstr "" + +#: keys.cpp:85 +msgid "Change Direction Keys" +msgstr "" + +#: keys.cpp:98 +msgid "Undefined key" +msgstr "" + +#: tdepacman.cpp:78 +msgid "Show Mouse&cursor" +msgstr "" + +#: tdepacman.cpp:81 +msgid "&Select graphic scheme" +msgstr "" + +#: tdepacman.cpp:84 +msgid "Pause in &Background" +msgstr "" + +#: tdepacman.cpp:87 +msgid "Continue in &Foreground" +msgstr "" + +#: tdepacman.cpp:91 +msgid "Enables/disables the menubar" +msgstr "" + +#: tdepacman.cpp:92 +msgid "Enables/disables the toolbar" +msgstr "" + +#: tdepacman.cpp:93 +msgid "Enables/disables the statusbar" +msgstr "" + +#: tdepacman.cpp:94 +msgid "Enable/disables the mousecursor" +msgstr "" + +#: tdepacman.cpp:106 tdepacman.cpp:348 tdepacman.cpp:363 tdepacman.cpp:378 +#: tdepacman.cpp:392 tdepacman.cpp:420 tdepacman.cpp:430 tdepacman.cpp:440 +#: tdepacman.cpp:455 tdepacman.cpp:465 +msgid "Ready." +msgstr "" + +#: tdepacman.cpp:206 +msgid "Configuration Error" +msgstr "" + +#: tdepacman.cpp:207 +msgid "" +"There are no schemes defined,\n" +"or no scheme is selected." +msgstr "" + +#: tdepacman.cpp:331 +msgid "Exiting..." +msgstr "" + +#: tdepacman.cpp:338 +msgid "Toggling menubar..." +msgstr "" + +#: tdepacman.cpp:353 +msgid "Toggling toolbar..." +msgstr "" + +#: tdepacman.cpp:368 +msgid "Toggle the statusbar..." +msgstr "" + +#: tdepacman.cpp:383 +msgid "Toggle the mousecursor..." +msgstr "" + +#: tdepacman.cpp:397 +msgid "Graphic scheme selected..." +msgstr "" + +#: tdepacman.cpp:425 +msgid "Toggle focusOutPause..." +msgstr "" + +#: tdepacman.cpp:435 +msgid "Toggle focusInContinue..." +msgstr "" + +#: tdepacman.cpp:445 +msgid "Configure key bindings..." +msgstr "" + +#: tdepacman.cpp:460 +msgid "Game finished..." +msgstr "" + +#: tdepacmanview.cpp:118 +msgid "" +"The bitfont could not be contructed.\n" +"\n" +"The file '@FONTNAME@' does not exist,\n" +"or is of an unknown format." +msgstr "" + +#: main.cpp:25 +msgid "" +"A pacman game for the TDE Desktop\n" +"\n" +"The program based on the source of ksnake\n" +"by Michel Filippi (mfilippi@sade.rhein-main.de).\n" +"The design was strongly influenced by the pacman\n" +"(c) 1980 MIDWAY MFG.CO.\n" +"\n" +"I like to thank my girlfriend Elke Krueers for\n" +"the last 14 years of her friendship\n" +"and Christine Nickel for the 'K' in my life." +msgstr "" + +#: main.cpp:43 +msgid "TDEpacman" +msgstr "" + +#: painter.cpp:68 status.cpp:41 +msgid "" +"The pixmap could not be contructed.\n" +"\n" +"The file '@PIXMAPNAME@' does not exist,\n" +"or is of an unknown format." +msgstr "" + +#: referee.cpp:88 referee.cpp:89 referee.cpp:1258 +msgid "GAME OVER" +msgstr "" + +#: referee.cpp:150 referee.cpp:151 referee.cpp:1060 referee.cpp:1078 +msgid "PLAYER ONE" +msgstr "" + +#: referee.cpp:154 referee.cpp:155 referee.cpp:1061 referee.cpp:1086 +#: referee.cpp:1091 +msgid "READY!" +msgstr "" + +#: referee.cpp:158 referee.cpp:159 referee.cpp:807 referee.cpp:810 +#: score.cpp:147 score.cpp:148 score.cpp:506 +msgid "PAUSED" +msgstr "" + +#: referee.cpp:875 +msgid "CHARACTER" +msgstr "" + +#: referee.cpp:876 +msgid "/" +msgstr "" + +#: referee.cpp:877 +msgid "NICKNAME" +msgstr "" + +#: referee.cpp:881 +msgid "-SHADOW" +msgstr "" + +#: referee.cpp:883 +msgid "\"BLINKY\"" +msgstr "" + +#: referee.cpp:887 +msgid "-SPEEDY" +msgstr "" + +#: referee.cpp:889 +msgid "\"PINKY\"" +msgstr "" + +#: referee.cpp:893 +msgid "-BASHFUL" +msgstr "" + +#: referee.cpp:895 +msgid "\"INKY\"" +msgstr "" + +#: referee.cpp:899 +msgid "-POKEY" +msgstr "" + +#: referee.cpp:901 +msgid "\"CLYDE\"" +msgstr "" + +#: score.cpp:67 score.cpp:72 score.cpp:167 +msgid " 1UP " +msgstr "" + +#: score.cpp:76 score.cpp:77 +msgid " HIGH SCORE " +msgstr "" + +#: score.cpp:81 score.cpp:86 score.cpp:170 +msgid " 2UP " +msgstr "" + +#: score.cpp:105 score.cpp:106 +msgid " CONGRATULATIONS " +msgstr "" + +#: score.cpp:109 score.cpp:110 +msgid " YOU HAVE ARCHIEVED " +msgstr "" + +#: score.cpp:113 score.cpp:114 +msgid " A SCORE IN THE TOP 10. " +msgstr "" + +#: score.cpp:117 score.cpp:118 +msgid " " +msgstr "" + +#: score.cpp:123 score.cpp:124 +msgid "RNK SCORE NAME DATE" +msgstr "" + +#: score.cpp:468 +msgid "" +"You're going to create the highscore-file\n" +"'%1'\n" +"for your maschine, that should be used systemwide.\n" +"\n" +"To grant access to the other users, set the appropriate rights (a+w)\n" +"on that file or ask your systemadministator for that favor.\n" +"\n" +"To use a different directory or filename for the highscores,specify them in " +"the configfile (tdepacmanrc:highscoreFilePath)." +msgstr "" + +#: score.cpp:481 +msgid "" +"You're using a private highscore-file, that's mostly because of\n" +"missing write-access to the systemwide file\n" +"'%1' .\n" +"\n" +"Ask your systemadministrator for granting you access to that file,\n" +"by setting the appropriate rights (a+w) on it.\n" +"\n" +"To use a different directory or filename for the highscores,specify them in " +"the configfile (tdepacmanrc:highscoreFilePath)." +msgstr "" + +#: score.cpp:535 +msgid "@YY@/@MM@/@DD@" +msgstr "" + +#: status.cpp:45 +msgid "Initialization Error" +msgstr "" -- cgit v1.2.1