// Minecraft.cpp : Defines the entry point for the application. // #include "stdafx.h" #include #include #include #include "GameConfig\Minecraft.spa.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 "..\ClientConnection.h" #include "..\User.h" #include "..\..\Minecraft.World\Socket.h" #include "..\..\Minecraft.World\ThreadName.h" #include "..\..\Minecraft.Client\StatsCounter.h" #include "..\ConnectScreen.h" #include "..\..\Minecraft.Client\Tesselator.h" #include "..\..\Minecraft.Client\Options.h" #include "Sentient\SentientManager.h" #include "..\..\Minecraft.World\IntCache.h" #include "..\Textures.h" #include "..\..\Minecraft.World\compression.h" #include "..\..\Minecraft.World\OldChunkStorage.h" #include "Leaderboards\OrbisLeaderboardManager.h" #include "Network/Orbis_NPToolkit.h" #include "Orbis\Network\SonyVoiceChat_Orbis.h" #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. //------------------------------------------------------------------------------------- // functions for storing and converting rich presence strings from wchar to utf8 uint8_t * AddRichPresenceString(int iID); void FreeRichPresenceStrings(); 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 if(InputManager.IsCircleCrossSwapped()) { InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_A, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OK, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_B, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_X); } else { InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_A, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OK, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_B, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_O); } InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_X, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_Y, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_UP, _PS4_JOY_BUTTON_DPAD_UP | _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN | _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT | _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT | _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEUP, _PS4_JOY_BUTTON_L2); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEDOWN, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT_SCROLL, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT_SCROLL, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_STICK_PRESS, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_PRESS, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_JUMP, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_FORWARD, _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_BACKWARD, _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT, _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT, _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_USE, _PS4_JOY_BUTTON_L2); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_ACTION, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT_SCROLL, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT_SCROLL, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_INVENTORY, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DROP, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_SNEAK_TOGGLE, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_CRAFTING, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_GAME_INFO, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_UP, _PS4_JOY_BUTTON_DPAD_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN); if(InputManager.IsCircleCrossSwapped()) { InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OK, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_B, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_X); } else { InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OK, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_B, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_O); } InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_X, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_Y, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_UP, _PS4_JOY_BUTTON_DPAD_UP | _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN | _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT | _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT | _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEUP, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEDOWN, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT_SCROLL, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT_SCROLL, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAUSEMENU, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_STICK_PRESS, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_PRESS, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_JUMP, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_FORWARD, _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_BACKWARD, _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT, _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT, _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_USE, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_ACTION, _PS4_JOY_BUTTON_L2); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT_SCROLL, _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT_SCROLL, _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_INVENTORY, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DROP, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_SNEAK_TOGGLE, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_CRAFTING, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_GAME_INFO, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_UP, _PS4_JOY_BUTTON_DPAD_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN); if(InputManager.IsCircleCrossSwapped()) { InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_A, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OK, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_B, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_X); } else { InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_A, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OK, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_B, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_O); } InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_X, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_Y, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_UP, _PS4_JOY_BUTTON_DPAD_UP | _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN | _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT | _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT | _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEUP, _PS4_JOY_BUTTON_DPAD_UP | _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEDOWN, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT_SCROLL, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT_SCROLL, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_STICK_PRESS, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_PRESS, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_JUMP, _PS4_JOY_BUTTON_L2); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_FORWARD, _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_BACKWARD, _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT, _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT, _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_USE, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_ACTION, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT_SCROLL, _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT_SCROLL, _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_INVENTORY, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DROP, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_SNEAK_TOGGLE, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_CRAFTING, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_GAME_INFO, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_UP, _PS4_JOY_BUTTON_DPAD_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN); // Vita remote play map if(InputManager.IsCircleCrossSwapped()) { InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_A, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OK, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_B, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_X); } else { InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_A, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OK, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_B, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_CANCEL, _PS4_JOY_BUTTON_O); } InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_X, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_Y, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_UP, _PS4_JOY_BUTTON_DPAD_UP | _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_DOWN, _PS4_JOY_BUTTON_DPAD_DOWN | _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_LEFT, _PS4_JOY_BUTTON_DPAD_LEFT | _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_RIGHT, _PS4_JOY_BUTTON_DPAD_RIGHT | _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OTHER_STICK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OTHER_STICK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OTHER_STICK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OTHER_STICK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_PAGEUP, _PS4_JOY_BUTTON_L2); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_PAGEDOWN, _PS4_JOY_BUTTON_R2); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_RIGHT_SCROLL, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_LEFT_SCROLL, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_STICK_PRESS, _PS4_JOY_BUTTON_L3); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_OTHER_STICK_PRESS, _PS4_JOY_BUTTON_R3); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_JUMP, _PS4_JOY_BUTTON_X); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_FORWARD, _PS4_JOY_BUTTON_LSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_BACKWARD, _PS4_JOY_BUTTON_LSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LEFT, _PS4_JOY_BUTTON_LSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_RIGHT, _PS4_JOY_BUTTON_LSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LOOK_LEFT, _PS4_JOY_BUTTON_RSTICK_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LOOK_RIGHT, _PS4_JOY_BUTTON_RSTICK_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LOOK_UP, _PS4_JOY_BUTTON_RSTICK_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LOOK_DOWN, _PS4_JOY_BUTTON_RSTICK_DOWN); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_INVENTORY, _PS4_JOY_BUTTON_TRIANGLE); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_PAUSEMENU, _PS4_JOY_BUTTON_OPTIONS); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_DROP, _PS4_JOY_BUTTON_O); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_CRAFTING, _PS4_JOY_BUTTON_SQUARE); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_GAME_INFO, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_USE, _PS4_JOY_BUTTON_L1); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_ACTION, _PS4_JOY_BUTTON_R1); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_RIGHT_SCROLL, _PS4_JOY_BUTTON_R2 | _PS4_JOY_BUTTON_DPAD_RIGHT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_LEFT_SCROLL, _PS4_JOY_BUTTON_L2 | _PS4_JOY_BUTTON_DPAD_LEFT); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _PS4_JOY_BUTTON_L3 | _PS4_JOY_BUTTON_DPAD_UP); InputManager.SetGameJoypadMaps(MAP_STYLE_3,MINECRAFT_ACTION_SNEAK_TOGGLE, _PS4_JOY_BUTTON_R3 | _PS4_JOY_BUTTON_DPAD_DOWN); // Touchpad mapping InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_TOUCHPAD_PRESS, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_TOUCHPAD_PRESS, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_TOUCHPAD_PRESS, _PS4_JOY_BUTTON_TOUCHPAD); InputManager.SetGameJoypadMaps(MAP_STYLE_3,ACTION_MENU_TOUCHPAD_PRESS, _PS4_JOY_BUTTON_TOUCHPAD); // Partial mapping for Vita TV (applied over other mappings) InputManager.SetGameJoypadMaps(PARTIAL_MAP_1, MINECRAFT_ACTION_GAME_INFO, _PS4_JOY_BUTTON_DPAD_UP); } void MemSect(int sect) { } void RegisterAwardsWithProfileManager() { // register the awards ProfileManager.RegisterAward(eAward_TakingInventory, ACHIEVEMENT_01, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_GettingWood, ACHIEVEMENT_02, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_Benchmarking, ACHIEVEMENT_03, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_TimeToMine, ACHIEVEMENT_04, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_HotTopic, ACHIEVEMENT_05, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_AquireHardware, ACHIEVEMENT_06, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_TimeToFarm, ACHIEVEMENT_07, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_BakeBread, ACHIEVEMENT_08, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_TheLie, ACHIEVEMENT_09, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_GettingAnUpgrade, ACHIEVEMENT_10, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_DeliciousFish, ACHIEVEMENT_11, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_OnARail, ACHIEVEMENT_12, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_TimeToStrike, ACHIEVEMENT_13, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_MonsterHunter, ACHIEVEMENT_14, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_CowTipper, ACHIEVEMENT_15, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_WhenPigsFly, ACHIEVEMENT_16, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_LeaderOfThePack, ACHIEVEMENT_17, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_MOARTools, ACHIEVEMENT_18, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_DispenseWithThis, ACHIEVEMENT_19, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_InToTheNether, ACHIEVEMENT_20, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_snipeSkeleton, ACHIEVEMENT_21, eAwardType_Achievement); // 'Sniper Duel' ProfileManager.RegisterAward(eAward_diamonds, ACHIEVEMENT_22, eAwardType_Achievement); // 'DIAMONDS!' ProfileManager.RegisterAward(eAward_ghast, ACHIEVEMENT_23, eAwardType_Achievement); // 'Return To Sender' ProfileManager.RegisterAward(eAward_blazeRod, ACHIEVEMENT_24, eAwardType_Achievement); // 'Into Fire' ProfileManager.RegisterAward(eAward_potion, ACHIEVEMENT_25, eAwardType_Achievement); // 'Local Brewery' ProfileManager.RegisterAward(eAward_theEnd, ACHIEVEMENT_26, eAwardType_Achievement); // 'The End?' ProfileManager.RegisterAward(eAward_winGame, ACHIEVEMENT_27, eAwardType_Achievement); // 'The End.' ProfileManager.RegisterAward(eAward_enchantments, ACHIEVEMENT_28, eAwardType_Achievement); // 'Enchanter' #ifdef _EXTENDED_ACHIEVEMENTS ProfileManager.RegisterAward(eAward_overkill, ACHIEVEMENT_29, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_bookcase, ACHIEVEMENT_30, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_adventuringTime, ACHIEVEMENT_31, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_repopulation, ACHIEVEMENT_32, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_diamondsToYou, ACHIEVEMENT_33, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_eatPorkChop, ACHIEVEMENT_34, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_play100Days, ACHIEVEMENT_35, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_arrowKillCreeper, ACHIEVEMENT_36, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_theHaggler, ACHIEVEMENT_37, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_potPlanter, ACHIEVEMENT_38, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_itsASign, ACHIEVEMENT_39, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_ironBelly, ACHIEVEMENT_40, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_haveAShearfulDay, ACHIEVEMENT_41, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_rainbowCollection, ACHIEVEMENT_42, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_stayinFrosty, ACHIEVEMENT_43, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_chestfulOfCobblestone, ACHIEVEMENT_44, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_renewableEnergy, ACHIEVEMENT_45, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_musicToMyEars, ACHIEVEMENT_46, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_bodyGuard, ACHIEVEMENT_47, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_ironMan, ACHIEVEMENT_48, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_zombieDoctor, ACHIEVEMENT_49, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_lionTamer, ACHIEVEMENT_50, eAwardType_Achievement); #endif // Rich Presence init - number of presences, number of contexts ProfileManager.RichPresenceInit(4,1); ProfileManager.SetRichPresenceSettingFn(SQRNetworkManager_Orbis::SetRichPresence); char *pchRichPresenceString; pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_GAMESTATE); ProfileManager.RichPresenceRegisterContext(CONTEXT_GAME_STATE, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_IDLE); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_IDLE, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_MENUS); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_MENUS, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_MULTIPLAYER); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_MULTIPLAYER, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_MULTIPLAYEROFFLINE); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_MULTIPLAYER_1P); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_MULTIPLAYER_1P, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCE_MULTIPLAYER_1POFFLINE); ProfileManager.RichPresenceRegisterPresenceString(CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_BLANK); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_BLANK, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_RIDING_PIG); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_RIDING_PIG, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_RIDING_MINECART); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_RIDING_MINECART, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_BOATING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_BOATING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_FISHING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_FISHING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_CRAFTING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_CRAFTING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_FORGING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_FORGING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_NETHER); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_NETHER, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_CD); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_CD, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_MAP); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_MAP, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_ENCHANTING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_ENCHANTING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_BREWING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_BREWING, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_ANVIL); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_ANVIL, pchRichPresenceString); pchRichPresenceString=(char *)AddRichPresenceString(IDS_RICHPRESENCESTATE_TRADING); ProfileManager.RichPresenceRegisterContextString(CONTEXT_GAME_STATE, CONTEXT_GAME_STATE_TRADING, pchRichPresenceString); } int StartMinecraftThreadProc( void* lpParameter ) { Vec3::UseDefaultThreadStorage(); AABB::UseDefaultThreadStorage(); Tesselator::CreateNewThreadStorage(1024*1024); RenderManager.InitialiseContext(); Minecraft::start(wstring(),wstring()); delete Tesselator::getInstance(); return 0; } int main(int argc, const char *argv[] ) { app.DebugPrintf("---main()\n"); OrbisInit(); static bool bTrialTimerDisplayed=true; char *usrdirPath= getUsrDirPath(); strcpy(usrdirPath,"/app0"); RenderManager.Initialise(); // Read the file containing the product codes app.DebugPrintf("---ReadProductCodes()\n"); if(app.ReadProductCodes()==FALSE) { // can't continue app.FatalLoadError(); } SceNpContentRestriction param; memset(¶m, 0x0, sizeof(param)); param.size = sizeof(param); SceNpAgeRestriction ageRestriction[5]; memset(ageRestriction, 0x0, sizeof(ageRestriction)); bool bCircleCrossSwapped = false; switch(app.GetProductSKU()) { case e_sku_SCEA: // ESRB EVERYONE 10+ param.defaultAgeRestriction = 10; break; case e_sku_SCEJ: bCircleCrossSwapped = true; // 4J Stu - Intentional fall-through case e_sku_SCEE: // PEGI 7+ param.defaultAgeRestriction = 7; // USK 6+ strncpy(ageRestriction[0].countryCode.data, "de" , 2); ageRestriction[0].age = 6; // PG rating has no age, but for some reason the testers are saying it's 8 strncpy(ageRestriction[1].countryCode.data, "au" , 2); ageRestriction[1].age = 8; strncpy(ageRestriction[2].countryCode.data, "ru" , 2); ageRestriction[2].age = 6; strncpy(ageRestriction[3].countryCode.data, "jp" , 2); ageRestriction[3].age = 0; strncpy(ageRestriction[4].countryCode.data, "kr" , 2); ageRestriction[4].age = 0; param.ageRestrictionCount = 5; param.ageRestriction = ageRestriction; break; } InputManager.SetCircleCrossSwapped(bCircleCrossSwapped); int err = sceNpSetContentRestriction(¶m); if (err < 0){ /* Error handling */ app.DebugPrintf("sceNpSetContentRestriction failed with error %08x\n", err); } err = sceGameLiveStreamingInitialize(SCE_GAME_LIVE_STREAMING_HEAP_SIZE); if(err < 0) { app.DebugPrintf("Failed to init sceGameLiveStreamingInitialize. %08x\n", err); } err = sceGameLiveStreamingSetStandbyScreenResource("standy_screen"); if(err < 0) { app.DebugPrintf("Failed to set special standby screen resource. %08x\n", err); } app.loadMediaArchive(); app.loadStringTable(); ui.init(1920,1080); // storage manager is needed for the trial key check StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app,""); StorageManager.SetSaveTitleExtraFileSuffix(app.GetString(IDS_SAVE_SUBTITLE_SUFFIX)); StorageManager.SetDLCInfoMap(app.GetSonyDLCMap()); app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); //////////////// // Initialise // //////////////// app.InitTime(); NPToolkit.init(); // Set the number of possible joypad layouts that the user can switch between, and the number of actions InputManager.Initialise(1,5,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 PS4 controller is a good bit more sensitive than 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 SceNpCommunicationId commsId; SceNpCommunicationSignature commsSig; ProfileManager.Initialise( &commsId, //SQRNetworkManager::GetSceNpCommsId(), &commsSig, //SQRNetworkManager::GetSceNpCommsSig(), PROFILE_VERSION_12, NUM_PROFILE_VALUES, NUM_PROFILE_SETTINGS, dwProfileSettingsA, app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, &app.uiGameDefinedDataChangedBitmask); // register the awards RegisterAwardsWithProfileManager(); // register the get string function with the profile lib, so it can be called within the lib ProfileManager.SetGetStringFunc(&CConsoleMinecraftApp::GetString); ProfileManager.SetPlayerListTitleID(IDS_PLAYER_LIST_TITLE); StorageManager.SetGameSaveFolderTitle((WCHAR *)app.GetString(IDS_GAMENAME)); StorageManager.SetSaveCacheFolderTitle((WCHAR *)app.GetString(IDS_SAVECACHEFILE)); StorageManager.SetOptionsFolderTitle((WCHAR *)app.GetString(IDS_OPTIONSFILE)); StorageManager.SetCorruptSaveName((WCHAR *)app.GetString(IDS_CORRUPTSAVE_TITLE)); #if (defined _FINAL_BUILD) || (defined _ART_BUILD) StorageManager.SetGameSaveFolderPrefix(app.GetSaveFolderPrefix()); #else // Use debug directory to prevent debug saves being loaded/edited in package build (since debug can't edit package save games this causes various problems) StorageManager.SetGameSaveFolderPrefix("DEBUG01899"); #endif StorageManager.SetMaxSaves(99); byteArray baOptionsIcon = app.getArchiveFile(L"DefaultOptionsImage228x128.png"); byteArray baSaveThumbnail = app.getArchiveFile(L"DefaultSaveThumbnail64x64.png"); byteArray baSaveImage = app.getArchiveFile(L"DefaultSaveImage228x128.png"); StorageManager.InitialiseProfileData(PROFILE_VERSION_12, NUM_PROFILE_VALUES, NUM_PROFILE_SETTINGS, dwProfileSettingsA, app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, &app.uiGameDefinedDataChangedBitmask); StorageManager.SetDefaultImages((PBYTE)baOptionsIcon.data, baOptionsIcon.length,(PBYTE)baSaveImage.data, baSaveImage.length,(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); // Temporary - set a single user for quadrant 0 for the storage manager. Will need to do more to link this aspect of the storage manager is once we have proper profile management. SceUserServiceUserId aUserIds[4]; memset(aUserIds, 0, sizeof(aUserIds)); int ret = sceUserServiceGetInitialUser(&aUserIds[0]); assert(ret == SCE_OK); StorageManager.SetQuadrantUserIds(aUserIds); // 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); // Set a callback for when there is a read error on profile data //StorageManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(LPVOID)&app); // QNet needs to be setup after profile manager, as we do not want its Notify listener to handle // XN_SYS_SIGNINCHANGED notifications. This does mean that we need to have a callback in the // ProfileManager for XN_LIVE_INVITE_ACCEPTED for QNet. g_NetworkManager.Initialise(); // debug switch to trial version ProfileManager.SetDebugFullOverride(true); // 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(); Compression::CreateNewThreadStorage(); OldChunkStorage::CreateNewThreadStorage(); Level::enableLightingCache(); Tile::CreateNewThreadStorage(); Minecraft::main(); // Minecraft::main () used to call Minecraft::Start, but this takes ~2.5 seconds, so now running this in another thread // so we can do some basic renderer calls whilst it is happening. This is at attempt to stop getting TRC failure on SubmitDone taking > 5 seconds on boot C4JThread *minecraftThread = new C4JThread(&StartMinecraftThreadProc, NULL, "Running minecraft start"); minecraftThread->Run(); do { RenderManager.StartFrame(); Sleep(20); RenderManager.Present(); } while (minecraftThread->isRunning()); delete minecraftThread; Minecraft *pMinecraft=Minecraft::GetInstance(); app.InitGameSettings(); // read the options here for controller 0 StorageManager.ReadFromProfile(0); // 4J-PB - have to hide the auto splashscreen, or we never see our game sceSystemServiceHideSplashScreen(); // set the default profile values for(int i=0;isoundEngine->init(NULL); while (TRUE) { SonyVoiceChat_Orbis::tick(); 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(); PIXBeginNamedEvent(0,"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(); static bool bInitnet=false; if(bInitnet) { g_NetworkManager.Initialise(); } 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;istats[ i ]->clear(); pMinecraft->stats[i]->parse(pData); } } // clear the flag app.uiGameDefinedDataChangedBitmask=0; } PIXEndNamedEvent(); // 4J-PB - Monitor the options save for a space issue bool bOptionsNoSpace=false; for(int i=0;i vRichPresenceStrings; // convert wstring to UTF-8 string std::string wstring_to_utf8 (const std::wstring& str) { std::wstring_convert> myconv; return myconv.to_bytes(str); } uint8_t *mallocAndCreateUTF8ArrayFromString(int iID) { int result; LPCWSTR wchString=app.GetString(iID); std::wstring srcString = wchString; std::string dstString = wstring_to_utf8(srcString); int dst_len = dstString.size()+1; uint8_t *strUtf8=(uint8_t *)malloc(dst_len); memcpy(strUtf8, dstString.c_str(), dst_len); return strUtf8; } uint8_t * AddRichPresenceString(int iID) { uint8_t *strUtf8 = mallocAndCreateUTF8ArrayFromString(iID); if( strUtf8 != NULL ) { vRichPresenceStrings.push_back(strUtf8); } return strUtf8; } void FreeRichPresenceStrings() { uint8_t *strUtf8; for(int i=0;i