diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 4cca85f8f..ca8d769d4 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -627,6 +627,42 @@ VideoBuffer * Renderer::WallIcon(int wallID, int width, int height) newTexture->SetPixel(-j+20, j, 0xFF, 0, 0, 255); } } + else if (wt == WL_ERASEALL) + { + for (int j = 0; j < height; j++) + { + int r = 100, g = 150, b = 50; + int rd = 1, gd = -1, bd = -1; + for (int i = 0; i < width; i++) + { + r += 15*rd; + g += 15*gd; + b += 15*bd; + if (r > 200) rd = -1; + if (g > 200) gd = -1; + if (b > 200) bd = -1; + if (r < 15) rd = 1; + if (g < 15) gd = 1; + if (b < 15) bd = 1; + int rc = std::min(150, std::max(0, r)); + int gc = std::min(200, std::max(0, g)); + int bc = std::min(200, std::max(0, b)); + newTexture->SetPixel(i, j, rc, gc, bc, 255); + } + } + for (int j = 3; j < (width-4)/2; j++) + { + newTexture->SetPixel(j+0, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(j+1, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+13, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+14, j, 0xFF, 0, 0, 255); + + newTexture->SetPixel(j+11, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(j+12, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+24, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+25, j, 0xFF, 0, 0, 255); + } + } else if(wt == WL_STREAM) { for (j=0; j= 0; i--) + if (signs[i].x >= wallX*CELL && signs[i].y >= wallY*CELL && signs[i].x <= (wallX+1)*CELL && signs[i].y <= (wallY+1)*CELL) + signs.erase(signs.begin()+i); + bmap[wallY][wallX] = 0; + } + else + bmap[wallY][wallX] = wall; } } } @@ -1208,7 +1222,7 @@ int Simulation::FloodWalls(int x, int y, int wall, int bm) int x1, x2, dy = CELL; if (bm==-1) { - if (wall==WL_ERASE) + if (wall==WL_ERASE || wall==WL_ERASEALL) { bm = bmap[y/CELL][x/CELL]; if (!bm) diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index 9ddd03128..8f428a880 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -131,6 +131,7 @@ wall_type * LoadWalls(int & wallCount) {PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, Renderer::WallIcon, "GRAVITY WALL", "Gravity wall. Newtonian Gravity has no effect inside a box drawn with this."}, {PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, Renderer::WallIcon, "ENERGY WALL", "Allows energy particles, blocks all other particles."}, {PIXPACK(0xDCDCDC), PIXPACK(0x000000), 1, Renderer::WallIcon, "AIRBLOCK WALL", "Allows all particles, but blocks air."}, + {PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "ERASEALL", "Erases walls, particles, and signs."}, }; wallCount = UI_WALLCOUNT; wall_type * wtypesT = (wall_type*)malloc(UI_WALLCOUNT*sizeof(wall_type)); diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h index 00c693646..7aa033389 100644 --- a/src/simulation/SimulationData.h +++ b/src/simulation/SimulationData.h @@ -55,9 +55,10 @@ #define WL_GRAV 14 #define WL_ALLOWENERGY 15 #define WL_BLOCKAIR 16 +#define WL_ERASEALL 17 #define WL_FLOODHELPER 255 -#define UI_WALLCOUNT 17 +#define UI_WALLCOUNT 18 #define OLD_SPC_AIR 236 #define SPC_AIR 256