ScummVM API documentation
vars.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_AGS_WAVES_VARS_H
23 #define AGS_PLUGINS_AGS_WAVES_VARS_H
24 
25 #include "audio/audiostream.h"
26 
27 namespace AGS3 {
28 namespace Plugins {
29 namespace AGSWaves {
30 
31 #define texWidth 240
32 #define texHeight 240
33 #define screenWidth 640
34 #define screenHeight 360
35 
36 // TODO: Dummy definitions that need to be fixed
37 typedef void *stb_vorbis;
38 typedef void *Mix_Chunk;
39 typedef int SDL_AudioSpec;
40 typedef int SDL_AudioDeviceID;
41 
42 struct Particle {
43  int x;
44  int y;
45  int transp;
46  int life;
47  bool active;
48  int dx;
49  int dy;
50  int mlay;
51  int timlay;
52  int movedport;
53  int translay;
54  int translayHold;
55  int width;
56  int height;
57  int fx;
58  int fy;
59  bool doingcircle;
60  float angle;
61  float radius;
62  int doingCircleChance;
63  float angleLay;
64  int frame;
65  float anglespeed;
66 };
67 
68 /*---------------------------------------------*/
69 
70 typedef int (*SCAPI_CHARACTER_GETX)(AGSCharacter *ch);
71 typedef int (*SCAPI_CHARACTER_GETY)(AGSCharacter *ch);
72 typedef int (*SCAPI_CHARACTER_ID) (AGSCharacter *ch);
73 
74 //WAVE SOUNDS FILES
75 struct SoundEffect {
76  Audio::SoundHandle _soundHandle;
77  int _repeat = 0;
78  int _volume = 0;
79  int _allow = 0;
80  int _channel = 0;
81  int _filter = 0;
82  int _playing = 0;
83 };
84 
85 struct Aud {
86  int NumOfChannels = 0;
87  bool Initialized = false;
88  bool Disabled = false;
89  int FilterFrequency = 0;
90  int SoundValue = 0;
91 };
92 
93 struct Mus {
94  int ID = 0;
95  int FadeTime = 0;
96  float FadeRate = 0;
97  float FadeVolume = 0;
98  int Channel = 0;
99  bool Switch = 0;
100  bool HaltedZero = 0;
101  bool HaltedOne = 0;
102  Audio::SoundHandle _soundHandle;
103 };
104 
105 struct RainParticle {
106  int x = 0;
107  int y = 0;
108  int fx = 0;
109  int fy = 0;
110  int life = 0;
111  int trans = 0;
112  bool active = 0;
113  int translay = 0;
114  int transhold = 0;
115 };
116 
117 struct MusicStream {
118  int volume = 0;
119  const char *Filename = nullptr;
120  int repeat = 0;
121  stb_vorbis *Vorbis = 0;
122  bool fix_click = false;
123 };
124 
125 struct DustParticle {
126  int x = 0;
127  int y = 0;
128  int transp = 0;
129  int life = 0;
130  bool active = false;
131  int dx = 0;
132  int dy = 0;
133  int mlay = 0;
134  int timlay = 0;
135  int movedport = 0;
136  int translay = 0;
137  int translayHold = 0;
138 };
139 
140 struct Vars {
141  int32 screen_width = 640;
142  int32 screen_height = 360;
143  int32 screen_color_depth = 32;
144  AGSCharacter *playerCharacter = nullptr;
145 
146  PluginMethod Character_GetX;
147  PluginMethod Character_GetY;
148  PluginMethod Character_ID;
149 
150  SoundEffect SFX[500];
151  RainParticle RainParticles[400];
152  RainParticle RainParticlesFore[400];
153  RainParticle RainParticlesBack[800];
154  Aud GeneralAudio;
155  Mus MFXStream;
156 
157  int currentMusic = -1;
158  int currentMusicRepeat = -1;
159  int currentMusicFadein = 0;
160 
161  double xv[3];
162  double yv[3];
163  double xvOGG[3];
164  double yvOGG[3];
165 
166  Particle particles[110];
167  Particle particlesF[10];
168  Particle particles2[12];
169  int WForceX[400];
170  int WForceY[400];
171 
172  int raysizeF = 4;
173  int dsizeF = 0;
174  int raysize = 100;
175  int dsize = 0;
176  int raysize2 = 12;
177  int dsize2 = 0;
178  int creationdelayf = 0;
179  int ww;
180  int hh;
181  int proom;
182  int prevroom;
183  bool OGG_Filter = false;
184 
185  SDL_AudioSpec spec[2];
186  MusicStream globalStream[2];
187  SDL_AudioDeviceID getDevice[2];
188  bool AudioEnabled = false;
189  float ix = 0, iy = 0, ua = 0;
190  float b_time[5];
191  float d_time = 0;
192 
193  // Y-coordinate first because we use horizontal scanlines
194  uint32 texture[texHeight][texWidth];
195  int distanceTable[screenHeight][screenWidth];
196  int angleTable[screenHeight][screenWidth];
197  bool generateonce = false;
198 
199  DustParticle dusts[200];
200  int waitBy = 6;
201  int raysizeDust = 200;
202  int dsizeDust = 0;
203  int creationdelay = 0;
204  int Walkbehind[20];
205  char *GameDatavalue[40000];
206  char *Token[10000];
207  int TokenUnUsed[10000];
208  int usedTokens = 0;
209 
210  int dY[30];
211  int tDy[30];
212  int direction[30];
213 
214  // Warper fields
215  int _newWidth = 0, _newHeight = 0;
216  int _y2 = 0;
217  int _x3 = 0, _y3 = 0;
218  int _x4 = 0, _y4 = 0;
219 };
220 
221 } // namespace AGSWaves
222 } // namespace Plugins
223 } // namespace AGS3
224 
225 #endif
Definition: ags_plugin.h:131
Definition: vars.h:85
Definition: mixer.h:49
Definition: llex.h:49
Definition: vars.h:140
Definition: plugin_base.h:189
Definition: ags.h:40
Definition: vars.h:93