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