cleanup
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
# Compiler and flags
|
# Compiler and flags
|
||||||
CXX = g++
|
CXX = g++
|
||||||
CXXFLAGS = -std=c++17 -Wall -Wextra -O3
|
CXXFLAGS = -Wall -Wextra -O3
|
||||||
LDFLAGS = -static
|
LDFLAGS = -static
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int g_maxCells = 0;
|
|
||||||
|
|
||||||
// ANSI color codes
|
// ANSI color codes
|
||||||
namespace ANSI {
|
namespace ANSI {
|
||||||
const char *RESET = "\033[0m";
|
const char *RESET = "\033[0m";
|
||||||
@@ -132,7 +130,6 @@ void Aquarium::redraw() {
|
|||||||
clearCurrentFrame();
|
clearCurrentFrame();
|
||||||
ensureBigEntityExists();
|
ensureBigEntityExists();
|
||||||
|
|
||||||
// Use static vectors to avoid per-frame allocations
|
|
||||||
static std::vector<std::unique_ptr<Entity>> newEntities;
|
static std::vector<std::unique_ptr<Entity>> newEntities;
|
||||||
static std::vector<size_t> entitiesToRemove;
|
static std::vector<size_t> entitiesToRemove;
|
||||||
|
|
||||||
@@ -197,14 +194,6 @@ void Aquarium::resize() {
|
|||||||
|
|
||||||
getTerminalSize();
|
getTerminalSize();
|
||||||
|
|
||||||
if (g_maxCells && height * width > g_maxCells) {
|
|
||||||
cleanup_terminal(0);
|
|
||||||
std::cerr << "Error: Terminal too large. Maximum allowed area is "
|
|
||||||
<< g_maxCells << " cells, but current size is "
|
|
||||||
<< (height * width) << ".\n";
|
|
||||||
std::exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
currentFrame.assign(height, std::vector<Cell>(width));
|
currentFrame.assign(height, std::vector<Cell>(width));
|
||||||
previousFrame.assign(height, std::vector<Cell>(width));
|
previousFrame.assign(height, std::vector<Cell>(width));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user