Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas. 449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
This commit is contained in:
parent
3c939f1cdd
commit
e168b4e4a6
326 changed files with 9538 additions and 3481 deletions
|
|
@ -7,39 +7,42 @@
|
|||
#include <windows.h>
|
||||
|
||||
namespace {
|
||||
// INLINED
|
||||
std::uint16_t Read16(const unsigned char* data) {
|
||||
std::uint16_t value;
|
||||
std::memcpy(&value, data, sizeof(value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
std::uint32_t Read32(const unsigned char* data) {
|
||||
std::uint32_t value;
|
||||
std::memcpy(&value, data, sizeof(value));
|
||||
return value;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
int Signed(std::uint32_t value) {
|
||||
return std::bit_cast<std::int32_t>(value);
|
||||
}
|
||||
|
||||
// INLINED
|
||||
std::size_t PixelBytes(int width, int height) {
|
||||
const std::uint32_t count = static_cast<std::uint32_t>(width) * static_cast<std::uint32_t>(height);
|
||||
return count > 0x3FFFFFFFu ? 0xFFFFFFFFu : count * 4u;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
std::uint32_t Color(const unsigned char* data, unsigned alpha) {
|
||||
return data[0] | (data[1] << 8) | (data[2] << 16) | (alpha << 24);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00749580
|
||||
// FUNCTION: fn_07847
|
||||
// INLINED
|
||||
BitmapImage::BitmapImage() : alpha(0), pixels(nullptr), auxiliary(nullptr) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x00749850
|
||||
// FUNCTION: fn_07850
|
||||
// INLINED
|
||||
void BitmapImage::Clear() {
|
||||
if (this->pixels) {
|
||||
std::free(this->pixels);
|
||||
|
|
@ -222,6 +225,7 @@ bool BitmapImage::DecodeTga(const void* input, int) {
|
|||
this->pixels = static_cast<std::uint32_t*>(std::malloc(PixelBytes(this->width, this->height)));
|
||||
const bool rgba = data[16] == 32;
|
||||
unsigned alpha = 255;
|
||||
// INLINED
|
||||
auto read = [&]() {
|
||||
const unsigned char* pixel = source;
|
||||
source += 3;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
namespace {
|
||||
class MemoryBuffer : public std::streambuf {
|
||||
public:
|
||||
// INLINED
|
||||
MemoryBuffer(const void* data, int bytes) {
|
||||
char* begin = const_cast<char*>(static_cast<const char*>(data));
|
||||
this->setg(begin, begin, begin + bytes);
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@
|
|||
#include <windows.h>
|
||||
|
||||
// OFFSET: 0x00749580
|
||||
// FUNCTION: fn_07847
|
||||
// FUNCTION: fn_07861
|
||||
CBitmapRes::CBitmapRes(BitmapResourceContext& context) : m_context(&context) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x007498B0
|
||||
// FUNCTION: fn_07851
|
||||
// INLINED
|
||||
CBitmapRes::~CBitmapRes() = default;
|
||||
|
||||
// OFFSET: 0x00749580
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
#include "Resource/Bitmap/IJL15Runtime.h"
|
||||
|
||||
#include <system_error>
|
||||
|
||||
IJL15Runtime::IJL15Runtime() : m_module(LoadLibraryA("ijl15.dll")) {
|
||||
if (!this->m_module) {
|
||||
throw std::system_error(GetLastError(), std::system_category(), "ijl15.dll");
|
||||
}
|
||||
|
||||
this->initialize = reinterpret_cast<decltype(this->initialize)>(GetProcAddress(this->m_module, "ijlInit"));
|
||||
this->read = reinterpret_cast<decltype(this->read)>(GetProcAddress(this->m_module, "ijlRead"));
|
||||
this->write = reinterpret_cast<decltype(this->write)>(GetProcAddress(this->m_module, "ijlWrite"));
|
||||
this->release = reinterpret_cast<decltype(this->release)>(GetProcAddress(this->m_module, "ijlFree"));
|
||||
|
||||
if (!this->initialize || !this->read || !this->write || !this->release) {
|
||||
FreeLibrary(this->m_module);
|
||||
throw std::system_error(ERROR_PROC_NOT_FOUND, std::system_category(), "ijl15 exports");
|
||||
}
|
||||
}
|
||||
|
||||
IJL15Runtime::~IJL15Runtime() {
|
||||
FreeLibrary(this->m_module);
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#define RAGNAROK_SOURCE_RESOURCE_BITMAP_IJL15RUNTIME_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <system_error>
|
||||
#include <windows.h>
|
||||
|
||||
struct IJL15Properties {
|
||||
|
|
@ -44,6 +45,26 @@ private:
|
|||
IJL15Runtime& operator=(const IJL15Runtime&) = delete;
|
||||
};
|
||||
|
||||
inline IJL15Runtime::IJL15Runtime() : m_module(LoadLibraryA("ijl15.dll")) {
|
||||
if (!this->m_module) {
|
||||
throw std::system_error(GetLastError(), std::system_category(), "ijl15.dll");
|
||||
}
|
||||
|
||||
this->initialize = reinterpret_cast<decltype(this->initialize)>(GetProcAddress(this->m_module, "ijlInit"));
|
||||
this->read = reinterpret_cast<decltype(this->read)>(GetProcAddress(this->m_module, "ijlRead"));
|
||||
this->write = reinterpret_cast<decltype(this->write)>(GetProcAddress(this->m_module, "ijlWrite"));
|
||||
this->release = reinterpret_cast<decltype(this->release)>(GetProcAddress(this->m_module, "ijlFree"));
|
||||
|
||||
if (!this->initialize || !this->read || !this->write || !this->release) {
|
||||
FreeLibrary(this->m_module);
|
||||
throw std::system_error(ERROR_PROC_NOT_FOUND, std::system_category(), "ijl15 exports");
|
||||
}
|
||||
}
|
||||
|
||||
inline IJL15Runtime::~IJL15Runtime() {
|
||||
FreeLibrary(this->m_module);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(offsetof(IJL15Properties, jpegBytes) == 36);
|
||||
static_assert(offsetof(IJL15Properties, jpegWidth) == 44);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue