mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 17:15:34 +00:00
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)
|
||||
: 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);
|
||||
|
||||
|
|
|
@ -13,9 +13,22 @@ const int StatsWindow::lineHeight = 18;
|
|||
|
||||
StatsWindow::StatsWindow (WindowManager& parWindowManager)
|
||||
: WindowBase("openmw_stats_window_layout.xml", parWindowManager)
|
||||
, skillAreaWidget(NULL)
|
||||
, skillClientWidget(NULL)
|
||||
, skillScrollerWidget(NULL)
|
||||
, lastPos(0)
|
||||
, clientHeight(0)
|
||||
, majorSkills()
|
||||
, minorSkills()
|
||||
, miscSkills()
|
||||
, skillValues()
|
||||
, skillWidgetMap()
|
||||
, factionWidgetMap()
|
||||
, factions()
|
||||
, birthSignId()
|
||||
, reputation(0)
|
||||
, bounty(0)
|
||||
, skillWidgets()
|
||||
{
|
||||
setCoord(0,0,498, 342);
|
||||
|
||||
|
|
|
@ -22,15 +22,40 @@ using namespace MWGui;
|
|||
|
||||
WindowManager::WindowManager(MWWorld::Environment& environment,
|
||||
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)
|
||||
, mCharGen(NULL)
|
||||
, playerClass()
|
||||
, playerName()
|
||||
, playerRaceId()
|
||||
, playerBirthSignId()
|
||||
, playerAttributes()
|
||||
, playerMajorSkills()
|
||||
, playerMinorSkills()
|
||||
, playerSkillValues()
|
||||
, playerHealth()
|
||||
, playerMagicka()
|
||||
, playerFatigue()
|
||||
, gui(NULL)
|
||||
, mode(GM_Game)
|
||||
, nextMode(GM_Game)
|
||||
, needModeChange(false)
|
||||
, garbageDialogs()
|
||||
, shown(GW_ALL)
|
||||
, allowed(newGame ? GW_None : GW_ALL)
|
||||
, showFPSLevel(fpsLevel)
|
||||
, mFPS(0.0f)
|
||||
, mTriangleCount(0)
|
||||
, mBatchCount(0)
|
||||
{
|
||||
showFPSLevel = fpsLevel;
|
||||
|
||||
// Set up the GUI system
|
||||
mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath);
|
||||
|
|
|
@ -4,7 +4,30 @@
|
|||
namespace MWRender{
|
||||
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){
|
||||
|
|
|
@ -60,14 +60,14 @@ class Animation{
|
|||
std::string getUniqueID(std::string mesh);
|
||||
|
||||
public:
|
||||
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), animate(0){};
|
||||
virtual void runAnimation(float timepassed) = 0;
|
||||
void startScript(std::string groupname, int mode, int loops);
|
||||
void stopScript();
|
||||
|
||||
|
||||
virtual ~Animation();
|
||||
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
||||
virtual void runAnimation(float timepassed) = 0;
|
||||
void startScript(std::string groupname, int mode, int loops);
|
||||
void stopScript();
|
||||
|
||||
|
||||
virtual ~Animation();
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -44,27 +44,51 @@ namespace Render
|
|||
Ogre::SceneManager *mScene;
|
||||
Ogre::Camera *mCamera;
|
||||
Ogre::Viewport *mView;
|
||||
#ifdef ENABLE_PLUGIN_CgProgramManager
|
||||
#ifdef ENABLE_PLUGIN_CgProgramManager
|
||||
Ogre::CgPlugin* mCgPlugin;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_OctreeSceneManager
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_OctreeSceneManager
|
||||
Ogre::OctreePlugin* mOctreePlugin;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_ParticleFX
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_ParticleFX
|
||||
Ogre::ParticleFXPlugin* mParticleFXPlugin;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_GL
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_GL
|
||||
Ogre::GLPlugin* mGLPlugin;
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
#endif
|
||||
#ifdef ENABLE_PLUGIN_Direct3D9
|
||||
Ogre::D3D9Plugin* mD3D9Plugin;
|
||||
#endif
|
||||
#endif
|
||||
Fader* mFader;
|
||||
bool logging;
|
||||
|
||||
public:
|
||||
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(); }
|
||||
|
||||
/** Configure the renderer. This will load configuration files and
|
||||
|
|
Loading…
Reference in a new issue