From 5574eccebd16ae38a2a21ed202d1f9d1ba8f67a4 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 26 Dec 2012 20:58:02 +0100 Subject: Engine optimization - rewritten model management - new class CModelManager - rewritten engine object structure in CEngine - created shared model data instead of separate objects per each model instance - minor refactoring --- src/app/app.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/app/app.cpp') diff --git a/src/app/app.cpp b/src/app/app.cpp index 57a827d..9f1667b 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -25,6 +25,7 @@ #include "common/image.h" #include "common/key.h" +#include "graphics/engine/modelmanager.h" #include "graphics/opengl/gldevice.h" #include "object/robotmain.h" @@ -94,6 +95,7 @@ CApplication::CApplication() m_engine = nullptr; m_device = nullptr; + m_modelManager = nullptr; m_robotMain = nullptr; m_sound = nullptr; @@ -142,8 +144,6 @@ CApplication::CApplication() m_lowCPU = true; - m_useVbo = false; - for (int i = 0; i < DIR_MAX; ++i) m_dataDirs[i] = nullptr; @@ -245,10 +245,6 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[]) { SetDebugMode(true); } - else if (arg == "-vbo") - { - m_useVbo = true; - } else if (arg == "-loglevel") { waitLogLevel = true; @@ -432,8 +428,6 @@ bool CApplication::Create() return false; } - static_cast(m_device)->SetUseVbo(m_useVbo); - // Create the 3D engine m_engine = new Gfx::CEngine(m_iMan, this); @@ -446,6 +440,9 @@ bool CApplication::Create() return false; } + // Create model manager + m_modelManager = new Gfx::CModelManager(m_engine); + // Create the robot application. m_robotMain = new CRobotMain(m_iMan, this); @@ -525,6 +522,12 @@ void CApplication::Destroy() m_sound = nullptr; } + if (m_modelManager != nullptr) + { + delete m_modelManager; + m_modelManager = nullptr; + } + if (m_engine != nullptr) { m_engine->Destroy(); -- cgit v1.2.3-1-g7c22