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'
|
// 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
|
// TEMPLATE: LEGO1 0x1004eec0
|
||||||
// MxCollection<LegoNamedTexture *>::Compare
|
// MxCollection<LegoNamedTexture *>::Compare
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,26 @@
|
|||||||
#ifndef LEGOTEXTUREINFO_H
|
#ifndef LEGOTEXTUREINFO_H
|
||||||
#define LEGOTEXTUREINFO_H
|
#define LEGOTEXTUREINFO_H
|
||||||
|
|
||||||
|
#include "misc/legotypes.h"
|
||||||
|
#include "tgl/tgl.h"
|
||||||
|
|
||||||
#include <d3drmobj.h>
|
#include <d3drmobj.h>
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
|
||||||
class LegoTexture;
|
class LegoTexture;
|
||||||
|
|
||||||
// SIZE 0x10
|
// SIZE 0x10
|
||||||
struct LegoTextureInfo {
|
class LegoTextureInfo {
|
||||||
public:
|
public:
|
||||||
LegoTextureInfo();
|
LegoTextureInfo();
|
||||||
~LegoTextureInfo();
|
~LegoTextureInfo();
|
||||||
|
|
||||||
static LegoTextureInfo* Create(const char* p_name, LegoTexture* p_texture);
|
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
|
char* m_name; // 0x00
|
||||||
LPDIRECTDRAWSURFACE m_surface; // 0x04
|
LPDIRECTDRAWSURFACE m_surface; // 0x04
|
||||||
LPDIRECTDRAWPALETTE m_palette; // 0x08
|
LPDIRECTDRAWPALETTE m_palette; // 0x08
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class LegoTexturePresenter : public MxMediaPresenter {
|
|||||||
// LegoTexturePresenter::`scalar deleting destructor'
|
// LegoTexturePresenter::`scalar deleting destructor'
|
||||||
|
|
||||||
MxResult Read(MxDSChunk& p_chunk);
|
MxResult Read(MxDSChunk& p_chunk);
|
||||||
void FUN_1004f290();
|
MxResult Store();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LegoNamedTextureList* m_textures; // 0x50
|
LegoNamedTextureList* m_textures; // 0x50
|
||||||
|
|||||||
@ -151,3 +151,18 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text
|
|||||||
|
|
||||||
return NULL;
|
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;
|
LegoTexturePresenter texturePresenter;
|
||||||
if (texturePresenter.Read(chunk) == SUCCESS) {
|
if (texturePresenter.Read(chunk) == SUCCESS) {
|
||||||
texturePresenter.FUN_1004f290();
|
texturePresenter.Store();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] buff;
|
delete[] buff;
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "legoomni.h"
|
#include "legoomni.h"
|
||||||
#include "legovideomanager.h"
|
#include "legovideomanager.h"
|
||||||
|
#include "misc/legocontainer.h"
|
||||||
|
#include "misc/legoimage.h"
|
||||||
#include "misc/legostorage.h"
|
#include "misc/legostorage.h"
|
||||||
#include "mxcompositepresenter.h"
|
#include "mxcompositepresenter.h"
|
||||||
|
|
||||||
@ -80,10 +82,35 @@ MxResult LegoTexturePresenter::Read(MxDSChunk& p_chunk)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1004f290
|
// FUNCTION: LEGO1 0x1004f290
|
||||||
void LegoTexturePresenter::FUN_1004f290()
|
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
|
// STUB: LEGO1 0x1004fc60
|
||||||
|
|||||||
@ -122,6 +122,12 @@ class LegoTextureContainer : public LegoContainer<LegoTextureInfo> {
|
|||||||
// TEMPLATE: LEGO1 0x10001cc0
|
// TEMPLATE: LEGO1 0x10001cc0
|
||||||
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Lbound
|
// _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
|
// TEMPLATE: LEGO1 0x1004f960
|
||||||
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::iterator::_Dec
|
// _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 IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer);
|
||||||
inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh);
|
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
|
// FUNCTION: LEGO1 0x100aa380
|
||||||
LegoLOD::LegoLOD(Tgl::Renderer* p_renderer) : ViewLOD(p_renderer)
|
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);
|
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;
|
m_meshes[meshIndex].m_unk0x04 = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -328,7 +319,7 @@ LegoResult LegoLOD::FUN_100aad00(LegoTextureInfo* p_textureInfo)
|
|||||||
{
|
{
|
||||||
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
|
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
|
||||||
if (m_meshes[i].m_unk0x04) {
|
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_tglMesh->SetColor(1.0F, 1.0F, 1.0F, 0.0F);
|
||||||
m_meshes[i].m_unk0x04 = TRUE;
|
m_meshes[i].m_unk0x04 = TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include "viewmanager/viewlod.h"
|
#include "viewmanager/viewlod.h"
|
||||||
|
|
||||||
class LegoTextureContainer;
|
class LegoTextureContainer;
|
||||||
struct LegoTextureInfo;
|
class LegoTextureInfo;
|
||||||
class LegoStorage;
|
class LegoStorage;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dbf10
|
// VTABLE: LEGO1 0x100dbf10
|
||||||
|
|||||||
@ -8,7 +8,7 @@ typedef unsigned char (*ROIHandler)(const char*, char*, unsigned int);
|
|||||||
|
|
||||||
class LegoEntity;
|
class LegoEntity;
|
||||||
class LegoTextureContainer;
|
class LegoTextureContainer;
|
||||||
struct LegoTextureInfo;
|
class LegoTextureInfo;
|
||||||
class LegoStorage;
|
class LegoStorage;
|
||||||
class LegoAnim;
|
class LegoAnim;
|
||||||
class LegoAnimNodeData;
|
class LegoAnimNodeData;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user