Mercurial > sdl-ios-xcode
comparison src/video/sdlgenblit.pl @ 2263:900c35d8e8fd
More work in progress, still doesn't compile...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 17 Aug 2007 06:40:12 +0000 |
parents | bee005ace1bf |
children | c785543d1843 |
comparison
equal
deleted
inserted
replaced
2262:bee005ace1bf | 2263:900c35d8e8fd |
---|---|
121 } | 121 } |
122 | 122 |
123 sub output_copydefs | 123 sub output_copydefs |
124 { | 124 { |
125 print FILE <<__EOF__; | 125 print FILE <<__EOF__; |
126 extern SDL_BlitFuncEntry *SDL_GeneratedBlitFuncTable; | 126 extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]; |
127 __EOF__ | 127 __EOF__ |
128 } | 128 } |
129 | 129 |
130 sub output_copyfuncname | 130 sub output_copyfuncname |
131 { | 131 { |
273 my $dst = shift; | 273 my $dst = shift; |
274 my $modulate = shift; | 274 my $modulate = shift; |
275 my $blend = shift; | 275 my $blend = shift; |
276 my $scale = shift; | 276 my $scale = shift; |
277 | 277 |
278 output_copyfuncname("void", $src, $dst, $modulate, $blend, $scale, 1, "\n"); | 278 output_copyfuncname("static void", $src, $dst, $modulate, $blend, $scale, 1, "\n"); |
279 print FILE <<__EOF__; | 279 print FILE <<__EOF__; |
280 { | 280 { |
281 const int flags = info->flags; | 281 const int flags = info->flags; |
282 __EOF__ | 282 __EOF__ |
283 if ( $modulate ) { | 283 if ( $modulate ) { |
382 } | 382 } |
383 | 383 |
384 sub output_copyfunctable | 384 sub output_copyfunctable |
385 { | 385 { |
386 print FILE <<__EOF__; | 386 print FILE <<__EOF__; |
387 static SDL_BlitFuncEntry _SDL_GeneratedBlitFuncTable[] = { | 387 static SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = { |
388 __EOF__ | 388 __EOF__ |
389 for (my $i = 0; $i <= $#src_formats; ++$i) { | 389 for (my $i = 0; $i <= $#src_formats; ++$i) { |
390 my $src = $src_formats[$i]; | 390 my $src = $src_formats[$i]; |
391 for (my $j = 0; $j <= $#dst_formats; ++$j) { | 391 for (my $j = 0; $j <= $#dst_formats; ++$j) { |
392 my $dst = $dst_formats[$j]; | 392 my $dst = $dst_formats[$j]; |
434 } | 434 } |
435 print FILE <<__EOF__; | 435 print FILE <<__EOF__; |
436 { 0, 0, 0, 0, NULL } | 436 { 0, 0, 0, 0, NULL } |
437 }; | 437 }; |
438 | 438 |
439 SDL_BlitFuncEntry *SDL_GeneratedBlitFuncTable = _SDL_GeneratedBlitFuncTable; | |
440 | |
441 __EOF__ | 439 __EOF__ |
442 } | 440 } |
443 | 441 |
444 sub output_copyfunc_c | 442 sub output_copyfunc_c |
445 { | 443 { |
467 print FILE "\n"; | 465 print FILE "\n"; |
468 close_file("SDL_blit_auto.h"); | 466 close_file("SDL_blit_auto.h"); |
469 | 467 |
470 open_file("SDL_blit_auto.c"); | 468 open_file("SDL_blit_auto.c"); |
471 output_copyinc(); | 469 output_copyinc(); |
472 output_copyfunctable(); | |
473 for (my $i = 0; $i <= $#src_formats; ++$i) { | 470 for (my $i = 0; $i <= $#src_formats; ++$i) { |
474 for (my $j = 0; $j <= $#dst_formats; ++$j) { | 471 for (my $j = 0; $j <= $#dst_formats; ++$j) { |
475 output_copyfunc_c($src_formats[$i], $dst_formats[$j]); | 472 output_copyfunc_c($src_formats[$i], $dst_formats[$j]); |
476 } | 473 } |
477 } | 474 } |
475 output_copyfunctable(); | |
478 close_file("SDL_blit_auto.c"); | 476 close_file("SDL_blit_auto.c"); |