Working on UI part
This commit is contained in:
1 parent
6c8fcf17b6
commit
0da1ae124c
17 files changed
+221
-42
No files matched your search
+6
-7
@@ -490,7 +490,7 @@ namespace ZL {
|
||||
std::string path = t[key].get<std::string>();
|
||||
try {
|
||||
std::cout << "UiManager: loading texture for button '" << btn->name << "' : " << path << " Zip file: " << zipFile << std::endl;
|
||||
return renderer.textureManager.LoadFromPng(path, zipFile);
|
||||
return renderer.textureManager.LoadFromPng(path, zipFile, true);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "UiManager: failed load texture " << path << " : " << e.what() << std::endl;
|
||||
@@ -522,7 +522,7 @@ namespace ZL {
|
||||
std::string path = t[key].get<std::string>();
|
||||
try {
|
||||
std::cout << "UiManager: --loading texture for slider '" << s->name << "' : " << path << " Zip file: " << zipFile << std::endl;
|
||||
return renderer.textureManager.LoadFromPng(path, zipFile);
|
||||
return renderer.textureManager.LoadFromPng(path, zipFile, true);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "UiManager: failed load texture " << path << " : " << e.what() << std::endl;
|
||||
@@ -594,8 +594,7 @@ namespace ZL {
|
||||
if (!t.contains(key) || !t[key].is_string()) return nullptr;
|
||||
std::string path = t[key].get<std::string>();
|
||||
try {
|
||||
auto data = CreateTextureDataFromPng(path.c_str(), zipFile.c_str());
|
||||
return std::make_shared<Texture>(data);
|
||||
return renderer.textureManager.LoadFromPng(path, zipFile, true);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "UiManager: TextButton '" << tb->name << "' failed to load texture " << path << ": " << e.what() << std::endl;
|
||||
@@ -672,7 +671,7 @@ namespace ZL {
|
||||
|
||||
if (!texPath.empty()) {
|
||||
try {
|
||||
img->texture = renderer.textureManager.LoadFromPng(texPath, zipFile);
|
||||
img->texture = renderer.textureManager.LoadFromPng(texPath, zipFile, true);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "UiManager: failed load texture for StaticImage '" << img->name << "' : " << e.what() << std::endl;
|
||||
@@ -1056,9 +1055,9 @@ namespace ZL {
|
||||
|
||||
try {
|
||||
if (!trackPath.empty())
|
||||
s->texTrack = renderer.textureManager.LoadFromPng(trackPath, zipFile);
|
||||
s->texTrack = renderer.textureManager.LoadFromPng(trackPath, zipFile, true);
|
||||
if (!knobPath.empty())
|
||||
s->texKnob = renderer.textureManager.LoadFromPng(knobPath, zipFile);
|
||||
s->texKnob = renderer.textureManager.LoadFromPng(knobPath, zipFile, true);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "UiManager: addSlider failed to load textures: " << e.what() << std::endl;
|
||||
|
||||
Reference in new issue
Block a user