Adds test shapes of Kork and SpaceOrc

Sidestep of memleak from CSF at the moment
Minor fixes and corrections with asset importing and loose files
WIP of updated options menu
This commit is contained in:
Areloch 2019-05-28 17:24:29 -05:00
parent 98c4606b3c
commit ae857faae2
40 changed files with 765 additions and 182 deletions

View file

@ -116,6 +116,7 @@ Material::Material()
{
mDiffuse[i].set( 1.0f, 1.0f, 1.0f, 1.0f );
mDiffuseMapSRGB[i] = true;
mDiffuseMapAsset[i] = StringTable->EmptyString();
mSmoothness[i] = 0.0f;
mMetalness[i] = 0.0f;
@ -172,8 +173,10 @@ Material::Material()
// Deferred Shading
mMatInfoFlags[i] = 0.0f;
mRoughMapFilename[i].clear();
mRoughMapAsset[i] = StringTable->EmptyString();
mAOMapFilename[i].clear();
mMetalMapFilename[i].clear();
mMetalMapAsset[i] = StringTable->EmptyString();
}
dMemset(mCellIndex, 0, sizeof(mCellIndex));
@ -235,6 +238,9 @@ void Material::initPersistFields()
addField("diffuseMap", TypeImageFilename, Offset(mDiffuseMapFilename, Material), MAX_STAGES,
"The diffuse color texture map." );
addField("diffuseMapAsset", TypeImageAssetPtr, Offset(mDiffuseMapAsset, Material), MAX_STAGES,
"The diffuse color texture map." );
addField("diffuseMapSRGB", TypeBool, Offset(mDiffuseMapSRGB, Material), MAX_STAGES,
"Enable sRGB for the diffuse color texture map.");
@ -636,7 +642,7 @@ void Material::_mapMaterial()
// If mapTo not defined in script, try to use the base texture name instead
if( mMapTo.isEmpty() )
{
if ( mDiffuseMapFilename[0].isEmpty() )
if ( mDiffuseMapFilename[0].isEmpty() && mDiffuseMapAsset->isNull())
return;
else
@ -652,6 +658,10 @@ void Material::_mapMaterial()
// use everything after the last slash
mMapTo = mDiffuseMapFilename[0].substr(slashPos+1, mDiffuseMapFilename[0].length() - slashPos - 1);
}
else if (!mDiffuseMapAsset->isNull())
{
mMapTo = mDiffuseMapAsset[0]->getImageFileName();
}
}
}