mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 21:23:41 +00:00
mod: added InputManager call to GameInternal
This commit is contained in:
parent
8e7d9f2edf
commit
9c3185c6d8
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user