git repos / blockattack-game

blame: source/code/MenuSystem.cc

normal view · raw

f3ef3495 sago007 2008-11-13 20:00 1
/*
c53e6443 sago007 2012-04-17 11:04 2
===========================================================================
c53e6443 sago007 2012-04-17 11:04 3
blockattack - Block Attack - Rise of the Blocks
c53e6443 sago007 2012-04-17 11:04 4
Copyright (C) 2005-2012 Poul Sander
c53e6443 sago007 2012-04-17 11:04 5
c53e6443 sago007 2012-04-17 11:04 6
This program is free software: you can redistribute it and/or modify
c53e6443 sago007 2012-04-17 11:04 7
it under the terms of the GNU General Public License as published by
c53e6443 sago007 2012-04-17 11:04 8
the Free Software Foundation, either version 2 of the License, or
c53e6443 sago007 2012-04-17 11:04 9
(at your option) any later version.
c53e6443 sago007 2012-04-17 11:04 10
c53e6443 sago007 2012-04-17 11:04 11
This program is distributed in the hope that it will be useful,
c53e6443 sago007 2012-04-17 11:04 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
c53e6443 sago007 2012-04-17 11:04 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c53e6443 sago007 2012-04-17 11:04 14
GNU General Public License for more details.
c53e6443 sago007 2012-04-17 11:04 15
c53e6443 sago007 2012-04-17 11:04 16
You should have received a copy of the GNU General Public License
c53e6443 sago007 2012-04-17 11:04 17
along with this program.  If not, see http://www.gnu.org/licenses/
c53e6443 sago007 2012-04-17 11:04 18
c53e6443 sago007 2012-04-17 11:04 19
Source information and contacts persons can be found at
c53e6443 sago007 2012-04-17 11:04 20
http://blockattack.sf.net
c53e6443 sago007 2012-04-17 11:04 21
===========================================================================
f3ef3495 sago007 2008-11-13 20:00 22
*/
f3ef3495 sago007 2008-11-13 20:00 23
b7590374 sago007 2011-05-19 16:15 24
#include <SDL/SDL_events.h>
b7590374 sago007 2011-05-19 16:15 25
f3ef3495 sago007 2008-11-13 20:00 26
#include "MenuSystem.h"
f3ef3495 sago007 2008-11-13 20:00 27
#include "common.h"
605138b3 sago007 2012-04-14 15:12 28
#include "CppSdlImageHolder.hpp"
f3ef3495 sago007 2008-11-13 20:00 29
b7590374 sago007 2011-05-19 16:15 30
extern CppSdl::CppSdlImageHolder mouse;
f3ef3495 sago007 2008-11-13 20:00 31
extern SDL_Surface *backgroundImage;
f3ef3495 sago007 2008-11-13 20:00 32
extern bool highPriority;
f3ef3495 sago007 2008-11-13 20:00 33
int mousex;
f3ef3495 sago007 2008-11-13 20:00 34
int mousey;
f3ef3495 sago007 2008-11-13 20:00 35
f3ef3495 sago007 2008-11-13 20:00 36
/*Draws a image from on a given Surface. Takes source image, destination surface and coordinates*/
f3ef3495 sago007 2008-11-13 20:00 37
inline void DrawIMG(SDL_Surface *img, SDL_Surface *target, int x, int y)
f3ef3495 sago007 2008-11-13 20:00 38
{
c53e6443 sago007 2012-04-17 11:04 39
	SDL_Rect dest;
c53e6443 sago007 2012-04-17 11:04 40
	dest.x = x;
c53e6443 sago007 2012-04-17 11:04 41
	dest.y = y;
c53e6443 sago007 2012-04-17 11:04 42
	SDL_BlitSurface(img, NULL, target, &dest);
f3ef3495 sago007 2008-11-13 20:00 43
}
f3ef3495 sago007 2008-11-13 20:00 44
b7590374 sago007 2011-05-19 16:15 45
CppSdl::CppSdlImageHolder ButtonGfx::_marked;
b7590374 sago007 2011-05-19 16:15 46
CppSdl::CppSdlImageHolder ButtonGfx::_unmarked;
f3ef3495 sago007 2008-11-13 20:00 47
int ButtonGfx::xsize;
f3ef3495 sago007 2008-11-13 20:00 48
int ButtonGfx::ysize;
b7590374 sago007 2011-05-19 16:15 49
NFont ButtonGfx::thefont;
f3ef3495 sago007 2008-11-13 20:00 50
b7590374 sago007 2011-05-19 16:15 51
void ButtonGfx::setSurfaces(CppSdl::CppSdlImageHolder marked,CppSdl::CppSdlImageHolder unmarked)
f3ef3495 sago007 2008-11-13 20:00 52
{
c53e6443 sago007 2012-04-17 11:04 53
	ButtonGfx::_marked = marked;
c53e6443 sago007 2012-04-17 11:04 54
	ButtonGfx::_unmarked = unmarked;
c53e6443 sago007 2012-04-17 11:04 55
	xsize=(marked).GetWidth();
c53e6443 sago007 2012-04-17 11:04 56
	ysize=(marked).GetHeight();
c53e6443 sago007 2012-04-17 11:04 57
	cout << "Surfaces set, size: " <<xsize << " , " << ysize << endl;
f3ef3495 sago007 2008-11-13 20:00 58
}
f3ef3495 sago007 2008-11-13 20:00 59
f3ef3495 sago007 2008-11-13 20:00 60
Button::Button()
f3ef3495 sago007 2008-11-13 20:00 61
{
c53e6443 sago007 2012-04-17 11:04 62
	label = "";
c53e6443 sago007 2012-04-17 11:04 63
	marked = false;
c53e6443 sago007 2012-04-17 11:04 64
	action = NULL;
f3ef3495 sago007 2008-11-13 20:00 65
}
f3ef3495 sago007 2008-11-13 20:00 66
f3ef3495 sago007 2008-11-13 20:00 67
Button::~Button()
f3ef3495 sago007 2008-11-13 20:00 68
{
f3ef3495 sago007 2008-11-13 20:00 69
}
f3ef3495 sago007 2008-11-13 20:00 70
f3ef3495 sago007 2008-11-13 20:00 71
Button::Button(const Button& b)
f3ef3495 sago007 2008-11-13 20:00 72
{
c53e6443 sago007 2012-04-17 11:04 73
	label = b.label;
c53e6443 sago007 2012-04-17 11:04 74
	marked = b.marked;
c53e6443 sago007 2012-04-17 11:04 75
	action = b.action;
f3ef3495 sago007 2008-11-13 20:00 76
}
f3ef3495 sago007 2008-11-13 20:00 77
f3ef3495 sago007 2008-11-13 20:00 78
void Button::setLabel(string text)
f3ef3495 sago007 2008-11-13 20:00 79
{
c53e6443 sago007 2012-04-17 11:04 80
	label = text;
f3ef3495 sago007 2008-11-13 20:00 81
}
f3ef3495 sago007 2008-11-13 20:00 82
26ddb424 sago007 2011-06-09 20:06 83
void Button::setAction(void (*action2run)(Button*))
f3ef3495 sago007 2008-11-13 20:00 84
{
c53e6443 sago007 2012-04-17 11:04 85
	action = action2run;
f3ef3495 sago007 2008-11-13 20:00 86
}
f3ef3495 sago007 2008-11-13 20:00 87
f3ef3495 sago007 2008-11-13 20:00 88
bool Button::isClicked(int x,int y)
f3ef3495 sago007 2008-11-13 20:00 89
{
c53e6443 sago007 2012-04-17 11:04 90
	if ( x >= this->x && y >= this->y && x<= this->x+ButtonGfx::xsize && y <= this->y + ButtonGfx::ysize)
c53e6443 sago007 2012-04-17 11:04 91
		return true;
c53e6443 sago007 2012-04-17 11:04 92
	else
c53e6443 sago007 2012-04-17 11:04 93
		return false;
f3ef3495 sago007 2008-11-13 20:00 94
}
f3ef3495 sago007 2008-11-13 20:00 95
f3ef3495 sago007 2008-11-13 20:00 96
void Button::doAction()
f3ef3495 sago007 2008-11-13 20:00 97
{
c53e6443 sago007 2012-04-17 11:04 98
	if(action)
c53e6443 sago007 2012-04-17 11:04 99
		action(this);
c53e6443 sago007 2012-04-17 11:04 100
	else
c53e6443 sago007 2012-04-17 11:04 101
		cout << "Warning: button \"" << label << "\" has no action assigned!";
f3ef3495 sago007 2008-11-13 20:00 102
}
f3ef3495 sago007 2008-11-13 20:00 103
b7590374 sago007 2011-05-19 16:15 104
void Button::drawTo(SDL_Surface **surface)
f3ef3495 sago007 2008-11-13 20:00 105
{
c53e6443 sago007 2012-04-17 11:04 106
#if DEBUG
c53e6443 sago007 2012-04-17 11:04 107
	//cout << "Painting button: " << label << " at: " << x << "," << y << endl;
c53e6443 sago007 2012-04-17 11:04 108
#endif
c53e6443 sago007 2012-04-17 11:04 109
	if (marked)
c53e6443 sago007 2012-04-17 11:04 110
		ButtonGfx::_marked.PaintTo(*surface,x,y);
c53e6443 sago007 2012-04-17 11:04 111
	else
c53e6443 sago007 2012-04-17 11:04 112
		ButtonGfx::_unmarked.PaintTo(*surface,x,y);
c53e6443 sago007 2012-04-17 11:04 113
	//int stringx = x + (ButtonGfx::xsize)/2 - ButtonGfx::ttf->getTextWidth(label)/2;
c53e6443 sago007 2012-04-17 11:04 114
	//int stringy = y + (ButtonGfx::ysize)/2 - ButtonGfx::ttf->getTextHeight()/2;
c53e6443 sago007 2012-04-17 11:04 115
	//ButtonGfx::ttf->writeText(label,surface,stringx,stringy);
c53e6443 sago007 2012-04-17 11:04 116
	ButtonGfx::thefont.setDest(*surface);
c53e6443 sago007 2012-04-17 11:04 117
	ButtonGfx::thefont.drawCenter(x+ButtonGfx::xsize/2,y+ButtonGfx::ysize/2-ButtonGfx::thefont.getHeight(label.c_str())/2,label.c_str());
f3ef3495 sago007 2008-11-13 20:00 118
}
f3ef3495 sago007 2008-11-13 20:00 119
f3ef3495 sago007 2008-11-13 20:00 120
void Menu::drawSelf()
f3ef3495 sago007 2008-11-13 20:00 121
{
c53e6443 sago007 2012-04-17 11:04 122
	DrawIMG(backgroundImage,screen,0,0);
c53e6443 sago007 2012-04-17 11:04 123
	vector<Button*>::iterator it;
c53e6443 sago007 2012-04-17 11:04 124
	for(it = buttons.begin(); it < buttons.end(); it++)
c53e6443 sago007 2012-04-17 11:04 125
		(*it)->drawTo(&screen);
c53e6443 sago007 2012-04-17 11:04 126
	exit.drawTo(&screen);
c53e6443 sago007 2012-04-17 11:04 127
	ButtonGfx::thefont.draw(50,50,title.c_str());
c53e6443 sago007 2012-04-17 11:04 128
	mouse.PaintTo(screen,mousex,mousey);
f3ef3495 sago007 2008-11-13 20:00 129
}
f3ef3495 sago007 2008-11-13 20:00 130
f3ef3495 sago007 2008-11-13 20:00 131
void Menu::performClick(int x,int y)
f3ef3495 sago007 2008-11-13 20:00 132
{
c53e6443 sago007 2012-04-17 11:04 133
	vector<Button*>::iterator it;
c53e6443 sago007 2012-04-17 11:04 134
	for(it = buttons.begin(); it < buttons.end(); it++)
c53e6443 sago007 2012-04-17 11:04 135
	{
c53e6443 sago007 2012-04-17 11:04 136
		Button *b = (*it);
c53e6443 sago007 2012-04-17 11:04 137
		if(b->isClicked(x,y))
c53e6443 sago007 2012-04-17 11:04 138
			b->doAction();
c53e6443 sago007 2012-04-17 11:04 139
	}
c53e6443 sago007 2012-04-17 11:04 140
	if(exit.isClicked(x,y))
c53e6443 sago007 2012-04-17 11:04 141
		running = false;
f3ef3495 sago007 2008-11-13 20:00 142
}
f3ef3495 sago007 2008-11-13 20:00 143
f3ef3495 sago007 2008-11-13 20:00 144
void Menu::placeButtons()
f3ef3495 sago007 2008-11-13 20:00 145
{
c53e6443 sago007 2012-04-17 11:04 146
	int nextY = 100;
c53e6443 sago007 2012-04-17 11:04 147
	const int X = 50;
c53e6443 sago007 2012-04-17 11:04 148
	vector<Button*>::iterator it;
c53e6443 sago007 2012-04-17 11:04 149
	for(it = buttons.begin(); it < buttons.end(); it++)
c53e6443 sago007 2012-04-17 11:04 150
	{
c53e6443 sago007 2012-04-17 11:04 151
		(*it)->x = X;
c53e6443 sago007 2012-04-17 11:04 152
		(*it)->y = nextY;
c53e6443 sago007 2012-04-17 11:04 153
		nextY += ButtonGfx::ysize+10;
c53e6443 sago007 2012-04-17 11:04 154
	}
c53e6443 sago007 2012-04-17 11:04 155
	exit.x = X;
c53e6443 sago007 2012-04-17 11:04 156
	exit.y = nextY;
f3ef3495 sago007 2008-11-13 20:00 157
}
f3ef3495 sago007 2008-11-13 20:00 158
fc8e3d6a sago007 2011-06-25 16:31 159
void Menu::addButton(Button *b)
f3ef3495 sago007 2008-11-13 20:00 160
{
c53e6443 sago007 2012-04-17 11:04 161
	buttons.push_back(b);
c53e6443 sago007 2012-04-17 11:04 162
	b->marked = false;
c53e6443 sago007 2012-04-17 11:04 163
	placeButtons();
f3ef3495 sago007 2008-11-13 20:00 164
}
f3ef3495 sago007 2008-11-13 20:00 165
f3ef3495 sago007 2008-11-13 20:00 166
Menu::Menu(SDL_Surface **screen)
f3ef3495 sago007 2008-11-13 20:00 167
{
c53e6443 sago007 2012-04-17 11:04 168
	this->screen = *screen;
c53e6443 sago007 2012-04-17 11:04 169
	buttons = vector<Button*>(10);
c53e6443 sago007 2012-04-17 11:04 170
	isSubmenu = true;
c53e6443 sago007 2012-04-17 11:04 171
	exit.setLabel( _("Back") );
f3ef3495 sago007 2008-11-13 20:00 172
}
f3ef3495 sago007 2008-11-13 20:00 173
f3ef3495 sago007 2008-11-13 20:00 174
Menu::Menu(SDL_Surface **screen,bool submenu)
f3ef3495 sago007 2008-11-13 20:00 175
{
c53e6443 sago007 2012-04-17 11:04 176
	this->screen = *screen;
c53e6443 sago007 2012-04-17 11:04 177
	buttons = vector<Button*>(0);
c53e6443 sago007 2012-04-17 11:04 178
	isSubmenu = submenu;
c53e6443 sago007 2012-04-17 11:04 179
	if(isSubmenu)
c53e6443 sago007 2012-04-17 11:04 180
		exit.setLabel( _("Back") );
c53e6443 sago007 2012-04-17 11:04 181
	else
c53e6443 sago007 2012-04-17 11:04 182
		exit.setLabel( _("Exit") );
f3ef3495 sago007 2008-11-13 20:00 183
}
f3ef3495 sago007 2008-11-13 20:00 184
c53e6443 sago007 2012-04-17 11:04 185
Menu::Menu(SDL_Surface** screen, string title, bool submenu)
c53e6443 sago007 2012-04-17 11:04 186
{
c53e6443 sago007 2012-04-17 11:04 187
	this->screen = *screen;
c53e6443 sago007 2012-04-17 11:04 188
	buttons = vector<Button*>(0);
c53e6443 sago007 2012-04-17 11:04 189
	isSubmenu = submenu;
c53e6443 sago007 2012-04-17 11:04 190
	this->title = title;
c53e6443 sago007 2012-04-17 11:04 191
	if(isSubmenu)
c53e6443 sago007 2012-04-17 11:04 192
		exit.setLabel(_("Back") );
c53e6443 sago007 2012-04-17 11:04 193
	else
c53e6443 sago007 2012-04-17 11:04 194
		exit.setLabel(_("Exit") );
cc3ef158 sago007 2011-07-03 16:13 195
}
cc3ef158 sago007 2011-07-03 16:13 196
f3ef3495 sago007 2008-11-13 20:00 197
void Menu::run()
f3ef3495 sago007 2008-11-13 20:00 198
{
c53e6443 sago007 2012-04-17 11:04 199
	running = true;
c53e6443 sago007 2012-04-17 11:04 200
	bool bMouseUp = false;
c53e6443 sago007 2012-04-17 11:04 201
	long oldmousex = mousex;
c53e6443 sago007 2012-04-17 11:04 202
	long oldmousey = mousey;
c53e6443 sago007 2012-04-17 11:04 203
	while(running && !Config::getInstance()->isShuttingDown())
c53e6443 sago007 2012-04-17 11:04 204
	{
c53e6443 sago007 2012-04-17 11:04 205
		if (!(highPriority)) SDL_Delay(10);
c53e6443 sago007 2012-04-17 11:04 206
c53e6443 sago007 2012-04-17 11:04 207
c53e6443 sago007 2012-04-17 11:04 208
		SDL_Event event;
c53e6443 sago007 2012-04-17 11:04 209
c53e6443 sago007 2012-04-17 11:04 210
		while ( SDL_PollEvent(&event) )
c53e6443 sago007 2012-04-17 11:04 211
		{
c53e6443 sago007 2012-04-17 11:04 212
			if ( event.type == SDL_QUIT )
c53e6443 sago007 2012-04-17 11:04 213
			{
c53e6443 sago007 2012-04-17 11:04 214
				Config::getInstance()->setShuttingDown(5);
c53e6443 sago007 2012-04-17 11:04 215
				running = false;
c53e6443 sago007 2012-04-17 11:04 216
			}
c53e6443 sago007 2012-04-17 11:04 217
c53e6443 sago007 2012-04-17 11:04 218
			if ( event.type == SDL_KEYDOWN )
c53e6443 sago007 2012-04-17 11:04 219
			{
c53e6443 sago007 2012-04-17 11:04 220
				if ( event.key.keysym.sym == SDLK_ESCAPE )
c53e6443 sago007 2012-04-17 11:04 221
				{
c53e6443 sago007 2012-04-17 11:04 222
					running = false;
c53e6443 sago007 2012-04-17 11:04 223
				}
c53e6443 sago007 2012-04-17 11:04 224
c53e6443 sago007 2012-04-17 11:04 225
				if (event.key.keysym.sym == SDLK_UP)
c53e6443 sago007 2012-04-17 11:04 226
				{
c53e6443 sago007 2012-04-17 11:04 227
					marked--;
c53e6443 sago007 2012-04-17 11:04 228
					if(marked<0)
c53e6443 sago007 2012-04-17 11:04 229
						marked = buttons.size(); //not -1, since exit is after the last element in the list
c53e6443 sago007 2012-04-17 11:04 230
				}
c53e6443 sago007 2012-04-17 11:04 231
c53e6443 sago007 2012-04-17 11:04 232
				if (event.key.keysym.sym == SDLK_DOWN)
c53e6443 sago007 2012-04-17 11:04 233
				{
c53e6443 sago007 2012-04-17 11:04 234
					marked++;
c53e6443 sago007 2012-04-17 11:04 235
					if(marked>buttons.size())
c53e6443 sago007 2012-04-17 11:04 236
						marked = 0;
c53e6443 sago007 2012-04-17 11:04 237
				}
c53e6443 sago007 2012-04-17 11:04 238
c53e6443 sago007 2012-04-17 11:04 239
				if(event.key.keysym.sym == SDLK_RETURN || event.key.keysym.sym == SDLK_KP_ENTER )
c53e6443 sago007 2012-04-17 11:04 240
				{
c53e6443 sago007 2012-04-17 11:04 241
					if(marked < buttons.size())
c53e6443 sago007 2012-04-17 11:04 242
						buttons.at(marked)->doAction();
c53e6443 sago007 2012-04-17 11:04 243
					if(marked == buttons.size())
c53e6443 sago007 2012-04-17 11:04 244
						running = false;
c53e6443 sago007 2012-04-17 11:04 245
				}
c53e6443 sago007 2012-04-17 11:04 246
			}
c53e6443 sago007 2012-04-17 11:04 247
c53e6443 sago007 2012-04-17 11:04 248
c53e6443 sago007 2012-04-17 11:04 249
		}
c53e6443 sago007 2012-04-17 11:04 250
c53e6443 sago007 2012-04-17 11:04 251
		for(int i=0; i<buttons.size(); i++)
c53e6443 sago007 2012-04-17 11:04 252
		{
c53e6443 sago007 2012-04-17 11:04 253
			buttons.at(i)->marked = (i == marked);
c53e6443 sago007 2012-04-17 11:04 254
		}
c53e6443 sago007 2012-04-17 11:04 255
		exit.marked = (marked == buttons.size());
c53e6443 sago007 2012-04-17 11:04 256
		Uint8 buttonState = SDL_GetMouseState(&mousex,&mousey);
c53e6443 sago007 2012-04-17 11:04 257
		// If the mouse button is released, make bMouseUp equal true
c53e6443 sago007 2012-04-17 11:04 258
		if ( (buttonState&SDL_BUTTON(1))==0)
c53e6443 sago007 2012-04-17 11:04 259
		{
c53e6443 sago007 2012-04-17 11:04 260
			bMouseUp=true;
c53e6443 sago007 2012-04-17 11:04 261
		}
c53e6443 sago007 2012-04-17 11:04 262
c53e6443 sago007 2012-04-17 11:04 263
		if(abs(mousex-oldmousex)>5 || abs(mousey-oldmousey)>5)
c53e6443 sago007 2012-04-17 11:04 264
		{
c53e6443 sago007 2012-04-17 11:04 265
			for(int i=0; i< buttons.size(); ++i)
c53e6443 sago007 2012-04-17 11:04 266
			{
c53e6443 sago007 2012-04-17 11:04 267
				if(buttons.at(i)->isClicked(mousex,mousey))
c53e6443 sago007 2012-04-17 11:04 268
				{
c53e6443 sago007 2012-04-17 11:04 269
					marked = i;
c53e6443 sago007 2012-04-17 11:04 270
				}
c53e6443 sago007 2012-04-17 11:04 271
			}
c53e6443 sago007 2012-04-17 11:04 272
			if(exit.isClicked(mousex,mousey))
c53e6443 sago007 2012-04-17 11:04 273
			{
c53e6443 sago007 2012-04-17 11:04 274
				marked = buttons.size();
c53e6443 sago007 2012-04-17 11:04 275
			}
c53e6443 sago007 2012-04-17 11:04 276
			oldmousex = mousex;
c53e6443 sago007 2012-04-17 11:04 277
			oldmousey = mousey;
c53e6443 sago007 2012-04-17 11:04 278
		}
c53e6443 sago007 2012-04-17 11:04 279
c53e6443 sago007 2012-04-17 11:04 280
		//mouse clicked
c53e6443 sago007 2012-04-17 11:04 281
		if(buttonState&SDL_BUTTON(1)==SDL_BUTTON(1) && bMouseUp)
c53e6443 sago007 2012-04-17 11:04 282
		{
c53e6443 sago007 2012-04-17 11:04 283
			bMouseUp = false;
c53e6443 sago007 2012-04-17 11:04 284
			for(int i=0; i< buttons.size(); ++i)
c53e6443 sago007 2012-04-17 11:04 285
			{
c53e6443 sago007 2012-04-17 11:04 286
				if(buttons.at(i)->isClicked(mousex,mousey))
c53e6443 sago007 2012-04-17 11:04 287
				{
c53e6443 sago007 2012-04-17 11:04 288
					buttons.at(i)->doAction();
c53e6443 sago007 2012-04-17 11:04 289
				}
c53e6443 sago007 2012-04-17 11:04 290
			}
c53e6443 sago007 2012-04-17 11:04 291
			if(exit.isClicked(mousex,mousey))
c53e6443 sago007 2012-04-17 11:04 292
			{
c53e6443 sago007 2012-04-17 11:04 293
				running = false;
c53e6443 sago007 2012-04-17 11:04 294
			}
c53e6443 sago007 2012-04-17 11:04 295
		}
c53e6443 sago007 2012-04-17 11:04 296
c53e6443 sago007 2012-04-17 11:04 297
		drawSelf();
c53e6443 sago007 2012-04-17 11:04 298
		SDL_Flip(screen);
c53e6443 sago007 2012-04-17 11:04 299
	}
f3ef3495 sago007 2008-11-13 20:00 300
}
1970-01-01 00:00 301