Compare commits
3 Commits
b1f9e57f36
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 4435bc4942 | |||
| 4a4485c6f8 | |||
| d09bb1cf6b |
87
CHANGELOG.md
87
CHANGELOG.md
@@ -1,6 +1,88 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
Tots els canvis de la reconstrucció moderna (C++/SDL3) d'**Aventures en Egipte**, des de l'inici del port fins a la v1.1.
|
Tots els canvis de la reconstrucció moderna (C++/SDL3) d'**Aventures en Egipte**.
|
||||||
|
|
||||||
|
## [1.2] — 2026-04-18
|
||||||
|
|
||||||
|
Versió de modernització profunda: desapareix el model *threads estil emulador* i tot el runtime passa a un sol fil tick-based compatible amb emscripten. Zero regressions de gameplay.
|
||||||
|
|
||||||
|
### Afegit
|
||||||
|
|
||||||
|
#### Arquitectura: capa `scenes::` tick-based
|
||||||
|
- Infraestructura `scenes::` ([source/scenes/](source/scenes/)): `Scene`, `SceneRegistry`, `Timeline`, `SpriteMover`, `FrameAnimator`, `PaletteFade`, `SurfaceHandle`, helper `playMusic` (`4436f7f`)
|
||||||
|
- **MortScene** substitueix `doMort()` (`d86cb21`)
|
||||||
|
- **BannerScene** substitueix `doBanner()` per piràmides 2–5 (`2cb38ff`)
|
||||||
|
- **MenuScene** substitueix `doMenu()` + fix `JI_Update` al loop (`8720e77`)
|
||||||
|
- **IntroNewLogoScene** substitueix `doIntroNewLogo()` (`ad38fc0`)
|
||||||
|
- **SlidesScene** amb wipe suau per easing (`605c273`)
|
||||||
|
- **CreditsScene** amb scroll vertical + parallax condicional (`829d743`)
|
||||||
|
- **SecretaScene** amb swap `tomba1→tomba2` i red pulse animat (`6063b1c`)
|
||||||
|
- **IntroScene** amb revelat *JAILGAMES* lletra a lletra + cicle de paleta (`e18b732`)
|
||||||
|
- **IntroSpritesScene** com a sub-escena amb 3 variants aleatòries (`d343e71`)
|
||||||
|
- **ModuleGame** migrat a `scenes::Scene` amb fases `FadingIn`/`FadingOut` (`4e18f83`)
|
||||||
|
- Pla de migració documentat a [docs/scenes-migration-plan.md](docs/scenes-migration-plan.md) (`6125277`)
|
||||||
|
|
||||||
|
#### Resource pack
|
||||||
|
- Sistema d'empaquetat d'assets `resources.pack` (format **AEE1**, XOR-xifrat) estil *coffee_crisis* (`b2d5f5a`, `4244bca`)
|
||||||
|
- Classe `ResourcePack` + namespace `ResourceHelper` + eina CLI standalone `pack_resources` (target `make pack`)
|
||||||
|
- Cablejat a tots els callsites de recursos via `ResourceHelper::loadFile`
|
||||||
|
- Scaffold `.jrf` llegat eliminat completament de `jfile.cpp`
|
||||||
|
- Releases natius depenen del pack i l'usen obligatòriament (sense fallback); WASM i Debug mantenen fallback
|
||||||
|
- Normalització de `resource::cache` per a `Audio` (`94aa69c`)
|
||||||
|
|
||||||
|
#### Build WebAssembly
|
||||||
|
- Build WASM via Docker (`emscripten/emsdk:latest`) amb desplegament a maverick (`make wasm`)
|
||||||
|
- SDL3 compilat des de font via `FetchContent`; shaders omesos; `sdl3gpu_shader.cpp` exclòs
|
||||||
|
- Events de canvas d'emscripten (`1c11a30`)
|
||||||
|
- Fix de mandos en emscripten Android (`d3bdd9b`)
|
||||||
|
- Defaults específics d'emscripten (`7f26b8d`)
|
||||||
|
- Internal resolution configurable (`e8b0b12`, `16a3f5b`)
|
||||||
|
|
||||||
|
#### Menú i UI
|
||||||
|
- **Menú de sistema** amb versió i opció de tancar/reiniciar (`e0f9b60`)
|
||||||
|
- Animació de tancar el menú (`5956d87`)
|
||||||
|
- Items ocultables condicionalment en funció d'altres items (`a3fc111`)
|
||||||
|
- Tots els valors d'escala que exposa SDL3 (`52431ad`)
|
||||||
|
- `debug.yaml` separat de `config.yaml` (`fe41919`)
|
||||||
|
|
||||||
|
### Canviat
|
||||||
|
|
||||||
|
#### Runtime: sense fibers, sense threads, sense mutex
|
||||||
|
- **Fase 1** — jail i game a C++ idiomàtic: RAII, `info::ctx` com a singleton `inline`, cheats arreglats (`scancode→ASCII`) (`7f85b50`)
|
||||||
|
- **Fase 2** — fades de `jd8` a màquina d'estats + helper `wait_frame_or_skip` a les cinemàtiques (`80fa7b4`)
|
||||||
|
- **Fase 3** — `jail_audio` header-only amb streaming real (`stb_vorbis_open_memory` + `JA_PumpMusic`), sense `SDL_AddTimer` (`801a8ad`)
|
||||||
|
- **Fase 4+5** — fibers cooperatius substitueixen el game thread, sense mutex ni `cv` (`1507a1c`)
|
||||||
|
- **Step B.1** — fades de `ModuleGame` tick-based amb `scenes::PaletteFade` (`4e18f83`)
|
||||||
|
- **Step B.2** — **eliminació total del fiber**: `Director` posseeix l'escena (`current_scene_`, `game_state_`), `JD8_Flip` sense yield, `fiber.{hpp,cpp}` esborrats (`96a3cf9`)
|
||||||
|
- **Step 10** — `ModuleSequence` eliminat; dispatch via `SceneRegistry::tryCreate()` i `game_state_ == 0/1` directe des del `Director`
|
||||||
|
- Main loop via **SDL3 Callback API** (`SDL_MAIN_USE_CALLBACKS`): `SDL_AppInit`/`Iterate`/`Event`/`Quit`, compatible amb emscripten
|
||||||
|
|
||||||
|
#### RAII i neteja de memòria
|
||||||
|
- **Fase 1** — cleanup mecànic: `NULL→nullptr`, `typedef→using`, `explicit`, `enum class` local (`e7aa246`)
|
||||||
|
- **Fase 2** — elimina `malloc`/`free` a `jdraw8` i paletes d'escenes (`53e93ef`)
|
||||||
|
- **Fase 3** — `Text::bitmap_` a `std::vector<Uint8>` (`2a8fbbb`)
|
||||||
|
- **Fase 4** — llista enllaçada de Momia a `std::vector<std::unique_ptr>` (`5e57034`)
|
||||||
|
- **Fase 5** — singletons a `std::unique_ptr` (elimina `new`/`delete` manual) (`c6e37af`)
|
||||||
|
- **Fase 6** — Rule of 5 a `Mapa` i `ModuleGame` (no-copiables, no-movibles) (`f7875ba`)
|
||||||
|
- `file_getfilebuffer` → `file_readfile` retornant `std::vector<char>` — elimina 3 leaks silenciosos (paleta + música gameplay + música cinemàtica) (`b3ff620`)
|
||||||
|
- `JA_Music_t` RAII amb `vector<Uint8>`/`string`, elimina overload i camps morts (`f9346ad`)
|
||||||
|
- `JA_Sound_t` RAII amb `unique_ptr + SDLFreeDeleter`, elimina `JA_NewSound` (`550e3e0`)
|
||||||
|
|
||||||
|
#### Build i tooling
|
||||||
|
- Unificats `.clang-format` i `.clang-tidy`, amb exclusió de `external/` i `spv/` via dummies (`7409c79`)
|
||||||
|
- `cppcheck` integrat amb suppress list (`27f8b0a`, `2e1a82f`)
|
||||||
|
- `make`/`cmake` estandarditzats amb la resta de projectes JailGames (`9d86137`)
|
||||||
|
- Fitxers de música renombrats a noms temàtics (`417699d`)
|
||||||
|
- Carpeta `data/` reordenada (`083a57d`)
|
||||||
|
|
||||||
|
### Arreglat
|
||||||
|
|
||||||
|
- Shaders ON/OFF no afectaven a CRT-Pi (`a36662a`)
|
||||||
|
- Logo nou de la intro tornava a descentrar-se (`52369be`, `5cda8fc`)
|
||||||
|
- Color de fons dels sliders de `0x050505` a `0x000000` (`b1f9e57`)
|
||||||
|
- Diversos detalls menors (`6394e9a`, `0cd09f6`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [1.1] — 2026-04-05
|
## [1.1] — 2026-04-05
|
||||||
|
|
||||||
@@ -64,4 +146,5 @@ Versió que fa coincidir la numeració amb la del joc original del 2000.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[1.1]: https://gitea/aee/compare/9e0ab87...HEAD
|
[1.2]: https://gitea/aee/compare/486f00b...HEAD
|
||||||
|
[1.1]: https://gitea/aee/compare/9e0ab87...486f00b
|
||||||
|
|||||||
91
Makefile
91
Makefile
@@ -184,12 +184,28 @@ _windows_release: pack
|
|||||||
_macos_release: pack
|
_macos_release: pack
|
||||||
@echo "Creando release para macOS - Version: $(VERSION)"
|
@echo "Creando release para macOS - Version: $(VERSION)"
|
||||||
|
|
||||||
# Verificar e instalar create-dmg si es necesario
|
# Verifica dependencias necesarias (create-dmg). Si falta, intenta instalarla
|
||||||
@which create-dmg > /dev/null || (echo "Instalando create-dmg..." && brew install create-dmg)
|
# con brew; si brew tampoco está, indica el comando exacto al usuario.
|
||||||
|
@command -v create-dmg >/dev/null 2>&1 || { \
|
||||||
# Compila la versión para procesadores Intel con cmake
|
echo ""; \
|
||||||
@cmake -S . -B build/intel -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DMACOS_BUNDLE=ON -DGIT_HASH=$(GIT_HASH)
|
echo "============================================"; \
|
||||||
@cmake --build build/intel
|
echo " Falta la dependencia: create-dmg"; \
|
||||||
|
echo "============================================"; \
|
||||||
|
if command -v brew >/dev/null 2>&1; then \
|
||||||
|
echo " Instalando con: brew install create-dmg"; \
|
||||||
|
brew install create-dmg || { \
|
||||||
|
echo ""; \
|
||||||
|
echo " ERROR: 'brew install create-dmg' ha fallado."; \
|
||||||
|
echo " Ejecuta el comando manualmente y vuelve a probar."; \
|
||||||
|
exit 1; \
|
||||||
|
}; \
|
||||||
|
else \
|
||||||
|
echo " Homebrew no está instalado."; \
|
||||||
|
echo " Instálalo desde https://brew.sh y luego ejecuta:"; \
|
||||||
|
echo " brew install create-dmg"; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
}
|
||||||
|
|
||||||
# Elimina datos de compilaciones anteriores
|
# Elimina datos de compilaciones anteriores
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
@@ -218,30 +234,49 @@ _macos_release: pack
|
|||||||
sed -i '' '/<key>CFBundleShortVersionString<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"; \
|
sed -i '' '/<key>CFBundleShortVersionString<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"; \
|
||||||
sed -i '' '/<key>CFBundleVersion<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"
|
sed -i '' '/<key>CFBundleVersion<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"
|
||||||
|
|
||||||
# Copia el ejecutable Intel al bundle
|
# Compila y empaqueta la versión Intel (best-effort: si falla, se omite el
|
||||||
cp "$(TARGET_FILE)" "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)"
|
# DMG Intel y continúa con la build de Apple Silicon).
|
||||||
|
@echo ""
|
||||||
# Firma la aplicación
|
@echo "============================================"
|
||||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
@echo " Compilando version Intel (x86_64)"
|
||||||
|
@echo "============================================"
|
||||||
# Empaqueta el .dmg de la versión Intel con create-dmg
|
@if cmake -S . -B build/intel -DCMAKE_BUILD_TYPE=Release \
|
||||||
@echo "Creando DMG Intel con iconos de 96x96..."
|
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||||
create-dmg \
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
|
||||||
--volname "$(APP_NAME)" \
|
-DMACOS_BUNDLE=ON -DGIT_HASH=$(GIT_HASH) \
|
||||||
--window-pos 200 120 \
|
&& cmake --build build/intel; then \
|
||||||
--window-size 720 300 \
|
cp "$(TARGET_FILE)" "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)"; \
|
||||||
--icon-size 96 \
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"; \
|
||||||
--text-size 12 \
|
echo "Creando DMG Intel con iconos de 96x96..."; \
|
||||||
--icon "$(APP_NAME).app" 278 102 \
|
create-dmg \
|
||||||
--icon "LICENSE" 441 102 \
|
--volname "$(APP_NAME)" \
|
||||||
--icon "README.md" 604 102 \
|
--window-pos 200 120 \
|
||||||
--app-drop-link 115 102 \
|
--window-size 720 300 \
|
||||||
--hide-extension "$(APP_NAME).app" \
|
--icon-size 96 \
|
||||||
"$(MACOS_INTEL_RELEASE)" \
|
--text-size 12 \
|
||||||
"$(RELEASE_FOLDER)" || true
|
--icon "$(APP_NAME).app" 278 102 \
|
||||||
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
|
--icon "LICENSE" 441 102 \
|
||||||
|
--icon "README.md" 604 102 \
|
||||||
|
--app-drop-link 115 102 \
|
||||||
|
--hide-extension "$(APP_NAME).app" \
|
||||||
|
"$(MACOS_INTEL_RELEASE)" \
|
||||||
|
"$(RELEASE_FOLDER)" || true; \
|
||||||
|
echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"; \
|
||||||
|
else \
|
||||||
|
echo ""; \
|
||||||
|
echo "============================================"; \
|
||||||
|
echo " WARNING: la build Intel ha fallado."; \
|
||||||
|
echo " Se omite el DMG Intel y se continúa con"; \
|
||||||
|
echo " la build de Apple Silicon."; \
|
||||||
|
echo "============================================"; \
|
||||||
|
echo ""; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Compila la versión para procesadores Apple Silicon con cmake
|
# Compila la versión para procesadores Apple Silicon con cmake
|
||||||
|
@echo ""
|
||||||
|
@echo "============================================"
|
||||||
|
@echo " Compilando version Apple Silicon (arm64)"
|
||||||
|
@echo "============================================"
|
||||||
@cmake -S . -B build/arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DMACOS_BUNDLE=ON -DGIT_HASH=$(GIT_HASH)
|
@cmake -S . -B build/arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DMACOS_BUNDLE=ON -DGIT_HASH=$(GIT_HASH)
|
||||||
@cmake --build build/arm
|
@cmake --build build/arm
|
||||||
cp "$(TARGET_FILE)" "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)"
|
cp "$(TARGET_FILE)" "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ menu:
|
|||||||
exit_game: "Eixir del joc"
|
exit_game: "Eixir del joc"
|
||||||
use_new_logo: "Logo nou"
|
use_new_logo: "Logo nou"
|
||||||
show_title_credits: "Crèdits del port"
|
show_title_credits: "Crèdits del port"
|
||||||
|
show_preload: "Barra de precàrrega"
|
||||||
zoom: "Zoom"
|
zoom: "Zoom"
|
||||||
screen: "Pantalla"
|
screen: "Pantalla"
|
||||||
shader: "Shader"
|
shader: "Shader"
|
||||||
|
|||||||
@@ -169,20 +169,18 @@ auto Audio::getRealMusicState() -> MusicState {
|
|||||||
|
|
||||||
// Establece el volumen de los sonidos (float 0.0..1.0)
|
// Establece el volumen de los sonidos (float 0.0..1.0)
|
||||||
void Audio::setSoundVolume(float sound_volume, Group group) const {
|
void Audio::setSoundVolume(float sound_volume, Group group) const {
|
||||||
if (sound_enabled_) {
|
sound_volume = std::clamp(sound_volume, MIN_VOLUME, MAX_VOLUME);
|
||||||
sound_volume = std::clamp(sound_volume, MIN_VOLUME, MAX_VOLUME);
|
const bool active = enabled_ && sound_enabled_;
|
||||||
const float CONVERTED_VOLUME = sound_volume * Options::audio.volume;
|
const float CONVERTED_VOLUME = active ? sound_volume * Options::audio.volume : 0.0F;
|
||||||
JA_SetSoundVolume(CONVERTED_VOLUME, static_cast<int>(group));
|
JA_SetSoundVolume(CONVERTED_VOLUME, static_cast<int>(group));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece el volumen de la música (float 0.0..1.0)
|
// Establece el volumen de la música (float 0.0..1.0)
|
||||||
void Audio::setMusicVolume(float music_volume) const {
|
void Audio::setMusicVolume(float music_volume) const {
|
||||||
if (music_enabled_) {
|
music_volume = std::clamp(music_volume, MIN_VOLUME, MAX_VOLUME);
|
||||||
music_volume = std::clamp(music_volume, MIN_VOLUME, MAX_VOLUME);
|
const bool active = enabled_ && music_enabled_;
|
||||||
const float CONVERTED_VOLUME = music_volume * Options::audio.volume;
|
const float CONVERTED_VOLUME = active ? music_volume * Options::audio.volume : 0.0F;
|
||||||
JA_SetMusicVolume(CONVERTED_VOLUME);
|
JA_SetMusicVolume(CONVERTED_VOLUME);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aplica la configuración
|
// Aplica la configuración
|
||||||
|
|||||||
@@ -70,19 +70,26 @@ void file_setconfigfolder(const char* foldername) {
|
|||||||
if (!homedir) homedir = "/tmp";
|
if (!homedir) homedir = "/tmp";
|
||||||
config_folder = std::string(homedir) + "/Library/Application Support/" + foldername;
|
config_folder = std::string(homedir) + "/Library/Application Support/" + foldername;
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
// Nota emscripten: `__linux__` també està definit, però `getpwuid` no
|
// Nota emscripten: `__linux__` també està definit, però `getpwuid` pot
|
||||||
// troba cap /etc/passwd al MEMFS i retorna nullptr. Amb els fallbacks
|
// retornar nullptr (sense /etc/passwd al MEMFS) o un passwd amb pw_dir
|
||||||
// HOME → /tmp evitem crashejar al primer arranque dins del navegador.
|
// buit. Amb els fallbacks HOME → /tmp evitem crashejar al primer
|
||||||
// La config no persistirà entre recàrregues de la pàgina (MEMFS és
|
// arranque dins del navegador. La config no persistirà entre recàrregues
|
||||||
// volàtil); caldria IDBFS si volguéssem persistència a web.
|
// (MEMFS és volàtil); caldria IDBFS si volguéssem persistència a web.
|
||||||
struct passwd* pw = getpwuid(getuid());
|
struct passwd* pw = getpwuid(getuid());
|
||||||
const char* homedir = (pw && pw->pw_dir) ? pw->pw_dir : nullptr;
|
const char* homedir = (pw && pw->pw_dir && pw->pw_dir[0]) ? pw->pw_dir : nullptr;
|
||||||
if (!homedir) homedir = getenv("HOME");
|
if (!homedir || !homedir[0]) homedir = getenv("HOME");
|
||||||
if (!homedir) homedir = "/tmp";
|
if (!homedir || !homedir[0]) homedir = "/tmp";
|
||||||
config_folder = std::string(homedir) + "/.config/" + foldername;
|
config_folder = std::string(homedir) + "/.config/" + foldername;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::filesystem::create_directories(config_folder);
|
if (config_folder.empty()) {
|
||||||
|
config_folder = "/tmp/jailgames_config";
|
||||||
|
}
|
||||||
|
std::error_code ec;
|
||||||
|
std::filesystem::create_directories(config_folder, ec);
|
||||||
|
// A emscripten/MEMFS create_directories pot fallar (p.ex. parent
|
||||||
|
// read-only o libc++ amb path empty-check estricte). La config és
|
||||||
|
// volàtil al navegador de totes formes: ignorem l'error i continuem.
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* file_getconfigfolder() {
|
const char* file_getconfigfolder() {
|
||||||
|
|||||||
@@ -271,6 +271,8 @@ namespace Menu {
|
|||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.show_title_credits"), ItemKind::Toggle, [] { return yesNo(Options::game.show_title_credits); }, [](int) { Options::game.show_title_credits = !Options::game.show_title_credits; }, nullptr});
|
p.items.push_back({Locale::get("menu.items.show_title_credits"), ItemKind::Toggle, [] { return yesNo(Options::game.show_title_credits); }, [](int) { Options::game.show_title_credits = !Options::game.show_title_credits; }, nullptr});
|
||||||
|
|
||||||
|
p.items.push_back({Locale::get("menu.items.show_preload"), ItemKind::Toggle, [] { return yesNo(Options::game.show_preload); }, [](int) { Options::game.show_preload = !Options::game.show_preload; }, nullptr});
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,4 +46,5 @@ namespace Defaults::Game {
|
|||||||
constexpr int DINERS_INICIAL = 0;
|
constexpr int DINERS_INICIAL = 0;
|
||||||
constexpr bool USE_NEW_LOGO = true;
|
constexpr bool USE_NEW_LOGO = true;
|
||||||
constexpr bool SHOW_TITLE_CREDITS = true;
|
constexpr bool SHOW_TITLE_CREDITS = true;
|
||||||
|
constexpr bool SHOW_PRELOAD = false;
|
||||||
} // namespace Defaults::Game
|
} // namespace Defaults::Game
|
||||||
|
|||||||
@@ -219,6 +219,8 @@ namespace Options {
|
|||||||
game.use_new_logo = node["use_new_logo"].get_value<bool>();
|
game.use_new_logo = node["use_new_logo"].get_value<bool>();
|
||||||
if (node.contains("show_title_credits"))
|
if (node.contains("show_title_credits"))
|
||||||
game.show_title_credits = node["show_title_credits"].get_value<bool>();
|
game.show_title_credits = node["show_title_credits"].get_value<bool>();
|
||||||
|
if (node.contains("show_preload"))
|
||||||
|
game.show_preload = node["show_preload"].get_value<bool>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Carrega les opcions des del fitxer configurat
|
// Carrega les opcions des del fitxer configurat
|
||||||
@@ -368,6 +370,7 @@ namespace Options {
|
|||||||
file << "game:\n";
|
file << "game:\n";
|
||||||
file << " use_new_logo: " << (game.use_new_logo ? "true" : "false") << "\n";
|
file << " use_new_logo: " << (game.use_new_logo ? "true" : "false") << "\n";
|
||||||
file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n";
|
file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n";
|
||||||
|
file << " show_preload: " << (game.show_preload ? "true" : "false") << "\n";
|
||||||
file << "\n";
|
file << "\n";
|
||||||
|
|
||||||
// CONTROLS — només moviment del jugador. Les tecles d'UI viuen a
|
// CONTROLS — només moviment del jugador. Les tecles d'UI viuen a
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ namespace Options {
|
|||||||
int diners_inicial{Defaults::Game::DINERS_INICIAL};
|
int diners_inicial{Defaults::Game::DINERS_INICIAL};
|
||||||
bool use_new_logo{Defaults::Game::USE_NEW_LOGO};
|
bool use_new_logo{Defaults::Game::USE_NEW_LOGO};
|
||||||
bool show_title_credits{Defaults::Game::SHOW_TITLE_CREDITS};
|
bool show_title_credits{Defaults::Game::SHOW_TITLE_CREDITS};
|
||||||
|
bool show_preload{Defaults::Game::SHOW_PRELOAD};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Preset PostFX
|
// Preset PostFX
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ SDL_AppResult SDL_AppInit(void** /*appstate*/, int /*argc*/, char* /*argv*/[]) {
|
|||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
// MEMFS no persistix entre recàrregues: força valors sensats per a web.
|
// MEMFS no persistix entre recàrregues: força valors sensats per a web.
|
||||||
Options::window.fullscreen = false;
|
Options::window.fullscreen = false;
|
||||||
Options::window.zoom = 1;
|
Options::window.zoom = 3;
|
||||||
Options::video.aspect_ratio_4_3 = true;
|
Options::video.aspect_ratio_4_3 = true;
|
||||||
Options::video.scaling_mode = Options::ScalingMode::INTEGER;
|
Options::video.scaling_mode = Options::ScalingMode::INTEGER;
|
||||||
Options::video.texture_filter = Options::TextureFilter::LINEAR;
|
Options::video.texture_filter = Options::TextureFilter::LINEAR;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "core/jail/jdraw8.hpp"
|
#include "core/jail/jdraw8.hpp"
|
||||||
#include "core/resources/resource_cache.hpp"
|
#include "core/resources/resource_cache.hpp"
|
||||||
|
#include "game/options.hpp"
|
||||||
|
|
||||||
namespace scenes {
|
namespace scenes {
|
||||||
|
|
||||||
@@ -37,6 +38,8 @@ namespace scenes {
|
|||||||
void BootLoaderScene::render() const {
|
void BootLoaderScene::render() const {
|
||||||
JD8_ClearScreen(BG_COLOR);
|
JD8_ClearScreen(BG_COLOR);
|
||||||
|
|
||||||
|
if (!Options::game.show_preload) return;
|
||||||
|
|
||||||
const float pct = Resource::Cache::get()->getProgress();
|
const float pct = Resource::Cache::get()->getProgress();
|
||||||
const int filled = static_cast<int>(static_cast<float>(BAR_W) * pct);
|
const int filled = static_cast<int>(static_cast<float>(BAR_W) * pct);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user