mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
* initial commit * initial commit * add port files * ios: Changes to allow creating app bundle without xcode projects * ios: Added mic perms request * ios: Very basic app bundle creation script * ios: Fix -log parameter * ios: Sdk no longer hardcoded and option to compile for simulator * general: Update gitignore * ios: Enable game mode for the app * ios: Compile instructions and updated ipa creation script * ios: Code cleanup * ios: Remove dylibs * general: Remove extra submodules * ios: Remove dylibs again * ios: Implement suggested changes * ios: Fix building as dylib instead of binary * ios: Scripts for building mods * ios: Move 'ios' contents to engine/platform/ios/bundle and modify scripts * ios: Update createipa.sh to use waf install * ios: Clean script and updated README * general: Fix spelling mistake and outdated instructions * ios: Clean up in xcompile.py * ios: Fix createipa.sh generating an invalid ipa * ios: Temporary fix for launch dialog textfield colors in dark mode
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
/*
|
|
launcher.c - direct xash3d launcher
|
|
Copyright (C) 2015 Mittorn
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
*/
|
|
|
|
#if XASH_ENABLE_MAIN
|
|
#include "build.h"
|
|
#include "common.h"
|
|
|
|
#if XASH_SDLMAIN
|
|
#include <SDL.h>
|
|
#endif
|
|
|
|
#if XASH_EMSCRIPTEN
|
|
#include <emscripten.h>
|
|
#endif
|
|
|
|
#ifndef XASH_GAMEDIR
|
|
#define XASH_GAMEDIR "valve" // !!! Replace with your default (base) game directory !!!
|
|
#endif
|
|
|
|
#if XASH_WIN32
|
|
#error "Single-binary or dedicated builds aren't supported for Windows!"
|
|
#endif
|
|
|
|
static char szGameDir[128]; // safe place to keep gamedir
|
|
static int szArgc;
|
|
static char **szArgv;
|
|
|
|
static void Sys_ChangeGame( const char *progname )
|
|
{
|
|
// stub
|
|
}
|
|
|
|
static int Sys_Start( void )
|
|
{
|
|
Q_strncpy( szGameDir, XASH_GAMEDIR, sizeof( szGameDir ));
|
|
|
|
#if XASH_EMSCRIPTEN
|
|
#if !XASH_DEDICATED
|
|
EM_ASM( try {
|
|
FS.mkdir( '/rwdir' );
|
|
FS.mount( IDBFS, { root: '.' }, '/rwdir' );
|
|
} catch( e ) { };);
|
|
#else // XASH_DEDICATED
|
|
EM_ASM(try {
|
|
FS.mkdir( '/xash' );
|
|
FS.mount( NODEFS, { root: '.'}, '/xash' );
|
|
} catch( e ) { };);
|
|
#endif // XASH_DEDICATED
|
|
#endif // XASH_EMSCRIPTEN
|
|
|
|
#if XASH_IOS
|
|
IOS_LaunchDialog();
|
|
szArgc = IOS_GetArgs( &szArgv );
|
|
#endif // XASH_IOS
|
|
|
|
return Host_Main( szArgc, szArgv, szGameDir, 0, Sys_ChangeGame );
|
|
}
|
|
|
|
int main( int argc, char **argv )
|
|
{
|
|
#if XASH_PSVITA
|
|
// inject -dev -console into args if required
|
|
szArgc = PSVita_GetArgv( argc, argv, &szArgv );
|
|
#else
|
|
szArgc = argc;
|
|
szArgv = argv;
|
|
#endif // XASH_PSVITA
|
|
return Sys_Start();
|
|
}
|
|
#endif // XASH_ENABLE_MAIN
|