UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
entitiesdef.h
Go to the documentation of this file.
1
5
6
/*
7
All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
Copyright (C) 1997-2001 Id Software, Inc.
10
11
This program is free software; you can redistribute it and/or
12
modify it under the terms of the GNU General Public License
13
as published by the Free Software Foundation; either version 2
14
of the License, or (at your option) any later version.
15
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20
See the GNU General Public License for more details.
21
22
You should have received a copy of the GNU General Public License
23
along with this program; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26
*/
27
28
#pragma once
29
30
# define ED_MAX_DEFS 64
31
32
# define ED_ERROR -1
33
# define ED_OK 1
34
35
# define ED_OPTIONAL (1<<0)
36
# define ED_MANDATORY (1<<1)
37
# define ED_ABSTRACT (1<<2)
38
# define ED_TYPE_FLOAT (1<<3)
39
# define ED_TYPE_INT (1<<4)
40
# define ED_TYPE_STRING (1<<5)
41
# define ED_DEFAULT (1<<6)
42
# define ED_MODE_TYPE (1<<7)
43
# define ED_RANGE (1<<8)
44
# define ED_INSIST_POSITIVE (1<<9)
45
# define ED_TYPE_BOOL (1<<10)
46
47
# define ED_CONCRETE (ED_OPTIONAL | ED_MANDATORY)
48
# define ED_KEY_TYPE (ED_TYPE_FLOAT | ED_TYPE_INT | ED_TYPE_STRING | ED_TYPE_BOOL)
49
50
typedef
union
int_float_u {
51
int
i
;
52
float
f
;
53
}
int_float_tu
;
54
55
typedef
struct
entityKeyRange_s {
56
char
*
str
;
57
int
*
iArr
;
58
float
*
fArr
;
59
int
numElements
;
60
int
continuous
;
61
}
entityKeyRange_t
;
62
63
typedef
struct
entityKeyDef_s {
64
char
*
name
;
65
char
*
desc
;
66
char
*
defaultVal
;
67
int
flags
;
68
int
vLen
;
69
entityKeyRange_t
**
ranges
;
70
int
numRanges
;
71
}
entityKeyDef_t
;
72
73
typedef
struct
entityDef_s {
74
char
*
classname
;
75
entityKeyDef_t
*
keyDefs
;
76
int
numKeyDefs
;
77
}
entityDef_t
;
78
79
int
ED_GetIntVector
(
const
entityKeyDef_t
* kd,
int
v
[],
const
int
n);
80
int
ED_Check
(
const
char
* classname,
const
char
*
key
,
const
char
* value);
81
int
ED_CheckKey
(
const
entityKeyDef_t
* kd,
const
char
* value);
82
const
entityDef_t
*
ED_GetEntityDef
(
const
char
* classname);
83
const
entityKeyDef_t
*
ED_GetKeyDef
(
const
char
* classname,
const
char
* keyname,
const
int
abstract);
84
const
entityKeyDef_t
*
ED_GetKeyDefEntity
(
const
entityDef_t
* ed,
const
char
* keyname,
const
int
abstract);
85
int
ED_Parse
(
const
char
* data_p);
86
const
char
*
ED_GetLastError
(
void
);
87
void
ED_Free
(
void
);
88
89
extern
int
numEntityDefs
;
90
extern
entityDef_t
entityDefs
[
ED_MAX_DEFS
+ 1];
key
unsigned int key
Definition
cl_input.cpp:64
numEntityDefs
int numEntityDefs
Definition
entitiesdef.cpp:45
entityDefs
entityDef_t entityDefs[ED_MAX_DEFS+1]
Definition
entitiesdef.cpp:46
ED_Check
int ED_Check(const char *classname, const char *key, const char *value)
tests if a value string matches the type for this key. Also checks the value against the range,...
Definition
entitiesdef.cpp:357
ED_Parse
int ED_Parse(const char *data_p)
Definition
entitiesdef.cpp:738
ED_CheckKey
int ED_CheckKey(const entityKeyDef_t *kd, const char *value)
as ED_Check, but where the entity and key are known, so takes different arguments.
Definition
entitiesdef.cpp:372
ED_GetKeyDefEntity
const entityKeyDef_t * ED_GetKeyDefEntity(const entityDef_t *ed, const char *keyname, const int abstract)
searches for the parsed key def, when the entity def is known
Definition
entitiesdef.cpp:789
ED_GetKeyDef
const entityKeyDef_t * ED_GetKeyDef(const char *classname, const char *keyname, const int abstract)
searches for the parsed key def
Definition
entitiesdef.cpp:775
ED_MAX_DEFS
#define ED_MAX_DEFS
Definition
entitiesdef.h:30
ED_GetIntVector
int ED_GetIntVector(const entityKeyDef_t *kd, int v[], const int n)
parses a value from the definition
Definition
entitiesdef.cpp:208
ED_GetLastError
const char * ED_GetLastError(void)
Definition
entitiesdef.cpp:763
ED_Free
void ED_Free(void)
Definition
entitiesdef.cpp:827
ED_GetEntityDef
const entityDef_t * ED_GetEntityDef(const char *classname)
searches for the parsed entity def by classname
Definition
entitiesdef.cpp:815
v
QGL_EXTERN int GLboolean GLfloat * v
Definition
r_gl.h:120
entityDef_t
Definition
entitiesdef.h:73
entityDef_t::classname
char * classname
Definition
entitiesdef.h:74
entityDef_t::keyDefs
entityKeyDef_t * keyDefs
Definition
entitiesdef.h:75
entityDef_t::numKeyDefs
int numKeyDefs
Definition
entitiesdef.h:76
entityKeyDef_t
Definition
entitiesdef.h:63
entityKeyDef_t::vLen
int vLen
Definition
entitiesdef.h:68
entityKeyDef_t::desc
char * desc
Definition
entitiesdef.h:65
entityKeyDef_t::name
char * name
Definition
entitiesdef.h:64
entityKeyDef_t::numRanges
int numRanges
Definition
entitiesdef.h:70
entityKeyDef_t::defaultVal
char * defaultVal
Definition
entitiesdef.h:66
entityKeyDef_t::flags
int flags
Definition
entitiesdef.h:67
entityKeyDef_t::ranges
entityKeyRange_t ** ranges
Definition
entitiesdef.h:69
entityKeyRange_t
Definition
entitiesdef.h:55
entityKeyRange_t::continuous
int continuous
Definition
entitiesdef.h:60
entityKeyRange_t::fArr
float * fArr
Definition
entitiesdef.h:58
entityKeyRange_t::iArr
int * iArr
Definition
entitiesdef.h:57
entityKeyRange_t::numElements
int numElements
Definition
entitiesdef.h:59
entityKeyRange_t::str
char * str
Definition
entitiesdef.h:56
int_float_tu
Definition
entitiesdef.h:50
int_float_tu::i
int i
Definition
entitiesdef.h:51
int_float_tu::f
float f
Definition
entitiesdef.h:52
src
shared
entitiesdef.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0