Permalink
Browse files

fix platform / sconscript flag specific warnings, --no-warnings no lo…

…nger defaults to true
  • Loading branch information...
jacob1 committed Jan 17, 2015
1 parent ace9e36 commit b1a3c404b696bc324f1de76de7c3e813bf83351e
Showing with 17 additions and 15 deletions.
  1. +1 −1 SConscript
  2. +4 −4 src/PowderToySDL.cpp
  3. +2 −0 src/SDLMain.m
  4. +2 −4 src/client/GameSave.cpp
  5. +3 −3 src/graphics/Renderer.cpp
  6. +2 −2 src/graphics/Renderer.h
  7. +3 −1 src/simulation/Simulation.cpp
@@ -68,7 +68,7 @@ AddSconsOption('opengl-renderer', False, False, "Build with OpenGL renderer supp
AddSconsOption('renderer', False, False, "Build the save renderer.")
AddSconsOption('wall', False, False, "Error on all warnings.")
AddSconsOption('no-warnings', True, False, "Disable all compiler warnings (default).")
AddSconsOption('no-warnings', False, False, "Disable all compiler warnings.")
AddSconsOption('nolua', False, False, "Disable Lua.")
AddSconsOption('nofft', False, False, "Disable FFT.")
AddSconsOption("output", False, True, "Executable output name.")
@@ -948,16 +948,16 @@ int main(int argc, char * argv[])
{
std::string saveIdPart = "";
int saveId;
unsigned int hashPos = ptsaveArg.find('#');
if(hashPos != std::string::npos)
size_t hashPos = ptsaveArg.find('#');
if (hashPos != std::string::npos)
{
saveIdPart = ptsaveArg.substr(7, hashPos-7);
}
else
{
saveIdPart = ptsaveArg.substr(7);
}
if(saveIdPart.length())
if (saveIdPart.length())
{
#ifdef DEBUG
std::cout << "Got Ptsave: id: " << saveIdPart << std::endl;
@@ -967,7 +967,7 @@ int main(int argc, char * argv[])
throw std::runtime_error("Invalid Save ID");
SaveInfo * newSave = Client::Ref().GetSave(saveId, 0);
if(!newSave)
if (!newSave)
throw std::runtime_error("Could not load save");
GameSave * newGameSave = new GameSave(Client::Ref().GetSaveData(saveId, 0));
newSave->SetGameSave(newGameSave);
@@ -395,6 +395,7 @@ void writeUserPreferences(const char * prefData)
[prefDataNSString release];
}
//doesn't work on OS X 10.5 or below
char * readClipboard()
{
NSPasteboard *clipboard = [NSPasteboard generalPasteboard];
@@ -416,6 +417,7 @@ void writeUserPreferences(const char * prefData)
return clipboardDataCopy;
}
//doesn't work on OS X 10.5 or below
void writeClipboard(const char * clipboardData)
{
NSPasteboard *clipboard = [NSPasteboard generalPasteboard];
@@ -772,7 +772,7 @@ void GameSave::readOPS(char * data, int dataLength)
fanVelY[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
}
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
if (blockMap[y][x] >= UI_WALLCOUNT)
blockMap[y][x] = 0;
}
}
@@ -825,8 +825,6 @@ void GameSave::readOPS(char * data, int dataLength)
fprintf(stderr, "Out of range [%d]: %d %d, [%d, %d], [%d, %d]\n", i, x, y, (unsigned)partsData[i+1], (unsigned)partsData[i+2], (unsigned)partsData[i+3], (unsigned)partsData[i+4]);
goto fail;
}
if (partsData[i] >= PT_NUM)
partsData[i] = PT_DMND; //Replace all invalid elements with diamond
if (newIndex < 0 || newIndex >= NPART)
goto fail;
@@ -1295,7 +1293,7 @@ void GameSave::readPSv(char * data, int dataLength)
blockMap[y][x]=WL_ALLOWENERGY;
}
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
if (blockMap[y][x] >= UI_WALLCOUNT)
blockMap[y][x] = 0;
}
@@ -201,7 +201,7 @@ void Renderer::clearScreen(float alpha)
#endif
}
#ifdef OGLR
void Renderer::checkShader(GLuint shader, char * shname)
void Renderer::checkShader(GLuint shader, const char * shname)
{
GLint status;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
@@ -214,7 +214,7 @@ void Renderer::checkShader(GLuint shader, char * shname)
exit(1);
}
}
void Renderer::checkProgram(GLuint program, char * progname)
void Renderer::checkProgram(GLuint program, const char * progname)
{
GLint status;
glGetProgramiv(program, GL_LINK_STATUS, &status);
@@ -706,7 +706,7 @@ void Renderer::DrawWalls()
if (bmap[y][x])
{
wt = bmap[y][x];
if (wt<0 || wt>=UI_WALLCOUNT)
if (wt >= UI_WALLCOUNT)
continue;
pc = wtypes[wt].colour;
gc = wtypes[wt].eglow;
@@ -99,8 +99,8 @@ class Renderer
void SetSample(int x, int y);
#ifdef OGLR
void checkShader(GLuint shader, char * shname);
void checkProgram(GLuint program, char * progname);
void checkShader(GLuint shader, const char * shname);
void checkProgram(GLuint program, const char * progname);
void loadShaders();
GLuint vidBuf,textTexture;
GLint prevFbo;
@@ -81,8 +81,10 @@ int Simulation::Load(int fullX, int fullY, GameSave * save)
x = int(tempPart.x + 0.5f);
y = int(tempPart.y + 0.5f);
if(tempPart.type >= 0 && tempPart.type < PT_NUM)
if (tempPart.type >= 0 && tempPart.type < PT_NUM)
tempPart.type = partMap[tempPart.type];
else
continue;
if ((player.spwn == 1 && tempPart.type==PT_STKM) || (player2.spwn == 1 && tempPart.type==PT_STKM2))
continue;

0 comments on commit b1a3c40

Please sign in to comment.