mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2026-04-27 04:31:39 +00:00
More style changes.
This commit is contained in:
parent
937f390331
commit
5b5c51fc83
6 changed files with 74 additions and 21 deletions
|
|
@ -21,6 +21,8 @@ namespace recompui {
|
||||||
set_color(Color{ 204, 204, 204, 255 });
|
set_color(Color{ 204, 204, 204, 255 });
|
||||||
set_tab_index(TabIndex::Auto);
|
set_tab_index(TabIndex::Auto);
|
||||||
hover_style.set_color(Color{ 242, 242, 242, 255 });
|
hover_style.set_color(Color{ 242, 242, 242, 255 });
|
||||||
|
disabled_style.set_color(Color{ 204, 204, 204, 128 });
|
||||||
|
hover_disabled_style.set_color(Color{ 242, 242, 242, 128 });
|
||||||
|
|
||||||
const uint8_t border_opacity = 204;
|
const uint8_t border_opacity = 204;
|
||||||
const uint8_t background_opacity = 13;
|
const uint8_t background_opacity = 13;
|
||||||
|
|
@ -32,6 +34,10 @@ namespace recompui {
|
||||||
set_background_color({ 185, 125, 242, background_opacity });
|
set_background_color({ 185, 125, 242, background_opacity });
|
||||||
hover_style.set_border_color({ 185, 125, 242, border_hover_opacity });
|
hover_style.set_border_color({ 185, 125, 242, border_hover_opacity });
|
||||||
hover_style.set_background_color({ 185, 125, 242, background_hover_opacity });
|
hover_style.set_background_color({ 185, 125, 242, background_hover_opacity });
|
||||||
|
disabled_style.set_border_color({ 185, 125, 242, border_opacity / 4 });
|
||||||
|
disabled_style.set_background_color({ 185, 125, 242, background_opacity / 4 });
|
||||||
|
hover_disabled_style.set_border_color({ 185, 125, 242, border_hover_opacity / 4 });
|
||||||
|
hover_disabled_style.set_background_color({ 185, 125, 242, background_hover_opacity / 4 });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ButtonStyle::Secondary: {
|
case ButtonStyle::Secondary: {
|
||||||
|
|
@ -39,6 +45,10 @@ namespace recompui {
|
||||||
set_background_color({ 23, 214, 232, background_opacity });
|
set_background_color({ 23, 214, 232, background_opacity });
|
||||||
hover_style.set_border_color({ 23, 214, 232, border_hover_opacity });
|
hover_style.set_border_color({ 23, 214, 232, border_hover_opacity });
|
||||||
hover_style.set_background_color({ 23, 214, 232, background_hover_opacity });
|
hover_style.set_background_color({ 23, 214, 232, background_hover_opacity });
|
||||||
|
disabled_style.set_border_color({ 23, 214, 232, border_opacity / 4 });
|
||||||
|
disabled_style.set_background_color({ 23, 214, 232, background_opacity / 4 });
|
||||||
|
hover_disabled_style.set_border_color({ 23, 214, 232, border_hover_opacity / 4 });
|
||||||
|
hover_disabled_style.set_background_color({ 23, 214, 232, background_hover_opacity / 4 });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
@ -46,11 +56,6 @@ namespace recompui {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
disabled_style.set_border_color({ 128, 128, 128, border_hover_opacity });
|
|
||||||
disabled_style.set_background_color({ 128, 128, 128, background_hover_opacity });
|
|
||||||
hover_disabled_style.set_border_color({ 196, 196, 196, border_hover_opacity });
|
|
||||||
hover_disabled_style.set_background_color({ 196, 196, 196, background_hover_opacity });
|
|
||||||
|
|
||||||
add_style(&hover_style, hover_state);
|
add_style(&hover_style, hover_state);
|
||||||
add_style(&disabled_style, disabled_state);
|
add_style(&disabled_style, disabled_state);
|
||||||
add_style(&hover_disabled_style, { hover_state, disabled_state });
|
add_style(&hover_disabled_style, { hover_state, disabled_state });
|
||||||
|
|
@ -61,8 +66,10 @@ namespace recompui {
|
||||||
void Button::process_event(const Event &e) {
|
void Button::process_event(const Event &e) {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case EventType::Click:
|
case EventType::Click:
|
||||||
for (const auto &function : pressed_callbacks) {
|
if (is_enabled()) {
|
||||||
function();
|
for (const auto &function : pressed_callbacks) {
|
||||||
|
function();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EventType::Hover:
|
case EventType::Hover:
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,13 @@ ModDetailsPanel::ModDetailsPanel(Element *parent) : Element(parent) {
|
||||||
enable_toggle->add_checked_callback(std::bind(&ModDetailsPanel::enable_toggle_checked, this, std::placeholders::_1));
|
enable_toggle->add_checked_callback(std::bind(&ModDetailsPanel::enable_toggle_checked, this, std::placeholders::_1));
|
||||||
configure_button = context.create_element<Button>(buttons_container, "Configure", recompui::ButtonStyle::Secondary);
|
configure_button = context.create_element<Button>(buttons_container, "Configure", recompui::ButtonStyle::Secondary);
|
||||||
configure_button->add_pressed_callback(std::bind(&ModDetailsPanel::configure_button_pressed, this));
|
configure_button->add_pressed_callback(std::bind(&ModDetailsPanel::configure_button_pressed, this));
|
||||||
erase_button = context.create_element<Button>(buttons_container, "Erase", recompui::ButtonStyle::Secondary);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ModDetailsPanel::~ModDetailsPanel() {
|
ModDetailsPanel::~ModDetailsPanel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModDetailsPanel::set_mod_details(const recomp::mods::ModDetails& details, const std::string &thumbnail, bool mod_enabled, bool toggle_enabled) {
|
void ModDetailsPanel::set_mod_details(const recomp::mods::ModDetails& details, const std::string &thumbnail, bool mod_enabled, bool toggle_enabled, bool configure_enabled) {
|
||||||
cur_details = details;
|
cur_details = details;
|
||||||
|
|
||||||
thumbnail_image->set_src(thumbnail);
|
thumbnail_image->set_src(thumbnail);
|
||||||
|
|
@ -86,6 +85,7 @@ void ModDetailsPanel::set_mod_details(const recomp::mods::ModDetails& details, c
|
||||||
description_label->set_text(cur_details.description);
|
description_label->set_text(cur_details.description);
|
||||||
enable_toggle->set_checked(mod_enabled);
|
enable_toggle->set_checked(mod_enabled);
|
||||||
enable_toggle->set_enabled(toggle_enabled);
|
enable_toggle->set_enabled(toggle_enabled);
|
||||||
|
configure_button->set_enabled(configure_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModDetailsPanel::set_mod_toggled_callback(std::function<void(bool)> callback) {
|
void ModDetailsPanel::set_mod_toggled_callback(std::function<void(bool)> callback) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class ModDetailsPanel : public Element {
|
||||||
public:
|
public:
|
||||||
ModDetailsPanel(Element *parent);
|
ModDetailsPanel(Element *parent);
|
||||||
virtual ~ModDetailsPanel();
|
virtual ~ModDetailsPanel();
|
||||||
void set_mod_details(const recomp::mods::ModDetails& details, const std::string &thumbnail, bool mod_enabled, bool toggle_enabled);
|
void set_mod_details(const recomp::mods::ModDetails& details, const std::string &thumbnail, bool mod_enabled, bool toggle_enabled, bool configure_enabled);
|
||||||
void set_mod_toggled_callback(std::function<void(bool)> callback);
|
void set_mod_toggled_callback(std::function<void(bool)> callback);
|
||||||
void set_mod_configure_pressed_callback(std::function<void()> callback);
|
void set_mod_configure_pressed_callback(std::function<void()> callback);
|
||||||
private:
|
private:
|
||||||
|
|
@ -32,7 +32,6 @@ private:
|
||||||
Container *buttons_container = nullptr;
|
Container *buttons_container = nullptr;
|
||||||
Toggle *enable_toggle = nullptr;
|
Toggle *enable_toggle = nullptr;
|
||||||
Button *configure_button = nullptr;
|
Button *configure_button = nullptr;
|
||||||
Button *erase_button = nullptr;
|
|
||||||
std::function<void(bool)> mod_toggled_callback = nullptr;
|
std::function<void(bool)> mod_toggled_callback = nullptr;
|
||||||
std::function<void()> mod_configure_pressed_callback = nullptr;
|
std::function<void()> mod_configure_pressed_callback = nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "ui_mod_menu.h"
|
#include "ui_mod_menu.h"
|
||||||
#include "recomp_ui.h"
|
#include "recomp_ui.h"
|
||||||
|
|
||||||
#include "librecomp/mods.hpp"
|
#include "librecomp/mods.hpp"
|
||||||
|
|
@ -33,10 +33,14 @@ ModEntryView::ModEntryView(Element *parent) : Element(parent) {
|
||||||
set_padding_bottom(4.0f);
|
set_padding_bottom(4.0f);
|
||||||
set_padding_left(8.0f);
|
set_padding_left(8.0f);
|
||||||
set_border_width(1.1f);
|
set_border_width(1.1f);
|
||||||
set_border_color(Color{ 242, 242, 242, 204 });
|
set_border_color(Color{ 242, 242, 242, 12 });
|
||||||
set_background_color(Color{ 242, 242, 242, 12 });
|
set_background_color(Color{ 242, 242, 242, 12 });
|
||||||
set_cursor(Cursor::Pointer);
|
set_cursor(Cursor::Pointer);
|
||||||
|
|
||||||
|
checked_style.set_border_color(Color{ 242, 242, 242, 160 });
|
||||||
|
hover_style.set_border_color(Color{ 242, 242, 242, 64 });
|
||||||
|
checked_hover_style.set_border_color(Color{ 242, 242, 242, 204 });
|
||||||
|
|
||||||
{
|
{
|
||||||
thumbnail_image = context.create_element<Image>(this, "");
|
thumbnail_image = context.create_element<Image>(this, "");
|
||||||
thumbnail_image->set_width(100.0f);
|
thumbnail_image->set_width(100.0f);
|
||||||
|
|
@ -57,6 +61,10 @@ ModEntryView::ModEntryView(Element *parent) : Element(parent) {
|
||||||
description_label = context.create_element<Label>(body_container, LabelStyle::Small);
|
description_label = context.create_element<Label>(body_container, LabelStyle::Small);
|
||||||
} // body_container
|
} // body_container
|
||||||
} // this
|
} // this
|
||||||
|
|
||||||
|
add_style(&checked_style, checked_state);
|
||||||
|
add_style(&hover_style, hover_state);
|
||||||
|
add_style(&checked_hover_style, { checked_state, hover_state });
|
||||||
}
|
}
|
||||||
|
|
||||||
ModEntryView::~ModEntryView() {
|
ModEntryView::~ModEntryView() {
|
||||||
|
|
@ -72,6 +80,10 @@ void ModEntryView::set_mod_thumbnail(const std::string &thumbnail) {
|
||||||
thumbnail_image->set_src(thumbnail);
|
thumbnail_image->set_src(thumbnail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModEntryView::set_selected(bool selected) {
|
||||||
|
set_style_enabled(checked_state, selected);
|
||||||
|
}
|
||||||
|
|
||||||
// ModEntryButton
|
// ModEntryButton
|
||||||
|
|
||||||
ModEntryButton::ModEntryButton(Element *parent, uint32_t mod_index) : Element(parent, Events(EventType::Click, EventType::Hover, EventType::Focus, EventType::Drag)) {
|
ModEntryButton::ModEntryButton(Element *parent, uint32_t mod_index) : Element(parent, Events(EventType::Click, EventType::Hover, EventType::Focus, EventType::Drag)) {
|
||||||
|
|
@ -103,12 +115,17 @@ void ModEntryButton::set_mod_thumbnail(const std::string &thumbnail) {
|
||||||
view->set_mod_thumbnail(thumbnail);
|
view->set_mod_thumbnail(thumbnail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModEntryButton::set_selected(bool selected) {
|
||||||
|
view->set_selected(selected);
|
||||||
|
}
|
||||||
|
|
||||||
void ModEntryButton::process_event(const Event& e) {
|
void ModEntryButton::process_event(const Event& e) {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case EventType::Click:
|
case EventType::Click:
|
||||||
selected_callback(mod_index);
|
selected_callback(mod_index);
|
||||||
break;
|
break;
|
||||||
case EventType::Hover:
|
case EventType::Hover:
|
||||||
|
view->set_style_enabled(hover_state, std::get<EventHover>(e.variant).active);
|
||||||
break;
|
break;
|
||||||
case EventType::Focus:
|
case EventType::Focus:
|
||||||
break;
|
break;
|
||||||
|
|
@ -152,13 +169,21 @@ void ModMenu::mod_toggled(bool enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModMenu::mod_selected(uint32_t mod_index) {
|
void ModMenu::mod_selected(uint32_t mod_index) {
|
||||||
|
if (active_mod_index >= 0) {
|
||||||
|
mod_entry_buttons[active_mod_index]->set_selected(false);
|
||||||
|
}
|
||||||
|
|
||||||
active_mod_index = mod_index;
|
active_mod_index = mod_index;
|
||||||
|
|
||||||
if (active_mod_index >= 0) {
|
if (active_mod_index >= 0) {
|
||||||
std::string thumbnail_src = generate_thumbnail_src_for_mod(mod_details[mod_index].mod_id);
|
std::string thumbnail_src = generate_thumbnail_src_for_mod(mod_details[mod_index].mod_id);
|
||||||
|
const recomp::mods::ConfigSchema &config_schema = recomp::mods::get_mod_config_schema(mod_details[active_mod_index].mod_id);
|
||||||
bool mod_enabled = recomp::mods::is_mod_enabled(mod_details[mod_index].mod_id);
|
bool mod_enabled = recomp::mods::is_mod_enabled(mod_details[mod_index].mod_id);
|
||||||
bool auto_enabled = recomp::mods::is_mod_auto_enabled(mod_details[mod_index].mod_id);
|
bool auto_enabled = recomp::mods::is_mod_auto_enabled(mod_details[mod_index].mod_id);
|
||||||
bool toggle_enabled = !auto_enabled && (mod_details[mod_index].runtime_toggleable || !ultramodern::is_game_started());
|
bool toggle_enabled = !auto_enabled && (mod_details[mod_index].runtime_toggleable || !ultramodern::is_game_started());
|
||||||
mod_details_panel->set_mod_details(mod_details[mod_index], thumbnail_src, mod_enabled, toggle_enabled);
|
bool configure_enabled = !config_schema.options.empty();
|
||||||
|
mod_details_panel->set_mod_details(mod_details[mod_index], thumbnail_src, mod_enabled, toggle_enabled, configure_enabled);
|
||||||
|
mod_entry_buttons[active_mod_index]->set_selected(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,6 +249,7 @@ void ModMenu::mod_dragged(uint32_t mod_index, EventDrag drag) {
|
||||||
case DragPhase::End: {
|
case DragPhase::End: {
|
||||||
// Dragging has ended, hide the floating view.
|
// Dragging has ended, hide the floating view.
|
||||||
mod_entry_buttons[mod_index]->set_display(Display::Block);
|
mod_entry_buttons[mod_index]->set_display(Display::Block);
|
||||||
|
mod_entry_buttons[mod_index]->set_selected(false);
|
||||||
mod_entry_spacers[mod_drag_target_index]->set_height(0.0f, Unit::Px);
|
mod_entry_spacers[mod_drag_target_index]->set_height(0.0f, Unit::Px);
|
||||||
mod_entry_floating_view->set_display(Display::None);
|
mod_entry_floating_view->set_display(Display::None);
|
||||||
|
|
||||||
|
|
@ -240,6 +266,9 @@ void ModMenu::mod_dragged(uint32_t mod_index, EventDrag drag) {
|
||||||
mod_entry_buttons[i]->set_mod_thumbnail(generate_thumbnail_src_for_mod(mod_details[i].mod_id));
|
mod_entry_buttons[i]->set_mod_thumbnail(generate_thumbnail_src_for_mod(mod_details[i].mod_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod_entry_buttons[mod_drag_target_index]->set_selected(true);
|
||||||
|
active_mod_index = mod_drag_target_index;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
@ -410,6 +439,8 @@ ModMenu::ModMenu(Element *parent) : Element(parent) {
|
||||||
refresh_button = context.create_element<Button>(footer_container, "Refresh", recompui::ButtonStyle::Primary);
|
refresh_button = context.create_element<Button>(footer_container, "Refresh", recompui::ButtonStyle::Primary);
|
||||||
refresh_button->add_pressed_callback(std::bind(&ModMenu::refresh_mods, this));
|
refresh_button->add_pressed_callback(std::bind(&ModMenu::refresh_mods, this));
|
||||||
|
|
||||||
|
context.create_element<Label>(footer_container, "⚠ UNDER CONSTRUCTION ⚠", LabelStyle::Small);
|
||||||
|
|
||||||
mods_folder_button = context.create_element<Button>(footer_container, "Open Mods Folder", recompui::ButtonStyle::Primary);
|
mods_folder_button = context.create_element<Button>(footer_container, "Open Mods Folder", recompui::ButtonStyle::Primary);
|
||||||
mods_folder_button->add_pressed_callback(std::bind(&ModMenu::open_mods_folder, this));
|
mods_folder_button->add_pressed_callback(std::bind(&ModMenu::open_mods_folder, this));
|
||||||
} // footer_container
|
} // footer_container
|
||||||
|
|
@ -418,6 +449,7 @@ ModMenu::ModMenu(Element *parent) : Element(parent) {
|
||||||
mod_entry_floating_view = context.create_element<ModEntryView>(this);
|
mod_entry_floating_view = context.create_element<ModEntryView>(this);
|
||||||
mod_entry_floating_view->set_display(Display::None);
|
mod_entry_floating_view->set_display(Display::None);
|
||||||
mod_entry_floating_view->set_position(Position::Absolute);
|
mod_entry_floating_view->set_position(Position::Absolute);
|
||||||
|
mod_entry_floating_view->set_selected(true);
|
||||||
|
|
||||||
refresh_mods();
|
refresh_mods();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,15 @@ public:
|
||||||
virtual ~ModEntryView();
|
virtual ~ModEntryView();
|
||||||
void set_mod_details(const recomp::mods::ModDetails &details);
|
void set_mod_details(const recomp::mods::ModDetails &details);
|
||||||
void set_mod_thumbnail(const std::string &thumbnail);
|
void set_mod_thumbnail(const std::string &thumbnail);
|
||||||
|
void set_selected(bool selected);
|
||||||
private:
|
private:
|
||||||
Image *thumbnail_image = nullptr;
|
Image *thumbnail_image = nullptr;
|
||||||
Container *body_container = nullptr;
|
Container *body_container = nullptr;
|
||||||
Label *name_label = nullptr;
|
Label *name_label = nullptr;
|
||||||
Label *description_label = nullptr;
|
Label *description_label = nullptr;
|
||||||
|
Style checked_style;
|
||||||
|
Style hover_style;
|
||||||
|
Style checked_hover_style;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModEntryButton : public Element {
|
class ModEntryButton : public Element {
|
||||||
|
|
@ -31,6 +35,7 @@ public:
|
||||||
void set_mod_drag_callback(std::function<void(uint32_t, EventDrag)> callback);
|
void set_mod_drag_callback(std::function<void(uint32_t, EventDrag)> callback);
|
||||||
void set_mod_details(const recomp::mods::ModDetails &details);
|
void set_mod_details(const recomp::mods::ModDetails &details);
|
||||||
void set_mod_thumbnail(const std::string &thumbnail);
|
void set_mod_thumbnail(const std::string &thumbnail);
|
||||||
|
void set_selected(bool selected);
|
||||||
protected:
|
protected:
|
||||||
virtual void process_event(const Event &e);
|
virtual void process_event(const Event &e);
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class RmlRenderInterface_RT64_impl : public Rml::RenderInterfaceCompatibility {
|
||||||
Rml::Matrix4f transform_ = Rml::Matrix4f::Identity();
|
Rml::Matrix4f transform_ = Rml::Matrix4f::Identity();
|
||||||
Rml::Matrix4f mvp_ = Rml::Matrix4f::Identity();
|
Rml::Matrix4f mvp_ = Rml::Matrix4f::Identity();
|
||||||
std::unordered_map<Rml::TextureHandle, TextureHandle> textures_{};
|
std::unordered_map<Rml::TextureHandle, TextureHandle> textures_{};
|
||||||
Rml::TextureHandle texture_count_ = 1; // Start at 1 to reserve texture 0 as the 1x1 pixel white texture
|
Rml::TextureHandle texture_count_ = 2; // Start at 1 to reserve texture 0 as the 1x1 pixel white texture
|
||||||
DynamicBuffer upload_buffer_;
|
DynamicBuffer upload_buffer_;
|
||||||
DynamicBuffer vertex_buffer_;
|
DynamicBuffer vertex_buffer_;
|
||||||
DynamicBuffer index_buffer_;
|
DynamicBuffer index_buffer_;
|
||||||
|
|
@ -325,9 +325,12 @@ public:
|
||||||
void RenderGeometry(Rml::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rml::TextureHandle texture, const Rml::Vector2f& translation) override {
|
void RenderGeometry(Rml::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rml::TextureHandle texture, const Rml::Vector2f& translation) override {
|
||||||
if (!textures_.contains(texture)) {
|
if (!textures_.contains(texture)) {
|
||||||
if (texture == 0) {
|
if (texture == 0) {
|
||||||
// Create a 1x1 pixel white texture as the first handle
|
|
||||||
Rml::byte white_pixel[] = { 255, 255, 255, 255 };
|
Rml::byte white_pixel[] = { 255, 255, 255, 255 };
|
||||||
create_texture(0, white_pixel, Rml::Vector2i{ 1,1 });
|
create_texture(0, white_pixel, Rml::Vector2i{ 1, 1 });
|
||||||
|
}
|
||||||
|
else if (texture == 1) {
|
||||||
|
Rml::byte transparent_pixel[] = { 0, 0, 0, 0 };
|
||||||
|
create_texture(1, transparent_pixel, Rml::Vector2i{ 1, 1 });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(false && "Rendered without texture!");
|
assert(false && "Rendered without texture!");
|
||||||
|
|
@ -394,7 +397,11 @@ public:
|
||||||
|
|
||||||
auto it = image_from_bytes_map.find(source);
|
auto it = image_from_bytes_map.find(source);
|
||||||
if (it == image_from_bytes_map.end()) {
|
if (it == image_from_bytes_map.end()) {
|
||||||
return false;
|
// Return a transparent texture if the image can't be found.
|
||||||
|
texture_handle = 1;
|
||||||
|
texture_dimensions.x = 1;
|
||||||
|
texture_dimensions.y = 1;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr uint32_t PNG_MAGIC = 0x474E5089;
|
constexpr uint32_t PNG_MAGIC = 0x474E5089;
|
||||||
|
|
@ -508,7 +515,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReleaseTexture(Rml::TextureHandle texture) override {
|
void ReleaseTexture(Rml::TextureHandle texture) override {
|
||||||
textures_.erase(texture);
|
if (texture > 1) {
|
||||||
|
// Textures #0 and #1 are reserved and should never be released.
|
||||||
|
textures_.erase(texture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetTransform(const Rml::Matrix4f* transform) override {
|
void SetTransform(const Rml::Matrix4f* transform) override {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue