mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 20:59:00 +00:00
EMI: Share all materials for a given costume
This commit is contained in:
parent
0193a50f13
commit
cf1d73420b
@ -92,6 +92,8 @@ void EMICostume::load(Common::SeekableReadStream *data) {
|
||||
if (_emiSkel) {
|
||||
_emiMesh->_obj->setSkeleton(_emiSkel->_obj);
|
||||
}
|
||||
for (unsigned int z = 0; z < _emiMesh->_obj->_numTextures; ++z)
|
||||
_materials.push_back(_emiMesh->_obj->_mats[z]);
|
||||
} else if (component->isComponentType('s','k','e','l')) {
|
||||
_emiSkel = static_cast<EMISkelComponent *>(component);
|
||||
if (_emiMesh) {
|
||||
@ -220,6 +222,18 @@ int EMICostume::update(uint time) {
|
||||
return marker;
|
||||
}
|
||||
|
||||
Material * EMICostume::findSharedMaterial(const Common::String &name) {
|
||||
Common::List<Material *>::iterator it = _materials.begin();
|
||||
for (; it != _materials.end(); ++it)
|
||||
if ((*it)->getFilename() == name)
|
||||
return *it;
|
||||
|
||||
Material * mat = g_resourceloader->loadMaterial(name.c_str(), NULL);
|
||||
_materials.push_back(mat);
|
||||
return mat;
|
||||
}
|
||||
|
||||
|
||||
void EMICostume::saveState(SaveGame *state) const {
|
||||
// TODO
|
||||
return;
|
||||
|
@ -34,6 +34,7 @@ typedef uint32 tag32;
|
||||
|
||||
class EMISkelComponent;
|
||||
class EMIMeshComponent;
|
||||
class Material;
|
||||
|
||||
class EMICostume : public Costume {
|
||||
public:
|
||||
@ -47,9 +48,11 @@ public:
|
||||
void saveState(SaveGame *state) const;
|
||||
bool restoreState(SaveGame *state);
|
||||
|
||||
Material * findSharedMaterial(const Common::String &name);
|
||||
public:
|
||||
EMISkelComponent *_emiSkel;
|
||||
EMIMeshComponent *_emiMesh;
|
||||
Common::List<Material *> _materials;
|
||||
private:
|
||||
Component *loadComponent(Component *parent, int parentID, const char *name, Component *prevComponent);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user