Working on loading screen
This commit is contained in:
1 parent
1c2c80f0ea
commit
44f5136f1d
8 files changed
+272
-187
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include "utils/Utils.h"
|
||||
#include <Eigen/Geometry>
|
||||
#include "../Character.h"
|
||||
#include <SDL.h>
|
||||
|
||||
namespace ZL {
|
||||
|
||||
@@ -195,6 +196,9 @@ namespace ZL {
|
||||
std::unordered_map<std::string, LoadedGameObject> gameObjects;
|
||||
|
||||
for (const auto& data : loadFromJson(jsonPath, zipPath)) {
|
||||
// Service the OS message queue between loads so the window doesn't
|
||||
// get flagged as "not responding" during long location loads.
|
||||
SDL_PumpEvents();
|
||||
std::cout << "Loading game object: " << data.name << std::endl;
|
||||
try {
|
||||
LoadedGameObject obj = buildLoadedObject(data, renderer, zipPath);
|
||||
@@ -225,6 +229,7 @@ namespace ZL {
|
||||
return interactiveObjects;
|
||||
|
||||
for (const auto& data : loadInteractiveFromJson(jsonPath, zipPath)) {
|
||||
SDL_PumpEvents();
|
||||
std::cout << "Loading interactive object: " << data.base.name << std::endl;
|
||||
try {
|
||||
InteractiveObject intObj = InteractiveObject::createFromState(
|
||||
@@ -359,6 +364,7 @@ namespace ZL {
|
||||
std::vector<std::unique_ptr<Character>> npcs;
|
||||
|
||||
for (const auto& npcData : loadNpcsFromJson(jsonPath, zipPath)) {
|
||||
SDL_PumpEvents();
|
||||
std::cout << "Loading NPC: " << npcData.name << std::endl;
|
||||
try {
|
||||
auto npc = Character::createFromState(npcData.toCharacterState(), renderer, zipPath.c_str());
|
||||
|
||||
Reference in new issue
Block a user