summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-01-10 14:43:16 (GMT)
committer Cracker64 <cracker642@gmail.com>2011-01-10 14:43:16 (GMT)
commitf242566e30831963eee287b7dbe944b715457dae (patch)
treeca900890b1b52dc75a15ebd41791873bac680f3b /src
parentd6837437f2eff9a2d020638646ba874a33580227 (diff)
downloadpowder-f242566e30831963eee287b7dbe944b715457dae.zip
powder-f242566e30831963eee287b7dbe944b715457dae.tar.gz
fix QRTZ spot saving, rotate should change FAN vector as well
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c2
-rw-r--r--src/main.c2
-rw-r--r--src/powder.c23
3 files changed, 21 insertions, 6 deletions
diff --git a/src/graphics.c b/src/graphics.c
index b0d532d..ef8fb15 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1667,7 +1667,7 @@ void draw_parts(pixel *vid)
}
else if(t==PT_QRTZ || t==PT_PQRT)
{
- int z = parts[i].tmp;
+ int z = parts[i].tmp - 5;
if(parts[i].temp>(pstates[t].ltemp-800.0f))
{
float frequency = 3.1415/(2*pstates[t].ltemp-(pstates[t].ltemp-800.0f));
diff --git a/src/main.c b/src/main.c
index 97e7382..557673c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1756,7 +1756,7 @@ int main(int argc, char *argv[])
int tctype = parts[cr>>8].ctype;
if(tctype>=PT_NUM)
tctype = 0;
- sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life);
+ sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d,tmp: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life,parts[cr>>8].tmp);
//sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life);
} else {
sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f);
diff --git a/src/powder.c b/src/powder.c
index 440c0c2..5f6a78a 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -648,9 +648,9 @@ inline int create_part(int p, int x, int y, int t)
if(t==PT_SING)
parts[i].life = rand()%50+60;
if(t==PT_QRTZ)
- parts[i].tmp = (rand()%11) -5;
+ parts[i].tmp = (rand()%11);
if(t==PT_PQRT)
- parts[i].tmp = (rand()%11) -5;
+ parts[i].tmp = (rand()%11);
if(t==PT_FSEP)
parts[i].life = 50;
if(t==PT_COAL) {
@@ -5785,16 +5785,25 @@ void rotate_area(int area_x, int area_y, int area_w, int area_h, int invert)
unsigned rtpmap[area_w][area_h];
unsigned char tbmap[area_h/CELL][area_w/CELL];
unsigned char rtbmap[area_w/CELL][area_h/CELL];
+ float tfvy[area_h/CELL][area_w/CELL];
+ float tfvx[area_h/CELL][area_w/CELL];
for(cy=0; cy<area_h; cy++)
{
for(cx=0; cx<area_w; cx++)//save walls to temp
{
if(area_x + cx<XRES&&area_y + cy<YRES)
{
- if(bmap[(cy+area_y)/CELL][(cx+area_x)/CELL])
+ if(bmap[(cy+area_y)/CELL][(cx+area_x)/CELL]){
tbmap[cy/CELL][cx/CELL] = bmap[(cy+area_y)/CELL][(cx+area_x)/CELL];
- else
+ if(bmap[(cy+area_y)/CELL][(cx+area_x)/CELL]==WL_FAN){
+ tfvx[cy/CELL][cx/CELL] = fvx[(cy+area_y)/CELL][(cx+area_x)/CELL];
+ tfvy[cy/CELL][cx/CELL] = fvy[(cy+area_y)/CELL][(cx+area_x)/CELL];
+ }
+ }else {
tbmap[cy/CELL][cx/CELL] = 0;
+ tfvx[cy/CELL][cx/CELL] = 0;
+ tfvy[cy/CELL][cx/CELL] = 0;
+ }
}
}
}
@@ -5818,11 +5827,15 @@ void rotate_area(int area_x, int area_y, int area_w, int area_h, int invert)
{
rtbmap[cy/CELL][((area_h-1)-cx)/CELL] = tbmap[cy/CELL][cx/CELL];
rtpmap[cy][(area_h-1)-cx] = tpmap[(int)(cy+0.5f)][(int)(cx+0.5f)];
+ tfvx[cy/CELL][((area_h-1)-cx)/CELL] = -tfvx[cy/CELL][cx/CELL];
+ tfvy[cy/CELL][((area_h-1)-cx)/CELL] = tfvy[cy/CELL][cx/CELL];
}
else
{
rtbmap[((area_h-1)-cx)/CELL][cy/CELL] = tbmap[cy/CELL][cx/CELL];
rtpmap[(area_h-1)-cx][cy] = tpmap[(int)(cy+0.5f)][(int)(cx+0.5f)];
+ tfvy[((area_h-1)-cx)/CELL][cy/CELL] = -tfvx[cy/CELL][cx/CELL];
+ tfvx[((area_h-1)-cx)/CELL][cy/CELL] = tfvy[cy/CELL][cx/CELL];
}
}
}
@@ -5838,6 +5851,8 @@ void rotate_area(int area_x, int area_y, int area_w, int area_h, int invert)
parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>8].y = area_y +cy;
}
bmap[(area_y+cy)/CELL][(area_x+cx)/CELL] = rtbmap[cy/CELL][cx/CELL];
+ fvy[(area_y+cy)/CELL][(area_x+cx)/CELL] = tfvy[cy/CELL][cx/CELL];
+ fvx[(area_y+cy)/CELL][(area_x+cx)/CELL] = tfvx[cy/CELL][cx/CELL];
}
}
}