diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index f9991a0c2..c409b1a66 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -933,11 +933,7 @@ int LuaScriptInterface::simulation_createParts(lua_State * l) int ry = luaL_optint(l,4,5); int c = luaL_optint(l,5,luacon_model->GetActiveTool(0)->GetToolID()); int brush = luaL_optint(l,6,CIRCLE_BRUSH); - //int flags = luaL_optint(l,7,get_brush_flags()); - /*if (x < 0 || x > XRES || y < 0 || y > YRES) - return luaL_error(l, "Coordinates out of range (%d,%d)", x, y); - if (c < 0 || c >= PT_NUM || !luacon_sim->elements[c].Enabled) - return luaL_error(l, "Unrecognised element number '%d'", c);*/ + int flags = luaL_optint(l,7,0); vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush > brushList.size()) @@ -961,13 +957,7 @@ int LuaScriptInterface::simulation_createLine(lua_State * l) int ry = luaL_optint(l,6,5); int c = luaL_optint(l,7,luacon_model->GetActiveTool(0)->GetToolID()); int brush = luaL_optint(l,8,CIRCLE_BRUSH); - //int flags = luaL_optint(l,9,get_brush_flags()); - /* (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) - return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); - if (x2 < 0 || x2 > XRES || y2 < 0 || y2 > YRES) - return luaL_error(l, "Ending Coordinates out of range (%d,%d)", x2, y2); - if (c < 0 || c >= PT_NUM || !luacon_sim->elements[c].Enabled) - return luaL_error(l, "Unrecognised element number '%d'", c);*/ + int flags = luaL_optint(l,9,0); vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush > brushList.size()) @@ -987,13 +977,7 @@ int LuaScriptInterface::simulation_createBox(lua_State * l) int x2 = luaL_optint(l,3,-1); int y2 = luaL_optint(l,4,-1); int c = luaL_optint(l,5,luacon_model->GetActiveTool(0)->GetToolID()); - //int flags = luaL_optint(l,6,get_brush_flags()); - /*if (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) - return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); - if (x2 < 0 || x2 > XRES || y2 < 0 || y2 > YRES) - return luaL_error(l, "Ending Coordinates out of range (%d,%d)", x2, y2); - if (c < 0 || c >= PT_NUM || !luacon_sim->elements[c].Enabled) - return luaL_error(l, "Unrecognised element number '%d'", c);*/ + int flags = luaL_optint(l,6,0); luacon_sim->CreateBox(x1, y1, x2, y2, c, 0); return 0; @@ -1006,11 +990,7 @@ int LuaScriptInterface::simulation_floodParts(lua_State * l) int c = luaL_optint(l,3,luacon_model->GetActiveTool(0)->GetToolID()); int cm = luaL_optint(l,4,-1); int bm = luaL_optint(l,5,-1); - //int flags = luaL_optint(l,6,0); - /*if (x < 0 || x > XRES || y < 0 || y > YRES) - return luaL_error(l, "coordinates out of range (%d,%d)", x, y); - if ((c >= 0 && c < PT_NUM && !luacon_sim->elements[c].Enabled) || c < 0) - return luaL_error(l, "Unrecognised element number '%d'", c);*/ + int flags = luaL_optint(l,6,0); int ret = luacon_sim->FloodParts(x, y, c, cm, bm, 0); lua_pushinteger(l, ret); return 1; @@ -1023,9 +1003,7 @@ int LuaScriptInterface::simulation_createWalls(lua_State * l) int rx = luaL_optint(l,3,0); int ry = luaL_optint(l,4,0); int c = luaL_optint(l,5,8); - //int flags = luaL_optint(l,6,get_brush_flags()); - if (x < 0 || x > XRES || y < 0 || y > YRES) - return luaL_error(l, "Coordinates out of range (%d,%d)", x, y); + int flags = luaL_optint(l,6,0); if (c < 0 || c >= UI_WALLCOUNT) return luaL_error(l, "Unrecognised wall id '%d'", c); @@ -1043,11 +1021,7 @@ int LuaScriptInterface::simulation_createWallLine(lua_State * l) int rx = luaL_optint(l,5,0); int ry = luaL_optint(l,6,0); int c = luaL_optint(l,7,8); - //int flags = luaL_optint(l,8,get_brush_flags()); - if (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) - return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); - if (x2 < 0 || x2 > XRES || y2 < 0 || y2 > YRES) - return luaL_error(l, "Ending Coordinates out of range (%d,%d)", x2, y2); + int flags = luaL_optint(l,8,0); if (c < 0 || c >= UI_WALLCOUNT) return luaL_error(l, "Unrecognised wall id '%d'", c); @@ -1062,11 +1036,7 @@ int LuaScriptInterface::simulation_createWallBox(lua_State * l) int x2 = luaL_optint(l,3,-1); int y2 = luaL_optint(l,4,-1); int c = luaL_optint(l,5,8); - //int flags = luaL_optint(l,6,get_brush_flags()); - if (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) - return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); - if (x2 < 0 || x2 > XRES || y2 < 0 || y2 > YRES) - return luaL_error(l, "Ending Coordinates out of range (%d,%d)", x2, y2); + int flags = luaL_optint(l,6,0); if (c < 0 || c >= UI_WALLCOUNT) return luaL_error(l, "Unrecognised wall id '%d'", c); @@ -1081,9 +1051,7 @@ int LuaScriptInterface::simulation_floodWalls(lua_State * l) int c = luaL_optint(l,3,8); int cm = luaL_optint(l,4,-1); int bm = luaL_optint(l,5,-1); - //int flags = luaL_optint(l,6,0); - if (x < 0 || x > XRES || y < 0 || y > YRES) - return luaL_error(l, "coordinates out of range (%d,%d)", x, y); + int flags = luaL_optint(l,6,0); if (c < 0 || c >= UI_WALLCOUNT) return luaL_error(l, "Unrecognised wall id '%d'", c); int ret = luacon_sim->FloodWalls(x, y, c, cm, bm, 0); diff --git a/src/simulation/ElementGraphics.h b/src/simulation/ElementGraphics.h index 0f3723cbf..d1c816739 100644 --- a/src/simulation/ElementGraphics.h +++ b/src/simulation/ElementGraphics.h @@ -33,7 +33,7 @@ #define RENDER_GLOW OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_GLOW | PMODE_ADD | PMODE_BLEND #define RENDER_BLUR OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLUR | PMODE_ADD | PMODE_BLEND #define RENDER_BLOB OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLOB | PMODE_ADD | PMODE_BLEND -#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND +#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | EFFECT_LINES #define RENDER_NONE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT #define COLOUR_HEAT 0x00000001 diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 5ce0d1e5a..5387f8579 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -139,7 +139,6 @@ public: int flood_water(int x, int y, int i, int originaly, int check); TPT_NO_INLINE void detach(int i); TPT_NO_INLINE void part_change_type(int i, int x, int y, int t); - TPT_NO_INLINE int create_part_add_props(int p, int x, int y, int tv, int rx, int ry); //int InCurrentBrush(int i, int j, int rx, int ry); //int get_brush_flags(); TPT_NO_INLINE int create_part(int p, int x, int y, int t); @@ -170,8 +169,9 @@ public: int CreateParts(int positionX, int positionY, int c, Brush * cBrush); //Old particle creation, will create a crappy square, do not use int CreateParts(int x, int y, int rx, int ry, int c, int flags); + int CreatePartFlags(int x, int y, int c, int fn, int flags); void CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrush); - void CreateLine(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags); + void CreateLine(int x1, int y1, int x2, int y2, int c); void CreateWallBox(int x1, int y1, int x2, int y2, int c, int flags); int FloodWalls(int x, int y, int c, int cm, int bm, int flags); diff --git a/src/simulation/elements/BIZR.cpp b/src/simulation/elements/BIZR.cpp index 8b61543f9..0352c269a 100644 --- a/src/simulation/elements/BIZR.cpp +++ b/src/simulation/elements/BIZR.cpp @@ -117,6 +117,7 @@ int Element_BIZR::graphics(GRAPHICS_FUNC_ARGS) *firer = *colr/5 * fabs(cpart->vx)+fabs(cpart->vy); *pixel_mode |= FIRE_ADD; } + *pixel_mode |= PMODE_BLUR; return 0; } diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp index 472dbd747..79434e931 100644 --- a/src/simulation/elements/SOAP.cpp +++ b/src/simulation/elements/SOAP.cpp @@ -246,7 +246,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS) int Element_SOAP::graphics(GRAPHICS_FUNC_ARGS) { - *pixel_mode |= EFFECT_LINES; + *pixel_mode |= EFFECT_LINES|PMODE_BLUR; return 1; }