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  bool wait(uint32 delay);
68 };
69 
70 class intro_v1w : public IntroHandler {
71 public:
72  intro_v1w(HugoEngine *vm);
73  ~intro_v1w() override;
74 
75  void preNewGame() override;
76  void introInit() override;
77  bool introPlay() override;
78 };
79 
80 class intro_v1d : public IntroHandler {
81 public:
82  intro_v1d(HugoEngine *vm);
83  ~intro_v1d() override;
84 
85  void preNewGame() override;
86  void introInit() override;
87  bool introPlay() override;
88 private:
89  int _introState;
90 };
91 
92 class intro_v2w : public IntroHandler {
93 public:
94  intro_v2w(HugoEngine *vm);
95  ~intro_v2w() override;
96 
97  void preNewGame() override;
98  void introInit() override;
99  bool introPlay() override;
100 };
101 
102 class intro_v2d : public IntroHandler {
103 public:
104  intro_v2d(HugoEngine *vm);
105  ~intro_v2d() override;
106 
107  void preNewGame() override;
108  void introInit() override;
109  bool introPlay() override;
110 };
111 
112 class intro_v3w : public IntroHandler {
113 public:
114  intro_v3w(HugoEngine *vm);
115  ~intro_v3w() override;
116 
117  void preNewGame() override;
118  void introInit() override;
119  bool introPlay() override;
120 };
121 
122 class intro_v3d : public IntroHandler {
123 public:
124  intro_v3d(HugoEngine *vm);
125  ~intro_v3d() override;
126 
127  void preNewGame() override;
128  void introInit() override;
129  bool introPlay() override;
130 };
131 
132 } // End of namespace Hugo
133 
134 #endif
Definition: console.h:27
Definition: surface.h:67
Definition: winfont.h:46
Definition: intro.h:102
Definition: stream.h:745
Definition: intro.h:42
Definition: intro.h:92
Definition: intro.h:80
Definition: hugo.h:219
Definition: intro.h:122
Definition: intro.h:70
Definition: intro.h:112