diff --git a/src/Basescape/CraftInfoState.cpp b/src/Basescape/CraftInfoState.cpp index 5780321353..d49baf6e2b 100644 --- a/src/Basescape/CraftInfoState.cpp +++ b/src/Basescape/CraftInfoState.cpp @@ -50,7 +50,7 @@ namespace OpenXcom * @param base Pointer to the base to get info from. * @param craftId ID of the selected craft. */ -CraftInfoState::CraftInfoState(Base *base, size_t craftId) : _base(base), _craftId(craftId) +CraftInfoState::CraftInfoState(Base *base, size_t craftId) : _base(base), _craftId(craftId), _craft(0) { // Create objects if (_game->getSavedGame()->getMonthsPassed() != -1) diff --git a/src/Basescape/MiniBaseView.cpp b/src/Basescape/MiniBaseView.cpp index 0b0c9d8676..d107a2c85e 100644 --- a/src/Basescape/MiniBaseView.cpp +++ b/src/Basescape/MiniBaseView.cpp @@ -34,7 +34,7 @@ namespace OpenXcom * @param x X position in pixels. * @param y Y position in pixels. */ -MiniBaseView::MiniBaseView(int width, int height, int x, int y) : InteractiveSurface(width, height, x, y), _texture(0), _base(0), _hoverBase(0) +MiniBaseView::MiniBaseView(int width, int height, int x, int y) : InteractiveSurface(width, height, x, y), _bases(0), _texture(0), _base(0), _hoverBase(0), _red(0), _green(0) { } diff --git a/src/Basescape/SoldierInfoState.cpp b/src/Basescape/SoldierInfoState.cpp index 7195571f28..981e481b1c 100644 --- a/src/Basescape/SoldierInfoState.cpp +++ b/src/Basescape/SoldierInfoState.cpp @@ -53,7 +53,7 @@ namespace OpenXcom * @param base Pointer to the base to get info from. NULL to use the dead soldiers list. * @param soldierId ID of the selected soldier. */ -SoldierInfoState::SoldierInfoState(Base *base, size_t soldierId) : _base(base), _soldierId(soldierId) +SoldierInfoState::SoldierInfoState(Base *base, size_t soldierId) : _base(base), _soldierId(soldierId), _soldier(0) { if (_base == 0) { diff --git a/src/Battlescape/Map.cpp b/src/Battlescape/Map.cpp index dfee4aa38c..efcdf942c4 100644 --- a/src/Battlescape/Map.cpp +++ b/src/Battlescape/Map.cpp @@ -74,7 +74,7 @@ namespace OpenXcom * @param y Y position in pixels. * @param visibleMapHeight Current visible map height. */ -Map::Map(Game *game, int width, int height, int x, int y, int visibleMapHeight) : InteractiveSurface(width, height, x, y), _game(game), _arrow(0), _selectorX(0), _selectorY(0), _mouseX(0), _mouseY(0), _cursorType(CT_NORMAL), _cursorSize(1), _animFrame(0), _projectile(0), _projectileInFOV(false), _explosionInFOV(false), _launch(false), _visibleMapHeight(visibleMapHeight), _unitDying(false), _smoothingEngaged(false), _flashScreen(false), _showObstacles(false) +Map::Map(Game *game, int width, int height, int x, int y, int visibleMapHeight) : InteractiveSurface(width, height, x, y), _game(game), _arrow(0), _selectorX(0), _selectorY(0), _mouseX(0), _mouseY(0), _cursorType(CT_NORMAL), _cursorSize(1), _animFrame(0), _projectile(0), _projectileInFOV(false), _explosionInFOV(false), _launch(false), _visibleMapHeight(visibleMapHeight), _unitDying(false), _smoothingEngaged(false), _flashScreen(false), _projectileSet(0), _showObstacles(false) { _iconHeight = _game->getMod()->getInterface("battlescape")->getElement("icons")->h; _iconWidth = _game->getMod()->getInterface("battlescape")->getElement("icons")->w; diff --git a/src/Battlescape/MiniMapView.cpp b/src/Battlescape/MiniMapView.cpp index 7e931dba2d..7323f39b85 100644 --- a/src/Battlescape/MiniMapView.cpp +++ b/src/Battlescape/MiniMapView.cpp @@ -49,7 +49,7 @@ const int MAX_FRAME = 2; * @param camera The Battlescape camera. * @param battleGame Pointer to the SavedBattleGame. */ -MiniMapView::MiniMapView(int w, int h, int x, int y, Game * game, Camera * camera, SavedBattleGame * battleGame) : InteractiveSurface(w, h, x, y), _game(game), _camera(camera), _battleGame(battleGame), _frame(0), _isMouseScrolling(false), _isMouseScrolled(false), _xBeforeMouseScrolling(0), _yBeforeMouseScrolling(0), _mouseScrollX(0), _mouseScrollY(0), _totalMouseMoveX(0), _totalMouseMoveY(0), _mouseMovedOverThreshold(false) +MiniMapView::MiniMapView(int w, int h, int x, int y, Game * game, Camera * camera, SavedBattleGame * battleGame) : InteractiveSurface(w, h, x, y), _game(game), _camera(camera), _battleGame(battleGame), _frame(0), _mouseScrollingStartTime(0), _isMouseScrolling(false), _isMouseScrolled(false), _xBeforeMouseScrolling(0), _yBeforeMouseScrolling(0), _mouseScrollX(0), _mouseScrollY(0), _totalMouseMoveX(0), _totalMouseMoveY(0), _mouseMovedOverThreshold(false) { _set = _game->getMod()->getSurfaceSet("SCANG.DAT"); } @@ -77,10 +77,8 @@ void MiniMapView::draw() int px = _startX; for (int x = Surface::getX(); x < getWidth() + Surface::getX(); x += CELL_WIDTH) { - MapData * data = 0; - Tile * t = 0; - Position p (px, py, lvl); - t = _battleGame->getTile(p); + Position p(px, py, lvl); + Tile *t = _battleGame->getTile(p); if (!t) { px++; @@ -88,11 +86,11 @@ void MiniMapView::draw() } for (int i = O_FLOOR; i <= O_OBJECT; i++) { - data = t->getMapData((TilePart)i); + MapData *data = t->getMapData((TilePart)i); if (data && data->getMiniMapIndex()) { - Surface * s = _set->getFrame (data->getMiniMapIndex()+35); + Surface *s = _set->getFrame(data->getMiniMapIndex() + 35); if (s) { int shade = 16; diff --git a/src/Battlescape/PsiAttackBState.cpp b/src/Battlescape/PsiAttackBState.cpp index 97fc101f4f..2d59d3bd4e 100644 --- a/src/Battlescape/PsiAttackBState.cpp +++ b/src/Battlescape/PsiAttackBState.cpp @@ -40,7 +40,7 @@ namespace OpenXcom /** * Sets up a PsiAttackBState. */ -PsiAttackBState::PsiAttackBState(BattlescapeGame *parent, BattleAction action) : BattleState(parent, action), _unit(0), _item(0), _initialized(false) +PsiAttackBState::PsiAttackBState(BattlescapeGame *parent, BattleAction action) : BattleState(parent, action), _unit(0), _target(0), _item(0), _initialized(false) { } diff --git a/src/Engine/OpenGL.cpp b/src/Engine/OpenGL.cpp index 5b060814af..3f3e7a5dea 100644 --- a/src/Engine/OpenGL.cpp +++ b/src/Engine/OpenGL.cpp @@ -253,7 +253,7 @@ bool OpenGL::set_shader(const char *source_yaml_filename) glprogram = 0; } - if (source_yaml_filename && strlen(source_yaml_filename)) + if (source_yaml_filename && source_yaml_filename[0] != '\0') { glprogram = glCreateProgram(); if (glprogram == 0) @@ -501,7 +501,7 @@ void OpenGL::term() delete buffer_surface; } - OpenGL::OpenGL() : gltexture(0), glprogram(0), linear(false), + OpenGL::OpenGL() : gltexture(0), glprogram(0), linear(false), shader_support(false), buffer(NULL), buffer_surface(NULL), iwidth(0), iheight(0), iformat(GL_UNSIGNED_INT_8_8_8_8_REV), // this didn't seem to be set anywhere before... ibpp(32) // ...nor this diff --git a/src/Engine/Surface.cpp b/src/Engine/Surface.cpp index 9aca0833e2..d32c57fda0 100644 --- a/src/Engine/Surface.cpp +++ b/src/Engine/Surface.cpp @@ -201,6 +201,7 @@ Surface::Surface(const Surface& other) _visible = other._visible; _hidden = other._hidden; _redraw = other._redraw; + _tftdMode = other._tftdMode; } /** diff --git a/src/Engine/SurfaceSet.cpp b/src/Engine/SurfaceSet.cpp index b2e1de1b28..6f0cff8e15 100644 --- a/src/Engine/SurfaceSet.cpp +++ b/src/Engine/SurfaceSet.cpp @@ -43,6 +43,7 @@ SurfaceSet::SurfaceSet(const SurfaceSet& other) { _width = other._width; _height = other._height; + _sharedFrames = other._sharedFrames; for (std::map::const_iterator f = other._frames.begin(); f != other._frames.end(); ++f) { diff --git a/src/Menu/OptionsBaseState.cpp b/src/Menu/OptionsBaseState.cpp index b36a57c81e..e6ca4eba47 100644 --- a/src/Menu/OptionsBaseState.cpp +++ b/src/Menu/OptionsBaseState.cpp @@ -52,7 +52,7 @@ namespace OpenXcom * @param game Pointer to the core game. * @param origin Game section that originated this state. */ -OptionsBaseState::OptionsBaseState(OptionsOrigin origin) : _origin(origin) +OptionsBaseState::OptionsBaseState(OptionsOrigin origin) : _origin(origin), _group(0) { // Create objects _window = new Window(this, 320, 200, 0, 0);