mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 14:15:36 +00:00
Fix chargen race menu bug, updating a render target from within MyGUI's ControllerManager update is not a good idea
This commit is contained in:
parent
58fce74620
commit
72600a16cf
7 changed files with 30 additions and 0 deletions
|
@ -238,6 +238,12 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
void CharacterCreation::doRenderUpdate()
|
||||
{
|
||||
if (mRaceDialog)
|
||||
mRaceDialog->doRenderUpdate();
|
||||
}
|
||||
|
||||
void CharacterCreation::setPlayerHealth (const MWMechanics::DynamicStat<float>& value)
|
||||
{
|
||||
mPlayerHealth = value;
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace MWGui
|
|||
void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value);
|
||||
void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value);
|
||||
void configureSkills (const SkillList& major, const SkillList& minor);
|
||||
void doRenderUpdate();
|
||||
|
||||
private:
|
||||
//Dialogs
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace MWGui
|
|||
, mFaceIndex(0)
|
||||
, mHairIndex(0)
|
||||
, mCurrentAngle(0)
|
||||
, mPreviewDirty(true)
|
||||
{
|
||||
// Centre dialog
|
||||
center();
|
||||
|
@ -126,6 +127,8 @@ namespace MWGui
|
|||
mHairIndex = boost::lexical_cast<int>(index) - 1;
|
||||
|
||||
mPreviewImage->setImageTexture ("CharacterHeadPreview");
|
||||
|
||||
mPreviewDirty = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,6 +177,7 @@ namespace MWGui
|
|||
float angle = (float(_position) / 49.f - 0.5) * 3.14 * 2;
|
||||
float diff = angle - mCurrentAngle;
|
||||
mPreview->update (diff);
|
||||
mPreviewDirty = true;
|
||||
mCurrentAngle += diff;
|
||||
}
|
||||
|
||||
|
@ -286,6 +290,16 @@ namespace MWGui
|
|||
record.mHair = mAvailableHairs[mHairIndex];
|
||||
|
||||
mPreview->setPrototype(record);
|
||||
mPreviewDirty = true;
|
||||
}
|
||||
|
||||
void RaceDialog::doRenderUpdate()
|
||||
{
|
||||
if (mPreviewDirty)
|
||||
{
|
||||
mPreview->render();
|
||||
mPreviewDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
void RaceDialog::updateRaces()
|
||||
|
|
|
@ -52,6 +52,8 @@ namespace MWGui
|
|||
*/
|
||||
EventHandle_Void eventBack;
|
||||
|
||||
void doRenderUpdate();
|
||||
|
||||
protected:
|
||||
void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
|
||||
|
||||
|
@ -98,6 +100,8 @@ namespace MWGui
|
|||
float mCurrentAngle;
|
||||
|
||||
MWRender::RaceSelectionPreview* mPreview;
|
||||
|
||||
bool mPreviewDirty;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1292,6 +1292,7 @@ namespace MWGui
|
|||
void WindowManager::frameStarted (float dt)
|
||||
{
|
||||
mInventoryWindow->doRenderUpdate ();
|
||||
mCharGen->doRenderUpdate();
|
||||
}
|
||||
|
||||
void WindowManager::updatePlayer()
|
||||
|
|
|
@ -230,7 +230,10 @@ namespace MWRender
|
|||
mNode->roll(Ogre::Radian(angle), Ogre::SceneNode::TS_LOCAL);
|
||||
|
||||
updateCamera();
|
||||
}
|
||||
|
||||
void RaceSelectionPreview::render()
|
||||
{
|
||||
mRenderTarget->update();
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace MWRender
|
|||
RaceSelectionPreview();
|
||||
|
||||
virtual void onSetup();
|
||||
void render();
|
||||
|
||||
void update(float angle);
|
||||
|
||||
|
|
Loading…
Reference in a new issue