mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 10:45:31 +00:00
Merge branch 'master' of https://github.com/OpenMW/openmw into removed_items
This commit is contained in:
commit
6ec8f9123e
6 changed files with 29 additions and 14 deletions
|
@ -170,25 +170,25 @@ namespace MWGui
|
||||||
mCommandLine->setFontName(fntName);
|
mCommandLine->setFontName(fntName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::print(const std::string &msg)
|
void Console::print(const std::string &msg, const std::string& color)
|
||||||
{
|
{
|
||||||
mHistory->addText(msg);
|
mHistory->addText(color + MyGUI::TextIterator::toTagsString(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::printOK(const std::string &msg)
|
void Console::printOK(const std::string &msg)
|
||||||
{
|
{
|
||||||
print("#FF00FF" + msg + "\n");
|
print(msg + "\n", "#FF00FF");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::printError(const std::string &msg)
|
void Console::printError(const std::string &msg)
|
||||||
{
|
{
|
||||||
print("#FF2222" + msg + "\n");
|
print(msg + "\n", "#FF2222");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::execute (const std::string& command)
|
void Console::execute (const std::string& command)
|
||||||
{
|
{
|
||||||
// Log the command
|
// Log the command
|
||||||
print("#FFFFFF> " + command + "\n");
|
print("> " + command + "\n");
|
||||||
|
|
||||||
Compiler::Locals locals;
|
Compiler::Locals locals;
|
||||||
Compiler::Output output (locals);
|
Compiler::Output output (locals);
|
||||||
|
|
|
@ -48,9 +48,8 @@ namespace MWGui
|
||||||
|
|
||||||
void onResChange(int width, int height);
|
void onResChange(int width, int height);
|
||||||
|
|
||||||
// Print a message to the console. Messages may contain color
|
// Print a message to the console, in specified color.
|
||||||
// code, eg. "#FFFFFF this is white".
|
void print(const std::string &msg, const std::string& color = "#FFFFFF");
|
||||||
void print(const std::string &msg);
|
|
||||||
|
|
||||||
// These are pre-colored versions that you should use.
|
// These are pre-colored versions that you should use.
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ namespace
|
||||||
|
|
||||||
// NodeCallback used to have a transform always oriented towards the camera. Can have translation and scale
|
// NodeCallback used to have a transform always oriented towards the camera. Can have translation and scale
|
||||||
// set just like a regular MatrixTransform, but the rotation set will be overridden in order to face the camera.
|
// set just like a regular MatrixTransform, but the rotation set will be overridden in order to face the camera.
|
||||||
|
// Must be set as a cull callback.
|
||||||
class BillboardCallback : public osg::NodeCallback
|
class BillboardCallback : public osg::NodeCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -160,24 +161,34 @@ namespace
|
||||||
struct UpdateMorphGeometry : public osg::Drawable::CullCallback
|
struct UpdateMorphGeometry : public osg::Drawable::CullCallback
|
||||||
{
|
{
|
||||||
UpdateMorphGeometry()
|
UpdateMorphGeometry()
|
||||||
|
: mLastFrameNumber(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateMorphGeometry(const UpdateMorphGeometry& copy, const osg::CopyOp& copyop)
|
UpdateMorphGeometry(const UpdateMorphGeometry& copy, const osg::CopyOp& copyop)
|
||||||
: osg::Drawable::CullCallback(copy, copyop)
|
: osg::Drawable::CullCallback(copy, copyop)
|
||||||
|
, mLastFrameNumber(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
META_Object(NifOsg, UpdateMorphGeometry)
|
META_Object(NifOsg, UpdateMorphGeometry)
|
||||||
|
|
||||||
virtual bool cull(osg::NodeVisitor *, osg::Drawable * drw, osg::State *) const
|
virtual bool cull(osg::NodeVisitor* nv, osg::Drawable * drw, osg::State *) const
|
||||||
{
|
{
|
||||||
osgAnimation::MorphGeometry* geom = static_cast<osgAnimation::MorphGeometry*>(drw);
|
osgAnimation::MorphGeometry* geom = static_cast<osgAnimation::MorphGeometry*>(drw);
|
||||||
if (!geom)
|
if (!geom)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
|
||||||
|
return false;
|
||||||
|
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
geom->transformSoftwareMethod();
|
geom->transformSoftwareMethod();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutable unsigned int mLastFrameNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Callback to return a static bounding box for a MorphGeometry. The idea is to not recalculate the bounding box
|
// Callback to return a static bounding box for a MorphGeometry. The idea is to not recalculate the bounding box
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
RigGeometry::RigGeometry()
|
RigGeometry::RigGeometry()
|
||||||
: mSkeleton(NULL)
|
: mSkeleton(NULL)
|
||||||
, mFirstFrame(true)
|
, mLastFrameNumber(0)
|
||||||
, mBoundsFirstFrame(true)
|
, mBoundsFirstFrame(true)
|
||||||
{
|
{
|
||||||
setCullCallback(new UpdateRigGeometry);
|
setCullCallback(new UpdateRigGeometry);
|
||||||
|
@ -72,7 +72,7 @@ RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op)
|
||||||
: osg::Geometry(copy, copyop)
|
: osg::Geometry(copy, copyop)
|
||||||
, mSkeleton(NULL)
|
, mSkeleton(NULL)
|
||||||
, mInfluenceMap(copy.mInfluenceMap)
|
, mInfluenceMap(copy.mInfluenceMap)
|
||||||
, mFirstFrame(copy.mFirstFrame)
|
, mLastFrameNumber(0)
|
||||||
, mBoundsFirstFrame(copy.mBoundsFirstFrame)
|
, mBoundsFirstFrame(copy.mBoundsFirstFrame)
|
||||||
{
|
{
|
||||||
setSourceGeometry(copy.mSourceGeometry);
|
setSourceGeometry(copy.mSourceGeometry);
|
||||||
|
@ -206,9 +206,12 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mSkeleton->getActive() && !mFirstFrame)
|
if (!mSkeleton->getActive() && mLastFrameNumber != 0)
|
||||||
return;
|
return;
|
||||||
mFirstFrame = false;
|
|
||||||
|
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
|
||||||
|
return;
|
||||||
|
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
mSkeleton->updateBoneMatrices(nv);
|
mSkeleton->updateBoneMatrices(nv);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace SceneUtil
|
||||||
|
|
||||||
BoneSphereMap mBoneSphereMap;
|
BoneSphereMap mBoneSphereMap;
|
||||||
|
|
||||||
bool mFirstFrame;
|
unsigned int mLastFrameNumber;
|
||||||
bool mBoundsFirstFrame;
|
bool mBoundsFirstFrame;
|
||||||
|
|
||||||
bool initFromParentSkeleton(osg::NodeVisitor* nv);
|
bool initFromParentSkeleton(osg::NodeVisitor* nv);
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="MWScrollBar" skin="MW_HScroll" position="7 61 578 18" align="Left Top HStretch" name="CountSlider">
|
<Widget type="MWScrollBar" skin="MW_HScroll" position="7 61 578 18" align="Left Top HStretch" name="CountSlider">
|
||||||
<Property key="MoveToClick" value="true"/>
|
<Property key="MoveToClick" value="true"/>
|
||||||
|
<Property key="Page" value="1"/>
|
||||||
|
<Property key="WheelPage" value="1"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="HBox" skin="" position="0 88 585 24" align="Right Bottom">
|
<Widget type="HBox" skin="" position="0 88 585 24" align="Right Bottom">
|
||||||
<Widget type="Widget" skin="" position="0 12 0 0">
|
<Widget type="Widget" skin="" position="0 12 0 0">
|
||||||
|
|
Loading…
Reference in a new issue