VectorMA( light->origin, 1.0f, light->normal, light->origin );
light->dist = DotProduct( light->origin, normal );
- /* optionally create a point backsplash light for first pass */
- if ( original && si->backsplashFraction > 0 ) {
+ #if 0
+ /* optionally create a point backsplash light */
+ if ( si->backsplashFraction > 0 ) {
+
/* allocate a new point light */
- splash = safe_malloc( sizeof( *splash ) );
- memset( splash, 0, sizeof( *splash ) );
+ splash = safe_malloc0( sizeof( *splash ) );
+
splash->next = lights;
lights = splash;
/* -fs_homebase . means that -fs_home is to be used as is */
strcpy( temp, homePath );
}
- else if ( homePathLen >= 2 && !strcmp( homePath + homePathLen - 2, "/." ) ) {
- /* remove trailing /. of homePath */
- homePathLen -= 2;
+ else {
+ char *tempHomePath;
+ tempHomePath = homePath;
- /* concatenate home dir and path */
- sprintf( temp, "%.*s/%s", homePathLen, homePath, path );
+ /* homePath is . on Windows if not user supplied */
+
+ #if GDEF_OS_MACOS
+ /*
+ use ${HOME}/Library/Application as ${HOME}
+ if home path is not user supplied
+ and strip the leading dot from prefix in any case
+
+ basically it produces
+ ${HOME}/Library/Application/unvanquished
+ /user/supplied/home/path/unvanquished
+ */
+ tempHomePath = macLibraryApplicationSupportPath;
+ path = path + 1;
+ #elif GDEF_OS_XDG
+ /*
+ on Linux, check if game uses ${XDG_DATA_HOME}/prefix instead of ${HOME}/.prefix
+ if yes and home path is not user supplied
+ use XDG_DATA_HOME instead of HOME
+ and strip the leading dot
+
+ basically it produces
+ ${XDG_DATA_HOME}/unvanquished
+ /user/supplied/home/path/unvanquished
+
+ or
+ ${HOME}/.q3a
+ /user/supplied/home/path/.q3a
+ */
+
+ sprintf( temp, "%s/%s", xdgDataHomePath, ( path + 1 ) );
+ if ( access( temp, X_OK ) == 0 ) {
+ if ( customHomePath == qfalse ) {
+ tempHomePath = xdgDataHomePath;
- }
+ }
- else
- {
- /* remove leading . of path */
- if ( path[0] == '.' ) {
- ++path;
+ path = path + 1;
}
+ #endif // GDEF_OS_XDG
/* concatenate home dir and path */
- sprintf( temp, "%s/%s", homePath, path );
+ sprintf( temp, "%s/%s", tempHomePath, path );
}
/* make a hole */
void SetupSurfaceLightmaps( void );
void StitchSurfaceLightmaps( void );
-void StoreSurfaceLightmaps( qboolean fastAllocate );
+void StoreSurfaceLightmaps( qboolean fastAllocate, qboolean storeForReal );
+ /* exportents.c */
+ void ExportEntities( void );
+ int ExportEntitiesMain( int argc, char **argv );
+
+
/* exportents.c */
void ExportEntities( void );
int ExportEntitiesMain( int argc, char **argv );