make sure we call the sprite load callback

This commit is contained in:
Konstantin Käfer
2014-04-30 12:58:38 +02:00
parent f683cbf02a
commit 74768abeb8
6 changed files with 38 additions and 21 deletions

View File

@@ -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 {