summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-20 23:42:17 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-20 23:42:17 (GMT)
commitfa201a7aeb6c645801a11a115ef6baeed9edf1e5 (patch)
tree616a98dddd3b6f93dd6580f762298690c320b3bf /src
parent6a331fdaf848ce82adc930ad24ac15c5259d2262 (diff)
downloadpowder-fa201a7aeb6c645801a11a115ef6baeed9edf1e5.zip
powder-fa201a7aeb6c645801a11a115ef6baeed9edf1e5.tar.gz
Fix some uninitialised variables
Diffstat (limited to 'src')
-rw-r--r--src/game/GameController.cpp2
-rw-r--r--src/game/GameModel.cpp4
-rw-r--r--src/interface/Button.cpp3
-rw-r--r--src/interface/Window.cpp3
-rw-r--r--src/simulation/Air.cpp7
-rw-r--r--src/simulation/Simulation.cpp2
6 files changed, 15 insertions, 6 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index e029fc9..07f2722 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -54,7 +54,7 @@ void GameController::DrawPoints(queue<ui::Point*> & pointQueue)
void GameController::Tick()
{
- gameModel->GetSimulation()->update_particles();
+ //gameModel->GetSimulation()->update_particles();
}
void GameController::SetPaused(bool pauseState)
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 3d5a800..50f266f 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -5,7 +5,9 @@
#include "Renderer.h"
GameModel::GameModel():
- activeElement(1)
+ activeElement(1),
+ sim(NULL),
+ ren(NULL)
{
sim = new Simulation();
ren = new Renderer(ui::Engine::Ref().g, sim);
diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp
index 783c297..659aeed 100644
--- a/src/interface/Button.cpp
+++ b/src/interface/Button.cpp
@@ -21,6 +21,7 @@ Button::Button(Window* parent_state, std::string buttonText):
isMouseInside(false),
isButtonDown(false),
isTogglable(false),
+ toggle(false),
actionCallback(NULL),
textPosition(ui::Point(0, 0)),
textVAlign(AlignMiddle),
@@ -35,6 +36,7 @@ Button::Button(Point position, Point size, std::string buttonText):
isMouseInside(false),
isButtonDown(false),
isTogglable(false),
+ toggle(false),
actionCallback(NULL),
textPosition(ui::Point(0, 0)),
textVAlign(AlignMiddle),
@@ -49,6 +51,7 @@ Button::Button(std::string buttonText):
isMouseInside(false),
isButtonDown(false),
isTogglable(false),
+ toggle(false),
actionCallback(NULL),
textPosition(ui::Point(0, 0)),
textVAlign(AlignMiddle),
diff --git a/src/interface/Window.cpp b/src/interface/Window.cpp
index e28d34b..ca29be0 100644
--- a/src/interface/Window.cpp
+++ b/src/interface/Window.cpp
@@ -7,7 +7,8 @@ using namespace ui;
Window::Window(Point _position, Point _size):
Position(_position),
Size(_size),
- focusedComponent_(NULL)
+ focusedComponent_(NULL),
+ AllowExclusiveDrawing(true)
{
}
diff --git a/src/simulation/Air.cpp b/src/simulation/Air.cpp
index b3826ab..3c88e91 100644
--- a/src/simulation/Air.cpp
+++ b/src/simulation/Air.cpp
@@ -117,8 +117,8 @@ void Air::update_airh(void)
void Air::update_air(void)
{
- int x, y, i, j;
- float dp, dx, dy, f, tx, ty;
+ int x = 0, y = 0, i = 0, j = 0;
+ float dp = 0.0f, dx = 0.0f, dy = 0.0f, f = 0.0f, tx = 0.0f, ty = 0.0f;
for (y=0; y<YRES/CELL; y++)
for (x=0; x<XRES/CELL; x++)
@@ -294,7 +294,8 @@ void Air::update_air(void)
memcpy(pv, opv, sizeof(pv));
}
}
-Air::Air()
+Air::Air():
+ airMode(0)
{
//Simulation should do this.
make_kernel();
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 96b9d44..f7dec79 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -3222,6 +3222,8 @@ Simulation::Simulation()
pv = air->pv;
hv = air->hv;
+ signs = (sign*)calloc(MAXSIGNS, sizeof(sign));
+
//ptypes[0] = {"", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, 0, R_TEMP+0.0f +273.15f, 251, "Erases particles.", ST_NONE, 0, NULL, NULL};
//ptypes[1] = {"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 1, 85, 0, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, NULL, &graphics_DUST};
//ptypes[2] = {"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 30, 0, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_WATR, NULL};