0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00

mod: added InputManager call to GameInternal

This commit is contained in:
ezveee 2025-01-16 13:16:40 +01:00
parent 8e7d9f2edf
commit 9c3185c6d8
2 changed files with 4 additions and 2 deletions

View File

@ -44,7 +44,7 @@ public:
/* static */ AssetManager* assets; /* static */ AssetManager* assets;
/* static */ TextureManager* textureManager; /* static */ TextureManager* textureManager;
/* static */ SoundManager* soundManager; /* static */ SoundManager* soundManager;
/* static */ InputManager* inputs; /* static */ InputManager* inputManager;
Manager manager; Manager manager;
RenderManager renderManager; RenderManager renderManager;

View File

@ -33,7 +33,7 @@ SDL_AppResult GameInternal::init(const char* title, int xpos, int ypos, int widt
GameInternal::textureManager = new TextureManager(&manager); GameInternal::textureManager = new TextureManager(&manager);
GameInternal::soundManager = new SoundManager(); GameInternal::soundManager = new SoundManager();
GameInternal::collisionHandler = new CollisionHandler(manager); // why does this use a referrence, but AssetManager a pointer? GameInternal::collisionHandler = new CollisionHandler(manager); // why does this use a referrence, but AssetManager a pointer?
GameInternal::inputs = new InputManager(); GameInternal::inputManager = new InputManager();
int flags = 0; int flags = 0;
if (fullscreen) if (fullscreen)
@ -123,6 +123,8 @@ void GameInternal::update(Uint64 frameTime)
uint_fast16_t diffTime = frameTime - this->lastFrameTime; uint_fast16_t diffTime = frameTime - this->lastFrameTime;
manager.update(diffTime); manager.update(diffTime);
inputManager->processEvents(); // TODO: find out if location is correct
this->gameInstance->update(diffTime); // TODO: this might have to be split up into two update functions, before and after manager... this->gameInstance->update(diffTime); // TODO: this might have to be split up into two update functions, before and after manager...
this->lastFrameTime = frameTime; this->lastFrameTime = frameTime;