Eliminado código DEPRECATED de ui_manager
This commit is contained in:
@@ -39,16 +39,11 @@ static SDL_Rect getPhysicalViewport(SDL_Renderer* renderer) {
|
||||
}
|
||||
|
||||
UIManager::UIManager()
|
||||
: text_renderer_(nullptr)
|
||||
, text_renderer_debug_(nullptr)
|
||||
: text_renderer_debug_(nullptr)
|
||||
, text_renderer_notifier_(nullptr)
|
||||
, notifier_(nullptr)
|
||||
, help_overlay_(nullptr)
|
||||
, show_debug_(false)
|
||||
, show_text_(true)
|
||||
, text_()
|
||||
, text_pos_(0)
|
||||
, text_init_time_(0)
|
||||
, fps_last_time_(0)
|
||||
, fps_frame_count_(0)
|
||||
, fps_current_(0)
|
||||
@@ -63,7 +58,6 @@ UIManager::UIManager()
|
||||
|
||||
UIManager::~UIManager() {
|
||||
// Limpieza: Los objetos creados con new deben ser eliminados
|
||||
delete text_renderer_;
|
||||
delete text_renderer_debug_;
|
||||
delete text_renderer_notifier_;
|
||||
delete notifier_;
|
||||
@@ -81,12 +75,10 @@ void UIManager::initialize(SDL_Renderer* renderer, ThemeManager* theme_manager,
|
||||
current_font_size_ = calculateFontSize(physical_width, physical_height);
|
||||
|
||||
// Crear renderers de texto
|
||||
text_renderer_ = new TextRenderer();
|
||||
text_renderer_debug_ = new TextRenderer();
|
||||
text_renderer_notifier_ = new TextRenderer();
|
||||
|
||||
// Inicializar renderers con tamaño dinámico
|
||||
text_renderer_->init(renderer, "data/fonts/FunnelSans-Regular.ttf", current_font_size_, true);
|
||||
text_renderer_debug_->init(renderer, "data/fonts/FunnelSans-Regular.ttf", current_font_size_, true);
|
||||
text_renderer_notifier_->init(renderer, "data/fonts/FunnelSans-Regular.ttf", current_font_size_, true);
|
||||
|
||||
@@ -115,11 +107,6 @@ void UIManager::update(Uint64 current_time, float delta_time) {
|
||||
fps_text_ = "fps: " + std::to_string(fps_current_);
|
||||
}
|
||||
|
||||
// Actualizar texto obsoleto (DEPRECATED)
|
||||
if (show_text_) {
|
||||
show_text_ = !(SDL_GetTicks() - text_init_time_ > TEXT_DURATION);
|
||||
}
|
||||
|
||||
// Actualizar sistema de notificaciones
|
||||
notifier_->update(current_time);
|
||||
}
|
||||
@@ -138,11 +125,6 @@ void UIManager::render(SDL_Renderer* renderer,
|
||||
physical_window_width_ = physical_width;
|
||||
physical_window_height_ = physical_height;
|
||||
|
||||
// Renderizar texto obsoleto centrado (DEPRECATED - mantener temporalmente)
|
||||
if (show_text_) {
|
||||
renderObsoleteText(current_screen_width);
|
||||
}
|
||||
|
||||
// Renderizar debug HUD si está activo
|
||||
if (show_debug_) {
|
||||
renderDebugHUD(engine, scene_manager, current_mode, current_app_mode,
|
||||
@@ -191,9 +173,6 @@ void UIManager::updatePhysicalWindowSize(int width, int height) {
|
||||
current_font_size_ = new_font_size;
|
||||
|
||||
// Reinicializar text renderers con nuevo tamaño
|
||||
if (text_renderer_) {
|
||||
text_renderer_->reinitialize(current_font_size_);
|
||||
}
|
||||
if (text_renderer_debug_) {
|
||||
text_renderer_debug_->reinitialize(current_font_size_);
|
||||
}
|
||||
@@ -211,13 +190,6 @@ void UIManager::updatePhysicalWindowSize(int width, int height) {
|
||||
notifier_->updateWindowSize(width, height);
|
||||
}
|
||||
|
||||
void UIManager::setTextObsolete(const std::string& text, int pos, int current_screen_width) {
|
||||
text_ = text;
|
||||
text_pos_ = pos;
|
||||
text_init_time_ = SDL_GetTicks();
|
||||
show_text_ = true;
|
||||
}
|
||||
|
||||
// === Métodos privados ===
|
||||
|
||||
void UIManager::renderDebugHUD(const Engine* engine,
|
||||
@@ -424,27 +396,6 @@ void UIManager::renderDebugHUD(const Engine* engine,
|
||||
}
|
||||
}
|
||||
|
||||
void UIManager::renderObsoleteText(int current_screen_width) {
|
||||
// DEPRECATED: Sistema antiguo de texto centrado
|
||||
// Mantener por compatibilidad temporal hasta migrar todo a Notifier
|
||||
|
||||
// Calcular escala dinámica basada en resolución física
|
||||
float text_scale_x = static_cast<float>(physical_window_width_) / 426.0f;
|
||||
float text_scale_y = static_cast<float>(physical_window_height_) / 240.0f;
|
||||
|
||||
// Obtener color del tema actual (LERP interpolado)
|
||||
int margin = 8;
|
||||
Color text_color = theme_manager_->getInterpolatedColor(0);
|
||||
int text_color_r = text_color.r;
|
||||
int text_color_g = text_color.g;
|
||||
int text_color_b = text_color.b;
|
||||
|
||||
// Renderizar texto centrado usando coordenadas físicas
|
||||
text_renderer_->printPhysical(text_pos_, margin, text_.c_str(),
|
||||
text_color_r, text_color_g, text_color_b,
|
||||
text_scale_x, text_scale_y);
|
||||
}
|
||||
|
||||
std::string UIManager::gravityDirectionToString(int direction) const {
|
||||
switch (direction) {
|
||||
case 0: return "Abajo"; // DOWN
|
||||
|
||||
Reference in New Issue
Block a user