mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-15 12:41:15 +00:00
Kinda fix the flow using gotos
This commit is contained in:
parent
2c469af6bf
commit
84d3fc1582
@ -374,7 +374,7 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
|
|||||||
// LINE: BETA10 0x1013e666
|
// LINE: BETA10 0x1013e666
|
||||||
short row = p_flcHeader->height - yofs - 1;
|
short row = p_flcHeader->height - yofs - 1;
|
||||||
|
|
||||||
goto loop;
|
goto row_loop;
|
||||||
|
|
||||||
weird_code:
|
weird_code:
|
||||||
// This is very ugly, but it does yield the correct layout. This _may_ be correct.
|
// This is very ugly, but it does yield the correct layout. This _may_ be correct.
|
||||||
@ -382,8 +382,8 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
|
|||||||
// LINE: BETA10 0x1013e684
|
// LINE: BETA10 0x1013e684
|
||||||
row += token;
|
row += token;
|
||||||
|
|
||||||
do {
|
while (TRUE) {
|
||||||
loop:
|
row_loop:
|
||||||
// TODO: Can the typecast be removed?
|
// TODO: Can the typecast be removed?
|
||||||
// LINE: BETA10 0x1013e692
|
// LINE: BETA10 0x1013e692
|
||||||
token = *((short*) data++);
|
token = *((short*) data++);
|
||||||
@ -413,46 +413,45 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
|
|||||||
}
|
}
|
||||||
|
|
||||||
short column = xofs;
|
short column = xofs;
|
||||||
while (1) {
|
|
||||||
// TODO: Try turning this while-loop into gotos
|
|
||||||
|
|
||||||
column += *(data++);
|
column_loop:
|
||||||
short type = *((char*) data++);
|
|
||||||
type += type;
|
|
||||||
|
|
||||||
if (type >= 0) {
|
column += *(data++);
|
||||||
WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*) data, type);
|
short type = *((char*) data++);
|
||||||
column += type;
|
type += type;
|
||||||
data = (short*) ((char*) data + type);
|
|
||||||
// LINE: BETA10 0x1013e797
|
if (type >= 0) {
|
||||||
if (--token != 0) {
|
WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*) data, type);
|
||||||
continue;
|
column += type;
|
||||||
}
|
data = (short*) ((char*) data + type);
|
||||||
row--;
|
// LINE: BETA10 0x1013e797
|
||||||
if (--lines > 0) {
|
if (--token != 0) {
|
||||||
break;
|
goto column_loop;
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
row--;
|
||||||
type = -type;
|
if (--lines > 0) {
|
||||||
WORD* p_pixel = ((WORD*) data++);
|
goto row_loop;
|
||||||
WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, *p_pixel, type >> 1);
|
|
||||||
column += type;
|
|
||||||
// LINE: BETA10 0x1013e813
|
|
||||||
if (--token != 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
row--;
|
|
||||||
if (--lines > 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// break;
|
return;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
type = -type;
|
||||||
|
WORD* p_pixel = ((WORD*) data++);
|
||||||
|
WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, *p_pixel, type >> 1);
|
||||||
|
column += type;
|
||||||
|
// LINE: BETA10 0x1013e813
|
||||||
|
if (--token != 0) {
|
||||||
|
goto column_loop;
|
||||||
|
}
|
||||||
|
row--;
|
||||||
|
if (--lines > 0) {
|
||||||
|
goto row_loop;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// break;
|
||||||
|
|
||||||
} while (1);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100bdc00
|
// FUNCTION: LEGO1 0x100bdc00
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user