From bc085705a89b1f839fa6e3195dba4c341d94a72b Mon Sep 17 00:00:00 2001 From: catsoften Date: Tue, 11 Apr 2023 17:49:16 -0400 Subject: [PATCH] Remove deprecated PIXPACK/RGB/R/G/B functions --- src/debug/ElementPopulation.cpp | 12 +-- src/graphics/Graphics.cpp | 12 +-- src/graphics/Pixel.h | 26 ------ src/graphics/Renderer.cpp | 123 ++++++++++++++++------------- src/graphics/RendererBasic.cpp | 44 +++++------ src/gui/game/DecorationTool.cpp | 6 +- src/gui/interface/Slider.cpp | 8 +- src/gui/options/OptionsView.cpp | 4 +- src/lua/LuaScriptInterface.cpp | 39 +++++---- src/simulation/Editing.cpp | 8 +- src/simulation/Element.cpp | 2 +- src/simulation/SimTool.cpp | 2 +- src/simulation/Simulation.cpp | 9 ++- src/simulation/SimulationData.cpp | 86 ++++++++++---------- src/simulation/elements/ACEL.cpp | 2 +- src/simulation/elements/ACID.cpp | 2 +- src/simulation/elements/AMTR.cpp | 2 +- src/simulation/elements/ANAR.cpp | 2 +- src/simulation/elements/ARAY.cpp | 2 +- src/simulation/elements/BANG.cpp | 2 +- src/simulation/elements/BCLN.cpp | 2 +- src/simulation/elements/BCOL.cpp | 2 +- src/simulation/elements/BGLA.cpp | 2 +- src/simulation/elements/BHOL.cpp | 2 +- src/simulation/elements/BIZR.cpp | 2 +- src/simulation/elements/BIZRG.cpp | 2 +- src/simulation/elements/BIZRS.cpp | 2 +- src/simulation/elements/BMTL.cpp | 2 +- src/simulation/elements/BOMB.cpp | 2 +- src/simulation/elements/BOYL.cpp | 2 +- src/simulation/elements/BRAY.cpp | 2 +- src/simulation/elements/BRCK.cpp | 2 +- src/simulation/elements/BREC.cpp | 2 +- src/simulation/elements/BRMT.cpp | 2 +- src/simulation/elements/BTRY.cpp | 2 +- src/simulation/elements/BVBR.cpp | 2 +- src/simulation/elements/C5.cpp | 2 +- src/simulation/elements/CAUS.cpp | 2 +- src/simulation/elements/CBNW.cpp | 2 +- src/simulation/elements/CFLM.cpp | 10 +-- src/simulation/elements/CLNE.cpp | 2 +- src/simulation/elements/CLST.cpp | 2 +- src/simulation/elements/CNCT.cpp | 2 +- src/simulation/elements/CO2.cpp | 2 +- src/simulation/elements/COAL.cpp | 2 +- src/simulation/elements/CONV.cpp | 2 +- src/simulation/elements/CRAY.cpp | 2 +- src/simulation/elements/CRMC.cpp | 2 +- src/simulation/elements/DCEL.cpp | 2 +- src/simulation/elements/DESL.cpp | 2 +- src/simulation/elements/DEST.cpp | 2 +- src/simulation/elements/DEUT.cpp | 2 +- src/simulation/elements/DLAY.cpp | 2 +- src/simulation/elements/DMG.cpp | 2 +- src/simulation/elements/DMND.cpp | 2 +- src/simulation/elements/DRAY.cpp | 2 +- src/simulation/elements/DRIC.cpp | 2 +- src/simulation/elements/DSTW.cpp | 2 +- src/simulation/elements/DTEC.cpp | 2 +- src/simulation/elements/DUST.cpp | 2 +- src/simulation/elements/DYST.cpp | 2 +- src/simulation/elements/E116.cpp | 2 +- src/simulation/elements/E146.cpp | 2 +- src/simulation/elements/ELEC.cpp | 2 +- src/simulation/elements/EMBR.cpp | 2 +- src/simulation/elements/EMP.cpp | 2 +- src/simulation/elements/ETRD.cpp | 2 +- src/simulation/elements/EXOT.cpp | 2 +- src/simulation/elements/FIGH.cpp | 2 +- src/simulation/elements/FILT.cpp | 2 +- src/simulation/elements/FIRE.cpp | 10 +-- src/simulation/elements/FIRW.cpp | 2 +- src/simulation/elements/FOG.cpp | 2 +- src/simulation/elements/FRAY.cpp | 2 +- src/simulation/elements/FRME.cpp | 2 +- src/simulation/elements/FRZW.cpp | 2 +- src/simulation/elements/FRZZ.cpp | 2 +- src/simulation/elements/FSEP.cpp | 2 +- src/simulation/elements/FUSE.cpp | 2 +- src/simulation/elements/FWRK.cpp | 2 +- src/simulation/elements/GAS.cpp | 2 +- src/simulation/elements/GBMB.cpp | 2 +- src/simulation/elements/GEL.cpp | 2 +- src/simulation/elements/GLAS.cpp | 2 +- src/simulation/elements/GLOW.cpp | 2 +- src/simulation/elements/GOLD.cpp | 2 +- src/simulation/elements/GOO.cpp | 2 +- src/simulation/elements/GPMP.cpp | 2 +- src/simulation/elements/GRAV.cpp | 2 +- src/simulation/elements/GRVT.cpp | 2 +- src/simulation/elements/GUNP.cpp | 2 +- src/simulation/elements/H2.cpp | 2 +- src/simulation/elements/HEAC.cpp | 2 +- src/simulation/elements/HSWC.cpp | 2 +- src/simulation/elements/ICEI.cpp | 2 +- src/simulation/elements/IGNT.cpp | 2 +- src/simulation/elements/INSL.cpp | 2 +- src/simulation/elements/INST.cpp | 2 +- src/simulation/elements/INVIS.cpp | 2 +- src/simulation/elements/INWR.cpp | 2 +- src/simulation/elements/IRON.cpp | 2 +- src/simulation/elements/ISOZ.cpp | 2 +- src/simulation/elements/ISZS.cpp | 2 +- src/simulation/elements/LAVA.cpp | 2 +- src/simulation/elements/LCRY.cpp | 2 +- src/simulation/elements/LDTC.cpp | 2 +- src/simulation/elements/LIFE.cpp | 26 +++--- src/simulation/elements/LIGH.cpp | 2 +- src/simulation/elements/LITH.cpp | 10 +-- src/simulation/elements/LNTG.cpp | 2 +- src/simulation/elements/LO2.cpp | 2 +- src/simulation/elements/LOLZ.cpp | 2 +- src/simulation/elements/LOVE.cpp | 2 +- src/simulation/elements/LRBD.cpp | 2 +- src/simulation/elements/LSNS.cpp | 2 +- src/simulation/elements/MERC.cpp | 2 +- src/simulation/elements/METL.cpp | 2 +- src/simulation/elements/MORT.cpp | 2 +- src/simulation/elements/MWAX.cpp | 2 +- src/simulation/elements/NBHL.cpp | 2 +- src/simulation/elements/NBLE.cpp | 2 +- src/simulation/elements/NEUT.cpp | 2 +- src/simulation/elements/NICE.cpp | 2 +- src/simulation/elements/NITR.cpp | 2 +- src/simulation/elements/NONE.cpp | 2 +- src/simulation/elements/NSCN.cpp | 2 +- src/simulation/elements/NTCT.cpp | 2 +- src/simulation/elements/NWHL.cpp | 2 +- src/simulation/elements/O2.cpp | 2 +- src/simulation/elements/OIL.cpp | 2 +- src/simulation/elements/PBCN.cpp | 2 +- src/simulation/elements/PCLN.cpp | 2 +- src/simulation/elements/PHOT.cpp | 2 +- src/simulation/elements/PIPE.cpp | 12 ++- src/simulation/elements/PLEX.cpp | 2 +- src/simulation/elements/PLNT.cpp | 2 +- src/simulation/elements/PLSM.cpp | 10 +-- src/simulation/elements/PLUT.cpp | 2 +- src/simulation/elements/POLO.cpp | 2 +- src/simulation/elements/PPIP.cpp | 2 +- src/simulation/elements/PQRT.cpp | 2 +- src/simulation/elements/PROT.cpp | 2 +- src/simulation/elements/PRTI.cpp | 2 +- src/simulation/elements/PRTO.cpp | 2 +- src/simulation/elements/PSCN.cpp | 2 +- src/simulation/elements/PSNS.cpp | 2 +- src/simulation/elements/PSTE.cpp | 2 +- src/simulation/elements/PSTN.cpp | 2 +- src/simulation/elements/PSTS.cpp | 2 +- src/simulation/elements/PTCT.cpp | 2 +- src/simulation/elements/PTNM.cpp | 2 +- src/simulation/elements/PUMP.cpp | 2 +- src/simulation/elements/PVOD.cpp | 2 +- src/simulation/elements/QRTZ.cpp | 2 +- src/simulation/elements/RBDM.cpp | 2 +- src/simulation/elements/RFGL.cpp | 2 +- src/simulation/elements/RFRG.cpp | 2 +- src/simulation/elements/RIME.cpp | 2 +- src/simulation/elements/ROCK.cpp | 2 +- src/simulation/elements/RPEL.cpp | 2 +- src/simulation/elements/SALT.cpp | 2 +- src/simulation/elements/SAND.cpp | 2 +- src/simulation/elements/SAWD.cpp | 2 +- src/simulation/elements/SHLD1.cpp | 2 +- src/simulation/elements/SHLD2.cpp | 2 +- src/simulation/elements/SHLD3.cpp | 2 +- src/simulation/elements/SHLD4.cpp | 2 +- src/simulation/elements/SING.cpp | 2 +- src/simulation/elements/SLCN.cpp | 28 +++---- src/simulation/elements/SLTW.cpp | 2 +- src/simulation/elements/SMKE.cpp | 2 +- src/simulation/elements/SNOW.cpp | 2 +- src/simulation/elements/SOAP.cpp | 2 +- src/simulation/elements/SPAWN.cpp | 2 +- src/simulation/elements/SPAWN2.cpp | 2 +- src/simulation/elements/SPNG.cpp | 2 +- src/simulation/elements/SPRK.cpp | 2 +- src/simulation/elements/STKM.cpp | 2 +- src/simulation/elements/STKM2.cpp | 2 +- src/simulation/elements/STNE.cpp | 2 +- src/simulation/elements/STOR.cpp | 2 +- src/simulation/elements/SWCH.cpp | 2 +- src/simulation/elements/TESC.cpp | 2 +- src/simulation/elements/THDR.cpp | 2 +- src/simulation/elements/THRM.cpp | 2 +- src/simulation/elements/TRON.cpp | 2 +- src/simulation/elements/TSNS.cpp | 2 +- src/simulation/elements/TTAN.cpp | 2 +- src/simulation/elements/TUNG.cpp | 2 +- src/simulation/elements/URAN.cpp | 2 +- src/simulation/elements/VIBR.cpp | 2 +- src/simulation/elements/VINE.cpp | 2 +- src/simulation/elements/VIRS.cpp | 2 +- src/simulation/elements/VOID.cpp | 2 +- src/simulation/elements/VRSG.cpp | 2 +- src/simulation/elements/VRSS.cpp | 2 +- src/simulation/elements/VSNS.cpp | 2 +- src/simulation/elements/WARP.cpp | 2 +- src/simulation/elements/WATR.cpp | 2 +- src/simulation/elements/WAX.cpp | 2 +- src/simulation/elements/WHOL.cpp | 2 +- src/simulation/elements/WIFI.cpp | 2 +- src/simulation/elements/WIRE.cpp | 2 +- src/simulation/elements/WOOD.cpp | 2 +- src/simulation/elements/WTRV.cpp | 2 +- src/simulation/elements/YEST.cpp | 2 +- src/simulation/simtools/AIR.cpp | 2 +- src/simulation/simtools/AMBM.cpp | 2 +- src/simulation/simtools/AMBP.cpp | 2 +- src/simulation/simtools/COOL.cpp | 2 +- src/simulation/simtools/CYCL.cpp | 2 +- src/simulation/simtools/HEAT.cpp | 2 +- src/simulation/simtools/MIX.cpp | 2 +- src/simulation/simtools/NGRV.cpp | 2 +- src/simulation/simtools/PGRV.cpp | 2 +- src/simulation/simtools/VAC.cpp | 2 +- 216 files changed, 432 insertions(+), 445 deletions(-) diff --git a/src/debug/ElementPopulation.cpp b/src/debug/ElementPopulation.cpp index 9833b544e..7b08afc08 100644 --- a/src/debug/ElementPopulation.cpp +++ b/src/debug/ElementPopulation.cpp @@ -55,20 +55,22 @@ void ElementPopulationDebug::Draw() auto barSize = int(count * scale - 0.5f); int barX = bars;//*2; - g->draw_line(xStart+barX, yBottom+3, xStart+barX, yBottom+2, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), 255); + auto colour = RGB::Unpack(sim->elements[i].Colour); + + g->draw_line(xStart+barX, yBottom+3, xStart+barX, yBottom+2, colour.Red, colour.Green, colour.Blue, 255); if(sim->elementCount[i]) { if(barSize > 256) { barSize = 256; - g->blendpixel(xStart+barX, yBottom-barSize-3, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), 255); - g->blendpixel(xStart+barX, yBottom-barSize-5, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), 255); - g->blendpixel(xStart+barX, yBottom-barSize-7, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), 255); + g->blendpixel(xStart+barX, yBottom-barSize-3, colour.Red, colour.Green, colour.Blue, 255); + g->blendpixel(xStart+barX, yBottom-barSize-5, colour.Red, colour.Green, colour.Blue, 255); + g->blendpixel(xStart+barX, yBottom-barSize-7, colour.Red, colour.Green, colour.Blue, 255); } else { g->draw_line(xStart+barX, yBottom-barSize-3, xStart+barX, yBottom-barSize-2, 255, 255, 255, 180); } - g->draw_line(xStart+barX, yBottom-barSize, xStart+barX, yBottom, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), 255); + g->draw_line(xStart+barX, yBottom-barSize, xStart+barX, yBottom, colour.Red, colour.Green, colour.Blue, 255); } bars++; } diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index d4edf61e1..38ffb381d 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -485,11 +485,13 @@ std::vector Graphics::Gradient(std::vector stops, int resol auto &left = stops[stop]; auto &right = stops[stop + 1]; auto f = (point - left.point) / (right.point - left.point); - table[i] = PIXRGB( - int(int(PIXR(left.color)) + (int(PIXR(right.color)) - int(PIXR(left.color))) * f), - int(int(PIXG(left.color)) + (int(PIXG(right.color)) - int(PIXG(left.color))) * f), - int(int(PIXB(left.color)) + (int(PIXB(right.color)) - int(PIXB(left.color))) * f) - ); + auto leftColor = RGB::Unpack(left.color); + auto rightColor = RGB::Unpack(right.color); + table[i] = RGB( + 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; diff --git a/src/graphics/Pixel.h b/src/graphics/Pixel.h index 8ce888141..e9092938f 100644 --- a/src/graphics/Pixel.h +++ b/src/graphics/Pixel.h @@ -16,32 +16,6 @@ constexpr int PIXELCHANNELS = 3; // Use sparingly, e.g. when passing packed data to a third party library. typedef uint32_t pixel_rgba; -[[deprecated("Use 0x######_rgb .Pack()")]] -constexpr pixel PIXPACK(int x) -{ - return x; -} -[[deprecated("Use RGB(...).Pack()")]] -constexpr pixel PIXRGB(int r, int g, int b) -{ - return (r << 16) | (g << 8) | b; -} -[[deprecated("Use RGB::Unpack(...).Red")]] -constexpr int PIXR(pixel x) -{ - return (x >> 16) & 0xFF; -} -[[deprecated("Use RGB::Unpack(...).Green")]] -constexpr int PIXG(pixel x) -{ - return (x >> 8) & 0xFF; -} -[[deprecated("Use RGB::Unpack(...).Blue")]] -constexpr int PIXB(pixel x) -{ - return x & 0xFF; -} - template>> struct RGBA; diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index cc3ccf52e..3cc41b193 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -209,9 +209,10 @@ void Renderer::render_parts() //Defaults pixel_mode = 0 | PMODE_FLAT; cola = 255; - colr = PIXR(elements[t].Colour); - colg = PIXG(elements[t].Colour); - colb = PIXB(elements[t].Colour); + auto colour = RGB::Unpack(elements[t].Colour); + colr = colour.Red; + colg = colour.Green; + colb = colour.Blue; firer = fireg = fireb = firea = 0; deca = (sim->parts[i].dcolour>>24)&0xFF; @@ -287,10 +288,10 @@ void Renderer::render_parts() constexpr float min_temp = MIN_TEMP; constexpr float max_temp = MAX_TEMP; firea = 255; - auto color = heatTableAt(int((sim->parts[i].temp - min_temp) / (max_temp - min_temp) * 1024)); - firer = colr = PIXR(color); - fireg = colg = PIXG(color); - fireb = colb = PIXB(color); + auto color = RGB::Unpack(heatTableAt(int((sim->parts[i].temp - min_temp) / (max_temp - min_temp) * 1024))); + firer = colr = color.Red; + fireg = colg = color.Green; + fireb = colb = color.Blue; cola = 255; if(pixel_mode & (FIREMODE | PMODE_GLOW)) pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; @@ -317,9 +318,9 @@ void Renderer::render_parts() } else if(colour_mode & COLOUR_BASC) { - colr = PIXR(elements[t].Colour); - colg = PIXG(elements[t].Colour); - colb = PIXB(elements[t].Colour); + colr = colour.Red; + colg = colour.Green; + colb = colour.Blue; pixel_mode = PMODE_FLAT; } @@ -428,15 +429,17 @@ void Renderer::render_parts() { if (cplayer->fan) { - colr = PIXR(0x8080FF); - colg = PIXG(0x8080FF); - colb = PIXB(0x8080FF); + auto fanColor = 0x8080FF_rgb; + colr = fanColor.Red; + colg = fanColor.Green; + colb = fanColor.Blue; } else if (cplayer->elem < PT_NUM && cplayer->elem > 0) { - colr = PIXR(elements[cplayer->elem].Colour); - colg = PIXG(elements[cplayer->elem].Colour); - colb = PIXB(elements[cplayer->elem].Colour); + auto elemColour = RGB::Unpack(elements[cplayer->elem].Colour); + colr = elemColour.Red; + colg = elemColour.Green; + colb = elemColour.Blue; } else { @@ -524,7 +527,7 @@ void Renderer::render_parts() } if(pixel_mode & PMODE_FLAT) { - vid[ny*(VIDXRES)+nx] = PIXRGB(colr,colg,colb); + vid[ny*(VIDXRES)+nx] = RGB(colr, colg, colb).Pack(); } if(pixel_mode & PMODE_BLEND) { @@ -536,7 +539,7 @@ void Renderer::render_parts() } if(pixel_mode & PMODE_BLOB) { - vid[ny*(VIDXRES)+nx] = PIXRGB(colr,colg,colb); + vid[ny*(VIDXRES)+nx] = RGB(colr, colg, colb).Pack(); blendpixel(nx+1, ny, colr, colg, colb, 223); blendpixel(nx-1, ny, colr, colg, colb, 223); @@ -823,29 +826,29 @@ void Renderer::draw_air() float (*hv)[XCELLS] = sim->air->hv; float (*vx)[XCELLS] = sim->air->vx; float (*vy)[XCELLS] = sim->air->vy; - pixel c = 0; + auto c = RGB(0, 0, 0); for (y=0; y 0.0f) - c = PIXRGB(clamp_flt(pv[y][x], 0.0f, 8.0f), 0, 0);//positive pressure is red! + c = RGB(clamp_flt(pv[y][x], 0.0f, 8.0f), 0, 0);//positive pressure is red! else - c = PIXRGB(0, 0, clamp_flt(-pv[y][x], 0.0f, 8.0f));//negative pressure is blue! + c = RGB(0, 0, clamp_flt(-pv[y][x], 0.0f, 8.0f));//negative pressure is blue! } else if (display_mode & DISPLAY_AIRV) { - c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red + c = RGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red clamp_flt(pv[y][x], 0.0f, 8.0f),//pressure adds green clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue } else if (display_mode & DISPLAY_AIRH) { - c = HeatToColour(hv[y][x]); - //c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red + c = RGB::Unpack(HeatToColour(hv[y][x])); + //c = RGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red // clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green - // clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue + // clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f)).Pack();//vy adds blue } else if (display_mode & DISPLAY_AIRC) { @@ -865,7 +868,7 @@ void Renderer::draw_air() g=255; if (b>255) b=255; - c = PIXRGB(r, g, b); + c = RGB(r, g, b); } else { @@ -876,14 +879,18 @@ void Renderer::draw_air() g=255; if (b>255) b=255; - c = PIXRGB(r, g, b); + c = RGB(r, g, b); } } if (findingElement) - c = PIXRGB(PIXR(c)/10,PIXG(c)/10,PIXB(c)/10); + { + c.Red /= 10; + c.Green /= 10; + c.Blue /= 10; + } for (j=0; j= UI_WALLCOUNT) continue; unsigned char powered = sim->emap[y][x]; - pixel pc = PIXPACK(sim->wtypes[wt].colour); - pixel gc = PIXPACK(sim->wtypes[wt].eglow); + auto prgb = RGB::Unpack(sim->wtypes[wt].colour); + auto grgb = RGB::Unpack(sim->wtypes[wt].eglow); if (findingElement) { - pc = PIXRGB(PIXR(pc)/10,PIXG(pc)/10,PIXB(pc)/10); - gc = PIXRGB(PIXR(gc)/10,PIXG(gc)/10,PIXB(gc)/10); + prgb.Red /= 10; + prgb.Green /= 10; + prgb.Blue /= 10; + grgb.Red /= 10; + grgb.Green /= 10; + grgb.Blue /= 10; } + pixel pc = prgb.Pack(); + pixel gc = grgb.Pack(); + switch (sim->wtypes[wt].drawstyle) { case 0: @@ -935,7 +949,7 @@ void Renderer::DrawWalls() if (!((y*CELL+j)%2) && !((x*CELL+i)%2)) vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = pc; else - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x808080); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x808080_rgb .Pack(); } } else if (wt == WL_EHOLE) @@ -944,16 +958,16 @@ void Renderer::DrawWalls() { for (int j = 0; j < CELL; j++) for (int i = 0; i < CELL; i++) - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x242424); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x242424_rgb .Pack(); for (int j = 0; j < CELL; j += 2) for (int i = 0; i < CELL; i += 2) - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x000000); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x000000_rgb .Pack(); } else { for (int j = 0; j < CELL; j += 2) for (int i =0; i < CELL; i += 2) - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x242424); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x242424_rgb .Pack(); } } else if (wt == WL_STREAM) @@ -1023,7 +1037,7 @@ void Renderer::DrawWalls() else if (i == j+1 || (i == 0 && j == CELL-1)) vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = gc; else - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x202020); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x202020_rgb .Pack(); break; } @@ -1041,14 +1055,14 @@ void Renderer::DrawWalls() for (int j = 0; j < CELL; j++) for (int i =0; i < CELL; i++) if (i&j&1) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); } else { for (int j = 0; j < CELL; j++) for (int i = 0; i < CELL; i++) if (!(i&j&1)) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); } } else if (wt == WL_WALLELEC) @@ -1057,7 +1071,7 @@ void Renderer::DrawWalls() for (int i =0; i < CELL; i++) { if (!((y*CELL+j)%2) && !((x*CELL+i)%2)) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); else drawblob((x*CELL+i), (y*CELL+j), 0x80, 0x80, 0x80); } @@ -1072,7 +1086,7 @@ void Renderer::DrawWalls() for (int j = 0; j < CELL; j += 2) for (int i = 0; i < CELL; i += 2) // looks bad if drawing black blobs - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x000000); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x000000_rgb .Pack(); } else { @@ -1085,28 +1099,28 @@ void Renderer::DrawWalls() case 1: for (int j = 0; j < CELL; j += 2) for (int i = (j>>1)&1; i < CELL; i += 2) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); break; case 2: for (int j = 0; j < CELL; j += 2) for (int i = 0; i < CELL; i+=2) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); break; case 3: for (int j = 0; j < CELL; j++) for (int i = 0; i < CELL; i++) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); break; case 4: for (int j = 0; j < CELL; j++) for (int i = 0; i < CELL; i++) if (i == j) - drawblob((x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc)); + drawblob((x*CELL+i), (y*CELL+j), prgb.Red, prgb.Green, prgb.Blue); else if (i == j+1 || (i == 0 && j == CELL-1)) vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = gc; else // looks bad if drawing black blobs - vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = PIXPACK(0x202020); + vid[(y*CELL+j)*(VIDXRES)+(x*CELL+i)] = 0x202020_rgb .Pack(); break; } } @@ -1114,11 +1128,11 @@ void Renderer::DrawWalls() if (sim->wtypes[wt].eglow && powered) { // glow if electrified - pixel glow = sim->wtypes[wt].eglow; + auto glow = RGB::Unpack(sim->wtypes[wt].eglow); int alpha = 255; - int cr = (alpha*PIXR(glow) + (255-alpha)*fire_r[y/CELL][x/CELL]) >> 8; - int cg = (alpha*PIXG(glow) + (255-alpha)*fire_g[y/CELL][x/CELL]) >> 8; - int cb = (alpha*PIXB(glow) + (255-alpha)*fire_b[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 cb = (alpha*glow.Blue + (255-alpha)*fire_b[y/CELL][x/CELL]) >> 8; if (cr > 255) cr = 255; @@ -1177,6 +1191,9 @@ int HeatToColour(float temp) { constexpr float min_temp = MIN_TEMP; constexpr float max_temp = MAX_TEMP; - auto color = Renderer::heatTableAt(int((temp - min_temp) / (max_temp - min_temp) * 1024)); - return PIXRGB((int)(PIXR(color)*0.7f), (int)(PIXG(color)*0.7f), (int)(PIXB(color)*0.7f)); + auto color = RGB::Unpack(Renderer::heatTableAt(int((temp - min_temp) / (max_temp - min_temp) * 1024))); + color.Red *= 0.7f; + color.Green *= 0.7f; + color.Blue *= 0.7f; + return color.Pack(); } diff --git a/src/graphics/RendererBasic.cpp b/src/graphics/RendererBasic.cpp index 5a452d15b..de747a822 100644 --- a/src/graphics/RendererBasic.cpp +++ b/src/graphics/RendererBasic.cpp @@ -18,19 +18,16 @@ void Renderer::RenderBegin() if(display_mode & DISPLAY_PERS) { - int i,r,g,b; - for (i = 0; i < VIDXRES*YRES; i++) + for (int i = 0; i < VIDXRES*YRES; i++) { - r = PIXR(vid[i]); - g = PIXG(vid[i]); - b = PIXB(vid[i]); - if (r>0) - r--; - if (g>0) - g--; - if (b>0) - b--; - persistentVid[i] = PIXRGB(r,g,b); + auto rgb = RGB::Unpack(vid[i]); + if (rgb.Red > 0) + rgb.Red--; + if (rgb.Green > 0) + rgb.Green--; + if (rgb.Blue > 0) + rgb.Blue--; + persistentVid[i] = rgb.Pack(); } } @@ -126,7 +123,6 @@ void Renderer::render_gravlensing(pixel * source) { int nx, ny, rx, ry, gx, gy, bx, by, co; int r, g, b; - pixel t; pixel *src = source; pixel *dst = vid; if (!dst) @@ -144,17 +140,17 @@ void Renderer::render_gravlensing(pixel * source) by = (int)(ny-sim->gravy[co]+0.5f); 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) { - t = dst[ny*(VIDXRES)+nx]; - r = PIXR(src[ry*(VIDXRES)+rx]) + PIXR(t); - g = PIXG(src[gy*(VIDXRES)+gx]) + PIXG(t); - b = PIXB(src[by*(VIDXRES)+bx]) + PIXB(t); - if (r>255) - r = 255; - if (g>255) - g = 255; - if (b>255) - b = 255; - dst[ny*(VIDXRES)+nx] = PIXRGB(r,g,b); + auto t = RGB::Unpack(dst[ny*(VIDXRES)+nx]); + t.Red += RGB::Unpack(src[ry*(VIDXRES)+rx]).Red; + t.Green += RGB::Unpack(src[gy*(VIDXRES)+gx]).Green; + t.Blue += RGB::Unpack(src[by*(VIDXRES)+bx]).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(); } } } diff --git a/src/gui/game/DecorationTool.cpp b/src/gui/game/DecorationTool.cpp index b246a6fe1..cbd8cd703 100644 --- a/src/gui/game/DecorationTool.cpp +++ b/src/gui/game/DecorationTool.cpp @@ -54,11 +54,11 @@ void DecorationTool::DrawRect(Simulation * sim, Brush const &brush, ui::Point po void DecorationTool::DrawFill(Simulation * sim, Brush const &brush, ui::Point position) { - pixel loc = ren.vid[position.X+position.Y*WINDOWW]; + auto loc = RGB::Unpack(ren.vid[position.X+position.Y*WINDOWW]); if (ToolID == DECO_CLEAR) // TODO: this is actually const-correct - sim->ApplyDecorationFill(const_cast(&ren), position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc)); + sim->ApplyDecorationFill(const_cast(&ren), position.X, position.Y, 0, 0, 0, 0, loc.Red, loc.Green, loc.Blue); else - sim->ApplyDecorationFill(const_cast(&ren), position.X, position.Y, Colour.Red, Colour.Green, Colour.Blue, Colour.Alpha, PIXR(loc), PIXG(loc), PIXB(loc)); + sim->ApplyDecorationFill(const_cast(&ren), position.X, position.Y, Colour.Red, Colour.Green, Colour.Blue, Colour.Alpha, loc.Red, loc.Green, loc.Blue); } diff --git a/src/gui/interface/Slider.cpp b/src/gui/interface/Slider.cpp index 791244669..250372c66 100644 --- a/src/gui/interface/Slider.cpp +++ b/src/gui/interface/Slider.cpp @@ -68,8 +68,8 @@ void Slider::SetColour(Colour col1, Colour col2) this->col1 = col1; this->col2 = col2; bgGradient = Graphics::Gradient({ - { pixel(PIXRGB(col1.Red, col1.Green, col1.Blue)), 0.f }, - { pixel(PIXRGB(col2.Red, col2.Green, col2.Blue)), 1.f }, + { RGB(col1.Red, col1.Green, col1.Blue).Pack(), 0.f }, + { RGB(col2.Red, col2.Green, col2.Blue).Pack(), 1.f }, }, Size.X-7); } @@ -112,8 +112,8 @@ void Slider::Draw(const Point& screenPos) { for (int i = 3; i < Size.X-7; i++) { - auto color = bgGradient[i - 3]; - g->blendpixel(screenPos.X+i+2, screenPos.Y+j+2, PIXR(color), PIXG(color), PIXB(color), 255); + auto color = RGB::Unpack(bgGradient[i - 3]); + g->blendpixel(screenPos.X+i+2, screenPos.Y+j+2, color.Red, color.Green, color.Blue, 255); } } } diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index 221e4e4c8..72d7044d0 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -437,8 +437,8 @@ void OptionsView::UpdateAmbientAirTempPreview(float airTemp, bool isValid) { if (isValid) { - int c = HeatToColour(airTemp); - ambientAirTempPreview->Appearance.BackgroundInactive = ui::Colour(PIXR(c), PIXG(c), PIXB(c)); + auto c = RGB::Unpack(HeatToColour(airTemp)); + ambientAirTempPreview->Appearance.BackgroundInactive = ui::Colour(c.Red, c.Green, c.Blue); ambientAirTempPreview->SetText(""); } else diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index b5536bff6..a85286be8 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -1853,36 +1853,33 @@ int LuaScriptInterface::simulation_decoBox(lua_State * l) int LuaScriptInterface::simulation_decoColor(lua_State * l) { int acount = lua_gettop(l); - unsigned int color; + RGBA color(0, 0, 0, 0); if (acount == 0) { ui::Colour tempColor = luacon_model->GetColourSelectorColour(); - unsigned int color = (tempColor.Alpha << 24) | PIXRGB(tempColor.Red, tempColor.Green, tempColor.Blue); + unsigned int color = (tempColor.Alpha << 24) | RGB(tempColor.Red, tempColor.Green, tempColor.Blue).Pack(); lua_pushnumber(l, color); return 1; } else if (acount == 1) - color = (unsigned int)luaL_optnumber(l, 1, 0xFFFF0000); + color = RGBA::Unpack(luaL_optnumber(l, 1, 0xFFFF0000)); else { - int r, g, b, a; - r = luaL_optint(l, 1, 255); - g = luaL_optint(l, 2, 255); - b = luaL_optint(l, 3, 255); - a = luaL_optint(l, 4, 255); + color.Red = luaL_optint(l, 1, 255); + color.Green = luaL_optint(l, 2, 255); + color.Blue = luaL_optint(l, 3, 255); + color.Alpha = luaL_optint(l, 4, 255); - if (r < 0) r = 0; - if (r > 255) r = 255; - if (g < 0) g = 0; - if (g > 255) g = 255; - if (b < 0) b = 0; - if (b > 255) b = 255; - if (a < 0) a = 0; - if (a > 255) a = 255; - - color = (a << 24) + PIXRGB(r, g, b); + 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(PIXR(color), PIXG(color), PIXB(color), color >> 24)); + luacon_model->SetColourSelectorColour(ui::Colour(color.Red, color.Green, color.Blue, color.Alpha)); return 0; } @@ -1899,8 +1896,8 @@ int LuaScriptInterface::simulation_floodDeco(lua_State * l) return luaL_error(l, "coordinates out of range (%d,%d)", x, y); // hilariously broken, intersects with console and all Lua graphics - pixel loc = luacon_ren->vid[x + y * WINDOWW]; - luacon_sim->ApplyDecorationFill(luacon_ren, x, y, r, g, b, a, PIXR(loc), PIXG(loc), PIXB(loc)); + auto loc = RGB::Unpack(luacon_ren->vid[x + y * WINDOWW]); + luacon_sim->ApplyDecorationFill(luacon_ren, x, y, r, g, b, a, loc.Red, loc.Green, loc.Blue); return 0; } diff --git a/src/simulation/Editing.cpp b/src/simulation/Editing.cpp index 6a3be9e0f..5a98aade1 100644 --- a/src/simulation/Editing.cpp +++ b/src/simulation/Editing.cpp @@ -702,10 +702,10 @@ void Simulation::ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, in bool Simulation::ColorCompare(Renderer *ren, int x, int y, int replaceR, int replaceG, int replaceB) { - pixel pix = ren->vid[x+y*WINDOWW]; - int r = PIXR(pix); - int g = PIXG(pix); - int b = PIXB(pix); + auto pix = RGB::Unpack(ren->vid[x+y*WINDOWW]); + int r = pix.Red; + int g = pix.Green; + int b = pix.Blue; int diff = std::abs(replaceR-r) + std::abs(replaceG-g) + std::abs(replaceB-b); return diff < 15; } diff --git a/src/simulation/Element.cpp b/src/simulation/Element.cpp index b503cb9eb..2a0de039b 100644 --- a/src/simulation/Element.cpp +++ b/src/simulation/Element.cpp @@ -4,7 +4,7 @@ Element::Element(): Identifier("DEFAULT_INVALID"), Name(""), - Colour(PIXPACK(0xFF00FF)), + Colour(0xFF00FF_rgb .Pack()), MenuVisible(0), MenuSection(0), Enabled(0), diff --git a/src/simulation/SimTool.cpp b/src/simulation/SimTool.cpp index 8a813b3b9..a0e4629d4 100644 --- a/src/simulation/SimTool.cpp +++ b/src/simulation/SimTool.cpp @@ -10,7 +10,7 @@ SimTool::SimTool(): Identifier("DEFAULT_TOOL_INVALID"), Name(""), -Colour(PIXPACK(0xFFFFFF)), +Colour(0xFFFFFF_rgb .Pack()), Description("NULL Tool, does NOTHING") { } diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index e0393c6dc..238593256 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2134,10 +2134,11 @@ int Simulation::create_part(int p, int x, int y, int t, int v) if((elements[t].Properties & TYPE_PART) && pretty_powder) { int colr, colg, colb; - auto sandcolourToUse = p == -2 ? sandcolour_interface : sandcolour; - colr = PIXR(elements[t].Colour) + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); - colg = PIXG(elements[t].Colour) + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); - colb = PIXB(elements[t].Colour) + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); + int sandcolourToUse = p == -2 ? sandcolour_interface : sandcolour; + auto colour = RGB::Unpack(elements[t].Colour); + 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); + colb = colour.Blue + int(sandcolourToUse * 1.3) + rng.between(-20, 20) + rng.between(-15, 15); colr = colr>255 ? 255 : (colr<0 ? 0 : colr); colg = colg>255 ? 255 : (colg<0 ? 0 : colg); colb = colb>255 ? 255 : (colb<0 ? 0 : colb); diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index c646e9070..35261bfc0 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -21,55 +21,55 @@ const BuiltinGOL builtinGol[NGOL] = { // * 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, // as none of them have 10 or more states - { "GOL", GT_GOL , 0x0080C, PIXPACK(0x0CAC00), PIXPACK(0x0CAC00), NGT_GOL, String("Game Of Life: Begin 3/Stay 23") }, - { "HLIF", GT_HLIF, 0x0480C, PIXPACK(0xFF0000), PIXPACK(0xFF0000), NGT_HLIF, String("High Life: B36/S23") }, - { "ASIM", GT_ASIM, 0x038F0, PIXPACK(0x0000FF), PIXPACK(0x0000FF), NGT_ASIM, String("Assimilation: B345/S4567") }, - { "2X2", GT_2x2 , 0x04826, PIXPACK(0xFFFF00), PIXPACK(0xFFFF00), NGT_2x2, String("2X2: B36/S125") }, - { "DANI", GT_DANI, 0x1C9D8, PIXPACK(0x00FFFF), PIXPACK(0x00FFFF), NGT_DANI, String("Day and Night: B3678/S34678") }, - { "AMOE", GT_AMOE, 0x0A92A, PIXPACK(0xFF00FF), PIXPACK(0xFF00FF), NGT_AMOE, String("Amoeba: B357/S1358") }, - { "MOVE", GT_MOVE, 0x14834, PIXPACK(0xFFFFFF), PIXPACK(0xFFFFFF), NGT_MOVE, String("'Move' particles. Does not move things.. it is a life type: B368/S245") }, - { "PGOL", GT_PGOL, 0x0A90C, PIXPACK(0xE05010), PIXPACK(0xE05010), NGT_PGOL, String("Pseudo Life: B357/S238") }, - { "DMOE", GT_DMOE, 0x1E9E0, PIXPACK(0x500000), PIXPACK(0x500000), NGT_DMOE, String("Diamoeba: B35678/S5678") }, - { "3-4", GT_34 , 0x01818, PIXPACK(0x500050), PIXPACK(0x500050), NGT_34, String("3-4: B34/S34") }, - { "LLIF", GT_LLIF, 0x03820, PIXPACK(0x505050), PIXPACK(0x505050), NGT_LLIF, String("Long Life: B345/S5") }, - { "STAN", GT_STAN, 0x1C9EC, PIXPACK(0x5000FF), PIXPACK(0x5000FF), NGT_STAN, String("Stains: B3678/S235678") }, - { "SEED", GT_SEED, 0x00400, PIXPACK(0xFBEC7D), PIXPACK(0xFBEC7D), NGT_SEED, String("Seeds: B2/S") }, - { "MAZE", GT_MAZE, 0x0083E, PIXPACK(0xA8E4A0), PIXPACK(0xA8E4A0), NGT_MAZE, String("Maze: B3/S12345") }, - { "COAG", GT_COAG, 0x189EC, PIXPACK(0x9ACD32), PIXPACK(0x9ACD32), NGT_COAG, String("Coagulations: B378/S235678") }, - { "WALL", GT_WALL, 0x1F03C, PIXPACK(0x0047AB), PIXPACK(0x0047AB), NGT_WALL, String("Walled cities: B45678/S2345") }, - { "GNAR", GT_GNAR, 0x00202, PIXPACK(0xE5B73B), PIXPACK(0xE5B73B), NGT_GNAR, String("Gnarl: B1/S1") }, - { "REPL", GT_REPL, 0x0AAAA, PIXPACK(0x259588), PIXPACK(0x259588), NGT_REPL, String("Replicator: B1357/S1357") }, - { "MYST", GT_MYST, 0x139E1, PIXPACK(0x0C3C00), PIXPACK(0x0C3C00), NGT_MYST, String("Mystery: B3458/S05678") }, - { "LOTE", GT_LOTE, 0x48938, PIXPACK(0xFF0000), PIXPACK(0xFFFF00), NGT_LOTE, String("Living on the Edge: B37/S3458/4") }, - { "FRG2", GT_FRG2, 0x20816, PIXPACK(0x006432), PIXPACK(0x00FF5A), NGT_FRG2, String("Like Frogs rule: B3/S124/3") }, - { "STAR", GT_STAR, 0x98478, PIXPACK(0x000040), PIXPACK(0x0000E6), NGT_STAR, String("Like Star Wars rule: B278/S3456/6") }, - { "FROG", GT_FROG, 0x21806, PIXPACK(0x006400), PIXPACK(0x00FF00), NGT_FROG, String("Frogs: B34/S12/3") }, - { "BRAN", GT_BRAN, 0x25440, PIXPACK(0xFFFF00), PIXPACK(0x969600), NGT_BRAN, String("Brian 6: B246/S6/3" )} + { "GOL", GT_GOL , 0x0080C, 0x0CAC00_rgb .Pack(), 0x0CAC00_rgb .Pack(), 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") }, + { "ASIM", GT_ASIM, 0x038F0, 0x0000FF_rgb .Pack(), 0x0000FF_rgb .Pack(), NGT_ASIM, String("Assimilation: B345/S4567") }, + { "2X2", GT_2x2 , 0x04826, 0xFFFF00_rgb .Pack(), 0xFFFF00_rgb .Pack(), NGT_2x2, String("2X2: B36/S125") }, + { "DANI", GT_DANI, 0x1C9D8, 0x00FFFF_rgb .Pack(), 0x00FFFF_rgb .Pack(), NGT_DANI, String("Day and Night: B3678/S34678") }, + { "AMOE", GT_AMOE, 0x0A92A, 0xFF00FF_rgb .Pack(), 0xFF00FF_rgb .Pack(), 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") }, + { "PGOL", GT_PGOL, 0x0A90C, 0xE05010_rgb .Pack(), 0xE05010_rgb .Pack(), NGT_PGOL, String("Pseudo Life: B357/S238") }, + { "DMOE", GT_DMOE, 0x1E9E0, 0x500000_rgb .Pack(), 0x500000_rgb .Pack(), NGT_DMOE, String("Diamoeba: B35678/S5678") }, + { "3-4", GT_34 , 0x01818, 0x500050_rgb .Pack(), 0x500050_rgb .Pack(), NGT_34, String("3-4: B34/S34") }, + { "LLIF", GT_LLIF, 0x03820, 0x505050_rgb .Pack(), 0x505050_rgb .Pack(), NGT_LLIF, String("Long Life: B345/S5") }, + { "STAN", GT_STAN, 0x1C9EC, 0x5000FF_rgb .Pack(), 0x5000FF_rgb .Pack(), NGT_STAN, String("Stains: B3678/S235678") }, + { "SEED", GT_SEED, 0x00400, 0xFBEC7D_rgb .Pack(), 0xFBEC7D_rgb .Pack(), NGT_SEED, String("Seeds: B2/S") }, + { "MAZE", GT_MAZE, 0x0083E, 0xA8E4A0_rgb .Pack(), 0xA8E4A0_rgb .Pack(), NGT_MAZE, String("Maze: B3/S12345") }, + { "COAG", GT_COAG, 0x189EC, 0x9ACD32_rgb .Pack(), 0x9ACD32_rgb .Pack(), NGT_COAG, String("Coagulations: B378/S235678") }, + { "WALL", GT_WALL, 0x1F03C, 0x0047AB_rgb .Pack(), 0x0047AB_rgb .Pack(), NGT_WALL, String("Walled cities: B45678/S2345") }, + { "GNAR", GT_GNAR, 0x00202, 0xE5B73B_rgb .Pack(), 0xE5B73B_rgb .Pack(), NGT_GNAR, String("Gnarl: B1/S1") }, + { "REPL", GT_REPL, 0x0AAAA, 0x259588_rgb .Pack(), 0x259588_rgb .Pack(), NGT_REPL, String("Replicator: B1357/S1357") }, + { "MYST", GT_MYST, 0x139E1, 0x0C3C00_rgb .Pack(), 0x0C3C00_rgb .Pack(), 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") }, + { "FRG2", GT_FRG2, 0x20816, 0x006432_rgb .Pack(), 0x00FF5A_rgb .Pack(), 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") }, + { "FROG", GT_FROG, 0x21806, 0x006400_rgb .Pack(), 0x00FF00_rgb .Pack(), 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" )} }; std::vector LoadWalls() { return std::vector{ - {PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, String("ERASE"), "DEFAULT_WL_ERASE", String("Erases walls.")}, - {PIXPACK(0xC0C0C0), PIXPACK(0x101010), 0, Renderer::WallIcon, String("CONDUCTIVE WALL"), "DEFAULT_WL_CNDTW", String("Blocks everything. Conductive.")}, - {PIXPACK(0x808080), PIXPACK(0x808080), 0, Renderer::WallIcon, String("EWALL"), "DEFAULT_WL_EWALL", String("E-Wall. Becomes transparent when electricity is connected.")}, - {PIXPACK(0xFF8080), PIXPACK(0xFF2008), 1, Renderer::WallIcon, String("DETECTOR"), "DEFAULT_WL_DTECT", String("Detector. Generates electricity when a particle is inside.")}, - {PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, String("STREAMLINE"), "DEFAULT_WL_STRM", String("Streamline. Set start point of a streamline.")}, - {PIXPACK(0x8080FF), PIXPACK(0x000000), 1, Renderer::WallIcon, String("FAN"), "DEFAULT_WL_FAN", String("Fan. Accelerates air. Use the line tool to set direction and strength.")}, - {PIXPACK(0xC0C0C0), PIXPACK(0x101010), 2, Renderer::WallIcon, String("LIQUID WALL"), "DEFAULT_WL_LIQD", String("Allows liquids, blocks all other particles. Conductive.")}, - {PIXPACK(0x808080), PIXPACK(0x000000), 1, Renderer::WallIcon, String("ABSORB WALL"), "DEFAULT_WL_ABSRB", String("Absorbs particles but lets air currents through.")}, - {PIXPACK(0x808080), PIXPACK(0x000000), 3, Renderer::WallIcon, String("WALL"), "DEFAULT_WL_WALL", String("Basic wall, blocks everything.")}, - {PIXPACK(0x3C3C3C), PIXPACK(0x000000), 1, Renderer::WallIcon, String("AIRONLY WALL"), "DEFAULT_WL_AIR", String("Allows air, but blocks all particles.")}, - {PIXPACK(0x575757), PIXPACK(0x000000), 1, Renderer::WallIcon, String("POWDER WALL"), "DEFAULT_WL_POWDR", String("Allows powders, blocks all other particles.")}, - {PIXPACK(0xFFFF22), PIXPACK(0x101010), 2, Renderer::WallIcon, String("CONDUCTOR"), "DEFAULT_WL_CNDTR", String("Conductor. Allows all particles to pass through and conducts electricity.")}, - {PIXPACK(0x242424), PIXPACK(0x101010), 0, Renderer::WallIcon, String("EHOLE"), "DEFAULT_WL_EHOLE", String("E-Hole. absorbs particles, releases them when powered.")}, - {PIXPACK(0x579777), PIXPACK(0x000000), 1, Renderer::WallIcon, String("GAS WALL"), "DEFAULT_WL_GAS", String("Allows gases, blocks all other particles.")}, - {PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, Renderer::WallIcon, String("GRAVITY WALL"), "DEFAULT_WL_GRVTY", String("Gravity wall. Newtonian Gravity has no effect inside a box drawn with this.")}, - {PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, Renderer::WallIcon, String("ENERGY WALL"), "DEFAULT_WL_ENRGY", String("Allows energy particles, blocks all other particles.")}, - {PIXPACK(0xDCDCDC), PIXPACK(0x000000), 1, Renderer::WallIcon, String("AIRBLOCK WALL"), "DEFAULT_WL_NOAIR", String("Allows all particles, but blocks air.")}, - {PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, String("ERASEALL"), "DEFAULT_WL_ERASEA", String("Erases walls, particles, and signs.")}, - {PIXPACK(0x800080), PIXPACK(0x000000), 0, Renderer::WallIcon, String("STASIS WALL"), "DEFAULT_WL_STASIS", String("Freezes particles inside the wall in place until powered.")}, + {0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 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.")}, + {0x808080_rgb .Pack(), 0x808080_rgb .Pack(), 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.")}, + {0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 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.")}, + {0xC0C0C0_rgb .Pack(), 0x101010_rgb .Pack(), 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 .Pack(), 0x000000_rgb .Pack(), 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.")}, + {0x575757_rgb .Pack(), 0x000000_rgb .Pack(), 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.")}, + {0x242424_rgb .Pack(), 0x101010_rgb .Pack(), 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.")}, + {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.")}, + {0xFFAA00_rgb .Pack(), 0xAA5500_rgb .Pack(), 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.")}, + {0x808080_rgb .Pack(), 0x000000_rgb .Pack(), 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.")}, }; } diff --git a/src/simulation/elements/ACEL.cpp b/src/simulation/elements/ACEL.cpp index 7de07fb20..5798d9783 100644 --- a/src/simulation/elements/ACEL.cpp +++ b/src/simulation/elements/ACEL.cpp @@ -7,7 +7,7 @@ void Element::Element_ACEL() { Identifier = "DEFAULT_PT_ACEL"; Name = "ACEL"; - Colour = PIXPACK(0x0099CC); + Colour = 0x0099CC_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/ACID.cpp b/src/simulation/elements/ACID.cpp index 2fe4e4f02..4af694968 100644 --- a/src/simulation/elements/ACID.cpp +++ b/src/simulation/elements/ACID.cpp @@ -7,7 +7,7 @@ void Element::Element_ACID() { Identifier = "DEFAULT_PT_ACID"; Name = "ACID"; - Colour = PIXPACK(0xED55FF); + Colour = 0xED55FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/AMTR.cpp b/src/simulation/elements/AMTR.cpp index b20169cee..9a51de962 100644 --- a/src/simulation/elements/AMTR.cpp +++ b/src/simulation/elements/AMTR.cpp @@ -7,7 +7,7 @@ void Element::Element_AMTR() { Identifier = "DEFAULT_PT_AMTR"; Name = "AMTR"; - Colour = PIXPACK(0x808080); + Colour = 0x808080_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp index 666247ce7..9e1595611 100644 --- a/src/simulation/elements/ANAR.cpp +++ b/src/simulation/elements/ANAR.cpp @@ -6,7 +6,7 @@ void Element::Element_ANAR() { Identifier = "DEFAULT_PT_ANAR"; Name = "ANAR"; - Colour = PIXPACK(0xFFFFEE); + Colour = 0xFFFFEE_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/ARAY.cpp b/src/simulation/elements/ARAY.cpp index a8459dd61..84bee6e2b 100644 --- a/src/simulation/elements/ARAY.cpp +++ b/src/simulation/elements/ARAY.cpp @@ -6,7 +6,7 @@ void Element::Element_ARAY() { Identifier = "DEFAULT_PT_ARAY"; Name = "ARAY"; - Colour = PIXPACK(0xFFBB00); + Colour = 0xFFBB00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp index e15074391..61345c019 100644 --- a/src/simulation/elements/BANG.cpp +++ b/src/simulation/elements/BANG.cpp @@ -6,7 +6,7 @@ void Element::Element_BANG() { Identifier = "DEFAULT_PT_BANG"; Name = "TNT"; - Colour = PIXPACK(0xC05050); + Colour = 0xC05050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 76565b2bf..ef1cda296 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -6,7 +6,7 @@ void Element::Element_BCLN() { Identifier = "DEFAULT_PT_BCLN"; Name = "BCLN"; - Colour = PIXPACK(0xFFD040); + Colour = 0xFFD040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/BCOL.cpp b/src/simulation/elements/BCOL.cpp index 2c78791ae..7bdf781b6 100644 --- a/src/simulation/elements/BCOL.cpp +++ b/src/simulation/elements/BCOL.cpp @@ -7,7 +7,7 @@ void Element::Element_BCOL() { Identifier = "DEFAULT_PT_BCOL"; Name = "BCOL"; - Colour = PIXPACK(0x333333); + Colour = 0x333333_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/BGLA.cpp b/src/simulation/elements/BGLA.cpp index 729fd4804..b503dd928 100644 --- a/src/simulation/elements/BGLA.cpp +++ b/src/simulation/elements/BGLA.cpp @@ -4,7 +4,7 @@ void Element::Element_BGLA() { Identifier = "DEFAULT_PT_BGLA"; Name = "BGLA"; - Colour = PIXPACK(0x606060); + Colour = 0x606060_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/BHOL.cpp b/src/simulation/elements/BHOL.cpp index bad62d00b..56ba4a8e9 100644 --- a/src/simulation/elements/BHOL.cpp +++ b/src/simulation/elements/BHOL.cpp @@ -4,7 +4,7 @@ void Element::Element_BHOL() { Identifier = "DEFAULT_PT_BHOL"; Name = "VACU"; - Colour = PIXPACK(0x303030); + Colour = 0x303030_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/BIZR.cpp b/src/simulation/elements/BIZR.cpp index 64f907868..edc3e51d5 100644 --- a/src/simulation/elements/BIZR.cpp +++ b/src/simulation/elements/BIZR.cpp @@ -7,7 +7,7 @@ void Element::Element_BIZR() { Identifier = "DEFAULT_PT_BIZR"; Name = "BIZR"; - Colour = PIXPACK(0x00FF77); + Colour = 0x00FF77_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/BIZRG.cpp b/src/simulation/elements/BIZRG.cpp index 33e2fd509..8671e8119 100644 --- a/src/simulation/elements/BIZRG.cpp +++ b/src/simulation/elements/BIZRG.cpp @@ -7,7 +7,7 @@ void Element::Element_BIZRG() { Identifier = "DEFAULT_PT_BIZRG"; Name = "BIZG"; - Colour = PIXPACK(0x00FFBB); + Colour = 0x00FFBB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/BIZRS.cpp b/src/simulation/elements/BIZRS.cpp index 77757e1e8..c3258c499 100644 --- a/src/simulation/elements/BIZRS.cpp +++ b/src/simulation/elements/BIZRS.cpp @@ -7,7 +7,7 @@ void Element::Element_BIZRS() { Identifier = "DEFAULT_PT_BIZRS"; Name = "BIZS"; - Colour = PIXPACK(0x00E455); + Colour = 0x00E455_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/BMTL.cpp b/src/simulation/elements/BMTL.cpp index 25bb58fec..a005b40ac 100644 --- a/src/simulation/elements/BMTL.cpp +++ b/src/simulation/elements/BMTL.cpp @@ -6,7 +6,7 @@ void Element::Element_BMTL() { Identifier = "DEFAULT_PT_BMTL"; Name = "BMTL"; - Colour = PIXPACK(0x505070); + Colour = 0x505070_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp index bc44bc264..8ec3140c5 100644 --- a/src/simulation/elements/BOMB.cpp +++ b/src/simulation/elements/BOMB.cpp @@ -7,7 +7,7 @@ void Element::Element_BOMB() { Identifier = "DEFAULT_PT_BOMB"; Name = "BOMB"; - Colour = PIXPACK(0xFFF288); + Colour = 0xFFF288_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/BOYL.cpp b/src/simulation/elements/BOYL.cpp index 34e5b81ba..0c7b33450 100644 --- a/src/simulation/elements/BOYL.cpp +++ b/src/simulation/elements/BOYL.cpp @@ -6,7 +6,7 @@ void Element::Element_BOYL() { Identifier = "DEFAULT_PT_BOYL"; Name = "BOYL"; - Colour = PIXPACK(0x0A3200); + Colour = 0x0A3200_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/BRAY.cpp b/src/simulation/elements/BRAY.cpp index e8d11546d..f23bbbb31 100644 --- a/src/simulation/elements/BRAY.cpp +++ b/src/simulation/elements/BRAY.cpp @@ -6,7 +6,7 @@ void Element::Element_BRAY() { Identifier = "DEFAULT_PT_BRAY"; Name = "BRAY"; - Colour = PIXPACK(0xFFFFFF); + Colour = 0xFFFFFF_rgb .Pack(); MenuVisible = 0; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/BRCK.cpp b/src/simulation/elements/BRCK.cpp index 18216e40d..786af0904 100644 --- a/src/simulation/elements/BRCK.cpp +++ b/src/simulation/elements/BRCK.cpp @@ -6,7 +6,7 @@ void Element::Element_BRCK() { Identifier = "DEFAULT_PT_BRCK"; Name = "BRCK"; - Colour = PIXPACK(0x808080); + Colour = 0x808080_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp index eb54b9c87..32b1db882 100644 --- a/src/simulation/elements/BREC.cpp +++ b/src/simulation/elements/BREC.cpp @@ -6,7 +6,7 @@ void Element::Element_BREC() { Identifier = "DEFAULT_PT_BREC"; Name = "BREL"; - Colour = PIXPACK(0x707060); + Colour = 0x707060_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/BRMT.cpp b/src/simulation/elements/BRMT.cpp index df63db836..8f288af3c 100644 --- a/src/simulation/elements/BRMT.cpp +++ b/src/simulation/elements/BRMT.cpp @@ -6,7 +6,7 @@ void Element::Element_BRMT() { Identifier = "DEFAULT_PT_BRMT"; Name = "BRMT"; - Colour = PIXPACK(0x705060); + Colour = 0x705060_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/BTRY.cpp b/src/simulation/elements/BTRY.cpp index f3511bac7..d25da8beb 100644 --- a/src/simulation/elements/BTRY.cpp +++ b/src/simulation/elements/BTRY.cpp @@ -6,7 +6,7 @@ void Element::Element_BTRY() { Identifier = "DEFAULT_PT_BTRY"; Name = "BTRY"; - Colour = PIXPACK(0x858505); + Colour = 0x858505_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/BVBR.cpp b/src/simulation/elements/BVBR.cpp index b32ead1e0..79ea3106a 100644 --- a/src/simulation/elements/BVBR.cpp +++ b/src/simulation/elements/BVBR.cpp @@ -7,7 +7,7 @@ void Element::Element_BVBR() { Identifier = "DEFAULT_PT_BVBR"; Name = "BVBR"; - Colour = PIXPACK(0x005000); + Colour = 0x005000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/C5.cpp b/src/simulation/elements/C5.cpp index baa78e60d..d1fc2b443 100644 --- a/src/simulation/elements/C5.cpp +++ b/src/simulation/elements/C5.cpp @@ -7,7 +7,7 @@ void Element::Element_C5() { Identifier = "DEFAULT_PT_C5"; Name = "C-5"; - Colour = PIXPACK(0x2050E0); + Colour = 0x2050E0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/CAUS.cpp b/src/simulation/elements/CAUS.cpp index 96faf1a04..bdc73f74a 100644 --- a/src/simulation/elements/CAUS.cpp +++ b/src/simulation/elements/CAUS.cpp @@ -6,7 +6,7 @@ void Element::Element_CAUS() { Identifier = "DEFAULT_PT_CAUS"; Name = "CAUS"; - Colour = PIXPACK(0x80FFA0); + Colour = 0x80FFA0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/CBNW.cpp b/src/simulation/elements/CBNW.cpp index 2583bb311..c0f63fae4 100644 --- a/src/simulation/elements/CBNW.cpp +++ b/src/simulation/elements/CBNW.cpp @@ -7,7 +7,7 @@ void Element::Element_CBNW() { Identifier = "DEFAULT_PT_CBNW"; Name = "BUBW"; - Colour = PIXPACK(0x2030D0); + Colour = 0x2030D0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/CFLM.cpp b/src/simulation/elements/CFLM.cpp index 13b0c4cf4..ee467b8b1 100644 --- a/src/simulation/elements/CFLM.cpp +++ b/src/simulation/elements/CFLM.cpp @@ -7,7 +7,7 @@ void Element::Element_CFLM() { Identifier = "DEFAULT_PT_HFLM"; Name = "CFLM"; - Colour = PIXPACK(0x8080FF); + Colour = 0x8080FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; @@ -50,10 +50,10 @@ void Element::Element_CFLM() static int graphics(GRAPHICS_FUNC_ARGS) { - auto color = Renderer::clfmTableAt(cpart->life / 2); - *colr = PIXR(color); - *colg = PIXG(color); - *colb = PIXB(color); + auto color = RGB::Unpack(Renderer::clfmTableAt(cpart->life / 2)); + *colr = color.Red; + *colg = color.Green; + *colb = color.Blue; *firea = 255; *firer = *colr; diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp index 21a57cba6..78c0424ac 100644 --- a/src/simulation/elements/CLNE.cpp +++ b/src/simulation/elements/CLNE.cpp @@ -6,7 +6,7 @@ void Element::Element_CLNE() { Identifier = "DEFAULT_PT_CLNE"; Name = "CLNE"; - Colour = PIXPACK(0xFFD010); + Colour = 0xFFD010_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/CLST.cpp b/src/simulation/elements/CLST.cpp index 09b5c6f85..b085d97b0 100644 --- a/src/simulation/elements/CLST.cpp +++ b/src/simulation/elements/CLST.cpp @@ -8,7 +8,7 @@ void Element::Element_CLST() { Identifier = "DEFAULT_PT_CLST"; Name = "CLST"; - Colour = PIXPACK(0xE4A4A4); + Colour = 0xE4A4A4_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/CNCT.cpp b/src/simulation/elements/CNCT.cpp index 6f8645754..7e96b694f 100644 --- a/src/simulation/elements/CNCT.cpp +++ b/src/simulation/elements/CNCT.cpp @@ -4,7 +4,7 @@ void Element::Element_CNCT() { Identifier = "DEFAULT_PT_CNCT"; Name = "CNCT"; - Colour = PIXPACK(0xC0C0C0); + Colour = 0xC0C0C0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index 256cba211..0b8c4390a 100644 --- a/src/simulation/elements/CO2.cpp +++ b/src/simulation/elements/CO2.cpp @@ -6,7 +6,7 @@ void Element::Element_CO2() { Identifier = "DEFAULT_PT_CO2"; Name = "CO2"; - Colour = PIXPACK(0x666666); + Colour = 0x666666_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/COAL.cpp b/src/simulation/elements/COAL.cpp index ce4e70eef..1892b98ca 100644 --- a/src/simulation/elements/COAL.cpp +++ b/src/simulation/elements/COAL.cpp @@ -7,7 +7,7 @@ void Element::Element_COAL() { Identifier = "DEFAULT_PT_COAL"; Name = "COAL"; - Colour = PIXPACK(0x222222); + Colour = 0x222222_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/CONV.cpp b/src/simulation/elements/CONV.cpp index 6ac5956a4..0a4448eb7 100644 --- a/src/simulation/elements/CONV.cpp +++ b/src/simulation/elements/CONV.cpp @@ -6,7 +6,7 @@ void Element::Element_CONV() { Identifier = "DEFAULT_PT_CONV"; Name = "CONV"; - Colour = PIXPACK(0x0AAB0A); + Colour = 0x0AAB0A_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index 6db677cc8..4260bc98d 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -8,7 +8,7 @@ void Element::Element_CRAY() { Identifier = "DEFAULT_PT_CRAY"; Name = "CRAY"; - Colour = PIXPACK(0xBBFF00); + Colour = 0xBBFF00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/CRMC.cpp b/src/simulation/elements/CRMC.cpp index 9dea24139..b7bd8714a 100644 --- a/src/simulation/elements/CRMC.cpp +++ b/src/simulation/elements/CRMC.cpp @@ -8,7 +8,7 @@ void Element::Element_CRMC() { Identifier = "DEFAULT_PT_CRMC"; Name = "CRMC"; - Colour = PIXPACK(0xD6D1D4); + Colour = 0xD6D1D4_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/DCEL.cpp b/src/simulation/elements/DCEL.cpp index f23a52740..88fe6b030 100644 --- a/src/simulation/elements/DCEL.cpp +++ b/src/simulation/elements/DCEL.cpp @@ -7,7 +7,7 @@ void Element::Element_DCEL() { Identifier = "DEFAULT_PT_DCEL"; Name = "DCEL"; - Colour = PIXPACK(0x99CC00); + Colour = 0x99CC00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/DESL.cpp b/src/simulation/elements/DESL.cpp index bf3eee9d6..07fc5d179 100644 --- a/src/simulation/elements/DESL.cpp +++ b/src/simulation/elements/DESL.cpp @@ -4,7 +4,7 @@ void Element::Element_DESL() { Identifier = "DEFAULT_PT_DESL"; Name = "DESL"; - Colour = PIXPACK(0x440000); + Colour = 0x440000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/DEST.cpp b/src/simulation/elements/DEST.cpp index fd8172250..859ebedd3 100644 --- a/src/simulation/elements/DEST.cpp +++ b/src/simulation/elements/DEST.cpp @@ -7,7 +7,7 @@ void Element::Element_DEST() { Identifier = "DEFAULT_PT_DEST"; Name = "DEST"; - Colour = PIXPACK(0xFF3311); + Colour = 0xFF3311_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/DEUT.cpp b/src/simulation/elements/DEUT.cpp index d424d3ee9..d35bd9803 100644 --- a/src/simulation/elements/DEUT.cpp +++ b/src/simulation/elements/DEUT.cpp @@ -8,7 +8,7 @@ void Element::Element_DEUT() { Identifier = "DEFAULT_PT_DEUT"; Name = "DEUT"; - Colour = PIXPACK(0x00153F); + Colour = 0x00153F_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/DLAY.cpp b/src/simulation/elements/DLAY.cpp index ea7f73efe..00ce16141 100644 --- a/src/simulation/elements/DLAY.cpp +++ b/src/simulation/elements/DLAY.cpp @@ -7,7 +7,7 @@ void Element::Element_DLAY() { Identifier = "DEFAULT_PT_DLAY"; Name = "DLAY"; - Colour = PIXPACK(0x753590); + Colour = 0x753590_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp index d550d47e7..2d710e69d 100644 --- a/src/simulation/elements/DMG.cpp +++ b/src/simulation/elements/DMG.cpp @@ -7,7 +7,7 @@ void Element::Element_DMG() { Identifier = "DEFAULT_PT_DMG"; Name = "DMG"; - Colour = PIXPACK(0x88FF88); + Colour = 0x88FF88_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/DMND.cpp b/src/simulation/elements/DMND.cpp index 291e9d44e..570f862e0 100644 --- a/src/simulation/elements/DMND.cpp +++ b/src/simulation/elements/DMND.cpp @@ -4,7 +4,7 @@ void Element::Element_DMND() { Identifier = "DEFAULT_PT_DMND"; Name = "DMND"; - Colour = PIXPACK(0xCCFFFF); + Colour = 0xCCFFFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/DRAY.cpp b/src/simulation/elements/DRAY.cpp index 7e197423f..4831536a9 100644 --- a/src/simulation/elements/DRAY.cpp +++ b/src/simulation/elements/DRAY.cpp @@ -6,7 +6,7 @@ void Element::Element_DRAY() { Identifier = "DEFAULT_PT_DRAY"; Name = "DRAY"; - Colour = PIXPACK(0xFFAA22); + Colour = 0xFFAA22_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/DRIC.cpp b/src/simulation/elements/DRIC.cpp index 18e855d8a..4dc395246 100644 --- a/src/simulation/elements/DRIC.cpp +++ b/src/simulation/elements/DRIC.cpp @@ -4,7 +4,7 @@ void Element::Element_DRIC() { Identifier = "DEFAULT_PT_DRIC"; Name = "DRIC"; - Colour = PIXPACK(0xE0E0E0); + Colour = 0xE0E0E0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp index 4325edaaa..156a7b2ef 100644 --- a/src/simulation/elements/DSTW.cpp +++ b/src/simulation/elements/DSTW.cpp @@ -6,7 +6,7 @@ void Element::Element_DSTW() { Identifier = "DEFAULT_PT_DSTW"; Name = "DSTW"; - Colour = PIXPACK(0x1020C0); + Colour = 0x1020C0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/DTEC.cpp b/src/simulation/elements/DTEC.cpp index a40be497d..e79ef3f79 100644 --- a/src/simulation/elements/DTEC.cpp +++ b/src/simulation/elements/DTEC.cpp @@ -6,7 +6,7 @@ void Element::Element_DTEC() { Identifier = "DEFAULT_PT_DTEC"; Name = "DTEC"; - Colour = PIXPACK(0xFD9D18); + Colour = 0xFD9D18_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/DUST.cpp b/src/simulation/elements/DUST.cpp index 3a43c7463..615b09697 100644 --- a/src/simulation/elements/DUST.cpp +++ b/src/simulation/elements/DUST.cpp @@ -4,7 +4,7 @@ void Element::Element_DUST() { Identifier = "DEFAULT_PT_DUST"; Name = "DUST"; - Colour = PIXPACK(0xFFE0A0); + Colour = 0xFFE0A0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/DYST.cpp b/src/simulation/elements/DYST.cpp index 0530a1d47..7ed0c873f 100644 --- a/src/simulation/elements/DYST.cpp +++ b/src/simulation/elements/DYST.cpp @@ -4,7 +4,7 @@ void Element::Element_DYST() { Identifier = "DEFAULT_PT_DYST"; Name = "DYST"; - Colour = PIXPACK(0xBBB0A0); + Colour = 0xBBB0A0_rgb .Pack(); MenuVisible = 0; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/E116.cpp b/src/simulation/elements/E116.cpp index a05476e49..2672447f3 100644 --- a/src/simulation/elements/E116.cpp +++ b/src/simulation/elements/E116.cpp @@ -4,7 +4,7 @@ void Element::Element_E116() { Identifier = "DEFAULT_PT_116"; Name = "EQVE"; - Colour = PIXPACK(0xFFE0A0); + Colour = 0xFFE0A0_rgb .Pack(); MenuVisible = 0; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/E146.cpp b/src/simulation/elements/E146.cpp index 315e2cc7b..fdd78e1f2 100644 --- a/src/simulation/elements/E146.cpp +++ b/src/simulation/elements/E146.cpp @@ -4,7 +4,7 @@ void Element::Element_E146() { Identifier = "DEFAULT_PT_146"; Name = "BRAN"; - Colour = PIXPACK(0xCCCC00); + Colour = 0xCCCC00_rgb .Pack(); MenuVisible = 0; MenuSection = SC_LIFE; Enabled = 0; diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp index 3ba475153..ce2e4df79 100644 --- a/src/simulation/elements/ELEC.cpp +++ b/src/simulation/elements/ELEC.cpp @@ -8,7 +8,7 @@ void Element::Element_ELEC() { Identifier = "DEFAULT_PT_ELEC"; Name = "ELEC"; - Colour = PIXPACK(0xDFEFFF); + Colour = 0xDFEFFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/EMBR.cpp b/src/simulation/elements/EMBR.cpp index 2c7e256f4..869b566b5 100644 --- a/src/simulation/elements/EMBR.cpp +++ b/src/simulation/elements/EMBR.cpp @@ -7,7 +7,7 @@ void Element::Element_EMBR() { Identifier = "DEFAULT_PT_EMBR"; Name = "EMBR"; - Colour = PIXPACK(0xFFF288); + Colour = 0xFFF288_rgb .Pack(); MenuVisible = 0; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/EMP.cpp b/src/simulation/elements/EMP.cpp index c6ebabd26..7fad5e054 100644 --- a/src/simulation/elements/EMP.cpp +++ b/src/simulation/elements/EMP.cpp @@ -7,7 +7,7 @@ void Element::Element_EMP() { Identifier = "DEFAULT_PT_EMP"; Name = "EMP"; - Colour = PIXPACK(0x66AAFF); + Colour = 0x66AAFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/ETRD.cpp b/src/simulation/elements/ETRD.cpp index 392d0d43d..b9437b093 100644 --- a/src/simulation/elements/ETRD.cpp +++ b/src/simulation/elements/ETRD.cpp @@ -8,7 +8,7 @@ void Element::Element_ETRD() { Identifier = "DEFAULT_PT_ETRD"; Name = "ETRD"; - Colour = PIXPACK(0x404040); + Colour = 0x404040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 3e9301245..9a64ece13 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -7,7 +7,7 @@ void Element::Element_EXOT() { Identifier = "DEFAULT_PT_EXOT"; Name = "EXOT"; - Colour = PIXPACK(0x247BFE); + Colour = 0x247BFE_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/FIGH.cpp b/src/simulation/elements/FIGH.cpp index bda60f91b..40027e74b 100644 --- a/src/simulation/elements/FIGH.cpp +++ b/src/simulation/elements/FIGH.cpp @@ -15,7 +15,7 @@ void Element::Element_FIGH() { Identifier = "DEFAULT_PT_FIGH"; Name = "FIGH"; - Colour = PIXPACK(0xFFE0A0); + Colour = 0xFFE0A0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index 659a66f8f..68a1bd981 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -9,7 +9,7 @@ void Element::Element_FILT() { Identifier = "DEFAULT_PT_FILT"; Name = "FILT"; - Colour = PIXPACK(0x000056); + Colour = 0x000056_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index b97f64310..e6b1ab011 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -10,7 +10,7 @@ void Element::Element_FIRE() { Identifier = "DEFAULT_PT_FIRE"; Name = "FIRE"; - Colour = PIXPACK(0xFF1000); + Colour = 0xFF1000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; @@ -353,10 +353,10 @@ static int updateLegacy(UPDATE_FUNC_ARGS) static int graphics(GRAPHICS_FUNC_ARGS) { - auto color = Renderer::flameTableAt(cpart->life); - *colr = PIXR(color); - *colg = PIXG(color); - *colb = PIXB(color); + auto color = RGB::Unpack(Renderer::flameTableAt(cpart->life)); + *colr = color.Red; + *colg = color.Green; + *colb = color.Blue; *firea = 255; *firer = *colr; diff --git a/src/simulation/elements/FIRW.cpp b/src/simulation/elements/FIRW.cpp index d6700a721..167e67462 100644 --- a/src/simulation/elements/FIRW.cpp +++ b/src/simulation/elements/FIRW.cpp @@ -7,7 +7,7 @@ void Element::Element_FIRW() { Identifier = "DEFAULT_PT_FIRW"; Name = "FIRW"; - Colour = PIXPACK(0xFFA040); + Colour = 0xFFA040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/FOG.cpp b/src/simulation/elements/FOG.cpp index 6968591e7..ec5649980 100644 --- a/src/simulation/elements/FOG.cpp +++ b/src/simulation/elements/FOG.cpp @@ -6,7 +6,7 @@ void Element::Element_FOG() { Identifier = "DEFAULT_PT_FOG"; Name = "FOG"; - Colour = PIXPACK(0xAAAAAA); + Colour = 0xAAAAAA_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/FRAY.cpp b/src/simulation/elements/FRAY.cpp index 61cf72b9c..3f78d40f1 100644 --- a/src/simulation/elements/FRAY.cpp +++ b/src/simulation/elements/FRAY.cpp @@ -6,7 +6,7 @@ void Element::Element_FRAY() { Identifier = "DEFAULT_PT_FRAY"; Name = "FRAY"; - Colour = PIXPACK(0x00BBFF); + Colour = 0x00BBFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/FRME.cpp b/src/simulation/elements/FRME.cpp index 0f09ced90..3e21711af 100644 --- a/src/simulation/elements/FRME.cpp +++ b/src/simulation/elements/FRME.cpp @@ -6,7 +6,7 @@ void Element::Element_FRME() { Identifier = "DEFAULT_PT_FRME"; Name = "FRME"; - Colour = PIXPACK(0x999988); + Colour = 0x999988_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp index 20732f6e2..8664a5064 100644 --- a/src/simulation/elements/FRZW.cpp +++ b/src/simulation/elements/FRZW.cpp @@ -6,7 +6,7 @@ void Element::Element_FRZW() { Identifier = "DEFAULT_PT_FRZW"; Name = "FRZW"; - Colour = PIXPACK(0x1020C0); + Colour = 0x1020C0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp index cd430425d..7cd3426be 100644 --- a/src/simulation/elements/FRZZ.cpp +++ b/src/simulation/elements/FRZZ.cpp @@ -6,7 +6,7 @@ void Element::Element_FRZZ() { Identifier = "DEFAULT_PT_FRZZ"; Name = "FRZZ"; - Colour = PIXPACK(0xC0E0FF); + Colour = 0xC0E0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/FSEP.cpp b/src/simulation/elements/FSEP.cpp index c36097e0a..f00c5f587 100644 --- a/src/simulation/elements/FSEP.cpp +++ b/src/simulation/elements/FSEP.cpp @@ -6,7 +6,7 @@ void Element::Element_FSEP() { Identifier = "DEFAULT_PT_FSEP"; Name = "FSEP"; - Colour = PIXPACK(0x63AD5F); + Colour = 0x63AD5F_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/FUSE.cpp b/src/simulation/elements/FUSE.cpp index ffabb1838..dff25cc8c 100644 --- a/src/simulation/elements/FUSE.cpp +++ b/src/simulation/elements/FUSE.cpp @@ -6,7 +6,7 @@ void Element::Element_FUSE() { Identifier = "DEFAULT_PT_FUSE"; Name = "FUSE"; - Colour = PIXPACK(0x0A5706); + Colour = 0x0A5706_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/FWRK.cpp b/src/simulation/elements/FWRK.cpp index 432c1856e..e3ec3bbc9 100644 --- a/src/simulation/elements/FWRK.cpp +++ b/src/simulation/elements/FWRK.cpp @@ -7,7 +7,7 @@ void Element::Element_FWRK() { Identifier = "DEFAULT_PT_FWRK"; Name = "FWRK"; - Colour = PIXPACK(0x666666); + Colour = 0x666666_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/GAS.cpp b/src/simulation/elements/GAS.cpp index 2c68e6039..5c740c080 100644 --- a/src/simulation/elements/GAS.cpp +++ b/src/simulation/elements/GAS.cpp @@ -4,7 +4,7 @@ void Element::Element_GAS() { Identifier = "DEFAULT_PT_GAS"; Name = "GAS"; - Colour = PIXPACK(0xE0FF20); + Colour = 0xE0FF20_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/GBMB.cpp b/src/simulation/elements/GBMB.cpp index aacc7f31b..abc793bae 100644 --- a/src/simulation/elements/GBMB.cpp +++ b/src/simulation/elements/GBMB.cpp @@ -7,7 +7,7 @@ void Element::Element_GBMB() { Identifier = "DEFAULT_PT_GBMB"; Name = "GBMB"; - Colour = PIXPACK(0x1144BB); + Colour = 0x1144BB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp index b175209eb..55ebe7575 100644 --- a/src/simulation/elements/GEL.cpp +++ b/src/simulation/elements/GEL.cpp @@ -7,7 +7,7 @@ void Element::Element_GEL() { Identifier = "DEFAULT_PT_GEL"; Name = "GEL"; - Colour = PIXPACK(0xFF9900); + Colour = 0xFF9900_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp index d80bb2d7a..85f9f2377 100644 --- a/src/simulation/elements/GLAS.cpp +++ b/src/simulation/elements/GLAS.cpp @@ -7,7 +7,7 @@ void Element::Element_GLAS() { Identifier = "DEFAULT_PT_GLAS"; Name = "GLAS"; - Colour = PIXPACK(0x404040); + Colour = 0x404040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp index 5a764a080..b18362cb0 100644 --- a/src/simulation/elements/GLOW.cpp +++ b/src/simulation/elements/GLOW.cpp @@ -7,7 +7,7 @@ void Element::Element_GLOW() { Identifier = "DEFAULT_PT_GLOW"; Name = "GLOW"; - Colour = PIXPACK(0x445464); + Colour = 0x445464_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/GOLD.cpp b/src/simulation/elements/GOLD.cpp index 4a0ceaa1f..7b475d926 100644 --- a/src/simulation/elements/GOLD.cpp +++ b/src/simulation/elements/GOLD.cpp @@ -8,7 +8,7 @@ void Element::Element_GOLD() { Identifier = "DEFAULT_PT_GOLD"; Name = "GOLD"; - Colour = PIXPACK(0xDCAD2C); + Colour = 0xDCAD2C_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/GOO.cpp b/src/simulation/elements/GOO.cpp index b21d30a6d..93dada462 100644 --- a/src/simulation/elements/GOO.cpp +++ b/src/simulation/elements/GOO.cpp @@ -6,7 +6,7 @@ void Element::Element_GOO() { Identifier = "DEFAULT_PT_GOO"; Name = "GOO"; - Colour = PIXPACK(0x804000); + Colour = 0x804000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/GPMP.cpp b/src/simulation/elements/GPMP.cpp index 9a92ef589..85823d158 100644 --- a/src/simulation/elements/GPMP.cpp +++ b/src/simulation/elements/GPMP.cpp @@ -7,7 +7,7 @@ void Element::Element_GPMP() { Identifier = "DEFAULT_PT_GPMP"; Name = "GPMP"; - Colour = PIXPACK(0x0A3B3B); + Colour = 0x0A3B3B_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/GRAV.cpp b/src/simulation/elements/GRAV.cpp index 190f3bc82..e888beacf 100644 --- a/src/simulation/elements/GRAV.cpp +++ b/src/simulation/elements/GRAV.cpp @@ -8,7 +8,7 @@ void Element::Element_GRAV() { Identifier = "DEFAULT_PT_GRAV"; Name = "GRAV"; - Colour = PIXPACK(0x202020); + Colour = 0x202020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/GRVT.cpp b/src/simulation/elements/GRVT.cpp index cddfc97d1..3de2d9841 100644 --- a/src/simulation/elements/GRVT.cpp +++ b/src/simulation/elements/GRVT.cpp @@ -8,7 +8,7 @@ void Element::Element_GRVT() { Identifier = "DEFAULT_PT_GRVT"; Name = "GRVT"; - Colour = PIXPACK(0x00EE76); + Colour = 0x00EE76_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/GUNP.cpp b/src/simulation/elements/GUNP.cpp index 63cbe96ce..83d680884 100644 --- a/src/simulation/elements/GUNP.cpp +++ b/src/simulation/elements/GUNP.cpp @@ -4,7 +4,7 @@ void Element::Element_GUNP() { Identifier = "DEFAULT_PT_GUNP"; Name = "GUN"; - Colour = PIXPACK(0xC0C0D0); + Colour = 0xC0C0D0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp index 002a4cf13..39c16eb3f 100644 --- a/src/simulation/elements/H2.cpp +++ b/src/simulation/elements/H2.cpp @@ -6,7 +6,7 @@ void Element::Element_H2() { Identifier = "DEFAULT_PT_H2"; Name = "HYGN"; - Colour = PIXPACK(0x5070FF); + Colour = 0x5070FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/HEAC.cpp b/src/simulation/elements/HEAC.cpp index 0a11cee77..f5587eb4b 100644 --- a/src/simulation/elements/HEAC.cpp +++ b/src/simulation/elements/HEAC.cpp @@ -7,7 +7,7 @@ void Element::Element_HEAC() { Identifier = "DEFAULT_PT_HEAC"; Name = "HEAC"; - Colour = PIXPACK(0xCB6351); + Colour = 0xCB6351_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/HSWC.cpp b/src/simulation/elements/HSWC.cpp index f34198860..7e6085068 100644 --- a/src/simulation/elements/HSWC.cpp +++ b/src/simulation/elements/HSWC.cpp @@ -7,7 +7,7 @@ void Element::Element_HSWC() { Identifier = "DEFAULT_PT_HSWC"; Name = "HSWC"; - Colour = PIXPACK(0x3B0A0A); + Colour = 0x3B0A0A_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp index d51508f57..f58d8a20c 100644 --- a/src/simulation/elements/ICEI.cpp +++ b/src/simulation/elements/ICEI.cpp @@ -6,7 +6,7 @@ void Element::Element_ICEI() { Identifier = "DEFAULT_PT_ICEI"; Name = "ICE"; - Colour = PIXPACK(0xA0C0FF); + Colour = 0xA0C0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/IGNT.cpp b/src/simulation/elements/IGNT.cpp index dc32ff2af..01f7d3ae7 100644 --- a/src/simulation/elements/IGNT.cpp +++ b/src/simulation/elements/IGNT.cpp @@ -6,7 +6,7 @@ void Element::Element_IGNT() { Identifier = "DEFAULT_PT_IGNT"; Name = "IGNC"; - Colour = PIXPACK(0xC0B050); + Colour = 0xC0B050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/INSL.cpp b/src/simulation/elements/INSL.cpp index 980edbed2..4e07cd862 100644 --- a/src/simulation/elements/INSL.cpp +++ b/src/simulation/elements/INSL.cpp @@ -4,7 +4,7 @@ void Element::Element_INSL() { Identifier = "DEFAULT_PT_INSL"; Name = "INSL"; - Colour = PIXPACK(0x9EA3B6); + Colour = 0x9EA3B6_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/INST.cpp b/src/simulation/elements/INST.cpp index 3e50ceeb1..9688eba07 100644 --- a/src/simulation/elements/INST.cpp +++ b/src/simulation/elements/INST.cpp @@ -4,7 +4,7 @@ void Element::Element_INST() { Identifier = "DEFAULT_PT_INST"; Name = "INST"; - Colour = PIXPACK(0x404039); + Colour = 0x404039_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp index d03373de1..f135149f8 100644 --- a/src/simulation/elements/INVIS.cpp +++ b/src/simulation/elements/INVIS.cpp @@ -7,7 +7,7 @@ void Element::Element_INVIS() { Identifier = "DEFAULT_PT_INVIS"; Name = "INVS"; - Colour = PIXPACK(0x00CCCC); + Colour = 0x00CCCC_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/INWR.cpp b/src/simulation/elements/INWR.cpp index 9d1137ec8..3800e125a 100644 --- a/src/simulation/elements/INWR.cpp +++ b/src/simulation/elements/INWR.cpp @@ -4,7 +4,7 @@ void Element::Element_INWR() { Identifier = "DEFAULT_PT_INWR"; Name = "INWR"; - Colour = PIXPACK(0x544141); + Colour = 0x544141_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/IRON.cpp b/src/simulation/elements/IRON.cpp index 9c9ef6884..af5ad8344 100644 --- a/src/simulation/elements/IRON.cpp +++ b/src/simulation/elements/IRON.cpp @@ -6,7 +6,7 @@ void Element::Element_IRON() { Identifier = "DEFAULT_PT_IRON"; Name = "IRON"; - Colour = PIXPACK(0x707070); + Colour = 0x707070_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/ISOZ.cpp b/src/simulation/elements/ISOZ.cpp index f5c5e3fad..8274e8c92 100644 --- a/src/simulation/elements/ISOZ.cpp +++ b/src/simulation/elements/ISOZ.cpp @@ -6,7 +6,7 @@ void Element::Element_ISOZ() { Identifier = "DEFAULT_PT_ISOZ"; Name = "ISOZ"; - Colour = PIXPACK(0xAA30D0); + Colour = 0xAA30D0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/ISZS.cpp b/src/simulation/elements/ISZS.cpp index f8b971bd7..f969f64c6 100644 --- a/src/simulation/elements/ISZS.cpp +++ b/src/simulation/elements/ISZS.cpp @@ -6,7 +6,7 @@ void Element::Element_ISZS() { Identifier = "DEFAULT_PT_ISZS"; Name = "ISZS"; - Colour = PIXPACK(0x662089); + Colour = 0x662089_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/LAVA.cpp b/src/simulation/elements/LAVA.cpp index 3ceaf74ff..30a8fe453 100644 --- a/src/simulation/elements/LAVA.cpp +++ b/src/simulation/elements/LAVA.cpp @@ -8,7 +8,7 @@ void Element::Element_LAVA() { Identifier = "DEFAULT_PT_LAVA"; Name = "LAVA"; - Colour = PIXPACK(0xE05010); + Colour = 0xE05010_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/LCRY.cpp b/src/simulation/elements/LCRY.cpp index 2c1891009..f1aabb8d2 100644 --- a/src/simulation/elements/LCRY.cpp +++ b/src/simulation/elements/LCRY.cpp @@ -7,7 +7,7 @@ void Element::Element_LCRY() { Identifier = "DEFAULT_PT_LCRY"; Name = "LCRY"; - Colour = PIXPACK(0x505050); + Colour = 0x505050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/LDTC.cpp b/src/simulation/elements/LDTC.cpp index 81046c46d..f2b2f37f0 100644 --- a/src/simulation/elements/LDTC.cpp +++ b/src/simulation/elements/LDTC.cpp @@ -7,7 +7,7 @@ void Element::Element_LDTC() { Identifier = "DEFAULT_PT_LDTC"; Name = "LDTC"; - Colour = PIXPACK(0x66ff66); + Colour = 0x66ff66_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp index 2e28ee262..77449d48f 100644 --- a/src/simulation/elements/LIFE.cpp +++ b/src/simulation/elements/LIFE.cpp @@ -7,7 +7,7 @@ void Element::Element_LIFE() { Identifier = "DEFAULT_PT_LIFE"; Name = "LIFE"; - Colour = PIXPACK(0x0CAC00); + Colour = 0x0CAC00_rgb .Pack(); MenuVisible = 0; MenuSection = SC_LIFE; Enabled = 1; @@ -50,11 +50,11 @@ void Element::Element_LIFE() static int graphics(GRAPHICS_FUNC_ARGS) { - auto colour1 = cpart->dcolour; - auto colour2 = cpart->tmp; - if (!colour1) + auto colour1 = RGB::Unpack(cpart->dcolour); + auto colour2 = RGB::Unpack(cpart->tmp); + if (!cpart->dcolour) { - colour1 = PIXPACK(0xFFFFFF); + colour1 = 0xFFFFFF_rgb; } auto ruleset = cpart->ctype; bool renderDeco = !ren->blackDecorations; @@ -62,8 +62,8 @@ static int graphics(GRAPHICS_FUNC_ARGS) { if (!renderDeco || !ren->decorations_enable) { - colour1 = builtinGol[ruleset].colour; - colour2 = builtinGol[ruleset].colour2; + colour1 = RGB::Unpack(builtinGol[ruleset].colour); + colour2 = RGB::Unpack(builtinGol[ruleset].colour2); renderDeco = true; } ruleset = builtinGol[ruleset].ruleset; @@ -73,16 +73,16 @@ static int graphics(GRAPHICS_FUNC_ARGS) auto states = ((ruleset >> 17) & 0xF) + 2; if (states == 2) { - *colr = PIXR(colour1); - *colg = PIXG(colour1); - *colb = PIXB(colour1); + *colr = colour1.Red; + *colg = colour1.Green; + *colb = colour1.Blue; } else { auto mul = (cpart->tmp2 - 1) / float(states - 2); - *colr = int(PIXR(colour1) * mul + PIXR(colour2) * (1.f - mul)); - *colg = int(PIXG(colour1) * mul + PIXG(colour2) * (1.f - mul)); - *colb = int(PIXB(colour1) * mul + PIXB(colour2) * (1.f - mul)); + *colr = int(colour1.Red * mul + colour2.Red * (1.f - mul)); + *colg = int(colour1.Green * mul + colour2.Green * (1.f - mul)); + *colb = int(colour1.Blue * mul + colour2.Blue * (1.f - mul)); } } *pixel_mode |= NO_DECO; diff --git a/src/simulation/elements/LIGH.cpp b/src/simulation/elements/LIGH.cpp index fc0d32c1b..2d6d00a58 100644 --- a/src/simulation/elements/LIGH.cpp +++ b/src/simulation/elements/LIGH.cpp @@ -9,7 +9,7 @@ void Element::Element_LIGH() { Identifier = "DEFAULT_PT_LIGH"; Name = "LIGH"; - Colour = PIXPACK(0xFFFFC0); + Colour = 0xFFFFC0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/LITH.cpp b/src/simulation/elements/LITH.cpp index 2ee901b7a..55cca6eaf 100644 --- a/src/simulation/elements/LITH.cpp +++ b/src/simulation/elements/LITH.cpp @@ -7,7 +7,7 @@ void Element::Element_LITH() { Identifier = "DEFAULT_PT_LITH"; Name = "LITH"; - Colour = PIXPACK(0xB6AABF); + Colour = 0xB6AABF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; @@ -248,10 +248,10 @@ static int graphics(GRAPHICS_FUNC_ARGS) // Exploding lith if (cpart->life >= 1000) { - int colour = 0xFFA040; - *colr = PIXR(colour); - *colg = PIXG(colour); - *colb = PIXB(colour); + auto colour = 0xFFA040_rgb; + *colr = colour.Red; + *colg = colour.Green; + *colb = colour.Blue; *pixel_mode |= PMODE_FLARE | PMODE_GLOW; } // Charged lith diff --git a/src/simulation/elements/LNTG.cpp b/src/simulation/elements/LNTG.cpp index ac566e3a3..b6303933a 100644 --- a/src/simulation/elements/LNTG.cpp +++ b/src/simulation/elements/LNTG.cpp @@ -4,7 +4,7 @@ void Element::Element_LNTG() { Identifier = "DEFAULT_PT_LNTG"; Name = "LN2"; - Colour = PIXPACK(0x80A0DF); + Colour = 0x80A0DF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/LO2.cpp b/src/simulation/elements/LO2.cpp index 9efc2acb7..41e975408 100644 --- a/src/simulation/elements/LO2.cpp +++ b/src/simulation/elements/LO2.cpp @@ -4,7 +4,7 @@ void Element::Element_LO2() { Identifier = "DEFAULT_PT_LO2"; Name = "LOXY"; - Colour = PIXPACK(0x80A0EF); + Colour = 0x80A0EF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp index abd9d598e..e35cdab89 100644 --- a/src/simulation/elements/LOLZ.cpp +++ b/src/simulation/elements/LOLZ.cpp @@ -4,7 +4,7 @@ void Element::Element_LOLZ() { Identifier = "DEFAULT_PT_LOLZ"; Name = "LOLZ"; - Colour = PIXPACK(0x569212); + Colour = 0x569212_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp index 9e1c6c040..d610588ba 100644 --- a/src/simulation/elements/LOVE.cpp +++ b/src/simulation/elements/LOVE.cpp @@ -4,7 +4,7 @@ void Element::Element_LOVE() { Identifier = "DEFAULT_PT_LOVE"; Name = "LOVE"; - Colour = PIXPACK(0xFF30FF); + Colour = 0xFF30FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/LRBD.cpp b/src/simulation/elements/LRBD.cpp index b7716ac86..990644438 100644 --- a/src/simulation/elements/LRBD.cpp +++ b/src/simulation/elements/LRBD.cpp @@ -4,7 +4,7 @@ void Element::Element_LRBD() { Identifier = "DEFAULT_PT_LRBD"; Name = "LRBD"; - Colour = PIXPACK(0xAAAAAA); + Colour = 0xAAAAAA_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/LSNS.cpp b/src/simulation/elements/LSNS.cpp index f65a956d2..70f898493 100644 --- a/src/simulation/elements/LSNS.cpp +++ b/src/simulation/elements/LSNS.cpp @@ -6,7 +6,7 @@ void Element::Element_LSNS() { Identifier = "DEFAULT_PT_LSNS"; Name = "LSNS"; - Colour = PIXPACK(0x336699); + Colour = 0x336699_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/MERC.cpp b/src/simulation/elements/MERC.cpp index b32c6a153..34ef379fc 100644 --- a/src/simulation/elements/MERC.cpp +++ b/src/simulation/elements/MERC.cpp @@ -6,7 +6,7 @@ void Element::Element_MERC() { Identifier = "DEFAULT_PT_MERC"; Name = "MERC"; - Colour = PIXPACK(0x736B6D); + Colour = 0x736B6D_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/METL.cpp b/src/simulation/elements/METL.cpp index 44ff6a98a..5633e14fe 100644 --- a/src/simulation/elements/METL.cpp +++ b/src/simulation/elements/METL.cpp @@ -4,7 +4,7 @@ void Element::Element_METL() { Identifier = "DEFAULT_PT_METL"; Name = "METL"; - Colour = PIXPACK(0x404060); + Colour = 0x404060_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/MORT.cpp b/src/simulation/elements/MORT.cpp index 925056ad6..af352fa71 100644 --- a/src/simulation/elements/MORT.cpp +++ b/src/simulation/elements/MORT.cpp @@ -6,7 +6,7 @@ void Element::Element_MORT() { Identifier = "DEFAULT_PT_MORT"; Name = "MORT"; - Colour = PIXPACK(0xE0E0E0); + Colour = 0xE0E0E0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/MWAX.cpp b/src/simulation/elements/MWAX.cpp index 64d0d3e26..01621bf39 100644 --- a/src/simulation/elements/MWAX.cpp +++ b/src/simulation/elements/MWAX.cpp @@ -4,7 +4,7 @@ void Element::Element_MWAX() { Identifier = "DEFAULT_PT_MWAX"; Name = "MWAX"; - Colour = PIXPACK(0xE0E0AA); + Colour = 0xE0E0AA_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/NBHL.cpp b/src/simulation/elements/NBHL.cpp index 8461682d6..bd18cd665 100644 --- a/src/simulation/elements/NBHL.cpp +++ b/src/simulation/elements/NBHL.cpp @@ -6,7 +6,7 @@ void Element::Element_NBHL() { Identifier = "DEFAULT_PT_NBHL"; Name = "BHOL"; - Colour = PIXPACK(0x202020); + Colour = 0x202020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/NBLE.cpp b/src/simulation/elements/NBLE.cpp index 7660619fc..f2bfbd115 100644 --- a/src/simulation/elements/NBLE.cpp +++ b/src/simulation/elements/NBLE.cpp @@ -6,7 +6,7 @@ void Element::Element_NBLE() { Identifier = "DEFAULT_PT_NBLE"; Name = "NBLE"; - Colour = PIXPACK(0xEB4917); + Colour = 0xEB4917_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp index 003a9313a..dfccc6602 100644 --- a/src/simulation/elements/NEUT.cpp +++ b/src/simulation/elements/NEUT.cpp @@ -10,7 +10,7 @@ void Element::Element_NEUT() { Identifier = "DEFAULT_PT_NEUT"; Name = "NEUT"; - Colour = PIXPACK(0x20E0FF); + Colour = 0x20E0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/NICE.cpp b/src/simulation/elements/NICE.cpp index 5dd893f24..d6381e175 100644 --- a/src/simulation/elements/NICE.cpp +++ b/src/simulation/elements/NICE.cpp @@ -4,7 +4,7 @@ void Element::Element_NICE() { Identifier = "DEFAULT_PT_NICE"; Name = "NICE"; - Colour = PIXPACK(0xC0E0FF); + Colour = 0xC0E0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/NITR.cpp b/src/simulation/elements/NITR.cpp index df3c1dc84..b9732fbd2 100644 --- a/src/simulation/elements/NITR.cpp +++ b/src/simulation/elements/NITR.cpp @@ -4,7 +4,7 @@ void Element::Element_NITR() { Identifier = "DEFAULT_PT_NITR"; Name = "NITR"; - Colour = PIXPACK(0x20E010); + Colour = 0x20E010_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/NONE.cpp b/src/simulation/elements/NONE.cpp index f7a82aaa4..81ef2b18f 100644 --- a/src/simulation/elements/NONE.cpp +++ b/src/simulation/elements/NONE.cpp @@ -6,7 +6,7 @@ void Element::Element_NONE() { Identifier = "DEFAULT_PT_NONE"; Name = "NONE"; - Colour = PIXPACK(0x000000); + Colour = 0x000000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/NSCN.cpp b/src/simulation/elements/NSCN.cpp index f0e45749b..2d1849283 100644 --- a/src/simulation/elements/NSCN.cpp +++ b/src/simulation/elements/NSCN.cpp @@ -4,7 +4,7 @@ void Element::Element_NSCN() { Identifier = "DEFAULT_PT_NSCN"; Name = "NSCN"; - Colour = PIXPACK(0x505080); + Colour = 0x505080_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/NTCT.cpp b/src/simulation/elements/NTCT.cpp index df7888467..45b2a019b 100644 --- a/src/simulation/elements/NTCT.cpp +++ b/src/simulation/elements/NTCT.cpp @@ -6,7 +6,7 @@ void Element::Element_NTCT() { Identifier = "DEFAULT_PT_NTCT"; Name = "NTCT"; - Colour = PIXPACK(0x505040); + Colour = 0x505040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/NWHL.cpp b/src/simulation/elements/NWHL.cpp index dd6176252..178247313 100644 --- a/src/simulation/elements/NWHL.cpp +++ b/src/simulation/elements/NWHL.cpp @@ -6,7 +6,7 @@ void Element::Element_NWHL() { Identifier = "DEFAULT_PT_NWHL"; Name = "WHOL"; - Colour = PIXPACK(0xFFFFFF); + Colour = 0xFFFFFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/O2.cpp b/src/simulation/elements/O2.cpp index f8cb9c1a4..a876b0f32 100644 --- a/src/simulation/elements/O2.cpp +++ b/src/simulation/elements/O2.cpp @@ -6,7 +6,7 @@ void Element::Element_O2() { Identifier = "DEFAULT_PT_O2"; Name = "OXYG"; - Colour = PIXPACK(0x80A0FF); + Colour = 0x80A0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/OIL.cpp b/src/simulation/elements/OIL.cpp index 26e0dfbfa..64843aa89 100644 --- a/src/simulation/elements/OIL.cpp +++ b/src/simulation/elements/OIL.cpp @@ -4,7 +4,7 @@ void Element::Element_OIL() { Identifier = "DEFAULT_PT_OIL"; Name = "OIL"; - Colour = PIXPACK(0x404010); + Colour = 0x404010_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp index 5bcf88a11..d16bd97ab 100644 --- a/src/simulation/elements/PBCN.cpp +++ b/src/simulation/elements/PBCN.cpp @@ -8,7 +8,7 @@ void Element::Element_PBCN() { Identifier = "DEFAULT_PT_PBCN"; Name = "PBCN"; - Colour = PIXPACK(0x3B1D0A); + Colour = 0x3B1D0A_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp index b90af3bc2..83bd84333 100644 --- a/src/simulation/elements/PCLN.cpp +++ b/src/simulation/elements/PCLN.cpp @@ -8,7 +8,7 @@ void Element::Element_PCLN() { Identifier = "DEFAULT_PT_PCLN"; Name = "PCLN"; - Colour = PIXPACK(0x3B3B0A); + Colour = 0x3B3B0A_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp index 242b7aa52..6a01163b5 100644 --- a/src/simulation/elements/PHOT.cpp +++ b/src/simulation/elements/PHOT.cpp @@ -9,7 +9,7 @@ void Element::Element_PHOT() { Identifier = "DEFAULT_PT_PHOT"; Name = "PHOT"; - Colour = PIXPACK(0xFFFFFF); + Colour = 0xFFFFFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/PIPE.cpp b/src/simulation/elements/PIPE.cpp index aced13a49..c699bd85e 100644 --- a/src/simulation/elements/PIPE.cpp +++ b/src/simulation/elements/PIPE.cpp @@ -12,7 +12,7 @@ void Element::Element_PIPE() { Identifier = "DEFAULT_PT_PIPE"; Name = "PIPE"; - Colour = PIXPACK(0x444444); + Colour = 0x444444_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; @@ -382,9 +382,10 @@ int Element_PIPE_graphics(GRAPHICS_FUNC_ARGS) cpart->tmp = tpart.tmp3; cpart->ctype = tpart.tmp4; - *colr = PIXR(ren->sim->elements[t].Colour); - *colg = PIXG(ren->sim->elements[t].Colour); - *colb = PIXB(ren->sim->elements[t].Colour); + auto colour = RGB::Unpack(ren->sim->elements[t].Colour); + *colr = colour.Red; + *colg = colour.Green; + *colb = colour.Blue; if (ren->sim->elements[t].Graphics) { (*(ren->sim->elements[t].Graphics))(ren, cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb); @@ -397,9 +398,6 @@ int Element_PIPE_graphics(GRAPHICS_FUNC_ARGS) // Restore original particle data. *cpart = tpart; } - //*colr = PIXR(elements[t].pcolors); - //*colg = PIXG(elements[t].pcolors); - //*colb = PIXB(elements[t].pcolors); } else { diff --git a/src/simulation/elements/PLEX.cpp b/src/simulation/elements/PLEX.cpp index 579955471..b6bdfb372 100644 --- a/src/simulation/elements/PLEX.cpp +++ b/src/simulation/elements/PLEX.cpp @@ -4,7 +4,7 @@ void Element::Element_PLEX() { Identifier = "DEFAULT_PT_PLEX"; Name = "C-4"; - Colour = PIXPACK(0xD080E0); + Colour = 0xD080E0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index a8ae1a92d..4e56b31c7 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -8,7 +8,7 @@ void Element::Element_PLNT() { Identifier = "DEFAULT_PT_PLNT"; Name = "PLNT"; - Colour = PIXPACK(0x0CAC00); + Colour = 0x0CAC00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/PLSM.cpp b/src/simulation/elements/PLSM.cpp index 1c70cb664..e78d0af49 100644 --- a/src/simulation/elements/PLSM.cpp +++ b/src/simulation/elements/PLSM.cpp @@ -8,7 +8,7 @@ void Element::Element_PLSM() { Identifier = "DEFAULT_PT_PLSM"; Name = "PLSM"; - Colour = PIXPACK(0xBB99FF); + Colour = 0xBB99FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; @@ -52,10 +52,10 @@ void Element::Element_PLSM() static int graphics(GRAPHICS_FUNC_ARGS) { - auto color = Renderer::plasmaTableAt(cpart->life); - *colr = PIXR(color); - *colg = PIXG(color); - *colb = PIXB(color); + auto color = RGB::Unpack(Renderer::plasmaTableAt(cpart->life)); + *colr = color.Red; + *colg = color.Green; + *colb = color.Blue; *firea = 255; *firer = *colr; diff --git a/src/simulation/elements/PLUT.cpp b/src/simulation/elements/PLUT.cpp index 273315458..291149e1e 100644 --- a/src/simulation/elements/PLUT.cpp +++ b/src/simulation/elements/PLUT.cpp @@ -6,7 +6,7 @@ void Element::Element_PLUT() { Identifier = "DEFAULT_PT_PLUT"; Name = "PLUT"; - Colour = PIXPACK(0x407020); + Colour = 0x407020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/POLO.cpp b/src/simulation/elements/POLO.cpp index 1e57553ec..2f9427db1 100644 --- a/src/simulation/elements/POLO.cpp +++ b/src/simulation/elements/POLO.cpp @@ -7,7 +7,7 @@ void Element::Element_POLO() { Identifier = "DEFAULT_PT_POLO"; Name = "POLO"; - Colour = PIXPACK(0x506030); + Colour = 0x506030_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/PPIP.cpp b/src/simulation/elements/PPIP.cpp index 251b52447..67246d9fe 100644 --- a/src/simulation/elements/PPIP.cpp +++ b/src/simulation/elements/PPIP.cpp @@ -7,7 +7,7 @@ void Element::Element_PPIP() { Identifier = "DEFAULT_PT_PPIP"; Name = "PPIP"; - Colour = PIXPACK(0x444466); + Colour = 0x444466_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp index d5cd5ba23..2694e5c26 100644 --- a/src/simulation/elements/PQRT.cpp +++ b/src/simulation/elements/PQRT.cpp @@ -8,7 +8,7 @@ void Element::Element_PQRT() { Identifier = "DEFAULT_PT_PQRT"; Name = "PQRT"; - Colour = PIXPACK(0x88BBBB); + Colour = 0x88BBBB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index d464260d2..029c18a9e 100644 --- a/src/simulation/elements/PROT.cpp +++ b/src/simulation/elements/PROT.cpp @@ -9,7 +9,7 @@ void Element::Element_PROT() { Identifier = "DEFAULT_PT_PROT"; Name = "PROT"; - Colour = PIXPACK(0x990000); + Colour = 0x990000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp index ab5060c86..90ce48000 100644 --- a/src/simulation/elements/PRTI.cpp +++ b/src/simulation/elements/PRTI.cpp @@ -9,7 +9,7 @@ void Element::Element_PRTI() { Identifier = "DEFAULT_PT_PRTI"; Name = "PRTI"; - Colour = PIXPACK(0xEB5917); + Colour = 0xEB5917_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/PRTO.cpp b/src/simulation/elements/PRTO.cpp index 07ef0db6a..ca8de45ed 100644 --- a/src/simulation/elements/PRTO.cpp +++ b/src/simulation/elements/PRTO.cpp @@ -7,7 +7,7 @@ void Element::Element_PRTO() { Identifier = "DEFAULT_PT_PRTO"; Name = "PRTO"; - Colour = PIXPACK(0x0020EB); + Colour = 0x0020EB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/PSCN.cpp b/src/simulation/elements/PSCN.cpp index b5a5900c9..3616a9dcf 100644 --- a/src/simulation/elements/PSCN.cpp +++ b/src/simulation/elements/PSCN.cpp @@ -4,7 +4,7 @@ void Element::Element_PSCN() { Identifier = "DEFAULT_PT_PSCN"; Name = "PSCN"; - Colour = PIXPACK(0x805050); + Colour = 0x805050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/PSNS.cpp b/src/simulation/elements/PSNS.cpp index 65997816f..1ae6b159f 100644 --- a/src/simulation/elements/PSNS.cpp +++ b/src/simulation/elements/PSNS.cpp @@ -6,7 +6,7 @@ void Element::Element_PSNS() { Identifier = "DEFAULT_PT_PSNS"; Name = "PSNS"; - Colour = PIXPACK(0xDB2020); + Colour = 0xDB2020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/PSTE.cpp b/src/simulation/elements/PSTE.cpp index 09b3791c3..ada68fd02 100644 --- a/src/simulation/elements/PSTE.cpp +++ b/src/simulation/elements/PSTE.cpp @@ -4,7 +4,7 @@ void Element::Element_PSTE() { Identifier = "DEFAULT_PT_PSTE"; Name = "PSTE"; - Colour = PIXPACK(0xAA99AA); + Colour = 0xAA99AA_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp index 1a444c9c2..365122e83 100644 --- a/src/simulation/elements/PSTN.cpp +++ b/src/simulation/elements/PSTN.cpp @@ -12,7 +12,7 @@ void Element::Element_PSTN() { Identifier = "DEFAULT_PT_PSTN"; Name = "PSTN"; - Colour = PIXPACK(0xAA9999); + Colour = 0xAA9999_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/PSTS.cpp b/src/simulation/elements/PSTS.cpp index 816f046f0..384cb8d17 100644 --- a/src/simulation/elements/PSTS.cpp +++ b/src/simulation/elements/PSTS.cpp @@ -4,7 +4,7 @@ void Element::Element_PSTS() { Identifier = "DEFAULT_PT_PSTS"; Name = "PSTS"; - Colour = PIXPACK(0x776677); + Colour = 0x776677_rgb .Pack(); MenuVisible = 0; MenuSection = SC_CRACKER; Enabled = 1; diff --git a/src/simulation/elements/PTCT.cpp b/src/simulation/elements/PTCT.cpp index bc5dadb69..b892f1755 100644 --- a/src/simulation/elements/PTCT.cpp +++ b/src/simulation/elements/PTCT.cpp @@ -6,7 +6,7 @@ void Element::Element_PTCT() { Identifier = "DEFAULT_PT_PTCT"; Name = "PTCT"; - Colour = PIXPACK(0x405050); + Colour = 0x405050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/PTNM.cpp b/src/simulation/elements/PTNM.cpp index 37e790083..a883251d3 100644 --- a/src/simulation/elements/PTNM.cpp +++ b/src/simulation/elements/PTNM.cpp @@ -8,7 +8,7 @@ void Element::Element_PTNM() { Identifier = "DEFAULT_PT_PTNM"; Name = "PTNM"; - Colour = PIXPACK(0xD5E0EB); + Colour = 0xD5E0EB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/PUMP.cpp b/src/simulation/elements/PUMP.cpp index 27531cacf..a8420377e 100644 --- a/src/simulation/elements/PUMP.cpp +++ b/src/simulation/elements/PUMP.cpp @@ -7,7 +7,7 @@ void Element::Element_PUMP() { Identifier = "DEFAULT_PT_PUMP"; Name = "PUMP"; - Colour = PIXPACK(0x0A0A3B); + Colour = 0x0A0A3B_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/PVOD.cpp b/src/simulation/elements/PVOD.cpp index 457c06bf9..1c4d621ff 100644 --- a/src/simulation/elements/PVOD.cpp +++ b/src/simulation/elements/PVOD.cpp @@ -7,7 +7,7 @@ void Element::Element_PVOD() { Identifier = "DEFAULT_PT_PVOD"; Name = "PVOD"; - Colour = PIXPACK(0x792020); + Colour = 0x792020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/QRTZ.cpp b/src/simulation/elements/QRTZ.cpp index ca1e9e860..3f1109808 100644 --- a/src/simulation/elements/QRTZ.cpp +++ b/src/simulation/elements/QRTZ.cpp @@ -8,7 +8,7 @@ void Element::Element_QRTZ() { Identifier = "DEFAULT_PT_QRTZ"; Name = "QRTZ"; - Colour = PIXPACK(0xAADDDD); + Colour = 0xAADDDD_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/RBDM.cpp b/src/simulation/elements/RBDM.cpp index 395274b81..04392a288 100644 --- a/src/simulation/elements/RBDM.cpp +++ b/src/simulation/elements/RBDM.cpp @@ -4,7 +4,7 @@ void Element::Element_RBDM() { Identifier = "DEFAULT_PT_RBDM"; Name = "RBDM"; - Colour = PIXPACK(0xCCCCCC); + Colour = 0xCCCCCC_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/RFGL.cpp b/src/simulation/elements/RFGL.cpp index 16a95ae69..13a55f5a5 100644 --- a/src/simulation/elements/RFGL.cpp +++ b/src/simulation/elements/RFGL.cpp @@ -6,7 +6,7 @@ void Element::Element_RFGL() { Identifier = "DEFAULT_PT_RFGL"; Name = "RFGL"; - Colour = PIXPACK(0x84C2CF); + Colour = 0x84C2CF_rgb .Pack(); MenuVisible = 0; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/RFRG.cpp b/src/simulation/elements/RFRG.cpp index f072b3a88..b4e72d6f8 100644 --- a/src/simulation/elements/RFRG.cpp +++ b/src/simulation/elements/RFRG.cpp @@ -6,7 +6,7 @@ void Element::Element_RFRG() { Identifier = "DEFAULT_PT_RFRG"; Name = "RFRG"; - Colour = PIXPACK(0x72D2D4); + Colour = 0x72D2D4_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/RIME.cpp b/src/simulation/elements/RIME.cpp index ab0e5afab..12369e5fd 100644 --- a/src/simulation/elements/RIME.cpp +++ b/src/simulation/elements/RIME.cpp @@ -6,7 +6,7 @@ void Element::Element_RIME() { Identifier = "DEFAULT_PT_RIME"; Name = "RIME"; - Colour = PIXPACK(0xCCCCCC); + Colour = 0xCCCCCC_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/ROCK.cpp b/src/simulation/elements/ROCK.cpp index e7a4a4263..a72bca961 100644 --- a/src/simulation/elements/ROCK.cpp +++ b/src/simulation/elements/ROCK.cpp @@ -7,7 +7,7 @@ void Element::Element_ROCK() { Identifier = "DEFAULT_PT_ROCK"; Name = "ROCK"; - Colour = PIXPACK(0x727272); + Colour = 0x727272_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/RPEL.cpp b/src/simulation/elements/RPEL.cpp index bc6177400..e2b5f8335 100644 --- a/src/simulation/elements/RPEL.cpp +++ b/src/simulation/elements/RPEL.cpp @@ -6,7 +6,7 @@ void Element::Element_RPEL() { Identifier = "DEFAULT_PT_RPEL"; Name = "RPEL"; - Colour = PIXPACK(0x99CC00); + Colour = 0x99CC00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_FORCE; Enabled = 1; diff --git a/src/simulation/elements/SALT.cpp b/src/simulation/elements/SALT.cpp index 9e4f0c89a..7e6d07b6a 100644 --- a/src/simulation/elements/SALT.cpp +++ b/src/simulation/elements/SALT.cpp @@ -4,7 +4,7 @@ void Element::Element_SALT() { Identifier = "DEFAULT_PT_SALT"; Name = "SALT"; - Colour = PIXPACK(0xFFFFFF); + Colour = 0xFFFFFF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/SAND.cpp b/src/simulation/elements/SAND.cpp index 14c6e50db..418bf854f 100644 --- a/src/simulation/elements/SAND.cpp +++ b/src/simulation/elements/SAND.cpp @@ -4,7 +4,7 @@ void Element::Element_SAND() { Identifier = "DEFAULT_PT_SAND"; Name = "SAND"; - Colour = PIXPACK(0xFFD090); + Colour = 0xFFD090_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/SAWD.cpp b/src/simulation/elements/SAWD.cpp index cbbd8378d..e8036178e 100644 --- a/src/simulation/elements/SAWD.cpp +++ b/src/simulation/elements/SAWD.cpp @@ -4,7 +4,7 @@ void Element::Element_SAWD() { Identifier = "DEFAULT_PT_SAWD"; Name = "SAWD"; - Colour = PIXPACK(0xF0F0A0); + Colour = 0xF0F0A0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/SHLD1.cpp b/src/simulation/elements/SHLD1.cpp index f660e6803..d40083648 100644 --- a/src/simulation/elements/SHLD1.cpp +++ b/src/simulation/elements/SHLD1.cpp @@ -6,7 +6,7 @@ void Element::Element_SHLD1() { Identifier = "DEFAULT_PT_SHLD1"; Name = "SHLD"; - Colour = PIXPACK(0xAAAAAA); + Colour = 0xAAAAAA_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/SHLD2.cpp b/src/simulation/elements/SHLD2.cpp index 662c97b69..f8a882b4b 100644 --- a/src/simulation/elements/SHLD2.cpp +++ b/src/simulation/elements/SHLD2.cpp @@ -6,7 +6,7 @@ void Element::Element_SHLD2() { Identifier = "DEFAULT_PT_SHLD2"; Name = "SHD2"; - Colour = PIXPACK(0x777777); + Colour = 0x777777_rgb .Pack(); MenuVisible = 0; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/SHLD3.cpp b/src/simulation/elements/SHLD3.cpp index c79435c86..9f4588c88 100644 --- a/src/simulation/elements/SHLD3.cpp +++ b/src/simulation/elements/SHLD3.cpp @@ -6,7 +6,7 @@ void Element::Element_SHLD3() { Identifier = "DEFAULT_PT_SHLD3"; Name = "SHD3"; - Colour = PIXPACK(0x444444); + Colour = 0x444444_rgb .Pack(); MenuVisible = 0; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/SHLD4.cpp b/src/simulation/elements/SHLD4.cpp index cf9ce179f..73e1f9fbc 100644 --- a/src/simulation/elements/SHLD4.cpp +++ b/src/simulation/elements/SHLD4.cpp @@ -6,7 +6,7 @@ void Element::Element_SHLD4() { Identifier = "DEFAULT_PT_SHLD4"; Name = "SHD4"; - Colour = PIXPACK(0x212121); + Colour = 0x212121_rgb .Pack(); MenuVisible = 0; MenuSection = SC_CRACKER2; Enabled = 1; diff --git a/src/simulation/elements/SING.cpp b/src/simulation/elements/SING.cpp index 904bc22e0..7431b1b61 100644 --- a/src/simulation/elements/SING.cpp +++ b/src/simulation/elements/SING.cpp @@ -7,7 +7,7 @@ void Element::Element_SING() { Identifier = "DEFAULT_PT_SING"; Name = "SING"; - Colour = PIXPACK(0x242424); + Colour = 0x242424_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/SLCN.cpp b/src/simulation/elements/SLCN.cpp index fe3e6e703..2cf1f8fdc 100644 --- a/src/simulation/elements/SLCN.cpp +++ b/src/simulation/elements/SLCN.cpp @@ -8,7 +8,7 @@ void Element::Element_SLCN() { Identifier = "DEFAULT_PT_SLCN"; Name = "SLCN"; - Colour = PIXPACK(0xBCCDDF); + Colour = 0xBCCDDF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; @@ -50,10 +50,10 @@ void Element::Element_SLCN() } static const int SLCN_COLOUR[16] = { - PIXPACK(0x5A6679), PIXPACK(0x6878A1), PIXPACK(0xABBFDD), PIXPACK(0x838490), - PIXPACK(0xBCCDDF), PIXPACK(0x82A0D2), PIXPACK(0x5B6680), PIXPACK(0x232C3B), - PIXPACK(0x485067), PIXPACK(0x8B9AB6), PIXPACK(0xADB1C1), PIXPACK(0xC3C6D1), - PIXPACK(0x8594AD), PIXPACK(0x262F47), PIXPACK(0xA9AEBC), PIXPACK(0xC2E1F7), + 0x5A6679_rgb .Pack(), 0x6878A1_rgb .Pack(), 0xABBFDD_rgb .Pack(), 0x838490_rgb .Pack(), + 0xBCCDDF_rgb .Pack(), 0x82A0D2_rgb .Pack(), 0x5B6680_rgb .Pack(), 0x232C3B_rgb .Pack(), + 0x485067_rgb .Pack(), 0x8B9AB6_rgb .Pack(), 0xADB1C1_rgb .Pack(), 0xC3C6D1_rgb .Pack(), + 0x8594AD_rgb .Pack(), 0x262F47_rgb .Pack(), 0xA9AEBC_rgb .Pack(), 0xC2E1F7_rgb .Pack(), }; static void initSparkles(Simulation *sim, Particle &part) @@ -108,19 +108,19 @@ static int update(UPDATE_FUNC_ARGS) static int graphics(GRAPHICS_FUNC_ARGS) { - int curr_colour = SLCN_COLOUR[(cpart->tmp >> 12) & 15]; + auto curr_colour = RGB::Unpack(SLCN_COLOUR[(cpart->tmp >> 12) & 15]); if (cpart->tmp & 0x800) // mix with next colour if phase is at least halfway there { - int next_colour = SLCN_COLOUR[(cpart->tmp >> 16) & 15]; - curr_colour = PIXRGB( - (PIXR(curr_colour) + PIXR(next_colour)) / 2, - (PIXG(curr_colour) + PIXG(next_colour)) / 2, - (PIXB(curr_colour) + PIXB(next_colour)) / 2 + auto next_colour = RGB::Unpack(SLCN_COLOUR[(cpart->tmp >> 16) & 15]); + curr_colour = RGB( + (curr_colour.Red + next_colour.Red) / 2, + (curr_colour.Green + next_colour.Green) / 2, + (curr_colour.Blue + next_colour.Blue) / 2 ); } - *colr = PIXR(curr_colour); - *colg = PIXG(curr_colour); - *colb = PIXB(curr_colour); + *colr = curr_colour.Red; + *colg = curr_colour.Green; + *colb = curr_colour.Blue; int rnd = (cpart->tmp & 0xFFFF) * ((cpart->tmp >> 16) & 0xFFFF); if (!(rnd % 887)) diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp index 950095425..572396426 100644 --- a/src/simulation/elements/SLTW.cpp +++ b/src/simulation/elements/SLTW.cpp @@ -6,7 +6,7 @@ void Element::Element_SLTW() { Identifier = "DEFAULT_PT_SLTW"; Name = "SLTW"; - Colour = PIXPACK(0x4050F0); + Colour = 0x4050F0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/SMKE.cpp b/src/simulation/elements/SMKE.cpp index 82fde602e..da7401a8e 100644 --- a/src/simulation/elements/SMKE.cpp +++ b/src/simulation/elements/SMKE.cpp @@ -6,7 +6,7 @@ void Element::Element_SMKE() { Identifier = "DEFAULT_PT_SMKE"; Name = "SMKE"; - Colour = PIXPACK(0x222222); + Colour = 0x222222_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/SNOW.cpp b/src/simulation/elements/SNOW.cpp index 414e719fe..dd78e1c3f 100644 --- a/src/simulation/elements/SNOW.cpp +++ b/src/simulation/elements/SNOW.cpp @@ -6,7 +6,7 @@ void Element::Element_SNOW() { Identifier = "DEFAULT_PT_SNOW"; Name = "SNOW"; - Colour = PIXPACK(0xC0E0FF); + Colour = 0xC0E0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp index bed250fb7..9b4d017cc 100644 --- a/src/simulation/elements/SOAP.cpp +++ b/src/simulation/elements/SOAP.cpp @@ -8,7 +8,7 @@ void Element::Element_SOAP() { Identifier = "DEFAULT_PT_SOAP"; Name = "SOAP"; - Colour = PIXPACK(0xF5F5DC); + Colour = 0xF5F5DC_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/SPAWN.cpp b/src/simulation/elements/SPAWN.cpp index 2641151ac..8ab3c0f42 100644 --- a/src/simulation/elements/SPAWN.cpp +++ b/src/simulation/elements/SPAWN.cpp @@ -7,7 +7,7 @@ void Element::Element_SPAWN() { Identifier = "DEFAULT_PT_SPAWN"; Name = "SPWN"; - Colour = PIXPACK(0xAAAAAA); + Colour = 0xAAAAAA_rgb .Pack(); MenuVisible = 0; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/SPAWN2.cpp b/src/simulation/elements/SPAWN2.cpp index db5d66bd7..bac9664a5 100644 --- a/src/simulation/elements/SPAWN2.cpp +++ b/src/simulation/elements/SPAWN2.cpp @@ -7,7 +7,7 @@ void Element::Element_SPAWN2() { Identifier = "DEFAULT_PT_SPAWN2"; Name = "SPWN2"; - Colour = PIXPACK(0xAAAAAA); + Colour = 0xAAAAAA_rgb .Pack(); MenuVisible = 0; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp index b2c7e1001..984905cc5 100644 --- a/src/simulation/elements/SPNG.cpp +++ b/src/simulation/elements/SPNG.cpp @@ -7,7 +7,7 @@ void Element::Element_SPNG() { Identifier = "DEFAULT_PT_SPNG"; Name = "SPNG"; - Colour = PIXPACK(0xFFBE30); + Colour = 0xFFBE30_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index de19e6607..ff4e40544 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -8,7 +8,7 @@ void Element::Element_SPRK() { Identifier = "DEFAULT_PT_SPRK"; Name = "SPRK"; - Colour = PIXPACK(0xFFFF80); + Colour = 0xFFFF80_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp index 7ee9f9fde..2a26b5ae5 100644 --- a/src/simulation/elements/STKM.cpp +++ b/src/simulation/elements/STKM.cpp @@ -14,7 +14,7 @@ void Element::Element_STKM() { Identifier = "DEFAULT_PT_STKM"; Name = "STKM"; - Colour = PIXPACK(0xFFE0A0); + Colour = 0xFFE0A0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/STKM2.cpp b/src/simulation/elements/STKM2.cpp index 5e94525f0..e834250a0 100644 --- a/src/simulation/elements/STKM2.cpp +++ b/src/simulation/elements/STKM2.cpp @@ -12,7 +12,7 @@ void Element::Element_STKM2() { Identifier = "DEFAULT_PT_STKM2"; Name = "STK2"; - Colour = PIXPACK(0x6464FF); + Colour = 0x6464FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/STNE.cpp b/src/simulation/elements/STNE.cpp index a2cad3952..ece1d7e50 100644 --- a/src/simulation/elements/STNE.cpp +++ b/src/simulation/elements/STNE.cpp @@ -4,7 +4,7 @@ void Element::Element_STNE() { Identifier = "DEFAULT_PT_STNE"; Name = "STNE"; - Colour = PIXPACK(0xA0A0A0); + Colour = 0xA0A0A0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp index d0cbaebbf..68addc89c 100644 --- a/src/simulation/elements/STOR.cpp +++ b/src/simulation/elements/STOR.cpp @@ -9,7 +9,7 @@ void Element::Element_STOR() { Identifier = "DEFAULT_PT_STOR"; Name = "STOR"; - Colour = PIXPACK(0x50DFDF); + Colour = 0x50DFDF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWERED; Enabled = 1; diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp index 6e84b9004..77014ecf3 100644 --- a/src/simulation/elements/SWCH.cpp +++ b/src/simulation/elements/SWCH.cpp @@ -7,7 +7,7 @@ void Element::Element_SWCH() { Identifier = "DEFAULT_PT_SWCH"; Name = "SWCH"; - Colour = PIXPACK(0x103B11); + Colour = 0x103B11_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/TESC.cpp b/src/simulation/elements/TESC.cpp index 4333ee154..fada2981e 100644 --- a/src/simulation/elements/TESC.cpp +++ b/src/simulation/elements/TESC.cpp @@ -6,7 +6,7 @@ void Element::Element_TESC() { Identifier = "DEFAULT_PT_TESC"; Name = "TESC"; - Colour = PIXPACK(0x707040); + Colour = 0x707040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/THDR.cpp b/src/simulation/elements/THDR.cpp index 7dd937132..c02abe5ff 100644 --- a/src/simulation/elements/THDR.cpp +++ b/src/simulation/elements/THDR.cpp @@ -7,7 +7,7 @@ void Element::Element_THDR() { Identifier = "DEFAULT_PT_THDR"; Name = "THDR"; - Colour = PIXPACK(0xFFFFA0); + Colour = 0xFFFFA0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/THRM.cpp b/src/simulation/elements/THRM.cpp index c421f0269..6cb9747fc 100644 --- a/src/simulation/elements/THRM.cpp +++ b/src/simulation/elements/THRM.cpp @@ -4,7 +4,7 @@ void Element::Element_THRM() { Identifier = "DEFAULT_PT_THRM"; Name = "THRM"; - Colour = PIXPACK(0xA08090); + Colour = 0xA08090_rgb .Pack(); MenuVisible = 1; MenuSection = SC_EXPLOSIVE; Enabled = 1; diff --git a/src/simulation/elements/TRON.cpp b/src/simulation/elements/TRON.cpp index 171e27293..a5d5ad1fa 100644 --- a/src/simulation/elements/TRON.cpp +++ b/src/simulation/elements/TRON.cpp @@ -12,7 +12,7 @@ void Element::Element_TRON() { Identifier = "DEFAULT_PT_TRON"; Name = "TRON"; - Colour = PIXPACK(0xA9FF00); + Colour = 0xA9FF00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp index a554d6501..ff5cfc567 100644 --- a/src/simulation/elements/TSNS.cpp +++ b/src/simulation/elements/TSNS.cpp @@ -6,7 +6,7 @@ void Element::Element_TSNS() { Identifier = "DEFAULT_PT_TSNS"; Name = "TSNS"; - Colour = PIXPACK(0xFD00D5); + Colour = 0xFD00D5_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp index 0b9c46a00..972f30a72 100644 --- a/src/simulation/elements/TTAN.cpp +++ b/src/simulation/elements/TTAN.cpp @@ -7,7 +7,7 @@ void Element::Element_TTAN() { Identifier = "DEFAULT_PT_TTAN"; Name = "TTAN"; - Colour = PIXPACK(0x909090); + Colour = 0x909090_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/TUNG.cpp b/src/simulation/elements/TUNG.cpp index 8166ac1e3..f676d44f8 100644 --- a/src/simulation/elements/TUNG.cpp +++ b/src/simulation/elements/TUNG.cpp @@ -9,7 +9,7 @@ void Element::Element_TUNG() { Identifier = "DEFAULT_PT_TUNG"; Name = "TUNG"; - Colour = PIXPACK(0x505050); + Colour = 0x505050_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/URAN.cpp b/src/simulation/elements/URAN.cpp index e7fd50dca..245963378 100644 --- a/src/simulation/elements/URAN.cpp +++ b/src/simulation/elements/URAN.cpp @@ -6,7 +6,7 @@ void Element::Element_URAN() { Identifier = "DEFAULT_PT_URAN"; Name = "URAN"; - Colour = PIXPACK(0x707020); + Colour = 0x707020_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 51b8168da..e0ef6523d 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -7,7 +7,7 @@ void Element::Element_VIBR() { Identifier = "DEFAULT_PT_VIBR"; Name = "VIBR"; - Colour = PIXPACK(0x005000); + Colour = 0x005000_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp index 82377ac21..1076b5597 100644 --- a/src/simulation/elements/VINE.cpp +++ b/src/simulation/elements/VINE.cpp @@ -8,7 +8,7 @@ void Element::Element_VINE() { Identifier = "DEFAULT_PT_VINE"; Name = "VINE"; - Colour = PIXPACK(0x079A00); + Colour = 0x079A00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/VIRS.cpp b/src/simulation/elements/VIRS.cpp index 75f87d1dc..fa62ba294 100644 --- a/src/simulation/elements/VIRS.cpp +++ b/src/simulation/elements/VIRS.cpp @@ -7,7 +7,7 @@ void Element::Element_VIRS() { Identifier = "DEFAULT_PT_VIRS"; Name = "VIRS"; - Colour = PIXPACK(0xFE11F6); + Colour = 0xFE11F6_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/VOID.cpp b/src/simulation/elements/VOID.cpp index 39b9d9a64..04d47fcd4 100644 --- a/src/simulation/elements/VOID.cpp +++ b/src/simulation/elements/VOID.cpp @@ -4,7 +4,7 @@ void Element::Element_VOID() { Identifier = "DEFAULT_PT_VOID"; Name = "VOID"; - Colour = PIXPACK(0x790B0B); + Colour = 0x790B0B_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/VRSG.cpp b/src/simulation/elements/VRSG.cpp index a3aa6afc6..1b09d910f 100644 --- a/src/simulation/elements/VRSG.cpp +++ b/src/simulation/elements/VRSG.cpp @@ -7,7 +7,7 @@ void Element::Element_VRSG() { Identifier = "DEFAULT_PT_VRSG"; Name = "VRSG"; - Colour = PIXPACK(0xFE68FE); + Colour = 0xFE68FE_rgb .Pack(); MenuVisible = 0; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/VRSS.cpp b/src/simulation/elements/VRSS.cpp index 599e1f8ca..63281827c 100644 --- a/src/simulation/elements/VRSS.cpp +++ b/src/simulation/elements/VRSS.cpp @@ -7,7 +7,7 @@ void Element::Element_VRSS() { Identifier = "DEFAULT_PT_VRSS"; Name = "VRSS"; - Colour = PIXPACK(0xD408CD); + Colour = 0xD408CD_rgb .Pack(); MenuVisible = 0; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/VSNS.cpp b/src/simulation/elements/VSNS.cpp index a5e8693a0..d5489f176 100644 --- a/src/simulation/elements/VSNS.cpp +++ b/src/simulation/elements/VSNS.cpp @@ -6,7 +6,7 @@ void Element::Element_VSNS() { Identifier = "DEFAULT_PT_VSNS"; Name = "VSNS"; - Colour = PIXPACK(0x7C9C00); + Colour = 0x7C9C00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SENSOR; Enabled = 1; diff --git a/src/simulation/elements/WARP.cpp b/src/simulation/elements/WARP.cpp index 412308ea4..9057554a0 100644 --- a/src/simulation/elements/WARP.cpp +++ b/src/simulation/elements/WARP.cpp @@ -8,7 +8,7 @@ void Element::Element_WARP() { Identifier = "DEFAULT_PT_WARP"; Name = "WARP"; - Colour = PIXPACK(0x101010); + Colour = 0x101010_rgb .Pack(); MenuVisible = 1; MenuSection = SC_NUCLEAR; Enabled = 1; diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp index 0b7247671..95b8fd695 100644 --- a/src/simulation/elements/WATR.cpp +++ b/src/simulation/elements/WATR.cpp @@ -6,7 +6,7 @@ void Element::Element_WATR() { Identifier = "DEFAULT_PT_WATR"; Name = "WATR"; - Colour = PIXPACK(0x2030D0); + Colour = 0x2030D0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_LIQUID; Enabled = 1; diff --git a/src/simulation/elements/WAX.cpp b/src/simulation/elements/WAX.cpp index ba5ab7c5c..b89c775e5 100644 --- a/src/simulation/elements/WAX.cpp +++ b/src/simulation/elements/WAX.cpp @@ -4,7 +4,7 @@ void Element::Element_WAX() { Identifier = "DEFAULT_PT_WAX"; Name = "WAX"; - Colour = PIXPACK(0xF0F0BB); + Colour = 0xF0F0BB_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/WHOL.cpp b/src/simulation/elements/WHOL.cpp index bbf6f159e..6557dc75a 100644 --- a/src/simulation/elements/WHOL.cpp +++ b/src/simulation/elements/WHOL.cpp @@ -4,7 +4,7 @@ void Element::Element_WHOL() { Identifier = "DEFAULT_PT_WHOL"; Name = "VENT"; - Colour = PIXPACK(0xEFEFEF); + Colour = 0xEFEFEF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SPECIAL; Enabled = 1; diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp index 4a4b1f49e..172dba135 100644 --- a/src/simulation/elements/WIFI.cpp +++ b/src/simulation/elements/WIFI.cpp @@ -7,7 +7,7 @@ void Element::Element_WIFI() { Identifier = "DEFAULT_PT_WIFI"; Name = "WIFI"; - Colour = PIXPACK(0x40A060); + Colour = 0x40A060_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/WIRE.cpp b/src/simulation/elements/WIRE.cpp index 47ee8bf11..34614f6a5 100644 --- a/src/simulation/elements/WIRE.cpp +++ b/src/simulation/elements/WIRE.cpp @@ -7,7 +7,7 @@ void Element::Element_WIRE() { Identifier = "DEFAULT_PT_WIRE"; Name = "WWLD"; - Colour = PIXPACK(0xFFCC00); + Colour = 0xFFCC00_rgb .Pack(); MenuVisible = 1; MenuSection = SC_ELEC; Enabled = 1; diff --git a/src/simulation/elements/WOOD.cpp b/src/simulation/elements/WOOD.cpp index 8bcbd3e97..5ae3d6edf 100644 --- a/src/simulation/elements/WOOD.cpp +++ b/src/simulation/elements/WOOD.cpp @@ -8,7 +8,7 @@ void Element::Element_WOOD() { Identifier = "DEFAULT_PT_WOOD"; Name = "WOOD"; - Colour = PIXPACK(0xC0A040); + Colour = 0xC0A040_rgb .Pack(); MenuVisible = 1; MenuSection = SC_SOLIDS; Enabled = 1; diff --git a/src/simulation/elements/WTRV.cpp b/src/simulation/elements/WTRV.cpp index 696778820..ef4025978 100644 --- a/src/simulation/elements/WTRV.cpp +++ b/src/simulation/elements/WTRV.cpp @@ -6,7 +6,7 @@ void Element::Element_WTRV() { Identifier = "DEFAULT_PT_WTRV"; Name = "WTRV"; - Colour = PIXPACK(0xA0A0FF); + Colour = 0xA0A0FF_rgb .Pack(); MenuVisible = 1; MenuSection = SC_GAS; Enabled = 1; diff --git a/src/simulation/elements/YEST.cpp b/src/simulation/elements/YEST.cpp index e82be9e6b..6226802a8 100644 --- a/src/simulation/elements/YEST.cpp +++ b/src/simulation/elements/YEST.cpp @@ -6,7 +6,7 @@ void Element::Element_YEST() { Identifier = "DEFAULT_PT_YEST"; Name = "YEST"; - Colour = PIXPACK(0xEEE0C0); + Colour = 0xEEE0C0_rgb .Pack(); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; diff --git a/src/simulation/simtools/AIR.cpp b/src/simulation/simtools/AIR.cpp index 6d2538529..6ee22504b 100644 --- a/src/simulation/simtools/AIR.cpp +++ b/src/simulation/simtools/AIR.cpp @@ -7,7 +7,7 @@ void SimTool::Tool_AIR() { Identifier = "DEFAULT_TOOL_AIR"; Name = "AIR"; - Colour = PIXPACK(0xFFFFFF); + Colour = 0xFFFFFF_rgb .Pack(); Description = "Air, creates airflow and pressure."; Perform = &perform; } diff --git a/src/simulation/simtools/AMBM.cpp b/src/simulation/simtools/AMBM.cpp index 692ce36c8..8be5016ab 100644 --- a/src/simulation/simtools/AMBM.cpp +++ b/src/simulation/simtools/AMBM.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_AMBM() { Identifier = "DEFAULT_TOOL_AMBM"; Name = "AMBM"; - Colour = PIXPACK(0x00DDFF); + Colour = 0x00DDFF_rgb .Pack(); Description = "Decreases ambient air temperature."; Perform = &perform; } diff --git a/src/simulation/simtools/AMBP.cpp b/src/simulation/simtools/AMBP.cpp index 2b3b5fb43..09178062f 100644 --- a/src/simulation/simtools/AMBP.cpp +++ b/src/simulation/simtools/AMBP.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_AMBP() { Identifier = "DEFAULT_TOOL_AMBP"; Name = "AMBP"; - Colour = PIXPACK(0xFFDD00); + Colour = 0xFFDD00_rgb .Pack(); Description = "Increases ambient air temperature."; Perform = &perform; } diff --git a/src/simulation/simtools/COOL.cpp b/src/simulation/simtools/COOL.cpp index 651b0827d..42832292f 100644 --- a/src/simulation/simtools/COOL.cpp +++ b/src/simulation/simtools/COOL.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_COOL() { Identifier = "DEFAULT_TOOL_COOL"; Name = "COOL"; - Colour = PIXPACK(0x00DDFF); + Colour = 0x00DDFF_rgb .Pack(); Description = "Cools the targeted element."; Perform = &perform; } diff --git a/src/simulation/simtools/CYCL.cpp b/src/simulation/simtools/CYCL.cpp index 6b6bfb383..c9fc7014a 100644 --- a/src/simulation/simtools/CYCL.cpp +++ b/src/simulation/simtools/CYCL.cpp @@ -9,7 +9,7 @@ void SimTool::Tool_CYCL() { Identifier = "DEFAULT_TOOL_CYCL"; Name = "CYCL"; - Colour = PIXPACK(0x132f5b); + Colour = 0x132f5b_rgb .Pack(); Description = "Cyclone, produces swirling air currents"; Perform = &perform; } diff --git a/src/simulation/simtools/HEAT.cpp b/src/simulation/simtools/HEAT.cpp index 417295cf0..02fb6abca 100644 --- a/src/simulation/simtools/HEAT.cpp +++ b/src/simulation/simtools/HEAT.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_HEAT() { Identifier = "DEFAULT_TOOL_HEAT"; Name = "HEAT"; - Colour = PIXPACK(0xFFDD00); + Colour = 0xFFDD00_rgb .Pack(); Description = "Heats the targeted element."; Perform = &perform; } diff --git a/src/simulation/simtools/MIX.cpp b/src/simulation/simtools/MIX.cpp index 36ea4adc9..71f0c08f2 100644 --- a/src/simulation/simtools/MIX.cpp +++ b/src/simulation/simtools/MIX.cpp @@ -9,7 +9,7 @@ void SimTool::Tool_MIX() { Identifier = "DEFAULT_TOOL_MIX"; Name = "MIX"; - Colour = PIXPACK(0xFFD090); + Colour = 0xFFD090_rgb .Pack(); Description = "Mixes particles."; Perform = &perform; } diff --git a/src/simulation/simtools/NGRV.cpp b/src/simulation/simtools/NGRV.cpp index a52ba6b05..15ba3809a 100644 --- a/src/simulation/simtools/NGRV.cpp +++ b/src/simulation/simtools/NGRV.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_NGRV() { Identifier = "DEFAULT_TOOL_NGRV"; Name = "NGRV"; - Colour = PIXPACK(0xAACCFF); + Colour = 0xAACCFF_rgb .Pack(); Description = "Creates a short-lasting negative gravity well."; Perform = &perform; } diff --git a/src/simulation/simtools/PGRV.cpp b/src/simulation/simtools/PGRV.cpp index 596f57196..31aea7ad0 100644 --- a/src/simulation/simtools/PGRV.cpp +++ b/src/simulation/simtools/PGRV.cpp @@ -6,7 +6,7 @@ void SimTool::Tool_PGRV() { Identifier = "DEFAULT_TOOL_PGRV"; Name = "PGRV"; - Colour = PIXPACK(0xCCCCFF); + Colour = 0xCCCCFF_rgb .Pack(); Description = "Creates a short-lasting gravity well."; Perform = &perform; } diff --git a/src/simulation/simtools/VAC.cpp b/src/simulation/simtools/VAC.cpp index a41ccce85..ab263bc55 100644 --- a/src/simulation/simtools/VAC.cpp +++ b/src/simulation/simtools/VAC.cpp @@ -7,7 +7,7 @@ void SimTool::Tool_VAC() { Identifier = "DEFAULT_TOOL_VAC"; Name = "VAC"; - Colour = PIXPACK(0x303030); + Colour = 0x303030_rgb .Pack(); Description = "Vacuum, reduces air pressure."; Perform = &perform; }