summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-03-03 21:32:11 (GMT)
committer cracker64 <cracker642@gmail.com>2013-03-03 21:32:11 (GMT)
commit2be0b222111240cca189288a6a6da2141c5a8a2f (patch)
tree835779268f34c8feb870960fe5a9390e34c2525c /src
parent5e1c7d7932aead512549bacb6fa8847da2530e9f (diff)
parentcca1898ee8c2091833661f97748defb298cc77b9 (diff)
downloadpowder-2be0b222111240cca189288a6a6da2141c5a8a2f.zip
powder-2be0b222111240cca189288a6a6da2141c5a8a2f.tar.gz
Merge branch 'master' of git@github.com:FacialTurd/The-Powder-Toy.git
Diffstat (limited to 'src')
-rw-r--r--src/graphics/Renderer.cpp4
-rw-r--r--src/preview/PreviewController.cpp7
-rw-r--r--src/preview/PreviewModel.cpp8
-rw-r--r--src/preview/PreviewView.cpp11
-rw-r--r--src/simulation/Simulation.cpp14
5 files changed, 12 insertions, 32 deletions
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index 486a0d4..3a1a2cd 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -1172,10 +1172,10 @@ void Renderer::render_parts()
fnx = sim->parts[i].x;
fny = sim->parts[i].y;
- if((sim->photons[ny][nx]&0xFF) && !(sim->elements[t].Properties & TYPE_ENERGY) && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH)
- continue;
if(nx >= XRES || nx < 0 || ny >= YRES || ny < 0)
continue;
+ if((sim->photons[ny][nx]&0xFF) && !(sim->elements[t].Properties & TYPE_ENERGY) && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH)
+ continue;
//Defaults
pixel_mode = 0 | PMODE_FLAT;
diff --git a/src/preview/PreviewController.cpp b/src/preview/PreviewController.cpp
index 37561b7..1616c63 100644
--- a/src/preview/PreviewController.cpp
+++ b/src/preview/PreviewController.cpp
@@ -1,10 +1,3 @@
-/*
- * PreviewController.cpp
- *
- * Created on: Jan 21, 2012
- * Author: Simon
- */
-
#include <sstream>
#include "client/Client.h"
#include "PreviewController.h"
diff --git a/src/preview/PreviewModel.cpp b/src/preview/PreviewModel.cpp
index b5dbf40..ea3904d 100644
--- a/src/preview/PreviewModel.cpp
+++ b/src/preview/PreviewModel.cpp
@@ -1,10 +1,3 @@
-/*
- * PreviewModel.cpp
- *
- * Created on: Jan 21, 2012
- * Author: Simon
- */
-
#include <cmath>
#include "PreviewModel.h"
#include "client/Client.h"
@@ -25,7 +18,6 @@ PreviewModel::PreviewModel():
commentsPageNumber(1),
commentBoxEnabled(false)
{
- // TODO Auto-generated constructor stub
}
diff --git a/src/preview/PreviewView.cpp b/src/preview/PreviewView.cpp
index 61a0c8f..1859a2a 100644
--- a/src/preview/PreviewView.cpp
+++ b/src/preview/PreviewView.cpp
@@ -1,10 +1,3 @@
-/*
- * PreviewView.cpp
- *
- * Created on: Jan 21, 2012
- * Author: Simon
- */
-
#include <sstream>
#include <vector>
#include <cmath>
@@ -274,7 +267,7 @@ void PreviewView::OnDraw()
g->drawrect(Position.X, Position.Y, (XRES/2)+1, (YRES/2)+1, 255, 255, 255, 100);
g->draw_line(Position.X+XRES/2, Position.Y+1, Position.X+XRES/2, Position.Y+Size.Y-2, 200, 200, 200, 255);
- if(!(!votesUp && !votesDown))
+ if(votesUp || votesDown)
{
float ryf;
int nyu, nyd;
@@ -573,5 +566,7 @@ PreviewView::~PreviewView()
RemoveComponent(submitCommentButton);
delete submitCommentButton;
}
+ if(savePreview)
+ delete savePreview;
}
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index d64ccf7..ef3c3d9 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2947,10 +2947,10 @@ int Simulation::create_part(int p, int x, int y, int tv)
parts[i].life = 75;
break;
/*Testing
- case PT_WOOD:
- parts[i].life = 150;
- break;
- End Testing*/
+ case PT_WOOD:
+ parts[i].life = 150;
+ break;
+ End Testing*/
case PT_WARP:
parts[i].life = rand()%95+70;
break;
@@ -3555,7 +3555,7 @@ void Simulation::update_particles_i(int start, int inc)
{
golnum = parts[r>>8].ctype+1;
if (golnum<=0 || golnum>NGOLALT) {
- parts[r>>8].type = PT_NONE;
+ kill_part(r>>8);
continue;
}
if (parts[r>>8].tmp == grule[golnum][9]-1) {
@@ -3575,7 +3575,7 @@ void Simulation::update_particles_i(int start, int inc)
} else {
parts[r>>8].tmp --;
if (parts[r>>8].tmp<=0)
- parts[r>>8].type = PT_NONE;//using kill_part makes it not work
+ kill_part(r>>8);
}
}
//}
@@ -3604,7 +3604,7 @@ void Simulation::update_particles_i(int start, int inc)
parts[r>>8].tmp --;
}
if (r && parts[r>>8].tmp<=0)
- parts[r>>8].type = PT_NONE;//using kill_part makes it not work
+ kill_part(r>>8);
}
for ( z = 0; z<=NGOL; z++)
gol2[ny][nx][z] = 0;//this improves performance A LOT compared to the memset, i was getting ~23 more fps with this.