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