UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
shared.h
Go to the documentation of this file.
1 
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 {
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 {
56  int nice;
57  bool verbose;
59  bool noprune;
61  bool nodetail;
62  bool fulldetail;
63  bool onlyents;
65  bool nomerge;
66  bool nowater;
67  bool nocsg;
69  bool noweld;
70  bool noshare;
71  bool nosubdiv;
72  bool notjunc;
74  bool nobackclip;
76  int block_xl, block_xh, block_yl, block_yh;
77  float microvolume;
78  bool extrasamples;
79  bool soft;
80  bool info;
83 
89  bool chkNodraws;
90  bool chkBrushes;
94  bool chkMMicro;
95  bool chkZFight;
96  float mapMicrovol;
97  bool chkAll;
98  bool fixMap;
99  bool stats;
102 
108 
109  char gamedir[MAX_VAR];
110 
111  float saturation;
112  float contrast;
113  float brightness;
116  float entity_scale;
118  int onlynewer;
121 } mapConfig_t;
122 
123 extern mapConfig_t config;
124 extern char baseFilename[MAX_OSPATH];
126 typedef struct threadstate_s {
128  int workindex;
129  int workcount;
130  int workfrac;
131  int worktick;
132  bool progress;
133 } threadstate_t;
134 
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)));
float entity_scale
Definition: shared.h:116
#define __attribute__(x)
Definition: shared.h:58
float saturation
Definition: shared.h:111
bool chkTextures
Definition: shared.h:92
float surface_scale
Definition: shared.h:115
bool chkIntersection
Definition: shared.h:88
int onlynewer
Definition: shared.h:118
byte lightquant
Definition: shared.h:114
bool info
Definition: shared.h:80
bool chkZFight
Definition: shared.h:95
bool soft
Definition: shared.h:79
void RunSingleThreadOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
float subdivideSize
Definition: shared.h:55
bool chkMixedFaceContents
Definition: shared.h:93
#define sun_intensity
Definition: lightmap.cpp:31
bool stats
Definition: shared.h:99
bool generateFootstepFile
Definition: shared.h:81
bool performMapCheck
Definition: shared.h:84
memPool_t * com_genericPool
Definition: common.cpp:73
mapConfig_t config
Definition: ufo2map.cpp:49
#define MAX_OSPATH
Definition: filesys.h:44
bool verbose
Definition: shared.h:57
bool generateTraceFile
Definition: shared.h:100
int workfrac
Definition: shared.h:130
verbosityLevel_t
verbosity levels for use in calls to Verb_Printf and on the command line -v ...
Definition: shared.h:40
bool nobackclip
Definition: shared.h:74
bool nocsg
Definition: shared.h:67
bool chkMMicro
Definition: shared.h:94
int block_yl
Definition: shared.h:76
void ThreadUnlock(void)
Release the lock on the shared data.
Definition: threads.cpp:126
struct threadstate_s threadstate_t
bool chkAll
Definition: shared.h:97
#define sun_angles
Definition: lightmap.cpp:28
bool nowater
Definition: shared.h:66
bool fixMap
Definition: shared.h:98
#define MAX_VAR
Definition: shared.h:36
bool generateMaterialFile
Definition: shared.h:82
bool onlyents
Definition: shared.h:63
bool chkNodraws
Definition: shared.h:89
bool chkBrushes
Definition: shared.h:90
bool extrasamples
Definition: shared.h:78
#define sun_normal
Definition: lightmap.cpp:29
void format(__printf__, 3, 4)))
threadstate_t
Definition: cl_renderer.h:209
threadstate_t threadstate
Definition: threads.cpp:32
bool nosubdiv
Definition: shared.h:71
int numthreads
Definition: shared.h:127
bool nomerge
Definition: shared.h:65
float mapMicrovol
Definition: shared.h:96
float microvolume
Definition: shared.h:77
bool progress
Definition: shared.h:132
void Verb_Printf(const verbosityLevel_t importance, const char *format,...) __attribute__((format(__printf__
bool noprune
Definition: shared.h:59
int nolighting
Definition: shared.h:75
bool fulldetail
Definition: shared.h:62
bool exportLightmaps
Definition: shared.h:64
int compile_for_day
Definition: shared.h:120
void RunThreadsOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
void ThreadLock(void)
Lock the shared data by the calling thread.
Definition: threads.cpp:112
int workcount
Definition: shared.h:129
bool generateDebugTrace
Definition: shared.h:101
bool chkLevelFlags
Definition: shared.h:91
bool chkContained
Definition: shared.h:86
int nice
Definition: shared.h:56
float contrast
Definition: shared.h:112
int workindex
Definition: shared.h:128
#define sun_ambient_color
Definition: lightmap.cpp:32
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
bool chkEntities
Definition: shared.h:85
bool verboseentities
Definition: shared.h:73
float brightness
Definition: shared.h:113
vec_t vec3_t[3]
Definition: ufotypes.h:39
memPool_t * com_fileSysPool
Definition: common.cpp:72
#define LIGHTMAP_MAX
Definition: defines.h:365
bool chkFillLevelFlags
Definition: shared.h:87
bool noweld
Definition: shared.h:69
uint8_t byte
Definition: ufotypes.h:34
bool nodetail
Definition: shared.h:61
bool notjunc
Definition: shared.h:72
int worktick
Definition: shared.h:131
char baseFilename[MAX_OSPATH]
Definition: ufo2map.cpp:55
void Sys_Error(const char *error,...) __attribute__((noreturn
bool noshare
Definition: shared.h:70
verbosityLevel_t verbosity
Definition: shared.h:58
#define sun_color
Definition: lightmap.cpp:30
void Com_Printf(const char *fmt,...) __attribute__((format(__printf__
void struct mapConfig_s mapConfig_t