mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-03-28 10:03:34 +01:00
fix platform / sconscript flag specific warnings, --no-warnings no longer defaults to true
This commit is contained in:
parent
ace9e36cc6
commit
b1a3c404b6
@ -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,8 +948,8 @@ 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);
|
||||
}
|
||||
@ -957,7 +957,7 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
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 @@ char * readClipboard()
|
||||
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 @@ public:
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user