+ write_generic_addon_inf( k_addon_type_player,
+ "Chip", "ch_chip.mdl",
+ "playermodels_src/skaterift_chip/addon.inf" );
+ write_generic_addon_inf( k_addon_type_player,
+ "Aaron", "ch_aaron.mdl",
+ "playermodels_src/skaterift_aaron/addon.inf" );
+}
+
+void build_game_content(void){
+ vg_low( "Building game content structure\n" );
+ const char *project_name = vg_build.project_name.buffer;
+ vg_symlink( "textures_src", "textures" );
+ vg_symlink( "models_src", "models" );
+ vg_symlink( "boards_src", "boards" );
+ vg_symlink( "maps_src", "maps" );
+ vg_symlink( "sound_src", "sound" );
+ vg_symlink( "playermodels_src", "playermodels" );
+ vg_syscall( "mkdir -p bin/%s/cfg", project_name );
+ vg_syscall( "mkdir -p bin/%s/savedata", project_name );
+ vg_syscall( "mkdir -p bin/%s/tools", project_name );
+ vg_syscall( "cp blender_export.py bin/%s/tools/", project_name );
+}
+
+void build_shaders(void);
+void compile_game( int binaries, int content ){
+ static int meta = 0;
+ if( !meta ){
+ meta = 1;
+ build_shaders();
+ build_game_metadata();
+ vg_low( "\n\n" );
+ }
+
+ vg_build_new( "skaterift" );
+
+ if( binaries ){
+ vg_add_source( "skaterift.c" );
+ vg_add_graphics();
+ vg_add_game_stuff();
+ vg_compile( "skaterift" );
+ }
+
+ if( content )
+ build_game_content();
+}
+
+void compile_sqlite_obj(void){
+ vg_build_new( "sqlite3.o" );
+ vg_add_source( "-c dep/sqlite3/sqlite3.c " );
+ vg_link( "-ldl " );
+ vg_compile( "sqlite3.o" );
+}
+
+void compile_server(void){
+ vg_build_new( "skaterift_server" );
+ vg_add_source( "gameserver.c" );
+ vg_add_source( "bin/sqlite3.o-linux-x86_64-clang/sqlite3.o" );
+ vg_include_dir( "-I./dep " );
+ vg_library_dir( "-L./vg/dep/steam " );
+ vg_link( "-ldl -lpthread -lm -lsdkencryptedappticket -lsteam_api " );
+ vg_add_blob( "vg/dep/steam/libsteam_api.so", "" );
+ vg_add_blob( "vg/dep/steam/libsdkencryptedappticket.so", "" );
+ vg_compile( "server" );
+}
+
+/*
+ * Scripts
+ * -------------------------------------------------------------------------- */
+
+void s_release_all(void){
+ vg_info( "running script: s_release_all(void)\n" );
+
+ vg_build.optimization = 3;
+ vg_build.fresh = 1;
+ vg_build.arch = k_architecture_x86_64;
+ vg_build.compiler = k_compiler_zigcc;
+ vg_build.libc = k_libc_version_2_23;
+
+ /* binaries for windows and linux */
+ vg_build.platform = k_platform_windows;
+ compile_game( 1, 0 );
+ vg_tarball_last_project(); /* windows binary depot: 2103942 */
+ vg_success( "Completed 1/3\n" );
+
+ vg_build.platform = k_platform_linux;
+ compile_game( 1, 0 );
+ vg_tarball_last_project(); /* linux binary depot: 2103941 */
+ vg_success( "Completed 2/3\n" );
+
+ /* content files for any platform */
+ vg_build.platform = k_platform_anyplatform;
+ vg_build.compiler = k_compiler_blob;
+ vg_build.arch = k_architecture_anyarch;
+ vg_build.libc = k_libc_version_native;
+ compile_game( 0, 1 );
+ vg_tarball_last_project(); /* content depot: 2103943 */
+ vg_success( "Completed 3/3\n" );
+
+ /* TODO: DRM thingy? */
+}
+
+void s_testing_build(void){
+ vg_info( "running script: s_testing_build(void)\n" );