diff --git a/Makefile b/Makefile index b0c47a7a95fd8b58cf2d729806a6e8209e9bd953..669b32a953f26b2d616a5546c0151799de5119ab 100644 --- a/Makefile +++ b/Makefile @@ -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) DEPS = Makefile 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 # primary role based tagets @@ -22,7 +22,7 @@ release: clean starsphere debug: CPPFLAGS += $(DEBUGFLAGSCPP) memcheck: 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 # file based targets diff --git a/WindowManager.cpp b/WindowManager.cpp index 2f0bac57d8d5eaca0b6ed73903b18058067835f6..b1a249663679157eed5f0d15f6ab615611d4aa16 100644 --- a/WindowManager.cpp +++ b/WindowManager.cpp @@ -96,6 +96,9 @@ bool WindowManager::initialize() void WindowManager::eventLoop() { + // be sure there's at least one observer! + assert(eventObservers.size() > 0); + SDL_AddTimer(40, &timerCallbackRenderEvent, NULL); SDL_AddTimer(1000, &timerCallbackBOINCUpdateEvent, NULL); diff --git a/WindowManager.h b/WindowManager.h index 37266bcdf3df554a19166933550695f3dbe3da5e..9b6d2b029daf000025cdb6a8ffa0df38c3c56602 100644 --- a/WindowManager.h +++ b/WindowManager.h @@ -4,6 +4,7 @@ #include <iostream> #include <string> #include <list> +#include <cassert> #include <SDL.h> diff --git a/main.C b/main.C index 40500ed1dac34a8baab00e0b4843effa5dcbec71..e8d8d522810a12102c59c463437348d6b5e1b0cd 100644 --- a/main.C +++ b/main.C @@ -68,7 +68,7 @@ int main(int argc, char **argv) graphics.initialize(window.windowWidth(), window.windowHeight(), fontResource); graphics.render(0); -#ifndef DEBUG +#ifdef NDEBUG window.toggleFullscreen(); #endif