Skip to content
Permalink
Browse files

Fix warnings

  • Loading branch information...
SupSuper committed Jul 23, 2019
1 parent 671180c commit 84786c4eab6d01de01a2dfcb94178c0d82cc70a4
@@ -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)
@@ -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)
{
}

@@ -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)
{
@@ -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;
@@ -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,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;
@@ -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)
{
}

@@ -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
@@ -201,6 +201,7 @@ Surface::Surface(const Surface& other)
_visible = other._visible;
_hidden = other._hidden;
_redraw = other._redraw;
_tftdMode = other._tftdMode;
}

/**
@@ -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)
{
@@ -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);

0 comments on commit 84786c4

Please sign in to comment.
You can’t perform that action at this time.