summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-09-30 18:21:32 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-30 19:43:38 (GMT)
commitbe1b9112e85c270920a559acd790340ca32bce7f (patch)
tree9cfd011bd6b3cb030c825613ae43fcdee5c43c73 /src/simulation/Simulation.cpp
parent1c60ce25ee2fe15cc4bfa0649853bf6a0b95c14d (diff)
downloadpowder-be1b9112e85c270920a559acd790340ca32bce7f.zip
powder-be1b9112e85c270920a559acd790340ca32bce7f.tar.gz
Fix some uninitialized variables, add back sandcolor changing
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 462d4a3..004a914 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -3020,9 +3020,9 @@ int Simulation::create_part(int p, int x, int y, int tv)
{
int colr, colg, colb, randa;
randa = (rand()%30)-15;
- colr = (PIXR(elements[t].Colour)+sandcolour_r+(rand()%20)-10+randa);
- colg = (PIXG(elements[t].Colour)+sandcolour_g+(rand()%20)-10+randa);
- colb = (PIXB(elements[t].Colour)+sandcolour_b+(rand()%20)-10+randa);
+ colr = (PIXR(elements[t].Colour)+sandcolour+(rand()%20)-10+randa);
+ colg = (PIXG(elements[t].Colour)+sandcolour+(rand()%20)-10+randa);
+ colb = (PIXB(elements[t].Colour)+sandcolour+(rand()%20)-10+randa);
colr = colr>255 ? 255 : (colr<0 ? 0 : colr);
colg = colg>255 ? 255 : (colg<0 ? 0 : colg);
colb = colb>255 ? 255 : (colb<0 ? 0 : colb);
@@ -4483,6 +4483,8 @@ void Simulation::update_particles()//doesn't update the particles themselves, bu
if(emp_decor < 0)
emp_decor = 0;
}
+ sandcolour = (int)(20.0f*sin((float)sandcolour_frame*(M_PI/180.0f)));
+ sandcolour_frame = (sandcolour_frame++)%360;
memset(pmap, 0, sizeof(pmap));
memset(pmap_count, 0, sizeof(pmap_count));
@@ -4586,7 +4588,10 @@ Simulation::~Simulation()
}
Simulation::Simulation():
- sys_pause(0)
+ sys_pause(0),
+ framerender(false),
+ pretty_powder(0),
+ sandcolour_frame(0)
{
int tportal_rx[] = {-1, 0, 1, 1, 1, 0,-1,-1};