]> Shamusworld >> Repos - virtualjaguar/blob - src/include/fbmpop24p.h
Initial revision
[virtualjaguar] / src / include / fbmpop24p.h
1                 int count=0;
2                 if (flags&FLAGS_HFLIP)
3                 {
4                         if (flags&FLAGS_TRANSPARENT)
5                         {
6                                 while (iwidth)
7                                 {
8                                         uint32 data=jaguar_byte_read(ptr++);
9                                         data<<=8;
10                                         data|=jaguar_byte_read(ptr++);
11                                         data<<=8;
12                                         data|=jaguar_byte_read(ptr++);
13                                         data<<=8;
14                                         data|=jaguar_byte_read(ptr++);
15                                         if (data)
16                                         {
17                                                 *current_line_buffer--=(data>>24)&0xff;
18                                                 *current_line_buffer--=(data>>16)&0xff;
19                                                 *current_line_buffer--=(data>> 8)&0xff;
20                                                 *current_line_buffer--=data      &0xff;
21                                         }
22                                         else
23                                                 current_line_buffer-=4;
24                                         count+=4;
25                                         if (count==8) // 8 bytes = a phrase (64 bits)
26                                         {
27                                                 ptr-=8*(pitch-1);
28                                                 count=0;
29                                         }
30                                         iwidth--;
31                                 }
32                         }
33                         else
34                         {
35                                 while (iwidth)
36                                 {
37                                         *current_line_buffer++=jaguar_byte_read(ptr++);
38                                         *current_line_buffer++=jaguar_byte_read(ptr++);
39                                         *current_line_buffer++=jaguar_byte_read(ptr++);
40                                         *current_line_buffer++=jaguar_byte_read(ptr++);
41                                         iwidth--;
42                                         count+=4;
43                                         if (count==8) // 8 bytes = a phrase (64 bits)
44                                         {
45                                                 ptr+=8*(pitch-1);
46                                                 count=0;
47                                         }
48                                 }
49                         }
50                 }
51                 else
52                 {
53                         if (flags&FLAGS_TRANSPARENT)
54                         {
55                                 while (iwidth)
56                                 {
57                                         uint32 data=jaguar_byte_read(ptr++);
58                                         data<<=8;
59                                         data|=jaguar_byte_read(ptr++);
60                                         data<<=8;
61                                         data|=jaguar_byte_read(ptr++);
62                                         data<<=8;
63                                         data|=jaguar_byte_read(ptr++);
64                                         if (data)
65                                         {
66                                                 *current_line_buffer++=(data>>24)&0xff;
67                                                 *current_line_buffer++=(data>>16)&0xff;
68                                                 *current_line_buffer++=(data>> 8)&0xff;
69                                                 *current_line_buffer++=data      &0xff;
70                                         }
71                                         else
72                                                 current_line_buffer+=4;
73                                         count+=4;
74                                         if (count==8) // 8 bytes = a phrase (64 bits)
75                                         {
76                                                 ptr-=8*(pitch-1);
77                                                 count=0;
78                                         }
79                                         iwidth--;
80                                 }
81                         }
82                         else
83                         {
84                                 while (iwidth)
85                                 {
86                                         *current_line_buffer++=jaguar_byte_read(ptr++);
87                                         *current_line_buffer++=jaguar_byte_read(ptr++);
88                                         *current_line_buffer++=jaguar_byte_read(ptr++);
89                                         *current_line_buffer++=jaguar_byte_read(ptr++);
90                                         count+=4;
91                                         if (count==8) // 8 bytes = a phrase (64 bits)
92                                         {
93                                                 ptr+=8*(pitch-1);
94                                                 count=0;
95                                         }
96                                         iwidth--;
97                                 }
98                         }
99                 }