RenderInfo amb tres estats (off/dalt/baix), temps de joc i persistència; ombra, mono-dígits i easing compartits (v0.14.0)

This commit is contained in:
JailDesigner committed 2026-04-19 20:28:23 +02:00
1 parent 46a578fd86
commit 6f3fafbfff
17 files changed
+376 -97

No files matched your search

+18 -9
View File
@@ -23,6 +23,14 @@ namespace Defaults {
LINEAR = 1,
};
// Posició de l'overlay RenderInfo: apagat, a dalt o a baix del canvas.
// Cicle OFF → TOP → BOTTOM → OFF amb la hotkey corresponent.
enum class RenderInfoPosition : std::uint8_t {
OFF = 0,
TOP = 1,
BOTTOM = 2,
};
namespace Window {
constexpr int ZOOM = 3;
constexpr bool FULLSCREEN = false;
@@ -37,15 +45,16 @@ namespace Defaults {
constexpr bool VSYNC = true;
constexpr ScalingMode SCALING_MODE = ScalingMode::LETTERBOX;
constexpr TextureFilter TEXTURE_FILTER = TextureFilter::NEAREST;
constexpr bool GPU_ACCELERATION = true; // Path SDL3 GPU per defecte; fallback a SDL_Renderer si falla.
constexpr const char* GPU_PREFERRED_DRIVER = ""; // Buit = auto. Aplica a l'arrencada.
constexpr bool SHADER_ENABLED = true; // Aplica PostFX; si false, sempre passthrough.
constexpr const char* CURRENT_SHADER = "postfx"; // Shader actiu: "postfx" o "crtpi".
constexpr const char* POSTFX_DEFAULT_PRESET = "CRT"; // Preset inicial PostFX.
constexpr const char* CRTPI_DEFAULT_PRESET = "DEFAULT"; // Preset inicial CrtPi.
constexpr const char* POSTFX_FILE = "shaders/postfx.yaml"; // Relatiu a la carpeta de sistema.
constexpr const char* CRTPI_FILE = "shaders/crtpi.yaml"; // Relatiu a la carpeta de sistema.
constexpr bool RENDER_INFO = false; // Overlay de debug (FPS/driver/shader) amagat per defecte.
constexpr bool GPU_ACCELERATION = true; // Path SDL3 GPU per defecte; fallback a SDL_Renderer si falla.
constexpr const char* GPU_PREFERRED_DRIVER = ""; // Buit = auto. Aplica a l'arrencada.
constexpr bool SHADER_ENABLED = true; // Aplica PostFX; si false, sempre passthrough.
constexpr const char* CURRENT_SHADER = "postfx"; // Shader actiu: "postfx" o "crtpi".
constexpr const char* POSTFX_DEFAULT_PRESET = "CRT"; // Preset inicial PostFX.
constexpr const char* CRTPI_DEFAULT_PRESET = "DEFAULT"; // Preset inicial CrtPi.
constexpr const char* POSTFX_FILE = "shaders/postfx.yaml"; // Relatiu a la carpeta de sistema.
constexpr const char* CRTPI_FILE = "shaders/crtpi.yaml"; // Relatiu a la carpeta de sistema.
constexpr RenderInfoPosition RENDER_INFO_POSITION = RenderInfoPosition::OFF; // Overlay de debug amagat per defecte.
constexpr bool RENDER_INFO_SHOW_TIME = true; // Si l'overlay és visible, mostra el temps de joc.
} // namespace Video
namespace Audio {
+1 -1
View File
@@ -3,7 +3,7 @@
namespace Texts {
constexpr const char* WINDOW_TITLE = "© 2026 Aventures en Egipte — JailDesigner";
constexpr const char* COPYRIGHT = "© 2026 JailDesigner";
constexpr const char* VERSION = "0.13.0"; // Single source of truth — Makefile el grep
constexpr const char* VERSION = "0.14.0"; // Single source of truth — Makefile el grep
} // namespace Texts
namespace GameCanvas {
+26
View File
@@ -0,0 +1,26 @@
#include "utils/easing.hpp"
namespace Easing {
auto linear(float t) -> float { return t; }
auto outQuad(float t) -> float { return 1.0F - ((1.0F - t) * (1.0F - t)); }
auto inQuad(float t) -> float { return t * t; }
auto inOutQuad(float t) -> float {
return t < 0.5F
? 2.0F * t * t
: 1.0F - ((-2.0F * t + 2.0F) * (-2.0F * t + 2.0F) / 2.0F);
}
auto outCubic(float t) -> float {
const float INV = 1.0F - t;
return 1.0F - (INV * INV * INV);
}
auto inCubic(float t) -> float { return t * t * t; }
auto lerp(float a, float b, float t) -> float { return a + ((b - a) * t); }
auto lerpInt(int a, int b, float t) -> int {
return a + static_cast<int>(static_cast<float>(b - a) * t);
}
} // namespace Easing
+20
View File
@@ -0,0 +1,20 @@
#pragma once
// Funcions de suavitzat per a animacions. Totes accepten t en el rang [0, 1]
// i retornen un valor en [0, 1] (amb overshoot possible en algunes variants).
// Pensades per aplicar-se al paràmetre d'un lerp.
namespace Easing {
auto linear(float t) -> float;
auto outQuad(float t) -> float;
auto inQuad(float t) -> float;
auto inOutQuad(float t) -> float;
auto outCubic(float t) -> float;
auto inCubic(float t) -> float;
auto lerp(float a, float b, float t) -> float;
auto lerpInt(int a, int b, float t) -> int;
} // namespace Easing