[Scummvm-cvs-logs] CVS: scummvm/scumm/smush codec47.cpp,1.19,1.20

Pawel Kolodziejski aquadran at users.sourceforge.net
Fri Jan 10 08:03:04 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv19691

Modified Files:
	codec47.cpp 
Log Message:
changed table types

Index: codec47.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec47.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- codec47.cpp	10 Jan 2003 00:58:18 -0000	1.19
+++ codec47.cpp	10 Jan 2003 16:02:47 -0000	1.20
@@ -26,139 +26,150 @@
 #include "chunk.h"
 #include "blitter.h"
 
-static const int16 codec37_table[] = {
-		0,  0,  1,  0,  2,  0,  3,  0,  3,  0,  3,  0,  3,
-		0,  2,  0,  1,  0,  0,  0,  0,  0,  0,  0,  1,  0,
-		2,  0,  2,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,
-		0,  1,  0,  2,  0,  3,  0,  3,  0,  3,  0,  3,  0,
-		2,  0,  1,  0,  1,  0,  1,  0,  2,  0,  2,  0,  0,
-		0,  2,  0,  5,  0,  7,  0,  7,  0,  7,  0,  7,  0,
-		7,  0,  7,  0,  5,  0,  2,  0,  0,  0,  0,  0,  0,
-		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-		1,  0,  3,  0,  4,  0,  6,  0,  7,  0,  7,  0,  7,
-		0,  7,  0,  6,  0,  4,  0,  3,  0,  1,  0, -1, -1,
-		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-		0,  2,  0,  3,  0,  5,  0,  8,  0, 13,  0, 21,  0,
-	 -1,  0, -2,  0, -3,  0, -5,  0, -8,  0,-13,  0,-17,
-		0,-21,  0,  0,  1,  1,  1,  2,  1,  3,  1,  5,  1,
-		8,  1, 13,  1, 21,  1, -1,  1, -2,  1, -3,  1, -5,
-		1, -8,  1,-13,  1,-17,  1,-21,  1,  0,  2,  1,  2,
-		2,  2,  3,  2,  5,  2,  8,  2, 13,  2, 21,  2, -1,
-		2, -2,  2, -3,  2, -5,  2, -8,  2,-13,  2,-17,  2,
-	-21,  2,  0,  3,  1,  3,  2,  3,  3,  3,  5,  3,  8,
-		3, 13,  3, 21,  3, -1,  3, -2,  3, -3,  3, -5,  3,
-	 -8,  3,-13,  3,-17,  3,-21,  3,  0,  5,  1,  5,  2,
-		5,  3,  5,  5,  5,  8,  5, 13,  5, 21,  5, -1,  5,
-	 -2,  5, -3,  5, -5,  5, -8,  5,-13,  5,-17,  5,-21,
-		5,  0,  8,  1,  8,  2,  8,  3,  8,  5,  8,  8,  8,
-	 13,  8, 21,  8, -1,  8, -2,  8, -3,  8, -5,  8, -8,
-		8,-13,  8,-17,  8,-21,  8,  0, 13,  1, 13,  2, 13,
-		3, 13,  5, 13,  8, 13, 13, 13, 21, 13, -1, 13, -2,
-	 13, -3, 13, -5, 13, -8, 13,-13, 13,-17, 13,-21, 13,
-		0, 21,  1, 21,  2, 21,  3, 21,  5, 21,  8, 21, 13,
-	 21, 21, 21, -1, 21, -2, 21, -3, 21, -5, 21, -8, 21,
-	-13, 21,-17, 21,-21, 21,  0, -1,  1, -1,  2, -1,  3,
-	 -1,  5, -1,  8, -1, 13, -1, 21, -1, -1, -1, -2, -1,
-	 -3, -1, -5, -1, -8, -1,-13, -1,-17, -1,-21, -1,  0,
-	 -2,  1, -2,  2, -2,  3, -2,  5, -2,  8, -2, 13, -2,
-	 21, -2, -1, -2, -2, -2, -3, -2, -5, -2, -8, -2,-13,
-	 -2,-17, -2,-21, -2,  0, -3,  1, -3,  2, -3,  3, -3,
-		5, -3,  8, -3, 13, -3, 21, -3, -1, -3, -2, -3, -3,
-	 -3, -5, -3, -8, -3,-13, -3,-17, -3,-21, -3,  0, -5,
-		1, -5,  2, -5,  3, -5,  5, -5,  8, -5, 13, -5, 21,
-	 -5, -1, -5, -2, -5, -3, -5, -5, -5, -8, -5,-13, -5,
-	-17, -5,-21, -5,  0, -8,  1, -8,  2, -8,  3, -8,  5,
-	 -8,  8, -8, 13, -8, 21, -8, -1, -8, -2, -8, -3, -8,
-	 -5, -8, -8, -8,-13, -8,-17, -8,-21, -8,  0,-13,  1,
-	-13,  2,-13,  3,-13,  5,-13,  8,-13, 13,-13, 21,-13,
-	 -1,-13, -2,-13, -3,-13, -5,-13, -8,-13,-13,-13,-17,
-	-13,-21,-13,  0,-17,  1,-17,  2,-17,  3,-17,  5,-17,
-		8,-17, 13,-17, 21,-17, -1,-17, -2,-17, -3,-17, -5,
-	-17, -8,-17,-13,-17,-17,-17,-21,-17,  0,-21,  1,-21,
-		2,-21,  3,-21,  5,-21,  8,-21, 13,-21, 21,-21, -1,
-	-21, -2,-21, -3,-21, -5,-21, -8,-21,-13,-21,-17,-21,
-		0,  0, -8,-29,  8,-29,-18,-25, 17,-25,  0,-23, -6,
-	-22,  6,-22,-13,-19, 12,-19,  0,-18, 25,-18,-25,-17,
-	 -5,-17,  5,-17,-10,-15, 10,-15,  0,-14, -4,-13,  4,
-	-13, 19,-13,-19,-12, -8,-11, -2,-11,  0,-11,  2,-11,
-		8,-11,-15,-10, -4,-10,  4,-10, 15,-10, -6, -9, -1,
-	 -9,  1, -9,  6, -9,-29, -8,-11, -8, -8, -8, -3, -8,
-		3, -8,  8, -8, 11, -8, 29, -8, -5, -7, -2, -7,  0,
-	 -7,  2, -7,  5, -7,-22, -6, -9, -6, -6, -6, -3, -6,
-	 -1, -6,  1, -6,  3, -6,  6, -6,  9, -6, 22, -6,-17,
-	 -5, -7, -5, -4, -5, -2, -5,  0, -5,  2, -5,  4, -5,
-		7, -5, 17, -5,-13, -4,-10, -4, -5, -4, -3, -4, -1,
-	 -4,  0, -4,  1, -4,  3, -4,  5, -4, 10, -4, 13, -4,
-	 -8, -3, -6, -3, -4, -3, -3, -3, -2, -3, -1, -3,  0,
-	 -3,  1, -3,  2, -3,  4, -3,  6, -3,  8, -3,-11, -2,
-	 -7, -2, -5, -2, -3, -2, -2, -2, -1, -2,  0, -2,  1,
-	 -2,  2, -2,  3, -2,  5, -2,  7, -2, 11, -2, -9, -1,
-	 -6, -1, -4, -1, -3, -1, -2, -1, -1, -1,  0, -1,  1,
-	 -1,  2, -1,  3, -1,  4, -1,  6, -1,  9, -1,-31,  0,
-	-23,  0,-18,  0,-14,  0,-11,  0, -7,  0, -5,  0, -4,
-		0, -3,  0, -2,  0, -1,  0,  0,-31,  1,  0,  2,  0,
-		3,  0,  4,  0,  5,  0,  7,  0, 11,  0, 14,  0, 18,
-		0, 23,  0, 31,  0, -9,  1, -6,  1, -4,  1, -3,  1,
-	 -2,  1, -1,  1,  0,  1,  1,  1,  2,  1,  3,  1,  4,
-		1,  6,  1,  9,  1,-11,  2, -7,  2, -5,  2, -3,  2,
-	 -2,  2, -1,  2,  0,  2,  1,  2,  2,  2,  3,  2,  5,
-		2,  7,  2, 11,  2, -8,  3, -6,  3, -4,  3, -2,  3,
-	 -1,  3,  0,  3,  1,  3,  2,  3,  3,  3,  4,  3,  6,
-		3,  8,  3,-13,  4,-10,  4, -5,  4, -3,  4, -1,  4,
-		0,  4,  1,  4,  3,  4,  5,  4, 10,  4, 13,  4,-17,
-		5, -7,  5, -4,  5, -2,  5,  0,  5,  2,  5,  4,  5,
-		7,  5, 17,  5,-22,  6, -9,  6, -6,  6, -3,  6, -1,
-		6,  1,  6,  3,  6,  6,  6,  9,  6, 22,  6, -5,  7,
-	 -2,  7,  0,  7,  2,  7,  5,  7,-29,  8,-11,  8, -8,
-		8, -3,  8,  3,  8,  8,  8, 11,  8, 29,  8, -6,  9,
-	 -1,  9,  1,  9,  6,  9,-15, 10, -4, 10,  4, 10, 15,
-	 10, -8, 11, -2, 11,  0, 11,  2, 11,  8, 11, 19, 12,
-	-19, 13, -4, 13,  4, 13,  0, 14,-10, 15, 10, 15, -5,
-	 17,  5, 17, 25, 17,-25, 18,  0, 18,-12, 19, 13, 19,
-	 -6, 22,  6, 22,  0, 23,-17, 25, 18, 25, -8, 29,  8,
-	 29,  0, 31,  0,  0, -6,-22,  6,-22,-13,-19, 12,-19,
-		0,-18, -5,-17,  5,-17,-10,-15, 10,-15,  0,-14, -4,
-	-13,  4,-13, 19,-13,-19,-12, -8,-11, -2,-11,  0,-11,
-		2,-11,  8,-11,-15,-10, -4,-10,  4,-10, 15,-10, -6,
-	 -9, -1, -9,  1, -9,  6, -9,-11, -8, -8, -8, -3, -8,
-		0, -8,  3, -8,  8, -8, 11, -8, -5, -7, -2, -7,  0,
-	 -7,  2, -7,  5, -7,-22, -6, -9, -6, -6, -6, -3, -6,
-	 -1, -6,  1, -6,  3, -6,  6, -6,  9, -6, 22, -6,-17,
-	 -5, -7, -5, -4, -5, -2, -5, -1, -5,  0, -5,  1, -5,
-		2, -5,  4, -5,  7, -5, 17, -5,-13, -4,-10, -4, -5,
-	 -4, -3, -4, -2, -4, -1, -4,  0, -4,  1, -4,  2, -4,
-		3, -4,  5, -4, 10, -4, 13, -4, -8, -3, -6, -3, -4,
-	 -3, -3, -3, -2, -3, -1, -3,  0, -3,  1, -3,  2, -3,
-		3, -3,  4, -3,  6, -3,  8, -3,-11, -2, -7, -2, -5,
-	 -2, -4, -2, -3, -2, -2, -2, -1, -2,  0, -2,  1, -2,
-		2, -2,  3, -2,  4, -2,  5, -2,  7, -2, 11, -2, -9,
-	 -1, -6, -1, -5, -1, -4, -1, -3, -1, -2, -1, -1, -1,
-		0, -1,  1, -1,  2, -1,  3, -1,  4, -1,  5, -1,  6,
-	 -1,  9, -1,-23,  0,-18,  0,-14,  0,-11,  0, -7,  0,
-	 -5,  0, -4,  0, -3,  0, -2,  0, -1,  0,  0,-23,  1,
-		0,  2,  0,  3,  0,  4,  0,  5,  0,  7,  0, 11,  0,
-	 14,  0, 18,  0, 23,  0, -9,  1, -6,  1, -5,  1, -4,
-		1, -3,  1, -2,  1, -1,  1,  0,  1,  1,  1,  2,  1,
-		3,  1,  4,  1,  5,  1,  6,  1,  9,  1,-11,  2, -7,
-		2, -5,  2, -4,  2, -3,  2, -2,  2, -1,  2,  0,  2,
-		1,  2,  2,  2,  3,  2,  4,  2,  5,  2,  7,  2, 11,
-		2, -8,  3, -6,  3, -4,  3, -3,  3, -2,  3, -1,  3,
-		0,  3,  1,  3,  2,  3,  3,  3,  4,  3,  6,  3,  8,
-		3,-13,  4,-10,  4, -5,  4, -3,  4, -2,  4, -1,  4,
-		0,  4,  1,  4,  2,  4,  3,  4,  5,  4, 10,  4, 13,
-		4,-17,  5, -7,  5, -4,  5, -2,  5, -1,  5,  0,  5,
-		1,  5,  2,  5,  4,  5,  7,  5, 17,  5,-22,  6, -9,
-		6, -6,  6, -3,  6, -1,  6,  1,  6,  3,  6,  6,  6,
-		9,  6, 22,  6, -5,  7, -2,  7,  0,  7,  2,  7,  5,
-		7,-11,  8, -8,  8, -3,  8,  0,  8,  3,  8,  8,  8,
-	 11,  8, -6,  9, -1,  9,  1,  9,  6,  9,-15, 10, -4,
-	 10,  4, 10, 15, 10, -8, 11, -2, 11,  0, 11,  2, 11,
-		8, 11, 19, 12,-19, 13, -4, 13,  4, 13,  0, 14,-10,
-	 15, 10, 15, -5, 17,  5, 17,  0, 18,-12, 19, 13, 19,
-	 -6, 22,  6, 22,  0, 23
+static int32 codec37_table[] = {
+       0,       1,       2,       3,       3,       3,
+       3,       2,       1,       0,       0,       0,
+       1,       2,       2,       1,       0,       0,
+       0,       0,       1,       2,       3,       3,
+       3,       3,       2,       1,       1,       1,
+       2,       2,       0,       2,       5,       7,
+       7,       7,       7,       7,       7,       5,
+       2,       0,       0,       0,       0,       0,
+       0,       0,       0,       0,       1,       3,
+       4,       6,       7,       7,       7,       7,
+       6,       4,       3,       1,      -1,       0,
+       0,       0,       0,       0,       0,       1,
+       2,       3,       5,       8,      13,      21,
+   65535,   65534,   65533,   65531,   65528,   65523,
+   65519,   65515,   65536,   65537,   65538,   65539,
+   65541,   65544,   65549,   65557,  131071,  131070,
+  131069,  131067,  131064,  131059,  131055,  131051,
+  131072,  131073,  131074,  131075,  131077,  131080,
+  131085,  131093,  196607,  196606,  196605,  196603,
+  196600,  196595,  196591,  196587,  196608,  196609,
+  196610,  196611,  196613,  196616,  196621,  196629,
+  262143,  262142,  262141,  262139,  262136,  262131,
+  262127,  262123,  327680,  327681,  327682,  327683,
+  327685,  327688,  327693,  327701,  393215,  393214,
+  393213,  393211,  393208,  393203,  393199,  393195,
+  524288,  524289,  524290,  524291,  524293,  524296,
+  524301,  524309,  589823,  589822,  589821,  589819,
+  589816,  589811,  589807,  589803,  851968,  851969,
+  851970,  851971,  851973,  851976,  851981,  851989,
+  917503,  917502,  917501,  917499,  917496,  917491,
+  917487,  917483, 1376256, 1376257, 1376258, 1376259,
+ 1376261, 1376264, 1376269, 1376277, 1441791, 1441790,
+ 1441789, 1441787, 1441784, 1441779, 1441775, 1441771,
+  -65536,  -65535,  -65534,  -65533,  -65531,  -65528,
+  -65523,  -65515,      -1,      -2,      -3,      -5,
+      -8,     -13,     -17,     -21, -131072, -131071,
+ -131070, -131069, -131067, -131064, -131059, -131051,
+  -65537,  -65538,  -65539,  -65541,  -65544,  -65549,
+  -65553,  -65557, -196608, -196607, -196606, -196605,
+ -196603, -196600, -196595, -196587, -131073, -131074,
+ -131075, -131077, -131080, -131085, -131089, -131093,
+ -327680, -327679, -327678, -327677, -327675, -327672,
+ -327667, -327659, -262145, -262146, -262147, -262149,
+ -262152, -262157, -262161, -262165, -524288, -524287,
+ -524286, -524285, -524283, -524280, -524275, -524267,
+ -458753, -458754, -458755, -458757, -458760, -458765,
+ -458769, -458773, -851968, -851967, -851966, -851965,
+ -851963, -851960, -851955, -851947, -786433, -786434,
+ -786435, -786437, -786440, -786445, -786449, -786453,
+-1114112,-1114111,-1114110,-1114109,-1114107,-1114104,
+-1114099,-1114091,-1048577,-1048578,-1048579,-1048581,
+-1048584,-1048589,-1048593,-1048597,-1376256,-1376255,
+-1376254,-1376253,-1376251,-1376248,-1376243,-1376235,
+-1310721,-1310722,-1310723,-1310725,-1310728,-1310733,
+-1310737,       0,-1835016,-1900536,-1572882,-1638383,
+-1507328,-1376262,-1441786,-1179661,-1245172,-1179648,
+-1179623,-1048601,-1048581,-1114107, -917514, -983030,
+ -917504, -786436, -851964, -851949, -720915, -655368,
+ -655362, -720896, -720894, -720888, -589839, -589828,
+ -655356, -655345, -524294, -524289, -589823, -589818,
+ -458781, -458763, -458760, -458755, -524285, -524280,
+ -524277, -524259, -393221, -393218, -458752, -458750,
+ -458747, -327702, -327689, -327686, -327683, -327681,
+ -393215, -393213, -393210, -393207, -393194, -262161,
+ -262151, -262148, -262146, -327680, -327678, -327676,
+ -327673, -327663, -196621, -196618, -196613, -196611,
+ -196609, -262144, -262143, -262141, -262139, -262134,
+ -262131, -131080, -131078, -131076, -131075, -131074,
+ -131073, -196608, -196607, -196606, -196604, -196602,
+ -196600,  -65547,  -65543,  -65541,  -65539,  -65538,
+  -65537, -131072, -131071, -131070, -131069, -131067,
+ -131065, -131061,      -9,      -6,      -4,      -3,
+      -2,      -1,  -65536,  -65535,  -65534,  -65533,
+  -65532,  -65530,  -65527,   65505,   65513,   65518,
+   65522,   65525,   65529,   65531,   65532,   65533,
+   65534,   65535,-2031616,       1,       2,       3,
+       4,       5,       7,      11,      14,      18,
+      23,      31,  131063,  131066,  131068,  131069,
+  131070,  131071,   65536,   65537,   65538,   65539,
+   65540,   65542,   65545,  196597,  196601,  196603,
+  196605,  196606,  196607,  131072,  131073,  131074,
+  131075,  131077,  131079,  131083,  262136,  262138,
+  262140,  262142,  262143,  196608,  196609,  196610,
+  196611,  196612,  196614,  196616,  327667,  327670,
+  327675,  327677,  327679,  262144,  262145,  262147,
+  262149,  262154,  262157,  393199,  393209,  393212,
+  393214,  327680,  327682,  327684,  327687,  327697,
+  458730,  458743,  458746,  458749,  458751,  393217,
+  393219,  393222,  393225,  393238,  524283,  524286,
+  458752,  458754,  458757,  589795,  589813,  589816,
+  589821,  524291,  524296,  524299,  524317,  655354,
+  655359,  589825,  589830,  720881,  720892,  655364,
+  655375,  786424,  786430,  720896,  720898,  720904,
+  786451,  917485,  917500,  851972,  917504, 1048566,
+  983050, 1179643, 1114117, 1114137, 1245159, 1179648,
+ 1310708, 1245197, 1507322, 1441798, 1507328, 1703919,
+ 1638418, 1966072, 1900552, 2031616,       0,-1376262,
+-1441786,-1179661,-1245172,-1179648,-1048581,-1114107,
+ -917514, -983030, -917504, -786436, -851964, -851949,
+ -720915, -655368, -655362, -720896, -720894, -720888,
+ -589839, -589828, -655356, -655345, -524294, -524289,
+ -589823, -589818, -458763, -458760, -458755, -524288,
+ -524285, -524280, -524277, -393221, -393218, -458752,
+ -458750, -458747, -327702, -327689, -327686, -327683,
+ -327681, -393215, -393213, -393210, -393207, -393194,
+ -262161, -262151, -262148, -262146, -262145, -327680,
+ -327679, -327678, -327676, -327673, -327663, -196621,
+ -196618, -196613, -196611, -196610, -196609, -262144,
+ -262143, -262142, -262141, -262139, -262134, -262131,
+ -131080, -131078, -131076, -131075, -131074, -131073,
+ -196608, -196607, -196606, -196605, -196604, -196602,
+ -196600,  -65547,  -65543,  -65541,  -65540,  -65539,
+  -65538,  -65537, -131072, -131071, -131070, -131069,
+ -131068, -131067, -131065, -131061,      -9,      -6,
+      -5,      -4,      -3,      -2,      -1,  -65536,
+  -65535,  -65534,  -65533,  -65532,  -65531,  -65530,
+  -65527,   65513,   65518,   65522,   65525,   65529,
+   65531,   65532,   65533,   65534,   65535,-1507328,
+       1,       2,       3,       4,       5,       7,
+      11,      14,      18,      23,  131063,  131066,
+  131067,  131068,  131069,  131070,  131071,   65536,
+   65537,   65538,   65539,   65540,   65541,   65542,
+   65545,  196597,  196601,  196603,  196604,  196605,
+  196606,  196607,  131072,  131073,  131074,  131075,
+  131076,  131077,  131079,  131083,  262136,  262138,
+  262140,  262141,  262142,  262143,  196608,  196609,
+  196610,  196611,  196612,  196614,  196616,  327667,
+  327670,  327675,  327677,  327678,  327679,  262144,
+  262145,  262146,  262147,  262149,  262154,  262157,
+  393199,  393209,  393212,  393214,  393215,  327680,
+  327681,  327682,  327684,  327687,  327697,  458730,
+  458743,  458746,  458749,  458751,  393217,  393219,
+  393222,  393225,  393238,  524283,  524286,  458752,
+  458754,  458757,  589813,  589816,  589821,  524288,
+  524291,  524296,  524299,  655354,  655359,  589825,
+  589830,  720881,  720892,  655364,  655375,  786424,
+  786430,  720896,  720898,  720904,  786451,  917485,
+  917500,  851972,  917504, 1048566,  983050, 1179643,
+ 1114117, 1179648, 1310708, 1245197, 1507322, 1441798,
+ 1507328
 };
 
-static const int16 codec47_table[] = {
+static int16 codec47_table[] = {
 		0,   0,  -1, -43,   6, -43,  -9, -42,  13, -41,
 	-16, -40,  19, -39, -23, -36,  26, -34,  -2, -33,
 	  4, -33, -29, -32,  -9, -32,  11, -31, -16, -29,
@@ -269,12 +280,9 @@
 
 static int32 last_table_width;
 
-static int16 smush_buf_big[49664];
-//static byte smush_mktable1[99072];
-static int16 smush_buf_small[16384];
-//static byte smush_mktable2[32768];
+static byte smush_buf_big[99328];
+static byte smush_buf_small[32768];
 static byte smush_buffer[65536];
-
 static int16 codec47_temp_table[256];
 
 void mk_tables(int32 param) {
@@ -287,14 +295,14 @@
 	byte * ptr;
 
 	if (param == 8) {
-		table37_1 = (int32*)&codec37_table[64];
-		table37_2 = (int32*)&codec37_table[96];
-		ptr = (byte*)&smush_buf_big + 384;
+		table37_1 = &codec37_table[32];
+		table37_2 = &codec37_table[48];
+		ptr = smush_buf_big + 384;
 		for (l = 0; l < 256; l++) {
 			*ptr = 0;
 			ptr += 388;
 		}
-		ptr = (byte*)&smush_buf_big + 385;
+		ptr = smush_buf_big + 385;
 		for (l = 0; l < 256; l++) {
 			*ptr = 0;
 			ptr += 388;
@@ -302,14 +310,14 @@
 	}
 
 	if (param == 4) {
-		table37_1 = (int32*)&codec37_table[0];
-		table37_2 = (int32*)&codec37_table[32];
-		ptr = (byte*)&smush_buf_small + 96;
+		table37_1 = &codec37_table[0];
+		table37_2 = &codec37_table[16];
+		ptr = smush_buf_small + 96;
 		for (l = 0; l < 256; l++) {
 			*ptr = 0;
 			ptr += 128;
 		}
-		ptr = (byte*)&smush_buf_small + 97;
+		ptr = smush_buf_small + 97;
 		for (l = 0; l < 256; l++) {
 			*ptr = 0;
 			ptr += 128;
@@ -327,7 +335,7 @@
 		tmp_table37_2_2 = table37_2;
 		count_2 = 16;
 		do {
-			tmp = *(int32*)(tmp_table37_2_1);
+			tmp = *(tmp_table37_2_1);
 			tmp_value1 = tmp;
 			if (tmp == 0) {
 				b1 = 0;
@@ -338,7 +346,7 @@
 				goto label3;
 			} 
 			b1 = 2;
-			tmp = *(int32*)(tmp_table37_1_1);
+			tmp = *(tmp_table37_1_1);
 			if (tmp != 0) {
 				b1 = 0;
 				tmp -= param;
@@ -348,7 +356,7 @@
 					b1 = 4;
 			}
 label3:
-			tmp = *(int32*)(tmp_table37_2_2);
+			tmp = *(tmp_table37_2_2);
 			tmp_value2 = tmp;
 			if (tmp == 0) {
 				b2 = 0;
@@ -358,7 +366,7 @@
 				b2 = 1;
 				goto label4;
 			}
-			tmp = *(int32*)(tmp_table37_1_2);
+			tmp = *(tmp_table37_1_2);
 			if (tmp == 0) {
 				b2 = 2;
 				goto label4;
@@ -376,8 +384,8 @@
 					table[d] = 0;
 				} while (d-- != 0);
 			}
-			value_table37_1_1 = *(int32*)(tmp_table37_1_1);
-			value_table37_1_2 = *(int32*)(tmp_table37_1_2);
+			value_table37_1_1 = *(tmp_table37_1_1);
+			value_table37_1_2 = *(tmp_table37_1_2);
 			tmp_c = abs(tmp_value2 - tmp_value1);
 			tmp_a = abs(value_table37_1_2 - value_table37_1_1);
 			if (tmp_c <= tmp_a) {
@@ -425,7 +433,7 @@
 				tmp_c *= tmp_a;
 				tmp_c += tmp_d;
 				tmp_table = &table[tmp_c];
-				*(int32*)(tmp_table) = 1;
+				*(tmp_table) = 1;
 				if (b1 != 2)
 					goto label8;
 				if (b2 == 3)
@@ -451,7 +459,7 @@
 				tmp_c = param;
 				tmp_c <<= 2;
 				do {
-					*(int32*)(tmp_table) = 1;
+					*(tmp_table) = 1;
 					tmp_table -= tmp_c / 4;
 				} while (--tmp_a >= 0);
 				goto label26;
@@ -474,7 +482,7 @@
 				tmp_d = param;
 				tmp_d -= tmp_a;
 				do {
-					*(int32*)(tmp_table) = 1;
+					*(tmp_table) = 1;
 					tmp_table += tmp_c / 4;
 				} while (--tmp_d != 0);
 				goto label26;
@@ -506,7 +514,7 @@
 				tmp_c -= variable4;
 				d = tmp_c;
 				do {
-					*(uint32*)(tmp_table++) = 1;
+					*(tmp_table++) = 1;
 				} while (--d != 0);
 				goto label26;
 label22:
@@ -525,7 +533,7 @@
 					tmp_c = variable4 + 1;
 					d = tmp_c;
 					do {
-						*(uint32*)(tmp_table--) = 1;
+						*(tmp_table--) = 1;
 					} while (--d != 0);
 				}
 label26:;
@@ -536,11 +544,11 @@
 					tmp_c = tmp_param_tmp;
 					do {
 						if (table[tmp_c] != 0) {
-							*((byte*)&smush_buf_big + 256 + s + *((byte*)&smush_buf_big + 384 + s)) = (byte)tmp_c;
-							*((byte*)&smush_buf_big + 384 + s) = *((byte*)&smush_buf_big + 384 + s) + 1;
+							smush_buf_big[256 + s + smush_buf_big[384 + s]] = (byte)tmp_c;
+							smush_buf_big[384 + s]++;
 						} else {
-							*((byte*)&smush_buf_big + 320 + s + *((byte*)&smush_buf_big + 385 + s)) = (byte)tmp_c;
-							*((byte*)&smush_buf_big + 385 + s) = *((byte*)&smush_buf_big + 385 + s) + 1;
+							smush_buf_big[320 + s + smush_buf_big[385 + s]] = (byte)tmp_c;
+							smush_buf_big[385 + s]++;
 						}
 					} while (tmp_c-- != 0);
 				}
@@ -548,11 +556,11 @@
 					tmp_c = tmp_param_tmp;
 					do {
 						if (table[tmp_c] != 0) {
-							*((byte*)&smush_buf_small + 64 + p + *((byte*)&smush_buf_small + 96 + p)) = (byte)tmp_c;
-							*((byte*)&smush_buf_small + 96 + p) = *((byte*)&smush_buf_small + 96 + p) + 1;
+							smush_buf_small[64 + p + smush_buf_small[96 + p]] = (byte)tmp_c;
+							smush_buf_small[96 + p]++;
 						} else {
-							*((byte*)&smush_buf_small + 80 + p + *((byte*)&smush_buf_small + 97 + p)) = (byte)tmp_c;
-							*((byte*)&smush_buf_small + 97 + p) = *((byte*)&smush_buf_small + 97 + p) + 1;
+							smush_buf_small[80 + p + smush_buf_small[97 + p]] = (byte)tmp_c;
+							smush_buf_small[97 + p]++;
 						}
 					} while (tmp_c-- != 0);
 				}
@@ -575,15 +583,15 @@
 	int32 a, c, d, s, tmp_value, tmp_offset;
 	int16 tmp, tmp2;
 
-	int16 * tmp_ptr = (int16*)&codec47_temp_table;
-	int16 * ptr_table = (int16*)&codec47_table[1];
+	int16 * tmp_ptr = codec47_temp_table;
+	int16 * ptr_table = &codec47_table[1];
 	do {
-		int16 tmp_word = *(int16*)(ptr_table);
+		int16 tmp_word = *(ptr_table);
 		ptr_table += 2;
 		tmp_word *= (int16)width;
-		tmp_word += *(int16*)(ptr_table - 3);
+		tmp_word += *(ptr_table - 3);
 		tmp_ptr++;
-		*(int16*)(tmp_ptr - 1) = tmp_word;
+		*(tmp_ptr - 1) = tmp_word;
 	} while (tmp_ptr < &codec47_temp_table[255]);
 	a = 0;
 	c = 0;
@@ -591,42 +599,44 @@
 	tmp_value = 0;
 	do {
 		d = 0;
-		tmp = *((byte*)&smush_buf_small + 96 + c);
+		tmp = smush_buf_small[96 + c];
 		if (tmp != 0) {
 			do {
-				tmp = *((byte*)&smush_buf_small + 64 + c + d);
+				tmp = smush_buf_small[64 + c + d];
 				tmp2 = tmp;
 				tmp2 >>= 2;
 				tmp &= 3;
 				tmp2 &= 0xFFFF00FF;
 				tmp2 *= (int16)width;
 				tmp2 += tmp;
-				smush_buf_small[s + d] = tmp2;
+				smush_buf_small[(s + d) * 2] = (byte)tmp2;
+				smush_buf_small[(s + d) * 2 + 1] = tmp2 >> 8;
 				d++;
-				tmp = *((byte*)&smush_buf_small + 96 + c);
+				tmp = smush_buf_small[96 + c];
 			} while (tmp > d);
 		}
 		d = 0;
 		tmp = *((byte*)&smush_buf_small + 97 + c);
 		if (tmp != 0) {
 			do {
-				tmp = *((byte*)&smush_buf_small + 80 + c + d);
+				tmp = smush_buf_small[80 + c + d];
 				tmp2 = tmp;
 				tmp2 >>= 2;
 				tmp &= 3;
 				tmp2 &= 0xFFFF00FF;
 				tmp2 *= (int16)width;
 				tmp2 += tmp;
-				smush_buf_small[16 + s + d] = tmp2;
+				smush_buf_small[32 + (s + d) * 2] = (byte)tmp2;
+				smush_buf_small[32 + (s + d) * 2 + 1] = tmp2 >> 8;
 				d++;
-				tmp = *((byte*)&smush_buf_small + 97 + c);
+				tmp = smush_buf_small[97 + c];
 			} while (tmp > d);
 		}
 		d = 0;
 		tmp = *((byte*)&smush_buf_big + 384 + a);
 		if (tmp != 0) {
 			do {
-				tmp = *((byte*)&smush_buf_big + 256 + a + d);
+				tmp = smush_buf_big[256 + a + d];
 				tmp2 = tmp >> 3;
 				tmp = tmp & 7;
 				tmp2 &= 0xFFFF00FF;
@@ -635,15 +645,16 @@
 				tmp_offset = tmp_value;
 				tmp_offset += d;
 				d++;
-				smush_buf_big[tmp_offset] = tmp2;
-				tmp = *((byte*)&smush_buf_big + 384 + a);
+				smush_buf_big[tmp_offset * 2] = (byte)tmp2;
+				smush_buf_big[tmp_offset * 2 + 1] = tmp2 >> 8;
+				tmp = smush_buf_big[384 + a];
 			} while (tmp > d);
 		}
 		d = 0;
-		tmp = *((byte*)&smush_buf_big + 385 + a);
+		tmp = smush_buf_big[385 + a];
 		if (tmp != 0) {
 			do {
-				tmp = *((byte*)&smush_buf_big + 320 + a + d);
+				tmp = smush_buf_big[320 + a + d];
 				tmp2 = tmp >> 3;
 				tmp = tmp & 7;
 				tmp2 &= 0xFFFF00FF;
@@ -652,8 +663,9 @@
 				tmp_offset = tmp_value;
 				tmp_offset += d;
 				d++;
-				smush_buf_big[64 + tmp_offset] = tmp2;
-				tmp = *((byte*)&smush_buf_big + 385 + a);
+				smush_buf_big[128 + (tmp_offset * 2)] = (byte)tmp2;
+				smush_buf_big[128 + (tmp_offset * 2) + 1] = tmp2 >> 8;
+				tmp = smush_buf_big[385 + a];
 			} while (tmp > d);
 		}
 		
@@ -690,8 +702,8 @@
 static int16 * codec47_decode2_table;
 static int32 d_pitch;
 static byte * codec47_decode2_param_ptr;
-static int16 * codec47_decode2_buf_small;
-static int16 * codec47_decode2_buf_big;
+static byte * codec47_decode2_buf_small;
+static byte * codec47_decode2_buf_big;
 static int32 codec47_subgfx_width_blocks;
 static int32 codec47_subgfx_height_blocks;
 static int32 codec47_subgfx_width_pixels;
@@ -772,7 +784,7 @@
 		return;
 	}
 	if (code == 0xFD) {
-		byte * tmp_ptr = (*(d_src + 1) << 7) + (byte*)codec47_decode2_buf_small;
+		byte * tmp_ptr = (*(d_src + 1) << 7) + codec47_decode2_buf_small;
 		int32 l = *(tmp_ptr + 96);
 		byte val = *(d_src + 2);
 		int16 * tmp_ptr2 = (int16*)tmp_ptr;
@@ -874,7 +886,7 @@
 		tmp2 = tmp * 4;
 		tmp <<= 7;
 		int32 tmp3 = tmp2 + tmp * 2;
-		byte * tmp_ptr = tmp + tmp3 + (byte*)codec47_decode2_buf_big;
+		byte * tmp_ptr = tmp + tmp3 + codec47_decode2_buf_big;
 		byte l = *(tmp_ptr + 384);
 		byte val = *(d_src + 2);
 		int16 * tmp_ptr2 = (int16*)tmp_ptr;
@@ -948,7 +960,7 @@
 
 static void decode2(byte * dst, byte * src, int32 offset1, int32 offset2, int32 pitch,
 						 int16 * tmp_table, byte * param_ptr, int32 height, int32,
-						 int16 * buf_small, int16 * buf_big) {
+						 byte * buf_small, byte * buf_big) {
 	d_dst = dst;
 	d_src = src;
 	codec47_decode2_offset1 = offset1;
@@ -1017,7 +1029,7 @@
 }
 
 bool Codec47Decoder::decode(Blitter & dst, Chunk & src) {
-	g_out = dst.getPtr();
+	g_out = _curBuf;
 	int32 width = getRect().width();
 	int32 height = getRect().height();
 	int32 offset1 = _deltaBufs[1] - _curBuf;





More information about the Scummvm-git-logs mailing list