Change the return type of GameMapLoader::TakeGameMap
to Handle<_>
This commit is contained in:
parent
5fe8b0fe18
commit
d248ac2460
@ -127,7 +127,7 @@ namespace spades {
|
||||
return static_cast<float>(progressCell.load(std::memory_order_relaxed)) / (512 * 512);
|
||||
}
|
||||
|
||||
GameMap *GameMapLoader::TakeGameMap() {
|
||||
Handle<GameMap> GameMapLoader::TakeGameMap() {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
SPAssert(IsComplete());
|
||||
@ -136,7 +136,7 @@ namespace spades {
|
||||
SPAssert(result);
|
||||
|
||||
if (result->gameMap) {
|
||||
return std::move(result->gameMap).Unmanage();
|
||||
return std::move(result->gameMap);
|
||||
} else {
|
||||
std::rethrow_exception(result->exceptionThrown);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ namespace spades {
|
||||
* If an exception occured while decoding the map, the exception will be rethrown when
|
||||
* this method is called.
|
||||
*/
|
||||
GameMap *TakeGameMap();
|
||||
Handle<GameMap> TakeGameMap();
|
||||
|
||||
private:
|
||||
struct Decoder;
|
||||
|
@ -1808,7 +1808,7 @@ namespace spades {
|
||||
SPLog("Waiting for the game map decoding to complete...");
|
||||
mapLoader->MarkEOF();
|
||||
mapLoader->WaitComplete();
|
||||
GameMap *map = mapLoader->TakeGameMap();
|
||||
GameMap *map = mapLoader->TakeGameMap().Unmanage();
|
||||
SPLog("The game map was decoded successfully.");
|
||||
|
||||
// now initialize world
|
||||
|
Loading…
x
Reference in New Issue
Block a user