Skip to content

Commit 180877a

Browse files
committed
blam: Fix custom map loading
1 parent b4f64e4 commit 180877a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.cmake/CMakePresets.wasm.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@
9696
"configurePreset": "web-wasm32-emscripten-webgl2",
9797
"inherits": "base-linux"
9898
},
99+
{
100+
"name": "web-wasm32-emscripten-webgl2-custom-dbg",
101+
"environment": {"BUILD_TYPE":"Debug"},
102+
"configurePreset": "web-wasm32-emscripten-webgl2-custom",
103+
"inherits": "base-linux"
104+
},
99105
{
100106
"name": "web-wasm64-emscripten-webgl2-dbg",
101107
"environment": {"BUILD_TYPE":"Debug"},

examples/blam/cblam-testing/ui_caching.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ struct FontCache
5656
{
5757
if(auto tag_it = index.find(font_tag); tag_it == index.end())
5858
return nullptr;
59+
else if(auto data = (*tag_it).template data<blam::font>(magic); !data.has_value())
60+
return nullptr;
5961
else
60-
return (*tag_it).template data<blam::font>(magic).value();
62+
return data.value();
6163
}
6264

6365
void allocate_font_texture()

0 commit comments

Comments
 (0)