Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/MapGenerator.h
/* Copyright (C) 2021 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
Lint: Inaccurate Copyright Year: Inaccurate Copyright Year | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | private: | ||||
*/ | */ | ||||
std::string m_Settings; | std::string m_Settings; | ||||
/** | /** | ||||
* Backend to loading template data. | * Backend to loading template data. | ||||
*/ | */ | ||||
CTemplateLoader m_TemplateLoader; | CTemplateLoader m_TemplateLoader; | ||||
struct FutureFunction | |||||
{ | |||||
void operator ()(); | |||||
CMapGeneratorWorker& self; | |||||
}; | |||||
/** | /** | ||||
* Holds the completion result of the asynchronous map generation. | * Holds the completion result of the asynchronous map generation. | ||||
* TODO: this whole class could really be a future on its own. | * TODO: this whole class could really be a future on its own. | ||||
*/ | */ | ||||
Future<void> m_WorkerThread; | Future<FutureFunction> m_WorkerThread; | ||||
/** | /** | ||||
* Avoids thread synchronization issues. | * Avoids thread synchronization issues. | ||||
*/ | */ | ||||
std::mutex m_WorkerMutex; | std::mutex m_WorkerMutex; | ||||
}; | }; | ||||
#endif //INCLUDED_MAPGENERATOR | #endif //INCLUDED_MAPGENERATOR |
Wildfire Games · Phabricator
Inaccurate Copyright Year