fix the race selection escape crash

actorid
scrawl 12 years ago
parent 1cb1259e18
commit e2b1329620

@ -33,11 +33,6 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
getWidget(mPreviewImage, "PreviewImage");
MWBase::Environment::get().getWorld ()->setupExternalRendering (mPreview);
mPreview.update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
getWidget(mHeadRotate, "HeadRotate");
mHeadRotate->setScrollRange(50);
mHeadRotate->setScrollPosition(25);
@ -107,6 +102,12 @@ void RaceDialog::open()
updateRaces();
updateSkills();
updateSpellPowers();
mPreview = new MWRender::RaceSelectionPreview();
MWBase::Environment::get().getWorld ()->setupExternalRendering (*mPreview);
mPreview->update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
}
@ -138,6 +139,12 @@ int wrap(int index, int max)
return index;
}
void RaceDialog::close()
{
delete mPreview;
mPreview = 0;
}
// widget controls
void RaceDialog::onOkClicked(MyGUI::Widget* _sender)
@ -154,7 +161,7 @@ void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position)
{
float angle = (float(_position) / 49.f - 0.5) * 3.14 * 2;
float diff = angle - mCurrentAngle;
mPreview.update (diff);
mPreview->update (diff);
mCurrentAngle += diff;
}

@ -46,6 +46,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
virtual void open();
virtual void close();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
@ -94,7 +95,7 @@ namespace MWGui
float mCurrentAngle;
MWRender::RaceSelectionPreview mPreview;
MWRender::RaceSelectionPreview* mPreview;
};
}
#endif

@ -25,6 +25,7 @@ namespace MWRender
, mPosition(position)
, mLookAt(lookAt)
, mCharacter(character)
, mAnimation(NULL)
{
}

Loading…
Cancel
Save