diff --git a/.gitignore b/.gitignore index 26a9c1d..97349a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store .build/ dist/ +game/ first packs/* first.dSYM/Contents diff --git a/first.jai b/first.jai index f415eb3..35f5f77 100644 --- a/first.jai +++ b/first.jai @@ -1,6 +1,7 @@ #load "./src/meta/meta.jai"; Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM); +#import "File_Utilities"; #run { print("%\n", ascii_car); @@ -80,6 +81,15 @@ Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM); add_build_file("src/platform_specific/main_web.jai", w); add_build_string("HAS_TACOMA :: false;", w); add_build_string("HAS_IPROF :: false;", w); + + if is_directory("./game") { + add_build_string("USE_SAMPLE_GAME :: false;", w); + } else { + add_build_string("USE_SAMPLE_GAME :: true;", w); + + } + + add_shaders_to_workspace(w); while true { @@ -157,6 +167,13 @@ Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM); } else { add_build_string("HAS_TACOMA :: false;", w); } + + if is_directory("./game") { + add_build_string("USE_SAMPLE_GAME :: false;", w); + } else { + add_build_string("USE_SAMPLE_GAME :: true;", w); + } + if profile { add_build_string("HAS_IPROF :: true;", w); iprof_plugin.add_source(iprof_plugin); diff --git a/game/game.jai b/sample_game/game.jai similarity index 100% rename from game/game.jai rename to sample_game/game.jai diff --git a/game/resources/postprocess.json b/sample_game/resources/postprocess.json similarity index 100% rename from game/resources/postprocess.json rename to sample_game/resources/postprocess.json diff --git a/game/resources/triles.json b/sample_game/resources/triles.json similarity index 100% rename from game/resources/triles.json rename to sample_game/resources/triles.json diff --git a/game/resources/worlds.json b/sample_game/resources/worlds.json similarity index 100% rename from game/resources/worlds.json rename to sample_game/resources/worlds.json diff --git a/src/main.jai b/src/main.jai index b0ffb71..8972f1f 100644 --- a/src/main.jai +++ b/src/main.jai @@ -24,8 +24,12 @@ stbi :: #import "stb_image"; #load "load.jai"; #load "ray.jai"; #load "world.jai"; - -#load "../game/game.jai"; + +#if USE_SAMPLE_GAME { + #load "../sample_game/game.jai"; +} else { + #load "../game/game.jai"; +} last_frame_time : float64; delta\ _time : float64;