mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Implement LegoTexturePresenter::Store
This commit is contained in:
parent
4f888b601e
commit
90b710eedc
@ -23,6 +23,37 @@ class LegoNamedTextureList : public MxPtrList<LegoNamedTexture> {
|
||||
// LegoNamedTextureList::`scalar deleting destructor'
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100d8170
|
||||
// class MxListCursor<LegoNamedTexture *>
|
||||
|
||||
// VTABLE: LEGO1 0x100d8188
|
||||
// class MxPtrListCursor<LegoNamedTexture>
|
||||
|
||||
// VTABLE: LEGO1 0x100d81a0
|
||||
// SIZE 0x10
|
||||
class LegoNamedTextureListCursor : public MxPtrListCursor<LegoNamedTexture> {
|
||||
public:
|
||||
LegoNamedTextureListCursor(LegoNamedTextureList* p_list) : MxPtrListCursor<LegoNamedTexture>(p_list) {}
|
||||
};
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1004f500
|
||||
// LegoNamedTextureListCursor::`scalar deleting destructor'
|
||||
|
||||
// FUNCTION: LEGO1 0x1004f570
|
||||
// MxPtrListCursor<LegoNamedTexture>::~MxPtrListCursor<LegoNamedTexture>
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1004f5c0
|
||||
// MxListCursor<LegoNamedTexture *>::`scalar deleting destructor'
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1004f630
|
||||
// MxPtrListCursor<LegoNamedTexture>::`scalar deleting destructor'
|
||||
|
||||
// FUNCTION: LEGO1 0x1004f6a0
|
||||
// MxListCursor<LegoNamedTexture *>::~MxListCursor<LegoNamedTexture *>
|
||||
|
||||
// FUNCTION: LEGO1 0x1004f6f0
|
||||
// LegoNamedTextureListCursor::~LegoNamedTextureListCursor
|
||||
|
||||
// TEMPLATE: LEGO1 0x1004eec0
|
||||
// MxCollection<LegoNamedTexture *>::Compare
|
||||
|
||||
|
||||
@ -1,19 +1,26 @@
|
||||
#ifndef LEGOTEXTUREINFO_H
|
||||
#define LEGOTEXTUREINFO_H
|
||||
|
||||
#include "misc/legotypes.h"
|
||||
#include "tgl/tgl.h"
|
||||
|
||||
#include <d3drmobj.h>
|
||||
#include <ddraw.h>
|
||||
|
||||
class LegoTexture;
|
||||
|
||||
// SIZE 0x10
|
||||
struct LegoTextureInfo {
|
||||
class LegoTextureInfo {
|
||||
public:
|
||||
LegoTextureInfo();
|
||||
~LegoTextureInfo();
|
||||
|
||||
static LegoTextureInfo* Create(const char* p_name, LegoTexture* p_texture);
|
||||
static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo);
|
||||
|
||||
LegoResult FUN_10066010(LegoU8* m_bits);
|
||||
|
||||
// private:
|
||||
char* m_name; // 0x00
|
||||
LPDIRECTDRAWSURFACE m_surface; // 0x04
|
||||
LPDIRECTDRAWPALETTE m_palette; // 0x08
|
||||
|
||||
@ -32,7 +32,7 @@ class LegoTexturePresenter : public MxMediaPresenter {
|
||||
// LegoTexturePresenter::`scalar deleting destructor'
|
||||
|
||||
MxResult Read(MxDSChunk& p_chunk);
|
||||
void FUN_1004f290();
|
||||
MxResult Store();
|
||||
|
||||
private:
|
||||
LegoNamedTextureList* m_textures; // 0x50
|
||||
|
||||
@ -151,3 +151,18 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10065f60
|
||||
BOOL LegoTextureInfo::SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo)
|
||||
{
|
||||
TglImpl::MeshImpl::MeshData* data = ((TglImpl::MeshImpl*) pMesh)->ImplementationData();
|
||||
data->groupMesh->SetGroupTexture(data->groupIndex, p_textureInfo->m_texture);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10066010
|
||||
LegoResult LegoTextureInfo::FUN_10066010(LegoU8* m_bits)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
|
||||
|
||||
LegoTexturePresenter texturePresenter;
|
||||
if (texturePresenter.Read(chunk) == SUCCESS) {
|
||||
texturePresenter.FUN_1004f290();
|
||||
texturePresenter.Store();
|
||||
}
|
||||
|
||||
delete[] buff;
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
#include "legoomni.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "misc/legocontainer.h"
|
||||
#include "misc/legoimage.h"
|
||||
#include "misc/legostorage.h"
|
||||
#include "mxcompositepresenter.h"
|
||||
|
||||
@ -80,10 +82,35 @@ MxResult LegoTexturePresenter::Read(MxDSChunk& p_chunk)
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004f290
|
||||
void LegoTexturePresenter::FUN_1004f290()
|
||||
// FUNCTION: LEGO1 0x1004f290
|
||||
MxResult LegoTexturePresenter::Store()
|
||||
{
|
||||
// TODO
|
||||
LegoNamedTextureListCursor cursor(m_textures);
|
||||
LegoNamedTexture* namedTexture;
|
||||
VideoManager();
|
||||
|
||||
while (cursor.Next(namedTexture)) {
|
||||
LegoTexture* texture = namedTexture->GetTexture();
|
||||
LegoTextureInfo* textureInfo = TextureContainer()->Get(namedTexture->GetName()->GetData());
|
||||
|
||||
if (textureInfo == NULL) {
|
||||
textureInfo = LegoTextureInfo::Create(namedTexture->GetName()->GetData(), texture);
|
||||
|
||||
if (textureInfo != NULL) {
|
||||
TextureContainer()->Add(namedTexture->GetName()->GetData(), textureInfo);
|
||||
}
|
||||
}
|
||||
else {
|
||||
textureInfo->FUN_10066010(texture->GetImage()->GetBits());
|
||||
}
|
||||
}
|
||||
|
||||
if (m_textures != NULL) {
|
||||
delete m_textures;
|
||||
}
|
||||
|
||||
m_textures = NULL;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004fc60
|
||||
|
||||
@ -122,6 +122,12 @@ class LegoTextureContainer : public LegoContainer<LegoTextureInfo> {
|
||||
// TEMPLATE: LEGO1 0x10001cc0
|
||||
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Lbound
|
||||
|
||||
// TEMPLATE: LEGO1 0x1004f740
|
||||
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::find
|
||||
|
||||
// TEMPLATE: LEGO1 0x1004f800
|
||||
// map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::insert
|
||||
|
||||
// TEMPLATE: LEGO1 0x1004f960
|
||||
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::iterator::_Dec
|
||||
|
||||
|
||||
@ -21,15 +21,6 @@ const char* g_unk0x101013dc = "inh";
|
||||
inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer);
|
||||
inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh);
|
||||
|
||||
// TODO: Find out which unit this belongs to
|
||||
// STUB: LEGO1 0x10065f60
|
||||
BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo)
|
||||
{
|
||||
TglImpl::MeshImpl::MeshData* data = ((TglImpl::MeshImpl*) pMesh)->ImplementationData();
|
||||
data->groupMesh->SetGroupTexture(data->groupIndex, p_textureInfo->m_texture);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aa380
|
||||
LegoLOD::LegoLOD(Tgl::Renderer* p_renderer) : ViewLOD(p_renderer)
|
||||
{
|
||||
@ -231,7 +222,7 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
|
||||
}
|
||||
|
||||
m_meshes[meshIndex].m_tglMesh->SetColor(1.0F, 1.0F, 1.0F, 0.0F);
|
||||
SetGroupTexture(m_meshes[meshIndex].m_tglMesh, textureInfo);
|
||||
LegoTextureInfo::SetGroupTexture(m_meshes[meshIndex].m_tglMesh, textureInfo);
|
||||
m_meshes[meshIndex].m_unk0x04 = TRUE;
|
||||
}
|
||||
else {
|
||||
@ -328,7 +319,7 @@ LegoResult LegoLOD::FUN_100aad00(LegoTextureInfo* p_textureInfo)
|
||||
{
|
||||
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
|
||||
if (m_meshes[i].m_unk0x04) {
|
||||
SetGroupTexture(m_meshes[i].m_tglMesh, p_textureInfo);
|
||||
LegoTextureInfo::SetGroupTexture(m_meshes[i].m_tglMesh, p_textureInfo);
|
||||
m_meshes[i].m_tglMesh->SetColor(1.0F, 1.0F, 1.0F, 0.0F);
|
||||
m_meshes[i].m_unk0x04 = TRUE;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "viewmanager/viewlod.h"
|
||||
|
||||
class LegoTextureContainer;
|
||||
struct LegoTextureInfo;
|
||||
class LegoTextureInfo;
|
||||
class LegoStorage;
|
||||
|
||||
// VTABLE: LEGO1 0x100dbf10
|
||||
|
||||
@ -8,7 +8,7 @@ typedef unsigned char (*ROIHandler)(const char*, char*, unsigned int);
|
||||
|
||||
class LegoEntity;
|
||||
class LegoTextureContainer;
|
||||
struct LegoTextureInfo;
|
||||
class LegoTextureInfo;
|
||||
class LegoStorage;
|
||||
class LegoAnim;
|
||||
class LegoAnimNodeData;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user