fixed compiler warnings

3d_asteroids
Martin Felis 2011-06-13 13:46:19 +02:00
parent 40a11244dd
commit 99f3a4dfff
6 changed files with 17 additions and 16 deletions

View File

@ -392,7 +392,7 @@ bool Model::PullGlobalHighscore(std::stringstream &highscore_stream) {
int bytes_sent; int bytes_sent;
bytes_sent = SDLNet_TCP_Send (server_socket, http_query_string.c_str(), http_query_string.size()); bytes_sent = SDLNet_TCP_Send (server_socket, http_query_string.c_str(), http_query_string.size());
if (bytes_sent != http_query_string.size()) { if (static_cast<unsigned int>(bytes_sent) != http_query_string.size()) {
Engine::LogError ("SDL_net tcp send: %s", SDLNet_GetError()); Engine::LogError ("SDL_net tcp send: %s", SDLNet_GetError());
return false; return false;
} }
@ -501,7 +501,7 @@ bool Model::SubmitGlobalHigscoreEntry (std::string name, const unsigned int poin
int bytes_sent; int bytes_sent;
bytes_sent = SDLNet_TCP_Send (server_socket, http_query_string.c_str(), http_query_string.size()); bytes_sent = SDLNet_TCP_Send (server_socket, http_query_string.c_str(), http_query_string.size());
if (bytes_sent != http_query_string.size()) { if (static_cast<unsigned int>(bytes_sent) != http_query_string.size()) {
Engine::LogError ("SDL_net tcp send: %s", SDLNet_GetError()); Engine::LogError ("SDL_net tcp send: %s", SDLNet_GetError());
return false; return false;
} }
@ -800,7 +800,6 @@ void Model::OnLevelComplete() {
// calculate the bonus points // calculate the bonus points
float level_time = roundf(mLevelTimeSeconds); float level_time = roundf(mLevelTimeSeconds);
float level_par_time = roundf(mLevelParTimeSeconds); float level_par_time = roundf(mLevelParTimeSeconds);
int bonus_points = 0;
if (level_time <= level_par_time) { if (level_time <= level_par_time) {
// secret time bonus formula // secret time bonus formula

View File

@ -589,8 +589,6 @@ void View::DrawUiGameOver() {
text_xpos, text_xpos,
text_ypos); text_ypos);
const static int value_width = 10;
text_ypos += 48; text_ypos += 48;
// ----- New Score ----- // ----- New Score -----
@ -781,7 +779,6 @@ void View::DrawUiLevelComplete() {
if (GetModel()->GetGameModified()) { if (GetModel()->GetGameModified()) {
SelectFont("console.ttf size=23 color=#cc0000"); SelectFont("console.ttf size=23 color=#cc0000");
float width, height;
std::string message ("* UNOFFICIAL GAME * UNOFFICIAL GAME * UNOFFICIAL GAME *"); std::string message ("* UNOFFICIAL GAME * UNOFFICIAL GAME * UNOFFICIAL GAME *");
float xpos = (screen_left) + 5; float xpos = (screen_left) + 5;
@ -951,7 +948,7 @@ void View::DrawUiPlayerDied() {
*/ */
void View::DrawHighscoreEntry (float x, float y, float entry_width, const std::string &name, unsigned int points) { void View::DrawHighscoreEntry (float x, float y, float entry_width, const std::string &name, unsigned int points) {
const float width_buffer = 30.; const float width_buffer = 30.;
float width, height; float height;
float name_width, points_value_width; float name_width, points_value_width;
// Measure and draw the name // Measure and draw the name

View File

@ -88,8 +88,8 @@ std::string find_game_data_dir () {
paths.push_back("/usr/local/share/fysxasteroids"); paths.push_back("/usr/local/share/fysxasteroids");
paths.push_back("/usr/share/fysxasteroids"); paths.push_back("/usr/share/fysxasteroids");
std::vector<std::string>::iterator iter = paths.begin(); std::vector<std::string>::iterator iter;
for (iter; iter != paths.end(); iter++) { for (iter = paths.begin(); iter != paths.end(); iter++) {
std::string test_path = *iter; std::string test_path = *iter;
if (!boost::filesystem::is_directory(test_path + "/data/fonts")) if (!boost::filesystem::is_directory(test_path + "/data/fonts"))
@ -157,7 +157,6 @@ int main (int argc, char* argv[]) {
Engine::SetMusicVolume (0.); Engine::SetMusicVolume (0.);
// Load the icon // Load the icon
Uint32 colorkey;
SDL_Surface *image = NULL; SDL_Surface *image = NULL;
image = SDL_LoadBMP("./data/textures/icon.bmp"); image = SDL_LoadBMP("./data/textures/icon.bmp");
if (!image) if (!image)

View File

@ -186,7 +186,7 @@ void CommandSetErrorString (const std::string &error_str){
std::string CommandGetErrorString (){ std::string CommandGetErrorString (){
if (!CommandsInitialized ()) if (!CommandsInitialized ())
return false; return std::string("");
return CommandsInstance->GetErrorString(); return CommandsInstance->GetErrorString();
} }

View File

@ -34,7 +34,7 @@ bool regionhit (int x, int y, int w, int h) {
void DrawBlock (int x, int y, int w, int h) { void DrawBlock (int x, int y, int w, int h) {
const float shading_dark = 0.5f; const float shading_dark = 0.5f;
const float shading_light = 1.3f; // const float shading_light = 1.3f;
float color[4]; float color[4];
glGetFloatv (GL_CURRENT_COLOR, color); glGetFloatv (GL_CURRENT_COLOR, color);
@ -297,6 +297,8 @@ bool Button (int id, const char* caption, int x, int y, int w, int h) {
controller->uistate.kbditem = 0; controller->uistate.kbditem = 0;
return true; return true;
break; break;
default:
break;
} }
} }
@ -418,6 +420,8 @@ bool CheckButton (int id, const char* caption, bool checked, int x, int y, int w
return true; return true;
break; break;
default:
break;
} }
} }
@ -541,7 +545,7 @@ bool LineEdit (int id, int x, int y, std::string &text_value, const int &maxleng
break; break;
default: default:
// The raw input processing // The raw input processing
if (maxlength > 0 && text_value.size() < maxlength) { if (maxlength > 0 && static_cast<int>(text_value.size()) < maxlength) {
if (controller->uistate.last_unicode) { if (controller->uistate.last_unicode) {
if ((controller->uistate.last_unicode & 0xFF80) == 0) { if ((controller->uistate.last_unicode & 0xFF80) == 0) {
// we do not want to add special characters such as backspaces // we do not want to add special characters such as backspaces
@ -681,7 +685,7 @@ bool LineEditMasked (int id, int x, int y, std::string &text_value, const int &m
break; break;
default: default:
// The raw input processing // The raw input processing
if (maxlength > 0 && text_value.size() < maxlength) { if (maxlength > 0 && static_cast<int>(text_value.size()) < maxlength) {
if (controller->uistate.last_unicode) { if (controller->uistate.last_unicode) {
if ((controller->uistate.last_unicode & 0xFF80) == 0) { if ((controller->uistate.last_unicode & 0xFF80) == 0) {
char c = controller->uistate.last_unicode & 0x7F; char c = controller->uistate.last_unicode & 0x7F;
@ -789,6 +793,8 @@ float VerticalSlider (int id, int x, int y, int w, int h, float min_value, float
controller->uistate.last_keysym = SDLK_CLEAR; controller->uistate.last_keysym = SDLK_CLEAR;
return true; return true;
break; break;
default:
break;
} }
} }

View File

@ -11,8 +11,8 @@ class Module;
class SoundSample { class SoundSample {
public: public:
SoundSample() : SoundSample() :
mMixChunk (NULL), mChannel (-1),
mChannel (-1) { mMixChunk (NULL) {
} }
~SoundSample(); ~SoundSample();