ScummVM API documentation
intro.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  * This code is based on original Hugo Trilogy source code
24  *
25  * Copyright (c) 1989-1995 David P. Gray
26  *
27  */
28 
29 #ifndef INTRO_H
30 #define INTRO_H
31 #include "graphics/surface.h"
32 #include "graphics/fonts/winfont.h"
33 
34 namespace Hugo {
35 
36 enum seqTextIntro {
37  kIntro1 = 0,
38  kIntro2 = 1,
39  kIntro3 = 2
40 };
41 
42 class IntroHandler {
43 public:
45  Graphics::Surface _surf;
46  Graphics::WinFont _font;
47 
48  virtual ~IntroHandler();
49 
50  virtual void preNewGame() = 0;
51  virtual void introInit() = 0;
52  virtual bool introPlay() = 0;
53 
54  void freeIntroData();
55  void loadIntroData(Common::SeekableReadStream &in);
56 
57  byte getIntroSize() const;
58 
59 protected:
60  HugoEngine *_vm;
61 
62  byte *_introX;
63  byte *_introY;
64  byte _introXSize;
65  int16 _introTicks; // Count calls to introPlay()
66 };
67 
68 class intro_v1w : public IntroHandler {
69 public:
70  intro_v1w(HugoEngine *vm);
71  ~intro_v1w() override;
72 
73  void preNewGame() override;
74  void introInit() override;
75  bool introPlay() override;
76 };
77 
78 class intro_v1d : public IntroHandler {
79 public:
80  intro_v1d(HugoEngine *vm);
81  ~intro_v1d() override;
82 
83  void preNewGame() override;
84  void introInit() override;
85  bool introPlay() override;
86 private:
87  int _introState;
88 };
89 
90 class intro_v2w : public IntroHandler {
91 public:
92  intro_v2w(HugoEngine *vm);
93  ~intro_v2w() override;
94 
95  void preNewGame() override;
96  void introInit() override;
97  bool introPlay() override;
98 };
99 
100 class intro_v2d : public IntroHandler {
101 public:
102  intro_v2d(HugoEngine *vm);
103  ~intro_v2d() override;
104 
105  void preNewGame() override;
106  void introInit() override;
107  bool introPlay() override;
108 };
109 
110 class intro_v3w : public IntroHandler {
111 public:
112  intro_v3w(HugoEngine *vm);
113  ~intro_v3w() override;
114 
115  void preNewGame() override;
116  void introInit() override;
117  bool introPlay() override;
118 };
119 
120 class intro_v3d : public IntroHandler {
121 public:
122  intro_v3d(HugoEngine *vm);
123  ~intro_v3d() override;
124 
125  void preNewGame() override;
126  void introInit() override;
127  bool introPlay() override;
128 };
129 
130 } // End of namespace Hugo
131 
132 #endif
Definition: console.h:27
Definition: surface.h:67
Definition: winfont.h:45
Definition: intro.h:100
Definition: stream.h:745
Definition: intro.h:42
Definition: intro.h:90
Definition: intro.h:78
Definition: hugo.h:210
Definition: intro.h:120
Definition: intro.h:68
Definition: intro.h:110