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) {
|
errorret_t engineUpdate(void) {
|
||||||
|
errorChain(networkManagerUpdate());
|
||||||
|
if(networkManagerIsConnectionModalOpen()) {
|
||||||
|
errorChain(displayUpdate());
|
||||||
|
errorOk();
|
||||||
|
}
|
||||||
|
|
||||||
timeUpdate();
|
timeUpdate();
|
||||||
inputUpdate();
|
inputUpdate();
|
||||||
errorChain(networkManagerUpdate());
|
|
||||||
|
|
||||||
uiUpdate();
|
uiUpdate();
|
||||||
errorChain(sceneUpdate());
|
errorChain(sceneUpdate());
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ void networkManagerRequestConnection(
|
|||||||
networkPlatformRequestConnection(onConnected, onFailed, user);
|
networkPlatformRequestConnection(onConnected, onFailed, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool_t networkManagerIsConnectionModalOpen() {
|
||||||
|
return networkPlatformIsConnectionModalOpen();
|
||||||
|
}
|
||||||
|
|
||||||
errorret_t networkManagerDispose() {
|
errorret_t networkManagerDispose() {
|
||||||
errorChain(networkPlatformDispose());
|
errorChain(networkPlatformDispose());
|
||||||
errorOk();
|
errorOk();
|
||||||
|
|||||||
@@ -68,6 +68,16 @@ void networkManagerRequestConnection(
|
|||||||
void *user
|
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.
|
* Disposes of the network manager. This will NOT disconnect from the network.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "networkpsp.h"
|
#include "networkpsp.h"
|
||||||
|
|
||||||
#define networkPlatformInit networkPspInit
|
#define networkPlatformInit networkPspInit
|
||||||
#define networkPlatformUpdate networkPspUpdate
|
#define networkPlatformUpdate networkPspUpdate
|
||||||
#define networkPlatformDispose networkPspDispose
|
#define networkPlatformDispose networkPspDispose
|
||||||
#define networkPlatformIsConnected networkPspIsConnected
|
#define networkPlatformIsConnected networkPspIsConnected
|
||||||
#define networkPlatformRequestConnection networkPspRequestConnection
|
#define networkPlatformRequestConnection networkPspRequestConnection
|
||||||
#define networkPlatformHTTPRequest networkPspHTTPRequest
|
#define networkPlatformHTTPRequest networkPspHTTPRequest
|
||||||
|
#define networkPlatformIsConnectionModalOpen networkPspIsConnectionModalOpen
|
||||||
@@ -388,3 +388,7 @@ void networkPspHTTPRequest(
|
|||||||
item->thread.data = item;
|
item->thread.data = item;
|
||||||
threadStartRequest(&item->thread);
|
threadStartRequest(&item->thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool_t networkPspIsConnectionModalOpen() {
|
||||||
|
return sceUtilityNetconfGetStatus() == PSP_UTILITY_DIALOG_VISIBLE;
|
||||||
|
}
|
||||||
@@ -61,14 +61,19 @@ typedef struct {
|
|||||||
} networkpsp_t;
|
} networkpsp_t;
|
||||||
|
|
||||||
errorret_t networkPspInit();
|
errorret_t networkPspInit();
|
||||||
|
|
||||||
errorret_t networkPspUpdate();
|
errorret_t networkPspUpdate();
|
||||||
|
|
||||||
errorret_t networkPspDispose();
|
errorret_t networkPspDispose();
|
||||||
|
|
||||||
bool_t networkPspIsConnected();
|
bool_t networkPspIsConnected();
|
||||||
|
|
||||||
void networkPspRequestConnection(
|
void networkPspRequestConnection(
|
||||||
void (*onConnected)(void *user),
|
void (*onConnected)(void *user),
|
||||||
void (*onFailed)(errorret_t error, void *user),
|
void (*onFailed)(errorret_t error, void *user),
|
||||||
void *user
|
void *user
|
||||||
);
|
);
|
||||||
|
|
||||||
void networkPspHTTPRequest(
|
void networkPspHTTPRequest(
|
||||||
const char_t *url,
|
const char_t *url,
|
||||||
const networkhttprequestmethod_t method,
|
const networkhttprequestmethod_t method,
|
||||||
@@ -79,3 +84,5 @@ void networkPspHTTPRequest(
|
|||||||
networkhttpcallback_t callback,
|
networkhttpcallback_t callback,
|
||||||
networkhttperrorcallback_t errorCallback
|
networkhttperrorcallback_t errorCallback
|
||||||
);
|
);
|
||||||
|
|
||||||
|
bool_t networkPspIsConnectionModalOpen();
|
||||||
Reference in New Issue
Block a user