#pragma once #include "Character.h" #include "BoneAnimatedModel.h" #include "render/Renderer.h" #include "Environment.h" #include "render/TextureManager.h" #include "SparkEmitter.h" #include "UiManager.h" #include "utils/TaskManager.h" #include "items/GameObjectLoader.h" #include "items/Item.h" #include "items/InteractiveObject.h" #include #include #include #include #include #include #include "MenuManager.h" #include #include #include "Location.h" #include "AudioPlayerAsync.h" namespace ZL { class Game { public: Game(); ~Game(); void setup(); void setupPart2(); void update(); void render(); bool shouldExit() const { return Environment::exitGameLoop; } Renderer renderer; TaskManager taskManager; MainThreadHandler mainThreadHandler; std::shared_ptr loadingTexture; VertexRenderStruct loadingMesh; bool loadingCompleted = false; std::shared_ptr currentLocation; Inventory inventory; InteractiveObject* pickedUpObject = nullptr; bool inventoryOpen = false; MenuManager menuManager; private: bool rightMouseDown = false; int lastMouseX = 0; int lastMouseY = 0; std::unique_ptr audioPlayer; int64_t getSyncTimeMs(); void processTickCount(); void drawScene(); void drawUI(); void drawLoading(); void handleDown(int64_t fingerId, int mx, int my); void handleUp(int64_t fingerId, int mx, int my); void handleMotion(int64_t fingerId, int mx, int my); #ifdef EMSCRIPTEN static Game* s_instance; static void onResourcesZipLoaded(const char* filename); static void onResourcesZipError(const char* filename); #endif int64_t newTickCount; int64_t lastTickCount; static const size_t CONST_TIMER_INTERVAL = 10; static const size_t CONST_MAX_TIME_INTERVAL = 1000; }; } // namespace ZL