shared.h
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SHARED_H
00026 #define _SHARED_H
00027
00028 #include "../../../shared/ufotypes.h"
00029 #include "../../../common/unzip.h"
00030 #include "../../../common/mem.h"
00031 #include "../../../common/filesys.h"
00032 #include "../../../shared/shared.h"
00033 #include "../../../shared/mathlib.h"
00034 #include "../../../shared/defines.h"
00035 #include "../../../shared/typedefs.h"
00036 #include "../../../shared/byte.h"
00037
00038 #ifndef errno
00039 extern int errno;
00040 #endif
00041
00042
00043
00044
00045
00048 typedef enum {
00049 VERB_SILENT_EXCEPT_ERROR,
00050 VERB_CHECK,
00051 VERB_MAPNAME,
00052 VERB_LESS,
00053 VERB_NORMAL,
00054 VERB_EXTRA,
00055 VERB_DUMP,
00056 VERB_NUM
00057 } verbosityLevel_t;
00058
00059 qboolean AbortPrint(const verbosityLevel_t importance);
00060 void Verb_Printf(const verbosityLevel_t importance, const char *format, ...) __attribute__((format(printf, 2, 3)));
00061
00062 typedef struct mapConfig_s {
00063 float subdivideSize;
00064 int nice;
00065 qboolean verbose;
00066 verbosityLevel_t verbosity;
00067 qboolean noprune;
00068 qboolean nodetail;
00069 qboolean fulldetail;
00070 qboolean onlyents;
00071 qboolean exportLightmaps;
00072 qboolean nomerge;
00073 qboolean nowater;
00074 qboolean nocsg;
00075 qboolean noweld;
00076 qboolean noshare;
00077 qboolean nosubdiv;
00078 qboolean notjunc;
00079 qboolean verboseentities;
00080 qboolean nobackclip;
00081 int nolighting;
00082 int block_xl, block_xh, block_yl, block_yh;
00083 float microvolume;
00084 qboolean extrasamples;
00085 qboolean info;
00086 qboolean generateFootstepFile;
00087 qboolean generateMaterialFile;
00088
00089 qboolean performMapCheck;
00090 qboolean chkEntities;
00091 qboolean chkContained;
00092 qboolean chkFillLevelFlags;
00093 qboolean chkIntersection;
00094 qboolean chkNodraws;
00095 qboolean chkBrushes;
00096 qboolean chkLevelFlags;
00097 qboolean chkTextures;
00098 qboolean chkMixedFaceContents;
00099 qboolean chkMMicro;
00100 qboolean chkZFight;
00101 float mapMicrovol;
00102 qboolean chkAll;
00103 qboolean fixMap;
00104 qboolean stats;
00105 qboolean generateTraceFile;
00106 qboolean generateDebugTrace;
00107
00108 int sun_intensity[LIGHTMAP_MAX];
00109 vec3_t sun_ambient_color[LIGHTMAP_MAX];
00110 vec3_t sun_color[LIGHTMAP_MAX];
00111 vec3_t sun_angles[LIGHTMAP_MAX];
00112 vec3_t sun_normal[LIGHTMAP_MAX];
00113
00114 float saturation;
00115 float contrast;
00116 float brightness;
00117 byte lightquant;
00118 float surface_scale;
00119 float entity_scale;
00121 int onlynewer;
00123 int compile_for_day;
00124 } mapConfig_t;
00125
00126 extern mapConfig_t config;
00127 extern char baseFilename[MAX_OSPATH];
00129 typedef struct threadstate_s {
00130 int numthreads;
00131 int workindex;
00132 int workcount;
00133 int workfrac;
00134 int worktick;
00135 qboolean progress;
00136 } threadstate_t;
00137
00138 extern threadstate_t threadstate;
00139
00140 extern memPool_t *com_genericPool;
00141 extern memPool_t *com_fileSysPool;
00142
00143 void ThreadLock(void);
00144 void ThreadUnlock(void);
00145 void RunThreadsOn(void (*func)(unsigned int), unsigned int workcount, qboolean progress, const char *id);
00146 void RunSingleThreadOn(void (*func)(unsigned int), unsigned int workcount, qboolean progress, const char *id);
00147
00148 #define SYS_VRB 0
00149 #define SYS_STD 1
00150 #define SYS_WRN 2
00151 #define SYS_ERR 3
00152
00153 void Sys_Error(const char *error, ...) __attribute__((noreturn, format(printf, 1, 2)));
00154 void Com_Printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
00155
00156 #endif