mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-27 10:11:15 +00:00
More fixes
This commit is contained in:
parent
e2bfeb6817
commit
78c37ada37
@ -636,21 +636,21 @@ void SetOmniUserMessage(void (*p_userMsg)(const char*, int))
|
|||||||
MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
||||||
{
|
{
|
||||||
char* buf;
|
char* buf;
|
||||||
_MMCKINFO tmp_chunk;
|
_MMCKINFO tmpChunk;
|
||||||
|
|
||||||
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) {
|
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'S', 't')) {
|
if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'S', 't')) {
|
||||||
if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'O', 'b')) {
|
if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'O', 'b')) {
|
||||||
|
|
||||||
buf = new char[tmp_chunk.cksize];
|
buf = new char[tmpChunk.cksize];
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_file->Read((MxU8*) buf, tmp_chunk.cksize) != 0) {
|
if (p_file->Read((MxU8*) buf, tmpChunk.cksize) != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,67 +35,67 @@ ExtraActionType MatchActionString(const char* p_str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1003eae0
|
// FUNCTION: LEGO1 0x1003eae0
|
||||||
void ConvertHSVToRGB(float h, float s, float v, float* r_out, float* b_out, float* g_out)
|
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut)
|
||||||
{
|
{
|
||||||
double calc;
|
double calc;
|
||||||
double p;
|
double p;
|
||||||
MxLong hue_index;
|
MxLong hueIndex;
|
||||||
double v9;
|
double v9;
|
||||||
double v12;
|
double v12;
|
||||||
double v13;
|
double v13;
|
||||||
|
|
||||||
double s_dbl = s;
|
double sDbl = p_s;
|
||||||
|
|
||||||
if (s > 0.5f)
|
if (p_s > 0.5f)
|
||||||
calc = (1.0f - v) * s + v;
|
calc = (1.0f - p_v) * p_s + p_v;
|
||||||
else
|
else
|
||||||
calc = (v + 1.0) * s_dbl;
|
calc = (p_v + 1.0) * sDbl;
|
||||||
if (calc <= 0.0) {
|
if (calc <= 0.0) {
|
||||||
*g_out = 0.0f;
|
*p_gOut = 0.0f;
|
||||||
*b_out = 0.0f;
|
*p_bOut = 0.0f;
|
||||||
*r_out = 0.0f;
|
*p_rOut = 0.0f;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p = s * 2.0f - calc;
|
p = p_s * 2.0f - calc;
|
||||||
hue_index = h * 6.0;
|
hueIndex = p_h * 6.0;
|
||||||
v9 = (h * 6.0 - (float) hue_index) * ((calc - p) / calc) * calc;
|
v9 = (p_h * 6.0 - (float) hueIndex) * ((calc - p) / calc) * calc;
|
||||||
v12 = p + v9;
|
v12 = p + v9;
|
||||||
v13 = calc - v9;
|
v13 = calc - v9;
|
||||||
switch (hue_index) {
|
switch (hueIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
*r_out = calc;
|
*p_rOut = calc;
|
||||||
*b_out = v12;
|
*p_bOut = v12;
|
||||||
*g_out = p;
|
*p_gOut = p;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
*r_out = v13;
|
*p_rOut = v13;
|
||||||
*b_out = calc;
|
*p_bOut = calc;
|
||||||
*g_out = p;
|
*p_gOut = p;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
*r_out = p;
|
*p_rOut = p;
|
||||||
*b_out = calc;
|
*p_bOut = calc;
|
||||||
*g_out = v12;
|
*p_gOut = v12;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
*r_out = p;
|
*p_rOut = p;
|
||||||
*b_out = v13;
|
*p_bOut = v13;
|
||||||
*g_out = calc;
|
*p_gOut = calc;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
*r_out = v12;
|
*p_rOut = v12;
|
||||||
*b_out = p;
|
*p_bOut = p;
|
||||||
*g_out = calc;
|
*p_gOut = calc;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
*r_out = calc;
|
*p_rOut = calc;
|
||||||
*b_out = p;
|
*p_bOut = p;
|
||||||
*g_out = v13;
|
*p_gOut = v13;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
*r_out = calc;
|
*p_rOut = calc;
|
||||||
*b_out = p;
|
*p_bOut = p;
|
||||||
*g_out = v13;
|
*p_gOut = v13;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ inline void GetString(char** p_source, const char* p_dest, T* p_obj, void (T::*p
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExtraActionType MatchActionString(const char*);
|
ExtraActionType MatchActionString(const char*);
|
||||||
void ConvertHSVToRGB(float r, float g, float b, float* out_r, float* out_g, float* out_b);
|
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
|
||||||
void FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id);
|
void FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id);
|
||||||
void SetAppCursor(WPARAM p_wparam);
|
void SetAppCursor(WPARAM p_wparam);
|
||||||
|
|
||||||
|
|||||||
@ -19,12 +19,12 @@ class LegoVideoManager : public MxVideoManager {
|
|||||||
__declspec(dllexport) int DisableRMDevice();
|
__declspec(dllexport) int DisableRMDevice();
|
||||||
void EnableFullScreenMovie(MxBool p_enable);
|
void EnableFullScreenMovie(MxBool p_enable);
|
||||||
__declspec(dllexport) void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
|
__declspec(dllexport) void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
|
||||||
__declspec(dllexport) void MoveCursor(int x, int y);
|
__declspec(dllexport) void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY);
|
||||||
|
|
||||||
inline Lego3DManager* Get3DManager() { return this->m_3dManager; }
|
inline Lego3DManager* Get3DManager() { return this->m_3dManager; }
|
||||||
inline MxDirect3D* GetDirect3D() { return this->m_direct3d; }
|
inline MxDirect3D* GetDirect3D() { return this->m_direct3d; }
|
||||||
|
|
||||||
void SetSkyColor(float r, float g, float b);
|
void SetSkyColor(float p_red, float p_green, float p_blue);
|
||||||
inline void SetUnkE4(MxBool p_unk0xe4) { this->m_unk0xe4 = p_unk0xe4; }
|
inline void SetUnkE4(MxBool p_unk0xe4) { this->m_unk0xe4 = p_unk0xe4; }
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007c4c0
|
// FUNCTION: LEGO1 0x1007c4c0
|
||||||
|
|||||||
@ -17,13 +17,13 @@ void LegoWorld::VTable0x60()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10015820
|
// STUB: LEGO1 0x10015820
|
||||||
void FUN_10015820(MxU32 p_unk1, MxU32 p_unk2)
|
void FUN_10015820(MxU32, MxU32)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10015910
|
// STUB: LEGO1 0x10015910
|
||||||
void FUN_10015910(MxU32 p_unk1)
|
void FUN_10015910(MxU32)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,8 +51,8 @@ class LegoWorld : public LegoEntity {
|
|||||||
undefined m_unk0xf7;
|
undefined m_unk0xf7;
|
||||||
};
|
};
|
||||||
|
|
||||||
void FUN_10015820(MxU32 p_unk1, MxU32 p_unk2);
|
void FUN_10015820(MxU32, MxU32);
|
||||||
void FUN_10015910(MxU32 p_unk1);
|
void FUN_10015910(MxU32);
|
||||||
void SetIsWorldActive(MxBool p_isWorldActive);
|
void SetIsWorldActive(MxBool p_isWorldActive);
|
||||||
|
|
||||||
#endif // LEGOWORLD_H
|
#endif // LEGOWORLD_H
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
#include "legoworldpresenter.h"
|
#include "legoworldpresenter.h"
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f75d4
|
// GLOBAL: LEGO1 0x100f75d4
|
||||||
undefined4 g_LegoWorldPresenterQuality = 1;
|
undefined4 g_legoWorldPresenterQuality = 1;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100665b0
|
// FUNCTION: LEGO1 0x100665b0
|
||||||
void LegoWorldPresenter::configureLegoWorldPresenter(int p_quality)
|
void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality)
|
||||||
{
|
{
|
||||||
g_LegoWorldPresenterQuality = p_quality;
|
g_legoWorldPresenterQuality = p_legoWorldPresenterQuality;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100665c0
|
// FUNCTION: LEGO1 0x100665c0
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class LegoWorldPresenter : public LegoEntityPresenter {
|
|||||||
LegoWorldPresenter();
|
LegoWorldPresenter();
|
||||||
virtual ~LegoWorldPresenter() override; // vtable+0x0
|
virtual ~LegoWorldPresenter() override; // vtable+0x0
|
||||||
|
|
||||||
__declspec(dllexport) static void configureLegoWorldPresenter(int param_1);
|
__declspec(dllexport) static void configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality);
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10066630
|
// FUNCTION: LEGO1 0x10066630
|
||||||
inline virtual const char* ClassName() const override // vtable+0x0c
|
inline virtual const char* ClassName() const override // vtable+0x0c
|
||||||
|
|||||||
@ -61,7 +61,7 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
|
|||||||
// FUNCTION: LEGO1 0x100ad210
|
// FUNCTION: LEGO1 0x100ad210
|
||||||
MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode)
|
MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode)
|
||||||
{
|
{
|
||||||
MxAtomId _unused;
|
MxAtomId unused;
|
||||||
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str);
|
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str);
|
||||||
|
|
||||||
switch (p_mode) {
|
switch (p_mode) {
|
||||||
|
|||||||
@ -14,12 +14,12 @@ enum LookupMode {
|
|||||||
class MxAtomId {
|
class MxAtomId {
|
||||||
public:
|
public:
|
||||||
__declspec(dllexport) MxAtomId(const char*, LookupMode);
|
__declspec(dllexport) MxAtomId(const char*, LookupMode);
|
||||||
__declspec(dllexport) MxAtomId& operator=(const MxAtomId& id);
|
__declspec(dllexport) MxAtomId& operator=(const MxAtomId& p_atomId);
|
||||||
__declspec(dllexport) ~MxAtomId();
|
__declspec(dllexport) ~MxAtomId();
|
||||||
|
|
||||||
MxAtomId() { this->m_internal = 0; }
|
MxAtomId() { this->m_internal = 0; }
|
||||||
|
|
||||||
inline MxBool operator==(const MxAtomId& other) const { return this->m_internal == other.m_internal; }
|
inline MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; }
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
DECOMP_SIZE_ASSERT(MxAudioManager, 0x30);
|
DECOMP_SIZE_ASSERT(MxAudioManager, 0x30);
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x10102108
|
// GLOBAL: LEGO1 0x10102108
|
||||||
MxS32 MxAudioManager::g_unkCount = 0;
|
MxS32 MxAudioManager::g_count = 0;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10029910
|
// FUNCTION: LEGO1 0x10029910
|
||||||
MxS32 MxAudioManager::GetVolume()
|
MxS32 MxAudioManager::GetVolume()
|
||||||
@ -33,7 +33,7 @@ void MxAudioManager::Init()
|
|||||||
void MxAudioManager::Destroy(MxBool p_fromDestructor)
|
void MxAudioManager::Destroy(MxBool p_fromDestructor)
|
||||||
{
|
{
|
||||||
this->m_criticalSection.Enter();
|
this->m_criticalSection.Enter();
|
||||||
g_unkCount--;
|
g_count--;
|
||||||
Init();
|
Init();
|
||||||
this->m_criticalSection.Leave();
|
this->m_criticalSection.Leave();
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ MxResult MxAudioManager::InitPresenters()
|
|||||||
this->m_criticalSection.Enter();
|
this->m_criticalSection.Enter();
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
g_unkCount++;
|
g_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class MxAudioManager : public MxMediaManager {
|
|||||||
private:
|
private:
|
||||||
void Destroy(MxBool p_fromDestructor);
|
void Destroy(MxBool p_fromDestructor);
|
||||||
|
|
||||||
static MxS32 g_unkCount;
|
static MxS32 g_count;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Init();
|
void Init();
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
#include "mxautolocker.h"
|
#include "mxautolocker.h"
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b8ed0
|
// FUNCTION: LEGO1 0x100b8ed0
|
||||||
MxAutoLocker::MxAutoLocker(MxCriticalSection* critsect)
|
MxAutoLocker::MxAutoLocker(MxCriticalSection* p_criticalSection)
|
||||||
{
|
{
|
||||||
this->m_criticalSection = critsect;
|
this->m_criticalSection = p_criticalSection;
|
||||||
if (this->m_criticalSection != 0)
|
if (this->m_criticalSection != 0)
|
||||||
this->m_criticalSection->Enter();
|
this->m_criticalSection->Enter();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
class MxAutoLocker {
|
class MxAutoLocker {
|
||||||
public:
|
public:
|
||||||
MxAutoLocker(MxCriticalSection* cs);
|
MxAutoLocker(MxCriticalSection* p_criticalSection);
|
||||||
~MxAutoLocker();
|
~MxAutoLocker();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -230,7 +230,7 @@ void MxBackgroundAudioManager::StopAction(MxParam& p_param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007f2f0
|
// FUNCTION: LEGO1 0x1007f2f0
|
||||||
MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2)
|
MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, undefined4 p_unk0x13c)
|
||||||
{
|
{
|
||||||
if (!m_musicEnabled) {
|
if (!m_musicEnabled) {
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
@ -253,8 +253,8 @@ MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_
|
|||||||
GetCurrentAction().SetUnknown24(action.GetUnknown24());
|
GetCurrentAction().SetUnknown24(action.GetUnknown24());
|
||||||
|
|
||||||
if (result == SUCCESS) {
|
if (result == SUCCESS) {
|
||||||
m_unk0x13c = p_unknown2;
|
m_unk0x13c = p_unk0x13c;
|
||||||
m_unk0x140 = p_unknown;
|
m_unk0x140 = p_unk0x140;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -308,11 +308,11 @@ void MxBackgroundAudioManager::RaiseVolume()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007f5f0
|
// FUNCTION: LEGO1 0x1007f5f0
|
||||||
void MxBackgroundAudioManager::Enable(MxBool p)
|
void MxBackgroundAudioManager::Enable(MxBool p_enable)
|
||||||
{
|
{
|
||||||
if (this->m_musicEnabled != p) {
|
if (this->m_musicEnabled != p_enable) {
|
||||||
this->m_musicEnabled = p;
|
this->m_musicEnabled = p_enable;
|
||||||
if (!p) {
|
if (!p_enable) {
|
||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,13 +33,13 @@ class MxBackgroundAudioManager : public MxCore {
|
|||||||
|
|
||||||
void StartAction(MxParam& p_param);
|
void StartAction(MxParam& p_param);
|
||||||
void StopAction(MxParam& p_param);
|
void StopAction(MxParam& p_param);
|
||||||
MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2);
|
MxResult PlayMusic(MxDSAction& p_action, undefined4 p_unk0x140, undefined4 p_unk0x13c);
|
||||||
|
|
||||||
void FUN_1007ee70();
|
void FUN_1007ee70();
|
||||||
void FUN_1007ef40();
|
void FUN_1007ef40();
|
||||||
void FadeInOrFadeOut();
|
void FadeInOrFadeOut();
|
||||||
|
|
||||||
__declspec(dllexport) void Enable(unsigned char p);
|
__declspec(dllexport) void Enable(MxBool p_enable);
|
||||||
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
|
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
|
||||||
|
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|||||||
@ -21,7 +21,7 @@ inline MxLong AlignToFourByte(MxLong p_value)
|
|||||||
// Same as the one from legoutil.h, but flipped the other way
|
// Same as the one from legoutil.h, but flipped the other way
|
||||||
// TODO: While it's not outside the realm of possibility that they
|
// TODO: While it's not outside the realm of possibility that they
|
||||||
// reimplemented Abs for only this file, that seems odd, right?
|
// reimplemented Abs for only this file, that seems odd, right?
|
||||||
inline MxLong _Abs(MxLong p_value)
|
inline MxLong AbsFlipped(MxLong p_value)
|
||||||
{
|
{
|
||||||
return p_value > 0 ? p_value : -p_value;
|
return p_value > 0 ? p_value : -p_value;
|
||||||
}
|
}
|
||||||
@ -64,9 +64,9 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette,
|
|||||||
if (m_info) {
|
if (m_info) {
|
||||||
m_data = new MxU8[size];
|
m_data = new MxU8[size];
|
||||||
if (m_data) {
|
if (m_data) {
|
||||||
m_bmiHeader = &m_info->bmiHeader;
|
m_bmiHeader = &m_info->m_bmiHeader;
|
||||||
m_paletteData = m_info->bmiColors;
|
m_paletteData = m_info->m_bmiColors;
|
||||||
memset(&m_info->bmiHeader, 0, sizeof(m_info->bmiHeader));
|
memset(&m_info->m_bmiHeader, 0, sizeof(m_info->m_bmiHeader));
|
||||||
|
|
||||||
m_bmiHeader->biSize = sizeof(*m_bmiHeader); // should be 40 bytes
|
m_bmiHeader->biSize = sizeof(*m_bmiHeader); // should be 40 bytes
|
||||||
m_bmiHeader->biWidth = p_width;
|
m_bmiHeader->biWidth = p_width;
|
||||||
@ -103,8 +103,8 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette,
|
|||||||
MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info)
|
MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info)
|
||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
MxLong width = p_info->bmiHeader.biWidth;
|
MxLong width = p_info->m_bmiHeader.biWidth;
|
||||||
MxLong height = p_info->bmiHeader.biHeight;
|
MxLong height = p_info->m_bmiHeader.biHeight;
|
||||||
MxLong size = AlignToFourByte(width) * height;
|
MxLong size = AlignToFourByte(width) * height;
|
||||||
|
|
||||||
this->m_info = new MxBITMAPINFO;
|
this->m_info = new MxBITMAPINFO;
|
||||||
@ -112,8 +112,8 @@ MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info)
|
|||||||
this->m_data = new MxU8[size];
|
this->m_data = new MxU8[size];
|
||||||
if (this->m_data) {
|
if (this->m_data) {
|
||||||
memcpy(this->m_info, p_info, sizeof(*this->m_info));
|
memcpy(this->m_info, p_info, sizeof(*this->m_info));
|
||||||
this->m_bmiHeader = &this->m_info->bmiHeader;
|
this->m_bmiHeader = &this->m_info->m_bmiHeader;
|
||||||
this->m_paletteData = this->m_info->bmiColors;
|
this->m_paletteData = this->m_info->m_bmiColors;
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,16 +140,16 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap)
|
|||||||
|
|
||||||
this->m_info = new MxBITMAPINFO;
|
this->m_info = new MxBITMAPINFO;
|
||||||
if (this->m_info) {
|
if (this->m_info) {
|
||||||
MxLong height = _Abs(p_bitmap->m_bmiHeader->biHeight);
|
MxLong height = AbsFlipped(p_bitmap->m_bmiHeader->biHeight);
|
||||||
this->m_data = new MxU8[AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height];
|
this->m_data = new MxU8[AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height];
|
||||||
if (this->m_data) {
|
if (this->m_data) {
|
||||||
memcpy(this->m_info, p_bitmap->m_info, sizeof(*this->m_info));
|
memcpy(this->m_info, p_bitmap->m_info, sizeof(*this->m_info));
|
||||||
height = _Abs(p_bitmap->m_bmiHeader->biHeight);
|
height = AbsFlipped(p_bitmap->m_bmiHeader->biHeight);
|
||||||
memcpy(this->m_data, p_bitmap->m_data, AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height);
|
memcpy(this->m_data, p_bitmap->m_data, AlignToFourByte(p_bitmap->m_bmiHeader->biWidth) * height);
|
||||||
|
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
this->m_bmiHeader = &this->m_info->bmiHeader;
|
this->m_bmiHeader = &this->m_info->m_bmiHeader;
|
||||||
this->m_paletteData = this->m_info->bmiColors;
|
this->m_paletteData = this->m_info->m_bmiColors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,18 +196,18 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle)
|
|||||||
this->m_info = new MxBITMAPINFO;
|
this->m_info = new MxBITMAPINFO;
|
||||||
if (this->m_info) {
|
if (this->m_info) {
|
||||||
ret = ReadFile(p_handle, this->m_info, sizeof(*this->m_info), &bytesRead, NULL);
|
ret = ReadFile(p_handle, this->m_info, sizeof(*this->m_info), &bytesRead, NULL);
|
||||||
if (ret && (this->m_info->bmiHeader.biBitCount == 8)) {
|
if (ret && (this->m_info->m_bmiHeader.biBitCount == 8)) {
|
||||||
MxLong size = hdr.bfSize - (sizeof(MxBITMAPINFO) + sizeof(BITMAPFILEHEADER));
|
MxLong size = hdr.bfSize - (sizeof(MxBITMAPINFO) + sizeof(BITMAPFILEHEADER));
|
||||||
this->m_data = new MxU8[size];
|
this->m_data = new MxU8[size];
|
||||||
if (this->m_data) {
|
if (this->m_data) {
|
||||||
ret = ReadFile(p_handle, this->m_data, size, &bytesRead, NULL);
|
ret = ReadFile(p_handle, this->m_data, size, &bytesRead, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
this->m_bmiHeader = &this->m_info->bmiHeader;
|
this->m_bmiHeader = &this->m_info->m_bmiHeader;
|
||||||
this->m_paletteData = this->m_info->bmiColors;
|
this->m_paletteData = this->m_info->m_bmiColors;
|
||||||
if (this->m_info->bmiHeader.biSizeImage == 0) {
|
if (this->m_info->m_bmiHeader.biSizeImage == 0) {
|
||||||
MxLong height = _Abs(this->m_info->bmiHeader.biHeight);
|
MxLong height = AbsFlipped(this->m_info->m_bmiHeader.biHeight);
|
||||||
this->m_info->bmiHeader.biSizeImage =
|
this->m_info->m_bmiHeader.biSizeImage =
|
||||||
AlignToFourByte(this->m_info->bmiHeader.biWidth) * height;
|
AlignToFourByte(this->m_info->m_bmiHeader.biWidth) * height;
|
||||||
}
|
}
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
// SIZE 0x428
|
// SIZE 0x428
|
||||||
struct MxBITMAPINFO {
|
struct MxBITMAPINFO {
|
||||||
BITMAPINFOHEADER bmiHeader;
|
BITMAPINFOHEADER m_bmiHeader;
|
||||||
RGBQUAD bmiColors[256];
|
RGBQUAD m_bmiColors[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Non-standard value for biCompression in the BITMAPINFOHEADER struct.
|
// Non-standard value for biCompression in the BITMAPINFOHEADER struct.
|
||||||
|
|||||||
@ -10,10 +10,10 @@
|
|||||||
DECOMP_SIZE_ASSERT(MxCompositePresenter, 0x4c);
|
DECOMP_SIZE_ASSERT(MxCompositePresenter, 0x4c);
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1000caf0
|
// FUNCTION: LEGO1 0x1000caf0
|
||||||
MxBool MxCompositePresenter::VTable0x64(undefined4 p_unknown)
|
MxBool MxCompositePresenter::VTable0x64(undefined4 p_undefined)
|
||||||
{
|
{
|
||||||
if (m_compositePresenter)
|
if (m_compositePresenter)
|
||||||
return m_compositePresenter->VTable0x64(p_unknown);
|
return m_compositePresenter->VTable0x64(p_undefined);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class MxCompositePresenter : public MxPresenter {
|
|||||||
virtual void VTable0x58(MxParam& p_param); // vtable+0x58
|
virtual void VTable0x58(MxParam& p_param); // vtable+0x58
|
||||||
virtual void VTable0x5c(MxParam& p_param); // vtable+0x5c
|
virtual void VTable0x5c(MxParam& p_param); // vtable+0x5c
|
||||||
virtual void VTable0x60(MxPresenter* p_presenter); // vtable+0x60
|
virtual void VTable0x60(MxPresenter* p_presenter); // vtable+0x60
|
||||||
virtual MxBool VTable0x64(undefined4 p_unknown); // vtable+0x64
|
virtual MxBool VTable0x64(undefined4 p_undefined); // vtable+0x64
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxCompositePresenterList m_list; // 0x40
|
MxCompositePresenterList m_list; // 0x40
|
||||||
|
|||||||
@ -3,4 +3,5 @@ configureLegoBuildingManager(MxS32): 'DLL exported function'
|
|||||||
configureLegoModelPresenter(MxS32): 'DLL exported function'
|
configureLegoModelPresenter(MxS32): 'DLL exported function'
|
||||||
configureLegoPartPresenter(MxS32, MxS32): 'DLL exported function'
|
configureLegoPartPresenter(MxS32, MxS32): 'DLL exported function'
|
||||||
configureLegoROI(MxS32): 'DLL exported function'
|
configureLegoROI(MxS32): 'DLL exported function'
|
||||||
GetNoCD_SourceName: 'DLL exported function'
|
configureLegoWorldPresenter(MxS32): 'DLL exported function'
|
||||||
|
GetNoCD_SourceName(): 'DLL exported function'
|
||||||
Loading…
Reference in New Issue
Block a user