Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce CLX header size from 10 to 6 #154

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading