]> Shamusworld >> Repos - virtualjaguar/blob - src/include/zbmpop16p.h
Adding 1.0.1/2 uncompressed tarballs to tags for historical purposes.
[virtualjaguar] / src / include / zbmpop16p.h
1                 if (flags&FLAGS_READMODIFY)\r
2                 {\r
3                         if (flags&FLAGS_HFLIP)\r
4                         {\r
5                                 if (flags&FLAGS_TRANSPARENT)\r
6                                 {                                       \r
7                                         while (scaled_width)\r
8                                         {\r
9                                                 uint16 c=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);;\r
10                                                 c<<=8;\r
11                                                 c|=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
12                                                 if (c)\r
13                                                 {\r
14                                                         *current_line_buffer--=BLEND_Y(*current_line_buffer,(c>>8));\r
15                                                         *current_line_buffer--=BLEND_CC(*current_line_buffer,(c&0xff));\r
16                                                 }\r
17                                                 else\r
18                                                         current_line_buffer-=2;\r
19                                                 cnt+=hscale_fixed;\r
20                                                 scaled_width--;\r
21                                         }\r
22                                 }\r
23                                 else\r
24                                 {\r
25                                         while (scaled_width)\r
26                                         {\r
27                                                 *current_line_buffer--=BLEND_Y(*current_line_buffer,jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0));\r
28                                                 *current_line_buffer--=BLEND_CC(*current_line_buffer,jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1));\r
29                                                 cnt+=hscale_fixed;\r
30                                                 scaled_width--;\r
31                                         }\r
32                                 }\r
33                         }\r
34                         else\r
35                         {\r
36                                 if (flags&FLAGS_TRANSPARENT)\r
37                                 {                                       \r
38                                         while (scaled_width)\r
39                                         {\r
40                                                 uint16 c=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);;\r
41                                                 c<<=8;\r
42                                                 c|=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
43                                                 if (c)\r
44                                                 {\r
45                                                         *current_line_buffer++=BLEND_Y(*current_line_buffer,(c>>8));\r
46                                                         *current_line_buffer++=BLEND_CC(*current_line_buffer,(c&0xff));\r
47                                                 }\r
48                                                 else\r
49                                                         current_line_buffer+=2;\r
50                                                 cnt+=hscale_fixed;\r
51                                                 scaled_width--;\r
52                                         }\r
53                                 }\r
54                                 else\r
55                                 {\r
56                                         while (scaled_width)\r
57                                         {\r
58                                                 *current_line_buffer++=BLEND_Y(*current_line_buffer,jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0));\r
59                                                 *current_line_buffer++=BLEND_CC(*current_line_buffer,jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1));\r
60                                                 cnt+=hscale_fixed;\r
61                                                 scaled_width--;\r
62                                         }\r
63                                 }\r
64                         }\r
65                 }\r
66                 else\r
67                 {\r
68                         if (flags&FLAGS_HFLIP)\r
69                         {\r
70                                 if (flags&FLAGS_TRANSPARENT)\r
71                                 {                                       \r
72                                         while (scaled_width)\r
73                                         {\r
74                                                 uint16 c=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);;\r
75                                                 c<<=8;\r
76                                                 c|=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
77                                                 if (c)\r
78                                                 {\r
79                                                         *current_line_buffer--=(c>>8);\r
80                                                         *current_line_buffer--=(c&0xff);\r
81                                                 }\r
82                                                 else\r
83                                                         current_line_buffer-=2;\r
84                                                 cnt+=hscale_fixed;\r
85                                                 scaled_width--;\r
86                                         }\r
87                                 }\r
88                                 else\r
89                                 {\r
90                                         while (scaled_width)\r
91                                         {\r
92                                                 *current_line_buffer--=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);\r
93                                                 *current_line_buffer--=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
94                                                 cnt+=hscale_fixed;\r
95                                                 scaled_width--;\r
96                                         }\r
97                                 }\r
98                         }\r
99                         else\r
100                         {\r
101                                 if (flags&FLAGS_TRANSPARENT)\r
102                                 {                                       \r
103                                         while (scaled_width)\r
104                                         {\r
105                                                 uint16 c=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);;\r
106                                                 c<<=8;\r
107                                                 c|=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
108                                                 if (c)\r
109                                                 {\r
110                                                         *current_line_buffer++=(c>>8);\r
111                                                         *current_line_buffer++=(c&0xff);\r
112                                                 }\r
113                                                 else\r
114                                                         current_line_buffer+=2;\r
115                                                 cnt+=hscale_fixed;\r
116                                                 scaled_width--;\r
117                                         }\r
118                                 }\r
119                                 else\r
120                                 {\r
121                                         while (scaled_width)\r
122                                         {\r
123                                                 *current_line_buffer++=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+0);\r
124                                                 *current_line_buffer++=jaguar_byte_read(ptr+((((cnt>>16) & (~0x3))*pitch)+((cnt>>16)&0x3)<<1)+1);\r
125                                                 cnt+=hscale_fixed;\r
126                                                 scaled_width--;\r
127                                         }\r
128                                 }\r
129                         }\r
130                 }\r