diff --git a/src/game/boe.appleevents.mm b/src/game/boe.appleevents.mm index cc2e487e..650d3b6c 100644 --- a/src/game/boe.appleevents.mm +++ b/src/game/boe.appleevents.mm @@ -30,8 +30,8 @@ typedef NSAppleEventDescriptor AEDescr; -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*) sender; @end -void set_up_apple_events(int argc, char* argv[]); // Suppress "no prototype" warning -void set_up_apple_events(int, char*[]) { +void set_up_apple_events(); // Suppress "no prototype" warning +void set_up_apple_events() { AppleEventHandler* aeHandler = [[AppleEventHandler alloc] init]; [[NSApplication sharedApplication] setDelegate: aeHandler]; } diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 8c2d2090..b745bb73 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -238,7 +238,7 @@ void process_args(int argc, char* argv[]) { } void init_boe(int argc, char* argv[]) { - set_up_apple_events(argc, argv); + set_up_apple_events(); init_directories(argv[0]); check_for_intel(); process_args(argc, argv); diff --git a/src/game/boe.main.hpp b/src/game/boe.main.hpp index a99130cf..1914ed76 100644 --- a/src/game/boe.main.hpp +++ b/src/game/boe.main.hpp @@ -11,7 +11,7 @@ void redraw_everything(); void Mouse_Pressed(const sf::Event&); void close_program(); void change_cursor(location where_curs); -void set_up_apple_events(int argc, char* argv[]); +void set_up_apple_events(); void move_sound(ter_num_t ter,short step); void incidental_noises(bool on_surface); void pause(short length); diff --git a/src/game/boe.menus.linux.cpp b/src/game/boe.menus.linux.cpp index 861f387f..d5004835 100644 --- a/src/game/boe.menus.linux.cpp +++ b/src/game/boe.menus.linux.cpp @@ -49,6 +49,6 @@ void hideMenuBar() { void showMenuBar() { } -void set_up_apple_events(int argc, char* argv[]) { +void set_up_apple_events() { } diff --git a/src/game/boe.menus.win.cpp b/src/game/boe.menus.win.cpp index 4e3c6401..fead5645 100644 --- a/src/game/boe.menus.win.cpp +++ b/src/game/boe.menus.win.cpp @@ -313,11 +313,6 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara return CallWindowProc(reinterpret_cast(mainProc), handle, message, wParam, lParam); } -#include "fileio.hpp" -#include "boe.graphics.hpp" -#include "boe.actions.hpp" -#include "boe.fileio.hpp" - -void set_up_apple_events(int argc, char* argv[]) { +void set_up_apple_events() { } \ No newline at end of file diff --git a/src/pcedit/pc.appleevents.mm b/src/pcedit/pc.appleevents.mm index fc4cdca0..31c62c02 100644 --- a/src/pcedit/pc.appleevents.mm +++ b/src/pcedit/pc.appleevents.mm @@ -23,8 +23,8 @@ extern fs::path file_in_mem; -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*) sender; @end -void set_up_apple_events(int argc, char* argv[]); // Suppress "no prototype" warning -void set_up_apple_events(int, char*[]) { +void set_up_apple_events(); // Suppress "no prototype" warning +void set_up_apple_events() { AppleEventHandler* aeHandler = [[AppleEventHandler alloc] init]; [[NSApplication sharedApplication] setDelegate: aeHandler]; } diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index 56fa7501..3674a1ce 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -69,7 +69,7 @@ void Mouse_Pressed(const sf::Event&); void adjust_window(sf::RenderWindow&, sf::View&); sf::FloatRect compute_viewport(const sf::RenderWindow&, float ui_scale); bool verify_restore_quit(std::string dlog); -void set_up_apple_events(int argc, char* argv[]); +void set_up_apple_events(); void pick_preferences(); void save_prefs(); @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) { check_for_intel(); srand(time(nullptr)); - set_up_apple_events(argc, argv); + set_up_apple_events(); cDialog::init(); redraw_screen(); diff --git a/src/pcedit/pc.menus.linux.cpp b/src/pcedit/pc.menus.linux.cpp index 83ab56ad..c405f374 100644 --- a/src/pcedit/pc.menus.linux.cpp +++ b/src/pcedit/pc.menus.linux.cpp @@ -27,5 +27,5 @@ void drawMenuBar() { menu_ptr->draw(); } -void set_up_apple_events(int argc, char* argv[]) { +void set_up_apple_events() { } diff --git a/src/pcedit/pc.menus.win.cpp b/src/pcedit/pc.menus.win.cpp index 7b2256e3..0e271b84 100644 --- a/src/pcedit/pc.menus.win.cpp +++ b/src/pcedit/pc.menus.win.cpp @@ -153,19 +153,5 @@ bool menuBarProcessEvent(const sf::Event&) { void drawMenuBar() { } -#include "fileio.hpp" -#include "pc.fileio.hpp" - -extern bool party_in_scen, scen_items_loaded; -extern fs::path file_in_mem; -void set_up_apple_events(int argc, char* argv[]) { - if(argc > 1) { - if(load_party(argv[1], univ)) { - file_in_mem = argv[1]; - party_in_scen = !univ.party.scen_name.empty(); - if(!party_in_scen) load_base_item_defs(); - scen_items_loaded = true; - menu_activate(); - } - } +void set_up_apple_events() { } diff --git a/src/scenedit/scen.appleevents.mm b/src/scenedit/scen.appleevents.mm index 0ae57a81..3e089065 100644 --- a/src/scenedit/scen.appleevents.mm +++ b/src/scenedit/scen.appleevents.mm @@ -27,8 +27,8 @@ extern bool change_made, ae_loading; //-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*) sender; @end -void set_up_apple_events(int argc, char* argv[]); // Suppress "no prototype" warning -void set_up_apple_events(int, char*[]) { +void set_up_apple_events(); // Suppress "no prototype" warning +void set_up_apple_events() { AppleEventHandler* aeHandler = [[AppleEventHandler alloc] init]; [[NSApplication sharedApplication] setDelegate: aeHandler]; } diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index bb8f1b4d..a3da1f13 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -78,7 +78,7 @@ cScenario scenario; rectangle right_sbar_rect; extern rectangle terrain_buttons_rect; -extern void set_up_apple_events(int argc, char* argv[]); +extern void set_up_apple_events(); // TODO: these should be members of some global entity instead of being here std::unordered_map> event_listeners; @@ -232,7 +232,7 @@ void init_scened(int argc, char* argv[]) { cDialog::defaultBackground = cDialog::BG_LIGHT; cDialog::doAnimations = true; - set_up_apple_events(argc, argv); + set_up_apple_events(); init_fileio(); } diff --git a/src/scenedit/scen.menus.linux.cpp b/src/scenedit/scen.menus.linux.cpp index e1105e28..8b09c189 100644 --- a/src/scenedit/scen.menus.linux.cpp +++ b/src/scenedit/scen.menus.linux.cpp @@ -31,5 +31,5 @@ void update_edit_menu() { menu_ptr->update_edit_menu(undo_list); } -void set_up_apple_events(int argc, char* argv[]) { +void set_up_apple_events() { } diff --git a/src/scenedit/scen.menus.win.cpp b/src/scenedit/scen.menus.win.cpp index 692ed16b..c2103496 100644 --- a/src/scenedit/scen.menus.win.cpp +++ b/src/scenedit/scen.menus.win.cpp @@ -234,22 +234,5 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara return CallWindowProc(reinterpret_cast(mainProc), handle, message, wParam, lParam); } -#include "fileio.hpp" -#include "scen.actions.hpp" -#include "scen.townout.hpp" - -extern location cur_out; -extern cOutdoors* current_terrain; -extern bool change_made, ae_loading; -void set_up_apple_events(int argc, char* argv[]) { - if(argc > 1) { - if(load_scenario(argv[1], scenario)) { - set_current_town(scenario.last_town_edited); - cur_out = scenario.last_out_edited; - current_terrain = scenario.outdoors[cur_out.x][cur_out.y]; - change_made = false; - ae_loading = true; - set_up_main_screen(); - } - } +void set_up_apple_events() { }