Change the return type of GameMapLoader::TakeGameMap to Handle<_>

This commit is contained in:
yvt 2019-07-23 21:57:02 +09:00
parent 5fe8b0fe18
commit d248ac2460
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

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

View File

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