-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentities.h
95 lines (78 loc) · 2.77 KB
/
entities.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* Copyright (C) 1996-1997 Id Software, Inc.
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
See file, 'COPYING', for details.
*/
/*
* tyrlite/entites.h
* Modifications by Kevin Shanahan, 1999-2000
*/
#ifndef __TYRLITE_ENTITIES_H__
#define __TYRLITE_ENTITIES_H__
#define DEFAULTLIGHTLEVEL 300
typedef struct epair_s {
struct epair_s *next;
char key[MAX_KEY];
char value[MAX_VALUE];
} epair_t;
typedef struct entity_s {
char classname[64];
char message[1024];
vec3_t origin;
float angle;
/* TYR - added fields */
int formula;
float atten;
vec3_t mangle;
qboolean use_mangle;
int lightcolour[3];
int light;
int style;
char target[32];
char targetname[32];
struct epair_s *epairs;
struct entity_s *targetent;
} entity_t;
/* Explanation of values added to struct entity_s
*
* formula:
* takes a value 0-3 (default 0)
* 0 - Standard lighting formula like original light
* 1 - light fades as 1/x
* 2 - light fades as 1/(x^2)
* 3 - Light stays same brightness reguardless of distance
*
* atten:
* Takes a float as a value (default 1.0).
* This reflects how fast a light fades with distance.
* For example a value of 2 will fade twice as fast, and a value of 0.5
* will fade half as fast. (Just like arghlite)
*
* mangle:
* If the entity is a light, then point the spotlight in this direction.
* If it is the worldspawn, then this is the sunlight mangle
*
* lightcolour:
* Stores the RGB values to determine the light colour
*/
extern entity_t entities[MAX_MAP_ENTITIES];
extern int num_entities;
extern int numtexlights;
extern entity_t texlights[MAX_MAP_FACES];
entity_t *FindEntityWithKeyPair (char *key, char *value);
char *ValueForKey (entity_t *ent, char *key);
void SetKeyValue (entity_t *ent, char *key, char *value);
float FloatForKey (entity_t *ent, char *key);
void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
void LoadEntities (void);
void WriteEntitiesToString (void);
#endif /* __TYRLITE_ENTITIES_H__ */