-
Notifications
You must be signed in to change notification settings - Fork 30
/
lights.h
executable file
·81 lines (63 loc) · 1.69 KB
/
lights.h
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
/*==========================================================================
*
*
* File: Lights.h
* Content: Lights.c include file
*
*
***************************************************************************/
#ifndef LIGHTS_INCLUDED
#define LIGHTS_INCLUDED
#include <math.h>
#include "main.h"
#include "new3d.h"
#include "ships.h"
#include "mload.h"
#include "mxload.h"
#include "mxaload.h"
#include "collision.h"
/*
* defines
*/
#define MAXXLIGHTS 256
#define POINT_LIGHT 0
#define SPOT_LIGHT 1
#define MIN_LIGHT_SIZE ( 1536.0F * GLOBAL_SCALE )
/*
* structures
*/
typedef struct XLIGHT{
int Type;
bool Visible;
u_int16_t Index;
float r;
float g;
float b;
float Size;
float SizeCount;
float ColorCount;
float CosArc; // how wide is my light.......
u_int16_t Next; // Next Free
u_int16_t Prev; // Previous used...
VECTOR Pos;
VECTOR Dir; // Normalised....
u_int16_t Group;
struct XLIGHT * NextVisible;
}XLIGHT;
/*
* fn prototypes
*/
bool ProcessXLights( MLOADHEADER * Mloadheader );
void InitXLights();
u_int16_t FindFreeXLight();
void KillUsedXLight(u_int16_t);
void SetLightDie ( u_int16_t light );
bool XLight1Group( MLOADHEADER * Mloadheader, u_int16_t group );
bool XLightMxloadHeader( MXLOADHEADER * MXloadheader , VECTOR * Pos , float Radius , MATRIX * Matrix );
bool XLightMxaloadHeader( MXALOADHEADER * MXAloadheader , VECTOR * Pos , float Radius , MATRIX * Matrix );
void CreateCellColours( MLOADHEADER * Mloadheader );
COLOR FindNearestCellColour( MLOADHEADER * Mloadheader,VECTOR * Pos, u_int16_t group );
void BuildVisibleLightList( u_int16_t Group );
FILE * SaveXLights( FILE * fp );
FILE * LoadXLights( FILE * fp );
#endif // LIGHTS_INCLUDED