diff --git a/LEGO1/omni/include/flic.h b/LEGO1/omni/include/flic.h index bcebabbd..21d114df 100644 --- a/LEGO1/omni/include/flic.h +++ b/LEGO1/omni/include/flic.h @@ -27,17 +27,16 @@ typedef struct { typedef struct : FLIC_CHUNK { WORD frames; /* Number of frames in first segment */ // 0x06 - // TODO: See signed issue in MxFlcPresenter::CreateBitmap() - short width; /* FLIC width in pixels */ // 0x08 - short height; /* FLIC height in pixels */ // 0x0a - WORD depth; /* Bits per pixel (usually 8) */ // 0x0c - WORD flags; /* Set to zero or to three */ // 0x0e - DWORD speed; /* Delay between frames */ // 0x10 + WORD width; /* FLIC width in pixels */ // 0x08 + WORD height; /* FLIC height in pixels */ // 0x0a + WORD depth; /* Bits per pixel (usually 8) */ // 0x0c + WORD flags; /* Set to zero or to three */ // 0x0e + DWORD speed; /* Delay between frames */ // 0x10 } FLIC_HEADER; #pragma pack(pop) typedef struct : FLIC_CHUNK { - short chunks; /* Number of subchunks */ // 0x06 + WORD chunks; /* Number of subchunks */ // 0x06 WORD delay; /* Delay in milliseconds */ // 0x08 WORD reserved; /* Always zero */ // 0x0a WORD width; /* Frame width override (if non-zero) */ // 0x0c diff --git a/LEGO1/omni/src/video/flic.cpp b/LEGO1/omni/src/video/flic.cpp index 4e762a45..f15f406c 100644 --- a/LEGO1/omni/src/video/flic.cpp +++ b/LEGO1/omni/src/video/flic.cpp @@ -170,7 +170,7 @@ short DecodeChunks( { *p_decodedColorMap = FALSE; - for (short subchunk = 0; subchunk < p_flcFrame->chunks; subchunk++) { + for (short subchunk = 0; subchunk < (short) p_flcFrame->chunks; subchunk++) { FLIC_CHUNK* chunk = (FLIC_CHUNK*) p_flcSubchunks; p_flcSubchunks += chunk->size; @@ -260,7 +260,7 @@ void DecodeBrun(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_da BYTE* data = p_data; short width = p_flcHeader->width; short height = p_flcHeader->height; - BYTE* offset = ((p_bitmapHeader->biWidth + 3) & -4) * (p_flcHeader->height - 1) + p_pixelData; + BYTE* offset = ((p_bitmapHeader->biWidth + 3) & -4) * (height - 1) + p_pixelData; for (short line = height - 1; line >= 0; line--) { data++; @@ -292,7 +292,7 @@ void DecodeBrun(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_da // FUNCTION: LEGO1 0x100bda10 void DecodeLC(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_data, FLIC_HEADER* p_flcHeader) { - short row = p_flcHeader->height - *((short*) p_data) - 1; + short row = (short) p_flcHeader->height - *((short*) p_data) - 1; BYTE* data = p_data + 4; for (short lines = *((short*) (p_data + 2)) - 1; lines >= 0; lines--) { @@ -322,8 +322,8 @@ void DecodeLC(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_data // FUNCTION: LEGO1 0x100bdac0 void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_data, FLIC_HEADER* p_flcHeader) { - short width = p_flcHeader->width - 1; - short row = p_flcHeader->height - 1; + short width = (short) p_flcHeader->width - 1; + short row = (short) p_flcHeader->height - 1; short lines = *((short*) p_data); BYTE* data = p_data + 2; diff --git a/LEGO1/omni/src/video/mxflcpresenter.cpp b/LEGO1/omni/src/video/mxflcpresenter.cpp index 8970838c..da7441a8 100644 --- a/LEGO1/omni/src/video/mxflcpresenter.cpp +++ b/LEGO1/omni/src/video/mxflcpresenter.cpp @@ -40,8 +40,7 @@ void MxFlcPresenter::CreateBitmap() } m_bitmap = new MxBitmap; - // TODO: Unlikely that width/height are signed shorts - m_bitmap->SetSize((MxU16) m_flcHeader->width, (MxU16) m_flcHeader->height, NULL, FALSE); + m_bitmap->SetSize(m_flcHeader->width, m_flcHeader->height, NULL, FALSE); } // FUNCTION: LEGO1 0x100b3570