File: vars.h

package info (click to toggle)
scummvm 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 450,580 kB
  • sloc: cpp: 4,299,825; asm: 28,322; python: 12,901; sh: 11,302; java: 9,289; xml: 7,895; perl: 2,639; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (225 lines) | stat: -rw-r--r-- 4,670 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * of the License, or(at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef AGS_PLUGINS_AGS_WAVES_VARS_H
#define AGS_PLUGINS_AGS_WAVES_VARS_H

#include "audio/audiostream.h"

namespace AGS3 {
namespace Plugins {
namespace AGSWaves {

#define texWidth 240
#define texHeight 240
#define screenWidth 640
#define screenHeight 360

// TODO: Dummy definitions that need to be fixed
typedef void *stb_vorbis;
typedef void *Mix_Chunk;
typedef int SDL_AudioSpec;
typedef int SDL_AudioDeviceID;

struct Particle {
	int x;
	int y;
	int transp;
	int life;
	bool active;
	int dx;
	int dy;
	int mlay;
	int timlay;
	int movedport;
	int translay;
	int translayHold;
	int width;
	int height;
	int fx;
	int fy;
	bool doingcircle;
	float angle;
	float radius;
	int doingCircleChance;
	float angleLay;
	int frame;
	float anglespeed;
};

/*---------------------------------------------*/

typedef int (*SCAPI_CHARACTER_GETX)(AGSCharacter *ch);
typedef int (*SCAPI_CHARACTER_GETY)(AGSCharacter *ch);
typedef int (*SCAPI_CHARACTER_ID) (AGSCharacter *ch);

//WAVE SOUNDS FILES
struct SoundEffect {
	Audio::SoundHandle _soundHandle;
	int _repeat = 0;
	int _volume = 0;
	int _allow = 0;
	int _channel = 0;
	int _filter = 0;
	int _playing = 0;
};

struct Aud {
	int NumOfChannels = 0;
	bool Initialized = false;
	bool Disabled = false;
	int FilterFrequency = 0;
	int SoundValue = 0;
};

struct Mus {
	int ID = 0;
	int FadeTime = 0;
	float FadeRate = 0;
	float FadeVolume = 0;
	int Channel = 0;
	bool Switch = 0;
	bool HaltedZero = 0;
	bool HaltedOne = 0;
	Audio::SoundHandle _soundHandle;
};

struct RainParticle {
	int x = 0;
	int y = 0;
	int fx = 0;
	int fy = 0;
	int life = 0;
	int trans = 0;
	bool active = 0;
	int translay = 0;
	int transhold = 0;
};

struct MusicStream {
	int volume = 0;
	const char *Filename = nullptr;
	int repeat = 0;
	stb_vorbis *Vorbis = 0;
	bool fix_click = false;
};

struct DustParticle {
	int x = 0;
	int y = 0;
	int transp = 0;
	int life = 0;
	bool active = false;
	int dx = 0;
	int dy = 0;
	int mlay = 0;
	int timlay = 0;
	int movedport = 0;
	int translay = 0;
	int translayHold = 0;
};

struct Vars {
	int32 screen_width = 640;
	int32 screen_height = 360;
	int32 screen_color_depth = 32;
	AGSCharacter *playerCharacter = nullptr;

	PluginMethod Character_GetX;
	PluginMethod Character_GetY;
	PluginMethod Character_ID;

	SoundEffect SFX[500];
	RainParticle RainParticles[400];
	RainParticle RainParticlesFore[400];
	RainParticle RainParticlesBack[800];
	Aud GeneralAudio;
	Mus MFXStream;

	int currentMusic = -1;
	int currentMusicRepeat = -1;
	int currentMusicFadein = 0;

	double xv[3];
	double yv[3];
	double xvOGG[3];
	double yvOGG[3];

	Particle particles[110];
	Particle particlesF[10];
	Particle particles2[12];
	int WForceX[400];
	int WForceY[400];

	int raysizeF = 4;
	int dsizeF = 0;
	int raysize = 100;
	int dsize = 0;
	int raysize2 = 12;
	int dsize2 = 0;
	int creationdelayf = 0;
	int ww;
	int hh;
	int proom;
	int prevroom;
	bool OGG_Filter = false;

	SDL_AudioSpec spec[2];
	MusicStream globalStream[2];
	SDL_AudioDeviceID getDevice[2];
	bool AudioEnabled = false;
	float ix = 0, iy = 0, ua = 0;
	float b_time[5];
	float d_time = 0;

	// Y-coordinate first because we use horizontal scanlines
	uint32 texture[texHeight][texWidth];
	int distanceTable[screenHeight][screenWidth];
	int angleTable[screenHeight][screenWidth];
	bool generateonce = false;

	DustParticle dusts[200];
	int waitBy = 6;
	int raysizeDust = 200;
	int dsizeDust = 0;
	int creationdelay = 0;
	int Walkbehind[20];
	char *GameDatavalue[40000];
	char *Token[10000];
	int TokenUnUsed[10000];
	int usedTokens = 0;

	int dY[30];
	int tDy[30];
	int direction[30];

	// Warper fields
	int _newWidth = 0, _newHeight = 0;
	int _y2 = 0;
	int _x3 = 0, _y3 = 0;
	int _x4 = 0, _y4 = 0;
};

} // namespace AGSWaves
} // namespace Plugins
} // namespace AGS3

#endif