Project

General

Profile

Revision 217

changed stuff place

View differences:

proj/font/png_to_xpm.sh
1
cd $1
2
mkdir -p xpm
3
for f in png/*.png; do
4
    a=`expr "$f" : 'png/\([a-zA-Z0-9]*\).png'`
5
    convert $f xpm/$a.xpm
6
done
7
sed -i "s/black/#000000/g" xpm/*.xpm
8 0

  
proj/font/xpm_to_xpm2.sh
1
cd $1
2
echo "#include \"xpm_utils.h\"" > convert.c
3
for f in xpm/*.xpm; do
4
    echo "#include \"$f\"" >> convert.c 
5
done
6
echo "int main(){" >> convert.c
7
for f in xpm/*.xpm; do
8
    s=${f:4:-4}
9
    echo "    xpm_save_as_xpm2($s,\"xpm2/$s.xpm2\");" >> convert.c
10
done
11
echo "    return 0;" >> convert.c
12
echo "}" >> convert.c
13
gcc -I../../include ../../src/xpm_utils.c convert.c -o convert.app
14
rm -rf xpm2
15
mkdir xpm2
16
./convert.app
17
rm convert.c convert.app
18 0

  
proj/font/process_font.sh
2 2
echo "    Splitting font"
3 3
python3 split_font.py $1 $2 $3 $4 $5 $6
4 4
echo "    Converting from png to xpm"
5
./png_to_xpm.sh $1
5
../helpers/png_to_xpm.sh $1
6 6
echo "    Converting from xpm to xpm2"
7
./xpm_to_xpm2.sh $1
7
../helpers/xpm_to_xpm2.sh $1
8 8
echo "    Cleaning up"
9 9
rm -rf $1/png
10 10
rm -rf $1/xpm
11
#rm -rf $1/xpm2
11
#rm -rf $1/xpm2
proj/helpers/png_to_xpm.sh
1
cd $1
2
mkdir -p xpm
3
for f in png/*.png; do
4
    a=`expr "$f" : 'png/\([a-zA-Z0-9]*\).png'`
5
    convert $f xpm/$a.xpm
6
done
7
sed -i "s/black/#000000/g" xpm/*.xpm
0 8

  
proj/helpers/xpm_to_xpm2.sh
1
cd $1
2
echo "#include \"xpm_utils.h\"" > convert.c
3
for f in xpm/*.xpm; do
4
    echo "#include \"$f\"" >> convert.c 
5
done
6
echo "int main(){" >> convert.c
7
for f in xpm/*.xpm; do
8
    s=${f:4:-4}
9
    echo "    xpm_save_as_xpm2($s,\"xpm2/$s.xpm2\");" >> convert.c
10
done
11
echo "    return 0;" >> convert.c
12
echo "}" >> convert.c
13
gcc -I../../include ../../src/xpm_utils.c convert.c -o convert.app
14
rm -rf xpm2
15
mkdir xpm2
16
./convert.app
17
rm convert.c convert.app
0 18

  
proj/maps/map1.h
5 5
#include "map1_collide.xpm"
6 6
#include "sprite.h"
7 7

  
8
#include "xpm_utils.h"
9

  
8 10
map_t* get_map1(void){
11
    char **map1         = xpm_load_xpm2("maps/map1.xpm2");
12
    char **map1_collide = xpm_load_xpm2("maps/map1_collide.xpm2");
9 13
    return map_ctor((const char **)map1_xpm, (const char **)map1_collide_xpm);
14
    free(map1); free(map1_collide);
10 15
}
11 16

  
12 17
#endif /* end of include guard: MAP_H_INCLUDED */

Also available in: Unified diff