Preprocessor purge round 1: simulation constants

This commit is contained in:
Tamás Bálint Misius
2023-01-04 10:08:09 +01:00
parent 44d53082eb
commit 3a591b8539
16 changed files with 239 additions and 241 deletions

View File

@@ -1,5 +1,3 @@
#define LUASCRIPT 256
#define IDI_ICON 101 #define IDI_ICON 101
#define IDI_DOC_ICON 102 #define IDI_DOC_ICON 102

View File

@@ -32,8 +32,8 @@
#include <cstdint> #include <cstdint>
#define BSON_OK 0 constexpr int BSON_OK = 0;
#define BSON_ERROR -1 constexpr int BSON_ERROR = -1;
static const char bson_numstrs[1000][4] = { static const char bson_numstrs[1000][4] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",

View File

@@ -3,7 +3,7 @@
#include "common/String.h" #include "common/String.h"
#define FONT_H 12 constexpr auto FONT_H = 12;
class FontReader class FontReader
{ {

View File

@@ -251,7 +251,7 @@ public:
} }
}; };
#define FONT_SCALE 16 constexpr int FONT_SCALE = 16;
FontEditor::FontEditor(ByteString _dataFile): FontEditor::FontEditor(ByteString _dataFile):
ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, WINDOWH)), ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, WINDOWH)),
dataFile(_dataFile), dataFile(_dataFile),

View File

@@ -15,7 +15,7 @@ namespace ui
class Button; class Button;
} }
#define MAX_WIDTH 64 constexpr int MAX_WIDTH = 64;
class FontEditor: public ui::Window class FontEditor: public ui::Window
{ {
private: private:

View File

@@ -21,19 +21,6 @@ class Tool;
//Because lua only has bindings for C, we're going to have to go outside "outside" the LuaScriptInterface, this means we can only have one instance :( //Because lua only has bindings for C, we're going to have to go outside "outside" the LuaScriptInterface, this means we can only have one instance :(
#define LUACON_MDOWN 1
#define LUACON_MUP 2
#define LUACON_MPRESS 3
#define LUACON_MUPALT 4
#define LUACON_MUPZOOM 5
#define LUACON_KDOWN 1
#define LUACON_KUP 2
//Bitmasks for things that might need recalculating after changes to tpt.el
#define LUACON_EL_MODIFIED_CANMOVE 0x1
#define LUACON_EL_MODIFIED_GRAPHICS 0x2
#define LUACON_EL_MODIFIED_MENUS 0x4
class Simulation; class Simulation;
class TPTScriptInterface; class TPTScriptInterface;
class LuaComponent; class LuaComponent;

View File

@@ -21,15 +21,15 @@
#include "graphics/Renderer.h" #include "graphics/Renderer.h"
#define IPL -257.0f constexpr float IPL = MIN_PRESSURE - 1;
#define IPH 257.0f constexpr float IPH = MAX_PRESSURE + 1;
#define ITL MIN_TEMP-1 constexpr float ITL = MIN_TEMP - 1;
#define ITH MAX_TEMP+1 constexpr float ITH = MAX_TEMP + 1;
// no transition (PT_NONE means kill part) // no transition (PT_NONE means kill part)
#define NT -1 constexpr int NT = -1;
// special transition - lava ctypes etc need extra code, which is only found and run if ST is given // special transition - lava ctypes etc need extra code, which is only found and run if ST is given
#define ST PT_NUM constexpr int ST = PT_NUM;
#endif #endif

View File

@@ -2,43 +2,43 @@
#define ELEMENTS_H_ #define ELEMENTS_H_
#include "Config.h" #include "Config.h"
//#include "Simulation.h" #include <cstdint>
#define MAX_TEMP 9999 constexpr float MAX_TEMP = 9999;
#define MIN_TEMP 0 constexpr float MIN_TEMP = 0;
#define O_MAX_TEMP 3500 constexpr float O_MAX_TEMP = 3500;
#define O_MIN_TEMP -273 constexpr float O_MIN_TEMP = -273;
#define MAX_PRESSURE 256.0f constexpr float MAX_PRESSURE = 256.0f;
#define MIN_PRESSURE -256.0f constexpr float MIN_PRESSURE = -256.0f;
#define TYPE_PART 0x00001 //1 Powders constexpr auto TYPE_PART = UINT32_C(0x00000001); //1 Powders
#define TYPE_LIQUID 0x00002 //2 Liquids constexpr auto TYPE_LIQUID = UINT32_C(0x00000002); //2 Liquids
#define TYPE_SOLID 0x00004 //4 Solids constexpr auto TYPE_SOLID = UINT32_C(0x00000004); //4 Solids
#define TYPE_GAS 0x00008 //8 Gases (Includes plasma) constexpr auto TYPE_GAS = UINT32_C(0x00000008); //8 Gases (Includes plasma)
#define TYPE_ENERGY 0x00010 //16 Energy (Thunder, Light, Neutrons etc.) constexpr auto TYPE_ENERGY = UINT32_C(0x00000010); //16 Energy (Thunder, Light, Neutrons etc.)
#define STATE_FLAGS 0x0001F constexpr auto STATE_FLAGS = UINT32_C(0x0000001F);
#define PROP_CONDUCTS 0x00020 //32 Conducts electricity constexpr auto PROP_CONDUCTS = UINT32_C(0x00000020); //32 Conducts electricity
#define PROP_BLACK 0x00040 //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better) constexpr auto PROP_BLACK = UINT32_C(0x00000040); //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
#define PROP_NEUTPENETRATE 0x00080 //128 Penetrated by neutrons constexpr auto PROP_NEUTPENETRATE = UINT32_C(0x00000080); //128 Penetrated by neutrons
#define PROP_NEUTABSORB 0x00100 //256 Absorbs neutrons, reflect is default constexpr auto PROP_NEUTABSORB = UINT32_C(0x00000100); //256 Absorbs neutrons, reflect is default
#define PROP_NEUTPASS 0x00200 //512 Neutrons pass through, such as with glass constexpr auto PROP_NEUTPASS = UINT32_C(0x00000200); //512 Neutrons pass through, such as with glass
#define PROP_DEADLY 0x00400 //1024 Is deadly for stickman constexpr auto PROP_DEADLY = UINT32_C(0x00000400); //1024 Is deadly for stickman
#define PROP_HOT_GLOW 0x00800 //2048 Hot Metal Glow constexpr auto PROP_HOT_GLOW = UINT32_C(0x00000800); //2048 Hot Metal Glow
#define PROP_LIFE 0x01000 //4096 Is a GoL type constexpr auto PROP_LIFE = UINT32_C(0x00001000); //4096 Is a GoL type
#define PROP_RADIOACTIVE 0x02000 //8192 Radioactive constexpr auto PROP_RADIOACTIVE = UINT32_C(0x00002000); //8192 Radioactive
#define PROP_LIFE_DEC 0x04000 //2^14 Life decreases by one every frame if > zero constexpr auto PROP_LIFE_DEC = UINT32_C(0x00004000); //2^14 Life decreases by one every frame if > zero
#define PROP_LIFE_KILL 0x08000 //2^15 Kill when life value is <= zero constexpr auto PROP_LIFE_KILL = UINT32_C(0x00008000); //2^15 Kill when life value is <= zero
#define PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to <= zero constexpr auto PROP_LIFE_KILL_DEC = UINT32_C(0x00010000); //2^16 Kill when life value is decremented to <= zero
#define PROP_SPARKSETTLE 0x20000 //2^17 Allow Sparks/Embers to settle constexpr auto PROP_SPARKSETTLE = UINT32_C(0x00020000); //2^17 Allow Sparks/Embers to settle
#define PROP_NOAMBHEAT 0x40000 //2^18 Don't transfer or receive heat from ambient heat. constexpr auto PROP_NOAMBHEAT = UINT32_C(0x00040000); //2^18 Don't transfer or receive heat from ambient heat.
#define PROP_NOCTYPEDRAW 0x100000 // 2^20 When this element is drawn upon with, do not set ctype (like BCLN for CLNE) constexpr auto PROP_NOCTYPEDRAW = UINT32_C(0x00100000); // 2^20 When this element is drawn upon with, do not set ctype (like BCLN for CLNE)
#define FLAG_STAGNANT 0x1 constexpr auto FLAG_STAGNANT = UINT32_C(0x00000001);
#define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT constexpr auto FLAG_SKIPMOVE = UINT32_C(0x00000002); // skip movement for one frame, only implemented for PHOT
//#define FLAG_WATEREQUAL 0x4 //if a liquid was already checked during equalization //#define FLAG_WATEREQUAL 0x4 //if a liquid was already checked during equalization
#define FLAG_MOVABLE 0x8 // compatibility with old saves (moving SPNG), only applies to SPNG constexpr auto FLAG_MOVABLE = UINT32_C(0x00000008); // compatibility with old saves (moving SPNG), only applies to SPNG
#define FLAG_PHOTDECO 0x8 // compatibility with old saves (decorated photons), only applies to PHOT. Having the same value as FLAG_MOVABLE is fine because they apply to different elements, and this saves space for future flags, constexpr auto FLAG_PHOTDECO = UINT32_C(0x00000008); // compatibility with old saves (decorated photons), only applies to PHOT. Having the same value as FLAG_MOVABLE is fine because they apply to different elements, and this saves space for future flags,
#define UPDATE_FUNC_ARGS Simulation* sim, int i, int x, int y, int surround_space, int nt, Particle *parts, int pmap[YRES][XRES] #define UPDATE_FUNC_ARGS Simulation* sim, int i, int x, int y, int surround_space, int nt, Particle *parts, int pmap[YRES][XRES]
@@ -56,19 +56,30 @@
#define CTYPEDRAW_FUNC_ARGS Simulation *sim, int i, int t, int v #define CTYPEDRAW_FUNC_ARGS Simulation *sim, int i, int t, int v
#define CTYPEDRAW_FUNC_SUBCALL_ARGS sim, i, t, v #define CTYPEDRAW_FUNC_SUBCALL_ARGS sim, i, t, v
#define BOUNDS_CHECK true constexpr bool BOUNDS_CHECK = true;
#define OLD_PT_WIND 147 constexpr int OLD_PT_WIND = 147;
// Change this to change the amount of bits used to store type in pmap (and a few elements such as PIPE and CRAY) // Change this to change the amount of bits used to store type in pmap (and a few elements such as PIPE and CRAY)
#define PMAPBITS 9 constexpr int PMAPBITS = 9;
#define PMAPMASK ((1<<PMAPBITS)-1) constexpr int PMAPMASK = ((1 << PMAPBITS) - 1);
#define ID(r) ((r)>>PMAPBITS) constexpr int ID(int r)
#define TYP(r) ((r)&PMAPMASK) {
#define PMAP(id, typ) ((id)<<PMAPBITS | ((typ)&PMAPMASK)) return r >> PMAPBITS;
#define PMAPID(id) ((id)<<PMAPBITS) }
constexpr int TYP(int r)
#define PT_NUM (1<<PMAPBITS) {
return r & PMAPMASK;
}
constexpr int PMAP(int id, int typ)
{
return (id << PMAPBITS) | (typ & PMAPMASK);
}
constexpr int PMAPID(int id)
{
return id << PMAPBITS;
}
constexpr int PT_NUM = 1 << PMAPBITS;
struct playerst; struct playerst;

View File

@@ -1,57 +1,58 @@
#ifndef PGRAPHICS_H #ifndef PGRAPHICS_H
#define PGRAPHICS_H #define PGRAPHICS_H
#include <cstdint>
#define PMODE 0x00000FFF constexpr auto PMODE = UINT32_C(0x00000FFF);
#define PMODE_NONE 0x00000000 constexpr auto PMODE_NONE = UINT32_C(0x00000000);
#define PMODE_FLAT 0x00000001 constexpr auto PMODE_FLAT = UINT32_C(0x00000001);
#define PMODE_BLOB 0x00000002 constexpr auto PMODE_BLOB = UINT32_C(0x00000002);
#define PMODE_BLUR 0x00000004 constexpr auto PMODE_BLUR = UINT32_C(0x00000004);
#define PMODE_GLOW 0x00000008 constexpr auto PMODE_GLOW = UINT32_C(0x00000008);
#define PMODE_SPARK 0x00000010 constexpr auto PMODE_SPARK = UINT32_C(0x00000010);
#define PMODE_FLARE 0x00000020 constexpr auto PMODE_FLARE = UINT32_C(0x00000020);
#define PMODE_LFLARE 0x00000040 constexpr auto PMODE_LFLARE = UINT32_C(0x00000040);
#define PMODE_ADD 0x00000080 constexpr auto PMODE_ADD = UINT32_C(0x00000080);
#define PMODE_BLEND 0x00000100 constexpr auto PMODE_BLEND = UINT32_C(0x00000100);
#define PSPEC_STICKMAN 0x00000200 constexpr auto PSPEC_STICKMAN = UINT32_C(0x00000200);
#define OPTIONS 0x0000F000 constexpr auto OPTIONS = UINT32_C(0x0000F000);
#define NO_DECO 0x00001000 constexpr auto NO_DECO = UINT32_C(0x00001000);
#define DECO_FIRE 0x00002000 constexpr auto DECO_FIRE = UINT32_C(0x00002000);
#define FIREMODE 0x00FF0000 constexpr auto FIREMODE = UINT32_C(0x00FF0000);
#define FIRE_ADD 0x00010000 constexpr auto FIRE_ADD = UINT32_C(0x00010000);
#define FIRE_BLEND 0x00020000 constexpr auto FIRE_BLEND = UINT32_C(0x00020000);
#define FIRE_SPARK 0x00040000 constexpr auto FIRE_SPARK = UINT32_C(0x00040000);
#define EFFECT 0xFF000000 constexpr auto EFFECT = UINT32_C(0xFF000000);
#define EFFECT_GRAVIN 0x01000000 constexpr auto EFFECT_GRAVIN = UINT32_C(0x01000000);
#define EFFECT_GRAVOUT 0x02000000 constexpr auto EFFECT_GRAVOUT = UINT32_C(0x02000000);
#define EFFECT_LINES 0x04000000 constexpr auto EFFECT_LINES = UINT32_C(0x04000000);
#define EFFECT_DBGLINES 0x08000000 constexpr auto EFFECT_DBGLINES = UINT32_C(0x08000000);
#define RENDER_EFFE OPTIONS | PSPEC_STICKMAN | EFFECT | PMODE_SPARK | PMODE_FLARE | PMODE_LFLARE constexpr auto RENDER_EFFE = OPTIONS | PSPEC_STICKMAN | EFFECT | PMODE_SPARK | PMODE_FLARE | PMODE_LFLARE;
#define RENDER_FIRE OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_ADD | PMODE_BLEND | FIRE_ADD | FIRE_BLEND constexpr auto RENDER_FIRE = OPTIONS | PSPEC_STICKMAN | PMODE_ADD | PMODE_BLEND | FIRE_ADD | FIRE_BLEND;
#define RENDER_SPRK OPTIONS | PSPEC_STICKMAN | PMODE_ADD | PMODE_BLEND | FIRE_SPARK constexpr auto RENDER_SPRK = OPTIONS | PSPEC_STICKMAN | PMODE_ADD | PMODE_BLEND | FIRE_SPARK;
#define RENDER_GLOW OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_GLOW | PMODE_ADD | PMODE_BLEND constexpr auto RENDER_GLOW = OPTIONS | PSPEC_STICKMAN | PMODE_GLOW | PMODE_ADD | PMODE_BLEND;
#define RENDER_BLUR OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLUR | PMODE_ADD | PMODE_BLEND constexpr auto RENDER_BLUR = OPTIONS | PSPEC_STICKMAN | PMODE_BLUR | PMODE_ADD | PMODE_BLEND;
#define RENDER_BLOB OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLOB | PMODE_ADD | PMODE_BLEND constexpr auto RENDER_BLOB = OPTIONS | PSPEC_STICKMAN | PMODE_BLOB | PMODE_ADD | PMODE_BLEND;
#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | EFFECT_LINES constexpr auto RENDER_BASC = OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | EFFECT_LINES;
#define RENDER_NONE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT constexpr auto RENDER_NONE = OPTIONS | PSPEC_STICKMAN | PMODE_FLAT;
#define COLOUR_HEAT 0x00000001 constexpr auto COLOUR_HEAT = UINT32_C(0x00000001);
#define COLOUR_LIFE 0x00000002 constexpr auto COLOUR_LIFE = UINT32_C(0x00000002);
#define COLOUR_GRAD 0x00000004 constexpr auto COLOUR_GRAD = UINT32_C(0x00000004);
#define COLOUR_BASC 0x00000008 constexpr auto COLOUR_BASC = UINT32_C(0x00000008);
#define COLOUR_DEFAULT 0x00000000 constexpr auto COLOUR_DEFAULT = UINT32_C(0x00000000);
#define DISPLAY_AIRC 0x00000001 constexpr auto DISPLAY_AIRC = UINT32_C(0x00000001);
#define DISPLAY_AIRP 0x00000002 constexpr auto DISPLAY_AIRP = UINT32_C(0x00000002);
#define DISPLAY_AIRV 0x00000004 constexpr auto DISPLAY_AIRV = UINT32_C(0x00000004);
#define DISPLAY_AIRH 0x00000008 constexpr auto DISPLAY_AIRH = UINT32_C(0x00000008);
#define DISPLAY_AIR 0x0000000F constexpr auto DISPLAY_AIR = UINT32_C(0x0000000F);
#define DISPLAY_WARP 0x00000010 constexpr auto DISPLAY_WARP = UINT32_C(0x00000010);
#define DISPLAY_PERS 0x00000020 constexpr auto DISPLAY_PERS = UINT32_C(0x00000020);
#define DISPLAY_EFFE 0x00000040 constexpr auto DISPLAY_EFFE = UINT32_C(0x00000040);
#endif #endif

View File

@@ -19,7 +19,7 @@
#include "Element.h" #include "Element.h"
#define CHANNELS ((int)(MAX_TEMP-73)/100+2) constexpr int CHANNELS = int(MAX_TEMP - 73) / 100 + 2;
class Snapshot; class Snapshot;
class SimTool; class SimTool;

View File

@@ -2,137 +2,138 @@
#define SIMULATIONDATA_H #define SIMULATIONDATA_H
#include "Config.h" #include "Config.h"
#include <cstdint>
#include <vector> #include <vector>
#include <array> #include <array>
#define SC_WALL 0 constexpr int SC_WALL = 0;
#define SC_ELEC 1 constexpr int SC_ELEC = 1;
#define SC_POWERED 2 constexpr int SC_POWERED = 2;
#define SC_SENSOR 3 constexpr int SC_SENSOR = 3;
#define SC_FORCE 4 constexpr int SC_FORCE = 4;
#define SC_EXPLOSIVE 5 constexpr int SC_EXPLOSIVE = 5;
#define SC_GAS 6 constexpr int SC_GAS = 6;
#define SC_LIQUID 7 constexpr int SC_LIQUID = 7;
#define SC_POWDERS 8 constexpr int SC_POWDERS = 8;
#define SC_SOLIDS 9 constexpr int SC_SOLIDS = 9;
#define SC_NUCLEAR 10 constexpr int SC_NUCLEAR = 10;
#define SC_SPECIAL 11 constexpr int SC_SPECIAL = 11;
#define SC_LIFE 12 constexpr int SC_LIFE = 12;
#define SC_TOOL 13 constexpr int SC_TOOL = 13;
#define SC_FAVORITES 14 constexpr int SC_FAVORITES = 14;
#define SC_DECO 15 constexpr int SC_DECO = 15;
#define SC_CRACKER 16 constexpr int SC_CRACKER = 16;
#define SC_CRACKER2 17 constexpr int SC_CRACKER2 = 17;
#define SC_TOTAL 16 constexpr int SC_TOTAL = 16;
#define O_WL_WALLELEC 122 constexpr int O_WL_WALLELEC = 122;
#define O_WL_EWALL 123 constexpr int O_WL_EWALL = 123;
#define O_WL_DETECT 124 constexpr int O_WL_DETECT = 124;
#define O_WL_STREAM 125 constexpr int O_WL_STREAM = 125;
#define O_WL_SIGN 126 constexpr int O_WL_SIGN = 126;
#define O_WL_FAN 127 constexpr int O_WL_FAN = 127;
#define O_WL_FANHELPER 255 constexpr int O_WL_FANHELPER = 255;
#define O_WL_ALLOWLIQUID 128 constexpr int O_WL_ALLOWLIQUID = 128;
#define O_WL_DESTROYALL 129 constexpr int O_WL_DESTROYALL = 129;
#define O_WL_ERASE 130 constexpr int O_WL_ERASE = 130;
#define O_WL_WALL 131 constexpr int O_WL_WALL = 131;
#define O_WL_ALLOWAIR 132 constexpr int O_WL_ALLOWAIR = 132;
#define O_WL_ALLOWSOLID 133 constexpr int O_WL_ALLOWSOLID = 133;
#define O_WL_ALLOWALLELEC 134 constexpr int O_WL_ALLOWALLELEC = 134;
#define O_WL_EHOLE 135 constexpr int O_WL_EHOLE = 135;
#define O_WL_ALLOWGAS 140 constexpr int O_WL_ALLOWGAS = 140;
#define O_WL_GRAV 142 constexpr int O_WL_GRAV = 142;
#define O_WL_ALLOWENERGY 145 constexpr int O_WL_ALLOWENERGY = 145;
#define WL_ERASE 0 constexpr int WL_ERASE = 0;
#define WL_WALLELEC 1 constexpr int WL_WALLELEC = 1;
#define WL_EWALL 2 constexpr int WL_EWALL = 2;
#define WL_DETECT 3 constexpr int WL_DETECT = 3;
#define WL_STREAM 4 constexpr int WL_STREAM = 4;
#define WL_FAN 5 constexpr int WL_FAN = 5;
#define WL_ALLOWLIQUID 6 constexpr int WL_ALLOWLIQUID = 6;
#define WL_DESTROYALL 7 constexpr int WL_DESTROYALL = 7;
#define WL_WALL 8 constexpr int WL_WALL = 8;
#define WL_ALLOWAIR 9 constexpr int WL_ALLOWAIR = 9;
#define WL_ALLOWPOWDER 10 constexpr int WL_ALLOWPOWDER = 10;
#define WL_ALLOWALLELEC 11 constexpr int WL_ALLOWALLELEC = 11;
#define WL_EHOLE 12 constexpr int WL_EHOLE = 12;
#define WL_ALLOWGAS 13 constexpr int WL_ALLOWGAS = 13;
#define WL_GRAV 14 constexpr int WL_GRAV = 14;
#define WL_ALLOWENERGY 15 constexpr int WL_ALLOWENERGY = 15;
#define WL_BLOCKAIR 16 constexpr int WL_BLOCKAIR = 16;
#define WL_ERASEALL 17 constexpr int WL_ERASEALL = 17;
#define WL_STASIS 18 constexpr int WL_STASIS = 18;
#define WL_FLOODHELPER 255 constexpr int WL_FLOODHELPER =255;
#define UI_WALLCOUNT 19 constexpr int UI_WALLCOUNT = 19;
#define OLD_SPC_AIR 236 constexpr int OLD_SPC_AIR = 236;
#define SPC_AIR 256 constexpr int SPC_AIR = 256;
#define DECO_DRAW 0 constexpr int DECO_DRAW = 0;
#define DECO_CLEAR 1 constexpr int DECO_CLEAR = 1;
#define DECO_ADD 2 constexpr int DECO_ADD = 2;
#define DECO_SUBTRACT 3 constexpr int DECO_SUBTRACT = 3;
#define DECO_MULTIPLY 4 constexpr int DECO_MULTIPLY = 4;
#define DECO_DIVIDE 5 constexpr int DECO_DIVIDE = 5;
#define DECO_SMUDGE 6 constexpr int DECO_SMUDGE = 6;
//Old IDs for GOL types //Old IDs for GOL types
#define GT_GOL 78 constexpr int GT_GOL = 78;
#define GT_HLIF 79 constexpr int GT_HLIF = 79;
#define GT_ASIM 80 constexpr int GT_ASIM = 80;
#define GT_2x2 81 constexpr int GT_2x2 = 81;
#define GT_DANI 82 constexpr int GT_DANI = 82;
#define GT_AMOE 83 constexpr int GT_AMOE = 83;
#define GT_MOVE 84 constexpr int GT_MOVE = 84;
#define GT_PGOL 85 constexpr int GT_PGOL = 85;
#define GT_DMOE 86 constexpr int GT_DMOE = 86;
#define GT_34 87 constexpr int GT_34 = 87;
#define GT_LLIF 88 constexpr int GT_LLIF = 88;
#define GT_STAN 89 constexpr int GT_STAN = 89;
#define GT_SEED 134 constexpr int GT_SEED = 134;
#define GT_MAZE 135 constexpr int GT_MAZE = 135;
#define GT_COAG 136 constexpr int GT_COAG = 136;
#define GT_WALL 137 constexpr int GT_WALL = 137;
#define GT_GNAR 138 constexpr int GT_GNAR = 138;
#define GT_REPL 139 constexpr int GT_REPL = 139;
#define GT_MYST 140 constexpr int GT_MYST = 140;
#define GT_LOTE 142 constexpr int GT_LOTE = 142;
#define GT_FRG2 143 constexpr int GT_FRG2 = 143;
#define GT_STAR 144 constexpr int GT_STAR = 144;
#define GT_FROG 145 constexpr int GT_FROG = 145;
#define GT_BRAN 146 constexpr int GT_BRAN = 146;
//New IDs for GOL types //New IDs for GOL types
#define NGT_GOL 0 constexpr int NGT_GOL = 0;
#define NGT_HLIF 1 constexpr int NGT_HLIF = 1;
#define NGT_ASIM 2 constexpr int NGT_ASIM = 2;
#define NGT_2x2 3 constexpr int NGT_2x2 = 3;
#define NGT_DANI 4 constexpr int NGT_DANI = 4;
#define NGT_AMOE 5 constexpr int NGT_AMOE = 5;
#define NGT_MOVE 6 constexpr int NGT_MOVE = 6;
#define NGT_PGOL 7 constexpr int NGT_PGOL = 7;
#define NGT_DMOE 8 constexpr int NGT_DMOE = 8;
#define NGT_34 9 constexpr int NGT_34 = 9;
#define NGT_LLIF 10 constexpr int NGT_LLIF = 10;
#define NGT_STAN 11 constexpr int NGT_STAN = 11;
#define NGT_SEED 12 constexpr int NGT_SEED = 12;
#define NGT_MAZE 13 constexpr int NGT_MAZE = 13;
#define NGT_COAG 14 constexpr int NGT_COAG = 14;
#define NGT_WALL 15 constexpr int NGT_WALL = 15;
#define NGT_GNAR 16 constexpr int NGT_GNAR = 16;
#define NGT_REPL 17 constexpr int NGT_REPL = 17;
#define NGT_MYST 18 constexpr int NGT_MYST = 18;
#define NGT_LOTE 19 constexpr int NGT_LOTE = 19;
#define NGT_FRG2 20 constexpr int NGT_FRG2 = 20;
#define NGT_STAR 21 constexpr int NGT_STAR = 21;
#define NGT_FROG 22 constexpr int NGT_FROG = 22;
#define NGT_BRAN 23 constexpr int NGT_BRAN = 23;
//replace mode / specific delete flags //replace mode / specific delete flags
#define REPLACE_MODE 0x1 constexpr auto REPLACE_MODE = UINT32_C(0x00000001);
#define SPECIFIC_DELETE 0x2 constexpr auto SPECIFIC_DELETE = UINT32_C(0x00000002);
struct part_type; struct part_type;
struct part_transition; struct part_transition;

View File

@@ -1,7 +1,7 @@
#ifndef STICKMAN_H_ #ifndef STICKMAN_H_
#define STICKMAN_H_ #define STICKMAN_H_
#define MAX_FIGHTERS 100 constexpr auto MAX_FIGHTERS = 100;
struct playerst struct playerst
{ {
char comm; //command cell char comm; //command cell

View File

@@ -55,7 +55,7 @@ static int update(UPDATE_FUNC_ARGS)
if (BOUNDS_CHECK && (rx || ry)) if (BOUNDS_CHECK && (rx || ry))
{ {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
switch TYP(r) switch (TYP(r))
{ {
case PT_SALT: case PT_SALT:
if (RNG::Ref().chance(1, 47)) if (RNG::Ref().chance(1, 47))

View File

@@ -53,7 +53,7 @@ static int update(UPDATE_FUNC_ARGS)
if (BOUNDS_CHECK && (rx || ry)) if (BOUNDS_CHECK && (rx || ry))
{ {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
switch TYP(r) switch (TYP(r))
{ {
case PT_SALT: case PT_SALT:
if (RNG::Ref().chance(1, 2000)) if (RNG::Ref().chance(1, 2000))

View File

@@ -59,7 +59,7 @@ static int update(UPDATE_FUNC_ARGS)
if (BOUNDS_CHECK && (rx || ry)) if (BOUNDS_CHECK && (rx || ry))
{ {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
switch TYP(r) switch (TYP(r))
{ {
case PT_WATR: case PT_WATR:
case PT_DSTW: case PT_DSTW:

View File

@@ -74,12 +74,12 @@ void Element::Element_TRON()
* .ctype Contains the colour, lost on save, regenerated using hue tmp (bits 7 - 16) * .ctype Contains the colour, lost on save, regenerated using hue tmp (bits 7 - 16)
*/ */
#define TRON_HEAD 1 constexpr auto TRON_HEAD = UINT32_C(0x00000001);
#define TRON_NOGROW 2 constexpr auto TRON_NOGROW = UINT32_C(0x00000002);
#define TRON_WAIT 4 //it was just created, so WAIT a frame constexpr auto TRON_WAIT = UINT32_C(0x00000004); //it was just created, so WAIT a frame
#define TRON_NODIE 8 constexpr auto TRON_NODIE = UINT32_C(0x00000008);
#define TRON_DEATH 16 //Crashed, now dying constexpr auto TRON_DEATH = UINT32_C(0x00000010); //Crashed, now dying
#define TRON_NORANDOM 65536 constexpr auto TRON_NORANDOM = UINT32_C(0x00010000);
int tron_rx[4] = {-1, 0, 1, 0}; int tron_rx[4] = {-1, 0, 1, 0};
int tron_ry[4] = { 0,-1, 0, 1}; int tron_ry[4] = { 0,-1, 0, 1};
unsigned int tron_colours[32]; unsigned int tron_colours[32];