first attempt to build on the octane, nosound for now
[summerhack] / src / sumhack.cpp
index 75c6fa3..5702001 100644 (file)
@@ -7,7 +7,9 @@
 #include "common/err_msg.h"
 #include "parts/parts.hpp"
 #include "events.hpp"
+#ifndef NO_MUSIC
 #include "sdlvf/sdlvf.h"
+#endif
 
 using namespace std;
 
@@ -88,10 +90,10 @@ bool init() {
        }
 
        if(gip->fullscreen) {
-               SDL_ShowCursor(0);
+               fxwt::show_cursor(false);
        }
 
-       fxwt::set_window_title("The Lab Demos :: Summer Hack");
+       fxwt::set_window_title("The Lab Demos :: Summer Hack (rebuild)");
        fxwt::set_display_handler(update_gfx);
        fxwt::set_idle_handler(update_gfx);
        fxwt::set_keyboard_handler(key_handler);
@@ -102,6 +104,7 @@ bool init() {
        //dsys::init();
 
        // show loading screen
+       glClear(GL_COLOR_BUFFER_BIT);
        dsys::overlay(get_texture("data/img/loading.jpg"), Vector2(0, 0), Vector2(1, 1), 1.0);
        flip();
 
@@ -139,24 +142,28 @@ bool init() {
                dsys::render_demo(render_fps, render_path);
        }
 
+#ifndef NO_MUSIC
        if(music) {
                sdlvf_init("data/music/red_herring.ogg");
        }
+#endif
        
        timer_reset(&timer);
        timer_start(&timer);
-       
+
        return true;
 }
 
 void clean_up() {
        unsigned long time = timer_getmsec(&timer);
-       
+
+#ifndef NO_MUSIC
        if(music) {
                sdlvf_done();
        }
+#endif
 
-       SDL_ShowCursor(1);
+       fxwt::show_cursor(true);
 
        for(size_t i=0; i<parts.size(); i++) {
                delete parts[i];
@@ -180,6 +187,7 @@ void clean_up() {
 void update_gfx() {
        unsigned long frame_start = timer_getmsec(&timer);
        
+#ifndef NO_MUSIC
        if(music) {
                int sdlvf_err;
                if((sdlvf_err = sdlvf_check()) != SDLVF_PLAYING) {
@@ -187,6 +195,7 @@ void update_gfx() {
                        exit(0);
                }
        }
+#endif
        
        if(dsys::update_graphics() == -1) {
                exit(0);