mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
feat: add round display
This commit is contained in:
7
src/core/CoreData.h
Normal file
7
src/core/CoreData.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ui/managers/debug/DebugData.h"
|
||||
|
||||
struct CoreData {
|
||||
DebugData debugData;
|
||||
};
|
||||
@@ -5,12 +5,14 @@ DebugManager::DebugManager(
|
||||
const SDL_Renderer* renderer,
|
||||
const SDL_Window* window,
|
||||
//const InputState& inputState,
|
||||
UIRenderer* uiRenderer
|
||||
UIRenderer* uiRenderer,
|
||||
DebugData& debugData
|
||||
):
|
||||
m_renderer(renderer),
|
||||
m_window(window),
|
||||
//m_inputState(inputState),
|
||||
m_uiRenderer(uiRenderer)
|
||||
m_uiRenderer(uiRenderer),
|
||||
m_debugData(debugData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ public:
|
||||
const SDL_Renderer* renderer,
|
||||
const SDL_Window* window,
|
||||
//const InputState& inputState,
|
||||
UIRenderer* uiRenderer
|
||||
UIRenderer* uiRenderer,
|
||||
DebugData& debugData
|
||||
);
|
||||
~DebugManager();
|
||||
|
||||
@@ -22,9 +23,13 @@ public:
|
||||
void updateMousePos(int logicalX, int logicalY, const InputState& inputState);
|
||||
void updateDebugInfo();
|
||||
|
||||
DebugData& getDebugData() {
|
||||
return m_debugData;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<DebugOverlay> m_debugOverlay;
|
||||
DebugData m_debugData;
|
||||
DebugData& m_debugData;
|
||||
const SDL_Renderer* m_renderer = nullptr;
|
||||
const SDL_Window* m_window = nullptr;
|
||||
//const InputState& m_inputState;
|
||||
|
||||
@@ -50,14 +50,15 @@ bool GameApplication::initialize() {
|
||||
m_windowManager->GetRenderer(),
|
||||
m_windowManager->GetWindow(),
|
||||
//m_inputManager->GetInputState(),
|
||||
m_uiRenderer.get()
|
||||
m_uiRenderer.get(),
|
||||
m_coreData.debugData
|
||||
);
|
||||
m_debugManager->initialize();
|
||||
// 材质管理
|
||||
m_textureManager = std::make_unique<TextureManager>(m_windowManager->GetRenderer());
|
||||
|
||||
// 场景管理,传入窗口句柄以便 SceneManager 能获取窗口尺寸
|
||||
m_sceneManager = std::make_unique<SceneManager>(m_windowManager->GetRenderer(), m_uiRenderer.get(), m_windowManager->GetWindow(), m_textureManager.get());
|
||||
m_sceneManager = std::make_unique<SceneManager>(m_windowManager->GetRenderer(), m_uiRenderer.get(), m_windowManager->GetWindow(), m_textureManager.get(), m_coreData);
|
||||
if (!m_sceneManager->initialize()) {
|
||||
SDL_Log("SceneManager 初始化失败!");
|
||||
return false;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "graphics/font/FontManager.h"
|
||||
#include "core/DebugManager.h"
|
||||
#include "graphics/texture/TextureManager.h"
|
||||
#include "CoreData.h"
|
||||
|
||||
class GameApplication {
|
||||
private:
|
||||
|
||||
@@ -26,6 +28,8 @@ private:
|
||||
Config m_config;
|
||||
void cleanup();
|
||||
|
||||
CoreData m_coreData;
|
||||
|
||||
public:
|
||||
GameApplication();
|
||||
~GameApplication();
|
||||
|
||||
Reference in New Issue
Block a user