# fails on MinGW:
# -ansi
# fails on clang:
- # -Wlogical-op
- SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter -Wshadow -Wnon-virtual-dtor -Wcast-qual")
+ # -Wlogical-op -Wstrict-null-sentinel
+ SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wno-unused-parameter -Wshadow -Wnon-virtual-dtor -Wcast-qual")
ENDIF(WARNINGS)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
PluralForms
PluralForms::from_string(const std::string& str)
{
- static std::unordered_map<std::string, struct PluralForms> plural_forms;
+ static std::unordered_map<std::string, PluralForms> plural_forms;
if (plural_forms.empty())
{
if (!isspace(str[i]))
space_less_str += str[i];
- std::unordered_map<std::string, struct PluralForms>::const_iterator it= plural_forms.find(space_less_str);
+ std::unordered_map<std::string, PluralForms>::const_iterator it= plural_forms.find(space_less_str);
if (it != plural_forms.end())
{
return it->second;
m_id(id),
m_url(url),
m_handle(),
- m_error_buffer({'\0'}),
- m_status(new TransferStatus(downloader, id)),
+ m_error_buffer({{'\0'}}),
+ m_status(new TransferStatus(m_downloader, id)),
m_fout(PHYSFS_openWrite(outfile.c_str()), PHYSFS_close)
{
if (!m_fout)
movement_timer(),
lifetime(),
direction(),
- state(),
light(0.0f,0.0f,0.0f),
lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light.sprite"))
{
Timer movement_timer;
Timer lifetime;
int direction;
- State state;
Color light;
SpritePtr lightsprite;
};
#include <math.h>
static const std::string TREEWILLOSOUND = "sounds/willowisp.wav";
-static const float SUCKSPEED = 25;
TreeWillOWisp::TreeWillOWisp(GhostTree* tree_, const Vector& pos,
float radius_, float speed_) :
static const float BOUNCY_BRICK_MAX_OFFSET = 8;
static const float BOUNCY_BRICK_SPEED = 90;
-static const float EPSILON = .0001f;
static const float BUMP_ROTATION_ANGLE = 10;
Block::Block(SpritePtr newsprite) :
namespace {
const float BULLET_XM = 600;
-const float BULLET_STARTING_YM = 0;
}
Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type_) :
}
static const float CAMERA_EPSILON = .00001f;
-static const float MAX_SPEED_Y = 140;
void
Camera::update(float elapsed_time)
#include "video/drawing_context.hpp"
#include "sprite/sprite.hpp"
-namespace {
-const float SCROLL_DELAY = 0.5;
-const float SCROLL_DISTANCE = 16;
-const float WIDTH = 400;
-const float HEIGHT = 200;
-}
-
InfoBlock::InfoBlock(const Reader& lisp) :
Block(SpriteManager::current()->create("images/objects/bonus_block/infoblock.sprite")),
message(),
//#define SWIMMING
namespace {
-static const int TILES_FOR_BUTTJUMP = 3;
static const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f;
static const float SHOOTING_TIME = .150f;
/** time of the kick (kicking mriceblock) animation */
static const float KICK_TIME = .3f;
-/** time of tux cheering (currently unused) */
-static const float CHEER_TIME = 1.0f;
/** if Tux cannot unduck for this long, he will get hurt */
static const float UNDUCK_HURT_TIME = 0.25f;
#include "supertux/savegame.hpp"
+#include <algorithm>
+
#include "lisp/lisp.hpp"
#include "lisp/parser.hpp"
#include "lisp/writer.hpp"
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
- log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
+ log_debug << "Malformed utf-8 sequence beginning with " << *(reinterpret_cast<const uint32_t*>(text.c_str() + pos)) << " found " << std::endl;
chr = 0;
}
}
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
- log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
+ log_debug << "Malformed utf-8 sequence beginning with " << *(reinterpret_cast<const uint32_t*>(text.c_str() + pos)) << " found " << std::endl;
chr = 0;
++pos;
}
#include "video/font_ptr.hpp"
#include "video/texture.hpp"
-class DrawingRequest;
+struct DrawingRequest;
class Surface;
class Texture;
class VideoSystem;
#include "SDL_opengl.h"
#endif
-class DrawingRequest;
+struct DrawingRequest;
class GLPainter
{
namespace {
+#ifdef GL_VERSION_ES_CM_1_0
inline bool is_power_of_2(int v)
{
return (v & (v-1)) == 0;
}
+#endif
inline int next_power_of_two(int val)
{