Separating state out of the location
This commit is contained in:
1 parent
5e9a663812
commit
297bd7377f
45 files changed
+2114
-778
No files matched your search
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace FRG {
|
||||
|
||||
extern const char* CONST_ZIP_FILE;
|
||||
|
||||
namespace {
|
||||
nlohmann::json saveCar(const NpcCar& car)
|
||||
{
|
||||
@@ -51,7 +49,8 @@ namespace FRG {
|
||||
return navigationMaps[activeNavigationIndex].findPathToNearest(start, end, {});
|
||||
}
|
||||
|
||||
void LocationState::initNavigation(const std::vector<std::string>& paths)
|
||||
void LocationState::initNavigation(
|
||||
const std::vector<std::string>& paths, const std::string& zipFile)
|
||||
{
|
||||
const int savedActiveNavigationIndex = activeNavigationIndex;
|
||||
//navigationMapPaths = paths;
|
||||
@@ -59,10 +58,7 @@ namespace FRG {
|
||||
navigationMaps.resize(paths.size());
|
||||
|
||||
for (size_t i = 0; i < paths.size(); ++i) {
|
||||
// Service the OS message queue between builds so the window doesn't
|
||||
// get flagged as "not responding" while loading many navigation grids.
|
||||
SDL_PumpEvents();
|
||||
navigationMaps[i].build(paths[i], CONST_ZIP_FILE);
|
||||
navigationMaps[i].build(paths[i], zipFile);
|
||||
}
|
||||
|
||||
activeNavigationIndex =
|
||||
|
||||
Reference in new issue
Block a user