Fix saving of effects
parent
76edcb87fd
commit
de42fd3547
|
@ -47,6 +47,11 @@
|
|||
//*************************************************************************
|
||||
|
||||
void modelShutdown();
|
||||
|
||||
/// Get filename of model pointer. This is really slow, so do not abuse for logging
|
||||
/// purposes, for example.
|
||||
const QString &modelName(iIMDShape *model);
|
||||
|
||||
iIMDShape *modelGet(const QString &filename);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -110,6 +110,7 @@ void modelShutdown()
|
|||
{
|
||||
iV_IMDRelease(i.value());
|
||||
}
|
||||
models.clear();
|
||||
}
|
||||
|
||||
static bool tryLoad(const QString &path, const QString &filename)
|
||||
|
@ -134,6 +135,20 @@ static bool tryLoad(const QString &path, const QString &filename)
|
|||
return false;
|
||||
}
|
||||
|
||||
const QString &modelName(iIMDShape *model)
|
||||
{
|
||||
for (MODELMAP::iterator i = models.begin(); i != models.end(); i = models.erase(i))
|
||||
{
|
||||
if (i.value() == model)
|
||||
{
|
||||
return i.key();
|
||||
}
|
||||
}
|
||||
ASSERT(false, "An IMD pointer could not be backtraced to a filename!");
|
||||
static QString error;
|
||||
return error;
|
||||
}
|
||||
|
||||
iIMDShape *modelGet(const QString &filename)
|
||||
{
|
||||
QString name(filename.toLower());
|
||||
|
|
|
@ -2537,8 +2537,8 @@ bool writeFXData(const char *fileName)
|
|||
ini.setValue("lifeSpan", it->lifeSpan);
|
||||
ini.setValue("radius", it->radius);
|
||||
|
||||
const char *imd_name = resGetNamefromData("IMD", it->imd);
|
||||
if (imd_name && *imd_name)
|
||||
const QString &imd_name = modelName(it->imd);
|
||||
if (!imd_name.isEmpty())
|
||||
{
|
||||
ini.setValue("imd_name", imd_name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue