~melchizedek6809/WolkenWelten

ref: 6d229600f745dbd4bd087f01a5fc06f58422b0de WolkenWelten/server/tools/objgen -rwxr-xr-x 564 bytes
6d229600Ben (X13/Arch) Alot of fixes, mostly regarding animals and UI 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

C_FILE="$1.c"
H_FILE="$1.h"
shift

echo "#include \"objs.h\""                        > $C_FILE
echo ""                                          >> $C_FILE

echo "#pragma once"                               > $H_FILE
echo "#include \"../../../common/src/common.h\"" >> $H_FILE
echo ""                                          >> $H_FILE

while (("$#")); do
	for filename in $1*.obj; do
		file=${filename##*/}
		file=${file%.obj}
		file=${file^}
		echo "mesh *mesh$file;" >> $C_FILE
		echo "extern mesh *mesh$file;" >> $H_FILE
	done
	shift
done