diff --git a/src/game/area.c b/src/game/area.c index 6b7829da7..88b783ed9 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -27,7 +27,6 @@ #include "pc/lua/smlua_hooks.h" #include "pc/djui/djui.h" #include "pc/djui/djui_panel_pause.h" -#include "pc/pc_main.h" #include "pc/nametags.h" struct SpawnInfo gPlayerSpawnInfos[MAX_PLAYERS]; @@ -448,7 +447,7 @@ void render_game(void) { djui_reset_hud_params(); create_dl_ortho_matrix(); djui_gfx_displaylist_begin(); - if (!gCoopCompatibility && gServerSettings.nametags && !gDjuiInMainMenu) { + if (!configCoopCompatibility && gServerSettings.nametags && !gDjuiInMainMenu) { nametags_render(); } smlua_call_event_on_hud_render_behind(djui_reset_hud_params); diff --git a/src/game/interaction.c b/src/game/interaction.c index fd291f6cf..a30dcf3e0 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -31,7 +31,6 @@ #include "pc/network/network.h" #include "pc/network/lag_compensation.h" #include "pc/lua/smlua_hooks.h" -#include "pc/pc_main.h" u8 sDelayInvincTimer; s16 gInteractionInvulnerable; @@ -180,7 +179,7 @@ static u32 determine_interaction_internal(struct MarioState *m, struct Object *o // when set to false, angle checks apply again. I would just restore the original // determine_interaction function but this is easier with keeping compatibility - if (!gCoopCompatibility) { isPVP = FALSE; } + if (!configCoopCompatibility) { isPVP = FALSE; } u32 interaction = 0; u32 action = m->action; @@ -193,7 +192,7 @@ static u32 determine_interaction_internal(struct MarioState *m, struct Object *o } if (interaction == 0 && action & ACT_FLAG_ATTACKING) { - u32 flags = gCoopCompatibility ? (MARIO_PUNCHING | MARIO_KICKING | MARIO_TRIPPING) : (MARIO_PUNCHING | MARIO_KICKING); + u32 flags = configCoopCompatibility ? (MARIO_PUNCHING | MARIO_KICKING | MARIO_TRIPPING) : (MARIO_PUNCHING | MARIO_KICKING); if (m->flags & flags) { s16 dYawToObject = mario_obj_angle_to_object(m, o) - m->faceAngle[1]; @@ -209,7 +208,7 @@ static u32 determine_interaction_internal(struct MarioState *m, struct Object *o interaction = INT_KICK; } } - if (m->flags & MARIO_TRIPPING && gCoopCompatibility) { + if (m->flags & MARIO_TRIPPING && configCoopCompatibility) { // 180 degrees total, or 90 each way if (-0x4000 <= dYawToObject && dYawToObject <= 0x4000) { interaction = INT_TRIP; diff --git a/src/game/object_collision.c b/src/game/object_collision.c index 57b4767e2..c939e67cc 100644 --- a/src/game/object_collision.c +++ b/src/game/object_collision.c @@ -7,7 +7,6 @@ #include "object_list_processor.h" #include "spawn_object.h" #include "pc/network/network_player.h" -#include "pc/pc_main.h" struct Object *debug_print_obj_collision(struct Object *a) { if (!a) { return NULL; } @@ -39,7 +38,7 @@ int detect_player_hitbox_overlap(struct MarioState* local, struct MarioState* re f32 dx = aTorso[0] - bTorso[0]; UNUSED f32 sp30 = sp3C - sp38; f32 dz = aTorso[2] - bTorso[2]; - f32 collisionRadius = (a->hitboxRadius + b->hitboxRadius) * (gCoopCompatibility ? 2.25f : 1.6f); // 1.5f before + f32 collisionRadius = (a->hitboxRadius + b->hitboxRadius) * (configCoopCompatibility ? 2.25f : 1.6f); // 1.5f before f32 distance = sqrtf(dx * dx + dz * dz); if (collisionRadius * scale > distance) { diff --git a/src/pc/discord/discord.c b/src/pc/discord/discord.c index d5fc68e39..6c386f2fa 100644 --- a/src/pc/discord/discord.c +++ b/src/pc/discord/discord.c @@ -2,7 +2,6 @@ #include "pc/djui/djui.h" #include "pc/crash_handler.h" #include "pc/debuglog.h" -#include "pc/pc_main.h" #if defined(_WIN32) || defined(_WIN64) #include @@ -19,7 +18,7 @@ struct DiscordApplication app = { 0 }; static bool sFatalShown = false; -static bool sDiscordInitialized = false; +bool gDiscordInitialized = false; static bool sDiscordFailed = false; static void discord_sdk_log_callback(UNUSED void* hook_data, enum EDiscordLogLevel level, const char* message) { @@ -114,8 +113,13 @@ struct IDiscordUserEvents* discord_user_initialize(void) { } static void discord_initialize(void) { - if (sDiscordInitialized) { return; } - sDiscordInitialized = true; + if (gDiscordInitialized) { + return; + } else if (app.core != NULL) { // reinit + app.core->destroy(app.core); // why does it ask for itself? + app.core = NULL; + } + gDiscordInitialized = true; if (app.core != NULL) { app.core->set_log_hook(app.core, DiscordLogLevel_Debug, NULL, discord_sdk_log_callback); @@ -124,7 +128,7 @@ static void discord_initialize(void) { // set up discord params struct DiscordCreateParams params = { 0 }; DiscordCreateParamsSetDefault(¶ms); - params.client_id = gCoopCompatibility ? APPLICATION_ID_COOP : APPLICATION_ID_COOPDX; // you have to have activity status on if you don't want discord to prompt you to authorize on every boot + params.client_id = configCoopCompatibility ? APPLICATION_ID_COOP : APPLICATION_ID_COOPDX; // you have to have activity status on if you don't want discord to prompt you to authorize on every boot params.flags = DiscordCreateFlags_NoRequireDiscord; params.event_data = &app; params.user_events = discord_user_initialize(); @@ -169,7 +173,7 @@ u64 discord_get_user_id(void) { void discord_update(void) { if (sDiscordFailed) { return; } - if (!sDiscordInitialized) { discord_initialize(); } + if (!gDiscordInitialized) { discord_initialize(); } if (sDiscordFailed) { return; } discord_activity_update_check(); diff --git a/src/pc/discord/discord.h b/src/pc/discord/discord.h index 9d8277cbd..8f82c364b 100644 --- a/src/pc/discord/discord.h +++ b/src/pc/discord/discord.h @@ -29,6 +29,8 @@ struct DiscordApplication { DiscordUserId userId; }; +extern bool gDiscordInitialized; + void discord_update(void); void discord_fatal(int rc); void discord_activity_update_check(void); diff --git a/src/pc/djui/djui_panel_host_settings.c b/src/pc/djui/djui_panel_host_settings.c index a44958fdd..ee4a6d141 100644 --- a/src/pc/djui/djui_panel_host_settings.c +++ b/src/pc/djui/djui_panel_host_settings.c @@ -4,7 +4,6 @@ #include "djui_panel_menu.h" #include "game/save_file.h" #include "pc/network/network.h" -#include "pc/pc_main.h" #include "pc/utils/misc.h" #include "pc/configfile.h" #include "djui_inputbox.h" @@ -62,11 +61,11 @@ void djui_panel_host_settings_create(struct DjuiBase* caller) { djui_checkbox_create(body, DLANG(HOST_SETTINGS, SKIP_INTRO_CUTSCENE), &configSkipIntro, NULL); djui_checkbox_create(body, DLANG(HOST_SETTINGS, BUBBLE_ON_DEATH), &configBubbleDeath, NULL); struct DjuiCheckbox* checkbox = djui_checkbox_create(body, DLANG(HOST_SETTINGS, NAMETAGS), &configNametags, NULL); - djui_base_set_enabled(&checkbox->base, !gCoopCompatibility); + djui_base_set_enabled(&checkbox->base, !configCoopCompatibility); char* bChoices[3] = { DLANG(HOST_SETTINGS, BOUNCY_BOUNDS_OFF), DLANG(HOST_SETTINGS, BOUNCY_BOUNDS_ON), DLANG(HOST_SETTINGS, BOUNCY_BOUNDS_ON_CAP) }; struct DjuiSelectionbox* selectionbox = djui_selectionbox_create(body, DLANG(HOST_SETTINGS, BOUNCY_LEVEL_BOUNDS), bChoices, 3, &configBouncyLevelBounds, NULL); - djui_base_set_enabled(&selectionbox->base, !gCoopCompatibility); + djui_base_set_enabled(&selectionbox->base, !configCoopCompatibility); struct DjuiRect* rect1 = djui_rect_container_create(body, 32); { diff --git a/src/pc/djui/djui_panel_join.c b/src/pc/djui/djui_panel_join.c index 6aa7d9b74..4168efc84 100644 --- a/src/pc/djui/djui_panel_join.c +++ b/src/pc/djui/djui_panel_join.c @@ -4,18 +4,16 @@ #include "djui_panel_join_lobbies.h" #include "djui_panel_join_private.h" #include "djui_panel_join_direct.h" +#include "djui_panel_main.h" #include "pc/network/network.h" #include "pc/utils/misc.h" -#include "pc/pc_main.h" +#include "pc/discord/discord.h" #ifdef COOPNET -static struct DjuiText* sRestartText = NULL; - static void djui_panel_compatibility_checkbox_on_value_change(UNUSED struct DjuiBase* caller) { - if (gCoopCompatibility != configCoopCompatibility) { - djui_text_set_text(sRestartText, DLANG(DISPLAY, MUST_RESTART)); - } else { - djui_text_set_text(sRestartText, ""); + gDiscordInitialized = false; + if (gVersionText != NULL) { + djui_text_set_text(gVersionText, get_version_local()); } } @@ -34,14 +32,10 @@ void djui_panel_join_create(struct DjuiBase* caller) { djui_button_create(body, DLANG(JOIN, PUBLIC_LOBBIES), DJUI_BUTTON_STYLE_NORMAL, djui_panel_join_public_lobbies); djui_button_create(body, DLANG(JOIN, PRIVATE_LOBBIES), DJUI_BUTTON_STYLE_NORMAL, djui_panel_join_private_create); djui_button_create(body, DLANG(JOIN, DIRECT), DJUI_BUTTON_STYLE_NORMAL, djui_panel_join_direct_create); - djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + if (gDjuiInMainMenu) { + djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + } djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); - - sRestartText = djui_text_create(body, ""); - djui_text_set_alignment(sRestartText, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); - djui_base_set_color(&sRestartText->base, 255, 100, 100, 255); - djui_base_set_size_type(&sRestartText->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(&sRestartText->base, 1.0f, 64); } djui_panel_add(caller, panel, NULL); diff --git a/src/pc/djui/djui_panel_join_direct.c b/src/pc/djui/djui_panel_join_direct.c index 62068fdaf..5e8a123ce 100644 --- a/src/pc/djui/djui_panel_join_direct.c +++ b/src/pc/djui/djui_panel_join_direct.c @@ -5,24 +5,23 @@ #include "djui_panel_modlist.h" #include "djui_panel_join_message.h" #include "djui_lobby_entry.h" -#include "src/pc/network/network.h" -#include "src/pc/network/socket/socket.h" -#include "src/pc/network/coopnet/coopnet.h" -#include "src/pc/network/socket/domain_res.h" -#include "src/pc/utils/misc.h" -#include "src/pc/configfile.h" -#include "src/pc/debuglog.h" +#include "djui_panel_main.h" +#include "pc/network/network.h" +#include "pc/network/socket/socket.h" +#include "pc/network/coopnet/coopnet.h" +#include "pc/network/socket/domain_res.h" +#include "pc/utils/misc.h" +#include "pc/configfile.h" +#include "pc/debuglog.h" #include "macros.h" +#include "pc/discord/discord.h" static struct DjuiInputbox* sInputboxIp = NULL; #ifndef COOPNET -static struct DjuiText* sRestartText = NULL; - static void djui_panel_compatibility_checkbox_on_value_change(UNUSED struct DjuiBase* caller) { - if (gCoopCompatibility != configCoopCompatibility) { - djui_text_set_text(sRestartText, DLANG(DISPLAY, MUST_RESTART)); - } else { - djui_text_set_text(sRestartText, ""); + gDiscordInitialized = false; + if (gVersionText != NULL) { + djui_text_set_text(gVersionText, get_version_local()); } } #endif @@ -184,7 +183,9 @@ void djui_panel_join_direct_create(struct DjuiBase* caller) { djui_panel_join_direct_ip_text_set(inputbox1); #ifndef COOPNET - djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + if (gDjuiInMainMenu) { + djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + } #endif struct DjuiRect* rect2 = djui_rect_container_create(body, 64); @@ -198,14 +199,6 @@ void djui_panel_join_direct_create(struct DjuiBase* caller) { djui_base_set_alignment(&button2->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP); defaultBase = &button2->base; } - -#ifndef COOPNET - sRestartText = djui_text_create(body, ""); - djui_text_set_alignment(sRestartText, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); - djui_base_set_color(&sRestartText->base, 255, 100, 100, 255); - djui_base_set_size_type(&sRestartText->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(&sRestartText->base, 1.0f, 64); -#endif } djui_panel_add(caller, panel, defaultBase); diff --git a/src/pc/djui/djui_panel_main.c b/src/pc/djui/djui_panel_main.c index 15c59acff..553dfd08e 100644 --- a/src/pc/djui/djui_panel_main.c +++ b/src/pc/djui/djui_panel_main.c @@ -10,6 +10,8 @@ extern ALIGNED8 u8 texture_coopdx_logo[]; +struct DjuiText* gVersionText = NULL; + bool gDjuiPanelMainCreated = false; static void djui_panel_main_quit_yes(UNUSED struct DjuiBase* caller) { @@ -46,13 +48,11 @@ void djui_panel_main_create(struct DjuiBase* caller) { djui_base_set_location(&button4->base, 0, -30.0f); } - char version[MAX_VERSION_LENGTH]; - snprintf(version, MAX_VERSION_LENGTH, "%s", get_version_local()); - struct DjuiText* footer = djui_text_create(&panel->base, version); - djui_base_set_size_type(&footer->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(&footer->base, 1.0f, 1.0f); - djui_base_set_color(&footer->base, 50, 50, 50, 255); - djui_text_set_alignment(footer, DJUI_HALIGN_RIGHT, DJUI_VALIGN_BOTTOM); + gVersionText = djui_text_create(&panel->base, get_version_local()); + djui_base_set_size_type(&gVersionText->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); + djui_base_set_size(&gVersionText->base, 1.0f, 1.0f); + djui_base_set_color(&gVersionText->base, 50, 50, 50, 255); + djui_text_set_alignment(gVersionText, DJUI_HALIGN_RIGHT, DJUI_VALIGN_BOTTOM); } djui_panel_add(caller, panel, NULL); diff --git a/src/pc/djui/djui_panel_main.h b/src/pc/djui/djui_panel_main.h index e15eeea67..d7061edc8 100644 --- a/src/pc/djui/djui_panel_main.h +++ b/src/pc/djui/djui_panel_main.h @@ -1,6 +1,8 @@ #pragma once #include "djui.h" +extern struct DjuiText* gVersionText; + extern bool gDjuiPanelMainCreated; void djui_panel_main_create(struct DjuiBase* caller); diff --git a/src/pc/djui/djui_panel_misc.c b/src/pc/djui/djui_panel_misc.c index 9863c2180..b15f830f7 100644 --- a/src/pc/djui/djui_panel_misc.c +++ b/src/pc/djui/djui_panel_misc.c @@ -9,16 +9,13 @@ #include "djui_panel_changelog.h" #include "pc/utils/misc.h" #include "pc/configfile.h" -#include "pc/pc_main.h" #include "game/hardcoded.h" - -static struct DjuiText* sRestartText = NULL; +#include "pc/discord/discord.h" static void djui_panel_compatibility_checkbox_on_value_change(UNUSED struct DjuiBase* caller) { - if (gCoopCompatibility != configCoopCompatibility) { - djui_text_set_text(sRestartText, DLANG(DISPLAY, MUST_RESTART)); - } else { - djui_text_set_text(sRestartText, ""); + gDiscordInitialized = false; + if (gVersionText != NULL) { + djui_text_set_text(gVersionText, get_version_local()); } } @@ -50,7 +47,9 @@ void djui_panel_misc_create(struct DjuiBase* caller) { { djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL); - djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + if (gDjuiInMainMenu) { + djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); + } #ifndef DEVELOPMENT djui_checkbox_create(body, DLANG(MISC, LUA_PROFILER), &configLuaProfiler, NULL); #endif @@ -63,19 +62,6 @@ void djui_panel_misc_create(struct DjuiBase* caller) { djui_button_create(body, DLANG(MISC, DEBUG), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_debug_create); #endif djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); - - sRestartText = djui_text_create(body, ""); - djui_text_set_alignment(sRestartText, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); - djui_base_set_color(&sRestartText->base, 255, 100, 100, 255); - djui_base_set_size_type(&sRestartText->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(&sRestartText->base, 1.0f, 64); - } - - // force the restart text to update - if (gCoopCompatibility != configCoopCompatibility) { - djui_text_set_text(sRestartText, DLANG(DISPLAY, MUST_RESTART)); - } else { - djui_text_set_text(sRestartText, ""); } djui_panel_add(caller, panel, NULL); diff --git a/src/pc/mods/mods_utils.c b/src/pc/mods/mods_utils.c index 833768ae5..e2bf409c6 100644 --- a/src/pc/mods/mods_utils.c +++ b/src/pc/mods/mods_utils.c @@ -3,7 +3,6 @@ #include "mods.h" #include "mods_utils.h" #include "pc/debuglog.h" -#include "pc/pc_main.h" #if defined(_WIN32) || defined(_WIN64) #include @@ -29,7 +28,7 @@ void mods_size_enforce(struct Mods* mods) { void mods_deluxe_enforce(struct Mods* mods) { for (int i = 0; i < mods->entryCount; i++) { struct Mod* mod = mods->entries[i]; - if (mod->deluxe && gCoopCompatibility) { + if (mod->deluxe && configCoopCompatibility) { mod->enabled = false; mod->selectable = false; } diff --git a/src/pc/network/packets/packet_join.c b/src/pc/network/packets/packet_join.c index d3ec139cf..4c865ccf5 100644 --- a/src/pc/network/packets/packet_join.c +++ b/src/pc/network/packets/packet_join.c @@ -25,7 +25,6 @@ #include "pc/mods/mods.h" #include "pc/lua/smlua.h" #include "pc/configfile.h" -#include "pc/pc_main.h" extern u8* gOverrideEeprom; static u8 eeprom[512] = { 0 }; @@ -112,14 +111,14 @@ void network_send_join(struct Packet* joinRequestPacket) { packet_write(&p, &globalIndex, sizeof(u8)); packet_write(&p, &gCurrSaveFileNum, sizeof(s16)); packet_write(&p, &gServerSettings.playerInteractions, sizeof(u8)); - if (!gCoopCompatibility) { packet_write(&p, &gServerSettings.bouncyLevelBounds, sizeof(u8)); } + if (!configCoopCompatibility) { packet_write(&p, &gServerSettings.bouncyLevelBounds, sizeof(u8)); } packet_write(&p, &gServerSettings.playerKnockbackStrength, sizeof(u8)); packet_write(&p, &gServerSettings.stayInLevelAfterStar, sizeof(u8)); packet_write(&p, &gServerSettings.skipIntro, sizeof(u8)); packet_write(&p, &gServerSettings.enableCheats, sizeof(u8)); packet_write(&p, &gServerSettings.bubbleDeath, sizeof(u8)); packet_write(&p, &gServerSettings.headlessServer, sizeof(u8)); - if (!gCoopCompatibility) { packet_write(&p, &gServerSettings.nametags, sizeof(u8)); } + if (!configCoopCompatibility) { packet_write(&p, &gServerSettings.nametags, sizeof(u8)); } packet_write(&p, &gServerSettings.maxPlayers, sizeof(u8)); packet_write(&p, eeprom, sizeof(u8) * 512); @@ -164,7 +163,7 @@ void network_receive_join(struct Packet* p) { packet_read(p, &myGlobalIndex, sizeof(u8)); packet_read(p, &gCurrSaveFileNum, sizeof(s16)); packet_read(p, &gServerSettings.playerInteractions, sizeof(u8)); - if (!gCoopCompatibility) { + if (!configCoopCompatibility) { packet_read(p, &gServerSettings.bouncyLevelBounds, sizeof(u8)); } else { gServerSettings.bouncyLevelBounds = BOUNCY_LEVEL_BOUNDS_OFF; @@ -175,7 +174,7 @@ void network_receive_join(struct Packet* p) { packet_read(p, &gServerSettings.enableCheats, sizeof(u8)); packet_read(p, &gServerSettings.bubbleDeath, sizeof(u8)); packet_read(p, &gServerSettings.headlessServer, sizeof(u8)); - if (!gCoopCompatibility) { + if (!configCoopCompatibility) { packet_read(p, &gServerSettings.nametags, sizeof(u8)); } else { gServerSettings.nametags = false; diff --git a/src/pc/network/packets/packet_mod_list.c b/src/pc/network/packets/packet_mod_list.c index f77cd8096..9e8872f2d 100644 --- a/src/pc/network/packets/packet_mod_list.c +++ b/src/pc/network/packets/packet_mod_list.c @@ -5,7 +5,6 @@ #include "pc/djui/djui.h" #include "pc/djui/djui_panel_join_message.h" #include "pc/debuglog.h" -#include "pc/pc_main.h" #include "pc/mods/mod_cache.h" void network_send_mod_list_request(void) { @@ -86,7 +85,7 @@ void network_send_mod_list(void) { packet_write(&p, mod->relativePath, sizeof(u8) * relativePathLength); packet_write(&p, &modSize, sizeof(u64)); packet_write(&p, &mod->isDirectory, sizeof(u8)); - if (!gCoopCompatibility) { + if (!configCoopCompatibility) { packet_write(&p, &mod->deluxe, sizeof(u8)); } packet_write(&p, &mod->fileCount, sizeof(u16)); @@ -227,7 +226,7 @@ void network_receive_mod_list_entry(struct Packet* p) { packet_read(p, mod->relativePath, relativePathLength * sizeof(u8)); packet_read(p, &mod->size, sizeof(u64)); packet_read(p, &mod->isDirectory, sizeof(u8)); - if (!gCoopCompatibility) { + if (!configCoopCompatibility) { packet_read(p, &mod->deluxe, sizeof(u8)); } normalize_path(mod->relativePath); diff --git a/src/pc/network/version.c b/src/pc/network/version.c index 15b0ab105..39029511f 100644 --- a/src/pc/network/version.c +++ b/src/pc/network/version.c @@ -1,7 +1,6 @@ #include #include "version.h" #include "types.h" -#include "pc/pc_main.h" #undef VERSION_TEXT #define VERSION_TEXT "v" @@ -10,7 +9,7 @@ static char sVersionString[MAX_VERSION_LENGTH] = { 0 }; static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 }; const char* get_version(void) { - if (gCoopCompatibility) { + if (configCoopCompatibility) { #if defined(VERSION_US) if (MINOR_VERSION_NUMBER > 0) { snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER); @@ -39,7 +38,7 @@ const char* get_version_local(void) { return get_version(); } - if (gCoopCompatibility) { + if (configCoopCompatibility) { #if defined(VERSION_US) snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s%d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER); #else @@ -57,7 +56,7 @@ const char* get_version_local(void) { } const char* get_game_name(void) { - if (gCoopCompatibility) { + if (configCoopCompatibility) { #ifdef DEVELOPMENT return "sm64ex-coop-dev"; #elif !defined(VERSION_US) diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index cab8879dc..180ba099f 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -60,8 +60,6 @@ #include #endif -bool gCoopCompatibility; - OSMesg D_80339BEC; OSMesgQueue gSIEventMesgQueue; @@ -316,8 +314,6 @@ void* main_game_init(UNUSED void* arg) { } else if (memcmp(&configPlayerPalette, &gPalettePresets[i], sizeof(struct PlayerPalette)) == 0) { break; } } - gCoopCompatibility = configCoopCompatibility; - if (gCLIOpts.FullScreen == 1) { configWindow.fullscreen = true; } else if (gCLIOpts.FullScreen == 2) { configWindow.fullscreen = false; } diff --git a/src/pc/pc_main.h b/src/pc/pc_main.h index 9ac6467a7..b99ab6f8d 100644 --- a/src/pc/pc_main.h +++ b/src/pc/pc_main.h @@ -15,8 +15,6 @@ extern "C" { #include "gfx/gfx_sdl.h" #include "gfx/gfx_dummy.h" -extern bool gCoopCompatibility; - #if defined(WAPI_SDL1) || defined(WAPI_SDL2) # define WAPI gfx_sdl #elif defined(WAPI_DXGI)