Skip to content

Commit aa7cbbf

Browse files
committed
CRAY can now mark PAPR
1 parent b5e778e commit aa7cbbf

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/simulation/elements/CRAY.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "simulation/ElementCommon.h"
22
#include "FILT.h"
3+
#include "PAPR.h"
34

45
static int update(UPDATE_FUNC_ARGS);
56
static bool ctypeDraw(CTYPEDRAW_FUNC_ARGS);
@@ -122,6 +123,21 @@ static int update(UPDATE_FUNC_ARGS)
122123
else if (colored==0xFF000000)
123124
colored = 0;
124125
parts[ID(r)].life = 4;
126+
} else if (TYP(r) == PT_PAPR) {
127+
if (TYP(parts[i].ctype == PT_COAL) || TYP(parts[i].ctype) == PT_BCOL) {
128+
sim->parts[ID(r)].life = 1;
129+
if (colored)
130+
sim->parts[ID(r)].dcolour = colored;
131+
else
132+
sim->parts[ID(r)].dcolour = MARK_COLOR_COAL;
133+
if(!--partsRemaining)
134+
docontinue = 0;
135+
} else if (TYP(parts[i].ctype == PT_SOAP)) {
136+
sim->parts[ID(r)].life = 0;
137+
sim->parts[ID(r)].dcolour = 0x00000000;
138+
if(!--partsRemaining)
139+
docontinue = 0;
140+
}
125141
} else if (TYP(r) == PT_CRAY || nostop) {
126142
docontinue = 1;
127143
} else if(destroy && r && (TYP(r) != PT_DMND)) {

src/simulation/elements/PAPR.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "simulation/ElementCommon.h"
2+
#include "PAPR.h"
23

34
static int update(UPDATE_FUNC_ARGS);
45
static int graphics(GRAPHICS_FUNC_ARGS);
@@ -86,7 +87,7 @@ static int update(UPDATE_FUNC_ARGS)
8687
// Get marked by BCOL
8788
case PT_BCOL:
8889
parts[i].life = 1;
89-
parts[i].dcolour = 0xFF22222A;
90+
parts[i].dcolour = MARK_COLOR_COAL;
9091
break;
9192

9293
// Acts as a smoke filter
@@ -205,7 +206,7 @@ static bool ctypeDraw(CTYPEDRAW_FUNC_ARGS)
205206
if (t == PT_BCOL || t == PT_COAL)
206207
{
207208
sim->parts[i].life = 1;
208-
sim->parts[i].dcolour = 0xFF22222A;
209+
sim->parts[i].dcolour = MARK_COLOR_COAL;
209210
}
210211
// Similarly, erase with SOAP
211212
if (t == PT_SOAP)

src/simulation/elements/PAPR.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
constexpr unsigned int MARK_COLOR_COAL = 0xFF22222A;

0 commit comments

Comments
 (0)