Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Bug fixes for windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jaw committed Dec 12, 2014
1 parent 758548c commit f1a36fc
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
24 changes: 18 additions & 6 deletions engine/include/vsx_command_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,22 @@
template<class T>
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;
Expand Down Expand Up @@ -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)
Expand All @@ -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
}


Expand All @@ -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
}

};
Expand Down
3 changes: 2 additions & 1 deletion engine/src/core/vsx_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
9 changes: 5 additions & 4 deletions engine_audiovisual/src/vsx_statelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -323,9 +324,7 @@ void vsx_statelist::render()
get_files_recursive(own_path+"visuals_faders", &fader_file_list,"",".svn CVS");
for (std::list<vsx_string>::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);
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -475,6 +475,7 @@ void vsx_statelist::render()
}
} else
{

if (cmd_out && cmd_in)
{
vxe->process_message_queue(cmd_in, cmd_out);
Expand Down
2 changes: 2 additions & 0 deletions player/src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
}

/*
Expand Down
4 changes: 4 additions & 0 deletions player/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -291,6 +294,7 @@ int main(int argc, char* argv[])
mouse_pos_type = 0;
}


app_pre_draw();

// Get time and mouse position
Expand Down

0 comments on commit f1a36fc

Please sign in to comment.