| 54d2d583 |
sago007 |
2018-04-05 17:52 |
1 |
/* |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
2 |
=========================================================================== |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
3 |
blockattack - Block Attack - Rise of the Blocks |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
4 |
Copyright (C) 2005-2018 Poul Sander |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
5 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
6 |
This program is free software: you can redistribute it and/or modify |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
7 |
it under the terms of the GNU General Public License as published by |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
8 |
the Free Software Foundation, either version 2 of the License, or |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
9 |
(at your option) any later version. |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
10 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
11 |
This program is distributed in the hope that it will be useful, |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
14 |
GNU General Public License for more details. |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
15 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
16 |
You should have received a copy of the GNU General Public License |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
17 |
along with this program. If not, see http://www.gnu.org/licenses/ |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
18 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
19 |
Source information and contacts persons can be found at |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
20 |
https://blockattack.net |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
21 |
=========================================================================== |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
22 |
*/ |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
23 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
24 |
#include "HelpGamepadState.hpp" |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
25 |
#include "global.hpp" |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
26 |
#include "common.h" |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
27 |
#include "MenuSystem.h" |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
28 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
29 |
HelpGamepadState::HelpGamepadState() { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
30 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
31 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
32 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
33 |
HelpGamepadState::~HelpGamepadState() { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
34 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
35 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
36 |
bool HelpGamepadState::IsActive() { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
37 |
return isActive; |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
38 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
39 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
40 |
void HelpGamepadState::ProcessInput(const SDL_Event& event, bool& processed) { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
41 |
UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey); |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
42 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
43 |
if (isConfirmEvent(event) || isEscapeEvent(event)) { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
44 |
isActive = false; |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
45 |
processed = true; |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
46 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
47 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
48 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
49 |
void HelpGamepadState::Draw(SDL_Renderer* target) { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
50 |
DrawBackground(target); |
| a5421912 |
sago007 |
2018-04-07 14:13 |
51 |
const sago::SagoSprite& gamepad = globalData.spriteHolder->GetSprite("help_controller"); |
| a5421912 |
sago007 |
2018-04-07 14:13 |
52 |
gamepad.Draw(target, SDL_GetTicks(), globalData.xsize/2-480/2, 100); |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
53 |
} |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
54 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
55 |
void HelpGamepadState::Update() { |
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
56 |
|
| 54d2d583 |
sago007 |
2018-04-05 17:52 |
57 |
} |