mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
The calculation process has been modified, and now it is performed directly in the gameapplication class
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "GameApplication.h"
|
||||
|
||||
#include "utils/Tools.h"
|
||||
GameApplication::GameApplication() {
|
||||
|
||||
}
|
||||
@@ -49,10 +49,11 @@ SDL_AppResult GameApplication::handleInputEvent(SDL_Event* event) {
|
||||
InputState input = m_inputManager->GetInputState();
|
||||
if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN &&
|
||||
event->button.button == SDL_BUTTON_LEFT) {
|
||||
|
||||
m_sceneManager->handleClickCurrent(input.mouseCilckOn);
|
||||
auto pos = Tools::physicalToLogical(input.mouseCilckOn.first, input.mouseCilckOn.second, m_windowManager->getViewport());
|
||||
m_sceneManager->handleClickCurrent(pos);
|
||||
}
|
||||
m_sceneManager->handleMousePosition(input.mouseCurrentPosition);
|
||||
auto pos = Tools::physicalToLogical(input.mouseCurrentPosition.first, input.mouseCurrentPosition.second, m_windowManager->getViewport());
|
||||
m_sceneManager->handleMousePosition(pos);
|
||||
m_windowManager->setFullscreen(input.isFullscreen);
|
||||
// 改变窗口时清理旧的缓存
|
||||
if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) {
|
||||
|
||||
Reference in New Issue
Block a user