WIP: save progress with line annotations

This commit is contained in:
jonschz 2025-05-04 08:31:42 +02:00
parent 958a097cf6
commit 36536c530b

View File

@ -358,29 +358,40 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
short xofs = 0; short xofs = 0;
short yofs = 0; short yofs = 0;
short width = (short) p_flcHeader->width; short width = p_flcHeader->width;
short token = 0; short token = 0;
// LINE: BETA10 0x1013e643
short xmax = xofs + width - 1; short xmax = xofs + width - 1;
short row = yofs + p_flcHeader->height - 1; // LINE: BETA10 0x1013e652
short* data = (short*) p_data; short* data = (short*) p_data;
// The first word in the data following the chunk header contains the number of lines in the chunk. // The first word in the data following the chunk header contains the number of lines in the chunk.
// The line count does not include skipped lines. // The line count does not include skipped lines.
short lines = *data++; short lines = *data++;
while (--lines > 0) {
while (TRUE) { short height = p_flcHeader->height;
// LINE: BETA10 0x1013e66f
short row = height - yofs - 1;
do {
token = *((short*) data); token = *((short*) data);
data += 2; data += 2; // TODO: likely an otherData assignment
if (token < 0) { if (token < 0) {
if (token & 0x4000) { if (token & 0x4000) {
row += token; row += token;
// TODO: otherData assigment
continue;
} }
else {
WritePixel(p_bitmapHeader, p_pixelData, width, row, token); WritePixel(p_bitmapHeader, p_pixelData, width, row, token);
token = *((WORD*) data); token = *((WORD*) data);
data += 2; data += 2;
@ -395,11 +406,9 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
break; break;
} }
} }
}
else { else {
break; break;
} }
}
short column = 0; short column = 0;
do { do {
@ -408,21 +417,21 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
type += type; type += type;
if (type >= 0) { if (type >= 0) {
WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*)data, type); WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*) data, type);
column += type; column += type;
data += type; data += type;
} }
else { else {
type = -type; type = -type;
short p_pixel = *((WORD*) data); // short p_pixel = *((WORD*) data); // removed for stack size
data += 2; data += 2;
WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, p_pixel, type >> 1); WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, *((WORD*) data), type >> 1);
column += type; column += type;
} }
} while (--token); } while (--token);
row--; row--;
} } while (--lines > 0);
} }
// FUNCTION: LEGO1 0x100bdc00 // FUNCTION: LEGO1 0x100bdc00