move audio comp to its own thing
[carveJwlIkooP6JGAAIwe30JlM.git] / build.c
diff --git a/build.c b/build.c
index 4cf3b34c3e017dc07701bd133e99a56a82ac43c6..4fff0d3c070b4d27ee48e30450ae46f6a05178f9 100644 (file)
--- a/build.c
+++ b/build.c
@@ -14,6 +14,8 @@
  */
 
 int compiled_something = 0;
+int content_enabled = 1;
+int binary_enabled = 1;
 
 /* old highscores server */
 void build_server( enum compiler compiler ){
@@ -107,21 +109,21 @@ void write_generic_addon_inf( u32 type, const char *title,
 }
 
 void build_shaders(void);
-void build_game( enum compiler compiler ){
+void build_game_binary( enum compiler compiler ){
    static int shaders_built = 0;
    if( !shaders_built ){
       shaders_built = 1;
       build_shaders();
    }
 
-   vg_build_start( "skaterift", compiler );
    vg_build_object( "skaterift.c " );
    vg_build_add_link_for_graphics();
    vg_build_add_link_for_game();
-
    vg_build_copy_graphics_dependencies();
    vg_build_copy_game_dependencies();
+}
 
+void build_game_content( enum compiler compiler ){
    vg_build_symbolic_link( "textures_src", "textures" );
    vg_build_symbolic_link( "models_src", "models" );
    vg_build_symbolic_link( "boards_src", "boards" );
@@ -130,7 +132,6 @@ void build_game( enum compiler compiler ){
    vg_build_symbolic_link( "playermodels_src", "playermodels" );
    vg_build_syscall( "mkdir -p %s/cfg", vg_compiler.build_dir );
    vg_build_syscall( "mkdir -p %s/savedata", vg_compiler.build_dir );
-
    vg_build_syscall( "mkdir -p %s/tools", vg_compiler.build_dir );
    vg_build_syscall( "cp blender_export.py %s/tools/", vg_compiler.build_dir );
 
@@ -168,8 +169,19 @@ void build_game( enum compiler compiler ){
    write_generic_addon_inf( k_addon_type_player,
                             "Aaron", "ch_aaron.mdl",
                             "playermodels_src/skaterift_aaron/addon.inf" );
+}
+
+void build_game( enum compiler compiler ){
+   vg_build_start( "skaterift", compiler );
+
+   if( binary_enabled ){
+      build_game_binary( compiler );
+      vg_build();
+   }
+
+   if( content_enabled )
+      build_game_content( compiler );
 
-   vg_build();
    compiled_something = 1;
 }
 
@@ -199,6 +211,9 @@ int main( int argc, char *argv[] ){
       if( vg_long_opt( "clang-aadb-edit" ) )
          build_aadb_edit( k_compiler_clang );
 
+      if( vg_long_opt( "clang-demo" ) )
+         build_game( k_compiler_clang );
+
       if( vg_long_opt( "clean" ) )
          vg_build_clean();
 
@@ -211,6 +226,15 @@ int main( int argc, char *argv[] ){
       if( vg_long_opt( "mingw" ) )
          build_game( k_compiler_mingw );
 
+      if( vg_long_opt( "none" ) )
+         build_game( k_compiler_none );
+
+      if( (arg=vg_long_opt_arg( "content" )) )
+         content_enabled = atoi(arg);
+
+      if( (arg=vg_long_opt_arg( "binary" )) )
+         binary_enabled = atoi(arg);
+
       if( vg_opt('p') || vg_long_opt("run") ){
          chdir( vg_compiler.build_dir );
          if( vg_compiler.compiler == k_compiler_mingw )
@@ -223,15 +247,17 @@ int main( int argc, char *argv[] ){
       if( vg_long_opt( "tar" ) || vg_opt( 't' ) ){
          vg_build_syscall( "mkdir -p dist" );
          if( compiled_something )
-            vg_build_syscall( "tar -chzvf dist/%s-%u.tar.gz %s", 
-                              vg_compiler.name, uid, vg_compiler.build_dir );
+            vg_build_syscall( "tar -chzvf dist/%s-%u-%s.tar.gz %s", 
+                              vg_compiler.name, uid, vg_compiler_str(),
+                              vg_compiler.build_dir );
       }
 
       if( vg_long_opt( "zip" ) || vg_opt( 'z' ) ){
          vg_build_syscall( "mkdir -p dist" );
          if( compiled_something )
             vg_build_syscall( "zip -r9 dist/%s-%u.zip %s", 
-                              vg_compiler.name, uid, vg_compiler.build_dir );
+                              vg_compiler.name, uid, vg_compiler_str(),
+                              vg_compiler.build_dir );
       }
    }
 }
@@ -245,11 +271,12 @@ void build_shaders(void){
    /* Scene */
    _S( "scene_standard",            "scene.vs", "scene_standard.fs" );
    _S( "scene_standard_alphatest",  "scene.vs", "scene_standard_alphatest.fs" );
+   _S( "scene_foliage",             "scene_foliage.vs", "scene_foliage.fs" );
    _S( "scene_override",            "scene_override.vs", "scene_override.fs" );
    _S( "scene_fxglow",              "scene_fxglow.vs", "scene_fxglow.fs" );
    _S( "scene_vertex_blend",        "scene.vs", "scene_vertex_blend.fs" );
    _S( "scene_terrain",             "scene.vs", "scene_terrain.fs" );
-   _S( "scene_route",               "scene.vs", "scene_route.fs" );
+   _S( "scene_route",               "scene_override.vs", "scene_route.fs" );
    _S( "scene_depth",               "scene.vs", "scene_depth.fs" );
    _S( "scene_position",            "scene.vs", "scene_position.fs" );
    _S( "scene_cubemapped",          "scene.vs", "scene_cubemapped.fs" );
@@ -265,15 +292,18 @@ void build_shaders(void){
    _S( "model_character_view", "model_skinned.vs", "model_character_view.fs" );
    _S( "model_board_view",     "model.vs",         "model_character_view.fs" );
    _S( "model_entity",         "model.vs",         "model_entity.fs" );
-   _S( "model_gate",           "model_gate.vs",    "model_gate_lq.fs" );
+   _S( "model_gate",           "model.vs",         "model_gate_lq.fs" );
+   _S( "model_gate_unlinked",  "model.vs",         "model_gate_unlinked.fs" );
    _S( "model_font",           "model_font.vs",    "model_font.fs" );
 
    /* Pointcloud */
-   _S( "point_map", "cloud.vs", "cloud.fs" );
+   //_S( "point_map", "cloud.vs", "cloud.fs" );
+   _S( "particle", "particle.vs", "particle.fs" );
 
    /* 2D */
    _S( "blit",      "blit.vs",      "blit.fs" );
    _S( "blitblur",  "blit.vs",      "blitblur.fs" );
    _S( "blitcolour","blit.vs",      "colour.fs" );
+   _S( "blit_transition", "blit.vs", "blit_transition.fs" );
    _S( "routeui",   "routeui.vs",   "routeui.fs" );
 }