1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Merge remote-tracking branch 'origin/master' into wip/android

This commit is contained in:
krzys-h 2017-10-29 13:35:07 +01:00
commit 4fdaf201e7
73 changed files with 4822 additions and 474 deletions

View File

@ -4,6 +4,7 @@ cmake_minimum_required (VERSION 3.2)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD 11)
include (GNUInstallDirs)
include (${CMAKE_ROOT}/Modules/ExternalProject.cmake) include (${CMAKE_ROOT}/Modules/ExternalProject.cmake)
include_directories (${CMAKE_INSTALL_PREFIX}/include) include_directories (${CMAKE_INSTALL_PREFIX}/include)
@ -12,12 +13,16 @@ list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX}") # This is required w
project (planetblupi) project (planetblupi)
set (PB_VERSION_MAJOR 1) set (PB_VERSION_MAJOR 1)
set (PB_VERSION_MINOR 9) set (PB_VERSION_MINOR 11)
set (PB_VERSION_PATCH 1) set (PB_VERSION_PATCH 0)
set (PB_VERSION_EXTRA "") set (PB_VERSION_EXTRA "")
set (PB_PRODUCT_NAME "Planet Blupi") set (PB_PRODUCT_NAME "Planet Blupi")
set (PB_PACKAGE_NAME "planetblupi") set (PB_PACKAGE_NAME "planetblupi")
set (PB_DESCRIPTION "Planet Blupi - A delerious spell-binding game") set (PB_EXEC "planetblupi")
set (PB_ICON_REF "blupi")
set (PB_DESCRIPTION "Planet Blupi - A delirious spell-binding game")
option (PB_HTTP_VERSION_CHECK "Run a version check over HTTP (with CURL)" OFF)
set(CMAKE_CXX_FLAGS "-Wno-error=c++11-narrowing ${CMAKE_CXX_FLAGS}") # TODO: FIXME in fog.cxx set(CMAKE_CXX_FLAGS "-Wno-error=c++11-narrowing ${CMAKE_CXX_FLAGS}") # TODO: FIXME in fog.cxx
@ -37,6 +42,14 @@ if (APPIMAGE_APPRUN_PROGRAM AND APPIMAGE_ASSISTANT_PROGRAM)
set (USE_APPIMAGE ON) set (USE_APPIMAGE ON)
endif () endif ()
if (NOT USE_APPIMAGE)
configure_file (
"${PROJECT_SOURCE_DIR}/resources/linux/application.desktop.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}.desktop"
@ONLY
)
endif ()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -L${CMAKE_INSTALL_PREFIX}/lib") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -L${CMAKE_INSTALL_PREFIX}/lib")
endif () endif ()
@ -45,10 +58,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${STATIC_BUILD}")
set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
endif () endif ()
if (NOT "${STATIC_BUILD}")
set (CMAKE_EXE_LINKER_FLAGS "-lpthread")
endif ()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
endif () endif ()
@ -124,7 +133,10 @@ find_package (PkgConfig REQUIRED)
pkg_search_module (SDL2 REQUIRED sdl2) pkg_search_module (SDL2 REQUIRED sdl2)
pkg_search_module (SDL2_MIXER REQUIRED SDL2_mixer) pkg_search_module (SDL2_MIXER REQUIRED SDL2_mixer)
pkg_search_module (SDL2_IMAGE REQUIRED SDL2_image) pkg_search_module (SDL2_IMAGE REQUIRED SDL2_image)
pkg_search_module (CURL REQUIRED libcurl) if (${PB_HTTP_VERSION_CHECK})
pkg_search_module (CURL REQUIRED libcurl)
add_definitions (-DUSE_CURL)
endif ()
if ("${STATIC_BUILD}") if ("${STATIC_BUILD}")
pkg_search_module (PNG REQUIRED libpng) pkg_search_module (PNG REQUIRED libpng)
@ -140,7 +152,9 @@ if ("${STATIC_BUILD}")
pkg_search_module (PULSE REQUIRED libpulse) pkg_search_module (PULSE REQUIRED libpulse)
endif () endif ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURL_STATICLIB") if (${PB_HTTP_VERSION_CHECK})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURL_STATICLIB")
endif ()
endif () endif ()
########################### ###########################
@ -160,7 +174,6 @@ if ("${STATIC_BUILD}")
${SDL2_STATIC_LIBRARIES} ${SDL2_STATIC_LIBRARIES}
${SDL2_MIXER_STATIC_LIBRARIES} ${SDL2_MIXER_STATIC_LIBRARIES}
${SDL2_IMAGE_STATIC_LIBRARIES} ${SDL2_IMAGE_STATIC_LIBRARIES}
${CURL_STATIC_LIBRARIES}
${SDLKitchensink_STATIC_LIBRARIES} ${SDLKitchensink_STATIC_LIBRARIES}
${PNG_STATIC_LIBRARIES} ${PNG_STATIC_LIBRARIES}
${AVCODEC_STATIC_LIBRARIES} ${AVCODEC_STATIC_LIBRARIES}
@ -170,6 +183,12 @@ if ("${STATIC_BUILD}")
${SWRESAMPLE_STATIC_LIBRARIES} ${SWRESAMPLE_STATIC_LIBRARIES}
) )
if (${PB_HTTP_VERSION_CHECK})
list (APPEND planetblupi_DEPS
${CURL_STATIC_LIBRARIES}
)
endif ()
if (UNIX AND NOT APPLE AND NOT ANDROID) if (UNIX AND NOT APPLE AND NOT ANDROID)
list (APPEND planetblupi_DEPS list (APPEND planetblupi_DEPS
${ALSA_STATIC_LIBRARIES} ${ALSA_STATIC_LIBRARIES}
@ -184,7 +203,14 @@ else ()
${SDL2_IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES}
${CURL_LIBRARIES} ${CURL_LIBRARIES}
${SDLKitchensink_LIBRARIES} ${SDLKitchensink_LIBRARIES}
pthread
) )
if (${PB_HTTP_VERSION_CHECK})
list (APPEND planetblupi_DEPS
${CURL_LIBRARIES}
)
endif ()
endif () endif ()
target_link_libraries (planetblupi PUBLIC ${planetblupi_DEPS}) target_link_libraries (planetblupi PUBLIC ${planetblupi_DEPS})
@ -231,8 +257,10 @@ endforeach (file)
############## ##############
install (TARGETS planetblupi install (TARGETS planetblupi
RUNTIME DESTINATION bin # TODO: merge conflict
ARCHIVE DESTINATION lib #RUNTIME DESTINATION bin
#ARCHIVE DESTINATION lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
) )
install ( install (
@ -256,6 +284,13 @@ if (UNIX AND NOT APPLE)
install (DIRECTORY resources/icon/hicolor DESTINATION share/icons) install (DIRECTORY resources/icon/hicolor DESTINATION share/icons)
endif () endif ()
if (NOT USE_APPIMAGE)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}.desktop
DESTINATION share/applications
)
endif ()
# Copy libwinpthread-1.dll which seems not be linkable statically # Copy libwinpthread-1.dll which seems not be linkable statically
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND MINGW) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND MINGW)
execute_process (COMMAND cygpath.exe --windows /mingw64 OUTPUT_VARIABLE MINGW64_PATH) execute_process (COMMAND cygpath.exe --windows /mingw64 OUTPUT_VARIABLE MINGW64_PATH)
@ -283,7 +318,7 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND "${STATIC_BUILD}")
if (USE_APPIMAGE) if (USE_APPIMAGE)
include (LinuxAppImageBuild) include (LinuxAppImageBuild)
set (CMAKE_PACKAGED_OUTPUT_PREFIX ${CMAKE_INSTALL_PREFIX}) set (CMAKE_PACKAGED_OUTPUT_PREFIX ${CMAKE_INSTALL_PREFIX})
APPIMAGE_PACKAGE (planetblupi ${PB_PACKAGE_NAME} ${PB_PRODUCT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/resources/linux" "${CMAKE_BINARY_DIR}/share" "" "" "blupi") APPIMAGE_PACKAGE (planetblupi ${PB_PACKAGE_NAME} ${PB_PRODUCT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/resources/linux" "${CMAKE_BINARY_DIR}/share" "" "" ${PB_ICON_REF})
elseif (MINGW) elseif (MINGW)
set (INSTALLER_FILE_NAME "${PB_PACKAGE_NAME}-${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}") set (INSTALLER_FILE_NAME "${PB_PACKAGE_NAME}-${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}")
set (CPACK_PACKAGE_FILE_NAME "${INSTALLER_FILE_NAME}") set (CPACK_PACKAGE_FILE_NAME "${INSTALLER_FILE_NAME}")

View File

@ -8,10 +8,10 @@ to construct your own missions.
| Category | Description | | Category | Description |
| -------- | ----------- | | -------- | ----------- |
| OS | At least GNU/Linux 2.6.32, macOS 10.7 or Microsoft Windows Vista | | OS | At least GNU/Linux 2.6.32, macOS 10.9 or Microsoft Windows Vista |
| VIDEO | An 3D accelerated video card is highly recommended | | VIDEO | An 3D accelerated video card is highly recommended |
| SOUND | Any sound card supported by ALSA, sndio, macOS or DirectSound | | SOUND | Any sound card supported by ALSA, PulseAudio, macOS or DirectSound |
| INPUT | Keyboard and mouse | | INPUT | Keyboard and mouse |
## Screen problems ## Screen problems
@ -19,10 +19,10 @@ What ever your screen resolution is, the game "Planet Blupi" always runs in
640x480 on full screen. If your screen does not support this mode, you may run 640x480 on full screen. If your screen does not support this mode, you may run
the game by default in windowed mode. Proceed as follows: the game by default in windowed mode. Proceed as follows:
- 1. Quit the game _Planet Blupi_. 1. Quit the game _Planet Blupi_.
- 2. Open the file `<INSTALLDIR>/data/config.json` with a text editor. 2. Open the file `<INSTALLDIR>/data/config.json` with a text editor.
- 3. Replace `fullscreen: true` by `fullscreen: false`. 3. Replace `fullscreen: true` by `fullscreen: false`.
- 4. Save and restart the game. 4. Save and restart the game.
In this mode the screen is no more scrolled if the mouse touches the window In this mode the screen is no more scrolled if the mouse touches the window
border. Use the Keyboard arrows instead. border. Use the Keyboard arrows instead.
@ -32,9 +32,9 @@ border. Use the Keyboard arrows instead.
Left button: Left button:
This button is always used in three steps: This button is always used in three steps:
- 1. Select a Blupi. 1. Select a Blupi.
- 2. Click where you want him to act. 2. Click where you want him to act.
- 3. Click the button corresponding to the required operation. 3. Click the button corresponding to the required operation.
If the chosen Blupi is already selected (blue or red circle around him), If the chosen Blupi is already selected (blue or red circle around him),
step 1) is not necessary. step 1) is not necessary.

View File

@ -1,4 +1,5 @@
{ {
"fullscreen": true, "fullscreen": true,
"zoom": 1,
"speedrate": 1 "speedrate": 1
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -3,8 +3,8 @@ Version=1.0
Type=Application Type=Application
Name=@PB_PRODUCT_NAME@ Name=@PB_PRODUCT_NAME@
GenericName=Video Game GenericName=Video Game
Comment=@CPACK_PACKAGE_DESCRIPTION_SUMMARY@ Comment=@PB_DESCRIPTION@
Exec=@APPIMAGE_EXEC@ Exec=@PB_EXEC@
StartupWMClass=@APPIMAGE_EXEC_WM@ StartupWMClass=@PB_EXEC@
Icon=@APPIMAGE_ICON_REF@ Icon=@APPIMAGE_ICON_REF@
Categories=Game; Categories=Game;StrategyGame;

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-09 09:13+0200\n" "POT-Creation-Date: 2017-09-15 18:34+0200\n"
"PO-Revision-Date: 2017-09-09 09:13+0200\n" "PO-Revision-Date: 2017-10-04 23:30+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de\n"
@ -548,6 +548,9 @@ msgstr "Auswahl der Musik"
msgid "Music number 1" msgid "Music number 1"
msgstr "Musik Nummer 1" msgstr "Musik Nummer 1"
msgid "Music number 10"
msgstr "Musik Nummer 10"
msgid "Music number 2" msgid "Music number 2"
msgstr "Musik Nummer 2" msgstr "Musik Nummer 2"
@ -908,7 +911,7 @@ msgid "free slot"
msgstr "frei" msgstr "frei"
msgid "http://www.blupi.org info@blupi.org" msgid "http://www.blupi.org info@blupi.org"
msgstr "" msgstr "http://www.blupi.org info@blupi.org"
#, c-format #, c-format
msgid "mission %d, time %d" msgid "mission %d, time %d"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-09 09:13+0200\n" "POT-Creation-Date: 2017-09-15 18:34+0200\n"
"PO-Revision-Date: 2017-02-27 21:28+0100\n" "PO-Revision-Date: 2017-02-27 21:28+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -491,6 +491,9 @@ msgstr ""
msgid "Music number 1" msgid "Music number 1"
msgstr "" msgstr ""
msgid "Music number 10"
msgstr ""
msgid "Music number 2" msgid "Music number 2"
msgstr "" msgstr ""

View File

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-09 09:13+0200\n" "POT-Creation-Date: 2017-09-15 18:34+0200\n"
"PO-Revision-Date: 2017-09-09 09:13+0200\n" "PO-Revision-Date: 2017-10-04 23:29+0200\n"
"Last-Translator: Mathieu Schroeter <mathieu@schroetersa.ch>\n" "Last-Translator: Mathieu Schroeter <mathieu@schroetersa.ch>\n"
"Language-Team: French <kde-i18n-doc@kde.org>\n" "Language-Team: French <kde-i18n-doc@kde.org>\n"
"Language: fr\n" "Language: fr\n"
@ -543,6 +543,9 @@ msgstr "Choix de la musique"
msgid "Music number 1" msgid "Music number 1"
msgstr "Musique numéro 1" msgstr "Musique numéro 1"
msgid "Music number 10"
msgstr "Musique numéro 10"
msgid "Music number 2" msgid "Music number 2"
msgstr "Musique numéro 2" msgstr "Musique numéro 2"
@ -900,7 +903,7 @@ msgid "free slot"
msgstr "libre" msgstr "libre"
msgid "http://www.blupi.org info@blupi.org" msgid "http://www.blupi.org info@blupi.org"
msgstr "" msgstr "http://www.blupi.org info@blupi.org"
#, c-format #, c-format
msgid "mission %d, time %d" msgid "mission %d, time %d"

917
resources/po/it.po Normal file
View File

@ -0,0 +1,917 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-29 10:21+0200\n"
"PO-Revision-Date: 2017-10-04 17:30+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid " - FFmpeg (LGPLv2.1)"
msgstr " - FFmpeg (LGPLv2.1)"
msgid " - GNU/gettext and GNU/libiconv (GPLv3)"
msgstr " - GNU/gettext e GNU/libiconv (GPLv3)"
msgid " - SDL2, SDL2_image and SDL2_mixer (zlib license)"
msgstr " - SDL2, SDL2_image e SDL2_mixer (zlib licensa)"
msgid " - SDL_kitchensink (MIT)"
msgstr " - SDL_kitchensink (MIT)"
msgid " - argagg (MIT)"
msgstr " - argagg (MIT)"
msgid " - libasound (LGPLv2.1)"
msgstr " - libasound (LGPLv2.1)"
msgid " - libcurl (MIT/X derivate)"
msgstr " - libcurl (MIT/X derivata)"
msgid " - libpng (own license)"
msgstr " - libpng (licensa personale)"
msgid " - libpulse (LGPLv2.1)"
msgstr " - libpulse (LGPLv2.1)"
msgid " - zlib (own license)"
msgstr " - zlib (licensa personale)"
msgid "(isolated tower)"
msgstr "(torre isolata)"
msgid ""
"1: Cut down a tree \n"
"2: Build a bridge"
msgstr ""
"1: Abbatti un albero \n"
"2: Costruisci un ponte"
msgid ""
"1: Cut down a tree \n"
"2: Make a boat"
msgstr ""
"1: Abbatti un albero \n"
"2: Costruisci una barca"
msgid ""
"1: Cut down a tree \n"
"2: Make a palisade"
msgstr ""
"1: Abbatti un albero \n"
"2: Costruisci una palizzata"
msgid ""
"1: Extract iron\n"
"2: Make a Jeep"
msgstr ""
"1: Estrai del ferro\n"
"2: Costruisci una Jeep"
msgid ""
"1: Extract iron\n"
"2: Make a bomb"
msgstr ""
"1: Estrai del ferro\n"
"2: Costruisci una bomba"
msgid ""
"1: Extract iron\n"
"2: Make an armour"
msgstr ""
"1: Estrai del ferro\n"
"2: Costruisci un'armatura"
msgid ""
"1: Grow tomatoes\n"
"2: Eat"
msgstr ""
"1: Coltiva...\n"
"2: Mangia"
msgid ""
"1: Make a bunch\n"
"2: Transform"
msgstr ""
"1: Fai un mazzo\n"
"2: Trasforma"
msgid ""
"1: Take\n"
"2: Build a bridge"
msgstr ""
"1: Prendi\n"
"2: Costruisci un ponte"
msgid ""
"1: Take\n"
"2: Build palisade"
msgstr ""
"1: Prendi\n"
"2: Costruisci una palizzata"
msgid ""
"1: Take\n"
"2: Make a boat"
msgstr ""
"1: Prendi\n"
"2: Costruisci una barca"
msgid ""
"1: Take\n"
"2: Transform"
msgstr ""
"1: Prendi\n"
"2: Trasforma"
msgid ""
"1|Drop planks on striped \n"
"1|paving stones."
msgstr ""
"1|Posa delle assi \n"
"1|sulle lastre tratteggiate."
msgid ""
"1|Drop platinium on striped \n"
"1|paving stones."
msgstr ""
"1|Posa del platinium sulle \n"
"1|lastre tratteggiate."
msgid ""
"1|Drop tomatoes on striped \n"
"1|paving stones."
msgstr ""
"1|Posa dei pomodori sulle \n"
"1|lastre tratteggiate."
msgid ""
"1|Each Blupi in\n"
"1|his house."
msgstr ""
"1|Ogni Blupi nella\n"
"1|sua casa."
msgid ""
"1|Go on striped\n"
"1|paving stones."
msgstr ""
"1|Andare sulle lastre\n"
"1|tratteggiate."
msgid "1|Goal :"
msgstr "1|Obbiettivo :"
msgid ""
"1|Kill all\n"
"1|enemies !"
msgstr ""
"1|Eliminare\n"
"1|tutti i nemici !"
msgid ""
"1|Resist until\n"
"1|fire extinction ..."
msgstr ""
"1|Resistere sino allo\n"
"1|spegnimento del fuoco ..."
#, c-format
msgid ""
"1|The Blupi population must\n"
"1|be of at least %d Blupi."
msgstr ""
"1|La popolazione deve\n"
"1|essere di almeno %d Blupi."
msgid ""
"1|The robot must reach\n"
"1|the striped paving stones."
msgstr ""
"1|Il robot deve raggiungere\n"
"1|le lastre tratteggiate."
msgid "All licenses are available under share/doc/planetblupi/copyright"
msgstr "Tutte le license sono disponibili in share/doc/planetblupi/copyright"
msgid "Already two teleporters"
msgstr "Esistono già due teletrasporti"
msgid "Another mistake..."
msgstr "Ahimè, hai sbagliato un'altra volta..."
msgid "Armour"
msgstr "Armatura"
msgid "Available buttons"
msgstr "Pulsanti disponibili"
msgid "Bang, failed again !"
msgstr "Bang, hai sbagliato ancora !"
msgid "Bank"
msgstr "Riva"
msgid "Blow up"
msgstr "Espoldi"
msgid "Blupi"
msgstr "Blupi"
msgid "Blupi in house"
msgstr "Blupi nella sua casa"
msgid "Blupi on striped paving stones"
msgstr "Blupi su lastre tratteggiate"
msgid "Blupi's energy"
msgstr "Energia di Blupi"
msgid "Blupi's house"
msgstr "Casa di Blupi"
msgid "Boat"
msgstr "Barca"
msgid "Bouncing bomb"
msgstr "Bomba salterina"
msgid "Bridge"
msgstr "Ponte"
msgid "Bridge finished"
msgstr "Ponte finito"
msgid "Buildings"
msgstr "Edifici"
msgid "Bulldozer"
msgstr "Bulldozer"
msgid "Bunch of flowers"
msgstr "Mazzo di fiori"
msgid "Burnt ground"
msgstr "Terreno bruciato"
msgid "Cancel last operation"
msgstr "Annullare l'ultima operazione"
msgid "Carve a rock"
msgstr "Spacca una roccia"
msgid "Carve rocks"
msgstr "Spacca delle roccie"
msgid ""
"Change the\n"
"window size"
msgstr ""
"Cambiare la\n"
"dimensione\n"
"della finestra"
msgid "Construct this game"
msgstr "Costruire questa partita"
msgid "Construction"
msgstr "Costruzione"
msgid "Construction number"
msgstr "Costruzione numero"
msgid "Continue this game"
msgstr "Continua la partita"
msgid "Cut down a tree"
msgstr "Abbatti un albero"
msgid "Cut down trees"
msgstr "Abbatti degli alberi"
msgid "Decorative plants"
msgstr "Piante ornamentali"
msgid "Delete figure"
msgstr "Elimina personaggio"
msgid "Delete fire"
msgstr "Elimina il fuoco"
msgid "Delete item"
msgstr "Elimina oggetto"
msgid "Demo"
msgstr "Demo"
msgid "Desert"
msgstr "Deserto"
msgid "Difficult"
msgstr "Difficile"
msgid "Drink"
msgstr "Bevi"
msgid "Drop"
msgstr "Posa"
msgid "Dynamite"
msgstr "Dinamite"
msgid "E"
msgstr "E"
msgid "Easy"
msgstr "Facile"
msgid "Eat"
msgstr "Mangia"
msgid "Eggs"
msgstr "Uova"
msgid "Electrocutor"
msgstr "Folgoratore"
msgid "Ending conditions"
msgstr ""
"Condizioni per\n"
"concludere\n"
"la missione"
msgid "Enemy barrier"
msgstr "Barriera nemica"
msgid "Enemy buildings"
msgstr "Edifici nemici"
msgid "Enemy construction"
msgstr "Costruzione nemica"
msgid "Enemy ground"
msgstr "Terreno nemico"
msgid "Enemy rocket"
msgstr "Razzo nemico"
msgid "Excellent..."
msgstr "Eccellente..."
msgid "Extract iron"
msgstr "Estrai del ferro"
msgid "Faster"
msgstr "Veloce"
msgid "Finish"
msgstr "Terminare"
msgid "Fire"
msgstr "Fuoco"
msgid "Fire out"
msgstr "Fuoco fermato"
msgid "Flag"
msgstr "Bandiera"
msgid "Flowers"
msgstr "Fiori"
msgid "Forest"
msgstr "Foresta"
msgid "Forest under snow"
msgstr "Foresta innevata"
msgid "Fullscreen"
msgstr "Schermata intera"
msgid "Game paused"
msgstr "Partita interrotta"
msgid "Garden shed"
msgstr "Capanno"
msgid ""
"Global game\n"
"speed"
msgstr ""
"Velocità\n"
"del gioco"
msgid "Global settings"
msgstr "Configurazione globale"
msgid "Go"
msgstr "Va"
msgid "Grow tomatoes"
msgstr "Coltiva pomodori"
msgid "Help"
msgstr "Aiuto"
msgid "Help number"
msgstr "Aiuto numero"
msgid "Helper robot"
msgstr "Robot aiutante"
msgid "Ice"
msgstr "Ghiaccio"
msgid "Impossible"
msgstr "Impossibile"
#, c-format
msgid "Impossible to win if less than %d Blupi"
msgstr "Impossibile vincere se meno di %d Blupi"
msgid "Inadequate ground"
msgstr "Terreno non adatto"
msgid "Increase volume"
msgstr "Alza il volume"
msgid "Increase window size"
msgstr "Aumentare la dimensione della finestra"
msgid "Incubator"
msgstr "Incubatrice"
msgid "Incubator or teleporter"
msgstr "Incubatrice o teletrasporto"
msgid "Inflammable ground"
msgstr "Terreno infiammabile"
msgid "Insert CD-Rom Planet Blupi and wait a few seconds..."
msgstr "Inserire il CD-Rom Planet Blupi e attendere qualche secondo ..."
msgid ""
"Interface language\n"
"and sounds"
msgstr ""
"Lingua\n"
"dell'interfaccia\n"
"e dei suoni"
msgid "Interrupt"
msgstr "Interrompere"
msgid "Iron"
msgstr "Ferro"
msgid "Items"
msgstr "Oggetti"
msgid "Jeep"
msgstr "Jeep"
msgid "Laboratory"
msgstr "Laboratorio"
msgid "Last construction resolved !"
msgstr "Ultima costruzione risolta !"
msgid "Leave Jeep"
msgstr "Lascia la Jeep"
#, c-format
msgid "Lost if less than %d Blupi"
msgstr "Perso se meno di %d Blupi"
msgid "Make a Jeep"
msgstr "Costruisci una Jeep"
msgid "Make a helper robot"
msgstr "Costruisci un robot aiutante"
msgid "Make a time bomb"
msgstr "Costruisci una bomba"
msgid "Make armour"
msgstr "Costruisci un'armatura"
msgid "Make bunch of flowers"
msgstr "Fai un mazzo di fiori"
msgid "Make bunches of flowers"
msgstr "Fai dei mazzi di fiori"
msgid "Master robot"
msgstr "Robot-capo"
msgid "Medical potion"
msgstr "Pozione"
msgid "Mine"
msgstr "Miniera"
msgid "Miscellaneous ground"
msgstr "Terreno misto"
msgid "Mission number"
msgstr "Missione numero"
msgid "Mission over..."
msgstr "Missione compiuta..."
msgid "Missions"
msgstr "Missioni"
msgid ""
"Music\n"
"volume"
msgstr ""
"Volume\n"
"della musica"
msgid "Music choice"
msgstr "Scelta della musica"
msgid "Music number 1"
msgstr "Musica numero 1"
msgid "Music number 10"
msgstr "Musica numero 10"
msgid "Music number 2"
msgstr "Musica numero 2"
msgid "Music number 3"
msgstr "Musica numero 3"
msgid "Music number 4"
msgstr "Musica numero 4"
msgid "Music number 5"
msgstr "Musica numero 5"
msgid "Music number 6"
msgstr "Musica numero 6"
msgid "Music number 7"
msgstr "Musica numero 7"
msgid "Music number 8"
msgstr "Musica numero 8"
msgid "Music number 9"
msgstr "Musica numero 9"
msgid "N"
msgstr "N"
#, c-format
msgid "New version available for download on www.blupi.org (v%s)"
msgstr "Nuova versione disponibile su www.blupi.org (v%s)"
msgid "Next game"
msgstr "Partita successiva"
msgid "Next language"
msgstr "Prossima lingua"
msgid "Next page"
msgstr "Pagina successiva"
msgid "No"
msgstr "No"
msgid "No more enemies"
msgstr "Nemici eliminati"
msgid "No music"
msgstr "Nessuna musica"
msgid "No video"
msgstr "Nessun video"
msgid "No, not that way !"
msgstr "Ma no, non così !"
msgid "No, wrong way ..."
msgstr "Eh no, non è così ..."
msgid "None"
msgstr "Nessuno"
msgid "Normal ground"
msgstr "Terreno normale"
msgid "Not enough energy"
msgstr "Energia limitata"
msgid "Now go on mission."
msgstr "Ora passa alle missioni."
msgid "Occupied ground"
msgstr "Terreno occupato"
msgid "Open another game"
msgstr "Apri un'altra partita"
msgid "Opposite bank no good"
msgstr "Riva opposta non ok"
msgid "Palisade"
msgstr "Palizzata"
msgid "Paving stones"
msgstr "Lastre"
msgid "Planet Blupi"
msgstr "Planet Blupi"
msgid "Planet Blupi -- stop"
msgstr "Planet Blupi -- stop"
msgid "Planks"
msgstr "Assi"
msgid "Planks on striped paving stones"
msgstr "Assi su lastre tratteggiate"
msgid "Platinium"
msgstr "Platinium"
msgid "Platinium on striped paving stones"
msgstr "Platinium su lastre trattegiate"
msgid "Play this game"
msgstr "Giocare questa partita"
msgid "Poison"
msgstr "Veleno"
msgid "Prairie"
msgstr "Prateria"
msgid "Previous game"
msgstr "Partita precedente"
msgid "Previous language"
msgstr "Lingua precedente"
msgid "Previous page"
msgstr "Pagina precedente"
msgid "Prospect for iron"
msgstr "Cerca del ferro"
msgid "Protection tower"
msgstr "Torre di protezione"
msgid "Quit"
msgstr "Lascia"
msgid "Quit Planet Blupi"
msgstr "Lasciare Planet Blupi"
msgid "Quit construction"
msgstr "Terminare la costruzione"
msgid "Quit this game"
msgstr "Lasciare la partita"
msgid "REC"
msgstr "REC"
msgid "Reduce volume"
msgstr "Abbassa il volume"
msgid "Reduce window size"
msgstr "Ridurre la dimesione della finestra"
msgid "Repeat"
msgstr "Ripeti"
msgid "Restart this game"
msgstr "Ricomincia la partita"
msgid "Robot on striped paving stones"
msgstr "Robot su lastre tratteggiate"
msgid "Rocks"
msgstr "Rocce"
msgid "S"
msgstr "S"
msgid "Save"
msgstr "Salvare"
msgid "Save this game"
msgstr "Salvare questa partita"
msgid "Scenery choice"
msgstr "Scelta degli scenari"
msgid ""
"Scroll speed\n"
"with mouse"
msgstr ""
"Velocità\n"
"del mouse"
msgid ""
"Select the\n"
"window mode"
msgstr ""
"Selezionare il\n"
"modo finestra"
msgid "Settings"
msgstr "Configurazione"
msgid "Show videos"
msgstr "Mostra i video"
msgid "Sick Blupi"
msgstr "Blupi ammalato"
msgid "Skill level"
msgstr "Livello di difficoltà"
msgid "Slower"
msgstr "Lento"
msgid ""
"Sound effect\n"
"volume"
msgstr ""
"Volume\n"
"degli effetti"
msgid "Special pavings"
msgstr "Lastre speciali"
msgid "Spider"
msgstr "Ragno"
msgid "Starting fire"
msgstr "Inizio d'incendio"
msgid "Sterile ground"
msgstr "Terreno sterile"
msgid "Sticky trap"
msgstr "Trappola collosa"
msgid "Stones"
msgstr "Pietre"
msgid "Stop"
msgstr "Stop"
msgid "Striped paving stones"
msgstr "Lastre tratteggiate"
msgid "Take"
msgstr "Prendi"
msgid "Teleporter"
msgstr "Teletrasporto"
msgid ""
"This game is an original creation of Epsitec SA, CH-1400 Yverdon-les-Bains"
msgstr ""
"Questo gioco è una realizzazione originale di Epsitec SA, CH-1400 Yverdon-"
"les-Bains"
msgid "This game uses statically linked free and open-source libraries:"
msgstr "Questo gioco utilizza delle librerie open-source:"
msgid "Time bomb"
msgstr "Bomba a tempo"
msgid "Tired Blupi"
msgstr "Blupi stanco"
msgid "Tomatoes"
msgstr "Pomodori"
msgid "Tomatoes on striped paving stones"
msgstr "Pomodori su lastre tratteggiate"
msgid "Too close to water"
msgstr "Troppo vicino all'acqua"
msgid "Training"
msgstr "Allenamento"
msgid "Training number"
msgstr "Allenamento numero"
msgid "Transform"
msgstr "Trasforma"
msgid "Transport"
msgstr "Mezzi di trasporto"
msgid "Trapped enemy"
msgstr "Nemico intrappolato"
msgid "Tree"
msgstr "Alberi"
msgid "Tree trunks"
msgstr "Tronchi"
msgid "Version"
msgstr "Versione"
msgid "Very good, success on all missions !"
msgstr "Splendido, hai concluso il gioco !"
msgid "Very good."
msgstr "Molto bene."
msgid ""
"Video\n"
"sequences"
msgstr ""
"Sequenze\n"
"video"
msgid "Virus"
msgstr "Virus"
msgid "W"
msgstr "O"
msgid "Wall"
msgstr "Muro"
msgid "Wall or palisade"
msgstr "Muro o Palizzata"
msgid "Water"
msgstr "Acqua"
msgid "We hope you have had as much fun playing the game as we had making it !"
msgstr ""
"Speriamo che ti sia divertito con questo gioco almeno quanto noi ci siamo "
"zzarlo !"
msgid "Weapons"
msgstr "Armi"
msgid "Well done !"
msgstr "Bravo, ce l'hai fatta !"
msgid "Windowed"
msgstr "Finestra"
msgid "Work done"
msgstr "Lavoro in corso"
msgid "Workshop"
msgstr "Fabbrica"
msgid "Yes"
msgstr "Si"
msgid "Yes, great ..."
msgstr "Si, fantastico ..."
msgid "You have failed, try again..."
msgstr "Hai sbagliato, riprova..."
msgid "You have played Planet Blupi."
msgstr "Hai giocato con Planet Blupi."
#, c-format
msgid "construction %d, time %d"
msgstr "Costruzione %d, tempo %d"
msgid "en"
msgstr "it"
msgid "free slot"
msgstr "libero"
msgid "http://www.blupi.org info@blupi.org"
msgstr "http://www.blupi.org info@blupi.org"
#, c-format
msgid "mission %d, time %d"
msgstr "missione %d, tempo %d"
#, c-format
msgid "training %d, time %d"
msgstr "allenamento %d, tempo %d"

914
resources/po/pl.po Normal file
View File

@ -0,0 +1,914 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-04 07:04+0200\n"
"PO-Revision-Date: 2017-09-12 20:10+0200\n"
"Last-Translator: tomangelo <tomangelo@wp.pl>\n"
"Language-Team: TerranovaTeam <contact@colobot.info>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
msgid " - FFmpeg (LGPLv2.1)"
msgstr " - FFmpeg (LGPLv2.1)"
msgid " - GNU/gettext and GNU/libiconv (GPLv3)"
msgstr " - GNU/gettext and GNU/libiconv (GPLv3)"
msgid " - SDL2, SDL2_image and SDL2_mixer (zlib license)"
msgstr " - SDL2, SDL2_image and SDL2_mixer (licencja zlib)"
msgid " - SDL_kitchensink (MIT)"
msgstr " - SDL_kitchensink (MIT)"
msgid " - argagg (MIT)"
msgstr " - argagg (MIT)"
msgid " - libasound (LGPLv2.1)"
msgstr " - libasound (LGPLv2.1)"
msgid " - libcurl (MIT/X derivate)"
msgstr " - libcurl (MIT/X derivate)"
msgid " - libpng (own license)"
msgstr " - libpng (własna licencja)"
msgid " - libpulse (LGPLv2.1)"
msgstr " - libpulse (LGPLv2.1)"
msgid " - zlib (own license)"
msgstr " - zlib (własna licencja)"
msgid "(isolated tower)"
msgstr "(samotna wieża)"
msgid ""
"1: Cut down a tree \n"
"2: Build a bridge"
msgstr ""
"1: Zetnij drzewo\n"
"2: Zbuduj most"
msgid ""
"1: Cut down a tree \n"
"2: Make a boat"
msgstr ""
"1: Zetnij drzewo\n"
"2: Zbuduj łódź"
msgid ""
"1: Cut down a tree \n"
"2: Make a palisade"
msgstr ""
"1: Zetnij drzewo\n"
"2: Zbuduj palisadę"
msgid ""
"1: Extract iron\n"
"2: Make a Jeep"
msgstr ""
"1: Wykop żelazo\n"
"2: Stwórz Jeepa"
msgid ""
"1: Extract iron\n"
"2: Make a bomb"
msgstr ""
"1: Wykop żelazo\n"
"2: Stwórz bombę"
msgid ""
"1: Extract iron\n"
"2: Make an armour"
msgstr ""
"1: Wykop żelazo\n"
"2: Stwórz zbroję"
msgid ""
"1: Grow tomatoes\n"
"2: Eat"
msgstr ""
"1: Zasadź pomidory\n"
"2: Zjedz"
msgid ""
"1: Make a bunch\n"
"2: Transform"
msgstr ""
"1: Zbierz wiele\n"
"2: Przetwórz"
msgid ""
"1: Take\n"
"2: Build a bridge"
msgstr ""
"1: Weź\n"
"2: Zbuduj most"
msgid ""
"1: Take\n"
"2: Build palisade"
msgstr ""
"1: Weź\n"
"2: Zbuduj palisadę"
msgid ""
"1: Take\n"
"2: Make a boat"
msgstr ""
"1: Weź\n"
"2: Zbuduj łódź"
msgid ""
"1: Take\n"
"2: Transform"
msgstr ""
"1: Weź\n"
"2: Przetwórz"
msgid ""
"1|Drop planks on striped \n"
"1|paving stones."
msgstr ""
"1|Połóż deski na\n"
"1|nawierzchni docelowej."
msgid ""
"1|Drop platinium on striped \n"
"1|paving stones."
msgstr ""
"1|Połóż platynę na\n"
"1|nawierzchni docelowej."
msgid ""
"1|Drop tomatoes on striped \n"
"1|paving stones."
msgstr ""
"1|Połóż pomidory na\n"
"1|nawierzchni docelowej."
msgid ""
"1|Each Blupi in\n"
"1|his house."
msgstr ""
"1|Każdy Blupi we\n"
"1|własnym domu."
msgid ""
"1|Go on striped\n"
"1|paving stones."
msgstr ""
"1|Idź na\n"
"1|nawierzchnię docelową."
msgid "1|Goal :"
msgstr "1|Zadanie :"
msgid ""
"1|Kill all\n"
"1|enemies !"
msgstr ""
"1|Wyeliminuj wszystkich\n"
"1|przeciwników!"
msgid ""
"1|Resist until\n"
"1|fire extinction ..."
msgstr ""
"1|Wytrzymaj dopóki\n"
"1|pożar nie wygaśnie ..."
#, c-format
msgid ""
"1|The Blupi population must\n"
"1|be of at least %d Blupi."
msgstr ""
"1|Populacja Blupich musi\n"
"1|wynosić minimum %d Blupich."
msgid ""
"1|The robot must reach\n"
"1|the striped paving stones."
msgstr ""
"1|Robot musi dotrzeć do\n"
"1|nawierzchni docelowej."
msgid "All licenses are available under share/doc/planetblupi/copyright"
msgstr "Wszystkie licencje dostępne są w share/doc/planetblupi/copyright"
msgid "Already two teleporters"
msgstr "Już istnieją 2 teleportery"
msgid "Another mistake..."
msgstr "Znowu pomyłka..."
msgid "Armour"
msgstr "Zbroja"
msgid "Available buttons"
msgstr "Dostępne przyciski"
msgid "Bang, failed again !"
msgstr "Motyla noga, znowu porażka!"
msgid "Bank"
msgstr "Brzeg"
msgid "Blow up"
msgstr "Wysadź w powietrze"
msgid "Blupi"
msgstr "Blupi"
msgid "Blupi in house"
msgstr "Blupi w domu"
msgid "Blupi on striped paving stones"
msgstr "Blupi na nawierzchni docelowej"
msgid "Blupi's energy"
msgstr "Siła Blupiego"
msgid "Blupi's house"
msgstr "Domek Blupiego"
msgid "Boat"
msgstr "Łódź"
msgid "Bouncing bomb"
msgstr "Skacząca bomba"
msgid "Bridge"
msgstr "Most"
msgid "Bridge finished"
msgstr "Most skończony"
msgid "Buildings"
msgstr "Budynki"
msgid "Bulldozer"
msgstr "Buldożer"
msgid "Bunch of flowers"
msgstr "Bukiet kwiatów"
msgid "Burnt ground"
msgstr "Wypalona ziemia"
msgid "Cancel last operation"
msgstr "Cofnij ostatnią operację"
msgid "Carve a rock"
msgstr "Wyłup skałę"
msgid "Carve rocks"
msgstr "Wyłup skały"
msgid ""
"Change the\n"
"window size"
msgstr ""
"Zmień rozmiar\n"
"okna"
msgid "Construct this game"
msgstr "Edytuj poziom"
msgid "Construction"
msgstr "Konstrukcja"
msgid "Construction number"
msgstr "Konstrukcja numer"
msgid "Continue this game"
msgstr "Kontynuuj"
msgid "Cut down a tree"
msgstr "Zetnij drzewo"
msgid "Cut down trees"
msgstr "Zetnij drzewa"
msgid "Decorative plants"
msgstr "Rośliny ozdobne"
msgid "Delete figure"
msgstr "Usuń postać"
msgid "Delete fire"
msgstr "Usuń ogień"
msgid "Delete item"
msgstr "Usuń przedmiot"
msgid "Demo"
msgstr "Demonstracja"
msgid "Desert"
msgstr "Pustynia"
msgid "Difficult"
msgstr "Trudny"
msgid "Drink"
msgstr "Wypij"
msgid "Drop"
msgstr "Upuść"
msgid "Dynamite"
msgstr "Dynamit"
msgid "E"
msgstr "Ws"
msgid "Easy"
msgstr "Prosty"
msgid "Eat"
msgstr "Jedz"
msgid "Eggs"
msgstr "Jaja"
msgid "Electrocutor"
msgstr "Paralizator"
msgid "Ending conditions"
msgstr "Warunki zwycięstwa"
msgid "Enemy barrier"
msgstr "Wroga bariera"
msgid "Enemy buildings"
msgstr "Wrogie budynki"
msgid "Enemy construction"
msgstr "Wroga konstrukcja"
msgid "Enemy ground"
msgstr "Wroga ziemia"
msgid "Enemy rocket"
msgstr "Wroga rakieta"
msgid "Excellent..."
msgstr "Doskonale..."
msgid "Extract iron"
msgstr "Wykop żelazo"
msgid "Faster"
msgstr "Szybciej"
msgid "Finish"
msgstr "Zakończ"
msgid "Fire"
msgstr "Ogień"
msgid "Fire out"
msgstr "Ugaszony pożar"
msgid "Flag"
msgstr "Flaga"
msgid "Flowers"
msgstr "Kwiaty"
msgid "Forest"
msgstr "Las"
msgid "Forest under snow"
msgstr "Las pokryty śniegiem"
msgid "Fullscreen"
msgstr "Pełny ekran"
msgid "Game paused"
msgstr "Gra zapauzowana"
msgid "Garden shed"
msgstr "Szopka ogrodowa"
msgid ""
"Global game\n"
"speed"
msgstr ""
"Prędkość\n"
"gry"
msgid "Global settings"
msgstr "Ustawienia"
msgid "Go"
msgstr "Idź"
msgid "Grow tomatoes"
msgstr "Sadź pomidory"
msgid "Help"
msgstr "Pomoc"
msgid "Help number"
msgstr "Pomoc numer"
msgid "Helper robot"
msgstr "Robot-pomocnik"
msgid "Ice"
msgstr "Lód"
msgid "Impossible"
msgstr "Niemożliwe"
#, c-format
msgid "Impossible to win if less than %d Blupi"
msgstr "Niemożliwe do wygrania jeśli mniej niż %d Blupich"
msgid "Inadequate ground"
msgstr "Nieodpowiedni teren"
msgid "Increase volume"
msgstr "Zwiększ głośność"
msgid "Increase window size"
msgstr "Zwiększ rozmiar okna"
msgid "Incubator"
msgstr "Wylęgarka"
msgid "Incubator or teleporter"
msgstr "Inkubator lub teleporter"
msgid "Inflammable ground"
msgstr "Łatwopalna ziemia"
msgid "Insert CD-Rom Planet Blupi and wait a few seconds..."
msgstr ""
"Włóż płytę CD-ROM z grą Planet Blupi do napędu optycznego i poczekaj kilka "
"sekund"
msgid ""
"Interface language\n"
"and sounds"
msgstr ""
"Język interfejsu\n"
"oraz dźwięków"
msgid "Interrupt"
msgstr "Przerwij"
msgid "Iron"
msgstr "Żelazo"
msgid "Items"
msgstr "Przedmioty"
msgid "Jeep"
msgstr "Jeep"
msgid "Laboratory"
msgstr "Laboratorium"
msgid "Last construction resolved !"
msgstr "Ostatnia łamigłówka rozwiązana!"
msgid "Leave Jeep"
msgstr "Opuść Jeepa"
#, c-format
msgid "Lost if less than %d Blupi"
msgstr "Przegrana jeśli mniej niż %d Blupich"
msgid "Make a Jeep"
msgstr "Stwórz Jeepa"
msgid "Make a helper robot"
msgstr "Stwórz robota-pomocnika"
msgid "Make a time bomb"
msgstr "Stwórz bombę zegarową"
msgid "Make armour"
msgstr "Stwórz zbroję"
msgid "Make bunch of flowers"
msgstr "Ułóż bukiet kwiatów"
msgid "Make bunches of flowers"
msgstr "Ułóż bukiety kwiatów"
msgid "Master robot"
msgstr "Mistrz robotów"
msgid "Medical potion"
msgstr "Lekarstwo"
msgid "Mine"
msgstr "Kopalnia"
msgid "Miscellaneous ground"
msgstr "Mieszana ziemia"
msgid "Mission number"
msgstr "Misja numer"
msgid "Mission over..."
msgstr "Koniec zadania..."
msgid "Missions"
msgstr "Misje"
msgid ""
"Music\n"
"volume"
msgstr ""
"Głośność\n"
"muzyki"
msgid "Music choice"
msgstr "Wybór muzyki"
msgid "Music number 1"
msgstr "Muzyka numer 1"
#, fuzzy
msgid "Music number 10"
msgstr "Muzyka numer 1"
msgid "Music number 2"
msgstr "Muzyka numer 2"
msgid "Music number 3"
msgstr "Muzyka numer 3"
msgid "Music number 4"
msgstr "Muzyka numer 4"
msgid "Music number 5"
msgstr "Muzyka numer 5"
msgid "Music number 6"
msgstr "Muzyka numer 6"
msgid "Music number 7"
msgstr "Muzyka numer 7"
msgid "Music number 8"
msgstr "Muzyka numer 8"
msgid "Music number 9"
msgstr "Muzyka numer 9"
msgid "N"
msgstr "Pn"
#, c-format
msgid "New version available for download on www.blupi.org (v%s)"
msgstr "Nowa wersja dostępna do pobrania na www.blupi.org (v%s)"
msgid "Next game"
msgstr "Następne zadanie"
msgid "Next language"
msgstr "Następny język"
msgid "Next page"
msgstr "Następna strona"
msgid "No"
msgstr "Nie"
msgid "No more enemies"
msgstr "Brak przeciwników"
msgid "No music"
msgstr "Brak muzyki"
msgid "No video"
msgstr "Brak wstawek filmowych"
msgid "No, not that way !"
msgstr "Nie, nie w ten sposób!"
msgid "No, wrong way ..."
msgstr "Nie, nie tak..."
msgid "None"
msgstr "Brak"
msgid "Normal ground"
msgstr "Zwykła ziemia"
msgid "Not enough energy"
msgstr "Za mało siły"
msgid "Now go on mission."
msgstr "Teraz spróbuj swoich sił w misjach"
msgid "Occupied ground"
msgstr "Teren zajęty"
msgid "Open another game"
msgstr "Otwórz poprzednią grę"
msgid "Opposite bank no good"
msgstr "Brzeg nie jest odpowiedni"
msgid "Palisade"
msgstr "Palisada"
msgid "Paving stones"
msgstr "Kostka brukowa"
msgid "Planet Blupi"
msgstr "Planet Blupi"
msgid "Planet Blupi -- stop"
msgstr "Planet Blupi -- zatrzymano"
msgid "Planks"
msgstr "Deski"
msgid "Planks on striped paving stones"
msgstr "Deski na nawierzchni docelowej"
msgid "Platinium"
msgstr "Platyna"
msgid "Platinium on striped paving stones"
msgstr "Platyna na nawierzchni docelowej"
msgid "Play this game"
msgstr "Zagraj"
msgid "Poison"
msgstr "Trucizna"
msgid "Prairie"
msgstr "Preria"
msgid "Previous game"
msgstr "Poprzednie zadanie"
msgid "Previous language"
msgstr "Poprzedni język"
msgid "Previous page"
msgstr "Poprzednia strona"
msgid "Prospect for iron"
msgstr "Szukaj żelaza"
msgid "Protection tower"
msgstr "Wieża obronna"
msgid "Quit"
msgstr "Wyjdź"
msgid "Quit Planet Blupi"
msgstr "Wyjdź z Planet Blupi"
msgid "Quit construction"
msgstr "Zakończ tworzenie"
msgid "Quit this game"
msgstr "Opuść tą grę"
msgid "REC"
msgstr "Nagrywanie"
msgid "Reduce volume"
msgstr "Zmniejsz głośność"
msgid "Reduce window size"
msgstr "Zmniejsz rozmiar okna"
msgid "Repeat"
msgstr "Powtórz"
msgid "Restart this game"
msgstr "Uruchom grę ponownie"
msgid "Robot on striped paving stones"
msgstr "Roboty na nawierzchni docelowej"
msgid "Rocks"
msgstr "Skały"
msgid "S"
msgstr "Pd"
msgid "Save"
msgstr "Zapisz"
msgid "Save this game"
msgstr "Zapisz tą grę"
msgid "Scenery choice"
msgstr "Wybór scenerii"
msgid ""
"Scroll speed\n"
"with mouse"
msgstr ""
"Prędkość przewijania\n"
"myszą"
msgid ""
"Select the\n"
"window mode"
msgstr ""
"Wybierz\n"
"tryb okienkowy"
msgid "Settings"
msgstr "Opcje"
msgid "Show videos"
msgstr "Pokaż wstawki filmowe"
msgid "Sick Blupi"
msgstr "Zarażony Blupi"
msgid "Skill level"
msgstr "Poziom trudności"
msgid "Slower"
msgstr "Wolniej"
msgid ""
"Sound effect\n"
"volume"
msgstr ""
"Głośność\n"
"efektów"
msgid "Special pavings"
msgstr "Specjalne nawierzchnie"
msgid "Spider"
msgstr "Pająk"
msgid "Starting fire"
msgstr "Początek pożaru"
msgid "Sterile ground"
msgstr "Jałowa ziemia"
msgid "Sticky trap"
msgstr "Klejąca pułapka"
msgid "Stones"
msgstr "Kamienie"
msgid "Stop"
msgstr "Przerwij"
msgid "Striped paving stones"
msgstr "Nawierzchnia docelowa"
msgid "Take"
msgstr "Weź"
msgid "Teleporter"
msgstr "Teleporter"
msgid ""
"This game is an original creation of Epsitec SA, CH-1400 Yverdon-les-Bains"
msgstr "Ta gra to oryginalne dzieło Epsitec SA, CH-1400 Yverdon-les-Bains"
msgid "This game uses statically linked free and open-source libraries:"
msgstr ""
"Ta gra używa statystycznie linkowanych wolnych i otwartoźródłowych "
"bibliotek: "
msgid "Time bomb"
msgstr "Bomba zegarowa"
msgid "Tired Blupi"
msgstr "Zmęczony Blupi"
msgid "Tomatoes"
msgstr "Pomidory"
msgid "Tomatoes on striped paving stones"
msgstr "Pomidory na nawierzchni docelowej"
msgid "Too close to water"
msgstr "Za blisko wody"
msgid "Training"
msgstr "Trening"
msgid "Training number"
msgstr "Trening numer"
msgid "Transform"
msgstr "Przetwórz"
msgid "Transport"
msgstr "Środki transportu"
msgid "Trapped enemy"
msgstr "Przyklejony przeciwnik"
msgid "Tree"
msgstr "Drzewo"
msgid "Tree trunks"
msgstr "Pnie drzew"
msgid "Version"
msgstr "Wersja"
msgid "Very good, success on all missions !"
msgstr "Bardzo dobrze, suksesów we wszystkich misjach"
msgid "Very good."
msgstr "Bardzo dobrze."
msgid ""
"Video\n"
"sequences"
msgstr ""
"Wstawki\n"
"filmowe"
msgid "Virus"
msgstr "Wirus"
msgid "W"
msgstr "Za"
msgid "Wall"
msgstr "Mur"
msgid "Wall or palisade"
msgstr "Mur lub palisada"
msgid "Water"
msgstr "Woda"
msgid "We hope you have had as much fun playing the game as we had making it !"
msgstr ""
"Mamy nadzieję że miałeś tak dużo frajdy z gry jak my gdy ją tworzyliśmy!"
msgid "Weapons"
msgstr "Bronie"
msgid "Well done !"
msgstr "Dobra robota!"
msgid "Windowed"
msgstr "Tryb okienkowy"
msgid "Work done"
msgstr "Zadanie skończone"
msgid "Workshop"
msgstr "Warsztat"
msgid "Yes"
msgstr "Tak"
msgid "Yes, great ..."
msgstr "Tak, wspaniale ..."
msgid "You have failed, try again..."
msgstr "Przegrałeś, spróbuj ponownie..."
msgid "You have played Planet Blupi."
msgstr "Grałeś w Planet Blupi"
#, c-format
msgid "construction %d, time %d"
msgstr "Budowanie %d, czas %d"
msgid "en"
msgstr "pl"
msgid "free slot"
msgstr "Wolny slot"
msgid "http://www.blupi.org info@blupi.org"
msgstr "http://www.blupi.org info@blupi.org"
#, c-format
msgid "mission %d, time %d"
msgstr "Misja %d, czas %d"
#, c-format
msgid "training %d, time %d"
msgstr "Trenowanie %d, czas %d"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-09 09:13+0200\n" "POT-Creation-Date: 2017-10-04 07:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -518,6 +518,9 @@ msgstr ""
msgid "Music number 9" msgid "Music number 9"
msgstr "" msgstr ""
msgid "Music number 10"
msgstr ""
msgid "Prairie" msgid "Prairie"
msgstr "" msgstr ""

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1764,7 +1764,7 @@ static const DescAction action_table[] =
{0}, {0},
}, },
{ {
ACTION_D_PICKAXE, ACTION_D_SAW,
CHBLUPI, CHBLUPI,
{ {
{1, 290}, // e {1, 290}, // e
@ -1839,7 +1839,7 @@ static const DescAction action_table[] =
{0}, {0},
}, },
{ {
ACTION_D_SAW, ACTION_D_PICKAXE,
CHBLUPI, CHBLUPI,
{ {
{8, 290, 290, 304, 304, 290, 290, 292, 292}, // e {8, 290, 290, 304, 304, 290, 290, 292, 292}, // e

View File

@ -30,7 +30,9 @@
#include <SDL2/SDL_image.h> #include <SDL2/SDL_image.h>
#include <argagg/argagg.hpp> #include <argagg/argagg.hpp>
#ifdef USE_CURL
#include <curl/curl.h> #include <curl/curl.h>
#endif /* USE_CURL */
#include "json/json.hpp" #include "json/json.hpp"
@ -59,6 +61,7 @@ CDecor * g_pDecor = nullptr;
std::thread * g_updateThread = nullptr; std::thread * g_updateThread = nullptr;
bool g_bFullScreen = false; // false si mode de test bool g_bFullScreen = false; // false si mode de test
Uint8 g_windowScale = 1;
Sint32 g_speedRate = 1; Sint32 g_speedRate = 1;
Sint32 g_timerInterval = 50; // inverval = 50ms Sint32 g_timerInterval = 50; // inverval = 50ms
int g_rendererType = 0; int g_rendererType = 0;
@ -71,6 +74,7 @@ enum Settings {
SETTING_SPEEDRATE = 1 << 1, SETTING_SPEEDRATE = 1 << 1,
SETTING_TIMERINTERVAL = 1 << 2, SETTING_TIMERINTERVAL = 1 << 2,
SETTING_RENDERER = 1 << 3, SETTING_RENDERER = 1 << 3,
SETTING_ZOOM = 1 << 4,
}; };
static int g_settingsOverload = 0; static int g_settingsOverload = 0;
@ -79,11 +83,13 @@ bool g_bTermInit = false; // initialisation en cours
Uint32 g_lastPhase = 999; Uint32 g_lastPhase = 999;
static bool g_pause; static bool g_pause;
#ifdef USE_CURL
struct url_data { struct url_data {
CURLcode status; CURLcode status;
char * buffer; char * buffer;
size_t size; size_t size;
}; };
#endif
template <typename Out> template <typename Out>
static void static void
@ -92,7 +98,7 @@ split (const std::string & s, char delim, Out result)
std::stringstream ss; std::stringstream ss;
ss.str (s); ss.str (s);
std::string item; std::string item;
while (std::getline (ss, item, delim).good ()) while (std::getline (ss, item, delim))
*(result++) = item; *(result++) = item;
} }
@ -114,7 +120,10 @@ ReadConfig ()
{ {
const auto config = GetBaseDir () + "data/config.json"; const auto config = GetBaseDir () + "data/config.json";
std::ifstream file (config, std::ifstream::in); std::ifstream file (config, std::ifstream::in);
if (!file)
return false;
nlohmann::json j; nlohmann::json j;
file >> j; file >> j;
@ -149,6 +158,13 @@ ReadConfig ()
g_bFullScreen = 1; g_bFullScreen = 1;
} }
if (!(g_settingsOverload & SETTING_ZOOM) && j.find ("zoom") != j.end ())
{
g_windowScale = j["zoom"].get<Uint8> ();
if (g_windowScale != 1 && g_windowScale != 2)
g_windowScale = 1;
}
if ( if (
!(g_settingsOverload & SETTING_RENDERER) && j.find ("renderer") != j.end ()) !(g_settingsOverload & SETTING_RENDERER) && j.find ("renderer") != j.end ())
{ {
@ -164,13 +180,14 @@ ReadConfig ()
/** /**
* \brief Main frame update. * \brief Main frame update.
*/ */
static void static bool
UpdateFrame (void) UpdateFrame (void)
{ {
Rect clip, rcRect; Rect clip, rcRect;
Uint32 phase; Uint32 phase;
Point posMouse; Point posMouse;
Sint32 i, term, speed; Sint32 i, term, speed;
bool display = true;
posMouse = g_pEvent->GetLastMousePos (); posMouse = g_pEvent->GetLastMousePos ();
@ -195,27 +212,22 @@ UpdateFrame (void)
clip.bottom = POSDRAWY + DIMDRAWY; clip.bottom = POSDRAWY + DIMDRAWY;
if (g_pEvent->IsShift ()) // screen shifting if (g_pEvent->IsShift ()) // screen shifting
{
g_pEvent->DecorAutoShift (); g_pEvent->DecorAutoShift ();
g_pDecor->Build (clip, posMouse); // build the environment
}
else
{
if (!g_pEvent->GetPause ())
{
speed = g_pEvent->GetSpeed () * g_speedRate;
for (i = 0; i < speed; i++)
{
g_pDecor->BlupiStep (i == 0); // move all blupi
g_pDecor->MoveStep (i == 0); // move the environment
g_pEvent->DemoStep (); // forward the recording or demo playing
}
}
g_pEvent->DecorAutoShift (); if (!g_pEvent->GetPause ())
g_pDecor->Build (clip, posMouse); // build the environment {
g_pDecor->NextPhase (1); // rebuild the map sometimes speed = g_pEvent->GetSpeed () * g_speedRate;
for (i = 0; i < speed; i++)
{
g_pDecor->BlupiStep (i == 0); // move all blupi
g_pDecor->MoveStep (i == 0); // move the environment
g_pEvent->DemoStep (); // forward the recording or demo playing
}
} }
g_pEvent->DecorAutoShift ();
g_pDecor->Build (clip, posMouse); // build the environment
g_pDecor->NextPhase (1); // rebuild the map sometimes
} }
if (phase == EV_PHASE_BUILD) if (phase == EV_PHASE_BUILD)
@ -243,7 +255,7 @@ UpdateFrame (void)
phase == EV_PHASE_H2MOVIE || phase == EV_PHASE_PLAYMOVIE || phase == EV_PHASE_H2MOVIE || phase == EV_PHASE_PLAYMOVIE ||
phase == EV_PHASE_WINMOVIE) phase == EV_PHASE_WINMOVIE)
{ {
g_pEvent->MovieToStart (); // start a movie if necessary display = g_pEvent->MovieToStart (); // start a movie if necessary
} }
if (phase == EV_PHASE_INSERT) if (phase == EV_PHASE_INSERT)
@ -257,6 +269,8 @@ UpdateFrame (void)
if (term == 2) if (term == 2)
g_pEvent->ChangePhase (EV_PHASE_WINMOVIE); // win g_pEvent->ChangePhase (EV_PHASE_WINMOVIE); // win
} }
return display;
} }
/** /**
@ -371,10 +385,12 @@ HandleEvent (const SDL_Event & event)
case EV_UPDATE: case EV_UPDATE:
if (!g_pEvent->IsMovie ()) // pas de film en cours ? if (!g_pEvent->IsMovie ()) // pas de film en cours ?
{ {
if (!g_pause) bool display = true;
UpdateFrame ();
if (!g_pEvent->IsMovie ()) if (!g_pause)
display = UpdateFrame ();
if (!g_pEvent->IsMovie () && display)
g_pPixmap->Display (); g_pPixmap->Display ();
} }
break; break;
@ -446,6 +462,7 @@ InitFail (const char * msg)
FinishObjects (); FinishObjects ();
} }
#ifdef USE_CURL
static size_t static size_t
updateCallback (void * ptr, size_t size, size_t nmemb, void * data) updateCallback (void * ptr, size_t size, size_t nmemb, void * data)
{ {
@ -463,10 +480,12 @@ updateCallback (void * ptr, size_t size, size_t nmemb, void * data)
return realsize; return realsize;
} }
#endif /* USE_CURL */
static void static void
CheckForUpdates () CheckForUpdates ()
{ {
#ifdef USE_CURL
url_data chunk; url_data chunk;
chunk.buffer = nullptr; /* we expect realloc(NULL, size) to work */ chunk.buffer = nullptr; /* we expect realloc(NULL, size) to work */
@ -503,6 +522,7 @@ CheckForUpdates ()
free (chunk.buffer); free (chunk.buffer);
curl_easy_cleanup (curl); curl_easy_cleanup (curl);
#endif /* USE_CURL */
} }
static int static int
@ -523,6 +543,10 @@ parseArgs (int argc, char * argv[], bool & exit)
{"-f", "--fullscreen"}, {"-f", "--fullscreen"},
"load in fullscreen [on;off] (default: on)", "load in fullscreen [on;off] (default: on)",
1}, 1},
{"zoom",
{"-z", "--zoom"},
"change the window scale (only if fullscreen is off) [1;2] (default: 1)",
1},
{"renderer", {"renderer",
{"-r", "--renderer"}, {"-r", "--renderer"},
"set a renderer [auto;software;accelerated] (default: auto)", "set a renderer [auto;software;accelerated] (default: auto)",
@ -584,6 +608,12 @@ parseArgs (int argc, char * argv[], bool & exit)
g_settingsOverload |= SETTING_FULLSCREEN; g_settingsOverload |= SETTING_FULLSCREEN;
} }
if (args["zoom"])
{
g_windowScale = args["zoom"];
g_settingsOverload |= SETTING_ZOOM;
}
if (args["renderer"]) if (args["renderer"])
{ {
if (args["renderer"].as<std::string> () == "auto") if (args["renderer"].as<std::string> () == "auto")
@ -622,6 +652,12 @@ DoInit (int argc, char * argv[], bool & exit)
bOK = ReadConfig (); // lit le fichier config.json bOK = ReadConfig (); // lit le fichier config.json
if (!bOK) // Something wrong with config.json file?
{
InitFail ("Game not correctly installed");
return EXIT_FAILURE;
}
auto res = SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER); auto res = SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER);
if (res < 0) if (res < 0)
return EXIT_FAILURE; return EXIT_FAILURE;
@ -652,12 +688,6 @@ DoInit (int argc, char * argv[], bool & exit)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (!bOK) // Something wrong with config.json file?
{
InitFail ("Game not correctly installed");
return EXIT_FAILURE;
}
SDL_RenderSetLogicalSize (g_renderer, LXIMAGE, LYIMAGE); SDL_RenderSetLogicalSize (g_renderer, LXIMAGE, LYIMAGE);
const auto renders = SDL_GetNumRenderDrivers (); const auto renders = SDL_GetNumRenderDrivers ();
@ -825,7 +855,7 @@ DoInit (int argc, char * argv[], bool & exit)
} }
totalDim.x = DIMTEXTX * 16; totalDim.x = DIMTEXTX * 16;
totalDim.y = DIMTEXTY * 8 * 3; totalDim.y = DIMTEXTY * 9 * 3;
iconDim.x = DIMTEXTX; iconDim.x = DIMTEXTX;
iconDim.y = DIMTEXTY; iconDim.y = DIMTEXTY;
if (!g_pPixmap->Cache (CHTEXT, "image/text.png", totalDim, iconDim)) if (!g_pPixmap->Cache (CHTEXT, "image/text.png", totalDim, iconDim))
@ -835,7 +865,7 @@ DoInit (int argc, char * argv[], bool & exit)
} }
totalDim.x = DIMLITTLEX * 16; totalDim.x = DIMLITTLEX * 16;
totalDim.y = DIMLITTLEY * 8; totalDim.y = DIMLITTLEY * 9;
iconDim.x = DIMLITTLEX; iconDim.x = DIMLITTLEX;
iconDim.y = DIMLITTLEY; iconDim.y = DIMLITTLEY;
if (!g_pPixmap->Cache (CHLITTLE, "image/little.png", totalDim, iconDim)) if (!g_pPixmap->Cache (CHLITTLE, "image/little.png", totalDim, iconDim))
@ -855,7 +885,7 @@ DoInit (int argc, char * argv[], bool & exit)
} }
// Load all cursors // Load all cursors
g_pPixmap->LoadCursors (); g_pPixmap->LoadCursors (g_windowScale);
g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison
// Create the sound manager. // Create the sound manager.
@ -902,6 +932,8 @@ DoInit (int argc, char * argv[], bool & exit)
g_pEvent->Create (g_pPixmap, g_pDecor, g_pSound, g_pMovie); g_pEvent->Create (g_pPixmap, g_pDecor, g_pSound, g_pMovie);
g_updateThread = new std::thread (CheckForUpdates); g_updateThread = new std::thread (CheckForUpdates);
g_pEvent->SetFullScreen (g_bFullScreen); g_pEvent->SetFullScreen (g_bFullScreen);
if (!g_bFullScreen)
g_pEvent->SetWindowSize (g_windowScale);
g_pEvent->ChangePhase (EV_PHASE_INTRO1); g_pEvent->ChangePhase (EV_PHASE_INTRO1);
g_bTermInit = true; g_bTermInit = true;

View File

@ -155,7 +155,7 @@ CButton::Draw ()
rect.right = m_pos.x + m_dim.x; rect.right = m_pos.x + m_dim.x;
rect.top = m_pos.y; rect.top = m_pos.y;
rect.bottom = m_pos.y + m_dim.y; rect.bottom = m_pos.y + m_dim.y;
m_pPixmap->DrawPart (-1, CHBACK, m_pos, rect, 1); // dessine le fond m_pPixmap->DrawPart (-1, CHBACK, m_pos, rect); // dessine le fond
return; return;
} }

View File

@ -71,7 +71,7 @@ protected:
bool m_bEnable; // true si bouton actif bool m_bEnable; // true si bouton actif
bool m_bHide; // true si bouton caché bool m_bHide; // true si bouton caché
Uint32 m_message; // message envoyé si bouton actionné Uint32 m_message; // message envoyé si bouton actionné
Point m_pos; // coin sup/gauche Point m_pos; // up/left corner
Point m_dim; // dimensions Point m_dim; // dimensions
Sint32 m_state; // 0=relâché, 1=pressé, +2=survollé Sint32 m_state; // 0=relâché, 1=pressé, +2=survollé
Sint32 m_mouseState; // 0=relâché, 1=pressé, +2=survollé Sint32 m_mouseState; // 0=relâché, 1=pressé, +2=survollé

View File

@ -728,13 +728,18 @@ CDecor::BlupiInitAction (Sint32 rank, Sint32 action, Sint32 direct)
if (m_blupi[rank].action == ACTION_STOP) if (m_blupi[rank].action == ACTION_STOP)
m_blupi[rank].action = ACTION_D_STOP; m_blupi[rank].action = ACTION_D_STOP;
if (m_blupi[rank].action == ACTION_PICKAXE) if (
m_blupi[rank].action == ACTION_PICKAXE ||
m_blupi[rank].action == ACTION_BUILDSEC)
m_blupi[rank].action = ACTION_D_PICKAXE; m_blupi[rank].action = ACTION_D_PICKAXE;
if (m_blupi[rank].action == ACTION_BUILD) if (m_blupi[rank].action == ACTION_BUILD)
m_blupi[rank].action = ACTION_D_BUILD; m_blupi[rank].action = ACTION_D_BUILD;
if (m_blupi[rank].action == ACTION_SAW) if (
m_blupi[rank].action == ACTION_SAW ||
m_blupi[rank].action == ACTION_BUILDSOURD ||
m_blupi[rank].action == ACTION_PIOCHESOURD)
m_blupi[rank].action = ACTION_D_SAW; m_blupi[rank].action = ACTION_D_SAW;
if (m_blupi[rank].action == ACTION_TCHAO) if (m_blupi[rank].action == ACTION_TCHAO)
@ -2008,7 +2013,7 @@ CDecor::GoalNextOp (Sint32 rank, Sint16 * pTable)
m_blupi[rank].cel = cel; m_blupi[rank].cel = cel;
BlupiPushFog (rank); BlupiPushFog (rank);
if (m_blupi[rank].bHili) if (m_blupi[rank].bHili)
SetCoin (cel, true); SetCorner (cel, true);
return true; return true;
} }
@ -2487,6 +2492,29 @@ CDecor::BlupiNextAction (Sint32 rank)
return false; return false;
} }
} }
/* Prevent Blupi to take a trap when an enemy is already captured. */
if (m_blupi[rank].perso == 0 && m_blupi[rank].action == ACTION_CARRY)
{
Sint32 ch, icon;
auto exists = this->GetObject (m_blupi[rank].goalHili, ch, icon);
if (exists && ch == CHOBJECT)
{
switch (icon)
{
case 96: // spider in trap
case 97: // track in trap
case 98: // robot in trap
BlupiInitAction (rank, ACTION_STOP);
GoalStop (rank, true);
return false;
default:
break;
}
}
}
} }
if (m_blupi[rank].clicDelay > 0) if (m_blupi[rank].clicDelay > 0)
@ -3991,7 +4019,7 @@ CDecor::BlupiGoal (Sint32 rank, Buttons button, Point cel, Point cMem)
if (direct == DIRECT_S) if (direct == DIRECT_S)
action = EV_ACTION_BOATS; action = EV_ACTION_BOATS;
if (direct == DIRECT_O) if (direct == DIRECT_W)
action = EV_ACTION_BOATO; action = EV_ACTION_BOATO;
if (direct == DIRECT_N) if (direct == DIRECT_N)
action = EV_ACTION_BOATN; action = EV_ACTION_BOATN;

View File

@ -640,7 +640,7 @@ static Sint16 table_goal_build1[] =
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1, +1, true, GOAL_GOBLUPI, +1, +1, true,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -2, true, GOAL_GOBLUPI, 0, -2, true,
GOAL_GOBLUPI, -2, 0, true, GOAL_GOBLUPI, -2, 0, true,
GOAL_ACTION, ACTION_SAW, DIRECT_S, GOAL_ACTION, ACTION_SAW, DIRECT_S,
@ -648,11 +648,11 @@ static Sint16 table_goal_build1[] =
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
// maison // maison
GOAL_BUILDOBJECT, -2, 0, CHOBJECT, 61, -1, -1, DIMOBJY / 10, 20, 10 * 100, GOAL_BUILDOBJECT, -2, 0, CHOBJECT, 61, -1, -1, DIMOBJY / 10, 20, 10 * 100,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
@ -723,11 +723,11 @@ static Sint16 table_goal_build3[] =
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
@ -752,7 +752,7 @@ static Sint16 table_goal_build4[] =
GOAL_ACTION, ACTION_SAW, DIRECT_S, GOAL_ACTION, ACTION_SAW, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -2, true, GOAL_GOBLUPI, 0, -2, true,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_ACTION, ACTION_SAW, DIRECT_S, GOAL_ACTION, ACTION_SAW, DIRECT_S,
@ -760,11 +760,11 @@ static Sint16 table_goal_build4[] =
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
// mine // mine
GOAL_BUILDOBJECT, -2, 0, CHOBJECT, 122, -1, -1, DIMOBJY / 10, 20, 10 * 100, GOAL_BUILDOBJECT, -2, 0, CHOBJECT, 122, -1, -1, DIMOBJY / 10, 20, 10 * 100,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
@ -801,11 +801,11 @@ static Sint16 table_goal_build5[] =
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_O, GOAL_ACTION, ACTION_BUILDSOURD, DIRECT_W,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
@ -876,16 +876,16 @@ static Sint16 table_goal_mur[] =
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_S, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_S,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_S, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_S,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_TCHAO, DIRECT_E, GOAL_ACTION, ACTION_TCHAO, DIRECT_E,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
@ -911,16 +911,16 @@ static Sint16 table_goal_tour[] =
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_PUTOBJECT, -1, 0, -1, -1, // enlève les pierres GOAL_PUTOBJECT, -1, 0, -1, -1, // enlève les pierres
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_W,
GOAL_ACTION, ACTION_STOP, DIRECT_S, GOAL_ACTION, ACTION_STOP, DIRECT_S,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_ARRANGEOBJECT, -1, -1, GOAL_ARRANGEOBJECT, -1, -1,
@ -1317,7 +1317,7 @@ static Sint16 table_goal_labo[] =
GOAL_ADDMOVES, -1, -1, 10, // secoue GOAL_ADDMOVES, -1, -1, 10, // secoue
GOAL_CACHE, true, false, GOAL_CACHE, true, false,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_LABO, GOAL_SOUND, SOUND_LABO,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
@ -1785,7 +1785,7 @@ static Sint16 table_goal_pontol[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_BUILDOBJECT, -10, -10, CHOBJECT, 72, -1, -1, DIMOBJY, 1, -1 * 100, GOAL_BUILDOBJECT, -10, -10, CHOBJECT, 72, -1, -1, DIMOBJY, 1, -1 * 100,
GOAL_ADDMOVES, -10, -10, 7, // pont vers l'ouest GOAL_ADDMOVES, -10, -10, 7, // pont vers l'ouest
GOAL_ACTION, ACTION_BRIDGE, DIRECT_O, GOAL_ACTION, ACTION_BRIDGE, DIRECT_W,
GOAL_GROUP, 4, GOAL_GROUP, 4,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_PUTOBJECT, -10, -10, -1, -1, GOAL_PUTOBJECT, -10, -10, -1, -1,
@ -1798,7 +1798,7 @@ static Sint16 table_goal_pontol[] =
GOAL_PUTFLOOR, -10, -10, CHFLOOR, -2, // vIcon GOAL_PUTFLOOR, -10, -10, CHFLOOR, -2, // vIcon
GOAL_SOUND, SOUND_PLOUF, GOAL_SOUND, SOUND_PLOUF,
//? GOAL_GOBLUPI, 0,-1, true, //? GOAL_GOBLUPI, 0,-1, true,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_TERM, GOAL_TERM,
0 0
}; };
@ -1982,7 +1982,7 @@ static Sint16 table_goal_bateauo[] =
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_BUILDOBJECT, -1, 0, CHOBJECT, 117, -1, -1, DIMOBJY, 1, -1 * 100, GOAL_BUILDOBJECT, -1, 0, CHOBJECT, 117, -1, -1, DIMOBJY, 1, -1 * 100,
GOAL_ADDMOVES, -1, 0, 7, // bateau vers l'ouest GOAL_ADDMOVES, -1, 0, 7, // bateau vers l'ouest
GOAL_ACTION, ACTION_BRIDGE, DIRECT_O, GOAL_ACTION, ACTION_BRIDGE, DIRECT_W,
GOAL_GROUP, 4, GOAL_GROUP, 4,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_PUTOBJECT, -1, 0, -1, -1, GOAL_PUTOBJECT, -1, 0, -1, -1,
@ -2227,7 +2227,7 @@ static Sint16 table_goal_r_build1[] =
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_E, GOAL_ACTION, ACTION_R_APLAT, DIRECT_E,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_O, GOAL_ACTION, ACTION_R_BUILD, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_E, GOAL_ACTION, ACTION_R_BUILD, DIRECT_E,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
@ -2235,7 +2235,7 @@ static Sint16 table_goal_r_build1[] =
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_E, GOAL_ACTION, ACTION_R_BUILD, DIRECT_E,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_S, GOAL_ACTION, ACTION_R_STOP, DIRECT_S,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_TERM, GOAL_TERM,
@ -2265,7 +2265,7 @@ static Sint16 table_goal_r_build2[] =
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_E, GOAL_ACTION, ACTION_R_APLAT, DIRECT_E,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
@ -2273,7 +2273,7 @@ static Sint16 table_goal_r_build2[] =
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_S, GOAL_ACTION, ACTION_R_APLAT, DIRECT_S,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_S, GOAL_ACTION, ACTION_R_STOP, DIRECT_S,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_TERM, GOAL_TERM,
@ -2301,7 +2301,7 @@ static Sint16 table_goal_r_build3[] =
GOAL_BUILDOBJECT, -1, -1, CHOBJECT, 102, -1, -1, DIMOBJY / 4, 20, 4 * 100, GOAL_BUILDOBJECT, -1, -1, CHOBJECT, 102, -1, -1, DIMOBJY / 4, 20, 4 * 100,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_E, GOAL_ACTION, ACTION_R_BUILD, DIRECT_E,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_N, GOAL_ACTION, ACTION_R_BUILD, DIRECT_N,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
@ -2341,7 +2341,7 @@ static Sint16 table_goal_r_build4[] =
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
@ -2379,7 +2379,7 @@ static Sint16 table_goal_r_build5[] =
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
@ -2417,7 +2417,7 @@ static Sint16 table_goal_r_build6[] =
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, +1, 0, true, GOAL_GOBLUPI, +1, 0, true,
GOAL_ACTION, ACTION_R_APLAT, DIRECT_O, GOAL_ACTION, ACTION_R_APLAT, DIRECT_W,
GOAL_GOBLUPI, 0, +1, true, GOAL_GOBLUPI, 0, +1, true,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_S, GOAL_ACTION, ACTION_R_BUILD, DIRECT_S,
GOAL_GOBLUPI, 0, -1, true, GOAL_GOBLUPI, 0, -1, true,
@ -2440,17 +2440,17 @@ static Sint16 table_goal_r_make1[] =
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_USINEFREE, -1, -1, GOAL_USINEFREE, -1, -1,
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_O, GOAL_ACTION, ACTION_R_BUILD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_O, GOAL_ACTION, ACTION_R_BUILD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_O, GOAL_ACTION, ACTION_R_BUILD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_LOAD, DIRECT_O, GOAL_ACTION, ACTION_R_LOAD, DIRECT_W,
GOAL_ACTION, ACTION_R_BUILD, DIRECT_O, GOAL_ACTION, ACTION_R_BUILD, DIRECT_W,
GOAL_TERM, GOAL_TERM,
0 0
}; };
@ -2465,11 +2465,11 @@ static Sint16 table_goal_r_make2[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_PUTOBJECT, -2, -1, CHOBJECT, 101, // ouvre la porte GOAL_PUTOBJECT, -2, -1, CHOBJECT, 101, // ouvre la porte
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -2530,11 +2530,11 @@ static Sint16 table_goal_r_make3[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_PUTOBJECT, -2, -1, CHOBJECT, 103, // ouvre la porte GOAL_PUTOBJECT, -2, -1, CHOBJECT, 103, // ouvre la porte
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -2594,11 +2594,11 @@ static Sint16 table_goal_r_make4[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_PUTOBJECT, -2, -1, CHOBJECT, 105, // ouvre la porte GOAL_PUTOBJECT, -2, -1, CHOBJECT, 105, // ouvre la porte
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -2658,11 +2658,11 @@ static Sint16 table_goal_r_make5[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_PUTOBJECT, -2, -1, CHOBJECT, 116, // ouvre la porte GOAL_PUTOBJECT, -2, -1, CHOBJECT, 116, // ouvre la porte
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -2722,11 +2722,11 @@ static Sint16 table_goal_r_make6[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_PUTOBJECT, -2, -1, CHOBJECT, 18, // ouvre la porte GOAL_PUTOBJECT, -2, -1, CHOBJECT, 18, // ouvre la porte
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_ACTION, ACTION_R_STOP, DIRECT_O, GOAL_ACTION, ACTION_R_STOP, DIRECT_W,
GOAL_GOBLUPI, -1, 0, true, GOAL_GOBLUPI, -1, 0, true,
GOAL_SOUND, SOUND_DOOR, GOAL_SOUND, SOUND_DOOR,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -2940,7 +2940,7 @@ static Sint16 table_goal_drapeau3[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, 0, -1, GOAL_WORK, 0, -1,
GOAL_BUILDOBJECT, 0, -1, CHOBJECT, 124, -1, -1, DIMOBJY / 10, 8, 10 * 100, GOAL_BUILDOBJECT, 0, -1, CHOBJECT, 124, -1, -1, DIMOBJY / 10, 8, 10 * 100,
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_O, GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_W,
GOAL_GOBLUPI, +1, -1, true, GOAL_GOBLUPI, +1, -1, true,
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E, GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E,
GOAL_ADDDRAPEAU, -1, 0, GOAL_ADDDRAPEAU, -1, 0,
@ -2968,7 +2968,7 @@ static Sint16 table_goal_extrait[] =
GOAL_ADDMOVES, -1, -1, 11, // secoue GOAL_ADDMOVES, -1, -1, 11, // secoue
GOAL_CACHE, true, false, GOAL_CACHE, true, false,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_MINE, GOAL_SOUND, SOUND_MINE,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -3015,7 +3015,7 @@ static Sint16 table_goal_fabjeep[] =
GOAL_ADDMOVES, -1, -1, 12, // secoue GOAL_ADDMOVES, -1, -1, 12, // secoue
GOAL_CACHE, true, false, GOAL_CACHE, true, false,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_USINE, GOAL_SOUND, SOUND_USINE,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -3058,7 +3058,7 @@ static Sint16 table_goal_fabarmure[] =
GOAL_ADDMOVES, -1, -1, 12, // secoue GOAL_ADDMOVES, -1, -1, 12, // secoue
GOAL_CACHE, true, false, GOAL_CACHE, true, false,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_USINE, GOAL_SOUND, SOUND_USINE,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -3101,7 +3101,7 @@ static Sint16 table_goal_fabmine[] =
GOAL_ADDMOVES, -1, -1, 12, // secoue GOAL_ADDMOVES, -1, -1, 12, // secoue
GOAL_CACHE, true, false, GOAL_CACHE, true, false,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_USINE, GOAL_SOUND, SOUND_USINE,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
@ -3150,7 +3150,7 @@ static Sint16 table_goal_fabdisc[] =
GOAL_BUILDOBJECT, 0, -1, CHOBJECT, 119, -1, -1, DIMOBJY, 1, -1 * 100, GOAL_BUILDOBJECT, 0, -1, CHOBJECT, 119, -1, -1, DIMOBJY, 1, -1 * 100,
GOAL_ADDMOVES, 0, -1, 12, // secoue GOAL_ADDMOVES, 0, -1, 12, // secoue
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_O, GOAL_ACTION, ACTION_STOP, DIRECT_W,
GOAL_SOUND, SOUND_USINE, GOAL_SOUND, SOUND_USINE,
GOAL_ACTION, ACTION_LABO, DIRECT_E, GOAL_ACTION, ACTION_LABO, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,

View File

@ -136,7 +136,7 @@ CDecor::Write (Sint32 rank, bool bUser, Sint32 world, Sint32 time, Sint32 total)
pBuffer->majRev = 1; pBuffer->majRev = 1;
pBuffer->minRev = 5; pBuffer->minRev = 5;
pBuffer->celCoin = m_celCoin; pBuffer->celCoin = m_celCorner;
pBuffer->world = world; pBuffer->world = world;
pBuffer->time = time; pBuffer->time = time;
pBuffer->totalTime = total; pBuffer->totalTime = total;
@ -255,7 +255,7 @@ CDecor::Read (
goto error; goto error;
} }
SetCoin (pBuffer->celCoin); SetCorner (pBuffer->celCoin);
if (bUser) if (bUser)
{ {
world = pBuffer->world; world = pBuffer->world;
@ -511,7 +511,7 @@ CDecor::Flush ()
m_celHome.x = 90; m_celHome.x = 90;
m_celHome.y = 98; m_celHome.y = 98;
SetCoin (m_celHome); SetCorner (m_celHome);
InitAfterBuild (); InitAfterBuild ();
LoadImages (); LoadImages ();
} }

View File

@ -114,8 +114,8 @@ CDecor::ConvCelToMap (Point cel)
{ {
Point pos; Point pos;
pos.x = (cel.x - m_celCoin.x) - (cel.y - m_celCoin.y); pos.x = (cel.x - m_celCorner.x) - (cel.y - m_celCorner.y);
pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) / 2; pos.y = ((cel.x - m_celCorner.x) + (cel.y - m_celCorner.y)) / 2;
pos.x += (DIMMAPX - MAPCADREX) / 2; pos.x += (DIMMAPX - MAPCADREX) / 2;
pos.y += (DIMMAPY - MAPCADREY) / 2; pos.y += (DIMMAPY - MAPCADREY) / 2;
@ -136,8 +136,8 @@ CDecor::ConvMapToCel (Point pos)
cel.x = pos.y + pos.x / 2; cel.x = pos.y + pos.x / 2;
cel.y = pos.y - pos.x / 2; cel.y = pos.y - pos.x / 2;
cel.x += m_celCoin.x; cel.x += m_celCorner.x;
cel.y += m_celCoin.y; cel.y += m_celCorner.y;
return cel; return cel;
} }
@ -158,7 +158,7 @@ CDecor::MapMove (Point pos)
cel = ConvMapToCel (pos); cel = ConvMapToCel (pos);
cel.x = cel.x - 10; cel.x = cel.x - 10;
cel.y = cel.y; cel.y = cel.y;
SetCoin (cel); SetCorner (cel);
NextPhase (0); // faudra refaire la carte tout de suite NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }
@ -533,6 +533,16 @@ CDecor::GenerateMap ()
if (m_blupi[rank].bExist) if (m_blupi[rank].bExist)
{ {
pos = ConvCelToMap (m_blupi[rank].cel); pos = ConvCelToMap (m_blupi[rank].cel);
if (this->GetSkill () >= 1 && !m_bBuild)
{
auto fogCel = m_blupi[rank].cel;
fogCel.x = (fogCel.x / 4) * 4;
fogCel.y = (fogCel.y / 4) * 4;
if (m_decor[fogCel.x / 2][fogCel.y / 2].fog == FOGHIDE) // hidden?
continue;
}
if ( if (
pos.x >= 0 && pos.x < DIMMAPX - 1 && pos.y >= 0 && pos.y < DIMMAPY - 1) pos.x >= 0 && pos.x < DIMMAPX - 1 && pos.y >= 0 && pos.y < DIMMAPY - 1)
{ {
@ -550,7 +560,7 @@ CDecor::GenerateMap ()
} }
// Dessine le cadre. // Dessine le cadre.
cel = m_celCoin; cel = m_celCorner;
pos = ConvCelToMap (cel); pos = ConvCelToMap (cel);
for (i = pos.x; i < pos.x + MAPCADREX; i++) for (i = pos.x; i < pos.x + MAPCADREX; i++)

View File

@ -90,14 +90,14 @@ GetVector (Sint32 direct)
case DIRECT_S: case DIRECT_S:
vector.y = +1; vector.y = +1;
break; break;
case DIRECT_SO: case DIRECT_SW:
vector.x = -1; vector.x = -1;
vector.y = +1; vector.y = +1;
break; break;
case DIRECT_O: case DIRECT_W:
vector.x = -1; vector.x = -1;
break; break;
case DIRECT_NO: case DIRECT_NW:
vector.x = -1; vector.x = -1;
vector.y = -1; vector.y = -1;
break; break;
@ -119,8 +119,8 @@ CDecor::CDecor ()
m_pSound = nullptr; m_pSound = nullptr;
m_pUndoDecor = nullptr; m_pUndoDecor = nullptr;
m_celCoin.x = 90; m_celCorner.x = 90;
m_celCoin.y = 98; m_celCorner.y = 98;
m_celHili.x = -1; m_celHili.x = -1;
m_celOutline1.x = -1; m_celOutline1.x = -1;
@ -465,8 +465,8 @@ CDecor::ConvCelToPos (Point cel)
{ {
Point pos; Point pos;
pos.x = ((cel.x - m_celCoin.x) - (cel.y - m_celCoin.y)) * (DIMCELX / 2); pos.x = ((cel.x - m_celCorner.x) - (cel.y - m_celCorner.y)) * (DIMCELX / 2);
pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) * (DIMCELY / 2); pos.y = ((cel.x - m_celCorner.x) + (cel.y - m_celCorner.y)) * (DIMCELY / 2);
pos.x += POSDRAWX + m_shiftOffset.x; pos.x += POSDRAWX + m_shiftOffset.x;
pos.y += POSDRAWY + m_shiftOffset.y; pos.y += POSDRAWY + m_shiftOffset.y;
@ -500,8 +500,8 @@ CDecor::ConvPosToCel (Point pos, bool bMap)
cel.y -= (DIMCELX * DIMCELY); cel.y -= (DIMCELX * DIMCELY);
cel.y /= (DIMCELX * DIMCELY); cel.y /= (DIMCELX * DIMCELY);
cel.x += m_celCoin.x; cel.x += m_celCorner.x;
cel.y += m_celCoin.y; cel.y += m_celCorner.y;
return cel; return cel;
} }
@ -516,19 +516,19 @@ CDecor::ConvPosToCel2 (Point pos)
pos.x -= POSDRAWX + DIMCELX / 2; pos.x -= POSDRAWX + DIMCELX / 2;
pos.y -= POSDRAWY; pos.y -= POSDRAWY;
if (m_celCoin.x % 2 != 0 && m_celCoin.y % 2 == 0) if (m_celCorner.x % 2 != 0 && m_celCorner.y % 2 == 0)
{ {
pos.x += DIMCELX / 2; pos.x += DIMCELX / 2;
pos.y += DIMCELY / 2; pos.y += DIMCELY / 2;
} }
if (m_celCoin.x % 2 == 0 && m_celCoin.y % 2 != 0) if (m_celCorner.x % 2 == 0 && m_celCorner.y % 2 != 0)
{ {
pos.x -= DIMCELX / 2; pos.x -= DIMCELX / 2;
pos.y += DIMCELY / 2; pos.y += DIMCELY / 2;
} }
if (m_celCoin.x % 2 != 0 && m_celCoin.y % 2 != 0) if (m_celCorner.x % 2 != 0 && m_celCorner.y % 2 != 0)
pos.y += DIMCELY; pos.y += DIMCELY;
cel.x = cel.x =
@ -539,8 +539,8 @@ CDecor::ConvPosToCel2 (Point pos)
cel.y -= (DIMCELX * 2 * DIMCELY * 2); cel.y -= (DIMCELX * 2 * DIMCELY * 2);
cel.y /= (DIMCELX * 2 * DIMCELY * 2); cel.y /= (DIMCELX * 2 * DIMCELY * 2);
cel.x = (cel.x * 2 + m_celCoin.x) / 2 * 2; cel.x = (cel.x * 2 + m_celCorner.x) / 2 * 2;
cel.y = (cel.y * 2 + m_celCoin.y) / 2 * 2; cel.y = (cel.y * 2 + m_celCorner.y) / 2 * 2;
return cel; return cel;
} }
@ -684,7 +684,7 @@ CDecor::BuildMoveFloor (Sint32 x, Sint32 y, Point pos, Sint32 rank)
m_move[rank].maskChannel, icon, m_move[rank].channel, m_move[rank].icon, m_move[rank].maskChannel, icon, m_move[rank].channel, m_move[rank].icon,
0); 0);
m_pPixmap->DrawIcon (-1, m_move[rank].channel, 0, pos, true); m_pPixmap->DrawIcon (-1, m_move[rank].channel, 0, pos);
} }
else else
{ {
@ -2985,8 +2985,8 @@ CDecor::GetResHili (Point posMouse)
{ {
Sint32 icon; Sint32 icon;
// Les valeurs `corner == true` correspondent aux objets placés // The `corner == true` values are corresponding to the objects
// au coin inf/droit de la cellule. // positionned at the bottom/right corner of the cell.
struct object_t { struct object_t {
bool corner; bool corner;
const char * text; const char * text;
@ -3261,33 +3261,33 @@ CDecor::HideTooltips (bool bHide)
// Modifie l'origine supérieure/gauche du décor. // Modifie l'origine supérieure/gauche du décor.
void void
CDecor::SetCoin (Point coin, bool bCenter) CDecor::SetCorner (Point corner, bool bCenter)
{ {
if (bCenter) if (bCenter)
{ {
coin.x -= 10; corner.x -= 10;
coin.y -= 2; corner.y -= 2;
} }
if (coin.x < -8) if (corner.x < -8)
coin.x = -8; corner.x = -8;
if (coin.x > MAXCELX - 12) if (corner.x > MAXCELX - 12)
coin.x = MAXCELX - 12; corner.x = MAXCELX - 12;
if (coin.y < -2) if (corner.y < -2)
coin.y = -2; corner.y = -2;
if (coin.y > MAXCELY - 4) if (corner.y > MAXCELY - 4)
coin.y = MAXCELY - 4; corner.y = MAXCELY - 4;
m_celCoin = coin; m_celCorner = corner;
m_bGroundRedraw = true; // faudra redessiner les sols m_bGroundRedraw = true; // faudra redessiner les sols
m_celHili.x = -1; m_celHili.x = -1;
m_textLastPos.x = -1; // tooltips plus lavable ! m_textLastPos.x = -1; // tooltips plus lavable !
} }
Point Point
CDecor::GetCoin () CDecor::GetCorner ()
{ {
return m_celCoin; return m_celCorner;
} }
Point Point
@ -3312,7 +3312,7 @@ CDecor::MemoPos (Sint32 rank, bool bRecord)
if (bRecord) if (bRecord)
{ {
m_pSound->PlayImage (SOUND_CLOSE, pos); m_pSound->PlayImage (SOUND_CLOSE, pos);
m_memoPos[rank] = m_celCoin; m_memoPos[rank] = m_celCorner;
} }
else else
{ {
@ -3321,7 +3321,7 @@ CDecor::MemoPos (Sint32 rank, bool bRecord)
else else
{ {
m_pSound->PlayImage (SOUND_GOAL, pos); m_pSound->PlayImage (SOUND_GOAL, pos);
SetCoin (m_memoPos[rank], false); SetCorner (m_memoPos[rank], false);
} }
} }
} }

View File

@ -406,8 +406,8 @@ public:
bool GetObject (Point cel, Sint32 & channel, Sint32 & icon); bool GetObject (Point cel, Sint32 & channel, Sint32 & icon);
bool SetFire (Point cel, bool bFire); bool SetFire (Point cel, bool bFire);
void SetCoin (Point coin, bool bCenter = false); void SetCorner (Point corner, bool bCenter = false);
Point GetCoin (); Point GetCorner ();
Point GetHome (); Point GetHome ();
void MemoPos (Sint32 rank, bool bRecord); void MemoPos (Sint32 rank, bool bRecord);
@ -467,7 +467,7 @@ protected:
Sint16 m_rankBlupi[MAXCELX][MAXCELY]; Sint16 m_rankBlupi[MAXCELX][MAXCELY];
Blupi m_blupi[MAXBLUPI]; Blupi m_blupi[MAXBLUPI];
Move m_move[MAXMOVE]; Move m_move[MAXMOVE];
Point m_celCoin; // cellule sup/gauche Point m_celCorner; // cellule sup/gauche
Point m_celHome; // pour touche Home Point m_celHome; // pour touche Home
Point m_celHili; Point m_celHili;
Point m_celOutline1; Point m_celOutline1;

View File

@ -472,9 +472,22 @@ CDecor::StatisticUpdate ()
} }
if (m_blupi[rank].perso == 8) // disciple ? if (m_blupi[rank].perso == 8) // disciple ?
table_statistic[STATDISCIPLE].nb++; table_statistic[STATDISCIPLE].nb++;
// Hide enemies from the stat when hidden by the fog
bool hide = false;
if (this->GetSkill () >= 1 && this->m_bFog)
{
auto fogCel = m_blupi[rank].cel;
fogCel.x = (fogCel.x / 4) * 4;
fogCel.y = (fogCel.y / 4) * 4;
if (m_decor[fogCel.x / 2][fogCel.y / 2].fog == FOGHIDE) // hidden?
hide = true;
}
if (m_blupi[rank].perso == 4) // robot ? if (m_blupi[rank].perso == 4) // robot ?
{ {
table_statistic[STATROBOT].nb++; if (!hide)
table_statistic[STATROBOT].nb++;
m_nbStatRobots++; m_nbStatRobots++;
x = (m_blupi[rank].cel.x / 2) * 2; x = (m_blupi[rank].cel.x / 2) * 2;
y = (m_blupi[rank].cel.y / 2) * 2; y = (m_blupi[rank].cel.y / 2) * 2;
@ -485,27 +498,32 @@ CDecor::StatisticUpdate ()
} }
if (m_blupi[rank].perso == 3) // tracks ? if (m_blupi[rank].perso == 3) // tracks ?
{ {
table_statistic[STATTRACKS].nb++; if (!hide)
table_statistic[STATTRACKS].nb++;
if (!m_term.bHachRobot) // pas robot sur hachures ? if (!m_term.bHachRobot) // pas robot sur hachures ?
m_nbStatRobots++; m_nbStatRobots++;
} }
if (m_blupi[rank].perso == 1) // araignée ? if (m_blupi[rank].perso == 1) // araignée ?
{ {
table_statistic[STATARAIGNEE].nb++; if (!hide)
table_statistic[STATARAIGNEE].nb++;
if (!m_term.bHachRobot) // pas robot sur hachures ? if (!m_term.bHachRobot) // pas robot sur hachures ?
m_nbStatRobots++; m_nbStatRobots++;
} }
if (m_blupi[rank].perso == 2) // virus ? if (m_blupi[rank].perso == 2) // virus ?
table_statistic[STATVIRUS].nb++; if (!hide)
table_statistic[STATVIRUS].nb++;
if (m_blupi[rank].perso == 5) // bombe ? if (m_blupi[rank].perso == 5) // bombe ?
{ {
table_statistic[STATBOMBE].nb++; if (!hide)
table_statistic[STATBOMBE].nb++;
if (!m_term.bHachRobot) // pas robot sur hachures ? if (!m_term.bHachRobot) // pas robot sur hachures ?
m_nbStatRobots++; m_nbStatRobots++;
} }
if (m_blupi[rank].perso == 7) // électro ? if (m_blupi[rank].perso == 7) // électro ?
{ {
table_statistic[STATELECTRO].nb++; if (!hide)
table_statistic[STATELECTRO].nb++;
if (!m_term.bHachRobot) // pas robot sur hachures ? if (!m_term.bHachRobot) // pas robot sur hachures ?
m_nbStatRobots++; m_nbStatRobots++;
} }
@ -675,7 +693,7 @@ CDecor::StatisticDraw ()
rect.top = pos.y; rect.top = pos.y;
rect.bottom = pos.y + DIMSTATY; rect.bottom = pos.y + DIMSTATY;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); // dessine le fond m_pPixmap->DrawPart (-1, CHBACK, pos, rect); // dessine le fond
if (rank == 0 && m_bStatUp) if (rank == 0 && m_bStatUp)
{ {
@ -750,7 +768,7 @@ CDecor::StatisticDraw ()
rect.right = pos.x + POSDRAWX; rect.right = pos.x + POSDRAWX;
rect.top = pos.y; rect.top = pos.y;
rect.bottom = pos.y + 16; rect.bottom = pos.y + 16;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); // dessine le fond m_pPixmap->DrawPart (-1, CHBACK, pos, rect); // dessine le fond
if (strlen (textRes)) if (strlen (textRes))
{ {
@ -956,7 +974,7 @@ CDecor::StatisticDown (Point pos)
return false; return false;
select: select:
SetCoin (cel, true); SetCorner (cel, true);
NextPhase (0); // faudra refaire la carte tout de suite NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }
@ -1009,6 +1027,14 @@ CDecor::StatisticDetect (Point pos)
if (rank >= STATNB) if (rank >= STATNB)
return -1; return -1;
auto pStatistic = StatisticGet (rank);
if (
this->GetSkill () >= 1 && pStatistic->perso >= 0 &&
(pStatistic->perso != 0 && pStatistic->perso != 8))
{
return -1;
}
return rank; return rank;
} }

View File

@ -23,50 +23,50 @@
#include <SDL2/SDL_stdinc.h> #include <SDL2/SDL_stdinc.h>
// clang-format off // clang-format off
#define _INTRO true // true si images d'introduction #define _INTRO true // true for init screen
#define SCRFACTOR 4 / 3
#define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LXIMAGE (480 * SCRFACTOR + (480 * SCRFACTOR) % 2) // window size
#define LYIMAGE 480 #define LYIMAGE 480
#define POSDRAWX 144 // surface de dessin #define POSDRAWX 144 // draw surface
#define POSDRAWY 15 #define POSDRAWY 15
#define DIMDRAWX 480 #define DIMDRAWX (LXIMAGE - (640 - 480))
#define DIMDRAWY 450 #define DIMDRAWY 450
#define POSMAPX 8 // surface pour la carte #define POSMAPX 8 // map surface
#define POSMAPY 15 #define POSMAPY 15
#define DIMMAPX 128 #define DIMMAPX 128
#define DIMMAPY 128 #define DIMMAPY 128
#define MAXCELX 200 // nb max de cellules d'un monde #define MAXCELX 200 // max cells for a world
#define MAXCELY 200 #define MAXCELY 200
#define DIMCELX 60 // dimensions d'une cellule (décor) #define DIMCELX 60 // cell size (decor)
#define DIMCELY 30 #define DIMCELY 30
#define DIMOBJX 120 // dimensions d'un objet #define DIMOBJX 120 // object size
#define DIMOBJY 120 #define DIMOBJY 120
#define DIMBLUPIX 60 // dimensions de blupi #define DIMBLUPIX 60 // Blupi size
#define DIMBLUPIY 60 #define DIMBLUPIY 60
#define SHIFTBLUPIY 5 // petit décalage vers le haut #define SHIFTBLUPIY 5 // shift on top
#define DIMBUTTONX 40 // dimensions d'un button #define DIMBUTTONX 40 // button size
#define DIMBUTTONY 40 #define DIMBUTTONY 40
#define DIMJAUGEX 124 // dimensions de la jauge #define DIMJAUGEX 124 // progress size
#define DIMJAUGEY 22 #define DIMJAUGEY 22
#define POSSTATX 12 // statistiques #define POSSTATX 12 // statistics
#define POSSTATY 220 #define POSSTATY 220
#define DIMSTATX 60 #define DIMSTATX 60
#define DIMSTATY 30 #define DIMSTATY 30
#define DIMTEXTX 16 // dimensions max d'un caractère #define DIMTEXTX 16 // max char size
#define DIMTEXTY 16 #define DIMTEXTY 16
#define DIMLITTLEX 16 // dimensions max d'un petit caractère #define DIMLITTLEX 16 // max small char size
#define DIMLITTLEY 12 #define DIMLITTLEY 12
#define CHBACK 0 #define CHBACK 0
@ -94,9 +94,9 @@ enum Directions {
DIRECT_E = (0 * 16), // east DIRECT_E = (0 * 16), // east
DIRECT_SE = (1 * 16), // south-east DIRECT_SE = (1 * 16), // south-east
DIRECT_S = (2 * 16), // south DIRECT_S = (2 * 16), // south
DIRECT_SO = (3 * 16), // south-west DIRECT_SW = (3 * 16), // south-west
DIRECT_O = (4 * 16), // west DIRECT_W = (4 * 16), // west
DIRECT_NO = (5 * 16), // north-west DIRECT_NW = (5 * 16), // north-west
DIRECT_N = (6 * 16), // north DIRECT_N = (6 * 16), // north
DIRECT_NE = (7 * 16), // north-east DIRECT_NE = (7 * 16), // north-east
}; };

View File

@ -1259,63 +1259,69 @@ static Phase table[] =
{ {
EV_BUTTON1, EV_BUTTON1,
0, {1, 40}, 0, {1, 40},
170 + 42 * 0, 30 + 42 * 0, 170 + 42 * 1, 30 + 42 * 0,
{ translate ("No music") }, { translate ("No music") },
}, },
{ {
EV_BUTTON2, EV_BUTTON2,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 1, 170 + 42 * 0, 30 + 42 * 0,
{ translate ("Music number 1") }, { translate ("Music number 1") },
}, },
{ {
EV_BUTTON3, EV_BUTTON3,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 2, 170 + 42 * 0, 30 + 42 * 1,
{ translate ("Music number 2") }, { translate ("Music number 2") },
}, },
{ {
EV_BUTTON4, EV_BUTTON4,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 3, 170 + 42 * 0, 30 + 42 * 2,
{ translate ("Music number 3") }, { translate ("Music number 3") },
}, },
{ {
EV_BUTTON5, EV_BUTTON5,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 4, 170 + 42 * 0, 30 + 42 * 3,
{ translate ("Music number 4") }, { translate ("Music number 4") },
}, },
{ {
EV_BUTTON6, EV_BUTTON6,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 5, 170 + 42 * 0, 30 + 42 * 4,
{ translate ("Music number 5") }, { translate ("Music number 5") },
}, },
{ {
EV_BUTTON7, EV_BUTTON7,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 6, 170 + 42 * 0, 30 + 42 * 5,
{ translate ("Music number 6") }, { translate ("Music number 6") },
}, },
{ {
EV_BUTTON8, EV_BUTTON8,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 7, 170 + 42 * 0, 30 + 42 * 6,
{ translate ("Music number 7") }, { translate ("Music number 7") },
}, },
{ {
EV_BUTTON9, EV_BUTTON9,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 8, 170 + 42 * 0, 30 + 42 * 7,
{ translate ("Music number 8") }, { translate ("Music number 8") },
}, },
{ {
EV_BUTTON10, EV_BUTTON10,
0, {1, 44}, 0, {1, 44},
170 + 42 * 0, 30 + 42 * 9, 170 + 42 * 0, 30 + 42 * 8,
{ translate ("Music number 9") }, { translate ("Music number 9") },
}, },
{
EV_BUTTON11,
0, {1, 44},
170 + 42 * 0, 30 + 42 * 9,
{ translate ("Music number 10") },
},
{ {
EV_PHASE_BUILD, EV_PHASE_BUILD,
0, {1, 50}, 0, {1, 50},
@ -1546,7 +1552,6 @@ CEvent::CEvent ()
m_bSpeed = false; m_bSpeed = false;
m_bHelp = false; m_bHelp = false;
m_bAllMissions = false; m_bAllMissions = false;
m_bChangeCheat = false;
m_scrollSpeed = 1; m_scrollSpeed = 1;
m_bPause = false; m_bPause = false;
m_bShift = false; m_bShift = false;
@ -1588,6 +1593,8 @@ CEvent::CEvent ()
m_Languages.push_back (Language::en_US); m_Languages.push_back (Language::en_US);
m_Languages.push_back (Language::fr); m_Languages.push_back (Language::fr);
m_Languages.push_back (Language::de); m_Languages.push_back (Language::de);
m_Languages.push_back (Language::it);
m_Languages.push_back (Language::pl);
this->m_LangStart = GetLocale (); this->m_LangStart = GetLocale ();
@ -1597,6 +1604,10 @@ CEvent::CEvent ()
m_Lang = m_Languages.begin () + 2; m_Lang = m_Languages.begin () + 2;
else if (this->m_LangStart == "de") else if (this->m_LangStart == "de")
m_Lang = m_Languages.begin () + 3; m_Lang = m_Languages.begin () + 3;
else if (this->m_LangStart == "it")
m_Lang = m_Languages.begin () + 4;
else if (this->m_LangStart == "pl")
m_Lang = m_Languages.begin () + 5;
else else
m_Lang = m_Languages.begin (); m_Lang = m_Languages.begin ();
@ -1648,6 +1659,7 @@ CEvent::SetFullScreen (bool bFullScreen)
SDL_SetWindowPosition ( SDL_SetWindowPosition (
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
m_pPixmap->LoadCursors (m_WindowScale);
m_pPixmap->ReloadTargetTextures (); m_pPixmap->ReloadTargetTextures ();
/* Force this update before otherwise the coordinates retrieved with /* Force this update before otherwise the coordinates retrieved with
@ -1661,6 +1673,33 @@ CEvent::SetFullScreen (bool bFullScreen)
CEvent::PushUserEvent (EV_WARPMOUSE, coord); CEvent::PushUserEvent (EV_WARPMOUSE, coord);
} }
/**
* \brief Change the size of the window.
*
* We use an integer scale to be sure that the pixels are always well formed.
*
* \param[in] newScale - The new scale.
*/
void
CEvent::SetWindowSize (Uint8 newScale)
{
if (newScale == m_WindowScale)
return;
auto scale = m_WindowScale;
m_WindowScale = newScale;
switch (newScale)
{
case 1:
case 2:
SetWindowSize (scale, m_WindowScale);
break;
default:
return;
}
}
/** /**
* \brief Change the size of the window. * \brief Change the size of the window.
* *
@ -1679,6 +1718,7 @@ CEvent::SetWindowSize (Uint8 prevScale, Uint8 newScale)
SDL_SetWindowPosition ( SDL_SetWindowPosition (
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
m_pPixmap->LoadCursors (newScale);
m_pPixmap->ReloadTargetTextures (); m_pPixmap->ReloadTargetTextures ();
/* Force this update before otherwise the coordinates retrieved with /* Force this update before otherwise the coordinates retrieved with
@ -1930,12 +1970,10 @@ CEvent::DrawButtons ()
bool bEnable; bool bEnable;
if ( if (
(m_phase == EV_PHASE_PLAY && m_bChangeCheat) || (m_phase == EV_PHASE_PLAY) ||
(m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_INSERT && (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_INSERT &&
m_phase != EV_PHASE_INTRO1 && m_phase != EV_PHASE_BYE)) m_phase != EV_PHASE_INTRO1 && m_phase != EV_PHASE_BYE))
{ {
m_bChangeCheat = false;
text[0] = 0; text[0] = 0;
if (m_bAllMissions) if (m_bAllMissions)
AddCheatCode (text, cheat_code[3]); AddCheatCode (text, cheat_code[3]);
@ -1947,14 +1985,17 @@ CEvent::DrawButtons ()
AddCheatCode (text, cheat_code[6]); AddCheatCode (text, cheat_code[6]);
if (m_pDecor->GetSuper ()) if (m_pDecor->GetSuper ())
AddCheatCode (text, cheat_code[7]); AddCheatCode (text, cheat_code[7]);
pos.x = 2;
pos.y = 2; if (text[0])
rect.left = pos.x; {
rect.right = pos.x + 300; pos.x = 2;
rect.top = pos.y; pos.y = 2;
rect.bottom = pos.y + DIMLITTLEY; rect.left = pos.x;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); // dessine le fond rect.right = pos.x + 300;
DrawText (m_pPixmap, pos, text, FONTLITTLE); rect.top = pos.y;
rect.bottom = pos.y + DIMLITTLEY;
DrawText (m_pPixmap, pos, text, FONTLITTLE);
}
} }
if (m_phase == EV_PHASE_INIT) if (m_phase == EV_PHASE_INIT)
@ -2110,7 +2151,7 @@ CEvent::DrawButtons ()
rect.right = pos.x + 20; rect.right = pos.x + 20;
rect.top = pos.y; rect.top = pos.y;
rect.bottom = pos.y + 15; rect.bottom = pos.y + 15;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); // dessine le fond m_pPixmap->DrawPart (-1, CHBACK, pos, rect); // dessine le fond
if (m_speed > 1) if (m_speed > 1)
{ {
snprintf (res, sizeof (res), "x%d", m_speed); snprintf (res, sizeof (res), "x%d", m_speed);
@ -2128,7 +2169,7 @@ CEvent::DrawButtons ()
rect.right = POSDRAWX + DIMDRAWX; rect.right = POSDRAWX + DIMDRAWX;
rect.top = 0; rect.top = 0;
rect.bottom = lg; rect.bottom = lg;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); m_pPixmap->DrawPart (-1, CHBACK, pos, rect);
pos.x = POSDRAWX; pos.x = POSDRAWX;
pos.y = lg; pos.y = lg;
@ -2136,7 +2177,7 @@ CEvent::DrawButtons ()
rect.right = POSDRAWX + DIMDRAWX; rect.right = POSDRAWX + DIMDRAWX;
rect.top = 0; rect.top = 0;
rect.bottom = POSDRAWY; rect.bottom = POSDRAWY;
m_pPixmap->DrawPart (-1, CHBACK, pos, rect, 1); m_pPixmap->DrawPart (-1, CHBACK, pos, rect);
pos.x = POSDRAWX + 20; pos.x = POSDRAWX + 20;
pos.y = POSDRAWY + 4; pos.y = POSDRAWY + 4;
@ -2423,7 +2464,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, list[GetWorld () % 5]); DrawText (m_pPixmap, pos, list[GetWorld () % 5]);
} }
// Affiche le texte lorsque c'est fini. // Show the ending text when the game is finished.
if (m_phase == EV_PHASE_LASTWIN) if (m_phase == EV_PHASE_LASTWIN)
{ {
char * text; char * text;
@ -2440,7 +2481,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, text); DrawText (m_pPixmap, pos, text);
} }
// Dessine les réglages. // Draw the game settings.
if (m_phase == EV_PHASE_SETUP || m_phase == EV_PHASE_SETUPp) if (m_phase == EV_PHASE_SETUP || m_phase == EV_PHASE_SETUPp)
{ {
DrawTextCenter (gettext ("Global game\nspeed"), 54 + 40, 80); DrawTextCenter (gettext ("Global game\nspeed"), 54 + 40, 80);
@ -2502,6 +2543,10 @@ CEvent::DrawButtons ()
lang = "Français"; lang = "Français";
else if (locale == "de") else if (locale == "de")
lang = "Deutsch"; lang = "Deutsch";
else if (locale == "it")
lang = "Italiano";
else if (locale == "pl")
lang = "Polski";
lg = GetTextWidth (lang.c_str ()); lg = GetTextWidth (lang.c_str ());
pos.x = (54 + 40) - lg / 2; pos.x = (54 + 40) - lg / 2;
@ -2580,7 +2625,7 @@ CEvent::DrawButtons ()
DrawText (m_pPixmap, pos, text); DrawText (m_pPixmap, pos, text);
} }
// Affiche le texte lorsqu'il faut insérer le CD-Rom. // Show the text when the CD-Rom must be inserted (deprecated).
if (m_phase == EV_PHASE_INSERT) if (m_phase == EV_PHASE_INSERT)
DrawTextCenter ( DrawTextCenter (
gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."), gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."),
@ -2589,15 +2634,19 @@ CEvent::DrawButtons ()
if (m_phase == EV_PHASE_BUILD) if (m_phase == EV_PHASE_BUILD)
SetEnable (EV_PHASE_UNDO, m_pDecor->IsUndo ()); SetEnable (EV_PHASE_UNDO, m_pDecor->IsUndo ());
// Dessine les tool tips (info bulle). // Draw the tooltips.
if (m_textToolTips[0] != 0) if (m_textToolTips[0] != 0)
DrawText (m_pPixmap, m_posToolTips, m_textToolTips); DrawText (m_pPixmap, m_posToolTips, m_textToolTips);
return true; return true;
} }
// Retourne le lutin à utiliser à une position donnée. /**
* \brief Return the mouse sprite to use for a position.
*
* \param[in] pos - The position.
* \return the sprite.
*/
MouseSprites MouseSprites
CEvent::MousePosToSprite (Point pos) CEvent::MousePosToSprite (Point pos)
{ {
@ -2668,8 +2717,11 @@ CEvent::MousePosToSprite (Point pos)
return sprite; return sprite;
} }
// Gère le lutin de la souris. /**
* \brief Main mouse sprite handling.
*
* \param[in] pos - The position.
*/
void void
CEvent::MouseSprite (Point pos) CEvent::MouseSprite (Point pos)
{ {
@ -2677,8 +2729,11 @@ CEvent::MouseSprite (Point pos)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Met ou enlève le sablier de la souris. /**
* \brief Set or remove the waiting mouse sprite.
*
* \param[in] bWait - If waiting.
*/
void void
CEvent::WaitMouse (bool bWait) CEvent::WaitMouse (bool bWait)
{ {
@ -2692,8 +2747,11 @@ CEvent::WaitMouse (bool bWait)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Cache ou montre la souris. /**
* \brief Hide or show the mouse.
*
* \param[in] bHide - If hide.
*/
void void
CEvent::HideMouse (bool bHide) CEvent::HideMouse (bool bHide)
{ {
@ -2714,8 +2772,13 @@ CEvent::HideMouse (bool bHide)
m_pPixmap->ChangeSprite (m_mouseSprite); m_pPixmap->ChangeSprite (m_mouseSprite);
} }
// Traite les événements pour tous les boutons. /**
* \brief Handle events for buttons.
*
* \param[in] event - The SDL event.
* \param[in] pos - The position.
* \return true if the event is handled.
*/
bool bool
CEvent::EventButtons (const SDL_Event & event, Point pos) CEvent::EventButtons (const SDL_Event & event, Point pos)
{ {
@ -2805,7 +2868,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
// Montre ou cache les infos tout en haut. // Show or hide the informations at the top.
m_pDecor->SetInfoMode (!m_pDecor->GetInfoMode ()); m_pDecor->SetInfoMode (!m_pDecor->GetInfoMode ());
} }
} }
@ -2828,7 +2891,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
// Inverse le mode aide dans les infos. // Reverse the help mode in the informations.
m_bInfoHelp = !m_bInfoHelp; m_bInfoHelp = !m_bInfoHelp;
if (m_bInfoHelp) if (m_bInfoHelp)
@ -2846,7 +2909,7 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
(event.button.button == SDL_BUTTON_LEFT || (event.button.button == SDL_BUTTON_LEFT ||
event.button.button == SDL_BUTTON_RIGHT)) event.button.button == SDL_BUTTON_RIGHT))
{ {
m_pDecor->HideTooltips (true); // plus de tooltips pour décor m_pDecor->HideTooltips (true); // Remove tooltips for the decor.
} }
if ( if (
event.type == SDL_MOUSEBUTTONUP && event.type == SDL_MOUSEBUTTONUP &&
@ -2875,8 +2938,12 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
return false; return false;
} }
// Indique si la souris est sur un bouton. /**
* \brief Notify if the mouse is on a button.
*
* \param[in] pos - The mouse position.
* \return true if the mouse is on a button.
*/
bool bool
CEvent::MouseOnButton (Point pos) CEvent::MouseOnButton (Point pos)
{ {
@ -2896,8 +2963,12 @@ CEvent::MouseOnButton (Point pos)
return false; return false;
} }
// Retourne l'index dans table pour une phase donnée. /**
* \brief Return the table index for a specific phase.
*
* \param[in] phase - The phase.
* \return the index in `table`.
*/
Sint32 Sint32
CEvent::SearchPhase (Uint32 phase) CEvent::SearchPhase (Uint32 phase)
{ {
@ -2913,8 +2984,11 @@ CEvent::SearchPhase (Uint32 phase)
return -1; return -1;
} }
// Donne le numéro du monde. /**
* \brief Return the world number.
*
* \return the number.
*/
Sint32 Sint32
CEvent::GetWorld () CEvent::GetWorld ()
{ {
@ -2926,8 +3000,13 @@ CEvent::GetWorld ()
return m_mission; return m_mission;
} }
// Donne le numéro physique du monde. /**
* \brief Return the physical world number.
*
* This number should be the same as the filename.
*
* \return the number.
*/
Sint32 Sint32
CEvent::GetPhysicalWorld () CEvent::GetPhysicalWorld ()
{ {
@ -2950,8 +3029,11 @@ CEvent::GetImageWorld ()
return 1; return 1;
} }
// Indique si l'aide est disponible. /**
* Notify if the help is available.
*
* \return true if available.
*/
bool bool
CEvent::IsHelpHide () CEvent::IsHelpHide ()
{ {
@ -2961,14 +3043,18 @@ CEvent::IsHelpHide ()
bHide = false; bHide = false;
if (m_bSchool || m_bPrivate) if (m_bSchool || m_bPrivate)
{ {
bHide = true; // pas d'aide pour les exercices bHide = true; // No help for the exercises.
} }
return bHide; return bHide;
} }
// Change de phase. /**
* \brief Change the phase.
*
* \param[in] phase - The new phase.
* \return true if the phase has changed.
*/
bool bool
CEvent::ChangePhase (Uint32 phase) CEvent::ChangePhase (Uint32 phase)
{ {
@ -3037,11 +3123,11 @@ CEvent::ChangePhase (Uint32 phase)
m_pSound->StopAllSounds (false, &except); m_pSound->StopAllSounds (false, &except);
} }
m_phase = phase; // change de phase m_phase = phase; // change phase
m_index = index; m_index = index;
filename = table[m_index].backName; filename = table[m_index].backName;
if (filename.find ("%.3d") != std::string::npos) // "%.3d" dans le nom ? if (filename.find ("%.3d") != std::string::npos)
filename = string_format (table[m_index].backName, GetImageWorld ()); filename = string_format (table[m_index].backName, GetImageWorld ());
totalDim.x = LXIMAGE; totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE; totalDim.y = LYIMAGE;
@ -3049,10 +3135,10 @@ CEvent::ChangePhase (Uint32 phase)
iconDim.y = 0; iconDim.y = 0;
if (!m_pPixmap->Cache (CHBACK, filename, totalDim, iconDim)) if (!m_pPixmap->Cache (CHBACK, filename, totalDim, iconDim))
{ {
WaitMouse (false); // enlève le sablier WaitMouse (false);
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
if ( if (
@ -3077,13 +3163,13 @@ CEvent::ChangePhase (Uint32 phase)
{ {
if ( if (
!m_pDecor->Read ( !m_pDecor->Read (
GetPhysicalWorld (), false, world, time, total) && // lit le monde GetPhysicalWorld (), false, world, time, total) && // read the world
!m_bAccessBuild && !m_bAccessBuild &&
!m_bPrivate) !m_bPrivate)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
m_pDecor->SetTime (0); m_pDecor->SetTime (0);
m_pDecor->SetTotalTime (0); m_pDecor->SetTotalTime (0);
@ -3119,7 +3205,7 @@ CEvent::ChangePhase (Uint32 phase)
if (m_phase == EV_PHASE_TESTCD) if (m_phase == EV_PHASE_TESTCD)
{ {
if (m_pDecor->Read (0, false, world, time, total)) // lit un monde if (m_pDecor->Read (0, false, world, time, total)) // read the world
{ {
return ChangePhase (EV_PHASE_INIT); // ok return ChangePhase (EV_PHASE_INIT); // ok
} }
@ -3127,44 +3213,43 @@ CEvent::ChangePhase (Uint32 phase)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase (EV_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase (EV_PHASE_INSERT); // insert the CD-Rom ...
} }
} }
m_jauges[0].SetHide (true); // cache les jauges m_jauges[0].SetHide (true);
m_jauges[1].SetHide (true); m_jauges[1].SetHide (true);
CreateButtons (); // crée les boutons selon la phase CreateButtons (); // create the buttons accordingly to the phase
m_bMenu = false; m_bMenu = false;
m_pDecor->HideTooltips (false); m_pDecor->HideTooltips (false);
m_menu.Delete (); m_menu.Delete ();
m_pDecor->BlupiSetArrow (0, false); // enlève toutes les flèches m_pDecor->BlupiSetArrow (0, false); // remove all arrows
m_pDecor->ResetHili (); // enlève les mises en évidence m_pDecor->ResetHili (); // remove all highlights
if (m_phase == EV_PHASE_PLAY) if (m_phase == EV_PHASE_PLAY)
{ {
m_pDecor->LoadImages (); m_pDecor->LoadImages ();
m_pDecor->SetBuild (false); m_pDecor->SetBuild (false);
m_pDecor->EnableFog (true); m_pDecor->EnableFog (true);
m_pDecor->NextPhase (0); // refait la carte tout de suite m_pDecor->NextPhase (0); // rebuild the map immediatly
m_pDecor->StatisticInit (); m_pDecor->StatisticInit ();
m_pDecor->TerminatedInit (); m_pDecor->TerminatedInit ();
m_bChangeCheat = true; // affiche les cheat-codes
} }
if (m_phase == EV_PHASE_BUILD) if (m_phase == EV_PHASE_BUILD)
{ {
m_bBuildModify = true; m_bBuildModify = true;
SetState (EV_DECOR1, 1); SetState (EV_DECOR1, 1);
SetMenu (EV_DECOR1, 0); // herbe SetMenu (EV_DECOR1, 0); // grass
SetMenu (EV_DECOR2, 2); // arbre SetMenu (EV_DECOR2, 2); // tree
SetMenu (EV_DECOR3, 1); // maison SetMenu (EV_DECOR3, 1); // house
SetMenu (EV_DECOR4, 2); // blupi fort SetMenu (EV_DECOR4, 2); // strong blupi
SetMenu (EV_DECOR5, 1); // feu SetMenu (EV_DECOR5, 1); // fire
m_pDecor->LoadImages (); m_pDecor->LoadImages ();
m_pDecor->SetBuild (true); m_pDecor->SetBuild (true);
m_pDecor->EnableFog (false); m_pDecor->EnableFog (false);
m_pDecor->BlupiDeselect (); m_pDecor->BlupiDeselect ();
m_pDecor->NextPhase (0); // refait la carte tout de suite m_pDecor->NextPhase (0); // rebuild the map immediatly
} }
if (m_phase == EV_PHASE_INFO) if (m_phase == EV_PHASE_INFO)
@ -3250,7 +3335,7 @@ CEvent::ChangePhase (Uint32 phase)
{ {
music = m_pDecor->GetMusic (); music = m_pDecor->GetMusic ();
for (i = 0; i < 10; i++) for (i = 0; i < 11; i++)
SetState (EV_BUTTON1 + i, music == i ? 1 : 0); SetState (EV_BUTTON1 + i, music == i ? 1 : 0);
} }
@ -3266,7 +3351,7 @@ CEvent::ChangePhase (Uint32 phase)
{ {
if (m_pSound->IsPlayingMusic ()) if (m_pSound->IsPlayingMusic ())
{ {
m_pSound->AdaptVolumeMusic (); // adapte le volume m_pSound->AdaptVolumeMusic ();
} }
else else
{ {
@ -3316,20 +3401,24 @@ CEvent::ChangePhase (Uint32 phase)
m_phaseAfterMovie = EV_PHASE_LASTWIN; m_phaseAfterMovie = EV_PHASE_LASTWIN;
} }
WaitMouse (false); // enlève le sablier WaitMouse (false);
return true; return true;
} }
// Retourne la phase en cours. /**
* \brief Return the current phase.
*
* \return the phase number.
*/
Uint32 Uint32
CEvent::GetPhase () CEvent::GetPhase ()
{ {
return m_phase; return m_phase;
} }
// Essaye de lire le CD-Rom. /**
* \brief Try to read the CD-Rom.
*/
void void
CEvent::TryInsert () CEvent::TryInsert ()
{ {
@ -3339,47 +3428,57 @@ CEvent::TryInsert ()
m_tryInsertCount--; m_tryInsertCount--;
} }
// Fait démarrer un film si nécessaire. /**
* \brief Start a movie if necessary.
void *
* \return true if the movie has started.
*/
bool
CEvent::MovieToStart () CEvent::MovieToStart ()
{ {
if (m_movieToStart[0] != 0) // y a-t-il un film à démarrer ? bool movie = false;
{
HideMouse (true); // cache la souris
if (m_movieToStart[0] != 0) // is movie available?
{
if (StartMovie (m_movieToStart)) if (StartMovie (m_movieToStart))
{ {
m_phase = m_phaseAfterMovie; // prochaine phase normale movie = true;
m_phase = m_phaseAfterMovie; // the next normal phase
} }
else else
ChangePhase (m_phaseAfterMovie); ChangePhase (m_phaseAfterMovie);
m_movieToStart[0] = 0; m_movieToStart[0] = 0;
} }
return movie;
} }
// Décale le décor. /**
* \brief Shift the decor.
*
* \param[in] dx - Delta x.
* \param[in] dy - Delta y.
*/
void void
CEvent::DecorShift (Sint32 dx, Sint32 dy) CEvent::DecorShift (Sint32 dx, Sint32 dy)
{ {
Point coin; Point corner;
if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD) if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD)
return; return;
coin = m_pDecor->GetCoin (); corner = m_pDecor->GetCorner ();
coin.x += dx; corner.x += dx;
coin.y += dy; corner.y += dy;
m_pDecor->SetCoin (coin); m_pDecor->SetCorner (corner);
//? m_pDecor->NextPhase(0); // faudra refaire la carte tout de suite
} }
// Décale le décor lorsque la souris touche un bord. /**
* \brief Shift the decor when the mouse is on the sides.
*/
void void
CEvent::DecorAutoShift () CEvent::DecorAutoShift ()
{ {
@ -3395,7 +3494,7 @@ CEvent::DecorAutoShift ()
if (m_phase == EV_PHASE_PLAY || m_phase == EV_PHASE_BUILD) if (m_phase == EV_PHASE_PLAY || m_phase == EV_PHASE_BUILD)
{ {
if (m_shiftPhase == 0) // début du shift ? if (m_shiftPhase == 0) // start shift ?
{ {
switch (m_mouseSprite) switch (m_mouseSprite)
{ {
@ -3476,7 +3575,7 @@ CEvent::DecorAutoShift ()
offset.y = m_shiftOffset.y * (max - m_shiftPhase) * (DIMCELY / 2 / max); offset.y = m_shiftOffset.y * (max - m_shiftPhase) * (DIMCELY / 2 / max);
m_pDecor->SetShiftOffset (offset); m_pDecor->SetShiftOffset (offset);
if (m_shiftPhase == 0) // dernière phase ? if (m_shiftPhase == 0) // last phase ?
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
@ -3487,8 +3586,11 @@ CEvent::DecorAutoShift ()
} }
} }
// Indique su un shift est en cours. /**
* \brief Notify if a shift is doing.
*
* \return true of the shift is doing.
*/
bool bool
CEvent::IsShift () CEvent::IsShift ()
{ {
@ -3547,7 +3649,7 @@ CEvent::PlayDown (Point pos, const SDL_Event & event)
if (bMap) if (bMap)
{ {
m_pDecor->SetCoin (cel, true); m_pDecor->SetCorner (cel, true);
m_pDecor->NextPhase (0); // faudra refaire la carte tout de suite m_pDecor->NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }
@ -3649,6 +3751,10 @@ CEvent::GetStartLanguage ()
return Language::fr; return Language::fr;
if (this->m_LangStart == "de") if (this->m_LangStart == "de")
return Language::de; return Language::de;
if (this->m_LangStart == "it")
return Language::it;
if (this->m_LangStart == "pl")
return Language::pl;
return Language::en; return Language::en;
} }
@ -3683,6 +3789,12 @@ CEvent::SetLanguage (Language lang)
case Language::de: case Language::de:
slang = "de"; slang = "de";
break; break;
case Language::it:
slang = "it";
break;
case Language::pl:
slang = "pl";
break;
} }
snprintf (env, sizeof (env), "LANGUAGE=%s", slang); snprintf (env, sizeof (env), "LANGUAGE=%s", slang);
@ -4196,8 +4308,6 @@ CEvent::BuildMove (Point pos, Uint16 mod, const SDL_Event & event)
bool bool
CEvent::StartMovie (const std::string & pFilename) CEvent::StartMovie (const std::string & pFilename)
{ {
Rect rect;
if (!m_pMovie->GetEnable ()) if (!m_pMovie->GetEnable ())
return false; return false;
if (!m_bMovie) if (!m_bMovie)
@ -4206,15 +4316,12 @@ CEvent::StartMovie (const std::string & pFilename)
if (!m_pMovie->IsExist (pFilename)) if (!m_pMovie->IsExist (pFilename))
return false; return false;
rect.left = 1; // mystère: plante avec 0,0,LXIMAGE,LYIMAGE !!! HideMouse (true);
rect.top = 1;
rect.right = LXIMAGE - 2;
rect.bottom = LYIMAGE - 2;
m_pSound->StopMusic (); m_pSound->StopMusic ();
if (!m_pMovie->Play (rect, pFilename)) if (!m_pMovie->Play (pFilename))
return false; return false;
m_bRunMovie = true; m_bRunMovie = true;
return true; return true;
} }
@ -4512,6 +4619,8 @@ CEvent::ReadInfo ()
if (file == nullptr) if (file == nullptr)
goto error; goto error;
SDL_memset (&info, 0, sizeof (info));
nb = fread (&info, sizeof (DescInfo), 1, file); nb = fread (&info, sizeof (DescInfo), 1, file);
if (nb < 1) if (nb < 1)
goto error; goto error;
@ -4531,7 +4640,11 @@ CEvent::ReadInfo ()
m_pSound->SetMidiVolume (info.midiVolume); m_pSound->SetMidiVolume (info.midiVolume);
if ((info.majRev == 1 && info.minRev >= 1) || info.majRev >= 2) if ((info.majRev == 1 && info.minRev >= 1) || info.majRev >= 2)
{
if (info.language >= static_cast<int> (Language::end))
info.language = 0;
this->SetLanguage (static_cast<Language> (info.language)); this->SetLanguage (static_cast<Language> (info.language));
}
fclose (file); fclose (file);
return true; return true;
@ -5066,42 +5179,36 @@ CEvent::TreatEventBase (const SDL_Event & event)
{ {
m_bAllMissions = !m_bAllMissions; m_bAllMissions = !m_bAllMissions;
bEnable = m_bAllMissions; bEnable = m_bAllMissions;
m_bChangeCheat = true;
break; break;
} }
case 4: // quick ? case 4: // quick ?
{ {
m_bSpeed = !m_bSpeed; m_bSpeed = !m_bSpeed;
bEnable = m_bSpeed; bEnable = m_bSpeed;
m_bChangeCheat = true;
break; break;
} }
case 5: // helpme ? case 5: // helpme ?
{ {
m_bHelp = !m_bHelp; m_bHelp = !m_bHelp;
bEnable = m_bHelp; bEnable = m_bHelp;
m_bChangeCheat = true;
break; break;
} }
case 6: // invincible ? case 6: // invincible ?
{ {
m_pDecor->SetInvincible (!m_pDecor->GetInvincible ()); m_pDecor->SetInvincible (!m_pDecor->GetInvincible ());
bEnable = m_pDecor->GetInvincible (); bEnable = m_pDecor->GetInvincible ();
m_bChangeCheat = true;
break; break;
} }
case 7: // superblupi ? case 7: // superblupi ?
{ {
m_pDecor->SetSuper (!m_pDecor->GetSuper ()); m_pDecor->SetSuper (!m_pDecor->GetSuper ());
bEnable = m_pDecor->GetSuper (); bEnable = m_pDecor->GetSuper ();
m_bChangeCheat = true;
break; break;
} }
case 8: // construire ? case 8: // construire ?
{ {
m_bAccessBuild = !m_bAccessBuild; m_bAccessBuild = !m_bAccessBuild;
bEnable = m_bAccessBuild; bEnable = m_bAccessBuild;
m_bChangeCheat = true;
break; break;
} }
} }
@ -5165,6 +5272,9 @@ CEvent::TreatEventBase (const SDL_Event & event)
return true; return true;
case EV_PHASE_STOP: case EV_PHASE_STOP:
ChangePhase (EV_PHASE_PLAY);
return true;
case EV_PHASE_LOST: case EV_PHASE_LOST:
case EV_PHASE_BUILD: case EV_PHASE_BUILD:
ChangePhase (EV_PHASE_INFO); ChangePhase (EV_PHASE_INFO);
@ -5258,7 +5368,7 @@ CEvent::TreatEventBase (const SDL_Event & event)
} }
case SDLK_HOME: case SDLK_HOME:
pos = m_pDecor->GetHome (); pos = m_pDecor->GetHome ();
m_pDecor->SetCoin (pos); m_pDecor->SetCorner (pos);
return true; return true;
case SDLK_SPACE: case SDLK_SPACE:
if (m_bRunMovie) if (m_bRunMovie)
@ -5270,6 +5380,9 @@ CEvent::TreatEventBase (const SDL_Event & event)
m_pDecor->FlipOutline (); m_pDecor->FlipOutline ();
return true; return true;
case SDLK_PAUSE: case SDLK_PAUSE:
if (this->m_pDecor->GetSkill () >= 1)
return true;
m_bPause = !m_bPause; m_bPause = !m_bPause;
if (m_phase == EV_PHASE_PLAY) if (m_phase == EV_PHASE_PLAY)
{ {

View File

@ -81,6 +81,9 @@ enum class Language {
en_US = 1, en_US = 1,
fr = 2, fr = 2,
de = 3, de = 3,
it = 4,
pl = 5,
end,
}; };
class CEvent class CEvent
@ -98,7 +101,7 @@ public:
Sint32 GetImageWorld (); Sint32 GetImageWorld ();
bool IsHelpHide (); bool IsHelpHide ();
bool ChangePhase (Uint32 phase); bool ChangePhase (Uint32 phase);
void MovieToStart (); bool MovieToStart ();
Uint32 GetPhase (); Uint32 GetPhase ();
void TryInsert (); void TryInsert ();
@ -140,6 +143,7 @@ public:
void IntroStep (); void IntroStep ();
Uint8 GetWindowScale (); Uint8 GetWindowScale ();
void SetWindowSize (Uint8 newScale);
void SetUpdateVersion (const std::string & version); void SetUpdateVersion (const std::string & version);
static void PushUserEvent (Sint32 code, void * data = nullptr); static void PushUserEvent (Sint32 code, void * data = nullptr);
@ -236,7 +240,6 @@ protected:
bool m_bSpeed; bool m_bSpeed;
bool m_bHelp; bool m_bHelp;
bool m_bAllMissions; bool m_bAllMissions;
bool m_bChangeCheat;
Sint32 m_scrollSpeed; Sint32 m_scrollSpeed;
bool m_bPause; bool m_bPause;
bool m_bShift; bool m_bShift;

View File

@ -628,76 +628,77 @@ CDecor::ArrangeObject (Point cel)
} }
} }
// Arrange les rayons entre les tours.
if ( if (
m_decor[cel.x / 2][cel.y / 2].objectIcon == 27 || // tour ? g_restoreBugs &&
m_decor[cel.x / 2][cel.y / 2].objectIcon == -1) // rien ? (m_decor[cel.x / 2][cel.y / 2].objectIcon != 27 && // not a tower?
m_decor[cel.x / 2][cel.y / 2].objectIcon != -1))
return;
// Arrange les rayons entre les tours.
for (i = 0; i < 4; i++)
{ {
for (i = 0; i < 4; i++) vector = GetVector (i * 2 * 16);
test = cel;
bTour = false;
j = 0;
while (true)
{ {
vector = GetVector (i * 2 * 16); test.x += vector.x * 2;
test = cel; test.y += vector.y * 2;
if (m_decor[test.x / 2][test.y / 2].objectIcon == 27) // tour ?
{
bTour = true;
break;
}
if (
m_decor[test.x / 2][test.y / 2].objectIcon != -1 &&
m_decor[test.x / 2][test.y / 2].objectIcon != 10001 - i % 2)
break;
j++;
if (j >= 2 + 1)
break;
}
if (m_decor[cel.x / 2][cel.y / 2].objectIcon != 27) // pas tour ?
bTour = false; bTour = false;
j = 0;
while (true)
{
test.x += vector.x * 2;
test.y += vector.y * 2;
if (m_decor[test.x / 2][test.y / 2].objectIcon == 27) // tour ? test = cel;
for (k = 0; k < j; k++)
{
test.x += vector.x * 2;
test.y += vector.y * 2;
if (bTour)
{
channel = CHOBJECT;
icon = 10001 - i % 2; // rayon e-o (10001) ou n-s (10000)
}
else
{
channel = -1;
icon = -1;
}
m_decor[test.x / 2][test.y / 2].objectChannel = channel;
m_decor[test.x / 2][test.y / 2].objectIcon = icon;
if (!m_bBuild && bTour)
{
if (MoveCreate (
test, -1, false, CHOBJECT, -1, -1, -1, 9999, 1, 0, true))
{ {
bTour = true; MoveAddIcons (test, 5 - i % 2, true); // éclairs
break;
} }
if ( pos = ConvCelToPos (test);
m_decor[test.x / 2][test.y / 2].objectIcon != -1 && m_pSound->PlayImage (SOUND_RAYON1, pos);
m_decor[test.x / 2][test.y / 2].objectIcon != 10001 - i % 2)
break;
j++;
if (j >= 2 + 1)
break;
} }
if (m_decor[cel.x / 2][cel.y / 2].objectIcon != 27) // pas tour ? if (!m_bBuild && !bTour)
bTour = false; MoveFinish (test);
test = cel;
for (k = 0; k < j; k++)
{
test.x += vector.x * 2;
test.y += vector.y * 2;
if (bTour)
{
channel = CHOBJECT;
icon = 10001 - i % 2; // rayon e-o (10001) ou n-s (10000)
}
else
{
channel = -1;
icon = -1;
}
m_decor[test.x / 2][test.y / 2].objectChannel = channel;
m_decor[test.x / 2][test.y / 2].objectIcon = icon;
if (!m_bBuild && bTour)
{
if (MoveCreate (
test, -1, false, CHOBJECT, -1, -1, -1, 9999, 1, 0, true))
{
MoveAddIcons (test, 5 - i % 2, true); // éclairs
}
pos = ConvCelToPos (test);
m_pSound->PlayImage (SOUND_RAYON1, pos);
}
if (!m_bBuild && !bTour)
MoveFinish (test);
}
} }
} }
} }

View File

@ -87,7 +87,7 @@ GetFogIcon (char * pBits)
// Table donnant la "vision" d'un blupi dans le // Table donnant la "vision" d'un blupi dans le
// brouillard. // brouillard.
// clang-format off // clang-format off
static char table_fog[17 * 17] = static Sint8 table_fog[17 * 17] =
{ {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4,

View File

@ -60,7 +60,7 @@ protected:
CDecor * m_pDecor; CDecor * m_pDecor;
CSound * m_pSound; CSound * m_pSound;
CEvent * m_pEvent; CEvent * m_pEvent;
Point m_pos; // coin sup/gauche Point m_pos; // up/left corner
Point m_dim; // dimensions Point m_dim; // dimensions
Sint32 m_nbButtons; Sint32 m_nbButtons;
Point m_nbCel; Point m_nbCel;

View File

@ -90,7 +90,7 @@ CMovie::fileCloseMovie ()
// Sets <m_fMovieOpen> on success. // Sets <m_fMovieOpen> on success.
bool bool
CMovie::fileOpenMovie (Rect rect, const std::string & pFilename) CMovie::fileOpenMovie (const std::string & pFilename)
{ {
const auto path = GetBaseDir () + pFilename; const auto path = GetBaseDir () + pFilename;
@ -108,21 +108,22 @@ CMovie::fileOpenMovie (Rect rect, const std::string & pFilename)
if (m_player == nullptr) if (m_player == nullptr)
return false; return false;
pinfo = new Kit_PlayerInfo; Kit_PlayerInfo info;
Kit_GetPlayerInfo (m_player, pinfo); Kit_GetPlayerInfo (m_player, &info);
SDL_AudioSpec wanted_spec, audio_spec; SDL_AudioSpec wanted_spec, audio_spec;
SDL_memset (&wanted_spec, 0, sizeof (wanted_spec)); SDL_memset (&wanted_spec, 0, sizeof (wanted_spec));
wanted_spec.freq = pinfo->audio.samplerate; wanted_spec.freq = info.audio.samplerate;
wanted_spec.format = pinfo->audio.format; wanted_spec.format = info.audio.format;
wanted_spec.channels = pinfo->audio.channels; wanted_spec.channels = info.audio.channels;
m_audioDev = SDL_OpenAudioDevice (nullptr, 0, &wanted_spec, &audio_spec, 0); m_audioDev = SDL_OpenAudioDevice (nullptr, 0, &wanted_spec, &audio_spec, 0);
SDL_PauseAudioDevice (m_audioDev, 0); SDL_PauseAudioDevice (m_audioDev, 0);
m_videoTex = SDL_CreateTexture ( m_videoTex = SDL_CreateTexture (
g_renderer, pinfo->video.format, SDL_TEXTUREACCESS_STATIC, g_renderer, info.video.format, SDL_TEXTUREACCESS_TARGET, info.video.width,
pinfo->video.width, pinfo->video.height); info.video.height);
if (m_videoTex == nullptr) if (m_videoTex == nullptr)
return false; return false;
@ -145,7 +146,10 @@ CMovie::playMovie ()
// play/pause the AVI movie // play/pause the AVI movie
if (m_fPlaying) if (m_fPlaying)
{
this->starting = true;
Kit_PlayerPlay (m_player); Kit_PlayerPlay (m_player);
}
else else
Kit_PlayerPause (m_player); Kit_PlayerPause (m_player);
} }
@ -159,7 +163,6 @@ CMovie::CMovie ()
m_movie = nullptr; m_movie = nullptr;
m_player = nullptr; m_player = nullptr;
m_videoTex = nullptr; m_videoTex = nullptr;
pinfo = nullptr;
memset (m_audiobuf, 0, sizeof (m_audiobuf)); memset (m_audiobuf, 0, sizeof (m_audiobuf));
@ -207,11 +210,12 @@ CMovie::IsExist (const std::string & pFilename)
// Montre un film avi. // Montre un film avi.
bool bool
CMovie::Play (Rect rect, const std::string & pFilename) CMovie::Play (const std::string & pFilename)
{ {
if (!m_bEnable) if (!m_bEnable)
return false; return false;
if (!fileOpenMovie (rect, pFilename))
if (!fileOpenMovie (pFilename))
return false; return false;
playMovie (); playMovie ();
@ -289,6 +293,15 @@ CMovie::Render ()
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255); SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
SDL_RenderClear (g_renderer); SDL_RenderClear (g_renderer);
if (this->starting)
{
SDL_SetRenderTarget (g_renderer, m_videoTex);
SDL_SetRenderDrawColor (g_renderer, 0, 0, 0, 255);
SDL_RenderClear (g_renderer);
SDL_SetRenderTarget (g_renderer, nullptr);
this->starting = false;
}
// Refresh videotexture and render it // Refresh videotexture and render it
Kit_GetVideoData (m_player, m_videoTex); Kit_GetVideoData (m_player, m_videoTex);
SDL_RenderCopy (g_renderer, m_videoTex, nullptr, nullptr); SDL_RenderCopy (g_renderer, m_videoTex, nullptr, nullptr);

View File

@ -38,7 +38,7 @@ public:
bool Create (); bool Create ();
bool GetEnable (); bool GetEnable ();
bool IsExist (const std::string & pFilename); bool IsExist (const std::string & pFilename);
bool Play (Rect rect, const std::string & pFilename); bool Play (const std::string & pFilename);
void Stop (); void Stop ();
void Pause (); void Pause ();
void Resume (); void Resume ();
@ -46,13 +46,12 @@ public:
protected: protected:
void playMovie (); void playMovie ();
bool fileOpenMovie (Rect rect, const std::string & pFilename); bool fileOpenMovie (const std::string & pFilename);
void fileCloseMovie (); void fileCloseMovie ();
void termAVI (); void termAVI ();
bool initAVI (); bool initAVI ();
protected: protected:
Kit_PlayerInfo * pinfo;
Kit_Source * m_movie; Kit_Source * m_movie;
Kit_Player * m_player; Kit_Player * m_player;
SDL_Texture * m_videoTex; SDL_Texture * m_videoTex;
@ -61,6 +60,7 @@ protected:
char m_audiobuf[AUDIOBUFFER_SIZE]; char m_audiobuf[AUDIOBUFFER_SIZE];
bool m_bEnable; bool m_bEnable;
bool starting;
bool m_fPlaying; // Play flag: true == playing, false == paused bool m_fPlaying; // Play flag: true == playing, false == paused
bool m_fMovieOpen; // Open flag: true == movie open, false = none bool m_fMovieOpen; // Open flag: true == movie open, false = none
}; };

View File

@ -2228,17 +2228,17 @@ CDecor::DirectSearch (Point cel, Point goal)
{ {
if (dir.y > 0) if (dir.y > 0)
{ {
direct = DIRECT_SO; direct = DIRECT_SW;
if (tan < 41) if (tan < 41)
direct = DIRECT_O; direct = DIRECT_W;
if (tan > 241) if (tan > 241)
direct = DIRECT_S; direct = DIRECT_S;
} }
else else
{ {
direct = DIRECT_NO; direct = DIRECT_NW;
if (tan < 41) if (tan < 41)
direct = DIRECT_O; direct = DIRECT_W;
if (tan > 241) if (tan > 241)
direct = DIRECT_N; direct = DIRECT_N;
} }
@ -3724,7 +3724,7 @@ CDecor::IsBuildBateau (Point cel, Sint32 & direct)
fChannel == CHFLOOR && fIcon == 4 && // rivage ? fChannel == CHFLOOR && fIcon == 4 && // rivage ?
oChannel == -1 && oIcon == -1) oChannel == -1 && oIcon == -1)
{ {
direct = DIRECT_O; direct = DIRECT_W;
return true; return true;
} }

View File

@ -373,8 +373,7 @@ CPixmap::IsIconPixel (size_t channel, Sint32 rank, Point pos)
// Les modes sont 0=transparent, 1=opaque. // Les modes sont 0=transparent, 1=opaque.
bool bool
CPixmap::DrawIcon ( CPixmap::DrawIcon (Sint32 chDst, size_t channel, Sint32 rank, Point pos)
Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask)
{ {
Sint32 nbx, nby; Sint32 nbx, nby;
Rect rect; Rect rect;
@ -411,8 +410,7 @@ CPixmap::DrawIcon (
// 33,48 35,49 // 33,48 35,49
bool bool
CPixmap::DrawIconDemi ( CPixmap::DrawIconDemi (Sint32 chDst, size_t channel, Sint32 rank, Point pos)
Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask)
{ {
Sint32 nbx, nby; Sint32 nbx, nby;
Rect rect; Rect rect;
@ -445,7 +443,7 @@ CPixmap::DrawIconDemi (
bool bool
CPixmap::DrawIconPart ( CPixmap::DrawIconPart (
Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY, Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY,
Sint32 endY, bool bMask) Sint32 endY)
{ {
Sint32 nbx, nby; Sint32 nbx, nby;
Rect rect; Rect rect;
@ -477,8 +475,7 @@ CPixmap::DrawIconPart (
// Dessine une partie d'image n'importe o�. // Dessine une partie d'image n'importe o�.
bool bool
CPixmap::DrawPart ( CPixmap::DrawPart (Sint32 chDst, size_t channel, Point dest, Rect rect)
Sint32 chDst, size_t channel, Point dest, Rect rect, bool bMask)
{ {
if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ()) if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ())
return false; return false;
@ -770,7 +767,7 @@ CPixmap::GetCursorRect (MouseSprites sprite)
} }
void void
CPixmap::LoadCursors () CPixmap::LoadCursors (Uint8 scale)
{ {
Uint32 rmask, gmask, bmask, amask; Uint32 rmask, gmask, bmask, amask;
@ -791,16 +788,20 @@ on the endianness (byte order) of the machine */
for (int i = SPRITE_BEGIN; i <= SPRITE_END; ++i) for (int i = SPRITE_BEGIN; i <= SPRITE_END; ++i)
{ {
MouseSprites sprite = static_cast<MouseSprites> (i); MouseSprites sprite = static_cast<MouseSprites> (i);
if (m_lpSDLCursors[sprite - 1])
SDL_FreeCursor (m_lpSDLCursors[sprite - 1]);
SDL_Point hotspot = this->GetCursorHotSpot (sprite); SDL_Point hotspot = this->GetCursorHotSpot (sprite);
SDL_Rect rect = this->GetCursorRect (sprite); SDL_Rect rect = this->GetCursorRect (sprite);
SDL_Surface * surface = SDL_Surface * surface = SDL_CreateRGBSurface (
SDL_CreateRGBSurface (0, rect.w, rect.h, 32, rmask, gmask, bmask, amask); 0, rect.w * scale, rect.h * scale, 32, rmask, gmask, bmask, amask);
SDL_BlitSurface (m_lpSDLBlupi, &rect, surface, nullptr); SDL_BlitScaled (m_lpSDLBlupi, &rect, surface, nullptr);
// FIXME: change cursor first value to 0 // FIXME: change cursor first value to 0
m_lpSDLCursors[sprite - 1] = m_lpSDLCursors[sprite - 1] =
SDL_CreateColorCursor (surface, hotspot.x, hotspot.y); SDL_CreateColorCursor (surface, hotspot.x * scale, hotspot.y * scale);
SDL_FreeSurface (surface); SDL_FreeSurface (surface);
} }
} }

View File

@ -66,15 +66,12 @@ public:
bool IsIconPixel (size_t channel, Sint32 rank, Point pos); bool IsIconPixel (size_t channel, Sint32 rank, Point pos);
bool DrawIcon ( bool DrawIcon (Sint32 chDst, size_t channel, Sint32 rank, Point pos);
Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask = false); bool DrawIconDemi (Sint32 chDst, size_t channel, Sint32 rank, Point pos);
bool DrawIconDemi (
Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask = false);
bool DrawIconPart ( bool DrawIconPart (
Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY, Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY,
Sint32 endY, bool bMask = false); Sint32 endY);
bool DrawPart ( bool DrawPart (Sint32 chDst, size_t channel, Point dest, Rect rect);
Sint32 chDst, size_t channel, Point dest, Rect rect, bool bMask = false);
bool DrawImage (Sint32 chDst, size_t channel, Rect rect); bool DrawImage (Sint32 chDst, size_t channel, Rect rect);
bool BuildIconMask ( bool BuildIconMask (
@ -85,7 +82,7 @@ public:
void SetMouseSprite (MouseSprites sprite); void SetMouseSprite (MouseSprites sprite);
void MouseShow (bool bShow); void MouseShow (bool bShow);
void LoadCursors (); void LoadCursors (Uint8 scale);
void ChangeSprite (MouseSprites sprite); void ChangeSprite (MouseSprites sprite);
protected: protected:

View File

@ -72,7 +72,7 @@ CJauge::Draw ()
rect.right = m_pos.x + m_dim.x; rect.right = m_pos.x + m_dim.x;
rect.top = m_pos.y; rect.top = m_pos.y;
rect.bottom = m_pos.y + m_dim.y; rect.bottom = m_pos.y + m_dim.y;
m_pPixmap->DrawPart (-1, CHBACK, m_pos, rect, 1); // dessine le fond m_pPixmap->DrawPart (-1, CHBACK, m_pos, rect); // dessine le fond
return; return;
} }

View File

@ -46,7 +46,7 @@ protected:
CDecor * m_pDecor; CDecor * m_pDecor;
CSound * m_pSound; CSound * m_pSound;
bool m_bHide; // true si bouton caché bool m_bHide; // true si bouton caché
Point m_pos; // coin sup/gauche Point m_pos; // up/left corner
Point m_dim; // dimensions Point m_dim; // dimensions
Sint32 m_type; Sint32 m_type;
Sint32 m_level; Sint32 m_level;

View File

@ -22,35 +22,62 @@
#include <stdlib.h> #include <stdlib.h>
#include "def.h" #include "def.h"
#include "misc.h"
#include "pixmap.h" #include "pixmap.h"
#include "text.h" #include "text.h"
/** /**
* \brief Return the character offset for the sprite. * \brief Return the character offset for the sprite.
* *
* \param[in] c - The character (incremented if 0xC3 UTF-8). * \param[in] c - The character (incremented if 0xC3 or 0xC4 or 0xC5 UTF-8).
* \returns the offset. * \returns the offset.
*/ */
static Sint32 static Sint32
GetOffset (const char *& c) GetOffset (const char *& c)
{ {
/* clang-format off */
static const unsigned char table_accents[] = { static const unsigned char table_accents[] = {
/* ü à â é è ë ê ï */ /* ü à â é è ë ê ï */
/* 0xFC, 0xE0, 0xE2, 0xE9, 0xE8, 0xEB, 0xEA, 0xEF, // CP1252 */ 0xBC, 0xA0, 0xA2, 0xA9, 0xA8, 0xAB, 0xAA, 0xAF, /* UTF-8 */
0xBC, 0xA0, 0xA2, 0xA9, 0xA8, 0xAB, 0xAA, 0xAF, // UTF-8 /* î ô ù û ä ö ç */
/* î ô ù û ä ö ç */ 0xAE, 0xB4, 0xB9, 0xBB, 0xA4, 0xB6, 0xA7, /* UTF-8 */
/* 0xEE, 0xF4, 0xF9, 0xFB, 0xE4, 0xF6, 0xE7, // CP1252 */
0xAE, 0xB4, 0xB9, 0xBB, 0xA4, 0xB6, 0xA7, // UTF-8
}; };
static const unsigned char table_extended[] = {
/* Italian */
/* ò ì */
0xB2, 0xAC, /* UTF-8 */
/* Polish */
/* ń ó ę ć ź ż */
0x84, 0xB3, 0x99, 0x87, 0xBA, 0xBC, /* UTF-8 */
/* ą ł ś */
0x85, 0x82, 0x9B, /* UTF-8 */
};
/* clang-format on */
if (static_cast<unsigned char> (*c) == 0xC3) if (static_cast<unsigned char> (*c) == 0xC3)
c++; c++;
if (static_cast<unsigned char> (*c) == 0xC4)
c++;
if (static_cast<unsigned char> (*c) == 0xC5)
c++;
for (unsigned int i = 0; i < countof (table_accents); ++i) if (GetLocale () != "pl")
{ {
if ((unsigned char) *c == table_accents[i]) // Do not use the 'standard' accents table with Polish locale
return 15 + i; // This is required because we check only last byte of UTF-8 and some
// characters overlap
// TODO: In the future, this ugly hack should be replaced with proper UTF-8
// parsing
for (unsigned int i = 0; i < countof (table_accents); ++i)
if ((unsigned char) *c == table_accents[i])
return 15 + i;
} }
for (unsigned int i = 0; i < countof (table_extended); ++i)
if ((unsigned char) *c == table_extended[i])
return 127 + i;
if (*c < 0) if (*c < 0)
return 1; // square return 1; // square
@ -77,7 +104,8 @@ GetCharWidth (const char *& c, Sint32 font)
12, 8, 9, 9, 9, 8, 8, 8, 9, 4, 8, 9, 8, 10, 9, 9, 12, 8, 9, 9, 9, 8, 8, 8, 9, 4, 8, 9, 8, 10, 9, 9,
8, 9, 8, 9, 10, 8, 9, 11, 9, 8, 10, 7, 10, 7, 13, 13, 8, 9, 8, 9, 10, 8, 9, 11, 9, 8, 10, 7, 10, 7, 13, 13,
9, 9, 8, 8, 8, 8, 6, 8, 8, 4, 6, 8, 4, 12, 8, 8, 9, 9, 8, 8, 8, 8, 6, 8, 8, 4, 6, 8, 4, 12, 8, 8,
8, 8, 7, 6, 7, 8, 8, 10, 8, 8, 7, 6, 6, 6, 10, 0, 8, 8, 7, 6, 7, 8, 8, 10, 8, 8, 7, 6, 6, 6, 10, 8,
5, 8, 8, 8, 8, 8, 7, 9, 6, 7
}; };
static const unsigned char table_width_little[] = static const unsigned char table_width_little[] =
@ -89,7 +117,8 @@ GetCharWidth (const char *& c, Sint32 font)
9, 8, 6, 7, 7, 5, 5, 8, 7, 2, 4, 7, 5, 10, 7, 8, 9, 8, 6, 7, 7, 5, 5, 8, 7, 2, 4, 7, 5, 10, 7, 8,
6, 8, 7, 6, 6, 6, 8, 12, 7, 6, 6, 3, 5, 3, 6, 8, 6, 8, 7, 6, 6, 6, 8, 12, 7, 6, 6, 3, 5, 3, 6, 8,
4, 6, 6, 6, 6, 6, 4, 6, 6, 2, 3, 5, 2, 10, 6, 6, 4, 6, 6, 6, 6, 6, 4, 6, 6, 2, 3, 5, 2, 10, 6, 6,
6, 6, 3, 5, 3, 6, 6, 8, 6, 6, 5, 4, 6, 4, 7, 0, 6, 6, 3, 5, 3, 6, 6, 8, 6, 6, 5, 4, 6, 4, 7, 6,
3, 6, 6, 6, 5, 5, 5, 7, 4, 5
}; };
// clang-format on // clang-format on
@ -118,7 +147,7 @@ DrawText (CPixmap * pPixmap, Point pos, const char * pText, Sint32 font)
if (font != FONTLITTLE) if (font != FONTLITTLE)
{ {
rank += 128 * font; rank += (128 + 16) * font;
pPixmap->DrawIcon (-1, CHTEXT, rank, pos); pPixmap->DrawIcon (-1, CHTEXT, rank, pos);
} }
else else
@ -142,7 +171,7 @@ DrawTextPente (
while (*pText != 0) while (*pText != 0)
{ {
rank = GetOffset (pText); rank = GetOffset (pText);
rank += 128 * font; rank += (128 + 16) * font;
pPixmap->DrawIcon (-1, CHTEXT, rank, pos); pPixmap->DrawIcon (-1, CHTEXT, rank, pos);
lg = GetCharWidth (pText, font); lg = GetCharWidth (pText, font);