1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Merge remote-tracking branch 'zini/master' into nifogre

This commit is contained in:
Chris Robinson 2013-04-13 13:04:41 -07:00
commit 4a42f89e08
6 changed files with 21 additions and 12 deletions

View File

@ -161,7 +161,7 @@ void OMW::Engine::loadBSA()
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
{
// Last data dir has the highest priority
std::string groupName = "Data" + Ogre::StringConverter::toString(dataDirs.size()-i);
std::string groupName = "Data" + Ogre::StringConverter::toString(dataDirs.size()-i, 8, '0');
Ogre::ResourceGroupManager::getSingleton ().createResourceGroup (groupName);
std::string dataDirectory = iter->string();
@ -176,7 +176,7 @@ void OMW::Engine::loadBSA()
if (mFileCollections.doesExist(*archive))
{
// Last BSA has the highest priority
std::string groupName = "DataBSA" + Ogre::StringConverter::toString(dataDirs.size()-i);
std::string groupName = "DataBSA" + Ogre::StringConverter::toString(mArchives.size()-i, 8, '0');
Ogre::ResourceGroupManager::getSingleton ().createResourceGroup (groupName);

View File

@ -801,8 +801,8 @@ namespace MWWorld
void World::scaleObject (const Ptr& ptr, float scale)
{
MWWorld::Class::get(ptr).adjustScale(ptr,scale);
ptr.getCellRef().mScale = scale;
MWWorld::Class::get(ptr).adjustScale(ptr,scale);
if(ptr.getRefData().getBaseNode() == 0)
return;

View File

@ -34,17 +34,20 @@ namespace Interpreter
std::string Runtime::getStringLiteral (int index) const
{
assert (index>=0 && index<static_cast<int> (mCode[3]));
assert (index>=0 && static_cast<int> (mCode[3])>0);
const char *literalBlock =
reinterpret_cast<const char *> (mCode + 4 + mCode[0] + mCode[1] + mCode[2]);
int offset = 0;
for (; index; --index)
{
literalBlock += std::strlen (literalBlock) + 1;
offset += std::strlen (literalBlock+offset) + 1;
assert (offset/4<static_cast<int> (mCode[3]));
}
return literalBlock;
return literalBlock+offset;
}
void Runtime::configure (const Interpreter::Type_Code *code, int codeSize, Context& context)

View File

@ -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++)
{

View File

@ -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;

View File

@ -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