Mes colorets
This commit is contained in:
@@ -63,4 +63,15 @@ service_menu.title_color 99FF62
|
|||||||
service_menu.text_color FFFFFF
|
service_menu.text_color FFFFFF
|
||||||
service_menu.selected_color FFDC44
|
service_menu.selected_color FFDC44
|
||||||
service_menu.bg_color 000000F0
|
service_menu.bg_color 000000F0
|
||||||
service_menu.drop_shadow false
|
service_menu.drop_shadow false
|
||||||
|
|
||||||
|
## --- INTRO ---
|
||||||
|
intro.bg_color 000000
|
||||||
|
intro.card_color FFFFFF
|
||||||
|
|
||||||
|
## --- DEBUG ---
|
||||||
|
debug.color 00FFFF
|
||||||
|
|
||||||
|
## --- RESOURCE ---
|
||||||
|
resource.color CDD1CD
|
||||||
|
resource.color 17E97A
|
||||||
@@ -63,4 +63,15 @@ service_menu.title_color 99FF62
|
|||||||
service_menu.text_color FFFFFF
|
service_menu.text_color FFFFFF
|
||||||
service_menu.selected_color FFDC44
|
service_menu.selected_color FFDC44
|
||||||
service_menu.bg_color 000000F0
|
service_menu.bg_color 000000F0
|
||||||
service_menu.drop_shadow false
|
service_menu.drop_shadow false
|
||||||
|
|
||||||
|
## --- INTRO ---
|
||||||
|
intro.bg_color 000000
|
||||||
|
intro.card_color 543149
|
||||||
|
|
||||||
|
## --- DEBUG ---
|
||||||
|
debug.color 00FFFF
|
||||||
|
|
||||||
|
## --- RESOURCE ---
|
||||||
|
resource.color CDD1CD
|
||||||
|
resource.color 17E97A
|
||||||
@@ -348,7 +348,8 @@ void Intro::initSprites()
|
|||||||
auto temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
auto temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||||
shadow_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
shadow_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||||
|
|
||||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0x00, 0x00, 0xFF);
|
auto color = param.intro.card_color;
|
||||||
|
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, color.a);
|
||||||
SDL_RenderClear(Screen::get()->getRenderer());
|
SDL_RenderClear(Screen::get()->getRenderer());
|
||||||
|
|
||||||
SDL_FRect rect = {BORDER / 2, BORDER / 2, SPRITE_WIDTH, SPRITE_HEIGHT};
|
SDL_FRect rect = {BORDER / 2, BORDER / 2, SPRITE_WIDTH, SPRITE_HEIGHT};
|
||||||
|
|||||||
@@ -388,6 +388,29 @@ bool setParams(const std::string &var, const std::string &value)
|
|||||||
param.service_menu.drop_shadow = stringToBool(value);
|
param.service_menu.drop_shadow = stringToBool(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// INTRO
|
||||||
|
else if (var == "intro.bg_color")
|
||||||
|
{
|
||||||
|
param.intro.bg_color = Color::fromHex(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (var == "intro.card_color")
|
||||||
|
{
|
||||||
|
param.intro.card_color = Color::fromHex(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
else if (var == "debug.color")
|
||||||
|
{
|
||||||
|
param.debug.color = Color::fromHex(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// RESOURCE
|
||||||
|
else if (var == "resource.color")
|
||||||
|
{
|
||||||
|
param.resource.color = Color::fromHex(value);
|
||||||
|
}
|
||||||
|
|
||||||
// RESTO
|
// RESTO
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -91,6 +91,25 @@ struct ParamServiceMenu
|
|||||||
bool drop_shadow;
|
bool drop_shadow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// --- Parámetros de la intro ---
|
||||||
|
struct ParamIntro
|
||||||
|
{
|
||||||
|
Color bg_color;
|
||||||
|
Color card_color;
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Parámetros para Debug ---
|
||||||
|
struct ParamDebug
|
||||||
|
{
|
||||||
|
Color color;
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Parámetros para Resource ---
|
||||||
|
struct ParamResource
|
||||||
|
{
|
||||||
|
Color color;
|
||||||
|
};
|
||||||
|
|
||||||
// --- Estructura principal para almacenar todos los parámetros del juego ---
|
// --- Estructura principal para almacenar todos los parámetros del juego ---
|
||||||
struct Param
|
struct Param
|
||||||
{
|
{
|
||||||
@@ -102,6 +121,9 @@ struct Param
|
|||||||
std::vector<ParamBalloon> balloon; // Parámetros de los globos
|
std::vector<ParamBalloon> balloon; // Parámetros de los globos
|
||||||
ParamNotification notification; // Parámetros de las notificaciones
|
ParamNotification notification; // Parámetros de las notificaciones
|
||||||
ParamServiceMenu service_menu; // Parámetros del menú de servicio
|
ParamServiceMenu service_menu; // Parámetros del menú de servicio
|
||||||
|
ParamIntro intro; // Parámetros de la intro
|
||||||
|
ParamDebug debug; // Parámetros para Debug
|
||||||
|
ParamResource resource; // Parámetros para Resource
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Param() : game(), fade(), scoreboard(), title(), background(), notification()
|
Param() : game(), fade(), scoreboard(), title(), background(), notification()
|
||||||
|
|||||||
@@ -3,14 +3,15 @@
|
|||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <algorithm> // Para find_if
|
#include <algorithm> // Para find_if
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <stdexcept> // Para runtime_error
|
#include <stdexcept> // Para runtime_error
|
||||||
#include "asset.h" // Para Asset, AssetType
|
#include "asset.h" // Para Asset, AssetType
|
||||||
#include "external/jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
#include "external/jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
||||||
#include "lang.h" // Para getText
|
#include "lang.h" // Para getText
|
||||||
#include "screen.h" // Para Screen
|
#include "screen.h" // Para Screen
|
||||||
#include "text.h" // Para Text, loadTextFile
|
#include "text.h" // Para Text, loadTextFile
|
||||||
struct JA_Music_t; // lines 11-11
|
#include "param.h"
|
||||||
struct JA_Sound_t; // lines 12-12
|
struct JA_Music_t; // lines 11-11
|
||||||
|
struct JA_Sound_t; // lines 12-12
|
||||||
|
|
||||||
// Singleton
|
// Singleton
|
||||||
Resource *Resource::instance_ = nullptr;
|
Resource *Resource::instance_ = nullptr;
|
||||||
@@ -435,19 +436,22 @@ void Resource::renderProgress()
|
|||||||
screen->start();
|
screen->start();
|
||||||
screen->clean();
|
screen->clean();
|
||||||
|
|
||||||
// Establece el color de dibujo a blanco
|
auto color = param.resource.color.darken();
|
||||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
|
||||||
|
|
||||||
// Dibuja la barra de progreso (marco y barra llena)
|
// Dibuja el interior de la barra de progreso
|
||||||
SDL_RenderRect(renderer, &loading_wired_rect_);
|
SDL_SetRenderDrawColor(renderer, param.resource.color.r, param.resource.color.g, param.resource.color.b, param.resource.color.a);
|
||||||
SDL_RenderFillRect(renderer, &loading_full_rect_);
|
SDL_RenderFillRect(renderer, &loading_full_rect_);
|
||||||
|
|
||||||
|
// Dibuja el marco de la barra de progreso
|
||||||
|
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
|
||||||
|
SDL_RenderRect(renderer, &loading_wired_rect_);
|
||||||
|
|
||||||
// Escribe el texto de carga encima de la barra
|
// Escribe el texto de carga encima de la barra
|
||||||
loading_text_->write(
|
loading_text_->writeColored(
|
||||||
loading_wired_rect_.x,
|
loading_wired_rect_.x,
|
||||||
loading_wired_rect_.y - 9,
|
loading_wired_rect_.y - 9,
|
||||||
Lang::getText("[RESOURCE] LOADING") + " : " + loading_resource_name_
|
Lang::getText("[RESOURCE] LOADING") + " : " + loading_resource_name_,
|
||||||
);
|
param.resource.color);
|
||||||
|
|
||||||
// Renderiza el frame en pantalla
|
// Renderiza el frame en pantalla
|
||||||
screen->coreRender();
|
screen->coreRender();
|
||||||
|
|||||||
@@ -248,11 +248,11 @@ void Screen::renderInfo()
|
|||||||
if (debug_info_.show)
|
if (debug_info_.show)
|
||||||
{
|
{
|
||||||
// Resolution
|
// Resolution
|
||||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_SHADOW, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, DEBUG_COLOR, 1, DEBUG_COLOR.darken(150));
|
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, param.debug.color, 1, param.debug.color.darken(150));
|
||||||
|
|
||||||
// FPS
|
// FPS
|
||||||
const std::string FPS_TEXT = std::to_string(fps_.lastValue) + " FPS";
|
const std::string FPS_TEXT = std::to_string(fps_.lastValue) + " FPS";
|
||||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_SHADOW, param.game.width - debug_info_.text->lenght(FPS_TEXT) - 2, 1 + debug_info_.text->getCharacterSize(), FPS_TEXT, 1, DEBUG_COLOR, 1, DEBUG_COLOR.darken(150));
|
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(FPS_TEXT) - 2, 1 + debug_info_.text->getCharacterSize(), FPS_TEXT, 1, param.debug.color, 1, param.debug.color.darken(150));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -180,8 +180,6 @@ constexpr Color BLUE_SKY_COLOR = Color(0X02, 0X88, 0XD1);
|
|||||||
constexpr Color PINK_SKY_COLOR = Color(0XFF, 0X6B, 0X97);
|
constexpr Color PINK_SKY_COLOR = Color(0XFF, 0X6B, 0X97);
|
||||||
constexpr Color GREEN_SKY_COLOR = Color(0X00, 0X79, 0X6B);
|
constexpr Color GREEN_SKY_COLOR = Color(0X00, 0X79, 0X6B);
|
||||||
|
|
||||||
constexpr Color DEBUG_COLOR = Color(0xFF, 0xFF, 0x00);
|
|
||||||
|
|
||||||
// Colores y gráficos
|
// Colores y gráficos
|
||||||
Color getColorLikeKnightRider(const std::vector<Color> &colors, int counter_);
|
Color getColorLikeKnightRider(const std::vector<Color> &colors, int counter_);
|
||||||
constexpr HSV rgbToHsv(Color color);
|
constexpr HSV rgbToHsv(Color color);
|
||||||
|
|||||||
Reference in New Issue
Block a user