mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Cleanups
This commit is contained in:
parent
b1579dd8d9
commit
c4e04a6d09
@ -402,9 +402,12 @@ static bool core_updater_list_set_crc(
|
|||||||
static bool core_updater_list_set_paths(
|
static bool core_updater_list_set_paths(
|
||||||
core_updater_list_entry_t *entry, const char *filename_str)
|
core_updater_list_entry_t *entry, const char *filename_str)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
char *last_underscore = NULL;
|
char *last_underscore = NULL;
|
||||||
char *tmp_url = NULL;
|
char *tmp_url = NULL;
|
||||||
|
const char *path_dir_libretro = NULL;
|
||||||
|
const char *path_libretro_info = NULL;
|
||||||
|
const char *network_buildbot_url = NULL;
|
||||||
char remote_core_path[PATH_MAX_LENGTH];
|
char remote_core_path[PATH_MAX_LENGTH];
|
||||||
char local_core_path[PATH_MAX_LENGTH];
|
char local_core_path[PATH_MAX_LENGTH];
|
||||||
char local_info_path[PATH_MAX_LENGTH];
|
char local_info_path[PATH_MAX_LENGTH];
|
||||||
@ -419,9 +422,13 @@ static bool core_updater_list_set_paths(
|
|||||||
if (!entry || string_is_empty(filename_str) || !settings)
|
if (!entry || string_is_empty(filename_str) || !settings)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (string_is_empty(settings->paths.directory_libretro) ||
|
path_dir_libretro = settings->paths.directory_libretro;
|
||||||
string_is_empty(settings->paths.path_libretro_info) ||
|
path_libretro_info = settings->paths.path_libretro_info;
|
||||||
string_is_empty(settings->paths.network_buildbot_url))
|
network_buildbot_url = settings->paths.network_buildbot_url;
|
||||||
|
|
||||||
|
if (string_is_empty(path_dir_libretro) ||
|
||||||
|
string_is_empty(path_libretro_info) ||
|
||||||
|
string_is_empty(network_buildbot_url))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check whether remote file is an archive */
|
/* Check whether remote file is an archive */
|
||||||
@ -439,7 +446,7 @@ static bool core_updater_list_set_paths(
|
|||||||
/* remote_core_path */
|
/* remote_core_path */
|
||||||
fill_pathname_join(
|
fill_pathname_join(
|
||||||
remote_core_path,
|
remote_core_path,
|
||||||
settings->paths.network_buildbot_url,
|
network_buildbot_url,
|
||||||
filename_str,
|
filename_str,
|
||||||
sizeof(remote_core_path));
|
sizeof(remote_core_path));
|
||||||
|
|
||||||
@ -462,7 +469,7 @@ static bool core_updater_list_set_paths(
|
|||||||
/* local_core_path */
|
/* local_core_path */
|
||||||
fill_pathname_join(
|
fill_pathname_join(
|
||||||
local_core_path,
|
local_core_path,
|
||||||
settings->paths.directory_libretro,
|
path_dir_libretro,
|
||||||
filename_str,
|
filename_str,
|
||||||
sizeof(local_core_path));
|
sizeof(local_core_path));
|
||||||
|
|
||||||
@ -482,7 +489,7 @@ static bool core_updater_list_set_paths(
|
|||||||
/* local_info_path */
|
/* local_info_path */
|
||||||
fill_pathname_join_noext(
|
fill_pathname_join_noext(
|
||||||
local_info_path,
|
local_info_path,
|
||||||
settings->paths.path_libretro_info,
|
path_libretro_info,
|
||||||
filename_str,
|
filename_str,
|
||||||
sizeof(local_info_path));
|
sizeof(local_info_path));
|
||||||
|
|
||||||
|
@ -531,13 +531,10 @@ bool netplay_cmd_mode(netplay_t *netplay,
|
|||||||
{
|
{
|
||||||
handle_play_spectate(netplay, 0, NULL, cmd, payload ? sizeof(uint32_t) : 0, payload);
|
handle_play_spectate(netplay, 0, NULL, cmd, payload ? sizeof(uint32_t) : 0, payload);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
return netplay_send_raw_cmd(netplay, connection, cmd, payload,
|
||||||
else
|
payload ? sizeof(uint32_t) : 0);
|
||||||
{
|
|
||||||
return netplay_send_raw_cmd(netplay, connection, cmd, payload,
|
|
||||||
payload ? sizeof(uint32_t) : 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -685,9 +682,7 @@ static void handle_play_spectate(netplay_t *netplay, uint32_t client_num,
|
|||||||
|
|
||||||
/* Mark them as not playing anymore */
|
/* Mark them as not playing anymore */
|
||||||
if (connection)
|
if (connection)
|
||||||
{
|
|
||||||
connection->mode = NETPLAY_CONNECTION_SPECTATING;
|
connection->mode = NETPLAY_CONNECTION_SPECTATING;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
netplay->self_devices = 0;
|
netplay->self_devices = 0;
|
||||||
@ -854,10 +849,8 @@ static void handle_play_spectate(netplay_t *netplay, uint32_t client_num,
|
|||||||
|
|
||||||
/* Mark them as playing */
|
/* Mark them as playing */
|
||||||
if (connection)
|
if (connection)
|
||||||
{
|
|
||||||
connection->mode =
|
connection->mode =
|
||||||
slave ? NETPLAY_CONNECTION_SLAVE : NETPLAY_CONNECTION_PLAYING;
|
slave ? NETPLAY_CONNECTION_SLAVE : NETPLAY_CONNECTION_PLAYING;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
netplay->self_devices = devices;
|
netplay->self_devices = devices;
|
||||||
@ -1106,11 +1099,9 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
|
|
||||||
frame = ntohl(frame);
|
frame = ntohl(frame);
|
||||||
|
|
||||||
|
/* We already had this, so ignore the new transmission */
|
||||||
if (frame < netplay->server_frame_count)
|
if (frame < netplay->server_frame_count)
|
||||||
{
|
|
||||||
/* We already had this, so ignore the new transmission */
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
if (frame != netplay->server_frame_count)
|
if (frame != netplay->server_frame_count)
|
||||||
{
|
{
|
||||||
@ -1194,12 +1185,11 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connection->mode == NETPLAY_CONNECTION_PLAYING
|
/* They were obviously confused */
|
||||||
|
if (
|
||||||
|
connection->mode == NETPLAY_CONNECTION_PLAYING
|
||||||
|| connection->mode == NETPLAY_CONNECTION_SLAVE)
|
|| connection->mode == NETPLAY_CONNECTION_SLAVE)
|
||||||
{
|
|
||||||
/* They were obviously confused */
|
|
||||||
return netplay_cmd_nak(netplay, connection);
|
return netplay_cmd_nak(netplay, connection);
|
||||||
}
|
|
||||||
|
|
||||||
client_num = (unsigned)(connection - netplay->connections + 1);
|
client_num = (unsigned)(connection - netplay->connections + 1);
|
||||||
|
|
||||||
@ -1535,11 +1525,9 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
tmp_ptr = PREV_PTR(tmp_ptr);
|
tmp_ptr = PREV_PTR(tmp_ptr);
|
||||||
} while (tmp_ptr != netplay->run_ptr);
|
} while (tmp_ptr != netplay->run_ptr);
|
||||||
|
|
||||||
|
/* Oh well, we got rid of it! */
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
|
||||||
/* Oh well, we got rid of it! */
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
if (buffer[0] <= netplay->other_frame_count)
|
if (buffer[0] <= netplay->other_frame_count)
|
||||||
{
|
{
|
||||||
@ -1548,11 +1536,9 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
uint32_t local_crc = netplay_delta_frame_crc(
|
uint32_t local_crc = netplay_delta_frame_crc(
|
||||||
netplay, &netplay->buffer[tmp_ptr]);
|
netplay, &netplay->buffer[tmp_ptr]);
|
||||||
|
|
||||||
|
/* Problem! */
|
||||||
if (buffer[1] != local_crc)
|
if (buffer[1] != local_crc)
|
||||||
{
|
|
||||||
/* Problem! */
|
|
||||||
netplay_cmd_request_savestate(netplay);
|
netplay_cmd_request_savestate(netplay);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1587,16 +1573,14 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
|||||||
{
|
{
|
||||||
if (!netplay->is_replay)
|
if (!netplay->is_replay)
|
||||||
{
|
{
|
||||||
netplay->is_replay = true;
|
netplay->is_replay = true;
|
||||||
netplay->replay_ptr = netplay->run_ptr;
|
netplay->replay_ptr = netplay->run_ptr;
|
||||||
netplay->replay_frame_count = netplay->run_frame_count;
|
netplay->replay_frame_count = netplay->run_frame_count;
|
||||||
netplay_wait_and_init_serialization(netplay);
|
netplay_wait_and_init_serialization(netplay);
|
||||||
netplay->is_replay = false;
|
netplay->is_replay = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
netplay_wait_and_init_serialization(netplay);
|
netplay_wait_and_init_serialization(netplay);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only players may load states */
|
/* Only players may load states */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user