mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Updated star count on host/join
This commit is contained in:
parent
7a61c61051
commit
05432c692a
4 changed files with 18 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
#include "src/pc/network/discord/discord.h"
|
#include "src/pc/network/discord/discord.h"
|
||||||
#include "src/pc/utils/misc.h"
|
#include "src/pc/utils/misc.h"
|
||||||
#include "src/pc/configfile.h"
|
#include "src/pc/configfile.h"
|
||||||
|
#include "pc/utils/misc.h"
|
||||||
|
|
||||||
#ifdef DISCORD_SDK
|
#ifdef DISCORD_SDK
|
||||||
static char* sWarningDiscord = "\
|
static char* sWarningDiscord = "\
|
||||||
|
|
@ -25,6 +26,7 @@ void djui_panel_host_message_do_host(struct DjuiBase* caller) {
|
||||||
djui_panel_shutdown();
|
djui_panel_shutdown();
|
||||||
extern s16 gCurrSaveFileNum;
|
extern s16 gCurrSaveFileNum;
|
||||||
gCurrSaveFileNum = configHostSaveSlot;
|
gCurrSaveFileNum = configHostSaveSlot;
|
||||||
|
update_all_mario_stars();
|
||||||
#ifndef DISCORD_SDK
|
#ifndef DISCORD_SDK
|
||||||
configNetworkSystem = 1;
|
configNetworkSystem = 1;
|
||||||
network_set_system(NS_SOCKET);
|
network_set_system(NS_SOCKET);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include "pc/utils/string_builder.h"
|
#include "pc/utils/string_builder.h"
|
||||||
//#define DISABLE_MODULE_LOG 1
|
//#define DISABLE_MODULE_LOG 1
|
||||||
#include "pc/debuglog.h"
|
#include "pc/debuglog.h"
|
||||||
|
#include "pc/utils/misc.h"
|
||||||
|
|
||||||
extern u8* gOverrideEeprom;
|
extern u8* gOverrideEeprom;
|
||||||
static u8 eeprom[512] = { 0 };
|
static u8 eeprom[512] = { 0 };
|
||||||
|
|
@ -183,6 +184,7 @@ void network_receive_join(struct Packet* p) {
|
||||||
save_file_load_all(TRUE);
|
save_file_load_all(TRUE);
|
||||||
|
|
||||||
djui_panel_shutdown();
|
djui_panel_shutdown();
|
||||||
|
update_all_mario_stars();
|
||||||
extern s16 gChangeLevel;
|
extern s16 gChangeLevel;
|
||||||
gChangeLevel = 16;
|
gChangeLevel = 16;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,21 @@
|
||||||
|
#include <PR/ultratypes.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
#include "course_table.h"
|
||||||
|
#include "game/area.h"
|
||||||
|
#include "game/level_update.h"
|
||||||
|
#include "game/save_file.h"
|
||||||
|
|
||||||
float smoothstep(float edge0, float edge1, float x) {
|
float smoothstep(float edge0, float edge1, float x) {
|
||||||
float t = (x - edge0) / (edge1 - edge0);
|
float t = (x - edge0) / (edge1 - edge0);
|
||||||
if (t < 0) { t = 0; }
|
if (t < 0) { t = 0; }
|
||||||
if (t > 1) { t = 1; }
|
if (t > 1) { t = 1; }
|
||||||
return t * t * (3.0 - 2.0 * t);
|
return t * t * (3.0 - 2.0 * t);
|
||||||
|
}
|
||||||
|
|
||||||
|
void update_all_mario_stars(void) {
|
||||||
|
s32 numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1);
|
||||||
|
for (int i = 0; i < MAX_PLAYERS; i++) {
|
||||||
|
gMarioStates[i].numStars = numStars;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,5 +2,6 @@
|
||||||
#define UTILS_MISC_H
|
#define UTILS_MISC_H
|
||||||
|
|
||||||
float smoothstep(float edge0, float edge1, float x);
|
float smoothstep(float edge0, float edge1, float x);
|
||||||
|
void update_all_mario_stars(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Loading…
Add table
Reference in a new issue