comparison src/cs/drivers/drv_app/r2d/convertanim.pl @ 0:92470e5d0b9e

src: partial import from FC Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 01:28:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92470e5d0b9e
1 #!perl
2
3 $nb=$ARGV[0];
4 $name=$ARGV[1];
5
6 for($i=0;$i<$nb;$i++)
7 {
8 $t=sprintf "%02d",($i+1);
9 $filename=$name.$t.".tga";
10 print "tor2d.pl $filename image$t\n";
11 system("tor2d.pl $filename image$t");
12 }
13
14 open(OUT,">E:\\BT\\Drivers\\Common\\R2D\\r2d_anim.c") or die "Cannot create anim file :$!\n";
15
16 for($i=0;$i<$nb;$i++)
17 {
18 $t=sprintf "%02d",($i+1);
19 print OUT "#include \"image$t.c\"\n";
20 }
21
22 print OUT "\n";
23 print OUT "#define r2d_create_anim_context() \\\n";
24 for($i=0;$i<$nb;$i++)
25 {
26 $t=sprintf "%02d",($i+1);
27 if ($i == ($nb-1))
28 {
29 print OUT "picgc[$i]=r2d_new_picture_context((UINT32*)image$t); \n";
30 }
31 else
32 {
33 print OUT "picgc[$i]=r2d_new_picture_context((UINT32*)image$t); \\\n";
34 }
35
36 }
37 close(OUT);