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