summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c26
-rw-r--r--src/main.c4
-rw-r--r--src/powder.c58
3 files changed, 52 insertions, 36 deletions
diff --git a/src/graphics.c b/src/graphics.c
index e4a4a4c..73a8f59 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1451,13 +1451,13 @@ void draw_parts(pixel *vid)
}
else
{
- cr = PIXR(ptypes[t].pcolors);
- cg = PIXG(ptypes[t].pcolors);
- cb = PIXB(ptypes[t].pcolors);
- blendpixel(vid, nx, ny, cr, cg, cb, 255);
+ cr = PIXR(ptypes[t].pcolors);
+ cg = PIXG(ptypes[t].pcolors);
+ cb = PIXB(ptypes[t].pcolors);
+ blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
- }
- else if(cmode==CM_GRAD)
+ }
+ else if(cmode==CM_GRAD)//forgot to put else, broke nothing view
{
float frequency = 0.05;
int q = parts[i].temp-40;
@@ -1987,7 +1987,7 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32);
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
}
- }
+ }
else if(t==PT_FILT)
{
int temp_bin = (int)((parts[i].temp-273.0f)*0.025f);
@@ -3074,12 +3074,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
if(!(j%2) && !(i%2))
fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0);
break;
- case 4:
- for(j=0; j<CELL; j+=2)
- for(i=(j>>1)&1; i<CELL; i+=2)
- fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF);
- k++;
- break;
+ case 4:
+ for(j=0; j<CELL; j+=2)
+ for(i=(j>>1)&1; i<CELL; i+=2)
+ fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF);
+ k++;
+ break;
case 6:
for(j=0; j<CELL; j+=2)
for(i=(j>>1)&1; i<CELL; i+=2)
diff --git a/src/main.c b/src/main.c
index f89eae1..1343b96 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1233,7 +1233,7 @@ int main(int argc, char *argv[])
if(!sys_pause||framerender)
{
- update_air();
+ update_air();
}
#ifdef OpenGL
ClearScreen();
@@ -1685,7 +1685,7 @@ int main(int argc, char *argv[])
bsx = 1180;
if(bsx<0)
bsx = 0;
- if(bsy>1180)
+ if(bsy>1180)
bsy = 1180;
if(bsy<0)
bsy = 0;
diff --git a/src/powder.c b/src/powder.c
index b21e113..e30a0b4 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -547,7 +547,7 @@ inline int create_part(int p, int x, int y, int t)
(pmap[y][x]&0xFF)!=PT_BRMT &&
(pmap[y][x]&0xFF)!=PT_NBLE &&
(pmap[y][x]&0xFF)!=PT_IRON &&
- (pmap[y][x]&0xFF)!=PT_INST &&
+ (pmap[y][x]&0xFF)!=PT_INST &&
(pmap[y][x]&0xFF)!=PT_INWR)
return -1;
if(parts[pmap[y][x]>>8].life!=0)
@@ -564,11 +564,17 @@ inline int create_part(int p, int x, int y, int t)
return -1;
if(p==-1)//creating from anything but brush
{
- if(pmap[y][x])
- if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2)
- if(t!=PT_STKM&&t!=PT_STKM2)
- return -1;
- if(pfree == -1)
+ if(pmap[y][x])
+ {
+ if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2)
+ {
+ if(t!=PT_STKM&&t!=PT_STKM2)
+ {
+ return -1;
+ }
+ }
+ }
+ if(pfree == -1)
return -1;
i = pfree;
pfree = parts[i].life;
@@ -576,20 +582,25 @@ inline int create_part(int p, int x, int y, int t)
else if(p==-2)//creating from brush
{
if(pmap[y][x])
- {
- if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2))
{
- parts[pmap[y][x]>>8].ctype = t;
+ if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2))
+ {
+ if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN))
+ {
+ parts[pmap[y][x]>>8].ctype = t;
+ }
+ return -1;
+ }
+ if(pfree == -1)
+ return -1;
+ i = pfree;
+ pfree = parts[i].life;
+ }
+ else
+ {
+ i = p;
}
- return -1;
}
- if(pfree == -1)
- return -1;
- i = pfree;
- pfree = parts[i].life;
- }
- else
- i = p;
if(t==PT_GLAS)
{
@@ -2097,6 +2108,7 @@ void update_particles_i(pixel *vid, int start, int inc)
continue;
if((r&0xFF)==PT_SPRK){
int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0;
+ int nostop = (parts[r>>8].ctype==PT_INST)?1:0;
for (docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) {
if(!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0)){
break;
@@ -2132,7 +2144,11 @@ void update_particles_i(pixel *vid, int start, int inc)
if(nyy!=0 || nxx!=0){
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
}
- docontinue = 0;
+ if(!(nostop && (ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))){
+ docontinue = 0;
+ } else {
+ docontinue = 1;
+ }
}
} else if(destroy) {
if(parts[r>>8].type==PT_BRAY){
@@ -2258,7 +2274,7 @@ void update_particles_i(pixel *vid, int start, int inc)
{
t = parts[i].type = PT_PLNT;
parts[r>>8].type = PT_PLNT;
- parts[r>>8].life = 0;
+ parts[r>>8].life = 0;
}
else if((r&0xFF)==PT_LAVA && 1>(rand()%250))
{
@@ -2540,8 +2556,8 @@ void update_particles_i(pixel *vid, int start, int inc)
create_n_parts(parts[r>>8].life, x+nx, y+ny, parts[i].vx, parts[i].vy, PT_NEUT);
#else
create_part(r>>8, x+nx, y+ny, PT_NEUT);
- parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx;
- parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy;
+ parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx;
+ parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy;
if(parts[r>>8].life>0)
{
parts[r>>8].life --;