Skip to content

Commit

Permalink
Reduce CLX header size from 10 to 6 (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm authored Oct 12, 2024
1 parent 8f4efcc commit 6c57fd8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions source/d1formats/d1cl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,12 @@ static quint8 *writeFrameData(D1GfxFrame *frame, quint8 *pBuf, bool isClx, int s
quint16 *pHeader = reinterpret_cast<quint16 *>(pBuf);
// add CL2 FRAME HEADER
pHeader[0] = SwapLE16(subHeaderSize); // SUB_HEADER_SIZE
pHeader[1] = 0; // row -32
pHeader[2] = 0; // row -64
pHeader[3] = 0; // row -96
pHeader[4] = 0; // row -128
if (!isClx) {
pHeader[1] = 0; // row -32
pHeader[2] = 0; // row -64
pHeader[3] = 0; // row -96
pHeader[4] = 0; // row -128
}
pBuf += subHeaderSize;

unsigned transparentRunWidth = 0;
Expand Down Expand Up @@ -443,7 +445,7 @@ bool D1Cl2::writeFileData(D1Gfx &gfx, QFile &outFile, bool isClx, const QString
}

// calculate sub header size
int subHeaderSize = SUB_HEADER_SIZE;
int subHeaderSize = !isClx ? SUB_HEADER_SIZE : 6;
if (!isClx) {
for (int n = 0; n < numFrames; n++) {
D1GfxFrame *frame = gfx.getFrame(n);
Expand Down

0 comments on commit 6c57fd8

Please sign in to comment.