ScummVM API documentation
credits.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 NANCY_STATE_CREDITS_H
23 #define NANCY_STATE_CREDITS_H
24 
25 #include "common/singleton.h"
26 
27 #include "engines/nancy/time.h"
28 #include "engines/nancy/commontypes.h"
29 
30 #include "engines/nancy/state/state.h"
31 
32 #include "engines/nancy/ui/fullscreenimage.h"
33 
34 namespace Nancy {
35 
36 namespace State {
37 
38 class Credits : public State, public Common::Singleton<Credits> {
39 public:
40  enum State { kInit, kRun };
41  Credits() : _state(kInit), _background(), _textSurface(1), _currentTextImage(0), _creditsData(nullptr) {}
42 
43  // State API
44  void process() override;
45  void onStateEnter(const NancyState::NancyState prevState) override;
46  bool onStateExit(const NancyState::NancyState nextState) override;
47 
48 protected:
49  void init();
50  void run();
51 
52  void drawTextSurface(uint id);
53 
54  const CRED *_creditsData;
55 
56  State _state;
57  UI::FullScreenImage _background;
58  RenderObject _textSurface;
59  Time _nextUpdateTime;
60  Graphics::ManagedSurface _fullTextSurface;
61  uint _currentTextImage;
62 };
63 
64 #define NancyCreditsState Nancy::State::Credits::instance()
65 
66 } // End of namespace State
67 } // End of namespace Nancy
68 
69 #endif // NANCY_STATE_CREDITS_H
Definition: managed_surface.h:51
Definition: time.h:30
Definition: enginedata.h:220
Definition: renderobject.h:36
Definition: credits.h:38
Definition: fullscreenimage.h:30
Definition: actionmanager.h:32
Definition: singleton.h:42