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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
|
/*
* PARSEC - Special Effects
*
* $Author: uberlinuxguy $ - $Date: 2004/09/15 12:25:25 $
*
* Orginally written by:
* Copyright (c) Markus Hadwiger <msh@parsec.org> 1997-1999
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// C library
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// compilation flags/debug support
#include "config.h"
#include "debug.h"
// general definitions
#include "general.h"
#include "objstruc.h"
#include "od_props.h"
// global externals
#include "globals.h"
// subsystem headers
#include "net_defs.h"
#include "vid_defs.h"
// mathematics header
#include "utl_math.h"
// particle types
#include "parttype.h"
// local module header
#include "g_sfx.h"
// proprietary module headers
#include "con_aux.h"
#include "e_color.h"
#include "e_record.h"
#include "h_supp.h"
#include "obj_ctrl.h"
#include "part_api.h"
#include "part_def.h"
// flags
#define NO_SIZE_BOUNDS
// particle size boundaries
#ifdef NO_SIZE_BOUNDS
#define PRTSB_EXPLOSION PRT_NO_SIZEBOUND
#define PRTSB_ENERGYFIELD PRT_NO_SIZEBOUND
#define PRTSB_PROTSHIELD PRT_NO_SIZEBOUND
#define PRTSB_INVULSHIELD PRT_NO_SIZEBOUND
#else
#define PRTSB_EXPLOSION partbitmap_size_bound
#define PRTSB_ENERGYFIELD partbitmap_size_bound
#define PRTSB_PROTSHIELD partbitmap_size_bound
#define PRTSB_INVULSHIELD partbitmap_size_bound
#endif
// geometry of particle explosion of ship
#define PARTICLE_EXPLOSION_STARTRADIUS FIXED_TO_GEOMV( 0xa00 )
#define PARTICLE_EXPLOSION_NUMPARTICLES 150
#define PARTICLE_EXPLOSION_DURATION 400 //250 //400
// properties of energy field
#define ENERGY_FIELD_INITIAL_RADIUS FLOAT_TO_GEOMV( 0.0625f )
#define ENERGY_FIELD_LIFETIME 10000
// properties of protection shield
#define PROTSHIELD_BITMAP BM_SHIELD2
#define PROTSHIELD_COLOR 228
#define PROTSHIELD_REF_Z SPHERE_REF_Z
// if ship is hit its shield is displayed for this period of time
#define SHIELD_FLASH_DURATION 40
// properties of invulnerability shield
#define MEGASHIELD_BITMAP BM_SHIELD1
#define MEGASHIELD_COLOR 123
#define MEGASHIELD_REF_Z SPHERE_REF_Z
#define MEGASHIELD_LIFETIME MEGASHIELD_STRENGTH * DEFAULT_REFFRAME_FREQUENCY //20000
// properties of propulsion fumes
#define PROPFUMES_BITMAP BM_PROPFUMES1
#define PROPFUMES_COLOR 3
#define PROPFUMES_REF_Z 60.0f
#define PROPFUMES_SIZE_BOUNDARY 2
#define PROPFUMES_SCATTER_BOUNDARY 2
#define PROPFUMES_DRIFT_SPEED 0.0016f
// reference z values for particles -------------------------------------------
//
float sphere_explosion_ref_z = 1.0f;
float protshield_ref_z = 1.0f;
float megashield_ref_z = 1.0f;
float propfumes_ref_z = 1.0f;
// init reference z values for particles according to resolution --------------
//
void SFX_InitParticleSizes( float resoscale )
{
sphere_explosion_ref_z = resoscale * SPHERE_EXPLOSION_REF_Z;
protshield_ref_z = resoscale * PROTSHIELD_REF_Z;
megashield_ref_z = resoscale * MEGASHIELD_REF_Z;
propfumes_ref_z = resoscale * PROPFUMES_REF_Z;
}
// create particle explosion; meant to be called only externally --------------
//
void SFX_ParticleExplosion( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
// calc explosion origin
Vertex3 origin;
FetchTVector( shippo->ObjPosition, &origin );
// some particle appearance properties
int bitmap = SPHERE_EXPLOSION_BM_INDX;
int color = SPHERE_EXPLOSION_COLOR;
float ref_z = sphere_explosion_ref_z;
int sizebound = PRTSB_EXPLOSION;
int lifetime = PARTICLE_EXPLOSION_DURATION;
pextinfo_s extinfo;
pextinfo_s *pextinfo = NULL;
if ( AUX_EXPLOSION_PARTICLES_EXTINFO ) {
// alter basic attributes
ref_z *= 2;
bitmap = iter_texrgba | iter_specularadd;
// sizebound = PRT_NO_SIZEBOUND;
// fetch pdef
pdef_s *pdef = PDEF_pflare02();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo = &extinfo;
PRT_InitParticleExtInfo( pextinfo, pdef, NULL, NULL );
}
pdrwinfo_s drawinfo;
drawinfo.bmindx = bitmap;
drawinfo.pcolor = color;
drawinfo.ref_z = ref_z;
drawinfo.extinfo = pextinfo;
drawinfo.sizebnd = sizebound;
pcluster_s *cluster =
PRT_CreateParticleSphereObject( origin,
PARTICLE_EXPLOSION_STARTRADIUS,
SAT_EXPLODING,
PARTICLE_EXPLOSION_NUMPARTICLES,
lifetime, &drawinfo,
GetObjectOwner( shippo ) );
}
// create an energy field -----------------------------------------------------
//
void SFX_CreateEnergyField( Vertex3& origin )
{
// some particle appearance properties
int bitmap = SPHERE_BM_INDX;
int color = SPHERE_PARTICLE_COLOR;
extern float sphere_ref_z;
float ref_z = sphere_ref_z;
int sizebound = PRTSB_ENERGYFIELD;
int lifetime = ENERGY_FIELD_LIFETIME;
pextinfo_s extinfo;
pextinfo_s *pextinfo = NULL;
if ( AUX_ENERGYFIELD_PARTICLES_EXTINFO ) {
// alter basic attributes
ref_z *= 4;
bitmap = iter_texrgba | iter_specularadd;
// sizebound = PRT_NO_SIZEBOUND;
// fetch pdef
pdef_s *pdef = PDEF_pflare03();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo = &extinfo;
PRT_InitParticleExtInfo( pextinfo, pdef, NULL, NULL );
}
pdrwinfo_s drawinfo;
drawinfo.bmindx = bitmap;
drawinfo.pcolor = color;
drawinfo.ref_z = ref_z;
drawinfo.extinfo = pextinfo;
drawinfo.sizebnd = sizebound;
pcluster_s *cluster =
PRT_CreateParticleSphereObject( origin,
ENERGY_FIELD_INITIAL_RADIUS,
SAT_ENERGYFIELD_SPHERE,
SPHERE_PARTICLES,
lifetime, &drawinfo,
LocalPlayerId );
// maintain particle extra count
CurrentNumPrtExtras++;
}
// show protective shield surrounding a ship for a short period of time -------
//
void SFX_FlashProtectiveShield( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
// dont't flash shield if already any shield-cluster attached
if ( PRT_ObjectHasAttachedClustersOfType( shippo, SAT_NO_ANIMATION ) )
return;
// some particle appearance properties
int bitmap = PROTSHIELD_BITMAP;
int color = PROTSHIELD_COLOR;
float ref_z = protshield_ref_z;
int sizebound = PRTSB_PROTSHIELD;
int lifetime = SHIELD_FLASH_DURATION;
pextinfo_s extinfo;
pextinfo_s *pextinfo = NULL;
if ( AUX_PROTSHIELD_PARTICLES_EXTINFO ) {
// alter basic attributes
ref_z *= 4;
bitmap = iter_texrgba | iter_specularadd;
// sizebound = PRT_NO_SIZEBOUND;
// fetch pdef
pdef_s *pdef = PDEF_pflare04();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo = &extinfo;
PRT_InitParticleExtInfo( pextinfo, pdef, NULL, NULL );
}
pdrwinfo_s drawinfo;
drawinfo.bmindx = bitmap;
drawinfo.pcolor = color;
drawinfo.ref_z = ref_z;
drawinfo.extinfo = pextinfo;
drawinfo.sizebnd = sizebound;
// create ship centered particle sphere without animation
basesphere_pcluster_s *cluster =
PRT_CreateObjectCenteredSphere( shippo, shippo->BoundingSphere,
SAT_NO_ANIMATION,
SPHERE_PARTICLES,
lifetime, &drawinfo,
GetObjectOwner( shippo ) );
}
// create particle sphere for invulnerability shield (megashield) -------------
//
PRIVATE
basesphere_pcluster_s *CreateMegaSphere( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
// some particle appearance properties
int bitmap = MEGASHIELD_BITMAP;
int color = MEGASHIELD_COLOR;
float ref_z = megashield_ref_z;
int sizebound = PRTSB_INVULSHIELD;
int lifetime = MEGASHIELD_LIFETIME;
pextinfo_s extinfo;
pextinfo_s *pextinfo = NULL;
if ( AUX_MEGASHIELD_PARTICLES_EXTINFO ) {
// alter basic attributes
ref_z *= 4;
bitmap = iter_texrgba | iter_specularadd;
// sizebound = PRT_NO_SIZEBOUND;
// fetch pdef
pdef_s *pdef = PDEF_pflare02();//05();
if ( pdef == NULL )
return NULL;
// create pextinfo
pextinfo = &extinfo;
PRT_InitParticleExtInfo( pextinfo, pdef, NULL, NULL );
}
pdrwinfo_s drawinfo;
drawinfo.bmindx = bitmap;
drawinfo.pcolor = color;
drawinfo.ref_z = ref_z;
drawinfo.extinfo = pextinfo;
drawinfo.sizebnd = sizebound;
basesphere_pcluster_s *cluster =
PRT_CreateObjectCenteredSphere( shippo, shippo->BoundingSphere,
SAT_MEGASHIELD_SPHERE,
SPHERE_PARTICLES,
lifetime, &drawinfo,
GetObjectOwner( shippo ) );
return cluster;
}
// enable invulnerability function (mega-shield) ------------------------------
//
int SFX_EnableInvulnerabilityShield( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
if ( NET_ConnectedPEER() ) {
// check if enough space in RE_List
if ( !NET_RmEvAllowed( RE_PARTICLEOBJECT ) )
return FALSE;
}
basesphere_pcluster_s *attached = (basesphere_pcluster_s *) PRT_ObjectHasAttachedClustersOfType( shippo, SAT_MEGASHIELD_SPHERE );
// don't attach more than one, only reset lifetime
if ( attached != NULL ) {
attached->lifetime = attached->max_life;
return TRUE;
}
// create particle sphere
CreateMegaSphere( shippo );
if ( NET_ConnectedPEER() ) {
// insert remote event
Vertex3 dummyorigin;
NET_RmEvParticleObject( POBJ_MEGASHIELD, dummyorigin );
}
return TRUE;
}
// fetch invulnerability shield and info --------------------------------------
//
basesphere_pcluster_s *SFX_FetchInvulnerabilityShield( ShipObject *shippo, float *strength )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
basesphere_pcluster_s *cluster = (basesphere_pcluster_s *)
PRT_ObjectHasAttachedClustersOfType( shippo, SAT_MEGASHIELD_SPHERE );
if ( cluster == NULL ) {
return NULL;
}
if ( strength != NULL ) {
*strength = (float)cluster->lifetime / (float)cluster->max_life;
}
return cluster;
}
// enable invulnerability function (mega-shield) for remote players -----------
//
void SFX_RemoteEnableInvulnerabilityShield( int owner )
{
// fetch pointer to remote player's ship
ShipObject *shippo = NET_FetchOwnersShip( owner );
ASSERT( shippo != NULL );
ASSERT( shippo != MyShip );
basesphere_pcluster_s *attached = (basesphere_pcluster_s *)
PRT_ObjectHasAttachedClustersOfType( shippo, SAT_MEGASHIELD_SPHERE );
// don't attach more than one, only reset lifetime
if ( attached != NULL ) {
attached->lifetime = MEGASHIELD_LIFETIME;
return;
}
// create particle sphere
CreateMegaSphere( shippo );
}
// create hull impact particles -----------------------------------------------
//
void SFX_HullImpact( ShipObject *shippo, Vertex3 *impact, Plane3 *plane )
{
ASSERT( shippo != NULL );
ASSERT( impact != NULL );
ASSERT( plane != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
// some particle appearance properties
int bitmap = PROTSHIELD_BITMAP;
int color = PROTSHIELD_COLOR;
float ref_z = protshield_ref_z;
int sizebound = PRTSB_PROTSHIELD;
int lifetime = 20000; //SHIELD_FLASH_DURATION;
pextinfo_s extinfo;
pextinfo_s *pextinfo = NULL;
if ( AUX_PROTSHIELD_PARTICLES_EXTINFO ) {
// alter basic attributes
ref_z *= 4;
bitmap = iter_texrgba | iter_specularadd;
// sizebound = PRT_NO_SIZEBOUND;
// fetch pdef
pdef_s *pdef = PDEF_pflare04();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo = &extinfo;
PRT_InitParticleExtInfo( pextinfo, pdef, NULL, NULL );
}
Vertex3 world_space;
MtxVctMUL( shippo->ObjPosition, impact, &world_space );
Vector3 dirvec_obj;
dirvec_obj.X = plane->X;
dirvec_obj.Y = plane->Y;
dirvec_obj.Z = plane->Z;
Vector3 dirvec;
MtxVctMULt( shippo->ObjPosition, &dirvec_obj, &dirvec );
geomv_t speed = FLOAT_TO_GEOMV( 0.01 );
dirvec.X = GEOMV_MUL( dirvec.X, speed );
dirvec.Y = GEOMV_MUL( dirvec.Y, speed );
dirvec.Z = GEOMV_MUL( dirvec.Z, speed );
particle_s particle;
PRT_InitParticle( particle, bitmap, color, sizebound,
ref_z, &world_space, &dirvec,
lifetime, GetObjectOwner( shippo ), pextinfo );
PRT_CreateLinearParticle( particle );
}
// create propulsion fumes for spaceship --------------------------------------
//
void SFX_CreatePropulsionParticles( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
//TEST:
//FIXME:
//////////////////////
return;
//////////////////////
int bitmap = PROPFUMES_BITMAP;
int color = PROPFUMES_COLOR;
float ref_z = propfumes_ref_z;
// alter basic attributes
// ref_z /= 2;
bitmap = iter_rgbtexa | iter_alphablend;
color = 0;
// fetch pdef
pdef_s *pdef = PDEF_psmoke02();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo_s extinfo;
PRT_InitParticleExtInfo( &extinfo, pdef, NULL, NULL );
// first particle ---
Vertex3 object_space;
object_space.X = shippo->Fume_X[ 0 ];
object_space.Y = shippo->Fume_Y;
object_space.Z = shippo->Fume_Z;
Vertex3 world_space;
MtxVctMUL( shippo->ObjPosition, &object_space, &world_space );
Vector3 dirvec;
fixed_t speed = shippo->FumeSpeed;
DirVctMUL( shippo->ObjPosition, FIXED_TO_GEOMV( speed ), &dirvec );
particle_s particle;
PRT_InitParticle( particle, bitmap, color, PROPFUMES_SIZE_BOUNDARY,
ref_z, &world_space, &dirvec,
shippo->FumeLifeTime, LocalPlayerId,
// NULL );
&extinfo );
PRT_CreateLinearParticle( particle );
// second particle ---
object_space.X = shippo->Fume_X[ 3 ];
MtxVctMUL( shippo->ObjPosition, &object_space, &world_space );
PRT_InitParticle( particle, bitmap, color, PROPFUMES_SIZE_BOUNDARY,
ref_z, &world_space, &dirvec,
shippo->FumeLifeTime, LocalPlayerId,
// NULL );
&extinfo );
PRT_CreateLinearParticle( particle );
}
// create propulsion fumes for missiles ---------------------------------------
//
void SFX_MissilePropulsion( MissileObject *missile )
{
ASSERT( missile != NULL );
ASSERT( OBJECT_TYPE_MISSILE( missile ) );
int bitmap = PROPFUMES_BITMAP;
int color = PROPFUMES_COLOR;
float ref_z = propfumes_ref_z;
int sizebound = PROPFUMES_SIZE_BOUNDARY;
int lifetime = PROP_FUME_LIFETIME;
// alter basic attributes
// ref_z /= 2;
bitmap = iter_rgbtexa | iter_alphablend;
color = 0;
sizebound = PRT_NO_SIZEBOUND;
lifetime = 1800;
// fetch pdef
pdef_s *pdef = PDEF_psmoke01();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo_s extinfo;
PRT_InitParticleExtInfo( &extinfo, pdef, NULL, NULL );
//TODO:
// make propulsion framerate independent
// create particle ---
Vertex3 object_space;
int x = ( PROPFUMES_SCATTER_BOUNDARY ) - ( RAND() & ( PROPFUMES_SCATTER_BOUNDARY * 2 ) );
int y = ( PROPFUMES_SCATTER_BOUNDARY ) - ( RAND() & ( PROPFUMES_SCATTER_BOUNDARY * 2 ) );
object_space.X = INT_TO_GEOMV( x );
object_space.Y = INT_TO_GEOMV( y );
object_space.Z = GEOMV_0; //PROP_FUME_START_Z;
Vertex3 world_space;
MtxVctMUL( missile->ObjPosition, &object_space, &world_space );
Vertex3 drift;
object_space.X = FLOAT_TO_GEOMV( PROPFUMES_DRIFT_SPEED * x );
object_space.Y = FLOAT_TO_GEOMV( PROPFUMES_DRIFT_SPEED * y );
object_space.Z = GEOMV_0; //PROP_FUME_START_Z;
MtxVctMULt( missile->ObjPosition, &object_space, &drift );
Vector3 dirvec;
fixed_t speed = PROP_FUME_SPEED; //missile->Speed/6;
DirVctMUL( missile->ObjPosition, FIXED_TO_GEOMV( speed ), &dirvec );
dirvec.X += drift.X;
dirvec.Y += drift.Y;
dirvec.Z += drift.Z;
particle_s particle;
PRT_InitParticle( particle, bitmap, color, sizebound,
ref_z, &world_space, &dirvec,
lifetime, LocalPlayerId,
// NULL );
&extinfo );
PRT_CreateLinearParticle( particle );
}
// create stargate ------------------------------------------------------------
//
void SFX_CreateStargate( ShipObject *shippo )
{
ASSERT( shippo != NULL );
ASSERT( OBJECT_TYPE_SHIP( shippo ) );
// basic attributes
float ref_z = 2000.0f;
int bitmap = iter_texrgba | iter_specularadd;
int color = 0;
// fetch pdef
pdef_s *pdef = PDEF_stargate();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo_s extinfo;
PRT_InitParticleExtInfo( &extinfo, pdef, NULL, NULL );
// position in object space
Vertex3 object_space;
object_space.X = GEOMV_0;
object_space.Y = GEOMV_0;
object_space.Z = INT_TO_GEOMV( ( shippo == MyShip ) ? 50 : 0 );
Vertex3 world_space;
MtxVctMUL( shippo->ObjPosition, &object_space, &world_space );
Vector3 dirvec;
dirvec.X = GEOMV_0;
dirvec.Y = GEOMV_0;
dirvec.Z = GEOMV_0;
particle_s particle;
PRT_InitParticle( particle, bitmap, color, PRT_NO_SIZEBOUND,
ref_z, &world_space, &dirvec,
32*40*2, LocalPlayerId,
&extinfo );
PRT_CreateLinearParticle( particle );
}
// extra generation animation -------------------------------------------------
//
void SFX_CreateExtra( ExtraObject *extra )
{
ASSERT( extra != NULL );
ASSERT( OBJECT_TYPE_EXTRA( extra ) );
// basic attributes
float ref_z = 350.0f;
int bitmap = iter_texrgba | iter_specularadd;
int color = 0;
// fetch pdef
pdef_s *pdef = PDEF_extragen();
if ( pdef == NULL )
return;
// create pextinfo
pextinfo_s extinfo;
PRT_InitParticleExtInfo( &extinfo, pdef, NULL, NULL );
// position in object space
Vertex3 object_space;
object_space.X = GEOMV_0;
object_space.Y = GEOMV_0;
object_space.Z = GEOMV_0;
Vertex3 world_space;
MtxVctMUL( extra->ObjPosition, &object_space, &world_space );
Vector3 dirvec;
dirvec.X = GEOMV_0;
dirvec.Y = GEOMV_0;
dirvec.Z = GEOMV_0;
particle_s particle;
PRT_InitParticle( particle, bitmap, color, PRT_NO_SIZEBOUND,
ref_z, &world_space, &dirvec,
32*40*2, LocalPlayerId,
&extinfo );
PRT_CreateLinearParticle( particle );
}
// extra vanishing animation --------------------------------------------------
//
void SFX_VanishExtra( ExtraObject *extra )
{
SFX_CreateExtra( extra );
}
|