Compare commits
3 Commits
8f1e872f1c
...
9e9a270550
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e9a270550 | ||
|
|
f9667430b9 | ||
|
|
9d7800bb4f |
8
flake.lock
generated
8
flake.lock
generated
@@ -21,17 +21,17 @@
|
|||||||
"imgui": {
|
"imgui": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752080038,
|
"lastModified": 1758128722,
|
||||||
"narHash": "sha256-m5h/H8k/CZ5Qwr3L9+Elt8XT/Tgwr3s4HuhVtI4wkwE=",
|
"narHash": "sha256-J+h7jJ+4wqr6RivtzyTDMXKxFoGs7dQbzqdu51XgEbc=",
|
||||||
"owner": "ocornut",
|
"owner": "ocornut",
|
||||||
"repo": "imgui",
|
"repo": "imgui",
|
||||||
"rev": "5d4126876bc10396d4c6511853ff10964414c776",
|
"rev": "bf75bfec48fc00f532af8926130b70c0e26eb099",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "ocornut",
|
"owner": "ocornut",
|
||||||
"repo": "imgui",
|
"repo": "imgui",
|
||||||
"rev": "5d4126876bc10396d4c6511853ff10964414c776",
|
"rev": "bf75bfec48fc00f532af8926130b70c0e26eb099",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
imgui = {
|
imgui = {
|
||||||
url = "github:ocornut/imgui/5d4126876bc10396d4c6511853ff10964414c776";
|
url = "github:ocornut/imgui/bf75bfec48fc00f532af8926130b70c0e26eb099";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
plutosvg = {
|
plutosvg = {
|
||||||
|
|||||||
@@ -70,7 +70,10 @@ ImageLoaderWebP::ImageResult ImageLoaderWebP::loadFromMemoryRGBA(const uint8_t*
|
|||||||
while (WebPAnimDecoderHasMoreFrames(dec.get())) {
|
while (WebPAnimDecoderHasMoreFrames(dec.get())) {
|
||||||
uint8_t* buf;
|
uint8_t* buf;
|
||||||
int timestamp;
|
int timestamp;
|
||||||
WebPAnimDecoderGetNext(dec.get(), &buf, ×tamp);
|
if (WebPAnimDecoderGetNext(dec.get(), &buf, ×tamp) == 0 || buf == nullptr) {
|
||||||
|
// error out with empty res
|
||||||
|
return {};
|
||||||
|
}
|
||||||
// ... (Render 'buf' based on 'timestamp').
|
// ... (Render 'buf' based on 'timestamp').
|
||||||
// ... (Do NOT free 'buf', as it is owned by 'dec').
|
// ... (Do NOT free 'buf', as it is owned by 'dec').
|
||||||
|
|
||||||
|
|||||||
@@ -103,10 +103,17 @@ TextureLoaderResult MessageImageLoader::load(TextureUploaderI& tu, Message3Handl
|
|||||||
new_entry.current_texture = 0;
|
new_entry.current_texture = 0;
|
||||||
for (const auto& [ms, data] : res.frames) {
|
for (const auto& [ms, data] : res.frames) {
|
||||||
const auto n_t = tu.upload(data.data(), res.width, res.height);
|
const auto n_t = tu.upload(data.data(), res.width, res.height);
|
||||||
|
if (n_t == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
new_entry.textures.push_back(n_t);
|
new_entry.textures.push_back(n_t);
|
||||||
new_entry.frame_duration.push_back(ms);
|
new_entry.frame_duration.push_back(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (new_entry.textures.empty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
new_entry.width = res.width;
|
new_entry.width = res.width;
|
||||||
new_entry.height = res.height;
|
new_entry.height = res.height;
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ struct TextureCache {
|
|||||||
_tu.destroy(tex_id);
|
_tu.destroy(tex_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (const auto& tex_id : _default_texture.textures) {
|
||||||
|
_tu.destroy(tex_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GetInfo {
|
struct GetInfo {
|
||||||
|
|||||||
Reference in New Issue
Block a user