Some refactoring

This commit is contained in:
Vladislav Khorev committed 2026-04-16 20:06:03 +03:00
1 parent f2f56125f0
commit 92ba3f2b60
7 files changed
+847 -485

No files matched your search

+21 -28
View File
@@ -20,9 +20,10 @@
#include "ScriptEngine.h"
#include <unordered_map>
#include "dialogue/DialogueSystem.h"
#include "render/ShadowMap.h"
#include "navigation/PathFinder.h"
//#include "render/ShadowMap.h"
//#include "navigation/PathFinder.h"
#include <unordered_set>
#include "Location.h"
namespace ZL {
@@ -52,71 +53,66 @@ namespace ZL {
VertexRenderStruct loadingMesh;
bool loadingCompleted = false;
std::shared_ptr<Location> currentLocation;
/*
std::shared_ptr<Texture> roomTexture;
VertexRenderStruct roomMesh;
std::unordered_map<std::string, LoadedGameObject> gameObjects;
/*
std::shared_ptr<Texture> fireboxTexture;
VertexRenderStruct fireboxMesh;
std::shared_ptr<Texture> inaiTexture;
VertexRenderStruct inaiMesh;
std::shared_ptr<Texture> benchTexture;
VertexRenderStruct benchMesh;
*/
std::vector<InteractiveObject> interactiveObjects;
std::vector<InteractiveObject> interactiveObjects;*/
Inventory inventory;
InteractiveObject* pickedUpObject = nullptr;
// Interactive object targeting
InteractiveObject* targetInteractiveObject = nullptr;
//InteractiveObject* targetInteractiveObject = nullptr;
bool inventoryOpen = false;
/*
std::unique_ptr<Character> player;
std::vector<std::unique_ptr<Character>> npcs;
float cameraAzimuth = 0.0f;
float cameraInclination = M_PI * 30.f / 180.f;
*/
// Public access for ScriptEngine
MenuManager menuManager;
ScriptEngine scriptEngine;
/*
PathFinder navigation;
#ifdef SHOW_PATH
std::vector<VertexRenderStruct> debugNavMeshes;
#endif
*/
private:
bool rightMouseDown = false;
int lastMouseX = 0;
int lastMouseY = 0;
static constexpr float CAMERA_FOV_Y = 1.0f / 1.5f;
//static constexpr float CAMERA_FOV_Y = 1.0f / 1.5f;
int64_t getSyncTimeMs();
void processTickCount();
void drawScene();
void drawUI();
void drawGame();
//void drawGame();
void drawLoading();
void drawShadowDepthPass();
void drawGameWithShadows();
void setupNavigation();
//void drawShadowDepthPass();
//void drawGameWithShadows();
//void setupNavigation();
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);
InteractiveObject* raycastInteractiveObjects(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir);
/*InteractiveObject* raycastInteractiveObjects(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir);
Character* raycastNpcs(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir, float maxDistance = 100.0f);
#ifdef SHOW_PATH
void buildDebugNavMeshes();
void drawDebugNavigation();
#endif
*/
#ifdef EMSCRIPTEN
static Game* s_instance;
@@ -132,12 +128,9 @@ namespace ZL {
static const size_t CONST_TIMER_INTERVAL = 10;
static const size_t CONST_MAX_TIME_INTERVAL = 1000;
//MenuManager menuManager;
Dialogue::DialogueSystem dialogueSystem;
//ScriptEngine scriptEngine;
std::unique_ptr<ShadowMap> shadowMap;
Eigen::Matrix4f cameraViewMatrix = Eigen::Matrix4f::Identity();
//std::unique_ptr<ShadowMap> shadowMap;
//Eigen::Matrix4f cameraViewMatrix = Eigen::Matrix4f::Identity();
};