From 06171f36714d842d19bab98553487e78ad40625a Mon Sep 17 00:00:00 2001 From: Tamir Atias Date: Thu, 12 Apr 2012 04:43:38 +0300 Subject: [PATCH] [Fix] Game was initialized before SDL. --- src/Main/Game.cpp | 5 +---- src/Main/main.cpp | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Main/Game.cpp b/src/Main/Game.cpp index 2ec2b91..c6664ac 100644 --- a/src/Main/Game.cpp +++ b/src/Main/Game.cpp @@ -35,7 +35,6 @@ bool Game::Init(void) { glAlphaFunc(GL_GREATER, 0.1f); _level->Load("../Data/Map/Ugly.tmx"); - _player->Update(); // Return success. return true; @@ -74,8 +73,6 @@ void Game::Render(void) { // Render our shit.. _level->Draw(xOffset, yOffset); _player->Render(); - - glPopMatrix(); } void Game::Shutdown(void) { @@ -85,7 +82,7 @@ void Game::Shutdown(void) { } void Game::ProcessEvents(void) { - // Should not need this, as the game class has no events to process.. + _player->ProcessEvents(); } void Game::OnResize(int width, int height) { diff --git a/src/Main/main.cpp b/src/Main/main.cpp index 2dc6337..5e803c5 100644 --- a/src/Main/main.cpp +++ b/src/Main/main.cpp @@ -40,8 +40,6 @@ int main(int argc, char** argv) { // Start by opening a debug log. Debug::openLog(true); Debug::logger->message("\n ----- Engine Loading -----"); - // Our game code. - Game game; if(SDL_Init(SDL_INIT_VIDEO) < 0) { Debug::logger->message("Error: Could not load SDL"); @@ -78,6 +76,7 @@ int main(int argc, char** argv) { Debug::logger->message("\n ----- Engine Initialization Complete -----"); Debug::logger->message("\n ----- Logic -----"); + Game game; game.Init(); CreateInput();