|
|
|
@ -253,7 +253,6 @@ static enum BoxType currently_building()
|
|
|
|
|
return toolbar[cur_toolbar_slot];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct BoxInfo boxinfo(enum BoxType type)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < ARRLEN(boxes); i++)
|
|
|
|
@ -519,29 +518,30 @@ static void init(void)
|
|
|
|
|
result = ma_device_init(NULL, µphone_config, µphone_device);
|
|
|
|
|
if (result != MA_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
Log("Failed to initialize capture device.\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
quit_with_popup("Failed to initialize microphone\n", "Failed to initialize audio");
|
|
|
|
|
Log("Cap device fail\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = ma_device_init(NULL, &speaker_config, &speaker_device);
|
|
|
|
|
if (result != MA_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
ma_device_uninit(µphone_device);
|
|
|
|
|
quit_with_popup("Failed to initialize speaker/headphones\n", "Failed to initialize audio");
|
|
|
|
|
Log("Failed to init speaker\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ma_mutex_init(&send_packets_mutex) != MA_SUCCESS)
|
|
|
|
|
Log("Failed to init send mutex\n");
|
|
|
|
|
if (ma_mutex_init(&play_packets_mutex) != MA_SUCCESS)
|
|
|
|
|
Log("Failed to init play mutex\n");
|
|
|
|
|
flight_assert(ma_mutex_init(&send_packets_mutex) == MA_SUCCESS);
|
|
|
|
|
flight_assert(ma_mutex_init(&play_packets_mutex) == MA_SUCCESS);
|
|
|
|
|
|
|
|
|
|
result = ma_device_start(µphone_device);
|
|
|
|
|
if (result != MA_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
ma_device_uninit(µphone_device);
|
|
|
|
|
Log("Failed to start device.\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
Log("Failed to start mic.\n");
|
|
|
|
|
quit_with_popup("Failed to start microphone device\n", "Failed to start audio");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = ma_device_start(&speaker_device);
|
|
|
|
@ -550,7 +550,8 @@ static void init(void)
|
|
|
|
|
ma_device_uninit(µphone_device);
|
|
|
|
|
ma_device_uninit(&speaker_device);
|
|
|
|
|
Log("Failed to start speaker\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
quit_with_popup("Failed to start speaker device\n", "Failed to start audio");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log("Initialized audio\n");
|
|
|
|
@ -580,10 +581,7 @@ static void init(void)
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// shaders
|
|
|
|
|
{
|
|
|
|
|
// initialize shader
|
|
|
|
|
{
|
|
|
|
|
// initialize shaders
|
|
|
|
|
{
|
|
|
|
|
sgp_pipeline_desc pip_desc = {
|
|
|
|
|
.shader = *hueshift_program_shader_desc(sg_query_backend()),
|
|
|
|
@ -595,7 +593,6 @@ static void init(void)
|
|
|
|
|
fprintf(stderr, "failed to make hueshift pipeline\n");
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
sgp_pipeline_desc pip_desc = {
|
|
|
|
@ -610,6 +607,7 @@ static void init(void)
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// images loading
|
|
|
|
|
{
|
|
|
|
@ -688,10 +686,9 @@ static void init(void)
|
|
|
|
|
/* received. Reset the peer in the event the 5 seconds */
|
|
|
|
|
/* had run out without any significant event. */
|
|
|
|
|
enet_peer_reset(peer);
|
|
|
|
|
fprintf(stderr, "Connection to server failed.");
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Log("Failed to connecvt to server\n");
|
|
|
|
|
quit_with_popup("Failed to connect to server. Is your wifi down? It took too long.", "Connection Failure");
|
|
|
|
|
Log("Connection to server failed.\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|