refactor: eliminar código muerto (constantes legacy y métodos sin usar)
- defines.hpp: eliminar WINDOW_ZOOM_MIN, WINDOW_ZOOM_MAX (legacy), ROTOBALL_TRANSITION_TIME y LOGO_MODE_MIN_BALLS (reemplazada por LOGO_MIN_SCENARIO_IDX) - resource_pack: eliminar encryptData/decryptData (XOR preparado pero nunca integrado en el pipeline de carga/guardado) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,15 +12,12 @@ constexpr int DEFAULT_SCREEN_WIDTH = 1280; // Ancho lógico por defecto (si no
|
|||||||
constexpr int DEFAULT_SCREEN_HEIGHT = 720; // Alto lógico por defecto (si no hay -h)
|
constexpr int DEFAULT_SCREEN_HEIGHT = 720; // Alto lógico por defecto (si no hay -h)
|
||||||
constexpr int DEFAULT_WINDOW_ZOOM = 1; // Zoom inicial de ventana (1x = sin zoom)
|
constexpr int DEFAULT_WINDOW_ZOOM = 1; // Zoom inicial de ventana (1x = sin zoom)
|
||||||
|
|
||||||
// Configuración de zoom dinámico de ventana (legacy, solo usado en initialize())
|
|
||||||
constexpr int WINDOW_ZOOM_MIN = 1; // Zoom mínimo (legacy, para validación inicial)
|
|
||||||
constexpr int WINDOW_ZOOM_MAX = 10; // Zoom máximo teórico (legacy)
|
|
||||||
constexpr int WINDOW_DESKTOP_MARGIN = 10; // Margen mínimo con bordes del escritorio
|
constexpr int WINDOW_DESKTOP_MARGIN = 10; // Margen mínimo con bordes del escritorio
|
||||||
constexpr int WINDOW_DECORATION_HEIGHT = 30; // Altura estimada de decoraciones del SO
|
constexpr int WINDOW_DECORATION_HEIGHT = 30; // Altura estimada de decoraciones del SO
|
||||||
|
|
||||||
// Configuración de escala de ventana por pasos (F1/F2)
|
// Configuración de escala de ventana por pasos (F1/F2)
|
||||||
constexpr float WINDOW_SCALE_STEP = 0.1f; // Incremento/decremento por pulsación (10%)
|
constexpr float WINDOW_SCALE_STEP = 0.1f; // Incremento/decremento por pulsación (10%)
|
||||||
constexpr float WINDOW_SCALE_MIN = 0.5f; // Escala mínima (50% de la resolución base)
|
constexpr float WINDOW_SCALE_MIN = 0.5f; // Escala mínima (50% de la resolución base)
|
||||||
|
|
||||||
// Configuración de física
|
// Configuración de física
|
||||||
constexpr float GRAVITY_FORCE = 0.2f; // Fuerza de gravedad (píxeles/frame²)
|
constexpr float GRAVITY_FORCE = 0.2f; // Fuerza de gravedad (píxeles/frame²)
|
||||||
@@ -58,30 +55,31 @@ constexpr float GRAVITY_CHANGE_LATERAL_MAX = 0.08f; // Velocidad lateral máxim
|
|||||||
constexpr float BALL_SPAWN_MARGIN = 0.15f; // Margen lateral para spawn (0.25 = 25% a cada lado)
|
constexpr float BALL_SPAWN_MARGIN = 0.15f; // Margen lateral para spawn (0.25 = 25% a cada lado)
|
||||||
|
|
||||||
// Escenarios de número de pelotas (teclas 1-8)
|
// Escenarios de número de pelotas (teclas 1-8)
|
||||||
// Fase 1 (instanced rendering): límit pràctic ~100K a 60fps (physics bound)
|
constexpr int SCENE_BALLS_1 = 10;
|
||||||
constexpr int SCENE_BALLS_1 = 10;
|
constexpr int SCENE_BALLS_2 = 50;
|
||||||
constexpr int SCENE_BALLS_2 = 50;
|
constexpr int SCENE_BALLS_3 = 100;
|
||||||
constexpr int SCENE_BALLS_3 = 100;
|
constexpr int SCENE_BALLS_4 = 500;
|
||||||
constexpr int SCENE_BALLS_4 = 500;
|
constexpr int SCENE_BALLS_5 = 1000;
|
||||||
constexpr int SCENE_BALLS_5 = 1000;
|
constexpr int SCENE_BALLS_6 = 5000;
|
||||||
constexpr int SCENE_BALLS_6 = 5000;
|
constexpr int SCENE_BALLS_7 = 10000;
|
||||||
constexpr int SCENE_BALLS_7 = 10000;
|
constexpr int SCENE_BALLS_8 = 50000; // Máximo escenario estándar (tecla 8)
|
||||||
constexpr int SCENE_BALLS_8 = 50000; // Máximo escenario estándar (tecla 8)
|
|
||||||
|
|
||||||
constexpr int SCENARIO_COUNT = 8;
|
constexpr int SCENARIO_COUNT = 8;
|
||||||
constexpr int BALL_COUNT_SCENARIOS[SCENARIO_COUNT] = {
|
constexpr int BALL_COUNT_SCENARIOS[SCENARIO_COUNT] = {
|
||||||
SCENE_BALLS_1, SCENE_BALLS_2, SCENE_BALLS_3, SCENE_BALLS_4,
|
SCENE_BALLS_1,
|
||||||
SCENE_BALLS_5, SCENE_BALLS_6, SCENE_BALLS_7, SCENE_BALLS_8
|
SCENE_BALLS_2,
|
||||||
};
|
SCENE_BALLS_3,
|
||||||
|
SCENE_BALLS_4,
|
||||||
|
SCENE_BALLS_5,
|
||||||
|
SCENE_BALLS_6,
|
||||||
|
SCENE_BALLS_7,
|
||||||
|
SCENE_BALLS_8};
|
||||||
|
|
||||||
constexpr int BOIDS_MAX_BALLS = SCENE_BALLS_5; // 1 000 bolas máximo en modo BOIDS
|
constexpr int BOIDS_MAX_BALLS = SCENE_BALLS_5; // 1 000 bolas máximo en modo BOIDS
|
||||||
|
constexpr int DEMO_AUTO_MIN_SCENARIO = 2; // mínimo 100 bolas
|
||||||
// Límites de escenario para modos automáticos (índices en BALL_COUNT_SCENARIOS)
|
constexpr int DEMO_AUTO_MAX_SCENARIO = 7; // máximo sin restricción hardware (ajustado por benchmark)
|
||||||
// 0 1 2 3 4 5 6 7
|
constexpr int LOGO_MIN_SCENARIO_IDX = 4; // mínimo 1000 bolas (sustituye LOGO_MODE_MIN_BALLS)
|
||||||
constexpr int DEMO_AUTO_MIN_SCENARIO = 2; // mínimo 100 bolas
|
constexpr int CUSTOM_SCENARIO_IDX = 8; // Escenario custom opcional (tecla 9, --custom-balls)
|
||||||
constexpr int DEMO_AUTO_MAX_SCENARIO = 7; // máximo sin restricción hardware (ajustado por benchmark)
|
|
||||||
constexpr int LOGO_MIN_SCENARIO_IDX = 4; // mínimo 1000 bolas (sustituye LOGO_MODE_MIN_BALLS)
|
|
||||||
constexpr int CUSTOM_SCENARIO_IDX = 8; // Escenario custom opcional (tecla 9, --custom-balls)
|
|
||||||
|
|
||||||
// Estructura para representar colores RGB
|
// Estructura para representar colores RGB
|
||||||
struct Color {
|
struct Color {
|
||||||
@@ -186,7 +184,6 @@ enum class ScalingMode {
|
|||||||
constexpr float ROTOBALL_RADIUS_FACTOR = 0.333f; // Radio como proporción de altura de pantalla (80/240 ≈ 0.333)
|
constexpr float ROTOBALL_RADIUS_FACTOR = 0.333f; // Radio como proporción de altura de pantalla (80/240 ≈ 0.333)
|
||||||
constexpr float ROTOBALL_ROTATION_SPEED_Y = 1.5f; // Velocidad rotación eje Y (rad/s)
|
constexpr float ROTOBALL_ROTATION_SPEED_Y = 1.5f; // Velocidad rotación eje Y (rad/s)
|
||||||
constexpr float ROTOBALL_ROTATION_SPEED_X = 0.8f; // Velocidad rotación eje X (rad/s)
|
constexpr float ROTOBALL_ROTATION_SPEED_X = 0.8f; // Velocidad rotación eje X (rad/s)
|
||||||
constexpr float ROTOBALL_TRANSITION_TIME = 1.5f; // Tiempo de transición (segundos)
|
|
||||||
constexpr int ROTOBALL_MIN_BRIGHTNESS = 50; // Brillo mínimo (fondo, 0-255)
|
constexpr int ROTOBALL_MIN_BRIGHTNESS = 50; // Brillo mínimo (fondo, 0-255)
|
||||||
constexpr int ROTOBALL_MAX_BRIGHTNESS = 255; // Brillo máximo (frente, 0-255)
|
constexpr int ROTOBALL_MAX_BRIGHTNESS = 255; // Brillo máximo (frente, 0-255)
|
||||||
|
|
||||||
@@ -295,7 +292,6 @@ constexpr int DEMO_LITE_WEIGHT_IMPULSE = 10; // Aplicar impulso (10%)
|
|||||||
// TOTAL: 100
|
// TOTAL: 100
|
||||||
|
|
||||||
// Configuración de Modo LOGO (easter egg - "marca de agua")
|
// Configuración de Modo LOGO (easter egg - "marca de agua")
|
||||||
constexpr int LOGO_MODE_MIN_BALLS = 500; // Mínimo de pelotas para activar modo logo
|
|
||||||
constexpr float LOGO_MODE_SHAPE_SCALE = 1.2f; // Escala de figura en modo logo (120%)
|
constexpr float LOGO_MODE_SHAPE_SCALE = 1.2f; // Escala de figura en modo logo (120%)
|
||||||
constexpr float LOGO_ACTION_INTERVAL_MIN = 3.0f; // Tiempo mínimo entre alternancia SHAPE/PHYSICS (escalado con resolución)
|
constexpr float LOGO_ACTION_INTERVAL_MIN = 3.0f; // Tiempo mínimo entre alternancia SHAPE/PHYSICS (escalado con resolución)
|
||||||
constexpr float LOGO_ACTION_INTERVAL_MAX = 5.0f; // Tiempo máximo entre alternancia SHAPE/PHYSICS (escalado con resolución)
|
constexpr float LOGO_ACTION_INTERVAL_MAX = 5.0f; // Tiempo máximo entre alternancia SHAPE/PHYSICS (escalado con resolución)
|
||||||
|
|||||||
@@ -231,17 +231,6 @@ void ResourcePack::clear() {
|
|||||||
// FUNCIONES AUXILIARES
|
// FUNCIONES AUXILIARES
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
void ResourcePack::encryptData(unsigned char* data, size_t size) {
|
|
||||||
for (size_t i = 0; i < size; i++) {
|
|
||||||
data[i] ^= XOR_KEY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePack::decryptData(unsigned char* data, size_t size) {
|
|
||||||
// XOR es simétrico
|
|
||||||
encryptData(data, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t ResourcePack::calculateChecksum(const unsigned char* data, size_t size) {
|
uint32_t ResourcePack::calculateChecksum(const unsigned char* data, size_t size) {
|
||||||
uint32_t checksum = 0;
|
uint32_t checksum = 0;
|
||||||
for (size_t i = 0; i < size; i++) {
|
for (size_t i = 0; i < size; i++) {
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ private:
|
|||||||
bool isLoaded_;
|
bool isLoaded_;
|
||||||
|
|
||||||
// Funciones auxiliares
|
// Funciones auxiliares
|
||||||
void encryptData(unsigned char* data, size_t size);
|
|
||||||
void decryptData(unsigned char* data, size_t size);
|
|
||||||
uint32_t calculateChecksum(const unsigned char* data, size_t size);
|
uint32_t calculateChecksum(const unsigned char* data, size_t size);
|
||||||
std::string normalizePath(const std::string& path);
|
std::string normalizePath(const std::string& path);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user