Skip to content

Commit

Permalink
Add DECOSPACE_ constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Mar 14, 2024
1 parent 3a3a8c1 commit 596e6ce
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lua/LuaSimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,9 +1960,11 @@ void LuaSimulation::Open(lua_State *L)
};
lua_newtable(L);
luaL_register(L, NULL, reg);

#define LCONST(v) lua_pushinteger(L, int(v)); lua_setfield(L, -2, #v)
#define LCONSTF(v) lua_pushnumber(L, float(v)); lua_setfield(L, -2, #v)
#define LCONSTAS(k, v) lua_pushinteger(L, int(v)); lua_setfield(L, -2, k)

LCONST(CELL);
LCONST(XCELLS);
LCONST(YCELLS);
Expand All @@ -1987,6 +1989,7 @@ void LuaSimulation::Open(lua_State *L)
LCONST(ISTP);
LCONSTF(CFDS);
LCONSTF(MAX_VELOCITY);

LCONST(TOOL_HEAT);
LCONST(TOOL_COOL);
LCONST(TOOL_VAC);
Expand All @@ -1996,39 +1999,53 @@ void LuaSimulation::Open(lua_State *L)
LCONST(TOOL_MIX);
LCONST(TOOL_CYCL);
LCONSTAS("TOOL_WIND", sd.tools.size());

LCONST(DECO_DRAW);
LCONST(DECO_CLEAR);
LCONST(DECO_ADD);
LCONST(DECO_SUBTRACT);
LCONST(DECO_MULTIPLY);
LCONST(DECO_DIVIDE);
LCONST(DECO_SMUDGE);

LCONST(FLAG_STAGNANT);
LCONST(FLAG_SKIPMOVE);
LCONST(FLAG_MOVABLE);
LCONST(FLAG_PHOTDECO);

LCONST(PMAPBITS);
LCONST(PMAPMASK);

LCONST(BRUSH_CIRCLE);
LCONST(BRUSH_SQUARE);
LCONST(BRUSH_TRIANGLE);
LCONST(NUM_DEFAULTBRUSHES);
LCONSTAS("NUM_BRUSHES", lsi->gameModel->BrushListSize());

LCONST(EDGE_VOID);
LCONST(EDGE_SOLID);
LCONST(EDGE_LOOP);
LCONST(NUM_EDGEMODES);

LCONST(AIR_ON);
LCONST(AIR_PRESSUREOFF);
LCONST(AIR_VELOCITYOFF);
LCONST(AIR_OFF);
LCONST(AIR_NOUPDATE);
LCONST(NUM_AIRMODES);

LCONST(GRAV_VERTICAL);
LCONST(GRAV_OFF);
LCONST(GRAV_RADIAL);
LCONST(GRAV_CUSTOM);
LCONST(NUM_GRAVMODES);

LCONST(DECOSPACE_SRGB);
LCONST(DECOSPACE_LINEAR);
LCONST(DECOSPACE_GAMMA22);
LCONST(DECOSPACE_GAMMA18);
LCONST(NUM_DECOSPACES);

{
lua_newtable(L);
for (int i = 0; i < UI_WALLCOUNT; i++)
Expand Down

0 comments on commit 596e6ce

Please sign in to comment.