15 lines
305 B
Bash
Executable File
15 lines
305 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -lt 1 ]
|
|
then
|
|
echo "You must pass in the texture! It should be 16x16 lol"
|
|
exit 1
|
|
fi
|
|
|
|
convert $1 -compress none $1.ppm
|
|
|
|
echo "int mytex_width = 16, mytex_height = 16;\nuint8_t mytex[] = {\n" > texture.h
|
|
cat $1.ppm | sed 1,3d | sed -e 's/ /, /g' >> texture.h
|
|
echo "};" >> texture.h
|
|
|