ScummVM API documentation
ags_creditz.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  * of the License, or(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 AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ_H
23 #define AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ_H
24 
25 #include "ags/plugins/ags_plugin.h"
26 #include "ags/plugins/ags_creditz/drawing.h"
27 #include "common/array.h"
28 #include "common/rect.h"
29 #include "common/str.h"
30 
31 namespace AGS3 {
32 namespace Plugins {
33 namespace AGSCreditz {
34 
35 typedef int (*IntFunction)(int val1);
36 
37 struct Credit {
38  Common::String _text;
39  int _x = 0;
40  int _y = 0;
41  int _fontSlot = 0;
42  int _colorHeight = 0;
43  bool _isSet = false;
44  bool _image = false;
45  bool _outline = false;
46 };
47 
49  int startpoint = 0;
50  int endpoint = 0;
51  int speed = 0;
52  bool finished = false;
53  int automatic = 0;
54  int endwait = 0;
55  int topmask = 0;
56  int bottommask = 0;
57 };
58 
59 struct StCredit {
60  Common::String credit;
61  Common::String title;
62  int x = 0;
63  int y = 0;
64  int font = 0;
65  int color = 0;
66  int title_x = 0;
67  int title_y = 0;
68  int title_font = 0;
69  int title_color = 0;
70  bool title_centered = false;
71  bool title_outline = false;
72  int pause = 0;
73  bool image = false;
74  int image_slot = 0;
75  int image_time = 0;
76  bool outline = false;
77 };
78 
80  int speed = 0;
81  bool finished = false;
82 };
83 
84 struct SingleStatic {
85  int id = 0;
86  int time = 0;
87  int style = 0;
88  int settings1 = 01;
89  int settings2 = 0;
90  bool bool_ = false;
91 };
92 
95 
96 class AGSCreditz : public PluginBase, public Drawing {
97 private:
98  int drawCredit(int sequence, int credit);
99  void doCredits();
100  int countLines(const Common::String &text);
101  Common::String extractParameter(Common::String &line, const Common::String &separator);
102  void specialEffect(int sequence, int credit, const Common::String &text,
103  int font, int color, int32 x_pos);
104  void drawStEffects(int sequence, int id, int style);
105  void speeder(int sequence);
106 
107 protected:
108  enum Version {
109  VERSION_11 = 11, VERSION_20 = 20
110  };
111 
112  Version _version;
113  PluginMethod _playSound;
114  CreditArray _credits[10];
115  StCreditArray _stCredits[10];
116  bool _creditsRunning = 0, _paused = 0, _staticCredits = 0;
117  int _creditSequence = 0, _yPos = 0, _sequenceHeight = 0, _speedPoint = 0;
118  int _calculatedSequenceHeight = 0, _timer = 0, _currentStatic = 0;
119  int _numChars = 0, _timer2 = 0;
120  int _emptyLineHeight = 10;
121  int _strCredit[10];
122  SequenceSettings _seqSettings[10];
123  StSequenceSettings _stSeqSettings[10];
124  SingleStatic _singleStatic;
125 
126  // Version 1.1 specific
127  bool _resolutionFlag = false;
128  int32 _screenWidth = 0, _screenHeight = 0, _screenColorDepth = 0;
129  int32 _staticScreenWidth = 0;
130  bool _staticWidthMatches = false;
131 
132  void draw();
133  void calculateSequenceHeight(int sequence);
134  int VGACheck(int value);
135  void startSequence(int sequence);
136 
137 public:
138  AGSCreditz() : PluginBase(), Drawing() {}
139  virtual ~AGSCreditz() {}
140 };
141 
142 } // namespace AGSCreditz
143 } // namespace Plugins
144 } // namespace AGS3
145 
146 #endif
Definition: str.h:59
Definition: plugin_base.h:171
Definition: ags_creditz.h:96
Definition: ags_creditz.h:84
Definition: color.h:49
Definition: drawing.h:31
Definition: ags_creditz.h:59
Definition: ags_creditz.h:37
Definition: plugin_base.h:189
Definition: ags.h:40