commit d9476292
DEBUG is no longer set by standard. Removed some debug print
Changed files
| M | CMakeLists.txt before |
| M | README.md before |
| M | source/code/common.cpp before |
| M | source/code/gamecontroller.cpp before |
| M | source/code/main.cpp before |
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f2f782..d73c96b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ endif()
#Compiler options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2")
#Setup SDL2
diff --git a/README.md b/README.md
index 0a72998..deb2475 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,10 @@ To build do:
```
./packdata.sh
cmake .
+# or
+# cmake -DCMAKE_BUILD_TYPE=Debug .
+# or
+# cmake -DCMAKE_BUILD_TYPE=Release .
make
```
The result should be in the "Game"-folder. To run
diff --git a/source/code/common.cpp b/source/code/common.cpp
index f351c65..c683d54 100644
--- a/source/code/common.cpp
+++ b/source/code/common.cpp
@@ -195,7 +195,7 @@ void Config::load() {
inFile.get(); //Read the space between the key and the content
inFile.getline(value,MAX_VAR_LENGTH);
#if DEBUG
- cout << "Config "<< "read: " << key << " with:\"" << value << "\"" << endl;
+ cerr << "Config "<< "read: " << key << " with:\"" << value << "\"" << endl;
#endif
configMap[key] = (string)value;
}
diff --git a/source/code/gamecontroller.cpp b/source/code/gamecontroller.cpp
index 273b871..7dbc463 100644
--- a/source/code/gamecontroller.cpp
+++ b/source/code/gamecontroller.cpp
@@ -74,7 +74,7 @@ static int GetNextPlayerByGui(const SDL_JoystickGUID& guid) {
Config::getInstance()->setDefault(configName, "1");
int player = Config::getInstance()->getInt(configName) + gamecontrollers_assigned[guidAsHex];
gamecontrollers_assigned[guidAsHex]++; //Next controller with same guid should be assigned to different player.
- std::cout << "Guid: " << guidAsHex << std::endl;
+ //std::cout << "Guid: " << guidAsHex << std::endl;
if (player%2==0) {
return 2; //Even number means player 2
diff --git a/source/code/main.cpp b/source/code/main.cpp
index 6124d51..fc3b4d8 100644
--- a/source/code/main.cpp
+++ b/source/code/main.cpp
@@ -31,11 +31,6 @@ http://www.blockattack.net
#include "version.h"
-//If DEBUG is defined: AI info and FPS will be written to screen
-#ifndef DEBUG
-#define DEBUG 1
-#endif
-
#define WITH_SDL 1
#include "sago/SagoSpriteHolder.hpp"