diff options
Diffstat (limited to 'htpstate.cpp')
-rw-r--r-- | htpstate.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/htpstate.cpp b/htpstate.cpp deleted file mode 100644 index 0771290..0000000 --- a/htpstate.cpp +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | #include "includes.h" | ||
2 | |||
3 | HowToPlayState::HowToPlayState() | ||
4 | { | ||
5 | background1 = SDL_LoadBMP("resources/htp1.bmp"); | ||
6 | background2 = SDL_LoadBMP("resources/htp2.bmp"); | ||
7 | pointer = SDL_LoadBMP("resources/pointer.bmp"); | ||
8 | |||
9 | secondPage = false; | ||
10 | selection = 0; | ||
11 | } | ||
12 | |||
13 | void HowToPlayState::input(SDL_keysym key) | ||
14 | { | ||
15 | if ((key.sym == SDLK_LEFT) && (selection != 0)) | ||
16 | { | ||
17 | selection--; | ||
18 | } else if ((key.sym == SDLK_RIGHT) && (selection != 1)) | ||
19 | { | ||
20 | selection++; | ||
21 | } else if (key.sym == SDLK_RETURN) | ||
22 | { | ||
23 | switch (selection) | ||
24 | { | ||
25 | case 0: | ||
26 | secondPage = !secondPage; | ||
27 | |||
28 | break; | ||
29 | case 1: | ||
30 | changeState(new TitleState()); | ||
31 | |||
32 | break; | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | |||
37 | void HowToPlayState::render(SDL_Surface* screen) | ||
38 | { | ||
39 | SDL_Rect pSpace; | ||
40 | |||
41 | if (!secondPage) | ||
42 | { | ||
43 | SDL_BlitSurface(background1, NULL, screen, NULL); | ||
44 | |||
45 | pSpace.x = (selection==0?74:216); | ||
46 | } else { | ||
47 | SDL_BlitSurface(background2, NULL, screen, NULL); | ||
48 | |||
49 | pSpace.x = (selection==0?45:238); | ||
50 | } | ||
51 | |||
52 | pSpace.y = 430; | ||
53 | pSpace.w = pointer->w; | ||
54 | pSpace.h = pointer->h; | ||
55 | |||
56 | SDL_BlitSurface(pointer, NULL, screen, &pSpace); | ||
57 | } | ||