move to a model where there is a sample game and a possible real game

This commit is contained in:
Tuomas Katajisto 2025-10-24 20:43:28 +03:00
parent a0845ed16f
commit 19803720a6
7 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.DS_Store .DS_Store
.build/ .build/
dist/ dist/
game/
first first
packs/* packs/*
first.dSYM/Contents first.dSYM/Contents

View File

@ -1,6 +1,7 @@
#load "./src/meta/meta.jai"; #load "./src/meta/meta.jai";
Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM); Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM);
#import "File_Utilities";
#run { #run {
print("%\n", ascii_car); 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_file("src/platform_specific/main_web.jai", w);
add_build_string("HAS_TACOMA :: false;", w); add_build_string("HAS_TACOMA :: false;", w);
add_build_string("HAS_IPROF :: 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); add_shaders_to_workspace(w);
while true { while true {
@ -157,6 +167,13 @@ Iprof :: #import "Iprof"(IMPORT_MODE = .METAPROGRAM);
} else { } else {
add_build_string("HAS_TACOMA :: false;", w); 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 { if profile {
add_build_string("HAS_IPROF :: true;", w); add_build_string("HAS_IPROF :: true;", w);
iprof_plugin.add_source(iprof_plugin); iprof_plugin.add_source(iprof_plugin);

View File

@ -24,8 +24,12 @@ stbi :: #import "stb_image";
#load "load.jai"; #load "load.jai";
#load "ray.jai"; #load "ray.jai";
#load "world.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; last_frame_time : float64;
delta\ _time : float64; delta\ _time : float64;