-char *gamedetect_argv_buffer[1024];
-void gamedetect_found_game( char *game, char *path ){
+char const *gamedetect_argv_buffer[1024];
+
+void gamedetect_found_game( char const *game, char *path ){
-bool gamedetect_check_game( char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
+bool gamedetect_check_game( char const *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
void gamedetect(){
// if we're inside a Nexuiz install
// default to nexuiz.game (unless the user used an option to inhibit this)
void gamedetect(){
// if we're inside a Nexuiz install
// default to nexuiz.game (unless the user used an option to inhibit this)
if ( g_argv[i][0] == '-' ) {
if ( !strcmp( g_argv[i], "-gamedetect" ) ) {
nogamedetect = !strcmp( g_argv[i + 1], "false" );
}
++i;
}
if ( g_argv[i][0] == '-' ) {
if ( !strcmp( g_argv[i], "-gamedetect" ) ) {
nogamedetect = !strcmp( g_argv[i + 1], "false" );
}
++i;
}
if ( !nogamedetect ) {
static char buf[1024 + 64];
strncpy( buf, environment_get_app_path(), sizeof( buf ) );
if ( !nogamedetect ) {
static char buf[1024 + 64];
strncpy( buf, environment_get_app_path(), sizeof( buf ) );
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz.exe", buf, p - buf ) )
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz.exe", buf, p - buf ) )
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "Nexuiz.app/Contents/Info.plist", buf, p - buf ) )
#else
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz-linux-glx.sh", buf, p - buf ) )
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "Nexuiz.app/Contents/Info.plist", buf, p - buf ) )
#else
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz-linux-glx.sh", buf, p - buf ) )
/* Now read the symbolic link */
int ret = readlink( LINK_NAME, buf, PATH_MAX );
/* Now read the symbolic link */
int ret = readlink( LINK_NAME, buf, PATH_MAX );
-void environment_init( int argc, char* argv[] ){
+char* openCmdMap;
+
+void cmdMap(){
+ openCmdMap = NULL;
+ for ( int i = 1; i < g_argc; ++i )
+ {
+ if ( !stricmp( g_argv[i] + strlen(g_argv[i]) - 4, ".map" ) ){
+ openCmdMap = g_argv[i];
+ }
+ }
+}
+
+void environment_init( int argc, char const* argv[] ){
if ( !portable_app_setup() ) {
char *appdata = getenv( "APPDATA" );
StringOutputStream home( 256 );
if ( !portable_app_setup() ) {
char *appdata = getenv( "APPDATA" );
StringOutputStream home( 256 );
- if ( !appdata || string_empty( appdata ) ) {
- ERROR_MESSAGE( "Application Data folder not available.\n"
- "Radiant will use C:\\ for user preferences.\n" );
- home << "C:";
- }
- else
- {
- home << PathCleaned( appdata );
- }
+ home << PathCleaned( appdata );