Skip to content
Snippets Groups Projects
Commit 519b3671 authored by Oliver Bock's avatar Oliver Bock
Browse files

Assert that there's at least one observer (changing vom DEBUG to NDEBUG due to...

Assert that there's at least one observer (changing vom DEBUG to NDEBUG due to use of assert() which is scrapped by the precompiler ifdef NDEBUG)
parent dc229447
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ LIBS = -L${BOINC_PREFIX}/lib -Bstatic $(shell sdl-config --static-libs) -lfreety ...@@ -8,7 +8,7 @@ LIBS = -L${BOINC_PREFIX}/lib -Bstatic $(shell sdl-config --static-libs) -lfreety
CPPFLAGS = -I/usr/include $(shell sdl-config --cflags) $(shell pkg-config --cflags ftgl) CPPFLAGS = -I/usr/include $(shell sdl-config --cflags) $(shell pkg-config --cflags ftgl)
DEPS = Makefile DEPS = Makefile
OBJS = starlist.o snr_list.o pulsar_list.o AbstractGraphicsEngine.o Starsphere.o WindowManager.o ${RESOURCESPEC}.o Resource.o ResourceFactory.o OBJS = starlist.o snr_list.o pulsar_list.o AbstractGraphicsEngine.o Starsphere.o WindowManager.o ${RESOURCESPEC}.o Resource.o ResourceFactory.o
DEBUGFLAGSCPP = -DDEBUG -pg -ggdb -O0 DEBUGFLAGSCPP = -pg -ggdb -O0
RESOURCESPEC = resources RESOURCESPEC = resources
# primary role based tagets # primary role based tagets
...@@ -22,7 +22,7 @@ release: clean starsphere ...@@ -22,7 +22,7 @@ release: clean starsphere
debug: CPPFLAGS += $(DEBUGFLAGSCPP) debug: CPPFLAGS += $(DEBUGFLAGSCPP)
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
release: CPPFLAGS += -O3 -Wall -Wno-switch-enum release: CPPFLAGS += -DNDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS += -s release: LDFLAGS += -s
# file based targets # file based targets
......
...@@ -96,6 +96,9 @@ bool WindowManager::initialize() ...@@ -96,6 +96,9 @@ bool WindowManager::initialize()
void WindowManager::eventLoop() void WindowManager::eventLoop()
{ {
// be sure there's at least one observer!
assert(eventObservers.size() > 0);
SDL_AddTimer(40, &timerCallbackRenderEvent, NULL); SDL_AddTimer(40, &timerCallbackRenderEvent, NULL);
SDL_AddTimer(1000, &timerCallbackBOINCUpdateEvent, NULL); SDL_AddTimer(1000, &timerCallbackBOINCUpdateEvent, NULL);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <list> #include <list>
#include <cassert>
#include <SDL.h> #include <SDL.h>
......
...@@ -68,7 +68,7 @@ int main(int argc, char **argv) ...@@ -68,7 +68,7 @@ int main(int argc, char **argv)
graphics.initialize(window.windowWidth(), window.windowHeight(), fontResource); graphics.initialize(window.windowWidth(), window.windowHeight(), fontResource);
graphics.render(0); graphics.render(0);
#ifndef DEBUG #ifdef NDEBUG
window.toggleFullscreen(); window.toggleFullscreen();
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment