00001 /* 00002 * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 */ 00009 #include "PosterState.h" 00010 00011 #include "Path.h" 00012 #include "Picture.h" 00013 #include "DemoInput.h" 00014 00015 #include "OptionAgent.h" 00016 #include "VideoAgent.h" 00017 00018 //----------------------------------------------------------------- 00019 PosterState::PosterState(const Path &picture) 00020 { 00021 m_bg = new Picture(picture, V2(0, 0)); 00022 takeHandler(new DemoInput(this)); 00023 registerDrawable(m_bg); 00024 } 00025 //----------------------------------------------------------------- 00026 PosterState::~PosterState() 00027 { 00028 delete m_bg; 00029 } 00030 //----------------------------------------------------------------- 00031 void 00032 PosterState::own_initState() 00033 { 00034 OptionAgent *options = OptionAgent::agent(); 00035 options->setParam("screen_width", m_bg->getW()); 00036 options->setParam("screen_height", m_bg->getH()); 00037 VideoAgent::agent()->initVideoMode(); 00038 }