diff options
-rw-r--r-- | engines/sci/scicore/decompress0.cpp | 2 | ||||
-rw-r--r-- | engines/sci/scicore/decompress01.cpp | 56 |
2 files changed, 29 insertions, 29 deletions
diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp index 701c70e639..e74aa65c86 100644 --- a/engines/sci/scicore/decompress0.cpp +++ b/engines/sci/scicore/decompress0.cpp @@ -191,7 +191,7 @@ gint16 getc2(guint8 *node, guint8 *src, guint16 *bytectr, guint16 *bitctr, int c node += next << 1; } - return (int16)READ_UINT16(node); + return (int16)READ_LE_UINT16(node); } // Huffman token decryptor diff --git a/engines/sci/scicore/decompress01.cpp b/engines/sci/scicore/decompress01.cpp index 224a142a06..352a4478ee 100644 --- a/engines/sci/scicore/decompress01.cpp +++ b/engines/sci/scicore/decompress01.cpp @@ -277,16 +277,16 @@ byte *pic_reorder(byte *inbuffer, int dsize) { for (i = 0;i < 256;i++) // Palette translation map *(writer++) = i; - WRITE_UINT16(writer, 0); // Palette stamp + WRITE_LE_UINT16(writer, 0); // Palette stamp writer += 2; - WRITE_UINT16(writer, 0); + WRITE_LE_UINT16(writer, 0); writer += 2; - view_size = READ_UINT16(seeker); + view_size = READ_LE_UINT16(seeker); seeker += 2; - view_start = READ_UINT16(seeker); + view_start = READ_LE_UINT16(seeker); seeker += 2; - cdata_size = READ_UINT16(seeker); + cdata_size = READ_LE_UINT16(seeker); seeker += 2; memcpy(viewdata, seeker, sizeof(viewdata)); @@ -318,7 +318,7 @@ byte *pic_reorder(byte *inbuffer, int dsize) { *(writer++) = 0; *(writer++) = 0; *(writer++) = 0; - WRITE_UINT16(writer, view_size + 8); + WRITE_LE_UINT16(writer, view_size + 8); writer += 2; memcpy(writer, viewdata, sizeof(viewdata)); @@ -340,20 +340,20 @@ static void build_cel_headers(byte **seeker, byte **writer, int celindex, int *c int c, w; for (c = 0;c < max;c++) { - w = READ_UINT16(*seeker); - WRITE_UINT16(*writer, w); + w = READ_LE_UINT16(*seeker); + WRITE_LE_UINT16(*writer, w); *seeker += 2; *writer += 2; - w = READ_UINT16(*seeker); - WRITE_UINT16(*writer, w); + w = READ_LE_UINT16(*seeker); + WRITE_LE_UINT16(*writer, w); *seeker += 2; *writer += 2; - w = READ_UINT16(*seeker); - WRITE_UINT16(*writer, w); + w = READ_LE_UINT16(*seeker); + WRITE_LE_UINT16(*writer, w); *seeker += 2; *writer += 2; w = *((*seeker)++); - WRITE_UINT16(*writer, w); // Zero extension + WRITE_LE_UINT16(*writer, w); // Zero extension *writer += 2; *writer += cc_lengths[celindex]; @@ -382,32 +382,32 @@ byte *view_reorder(byte *inbuffer, int dsize) { byte **cc_pos; // Parse the main header - cellengths = inbuffer + READ_UINT16(seeker) + 2; + cellengths = inbuffer + READ_LE_UINT16(seeker) + 2; seeker += 2; loopheaders = *(seeker++); lh_present = *(seeker++); - lh_mask = READ_UINT16(seeker); + lh_mask = READ_LE_UINT16(seeker); seeker += 2; - unknown = READ_UINT16(seeker); + unknown = READ_LE_UINT16(seeker); seeker += 2; - pal_offset = READ_UINT16(seeker); + pal_offset = READ_LE_UINT16(seeker); seeker += 2; - cel_total = READ_UINT16(seeker); + cel_total = READ_LE_UINT16(seeker); seeker += 2; cc_pos = (byte **)malloc(sizeof(byte *) * cel_total); cc_lengths = (int *)malloc(sizeof(int) * cel_total); for (c = 0;c < cel_total;c++) - cc_lengths[c] = READ_UINT16(cellengths + 2 * c); + cc_lengths[c] = READ_LE_UINT16(cellengths + 2 * c); *(writer++) = loopheaders; *(writer++) = VIEW_HEADER_COLORS_8BIT; - WRITE_UINT16(writer, lh_mask); + WRITE_LE_UINT16(writer, lh_mask); writer += 2; - WRITE_UINT16(writer, unknown); + WRITE_LE_UINT16(writer, unknown); writer += 2; - WRITE_UINT16(writer, pal_offset); + WRITE_LE_UINT16(writer, pal_offset); writer += 2; lh_ptr = writer; @@ -430,25 +430,25 @@ byte *view_reorder(byte *inbuffer, int dsize) { fprintf(stderr, "Error: While reordering view: Loop not present, but can't re-use last loop!\n"); lh_last = 0; } - WRITE_UINT16(lh_ptr, lh_last); + WRITE_LE_UINT16(lh_ptr, lh_last); lh_ptr += 2; } else { lh_last = writer - outbuffer; - WRITE_UINT16(lh_ptr, lh_last); + WRITE_LE_UINT16(lh_ptr, lh_last); lh_ptr += 2; - WRITE_UINT16(writer, celcounts[w]); + WRITE_LE_UINT16(writer, celcounts[w]); writer += 2; - WRITE_UINT16(writer, 0); + WRITE_LE_UINT16(writer, 0); writer += 2; // Now, build the cel offset table chptr = (writer - outbuffer) + (2 * celcounts[w]); for (c = 0; c < celcounts[w]; c++) { - WRITE_UINT16(writer, chptr); + WRITE_LE_UINT16(writer, chptr); writer += 2; cc_pos[celindex + c] = outbuffer + chptr; - chptr += 8 + READ_UINT16(cellengths + 2 * (celindex + c)); + chptr += 8 + READ_LE_UINT16(cellengths + 2 * (celindex + c)); } build_cel_headers(&seeker, &writer, celindex, cc_lengths, celcounts[w]); |