Merge branch 'master' into generate
[gfxprim.git] / libs / core / gen / make_GP_Blit.py
blob9d103ac05d4b8d2eb4f6f9e04d0f2c747b44beec
1 #!/usr/bin/python
2 # Script generating GP_Pixel_Blit.gen.c and GP_Pixel_Blit.gen.h
3 # 2011 - Tomas Gavenciak <gavento@ucw.cz>
5 from pixeltype import *
6 from gen_blit import *
7 from gen_utils import *
8 import defs
10 h = []
11 c = []
13 ## Headers
15 gen_headers(h, c,
16 descr = "specialized blit functions and macros",
17 authors = ["2011 - Tomas Gavenciak <gavento@ucw.cz>"],
18 generator = __file__,
19 hdef = "GP_PIXEL_BLIT_GEN_H")
21 c.append('#include <stdio.h>\n')
22 c.append('#include <string.h>\n')
23 c.append('#include "GP_Pixel.h"\n')
24 c.append('#include "GP.h"\n')
25 c.append('#include "GP_Context.h"\n')
26 c.append('#include "GP_Blit.gen.h"\n')
28 for bpp in bitsizes:
29 for bit_endian in bit_endians:
30 if (bpp < 8) or (bit_endian == bit_endians[0]):
31 gen_blit_same_t(bpp, get_size_suffix(bpp, bit_endian), h, c)
33 ## Close the files
35 gen_footers(h, c)
37 ## Write out!
39 if __name__ == '__main__':
40 main_write(h, c)