diff options
Diffstat (limited to 'chlstate.cpp')
-rw-r--r-- | chlstate.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/chlstate.cpp b/chlstate.cpp deleted file mode 100644 index 5c9f488..0000000 --- a/chlstate.cpp +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #include "includes.h" | ||
2 | |||
3 | ChooseHighscoreListState::ChooseHighscoreListState() | ||
4 | { | ||
5 | background = SDL_LoadBMP("resources/chl.bmp"); | ||
6 | pointer = SDL_LoadBMP("resources/pointer.bmp"); | ||
7 | |||
8 | selection = 0; | ||
9 | } | ||
10 | |||
11 | void ChooseHighscoreListState::input(SDL_keysym key) | ||
12 | { | ||
13 | if ((key.sym == SDLK_UP) && (selection != 0)) | ||
14 | { | ||
15 | selection--; | ||
16 | } else if ((key.sym == SDLK_DOWN) && (selection != 2)) | ||
17 | { | ||
18 | selection++; | ||
19 | } else if (key.sym == SDLK_RETURN) | ||
20 | { | ||
21 | switch (selection) | ||
22 | { | ||
23 | case 0: | ||
24 | changeState(new LocalHighscoreListState(false)); | ||
25 | |||
26 | break; | ||
27 | case 1: | ||
28 | changeState(new GlobalHighscoreListState()); | ||
29 | |||
30 | break; | ||
31 | case 2: | ||
32 | changeState(new TitleState()); | ||
33 | |||
34 | break; | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | |||
39 | void ChooseHighscoreListState::render(SDL_Surface* screen) | ||
40 | { | ||
41 | SDL_BlitSurface(background, NULL, screen, NULL); | ||
42 | |||
43 | SDL_Rect pSpace; | ||
44 | pSpace.x = 127; | ||
45 | pSpace.y = (selection==0?306:(selection==1?336:396)); | ||
46 | pSpace.w = pointer->w; | ||
47 | pSpace.h = pointer->h; | ||
48 | |||
49 | SDL_BlitSurface(pointer, NULL, screen, &pSpace); | ||
50 | } | ||