Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SupSuper committed Jul 23, 2019
1 parent 671180c commit 84786c4
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Basescape/CraftInfoState.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Basescape/MiniBaseView.cpp
Expand Up @@ -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)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Basescape/SoldierInfoState.cpp
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Battlescape/Map.cpp
Expand Up @@ -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;
Expand Down
12 changes: 5 additions & 7 deletions src/Battlescape/MiniMapView.cpp
Expand Up @@ -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");
}
Expand Down Expand Up @@ -77,22 +77,20 @@ 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++;
continue;
}
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;
Expand Down
2 changes: 1 addition & 1 deletion src/Battlescape/PsiAttackBState.cpp
Expand Up @@ -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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Engine/OpenGL.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Engine/Surface.cpp
Expand Up @@ -201,6 +201,7 @@ Surface::Surface(const Surface& other)
_visible = other._visible;
_hidden = other._hidden;
_redraw = other._redraw;
_tftdMode = other._tftdMode;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Engine/SurfaceSet.cpp
Expand Up @@ -43,6 +43,7 @@ SurfaceSet::SurfaceSet(const SurfaceSet& other)
{
_width = other._width;
_height = other._height;
_sharedFrames = other._sharedFrames;

for (std::map<int, Surface*>::const_iterator f = other._frames.begin(); f != other._frames.end(); ++f)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Menu/OptionsBaseState.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 84786c4

Please sign in to comment.