blob: 5c9f488d8a17b0155d6f0b3d10f6410556157f3c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#include "includes.h"
ChooseHighscoreListState::ChooseHighscoreListState()
{
background = SDL_LoadBMP("resources/chl.bmp");
pointer = SDL_LoadBMP("resources/pointer.bmp");
selection = 0;
}
void ChooseHighscoreListState::input(SDL_keysym key)
{
if ((key.sym == SDLK_UP) && (selection != 0))
{
selection--;
} else if ((key.sym == SDLK_DOWN) && (selection != 2))
{
selection++;
} else if (key.sym == SDLK_RETURN)
{
switch (selection)
{
case 0:
changeState(new LocalHighscoreListState(false));
break;
case 1:
changeState(new GlobalHighscoreListState());
break;
case 2:
changeState(new TitleState());
break;
}
}
}
void ChooseHighscoreListState::render(SDL_Surface* screen)
{
SDL_BlitSurface(background, NULL, screen, NULL);
SDL_Rect pSpace;
pSpace.x = 127;
pSpace.y = (selection==0?306:(selection==1?336:396));
pSpace.w = pointer->w;
pSpace.h = pointer->h;
SDL_BlitSurface(pointer, NULL, screen, &pSpace);
}
|