Skip to content

Commit

Permalink
tt
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Sep 26, 2024
1 parent 341eb95 commit da2b70b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion tools/patcher/DiabloUI/patcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3954,7 +3954,24 @@ static BYTE* patchFile(int index, size_t *dwLen)
} break;
case FILE_CATHEDRAL_SCEL:
{ // patch pSpecialsCel - L1S.CEL
buf = DRLP_L1_PatchSpec(buf, dwLen);
size_t minLen;
BYTE* minBuf = LoadFileInMem(filesToPatch[FILE_CATHEDRAL_MIN], &minLen);
if (minBuf == NULL) {
mem_free_dbg(buf);
app_warn("Unable to open file %s in the mpq.", filesToPatch[FILE_CATHEDRAL_MIN]);
return NULL;
}
size_t celLen;
BYTE* celBuf = LoadFileInMem(filesToPatch[FILE_CATHEDRAL_CEL], &celLen);
if (celBuf == NULL) {
mem_free_dbg(minBuf);
mem_free_dbg(buf);
app_warn("Unable to open file %s in the mpq.", filesToPatch[FILE_CATHEDRAL_CEL]);
return NULL;
}
buf = DRLP_L1_PatchSpec(minBuf, minLen, celBuf, celLen, buf, dwLen);
mem_free_dbg(celBuf);
mem_free_dbg(minBuf);
} break;
case FILE_CATHEDRAL_CEL:
{ // patch dMicroCels - L1.CEL
Expand Down
2 changes: 1 addition & 1 deletion tools/patcher/drlp_l1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ BYTE* DRLP_L1_PatchDoors(BYTE* celBuf, size_t* celLen)
return resCelBuf;
}

BYTE* DRLP_L1_PatchSpec(BYTE* sCelBuf, size_t* sCelLen)
BYTE* DRLP_L1_PatchSpec(const BYTE* minBuf, size_t minLen, const BYTE* celBuf, size_t celLen, BYTE* sCelBuf, size_t* sCelLen)
{
constexpr BYTE TRANS_COLOR = 128;
constexpr BYTE SUB_HEADER_SIZE = 10;
Expand Down
2 changes: 1 addition & 1 deletion tools/patcher/drlp_l1.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {
#define BLOCK_SIZE_L1 10

BYTE* DRLP_L1_PatchDoors(BYTE* celBuf, size_t* celLen);
BYTE* DRLP_L1_PatchSpec(BYTE* sCelBuf, size_t* sCelLen);
BYTE* DRLP_L1_PatchSpec(const BYTE* minBuf, size_t minLen, const BYTE* celBuf, size_t celLen, BYTE* sCelBuf, size_t* sCelLen);
BYTE* DRLP_L1_PatchCel(const BYTE* minBuf, size_t minLen, BYTE* celBuf, size_t* celLen);
void DRLP_L1_PatchMin(BYTE* minBuf);
void DRLP_L1_PatchTil(BYTE* tilBuf);
Expand Down

0 comments on commit da2b70b

Please sign in to comment.