Taking a break on net
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -34,6 +34,10 @@ void networkManagerRequestConnection(
|
||||
networkPlatformRequestConnection(onConnected, onFailed, user);
|
||||
}
|
||||
|
||||
bool_t networkManagerIsConnectionModalOpen() {
|
||||
return networkPlatformIsConnectionModalOpen();
|
||||
}
|
||||
|
||||
errorret_t networkManagerDispose() {
|
||||
errorChain(networkPlatformDispose());
|
||||
errorOk();
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -14,3 +14,4 @@
|
||||
#define networkPlatformIsConnected networkPspIsConnected
|
||||
#define networkPlatformRequestConnection networkPspRequestConnection
|
||||
#define networkPlatformHTTPRequest networkPspHTTPRequest
|
||||
#define networkPlatformIsConnectionModalOpen networkPspIsConnectionModalOpen
|
||||
@@ -388,3 +388,7 @@ void networkPspHTTPRequest(
|
||||
item->thread.data = item;
|
||||
threadStartRequest(&item->thread);
|
||||
}
|
||||
|
||||
bool_t networkPspIsConnectionModalOpen() {
|
||||
return sceUtilityNetconfGetStatus() == PSP_UTILITY_DIALOG_VISIBLE;
|
||||
}
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user