Skip to content

Commit 092d65c

Browse files
committed
fix: tested on linux, made necessary changes
1 parent 13e6a22 commit 092d65c

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CC=g++
22
CFLAGS=-Wall -O2
3-
# IFLAGS=-I"C:/MinGW-SDL/include"
4-
LFLAGS=-lmingw32 -lSDL2 -lSDL2main -lstdc++
3+
LFLAGS=-lSDL2 -lSDL2main -lstdc++
54

65
DEP=deps
76
DEPFLAGS=-MT $@ -MMD -MP -MF $(DEP)/$*.d
@@ -14,9 +13,9 @@ OBJS=$(patsubst $(SRC)/%.cpp, $(OBJ)/%.o, $(SRCS))
1413
BINDIR=bin
1514
BIN=$(BINDIR)/main
1615

17-
1816
all: $(BIN)
1917

18+
2019
$(BIN): $(OBJS) | $(BINDIR)
2120
$(CC) $(CFLAGS) $(OBJS) $(LFLAGS) -o $@
2221

inc/Generation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Generation{
88
~Generation();
99

1010
struct Cmp{
11-
bool operator()(const std::pair<std::pair<int, int>, Color>&, const std::pair<std::pair<int, int>, Color>&);
11+
bool operator()(const std::pair<std::pair<int, int>, Color>&, const std::pair<std::pair<int, int>, Color>&) const;
1212
};
1313

1414
void calculateNextGen();

src/Generation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int Generation::cnt(std::pair<int,int> p){
7575
return ret;
7676
}
7777

78-
bool Generation::Cmp::operator()(const std::pair<std::pair<int, int>, Color>& lhs, const std::pair<std::pair<int, int>, Color>& rhs){
78+
bool Generation::Cmp::operator()(const std::pair<std::pair<int, int>, Color>& lhs, const std::pair<std::pair<int, int>, Color>& rhs) const{
7979
if(lhs.first.second < rhs.first.second) return true;
8080
if(lhs.first.second == rhs.first.second){
8181
if(lhs.first.first < rhs.first.first)

src/GoL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void GoL::run(){
4545
void GoL::initSystems(){
4646
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER);
4747

48-
_window = SDL_CreateWindow("Game of Life", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, _screenWidth, _screenHeight, SDL_WINDOW_SHOWN);
48+
SDL_window = SDL_CreateWindow("Game of Life", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, _screenWidth, _screenHeight, SDL_WINDOW_SHOWN);
4949
if(_window == nullptr) fatalError("SDL Window could not be created!");
5050

5151
SDL_RaiseWindow(_window);

0 commit comments

Comments
 (0)