Taking a break on net

This commit is contained in:
2026-04-16 06:38:56 -05:00
parent e51cdc8992
commit 715ecffa18
6 changed files with 33 additions and 2 deletions
+6 -1
View File
@@ -138,9 +138,14 @@ errorret_t engineInit(const int32_t argc, const char_t **argv) {
}
errorret_t engineUpdate(void) {
errorChain(networkManagerUpdate());
if(networkManagerIsConnectionModalOpen()) {
errorChain(displayUpdate());
errorOk();
}
timeUpdate();
inputUpdate();
errorChain(networkManagerUpdate());
uiUpdate();
errorChain(sceneUpdate());
+4
View File
@@ -34,6 +34,10 @@ void networkManagerRequestConnection(
networkPlatformRequestConnection(onConnected, onFailed, user);
}
bool_t networkManagerIsConnectionModalOpen() {
return networkPlatformIsConnectionModalOpen();
}
errorret_t networkManagerDispose() {
errorChain(networkPlatformDispose());
errorOk();
+10
View File
@@ -68,6 +68,16 @@ void networkManagerRequestConnection(
void *user
);
/**
* This is highly platform specific unfortunately, but basically for PSP and
* maybe some other systems in future, I need a way to tell the engine that the
* network manager is blocking rendering while it lets the user connect.
*
* @return If true, then the network manager is asking the engine to not do any
* thing, including time stepping, until this complete.
*/
bool_t networkManagerIsConnectionModalOpen();
/**
* Disposes of the network manager. This will NOT disconnect from the network.
*
+2 -1
View File
@@ -8,9 +8,10 @@
#pragma once
#include "networkpsp.h"
#define networkPlatformInit networkPspInit
#define networkPlatformInit networkPspInit
#define networkPlatformUpdate networkPspUpdate
#define networkPlatformDispose networkPspDispose
#define networkPlatformIsConnected networkPspIsConnected
#define networkPlatformRequestConnection networkPspRequestConnection
#define networkPlatformHTTPRequest networkPspHTTPRequest
#define networkPlatformIsConnectionModalOpen networkPspIsConnectionModalOpen
+4
View File
@@ -388,3 +388,7 @@ void networkPspHTTPRequest(
item->thread.data = item;
threadStartRequest(&item->thread);
}
bool_t networkPspIsConnectionModalOpen() {
return sceUtilityNetconfGetStatus() == PSP_UTILITY_DIALOG_VISIBLE;
}
+7
View File
@@ -61,14 +61,19 @@ typedef struct {
} networkpsp_t;
errorret_t networkPspInit();
errorret_t networkPspUpdate();
errorret_t networkPspDispose();
bool_t networkPspIsConnected();
void networkPspRequestConnection(
void (*onConnected)(void *user),
void (*onFailed)(errorret_t error, void *user),
void *user
);
void networkPspHTTPRequest(
const char_t *url,
const networkhttprequestmethod_t method,
@@ -79,3 +84,5 @@ void networkPspHTTPRequest(
networkhttpcallback_t callback,
networkhttperrorcallback_t errorCallback
);
bool_t networkPspIsConnectionModalOpen();