swapping pcs so ill just commit this~
This commit is contained in:
parent
4f0e3c4dd4
commit
5423be67ca
3 changed files with 16 additions and 1 deletions
|
@ -89,6 +89,8 @@
|
||||||
//WARNING: Having this set to different values in different clients will break multiplayer!
|
//WARNING: Having this set to different values in different clients will break multiplayer!
|
||||||
#define TESTGODMODE false
|
#define TESTGODMODE false
|
||||||
|
|
||||||
|
bool paused;
|
||||||
|
|
||||||
u32 localUID;
|
u32 localUID;
|
||||||
|
|
||||||
int loadedtp;
|
int loadedtp;
|
||||||
|
|
|
@ -368,7 +368,6 @@ void renderGame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void exitGame() {
|
void exitGame() {
|
||||||
romfsExit();
|
|
||||||
networkDisconnect();
|
networkDisconnect();
|
||||||
synchronizerReset();
|
synchronizerReset();
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
//TODO: Something still causes desyncs very rarely
|
//TODO: Something still causes desyncs very rarely
|
||||||
|
|
||||||
|
static aptHookCookie cookie;
|
||||||
|
|
||||||
void setupGame() {
|
void setupGame() {
|
||||||
synchronizerInit(rand(), 1, 0);
|
synchronizerInit(rand(), 1, 0);
|
||||||
synchronizerSetPlayerUID(0, localUID);
|
synchronizerSetPlayerUID(0, localUID);
|
||||||
|
@ -77,6 +79,16 @@ void setupBGMap() {
|
||||||
|
|
||||||
initBGMap = 0;
|
initBGMap = 0;
|
||||||
}
|
}
|
||||||
|
static void task_apt_hook(APT_HookType hook, void* param) {
|
||||||
|
switch(hook) {
|
||||||
|
case APTHOOK_ONSUSPEND:
|
||||||
|
paused = true;
|
||||||
|
stopMusic();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//for rendering -> move to a better place
|
//for rendering -> move to a better place
|
||||||
|
@ -188,7 +200,9 @@ int main() {
|
||||||
initPlayers();
|
initPlayers();
|
||||||
initRecipes();
|
initRecipes();
|
||||||
initTrades();
|
initTrades();
|
||||||
|
aptHook(&cookie, task_apt_hook, NULL);
|
||||||
while (aptMainLoop()) {
|
while (aptMainLoop()) {
|
||||||
|
if (paused == true) playMusic(&music_menu);
|
||||||
if (quitGame) break;
|
if (quitGame) break;
|
||||||
|
|
||||||
if (initGame > 0 && --initGame==0) setupGame();
|
if (initGame > 0 && --initGame==0) setupGame();
|
||||||
|
|
Loading…
Add table
Reference in a new issue