mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-20 14:51:15 +00:00
MxStringVariable -> MxVariable
This commit is contained in:
parent
fb56735fbd
commit
2466878e35
@ -141,11 +141,11 @@ add_library(lego1 SHARED
|
||||
LEGO1/mxstillpresenter.cpp
|
||||
LEGO1/mxstreamer.cpp
|
||||
LEGO1/mxstring.cpp
|
||||
LEGO1/mxstringvariable.cpp
|
||||
LEGO1/mxtimer.cpp
|
||||
LEGO1/mxtransitionmanager.cpp
|
||||
LEGO1/mxunknown100dc6b0.cpp
|
||||
LEGO1/mxunknown100dc6e0.cpp
|
||||
LEGO1/mxvariable.cpp
|
||||
LEGO1/mxvariabletable.cpp
|
||||
LEGO1/mxvideomanager.cpp
|
||||
LEGO1/mxvideoparam.cpp
|
||||
|
||||
@ -9,18 +9,18 @@ const char *g_set = "set";
|
||||
const char *g_reset = "reset";
|
||||
|
||||
// OFFSET: LEGO1 0x1003bfb0
|
||||
LegoBackgroundColor::LegoBackgroundColor(const char *p_name, const char *p_colorString)
|
||||
LegoBackgroundColor::LegoBackgroundColor(const char *p_key, const char *p_value)
|
||||
{
|
||||
m_name = p_name;
|
||||
m_name.ToUpperCase();
|
||||
SetColorString(p_colorString);
|
||||
m_key = p_key;
|
||||
m_key.ToUpperCase();
|
||||
SetValue(p_value);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003c070
|
||||
void LegoBackgroundColor::SetColorString(const char *p_colorString)
|
||||
void LegoBackgroundColor::SetValue(const char *p_colorString)
|
||||
{
|
||||
m_string = p_colorString;
|
||||
m_string.ToLowerCase();
|
||||
m_value = p_colorString;
|
||||
m_value.ToLowerCase();
|
||||
|
||||
LegoVideoManager *videomanager = VideoManager();
|
||||
if (!videomanager || !p_colorString)
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
#ifndef LEGOBACKGROUNDCOLOR_H
|
||||
#define LEGOBACKGROUNDCOLOR_H
|
||||
|
||||
#include "mxstringvariable.h"
|
||||
#include "mxvariable.h"
|
||||
|
||||
class LegoBackgroundColor : public MxStringVariable
|
||||
class LegoBackgroundColor : public MxVariable
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) LegoBackgroundColor(const char *p_name, const char *p_colorString);
|
||||
void SetColorString(const char *p_colorString);
|
||||
__declspec(dllexport) LegoBackgroundColor(const char *p_key, const char *p_value);
|
||||
void SetValue(const char *p_colorString);
|
||||
|
||||
private:
|
||||
float h;
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
#include "mxstringvariable.h"
|
||||
#include "mxstring.h"
|
||||
|
||||
|
||||
// OFFSET: LEGO1 0x1003bea0
|
||||
MxString *MxStringVariable::GetString()
|
||||
{
|
||||
return &m_string;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003beb0
|
||||
void MxStringVariable::SetString(const char *colorString)
|
||||
{
|
||||
m_string = colorString;
|
||||
}
|
||||
|
||||
//FIXME: Figure out what exactly this class is used for. It is used in LegoGameState::LegoGameState when loading the background color, and for loading the "fsmovie" variable
|
||||
// OFFSET: LEGO1 0x1003bec0
|
||||
void MxStringVariable::Destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
#ifndef MXSTRINGVARIABLE_H
|
||||
#define MXSTRINGVARIABLE_H
|
||||
#include "mxstring.h"
|
||||
#include "mxcore.h"
|
||||
//VTABLE: 0x100d74a8
|
||||
class MxStringVariable
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) MxStringVariable(const char *, const char *);
|
||||
MxStringVariable() {}
|
||||
virtual MxString *GetString();
|
||||
virtual void SetString(const char *colorString);
|
||||
virtual void Destroy();
|
||||
|
||||
protected:
|
||||
MxString m_name;
|
||||
MxString m_string;
|
||||
};
|
||||
|
||||
#endif // MXSTRINGVARIABLE_H
|
||||
20
LEGO1/mxvariable.cpp
Normal file
20
LEGO1/mxvariable.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "mxvariable.h"
|
||||
#include "mxstring.h"
|
||||
|
||||
// OFFSET: LEGO1 0x1003bea0
|
||||
MxString *MxVariable::GetValue()
|
||||
{
|
||||
return &m_value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003beb0
|
||||
void MxVariable::SetValue(const char *value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003bec0
|
||||
void MxVariable::Destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
24
LEGO1/mxvariable.h
Normal file
24
LEGO1/mxvariable.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef MXVARIABLE_H
|
||||
#define MXVARIABLE_H
|
||||
|
||||
#include "mxstring.h"
|
||||
#include "mxcore.h"
|
||||
|
||||
//VTABLE: 0x100d74a8
|
||||
class MxVariable
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) MxVariable(const char *, const char *);
|
||||
MxVariable() {}
|
||||
virtual MxString *GetValue();
|
||||
virtual void SetValue(const char *);
|
||||
virtual void Destroy();
|
||||
|
||||
inline const MxString *GetKey() const { return &m_value; }
|
||||
|
||||
protected:
|
||||
MxString m_key;
|
||||
MxString m_value;
|
||||
};
|
||||
|
||||
#endif // MXVARIABLE_H
|
||||
@ -1,8 +1,22 @@
|
||||
#include "mxvariabletable.h"
|
||||
|
||||
// OFFSET: LEGO1 0x100b73a0
|
||||
void MxVariableTable::SetVariable(const char *key, const char *value)
|
||||
// OFFSET: LEGO1 0x100b7370
|
||||
int MxVariableTable::KeyChecksum(MxVariable *p_var)
|
||||
{
|
||||
const char *str = p_var->GetKey()->GetData();
|
||||
int value = 0;
|
||||
|
||||
for (int i = 0; str[i]; i++) {
|
||||
value += (int)str[i];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b73a0
|
||||
void MxVariableTable::SetVariable(const char *p_key, const char *p_value)
|
||||
{
|
||||
MxVariable *var = new MxVariable();
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,29 @@
|
||||
#ifndef MXVARIABLETABLE_H
|
||||
#define MXVARIABLETABLE_H
|
||||
|
||||
class MxVariable;
|
||||
#include "mxcore.h"
|
||||
#include "mxvariable.h"
|
||||
|
||||
// VTABLE 0x100dc1c8
|
||||
// SIZE 0x28
|
||||
class MxVariableTable
|
||||
class MxVariableTable : public MxCore
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) const char * GetVariable(const char *key);
|
||||
__declspec(dllexport) void SetVariable(MxVariable *var);
|
||||
__declspec(dllexport) void SetVariable(const char *key, const char *value);
|
||||
|
||||
virtual int KeyChecksum(MxVariable *); // +0x18
|
||||
|
||||
//private:
|
||||
int m_unk8;
|
||||
void (*m_unkc)(void *); // +0xc
|
||||
void *m_table; // +0x10
|
||||
int m_tableLen; // +0x14
|
||||
int m_unk18;
|
||||
int m_unk1c;
|
||||
int m_unk20;
|
||||
int m_unk24;
|
||||
};
|
||||
|
||||
#endif // MXVARIABLETABLE_H
|
||||
|
||||
Loading…
Reference in New Issue
Block a user