forked from cafeberry/cafeberry
666 lines
33 KiB
C++
666 lines
33 KiB
C++
// Minecraft.cpp : Defines the entry point for the application.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <assert.h>
|
|
#include "..\MinecraftServer.h"
|
|
#include "..\LocalPlayer.h"
|
|
#include "..\..\Minecraft.World\ItemInstance.h"
|
|
#include "..\..\Minecraft.World\MapItem.h"
|
|
#include "..\..\Minecraft.World\Recipes.h"
|
|
#include "..\..\Minecraft.World\Recipy.h"
|
|
#include "..\..\Minecraft.World\Language.h"
|
|
#include "..\..\Minecraft.World\StringHelpers.h"
|
|
#include "..\..\Minecraft.World\AABB.h"
|
|
#include "..\..\Minecraft.World\Vec3.h"
|
|
#include "..\..\Minecraft.World\Level.h"
|
|
#include "..\..\Minecraft.World\net.minecraft.world.level.tile.h"
|
|
|
|
#include "Leaderboards\GameProgress.h"
|
|
#include "..\ClientConnection.h"
|
|
#include "..\User.h"
|
|
#include "..\..\Minecraft.World\Socket.h"
|
|
#include "..\..\Minecraft.World\ThreadName.h"
|
|
#include "..\..\Minecraft.Client\StatsCounter.h"
|
|
#include "..\ConnectScreen.h"
|
|
#include "Leaderboards\DurangoLeaderboardManager.h"
|
|
#include "..\..\Minecraft.Client\Tesselator.h"
|
|
#include "..\..\Minecraft.Client\Options.h"
|
|
#include "Sentient\SentientManager.h"
|
|
#include "..\..\Minecraft.World\IntCache.h"
|
|
#include "..\Textures.h"
|
|
#include "Resource.h"
|
|
#include "..\..\Minecraft.World\compression.h"
|
|
#include "..\..\Minecraft.World\OldChunkStorage.h"
|
|
#include <agile.h>
|
|
|
|
//using namespace Windows::Xbox::Input;
|
|
using namespace Windows::Foundation::Collections;
|
|
|
|
#define THEME_NAME "584111F70AAAAAAA"
|
|
#define THEME_FILESIZE 2797568
|
|
|
|
//#define THREE_MB 3145728 // minimum save size (checking for this on a selected device)
|
|
//#define FIVE_MB 5242880 // minimum save size (checking for this on a selected device)
|
|
//#define FIFTY_TWO_MB (1024*1024*52) // Maximum TCR space required for a save (checking for this on a selected device)
|
|
#define FIFTY_ONE_MB (1000000*51) // Maximum TCR space required for a save is 52MB (checking for this on a selected device)
|
|
|
|
#define NUM_PROFILE_VALUES 5
|
|
#define NUM_PROFILE_SETTINGS 4
|
|
DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]=
|
|
{
|
|
0,0,0,0,0
|
|
};
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
// Time Since fAppTime is a float, we need to keep the quadword app time
|
|
// as a LARGE_INTEGER so that we don't lose precision after running
|
|
// for a long time.
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
|
BOOL g_bWidescreen = TRUE;
|
|
|
|
|
|
void DefineActions(void)
|
|
{
|
|
// The app needs to define the actions required, and the possible mappings for these
|
|
|
|
// Split into Menu actions, and in-game actions
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_A, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_X, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_Y, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OK, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_LT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_RB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_RTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_X, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_Y, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OK, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_RB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_LT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_RTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_A, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_X, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_Y, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OK, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_LT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_A);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW);
|
|
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
|
|
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
|
|
}
|
|
|
|
void MemSect(int sect)
|
|
{
|
|
}
|
|
|
|
HINSTANCE g_hInst = NULL;
|
|
|
|
Platform::Agile<Windows::UI::Core::CoreWindow> g_window;
|
|
Windows::Foundation::Rect g_windowBounds;
|
|
|
|
D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;
|
|
D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
|
|
Microsoft::WRL::ComPtr<ID3D11Device1> g_d3dDevice;
|
|
Microsoft::WRL::ComPtr<ID3D11DeviceContext1> g_d3dContext;
|
|
Microsoft::WRL::ComPtr<IDXGISwapChain1> g_swapChain;
|
|
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> g_renderTargetView;
|
|
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> g_depthStencilView;
|
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> g_depthStencil;
|
|
|
|
void CreateDevice();
|
|
void CreateResources();
|
|
void InitializeDurango(Windows::UI::Core::CoreWindow^ window)
|
|
{
|
|
SetThreadAffinityMask(GetCurrentThread(),1);
|
|
|
|
g_window = window;
|
|
|
|
CreateDevice();
|
|
|
|
CreateResources();
|
|
|
|
// TODO: Begin asynchronous loading of game assets.
|
|
|
|
C4JThread::StaticInit();
|
|
}
|
|
|
|
namespace DX
|
|
{
|
|
inline void ThrowIfFailed(HRESULT hr)
|
|
{
|
|
if (FAILED(hr))
|
|
{
|
|
// Set a breakpoint on this line to catch DirectX API errors
|
|
throw Platform::Exception::CreateException(hr);
|
|
}
|
|
}
|
|
}
|
|
|
|
void CreateDevice()
|
|
{
|
|
// This flag adds support for surfaces with a different color channel ordering than the API default.
|
|
// It is recommended usage, and is required for compatibility with Direct2D.
|
|
UINT creationFlags = D3D11_CREATE_DEVICE_FAST_KICKOFFS;
|
|
#ifndef _CONTENT_PACKAGE
|
|
creationFlags |= D3D11_CREATE_DEVICE_VALIDATED;
|
|
creationFlags |= D3D11_CREATE_DEVICE_INSTRUMENTED;
|
|
#endif
|
|
|
|
// This array defines the set of DirectX hardware feature levels this app will support.
|
|
// Note the ordering should be preserved.
|
|
// Don't forget to declare your application's minimum required feature level in its
|
|
// description. All applications are assumed to support 9.1 unless otherwise stated.
|
|
D3D_FEATURE_LEVEL featureLevels[] =
|
|
{
|
|
D3D_FEATURE_LEVEL_11_0
|
|
};
|
|
|
|
// Create the DX11 API device object, and get a corresponding context.
|
|
Microsoft::WRL::ComPtr<ID3D11Device> device;
|
|
Microsoft::WRL::ComPtr<ID3D11DeviceContext> context;
|
|
|
|
DX::ThrowIfFailed(
|
|
D3D11CreateDevice(
|
|
nullptr, // specify null to use the default adapter
|
|
D3D_DRIVER_TYPE_HARDWARE,
|
|
nullptr, // leave as nullptr unless software device
|
|
creationFlags, // optionally set debug and Direct2D compatibility flags
|
|
featureLevels, // list of feature levels this app can support
|
|
ARRAYSIZE(featureLevels), // number of entries in above list
|
|
D3D11_SDK_VERSION, // always set this to D3D11_SDK_VERSION
|
|
&device, // returns the Direct3D device created
|
|
&g_featureLevel, // returns feature level of device created
|
|
&context // returns the device immediate context
|
|
)
|
|
);
|
|
|
|
// Get the DirectX11.1 device by QI off the DirectX11 one.
|
|
DX::ThrowIfFailed(device.As(&g_d3dDevice));
|
|
|
|
// And get the corresponding device context in the same way.
|
|
DX::ThrowIfFailed(context.As(&g_d3dContext));
|
|
}
|
|
|
|
// Allocate all memory resources that change on a window SizeChanged event.
|
|
void CreateResources()
|
|
{
|
|
// Store the window bounds so the next time we get a SizeChanged event we can
|
|
// avoid rebuilding everything if the size is identical.
|
|
g_windowBounds = g_window.Get()->Bounds;
|
|
|
|
// If the swap chain already exists, resize it,
|
|
// otherwise create one.
|
|
if(g_swapChain != nullptr)
|
|
{
|
|
DX::ThrowIfFailed(g_swapChain->ResizeBuffers(2, 0, 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0));
|
|
}
|
|
else
|
|
{
|
|
// First, retrieve the underlying DXGI Device from the D3D Device
|
|
Microsoft::WRL::ComPtr<IDXGIDevice1> dxgiDevice;
|
|
DX::ThrowIfFailed(g_d3dDevice.As(&dxgiDevice));
|
|
|
|
// Identify the physical adapter (GPU or card) this device is running on.
|
|
Microsoft::WRL::ComPtr<IDXGIAdapter> dxgiAdapter;
|
|
DX::ThrowIfFailed(dxgiDevice->GetAdapter(&dxgiAdapter));
|
|
|
|
// And obtain the factory object that created it.
|
|
Microsoft::WRL::ComPtr<IDXGIFactory2> dxgiFactory;
|
|
DX::ThrowIfFailed(dxgiAdapter->GetParent(__uuidof(IDXGIFactory2), &dxgiFactory));
|
|
|
|
// Create a descriptor for the swap chain.
|
|
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
|
|
|
|
swapChainDesc.Width = 1920;
|
|
swapChainDesc.Height = 1080;
|
|
swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
|
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
|
|
swapChainDesc.BufferCount = 2;
|
|
swapChainDesc.Stereo = false;
|
|
swapChainDesc.SampleDesc.Count = 1;
|
|
swapChainDesc.SampleDesc.Quality = 0;
|
|
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
|
|
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
|
swapChainDesc.Flags = 0;
|
|
|
|
// Create a SwapChain from a CoreWindow.
|
|
DX::ThrowIfFailed(dxgiFactory->CreateSwapChainForCoreWindow(g_d3dDevice.Get(), reinterpret_cast<IUnknown*>(g_window.Get()), &swapChainDesc, nullptr, &g_swapChain));
|
|
}
|
|
|
|
// Obtain the backbuffer for this window which will be the final 3D rendertarget.
|
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> backBuffer;
|
|
DX::ThrowIfFailed(g_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), &backBuffer));
|
|
|
|
// Create a view interface on the rendertarget to use on bind.
|
|
DX::ThrowIfFailed(g_d3dDevice->CreateRenderTargetView(backBuffer.Get(), nullptr, &g_renderTargetView));
|
|
|
|
// Cache the rendertarget dimensions in our helper class for convenient use.
|
|
D3D11_TEXTURE2D_DESC backBufferDesc = {0};
|
|
backBuffer->GetDesc(&backBufferDesc);
|
|
|
|
// Allocate a 2-D surface as the depth/stencil buffer and
|
|
// create a DepthStencil view on this surface to use on bind.
|
|
CD3D11_TEXTURE2D_DESC depthStencilDesc(DXGI_FORMAT_D24_UNORM_S8_UINT, backBufferDesc.Width, backBufferDesc.Height, 1, 1, D3D11_BIND_DEPTH_STENCIL);
|
|
|
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> depthStencil;
|
|
DX::ThrowIfFailed(g_d3dDevice->CreateTexture2D(&depthStencilDesc, nullptr, &depthStencil));
|
|
|
|
CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
|
|
DX::ThrowIfFailed(g_d3dDevice->CreateDepthStencilView(depthStencil.Get(), &depthStencilViewDesc, &g_depthStencilView));
|
|
|
|
// Create a viewport descriptor of the full window size.
|
|
CD3D11_VIEWPORT viewPort(0.0f, 0.0f, static_cast<float>(backBufferDesc.Width), static_cast<float>(backBufferDesc.Height));
|
|
|
|
// Set the current viewport using the descriptor.
|
|
g_d3dContext->RSSetViewports(1, &viewPort);
|
|
g_d3dContext->OMSetRenderTargets( 1, g_renderTargetView.GetAddressOf(), g_depthStencilView.Get() );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
// Render the frame
|
|
//--------------------------------------------------------------------------------------
|
|
void Render()
|
|
{
|
|
// Just clear the backbuffer
|
|
float ClearColor[4] = { 0.0f, 0.125f, 0.3f, 1.0f }; //red,green,blue,alpha
|
|
|
|
g_d3dContext->ClearRenderTargetView( g_renderTargetView.Get(), ClearColor );
|
|
g_swapChain->Present( 0, 0 );
|
|
}
|
|
|
|
void oldWinMainInit()
|
|
{
|
|
app.loadMediaArchive();
|
|
|
|
RenderManager.Initialise(g_d3dDevice.Get(), g_swapChain.Get());
|
|
|
|
app.loadStringTable();
|
|
|
|
ui.init(g_d3dDevice,g_d3dContext,g_renderTargetView,g_depthStencilView,1920,1080);
|
|
|
|
////////////////
|
|
// Initialise //
|
|
////////////////
|
|
|
|
app.InitTime();
|
|
|
|
// Set the number of possible joypad layouts that the user can switch between, and the number of actions
|
|
InputManager.Initialise(1,3,MINECRAFT_ACTION_MAX, ACTION_MAX_MENU);
|
|
|
|
// Set the default joypad action mappings for Minecraft
|
|
DefineActions();
|
|
InputManager.SetJoypadMapVal(0,0);
|
|
InputManager.SetKeyRepeatRate(0.3f,0.2f);
|
|
|
|
// looks like the Durango controller is a good bit more sensitive than XBOX360/PS3. Defaults in the lib are 10000 for deadzone and 32767 for movement range
|
|
InputManager.SetDeadzoneAndMovementRange(10000,20000,32767);
|
|
|
|
// Initialise the profile manager with the game Title ID, Offer ID, a profile version number, and the number of profile values and settings
|
|
ProfileManager.Initialise(SERVICE_CONFIG_ID, TITLE_PRODUCT_ID);
|
|
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_IDLE,L"Idle");
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MENUS,L"InMenus");
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER,L"PlayingMultiplayer");
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,L"PlayingMultiplayerOffline");
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER_1P,L"PlayingAlone");
|
|
ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,L"PlayingAloneOffline");
|
|
|
|
// Fix for XboxOne #165025 - XR-049: Compliance: Title does not display Rich Presence strings for profiles in main menu.
|
|
ProfileManager.SetGameActivityForAllActiveUsers(CONTEXT_PRESENCE_IDLE);
|
|
|
|
Compression::CreateNewThreadStorage();
|
|
app.ReadLocalDLCList();
|
|
|
|
// initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message
|
|
StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app, app.UpdateProductId,SERVICE_CONFIG_ID,TITLE_PRODUCT_ID);
|
|
|
|
StorageManager.SetMaxSaves(99);
|
|
|
|
byteArray baSaveThumbnail = app.getArchiveFile(L"DefaultSaveThumbnail64x64.png");
|
|
|
|
StorageManager.InitialiseProfileData(PROFILE_VERSION_11,
|
|
NUM_PROFILE_VALUES,
|
|
NUM_PROFILE_SETTINGS,
|
|
dwProfileSettingsA,
|
|
app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT,
|
|
&app.uiGameDefinedDataChangedBitmask);
|
|
|
|
StorageManager.SetDefaultImages((PBYTE)baSaveThumbnail.data, baSaveThumbnail.length);
|
|
|
|
// Set function to be called if a save game operation can't complete due to running out of storage space etc.
|
|
StorageManager.SetIncompleteSaveCallback(CConsoleMinecraftApp::Callback_SaveGameIncomplete, (LPVOID)&app);
|
|
|
|
// set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out
|
|
ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app);
|
|
|
|
// Set a callback for the default player options to be set - when there is no profile data for the player
|
|
StorageManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(LPVOID)&app);
|
|
StorageManager.SetOptionsDataCallback(&CConsoleMinecraftApp::OptionsDataCallback,(LPVOID)&app);
|
|
|
|
|
|
// Set a callback to deal with old profile versions needing updated to new versions
|
|
StorageManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app);
|
|
|
|
g_NetworkManager.Initialise();
|
|
|
|
|
|
// Initialise TLS for tesselator, for this main thread
|
|
Tesselator::CreateNewThreadStorage(1024*1024);
|
|
// Initialise TLS for AABB and Vec3 pools, for this main thread
|
|
AABB::CreateNewThreadStorage();
|
|
Vec3::CreateNewThreadStorage();
|
|
IntCache::CreateNewThreadStorage();
|
|
OldChunkStorage::CreateNewThreadStorage();
|
|
Level::enableLightingCache();
|
|
Tile::CreateNewThreadStorage();
|
|
|
|
//4J-PB - after the init, which will have read all the local DLC, update the product ids by reading the local dlc file
|
|
StorageManager.UpdateDLCProductIDs();
|
|
|
|
Minecraft::main();
|
|
Minecraft *pMinecraft=Minecraft::GetInstance();
|
|
app.InitGameSettings();
|
|
|
|
// read the options here for controller 0
|
|
// 4J-PB - we have no valid user to read a profile for on Xbox One, and there's no EULA anyway
|
|
//StorageManager.ReadFromProfile(0);
|
|
|
|
app.InitialiseDLCDetails();
|
|
StorageManager.SetLicenseChangeFn(&app.HandleDLCLicenseChange);
|
|
|
|
|
|
// debug switch to trial version
|
|
ProfileManager.SetDebugFullOverride(true);
|
|
|
|
// set default values for controllers
|
|
// for(int i=0;i<4;i++)
|
|
// {
|
|
// //app.SetDefaultOptions(app.GetGameDefinedProfileData(i),i);
|
|
// app.SetDefaultOptions(ProfileManager.GetGameDefinedProfileData(i),i);
|
|
// }
|
|
|
|
app.InitialiseTips();
|
|
|
|
#ifdef _TEMPORARY_CREATE_GAME
|
|
app.TemporaryCreateGameStart();
|
|
|
|
Sleep(10000);
|
|
#endif
|
|
}
|
|
|
|
void oldWinMainTick()
|
|
{
|
|
static bool bTrialTimerDisplayed=true;
|
|
|
|
Minecraft *pMinecraft=Minecraft::GetInstance();
|
|
RenderManager.StartFrame();
|
|
|
|
app.UpdateTime();
|
|
PIXBeginNamedEvent(0,"Input manager tick");
|
|
InputManager.Tick();
|
|
PIXEndNamedEvent();
|
|
PIXBeginNamedEvent(0,"Profile manager tick");
|
|
ProfileManager.Tick();
|
|
PIXEndNamedEvent();
|
|
PIXBeginNamedEvent(0,"Storage manager tick");
|
|
StorageManager.Tick();
|
|
PIXEndNamedEvent();
|
|
PIXBeginNamedEvent(0,"Render manager tick");
|
|
RenderManager.Tick();
|
|
PIXEndNamedEvent();
|
|
|
|
GameProgress::Tick();
|
|
|
|
PIXBeginNamedEvent(PIX_COLOR_INDEX(2),"Network manager do work #1");
|
|
g_NetworkManager.DoWork();
|
|
PIXEndNamedEvent();
|
|
|
|
LeaderboardManager::Instance()->Tick();
|
|
// Render game graphics.
|
|
if(app.GetGameStarted())
|
|
{
|
|
pMinecraft->run_middle();
|
|
app.SetAppPaused( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) );
|
|
}
|
|
else
|
|
{
|
|
MemSect(28);
|
|
pMinecraft->soundEngine->tick(NULL, 0.0f);
|
|
MemSect(0);
|
|
pMinecraft->textures->tick(true,false);
|
|
IntCache::Reset();
|
|
if( app.GetReallyChangingSessionType() )
|
|
{
|
|
pMinecraft->tickAllConnections(); // Added to stop timing out when we are waiting after converting to an offline game
|
|
}
|
|
}
|
|
|
|
pMinecraft->soundEngine->playMusicTick();
|
|
|
|
ui.tick();
|
|
ui.render();
|
|
|
|
// Present the frame.
|
|
RenderManager.Present();
|
|
|
|
ui.CheckMenuDisplayed();
|
|
|
|
PIXBeginNamedEvent(0,"Profile load check");
|
|
// has the game defined profile data been changed (by a profile load)
|
|
if(app.uiGameDefinedDataChangedBitmask!=0)
|
|
{
|
|
void *pData;
|
|
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
|
{
|
|
if(app.uiGameDefinedDataChangedBitmask&(1<<i))
|
|
{
|
|
// It has - game needs to update its values with the data from the profile
|
|
pData=StorageManager.GetGameDefinedProfileData(i);
|
|
// reset the changed flag
|
|
app.ClearGameSettingsChangedFlag(i);
|
|
app.DebugPrintf("*** - APPLYING GAME SETTINGS CHANGE for pad %d\n",i);
|
|
app.ApplyGameSettingsChanged(i);
|
|
|
|
#ifdef _DEBUG_MENUS_ENABLED
|
|
if(app.DebugSettingsOn())
|
|
{
|
|
app.ActionDebugMask(i);
|
|
}
|
|
else
|
|
{
|
|
// force debug mask off
|
|
app.ActionDebugMask(i,true);
|
|
}
|
|
#endif
|
|
// clear the stats first - there could have beena signout and sign back in in the menus
|
|
// need to clear the player stats - can't assume it'll be done in setlevel - we may not be in the game
|
|
pMinecraft->stats[ i ]->clear();
|
|
pMinecraft->stats[i]->parse(pData);
|
|
}
|
|
}
|
|
|
|
// clear the flag
|
|
app.uiGameDefinedDataChangedBitmask=0;
|
|
|
|
// Check if any profile write are needed
|
|
app.CheckGameSettingsChanged();
|
|
|
|
}
|
|
PIXEndNamedEvent();
|
|
app.TickTMSPPFilesRetrieved();
|
|
|
|
app.TickDLCOffersRetrieved();
|
|
|
|
PIXBeginNamedEvent(0,"Network manager do work #2");
|
|
// 4J Stu - Added this back as it was causing horrendous lag (and eventually a crash on a client) when playing with multiple clients
|
|
g_NetworkManager.DoWork();
|
|
PIXEndNamedEvent();
|
|
|
|
// Any threading type things to deal with from the xui side?
|
|
app.HandleXuiActions();
|
|
|
|
// 4J-PB - Update the trial timer display if we are in the trial version
|
|
if(!ProfileManager.IsFullVersion())
|
|
{
|
|
// display the trial timer
|
|
if(app.GetGameStarted())
|
|
{
|
|
// 4J-PB - if the game is paused, add the elapsed time to the trial timer count so it doesn't tick down
|
|
if(app.IsAppPaused())
|
|
{
|
|
app.UpdateTrialPausedTimer();
|
|
}
|
|
ui.UpdateTrialTimer(ProfileManager.GetPrimaryPad());
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// need to turn off the trial timer if it was on , and we've unlocked the full version
|
|
if(bTrialTimerDisplayed)
|
|
{
|
|
ui.ShowTrialTimer(false);
|
|
bTrialTimerDisplayed=false;
|
|
}
|
|
}
|
|
|
|
// Fix for #7318 - Title crashes after short soak in the leaderboards menu
|
|
// A memory leak was caused because the icon renderer kept creating new Vec3's because the pool wasn't reset
|
|
Vec3::resetPool();
|
|
}
|