ScummVM API documentation
ButtonHandler.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_BUTTON_HANDLER_H
29 #define GAME_BUTTON_HANDLER_H
30 
31 #include "hpl1/engine/engine.h"
32 
33 #include "hpl1/penumbra-overture/GameTypes.h"
34 
35 using namespace hpl;
36 
37 class cInit;
38 class cPlayer;
39 
40 class cButtonHandler : public iUpdateable {
41 public:
42  cButtonHandler(cInit *apInit);
43  ~cButtonHandler();
44 
45  void OnStart();
46  void Update(float afTimeStep);
47  void Reset();
48  void OnExit();
49  void OnPostSceneDraw();
50 
51  void SetDefaultKeys();
52 
53  tString GetActionName(const tString &asInputName, const tString &asSkipAction);
54 
55  void ChangeState(eButtonHandlerState aState);
56  eButtonHandlerState GetState() { return mState; }
57 
58  bool GetInvertMouseY() { return mbInvertMouseY; }
59  bool GetToggleCrouch() { return mbToggleCrouch; }
60 
61  // Settings
62  float mfMouseSensitivity;
63  bool mbInvertMouseY;
64  bool mbToggleCrouch;
65 
66 private:
67  iAction *ActionFromTypeAndVal(const tString &asName, const tString &asType, int input);
68  void TypeAndValFromAction(iAction *apAction, tString *apType, tString *apVal);
69 
70  int mlNumOfActions;
71 
72  cInit *mpInit;
73 
74  cInput *mpInput;
75  iLowLevelGraphics *mpLowLevelGraphics;
76 
77  cPlayer *mpPlayer;
78 
79  eButtonHandlerState mState;
80 };
81 
82 #endif // GAME_BUTTON_HANDLER_H
Definition: AI.h:36
Definition: str.h:59
Definition: Player.h:145
Definition: Action.h:35
Definition: ButtonHandler.h:40
Definition: Input.h:55
Definition: Updateable.h:35
Definition: Init.h:70
Definition: LowLevelGraphics.h:200