Skip to content

Commit 813d3f3

Browse files
committed
Moved saved_film remote commands to hs
1 parent 4ba2ff0 commit 813d3f3

File tree

3 files changed

+21
-158
lines changed

3 files changed

+21
-158
lines changed

game/source/hs/hs_function.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "main/main.hpp"
1717
#include "main/main_game.hpp"
1818
#include "main/main_game_launch.hpp"
19+
#include "saved_games/saved_film_manager.hpp"
1920
#include "text/font_loading.hpp"
2021

2122
#include <utility>
@@ -12962,65 +12963,65 @@ MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
1296212963
NULL,
1296312964
1, _hs_type_boolean
1296412965
);
12965-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 4,
12966+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 4,
1296612967
_hs_type_void,
1296712968
saved_film_play,
1296812969
0,
12969-
0x00746CF0, // $TODO write the function chuckle nuts
12970+
saved_film_manager_play_hs, // 0x00746CF0,
1297012971
"plays a saved film for given controller\r\nNETWORK SAFE: Unknown, assumed unsafe",
1297112972
NULL,
1297212973
2, _hs_type_enum_controller, _hs_type_string
1297312974
);
12974-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 0,
12975+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 0,
1297512976
_hs_type_void,
1297612977
saved_film_play_last,
1297712978
0,
12978-
0x00746F40, // $TODO write the function chuckle nuts
12979+
saved_film_manager_play_last_hs, // 0x00746F40,
1297912980
"play back last recorded saved film for given controller\r\nNETWORK SAFE: Unknown, assumed unsafe",
1298012981
NULL,
1298112982
0,
1298212983
);
12983-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
12984+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1298412985
_hs_type_void,
1298512986
saved_film_disable_version_checking,
1298612987
0,
12987-
0x007471F0, // $TODO write the function chuckle nuts
12988+
saved_film_manager_disable_version_checking, // 0x007471F0,
1298812989
"disable saved film version checking\r\nNETWORK SAFE: Unknown, assumed unsafe",
1298912990
NULL,
1299012991
1, _hs_type_boolean
1299112992
);
12992-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
12993+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1299312994
_hs_type_void,
1299412995
saved_film_toggle_debug_saving,
1299512996
0,
12996-
0x00747370, // $TODO write the function chuckle nuts
12997+
saved_film_manager_toggle_automatic_debug_saving, // 0x00747370,
1299712998
"toggle saving of last film to the debug output directory automatically after each game level\r\nNETWORK SAFE: Unknown, assumed unsafe",
1299812999
NULL,
1299913000
1, _hs_type_boolean
1300013001
);
13001-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13002+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1300213003
_hs_type_void,
1300313004
saved_films_delete_on_level_load,
1300413005
0,
13005-
0x007476B0, // $TODO write the function chuckle nuts
13006+
saved_film_manager_delete_on_level_load, // 0x007476B0,
1300613007
"toggle deletion last saved film after loading a new game level\r\nNETWORK SAFE: Unkown, assumed unsafe",
1300713008
NULL,
1300813009
1, _hs_type_boolean
1300913010
);
13010-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13011+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1301113012
_hs_type_void,
1301213013
saved_films_show_timestamp,
1301313014
0,
13014-
0x00747870, // $TODO write the function chuckle nuts
13015+
saved_film_manager_show_timestamp, // 0x00747870,
1301513016
"toggle showing timestamp for saved film playback\r\nNETWORK SAFE: Unkown, assumed unsafe",
1301613017
NULL,
1301713018
1, _hs_type_boolean
1301813019
);
13019-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13020+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1302013021
_hs_type_void,
1302113022
saved_film_manager_should_record_film_default,
1302213023
0,
13023-
0x00747AF0, // $TODO write the function chuckle nuts
13024+
saved_film_manager_should_record_film_default_set, // 0x00747AF0
1302413025
"Toggle recording of replay in single player game\r\nNETWORK SAFE: Unknown, assumed unsafe",
1302513026
NULL,
1302613027
1, _hs_type_boolean
@@ -13385,20 +13386,20 @@ MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
1338513386
NULL,
1338613387
1, _hs_type_long_integer
1338713388
);
13388-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13389+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1338913390
_hs_type_void,
1339013391
saved_film_set_playback_game_speed,
1339113392
0,
13392-
0x00735750, // $TODO write the function chuckle nuts
13393+
saved_film_manager_set_playback_game_speed, // 0x00735750,
1339313394
"set the saved film playback speed",
1339413395
NULL,
1339513396
1, _hs_type_real
1339613397
);
13397-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13398+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1339813399
_hs_type_void,
1339913400
saved_film_set_pending_playback_game_speed,
1340013401
0,
13401-
0x00735B20, // $TODO write the function chuckle nuts
13402+
saved_film_manager_set_pending_playback_game_speed, // 0x00735B20,
1340213403
"set the pending saved film playback speed",
1340313404
NULL,
1340413405
1, _hs_type_real
@@ -13457,11 +13458,11 @@ MACRO_FUNCTION_EVALUATE2(hs_function_definition, 4,
1345713458
NULL,
1345813459
2, _hs_type_object, _hs_type_boolean
1345913460
);
13460-
MACRO_FUNCTION_EVALUATE2(hs_function_definition, 2,
13461+
MACRO_FUNCTION_EVALUATE(hs_function_definition, 2,
1346113462
_hs_type_void,
1346213463
saved_film_seek_to_film_tick,
1346313464
0,
13464-
0x00737080, // $TODO write the function chuckle nuts
13465+
saved_film_manager_seek_to_film_tick_hs, // 0x00737080,
1346513466
"seeks to a film tick",
1346613467
NULL,
1346713468
1, _hs_type_long_integer

game/source/networking/tools/remote_command.cpp

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,118 +2373,3 @@ callback_result_t gui_print_active_screens_callback(const void* userdata, int32
23732373
return result;
23742374
}
23752375

2376-
callback_result_t saved_film_play_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2377-
{
2378-
COMMAND_CALLBACK_PARAMETER_CHECK;
2379-
2380-
int16 controller_index = (int16)atol(tokens[1]->get_string());
2381-
const char* film_name = tokens[2]->get_string();
2382-
saved_film_manager_play_hs(controller_index, film_name);
2383-
2384-
return result;
2385-
}
2386-
2387-
callback_result_t saved_film_play_last_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2388-
{
2389-
COMMAND_CALLBACK_PARAMETER_CHECK;
2390-
2391-
saved_film_manager_play_last_hs();
2392-
2393-
return result;
2394-
}
2395-
2396-
callback_result_t saved_film_disable_version_checking_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2397-
{
2398-
COMMAND_CALLBACK_PARAMETER_CHECK;
2399-
2400-
int32 disable = token_try_parse_bool(tokens[1]);
2401-
if (disable <= 1)
2402-
{
2403-
saved_film_manager_disable_version_checking((bool)disable);
2404-
}
2405-
2406-
return result;
2407-
}
2408-
2409-
callback_result_t saved_film_toggle_debug_saving_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2410-
{
2411-
COMMAND_CALLBACK_PARAMETER_CHECK;
2412-
2413-
int32 enable = token_try_parse_bool(tokens[1]);
2414-
if (enable <= 1)
2415-
{
2416-
saved_film_manager_toggle_automatic_debug_saving((bool)enable);
2417-
}
2418-
2419-
return result;
2420-
}
2421-
2422-
callback_result_t saved_films_delete_on_level_load_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2423-
{
2424-
COMMAND_CALLBACK_PARAMETER_CHECK;
2425-
2426-
int32 delete_on_level_load = token_try_parse_bool(tokens[1]);
2427-
if (delete_on_level_load <= 1)
2428-
{
2429-
saved_film_manager_delete_on_level_load((bool)delete_on_level_load);
2430-
}
2431-
2432-
return result;
2433-
}
2434-
2435-
callback_result_t saved_films_show_timestamp_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2436-
{
2437-
COMMAND_CALLBACK_PARAMETER_CHECK;
2438-
2439-
int32 show_timestamp = token_try_parse_bool(tokens[1]);
2440-
if (show_timestamp <= 1)
2441-
{
2442-
saved_film_manager_show_timestamp((bool)show_timestamp);
2443-
}
2444-
2445-
return result;
2446-
}
2447-
2448-
callback_result_t saved_film_manager_should_record_film_default_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2449-
{
2450-
COMMAND_CALLBACK_PARAMETER_CHECK;
2451-
2452-
int32 b = token_try_parse_bool(tokens[1]);
2453-
if (b <= 1)
2454-
{
2455-
saved_film_manager_should_record_film_default_set((bool)b);
2456-
}
2457-
2458-
return result;
2459-
}
2460-
2461-
callback_result_t saved_film_set_playback_game_speed_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2462-
{
2463-
COMMAND_CALLBACK_PARAMETER_CHECK;
2464-
2465-
real32 game_speed = (real32)atof(tokens[1]->get_string());
2466-
saved_film_manager_set_playback_game_speed(game_speed);
2467-
2468-
return result;
2469-
}
2470-
2471-
callback_result_t saved_film_set_pending_playback_game_speed_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2472-
{
2473-
COMMAND_CALLBACK_PARAMETER_CHECK;
2474-
2475-
real32 game_speed = (real32)atof(tokens[1]->get_string());
2476-
saved_film_manager_set_pending_playback_game_speed(game_speed);
2477-
2478-
return result;
2479-
}
2480-
2481-
callback_result_t saved_film_seek_to_film_tick_callback(const void* userdata, int32 token_count, tokens_t const tokens)
2482-
{
2483-
COMMAND_CALLBACK_PARAMETER_CHECK;
2484-
2485-
int32 film_tick = (int32)atol(tokens[1]->get_string());
2486-
saved_film_manager_seek_to_film_tick_hs(film_tick);
2487-
2488-
return result;
2489-
}
2490-

game/source/networking/tools/remote_command.hpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,6 @@ COMMAND_CALLBACK_DECLARE(controller_set_tertiary_change_color);
223223
COMMAND_CALLBACK_DECLARE(controller_set_voice_mask);
224224
COMMAND_CALLBACK_DECLARE(controller_set_voice_output_setting);
225225

226-
COMMAND_CALLBACK_DECLARE(saved_film_play);
227-
COMMAND_CALLBACK_DECLARE(saved_film_play_last);
228-
COMMAND_CALLBACK_DECLARE(saved_film_disable_version_checking);
229-
COMMAND_CALLBACK_DECLARE(saved_film_toggle_debug_saving);
230-
COMMAND_CALLBACK_DECLARE(saved_films_delete_on_level_load);
231-
COMMAND_CALLBACK_DECLARE(saved_films_show_timestamp);
232-
COMMAND_CALLBACK_DECLARE(saved_film_manager_should_record_film_default);
233-
COMMAND_CALLBACK_DECLARE(saved_film_set_playback_game_speed);
234-
COMMAND_CALLBACK_DECLARE(saved_film_set_pending_playback_game_speed);
235-
COMMAND_CALLBACK_DECLARE(saved_film_seek_to_film_tick);
236-
237226
//-----------------------------------------------------------------------------
238227

239228
s_command const k_registered_commands[] =
@@ -391,18 +380,6 @@ s_command const k_registered_commands[] =
391380
COMMAND_CALLBACK_REGISTER(controller_set_tertiary_change_color, 2, "<controller> <player_color>", "set tertiary color for specified controller\r\nNETWORK SAFE: No"),
392381
COMMAND_CALLBACK_REGISTER(controller_set_voice_mask, 2, "<controller> <voice_mask>", "set voice mask for specified controller\r\nNETWORK SAFE: No"),
393382
COMMAND_CALLBACK_REGISTER(controller_set_voice_output_setting, 2, "<controller> <voice_output_setting>", "set voice output setting for specified controller\r\nNETWORK SAFE: No"),
394-
395-
COMMAND_CALLBACK_REGISTER(saved_film_play, 2, "<controller> <string>", "plays a saved film for given controller\r\nNETWORK SAFE: Unknown, assumed unsafe"),
396-
COMMAND_CALLBACK_REGISTER(saved_film_play_last, 0, "", "play back last recorded saved film for given controller\r\nNETWORK SAFE: Unknown, assumed unsafe"),
397-
COMMAND_CALLBACK_REGISTER(saved_film_disable_version_checking, 1, "<boolean>", "disable saved film version checking\r\nNETWORK SAFE: Unknown, assumed unsafe"),
398-
COMMAND_CALLBACK_REGISTER(saved_film_toggle_debug_saving, 1, "<boolean>", "toggle saving of last film to the debug output directory automatically after each game level\r\nNETWORK SAFE: Unknown, assumed unsafe"),
399-
COMMAND_CALLBACK_REGISTER(saved_films_delete_on_level_load, 1, "<boolean>", "toggle deletion last saved film after loading a new game level\r\nNETWORK SAFE: Unkown, assumed unsafe"),
400-
COMMAND_CALLBACK_REGISTER(saved_films_show_timestamp, 1, "<boolean>", "toggle showing timestamp for saved film playback\r\nNETWORK SAFE: Unkown, assumed unsafe"),
401-
COMMAND_CALLBACK_REGISTER(saved_film_manager_should_record_film_default, 1, "<boolean>", "Toggle recording of replay in single player game\r\nNETWORK SAFE: Unknown, assumed unsafe"),
402-
COMMAND_CALLBACK_REGISTER(saved_film_set_playback_game_speed, 1, "<real>", "set the saved film playback speed"),
403-
COMMAND_CALLBACK_REGISTER(saved_film_set_pending_playback_game_speed, 1, "<real>", "set the pending saved film playback speed"),
404-
COMMAND_CALLBACK_REGISTER(saved_film_seek_to_film_tick, 1, "<long>", "seeks to a film tick"),
405-
406383
};
407384

408385
extern void command_tokenize(const char* input, tokens_t& tokens, int32* token_count);

0 commit comments

Comments
 (0)