Use RGB for constants and gradients, other misc changes

This commit is contained in:
catsoften 2023-04-13 20:55:24 -04:00 committed by Tamás Bálint Misius
parent bc085705a8
commit a715f5d71a
221 changed files with 354 additions and 382 deletions

View File

@ -1130,7 +1130,7 @@ void GameSave::readOPS(const std::vector<char> &data)
if (particles[newIndex].tmp>=2 && savedVersion < 81) if (particles[newIndex].tmp>=2 && savedVersion < 81)
{ {
particles[newIndex].type = PT_EMBR; particles[newIndex].type = PT_EMBR;
particles[newIndex].ctype = Renderer::firwTableAt(particles[newIndex].tmp - 4); particles[newIndex].ctype = Renderer::firwTableAt(particles[newIndex].tmp - 4).Pack();
particles[newIndex].tmp = 1; particles[newIndex].tmp = 1;
} }
break; break;
@ -1224,8 +1224,8 @@ void GameSave::readOPS(const std::vector<char> &data)
{ {
particles[newIndex].tmp2 = particles[newIndex].tmp; particles[newIndex].tmp2 = particles[newIndex].tmp;
if (!particles[newIndex].dcolour) if (!particles[newIndex].dcolour)
particles[newIndex].dcolour = builtinGol[particles[newIndex].ctype].colour; particles[newIndex].dcolour = builtinGol[particles[newIndex].ctype].colour.Pack();
particles[newIndex].tmp = builtinGol[particles[newIndex].ctype].colour2; particles[newIndex].tmp = builtinGol[particles[newIndex].ctype].colour2.Pack();
} }
} }
} }
@ -1807,8 +1807,8 @@ void GameSave::readPSv(const std::vector<char> &dataVec)
if (particles[i-1].ctype >= 0 && particles[i-1].ctype < NGOL) if (particles[i-1].ctype >= 0 && particles[i-1].ctype < NGOL)
{ {
if (!particles[i-1].dcolour) if (!particles[i-1].dcolour)
particles[i-1].dcolour = builtinGol[particles[i-1].ctype].colour; particles[i-1].dcolour = builtinGol[particles[i-1].ctype].colour.Pack();
particles[i-1].tmp = builtinGol[particles[i-1].ctype].colour2; particles[i-1].tmp = builtinGol[particles[i-1].ctype].colour2.Pack();
} }
} }
if(ty==PT_LCRY){ if(ty==PT_LCRY){
@ -1856,7 +1856,7 @@ void GameSave::readPSv(const std::vector<char> &dataVec)
if (particles[i-1].type==PT_FIRW && particles[i-1].tmp>=2) if (particles[i-1].type==PT_FIRW && particles[i-1].tmp>=2)
{ {
particles[i-1].type = PT_EMBR; particles[i-1].type = PT_EMBR;
particles[i-1].ctype = Renderer::firwTableAt(particles[i-1].tmp-4); particles[i-1].ctype = Renderer::firwTableAt(particles[i-1].tmp-4).Pack();
particles[i-1].tmp = 1; particles[i-1].tmp = 1;
} }
} }

View File

@ -55,7 +55,7 @@ void ElementPopulationDebug::Draw()
auto barSize = int(count * scale - 0.5f); auto barSize = int(count * scale - 0.5f);
int barX = bars;//*2; int barX = bars;//*2;
auto colour = RGB<uint8_t>::Unpack(sim->elements[i].Colour); RGB<uint8_t> colour = sim->elements[i].Colour;
g->draw_line(xStart+barX, yBottom+3, xStart+barX, yBottom+2, colour.Red, colour.Green, colour.Blue, 255); g->draw_line(xStart+barX, yBottom+3, xStart+barX, yBottom+2, colour.Red, colour.Green, colour.Blue, 255);
if(sim->elementCount[i]) if(sim->elementCount[i])

View File

@ -464,9 +464,9 @@ bool Graphics::GradientStop::operator <(const GradientStop &other) const
return point < other.point; return point < other.point;
} }
std::vector<pixel> Graphics::Gradient(std::vector<GradientStop> stops, int resolution) std::vector<RGB<uint8_t>> Graphics::Gradient(std::vector<GradientStop> stops, int resolution)
{ {
std::vector<pixel> table(resolution, 0); std::vector<RGB<uint8_t>> table(resolution, 0x000000_rgb);
if (stops.size() >= 2) if (stops.size() >= 2)
{ {
std::sort(stops.begin(), stops.end()); std::sort(stops.begin(), stops.end());
@ -485,13 +485,7 @@ std::vector<pixel> Graphics::Gradient(std::vector<GradientStop> stops, int resol
auto &left = stops[stop]; auto &left = stops[stop];
auto &right = stops[stop + 1]; auto &right = stops[stop + 1];
auto f = (point - left.point) / (right.point - left.point); auto f = (point - left.point) / (right.point - left.point);
auto leftColor = RGB<uint8_t>::Unpack(left.color); table[i] = left.color.Blend(right.color.WithAlpha(f * 0xFF));
auto rightColor = RGB<uint8_t>::Unpack(right.color);
table[i] = RGB<uint8_t>(
int(int(leftColor.Red ) + (int(rightColor.Red ) - int(leftColor.Red )) * f),
int(int(leftColor.Green) + (int(rightColor.Green) - int(leftColor.Green)) * f),
int(int(leftColor.Blue ) + (int(rightColor.Blue ) - int(leftColor.Blue )) * f)
).Pack();
} }
} }
return table; return table;

View File

@ -84,12 +84,12 @@ public:
struct GradientStop struct GradientStop
{ {
pixel color; RGB<uint8_t> color;
float point; float point;
bool operator <(const GradientStop &other) const; bool operator <(const GradientStop &other) const;
}; };
static std::vector<pixel> Gradient(std::vector<GradientStop> stops, int resolution); static std::vector<RGB<uint8_t>> Gradient(std::vector<GradientStop> stops, int resolution);
//Font/text metrics //Font/text metrics
[[deprecated("Use TextSize().X")]] [[deprecated("Use TextSize().X")]]

View File

@ -19,8 +19,8 @@ std::unique_ptr<VideoBuffer> Renderer::WallIcon(int wallID, Vec2<int> size)
return nullptr; return nullptr;
wall_type const &wtype = wtypes[wallID]; wall_type const &wtype = wtypes[wallID];
RGB<uint8_t> primary = RGB<uint8_t>::Unpack(wtype.colour); RGB<uint8_t> primary = wtype.colour;
RGB<uint8_t> secondary = RGB<uint8_t>::Unpack(wtype.eglow); RGB<uint8_t> secondary = wtype.eglow;
auto texture = std::make_unique<VideoBuffer>(size); auto texture = std::make_unique<VideoBuffer>(size);
switch (wtype.drawstyle) switch (wtype.drawstyle)
@ -209,7 +209,7 @@ void Renderer::render_parts()
//Defaults //Defaults
pixel_mode = 0 | PMODE_FLAT; pixel_mode = 0 | PMODE_FLAT;
cola = 255; cola = 255;
auto colour = RGB<uint8_t>::Unpack(elements[t].Colour); RGB<uint8_t> colour = elements[t].Colour;
colr = colour.Red; colr = colour.Red;
colg = colour.Green; colg = colour.Green;
colb = colour.Blue; colb = colour.Blue;
@ -288,7 +288,7 @@ void Renderer::render_parts()
constexpr float min_temp = MIN_TEMP; constexpr float min_temp = MIN_TEMP;
constexpr float max_temp = MAX_TEMP; constexpr float max_temp = MAX_TEMP;
firea = 255; firea = 255;
auto color = RGB<uint8_t>::Unpack(heatTableAt(int((sim->parts[i].temp - min_temp) / (max_temp - min_temp) * 1024))); RGB<uint8_t> color = heatTableAt(int((sim->parts[i].temp - min_temp) / (max_temp - min_temp) * 1024));
firer = colr = color.Red; firer = colr = color.Red;
fireg = colg = color.Green; fireg = colg = color.Green;
fireb = colb = color.Blue; fireb = colb = color.Blue;
@ -436,7 +436,7 @@ void Renderer::render_parts()
} }
else if (cplayer->elem < PT_NUM && cplayer->elem > 0) else if (cplayer->elem < PT_NUM && cplayer->elem > 0)
{ {
auto elemColour = RGB<uint8_t>::Unpack(elements[cplayer->elem].Colour); RGB<uint8_t> elemColour = elements[cplayer->elem].Colour;
colr = elemColour.Red; colr = elemColour.Red;
colg = elemColour.Green; colg = elemColour.Green;
colb = elemColour.Blue; colb = elemColour.Blue;
@ -826,7 +826,7 @@ void Renderer::draw_air()
float (*hv)[XCELLS] = sim->air->hv; float (*hv)[XCELLS] = sim->air->hv;
float (*vx)[XCELLS] = sim->air->vx; float (*vx)[XCELLS] = sim->air->vx;
float (*vy)[XCELLS] = sim->air->vy; float (*vy)[XCELLS] = sim->air->vy;
auto c = RGB<uint8_t>(0, 0, 0); auto c = 0x000000_rgb;
for (y=0; y<YCELLS; y++) for (y=0; y<YCELLS; y++)
for (x=0; x<XCELLS; x++) for (x=0; x<XCELLS; x++)
{ {
@ -904,8 +904,8 @@ void Renderer::DrawWalls()
if (wt >= UI_WALLCOUNT) if (wt >= UI_WALLCOUNT)
continue; continue;
unsigned char powered = sim->emap[y][x]; unsigned char powered = sim->emap[y][x];
auto prgb = RGB<uint8_t>::Unpack(sim->wtypes[wt].colour); RGB<uint8_t> prgb = sim->wtypes[wt].colour;
auto grgb = RGB<uint8_t>::Unpack(sim->wtypes[wt].eglow); RGB<uint8_t> grgb = sim->wtypes[wt].eglow;
if (findingElement) if (findingElement)
{ {
@ -1125,10 +1125,10 @@ void Renderer::DrawWalls()
} }
} }
if (sim->wtypes[wt].eglow && powered) if (sim->wtypes[wt].eglow.Pack() && powered)
{ {
// glow if electrified // glow if electrified
auto glow = RGB<uint8_t>::Unpack(sim->wtypes[wt].eglow); RGB<uint8_t> glow = sim->wtypes[wt].eglow;
int alpha = 255; int alpha = 255;
int cr = (alpha*glow.Red + (255-alpha)*fire_r[y/CELL][x/CELL]) >> 8; int cr = (alpha*glow.Red + (255-alpha)*fire_r[y/CELL][x/CELL]) >> 8;
int cg = (alpha*glow.Green + (255-alpha)*fire_g[y/CELL][x/CELL]) >> 8; int cg = (alpha*glow.Green + (255-alpha)*fire_g[y/CELL][x/CELL]) >> 8;
@ -1191,7 +1191,7 @@ int HeatToColour(float temp)
{ {
constexpr float min_temp = MIN_TEMP; constexpr float min_temp = MIN_TEMP;
constexpr float max_temp = MAX_TEMP; constexpr float max_temp = MAX_TEMP;
auto color = RGB<uint8_t>::Unpack(Renderer::heatTableAt(int((temp - min_temp) / (max_temp - min_temp) * 1024))); RGB<uint8_t> color = Renderer::heatTableAt(int((temp - min_temp) / (max_temp - min_temp) * 1024));
color.Red *= 0.7f; color.Red *= 0.7f;
color.Green *= 0.7f; color.Green *= 0.7f;
color.Blue *= 0.7f; color.Blue *= 0.7f;

View File

@ -157,8 +157,8 @@ public:
~Renderer(); ~Renderer();
#define RENDERER_TABLE(name) \ #define RENDERER_TABLE(name) \
static std::vector<pixel> name; \ static std::vector<RGB<uint8_t>> name; \
static inline pixel name ## At(int index) \ static inline RGB<uint8_t> name ## At(int index) \
{ \ { \
auto size = int(name.size()); \ auto size = int(name.size()); \
if (index < 0) index = 0; \ if (index < 0) index = 0; \

View File

@ -20,14 +20,7 @@ void Renderer::RenderBegin()
{ {
for (int i = 0; i < VIDXRES*YRES; i++) for (int i = 0; i < VIDXRES*YRES; i++)
{ {
auto rgb = RGB<uint8_t>::Unpack(vid[i]); persistentVid[i] = RGB<uint8_t>::Unpack(vid[i]).Decay().Pack();
if (rgb.Red > 0)
rgb.Red--;
if (rgb.Green > 0)
rgb.Green--;
if (rgb.Blue > 0)
rgb.Blue--;
persistentVid[i] = rgb.Pack();
} }
} }
@ -141,15 +134,9 @@ void Renderer::render_gravlensing(pixel * source)
if(rx >= 0 && rx < XRES && ry >= 0 && ry < YRES && gx >= 0 && gx < XRES && gy >= 0 && gy < YRES && bx >= 0 && bx < XRES && by >= 0 && by < YRES) if(rx >= 0 && rx < XRES && ry >= 0 && ry < YRES && gx >= 0 && gx < XRES && gy >= 0 && gy < YRES && bx >= 0 && bx < XRES && by >= 0 && by < YRES)
{ {
auto t = RGB<uint8_t>::Unpack(dst[ny*(VIDXRES)+nx]); auto t = RGB<uint8_t>::Unpack(dst[ny*(VIDXRES)+nx]);
t.Red += RGB<uint8_t>::Unpack(src[ry*(VIDXRES)+rx]).Red; t.Red = std::min(0xFF, (int)RGB<uint8_t>::Unpack(src[ry*(VIDXRES)+rx]).Red + t.Red);
t.Green += RGB<uint8_t>::Unpack(src[gy*(VIDXRES)+gx]).Green; t.Green = std::min(0xFF, (int)RGB<uint8_t>::Unpack(src[gy*(VIDXRES)+gx]).Green + t.Green);
t.Blue += RGB<uint8_t>::Unpack(src[by*(VIDXRES)+bx]).Blue; t.Blue = std::min(0xFF, (int)RGB<uint8_t>::Unpack(src[by*(VIDXRES)+bx]).Blue + t.Blue);
if (t.Red > 255)
t.Red = 255;
if (t.Green > 255)
t.Green = 255;
if (t.Blue > 255)
t.Blue = 255;
dst[ny*(VIDXRES)+nx] = t.Pack(); dst[ny*(VIDXRES)+nx] = t.Pack();
} }
} }
@ -198,11 +185,11 @@ pixel Renderer::GetPixel(int x, int y)
return vid[(y*VIDXRES)+x]; return vid[(y*VIDXRES)+x];
} }
std::vector<pixel> Renderer::flameTable; std::vector<RGB<uint8_t>> Renderer::flameTable;
std::vector<pixel> Renderer::plasmaTable; std::vector<RGB<uint8_t>> Renderer::plasmaTable;
std::vector<pixel> Renderer::heatTable; std::vector<RGB<uint8_t>> Renderer::heatTable;
std::vector<pixel> Renderer::clfmTable; std::vector<RGB<uint8_t>> Renderer::clfmTable;
std::vector<pixel> Renderer::firwTable; std::vector<RGB<uint8_t>> Renderer::firwTable;
static bool tablesPopulated = false; static bool tablesPopulated = false;
static std::mutex tablesPopulatedMx; static std::mutex tablesPopulatedMx;
void Renderer::PopulateTables() void Renderer::PopulateTables()
@ -212,47 +199,47 @@ void Renderer::PopulateTables()
{ {
tablesPopulated = true; tablesPopulated = true;
flameTable = Graphics::Gradient({ flameTable = Graphics::Gradient({
{ 0x000000, 0.00f }, { 0x000000_rgb, 0.00f },
{ 0x60300F, 0.50f }, { 0x60300F_rgb, 0.50f },
{ 0xDFBF6F, 0.90f }, { 0xDFBF6F_rgb, 0.90f },
{ 0xAF9F0F, 1.00f }, { 0xAF9F0F_rgb, 1.00f },
}, 200); }, 200);
plasmaTable = Graphics::Gradient({ plasmaTable = Graphics::Gradient({
{ 0x000000, 0.00f }, { 0x000000_rgb, 0.00f },
{ 0x301040, 0.25f }, { 0x301040_rgb, 0.25f },
{ 0x301060, 0.50f }, { 0x301060_rgb, 0.50f },
{ 0xAFFFFF, 0.90f }, { 0xAFFFFF_rgb, 0.90f },
{ 0xAFFFFF, 1.00f }, { 0xAFFFFF_rgb, 1.00f },
}, 200); }, 200);
heatTable = Graphics::Gradient({ heatTable = Graphics::Gradient({
{ 0x2B00FF, 0.00f }, { 0x2B00FF_rgb, 0.00f },
{ 0x003CFF, 0.01f }, { 0x003CFF_rgb, 0.01f },
{ 0x00C0FF, 0.05f }, { 0x00C0FF_rgb, 0.05f },
{ 0x00FFEB, 0.08f }, { 0x00FFEB_rgb, 0.08f },
{ 0x00FF14, 0.19f }, { 0x00FF14_rgb, 0.19f },
{ 0x4BFF00, 0.25f }, { 0x4BFF00_rgb, 0.25f },
{ 0xC8FF00, 0.37f }, { 0xC8FF00_rgb, 0.37f },
{ 0xFFDC00, 0.45f }, { 0xFFDC00_rgb, 0.45f },
{ 0xFF0000, 0.71f }, { 0xFF0000_rgb, 0.71f },
{ 0xFF00DC, 1.00f }, { 0xFF00DC_rgb, 1.00f },
}, 1024); }, 1024);
clfmTable = Graphics::Gradient({ clfmTable = Graphics::Gradient({
{ 0x000000, 0.00f }, { 0x000000_rgb, 0.00f },
{ 0x0A0917, 0.10f }, { 0x0A0917_rgb, 0.10f },
{ 0x19163C, 0.20f }, { 0x19163C_rgb, 0.20f },
{ 0x28285E, 0.30f }, { 0x28285E_rgb, 0.30f },
{ 0x343E77, 0.40f }, { 0x343E77_rgb, 0.40f },
{ 0x49769A, 0.60f }, { 0x49769A_rgb, 0.60f },
{ 0x57A0B4, 0.80f }, { 0x57A0B4_rgb, 0.80f },
{ 0x5EC4C6, 1.00f }, { 0x5EC4C6_rgb, 1.00f },
}, 200); }, 200);
firwTable = Graphics::Gradient({ firwTable = Graphics::Gradient({
{ 0xFF00FF, 0.00f }, { 0xFF00FF_rgb, 0.00f },
{ 0x0000FF, 0.20f }, { 0x0000FF_rgb, 0.20f },
{ 0x00FFFF, 0.40f }, { 0x00FFFF_rgb, 0.40f },
{ 0x00FF00, 0.60f }, { 0x00FF00_rgb, 0.60f },
{ 0xFFFF00, 0.80f }, { 0xFFFF00_rgb, 0.80f },
{ 0xFF0000, 1.00f }, { 0xFF0000_rgb, 1.00f },
}, 200); }, 200);
} }
} }

View File

@ -270,19 +270,19 @@ void GameModel::BuildMenus()
Tool * tempTool; Tool * tempTool;
if(i == PT_LIGH) if(i == PT_LIGH)
{ {
tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, RGB<uint8_t>::Unpack(sim->elements[i].Colour), sim->elements[i].Identifier, sim->elements[i].IconGenerator); tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, sim->elements[i].Colour, sim->elements[i].Identifier, sim->elements[i].IconGenerator);
} }
else if(i == PT_TESC) else if(i == PT_TESC)
{ {
tempTool = new Element_TESC_Tool(i, sim->elements[i].Name, sim->elements[i].Description, RGB<uint8_t>::Unpack(sim->elements[i].Colour), sim->elements[i].Identifier, sim->elements[i].IconGenerator); tempTool = new Element_TESC_Tool(i, sim->elements[i].Name, sim->elements[i].Description, sim->elements[i].Colour, sim->elements[i].Identifier, sim->elements[i].IconGenerator);
} }
else if(i == PT_STKM || i == PT_FIGH || i == PT_STKM2) else if(i == PT_STKM || i == PT_FIGH || i == PT_STKM2)
{ {
tempTool = new PlopTool(i, sim->elements[i].Name, sim->elements[i].Description, RGB<uint8_t>::Unpack(sim->elements[i].Colour), sim->elements[i].Identifier, sim->elements[i].IconGenerator); tempTool = new PlopTool(i, sim->elements[i].Name, sim->elements[i].Description, sim->elements[i].Colour, sim->elements[i].Identifier, sim->elements[i].IconGenerator);
} }
else else
{ {
tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, RGB<uint8_t>::Unpack(sim->elements[i].Colour), sim->elements[i].Identifier, sim->elements[i].IconGenerator); tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, sim->elements[i].Colour, sim->elements[i].Identifier, sim->elements[i].IconGenerator);
} }
if (sim->elements[i].MenuSection >= 0 && sim->elements[i].MenuSection < SC_TOTAL && sim->elements[i].MenuVisible) if (sim->elements[i].MenuSection >= 0 && sim->elements[i].MenuSection < SC_TOTAL && sim->elements[i].MenuVisible)
@ -300,7 +300,7 @@ void GameModel::BuildMenus()
//Build menu for GOL types //Build menu for GOL types
for(int i = 0; i < NGOL; i++) for(int i = 0; i < NGOL; i++)
{ {
Tool * tempTool = new ElementTool(PT_LIFE|PMAPID(i), builtinGol[i].name, builtinGol[i].description, RGB<uint8_t>::Unpack(builtinGol[i].colour), "DEFAULT_PT_LIFE_"+builtinGol[i].name.ToAscii()); Tool * tempTool = new ElementTool(PT_LIFE|PMAPID(i), builtinGol[i].name, builtinGol[i].description, builtinGol[i].colour, "DEFAULT_PT_LIFE_"+builtinGol[i].name.ToAscii());
menuList[SC_LIFE]->AddTool(tempTool); menuList[SC_LIFE]->AddTool(tempTool);
} }
{ {
@ -362,7 +362,7 @@ void GameModel::BuildMenus()
//Build other menus from wall data //Build other menus from wall data
for(int i = 0; i < UI_WALLCOUNT; i++) for(int i = 0; i < UI_WALLCOUNT; i++)
{ {
Tool * tempTool = new WallTool(i, sim->wtypes[i].descs, RGB<uint8_t>::Unpack(sim->wtypes[i].colour), sim->wtypes[i].identifier, sim->wtypes[i].textureGen); Tool * tempTool = new WallTool(i, sim->wtypes[i].descs, sim->wtypes[i].colour, sim->wtypes[i].identifier, sim->wtypes[i].textureGen);
menuList[SC_WALL]->AddTool(tempTool); menuList[SC_WALL]->AddTool(tempTool);
//sim->wtypes[i] //sim->wtypes[i]
} }
@ -374,7 +374,7 @@ void GameModel::BuildMenus()
i, i,
sim->tools[i].Name, sim->tools[i].Name,
sim->tools[i].Description, sim->tools[i].Description,
RGB<uint8_t>::Unpack(sim->tools[i].Colour), sim->tools[i].Colour,
sim->tools[i].Identifier sim->tools[i].Identifier
); );
menuList[SC_TOOL]->AddTool(tempTool); menuList[SC_TOOL]->AddTool(tempTool);

View File

@ -68,8 +68,8 @@ void Slider::SetColour(Colour col1, Colour col2)
this->col1 = col1; this->col1 = col1;
this->col2 = col2; this->col2 = col2;
bgGradient = Graphics::Gradient({ bgGradient = Graphics::Gradient({
{ RGB<uint8_t>(col1.Red, col1.Green, col1.Blue).Pack(), 0.f }, { RGB<uint8_t>(col1.Red, col1.Green, col1.Blue), 0.f },
{ RGB<uint8_t>(col2.Red, col2.Green, col2.Blue).Pack(), 1.f }, { RGB<uint8_t>(col2.Red, col2.Green, col2.Blue), 1.f },
}, Size.X-7); }, Size.X-7);
} }
@ -112,7 +112,7 @@ void Slider::Draw(const Point& screenPos)
{ {
for (int i = 3; i < Size.X-7; i++) for (int i = 3; i < Size.X-7; i++)
{ {
auto color = RGB<uint8_t>::Unpack(bgGradient[i - 3]); RGB<uint8_t> color = bgGradient[i - 3];
g->blendpixel(screenPos.X+i+2, screenPos.Y+j+2, color.Red, color.Green, color.Blue, 255); g->blendpixel(screenPos.X+i+2, screenPos.Y+j+2, color.Red, color.Green, color.Blue, 255);
} }
} }

View File

@ -10,7 +10,7 @@ class Slider : public ui::Component
int sliderSteps; int sliderSteps;
int sliderPosition; int sliderPosition;
bool isMouseDown; bool isMouseDown;
std::vector<pixel> bgGradient; std::vector<RGB<uint8_t>> bgGradient;
struct SliderAction struct SliderAction
{ {

View File

@ -1865,19 +1865,10 @@ int LuaScriptInterface::simulation_decoColor(lua_State * l)
color = RGBA<uint8_t>::Unpack(luaL_optnumber(l, 1, 0xFFFF0000)); color = RGBA<uint8_t>::Unpack(luaL_optnumber(l, 1, 0xFFFF0000));
else else
{ {
color.Red = luaL_optint(l, 1, 255); color.Red = std::clamp(luaL_optint(l, 1, 255), 0, 255);
color.Green = luaL_optint(l, 2, 255); color.Green = std::clamp(luaL_optint(l, 2, 255), 0, 255);
color.Blue = luaL_optint(l, 3, 255); color.Blue = std::clamp(luaL_optint(l, 3, 255), 0, 255);
color.Alpha = luaL_optint(l, 4, 255); color.Alpha = std::clamp(luaL_optint(l, 4, 255), 0, 255);
if (color.Red < 0) color.Red = 0;
if (color.Red > 255) color.Red = 255;
if (color.Green < 0) color.Green = 0;
if (color.Green > 255) color.Green = 255;
if (color.Blue < 0) color.Blue = 0;
if (color.Blue > 255) color.Blue = 255;
if (color.Alpha < 0) color.Alpha = 0;
if (color.Alpha > 255) color.Alpha = 255;
} }
luacon_model->SetColourSelectorColour(ui::Colour(color.Red, color.Green, color.Blue, color.Alpha)); luacon_model->SetColourSelectorColour(ui::Colour(color.Red, color.Green, color.Blue, color.Alpha));
return 0; return 0;

View File

@ -8,7 +8,7 @@ struct BuiltinGOL
String name; String name;
int oldtype; int oldtype;
int ruleset; int ruleset;
pixel colour, colour2; RGB<uint8_t> colour, colour2;
int goltype; int goltype;
String description; String description;
}; };

View File

@ -4,7 +4,7 @@
Element::Element(): Element::Element():
Identifier("DEFAULT_INVALID"), Identifier("DEFAULT_INVALID"),
Name(""), Name(""),
Colour(0xFF00FF_rgb .Pack()), Colour(0xFF00FF_rgb),
MenuVisible(0), MenuVisible(0),
MenuSection(0), MenuSection(0),
Enabled(0), Enabled(0),

View File

@ -15,7 +15,7 @@ class Element
public: public:
ByteString Identifier; ByteString Identifier;
String Name; String Name;
pixel Colour; RGB<uint8_t> Colour;
int MenuVisible; int MenuVisible;
int MenuSection; int MenuSection;
int Enabled; int Enabled;

View File

@ -10,7 +10,7 @@
SimTool::SimTool(): SimTool::SimTool():
Identifier("DEFAULT_TOOL_INVALID"), Identifier("DEFAULT_TOOL_INVALID"),
Name(""), Name(""),
Colour(0xFFFFFF_rgb .Pack()), Colour(0xFFFFFF_rgb),
Description("NULL Tool, does NOTHING") Description("NULL Tool, does NOTHING")
{ {
} }

View File

@ -9,7 +9,7 @@ class SimTool
public: public:
ByteString Identifier; ByteString Identifier;
String Name; String Name;
pixel Colour; RGB<uint8_t> Colour;
String Description; String Description;
int (*Perform)(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength); int (*Perform)(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength);

View File

@ -2135,13 +2135,13 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
{ {
int colr, colg, colb; int colr, colg, colb;
int sandcolourToUse = p == -2 ? sandcolour_interface : sandcolour; int sandcolourToUse = p == -2 ? sandcolour_interface : sandcolour;
auto colour = RGB<uint8_t>::Unpack(elements[t].Colour); RGB<uint8_t> colour = elements[t].Colour;
colr = colour.Red + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); colr = colour.Red + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15);
colg = colour.Green + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); colg = colour.Green + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15);
colb = colour.Blue + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); colb = colour.Blue + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15);
colr = colr>255 ? 255 : (colr<0 ? 0 : colr); colr = std::clamp(colr, 0, 255);
colg = colg>255 ? 255 : (colg<0 ? 0 : colg); colg = std::clamp(colg, 0, 255);
colb = colb>255 ? 255 : (colb<0 ? 0 : colb); colb = std::clamp(colb, 0, 255);
parts[i].dcolour = (rng.between(0, 149)<<24) | (colr<<16) | (colg<<8) | colb; parts[i].dcolour = (rng.between(0, 149)<<24) | (colr<<16) | (colg<<8) | colb;
} }

View File

@ -21,55 +21,55 @@ const BuiltinGOL builtinGol[NGOL] = {
// * the ruleset constants below look 20-bit, but rulesets actually consist of 21 // * the ruleset constants below look 20-bit, but rulesets actually consist of 21
// bits of data; bit 20 just happens to not be set for any of the built-in types, // bits of data; bit 20 just happens to not be set for any of the built-in types,
// as none of them have 10 or more states // as none of them have 10 or more states
{ "GOL", GT_GOL , 0x0080C, 0x0CAC00_rgb .Pack(), 0x0CAC00_rgb .Pack(), NGT_GOL, String("Game Of Life: Begin 3/Stay 23") }, { "GOL", GT_GOL , 0x0080C, 0x0CAC00_rgb, 0x0CAC00_rgb, NGT_GOL, String("Game Of Life: Begin 3/Stay 23") },
{ "HLIF", GT_HLIF, 0x0480C, 0xFF0000_rgb .Pack(), 0xFF0000_rgb .Pack(), NGT_HLIF, String("High Life: B36/S23") }, { "HLIF", GT_HLIF, 0x0480C, 0xFF0000_rgb, 0xFF0000_rgb, NGT_HLIF, String("High Life: B36/S23") },
{ "ASIM", GT_ASIM, 0x038F0, 0x0000FF_rgb .Pack(), 0x0000FF_rgb .Pack(), NGT_ASIM, String("Assimilation: B345/S4567") }, { "ASIM", GT_ASIM, 0x038F0, 0x0000FF_rgb, 0x0000FF_rgb, NGT_ASIM, String("Assimilation: B345/S4567") },
{ "2X2", GT_2x2 , 0x04826, 0xFFFF00_rgb .Pack(), 0xFFFF00_rgb .Pack(), NGT_2x2, String("2X2: B36/S125") }, { "2X2", GT_2x2 , 0x04826, 0xFFFF00_rgb, 0xFFFF00_rgb, NGT_2x2, String("2X2: B36/S125") },
{ "DANI", GT_DANI, 0x1C9D8, 0x00FFFF_rgb .Pack(), 0x00FFFF_rgb .Pack(), NGT_DANI, String("Day and Night: B3678/S34678") }, { "DANI", GT_DANI, 0x1C9D8, 0x00FFFF_rgb, 0x00FFFF_rgb, NGT_DANI, String("Day and Night: B3678/S34678") },
{ "AMOE", GT_AMOE, 0x0A92A, 0xFF00FF_rgb .Pack(), 0xFF00FF_rgb .Pack(), NGT_AMOE, String("Amoeba: B357/S1358") }, { "AMOE", GT_AMOE, 0x0A92A, 0xFF00FF_rgb, 0xFF00FF_rgb, NGT_AMOE, String("Amoeba: B357/S1358") },
{ "MOVE", GT_MOVE, 0x14834, 0xFFFFFF_rgb .Pack(), 0xFFFFFF_rgb .Pack(), NGT_MOVE, String("'Move' particles. Does not move things.. it is a life type: B368/S245") }, { "MOVE", GT_MOVE, 0x14834, 0xFFFFFF_rgb, 0xFFFFFF_rgb, NGT_MOVE, String("'Move' particles. Does not move things.. it is a life type: B368/S245") },
{ "PGOL", GT_PGOL, 0x0A90C, 0xE05010_rgb .Pack(), 0xE05010_rgb .Pack(), NGT_PGOL, String("Pseudo Life: B357/S238") }, { "PGOL", GT_PGOL, 0x0A90C, 0xE05010_rgb, 0xE05010_rgb, NGT_PGOL, String("Pseudo Life: B357/S238") },
{ "DMOE", GT_DMOE, 0x1E9E0, 0x500000_rgb .Pack(), 0x500000_rgb .Pack(), NGT_DMOE, String("Diamoeba: B35678/S5678") }, { "DMOE", GT_DMOE, 0x1E9E0, 0x500000_rgb, 0x500000_rgb, NGT_DMOE, String("Diamoeba: B35678/S5678") },
{ "3-4", GT_34 , 0x01818, 0x500050_rgb .Pack(), 0x500050_rgb .Pack(), NGT_34, String("3-4: B34/S34") }, { "3-4", GT_34 , 0x01818, 0x500050_rgb, 0x500050_rgb, NGT_34, String("3-4: B34/S34") },
{ "LLIF", GT_LLIF, 0x03820, 0x505050_rgb .Pack(), 0x505050_rgb .Pack(), NGT_LLIF, String("Long Life: B345/S5") }, { "LLIF", GT_LLIF, 0x03820, 0x505050_rgb, 0x505050_rgb, NGT_LLIF, String("Long Life: B345/S5") },
{ "STAN", GT_STAN, 0x1C9EC, 0x5000FF_rgb .Pack(), 0x5000FF_rgb .Pack(), NGT_STAN, String("Stains: B3678/S235678") }, { "STAN", GT_STAN, 0x1C9EC, 0x5000FF_rgb, 0x5000FF_rgb, NGT_STAN, String("Stains: B3678/S235678") },
{ "SEED", GT_SEED, 0x00400, 0xFBEC7D_rgb .Pack(), 0xFBEC7D_rgb .Pack(), NGT_SEED, String("Seeds: B2/S") }, { "SEED", GT_SEED, 0x00400, 0xFBEC7D_rgb, 0xFBEC7D_rgb, NGT_SEED, String("Seeds: B2/S") },
{ "MAZE", GT_MAZE, 0x0083E, 0xA8E4A0_rgb .Pack(), 0xA8E4A0_rgb .Pack(), NGT_MAZE, String("Maze: B3/S12345") }, { "MAZE", GT_MAZE, 0x0083E, 0xA8E4A0_rgb, 0xA8E4A0_rgb, NGT_MAZE, String("Maze: B3/S12345") },
{ "COAG", GT_COAG, 0x189EC, 0x9ACD32_rgb .Pack(), 0x9ACD32_rgb .Pack(), NGT_COAG, String("Coagulations: B378/S235678") }, { "COAG", GT_COAG, 0x189EC, 0x9ACD32_rgb, 0x9ACD32_rgb, NGT_COAG, String("Coagulations: B378/S235678") },
{ "WALL", GT_WALL, 0x1F03C, 0x0047AB_rgb .Pack(), 0x0047AB_rgb .Pack(), NGT_WALL, String("Walled cities: B45678/S2345") }, { "WALL", GT_WALL, 0x1F03C, 0x0047AB_rgb, 0x0047AB_rgb, NGT_WALL, String("Walled cities: B45678/S2345") },
{ "GNAR", GT_GNAR, 0x00202, 0xE5B73B_rgb .Pack(), 0xE5B73B_rgb .Pack(), NGT_GNAR, String("Gnarl: B1/S1") }, { "GNAR", GT_GNAR, 0x00202, 0xE5B73B_rgb, 0xE5B73B_rgb, NGT_GNAR, String("Gnarl: B1/S1") },
{ "REPL", GT_REPL, 0x0AAAA, 0x259588_rgb .Pack(), 0x259588_rgb .Pack(), NGT_REPL, String("Replicator: B1357/S1357") }, { "REPL", GT_REPL, 0x0AAAA, 0x259588_rgb, 0x259588_rgb, NGT_REPL, String("Replicator: B1357/S1357") },
{ "MYST", GT_MYST, 0x139E1, 0x0C3C00_rgb .Pack(), 0x0C3C00_rgb .Pack(), NGT_MYST, String("Mystery: B3458/S05678") }, { "MYST", GT_MYST, 0x139E1, 0x0C3C00_rgb, 0x0C3C00_rgb, NGT_MYST, String("Mystery: B3458/S05678") },
{ "LOTE", GT_LOTE, 0x48938, 0xFF0000_rgb .Pack(), 0xFFFF00_rgb .Pack(), NGT_LOTE, String("Living on the Edge: B37/S3458/4") }, { "LOTE", GT_LOTE, 0x48938, 0xFF0000_rgb, 0xFFFF00_rgb, NGT_LOTE, String("Living on the Edge: B37/S3458/4") },
{ "FRG2", GT_FRG2, 0x20816, 0x006432_rgb .Pack(), 0x00FF5A_rgb .Pack(), NGT_FRG2, String("Like Frogs rule: B3/S124/3") }, { "FRG2", GT_FRG2, 0x20816, 0x006432_rgb, 0x00FF5A_rgb, NGT_FRG2, String("Like Frogs rule: B3/S124/3") },
{ "STAR", GT_STAR, 0x98478, 0x000040_rgb .Pack(), 0x0000E6_rgb .Pack(), NGT_STAR, String("Like Star Wars rule: B278/S3456/6") }, { "STAR", GT_STAR, 0x98478, 0x000040_rgb, 0x0000E6_rgb, NGT_STAR, String("Like Star Wars rule: B278/S3456/6") },
{ "FROG", GT_FROG, 0x21806, 0x006400_rgb .Pack(), 0x00FF00_rgb .Pack(), NGT_FROG, String("Frogs: B34/S12/3") }, { "FROG", GT_FROG, 0x21806, 0x006400_rgb, 0x00FF00_rgb, NGT_FROG, String("Frogs: B34/S12/3") },
{ "BRAN", GT_BRAN, 0x25440, 0xFFFF00_rgb .Pack(), 0x969600_rgb .Pack(), NGT_BRAN, String("Brian 6: B246/S6/3" )} { "BRAN", GT_BRAN, 0x25440, 0xFFFF00_rgb, 0x969600_rgb, NGT_BRAN, String("Brian 6: B246/S6/3" )}
}; };
std::vector<wall_type> LoadWalls() std::vector<wall_type> LoadWalls()
{ {
return return
std::vector<wall_type>{ std::vector<wall_type>{
{0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 0, Renderer::WallIcon, String("ERASE"), "DEFAULT_WL_ERASE", String("Erases walls.")}, {0x808080_rgb, 0x000000_rgb, 0, Renderer::WallIcon, String("ERASE"), "DEFAULT_WL_ERASE", String("Erases walls.")},
{0xC0C0C0_rgb .Pack(), 0x101010_rgb .Pack(), 0, Renderer::WallIcon, String("CONDUCTIVE WALL"), "DEFAULT_WL_CNDTW", String("Blocks everything. Conductive.")}, {0xC0C0C0_rgb, 0x101010_rgb, 0, Renderer::WallIcon, String("CONDUCTIVE WALL"), "DEFAULT_WL_CNDTW", String("Blocks everything. Conductive.")},
{0x808080_rgb .Pack(), 0x808080_rgb .Pack(), 0, Renderer::WallIcon, String("EWALL"), "DEFAULT_WL_EWALL", String("E-Wall. Becomes transparent when electricity is connected.")}, {0x808080_rgb, 0x808080_rgb, 0, Renderer::WallIcon, String("EWALL"), "DEFAULT_WL_EWALL", String("E-Wall. Becomes transparent when electricity is connected.")},
{0xFF8080_rgb .Pack(), 0xFF2008_rgb .Pack(), 1, Renderer::WallIcon, String("DETECTOR"), "DEFAULT_WL_DTECT", String("Detector. Generates electricity when a particle is inside.")}, {0xFF8080_rgb, 0xFF2008_rgb, 1, Renderer::WallIcon, String("DETECTOR"), "DEFAULT_WL_DTECT", String("Detector. Generates electricity when a particle is inside.")},
{0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 0, Renderer::WallIcon, String("STREAMLINE"), "DEFAULT_WL_STRM", String("Streamline. Set start point of a streamline.")}, {0x808080_rgb, 0x000000_rgb, 0, Renderer::WallIcon, String("STREAMLINE"), "DEFAULT_WL_STRM", String("Streamline. Set start point of a streamline.")},
{0x8080FF_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("FAN"), "DEFAULT_WL_FAN", String("Fan. Accelerates air. Use the line tool to set direction and strength.")}, {0x8080FF_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("FAN"), "DEFAULT_WL_FAN", String("Fan. Accelerates air. Use the line tool to set direction and strength.")},
{0xC0C0C0_rgb .Pack(), 0x101010_rgb .Pack(), 2, Renderer::WallIcon, String("LIQUID WALL"), "DEFAULT_WL_LIQD", String("Allows liquids, blocks all other particles. Conductive.")}, {0xC0C0C0_rgb, 0x101010_rgb, 2, Renderer::WallIcon, String("LIQUID WALL"), "DEFAULT_WL_LIQD", String("Allows liquids, blocks all other particles. Conductive.")},
{0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("ABSORB WALL"), "DEFAULT_WL_ABSRB", String("Absorbs particles but lets air currents through.")}, {0x808080_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("ABSORB WALL"), "DEFAULT_WL_ABSRB", String("Absorbs particles but lets air currents through.")},
{0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 3, Renderer::WallIcon, String("WALL"), "DEFAULT_WL_WALL", String("Basic wall, blocks everything.")}, {0x808080_rgb, 0x000000_rgb, 3, Renderer::WallIcon, String("WALL"), "DEFAULT_WL_WALL", String("Basic wall, blocks everything.")},
{0x3C3C3C_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("AIRONLY WALL"), "DEFAULT_WL_AIR", String("Allows air, but blocks all particles.")}, {0x3C3C3C_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("AIRONLY WALL"), "DEFAULT_WL_AIR", String("Allows air, but blocks all particles.")},
{0x575757_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("POWDER WALL"), "DEFAULT_WL_POWDR", String("Allows powders, blocks all other particles.")}, {0x575757_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("POWDER WALL"), "DEFAULT_WL_POWDR", String("Allows powders, blocks all other particles.")},
{0xFFFF22_rgb .Pack(), 0x101010_rgb .Pack(), 2, Renderer::WallIcon, String("CONDUCTOR"), "DEFAULT_WL_CNDTR", String("Conductor. Allows all particles to pass through and conducts electricity.")}, {0xFFFF22_rgb, 0x101010_rgb, 2, Renderer::WallIcon, String("CONDUCTOR"), "DEFAULT_WL_CNDTR", String("Conductor. Allows all particles to pass through and conducts electricity.")},
{0x242424_rgb .Pack(), 0x101010_rgb .Pack(), 0, Renderer::WallIcon, String("EHOLE"), "DEFAULT_WL_EHOLE", String("E-Hole. absorbs particles, releases them when powered.")}, {0x242424_rgb, 0x101010_rgb, 0, Renderer::WallIcon, String("EHOLE"), "DEFAULT_WL_EHOLE", String("E-Hole. absorbs particles, releases them when powered.")},
{0x579777_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("GAS WALL"), "DEFAULT_WL_GAS", String("Allows gases, blocks all other particles.")}, {0x579777_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("GAS WALL"), "DEFAULT_WL_GAS", String("Allows gases, blocks all other particles.")},
{0xFFEE00_rgb .Pack(), 0xAA9900_rgb .Pack(), 4, Renderer::WallIcon, String("GRAVITY WALL"), "DEFAULT_WL_GRVTY", String("Gravity wall. Newtonian Gravity has no effect inside a box drawn with this.")}, {0xFFEE00_rgb, 0xAA9900_rgb, 4, Renderer::WallIcon, String("GRAVITY WALL"), "DEFAULT_WL_GRVTY", String("Gravity wall. Newtonian Gravity has no effect inside a box drawn with this.")},
{0xFFAA00_rgb .Pack(), 0xAA5500_rgb .Pack(), 4, Renderer::WallIcon, String("ENERGY WALL"), "DEFAULT_WL_ENRGY", String("Allows energy particles, blocks all other particles.")}, {0xFFAA00_rgb, 0xAA5500_rgb, 4, Renderer::WallIcon, String("ENERGY WALL"), "DEFAULT_WL_ENRGY", String("Allows energy particles, blocks all other particles.")},
{0xDCDCDC_rgb .Pack(), 0x000000_rgb .Pack(), 1, Renderer::WallIcon, String("AIRBLOCK WALL"), "DEFAULT_WL_NOAIR", String("Allows all particles, but blocks air.")}, {0xDCDCDC_rgb, 0x000000_rgb, 1, Renderer::WallIcon, String("AIRBLOCK WALL"), "DEFAULT_WL_NOAIR", String("Allows all particles, but blocks air.")},
{0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 0, Renderer::WallIcon, String("ERASEALL"), "DEFAULT_WL_ERASEA", String("Erases walls, particles, and signs.")}, {0x808080_rgb, 0x000000_rgb, 0, Renderer::WallIcon, String("ERASEALL"), "DEFAULT_WL_ERASEA", String("Erases walls, particles, and signs.")},
{0x800080_rgb .Pack(), 0x000000_rgb .Pack(), 0, Renderer::WallIcon, String("STASIS WALL"), "DEFAULT_WL_STASIS", String("Freezes particles inside the wall in place until powered.")}, {0x800080_rgb, 0x000000_rgb, 0, Renderer::WallIcon, String("STASIS WALL"), "DEFAULT_WL_STASIS", String("Freezes particles inside the wall in place until powered.")},
}; };
} }

View File

@ -7,8 +7,8 @@ class VideoBuffer;
struct wall_type struct wall_type
{ {
pixel colour; RGB<uint8_t> colour;
pixel eglow; // if emap set, add this to fire glow RGB<uint8_t> eglow; // if emap set, add this to fire glow
int drawstyle; int drawstyle;
std::unique_ptr<VideoBuffer> (*textureGen)(int, Vec2<int>); std::unique_ptr<VideoBuffer> (*textureGen)(int, Vec2<int>);
String name; String name;

View File

@ -7,7 +7,7 @@ void Element::Element_ACEL()
{ {
Identifier = "DEFAULT_PT_ACEL"; Identifier = "DEFAULT_PT_ACEL";
Name = "ACEL"; Name = "ACEL";
Colour = 0x0099CC_rgb .Pack(); Colour = 0x0099CC_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_ACID()
{ {
Identifier = "DEFAULT_PT_ACID"; Identifier = "DEFAULT_PT_ACID";
Name = "ACID"; Name = "ACID";
Colour = 0xED55FF_rgb .Pack(); Colour = 0xED55FF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_AMTR()
{ {
Identifier = "DEFAULT_PT_AMTR"; Identifier = "DEFAULT_PT_AMTR";
Name = "AMTR"; Name = "AMTR";
Colour = 0x808080_rgb .Pack(); Colour = 0x808080_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_ANAR()
{ {
Identifier = "DEFAULT_PT_ANAR"; Identifier = "DEFAULT_PT_ANAR";
Name = "ANAR"; Name = "ANAR";
Colour = 0xFFFFEE_rgb .Pack(); Colour = 0xFFFFEE_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_ARAY()
{ {
Identifier = "DEFAULT_PT_ARAY"; Identifier = "DEFAULT_PT_ARAY";
Name = "ARAY"; Name = "ARAY";
Colour = 0xFFBB00_rgb .Pack(); Colour = 0xFFBB00_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BANG()
{ {
Identifier = "DEFAULT_PT_BANG"; Identifier = "DEFAULT_PT_BANG";
Name = "TNT"; Name = "TNT";
Colour = 0xC05050_rgb .Pack(); Colour = 0xC05050_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BCLN()
{ {
Identifier = "DEFAULT_PT_BCLN"; Identifier = "DEFAULT_PT_BCLN";
Name = "BCLN"; Name = "BCLN";
Colour = 0xFFD040_rgb .Pack(); Colour = 0xFFD040_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BCOL()
{ {
Identifier = "DEFAULT_PT_BCOL"; Identifier = "DEFAULT_PT_BCOL";
Name = "BCOL"; Name = "BCOL";
Colour = 0x333333_rgb .Pack(); Colour = 0x333333_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_BGLA()
{ {
Identifier = "DEFAULT_PT_BGLA"; Identifier = "DEFAULT_PT_BGLA";
Name = "BGLA"; Name = "BGLA";
Colour = 0x606060_rgb .Pack(); Colour = 0x606060_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_BHOL()
{ {
Identifier = "DEFAULT_PT_BHOL"; Identifier = "DEFAULT_PT_BHOL";
Name = "VACU"; Name = "VACU";
Colour = 0x303030_rgb .Pack(); Colour = 0x303030_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BIZR()
{ {
Identifier = "DEFAULT_PT_BIZR"; Identifier = "DEFAULT_PT_BIZR";
Name = "BIZR"; Name = "BIZR";
Colour = 0x00FF77_rgb .Pack(); Colour = 0x00FF77_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BIZRG()
{ {
Identifier = "DEFAULT_PT_BIZRG"; Identifier = "DEFAULT_PT_BIZRG";
Name = "BIZG"; Name = "BIZG";
Colour = 0x00FFBB_rgb .Pack(); Colour = 0x00FFBB_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_CRACKER2; MenuSection = SC_CRACKER2;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BIZRS()
{ {
Identifier = "DEFAULT_PT_BIZRS"; Identifier = "DEFAULT_PT_BIZRS";
Name = "BIZS"; Name = "BIZS";
Colour = 0x00E455_rgb .Pack(); Colour = 0x00E455_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_CRACKER2; MenuSection = SC_CRACKER2;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BMTL()
{ {
Identifier = "DEFAULT_PT_BMTL"; Identifier = "DEFAULT_PT_BMTL";
Name = "BMTL"; Name = "BMTL";
Colour = 0x505070_rgb .Pack(); Colour = 0x505070_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BOMB()
{ {
Identifier = "DEFAULT_PT_BOMB"; Identifier = "DEFAULT_PT_BOMB";
Name = "BOMB"; Name = "BOMB";
Colour = 0xFFF288_rgb .Pack(); Colour = 0xFFF288_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BOYL()
{ {
Identifier = "DEFAULT_PT_BOYL"; Identifier = "DEFAULT_PT_BOYL";
Name = "BOYL"; Name = "BOYL";
Colour = 0x0A3200_rgb .Pack(); Colour = 0x0A3200_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BRAY()
{ {
Identifier = "DEFAULT_PT_BRAY"; Identifier = "DEFAULT_PT_BRAY";
Name = "BRAY"; Name = "BRAY";
Colour = 0xFFFFFF_rgb .Pack(); Colour = 0xFFFFFF_rgb;
MenuVisible = 0; MenuVisible = 0;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BRCK()
{ {
Identifier = "DEFAULT_PT_BRCK"; Identifier = "DEFAULT_PT_BRCK";
Name = "BRCK"; Name = "BRCK";
Colour = 0x808080_rgb .Pack(); Colour = 0x808080_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BREC()
{ {
Identifier = "DEFAULT_PT_BREC"; Identifier = "DEFAULT_PT_BREC";
Name = "BREL"; Name = "BREL";
Colour = 0x707060_rgb .Pack(); Colour = 0x707060_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BRMT()
{ {
Identifier = "DEFAULT_PT_BRMT"; Identifier = "DEFAULT_PT_BRMT";
Name = "BRMT"; Name = "BRMT";
Colour = 0x705060_rgb .Pack(); Colour = 0x705060_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_BTRY()
{ {
Identifier = "DEFAULT_PT_BTRY"; Identifier = "DEFAULT_PT_BTRY";
Name = "BTRY"; Name = "BTRY";
Colour = 0x858505_rgb .Pack(); Colour = 0x858505_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_BVBR()
{ {
Identifier = "DEFAULT_PT_BVBR"; Identifier = "DEFAULT_PT_BVBR";
Name = "BVBR"; Name = "BVBR";
Colour = 0x005000_rgb .Pack(); Colour = 0x005000_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_C5()
{ {
Identifier = "DEFAULT_PT_C5"; Identifier = "DEFAULT_PT_C5";
Name = "C-5"; Name = "C-5";
Colour = 0x2050E0_rgb .Pack(); Colour = 0x2050E0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_CAUS()
{ {
Identifier = "DEFAULT_PT_CAUS"; Identifier = "DEFAULT_PT_CAUS";
Name = "CAUS"; Name = "CAUS";
Colour = 0x80FFA0_rgb .Pack(); Colour = 0x80FFA0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_CBNW()
{ {
Identifier = "DEFAULT_PT_CBNW"; Identifier = "DEFAULT_PT_CBNW";
Name = "BUBW"; Name = "BUBW";
Colour = 0x2030D0_rgb .Pack(); Colour = 0x2030D0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_CFLM()
{ {
Identifier = "DEFAULT_PT_HFLM"; Identifier = "DEFAULT_PT_HFLM";
Name = "CFLM"; Name = "CFLM";
Colour = 0x8080FF_rgb .Pack(); Colour = 0x8080FF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;
@ -50,7 +50,7 @@ void Element::Element_CFLM()
static int graphics(GRAPHICS_FUNC_ARGS) static int graphics(GRAPHICS_FUNC_ARGS)
{ {
auto color = RGB<uint8_t>::Unpack(Renderer::clfmTableAt(cpart->life / 2)); RGB<uint8_t> color = Renderer::clfmTableAt(cpart->life / 2);
*colr = color.Red; *colr = color.Red;
*colg = color.Green; *colg = color.Green;
*colb = color.Blue; *colb = color.Blue;

View File

@ -6,7 +6,7 @@ void Element::Element_CLNE()
{ {
Identifier = "DEFAULT_PT_CLNE"; Identifier = "DEFAULT_PT_CLNE";
Name = "CLNE"; Name = "CLNE";
Colour = 0xFFD010_rgb .Pack(); Colour = 0xFFD010_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_CLST()
{ {
Identifier = "DEFAULT_PT_CLST"; Identifier = "DEFAULT_PT_CLST";
Name = "CLST"; Name = "CLST";
Colour = 0xE4A4A4_rgb .Pack(); Colour = 0xE4A4A4_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_CNCT()
{ {
Identifier = "DEFAULT_PT_CNCT"; Identifier = "DEFAULT_PT_CNCT";
Name = "CNCT"; Name = "CNCT";
Colour = 0xC0C0C0_rgb .Pack(); Colour = 0xC0C0C0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_CO2()
{ {
Identifier = "DEFAULT_PT_CO2"; Identifier = "DEFAULT_PT_CO2";
Name = "CO2"; Name = "CO2";
Colour = 0x666666_rgb .Pack(); Colour = 0x666666_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_COAL()
{ {
Identifier = "DEFAULT_PT_COAL"; Identifier = "DEFAULT_PT_COAL";
Name = "COAL"; Name = "COAL";
Colour = 0x222222_rgb .Pack(); Colour = 0x222222_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_CONV()
{ {
Identifier = "DEFAULT_PT_CONV"; Identifier = "DEFAULT_PT_CONV";
Name = "CONV"; Name = "CONV";
Colour = 0x0AAB0A_rgb .Pack(); Colour = 0x0AAB0A_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_CRAY()
{ {
Identifier = "DEFAULT_PT_CRAY"; Identifier = "DEFAULT_PT_CRAY";
Name = "CRAY"; Name = "CRAY";
Colour = 0xBBFF00_rgb .Pack(); Colour = 0xBBFF00_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_CRMC()
{ {
Identifier = "DEFAULT_PT_CRMC"; Identifier = "DEFAULT_PT_CRMC";
Name = "CRMC"; Name = "CRMC";
Colour = 0xD6D1D4_rgb .Pack(); Colour = 0xD6D1D4_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_DCEL()
{ {
Identifier = "DEFAULT_PT_DCEL"; Identifier = "DEFAULT_PT_DCEL";
Name = "DCEL"; Name = "DCEL";
Colour = 0x99CC00_rgb .Pack(); Colour = 0x99CC00_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_DESL()
{ {
Identifier = "DEFAULT_PT_DESL"; Identifier = "DEFAULT_PT_DESL";
Name = "DESL"; Name = "DESL";
Colour = 0x440000_rgb .Pack(); Colour = 0x440000_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_DEST()
{ {
Identifier = "DEFAULT_PT_DEST"; Identifier = "DEFAULT_PT_DEST";
Name = "DEST"; Name = "DEST";
Colour = 0xFF3311_rgb .Pack(); Colour = 0xFF3311_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_DEUT()
{ {
Identifier = "DEFAULT_PT_DEUT"; Identifier = "DEFAULT_PT_DEUT";
Name = "DEUT"; Name = "DEUT";
Colour = 0x00153F_rgb .Pack(); Colour = 0x00153F_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_DLAY()
{ {
Identifier = "DEFAULT_PT_DLAY"; Identifier = "DEFAULT_PT_DLAY";
Name = "DLAY"; Name = "DLAY";
Colour = 0x753590_rgb .Pack(); Colour = 0x753590_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWERED; MenuSection = SC_POWERED;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_DMG()
{ {
Identifier = "DEFAULT_PT_DMG"; Identifier = "DEFAULT_PT_DMG";
Name = "DMG"; Name = "DMG";
Colour = 0x88FF88_rgb .Pack(); Colour = 0x88FF88_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_DMND()
{ {
Identifier = "DEFAULT_PT_DMND"; Identifier = "DEFAULT_PT_DMND";
Name = "DMND"; Name = "DMND";
Colour = 0xCCFFFF_rgb .Pack(); Colour = 0xCCFFFF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_DRAY()
{ {
Identifier = "DEFAULT_PT_DRAY"; Identifier = "DEFAULT_PT_DRAY";
Name = "DRAY"; Name = "DRAY";
Colour = 0xFFAA22_rgb .Pack(); Colour = 0xFFAA22_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_DRIC()
{ {
Identifier = "DEFAULT_PT_DRIC"; Identifier = "DEFAULT_PT_DRIC";
Name = "DRIC"; Name = "DRIC";
Colour = 0xE0E0E0_rgb .Pack(); Colour = 0xE0E0E0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_DSTW()
{ {
Identifier = "DEFAULT_PT_DSTW"; Identifier = "DEFAULT_PT_DSTW";
Name = "DSTW"; Name = "DSTW";
Colour = 0x1020C0_rgb .Pack(); Colour = 0x1020C0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_DTEC()
{ {
Identifier = "DEFAULT_PT_DTEC"; Identifier = "DEFAULT_PT_DTEC";
Name = "DTEC"; Name = "DTEC";
Colour = 0xFD9D18_rgb .Pack(); Colour = 0xFD9D18_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SENSOR; MenuSection = SC_SENSOR;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_DUST()
{ {
Identifier = "DEFAULT_PT_DUST"; Identifier = "DEFAULT_PT_DUST";
Name = "DUST"; Name = "DUST";
Colour = 0xFFE0A0_rgb .Pack(); Colour = 0xFFE0A0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_DYST()
{ {
Identifier = "DEFAULT_PT_DYST"; Identifier = "DEFAULT_PT_DYST";
Name = "DYST"; Name = "DYST";
Colour = 0xBBB0A0_rgb .Pack(); Colour = 0xBBB0A0_rgb;
MenuVisible = 0; MenuVisible = 0;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_E116()
{ {
Identifier = "DEFAULT_PT_116"; Identifier = "DEFAULT_PT_116";
Name = "EQVE"; Name = "EQVE";
Colour = 0xFFE0A0_rgb .Pack(); Colour = 0xFFE0A0_rgb;
MenuVisible = 0; MenuVisible = 0;
MenuSection = SC_CRACKER2; MenuSection = SC_CRACKER2;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_E146()
{ {
Identifier = "DEFAULT_PT_146"; Identifier = "DEFAULT_PT_146";
Name = "BRAN"; Name = "BRAN";
Colour = 0xCCCC00_rgb .Pack(); Colour = 0xCCCC00_rgb;
MenuVisible = 0; MenuVisible = 0;
MenuSection = SC_LIFE; MenuSection = SC_LIFE;
Enabled = 0; Enabled = 0;

View File

@ -8,7 +8,7 @@ void Element::Element_ELEC()
{ {
Identifier = "DEFAULT_PT_ELEC"; Identifier = "DEFAULT_PT_ELEC";
Name = "ELEC"; Name = "ELEC";
Colour = 0xDFEFFF_rgb .Pack(); Colour = 0xDFEFFF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_EMBR()
{ {
Identifier = "DEFAULT_PT_EMBR"; Identifier = "DEFAULT_PT_EMBR";
Name = "EMBR"; Name = "EMBR";
Colour = 0xFFF288_rgb .Pack(); Colour = 0xFFF288_rgb;
MenuVisible = 0; MenuVisible = 0;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_EMP()
{ {
Identifier = "DEFAULT_PT_EMP"; Identifier = "DEFAULT_PT_EMP";
Name = "EMP"; Name = "EMP";
Colour = 0x66AAFF_rgb .Pack(); Colour = 0x66AAFF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_ETRD()
{ {
Identifier = "DEFAULT_PT_ETRD"; Identifier = "DEFAULT_PT_ETRD";
Name = "ETRD"; Name = "ETRD";
Colour = 0x404040_rgb .Pack(); Colour = 0x404040_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_ELEC; MenuSection = SC_ELEC;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_EXOT()
{ {
Identifier = "DEFAULT_PT_EXOT"; Identifier = "DEFAULT_PT_EXOT";
Name = "EXOT"; Name = "EXOT";
Colour = 0x247BFE_rgb .Pack(); Colour = 0x247BFE_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -15,7 +15,7 @@ void Element::Element_FIGH()
{ {
Identifier = "DEFAULT_PT_FIGH"; Identifier = "DEFAULT_PT_FIGH";
Name = "FIGH"; Name = "FIGH";
Colour = 0xFFE0A0_rgb .Pack(); Colour = 0xFFE0A0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SPECIAL; MenuSection = SC_SPECIAL;
Enabled = 1; Enabled = 1;

View File

@ -9,7 +9,7 @@ void Element::Element_FILT()
{ {
Identifier = "DEFAULT_PT_FILT"; Identifier = "DEFAULT_PT_FILT";
Name = "FILT"; Name = "FILT";
Colour = 0x000056_rgb .Pack(); Colour = 0x000056_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -10,7 +10,7 @@ void Element::Element_FIRE()
{ {
Identifier = "DEFAULT_PT_FIRE"; Identifier = "DEFAULT_PT_FIRE";
Name = "FIRE"; Name = "FIRE";
Colour = 0xFF1000_rgb .Pack(); Colour = 0xFF1000_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;
@ -353,7 +353,7 @@ static int updateLegacy(UPDATE_FUNC_ARGS)
static int graphics(GRAPHICS_FUNC_ARGS) static int graphics(GRAPHICS_FUNC_ARGS)
{ {
auto color = RGB<uint8_t>::Unpack(Renderer::flameTableAt(cpart->life)); RGB<uint8_t> color = Renderer::flameTableAt(cpart->life);
*colr = color.Red; *colr = color.Red;
*colg = color.Green; *colg = color.Green;
*colb = color.Blue; *colb = color.Blue;

View File

@ -7,7 +7,7 @@ void Element::Element_FIRW()
{ {
Identifier = "DEFAULT_PT_FIRW"; Identifier = "DEFAULT_PT_FIRW";
Name = "FIRW"; Name = "FIRW";
Colour = 0xFFA040_rgb .Pack(); Colour = 0xFFA040_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;
@ -87,7 +87,7 @@ static int update(UPDATE_FUNC_ARGS)
} }
else //if (parts[i].tmp>=2) else //if (parts[i].tmp>=2)
{ {
unsigned col = Renderer::firwTableAt(sim->rng.between(0, 199)); unsigned col = Renderer::firwTableAt(sim->rng.between(0, 199)).Pack();
for (int n=0; n<40; n++) for (int n=0; n<40; n++)
{ {
np = sim->create_part(-3, x, y, PT_EMBR); np = sim->create_part(-3, x, y, PT_EMBR);

View File

@ -6,7 +6,7 @@ void Element::Element_FOG()
{ {
Identifier = "DEFAULT_PT_FOG"; Identifier = "DEFAULT_PT_FOG";
Name = "FOG"; Name = "FOG";
Colour = 0xAAAAAA_rgb .Pack(); Colour = 0xAAAAAA_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FRAY()
{ {
Identifier = "DEFAULT_PT_FRAY"; Identifier = "DEFAULT_PT_FRAY";
Name = "FRAY"; Name = "FRAY";
Colour = 0x00BBFF_rgb .Pack(); Colour = 0x00BBFF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FRME()
{ {
Identifier = "DEFAULT_PT_FRME"; Identifier = "DEFAULT_PT_FRME";
Name = "FRME"; Name = "FRME";
Colour = 0x999988_rgb .Pack(); Colour = 0x999988_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FRZW()
{ {
Identifier = "DEFAULT_PT_FRZW"; Identifier = "DEFAULT_PT_FRZW";
Name = "FRZW"; Name = "FRZW";
Colour = 0x1020C0_rgb .Pack(); Colour = 0x1020C0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_CRACKER2; MenuSection = SC_CRACKER2;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FRZZ()
{ {
Identifier = "DEFAULT_PT_FRZZ"; Identifier = "DEFAULT_PT_FRZZ";
Name = "FRZZ"; Name = "FRZZ";
Colour = 0xC0E0FF_rgb .Pack(); Colour = 0xC0E0FF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FSEP()
{ {
Identifier = "DEFAULT_PT_FSEP"; Identifier = "DEFAULT_PT_FSEP";
Name = "FSEP"; Name = "FSEP";
Colour = 0x63AD5F_rgb .Pack(); Colour = 0x63AD5F_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_FUSE()
{ {
Identifier = "DEFAULT_PT_FUSE"; Identifier = "DEFAULT_PT_FUSE";
Name = "FUSE"; Name = "FUSE";
Colour = 0x0A5706_rgb .Pack(); Colour = 0x0A5706_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_FWRK()
{ {
Identifier = "DEFAULT_PT_FWRK"; Identifier = "DEFAULT_PT_FWRK";
Name = "FWRK"; Name = "FWRK";
Colour = 0x666666_rgb .Pack(); Colour = 0x666666_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_GAS()
{ {
Identifier = "DEFAULT_PT_GAS"; Identifier = "DEFAULT_PT_GAS";
Name = "GAS"; Name = "GAS";
Colour = 0xE0FF20_rgb .Pack(); Colour = 0xE0FF20_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_GBMB()
{ {
Identifier = "DEFAULT_PT_GBMB"; Identifier = "DEFAULT_PT_GBMB";
Name = "GBMB"; Name = "GBMB";
Colour = 0x1144BB_rgb .Pack(); Colour = 0x1144BB_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_FORCE; MenuSection = SC_FORCE;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_GEL()
{ {
Identifier = "DEFAULT_PT_GEL"; Identifier = "DEFAULT_PT_GEL";
Name = "GEL"; Name = "GEL";
Colour = 0xFF9900_rgb .Pack(); Colour = 0xFF9900_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_GLAS()
{ {
Identifier = "DEFAULT_PT_GLAS"; Identifier = "DEFAULT_PT_GLAS";
Name = "GLAS"; Name = "GLAS";
Colour = 0x404040_rgb .Pack(); Colour = 0x404040_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_GLOW()
{ {
Identifier = "DEFAULT_PT_GLOW"; Identifier = "DEFAULT_PT_GLOW";
Name = "GLOW"; Name = "GLOW";
Colour = 0x445464_rgb .Pack(); Colour = 0x445464_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_LIQUID; MenuSection = SC_LIQUID;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_GOLD()
{ {
Identifier = "DEFAULT_PT_GOLD"; Identifier = "DEFAULT_PT_GOLD";
Name = "GOLD"; Name = "GOLD";
Colour = 0xDCAD2C_rgb .Pack(); Colour = 0xDCAD2C_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_GOO()
{ {
Identifier = "DEFAULT_PT_GOO"; Identifier = "DEFAULT_PT_GOO";
Name = "GOO"; Name = "GOO";
Colour = 0x804000_rgb .Pack(); Colour = 0x804000_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_GPMP()
{ {
Identifier = "DEFAULT_PT_GPMP"; Identifier = "DEFAULT_PT_GPMP";
Name = "GPMP"; Name = "GPMP";
Colour = 0x0A3B3B_rgb .Pack(); Colour = 0x0A3B3B_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWERED; MenuSection = SC_POWERED;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_GRAV()
{ {
Identifier = "DEFAULT_PT_GRAV"; Identifier = "DEFAULT_PT_GRAV";
Name = "GRAV"; Name = "GRAV";
Colour = 0x202020_rgb .Pack(); Colour = 0x202020_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWDERS; MenuSection = SC_POWDERS;
Enabled = 1; Enabled = 1;

View File

@ -8,7 +8,7 @@ void Element::Element_GRVT()
{ {
Identifier = "DEFAULT_PT_GRVT"; Identifier = "DEFAULT_PT_GRVT";
Name = "GRVT"; Name = "GRVT";
Colour = 0x00EE76_rgb .Pack(); Colour = 0x00EE76_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_NUCLEAR; MenuSection = SC_NUCLEAR;
Enabled = 1; Enabled = 1;

View File

@ -4,7 +4,7 @@ void Element::Element_GUNP()
{ {
Identifier = "DEFAULT_PT_GUNP"; Identifier = "DEFAULT_PT_GUNP";
Name = "GUN"; Name = "GUN";
Colour = 0xC0C0D0_rgb .Pack(); Colour = 0xC0C0D0_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_EXPLOSIVE; MenuSection = SC_EXPLOSIVE;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_H2()
{ {
Identifier = "DEFAULT_PT_H2"; Identifier = "DEFAULT_PT_H2";
Name = "HYGN"; Name = "HYGN";
Colour = 0x5070FF_rgb .Pack(); Colour = 0x5070FF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_GAS; MenuSection = SC_GAS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_HEAC()
{ {
Identifier = "DEFAULT_PT_HEAC"; Identifier = "DEFAULT_PT_HEAC";
Name = "HEAC"; Name = "HEAC";
Colour = 0xCB6351_rgb .Pack(); Colour = 0xCB6351_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

View File

@ -7,7 +7,7 @@ void Element::Element_HSWC()
{ {
Identifier = "DEFAULT_PT_HSWC"; Identifier = "DEFAULT_PT_HSWC";
Name = "HSWC"; Name = "HSWC";
Colour = 0x3B0A0A_rgb .Pack(); Colour = 0x3B0A0A_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_POWERED; MenuSection = SC_POWERED;
Enabled = 1; Enabled = 1;

View File

@ -6,7 +6,7 @@ void Element::Element_ICEI()
{ {
Identifier = "DEFAULT_PT_ICEI"; Identifier = "DEFAULT_PT_ICEI";
Name = "ICE"; Name = "ICE";
Colour = 0xA0C0FF_rgb .Pack(); Colour = 0xA0C0FF_rgb;
MenuVisible = 1; MenuVisible = 1;
MenuSection = SC_SOLIDS; MenuSection = SC_SOLIDS;
Enabled = 1; Enabled = 1;

Some files were not shown because too many files have changed in this diff Show More