UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
shared.h
Go to the documentation of this file.
1
4
5
/*
6
Copyright (C) 1997-2001 Id Software, Inc.
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17
See the GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
*/
24
25
#pragma once
26
27
#include "
../../../shared/ufotypes.h
"
28
#include "
../../../common/unzip.h
"
29
#include "
../../../common/mem.h
"
30
#include "
../../../common/filesys.h
"
31
#include "
../../../shared/shared.h
"
32
#include "
../../../shared/mathlib.h
"
33
#include "
../../../shared/defines.h
"
34
#include "
../../../shared/typedefs.h
"
35
#include "
../../../shared/parse.h
"
36
#include "
../../../shared/byte.h
"
37
40
typedef
enum
{
41
VERB_SILENT_EXCEPT_ERROR
,
42
VERB_CHECK
,
43
VERB_MAPNAME
,
44
VERB_LESS
,
45
VERB_NORMAL
,
46
VERB_EXTRA
,
47
VERB_DUMP
,
48
VERB_NUM
49
}
verbosityLevel_t
;
50
51
bool
AbortPrint
(
const
verbosityLevel_t
importance);
52
void
Verb_Printf
(
const
verbosityLevel_t
importance,
const
char
*
format
, ...)
__attribute__
((
format
(__printf__, 2, 3)));
53
54
typedef struct mapConfig_s {
55
float
subdivideSize
;
56
int
nice
;
57
bool
verbose
;
58
verbosityLevel_t
verbosity
;
59
bool
noprune
;
61
bool
nodetail
;
62
bool
fulldetail
;
63
bool
onlyents
;
64
bool
exportLightmaps
;
65
bool
nomerge
;
66
bool
nowater
;
67
bool
nocsg
;
69
bool
noweld
;
70
bool
noshare
;
71
bool
nosubdiv
;
72
bool
notjunc
;
73
bool
verboseentities
;
74
bool
nobackclip
;
75
int
nolighting
;
76
int
block_xl
,
block_xh
,
block_yl
,
block_yh
;
77
float
microvolume
;
78
bool
extrasamples
;
79
bool
soft
;
80
bool
info
;
81
bool
generateFootstepFile
;
82
bool
generateMaterialFile
;
83
84
bool
performMapCheck
;
85
bool
chkEntities
;
86
bool
chkContained
;
87
bool
chkFillLevelFlags
;
88
bool
chkIntersection
;
89
bool
chkNodraws
;
90
bool
chkBrushes
;
91
bool
chkLevelFlags
;
92
bool
chkTextures
;
93
bool
chkMixedFaceContents
;
94
bool
chkMMicro
;
95
bool
chkZFight
;
96
float
mapMicrovol
;
97
bool
chkAll
;
98
bool
fixMap
;
99
bool
stats
;
100
bool
generateTraceFile
;
101
bool
generateDebugTrace
;
102
103
int
sun_intensity
[
LIGHTMAP_MAX
];
104
vec3_t
sun_ambient_color
[
LIGHTMAP_MAX
];
105
vec3_t
sun_color
[
LIGHTMAP_MAX
];
106
vec3_t
sun_angles
[
LIGHTMAP_MAX
];
107
vec3_t
sun_normal
[
LIGHTMAP_MAX
];
108
109
char
gamedir
[
MAX_VAR
];
110
111
float
saturation
;
112
float
contrast
;
113
float
brightness
;
114
byte
lightquant
;
115
float
surface_scale
;
116
float
entity_scale
;
117
118
int
onlynewer
;
119
120
int
compile_for_day
;
121
}
mapConfig_t
;
122
123
extern
mapConfig_t
config
;
124
extern
char
baseFilename
[
MAX_OSPATH
];
125
126
typedef
struct
threadstate_s {
127
int
numthreads
;
128
int
workindex
;
129
int
workcount
;
130
int
workfrac
;
131
int
worktick
;
132
bool
progress
;
133
}
threadstate_t
;
134
135
extern
threadstate_t
threadstate
;
136
137
extern
memPool_t
*
com_genericPool
;
138
extern
memPool_t
*
com_fileSysPool
;
139
140
void
ThreadLock
(
void
);
141
void
ThreadUnlock
(
void
);
142
void
RunThreadsOn
(
void
(*func)(
unsigned
int
),
unsigned
int
workcount,
bool
progress,
const
char
*
id
);
143
void
RunSingleThreadOn
(
void
(*func)(
unsigned
int
),
unsigned
int
workcount,
bool
progress,
const
char
*
id
);
144
145
#define SYS_VRB 0
/* verbose support (on/off) */
146
#define SYS_STD 1
/* standard print level */
147
#define SYS_WRN 2
/* warnings */
148
#define SYS_ERR 3
/* error */
149
150
void
Sys_Error
(
const
char
*error, ...)
__attribute__
((noreturn,
format
(__printf__, 1, 2)));
151
void
Com_Printf
(const
char
*
format
, ...)
__attribute__
((
format
(__printf__, 1, 2)));
byte.h
Byte order functions header.
Com_Printf
void Com_Printf(const char *const fmt,...)
Definition
common.cpp:428
com_genericPool
memPool_t * com_genericPool
Definition
common.cpp:72
com_fileSysPool
memPool_t * com_fileSysPool
Definition
common.cpp:71
__attribute__
#define __attribute__(x)
Definition
cxx.h:37
defines.h
Defined CONSTANTS (Macros are elsewhere).
LIGHTMAP_MAX
#define LIGHTMAP_MAX
Definition
defines.h:365
filesys.h
Filesystem header file.
MAX_OSPATH
#define MAX_OSPATH
Definition
filesys.h:44
mathlib.h
mem.h
Memory handling with sentinel checking and pools with tags for grouped free'ing.
parse.h
Shared parsing functions.
format
void format(__printf__, 1, 2)))
shared.h
MAX_VAR
#define MAX_VAR
Definition
shared.h:36
mapConfig_t
Definition
shared.h:54
mapConfig_t::noshare
bool noshare
Definition
shared.h:70
mapConfig_t::chkFillLevelFlags
bool chkFillLevelFlags
Definition
shared.h:87
mapConfig_t::nice
int nice
Definition
shared.h:56
mapConfig_t::chkContained
bool chkContained
Definition
shared.h:86
mapConfig_t::entity_scale
float entity_scale
Definition
shared.h:116
mapConfig_t::nobackclip
bool nobackclip
Definition
shared.h:74
mapConfig_t::nosubdiv
bool nosubdiv
Definition
shared.h:71
mapConfig_t::fulldetail
bool fulldetail
Definition
shared.h:62
mapConfig_t::chkMixedFaceContents
bool chkMixedFaceContents
Definition
shared.h:93
mapConfig_t::performMapCheck
bool performMapCheck
Definition
shared.h:84
mapConfig_t::sun_color
vec3_t sun_color[LIGHTMAP_MAX]
Definition
shared.h:105
mapConfig_t::chkLevelFlags
bool chkLevelFlags
Definition
shared.h:91
mapConfig_t::sun_normal
vec3_t sun_normal[LIGHTMAP_MAX]
Definition
shared.h:107
mapConfig_t::lightquant
byte lightquant
Definition
shared.h:114
mapConfig_t::verbose
bool verbose
Definition
shared.h:57
mapConfig_t::subdivideSize
float subdivideSize
Definition
shared.h:55
mapConfig_t::nomerge
bool nomerge
Definition
shared.h:65
mapConfig_t::contrast
float contrast
Definition
shared.h:112
mapConfig_t::chkNodraws
bool chkNodraws
Definition
shared.h:89
mapConfig_t::surface_scale
float surface_scale
Definition
shared.h:115
mapConfig_t::exportLightmaps
bool exportLightmaps
Definition
shared.h:64
mapConfig_t::extrasamples
bool extrasamples
Definition
shared.h:78
mapConfig_t::info
bool info
Definition
shared.h:80
mapConfig_t::verbosity
verbosityLevel_t verbosity
Definition
shared.h:58
mapConfig_t::nowater
bool nowater
Definition
shared.h:66
mapConfig_t::noweld
bool noweld
Definition
shared.h:69
mapConfig_t::brightness
float brightness
Definition
shared.h:113
mapConfig_t::compile_for_day
int compile_for_day
Definition
shared.h:120
mapConfig_t::generateMaterialFile
bool generateMaterialFile
Definition
shared.h:82
mapConfig_t::block_yl
int block_yl
Definition
shared.h:76
mapConfig_t::notjunc
bool notjunc
Definition
shared.h:72
mapConfig_t::block_xh
int block_xh
Definition
shared.h:76
mapConfig_t::nocsg
bool nocsg
Definition
shared.h:67
mapConfig_t::chkMMicro
bool chkMMicro
Definition
shared.h:94
mapConfig_t::mapMicrovol
float mapMicrovol
Definition
shared.h:96
mapConfig_t::sun_ambient_color
vec3_t sun_ambient_color[LIGHTMAP_MAX]
Definition
shared.h:104
mapConfig_t::microvolume
float microvolume
Definition
shared.h:77
mapConfig_t::block_xl
int block_xl
Definition
shared.h:76
mapConfig_t::saturation
float saturation
Definition
shared.h:111
mapConfig_t::noprune
bool noprune
Definition
shared.h:59
mapConfig_t::onlyents
bool onlyents
Definition
shared.h:63
mapConfig_t::fixMap
bool fixMap
Definition
shared.h:98
mapConfig_t::sun_angles
vec3_t sun_angles[LIGHTMAP_MAX]
Definition
shared.h:106
mapConfig_t::chkTextures
bool chkTextures
Definition
shared.h:92
mapConfig_t::sun_intensity
int sun_intensity[LIGHTMAP_MAX]
Definition
shared.h:103
mapConfig_t::stats
bool stats
Definition
shared.h:99
mapConfig_t::chkAll
bool chkAll
Definition
shared.h:97
mapConfig_t::chkZFight
bool chkZFight
Definition
shared.h:95
mapConfig_t::nolighting
int nolighting
Definition
shared.h:75
mapConfig_t::chkBrushes
bool chkBrushes
Definition
shared.h:90
mapConfig_t::generateDebugTrace
bool generateDebugTrace
Definition
shared.h:101
mapConfig_t::generateTraceFile
bool generateTraceFile
Definition
shared.h:100
mapConfig_t::soft
bool soft
Definition
shared.h:79
mapConfig_t::onlynewer
int onlynewer
Definition
shared.h:118
mapConfig_t::verboseentities
bool verboseentities
Definition
shared.h:73
mapConfig_t::chkIntersection
bool chkIntersection
Definition
shared.h:88
mapConfig_t::block_yh
int block_yh
Definition
shared.h:76
mapConfig_t::chkEntities
bool chkEntities
Definition
shared.h:85
mapConfig_t::generateFootstepFile
bool generateFootstepFile
Definition
shared.h:81
mapConfig_t::gamedir
char gamedir[MAX_VAR]
Definition
shared.h:109
mapConfig_t::nodetail
bool nodetail
Definition
shared.h:61
memPool_t
Definition
mem.cpp:55
threadstate_t
Definition
shared.h:126
threadstate_t::workindex
int workindex
Definition
shared.h:128
threadstate_t::workfrac
int workfrac
Definition
shared.h:130
threadstate_t::workcount
int workcount
Definition
shared.h:129
threadstate_t::progress
bool progress
Definition
shared.h:132
threadstate_t::numthreads
int numthreads
Definition
shared.h:127
threadstate_t::worktick
int worktick
Definition
shared.h:131
config
static config_t config
Definition
test_all.cpp:43
ThreadUnlock
void ThreadUnlock(void)
Release the lock on the shared data.
Definition
threads.cpp:126
Verb_Printf
void Verb_Printf(const verbosityLevel_t importance, const char *format,...) __attribute__((format(__printf__
RunSingleThreadOn
void RunSingleThreadOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
RunThreadsOn
void RunThreadsOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
verbosityLevel_t
verbosityLevel_t
verbosity levels for use in calls to Verb_Printf and on the command line -v <int>
Definition
shared.h:40
VERB_NUM
@ VERB_NUM
Definition
shared.h:48
VERB_NORMAL
@ VERB_NORMAL
Definition
shared.h:45
VERB_SILENT_EXCEPT_ERROR
@ VERB_SILENT_EXCEPT_ERROR
Definition
shared.h:41
VERB_EXTRA
@ VERB_EXTRA
Definition
shared.h:46
VERB_MAPNAME
@ VERB_MAPNAME
Definition
shared.h:43
VERB_LESS
@ VERB_LESS
Definition
shared.h:44
VERB_CHECK
@ VERB_CHECK
Definition
shared.h:42
VERB_DUMP
@ VERB_DUMP
Definition
shared.h:47
baseFilename
char baseFilename[MAX_OSPATH]
Definition
ufo2map.cpp:55
ThreadLock
void ThreadLock(void)
Lock the shared data by the calling thread.
Definition
threads.cpp:112
threadstate
threadstate_t threadstate
Definition
threads.cpp:32
AbortPrint
bool AbortPrint(const verbosityLevel_t importance)
return nonzero if printing should be aborted based on the command line verbosity level and the import...
Definition
ufo2map.cpp:189
Sys_Error
void Sys_Error(const char *error,...) __attribute__((noreturn
typedefs.h
ufotypes.h
Cross-platform type definitions.
vec3_t
vec_t vec3_t[3]
Definition
ufotypes.h:39
unzip.h
src
tools
ufo2map
common
shared.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0