changes from carve
[vg.git] / vg_compiler.sh
index bea6ebf0c1ee44abaa150952979ce03e732dbe32..a27da4ae00509e05e67850040f471289255dabce 100755 (executable)
@@ -84,7 +84,7 @@ target_os_linux(){
    if [ $opt_release = true ]; then
       target_opts="-O3"
    else
-      target_opts="-O0 -fsanitize=address -ggdb3 -fno-omit-frame-pointer"
+      target_opts="-O1 -fsanitize=address -ggdb3 -fno-omit-frame-pointer"
    fi
 }
 
@@ -120,7 +120,7 @@ compile_x(){
       steam_part="$opt_steam $target_libs_steam"
    fi
 
-   warnings="-Wall -Wstrict-aliasing=3 -Wno-unused-function"
+   warnings="-Wall -Wstrict-aliasing=3 -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable"
    sources="$1 $vg_root/dep/glad/glad.c $target_miniaudio"
    output="-o $2$target_ext"
 
@@ -173,6 +173,7 @@ compile_main(){
    mv $target_dir/.temp_textures $target_dir/textures
    cp -r sound $target_dir
    cp -r maps $target_dir
+   cp -r models $target_dir
 }
 
 compile_tools(){
@@ -203,17 +204,19 @@ compile_assets(){
       $vg_root/bin/qoiconv$target_ext $f .temp_textures/"$(basename "$f" .png).qoi"
    done
 
-   # Autocombine textures
-   echo "  [combine]:"
-
-   auto_combine=""
-   cd textures_combine
-   for f in *.png;
-      do logit "    combine: $f";
-      auto_combine="$auto_combine $f"
-   done
-   $vg_root/bin/texsheet$taget_ext ../.temp_textures/autocombine.qoi ../sprites_autocombine.h sprites_auto_combine $auto_combine
-   cd ..
+   if [[ -d "textures_combine" ]]; then
+      # Autocombine textures
+      echo "  [combine]:"
+
+      auto_combine=""
+      cd textures_combine
+      for f in *.png;
+         do logit "    combine: $f";
+         auto_combine="$auto_combine $f"
+      done
+      $vg_root/bin/texsheet$taget_ext ../.temp_textures/autocombine.qoi ../sprites_autocombine.h sprites_auto_combine $auto_combine
+      cd ..
+   fi
 
    # Compile font file
    echo ""