Decompile 4 functions in Source/Resource/PaletteResource.cpp, Source/Resource/PaletteResource.h, ...
Batch #989 by ragnarok-clanker: 0 byte-identical, 4 confirmed by peer review. - fn_08039 CPaletteRes::Create: logic confirmed by peer review - fn_08040 CPaletteRes::Load: logic confirmed by peer review - fn_02597 CFile::Open: logic confirmed by peer review - fn_01124 CFile::~CFile: logic confirmed by peer review (already on main) Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
4d9d775cc8
commit
b574abe09d
2 changed files with 48 additions and 0 deletions
|
|
@ -33,6 +33,36 @@ bool CFile::OpenWrite(const char* path, CRenderSystemBase* renderSystem) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x0057C030
|
||||
// FUNCTION: fn_02597
|
||||
bool CFile::Open(const char* path, int mode, bool resourcePath, bool option) {
|
||||
if (mode == 0) {
|
||||
if (resourcePath) {
|
||||
this->m_path = MakeResourcePath(path);
|
||||
} else {
|
||||
this->m_path = path;
|
||||
}
|
||||
|
||||
this->m_position = 0;
|
||||
this->m_data = g_pakRegistry.Read(this->m_path.c_str(), &this->m_size, option);
|
||||
return this->m_data != nullptr;
|
||||
}
|
||||
|
||||
if ((mode & 1) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->m_path = path;
|
||||
this->m_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (this->m_handle == INVALID_HANDLE_VALUE) {
|
||||
ShowErrorDialog(GetRenderSystemHolder()->system, this->m_path.c_str(), 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
LARGE_INTEGER size;
|
||||
GetFileSizeEx(this->m_handle, &size);
|
||||
this->m_size = size.LowPart;
|
||||
return true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x0057C340
|
||||
// FUNCTION: fn_02601
|
||||
|
|
|
|||
|
|
@ -14,8 +14,26 @@ CPaletteRes::CPaletteRes() : sourcePalette{}, palette{} {
|
|||
CPaletteRes::~CPaletteRes() = default;
|
||||
|
||||
// OFFSET: 0x0075D730
|
||||
// FUNCTION: fn_08039
|
||||
CPaletteRes* CPaletteRes::Create() {
|
||||
return new CPaletteRes;
|
||||
}
|
||||
|
||||
// OFFSET: 0x0075D7D0
|
||||
// FUNCTION: fn_08040
|
||||
bool CPaletteRes::Load(const char* name) {
|
||||
CFile file;
|
||||
if (file.Open(name, 0, true, false)) {
|
||||
file.Read(this->sourcePalette, sizeof(this->sourcePalette));
|
||||
ConvertSpritePalette(this->palette, this->sourcePalette, 256);
|
||||
file.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string message = std::string("CPaletteRes :: Cannot find File : ") + name;
|
||||
ShowErrorDialog(GetRenderSystemHolder()->system, message.c_str(), 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
// OFFSET: 0x0075DAF0
|
||||
// FUNCTION: fn_08041
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue