comparison src/audio/sdlgenaudiocvt.pl @ 1985:8055185ae4ed

Added source color and alpha modulation support. Added perl script to generate optimized render copy functions.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 28 Aug 2006 03:17:39 +0000
parents 3b4ce57c6215
children b2b7154ce016
comparison
equal deleted inserted replaced
1984:b910bcabec26 1985:8055185ae4ed
21 my $custom_converters = 0; 21 my $custom_converters = 0;
22 22
23 23
24 sub outputHeader { 24 sub outputHeader {
25 print <<EOF; 25 print <<EOF;
26 /* DO NOT EDIT THIS FILE! It is generated code. */ 26 /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */
27 /* Please modify SDL/src/audio/sdlgenaudiocvt.pl instead. */
28
29 /* 27 /*
30 SDL - Simple DirectMedia Layer 28 SDL - Simple DirectMedia Layer
31 Copyright (C) 1997-2006 Sam Lantinga 29 Copyright (C) 1997-2006 Sam Lantinga
32 30
33 This library is free software; you can redistribute it and/or 31 This library is free software; you can redistribute it and/or
50 48
51 #include "SDL_config.h" 49 #include "SDL_config.h"
52 #include "SDL_audio.h" 50 #include "SDL_audio.h"
53 #include "SDL_audio_c.h" 51 #include "SDL_audio_c.h"
54 52
55 /* Now the generated code... */ 53 /* *INDENT-OFF* */
56 54
57 EOF 55 EOF
58 56
59 my @vals = ( 127, 255, 32767, 65535, 2147483647 ); 57 my @vals = ( 127, 255, 32767, 65535, 2147483647 );
60 foreach (@vals) { 58 foreach (@vals) {
64 } 62 }
65 63
66 print("\n"); 64 print("\n");
67 } 65 }
68 66
67 sub outputFooter {
68 print <<EOF;
69 /* *INDENT-ON* */
70
71 /* vi: set ts=4 sw=4 expandtab: */
72 EOF
73 }
69 74
70 sub splittype { 75 sub splittype {
71 my $t = shift; 76 my $t = shift;
72 my ($signed, $size, $endian) = $t =~ /([USF])(\d+)([LM]SB|)/; 77 my ($signed, $size, $endian) = $t =~ /([USF])(\d+)([LM]SB|)/;
73 my $float = ($signed eq 'F') ? 1 : 0; 78 my $float = ($signed eq 'F') ? 1 : 0;
305 }; 310 };
306 311
307 312
308 EOF 313 EOF
309 314
315 outputFooter();
316
310 exit 0; 317 exit 0;
311 318
312 # end of sdlaudiocvt.pl ... 319 # end of sdlgenaudiocvt.pl ...
313 320