| 1 |
/* |
| 2 |
* Copyright (C) 2004 Ivo Danihelka ([email protected]) |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
*/ |
| 9 |
#include "PosterState.h" |
| 10 |
|
| 11 |
#include "Path.h" |
| 12 |
#include "Picture.h" |
| 13 |
#include "DemoInput.h" |
| 14 |
|
| 15 |
#include "OptionAgent.h" |
| 16 |
#include "VideoAgent.h" |
| 17 |
|
| 18 |
//----------------------------------------------------------------- |
| 19 |
PosterState::PosterState(const Path &picture) |
| 20 |
{ |
| 21 |
m_bg = new Picture(picture, V2(0, 0)); |
| 22 |
takeHandler(new DemoInput(this)); |
| 23 |
registerDrawable(m_bg); |
| 24 |
} |
| 25 |
//----------------------------------------------------------------- |
| 26 |
PosterState::~PosterState() |
| 27 |
{ |
| 28 |
delete m_bg; |
| 29 |
} |
| 30 |
//----------------------------------------------------------------- |
| 31 |
void |
| 32 |
PosterState::own_initState() |
| 33 |
{ |
| 34 |
OptionAgent *options = OptionAgent::agent(); |
| 35 |
options->setParam("screen_width", m_bg->getW()); |
| 36 |
options->setParam("screen_height", m_bg->getH()); |
| 37 |
VideoAgent::agent()->initVideoMode(); |
| 38 |
} |