alternative http_request function

This commit is contained in:
Konstantin Käfer
2014-02-03 14:53:59 +01:00
parent 6849c8d576
commit 44a3ffbd57
3 changed files with 28 additions and 7 deletions

View File

@@ -77,16 +77,13 @@ void Tile::request() {
platform::request_http(url, [=](platform::Response& res) {
if (res.code == 200) {
tile->data.swap(res.body);
platform::async([tile]() {
tile->parse();
}, []() {
// TODO: Make sure this gets passed the correct map ID/pointer.
platform::restart(NULL);
});
tile->parse();
} else {
fprintf(stderr, "tile loading failed\n");
}
}, []() {
// TODO: Make sure this gets passed the correct map ID/pointer.
platform::restart(NULL);
});
}