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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fixer.h"
#include "strtab.hpp"
#include "awtexld.h"
#include "chnktexi.h"
#include "hud_layout.h"
#include "avp_menus.h"
#define UseLocalAssert Yes
#include "ourasert.h"
#include "ffstdio.h"
#include <GL/gl.h>
/* char AAFontWidths[256]; */
extern int AAFontImageNumber;
int PlayMenuBackgroundBink()
{
fprintf(stderr, "PlayMenuBackgroundBink()\n");
glClear(GL_COLOR_BUFFER_BIT);
return 0;
}
AVPMENUGFX AvPMenuGfxStorage[MAX_NO_OF_AVPMENUGFXS] =
{
{"Menus\\fractal.rim"},
{"Common\\aa_font.rim"},// Warning! Texture from common used
{"Menus\\copyright.rim"},
{"Menus\\FIandRD.rim"},
{"Menus\\presents.rim"},
{"Menus\\AliensVPredator.rim"},
{"Menus\\sliderbar.rim"},//AVPMENUGFX_SLIDERBAR,
{"Menus\\slider.rim"},//AVPMENUGFX_SLIDER,
{"Menus\\starfield.rim"},
{"Menus\\aliens.rim"},
{"Menus\\Alien.rim"},
{"Menus\\Marine.rim"},
{"Menus\\Predator.rim"},
{"Menus\\glowy_left.rim"},
{"Menus\\glowy_middle.rim"},
{"Menus\\glowy_right.rim"},
// Marine level
{"Menus\\MarineEpisode1.rim"},
{"Menus\\MarineEpisode2.rim"},
{"Menus\\MarineEpisode3.rim"},
{"Menus\\MarineEpisode4.rim"},
{"Menus\\MarineEpisode5.rim"},
{"Menus\\MarineEpisode6.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
// Predator level
{"Menus\\PredatorEpisode1.rim"},
{"Menus\\PredatorEpisode2.rim"},
{"Menus\\PredatorEpisode3.rim"},
{"Menus\\PredatorEpisode4.rim"},
{"Menus\\PredatorEpisode5.rim"},
{"Menus\\PredatorEpisode5.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
// Alien level
{"Menus\\AlienEpisode2.rim"},
{"Menus\\AlienEpisode4.rim"},
{"Menus\\AlienEpisode1.rim"},
{"Menus\\AlienEpisode3.rim"},
{"Menus\\AlienEpisode5.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
{"Menus\\bonus.rim"},
// Splash screens
#if MARINE_DEMO
{"MarineSplash\\splash00.rim"},
{"MarineSplash\\splash01.rim"},
{"MarineSplash\\splash02.rim"},
{"MarineSplash\\splash03.rim"},
{"MarineSplash\\splash04.rim"},
{"MarineSplash\\splash05.rim"},
#elif ALIEN_DEMO
{"AlienSplash\\splash00.rim"},
{"AlienSplash\\splash01.rim"},
{"AlienSplash\\splash02.rim"},
{"AlienSplash\\splash03.rim"},
{"AlienSplash\\splash04.rim"},
{"AlienSplash\\splash05.rim"},
#else
{"PredatorSplash\\splash00.rim"},
{"PredatorSplash\\splash01.rim"},
{"PredatorSplash\\splash02.rim"},
{"PredatorSplash\\splash03.rim"},
{"PredatorSplash\\splash04.rim"},
{"PredatorSplash\\splash05.rim"},
#endif
};
int LengthOfMenuText(char *textPtr)
{
fprintf(stderr, "LengthOfMenuText(%s)\n", textPtr);
return 0;
}
int RenderMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
{
return Hardware_RenderSmallMenuText(textPtr, x, y, alpha, format);
fprintf(stderr, "RenderMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format);
return 0;
}
int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY)
{
fprintf(stderr, "RenderMenuText_Clipped(%s, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, topY, bottomY);
return 0;
}
int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format)
{
return Hardware_RenderSmallMenuText(textPtr, x, y, alpha, format);
fprintf(stderr, "RenderSmallMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format);
return 0;
}
int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue)
{
return Hardware_RenderSmallMenuText_Coloured(textPtr, x, y, alpha, format, red, green, blue);
fprintf(stderr, "RenderSmallMenuText_Coloured(%s, %d, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, red, green, blue);
return 0;
}
void RenderKeyConfigRectangle(int alpha)
{
void Hardware_RenderKeyConfigRectangle(int alpha);
Hardware_RenderKeyConfigRectangle(alpha);
fprintf(stderr, "RenderKeyConfigRectangle(%d)\n", alpha);
}
void RenderHighlightRectangle(int x1, int y1, int x2, int y2, int r, int g, int b)
{
void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b);
Hardware_RenderHighlightRectangle(x1, y1, x2, y2, r, g, b);
fprintf(stderr, "RenderHighlightRectangle(%d, %d, %d, %d, %d, %d, %d)\n", x1, y1, x2, y2, r, g, b);
}
void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y)
{
fprintf(stderr, "RenderSmallFontString_Wrapped(%s, %p, %d, %p, %p)\n", textPtr, area, alpha, output_x, output_y);
}
void LoadAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID)
{
AVPMENUGFX *gfxPtr;
char buffer[100];
unsigned int fastFileLength;
void const *pFastFileData;
GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS);
gfxPtr = &AvPMenuGfxStorage[menuGfxID];
/* TODO: make sure this doesn't cause a leak */
InitialiseTextures();
CL_GetImageFileName(buffer, 100, gfxPtr->FilenamePtr, LIO_RELATIVEPATH);
pFastFileData = ffreadbuf(buffer, &fastFileLength);
if (pFastFileData) {
gfxPtr->ImagePtr = AwCreateSurface(
"pxfXY",
pFastFileData,
fastFileLength,
AW_TLF_TRANSP|AW_TLF_CHROMAKEY,
&(gfxPtr->Width),
&(gfxPtr->Height)
);
} else {
gfxPtr->ImagePtr = AwCreateSurface(
"sfXY",
buffer,
AW_TLF_TRANSP|AW_TLF_CHROMAKEY,
&(gfxPtr->Width),
&(gfxPtr->Height)
);
}
GLOBALASSERT(gfxPtr->ImagePtr);
GLOBALASSERT(gfxPtr->Width>0);
GLOBALASSERT(gfxPtr->Height>0);
gfxPtr->hBackup = 0;
}
static void ReleaseAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID)
{
AVPMENUGFX *gfxPtr;
GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS);
gfxPtr = &AvPMenuGfxStorage[menuGfxID];
GLOBALASSERT(gfxPtr);
GLOBALASSERT(gfxPtr->ImagePtr);
ReleaseDDSurface(gfxPtr->ImagePtr);
gfxPtr->ImagePtr = NULL;
}
void LoadAllAvPMenuGfx()
{
int i;
for (i = 0; i < AVPMENUGFX_WINNER_SCREEN; i++) {
LoadAvPMenuGfx(i);
}
AAFontImageNumber = CL_LoadImageOnce("Common\\aa_font.RIM",LIO_D3DTEXTURE|LIO_RELATIVEPATH|LIO_RESTORABLE);
/*
TODO: load Fonts
TODO: Create cloud texture
TODO: Calculate AA font table?
*/
fprintf(stderr, "LoadAllAvPMenuGfx()\n");
}
void LoadAllSplashScreenGfx()
{
int i;
for (i = AVPMENUGFX_SPLASH_SCREEN1; i < MAX_NO_OF_AVPMENUGFXS; i++) {
LoadAvPMenuGfx(i);
}
}
void InitialiseMenuGfx()
{
int i;
for (i = 0; i < MAX_NO_OF_AVPMENUGFXS; i++) {
AvPMenuGfxStorage[i].ImagePtr = NULL;
}
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glClear(GL_COLOR_BUFFER_BIT);
}
void ReleaseAllAvPMenuGfx()
{
int i;
for (i = 0; i < MAX_NO_OF_AVPMENUGFXS; i++) {
if (AvPMenuGfxStorage[i].ImagePtr) {
ReleaseAvPMenuGfx(i);
}
}
/*
TODO: Unload fonts
*/
fprintf(stderr, "ReleaseAllAvPMenuGfx()\n");
}
void DrawAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format)
{
fprintf(stderr, "DrawAvPMenuGfx(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format);
}
void DrawAvPMenuGfx_CrossFade(enum AVPMENUGFX_ID menuGfxID,enum AVPMENUGFX_ID menuGfxID2,int alpha)
{
fprintf(stderr, "DrawAvPMenuGfx_CrossFade(%d, %d, %d)\n", menuGfxID, menuGfxID2, alpha);
}
void DrawAvPMenuGfx_Faded(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format)
{
fprintf(stderr, "DrawAvPMenuGfx_Faded(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format);
}
void DrawAvPMenuGfx_Clipped(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format, int topY, int bottomY)
{
fprintf(stderr, "DrawAvPMenuGfx_Clipped(%d, %d, %d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format, topY, bottomY);
}
int HeightOfMenuGfx(enum AVPMENUGFX_ID menuGfxID)
{
return AvPMenuGfxStorage[menuGfxID].Height;
}
void FadedScreen(int alpha)
{
fprintf(stderr, "FadedScreen(%d)\n", alpha);
}
void ClearScreenToBlack()
{
fprintf(stderr, "ClearScreenToBlack()\n");
}
#include "aafont.h"
|