mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Merge branch 'master' of https://github.com/OpenMW/openmw into removed_items
This commit is contained in:
commit
6ec8f9123e
@ -170,25 +170,25 @@ namespace MWGui
|
||||
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)
|
||||
{
|
||||
print("#FF00FF" + msg + "\n");
|
||||
print(msg + "\n", "#FF00FF");
|
||||
}
|
||||
|
||||
void Console::printError(const std::string &msg)
|
||||
{
|
||||
print("#FF2222" + msg + "\n");
|
||||
print(msg + "\n", "#FF2222");
|
||||
}
|
||||
|
||||
void Console::execute (const std::string& command)
|
||||
{
|
||||
// Log the command
|
||||
print("#FFFFFF> " + command + "\n");
|
||||
print("> " + command + "\n");
|
||||
|
||||
Compiler::Locals locals;
|
||||
Compiler::Output output (locals);
|
||||
|
@ -48,9 +48,8 @@ namespace MWGui
|
||||
|
||||
void onResChange(int width, int height);
|
||||
|
||||
// Print a message to the console. Messages may contain color
|
||||
// code, eg. "#FFFFFF this is white".
|
||||
void print(const std::string &msg);
|
||||
// Print a message to the console, in specified color.
|
||||
void print(const std::string &msg, const std::string& color = "#FFFFFF");
|
||||
|
||||
// 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
|
||||
// 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
|
||||
{
|
||||
public:
|
||||
@ -160,24 +161,34 @@ namespace
|
||||
struct UpdateMorphGeometry : public osg::Drawable::CullCallback
|
||||
{
|
||||
UpdateMorphGeometry()
|
||||
: mLastFrameNumber(0)
|
||||
{
|
||||
}
|
||||
|
||||
UpdateMorphGeometry(const UpdateMorphGeometry& copy, const osg::CopyOp& copyop)
|
||||
: osg::Drawable::CullCallback(copy, copyop)
|
||||
, mLastFrameNumber(0)
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
if (!geom)
|
||||
return false;
|
||||
|
||||
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
|
||||
return false;
|
||||
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
|
||||
|
||||
geom->transformSoftwareMethod();
|
||||
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
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
|
||||
RigGeometry::RigGeometry()
|
||||
: mSkeleton(NULL)
|
||||
, mFirstFrame(true)
|
||||
, mLastFrameNumber(0)
|
||||
, mBoundsFirstFrame(true)
|
||||
{
|
||||
setCullCallback(new UpdateRigGeometry);
|
||||
@ -72,7 +72,7 @@ RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op)
|
||||
: osg::Geometry(copy, copyop)
|
||||
, mSkeleton(NULL)
|
||||
, mInfluenceMap(copy.mInfluenceMap)
|
||||
, mFirstFrame(copy.mFirstFrame)
|
||||
, mLastFrameNumber(0)
|
||||
, mBoundsFirstFrame(copy.mBoundsFirstFrame)
|
||||
{
|
||||
setSourceGeometry(copy.mSourceGeometry);
|
||||
@ -206,9 +206,12 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mSkeleton->getActive() && !mFirstFrame)
|
||||
if (!mSkeleton->getActive() && mLastFrameNumber != 0)
|
||||
return;
|
||||
mFirstFrame = false;
|
||||
|
||||
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
|
||||
return;
|
||||
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
|
||||
|
||||
mSkeleton->updateBoneMatrices(nv);
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace SceneUtil
|
||||
|
||||
BoneSphereMap mBoneSphereMap;
|
||||
|
||||
bool mFirstFrame;
|
||||
unsigned int mLastFrameNumber;
|
||||
bool mBoundsFirstFrame;
|
||||
|
||||
bool initFromParentSkeleton(osg::NodeVisitor* nv);
|
||||
|
@ -13,6 +13,8 @@
|
||||
</Widget>
|
||||
<Widget type="MWScrollBar" skin="MW_HScroll" position="7 61 578 18" align="Left Top HStretch" name="CountSlider">
|
||||
<Property key="MoveToClick" value="true"/>
|
||||
<Property key="Page" value="1"/>
|
||||
<Property key="WheelPage" value="1"/>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="0 88 585 24" align="Right Bottom">
|
||||
<Widget type="Widget" skin="" position="0 12 0 0">
|
||||
|
Loading…
x
Reference in New Issue
Block a user