ScummVM API documentation
game_view.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 #ifndef MM1_VIEWS_ENH_GAME_VIEW_H
23 #define MM1_VIEWS_ENH_GAME_VIEW_H
24 
25 #include "mm/mm1/views/game_view.h"
26 #include "mm/shared/xeen/sprites.h"
27 #include "mm/mm1/sound.h"
28 
29 namespace MM {
30 namespace MM1 {
31 namespace ViewsEnh {
32 
33 namespace Animations {
34 
36 private:
38  uint _frameIndex = 0;
39  uint _frameCount = 0;
40 protected:
41  Sound &_sound;
42 public:
43  ViewAnimation(const char *prefix, uint count, uint frameCount);
44  virtual ~ViewAnimation() {}
45 
46  virtual void enter() {}
47  void tick();
48  void draw(Graphics::ManagedSurface &s);
49  virtual void leave();
50 };
51 
52 } // namespace Animations
53 
54 class GameView : public Views::GameView {
55 private:
56  Animations::ViewAnimation *_anim = nullptr;
57  uint _timerCtr = 0;
58 
62  void showLocation(int locationId);
63 
64 public:
65  GameView(UIElement *owner) : Views::GameView(owner) {}
66  virtual ~GameView() {
67  delete _anim;
68  }
69 
70  void draw() override;
71  bool msgGame(const GameMessage &msg) override;
72  bool tick() override;
73 };
74 
75 } // namespace ViewsEnh
76 } // namespace MM1
77 } // namespace MM
78 
79 #endif
Definition: game_view.h:31
Definition: managed_surface.h:51
Definition: array.h:52
Definition: game_view.h:54
Definition: sound.h:35
Definition: detection.h:27
Definition: messages.h:87
Definition: events.h:68