Adapting for web

This commit is contained in:
Vladislav Khorev committed 2026-02-08 22:38:24 +03:00
1 parent cf1ec1e76f
commit a59bcc0c4b
42 files changed
+843 -294

No files matched your search

+3 -1
View File
@@ -247,6 +247,7 @@ namespace ZL {
if (!t.contains(key) || !t[key].is_string()) return nullptr;
std::string path = t[key].get<std::string>();
try {
std::cout << "UiManager: loading texture for button '" << btn->name << "' : " << path << " Zip file: " << zipFile << std::endl;
auto data = CreateTextureDataFromPng(path.c_str(), zipFile.c_str());
return std::make_shared<Texture>(data);
}
@@ -276,6 +277,7 @@ namespace ZL {
if (!t.contains(key) || !t[key].is_string()) return nullptr;
std::string path = t[key].get<std::string>();
try {
std::cout << "UiManager: --loading texture for button '" << "' : " << path << " Zip file: " << zipFile << std::endl;
auto data = CreateTextureDataFromPng(path.c_str(), zipFile.c_str());
return std::make_shared<Texture>(data);
}
@@ -345,7 +347,7 @@ namespace ZL {
if (j.contains("centered")) tv->centered = j["centered"].get<bool>();
tv->textRenderer = std::make_unique<TextRenderer>();
if (!tv->textRenderer->init(renderer, tv->fontPath, tv->fontSize)) {
if (!tv->textRenderer->init(renderer, tv->fontPath, tv->fontSize, zipFile)) {
std::cerr << "Failed to init TextRenderer for TextView: " << tv->name << std::endl;
}