From cc83d92c1840f72c0703850a49953ec8b55bc434 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 14 Oct 2009 03:45:46 +0000 Subject: [PATCH] moved Video out of Engine git-svn-id: svn://anubis/anaglym/trunk@85 99a6e188-d820-4881-8870-2d33a10e2619 --- Engine.cc | 10 ---------- Engine.h | 4 +--- anaglym.cc | 8 ++++++++ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Engine.cc b/Engine.cc index a57da07..6d4a6ab 100644 --- a/Engine.cc +++ b/Engine.cc @@ -1,6 +1,5 @@ #include "ag.h" -#include "Video.h" #include "Engine.h" #include #include /* exit() */ @@ -20,7 +19,6 @@ SDL_Event Engine::userEvent; Engine::Engine(const string & path) { - m_video = new Video(); m_next_object_index = 1; m_eye[0] = 0; m_eye[1] = -1; @@ -40,17 +38,10 @@ Engine::Engine(const string & path) /* setup redraw SDL event structure */ userEvent.type = SDL_USEREVENT; userEvent.user.code = 0; -#if 0 - /* start in windowed mode for debugging */ - m_video->start(0, 0, false, false); -#else - m_video->start(); -#endif } Engine::~Engine() { - m_video->stop(); lua_close(m_luaState); for (std::map::iterator it = m_objects.begin(); it != m_objects.end(); @@ -58,7 +49,6 @@ Engine::~Engine() { delete it->second; } - delete m_video; } bool Engine::load(const char * program) diff --git a/Engine.h b/Engine.h index 8449f86..43b460f 100644 --- a/Engine.h +++ b/Engine.h @@ -5,7 +5,7 @@ #include #include #include -#include "Video.h" +#include #include "OdeWorld/OdeWorld.h" #include "wfobj/WFObj.hh" @@ -50,7 +50,6 @@ class Engine ~Engine(); std::string locateResource(const std::string & shortname); - Video * getVideo() { return m_video; } bool load(const char * program); void run(); void reportErrors(int status); @@ -84,7 +83,6 @@ class Engine } lua_State * m_luaState; - Video * m_video; std::string m_program_path; std::string m_engine_path; OdeWorld m_world; diff --git a/anaglym.cc b/anaglym.cc index 4dd7e80..f6b73b9 100644 --- a/anaglym.cc +++ b/anaglym.cc @@ -46,10 +46,18 @@ int main(int argc, char * argv[]) usage(); } + Video video; +#if 0 + /* start in windowed mode for debugging */ + video.start(0, 0, false, false); +#else + video.start(); +#endif g_engine = new Engine(argv[0]); if (g_engine->load(program)) g_engine->run(); delete g_engine; + video.stop(); return 0; }