summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/game/Tool.cpp8
-rw-r--r--src/gui/preview/PreviewModel.cpp18
2 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/game/Tool.cpp b/src/gui/game/Tool.cpp
index bdc1801..97ab634 100644
--- a/src/gui/game/Tool.cpp
+++ b/src/gui/game/Tool.cpp
@@ -65,7 +65,7 @@ void ElementTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1,
sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID);
}
void ElementTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
- sim->FloodParts(position.X, position.Y, toolID, -1, -1);
+ sim->FloodParts(position.X, position.Y, toolID, -1);
}
@@ -87,7 +87,7 @@ void WallTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui
newFanVelX *= strength;
float newFanVelY = (position2.Y-position1.Y)*0.005f;
newFanVelY *= strength;
- sim->FloodWalls(position1.X, position1.Y, WL_FLOODHELPER, -1, WL_FAN, 0);
+ sim->FloodWalls(position1.X, position1.Y, WL_FLOODHELPER, WL_FAN, 0);
for (int j = 0; j < YRES/CELL; j++)
for (int i = 0; i < XRES/CELL; i++)
if (sim->bmap[j][i] == WL_FLOODHELPER)
@@ -107,7 +107,7 @@ void WallTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui
}
void WallTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
if (toolID != WL_STREAM)
- sim->FloodWalls(position.X, position.Y, toolID, -1, -1);
+ sim->FloodWalls(position.X, position.Y, toolID, -1);
}
WindTool::WindTool(int id, string name, string description, int r, int g, int b, std::string identifier, VideoBuffer * (*textureGen)(int, int, int)):
@@ -185,7 +185,7 @@ void Element_TESC_Tool::DrawRect(Simulation * sim, Brush * brush, ui::Point posi
}
void Element_TESC_Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7;
- sim->FloodParts(position.X, position.Y, toolID | (radiusInfo << 8), -1, -1);
+ sim->FloodParts(position.X, position.Y, toolID | (radiusInfo << 8), -1);
}
diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp
index 34d0c7f..88b281b 100644
--- a/src/gui/preview/PreviewModel.cpp
+++ b/src/gui/preview/PreviewModel.cpp
@@ -23,9 +23,10 @@ void * PreviewModel::updateSaveInfoT(void * obj)
{
SaveInfo * tempSave = Client::Ref().GetSave(((threadInfo*)obj)->saveID, ((threadInfo*)obj)->saveDate);
((threadInfo*)obj)->threadFinished = true;
- if (((threadInfo*)obj)->previewExited && tempSave)
+ if (((threadInfo*)obj)->previewExited)
{
- delete tempSave;
+ if (tempSave)
+ delete tempSave;
delete obj;
}
return tempSave;
@@ -52,12 +53,15 @@ void * PreviewModel::updateSaveCommentsT(void * obj)
{
std::vector<SaveComment*> * tempComments = Client::Ref().GetComments(((threadInfo*)obj)->saveID, (((threadInfo*)obj)->saveDate-1)*20, 20); //saveDate is used as commentsPageNumber
((threadInfo*)obj)->threadFinished = true;
- if (((threadInfo*)obj)->previewExited && tempComments)
+ if (((threadInfo*)obj)->previewExited)
{
- for(int i = 0; i < tempComments->size(); i++)
- delete tempComments->at(i);
- tempComments->clear();
- delete tempComments;
+ if (tempComments)
+ {
+ for(int i = 0; i < tempComments->size(); i++)
+ delete tempComments->at(i);
+ tempComments->clear();
+ delete tempComments;
+ }
delete obj;
}
return tempComments;