make sure we call the sprite load callback
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <llmr/platform/platform.hpp>
|
||||
#include <llmr/platform/gl.hpp>
|
||||
#include <llmr/util/time.hpp>
|
||||
#include <llmr/util/uv.hpp>
|
||||
|
||||
#include <png.h>
|
||||
|
||||
@@ -20,20 +21,22 @@ Raster::~Raster() {
|
||||
}
|
||||
}
|
||||
|
||||
Raster::operator bool() const {
|
||||
bool Raster::isLoaded() const {
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
return loaded;
|
||||
}
|
||||
|
||||
void Raster::load(const std::string& data) {
|
||||
std::shared_ptr<Raster> raster = shared_from_this();
|
||||
void Raster::load() {
|
||||
loadImage(data);
|
||||
|
||||
raster->loadImage(data);
|
||||
|
||||
std::lock_guard<std::mutex> lock(raster->mtx);
|
||||
if (raster->img) {
|
||||
raster->loaded = true;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
if (img) {
|
||||
loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
data.clear();
|
||||
}
|
||||
|
||||
struct Buffer {
|
||||
|
||||
Reference in New Issue
Block a user