Ticket #7962: insane.patch

File insane.patch, 2.9 KB (added by aquadran, 22 years ago)

insane.cpp

Line 
1281a282,362
2> void codec37_proc4(byte *dst, byte *src, int next_offs, int bw, int bh,
3> int pitch, int16 * table)
4> {
5> byte code, *tmp;
6> int i;
7> uint32 t;
8>
9> if (pitch != 320) {
10> warning("invalid pitch");
11> return;
12> }
13>
14> do {
15> i = bw;
16> do {
17> code = *src++;
18> if (code == 0xFD) {
19> t = src[0];
20> t += (t << 8) + (t << 16) + (t << 24);
21> *(uint32 *)(dst + 0) = t;
22> *(uint32 *)(dst + 320) = t;
23> *(uint32 *)(dst + 320 * 2) = t;
24> *(uint32 *)(dst + 320 * 3) = t;
25> src += 1;
26> dst += 4;
27> } else if (code == 0xFE) {
28> t = src[0];
29> t += (t << 8) + (t << 16) + (t << 24);
30> *(uint32 *)(dst + 0) = t;
31> t = src[1];
32> t += (t << 8) + (t << 16) + (t << 24);
33> *(uint32 *)(dst + 320) = t;
34> t = src[2];
35> t += (t << 8) + (t << 16) + (t << 24);
36> *(uint32 *)(dst + 320 * 2) = t;
37> t = src[3];
38> t += (t << 8) + (t << 16) + (t << 24);
39> *(uint32 *)(dst + 320 * 3) = t;
40> src += 4;
41> dst += 4;
42> } else if (code == 0xFF) {
43> *(uint32 *)(dst + 0) = ((uint32 *)src)[0];
44> *(uint32 *)(dst + 320) = ((uint32 *)src)[1];
45> *(uint32 *)(dst + 320 * 2) = ((uint32 *)src)[2];
46> *(uint32 *)(dst + 320 * 3) = ((uint32 *)src)[3];
47> src += 16;
48> dst += 4;
49> } else if (code == 0x00) {
50> uint16 count = src[0] + 1;
51> src += 1;
52> for (uint16 l = 0; l < count; l++) {
53> tmp = dst + next_offs;
54> *(uint32 *)(dst + 0) = *(uint32 *)(tmp);
55> *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320);
56> *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2);
57> *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3);
58> dst += 4;
59> i--;
60> if (i == 0) {
61> i = bw;
62> dst += 320 * 4 - 320;
63> bh--;
64> }
65> }
66> i++;
67> } else {
68> tmp = dst + table[code] + next_offs;
69> *(uint32 *)(dst + 0) = *(uint32 *)(tmp);
70> *(uint32 *)(dst + 320) = *(uint32 *)(tmp + 320);
71> *(uint32 *)(dst + 320 * 2) = *(uint32 *)(tmp + 320 * 2);
72> *(uint32 *)(dst + 320 * 3) = *(uint32 *)(tmp + 320 * 3);
73> dst += 4;
74> }
75> if (i <= 0) break;
76> if (bh <= 0) break;
77> } while (--i);
78> dst += 320 * 4 - 320;
79> if (bh <= 0) break;
80> } while (--bh);
81> }
82>
83467a549,571
84> case 4:{
85> uint16 number = *(uint16 *)(cd->src + 2);
86>
87> if (number && pcd->flags + 1 != number)
88> break;
89>
90> if (number & 1 && cd->src[12] & 1 && cd->flags & 0x10) {
91> _frameChanged = 0;
92> result = true;
93> break;
94> }
95>
96> if ((number & 1) || !(cd->src[12] & 1)) {
97> pcd->curtable ^= 1;
98> }
99>
100> codec37_proc4(pcd->deltaBufs[pcd->curtable], cd->src + 16,
101> pcd->deltaBufs[pcd->curtable ^ 1] -
102> pcd->deltaBufs[pcd->curtable], width_in_blocks,
103> height_in_blocks, src_pitch, pcd->table1);
104> break;
105> }
106>
107469d572
108< case 4: