Fix normal maps with spaces in filename not getting loaded

actorid
scrawl 12 years ago
parent b98063bba0
commit 23b477a938

@ -333,11 +333,6 @@ Ogre::String NIFMaterialLoader::getMaterial(const Nif::ShapeData *shapedata,
instance->setProperty("use_detail_map", sh::makeProperty(new sh::BooleanValue(true)));
instance->setProperty("detailMapUVSet", sh::makeProperty(new sh::IntValue(texprop->textures[Nif::NiTexturingProperty::DetailTexture].uvSet)));
}
if (!texName[Nif::NiTexturingProperty::BumpTexture].empty())
{
// force automips on normal maps for now
instance->setProperty("normalMap", sh::makeProperty(texName[Nif::NiTexturingProperty::BumpTexture] + " 4"));
}
for(int i = 0;i < 7;i++)
{

@ -2,6 +2,8 @@
#include <OgrePass.h>
#include <OgreStringConverter.h>
namespace sh
{
void OgreMaterialSerializer::reset()
@ -44,6 +46,13 @@ namespace sh
bool OgreMaterialSerializer::setTextureUnitProperty (const std::string& param, std::string value, Ogre::TextureUnitState* t)
{
// quick access to automip setting, without having to use 'texture' which doesn't like spaces in filenames
if (param == "num_mipmaps")
{
t->setNumMipmaps(Ogre::StringConverter::parseInt(value));
return true;
}
reset();
mScriptContext.section = Ogre::MSS_TEXTUREUNIT;

@ -55,7 +55,9 @@ material openmw_objects_base
texture_unit normalMap
{
texture $normalMap
direct_texture $normalMap
// force automips here for now
num_mipmaps 4
}
texture_unit emissiveMap

Loading…
Cancel
Save