From f1a36fc60670c8b7299570af97e3581d498a4766 Mon Sep 17 00:00:00 2001 From: "Jonatan \"jaw\" Wallmander" Date: Fri, 12 Dec 2014 21:18:39 +0100 Subject: [PATCH] Bug fixes for windows build --- engine/include/vsx_command_list.h | 24 ++++++++++++++++++------ engine/src/core/vsx_engine.cpp | 3 ++- engine_audiovisual/src/vsx_statelist.cpp | 9 +++++---- player/src/application.cpp | 2 ++ player/src/main.cpp | 4 ++++ 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/engine/include/vsx_command_list.h b/engine/include/vsx_command_list.h index bdb48163..c9e88804 100644 --- a/engine/include/vsx_command_list.h +++ b/engine/include/vsx_command_list.h @@ -17,16 +17,22 @@ template class vsx_command_buffer_broker { - pthread_mutex_t mutex1; + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_t mutex1; + #endif void get_lock() { - pthread_mutex_lock( &mutex1 ); + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_lock( &mutex1 ); + #endif } void release_lock() { - pthread_mutex_unlock( &mutex1 ); + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_unlock( &mutex1 ); + #endif } vsxf* filesystem; @@ -457,7 +463,9 @@ class vsx_command_buffer_broker accept_commands(1), delete_commands_on_delete(false) { - pthread_mutex_init(&mutex1, NULL); + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_init(&mutex1, NULL); + #endif } vsx_command_buffer_broker(bool delete_commands) @@ -466,7 +474,9 @@ class vsx_command_buffer_broker accept_commands(1), delete_commands_on_delete(delete_commands) { - pthread_mutex_init(&mutex1, NULL); + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_init(&mutex1, NULL); + #endif } @@ -475,7 +485,9 @@ class vsx_command_buffer_broker if (delete_commands_on_delete) clear_delete(); - pthread_mutex_destroy(&mutex1); + #if PLATFORM_FAMILY == PLATFORM_FAMILY_UNIX + pthread_mutex_destroy(&mutex1); + #endif } }; diff --git a/engine/src/core/vsx_engine.cpp b/engine/src/core/vsx_engine.cpp index cd5ed327..da230546 100644 --- a/engine/src/core/vsx_engine.cpp +++ b/engine/src/core/vsx_engine.cpp @@ -716,7 +716,8 @@ void vsx_engine::set_ignore_per_frame_time_limit(bool new_value) void vsx_engine::process_message_queue(vsx_command_list *cmd_in, vsx_command_list *cmd_out_res, bool exclusive, bool ignore_timing, float max_time) { - if (!valid) return; + if (!valid) + return; // service commands LOG("process_message_queue 1") diff --git a/engine_audiovisual/src/vsx_statelist.cpp b/engine_audiovisual/src/vsx_statelist.cpp index bf1866cc..9c7ef292 100644 --- a/engine_audiovisual/src/vsx_statelist.cpp +++ b/engine_audiovisual/src/vsx_statelist.cpp @@ -313,6 +313,7 @@ void vsx_statelist::render() { if (render_first) { + printf("render first\n"); GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); if (tex1.has_buffer_support()) @@ -323,9 +324,7 @@ void vsx_statelist::render() get_files_recursive(own_path+"visuals_faders", &fader_file_list,"",".svn CVS"); for (std::list::iterator it = fader_file_list.begin(); it != fader_file_list.end(); ++it) { - #ifdef VSXU_DEBUG - printf("initializing fader %s\n", (*it).c_str()); - #endif + printf("initializing fader %s\n", (*it).c_str()); vsx_engine* lvxe = new vsx_engine( module_list ); lvxe->start(); lvxe->load_state(*it); @@ -366,7 +365,8 @@ void vsx_statelist::render() } // render first // prevent from rendering by mistake - if ( !statelist.size() ) return; + if ( !statelist.size() ) + return; if ((*state_iter).engine != vxe) // change is on the way { @@ -475,6 +475,7 @@ void vsx_statelist::render() } } else { + if (cmd_out && cmd_in) { vxe->process_message_queue(cmd_in, cmd_out); diff --git a/player/src/application.cpp b/player/src/application.cpp index ef2c0f72..ac5cedd8 100644 --- a/player/src/application.cpp +++ b/player/src/application.cpp @@ -64,6 +64,7 @@ bool app_draw(int id) VSX_UNUSED(id); if (first) { + printf("INFO: app_draw first\n"); first = false; // create a new manager manager = manager_factory(); @@ -78,6 +79,7 @@ bool app_draw(int id) overlay->set_manager(manager); // create a new intro (Luna logo) object if (disable_randomizer) manager->set_randomizer(false); + printf("INFO: app_draw first done\n"); } /* diff --git a/player/src/main.cpp b/player/src/main.cpp index e8229ccb..48c9ecd9 100644 --- a/player/src/main.cpp +++ b/player/src/main.cpp @@ -238,7 +238,10 @@ int main(int argc, char* argv[]) glewInit(); if (start_fullscreen) glfwEnable( GLFW_MOUSE_CURSOR ); + + printf("INFO: app_init\n"); app_init(0); + printf("INFO: app_init done\n"); glfwEnable(GLFW_AUTO_POLL_EVENTS); @@ -291,6 +294,7 @@ int main(int argc, char* argv[]) mouse_pos_type = 0; } + app_pre_draw(); // Get time and mouse position