src="fishladder.c"
target="fishladder"
lib="-I. -L./lib -L./"
-libs="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl -l:steam/libsteam_api.so"
+libs="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl"
+steam_part="-l:steam/libsteam_api.so"
flags="-fsanitize=address -ggdb3 -Wno-unused-function"
build_dir="build.linux"
steam_api="libsteam_api.so"
echo "Operating system is not GNU/Linux, windows will be assumed."
target="fishladder.exe"
- libs="-lglfw3 -lopengl32 -lm -mwindows -l:steam/steam_api.dll"
+ libs="-lglfw3 -lopengl32 -lm -mwindows"
flags="-ggdb3 -Wno-unused-function"
build_dir="build.win32"
steam_api="steam_api.dll"
run_after=true
echo "& Run"
;;
+ -s|--no-steam)
+ steam_part=""
+ defines="-DNO_STEAM"
+ echo "no-steam"
+ ;;
-n|--nobuild)
do_build=false
echo "no-build"
if [ "$compile_tools" = true ]; then
echo "Building tools"
mkdir tools -p
- gcc -Wall -Wstrict-aliasing=3 $lib $flags mdlcomp.c gl/glad.c -o tools/mdlcomp $libs -Wl,-rpath=./ $defines
- gcc -Wall -Wstrict-aliasing=3 $lib $flags fontcomp.c gl/glad.c -o tools/fontcomp $libs -Wl,-rpath=./ $defines
+ gcc -Wall -Wstrict-aliasing=3 $lib $flags mdlcomp.c gl/glad.c -o tools/mdlcomp $libs $steam_part -Wl,-rpath=./ $defines
+ gcc -Wall -Wstrict-aliasing=3 $lib $flags fontcomp.c gl/glad.c -o tools/fontcomp $libs $steam_part -Wl,-rpath=./ $defines
+ gcc -Wall -Wstrict-aliasing=3 $lib $flags texsheet.c gl/glad.c -o tools/texsheet $libs $steam_part -Wl,-rpath=./ $defines
gcc $lib qoiconv.c -std=c99 -O3 -o tools/qoiconv
fi
./tools/qoiconv $f ./_temp_textures/"$(basename "$f" .png).qoi"
done
-#if [ "$compile_models" = true ]; then
-# echo "Recompiling models"
-# for f in models/*.obj;
-# do echo "Compiling $f..";
-# ./tools/mdlcomp $f $f.h
-# done
-#fi
+# Autocombine textures
+auto_combine=""
+cd textures_combine
+for f in *.png;
+ do echo "[combine] $f";
+ auto_combine="$auto_combine $f"
+done
+../tools/texsheet ../_temp_textures/autocombine.qoi ../sprites_autocombine.h sprites_auto_combine $auto_combine
+cd ..
+
+# Compile font file
+./tools/fontcomp fonts/vg_font.png vg/vg_pxfont.h
# Main build
if [ "$do_build" = true ]; then
- gcc -Wall -Wstrict-aliasing=3 $lib $flags $src gl/glad.c -o $target $libs -Wl,-rpath=./ $defines
+ gcc -Wall -Wstrict-aliasing=3 $lib $flags $src gl/glad.c -o $target $libs $steam_part -Wl,-rpath=./ $defines
if [ $? -ne 0 ]; then
echo "GCC build failed"