mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-13 08:07:37 +00:00
Run clang-format
This commit is contained in:
parent
b602c11c4a
commit
2778938be2
@ -2,7 +2,6 @@
|
||||
#define ACT1STATE_H
|
||||
|
||||
#include "legostate.h"
|
||||
|
||||
#include "misc/legotexture.h"
|
||||
#include "roi/legoroi.h"
|
||||
|
||||
@ -63,18 +62,16 @@ class Act1State : public LegoState {
|
||||
// SIZE 0x14
|
||||
class NamedTexture {
|
||||
public:
|
||||
~NamedTexture() {
|
||||
delete m_texture;
|
||||
}
|
||||
~NamedTexture() { delete m_texture; }
|
||||
// FUNCTION: LEGO1 0x1003f920
|
||||
const MxString *GetName() const {
|
||||
return &m_name;
|
||||
}
|
||||
const MxString* GetName() const { return &m_name; }
|
||||
LegoTexture* GetTexture() { return m_texture; }
|
||||
|
||||
private:
|
||||
MxString m_name; // 0x00
|
||||
LegoTexture* m_texture; // 0x4
|
||||
};
|
||||
|
||||
protected:
|
||||
int* m_unk0x008; // 0x008
|
||||
// FIXME: count for m_unk0x008
|
||||
|
||||
@ -25,11 +25,7 @@ int g_act1_ints[] = {
|
||||
};
|
||||
|
||||
// STUB: LEGO1 0x100334b0
|
||||
Act1State::Act1State()
|
||||
: m_unk0x00c(0)
|
||||
, m_unk0x00e(0)
|
||||
, m_unk0x008(NULL)
|
||||
, m_unk0x010(0)
|
||||
Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x010(0)
|
||||
{
|
||||
m_unk0x01e = 0;
|
||||
m_unk0x018 = 1;
|
||||
@ -76,59 +72,69 @@ MxResult Act1State::VTable0x1c(LegoFile* p_legoFile)
|
||||
if (m_unk0x108.GetName()->Compare("") != 0) {
|
||||
if (m_unk0x154) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x154);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "chwind.gif");
|
||||
}
|
||||
if (m_unk0x158) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x158);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "chjetl.gif");
|
||||
}
|
||||
if (m_unk0x15c) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x15c);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "chjetr.gif");
|
||||
}
|
||||
}
|
||||
if (m_unk0x164.GetName()->Compare("") != 0) {
|
||||
if (m_unk0x1b0) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x1b0);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "jsfrnt.gif");
|
||||
}
|
||||
if (m_unk0x1b4) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x1b4);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "jswnsh.gif");
|
||||
}
|
||||
}
|
||||
if (m_unk0x1bc.GetName()->Compare("") != 0) {
|
||||
if (m_unk0x208) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x208);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "dbfrfn.gif");
|
||||
}
|
||||
}
|
||||
if (m_unk0x210.GetName()->Compare("") != 0) {
|
||||
if (m_unk0x25c) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x25c);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "rcfrnt.gif");
|
||||
}
|
||||
if (m_unk0x260) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x260);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "rcback.gif");
|
||||
}
|
||||
if (m_unk0x264) {
|
||||
WriteNamedTexture(p_legoFile, m_unk0x264);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
FUN_1003f540(p_legoFile, "rctail.gif");
|
||||
}
|
||||
}
|
||||
p_legoFile->Write(&m_unk0x010, sizeof(undefined2));
|
||||
p_legoFile->Write(&m_unk0x022, sizeof(undefined));
|
||||
} else if (p_legoFile->IsReadMode()) {
|
||||
}
|
||||
else if (p_legoFile->IsReadMode()) {
|
||||
if (m_unk0x108.GetName()->Compare("") != 0) {
|
||||
m_unk0x154 = ReadNamedTexture(p_legoFile);
|
||||
if (m_unk0x154 == NULL) {
|
||||
@ -180,6 +186,24 @@ MxResult Act1State::VTable0x1c(LegoFile* p_legoFile)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100344d0
|
||||
int Act1State::NamedPlane::Serialize(LegoFile* p_file)
|
||||
{
|
||||
if (p_file->IsWriteMode()) {
|
||||
p_file->FUN_10006030(m_name);
|
||||
p_file->WriteVector3(m_point1);
|
||||
p_file->WriteVector3(m_point2);
|
||||
p_file->WriteVector3(m_point3);
|
||||
}
|
||||
else if (p_file->IsReadMode()) {
|
||||
p_file->ReadString(&m_name);
|
||||
p_file->ReadVector3(&m_point1);
|
||||
p_file->ReadVector3(&m_point2);
|
||||
p_file->ReadVector3(&m_point3);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100346d0
|
||||
MxBool Act1State::SetFlag()
|
||||
{
|
||||
@ -252,34 +276,20 @@ void Act1State::FUN_10034d00()
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003f8a0
|
||||
void WriteNamedTexture(LegoFile *p_file, Act1State::NamedTexture *p_texture) {
|
||||
p_file->FUN_10006030(*p_texture->GetName());
|
||||
p_texture->GetTexture()->Write(p_file);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003f3b0
|
||||
Act1State::NamedTexture *ReadNamedTexture(LegoFile *p_file) {
|
||||
Act1State::NamedTexture* ReadNamedTexture(LegoFile* p_file)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100344d0
|
||||
int Act1State::NamedPlane::Serialize(LegoFile *p_file) {
|
||||
if (p_file->IsWriteMode()) {
|
||||
p_file->FUN_10006030(m_name);
|
||||
p_file->WriteVector3(m_point1);
|
||||
p_file->WriteVector3(m_point2);
|
||||
p_file->WriteVector3(m_point3);
|
||||
} else if (p_file->IsReadMode()) {
|
||||
p_file->ReadString(&m_name);
|
||||
p_file->ReadVector3(&m_point1);
|
||||
p_file->ReadVector3(&m_point2);
|
||||
p_file->ReadVector3(&m_point3);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003f540
|
||||
void FUN_1003f540(LegoFile *p_file, const char *p_filename) {
|
||||
|
||||
void FUN_1003f540(LegoFile* p_file, const char* p_filename)
|
||||
{
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003f8a0
|
||||
void WriteNamedTexture(LegoFile* p_file, Act1State::NamedTexture* p_texture)
|
||||
{
|
||||
p_file->FUN_10006030(*p_texture->GetName());
|
||||
p_texture->GetTexture()->Write(p_file);
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
|
||||
#include "legotypes.h"
|
||||
#include "mxstring.h"
|
||||
|
||||
#include "vector.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -75,7 +74,8 @@ class LegoFile : public LegoStorage {
|
||||
LegoResult Open(const char* p_name, LegoU32 p_mode);
|
||||
|
||||
// FUNCTION: LEGO1 0x10034430
|
||||
LegoStorage *ReadVector3(Vector3 *p_vec3) {
|
||||
LegoStorage* ReadVector3(Vector3* p_vec3)
|
||||
{
|
||||
Read(&(*p_vec3)[0], sizeof(float));
|
||||
Read(&(*p_vec3)[1], sizeof(float));
|
||||
Read(&(*p_vec3)[2], sizeof(float));
|
||||
@ -83,7 +83,8 @@ class LegoFile : public LegoStorage {
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100343d0
|
||||
LegoStorage *WriteVector3(Vector3 p_vec3) {
|
||||
LegoStorage* WriteVector3(Vector3 p_vec3)
|
||||
{
|
||||
Write(&p_vec3[0], sizeof(float));
|
||||
Write(&p_vec3[1], sizeof(float));
|
||||
Write(&p_vec3[2], sizeof(float));
|
||||
@ -91,7 +92,8 @@ class LegoFile : public LegoStorage {
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10034470
|
||||
LegoStorage *ReadString(MxString *p_str) {
|
||||
LegoStorage* ReadString(MxString* p_str)
|
||||
{
|
||||
MxU16 len;
|
||||
Read(&len, sizeof(MxU16));
|
||||
char* text = new char[len + 1];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user