ENDIF(WERROR)
IF(WARNINGS)
# temporarily disabled:
- # -Wsign-conversion -Wfloat-equal -Wconversion -Wundef -Wshadow -Wswitch-default
+ # -Wsign-conversion -Wfloat-equal -Wconversion -Wundef -Wswitch-default
# -Wswitch-enum -Wsign-promo -Wcast-qual -Woverloaded-virtual -Wmissing-format-attribute
# -Wold-style-cast -Wpadded -Wabi -Winline -Wunsafe-loop-optimizations -Wstrict-overflow=5
# fails on MinGW:
# -ansi
- SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter")
+ SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter -Wshadow")
ENDIF(WARNINGS)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
static const float Y_OFFSCREEN_DISTANCE = 800;
static const int LAYER_FALLING = 500;
-BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name, int layer) :
- MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED),
+BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name_, int layer_) :
+ MovingSprite(pos, sprite_name_, layer_, COLGROUP_DISABLED),
physic(),
countMe(true),
is_initialized(false),
dir = (start_dir == AUTO) ? LEFT : start_dir;
}
-BadGuy::BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name, int layer) :
- MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED),
+BadGuy::BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name_, int layer_) :
+ MovingSprite(pos, sprite_name_, layer_, COLGROUP_DISABLED),
physic(),
countMe(true),
is_initialized(false),
dir = (start_dir == AUTO) ? LEFT : start_dir;
}
-BadGuy::BadGuy(const Reader& reader, const std::string& sprite_name, int layer) :
- MovingSprite(reader, sprite_name, layer, COLGROUP_DISABLED),
+BadGuy::BadGuy(const Reader& reader, const std::string& sprite_name_, int layer_) :
+ MovingSprite(reader, sprite_name_, layer_, COLGROUP_DISABLED),
physic(),
countMe(true),
is_initialized(false),
// if starting direction was set to AUTO, this is our chance to re-orient the badguy
if (start_dir == AUTO) {
- Player* player = get_nearest_player();
- if (player && (player->get_bbox().p1.x > get_bbox().p2.x)) {
+ Player* player_ = get_nearest_player();
+ if (player_ && (player_->get_bbox().p1.x > get_bbox().p2.x)) {
dir = RIGHT;
} else {
dir = LEFT;
}
void
-BadGuy::set_colgroup_active(CollisionGroup group)
+BadGuy::set_colgroup_active(CollisionGroup group_)
{
- this->colgroup_active = group;
- if (state == STATE_ACTIVE) set_group(group);
+ this->colgroup_active = group_;
+ if (state == STATE_ACTIVE) set_group(group_);
}
/* EOF */
sound_manager->preload("sounds/stomp.wav");
}
-Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0) :
+Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent_ = 0) :
BadGuy(pos, d, "images/creatures/dart/dart.sprite"),
- parent(parent),
+ parent(parent_),
sound_source()
{
physic.enable_gravity(false);
}
void
-GoldBomb::ungrab(MovingObject& object, Direction dir)
+GoldBomb::ungrab(MovingObject& object, Direction dir_)
{
int toss_velocity_x = 0;
int toss_velocity_y = 0;
Player* player = dynamic_cast<Player*> (&object);
// toss upwards
- if(dir == UP)
+ if(dir_ == UP)
toss_velocity_y += -500;
// toss to the side when moving sideways
- if(player && player->physic.get_velocity_x()*(dir == LEFT ? -1 : 1) > 1) {
- toss_velocity_x += (dir == LEFT) ? -200 : 200;
+ if(player && player->physic.get_velocity_x()*(dir_ == LEFT ? -1 : 1) > 1) {
+ toss_velocity_x += (dir_ == LEFT) ? -200 : 200;
toss_velocity_y = (toss_velocity_y < -200) ? toss_velocity_y : -200;
// toss farther when running
- if(player && player->physic.get_velocity_x()*(dir == LEFT ? -1 : 1) > 200)
- toss_velocity_x += player->physic.get_velocity_x()-(190*(dir == LEFT ? -1 : 1));
+ if(player && player->physic.get_velocity_x()*(dir_ == LEFT ? -1 : 1) > 200)
+ toss_velocity_x += player->physic.get_velocity_x()-(190*(dir_ == LEFT ? -1 : 1));
}
log_warning << toss_velocity_x << toss_velocity_y << std::endl;////
- //set_pos(object.get_pos() + Vector((dir == LEFT ? -33 : 33), get_bbox().get_height()*0.66666 - 32));
+ //set_pos(object.get_pos() + Vector((dir_ == LEFT ? -33 : 33), get_bbox().get_height()*0.66666 - 32));
physic.set_velocity(toss_velocity_x, toss_velocity_y);
set_colgroup_active(COLGROUP_MOVING);
grabbed = false;
}
void
-MrIceBlock::set_state(IceState state, bool up)
+MrIceBlock::set_state(IceState state_, bool up)
{
- if(ice_state == state)
+ if(ice_state == state_)
return;
- switch(state) {
+ switch(state_) {
case ICESTATE_NORMAL:
this->set_action(dir == LEFT ? "left" : "right", /* loops = */ -1);
WalkingBadguy::initialize();
default:
assert(false);
}
- ice_state = state;
+ ice_state = state_;
}
void
-MrIceBlock::grab(MovingObject&, const Vector& pos, Direction dir)
+MrIceBlock::grab(MovingObject&, const Vector& pos, Direction dir_)
{
movement = pos - get_pos();
- this->dir = dir;
- this->set_action(dir == LEFT ? "flat-left" : "flat-right", /* loops = */ -1);
+ this->dir = dir_;
+ this->set_action(dir_ == LEFT ? "flat-left" : "flat-right", /* loops = */ -1);
set_state(ICESTATE_GRABBED);
set_colgroup_active(COLGROUP_DISABLED);
}
void
-MrIceBlock::ungrab(MovingObject& , Direction dir)
+MrIceBlock::ungrab(MovingObject& , Direction dir_)
{
- if(dir == UP) {
+ if(dir_ == UP) {
set_state(ICESTATE_FLAT, true);
} else {
- this->dir = dir;
+ this->dir = dir_;
set_state(ICESTATE_KICKED);
}
set_colgroup_active(COLGROUP_MOVING);
}
void
-Menu::event(const SDL_Event& event)
+Menu::event(const SDL_Event& ev)
{
- switch(event.type) {
+ switch(ev.type) {
case SDL_MOUSEBUTTONDOWN:
- if(event.button.button == SDL_BUTTON_LEFT)
+ if(ev.button.button == SDL_BUTTON_LEFT)
{
- Vector mouse_pos = Renderer::instance()->to_logical(event.motion.x, event.motion.y);
+ Vector mouse_pos = Renderer::instance()->to_logical(ev.motion.x, ev.motion.y);
int x = int(mouse_pos.x);
int y = int(mouse_pos.y);
case SDL_MOUSEMOTION:
{
- Vector mouse_pos = Renderer::instance()->to_logical(event.motion.x, event.motion.y);
+ Vector mouse_pos = Renderer::instance()->to_logical(ev.motion.x, ev.motion.y);
float x = mouse_pos.x;
float y = mouse_pos.y;
}
void
-MenuManager::event(const SDL_Event& event)
+MenuManager::event(const SDL_Event& event_)
{
if (current() && !m_transition->is_active())
{
// only pass events when the menu is fully visible and not in a
// transition animation
- current()->event(event);
+ current()->event(event_);
}
}
}
const Lisp*
-Parser::parse(const std::string& filename)
+Parser::parse(const std::string& filename_)
{
- IFileStreambuf ins(filename);
+ IFileStreambuf ins(filename_);
std::istream in(&ins);
if(!in.good()) {
std::stringstream msg;
- msg << "Parser problem: Couldn't open file '" << filename << "'.";
+ msg << "Parser problem: Couldn't open file '" << filename_ << "'.";
throw std::runtime_error(msg.str());
}
if(dictionary_manager) {
- std::string rel_dir = dirname (filename);
+ std::string rel_dir = dirname (filename_);
for(char** i = searchpath; *i != NULL; i++)
{
std::string abs_dir = std::string (*i) + PHYSFS_getDirSeparator () + rel_dir;
dictionary = & (dictionary_manager->get_dictionary());
}
- return parse(in, filename);
+ return parse(in, filename_);
}
const Lisp*
}
HitResponse
-Brick::collision(GameObject& other, const CollisionHit& hit){
+Brick::collision(GameObject& other, const CollisionHit& hit_){
Player* player = dynamic_cast<Player*> (&other);
if (player) {
if(explosion && explosion->hurts()) {
try_break(player);
}
- return Block::collision(other, hit);
+ return Block::collision(other, hit_);
}
void
}
HitResponse
-InvisibleBlock::collision(GameObject& other, const CollisionHit& hit)
+InvisibleBlock::collision(GameObject& other, const CollisionHit& hit_)
{
- return Block::collision(other, hit);
+ return Block::collision(other, hit_);
}
void
#include "sprite/sprite.hpp"
#include "sprite/sprite_manager.hpp"
-Light::Light(const Vector& center, const Color& color) :
+Light::Light(const Vector& center, const Color& color_) :
position(center),
- color(color),
+ color(color_),
sprite()
{
sprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite");
#include "supertux/globals.hpp"
#include "video/drawing_context.hpp"
-ParticleSystem::ParticleSystem(float max_particle_size) :
- max_particle_size(max_particle_size),
+ParticleSystem::ParticleSystem(float max_particle_size_) :
+ max_particle_size(max_particle_size_),
z_pos(),
particles(),
virtual_width(),
#include <math.h>
#include <assert.h>
-PathWalker::PathWalker(const Path* path, bool running) :
+PathWalker::PathWalker(const Path* path, bool running_) :
path(path),
- running(running),
+ running(running_),
current_node_nr(0),
next_node_nr(0),
stop_at_node_nr(running?-1:0),
#include "math/random_generator.hpp"
-PulsingLight::PulsingLight(const Vector& center, float cycle_len, float min_alpha, float max_alpha, const Color& color) :
- Light(center, color),
- min_alpha(min_alpha),
- max_alpha(max_alpha),
- cycle_len(cycle_len),
+PulsingLight::PulsingLight(const Vector& center, float cycle_len_, float min_alpha_, float max_alpha_, const Color& color_) :
+ Light(center, color_),
+ min_alpha(min_alpha_),
+ max_alpha(max_alpha_),
+ cycle_len(cycle_len_),
t(0)
{
assert(cycle_len > 0);
}
void
-ScriptedObject::set_visible(bool visible)
+ScriptedObject::set_visible(bool visible_)
{
- this->visible = visible;
+ this->visible = visible_;
}
bool
}
void
-ScriptedObject::set_solid(bool solid)
+ScriptedObject::set_solid(bool solid_)
{
- this->solid = solid;
+ this->solid = solid_;
if( solid ){
set_group( COLGROUP_MOVING_STATIC );
} else {
SpriteParticle::SpriteParticle(std::string sprite_name, std::string action,
Vector position, AnchorPoint anchor, Vector velocity, Vector acceleration,
- int drawing_layer) :
+ int drawing_layer_) :
sprite(),
position(position),
velocity(velocity),
acceleration(acceleration),
- drawing_layer(drawing_layer),
+ drawing_layer(drawing_layer_),
light(0.0f,0.0f,0.0f),
lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-tiny.sprite")),
glow(false)
boost::shared_ptr<PathWalker> get_walker()
{ return walker; }
- void set_offset(const Vector &offset)
- { this->offset = offset; }
+ void set_offset(const Vector &offset_)
+ { this->offset = offset_; }
/* Returns the position of the upper-left corner of
* tile (x, y) in the sector. */
}
Sector*
-Level::get_sector(const std::string& name)
+Level::get_sector(const std::string& name_)
{
for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) {
Sector* sector = *i;
- if(sector->get_name() == name)
+ if(sector->get_name() == name_)
return sector;
}
friend class CollisionGrid;
friend class Platform;
- void set_group(CollisionGroup group)
+ void set_group(CollisionGroup group_)
{
- this->group = group;
+ this->group = group_;
}
/** The bounding box of the object (as used for collision detection,
/// adds a gameobject
void add_object(GameObject* object);
- void set_name(const std::string& name)
- { this->name = name; }
+ void set_name(const std::string& name_)
+ { this->name = name_; }
const std::string& get_name() const
{ return name; }
#include "video/texture_manager.hpp"
#include "video/video_systems.hpp"
-DrawingContext::DrawingContext(Renderer& renderer, Lightmap& lightmap) :
- renderer(renderer),
- lightmap(lightmap),
+DrawingContext::DrawingContext(Renderer& renderer_, Lightmap& lightmap_) :
+ renderer(renderer_),
+ lightmap(lightmap_),
transformstack(),
transform(),
blend_stack(),
float uv_bottom;
public:
- GLSurfaceData(const Surface &surface) :
- surface(surface),
+ GLSurfaceData(const Surface& surface_) :
+ surface(surface_),
uv_left((float) surface.get_x() / surface.get_texture()->get_texture_width()),
uv_top((float) surface.get_y() / surface.get_texture()->get_texture_height()),
uv_right((float) (surface.get_x() + surface.get_width()) / surface.get_texture()->get_texture_width()),