mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-25 01:14:19 +00:00
Refactor LegoContainer (#587)
* Refactor LegoContainer * Fix name * Fix build * Refactor some includes * Update STL compat * Fix * Fix annotations
This commit is contained in:
committed by
GitHub
parent
9d8820ee06
commit
6b1c75ab5a
@@ -1,18 +1,15 @@
|
||||
#include "legocontainer.h"
|
||||
#include "legotextureinfo.h"
|
||||
|
||||
#include "lego/sources/misc/legoimage.h"
|
||||
#include "lego/sources/misc/legotexture.h"
|
||||
#include "legoomni.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "misc/legoimage.h"
|
||||
#include "misc/legotexture.h"
|
||||
#include "tgl/d3drm/impl.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(TextureData, 0x10);
|
||||
DECOMP_SIZE_ASSERT(LegoContainerInfo<LegoTexture>, 0x10);
|
||||
// DECOMP_SIZE_ASSERT(LegoContainer<LegoTexture>, 0x18);
|
||||
DECOMP_SIZE_ASSERT(LegoTextureContainer, 0x24);
|
||||
DECOMP_SIZE_ASSERT(LegoTextureInfo, 0x10);
|
||||
|
||||
// FUNCTION: LEGO1 0x10065bf0
|
||||
TextureData::TextureData()
|
||||
LegoTextureInfo::LegoTextureInfo()
|
||||
{
|
||||
m_name = NULL;
|
||||
m_surface = NULL;
|
||||
@@ -21,7 +18,7 @@ TextureData::TextureData()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10065c00
|
||||
TextureData::~TextureData()
|
||||
LegoTextureInfo::~LegoTextureInfo()
|
||||
{
|
||||
if (m_name) {
|
||||
delete[] m_name;
|
||||
@@ -45,9 +42,9 @@ TextureData::~TextureData()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10065c60
|
||||
TextureData* TextureData::Create(const char* p_name, LegoTexture* p_texture)
|
||||
LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_texture)
|
||||
{
|
||||
TextureData* texture = new TextureData();
|
||||
LegoTextureInfo* texture = new LegoTextureInfo();
|
||||
|
||||
if (p_name == NULL || p_texture == NULL) {
|
||||
return NULL;
|
||||
@@ -154,35 +151,3 @@ done:
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10099870
|
||||
LegoTextureContainer::~LegoTextureContainer()
|
||||
{
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10099cc0
|
||||
void LegoTextureContainer::FUN_10099cc0(TextureData* p_data)
|
||||
{
|
||||
if (p_data == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef COMPAT_MODE
|
||||
TextureList::iterator it;
|
||||
for (it = m_list.begin(); it != m_list.end(); it++) {
|
||||
#else
|
||||
for (TextureList::iterator it = m_list.begin(); it != m_list.end(); it++) {
|
||||
#endif
|
||||
if (*it == p_data) {
|
||||
// TODO: This is wrong, but what is at +0x0c on the iterator?
|
||||
*it = NULL;
|
||||
|
||||
if (p_data->m_texture->Release() == TRUE) {
|
||||
delete p_data;
|
||||
m_list.erase(it);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
#include "ambulancemissionstate.h"
|
||||
#include "jukebox.h"
|
||||
#include "legocontainer.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legoomni.h"
|
||||
#include "misc/legocontainer.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxnotificationparam.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
@@ -233,7 +233,7 @@ void Score::Enable(MxBool p_enable)
|
||||
// FUNCTION: LEGO1 0x100019d0
|
||||
void Score::Paint()
|
||||
{
|
||||
TextureData* gd = GetTextureContainer()->Get("bigcube.gif");
|
||||
LegoTextureInfo* gd = TextureContainer()->Get("bigcube.gif");
|
||||
|
||||
if (gd) {
|
||||
RaceState* l78 = (RaceState*) GameState()->GetState("JetskiRaceState");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legobuildingmanager.h"
|
||||
#include "legocontainer.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legoobjectfactory.h"
|
||||
@@ -14,6 +13,7 @@
|
||||
#include "legovideomanager.h"
|
||||
#include "legoworld.h"
|
||||
#include "legoworldlist.h"
|
||||
#include "misc/legocontainer.h"
|
||||
#include "mxactionnotificationparam.h"
|
||||
#include "mxautolocker.h"
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
@@ -215,7 +215,7 @@ LegoBuildingManager* BuildingManager()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015800
|
||||
LegoTextureContainer* GetTextureContainer()
|
||||
LegoTextureContainer* TextureContainer()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetTextureContainer();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "legopalettepresenter.h"
|
||||
|
||||
#include "lego/sources/misc/legostorage.h"
|
||||
#include "legoomni.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "misc/legostorage.h"
|
||||
#include "mxstreamchunk.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPalettePresenter, 0x68)
|
||||
|
||||
Reference in New Issue
Block a user