UFO: Alien Invasion
shared.h
Go to the documentation of this file.
1
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, 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
40typedef enum {
50
51bool AbortPrint(const verbosityLevel_t importance);
52void Verb_Printf(const verbosityLevel_t importance, const char *format, ...) __attribute__((format(__printf__, 2, 3)));
53
54typedef struct mapConfig_s {
56 int nice;
57 bool verbose;
59 bool noprune;
61 bool nodetail;
63 bool onlyents;
65 bool nomerge;
66 bool nowater;
67 bool nocsg;
69 bool noweld;
70 bool noshare;
71 bool nosubdiv;
72 bool notjunc;
76 int block_xl, block_xh, block_yl, block_yh;
79 bool soft;
80 bool info;
83
97 bool chkAll;
98 bool fixMap;
99 bool stats;
102
108
109 char gamedir[MAX_VAR];
110
112 float contrast;
122
123extern mapConfig_t config;
124extern char baseFilename[MAX_OSPATH];
126typedef struct threadstate_s {
132 bool progress;
134
136
139
140void ThreadLock(void);
141void ThreadUnlock(void);
142void RunThreadsOn(void (*func)(unsigned int), unsigned int workcount, bool progress, const char *id);
143void 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
150void Sys_Error(const char *error, ...) __attribute__((noreturn, format(__printf__, 1, 2)));
151void Com_Printf(const char *format, ...) __attribute__((format(__printf__, 1, 2)));
threadstate_t
Definition: cl_renderer.h:209
#define LIGHTMAP_MAX
Definition: defines.h:365
#define MAX_OSPATH
Definition: filesys.h:44
#define sun_normal
Definition: lightmap.cpp:29
#define sun_angles
Definition: lightmap.cpp:28
#define sun_intensity
Definition: lightmap.cpp:31
#define sun_color
Definition: lightmap.cpp:30
#define sun_ambient_color
Definition: lightmap.cpp:32
void format(__printf__, 3, 4)))
#define __attribute__(x)
Definition: shared.h:58
void Com_Printf(const char *fmt,...) __attribute__((format(__printf__
#define MAX_VAR
Definition: shared.h:36
bool noshare
Definition: shared.h:70
bool chkFillLevelFlags
Definition: shared.h:87
int nice
Definition: shared.h:56
bool chkContained
Definition: shared.h:86
float entity_scale
Definition: shared.h:116
bool nobackclip
Definition: shared.h:74
bool nosubdiv
Definition: shared.h:71
bool fulldetail
Definition: shared.h:62
bool chkMixedFaceContents
Definition: shared.h:93
bool performMapCheck
Definition: shared.h:84
bool chkLevelFlags
Definition: shared.h:91
byte lightquant
Definition: shared.h:114
bool verbose
Definition: shared.h:57
float subdivideSize
Definition: shared.h:55
bool nomerge
Definition: shared.h:65
float contrast
Definition: shared.h:112
bool chkNodraws
Definition: shared.h:89
float surface_scale
Definition: shared.h:115
bool exportLightmaps
Definition: shared.h:64
bool extrasamples
Definition: shared.h:78
bool info
Definition: shared.h:80
verbosityLevel_t verbosity
Definition: shared.h:58
bool nowater
Definition: shared.h:66
bool noweld
Definition: shared.h:69
float brightness
Definition: shared.h:113
int compile_for_day
Definition: shared.h:120
bool generateMaterialFile
Definition: shared.h:82
bool notjunc
Definition: shared.h:72
int block_xh
Definition: shared.h:76
bool nocsg
Definition: shared.h:67
bool chkMMicro
Definition: shared.h:94
float mapMicrovol
Definition: shared.h:96
float microvolume
Definition: shared.h:77
float saturation
Definition: shared.h:111
bool noprune
Definition: shared.h:59
bool onlyents
Definition: shared.h:63
bool fixMap
Definition: shared.h:98
bool chkTextures
Definition: shared.h:92
bool stats
Definition: shared.h:99
bool chkAll
Definition: shared.h:97
bool chkZFight
Definition: shared.h:95
int nolighting
Definition: shared.h:75
bool chkBrushes
Definition: shared.h:90
bool generateDebugTrace
Definition: shared.h:101
bool generateTraceFile
Definition: shared.h:100
bool soft
Definition: shared.h:79
int onlynewer
Definition: shared.h:118
bool verboseentities
Definition: shared.h:73
bool chkIntersection
Definition: shared.h:88
bool chkEntities
Definition: shared.h:85
bool generateFootstepFile
Definition: shared.h:81
bool nodetail
Definition: shared.h:61
int workindex
Definition: shared.h:128
int workfrac
Definition: shared.h:130
int workcount
Definition: shared.h:129
bool progress
Definition: shared.h:132
int numthreads
Definition: shared.h:127
int worktick
Definition: shared.h:131
void ThreadUnlock(void)
Release the lock on the shared data.
Definition: threads.cpp:126
void Verb_Printf(const verbosityLevel_t importance, const char *format,...) __attribute__((format(__printf__
void RunSingleThreadOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
void RunThreadsOn(void(*func)(unsigned int), unsigned int workcount, bool progress, const char *id)
verbosityLevel_t
verbosity levels for use in calls to Verb_Printf and on the command line -v <int>
Definition: shared.h:40
@ VERB_NUM
Definition: shared.h:48
@ VERB_NORMAL
Definition: shared.h:45
@ VERB_SILENT_EXCEPT_ERROR
Definition: shared.h:41
@ VERB_EXTRA
Definition: shared.h:46
@ VERB_MAPNAME
Definition: shared.h:43
@ VERB_LESS
Definition: shared.h:44
@ VERB_CHECK
Definition: shared.h:42
@ VERB_DUMP
Definition: shared.h:47
char baseFilename[MAX_OSPATH]
Definition: ufo2map.cpp:55
void ThreadLock(void)
Lock the shared data by the calling thread.
Definition: threads.cpp:112
threadstate_t threadstate
Definition: threads.cpp:32
memPool_t * com_genericPool
Definition: common.cpp:73
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
memPool_t * com_fileSysPool
Definition: common.cpp:72
mapConfig_t config
Definition: ufo2map.cpp:49
void Sys_Error(const char *error,...) __attribute__((noreturn
vec_t vec3_t[3]
Definition: ufotypes.h:39