From: Thomas Debesse Date: Tue, 21 Jun 2022 04:10:48 +0000 (+0200) Subject: Merge commit 'ddee6cbe7c5fcbba52e7881a411f310809b867f9' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7bfd2b428ff9b8e49c2291fa94163e293d364de6;p=xonotic%2Fnetradiant.git Merge commit 'ddee6cbe7c5fcbba52e7881a411f310809b867f9' into master-merge --- 7bfd2b428ff9b8e49c2291fa94163e293d364de6 diff --cc tools/quake3/q3map2/light_bounce.c index e7384290,c8181212..8cd6dead --- a/tools/quake3/q3map2/light_bounce.c +++ b/tools/quake3/q3map2/light_bounce.c @@@ -586,10 -582,14 +588,13 @@@ static void RadSubdivideDiffuseLight( i 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; diff --cc tools/quake3/q3map2/path_init.c index 9bc5dd34,66f256b4..c9f26b32 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@@ -323,51 -315,22 +324,51 @@@ void AddHomeBasePath( char *path ) /* -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 */ diff --cc tools/quake3/q3map2/q3map2.h index 720dec29,a230dd00..e644cc8b --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@@ -1879,9 -1860,14 +1879,14 @@@ int ImportLight 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 );