forked from teamnwah/openmw-tes3coop
Issue #225: Initialize all class members in constructor.
This commit is contained in:
parent
d3b88b9e34
commit
5185a28b60
6 changed files with 123 additions and 22 deletions
|
@ -15,6 +15,22 @@ using namespace MWGui;
|
||||||
|
|
||||||
HUD::HUD(int width, int height, int fpsLevel)
|
HUD::HUD(int width, int height, int fpsLevel)
|
||||||
: Layout("openmw_hud_layout.xml")
|
: Layout("openmw_hud_layout.xml")
|
||||||
|
, health(NULL)
|
||||||
|
, magicka(NULL)
|
||||||
|
, stamina(NULL)
|
||||||
|
, weapImage(NULL)
|
||||||
|
, spellImage(NULL)
|
||||||
|
, weapStatus(NULL)
|
||||||
|
, spellStatus(NULL)
|
||||||
|
, effectBox(NULL)
|
||||||
|
, effect1(NULL)
|
||||||
|
, minimap(NULL)
|
||||||
|
, compass(NULL)
|
||||||
|
, crosshair(NULL)
|
||||||
|
, fpsbox(NULL)
|
||||||
|
, fpscounter(NULL)
|
||||||
|
, trianglecounter(NULL)
|
||||||
|
, batchcounter(NULL)
|
||||||
{
|
{
|
||||||
setCoord(0,0, width, height);
|
setCoord(0,0, width, height);
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,22 @@ const int StatsWindow::lineHeight = 18;
|
||||||
|
|
||||||
StatsWindow::StatsWindow (WindowManager& parWindowManager)
|
StatsWindow::StatsWindow (WindowManager& parWindowManager)
|
||||||
: WindowBase("openmw_stats_window_layout.xml", parWindowManager)
|
: WindowBase("openmw_stats_window_layout.xml", parWindowManager)
|
||||||
|
, skillAreaWidget(NULL)
|
||||||
|
, skillClientWidget(NULL)
|
||||||
|
, skillScrollerWidget(NULL)
|
||||||
, lastPos(0)
|
, lastPos(0)
|
||||||
|
, clientHeight(0)
|
||||||
|
, majorSkills()
|
||||||
|
, minorSkills()
|
||||||
|
, miscSkills()
|
||||||
|
, skillValues()
|
||||||
|
, skillWidgetMap()
|
||||||
|
, factionWidgetMap()
|
||||||
|
, factions()
|
||||||
|
, birthSignId()
|
||||||
, reputation(0)
|
, reputation(0)
|
||||||
, bounty(0)
|
, bounty(0)
|
||||||
|
, skillWidgets()
|
||||||
{
|
{
|
||||||
setCoord(0,0,498, 342);
|
setCoord(0,0,498, 342);
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,40 @@ using namespace MWGui;
|
||||||
|
|
||||||
WindowManager::WindowManager(MWWorld::Environment& environment,
|
WindowManager::WindowManager(MWWorld::Environment& environment,
|
||||||
const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath)
|
const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath)
|
||||||
: environment(environment)
|
: mGuiManager(NULL)
|
||||||
|
, environment(environment)
|
||||||
|
, hud(NULL)
|
||||||
|
, map(NULL)
|
||||||
|
, menu(NULL)
|
||||||
|
, stats(NULL)
|
||||||
|
, mMessageBoxManager(NULL)
|
||||||
|
, console(NULL)
|
||||||
|
, mJournal(NULL)
|
||||||
, dialogueWindow(nullptr)
|
, dialogueWindow(nullptr)
|
||||||
|
, mCharGen(NULL)
|
||||||
|
, playerClass()
|
||||||
|
, playerName()
|
||||||
|
, playerRaceId()
|
||||||
|
, playerBirthSignId()
|
||||||
|
, playerAttributes()
|
||||||
|
, playerMajorSkills()
|
||||||
|
, playerMinorSkills()
|
||||||
|
, playerSkillValues()
|
||||||
|
, playerHealth()
|
||||||
|
, playerMagicka()
|
||||||
|
, playerFatigue()
|
||||||
|
, gui(NULL)
|
||||||
, mode(GM_Game)
|
, mode(GM_Game)
|
||||||
, nextMode(GM_Game)
|
, nextMode(GM_Game)
|
||||||
, needModeChange(false)
|
, needModeChange(false)
|
||||||
|
, garbageDialogs()
|
||||||
, shown(GW_ALL)
|
, shown(GW_ALL)
|
||||||
, allowed(newGame ? GW_None : GW_ALL)
|
, allowed(newGame ? GW_None : GW_ALL)
|
||||||
|
, showFPSLevel(fpsLevel)
|
||||||
|
, mFPS(0.0f)
|
||||||
|
, mTriangleCount(0)
|
||||||
|
, mBatchCount(0)
|
||||||
{
|
{
|
||||||
showFPSLevel = fpsLevel;
|
|
||||||
|
|
||||||
// Set up the GUI system
|
// Set up the GUI system
|
||||||
mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath);
|
mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath);
|
||||||
|
|
|
@ -4,7 +4,30 @@
|
||||||
namespace MWRender{
|
namespace MWRender{
|
||||||
std::map<std::string, int> Animation::mUniqueIDs;
|
std::map<std::string, int> Animation::mUniqueIDs;
|
||||||
|
|
||||||
Animation::~Animation(){
|
Animation::Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend)
|
||||||
|
: insert(NULL)
|
||||||
|
, mRend(_rend)
|
||||||
|
, mEnvironment(_env)
|
||||||
|
, vecRotPos()
|
||||||
|
, shapeparts()
|
||||||
|
, time(0.0f)
|
||||||
|
, startTime(0.0f)
|
||||||
|
, stopTime(0.0f)
|
||||||
|
, animate(0)
|
||||||
|
, rindexI()
|
||||||
|
, tindexI()
|
||||||
|
, shapeNumber(0)
|
||||||
|
, shapeIndexI()
|
||||||
|
, shapes(NULL)
|
||||||
|
, entityparts()
|
||||||
|
, transformations(NULL)
|
||||||
|
, textmappings(NULL)
|
||||||
|
, base(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Animation::~Animation()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Animation::getUniqueID(std::string mesh){
|
std::string Animation::getUniqueID(std::string mesh){
|
||||||
|
|
|
@ -60,14 +60,14 @@ class Animation{
|
||||||
std::string getUniqueID(std::string mesh);
|
std::string getUniqueID(std::string mesh);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), animate(0){};
|
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
||||||
virtual void runAnimation(float timepassed) = 0;
|
virtual void runAnimation(float timepassed) = 0;
|
||||||
void startScript(std::string groupname, int mode, int loops);
|
void startScript(std::string groupname, int mode, int loops);
|
||||||
void stopScript();
|
void stopScript();
|
||||||
|
|
||||||
|
|
||||||
virtual ~Animation();
|
virtual ~Animation();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,27 +44,51 @@ namespace Render
|
||||||
Ogre::SceneManager *mScene;
|
Ogre::SceneManager *mScene;
|
||||||
Ogre::Camera *mCamera;
|
Ogre::Camera *mCamera;
|
||||||
Ogre::Viewport *mView;
|
Ogre::Viewport *mView;
|
||||||
#ifdef ENABLE_PLUGIN_CgProgramManager
|
#ifdef ENABLE_PLUGIN_CgProgramManager
|
||||||
Ogre::CgPlugin* mCgPlugin;
|
Ogre::CgPlugin* mCgPlugin;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_PLUGIN_OctreeSceneManager
|
#ifdef ENABLE_PLUGIN_OctreeSceneManager
|
||||||
Ogre::OctreePlugin* mOctreePlugin;
|
Ogre::OctreePlugin* mOctreePlugin;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_PLUGIN_ParticleFX
|
#ifdef ENABLE_PLUGIN_ParticleFX
|
||||||
Ogre::ParticleFXPlugin* mParticleFXPlugin;
|
Ogre::ParticleFXPlugin* mParticleFXPlugin;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_PLUGIN_GL
|
#ifdef ENABLE_PLUGIN_GL
|
||||||
Ogre::GLPlugin* mGLPlugin;
|
Ogre::GLPlugin* mGLPlugin;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||||
Ogre::D3D9Plugin* mD3D9Plugin;
|
Ogre::D3D9Plugin* mD3D9Plugin;
|
||||||
#endif
|
#endif
|
||||||
Fader* mFader;
|
Fader* mFader;
|
||||||
bool logging;
|
bool logging;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OgreRenderer()
|
OgreRenderer()
|
||||||
: mRoot(NULL), mWindow(NULL), mScene(NULL), mFader(NULL) {}
|
: mRoot(NULL)
|
||||||
|
, mWindow(NULL)
|
||||||
|
, mScene(NULL)
|
||||||
|
, mCamera(NULL)
|
||||||
|
, mView(NULL)
|
||||||
|
#ifdef ENABLE_PLUGIN_CgProgramManager
|
||||||
|
, mCgPlugin(NULL)
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_PLUGIN_OctreeSceneManager
|
||||||
|
, mOctreePlugin(NULL)
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_PLUGIN_ParticleFX
|
||||||
|
, mParticleFXPlugin(NULL)
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_PLUGIN_GL
|
||||||
|
, mGLPlugin(NULL)
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||||
|
, mD3D9Plugin(NULL)
|
||||||
|
#endif
|
||||||
|
, mFader(NULL)
|
||||||
|
, logging(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
~OgreRenderer() { cleanup(); }
|
~OgreRenderer() { cleanup(); }
|
||||||
|
|
||||||
/** Configure the renderer. This will load configuration files and
|
/** Configure the renderer. This will load configuration files and
|
||||||
|
|
Loading…
Reference in a new issue