#pragma once

#include <SDL3/SDL.h>

#include "core/locale/lang.h"
#include "utils/utils.h"

// =============================================================================
// Defaults per a Options (alineats amb coffee_crisis_arcade_edition).
// =============================================================================

namespace Defaults::Window {
    constexpr const char *CAPTION = "© 2020 Coffee Crisis — JailDesigner";
    constexpr int ZOOM = 3;
    constexpr int MAX_ZOOM = 4;
}  // namespace Defaults::Window

namespace Defaults::Video {
    constexpr SDL_ScaleMode SCALE_MODE = SDL_ScaleMode::SDL_SCALEMODE_NEAREST;
    constexpr bool FULLSCREEN = false;
    constexpr bool VSYNC = true;
    constexpr bool INTEGER_SCALE = true;
    constexpr bool GPU_ACCELERATION = true;
    constexpr const char *GPU_PREFERRED_DRIVER = "";
    constexpr bool SHADER_ENABLED = false;
    constexpr bool SUPERSAMPLING = false;
    constexpr bool LINEAR_UPSCALE = false;
    constexpr int DOWNSCALE_ALGO = 1;
}  // namespace Defaults::Video

namespace Defaults::Audio {
    constexpr bool ENABLED = true;
    constexpr float VOLUME = 1.0F;
}  // namespace Defaults::Audio

namespace Defaults::Music {
    constexpr bool ENABLED = true;
    constexpr float VOLUME = 0.8F;
}  // namespace Defaults::Music

namespace Defaults::Sound {
    constexpr bool ENABLED = true;
    constexpr float VOLUME = 1.0F;
}  // namespace Defaults::Sound

namespace Defaults::Loading {
    constexpr bool SHOW = false;
    constexpr bool SHOW_RESOURCE_NAME = true;
    constexpr bool WAIT_FOR_INPUT = false;
}  // namespace Defaults::Loading

namespace Defaults::Settings {
    constexpr int DIFFICULTY = DIFFICULTY_NORMAL;
    constexpr int LANGUAGE = ba_BA;
    constexpr palette_e PALETTE = p_zxspectrum;
}  // namespace Defaults::Settings

// Tamaño de bloque
constexpr int BLOCK = 8;
constexpr int HALF_BLOCK = BLOCK / 2;

// Tamaño de la pantalla virtual
constexpr int GAMECANVAS_WIDTH = 256;
constexpr int GAMECANVAS_HEIGHT = 192;

// Zona de juego
constexpr int PLAY_AREA_TOP = (0 * BLOCK);
constexpr int PLAY_AREA_BOTTOM = GAMECANVAS_HEIGHT - (4 * BLOCK);
constexpr int PLAY_AREA_LEFT = (0 * BLOCK);
constexpr int PLAY_AREA_RIGHT = GAMECANVAS_WIDTH - (0 * BLOCK);
constexpr int PLAY_AREA_WIDTH = PLAY_AREA_RIGHT - PLAY_AREA_LEFT;
constexpr int PLAY_AREA_HEIGHT = PLAY_AREA_BOTTOM - PLAY_AREA_TOP;
constexpr int PLAY_AREA_CENTER_X = PLAY_AREA_LEFT + (PLAY_AREA_WIDTH / 2);
constexpr int PLAY_AREA_CENTER_FIRST_QUARTER_X = (PLAY_AREA_WIDTH / 4);
constexpr int PLAY_AREA_CENTER_THIRD_QUARTER_X = (PLAY_AREA_WIDTH / 4) * 3;
constexpr int PLAY_AREA_CENTER_Y = PLAY_AREA_TOP + (PLAY_AREA_HEIGHT / 2);
constexpr int PLAY_AREA_FIRST_QUARTER_Y = PLAY_AREA_HEIGHT / 4;
constexpr int PLAY_AREA_THIRD_QUARTER_Y = (PLAY_AREA_HEIGHT / 4) * 3;

// Anclajes de pantalla
constexpr int GAMECANVAS_CENTER_X = GAMECANVAS_WIDTH / 2;
constexpr int GAMECANVAS_FIRST_QUARTER_X = GAMECANVAS_WIDTH / 4;
constexpr int GAMECANVAS_THIRD_QUARTER_X = (GAMECANVAS_WIDTH / 4) * 3;
constexpr int GAMECANVAS_CENTER_Y = GAMECANVAS_HEIGHT / 2;
constexpr int GAMECANVAS_FIRST_QUARTER_Y = GAMECANVAS_HEIGHT / 4;
constexpr int GAMECANVAS_THIRD_QUARTER_Y = (GAMECANVAS_HEIGHT / 4) * 3;

// Secciones del programa
constexpr int SECTION_PROG_LOGO = 0;
constexpr int SECTION_PROG_INTRO = 1;
constexpr int SECTION_PROG_TITLE = 2;
constexpr int SECTION_PROG_GAME = 3;
constexpr int SECTION_PROG_QUIT = 4;

// Subsecciones
constexpr int SUBSECTION_GAME_PLAY_1P = 0;
constexpr int SUBSECTION_GAME_PLAY_2P = 1;
constexpr int SUBSECTION_GAME_PAUSE = 2;
constexpr int SUBSECTION_GAME_GAMEOVER = 3;
constexpr int SUBSECTION_TITLE_1 = 3;
constexpr int SUBSECTION_TITLE_2 = 4;
constexpr int SUBSECTION_TITLE_3 = 5;
constexpr int SUBSECTION_TITLE_INSTRUCTIONS = 6;

// Ningun tipo
constexpr int NO_KIND = 0;

// Colores
const color_t bgColor = {0x27, 0x27, 0x36};
const color_t noColor = {0xFF, 0xFF, 0xFF};
const color_t shdwTxtColor = {0x43, 0x43, 0x4F};
