mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Merge pull request #2147 from akortunov/uvcontroller
Apply UVControllers only for given UV Set
This commit is contained in:
commit
e748abde7d
4 changed files with 9 additions and 2 deletions
|
@ -22,6 +22,7 @@
|
||||||
Bug #4803: Stray special characters before begin statement break script compilation
|
Bug #4803: Stray special characters before begin statement break script compilation
|
||||||
Bug #4804: Particle system with the "Has Sizes = false" causes an exception
|
Bug #4804: Particle system with the "Has Sizes = false" causes an exception
|
||||||
Bug #4820: Spell absorption is broken
|
Bug #4820: Spell absorption is broken
|
||||||
|
Bug #4827: NiUVController is handled incorrectly
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3442: Default values for fallbacks from ini file
|
Feature #3442: Default values for fallbacks from ini file
|
||||||
Feature #3610: Option to invert X axis
|
Feature #3610: Option to invert X axis
|
||||||
|
|
|
@ -139,7 +139,7 @@ namespace Nif
|
||||||
{
|
{
|
||||||
Controller::read(nif);
|
Controller::read(nif);
|
||||||
|
|
||||||
nif->getUShort(); // always 0
|
uvSet = nif->getUShort();
|
||||||
data.read(nif);
|
data.read(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,7 @@ class NiUVController : public Controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NiUVDataPtr data;
|
NiUVDataPtr data;
|
||||||
|
int uvSet;
|
||||||
|
|
||||||
void read(NIFStream *nif);
|
void read(NIFStream *nif);
|
||||||
void post(NIFFile *nif);
|
void post(NIFFile *nif);
|
||||||
|
|
|
@ -650,9 +650,14 @@ namespace NifOsg
|
||||||
if (ctrl->recType == Nif::RC_NiUVController)
|
if (ctrl->recType == Nif::RC_NiUVController)
|
||||||
{
|
{
|
||||||
const Nif::NiUVController *niuvctrl = static_cast<const Nif::NiUVController*>(ctrl.getPtr());
|
const Nif::NiUVController *niuvctrl = static_cast<const Nif::NiUVController*>(ctrl.getPtr());
|
||||||
|
const int uvSet = niuvctrl->uvSet;
|
||||||
std::set<int> texUnits;
|
std::set<int> texUnits;
|
||||||
|
// UVController should work only for textures which use a given UV Set, usually 0.
|
||||||
for (unsigned int i=0; i<boundTextures.size(); ++i)
|
for (unsigned int i=0; i<boundTextures.size(); ++i)
|
||||||
|
{
|
||||||
|
if (boundTextures[i] == uvSet)
|
||||||
texUnits.insert(i);
|
texUnits.insert(i);
|
||||||
|
}
|
||||||
|
|
||||||
osg::ref_ptr<UVController> uvctrl = new UVController(niuvctrl->data.getPtr(), texUnits);
|
osg::ref_ptr<UVController> uvctrl = new UVController(niuvctrl->data.getPtr(), texUnits);
|
||||||
setupController(niuvctrl, uvctrl, animflags);
|
setupController(niuvctrl, uvctrl, animflags);
|
||||||
|
|
Loading…
Reference in a new issue