1 #include "vg/vg_platform.h"
4 #include "vg/vg_build.h"
5 #include "vg/vg_build_utils_shader.h"
8 u32 optimize_test_compile
= 0;
11 * Compilation specifications
12 * -------------------------------------------------------------------------- */
14 void build_game_content( struct vg_project
*proj
)
16 vg_project_new_target( proj
, "Content files", k_obj_type_none
);
17 vg_symlink( proj
, "textures_qoi", "textures" );
18 vg_symlink( proj
, "maps", "maps" );
19 vg_symlink( proj
, "sound", "sound" );
20 vg_syscall( "mkdir -p bin/%s/cfg", proj
->uid
.buffer
);
21 vg_syscall( "mkdir -p bin/%s/sav", proj
->uid
.buffer
);
24 void build_shaders(void);
25 void build_game_bin( struct vg_project
*proj
)
34 vg_project_new_target( proj
, "fishladder", k_obj_type_exe
);
35 vg_add_engine( proj
, &(struct vg_engine_config
)
37 .fixed_update_hz
= 60,
38 .legacy_support_vg_msg1
= 0,
42 .custom_game_settings
= 1,
46 vg_add_source( proj
, "marblecomp.c" );
47 vg_compile_project( proj
);
52 * -------------------------------------------------------------------------- */
54 void s_release_all(void){
55 vg_info( "running script: s_release_all(void)\n" );
57 struct vg_project linux_proj
, windows_proj
;
59 struct vg_env env
= vg_release_env
;
60 env
.platform
= k_platform_linux
;
61 vg_project_init( &linux_proj
, &env
, "marblecomp" );
62 build_game_content( &linux_proj
);
63 build_game_bin( &linux_proj
);
66 env
.platform
= k_platform_windows
;
67 vg_project_init( &windows_proj
, &env
, "marblecomp" );
68 build_game_content( &windows_proj
);
69 build_game_bin( &windows_proj
);
71 vg_tarball_project( &linux_proj
);
72 vg_tarball_project( &windows_proj
);
75 void s_testing_build(void){
76 vg_info( "running script: s_testing_build(void)\n" );
78 struct vg_project test_proj
;
79 vg_project_init( &test_proj
, &vg_test_env
, "marblecomp-test" );
81 build_game_content( &test_proj
);
82 build_game_bin( &test_proj
);
85 int main( int argc
, char *argv
[] ){
87 while( vg_argp( argc
, argv
) ){
88 if( vg_long_opt( "release-all" ) )
91 if( vg_long_opt( "testing-build" ) )
95 vg_test_env
.optimization
= 3;
98 vg_success( "All scripts ran successfully\n" );
101 #define _S( NAME, VS, FS ) \
102 vg_build_shader( "shaders/" VS, "shaders/" FS, NULL, "shaders", NAME )
104 void build_shaders(void){
105 vg_info( "Compiling shader headers\n" );
106 vg_shader_set_include_dir( "shaders" );
109 _S( "tile_colour", "tile_colour.vs.glsl", "tile_colour.fs.glsl" );
110 _S( "tile_main", "tile_main.vs.glsl", "tile_main.fs.glsl" );
111 _S( "ball", "ball.vs.glsl", "ball.fs.glsl" );
112 _S( "background", "background.vs.glsl", "background.fs.glsl" );
113 _S( "wire", "wire.vs.glsl", "wire.fs.glsl" );
114 _S( "button", "button.vs.glsl", "button.fs.glsl" );
115 _S( "sprite", "sprite.vs.glsl", "sprite.fs.glsl" );
116 _S( "post_darken", "post_darken.vs.glsl", "post_darken.fs.glsl" );
117 _S( "post_comp", "post_comp.vs.glsl", "post_comp.fs.glsl" );
118 _S( "post_blur", "post_blur.vs.glsl", "post_blur.fs.glsl" );
120 vg_build_shader_impl( "shaders/impl.c" );