DS: Try to fix issues with water overlapping from outside of world, don't infinitely loop when connecting to WIFI

This commit is contained in:
UnknownShadow200 2024-03-24 10:57:46 +11:00
parent 9164d7c9c3
commit 189b164be4
3 changed files with 27 additions and 8 deletions

View File

@ -22,12 +22,14 @@ extern struct RayTracer Game_SelectedPos;
extern cc_bool Game_UseCPEBlocks;
extern cc_string Game_Username;
extern cc_string Game_Mppass;
extern cc_string Game_Mppass;
#ifdef CC_BUILD_N64
#define DEFAULT_VIEWDIST 20
#if defined CC_BUILD_N64
#define DEFAULT_VIEWDIST 20
#elif defined CC_BUILD_NDS
#define DEFAULT_VIEWDIST 192
#else
#define DEFAULT_VIEWDIST 512
#define DEFAULT_VIEWDIST 512
#endif
#define DEFAULT_MAX_VIEWDIST 32768

View File

@ -187,7 +187,7 @@ static void Gfx_RestoreState(void) {
InitDefaultResources();
}
cc_bool Gfx_WarnIfNecessary(void) { return false; }
cc_bool Gfx_WarnIfNecessary(void) { return true; }
/*########################################################################################################################*

View File

@ -365,15 +365,32 @@ cc_result Socket_CheckWritable(cc_socket s, cc_bool* writable) {
return res;
}
static void InitNetworking(void) {
if (!Wifi_InitDefault(INIT_ONLY)) {
Platform_LogConst("Initing WIFI failed"); return;
}
Wifi_AutoConnect();
for (int i = 0; i < 300; i++)
{
int status = Wifi_AssocStatus();
if (status == ASSOCSTATUS_ASSOCIATED) return;
if (status == ASSOCSTATUS_CANNOTCONNECT) {
Platform_LogConst("Can't connect to WIFI"); return;
}
swiWaitForVBlank();
}
Platform_LogConst("Gave up after 300 tries");
}
/*########################################################################################################################*
*--------------------------------------------------------Platform---------------------------------------------------------*
*#########################################################################################################################*/
void Platform_Init(void) {
InitFilesystem();
if (!Wifi_InitDefault(WFC_CONNECT)) {
Platform_LogConst("Can't connect to WIFI");
}
InitNetworking();
cpuStartTiming(1);
// TODO: Redesign Drawer2D to better handle this