From: hgn Date: Tue, 9 Aug 2022 10:32:04 +0000 (+0100) Subject: improved build X-Git-Url: https://skaterift.com/git/?a=commitdiff_plain;h=b8ce05b34d018f52a190b6be837f9693a983b771;p=carveJwlIkooP6JGAAIwe30JlM.git improved build --- diff --git a/.gitignore b/.gitignore index b02fe58..988d57d 100755 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,9 @@ * !*/ -build.linux/ -build.win32/ +bin/ restricted/ -.temp_textures/ +dist/ # ALLOW ============================ !.gitattributes diff --git a/build.sh b/build.sh index 26b2fe1..d7ea276 100755 --- a/build.sh +++ b/build.sh @@ -8,14 +8,14 @@ _linux_compiler="gcc -std=c99 -D_REENTRANT" _linux_linkgraphics="-lGL -lglfw3 -lX11 -lXxf86vm -lXrandr -lm -pthread -lXi -ldl" _linux_asan="-fsanitize=address" _linux_linksteam="-lsteam_api" -_linux_folder="build.linux" -_linux_server_folder="build.linux_server" +_linux_folder="bin/linux" +_linux_server_folder="bin/linux_server" _windows_compiler="i686-w64-mingw32-gcc" _windows_linkgraphics="-lglfw3dll -lopengl32 -lm -mwindows" _windows_asan="" _windows_linksteam="vg/dep/steam/steam_api.dll" -_windows_folder="build.win32" +_windows_folder="bin/win32" _options_debugmode="-O0 -ggdb3 -fno-omit-frame-pointer" _options_release="-O3 -DVG_RELEASE" @@ -32,17 +32,6 @@ _ext="" # Compile scripts # ============================================================================== -release(){ - _linux_options=$_options_release - _windows_options=$_options_release -} - -debug(){ - _linux_options="$_linux_asan $_options_debugmode" - _windows_options="$_windows_asan $_options_debugmode" -} -debug - compile_miniaudio(){ temp_options=$_options @@ -58,66 +47,185 @@ compile_miniaudio(){ _options=$temp_options } -game() { - _compiler=$_linux_compiler - _options=$_linux_options - - compile_miniaudio linux - - # Game tools - _folder="$_linux_folder" - _ext="" - vg_compile_tools - - # Main build - _link="$_linux_linkgraphics $_linux_linksteam" - _src="main.c vg/dep/glad/glad.c vg/dep/dr_soft/miniaudio_linux.o" - _dst="skaterift" - compile_x +# Again, these are not cross platform currently +# TODO +run_game(){ + cd $_linux_folder + ./skaterift + cd ./../ } -game_windows() { - _compiler=$_windows_compiler - _options=$_windows_options +run_server(){ + cd $_linux_server_folder + ./skaterift_server + cd ./../ +} - compile_miniaudio windows +delay_run_game(){ + sleep 2 + run_game +} - # Game tools - _folder="$_windows_folder" - _ext=".exe" - vg_compile_tools - - # Main build - _link="$_windows_linkgraphics $_windows_linksteam" - _src="main.c vg/dep/glad/glad.c vg/dep/dr_soft/miniaudio_windows.o" - _dst="skaterift" - compile_x +#TODO: Make this a seperate script +# it should not be called compile, rename to 'generate' shader headers, +# its a code writing tool, not a compiling tool +# +target_shaders="" +shader(){ + target_shaders="$target_shaders $1 $2 $3" } - -server() { - _compiler=$_linux_compiler - _options=$_linux_options - _link="-lm $_linux_linksteam" - _folder="$_linux_server_folder" - _src="server.c" - _dst="skaterift_server" - _ext="" - compile_x +compile_shaders(){ + titleit "Compiling shaders" + source shaders.sh + cd shaders + ../bin/linux/tools/shader $target_shaders + cd .. } -all() { - tools - game - server +link_content(){ + ln -sr bin/content/textures/ $1/textures + ln -sr bin/content/models/ $1/models + ln -sr bin/content/sound/ $1/sound } -distribution(){ - release - tools - game - game_windows - server +TIMESTAMP=`date +%Y-%m-%d_%H-%M-%S` + +vg_command(){ + case "$1" in + release) + _linux_options=$_options_release + _windows_options=$_options_release + ;; + debug) + _linux_options="$_linux_asan $_options_debugmode" + _windows_options="$_windows_asan $_options_debugmode" + ;; + game) + titleit "Creating Linux build" + mkdir -p $_linux_folder/cfg + + # Dependencies + cp vg/dep/steam/libsteam_api.so $_linux_folder + link_content $_linux_folder + + _compiler=$_linux_compiler + _options=$_linux_options + + compile_miniaudio linux + + # Game tools + _folder=$_linux_folder + _ext="" + vg_compile_tools + compile_shaders + + # Main build + _link="$_linux_linkgraphics $_linux_linksteam" + _src="main.c vg/dep/glad/glad.c vg/dep/dr_soft/miniaudio_linux.o" + _dst="skaterift" + compile_x + ;; + game_win) + titleit "Creating Windows build" + mkdir -p $_windows_folder/cfg + + # Dependencies + cp vg/dep/steam/steam_api.dll $_windows_folder + link_content $_windows_folder + + _compiler=$_windows_compiler + _options=$_windows_options + + compile_miniaudio windows + + # Game tools + _ext=".exe" + _folder=$_windows_folder + vg_compile_tools + + # Main build + _link="$_windows_linkgraphics $_windows_linksteam" + _src="main.c vg/dep/glad/glad.c vg/dep/dr_soft/miniaudio_windows.o" + _dst="skaterift" + compile_x + ;; + server) + titleit "Creating Server build" + mkdir -p $_linux_server_folder/cfg + + # Dependencies + cp vg/dep/steam/steamclient.so bin/linux_server/ + + _compiler=$_linux_compiler + _options=$_linux_options + _link="-lm $_linux_linksteam" + _src="server.c" + _folder=$_linux_server_folder + _dst="skaterift_server" + _ext="" + + compile_x + ;; + + #TODO: These are not cross platform in the build script, a full build + # from source is therefore not possible on windows, only a linux + # host can do that. + textures) + titleit "Compiling textures" + mkdir -p ./bin/content/textures + for f in ./textures_src/*.png; + do logit " qoiconv: $f"; + dest=./bin/content/textures/"$(basename "$f" .png).qoi" + ./bin/linux/tools/qoiconv $f $dest + done + ;; + content) + logit "Copying content" + mkdir -p ./bin/content/models + mkdir -p ./bin/content/sound + + cp ./models_src/* ./bin/content/models/ + cp ./sound_src/* ./bin/content/sound/ + ;; + + all) + run_command tools + run_command game + run_command server + ;; + distribution) + mkdir -p ./dist + run_command release + run_command tools + run_command game + run_command game_win + run_command content + run_command textures + run_command server + + titleit "Compressing distributions" + logit "Linux" + tar -chzvf dist/skaterift_linux__$TIMESTAMP.tar.gz bin/linux/ + logit "Server" + tar -chzvf dist/skaterift_server__$TIMESTAMP.tar.gz bin/linux_server + logit "Windows" + tar -chzvf dist/skaterift_win32__$TIMESTAMP.tar.gz bin/win32/ + ;; + # Runners + # ======================================================================== + test) + run_game + ;; + testnet) + delay_run_game & + run_server + wait + ;; + *) + echo "Unrecognised command $1" + esac } +vg_command debug source vg/vg_build.sh diff --git a/models/cement_r1.mdl b/models/cement_r1.mdl deleted file mode 100644 index aaa9071..0000000 Binary files a/models/cement_r1.mdl and /dev/null differ diff --git a/models/ch_anim.mdl b/models/ch_anim.mdl deleted file mode 100644 index 4ef24ef..0000000 Binary files a/models/ch_anim.mdl and /dev/null differ diff --git a/models/ch_default.mdl b/models/ch_default.mdl deleted file mode 100644 index f425d65..0000000 Binary files a/models/ch_default.mdl and /dev/null differ diff --git a/models/ch_mike.mdl b/models/ch_mike.mdl deleted file mode 100644 index 5fad81d..0000000 Binary files a/models/ch_mike.mdl and /dev/null differ diff --git a/models/ch_outlaw.mdl b/models/ch_outlaw.mdl deleted file mode 100644 index 49a2376..0000000 Binary files a/models/ch_outlaw.mdl and /dev/null differ diff --git a/models/ch_suitman.mdl b/models/ch_suitman.mdl deleted file mode 100644 index f4296ba..0000000 Binary files a/models/ch_suitman.mdl and /dev/null differ diff --git a/models/char_dev.mdl b/models/char_dev.mdl deleted file mode 100644 index 86292ba..0000000 Binary files a/models/char_dev.mdl and /dev/null differ diff --git a/models/cubeh.mdl b/models/cubeh.mdl deleted file mode 100644 index 9f0a845..0000000 Binary files a/models/cubeh.mdl and /dev/null differ diff --git a/models/epic_scene.mdl b/models/epic_scene.mdl deleted file mode 100644 index 7b868e2..0000000 Binary files a/models/epic_scene.mdl and /dev/null differ diff --git a/models/export 10.mdl b/models/export 10.mdl deleted file mode 100644 index 9f0a845..0000000 Binary files a/models/export 10.mdl and /dev/null differ diff --git a/models/export 8.mdl b/models/export 8.mdl deleted file mode 100644 index 8cce6fe..0000000 Binary files a/models/export 8.mdl and /dev/null differ diff --git a/models/free_dev.mdl b/models/free_dev.mdl deleted file mode 100644 index f8e2836..0000000 Binary files a/models/free_dev.mdl and /dev/null differ diff --git a/models/mp_cliff.mdl b/models/mp_cliff.mdl deleted file mode 100644 index 306a02c..0000000 Binary files a/models/mp_cliff.mdl and /dev/null differ diff --git a/models/mp_demo.mdl b/models/mp_demo.mdl deleted file mode 100644 index 0213bc7..0000000 Binary files a/models/mp_demo.mdl and /dev/null differ diff --git a/models/mp_dev.mdl b/models/mp_dev.mdl deleted file mode 100644 index 4bc7348..0000000 Binary files a/models/mp_dev.mdl and /dev/null differ diff --git a/models/mp_works.mdl b/models/mp_works.mdl deleted file mode 100644 index feed633..0000000 Binary files a/models/mp_works.mdl and /dev/null differ diff --git a/models/rs_cars.mdl b/models/rs_cars.mdl deleted file mode 100644 index 3b643c1..0000000 Binary files a/models/rs_cars.mdl and /dev/null differ diff --git a/models/rs_chicken.mdl b/models/rs_chicken.mdl deleted file mode 100644 index fc0e60c..0000000 Binary files a/models/rs_chicken.mdl and /dev/null differ diff --git a/models/rs_foliage.mdl b/models/rs_foliage.mdl deleted file mode 100644 index b65581b..0000000 Binary files a/models/rs_foliage.mdl and /dev/null differ diff --git a/models/rs_gate.mdl b/models/rs_gate.mdl deleted file mode 100644 index 386dddb..0000000 Binary files a/models/rs_gate.mdl and /dev/null differ diff --git a/models/rs_scoretext.mdl b/models/rs_scoretext.mdl deleted file mode 100644 index 5eef656..0000000 Binary files a/models/rs_scoretext.mdl and /dev/null differ diff --git a/models/rs_skydome.mdl b/models/rs_skydome.mdl deleted file mode 100644 index d2a2232..0000000 Binary files a/models/rs_skydome.mdl and /dev/null differ diff --git a/models/rs_vig.mdl b/models/rs_vig.mdl deleted file mode 100644 index 1a31cd9..0000000 Binary files a/models/rs_vig.mdl and /dev/null differ diff --git a/models/skydome.mdl b/models/skydome.mdl deleted file mode 100644 index 712651b..0000000 Binary files a/models/skydome.mdl and /dev/null differ diff --git a/models/test.mdl b/models/test.mdl deleted file mode 100644 index e69de29..0000000 diff --git a/models_src/cement_r1.mdl b/models_src/cement_r1.mdl new file mode 100644 index 0000000..aaa9071 Binary files /dev/null and b/models_src/cement_r1.mdl differ diff --git a/models_src/ch_anim.mdl b/models_src/ch_anim.mdl new file mode 100644 index 0000000..4ef24ef Binary files /dev/null and b/models_src/ch_anim.mdl differ diff --git a/models_src/ch_default.mdl b/models_src/ch_default.mdl new file mode 100644 index 0000000..f425d65 Binary files /dev/null and b/models_src/ch_default.mdl differ diff --git a/models_src/ch_mike.mdl b/models_src/ch_mike.mdl new file mode 100644 index 0000000..5fad81d Binary files /dev/null and b/models_src/ch_mike.mdl differ diff --git a/models_src/ch_outlaw.mdl b/models_src/ch_outlaw.mdl new file mode 100644 index 0000000..49a2376 Binary files /dev/null and b/models_src/ch_outlaw.mdl differ diff --git a/models_src/ch_suitman.mdl b/models_src/ch_suitman.mdl new file mode 100644 index 0000000..f4296ba Binary files /dev/null and b/models_src/ch_suitman.mdl differ diff --git a/models_src/char_dev.mdl b/models_src/char_dev.mdl new file mode 100644 index 0000000..86292ba Binary files /dev/null and b/models_src/char_dev.mdl differ diff --git a/models_src/cubeh.mdl b/models_src/cubeh.mdl new file mode 100644 index 0000000..9f0a845 Binary files /dev/null and b/models_src/cubeh.mdl differ diff --git a/models_src/epic_scene.mdl b/models_src/epic_scene.mdl new file mode 100644 index 0000000..7b868e2 Binary files /dev/null and b/models_src/epic_scene.mdl differ diff --git a/models_src/export 10.mdl b/models_src/export 10.mdl new file mode 100644 index 0000000..9f0a845 Binary files /dev/null and b/models_src/export 10.mdl differ diff --git a/models_src/export 8.mdl b/models_src/export 8.mdl new file mode 100644 index 0000000..8cce6fe Binary files /dev/null and b/models_src/export 8.mdl differ diff --git a/models_src/free_dev.mdl b/models_src/free_dev.mdl new file mode 100644 index 0000000..f8e2836 Binary files /dev/null and b/models_src/free_dev.mdl differ diff --git a/models_src/mp_cliff.mdl b/models_src/mp_cliff.mdl new file mode 100644 index 0000000..306a02c Binary files /dev/null and b/models_src/mp_cliff.mdl differ diff --git a/models_src/mp_demo.mdl b/models_src/mp_demo.mdl new file mode 100644 index 0000000..0213bc7 Binary files /dev/null and b/models_src/mp_demo.mdl differ diff --git a/models_src/mp_dev.mdl b/models_src/mp_dev.mdl new file mode 100644 index 0000000..4bc7348 Binary files /dev/null and b/models_src/mp_dev.mdl differ diff --git a/models_src/mp_works.mdl b/models_src/mp_works.mdl new file mode 100644 index 0000000..feed633 Binary files /dev/null and b/models_src/mp_works.mdl differ diff --git a/models_src/rs_cars.mdl b/models_src/rs_cars.mdl new file mode 100644 index 0000000..3b643c1 Binary files /dev/null and b/models_src/rs_cars.mdl differ diff --git a/models_src/rs_chicken.mdl b/models_src/rs_chicken.mdl new file mode 100644 index 0000000..fc0e60c Binary files /dev/null and b/models_src/rs_chicken.mdl differ diff --git a/models_src/rs_foliage.mdl b/models_src/rs_foliage.mdl new file mode 100644 index 0000000..b65581b Binary files /dev/null and b/models_src/rs_foliage.mdl differ diff --git a/models_src/rs_gate.mdl b/models_src/rs_gate.mdl new file mode 100644 index 0000000..386dddb Binary files /dev/null and b/models_src/rs_gate.mdl differ diff --git a/models_src/rs_scoretext.mdl b/models_src/rs_scoretext.mdl new file mode 100644 index 0000000..5eef656 Binary files /dev/null and b/models_src/rs_scoretext.mdl differ diff --git a/models_src/rs_skydome.mdl b/models_src/rs_skydome.mdl new file mode 100644 index 0000000..d2a2232 Binary files /dev/null and b/models_src/rs_skydome.mdl differ diff --git a/models_src/rs_vig.mdl b/models_src/rs_vig.mdl new file mode 100644 index 0000000..1a31cd9 Binary files /dev/null and b/models_src/rs_vig.mdl differ diff --git a/models_src/skydome.mdl b/models_src/skydome.mdl new file mode 100644 index 0000000..712651b Binary files /dev/null and b/models_src/skydome.mdl differ diff --git a/models_src/test.mdl b/models_src/test.mdl new file mode 100644 index 0000000..e69de29 diff --git a/shaders.sh b/shaders.sh new file mode 100644 index 0000000..2ebc67b --- /dev/null +++ b/shaders.sh @@ -0,0 +1,16 @@ +shader blit blit.vs blit.fs +shader fscolour blit.vs colour.fs +shader terrain standard.vs terrain.fs +shader vblend standard.vs vblend.fs +shader alphatest standard.vs std_alphatest.fs +shader standard standard.vs standard.fs +shader unlit standard.vs unlit.fs +shader character character.vs character.fs +shader gate gate.vs gate.fs +shader gatelq gate.vs gate_lq.fs +shader water standard.vs water.fs +shader sky standard.vs sky.fs +shader planeinf standard.vs planeinf.fs +shader gpos standard.vs gpos.fs +shader route standard.vs route.fs +shader scoretext scoretext.vs vblend.fs diff --git a/sound/skate.ogg b/sound/skate.ogg deleted file mode 100644 index 06b2144..0000000 Binary files a/sound/skate.ogg and /dev/null differ diff --git a/sound/slide.ogg b/sound/slide.ogg deleted file mode 100644 index ccfe4be..0000000 Binary files a/sound/slide.ogg and /dev/null differ diff --git a/sound/wheel.ogg b/sound/wheel.ogg deleted file mode 100644 index 28e09bc..0000000 Binary files a/sound/wheel.ogg and /dev/null differ diff --git a/sound_src/skate.ogg b/sound_src/skate.ogg new file mode 100644 index 0000000..06b2144 Binary files /dev/null and b/sound_src/skate.ogg differ diff --git a/sound_src/slide.ogg b/sound_src/slide.ogg new file mode 100644 index 0000000..ccfe4be Binary files /dev/null and b/sound_src/slide.ogg differ diff --git a/sound_src/wheel.ogg b/sound_src/wheel.ogg new file mode 100644 index 0000000..28e09bc Binary files /dev/null and b/sound_src/wheel.ogg differ diff --git a/textures/alphatest.png b/textures/alphatest.png deleted file mode 100644 index d27c828..0000000 Binary files a/textures/alphatest.png and /dev/null differ diff --git a/textures/cement512.png b/textures/cement512.png deleted file mode 100644 index cd94f96..0000000 Binary files a/textures/cement512.png and /dev/null differ diff --git a/textures/ch_gradient.png b/textures/ch_gradient.png deleted file mode 100644 index e3ed408..0000000 Binary files a/textures/ch_gradient.png and /dev/null differ diff --git a/textures/garbage.png b/textures/garbage.png deleted file mode 100644 index 705b8da..0000000 Binary files a/textures/garbage.png and /dev/null differ diff --git a/textures/gradients.png b/textures/gradients.png deleted file mode 100644 index 15bd113..0000000 Binary files a/textures/gradients.png and /dev/null differ diff --git a/textures/grid.png b/textures/grid.png deleted file mode 100644 index 3b9d99d..0000000 Binary files a/textures/grid.png and /dev/null differ diff --git a/textures/grid_terrain.png b/textures/grid_terrain.png deleted file mode 100644 index f88b759..0000000 Binary files a/textures/grid_terrain.png and /dev/null differ diff --git a/textures/norway_foliage.png b/textures/norway_foliage.png deleted file mode 100644 index 6ca93f8..0000000 Binary files a/textures/norway_foliage.png and /dev/null differ diff --git a/textures/norwey.png b/textures/norwey.png deleted file mode 100644 index 9ac01ff..0000000 Binary files a/textures/norwey.png and /dev/null differ diff --git a/textures/road.png b/textures/road.png deleted file mode 100644 index 06c95cc..0000000 Binary files a/textures/road.png and /dev/null differ diff --git a/textures/scoretext.png b/textures/scoretext.png deleted file mode 100644 index e45097b..0000000 Binary files a/textures/scoretext.png and /dev/null differ diff --git a/textures/sky.png b/textures/sky.png deleted file mode 100644 index f9cdae4..0000000 Binary files a/textures/sky.png and /dev/null differ diff --git a/textures/water.png b/textures/water.png deleted file mode 100644 index f0045e4..0000000 Binary files a/textures/water.png and /dev/null differ diff --git a/textures/water_surf.png b/textures/water_surf.png deleted file mode 100644 index 3c1c6f5..0000000 Binary files a/textures/water_surf.png and /dev/null differ diff --git a/textures_src/alphatest.png b/textures_src/alphatest.png new file mode 100644 index 0000000..d27c828 Binary files /dev/null and b/textures_src/alphatest.png differ diff --git a/textures_src/cement512.png b/textures_src/cement512.png new file mode 100644 index 0000000..cd94f96 Binary files /dev/null and b/textures_src/cement512.png differ diff --git a/textures_src/ch_gradient.png b/textures_src/ch_gradient.png new file mode 100644 index 0000000..e3ed408 Binary files /dev/null and b/textures_src/ch_gradient.png differ diff --git a/textures_src/garbage.png b/textures_src/garbage.png new file mode 100644 index 0000000..705b8da Binary files /dev/null and b/textures_src/garbage.png differ diff --git a/textures_src/gradients.png b/textures_src/gradients.png new file mode 100644 index 0000000..15bd113 Binary files /dev/null and b/textures_src/gradients.png differ diff --git a/textures_src/grid.png b/textures_src/grid.png new file mode 100644 index 0000000..3b9d99d Binary files /dev/null and b/textures_src/grid.png differ diff --git a/textures_src/grid_terrain.png b/textures_src/grid_terrain.png new file mode 100644 index 0000000..f88b759 Binary files /dev/null and b/textures_src/grid_terrain.png differ diff --git a/textures_src/norway_foliage.png b/textures_src/norway_foliage.png new file mode 100644 index 0000000..6ca93f8 Binary files /dev/null and b/textures_src/norway_foliage.png differ diff --git a/textures_src/norwey.png b/textures_src/norwey.png new file mode 100644 index 0000000..9ac01ff Binary files /dev/null and b/textures_src/norwey.png differ diff --git a/textures_src/road.png b/textures_src/road.png new file mode 100644 index 0000000..06c95cc Binary files /dev/null and b/textures_src/road.png differ diff --git a/textures_src/scoretext.png b/textures_src/scoretext.png new file mode 100644 index 0000000..e45097b Binary files /dev/null and b/textures_src/scoretext.png differ diff --git a/textures_src/sky.png b/textures_src/sky.png new file mode 100644 index 0000000..f9cdae4 Binary files /dev/null and b/textures_src/sky.png differ diff --git a/textures_src/water.png b/textures_src/water.png new file mode 100644 index 0000000..f0045e4 Binary files /dev/null and b/textures_src/water.png differ diff --git a/textures_src/water_surf.png b/textures_src/water_surf.png new file mode 100644 index 0000000..3c1c6f5 Binary files /dev/null and b/textures_src/water_surf.png differ