diff options
Diffstat (limited to 'src/ui/maindialog.cpp')
-rw-r--r-- | src/ui/maindialog.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index cf451e5..920d958 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -14,22 +14,24 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// maindialog.cpp #include "ui/maindialog.h" #include "app/app.h" + #include "common/global.h" #include "common/event.h" #include "common/logger.h" #include "common/misc.h" #include "common/profile.h" -#include "common/iman.h" #include "common/restext.h" #include "common/logger.h" + #include "object/robotmain.h" + #include "script/cmdtoken.h" #include "sound/sound.h" + #include "ui/interface.h" #include "ui/button.h" #include "ui/color.h" @@ -54,8 +56,7 @@ //TODO Get rid of all sprintf's -namespace Ui -{ +namespace Ui { const int KEY_VISIBLE = 6; // number of visible keys redefinable @@ -106,20 +107,16 @@ namespace fs = boost::filesystem; // Constructor of robot application. -CMainDialog::CMainDialog(CInstanceManager* iMan) +CMainDialog::CMainDialog() { - m_iMan = iMan; - m_iMan->AddInstance(CLASS_DIALOG, this); - - m_app = CApplication::GetInstancePointer(); - - m_main = static_cast<CRobotMain*>(m_iMan->SearchInstance(CLASS_MAIN)); - m_interface = static_cast<CInterface*>(m_iMan->SearchInstance(CLASS_INTERFACE)); - m_eventQueue = static_cast<CEventQueue*>(m_iMan->SearchInstance(CLASS_EVENT)); - m_engine = static_cast<Gfx::CEngine*>(m_iMan->SearchInstance(CLASS_ENGINE)); - m_particle = static_cast<Gfx::CParticle*>(m_iMan->SearchInstance(CLASS_PARTICULE)); - m_camera = static_cast<Gfx::CCamera*>(m_iMan->SearchInstance(CLASS_CAMERA)); - m_sound = static_cast<CSoundInterface*>(m_iMan->SearchInstance(CLASS_SOUND)); + m_app = CApplication::GetInstancePointer(); + m_eventQueue = m_app->GetEventQueue(); + m_sound = m_app->GetSound(); + m_main = CRobotMain::GetInstancePointer(); + m_interface = m_main->GetInterface(); + m_camera = m_main->GetCamera(); + m_engine = Gfx::CEngine::GetInstancePointer(); + m_particle = m_engine->GetParticle(); m_phase = PHASE_NAME; m_phaseSetup = PHASE_SETUPg; |