summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-11-26 12:44:52 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-26 12:44:52 (GMT)
commitd17336b4672e72791fa1f9ac1c5e7c04bbffd831 (patch)
tree88ee2b49e3ec9d1529a74ff2209f4ab5681e0cec /src/elements
parent4c2f8d56f148b0a02d28f061f835f39efe4273e4 (diff)
downloadpowder-d17336b4672e72791fa1f9ac1c5e7c04bbffd831.zip
powder-d17336b4672e72791fa1f9ac1c5e7c04bbffd831.tar.gz
Allow pipe to grab from photon map, BRAY beam takes temp from ARAY
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/aray.c1
-rw-r--r--src/elements/pipe.c84
2 files changed, 46 insertions, 39 deletions
diff --git a/src/elements/aray.c b/src/elements/aray.c
index 539b5a6..22ee26c 100644
--- a/src/elements/aray.c
+++ b/src/elements/aray.c
@@ -27,6 +27,7 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
parts[nr].life = 2;
} else
parts[nr].ctype = colored;
+ parts[nr].temp = parts[i].temp;
}
} else if (!destroy) {
if ((r&0xFF)==PT_BRAY&&parts[r>>8].tmp==0) {//if it hits another BRAY that isn't red
diff --git a/src/elements/pipe.c b/src/elements/pipe.c
index 3f370a1..afb4b4e 100644
--- a/src/elements/pipe.c
+++ b/src/elements/pipe.c
@@ -130,6 +130,8 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = pmap[y+ry][x+rx];
+ if(!r)
+ r = photons[y+ry][x+rx];
if (surround_space && !r && (parts[i].tmp&0xFF)!=0) //creating at end
{
np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF);
@@ -240,45 +242,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
int graphics_PIPE(GRAPHICS_FUNC_ARGS)
{
- if (cpart->ctype==2)
- {
- *colr = 50;
- *colg = 1;
- *colb = 1;
- }
- else if (cpart->ctype==3)
- {
- *colr = 1;
- *colg = 50;
- *colb = 1;
- }
- else if (cpart->ctype==4)
- {
- *colr = 1;
- *colg = 1;
- *colb = 50;
- }
- else if (cpart->temp<272.15&&cpart->ctype!=1)
- {
- if (cpart->temp>173.25&&cpart->temp<273.15)
- {
- *colr = 50;
- *colg = 1;
- *colb = 1;
- }
- if (cpart->temp>73.25&&cpart->temp<=173.15)
- {
- *colr = 1;
- *colg = 50;
- *colb = 1;
- }
- if (cpart->temp>=0&&cpart->temp<=73.15)
- {
- *colr = 1;
- *colg = 1;
- *colb = 50;
- }
- }
+
if ((cpart->tmp&0xFF)>0 && (cpart->tmp&0xFF)<PT_NUM)
{
//Create a temp. particle and do a subcall.
@@ -317,5 +281,47 @@ int graphics_PIPE(GRAPHICS_FUNC_ARGS)
//*colg = PIXG(ptypes[cpart->tmp&0xFF].pcolors);
//*colb = PIXB(ptypes[cpart->tmp&0xFF].pcolors);
}
+ else
+ {
+ if (cpart->ctype==2)
+ {
+ *colr = 50;
+ *colg = 1;
+ *colb = 1;
+ }
+ else if (cpart->ctype==3)
+ {
+ *colr = 1;
+ *colg = 50;
+ *colb = 1;
+ }
+ else if (cpart->ctype==4)
+ {
+ *colr = 1;
+ *colg = 1;
+ *colb = 50;
+ }
+ else if (cpart->temp<272.15&&cpart->ctype!=1)
+ {
+ if (cpart->temp>173.25&&cpart->temp<273.15)
+ {
+ *colr = 50;
+ *colg = 1;
+ *colb = 1;
+ }
+ if (cpart->temp>73.25&&cpart->temp<=173.15)
+ {
+ *colr = 1;
+ *colg = 50;
+ *colb = 1;
+ }
+ if (cpart->temp>=0&&cpart->temp<=73.15)
+ {
+ *colr = 1;
+ *colg = 1;
+ *colb = 50;
+ }
+ }
+ }
return 0;
}