Merge pull request #409 from 4jcraft/platform-refactor

This commit is contained in:
MatthewBeshay 2026-04-08 13:39:24 +10:00 committed by GitHub
commit f1f1d116b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
372 changed files with 3385 additions and 4562 deletions

View file

@ -2,7 +2,7 @@
#include <cstdint>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "minecraft/GameTypes.h"
@ -171,10 +171,10 @@ typedef struct _DLCRequest {
typedef struct _TMSPPRequest {
eTMSContentState eState;
eDLCContentType eType;
C4JStorage::eGlobalStorage eStorageFacility;
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal;
IPlatformStorage::eGlobalStorage eStorageFacility;
IPlatformStorage::eTMS_FILETYPEVAL eFileTypeVal;
// char szFilename[MAX_TMSFILENAME_SIZE];
int (*CallbackFunc)(void*, int, int, C4JStorage::PTMSPP_FILEDATA,
int (*CallbackFunc)(void*, int, int, IPlatformStorage::PTMSPP_FILEDATA,
const char* szFilename);
wchar_t wchFilename[MAX_TMSFILENAME_SIZE];

View file

@ -9,7 +9,7 @@
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/PlatformServices.h"
#include "platform/fs/fs.h"
#include "platform/PlatformTypes.h"
ArchiveManager::ArchiveManager()
@ -26,7 +26,7 @@ void ArchiveManager::loadMediaArchive() {
if (!mediapath.empty()) {
#if defined(__linux__)
std::wstring exeDirW = PlatformFileIO.getBasePath().wstring();
std::wstring exeDirW = PlatformFilesystem.getBasePath().wstring();
std::wstring candidate = exeDirW + File::pathSeparator + mediapath;
if (File(candidate).exists()) {
m_mediaArchive = new ArchiveFile(File(candidate));

View file

@ -16,7 +16,7 @@
#include "app/linux/Iggy/include/rrCore.h"
#include "app/linux/LinuxGame.h"
#include "platform/C4JThread.h"
#include "platform/PlatformServices.h"
#include "platform/fs/fs.h"
#include "java/Random.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
@ -183,7 +183,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
for (int i = 0; szId[i]; i++)
if (szId[i] == '.') szId[i] = '/';
std::string base = PlatformFileIO.getBasePath().string() + "/";
std::string base = PlatformFilesystem.getBasePath().string() + "/";
const char* roots[] = {
"Sound/Minecraft/", "app/common/Sound/Minecraft/",
"app/common/res/TitleUpdate/res/Sound/Minecraft/"};
@ -197,7 +197,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
for (int i = 1; i <= 16; i++) {
char tryP[512];
snprintf(tryP, 512, "%s%s%d%s", fullRoot.c_str(), szId, i, ext);
if (PlatformFileIO.exists(tryP))
if (PlatformFilesystem.exists(tryP))
count = i;
else
break;
@ -210,7 +210,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
}
char tryP[512];
snprintf(tryP, 512, "%s%s%s", fullRoot.c_str(), szId, ext);
if (PlatformFileIO.exists(tryP)) {
if (PlatformFilesystem.exists(tryP)) {
strncpy(finalPath, tryP, 511);
found = true;
break;
@ -250,7 +250,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) {
wcstombs(szIdentifier, wchUISoundNames[iSound], 255);
for (int i = 0; szIdentifier[i]; i++)
if (szIdentifier[i] == '.') szIdentifier[i] = '/';
std::string base = PlatformFileIO.getBasePath().string() + "/";
std::string base = PlatformFilesystem.getBasePath().string() + "/";
const char* roots[] = {
"Sound/Minecraft/UI/",
"Sound/Minecraft/",
@ -265,7 +265,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) {
char tryP[512];
snprintf(tryP, 512, "%s%s%s%s", base.c_str(), root, szIdentifier,
ext);
if (PlatformFileIO.exists(tryP)) {
if (PlatformFilesystem.exists(tryP)) {
strncpy(finalPath, tryP, 511);
found = true;
break;
@ -452,7 +452,7 @@ void SoundEngine::playMusicTick() {
return;
}
if (m_musicID != -1) {
std::string base = PlatformFileIO.getBasePath().string() + "/";
std::string base = PlatformFilesystem.getBasePath().string() + "/";
bool isCD = (m_musicID >= m_iStream_CD_1);
const char* folder = isCD ? "cds/" : "music/";
const char* track = m_szStreamFileA[m_musicID];
@ -467,13 +467,13 @@ void SoundEngine::playMusicTick() {
// try with folder prefix (music/ or cds/)
snprintf(m_szStreamName, sizeof(m_szStreamName), "%s%s%s%s%s", base.c_str(), r, folder,
track, e);
if (PlatformFileIO.exists(m_szStreamName)) {
if (PlatformFilesystem.exists(m_szStreamName)) {
found = true;
break;
}
// try without folder prefix
snprintf(m_szStreamName, sizeof(m_szStreamName), "%s%s%s%s", base.c_str(), r, track, e);
if (PlatformFileIO.exists(m_szStreamName)) {
if (PlatformFilesystem.exists(m_szStreamName)) {
found = true;
break;
}
@ -1470,7 +1470,7 @@ void SoundEngine::playMusicUpdate() {
std::string strFile =
"TPACK:\\Data\\" + string(szName) + ".binka";
std::string mountedPath =
StorageManager.GetMountedPath(strFile);
PlatformStorage.GetMountedPath(strFile);
strcpy(m_szStreamName, mountedPath.c_str());
} else {
SetIsPlayingStreamingGameMusic(false);

View file

@ -56,7 +56,7 @@ void BannedListManager::addLevel(int iPad, PlayerUID xuid,
// 4J-PB - write to TMS++ now
// bool
// bRes=StorageManager.WriteTMSFile(iPad,C4JStorage::eGlobalStorage_TitleUser,L"BannedList",(std::uint8_t*)pBannedList,
// bRes=PlatformStorage.WriteTMSFile(iPad,IPlatformStorage::eGlobalStorage_TitleUser,L"BannedList",(std::uint8_t*)pBannedList,
// dwDataBytes);
delete[] pBannedList;

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <unordered_map>
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "DLCManager.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
@ -53,19 +53,19 @@ void ReadAudioDlcStruct(T* out, const std::uint8_t* data,
}
inline unsigned int AudioParamAdvance(unsigned int wcharCount) {
return static_cast<unsigned int>(sizeof(C4JStorage::DLC_FILE_PARAM) +
return static_cast<unsigned int>(sizeof(IPlatformStorage::DLC_FILE_PARAM) +
wcharCount * AUDIO_DLC_WCHAR_BIN_SIZE);
}
inline unsigned int AudioDetailAdvance(unsigned int wcharCount) {
return static_cast<unsigned int>(sizeof(C4JStorage::DLC_FILE_DETAILS) +
return static_cast<unsigned int>(sizeof(IPlatformStorage::DLC_FILE_DETAILS) +
wcharCount * AUDIO_DLC_WCHAR_BIN_SIZE);
}
inline std::wstring ReadAudioParamString(const std::uint8_t* data,
unsigned int offset) {
return ReadAudioDlcWString(data + offset +
offsetof(C4JStorage::DLC_FILE_PARAM, wchData));
offsetof(IPlatformStorage::DLC_FILE_PARAM, wchData));
}
} // namespace
@ -123,7 +123,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype,
int maximumChars = 55;
bool bIsSDMode =
!RenderManager.IsHiDef() && !RenderManager.IsWidescreen();
!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen();
if (bIsSDMode) {
maximumChars = 45;
@ -196,7 +196,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
unsigned int uiParameterTypeCount =
ReadAudioDlcValue<unsigned int>(pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_PARAM paramBuf;
IPlatformStorage::DLC_FILE_PARAM paramBuf;
ReadAudioDlcStruct(&paramBuf, pbData, uiCurrentByte);
for (unsigned int i = 0; i < uiParameterTypeCount; i++) {
@ -214,7 +214,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
unsigned int uiFileCount =
ReadAudioDlcValue<unsigned int>(pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_DETAILS fileBuf;
IPlatformStorage::DLC_FILE_DETAILS fileBuf;
ReadAudioDlcStruct(&fileBuf, pbData, uiCurrentByte);
unsigned int tempByteOffset = uiCurrentByte;

View file

@ -13,14 +13,14 @@
#include <unordered_map>
#include <utility>
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "DLCFile.h"
#include "DLCPack.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "platform/PlatformServices.h"
#include "platform/fs/fs.h"
#include "util/StringHelpers.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePackRepository.h"
@ -69,9 +69,9 @@ static_assert(sizeof(wchar_t) == 2,
#endif
#define DLC_PARAM_ADV(n) \
(sizeof(C4JStorage::DLC_FILE_PARAM) + (n) * DLC_WCHAR_BIN_SIZE)
(sizeof(IPlatformStorage::DLC_FILE_PARAM) + (n) * DLC_WCHAR_BIN_SIZE)
#define DLC_DETAIL_ADV(n) \
(sizeof(C4JStorage::DLC_FILE_DETAILS) + (n) * DLC_WCHAR_BIN_SIZE)
(sizeof(IPlatformStorage::DLC_FILE_DETAILS) + (n) * DLC_WCHAR_BIN_SIZE)
namespace {
template <typename T>
@ -90,7 +90,7 @@ std::wstring getMountedDlcReadPath(const std::string& path) {
std::wstring readPath = convStringToWstring(path);
#if defined(_WINDOWS64)
const std::string mountedPath = StorageManager.GetMountedPath(path.c_str());
const std::string mountedPath = PlatformStorage.GetMountedPath(path.c_str());
if (!mountedPath.empty()) {
readPath = convStringToWstring(mountedPath);
}
@ -105,14 +105,14 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData,
*pBytesRead = 0;
const std::wstring readPath = getMountedDlcReadPath(path);
const std::size_t fSize = PlatformFileIO.fileSize(readPath);
const std::size_t fSize = PlatformFilesystem.fileSize(readPath);
if (fSize == 0 || fSize > std::numeric_limits<unsigned int>::max()) {
return false;
}
std::uint8_t* data = new std::uint8_t[fSize];
auto result = PlatformFileIO.readFile(readPath, data, fSize);
if (result.status != IPlatformFileIO::ReadStatus::Ok) {
auto result = PlatformFilesystem.readFile(readPath, data, fSize);
if (result.status != IPlatformFilesystem::ReadStatus::Ok) {
delete[] data;
return false;
}
@ -259,7 +259,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
if (pack == nullptr) {
app.DebugPrintf(
"DLCManager: Attempting to find the index for a nullptr pack\n");
//__debugbreak();
//assert(0);
return foundIndex;
}
if (type != e_DLCType_All) {
@ -359,14 +359,14 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
swprintf(wchFormat, 132, L"%ls\n\n%%ls",
firstCorruptPack->getName().c_str());
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IPlatformStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA, 1,
ProfileManager.GetPrimaryPad(), nullptr, nullptr, wchFormat);
PlatformProfile.GetPrimaryPad(), nullptr, nullptr, wchFormat);
} else {
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IPlatformStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC_MULTIPLE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
}
@ -413,17 +413,17 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
memcpy((out), (buf) + (off), sizeof(unsigned int))
#define DLC_READ_PARAM(out, buf, off) \
memcpy((out), (buf) + (off), sizeof(C4JStorage::DLC_FILE_PARAM))
memcpy((out), (buf) + (off), sizeof(IPlatformStorage::DLC_FILE_PARAM))
#define DLC_READ_DETAIL(out, buf, off) \
memcpy((out), (buf) + (off), sizeof(C4JStorage::DLC_FILE_DETAILS))
memcpy((out), (buf) + (off), sizeof(IPlatformStorage::DLC_FILE_DETAILS))
// for details, read in the function below
#define DLC_PARAM_WSTR(buf, off) \
DLC_WSTRING((buf) + (off) + offsetof(C4JStorage::DLC_FILE_PARAM, wchData))
DLC_WSTRING((buf) + (off) + offsetof(IPlatformStorage::DLC_FILE_PARAM, wchData))
#define DLC_DETAIL_WSTR(buf, off) \
DLC_WSTRING((buf) + (off) + offsetof(C4JStorage::DLC_FILE_DETAILS, wchFile))
DLC_WSTRING((buf) + (off) + offsetof(IPlatformStorage::DLC_FILE_DETAILS, wchFile))
{
std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte = 0;
@ -466,7 +466,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
DLC_READ_UINT(&uiParameterCount, pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_PARAM parBuf;
IPlatformStorage::DLC_FILE_PARAM parBuf;
DLC_READ_PARAM(&parBuf, pbData, uiCurrentByte);
// uint32_t dwwchCount=0;
for (unsigned int i = 0; i < uiParameterCount; i++) {
@ -481,13 +481,13 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
uiCurrentByte += DLC_PARAM_ADV(parBuf.dwWchCount);
DLC_READ_PARAM(&parBuf, pbData, uiCurrentByte);
}
// ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
// ulCurrentByte+=ulParameterCount * sizeof(IPlatformStorage::DLC_FILE_PARAM);
unsigned int uiFileCount;
DLC_READ_UINT(&uiFileCount, pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_DETAILS fileBuf;
IPlatformStorage::DLC_FILE_DETAILS fileBuf;
DLC_READ_DETAIL(&fileBuf, pbData, uiCurrentByte);
unsigned int dwTemp = uiCurrentByte;
@ -496,7 +496,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
DLC_READ_DETAIL(&fileBuf, pbData, dwTemp);
}
std::uint8_t* pbTemp =
&pbData[dwTemp]; //+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount;
&pbData[dwTemp]; //+ sizeof(IPlatformStorage::DLC_FILE_DETAILS)*ulFileCount;
DLC_READ_DETAIL(&fileBuf, pbData, uiCurrentByte);
for (unsigned int i = 0; i < uiFileCount; i++) {
@ -540,7 +540,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
pbTemp += DLC_PARAM_ADV(parBuf.dwWchCount);
DLC_READ_PARAM(&parBuf, pbTemp, 0);
}
// pbTemp+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
// pbTemp+=ulParameterCount * sizeof(IPlatformStorage::DLC_FILE_PARAM);
if (dlcTexturePack != nullptr) {
unsigned int texturePackFilesProcessed = 0;
@ -643,7 +643,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData,
unsigned int uiParameterCount =
ReadDlcValue<unsigned int>(pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_PARAM paramBuf;
IPlatformStorage::DLC_FILE_PARAM paramBuf;
ReadDlcStruct(&paramBuf, pbData, uiCurrentByte);
for (unsigned int i = 0; i < uiParameterCount; i++) {
// Map DLC strings to application strings, then store the DLC index
@ -661,7 +661,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData,
unsigned int uiFileCount =
ReadDlcValue<unsigned int>(pbData, uiCurrentByte);
uiCurrentByte += sizeof(int);
C4JStorage::DLC_FILE_DETAILS fileBuf;
IPlatformStorage::DLC_FILE_DETAILS fileBuf;
ReadDlcStruct(&fileBuf, pbData, uiCurrentByte);
unsigned int dwTemp = uiCurrentByte;

View file

@ -6,7 +6,7 @@
#include <sstream>
#include <utility>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "DLCAudioFile.h"
#include "DLCCapeFile.h"
#include "DLCColourTableFile.h"
@ -84,7 +84,7 @@ void DLCPack::addChildPack(DLCPack* childPack) {
const std::uint32_t packId = childPack->GetPackId();
#if !defined(_CONTENT_PACKAGE)
if (packId < 0 || packId > 15) {
__debugbreak();
assert(0);
}
#endif
childPack->SetPackId((packId << 24) | m_packId);
@ -302,7 +302,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
if (type == DLCManager::e_DLCType_All) {
app.DebugPrintf("Unimplemented\n");
#if !defined(__CONTENT_PACKAGE)
__debugbreak();
assert(0);
#endif
return 0;
}
@ -327,12 +327,12 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type,
if (type == DLCManager::e_DLCType_All) {
app.DebugPrintf("Unimplemented\n");
#if !defined(_CONTENT_PACKAGE)
__debugbreak();
assert(0);
#endif
return false;
}
#if !defined(_CONTENT_PACKAGE)
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
if (app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_UnlockAllDLC)) {
return true;
} else

View file

@ -3,7 +3,7 @@
#include <string.h>
#include <wchar.h>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "DLCManager.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
@ -57,7 +57,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
int maximumChars = 55;
bool bIsSDMode =
!RenderManager.IsHiDef() && !RenderManager.IsWidescreen();
!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen();
if (bIsSDMode) {
maximumChars = 45;

View file

@ -6,11 +6,12 @@
#include "app/common/DLC/DLCSkinFile.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/sdl2/Storage.h"
#include "platform/sdl2/Profile.h"
#include "platform/storage/storage.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h"
#include <cstring>
@ -46,7 +47,7 @@ std::uint32_t DLCController::m_dwContentTypeA[e_Marketplace_MAX] = {
};
int DLCController::marketplaceCountsCallback(
void* pParam, C4JStorage::DLC_TMS_DETAILS* pTMSDetails, int iPad) {
void* pParam, IPlatformStorage::DLC_TMS_DETAILS* pTMSDetails, int iPad) {
app.DebugPrintf("Marketplace Counts= New - %d Total - %d\n",
pTMSDetails->dwNewOffers, pTMSDetails->dwTotalOffers);
@ -73,9 +74,9 @@ bool DLCController::startInstallDLCProcess(int iPad) {
m_iTotalDLCInstalled = 0;
app.DebugPrintf(
"--- DLCController::startInstallDLCProcess - "
"StorageManager.GetInstalledDLC\n");
"PlatformStorage.GetInstalledDLC\n");
StorageManager.GetInstalledDLC(
PlatformStorage.GetInstalledDLC(
iPad, [this](int iInstalledC, int pad) {
return dlcInstalledCallback(iInstalledC, pad);
});
@ -99,7 +100,7 @@ int DLCController::dlcInstalledCallback(int iInstalledC, int iPad) {
void DLCController::mountNextDLC(int iPad) {
app.DebugPrintf("--- DLCController::mountNextDLC: pad=%i.\n", iPad);
if (m_iTotalDLCInstalled < m_iTotalDLC) {
if (StorageManager.MountInstalledDLC(
if (PlatformStorage.MountInstalledDLC(
iPad, m_iTotalDLCInstalled,
[this](int pad, std::uint32_t dwErr,
std::uint32_t dwLicenceMask) {
@ -110,7 +111,7 @@ void DLCController::mountNextDLC(int iPad) {
++m_iTotalDLCInstalled;
mountNextDLC(iPad);
} else {
app.DebugPrintf("StorageManager.MountInstalledDLC ok\n");
app.DebugPrintf("PlatformStorage.MountInstalledDLC ok\n");
}
} else {
m_bDLCInstallPending = false;
@ -135,7 +136,7 @@ int DLCController::dlcMountedCallback(int iPad, std::uint32_t dwErr,
app.m_dlcManager.incrementUnnamedCorruptCount();
} else {
XCONTENT_DATA ContentData =
StorageManager.GetDLC(m_iTotalDLCInstalled);
PlatformStorage.GetDLC(m_iTotalDLCInstalled);
DLCPack* pack =
app.m_dlcManager.getPack(CONTENT_DATA_DISPLAY_NAME(ContentData));
@ -176,7 +177,7 @@ int DLCController::dlcMountedCallback(int iPad, std::uint32_t dwErr,
pack->updateLicenseMask(dwLicenceMask);
}
StorageManager.UnmountInstalledDLC();
PlatformStorage.UnmountInstalledDLC();
}
++m_iTotalDLCInstalled;
mountNextDLC(iPad);
@ -190,7 +191,7 @@ void DLCController::handleDLC(DLCPack* pack) {
#if defined(_WINDOWS64) || defined(__linux__)
std::vector<std::string> dlcFilenames;
#endif
StorageManager.GetMountedDLCFileList("DLCDrive", dlcFilenames);
PlatformStorage.GetMountedDLCFileList("DLCDrive", dlcFilenames);
for (int i = 0; i < dlcFilenames.size(); i++) {
app.m_dlcManager.readDLCDataFile(dwFilesProcessed, dlcFilenames[i],
pack);
@ -413,8 +414,8 @@ unsigned int DLCController::addDLCRequest(eDLCMarketplaceType eType,
}
bool DLCController::retrieveNextDLCContent() {
int primPad = ProfileManager.GetPrimaryPad();
if (primPad == -1 || !ProfileManager.IsSignedInLive(primPad)) {
int primPad = PlatformProfile.GetPrimaryPad();
if (primPad == -1 || !PlatformProfile.IsSignedInLive(primPad)) {
return true;
}
@ -436,13 +437,13 @@ bool DLCController::retrieveNextDLCContent() {
app.DebugPrintf("RetrieveNextDLCContent - type = %d\n",
pCurrent->dwType);
#endif
C4JStorage::EDLCStatus status = StorageManager.GetDLCOffers(
ProfileManager.GetPrimaryPad(),
IPlatformStorage::EDLCStatus status = PlatformStorage.GetDLCOffers(
PlatformProfile.GetPrimaryPad(),
[this](int iOfferC, std::uint32_t dwType, int pad) {
return dlcOffersReturned(iOfferC, dwType, pad);
},
pCurrent->dwType);
if (status == C4JStorage::EDLC_Pending) {
if (status == IPlatformStorage::EDLC_Pending) {
pCurrent->eState = e_DLC_ContentState_Retrieving;
} else {
app.DebugPrintf("RetrieveNextDLCContent - PROBLEM\n");
@ -597,9 +598,9 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
&DLCController::tmsPPFileReturned;
pTMSPPreq->lpCallbackParam = this;
pTMSPPreq->eStorageFacility =
C4JStorage::eGlobalStorage_Title;
IPlatformStorage::eGlobalStorage_Title;
pTMSPPreq->eFileTypeVal =
C4JStorage::TMS_FILETYPE_BINARY;
IPlatformStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename,
pDLC->wchDataFile,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
@ -645,9 +646,9 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
&DLCController::tmsPPFileReturned;
pTMSPPreq->lpCallbackParam = this;
pTMSPPreq->eStorageFacility =
C4JStorage::eGlobalStorage_Title;
IPlatformStorage::eGlobalStorage_Title;
pTMSPPreq->eFileTypeVal =
C4JStorage::TMS_FILETYPE_BINARY;
IPlatformStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename, pDLC->wchBanner,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = eType;
@ -670,7 +671,7 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
}
int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData,
C4JStorage::PTMSPP_FILEDATA pFileData,
IPlatformStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename) {
DLCController* pClass = (DLCController*)pParam;

View file

@ -8,7 +8,7 @@
#include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h"
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h"
struct SCreditTextItemDef;
@ -32,7 +32,7 @@ public:
void clearDLCInstalled() { m_bDLCInstallProcessCompleted = false; }
static int marketplaceCountsCallback(void* pParam,
C4JStorage::DLC_TMS_DETAILS*,
IPlatformStorage::DLC_TMS_DETAILS*,
int iPad);
// DLC info registration
@ -73,7 +73,7 @@ public:
unsigned int addTMSPPFileTypeRequest(eDLCContentType eType,
bool bPromote = false);
static int tmsPPFileReturned(void* pParam, int iPad, int iUserData,
C4JStorage::PTMSPP_FILEDATA pFileData,
IPlatformStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename);
// Credit text

View file

@ -2,10 +2,9 @@
#include "app/common/Game.h"
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h"
@ -25,7 +24,6 @@
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h"
#include "platform/PlatformServices.h"
#include "java/Class.h"
#include "java/File.h"
#include "java/Random.h"
@ -74,7 +72,7 @@
#include <utility>
#include <vector>
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
#include "app/common/Audio/SoundEngine.h"
#include "app/common/Colours/ColourTable.h"
#include "app/common/DLC/DLCPack.h"
@ -121,7 +119,7 @@ Game::Game() {
"%d\n",
sizeof(GAME_SETTINGS), GAME_SETTINGS_PROFILE_DATA_BYTES);
#if !defined(_CONTENT_PACKAGE)
__debugbreak();
assert(0);
#endif
}
@ -158,7 +156,7 @@ void Game::DebugPrintf(const char* szFormat, ...) {
va_start(ap, szFormat);
vsnprintf(buf, sizeof(buf), szFormat, ap);
va_end(ap);
OutputDebugStringA(buf);
fputs(buf, stderr);
#endif
}
@ -170,7 +168,7 @@ void Game::DebugPrintf(int user, const char* szFormat, ...) {
va_start(ap, szFormat);
vsnprintf(buf, sizeof(buf), szFormat, ap);
va_end(ap);
OutputDebugStringA(buf);
fputs(buf, stderr);
if (user == USER_UI) {
ui.logDebugString(buf);
}
@ -235,12 +233,12 @@ void Game::SetAppPaused(bool val) { m_bIsAppPaused = val; }
int Game::BannedLevelDialogReturned(
void* pParam, int iPad, const C4JStorage::EMessageResult result) {
void* pParam, int iPad, const IPlatformStorage::EMessageResult result) {
Game* pApp = (Game*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
} else {
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pApp->SetAction(iPad, eAppAction_ExitWorld);
} else {
pApp->SetAction(iPad, eAppAction_ExitPlayer);
@ -253,12 +251,12 @@ int Game::BannedLevelDialogReturned(
#if defined(_DEBUG_MENUS_ENABLED)
bool Game::DebugArtToolsOn() {
return m_debugOptions.debugArtToolsOn(
GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()));
GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()));
}
#endif
void Game::SetDebugSequence(const char* pchSeq) {
InputManager.SetDebugSequence(pchSeq, [this]() -> int {
PlatformInput.SetDebugSequence(pchSeq, [this]() -> int {
// printf("sequence matched\n");
m_debugOptions.setDebugOptions(!m_debugOptions.settingsOn());
@ -317,10 +315,10 @@ int Game::GetLocalPlayerCount(void) {
// std::uint32_t dwSize=0;
// // 4J-PB - out for now for DaveK so he doesn't get the
// birthday cape #ifdef _CONTENT_PACKAGE
// C4JStorage::ETMSStatus eTMSStatus;
// eTMSStatus=StorageManager.ReadTMSFile(ProfileManager.GetPrimaryPad(),C4JStorage::eGlobalStorage_Title,C4JStorage::eTMS_FileType_Graphic,
// IPlatformStorage::ETMSStatus eTMSStatus;
// eTMSStatus=PlatformStorage.ReadTMSFile(PlatformProfile.GetPrimaryPad(),IPlatformStorage::eGlobalStorage_Title,IPlatformStorage::eTMS_FileType_Graphic,
// L"Default_Cape.png",&pBuffer, &dwSize);
// if(eTMSStatus==C4JStorage::ETMSStatus_Idle)
// if(eTMSStatus==IPlatformStorage::ETMSStatus_Idle)
// {
// app.AddMemoryTextureFile(wTemp,pBuffer,dwSize);
// }
@ -331,7 +329,7 @@ int Game::GetLocalPlayerCount(void) {
// int Game::DLCReadCallback(void*
// pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData)
// pParam,IPlatformStorage::DLC_FILE_DETAILS *pDLCData)
// {
//
//
@ -608,7 +606,7 @@ int32_t Game::RegisterConfigValues(wchar_t* pType, int iValue) {
// AUTOSAVE
void Game::SetAutosaveTimerTime(void) {
int settingValue = GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_Autosave);
int settingValue = GetGameSettings(PlatformProfile.GetPrimaryPad(), eGameSetting_Autosave);
m_saveManager.setAutosaveTimerTime(settingValue);
}
@ -624,28 +622,28 @@ float Game::getTrialTimer(void) {
bool Game::IsLocalMultiplayerAvailable() {
unsigned int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
bool available = RenderManager.IsHiDef() && connectedControllers > 1;
bool available = PlatformRenderer.IsHiDef() && connectedControllers > 1;
return available;
// Found this in GameNetworkManager?
// #ifdef 0
// iOtherConnectedControllers =
// InputManager.GetConnectedGamepadCount();
// if((InputManager.IsPadConnected(userIndex) ||
// ProfileManager.IsSignedIn(userIndex)))
// PlatformInput.GetConnectedGamepadCount();
// if((PlatformInput.IsPadConnected(userIndex) ||
// PlatformProfile.IsSignedIn(userIndex)))
// {
// --iOtherConnectedControllers;
// }
// #else
// for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
// {
// if( (i!=userIndex) && (InputManager.IsPadConnected(i) ||
// ProfileManager.IsSignedIn(i)) )
// if( (i!=userIndex) && (PlatformInput.IsPadConnected(i) ||
// PlatformProfile.IsSignedIn(i)) )
// {
// iOtherConnectedControllers++;
// }

View file

@ -4,8 +4,8 @@
#include <mutex>
#include "util/Timer.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
// using namespace std;
@ -145,7 +145,7 @@ public:
bool IsAppPaused();
void SetAppPaused(bool val);
int displaySavingMessage(const C4JStorage::ESavingMessage eMsg, int iPad) {
int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg, int iPad) {
return m_gameSettingsManager.displaySavingMessage(eMsg, iPad);
}
bool GetGameStarted() { return m_bGameStarted; }
@ -344,11 +344,11 @@ public:
}
static int DefaultOptionsCallback(void* pParam,
C_4JProfile::PROFILESETTINGS* pSettings,
IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) {
return GameSettingsManager::defaultOptionsCallback(pParam, pSettings, iPad);
}
int SetDefaultOptions(C_4JProfile::PROFILESETTINGS* pSettings,
int SetDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) {
return m_gameSettingsManager.setDefaultOptions(pSettings, iPad);
}
@ -486,11 +486,11 @@ public:
return NetworkController::signoutExitWorldThreadProc(lpParameter);
}
static int PrimaryPlayerSignedOutReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult result) {
const IPlatformStorage::EMessageResult result) {
return NetworkController::primaryPlayerSignedOutReturned(pParam, iPad, result);
}
static int EthernetDisconnectReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult result) {
const IPlatformStorage::EMessageResult result) {
return NetworkController::ethernetDisconnectReturned(pParam, iPad, result);
}
static void ProfileReadErrorCallback(void* pParam) {
@ -523,7 +523,7 @@ public:
#endif
void SetDebugSequence(const char* pchSeq);
// bool UploadFileToGlobalStorage(int iQuadrant,
// C4JStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile );
// IPlatformStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile );
// Installed DLC - delegated to DLCController
bool StartInstallDLCProcess(int iPad) { return m_dlcController.startInstallDLCProcess(iPad); }
@ -539,7 +539,7 @@ public:
bool DLCInstallProcessCompleted() { return m_dlcController.dlcInstallProcessCompleted(); }
void ClearDLCInstalled() { m_dlcController.clearDLCInstalled(); }
static int MarketplaceCountsCallback(void* pParam,
C4JStorage::DLC_TMS_DETAILS* details,
IPlatformStorage::DLC_TMS_DETAILS* details,
int iPad) {
return DLCController::marketplaceCountsCallback(pParam, details, iPad);
}
@ -677,9 +677,9 @@ public:
private:
static int BannedLevelDialogReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult);
const IPlatformStorage::EMessageResult);
static int TexturePackDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return MenuController::texturePackDialogReturned(pParam, iPad, result);
}
@ -730,41 +730,41 @@ public:
private:
static int UnlockFullExitReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullExitReturned(pParam, iPad, result);
}
static int UnlockFullSaveReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullSaveReturned(pParam, iPad, result);
}
static int UnlockFullInviteReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullInviteReturned(pParam, iPad, result);
}
static int TrialOverReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return MenuController::trialOverReturned(pParam, iPad, result);
}
static int ExitAndJoinFromInvite(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInvite(pParam, iPad, result);
}
static int ExitAndJoinFromInviteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteSaveDialogReturned(pParam, iPad, result);
}
static int ExitAndJoinFromInviteAndSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteAndSaveReturned(pParam, iPad, result);
}
static int ExitAndJoinFromInviteDeclineSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteDeclineSaveReturned(pParam, iPad, result);
}
static int FatalErrorDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int WarningTrialTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::warningTrialTexturePackReturned(pParam, iPad, result);
}
@ -817,7 +817,7 @@ public:
MenuController::exitGameFromRemoteSave(lpParameter);
}
static int ExitGameFromRemoteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return MenuController::exitGameFromRemoteSaveDialogReturned(pParam, iPad, result);
}
@ -1021,7 +1021,7 @@ public:
int GetDLCInfoTexturesOffersCount() { return m_dlcController.getDLCInfoTexturesOffersCount(); }
static int TMSPPFileReturned(void* pParam, int iPad, int iUserData,
C4JStorage::PTMSPP_FILEDATA pFileData,
IPlatformStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename) {
return DLCController::tmsPPFileReturned(pParam, iPad, iUserData, pFileData, szFilename);
}

View file

@ -473,7 +473,7 @@ bool GameRuleManager::readRuleFile(
compressedBuffer.data(), compressedSize); break; default:
app.DebugPrintf("Invalid compression
type %d found\n", compressionType);
__debugbreak();
assert(0);
[] decompressedBuffer.data(); dis.close(); bais.reset();

View file

@ -142,7 +142,7 @@ void ConsoleSchematicFile::load(DataInputStream* dis) {
app.DebugPrintf(
"ConsoleSchematicFile has read a nullptr tile "
"entity\n");
__debugbreak();
assert(0);
#endif
} else {
m_tileEntities.push_back(te);
@ -675,7 +675,7 @@ void ConsoleSchematicFile::generateSchematicFile(
}
#ifndef _CONTENT_PACKAGE
if (p != blockCount) __debugbreak();
if (p != blockCount) assert(0);
#endif
// We don't know how this will compress - just make a fixed length buffer to

View file

@ -30,9 +30,9 @@
#include "minecraft/world/level/dimension/Dimension.h"
#include "minecraft/world/level/levelgen/structure/BoundingBox.h"
#include "minecraft/world/phys/AABB.h"
#include "platform/PlatformServices.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/fs/fs.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "strings.h"
#include "util/StringHelpers.h"
@ -551,8 +551,8 @@ void LevelGenerationOptions::loadBaseSaveData() {
mountIndex = m_parentDLCPack->GetDLCMountIndex();
if (mountIndex > -1) {
if (StorageManager.MountInstalledDLC(
ProfileManager.GetPrimaryPad(), mountIndex,
if (PlatformStorage.MountInstalledDLC(
PlatformProfile.GetPrimaryPad(), mountIndex,
[this](int pad, std::uint32_t err, std::uint32_t lic) {
return onPackMounted(pad, err, lic);
},
@ -560,7 +560,7 @@ void LevelGenerationOptions::loadBaseSaveData() {
// corrupt DLC
setLoadedData();
app.DebugPrintf("Failed to mount LGO DLC %d for pad %d\n",
mountIndex, ProfileManager.GetPrimaryPad());
mountIndex, PlatformProfile.GetPrimaryPad());
} else {
m_bLoadingData = true;
app.DebugPrintf("Attempted to mount DLC data for LGO %d\n",
@ -568,7 +568,7 @@ void LevelGenerationOptions::loadBaseSaveData() {
}
} else {
setLoadedData();
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_ReloadTexturePack);
}
}
@ -599,10 +599,10 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
uint32_t dwFileSize = grf.length();
if (dwFileSize > 0) {
uint8_t* pbData = (uint8_t*)new uint8_t[dwFileSize];
auto readResult = PlatformFileIO.readFile(
auto readResult = PlatformFilesystem.readFile(
grf.getPath(), pbData, dwFileSize);
if (readResult.status !=
IPlatformFileIO::ReadStatus::Ok) {
IPlatformFilesystem::ReadStatus::Ok) {
app.FatalLoadError();
}
@ -623,12 +623,12 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
lgo->getBaseSavePath(), true, L"WPACK:"));
if (save.exists()) {
std::size_t dwFileSize =
PlatformFileIO.fileSize(save.getPath());
PlatformFilesystem.fileSize(save.getPath());
if (dwFileSize > 0) {
uint8_t* pbData = (uint8_t*)new uint8_t[dwFileSize];
auto readResult = PlatformFileIO.readFile(
auto readResult = PlatformFilesystem.readFile(
save.getPath(), pbData, dwFileSize);
if (readResult.status != IPlatformFileIO::ReadStatus::Ok) {
if (readResult.status != IPlatformFilesystem::ReadStatus::Ok) {
app.FatalLoadError();
}
@ -638,7 +638,7 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
}
}
}
uint32_t result = StorageManager.UnmountInstalledDLC("WPACK");
uint32_t result = PlatformStorage.UnmountInstalledDLC("WPACK");
}
lgo->setLoadedData();

View file

@ -34,7 +34,7 @@ GameRule::ValueType GameRule::getParameter(const std::wstring& parameterName) {
#ifndef _CONTENT_PACKAGE
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n",
parameterName.c_str());
__debugbreak();
assert(0);
#endif
}
return m_parameters[parameterName];

View file

@ -20,9 +20,9 @@
#include "minecraft/server/level/ServerPlayer.h"
#include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/level/tile/Tile.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "platform/input/input.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "app/common/Audio/SoundEngine.h"
#include <cstring>
@ -35,26 +35,26 @@ GameSettingsManager::GameSettingsManager() {
void GameSettingsManager::initGameSettings() {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
GameSettingsA[i] =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(i);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(i);
// clear the flag to say the settings have changed
GameSettingsA[i]->bSettingsChanged = false;
#if defined(_WINDOWS64)
C_4JProfile::PROFILESETTINGS* pProfileSettings =
ProfileManager.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(C_4JProfile::PROFILESETTINGS));
IPlatformProfile::PROFILESETTINGS* pProfileSettings =
PlatformProfile.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(IPlatformProfile::PROFILESETTINGS));
setDefaultOptions(pProfileSettings, i);
#else
C_4JProfile::PROFILESETTINGS* pProfileSettings =
ProfileManager.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(C_4JProfile::PROFILESETTINGS));
IPlatformProfile::PROFILESETTINGS* pProfileSettings =
PlatformProfile.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(IPlatformProfile::PROFILESETTINGS));
setDefaultOptions(pProfileSettings, i);
#endif
}
}
int GameSettingsManager::setDefaultOptions(
C_4JProfile::PROFILESETTINGS* pSettings, const int iPad) {
IPlatformProfile::PROFILESETTINGS* pSettings, const int iPad) {
setGameSettings(iPad, eGameSetting_MusicVolume, DEFAULT_VOLUME_LEVEL);
setGameSettings(iPad, eGameSetting_SoundFXVolume, DEFAULT_VOLUME_LEVEL);
setGameSettings(iPad, eGameSetting_Gamma, 50);
@ -133,7 +133,7 @@ int GameSettingsManager::setDefaultOptions(
}
int GameSettingsManager::defaultOptionsCallback(
void* pParam, C_4JProfile::PROFILESETTINGS* pSettings, const int iPad) {
void* pParam, IPlatformProfile::PROFILESETTINGS* pSettings, const int iPad) {
Game* pApp = (Game*)pParam;
pApp->DebugPrintf("Setting default options for player %d", iPad);
@ -249,27 +249,27 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
Minecraft* pMinecraft = Minecraft::GetInstance();
switch (eVal) {
case eGameSetting_MusicVolume:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->set(
Options::Option::MUSIC,
((float)GameSettingsA[iPad]->ucMusicVolume) / 100.0f);
}
break;
case eGameSetting_SoundFXVolume:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->set(
Options::Option::SOUND,
((float)GameSettingsA[iPad]->ucSoundFXVolume) / 100.0f);
}
break;
case eGameSetting_Gamma:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
float fVal = ((float)GameSettingsA[iPad]->ucGamma) * 327.68f;
RenderManager.UpdateGamma((unsigned short)fVal);
PlatformRenderer.UpdateGamma((unsigned short)fVal);
}
break;
case eGameSetting_Difficulty:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->toggle(
Options::Option::DIFFICULTY,
GameSettingsA[iPad]->usBitmaskValues & 0x03);
@ -282,7 +282,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
bool bInGame = pMinecraft->level != nullptr;
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetXuiServerAction(
iPad, eXuiServerAction_ServerSettingChanged_Difficulty);
}
@ -290,7 +290,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
app.DebugPrintf(
"NOT ACTIONING DIFFICULTY - Primary pad is %d, This pad is "
"%d\n",
ProfileManager.GetPrimaryPad(), iPad);
PlatformProfile.GetPrimaryPad(), iPad);
}
break;
case eGameSetting_Sensitivity_InGame:
@ -301,42 +301,42 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
case eGameSetting_ViewBob:
break;
case eGameSetting_ControlScheme:
InputManager.SetJoypadMapVal(
PlatformInput.SetJoypadMapVal(
iPad, (GameSettingsA[iPad]->usBitmaskValues & 0x30) >> 4);
break;
case eGameSetting_ControlInvertLook:
break;
case eGameSetting_ControlSouthPaw:
if (GameSettingsA[iPad]->usBitmaskValues & 0x80) {
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX,
AXIS_MAP_RX);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY,
AXIS_MAP_RY);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX,
AXIS_MAP_LX);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY,
AXIS_MAP_LY);
InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0,
PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0,
TRIGGER_MAP_1);
InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1,
PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1,
TRIGGER_MAP_0);
} else {
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX,
AXIS_MAP_LX);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY,
AXIS_MAP_LY);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX,
AXIS_MAP_RX);
InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY,
PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY,
AXIS_MAP_RY);
InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0,
PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0,
TRIGGER_MAP_0);
InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1,
PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1,
TRIGGER_MAP_1);
}
break;
case eGameSetting_SplitScreenVertical:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->updatePlayerViewportAssignments();
}
break;
@ -345,7 +345,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
// Game Host only
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetGameHostOption(
eGameHostOption_Gamertags,
((GameSettingsA[iPad]->usBitmaskValues & 0x0008) != 0) ? 1
@ -371,7 +371,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
for (std::uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) {
if (pMinecraft->localplayers[idx] != nullptr) {
if (pMinecraft->localplayers[idx]->m_iScreenSection ==
C4JRender::VIEWPORT_TYPE_FULLSCREEN) {
IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN) {
ui.DisplayGamertag(idx, false);
} else {
ui.DisplayGamertag(idx, true);
@ -403,7 +403,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
bool bInGame = pMinecraft->level != nullptr;
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetGameHostOption(
eGameHostOption_BedrockFog,
getGameSettings(iPad, eGameSetting_BedrockFog) ? 1 : 0);
@ -484,7 +484,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_MusicVolume:
if (GameSettingsA[iPad]->ucMusicVolume != ucVal) {
GameSettingsA[iPad]->ucMusicVolume = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -493,7 +493,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_SoundFXVolume:
if (GameSettingsA[iPad]->ucSoundFXVolume != ucVal) {
GameSettingsA[iPad]->ucSoundFXVolume = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -502,7 +502,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_Gamma:
if (GameSettingsA[iPad]->ucGamma != ucVal) {
GameSettingsA[iPad]->ucGamma = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -513,7 +513,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
(ucVal & 0x03)) {
GameSettingsA[iPad]->usBitmaskValues &= ~0x03;
GameSettingsA[iPad]->usBitmaskValues |= ucVal & 0x03;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -864,7 +864,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
}
unsigned char GameSettingsManager::getGameSettings(eGameSetting eVal) {
int iPad = ProfileManager.GetPrimaryPad();
int iPad = PlatformProfile.GetPrimaryPad();
return getGameSettings(iPad, eVal);
}
@ -979,13 +979,13 @@ void GameSettingsManager::checkGameSettingsChanged(bool bOverride5MinuteTimer,
if (iPad == XUSER_INDEX_ANY) {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
if (GameSettingsA[i]->bSettingsChanged) {
ProfileManager.WriteToProfile(i, true, bOverride5MinuteTimer);
PlatformProfile.WriteToProfile(i, true, bOverride5MinuteTimer);
GameSettingsA[i]->bSettingsChanged = false;
}
}
} else {
if (GameSettingsA[iPad]->bSettingsChanged) {
ProfileManager.WriteToProfile(iPad, true, bOverride5MinuteTimer);
PlatformProfile.WriteToProfile(iPad, true, bOverride5MinuteTimer);
GameSettingsA[iPad]->bSettingsChanged = false;
}
}
@ -1011,7 +1011,7 @@ void GameSettingsManager::actionDebugMask(int iPad, bool bSetAllClear) {}
unsigned int GameSettingsManager::getGameSettingsDebugMask(
int iPad, bool bOverridePlayer) {
if (iPad == -1) {
iPad = ProfileManager.GetPrimaryPad();
iPad = PlatformProfile.GetPrimaryPad();
}
if (iPad < 0) iPad = 0;
@ -1046,7 +1046,7 @@ void GameSettingsManager::actionDebugMask(int iPad, bool bSetAllClear) {
if (bSetAllClear) ulBitmask = 0L;
if (ProfileManager.GetPrimaryPad() != iPad) return;
if (PlatformProfile.GetPrimaryPad() != iPad) return;
for (int i = 0; i < eDebugSetting_Max; i++) {
switch (i) {
@ -1126,7 +1126,7 @@ void GameSettingsManager::setSpecialTutorialCompletionFlag(int iPad,
}
int GameSettingsManager::displaySavingMessage(
C4JStorage::ESavingMessage eVal, int iPad) {
IPlatformStorage::ESavingMessage eVal, int iPad) {
ui.ShowSavingMessage(iPad, eVal);
return 0;
}

View file

@ -3,7 +3,7 @@
#include <cstdint>
#include "app/common/App_structs.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h"
class GameSettingsManager {
@ -15,9 +15,9 @@ public:
const unsigned short usVersion,
const int iPad);
static int defaultOptionsCallback(void* pParam,
C_4JProfile::PROFILESETTINGS* pSettings,
IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad);
int setDefaultOptions(C_4JProfile::PROFILESETTINGS* pSettings,
int setDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad);
void setGameSettings(int iPad, eGameSetting eVal, unsigned char ucVal);
@ -64,7 +64,7 @@ public:
static void setActionConfirmed(void* param);
// Saving message
int displaySavingMessage(const C4JStorage::ESavingMessage eMsg, int iPad);
int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg, int iPad);
// Game settings array - public, referenced by Game via alias
GAME_SETTINGS* GameSettingsA[XUSER_MAX_COUNT];

View file

@ -28,8 +28,8 @@
#include "minecraft/server/MinecraftServer.h"
#include "minecraft/stats/StatsCounter.h"
#include "platform/PlatformTypes.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "util/StringHelpers.h"
#include "app/common/Audio/SoundEngine.h"
@ -49,11 +49,11 @@ void Game::HandleXuiActions(void) {
{
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
C4JStorage::EMessageResult result =
IPlatformStorage::EMessageResult result =
ui.RequestErrorMessage(IDS_CANT_PLACE_NEAR_SPAWN_TITLE,
IDS_CANT_PLACE_NEAR_SPAWN_TEXT,
uiIDA, 1, XUSER_INDEX_ANY);
if (result != C4JStorage::EMessage_Busy)
if (result != IPlatformStorage::EMessage_Busy)
SetGlobalXuiAction(eAppAction_Idle);
}
break;
@ -71,7 +71,7 @@ void Game::HandleXuiActions(void) {
switch (eAction) {
// // the renderer will capture a screenshot
// case eAppAction_SocialPost:
// if (ProfileManager.IsFullVersion()) {
// if (PlatformProfile.IsFullVersion()) {
// // Facebook Share
// if (CSocialManager::Instance()
// ->IsTitleAllowedToPostImages() &&
@ -127,7 +127,7 @@ void Game::HandleXuiActions(void) {
// stop the dialog asking if we want to overwrite it coming
// up on an autosave
bool bSaveExists;
StorageManager.DoesSaveExist(&bSaveExists);
PlatformStorage.DoesSaveExist(&bSaveExists);
SetAction(i, eAppAction_Idle);
if (!GetChangingSessionType()) {
@ -147,7 +147,7 @@ void Game::HandleXuiActions(void) {
// Check that there is a name for the save - if we're saving
// from the tutorial and this is the first save from the
// tutorial, we'll not have a name
/*if(StorageManager.GetSaveName()==nullptr)
/*if(PlatformStorage.GetSaveName()==nullptr)
{
app.NavigateToScene(i,eUIScene_SaveWorld);
}
@ -159,12 +159,12 @@ void Game::HandleXuiActions(void) {
// Hide the other players scenes
ui.ShowOtherPlayersBaseScene(
ProfileManager.GetPrimaryPad(), false);
PlatformProfile.GetPrimaryPad(), false);
// int saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// PlatformStorage.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
LoadingInputParams* loadingParams =
@ -184,9 +184,9 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
if (ui.IsSceneInStack(ProfileManager.GetPrimaryPad(),
if (ui.IsSceneInStack(PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->scene = eUIScene_EndPoem;
} else {
@ -197,7 +197,7 @@ void Game::HandleXuiActions(void) {
// 4J Stu - Xbox only
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams, eUILayer_Fullscreen,
eUIGroup_Fullscreen);
@ -215,22 +215,22 @@ void Game::HandleXuiActions(void) {
// app.CloseAllPlayersXuiScenes();
// Hide the other players scenes
ui.ShowOtherPlayersBaseScene(ProfileManager.GetPrimaryPad(),
ui.ShowOtherPlayersBaseScene(PlatformProfile.GetPrimaryPad(),
false);
// This just allows it to be shown
if (pMinecraft
->localgameModes[ProfileManager.GetPrimaryPad()] !=
->localgameModes[PlatformProfile.GetPrimaryPad()] !=
nullptr)
pMinecraft
->localgameModes[ProfileManager.GetPrimaryPad()]
->localgameModes[PlatformProfile.GetPrimaryPad()]
->getTutorial()
->showTutorialPopup(false);
// int saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// PlatformStorage.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
LoadingInputParams* loadingParams =
@ -246,13 +246,13 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->type =
e_ProgressCompletion_AutosaveNavigateBack;
completionData->iPad = ProfileManager.GetPrimaryPad();
// completionData->bAutosaveWasMenuDisplayed=ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad());
completionData->iPad = PlatformProfile.GetPrimaryPad();
// completionData->bAutosaveWasMenuDisplayed=ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad());
loadingParams->completionData = completionData;
// 4J Stu - Xbox only
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams, eUILayer_Fullscreen,
eUIGroup_Fullscreen);
@ -265,7 +265,7 @@ void Game::HandleXuiActions(void) {
// Since the player is exiting, let's flush any profile
// writes for them, and hope we're not breaking TCR
// 136...
ProfileManager.ForceQueuedProfileWrites(i);
PlatformProfile.ForceQueuedProfileWrites(i);
// not required - it's done within the
// removeLocalPlayerIdx
@ -285,7 +285,7 @@ void Game::HandleXuiActions(void) {
// Make sure we've not got this player selected as
// current - this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
// Wipe out the tooltips
@ -303,12 +303,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER,
false);
@ -321,12 +321,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1P,
false);
@ -342,7 +342,7 @@ void Game::HandleXuiActions(void) {
int iPlayerC = g_NetworkManager.GetPlayerCount();
// Since the player is exiting, let's flush any profile
// writes for them, and hope we're not breaking TCR 136...
ProfileManager.ForceQueuedProfileWrites(i);
PlatformProfile.ForceQueuedProfileWrites(i);
// if there are any tips showing, we need to close them
pMinecraft->gui->clearMessages(i);
@ -350,7 +350,7 @@ void Game::HandleXuiActions(void) {
// Make sure we've not got this player selected as current -
// this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
// Wipe out the tooltips
@ -367,12 +367,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer, CONTEXT_PRESENCE_MULTIPLAYER,
false);
}
@ -384,12 +384,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
@ -430,15 +430,15 @@ void Game::HandleXuiActions(void) {
// 4J-PB - cancel any possible std::string verifications
// queued with LIVE
// InputManager.CancelAllVerifyInProgress();
// PlatformInput.CancelAllVerifyInProgress();
// In a split screen, only the primary player actually
// quits the game, others just remove their players
if (i != ProfileManager.GetPrimaryPad()) {
if (i != PlatformProfile.GetPrimaryPad()) {
// Make sure we've not got this player selected as
// current - this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
SetAction(i, eAppAction_Idle);
@ -456,13 +456,13 @@ void Game::HandleXuiActions(void) {
if (g_NetworkManager.IsLocalGame()) {
app.SetRichPresenceContext(
j, CONTEXT_GAME_STATE_BLANK);
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
j, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
app.SetRichPresenceContext(
j, CONTEXT_GAME_STATE_BLANK);
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
j, CONTEXT_PRESENCE_MULTIPLAYER, false);
}
}
@ -470,11 +470,11 @@ void Game::HandleXuiActions(void) {
} else {
app.SetRichPresenceContext(i, CONTEXT_GAME_STATE_BLANK);
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
i, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
i, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
}
@ -524,7 +524,7 @@ void Game::HandleXuiActions(void) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
} break;
@ -566,7 +566,7 @@ void Game::HandleXuiActions(void) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -680,7 +680,7 @@ void Game::HandleXuiActions(void) {
// inform the player they are being returned to the menus
// because they signed out
StorageManager.SetSaveDeviceSelected(i, false);
PlatformStorage.SetSaveDeviceSelected(i, false);
// need to clear the player stats - can't assume it'll be
// done in setlevel - we may not be in the game
StatsCounter* pStats = Minecraft::GetInstance()->stats[i];
@ -823,7 +823,7 @@ void Game::HandleXuiActions(void) {
ui.HideAllGameUIElements();
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
if (g_NetworkManager.IsLeavingGame()) {
// 4J Stu - If we are already leaving the game, then we
@ -867,7 +867,7 @@ void Game::HandleXuiActions(void) {
e_ProgressCompletion_NavigateToHomeMenu;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -875,9 +875,9 @@ void Game::HandleXuiActions(void) {
case eAppAction_PrimaryPlayerSignedOutReturned_Menus:
SetAction(i, eAppAction_Idle);
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
// clear the save device
StorageManager.SetSaveDeviceSelected(i, false);
PlatformStorage.SetSaveDeviceSelected(i, false);
ui.UpdatePlayerBasePositions();
// there are multiple layers in the help menu, so a navigate
@ -888,7 +888,7 @@ void Game::HandleXuiActions(void) {
case eAppAction_EthernetDisconnectedReturned_Menus:
SetAction(i, eAppAction_Idle);
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
ui.UpdatePlayerBasePositions();
@ -926,8 +926,8 @@ void Game::HandleXuiActions(void) {
SetAction(i, eAppAction_Idle);
// Check the player really wants to do this
if (!StorageManager.GetSaveDisabled() &&
i == ProfileManager.GetPrimaryPad() &&
if (!PlatformStorage.GetSaveDisabled() &&
i == PlatformProfile.GetPrimaryPad() &&
g_NetworkManager.IsHost() && GetGameStarted()) {
uiIDA[0] = IDS_CONFIRM_CANCEL;
uiIDA[1] = IDS_EXIT_GAME_SAVE;
@ -1000,7 +1000,7 @@ void Game::HandleXuiActions(void) {
1);
const unsigned int result =
StorageManager.UnmountInstalledDLC("TPACK");
PlatformStorage.UnmountInstalledDLC("TPACK");
app.DebugPrintf("Unmount result is %d\n", result);
}
@ -1018,7 +1018,7 @@ void Game::HandleXuiActions(void) {
completionData->type = e_ProgressCompletion_NoAction;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -1043,15 +1043,15 @@ void Game::HandleXuiActions(void) {
app.DebugPrintf(
"Changing Primary Pad on an invite accept - pad was "
"%d, and is now %d\n",
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
inviteData->dwUserIndex);
ProfileManager.SetLockedProfile(inviteData->dwUserIndex);
ProfileManager.SetPrimaryPad(inviteData->dwUserIndex);
PlatformProfile.SetLockedProfile(inviteData->dwUserIndex);
PlatformProfile.SetPrimaryPad(inviteData->dwUserIndex);
// change the minecraft player name
Minecraft::GetInstance()->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
inviteData->dwUserIndex, // dwUserIndex
@ -1069,7 +1069,7 @@ void Game::HandleXuiActions(void) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER,
uiIDA, 1, ProfileManager.GetPrimaryPad());
uiIDA, 1, PlatformProfile.GetPrimaryPad());
ui.NavigateToHomeMenu();
ui.UpdatePlayerBasePositions();
@ -1097,12 +1097,12 @@ void Game::HandleXuiActions(void) {
ui.HideAllGameUIElements();
if (!ui.IsSceneInStack(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
ui.CloseAllPlayersScenes();
}
ui.ShowOtherPlayersBaseScene(
ProfileManager.GetPrimaryPad(), true);
PlatformProfile.GetPrimaryPad(), true);
// Remove this line to fix:
// #49084 - TU5: Code: Gameplay: The title crashes
@ -1125,7 +1125,7 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->iPad = DEFAULT_XUI_MENU_USER;
if (ui.IsSceneInStack(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
@ -1136,7 +1136,7 @@ void Game::HandleXuiActions(void) {
}
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -1148,7 +1148,7 @@ void Game::HandleXuiActions(void) {
} break;
case eAppAction_SetDefaultOptions:
SetAction(i, eAppAction_Idle);
SetDefaultOptions((C_4JProfile::PROFILESETTINGS*)param, i);
SetDefaultOptions((IPlatformProfile::PROFILESETTINGS*)param, i);
// if the profile data has been changed, then force a
// profile write It seems we're allowed to break the 5
@ -1161,7 +1161,7 @@ void Game::HandleXuiActions(void) {
// If the remote server save has already finished, don't
// complete the action
if (GetGameStarted()) {
SetAction(ProfileManager.GetPrimaryPad(),
SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_Idle);
break;
}
@ -1187,7 +1187,7 @@ void Game::HandleXuiActions(void) {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->iPad = DEFAULT_XUI_MENU_USER;
if (ui.IsSceneInStack(ProfileManager.GetPrimaryPad(),
if (ui.IsSceneInStack(PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
@ -1201,7 +1201,7 @@ void Game::HandleXuiActions(void) {
loadingParams->cancelFunc = &Game::ExitGameFromRemoteSave;
loadingParams->cancelText = IDS_TOOLTIPS_EXIT;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
} break;
@ -1211,11 +1211,11 @@ void Game::HandleXuiActions(void) {
case eAppAction_FailedToJoinNoPrivileges: {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IPlatformStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
if (result != C4JStorage::EMessage_Busy)
PlatformProfile.GetPrimaryPad());
if (result != IPlatformStorage::EMessage_Busy)
SetAction(i, eAppAction_Idle);
} break;
case eAppAction_ProfileReadError:
@ -1245,7 +1245,7 @@ void Game::HandleXuiActions(void) {
!g_NetworkManager.IsLeavingGame()) {
// primary player would exit the world, secondary would
// exit the player
if (ProfileManager.GetPrimaryPad() == i) {
if (PlatformProfile.GetPrimaryPad() == i) {
SetAction(i, eAppAction_ExitWorld);
} else {
SetAction(i, eAppAction_ExitPlayer);
@ -1269,12 +1269,12 @@ void Game::HandleXuiActions(void) {
swprintf(wchFormat, 40, L"%ls\n\n%%ls",
player->GetOnlineName());
C4JStorage::EMessageResult result =
IPlatformStorage::EMessageResult result =
ui.RequestErrorMessage(
IDS_BANNED_LEVEL_TITLE, IDS_PLAYER_BANNED_LEVEL,
uiIDA, 2, i, &Game::BannedLevelDialogReturned,
this, wchFormat);
if (result != C4JStorage::EMessage_Busy)
if (result != IPlatformStorage::EMessage_Busy)
SetAction(i, eAppAction_Idle);
} else {
SetAction(i, eAppAction_Idle);
@ -1341,7 +1341,7 @@ void Game::HandleXuiActions(void) {
ui.RequestErrorMessage(
IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&Game::TexturePackDialogReturned, this);
SetAction(i, eAppAction_Idle);
}
@ -1431,14 +1431,14 @@ void Game::HandleXuiActions(void) {
*/
case eTMSAction_TMS_RetrieveFiles_Complete:
SetTMSAction(i, eTMSAction_Idle);
// if(StorageManager.SetSaveDevice(&CScene_Main::DeviceSelectReturned,pClass))
// if(PlatformStorage.SetSaveDevice(&CScene_Main::DeviceSelectReturned,pClass))
// {
// // save device already
// selected
// // ensure we've applied
// this player's settings
// app.ApplyGameSettingsChanged(ProfileManager.GetPrimaryPad());
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// app.ApplyGameSettingsChanged(PlatformProfile.GetPrimaryPad());
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// }
break;
default:

View file

@ -1,293 +0,0 @@
/*
base64.cpp and base64.h
base64 encoding and decoding with C++.
More information at
https://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp
Version: 2.rc.09 (release candidate)
Copyright (C) 2004-2017, 2020-2022 René Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include "base64.h"
#include <algorithm>
#include <stdexcept>
//
// Depending on the url parameter in base64_chars, one of
// two sets of base64 characters needs to be chosen.
// They differ in their last two characters.
//
static const char* base64_chars[2] = {
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"+/",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"-_"};
static unsigned int pos_of_char(const unsigned char chr) {
//
// Return the position of chr within base64_encode()
//
if (chr >= 'A' && chr <= 'Z')
return chr - 'A';
else if (chr >= 'a' && chr <= 'z')
return chr - 'a' + ('Z' - 'A') + 1;
else if (chr >= '0' && chr <= '9')
return chr - '0' + ('Z' - 'A') + ('z' - 'a') + 2;
else if (chr == '+' || chr == '-')
return 62; // Be liberal with input and accept both url ('-') and
// non-url ('+') base 64 characters (
else if (chr == '/' || chr == '_')
return 63; // Ditto for '/' and '_'
else
//
// 2020-10-23: Throw std::exception rather than const char*
//(Pablo Martin-Gomez, https://github.com/Bouska)
//
throw std::runtime_error("Input is not valid base64-encoded data.");
}
static std::string insert_linebreaks(std::string str, size_t distance) {
//
// Provided by https://github.com/JomaCorpFX, adapted by me.
//
if (!str.length()) {
return "";
}
size_t pos = distance;
while (pos < str.size()) {
str.insert(pos, "\n");
pos += distance + 1;
}
return str;
}
template <typename String, unsigned int line_length>
static std::string encode_with_line_breaks(String s) {
return insert_linebreaks(base64_encode(s, false), line_length);
}
template <typename String>
static std::string encode_pem(String s) {
return encode_with_line_breaks<String, 64>(s);
}
template <typename String>
static std::string encode_mime(String s) {
return encode_with_line_breaks<String, 76>(s);
}
template <typename String>
static std::string encode(String s, bool url) {
return base64_encode(reinterpret_cast<const unsigned char*>(s.data()),
s.length(), url);
}
std::string base64_encode(unsigned char const* bytes_to_encode, size_t in_len,
bool url) {
size_t len_encoded = (in_len + 2) / 3 * 4;
unsigned char trailing_char = url ? '.' : '=';
//
// Choose set of base64 characters. They differ
// for the last two positions, depending on the url
// parameter.
// A bool (as is the parameter url) is guaranteed
// to evaluate to either 0 or 1 in C++ therefore,
// the correct character set is chosen by subscripting
// base64_chars with url.
//
const char* base64_chars_ = base64_chars[url];
std::string ret;
ret.reserve(len_encoded);
unsigned int pos = 0;
while (pos < in_len) {
ret.push_back(base64_chars_[(bytes_to_encode[pos + 0] & 0xfc) >> 2]);
if (pos + 1 < in_len) {
ret.push_back(
base64_chars_[((bytes_to_encode[pos + 0] & 0x03) << 4) +
((bytes_to_encode[pos + 1] & 0xf0) >> 4)]);
if (pos + 2 < in_len) {
ret.push_back(
base64_chars_[((bytes_to_encode[pos + 1] & 0x0f) << 2) +
((bytes_to_encode[pos + 2] & 0xc0) >> 6)]);
ret.push_back(base64_chars_[bytes_to_encode[pos + 2] & 0x3f]);
} else {
ret.push_back(
base64_chars_[(bytes_to_encode[pos + 1] & 0x0f) << 2]);
ret.push_back(trailing_char);
}
} else {
ret.push_back(
base64_chars_[(bytes_to_encode[pos + 0] & 0x03) << 4]);
ret.push_back(trailing_char);
ret.push_back(trailing_char);
}
pos += 3;
}
return ret;
}
template <typename String>
static std::string decode(String const& encoded_string,
bool remove_linebreaks) {
//
// decode(…) is templated so that it can be used with String = const
// std::string& or std::string_view (requires at least C++17)
//
if (encoded_string.empty()) return std::string();
if (remove_linebreaks) {
std::string copy(encoded_string);
copy.erase(std::remove(copy.begin(), copy.end(), '\n'), copy.end());
return base64_decode(copy, false);
}
size_t length_of_string = encoded_string.length();
size_t pos = 0;
//
// The approximate length (bytes) of the decoded string might be one or
// two bytes smaller, depending on the amount of trailing equal signs
// in the encoded string. This approximation is needed to reserve
// enough space in the string to be returned.
//
size_t approx_length_of_decoded_string = length_of_string / 4 * 3;
std::string ret;
ret.reserve(approx_length_of_decoded_string);
while (pos < length_of_string) {
//
// Iterate over encoded input string in chunks. The size of all
// chunks except the last one is 4 bytes.
//
// The last chunk might be padded with equal signs or dots
// in order to make it 4 bytes in size as well, but this
// is not required as per RFC 2045.
//
// All chunks except the last one produce three output bytes.
//
// The last chunk produces at least one and up to three bytes.
//
size_t pos_of_char_1 = pos_of_char(encoded_string.at(pos + 1));
//
// Emit the first output byte that is produced in each chunk:
//
ret.push_back(static_cast<std::string::value_type>(
((pos_of_char(encoded_string.at(pos + 0))) << 2) +
((pos_of_char_1 & 0x30) >> 4)));
if ((pos + 2 <
length_of_string) && // Check for data that is not padded with
// equal signs (which is allowed by RFC 2045)
encoded_string.at(pos + 2) != '=' &&
encoded_string.at(pos + 2) !=
'.' // accept URL-safe base 64 strings, too, so check for '.'
// also.
) {
//
// Emit a chunk's second byte (which might not be produced in the
// last chunk).
//
unsigned int pos_of_char_2 =
pos_of_char(encoded_string.at(pos + 2));
ret.push_back(static_cast<std::string::value_type>(
((pos_of_char_1 & 0x0f) << 4) + ((pos_of_char_2 & 0x3c) >> 2)));
if ((pos + 3 < length_of_string) &&
encoded_string.at(pos + 3) != '=' &&
encoded_string.at(pos + 3) != '.') {
//
// Emit a chunk's third byte (which might not be produced in the
// last chunk).
//
ret.push_back(static_cast<std::string::value_type>(
((pos_of_char_2 & 0x03) << 6) +
pos_of_char(encoded_string.at(pos + 3))));
}
}
pos += 4;
}
return ret;
}
std::string base64_decode(std::string const& s, bool remove_linebreaks) {
return decode(s, remove_linebreaks);
}
std::string base64_encode(std::string const& s, bool url) {
return encode(s, url);
}
std::string base64_encode_pem(std::string const& s) { return encode_pem(s); }
std::string base64_encode_mime(std::string const& s) { return encode_mime(s); }
#if __cplusplus >= 201703L
//
// Interface with std::string_view rather than const std::string&
// Requires C++17
// Provided by Yannic Bonenberger (https://github.com/Yannic)
//
std::string base64_encode(std::string_view s, bool url) {
return encode(s, url);
}
std::string base64_encode_pem(std::string_view s) { return encode_pem(s); }
std::string base64_encode_mime(std::string_view s) { return encode_mime(s); }
std::string base64_decode(std::string_view s, bool remove_linebreaks) {
return decode(s, remove_linebreaks);
}
#endif // __cplusplus >= 201703L

View file

@ -1,37 +0,0 @@
//
// base64 encoding and decoding with C++.
// Version: 2.rc.09 (release candidate)
//
#ifndef BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
#define BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
#include <stddef.h>
#include <string>
#if __cplusplus >= 201703L
#include <string_view>
#endif // __cplusplus >= 201703L
std::string base64_encode(std::string const& s, bool url = false);
std::string base64_encode_pem(std::string const& s);
std::string base64_encode_mime(std::string const& s);
std::string base64_decode(std::string const& s, bool remove_linebreaks = false);
std::string base64_encode(unsigned char const*, size_t len, bool url = false);
#if __cplusplus >= 201703L
//
// Interface with std::string_view rather than const std::string&
// Requires C++17
// Provided by Yannic Bonenberger (https://github.com/Yannic)
//
std::string base64_encode(std::string_view s, bool url = false);
std::string base64_encode_pem(std::string_view s);
std::string base64_encode_mime(std::string_view s);
std::string base64_decode(std::string_view s, bool remove_linebreaks = false);
#endif // __cplusplus >= 201703L
#endif /* BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A */

View file

@ -115,7 +115,7 @@ void StringTable::ProcessStringTableData(void) {
} else {
app.DebugPrintf("Failed to get language\n");
#ifdef _DEBUG
__debugbreak();
assert(0);
#endif
isStatic = false;
@ -137,7 +137,7 @@ void StringTable::getData(std::uint8_t** ppData, unsigned int* pSize) {
const wchar_t* StringTable::getString(const std::wstring& id) {
#ifndef _CONTENT_PACKAGE
if (isStatic) {
__debugbreak();
assert(0);
return L"";
}
#endif
@ -154,7 +154,7 @@ const wchar_t* StringTable::getString(const std::wstring& id) {
const wchar_t* StringTable::getString(int id) {
#ifndef _CONTENT_PACKAGE
if (!isStatic) {
__debugbreak();
assert(0);
return L"";
}
#endif

View file

@ -16,9 +16,8 @@
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Render.h"
#include "platform/input/input.h"
#include "platform/renderer/renderer.h"
#include "platform/XboxStubs.h"
#include "strings.h"
#include "util/StringHelpers.h"
@ -108,7 +107,7 @@ int LocalizationManager::TipsSortFunction(const void* a, const void* b) {
void LocalizationManager::initialiseTips() {
memset(m_TipIDA, 0, sizeof(m_TipIDA));
if (!RenderManager.IsHiDef()) {
if (!PlatformRenderer.IsHiDef()) {
m_GameTipA[0].uiStringID = IDS_TIPS_GAMETIP_0;
}
@ -348,8 +347,8 @@ std::wstring LocalizationManager::formatHTMLString(
std::wstring LocalizationManager::getActionReplacement(
int iPad, unsigned char ucAction) {
unsigned int input = InputManager.GetGameJoypadMaps(
InputManager.GetJoypadMapVal(iPad), ucAction);
unsigned int input = PlatformInput.GetGameJoypadMaps(
PlatformInput.GetJoypadMapVal(iPad), ucAction);
std::wstring replacement = L"";

View file

@ -6,6 +6,7 @@
#include "app/common/UI/Scenes/UIScene_FullscreenProgress.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/ProgressRenderer.h"
#include "minecraft/client/renderer/GameRenderer.h"
@ -18,8 +19,8 @@
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/HopperTileEntity.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include <cstring>
#include <sstream>
@ -431,12 +432,12 @@ bool MenuController::loadBeaconMenu(
}
int MenuController::texturePackDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return 0;
}
int MenuController::unlockFullInviteReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
Minecraft* pMinecraft = Minecraft::GetInstance();
bool bNoPlayer;
@ -448,16 +449,16 @@ int MenuController::unlockFullInviteReturned(
}
int MenuController::unlockFullSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return 0;
}
int MenuController::unlockFullExitReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
Game* pApp = (Game*)pParam;
Minecraft* pMinecraft = Minecraft::GetInstance();
if (result != C4JStorage::EMessage_ResultAccept) {
if (result != IPlatformStorage::EMessage_ResultAccept) {
pApp->SetAction(pMinecraft->player->GetXboxPad(),
eAppAction_ExitWorldTrial);
}
@ -466,11 +467,11 @@ int MenuController::unlockFullExitReturned(
}
int MenuController::trialOverReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
Game* pApp = (Game*)pParam;
Minecraft* pMinecraft = Minecraft::GetInstance();
if (result != C4JStorage::EMessage_ResultAccept) {
if (result != IPlatformStorage::EMessage_ResultAccept) {
pApp->SetAction(pMinecraft->player->GetXboxPad(), eAppAction_ExitTrial);
}
@ -489,17 +490,17 @@ int MenuController::remoteSaveThreadProc(void* lpParameter) {
pMinecraft->progressRenderer->progressStagePercentage(0);
while (!app.GetGameStarted() &&
app.GetXuiAction(ProfileManager.GetPrimaryPad()) ==
app.GetXuiAction(PlatformProfile.GetPrimaryPad()) ==
eAppAction_WaitRemoteServerSaveComplete) {
pMinecraft->tickAllConnections();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
if (app.GetXuiAction(ProfileManager.GetPrimaryPad()) !=
if (app.GetXuiAction(PlatformProfile.GetPrimaryPad()) !=
eAppAction_WaitRemoteServerSaveComplete) {
return ERROR_CANCELLED;
}
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_Idle);
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_Idle);
ui.UpdatePlayerBasePositions();
@ -509,7 +510,7 @@ int MenuController::remoteSaveThreadProc(void* lpParameter) {
}
void MenuController::exitGameFromRemoteSave(void* lpParameter) {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
unsigned int uiIDA[3];
uiIDA[0] = IDS_CONFIRM_CANCEL;
@ -521,8 +522,8 @@ void MenuController::exitGameFromRemoteSave(void* lpParameter) {
}
int MenuController::exitGameFromRemoteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
if (result == C4JStorage::EMessage_ResultDecline) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
app.SetAction(iPad, eAppAction_ExitWorld);
} else {
UIScene_FullscreenProgress* pScene =

View file

@ -5,7 +5,7 @@
#include <string>
#include "app/common/App_structs.h"
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h"
class Player;
@ -97,23 +97,23 @@ public:
// Dialog callbacks
static int texturePackDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int fatalErrorDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int trialOverReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int unlockFullExitReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int unlockFullSaveReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int unlockFullInviteReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
// Remote save
static int remoteSaveThreadProc(void* lpParameter);
static void exitGameFromRemoteSave(void* lpParameter);
static int exitGameFromRemoteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
// Image text data
void getImageTextData(std::uint8_t* imageData, unsigned int imageBytes,

View file

@ -9,10 +9,10 @@
#include <thread>
#include <vector>
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "minecraft/GameEnums.h"
#include "app/common/Game.h"
#include "app/common/GameRules/GameRuleManager.h"
@ -28,7 +28,7 @@
#include "Socket.h"
#include "platform/XboxStubs.h"
#include "util/StringHelpers.h"
#include "platform/PlatformServices.h"
#include "platform/fs/fs.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/File.h"
#include "minecraft/client/Minecraft.h"
@ -108,7 +108,7 @@ bool CGameNetworkManager::_RunNetworkGame(void* lpParameter) {
success = s_pPlatformNetworkManager->_RunNetworkGame();
if (!success) {
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
return true;
}
@ -118,7 +118,7 @@ bool CGameNetworkManager::_RunNetworkGame(void* lpParameter) {
app.SetGameStarted(true);
// app.CloseXuiScenes(ProfileManager.GetPrimaryPad());
// app.CloseXuiScenes(PlatformProfile.GetPrimaryPad());
return success;
}
@ -160,14 +160,14 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
File grf(fileRoot);
if (grf.exists()) {
std::size_t dwFileSize =
PlatformFileIO.fileSize(grf.getPath());
PlatformFilesystem.fileSize(grf.getPath());
if (dwFileSize > 0) {
uint8_t* pbData =
(uint8_t*)new uint8_t[dwFileSize];
auto readResult = PlatformFileIO.readFile(
auto readResult = PlatformFilesystem.readFile(
grf.getPath(), pbData, dwFileSize);
if (readResult.status !=
IPlatformFileIO::ReadStatus::Ok) {
IPlatformFilesystem::ReadStatus::Ok) {
app.FatalLoadError();
}
@ -268,10 +268,10 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
} else {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(
ProfileManager.GetLockedProfile());
PlatformProfile.GetLockedProfile());
if (pNetworkPlayer == nullptr) {
MinecraftServer::HaltServer();
app.DebugPrintf("%d\n", ProfileManager.GetLockedProfile());
app.DebugPrintf("%d\n", PlatformProfile.GetLockedProfile());
// If the player is nullptr here then something went wrong in the
// session setup, and continuing will end up in a crash
return false;
@ -341,33 +341,33 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
if (connection->isStarted() && !connection->isClosed()) {
createdConnections.push_back(connection);
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
app.SetRichPresenceContext(primaryPad, CONTEXT_GAME_STATE_BLANK);
if (GetPlayerCount() >
1) // Are we offline or online, and how many players are there
{
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
// ALL OTHER LOCAL PLAYERS
for (int idx = 0; idx < XUSER_MAX_COUNT; ++idx) {
// Already have setup the primary pad
if (idx == ProfileManager.GetPrimaryPad()) continue;
if (idx == PlatformProfile.GetPrimaryPad()) continue;
if (GetLocalPlayerByUserIndex(idx) != nullptr &&
!ProfileManager.IsSignedIn(idx)) {
!PlatformProfile.IsSignedIn(idx)) {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(idx);
Socket* socket = pNetworkPlayer->GetSocket();
@ -396,13 +396,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
minecraft->addPendingLocalConnection(idx, connection);
// minecraft->createExtraLocalPlayer(idx, (convStringToWstring(
// ProfileManager.GetGamertag(idx) )).c_str(), idx, connection);
// PlatformProfile.GetGamertag(idx) )).c_str(), idx, connection);
// Open the socket on the server end to accept incoming data
Socket::addIncomingSocket(socket);
connection->send(std::shared_ptr<PreLoginPacket>(new PreLoginPacket(
convStringToWstring(ProfileManager.GetGamertag(idx)))));
convStringToWstring(PlatformProfile.GetGamertag(idx)))));
createdConnections.push_back(connection);
@ -427,11 +427,11 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
app.DebugPrintf("<***> %d %d %d %d %d\n", IsInSession(),
!connection->isStarted(),
!connection->isClosed(),
ProfileManager.IsSignedIn(idx),
PlatformProfile.IsSignedIn(idx),
!g_NetworkManager.IsLeavingGame());
// TODO - This SHOULD be something just like the code above but
// temporarily changing here so that we don't have to depend on
// the profilemanager behaviour
// the platformprofile behaviour
} while (IsInSession() && !connection->isStarted() &&
!connection->isClosed() &&
!g_NetworkManager.IsLeavingGame());
@ -443,13 +443,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
// get closed at the end of the thread
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) break;
if (ProfileManager.IsSignedIn(idx) && !connection->isClosed()) {
if (PlatformProfile.IsSignedIn(idx) && !connection->isClosed()) {
app.SetRichPresenceContext(idx, CONTEXT_GAME_STATE_BLANK);
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
idx, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
connection->close();
@ -639,13 +639,13 @@ CGameNetworkManager::eJoinGameResult CGameNetworkManager::JoinGame(
app.SetTutorialMode(false);
g_NetworkManager.SetLocalGame(false);
int primaryUserIndex = ProfileManager.GetLockedProfile();
int primaryUserIndex = PlatformProfile.GetLockedProfile();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
// Make sure that the Primary Pad is in by default
localUsersMask |= GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
localUsersMask |= GetLocalPlayerMask(PlatformProfile.GetPrimaryPad());
return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame(
searchResult, localUsersMask, primaryUserIndex));
@ -666,8 +666,8 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
if (bContinue == true) {
app.DebugPrintf("JoinFromInvite_SignInReturned, iPad %d\n", iPad);
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(iPad) &&
ProfileManager.IsSignedInLive(iPad)) {
if (PlatformProfile.IsSignedIn(iPad) &&
PlatformProfile.IsSignedInLive(iPad)) {
app.DebugPrintf(
"JoinFromInvite_SignInReturned, passed sign-in tests\n");
int localUsersMask = 0;
@ -675,9 +675,9 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
bool noPrivileges = false;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (PlatformProfile.IsSignedIn(index)) {
++joiningUsers;
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
localUsersMask |= GetLocalPlayerMask(index);
}
@ -701,24 +701,24 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
ProfileManager.SetLockedProfile(iPad);
ProfileManager.SetPrimaryPad(iPad);
PlatformProfile.SetLockedProfile(iPad);
PlatformProfile.SetPrimaryPad(iPad);
g_NetworkManager.SetLocalGame(false);
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
iPad, // dwUserIndex
@ -731,8 +731,8 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
} else {
app.DebugPrintf(
"JoinFromInvite_SignInReturned, failed sign-in tests :%d %d\n",
ProfileManager.IsSignedIn(iPad),
ProfileManager.IsSignedInLive(iPad));
PlatformProfile.IsSignedIn(iPad),
PlatformProfile.IsSignedInLive(iPad));
}
}
return 0;
@ -875,12 +875,12 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
pMinecraft->progressRenderer->progressStage(
IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME);
while (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) !=
while (app.GetXuiServerAction(PlatformProfile.GetPrimaryPad()) !=
eXuiServerAction_Idle &&
!MinecraftServer::serverHalted()) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)true);
// wait for the server to be in a non-ticking state
@ -937,7 +937,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
int localUsersMask = 0;
char numLocalPlayers = 0;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index) &&
if (PlatformProfile.IsSignedIn(index) &&
pMinecraft->localplayers[index] != nullptr) {
numLocalPlayers++;
localUsersMask |= GetLocalPlayerMask(index);
@ -956,7 +956,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
// Restore the network player of all the server players that are local
if (pServer != nullptr) {
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index) &&
if (PlatformProfile.IsSignedIn(index) &&
pMinecraft->localplayers[index] != nullptr) {
PlayerUID localPlayerXuid =
pMinecraft->localplayers[index]->getXuid();
@ -1008,7 +1008,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
// Start the game again
app.SetGameStarted(true);
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)false);
app.SetChangingSessionType(false);
app.SetReallyChangingSessionType(false);
@ -1048,13 +1048,13 @@ void CGameNetworkManager::StateChange_AnyToJoining() {
Minecraft::GetInstance()->clearPendingClientTextureRequests();
ConnectionProgressParams* param = new ConnectionProgressParams();
param->iPad = ProfileManager.GetPrimaryPad();
param->iPad = PlatformProfile.GetPrimaryPad();
param->stringId = -1;
param->showTooltips = false;
param->setFailTimer = true;
param->timerTime = CONNECTING_PROGRESS_CHECK_TIME;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_ConnectingProgress, param);
}
@ -1068,7 +1068,7 @@ void CGameNetworkManager::StateChange_JoiningToIdle(
case IPlatformNetwork::JOIN_FAILED_INSUFFICIENT_PRIVILEGES:
disconnectReason =
DisconnectPacket::eDisconnect_NoMultiplayerPrivilegesJoin;
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_FailedToJoinNoPrivileges);
break;
default:
@ -1077,7 +1077,7 @@ void CGameNetworkManager::StateChange_JoiningToIdle(
break;
};
Minecraft::GetInstance()->connectionDisconnected(
ProfileManager.GetPrimaryPad(), disconnectReason);
PlatformProfile.GetPrimaryPad(), disconnectReason);
}
void CGameNetworkManager::StateChange_AnyToStarting() {
@ -1091,10 +1091,10 @@ void CGameNetworkManager::StateChange_AnyToStarting() {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
}
@ -1106,7 +1106,7 @@ void CGameNetworkManager::StateChange_AnyToEnding(bool bStateWasPlaying) {
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(i);
if (pNetworkPlayer != nullptr && ProfileManager.IsSignedIn(i)) {
if (pNetworkPlayer != nullptr && PlatformProfile.IsSignedIn(i)) {
app.DebugPrintf(
"Stats save for an offline game for the player at index "
"%d\n",
@ -1127,7 +1127,7 @@ void CGameNetworkManager::StateChange_AnyToEnding(bool bStateWasPlaying) {
// The host has notified that the game is about to end
if (app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
app.SetDisconnectReason(DisconnectPacket::eDisconnect_Quitting);
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
}
}
@ -1221,17 +1221,17 @@ void CGameNetworkManager::PlayerJoining(INetworkPlayer* pNetworkPlayer) {
app.SetRichPresenceContext(iPad, CONTEXT_GAME_STATE_BLANK);
if (multiplayer) {
if (localgame)
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
if (localgame)
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
}
@ -1240,14 +1240,14 @@ void CGameNetworkManager::PlayerJoining(INetworkPlayer* pNetworkPlayer) {
void CGameNetworkManager::PlayerLeaving(INetworkPlayer* pNetworkPlayer) {
if (pNetworkPlayer->IsLocal()) {
ProfileManager.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),
PlatformProfile.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),
CONTEXT_PRESENCE_IDLE, false);
}
}
void CGameNetworkManager::HostChanged() {
// Disable host migration
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
}
@ -1263,7 +1263,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
bool noPrivileges = false;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (PlatformProfile.IsSignedIn(index)) {
// 4J-PB we shouldn't bring any inactive players into the game,
// except for the invited player (who may be an inactive player) 4J
// Stu - If we are not in a game, then bring in all players signed
@ -1271,7 +1271,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
if (index == userIndex ||
pMinecraft->localplayers[index] != nullptr) {
++joiningUsers;
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
localUsersMask |= GetLocalPlayerMask(index);
}
@ -1284,8 +1284,8 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
bool bContentRestricted = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
if (noUGC) {
@ -1301,9 +1301,9 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
// 4J-PB - it's possible there is no primary pad here, when accepting an
// invite from the dashboard
// StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
// PlatformStorage.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
// IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
// uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr,
// uiIDA,1,PlatformProfile.GetPrimaryPad(),nullptr,nullptr,
// app.GetStringTable());
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
@ -1336,7 +1336,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// We are in the root menus somewhere
{
ProfileManager.SetPrimaryPad(userIndex);
PlatformProfile.SetPrimaryPad(userIndex);
// 4J Stu - If we accept an invite from the main menu before going to
// play game we need to load the DLC These checks are done within the
@ -1348,11 +1348,11 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// stuck in a soft-locked state after selecting the guest account when
// prompted The locked profile should not be changed if we are in menus
// as the main player might sign out in the sign-in ui
// ProfileManager.SetLockedProfile(-1);
// PlatformProfile.SetLockedProfile(-1);
if (!app.IsLocalMultiplayerAvailable()) {
bool noPrivileges =
!ProfileManager.AllowedToPlayMultiplayer(userIndex);
!PlatformProfile.AllowedToPlayMultiplayer(userIndex);
if (noPrivileges) {
unsigned int uiIDA[1];
@ -1360,10 +1360,10 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
ProfileManager.SetLockedProfile(userIndex);
ProfileManager.SetPrimaryPad(userIndex);
PlatformProfile.SetLockedProfile(userIndex);
PlatformProfile.SetPrimaryPad(userIndex);
int localUsersMask = 0;
localUsersMask |= GetLocalPlayerMask(userIndex);
@ -1371,7 +1371,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
@ -1380,7 +1380,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
userIndex, localUsersMask, pInviteInfo);
@ -1398,7 +1398,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
};
info.requireOnline = true;
app.DebugPrintf("Using fullscreen layer\n");
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info, eUILayer_Alert,
eUIGroup_Fullscreen);
}
@ -1426,23 +1426,23 @@ void CGameNetworkManager::HandleDisconnect(bool bLostRoomOnly) {
}
int CGameNetworkManager::GetPrimaryPad() {
return ProfileManager.GetPrimaryPad();
return PlatformProfile.GetPrimaryPad();
}
int CGameNetworkManager::GetLockedProfile() {
return ProfileManager.GetLockedProfile();
return PlatformProfile.GetLockedProfile();
}
bool CGameNetworkManager::IsSignedInLive(int playerIdx) {
return ProfileManager.IsSignedInLive(playerIdx);
return PlatformProfile.IsSignedInLive(playerIdx);
}
bool CGameNetworkManager::AllowedToPlayMultiplayer(int playerIdx) {
return ProfileManager.AllowedToPlayMultiplayer(playerIdx);
return PlatformProfile.AllowedToPlayMultiplayer(playerIdx);
}
char* CGameNetworkManager::GetOnlineName(int playerIdx) {
return ProfileManager.GetGamertag(playerIdx);
return PlatformProfile.GetGamertag(playerIdx);
}
void CGameNetworkManager::ServerReadyCreate(bool create) {
@ -1501,16 +1501,16 @@ void CGameNetworkManager::ServerStoppedWait() {
if (C4JThread::isMainThread()) {
int result = C4JThread::WaitResult::Timeout;
do {
RenderManager.StartFrame();
PlatformRenderer.StartFrame();
result = m_hServerStoppedEvent->waitForSignal(20);
// Tick some simple things
ProfileManager.Tick();
StorageManager.Tick();
InputManager.Tick();
RenderManager.Tick();
PlatformProfile.Tick();
PlatformStorage.Tick();
PlatformInput.Tick();
PlatformRenderer.Tick();
ui.tick();
ui.render();
RenderManager.Present();
PlatformRenderer.Present();
} while (result == C4JThread::WaitResult::Timeout);
} else {
if (m_hServerStoppedEvent != nullptr) {

View file

@ -1,5 +1,9 @@
#include "app/common/NetworkController.h"
#include <chrono>
#include <cstring>
#include <thread>
#include "app/common/Game.h"
#include "app/common/Network/GameNetworkManager.h"
#include "app/linux/LinuxGame.h"
@ -13,18 +17,10 @@
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "minecraft/server/MinecraftServer.h"
#include "minecraft/stats/StatsCounter.h"
#include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "app/common/Audio/SoundEngine.h"
#include <cstring>
#include <chrono>
#include <thread>
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
unsigned int NetworkController::m_uiLastSignInData = 0;
@ -39,9 +35,8 @@ NetworkController::NetworkController() {
memset(m_playerGamePrivileges, 0, sizeof(m_playerGamePrivileges));
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
if (FAILED(XUserGetSigninInfo(i,
XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY,
&m_currentSigninInfo[i]))) {
if (XUserGetSigninInfo(i, XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY,
&m_currentSigninInfo[i]) < 0) {
m_currentSigninInfo[i].xuid = INVALID_XUID;
m_currentSigninInfo[i].dwGuestNumber = 0;
}
@ -97,7 +92,7 @@ void NetworkController::processInvite(std::uint32_t dwUserIndex,
}
int NetworkController::primaryPlayerSignedOutReturned(
void* pParam, int iPad, const C4JStorage::EMessageResult) {
void* pParam, int iPad, const IPlatformStorage::EMessageResult) {
if (g_NetworkManager.IsInSession()) {
app.SetAction(iPad, eAppAction_PrimaryPlayerSignedOutReturned);
} else {
@ -107,7 +102,7 @@ int NetworkController::primaryPlayerSignedOutReturned(
}
int NetworkController::ethernetDisconnectReturned(
void* pParam, int iPad, const C4JStorage::EMessageResult) {
void* pParam, int iPad, const IPlatformStorage::EMessageResult) {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (Minecraft::GetInstance()->player != nullptr) {
@ -121,7 +116,7 @@ int NetworkController::ethernetDisconnectReturned(
void NetworkController::profileReadErrorCallback(void* pParam) {
Game* pApp = (Game*)pParam;
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
pApp->SetAction(iPrimaryPlayer, eAppAction_ProfileReadError);
}
@ -219,7 +214,7 @@ int NetworkController::signoutExitWorldThreadProc(void* lpParameter) {
}
void NetworkController::clearSignInChangeUsersMask() {
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
if (m_uiLastSignInData != 0) {
if (iPrimaryPlayer >= 0) {
@ -234,14 +229,14 @@ void NetworkController::signInChangeCallback(void* pParam,
bool bPrimaryPlayerChanged,
unsigned int uiSignInData) {
Game* pApp = (Game*)pParam;
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
if ((ProfileManager.GetLockedProfile() != -1) && iPrimaryPlayer != -1) {
if ((PlatformProfile.GetLockedProfile() != -1) && iPrimaryPlayer != -1) {
if (((uiSignInData & (1 << iPrimaryPlayer)) == 0) ||
bPrimaryPlayerChanged) {
pApp->SetAction(iPrimaryPlayer, eAppAction_PrimaryPlayerSignedOut);
pApp->InvalidateBannedList(iPrimaryPlayer);
StorageManager.ClearDLCOffers();
PlatformStorage.ClearDLCOffers();
pApp->ClearAndResetDLCDownloadQueue();
pApp->ClearDLCInstalled();
} else {
@ -251,7 +246,7 @@ void NetworkController::signInChangeCallback(void* pParam,
bool hasGuestIdChanged = false;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
unsigned int guestNumber = 0;
if (ProfileManager.IsSignedIn(i)) {
if (PlatformProfile.IsSignedIn(i)) {
XUSER_SIGNIN_INFO info;
XUserGetSigninInfo(
i, XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY, &info);
@ -274,12 +269,12 @@ void NetworkController::signInChangeCallback(void* pParam,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_GUEST_ORDER_CHANGED_TITLE,
IDS_GUEST_ORDER_CHANGED_TEXT, uiIDA,
1, ProfileManager.GetPrimaryPad());
1, PlatformProfile.GetPrimaryPad());
}
bool switchToOffline = false;
if (!ProfileManager.IsSignedInLive(
ProfileManager.GetLockedProfile()) &&
if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetLockedProfile()) &&
!g_NetworkManager.IsLocalGame()) {
switchToOffline = true;
}
@ -308,12 +303,11 @@ void NetworkController::signInChangeCallback(void* pParam,
if (bPlayerChanged &&
(!bPlayerSignedIn ||
(bPlayerSignedIn &&
!ProfileManager.AreXUIDSEqual(
pApp->m_networkController
.m_currentSigninInfo[i]
.xuid,
info.xuid)))) {
(bPlayerSignedIn && !PlatformProfile.AreXUIDSEqual(
pApp->m_networkController
.m_currentSigninInfo[i]
.xuid,
info.xuid)))) {
pApp->DebugPrintf(
"Player at index %d Left - invalidating their "
"banned list\n",
@ -338,8 +332,8 @@ void NetworkController::signInChangeCallback(void* pParam,
g_NetworkManager.HandleSignInChange();
} else if (pApp->GetLiveLinkRequired() &&
!ProfileManager.IsSignedInLive(
ProfileManager.GetLockedProfile())) {
!PlatformProfile.IsSignedInLive(
PlatformProfile.GetLockedProfile())) {
{
pApp->SetAction(iPrimaryPlayer,
eAppAction_EthernetDisconnected);
@ -349,15 +343,15 @@ void NetworkController::signInChangeCallback(void* pParam,
m_uiLastSignInData = uiSignInData;
} else if (iPrimaryPlayer != -1) {
pApp->InvalidateBannedList(iPrimaryPlayer);
StorageManager.ClearDLCOffers();
PlatformStorage.ClearDLCOffers();
pApp->ClearAndResetDLCDownloadQueue();
pApp->ClearDLCInstalled();
}
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (FAILED(XUserGetSigninInfo(
if (XUserGetSigninInfo(
i, XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY,
&pApp->m_networkController.m_currentSigninInfo[i]))) {
&pApp->m_networkController.m_currentSigninInfo[i]) < 0) {
pApp->m_networkController.m_currentSigninInfo[i].xuid =
INVALID_XUID;
pApp->m_networkController.m_currentSigninInfo[i].dwGuestNumber = 0;
@ -384,7 +378,7 @@ void NetworkController::notificationsCallback(void* pParam,
case XN_SYS_INPUTDEVICESCHANGED:
if (app.GetGameStarted() && g_NetworkManager.IsInSession()) {
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (!InputManager.IsPadConnected(i) &&
if (!PlatformInput.IsPadConnected(i) &&
Minecraft::GetInstance()->localplayers[i] != nullptr &&
!ui.IsPauseMenuDisplayed(i) &&
!ui.IsSceneInStack(i, eUIScene_EndPoem)) {
@ -396,7 +390,7 @@ void NetworkController::notificationsCallback(void* pParam,
break;
case XN_LIVE_CONTENT_INSTALLED: {
app.ClearDLCInstalled();
ui.HandleDLCInstalled(ProfileManager.GetPrimaryPad());
ui.HandleDLCInstalled(PlatformProfile.GetPrimaryPad());
} break;
case XN_SYS_STORAGEDEVICESCHANGED: {
} break;
@ -410,10 +404,10 @@ void NetworkController::liveLinkChangeCallback(void* pParam, bool bConnected) {
}
int NetworkController::exitAndJoinFromInvite(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
Game* pApp = (Game*)pParam;
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
pApp->SetAction(iPad, eAppAction_ExitAndJoinFromInviteConfirmed);
}
@ -421,11 +415,11 @@ int NetworkController::exitAndJoinFromInvite(
}
int NetworkController::exitAndJoinFromInviteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
Game* pClass = (Game*)pParam;
if (result == C4JStorage::EMessage_ResultDecline ||
result == C4JStorage::EMessage_ResultThirdOption) {
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline ||
result == IPlatformStorage::EMessage_ResultThirdOption) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
if (!Minecraft::GetInstance()->skins->isUsingDefaultSkin()) {
TexturePack* tPack =
Minecraft::GetInstance()->skins->getSelected();
@ -446,14 +440,14 @@ int NetworkController::exitAndJoinFromInviteSaveDialogReturned(
}
}
bool bSaveExists;
StorageManager.DoesSaveExist(&bSaveExists);
PlatformStorage.DoesSaveExist(&bSaveExists);
if (bSaveExists) {
unsigned int uiIDA[2];
uiIDA[0] = IDS_CONFIRM_CANCEL;
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&NetworkController::exitAndJoinFromInviteAndSaveReturned,
pClass);
return 0;
@ -466,26 +460,26 @@ int NetworkController::exitAndJoinFromInviteSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME,
uiIDA, 2, ProfileManager.GetPrimaryPad(),
uiIDA, 2, PlatformProfile.GetPrimaryPad(),
&NetworkController::exitAndJoinFromInviteDeclineSaveReturned,
pClass);
return 0;
}
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_ExitAndJoinFromInviteConfirmed);
}
return 0;
}
int NetworkController::warningTrialTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return 0;
}
int NetworkController::exitAndJoinFromInviteAndSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
if (result == C4JStorage::EMessage_ResultDecline) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
if (!Minecraft::GetInstance()->skins->isUsingDefaultSkin()) {
TexturePack* tPack = Minecraft::GetInstance()->skins->getSelected();
DLCPack* pDLCPack = tPack->getDLCPack();
@ -509,8 +503,8 @@ int NetworkController::exitAndJoinFromInviteAndSaveReturned(
}
int NetworkController::exitAndJoinFromInviteDeclineSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
if (result == C4JStorage::EMessage_ResultDecline) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
MinecraftServer::getInstance()->setSaveOnExit(false);
app.SetAction(iPad, eAppAction_ExitAndJoinFromInviteConfirmed);
}

View file

@ -4,7 +4,7 @@
#include "app/common/App_structs.h"
#include "platform/NetTypes.h"
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h"
#include "minecraft/network/packet/DisconnectPacket.h"
@ -33,9 +33,9 @@ public:
static void clearSignInChangeUsersMask();
static int signoutExitWorldThreadProc(void* lpParameter);
static int primaryPlayerSignedOutReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult);
const IPlatformStorage::EMessageResult);
static int ethernetDisconnectReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult);
const IPlatformStorage::EMessageResult);
static void profileReadErrorCallback(void* pParam);
// Notifications
@ -51,15 +51,15 @@ public:
std::uint32_t dwLocalUsersMask,
const INVITE_INFO* pInviteInfo);
static int exitAndJoinFromInvite(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int exitAndJoinFromInviteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int exitAndJoinFromInviteAndSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int exitAndJoinFromInviteDeclineSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int warningTrialTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
// Disconnect
DisconnectPacket::eDisconnectReason getDisconnectReason() {

View file

@ -6,7 +6,7 @@
#include "app/common/Game.h"
#include "app/common/Network/GameNetworkManager.h"
#include "minecraft/server/MinecraftServer.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
void SaveManager::setAutosaveTimerTime(int settingValue) {
m_uiAutosaveTimer =
@ -35,7 +35,7 @@ void SaveManager::lock() {
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)true);
}
@ -54,7 +54,7 @@ void SaveManager::unlock() {
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)false);
}

View file

@ -17,7 +17,7 @@
#include "minecraft/client/renderer/entity/EntityRenderer.h"
#include "minecraft/client/renderer/entity/EntityRenderDispatcher.h"
#include "minecraft/world/entity/player/Player.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
SkinManager::SkinManager() : m_xuidNotch(INVALID_XUID) {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
@ -183,7 +183,7 @@ void SkinManager::validateFavoriteSkins(int iPad,
bool SkinManager::isXuidNotch(PlayerUID xuid) {
if (m_xuidNotch != INVALID_XUID && xuid != INVALID_XUID) {
return ProfileManager.AreXUIDSEqual(xuid, m_xuidNotch);
return PlatformProfile.AreXUIDSEqual(xuid, m_xuidNotch);
}
return false;
}

View file

@ -1,7 +1,6 @@
#include "InputConstraint.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
bool InputConstraint::isMappingConstrained(int iPad, int mapping) {
// If it's a menu button, then we ignore all inputs
@ -10,11 +9,11 @@ bool InputConstraint::isMappingConstrained(int iPad, int mapping) {
}
// Otherwise see if they map to the same actual button
unsigned char layoutMapping = InputManager.GetJoypadMapVal(iPad);
unsigned char layoutMapping = PlatformInput.GetJoypadMapVal(iPad);
// 4J HEG - Replaced the equivalance test with bitwise AND, important in
// some mapping configurations (e.g. when comparing two action map values
// and one has extra buttons mapped)
return (InputManager.GetGameJoypadMaps(layoutMapping, m_inputMapping) &
InputManager.GetGameJoypadMaps(layoutMapping, mapping)) > 0;
return (PlatformInput.GetGameJoypadMaps(layoutMapping, m_inputMapping) &
PlatformInput.GetGameJoypadMaps(layoutMapping, mapping)) > 0;
}

View file

@ -3,7 +3,6 @@
#include <string>
#include <vector>
#include "platform/InputActions.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/Tutorial/Constraints/AreaConstraint.h"
#include "app/common/Tutorial/Constraints/ChangeStateConstraint.h"
@ -32,6 +31,7 @@
#include "minecraft/world/level/LevelSettings.h"
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/phys/AABB.h"
#include "platform/input/InputConstants.h"
#include "strings.h"
class TutorialConstraint;

View file

@ -3,7 +3,7 @@
#include <memory>
#include <vector>
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
#include "app/common/Tutorial/Constraints/InputConstraint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "app/common/Tutorial/Tutorial.h"
@ -54,12 +54,12 @@ bool ChoiceTask::isCompleted() {
return false;
if (!m_bConfirmMappingComplete &&
InputManager.GetValue(pMinecraft->player->GetXboxPad(),
PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
m_iConfirmMapping) > 0) {
m_bConfirmMappingComplete = true;
}
if (!m_bCancelMappingComplete &&
InputManager.GetValue(pMinecraft->player->GetXboxPad(),
PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
m_iCancelMapping) > 0) {
m_bCancelMappingComplete = true;
}

View file

@ -6,7 +6,7 @@
#include <utility>
#include <vector>
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Constraints/InputConstraint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
@ -81,7 +81,7 @@ bool ControllerTask::isCompleted() {
for (auto it = southpawCompletedMappings.begin();
it != southpawCompletedMappings.end(); ++it) {
if (!it->second) {
if (InputManager.GetValue(pMinecraft->player->GetXboxPad(),
if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
it->first) > 0) {
it->second = true;
m_uiCompletionMask |= 1 << iCurrent;
@ -95,7 +95,7 @@ bool ControllerTask::isCompleted() {
for (auto it = completedMappings.begin(); it != completedMappings.end();
++it) {
if (!it->second) {
if (InputManager.GetValue(pMinecraft->player->GetXboxPad(),
if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
it->first) > 0) {
it->second = true;
m_uiCompletionMask |= 1 << iCurrent;

View file

@ -5,7 +5,7 @@
#include <utility>
#include <vector>
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
#include "app/common/Tutorial/Constraints/InputConstraint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "app/common/Tutorial/Tutorial.h"
@ -63,7 +63,7 @@ bool InfoTask::isCompleted() {
++it) {
bool current = (*it).second;
if (!current) {
if (InputManager.GetValue(pMinecraft->player->GetXboxPad(),
if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
(*it).first) > 0) {
(*it).second = true;
bAllComplete = true;

View file

@ -1,6 +1,6 @@
#include "StatTask.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/stats/StatsCounter.h"
@ -14,7 +14,7 @@ StatTask::StatTask(Tutorial* tutorial, int descriptionId,
Minecraft* minecraft = Minecraft::GetInstance();
targetValue =
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) +
minecraft->stats[PlatformProfile.GetPrimaryPad()]->getTotalValue(stat) +
variance;
}
@ -23,7 +23,7 @@ bool StatTask::isCompleted() {
Minecraft* minecraft = Minecraft::GetInstance();
bIsCompleted =
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) >=
minecraft->stats[PlatformProfile.GetPrimaryPad()]->getTotalValue(stat) >=
(unsigned int)targetValue;
return bIsCompleted;
}

View file

@ -6,8 +6,7 @@
#include <algorithm>
#include <compare>
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h"
#include "app/common/Tutorial/Constraints/TutorialConstraint.h"
@ -1969,7 +1968,7 @@ Tutorial::~Tutorial() {
void Tutorial::debugResetPlayerSavedProgress(int iPad) {
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(iPad);
memset(pGameSettings->ucTutorialCompletion, 0,
TUTORIAL_PROFILE_STORAGE_BYTES);
pGameSettings->uiSpecialTutorialBitmask = 0;
@ -1994,7 +1993,7 @@ void Tutorial::setCompleted(int completableId) {
completableIndex < TUTORIAL_PROFILE_STORAGE_BITS) {
// Set the bit for this position
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(m_iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(m_iPad);
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);
pGameSettings->ucTutorialCompletion[arrayIndex] |= 1 << bitIndex;
@ -2023,7 +2022,7 @@ bool Tutorial::getCompleted(int completableId) {
// Read the bit for this position
// Retrieve the data pointer from the profile
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(m_iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(m_iPad);
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);
return (pGameSettings->ucTutorialCompletion[arrayIndex] &

View file

@ -7,7 +7,7 @@
#include "app/linux/LinuxGame.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "platform/PlatformServices.h"
#include "platform/fs/fs.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/InputOutputStream/ByteArrayInputStream.h"
#include "java/InputOutputStream/DataInputStream.h"
@ -102,7 +102,7 @@ std::vector<uint8_t> ArchiveFile::getFile(const std::wstring& filename) {
app.DebugPrintf("Failed to find file '%ls' in archive\n",
filename.c_str());
#if !defined(_CONTENT_PACKAGE)
__debugbreak();
assert(0);
#endif
app.FatalLoadError();
} else {
@ -117,11 +117,11 @@ std::vector<uint8_t> ArchiveFile::getFile(const std::wstring& filename) {
std::uint8_t* pbData = new std::uint8_t[fileSize == 0 ? 1 : fileSize];
out = std::vector<uint8_t>(pbData, pbData + fileSize);
auto readResult =
PlatformFileIO.readFileSegment(
PlatformFilesystem.readFileSegment(
m_sourcefile.getPath(), static_cast<std::size_t>(data->ptr),
out.data(), static_cast<std::size_t>(data->filesize));
if (readResult.status != IPlatformFileIO::ReadStatus::Ok) {
if (readResult.status != IPlatformFilesystem::ReadStatus::Ok) {
app.DebugPrintf("Failed to read archive file segment\n");
app.FatalLoadError();
}

View file

@ -1,6 +1,6 @@
#pragma once
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "UIEnums.h"
#include "UIStructs.h"
#include "minecraft/sounds/SoundTypes.h"
@ -82,7 +82,7 @@ public:
virtual void ShowAutosaveCountdownTimer(bool show) = 0;
virtual void UpdateAutosaveCountdownTimer(unsigned int uiSeconds) = 0;
virtual void ShowSavingMessage(unsigned int iPad,
C4JStorage::ESavingMessage eVal) = 0;
IPlatformStorage::ESavingMessage eVal) = 0;
virtual bool PressStartPlaying(unsigned int iPad) = 0;
virtual void ShowPressStart(unsigned int iPad) = 0;

View file

@ -7,9 +7,8 @@
#include <string>
#include <vector>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Render.h"
#include "platform/input/input.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialMode.h"
@ -263,11 +262,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick() {
bool bStickInput = false;
float fInputX =
InputManager.GetJoypadStick_LX(iPad, false) *
PlatformInput.GetJoypadStick_LX(iPad, false) *
((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu) /
100.0f); // apply the sensitivity
float fInputY =
InputManager.GetJoypadStick_LY(iPad, false) *
PlatformInput.GetJoypadStick_LY(iPad, false) *
((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu) /
100.0f); // apply the sensitivity
@ -329,7 +328,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() {
// 4J Stu - The cursor moves too fast in SD mode
// The SD/splitscreen scenes are approximately 0.6 times the size of
// the fullscreen on
if (!RenderManager.IsHiDef() || app.GetLocalPlayerCount() > 1)
if (!PlatformRenderer.IsHiDef() || app.GetLocalPlayerCount() > 1)
fInputScale *= 0.6f;
fInputX *= fInputScale;

View file

@ -7,16 +7,13 @@
#include <string>
#include <vector>
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "minecraft/GameEnums.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "minecraft/GameEnums.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerGameMode.h"
#include "minecraft/client/player/LocalPlayer.h"
@ -28,6 +25,8 @@
#include "minecraft/world/item/crafting/Recipes.h"
#include "minecraft/world/item/crafting/ShapedRecipy.h"
#include "minecraft/world/level/tile/Tile.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "strings.h"
Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA
@ -199,7 +198,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) {
// Force a make if the debug is on
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(
ProfileManager.GetPrimaryPad()) &
PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
if (CanBeMadeA[m_iCurrentSlotHIndex].iCount != 0) {
int iSlot = iVSlotIndexA[m_iCurrentSlotVIndex];
@ -481,7 +480,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) {
// Vita)
bool bNoScrollSlots = false;
if (m_bSplitscreen ||
(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())) {
(!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen())) {
bNoScrollSlots = true;
}
@ -876,7 +875,8 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
} else {
app.DebugPrintf("Need more H slots - ");
#if !defined(_CONTENT_PACKAGE)
OutputDebugStringW(
fwprintf(
stderr,
app.GetString(pTempItemInst->getDescriptionId()));
#endif
app.DebugPrintf("\n");
@ -907,7 +907,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
unsigned int uiAlpha;
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
uiAlpha = 31;
} else {
@ -1035,7 +1035,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() {
// splits & Vita)
bool bNoScrollSlots = false;
if (m_bSplitscreen ||
(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())) {
(!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen())) {
bNoScrollSlots = true;
}
@ -1054,7 +1054,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() {
unsigned int uiAlpha;
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
uiAlpha = 31;
} else {
@ -1171,7 +1171,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() {
setCraftingOutputSlotItem(getPad(), pTempItemInst);
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
setCraftingOutputSlotRedBox(false);
} else {
@ -1212,7 +1212,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() {
// recipe
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(
ProfileManager.GetPrimaryPad()) &
PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
setIngredientSlotRedBox(index, false);
} else {
@ -1314,8 +1314,8 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade) {
// 12 for splitscreen, 14 for normal
EHTMLFontSize size = eHTMLSize_Normal;
if (m_bSplitscreen ||
(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())) {
if (m_bSplitscreen || (!PlatformRenderer.IsHiDef() &&
!PlatformRenderer.IsWidescreen())) {
size = eHTMLSize_Splitscreen;
}
wchar_t startTags[64];

View file

@ -6,7 +6,6 @@
#include <string>
#include <vector>
#include "platform/InputActions.h"
#include "app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
@ -879,7 +878,7 @@ void IUIScene_CreativeMenu::staticCtor() {
// Just use the text LT - the graphic doesn't fit in splitscreen either
// In 480p there's not enough room for the LT button, so use text instead
// if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
// if(!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen())
{
specs[eCreativeInventoryTab_Brewing] =
new TabSpec(L"Brewing", IDS_GROUPNAME_POTIONS_480, 5, brewingGroup);

View file

@ -3,8 +3,8 @@
#include <cmath>
#include <memory>
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
@ -70,17 +70,17 @@ void IUIScene_HUD::updateFrameTick() {
int iGuiScale;
if (pMinecraft->localplayers[iPad]->m_iScreenSection ==
C4JRender::VIEWPORT_TYPE_FULLSCREEN) {
IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN) {
iGuiScale = app.GetGameSettings(iPad, eGameSetting_UISize);
} else {
iGuiScale = app.GetGameSettings(iPad, eGameSetting_UISizeSplitscreen);
}
SetHudSize(iGuiScale);
SetDisplayName(ProfileManager.GetDisplayName(iPad));
SetDisplayName(PlatformProfile.GetDisplayName(iPad));
SetTooltipsEnabled(((ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) ||
(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
SetTooltipsEnabled(((ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad())) ||
(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_Tooltips) != 0)));
SetActiveSlot(pMinecraft->localplayers[iPad]->inventory->selected);
@ -137,7 +137,7 @@ void IUIScene_HUD::updateFrameTick() {
}
}
unsigned char ucAlpha = app.GetGameSettings(ProfileManager.GetPrimaryPad(),
unsigned char ucAlpha = app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_InterfaceOpacity);
float fVal;

View file

@ -9,7 +9,7 @@
#include <thread>
#include <vector>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
@ -32,12 +32,12 @@
class TexturePack;
int IUIScene_PauseMenu::ExitGameDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_PauseMenu* pScene = dynamic_cast<IUIScene_PauseMenu*>(
ui.GetSceneFromCallbackId((std::size_t)pParam));
// Results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
if (pScene) pScene->SetIgnoreInput(true);
app.SetAction(iPad, eAppAction_ExitWorld);
}
@ -45,15 +45,15 @@ int IUIScene_PauseMenu::ExitGameDialogReturned(
}
int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_PauseMenu* pScene = dynamic_cast<IUIScene_PauseMenu*>(
ui.GetSceneFromCallbackId((std::size_t)pParam));
// Exit with or without saving
// Decline means save in this dialog
if (result == C4JStorage::EMessage_ResultDecline ||
result == C4JStorage::EMessage_ResultThirdOption) {
if (result == C4JStorage::EMessage_ResultDecline) // Save
if (result == IPlatformStorage::EMessage_ResultDecline ||
result == IPlatformStorage::EMessage_ResultThirdOption) {
if (result == IPlatformStorage::EMessage_ResultDecline) // Save
{
// 4J-PB - Is the player trying to save but they are using a trial
// texturepack ?
@ -76,7 +76,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
ui.RequestAlertMessage(
IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::WarningTrialTexturePackReturned,
pParam);
@ -86,7 +86,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
// does the save exist?
bool bSaveExists;
StorageManager.DoesSaveExist(&bSaveExists);
PlatformStorage.DoesSaveExist(&bSaveExists);
// 4J-PB - we check if the save exists inside the libs
// we need to ask if they are sure they want to overwrite the
// existing game
@ -96,7 +96,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameAndSaveReturned, pParam);
return 0;
} else {
@ -109,7 +109,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(
IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME,
uiIDA, 2, ProfileManager.GetPrimaryPad(),
uiIDA, 2, PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameDeclineSaveReturned, pParam);
return 0;
}
@ -122,17 +122,17 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
}
int IUIScene_PauseMenu::ExitGameAndSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
// 4J-PB - we won't come in here if we have a trial texture pack
IUIScene_PauseMenu* pScene = dynamic_cast<IUIScene_PauseMenu*>(
ui.GetSceneFromCallbackId((std::size_t)pParam));
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// int32_t saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// PlatformStorage.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
if (pScene) pScene->SetIgnoreInput(true);
MinecraftServer::getInstance()->setSaveOnExit(true);
@ -141,7 +141,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
} else {
// has someone disconnected the ethernet here, causing the pause menu to
// shut?
if (ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) {
if (ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad())) {
unsigned int uiIDA[3];
// you cancelled the save on exit after choosing exit and save? You
// go back to the Exit choices then.
@ -153,12 +153,12 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
ui.RequestAlertMessage(
IDS_EXIT_GAME,
IDS_CONFIRM_EXIT_GAME_CONFIRM_DISCONNECT_SAVE, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
} else {
ui.RequestAlertMessage(
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
@ -167,12 +167,12 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
}
int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_PauseMenu* pScene = dynamic_cast<IUIScene_PauseMenu*>(
ui.GetSceneFromCallbackId((std::size_t)pParam));
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
if (pScene) pScene->SetIgnoreInput(true);
MinecraftServer::getInstance()->setSaveOnExit(false);
// flag a app action of exit game
@ -180,7 +180,7 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
} else {
// has someone disconnected the ethernet here, causing the pause menu to
// shut?
if (ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) {
if (ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad())) {
unsigned int uiIDA[3];
// you cancelled the save on exit after choosing exit and save? You
// go back to the Exit choices then.
@ -192,12 +192,12 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
ui.RequestAlertMessage(
IDS_EXIT_GAME,
IDS_CONFIRM_EXIT_GAME_CONFIRM_DISCONNECT_SAVE, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
} else {
ui.RequestAlertMessage(
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
@ -206,17 +206,17 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
}
int IUIScene_PauseMenu::WarningTrialTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return 0;
}
int IUIScene_PauseMenu::SaveWorldThreadProc(void* lpParameter) {
bool bAutosave = (bool)lpParameter;
if (bAutosave) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_AutoSaveGame);
} else {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SaveGame);
}
@ -230,7 +230,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc(void* lpParameter) {
app.SetGameStarted(false);
while (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) !=
while (app.GetXuiServerAction(PlatformProfile.GetPrimaryPad()) !=
eXuiServerAction_Idle &&
!MinecraftServer::serverHalted()) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
@ -272,7 +272,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
if (pMinecraft->isClientSide() || g_NetworkManager.IsInSession()) {
if (lpParameter != nullptr) {
// 4J-PB - check if we have lost connection to Live
// if (ProfileManager.GetLiveConnectionStatus() !=
// if (PlatformProfile.GetLiveConnectionStatus() !=
// XONLINE_S_LOGON_CONNECTION_ESTABLISHED) {
// exitReasonStringId = IDS_CONNECTION_LOST_LIVE;
// } else {
@ -336,10 +336,10 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
// that is most likely the cause of the disconnection so don't
// display a message box. This will allow the message box requested
// by the libraries to be brought up
if (ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()))
if (PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad()))
ui.RequestErrorMessage(exitReasonTitleId, exitReasonStringId,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
// 4J - Force a disconnection, this handles the situation that the
@ -375,7 +375,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
g_NetworkManager.LeaveGame(false);
} else {
if (lpParameter != nullptr &&
ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad())) {
switch (app.GetDisconnectReason()) {
case DisconnectPacket::eDisconnect_Kicked:
exitReasonStringId = IDS_DISCONNECTED_KICKED;
@ -417,7 +417,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(exitReasonTitleId, exitReasonStringId, uiIDA,
1, ProfileManager.GetPrimaryPad());
1, PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
}
}
@ -452,9 +452,9 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
}
int IUIScene_PauseMenu::SaveGameDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// flag a app action of save game
app.SetAction(iPad, eAppAction_SaveGame);
}
@ -462,9 +462,9 @@ int IUIScene_PauseMenu::SaveGameDialogReturned(
}
int IUIScene_PauseMenu::EnableAutosaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// Set the global flag, so that we don't disable saving again once the
// save is complete
app.SetGameHostOption(eGameHostOption_DisableSaving, 0);
@ -475,7 +475,7 @@ int IUIScene_PauseMenu::EnableAutosaveDialogReturned(
app.SetGameHostOption(eGameHostOption_DisableSaving, 1);
}
// Re-enable saving temporarily
StorageManager.SetSaveDisabled(false);
PlatformStorage.SetSaveDisabled(false);
// flag a app action of save game
app.SetAction(iPad, eAppAction_SaveGame);
@ -483,13 +483,13 @@ int IUIScene_PauseMenu::EnableAutosaveDialogReturned(
}
int IUIScene_PauseMenu::DisableAutosaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// Set the global flag, so that we disable saving again once the save is
// complete
app.SetGameHostOption(eGameHostOption_DisableSaving, 1);
StorageManager.SetSaveDisabled(false);
PlatformStorage.SetSaveDisabled(false);
// flag a app action of save game
app.SetAction(iPad, eAppAction_SaveGame);

View file

@ -1,7 +1,7 @@
#pragma once
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Storage.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "app/common/DLC/DLCPack.h"
class DLCPack;
@ -12,21 +12,21 @@ protected:
public:
static int ExitGameDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int ExitGameSaveDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int ExitGameAndSaveReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int ExitGameDeclineSaveReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int WarningTrialTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int SaveGameDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int EnableAutosaveDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int DisableAutosaveDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int SaveWorldThreadProc(void* lpParameter);
static int ExitWorldThreadProc(void* lpParameter);

View file

@ -4,7 +4,6 @@
#include <algorithm>
#include "platform/InputActions.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/linux/LinuxGame.h"

View file

@ -6,7 +6,7 @@
#include <cstring>
#include <functional>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/App_Defines.h"
#include "UIEnums.h"
#include "platform/C4JThread.h"
@ -397,7 +397,7 @@ typedef struct _MessageBoxInfo {
uint32_t* uiOptionA;
uint32_t uiOptionC;
uint32_t dwPad;
int (*Func)(void*, int, const C4JStorage::EMessageResult);
int (*Func)(void*, int, const IPlatformStorage::EMessageResult);
void* lpParam;
// C4JStringTable *pStringTable; // 4J Stu - We don't need this for our
// internal message boxes

View file

@ -2,7 +2,7 @@
#include <memory>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_Label.h"
#include "app/common/UI/UILayer.h"
@ -32,18 +32,18 @@ UIComponent_Chat::UIComponent_Chat(int iPad, void* initData,
std::wstring UIComponent_Chat::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
m_bSplitscreen = true;
return L"ComponentChatSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
m_bSplitscreen = false;
return L"ComponentChat";
@ -89,20 +89,20 @@ void UIComponent_Chat::handleTimerComplete(int id) {
}
void UIComponent_Chat::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
IPlatformRenderer::eViewportType viewport) {
if (m_bSplitscreen) {
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
@ -117,22 +117,22 @@ void UIComponent_Chat::render(S32 width, S32 height,
S32 tileHeight = height;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
tileYStart = (S32)(m_movieHeight / 2);
break;
default:

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -69,7 +69,7 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
protected:
void handleTimerComplete(int id);

View file

@ -1,6 +1,6 @@
#include "UIComponent_Logo.h"
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
@ -13,17 +13,17 @@ UIComponent_Logo::UIComponent_Logo(int iPad, void* initData,
std::wstring UIComponent_Logo::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
return L"ComponentLogoSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
return L"ComponentLogo";
break;

View file

@ -1,6 +1,6 @@
#include "UIComponent_MenuBackground.h"
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/iggy.h"
@ -20,17 +20,17 @@ UIComponent_MenuBackground::UIComponent_MenuBackground(int iPad, void* initData,
std::wstring UIComponent_MenuBackground::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
m_bSplitscreen = true;
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
m_bSplitscreen = false;
break;
@ -42,20 +42,20 @@ std::wstring UIComponent_MenuBackground::getMoviePath() {
}
void UIComponent_MenuBackground::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
IPlatformRenderer::eViewportType viewport) {
if (m_bSplitscreen) {
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
@ -70,22 +70,22 @@ void UIComponent_MenuBackground::render(S32 width, S32 height,
S32 tileHeight = height;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
tileYStart = (S32)(m_movieHeight / 2);
break;
default:

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/rrCore.h"
@ -35,5 +35,5 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
};

View file

@ -4,7 +4,7 @@
#include <mutex>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/iggy.h"
@ -31,18 +31,18 @@ UIComponent_Panorama::UIComponent_Panorama(int iPad, void* initData,
std::wstring UIComponent_Panorama::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
m_bSplitscreen = true;
return L"PanoramaSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
m_bSplitscreen = false;
return L"Panorama";
@ -79,20 +79,20 @@ void UIComponent_Panorama::tick() {
}
void UIComponent_Panorama::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
IPlatformRenderer::eViewportType viewport) {
bool specialViewport =
(viewport == C4JRender::VIEWPORT_TYPE_SPLIT_TOP) ||
(viewport == C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM) ||
(viewport == C4JRender::VIEWPORT_TYPE_SPLIT_LEFT) ||
(viewport == C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT);
(viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP) ||
(viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM) ||
(viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT) ||
(viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT);
if (m_bSplitscreen && specialViewport) {
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
default:
@ -100,8 +100,8 @@ void UIComponent_Panorama::render(S32 width, S32 height,
}
ui.setupRenderPosition(xPos, yPos);
if ((viewport == C4JRender::VIEWPORT_TYPE_SPLIT_LEFT) ||
(viewport == C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT)) {
if ((viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT) ||
(viewport == IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT)) {
// Need to render at full height, but only the left side of the
// scene
S32 tileXStart = 0;

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/iggy.h"
@ -44,7 +44,7 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
private:
void setPanorama(bool isDay);

View file

@ -1,7 +1,7 @@
#include "UIComponent_Tooltips.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/UILayer.h"
@ -30,18 +30,18 @@ UIComponent_Tooltips::UIComponent_Tooltips(int iPad, void* initData,
std::wstring UIComponent_Tooltips::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
m_bSplitscreen = true;
return L"ToolTipsSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
m_bSplitscreen = false;
return L"ToolTips";
@ -55,7 +55,7 @@ F64 UIComponent_Tooltips::getSafeZoneHalfWidth() {
float safeWidth = 0.0f;
// 85% safezone for tooltips in either SD mode
if (!RenderManager.IsHiDef()) {
if (!PlatformRenderer.IsHiDef()) {
// 85% safezone
safeWidth = m_movieWidth * (0.15f / 2);
} else {
@ -73,39 +73,39 @@ void UIComponent_Tooltips::updateSafeZone() {
F64 safeRight = 0.0;
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
safeTop = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
safeBottom = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
safeLeft = getSafeZoneHalfWidth();
safeBottom = getSafeZoneHalfHeight();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
safeRight = getSafeZoneHalfWidth();
safeBottom = getSafeZoneHalfHeight();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
safeTop = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
safeTop = getSafeZoneHalfHeight();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
safeBottom = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
safeBottom = getSafeZoneHalfHeight();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
safeTop = getSafeZoneHalfHeight();
safeBottom = getSafeZoneHalfHeight();
@ -120,7 +120,7 @@ void UIComponent_Tooltips::tick() {
UIScene::tick();
// set the opacity of the tooltip items
unsigned char ucAlpha = app.GetGameSettings(ProfileManager.GetPrimaryPad(),
unsigned char ucAlpha = app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_InterfaceOpacity);
float fVal;
@ -166,8 +166,8 @@ void UIComponent_Tooltips::tick() {
}
void UIComponent_Tooltips::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
if ((ProfileManager.GetLockedProfile() != -1) &&
IPlatformRenderer::eViewportType viewport) {
if ((PlatformProfile.GetLockedProfile() != -1) &&
!ui.GetMenuDisplayed(m_iPad) &&
(app.GetGameSettings(m_iPad, eGameSetting_Tooltips) == 0 ||
app.GetGameSettings(m_iPad, eGameSetting_DisplayHUD) == 0)) {
@ -178,15 +178,15 @@ void UIComponent_Tooltips::render(S32 width, S32 height,
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
@ -201,22 +201,22 @@ void UIComponent_Tooltips::render(S32 width, S32 height,
S32 tileHeight = height;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
tileYStart = (S32)(m_movieHeight / 2);
break;
default:

View file

@ -3,8 +3,7 @@
#include <string>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/UIScene.h"
@ -14,6 +13,7 @@
#include "app/linux/Stubs/iggy_stubs.h"
#endif
#include "app/linux/Iggy/include/rrCore.h"
#include "platform/input/InputConstants.h"
class UILayer;
@ -71,7 +71,7 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
virtual void SetTooltipText(unsigned int tooltip, int iTextID);
virtual void SetEnableTooltips(bool bVal);

View file

@ -4,7 +4,7 @@
#include <vector>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
@ -46,17 +46,17 @@ UIComponent_TutorialPopup::UIComponent_TutorialPopup(int iPad, void* initData,
std::wstring UIComponent_TutorialPopup::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
return L"TutorialPopupSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
return L"TutorialPopup";
break;
@ -67,12 +67,12 @@ void UIComponent_TutorialPopup::UpdateTutorialPopup() {
// has the Splitscreen Gamertag visibility been changed? Re-Adjust Layout to
// prevent overlaps!
if (m_bSplitscreenGamertagVisible !=
(bool)(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
(bool)(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) !=
0)) {
m_bSplitscreenGamertagVisible =
(bool)(app.GetGameSettings(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) != 0);
handleReload();
}
@ -83,7 +83,7 @@ void UIComponent_TutorialPopup::handleReload() {
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_boolean;
value[0].boolval =
(bool)((app.GetGameSettings(ProfileManager.GetPrimaryPad(),
(bool)((app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) !=
0) &&
!m_bContainerMenuVisible); // 4J - TomK - Offset for splitscreen
@ -232,7 +232,7 @@ void UIComponent_TutorialPopup::_SetDescription(UIScene* interactScene,
// Layout function (so we can offset it to stay clear of the gamertag)
m_bSplitscreenGamertagVisible =
(bool)(app.GetGameSettings(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) != 0);
IggyDataValue result;
IggyDataValue value[1];
@ -410,9 +410,9 @@ void UIComponent_TutorialPopup::UpdateInteractScenePosition(bool visible) {
bool isTradingScene =
(m_interactScene->getSceneType() == eUIScene_TradingMenu);
switch (Minecraft::GetInstance()->localplayers[m_iPad]->m_iScreenSection) {
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
bAllowAnim = true;
break;
default:
@ -443,24 +443,24 @@ void UIComponent_TutorialPopup::UpdateInteractScenePosition(bool visible) {
}
void UIComponent_TutorialPopup::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
if (viewport != C4JRender::VIEWPORT_TYPE_FULLSCREEN) {
IPlatformRenderer::eViewportType viewport) {
if (viewport != IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN) {
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
@ -469,22 +469,22 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height,
}
// Adjust for safezone
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
yPos += getSafeZoneHalfHeight();
break;
default:
break;
}
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos -= getSafeZoneHalfWidth();
break;
default:

View file

@ -3,7 +3,7 @@
#include <memory>
#include <string>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl.h"
@ -104,7 +104,7 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
virtual void customDraw(IggyCustomDrawCallbackRegion* region);

View file

@ -4,7 +4,7 @@
#include <algorithm>
#include <memory>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Components/UIComponent_Chat.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -44,18 +44,18 @@ UIScene_HUD::UIScene_HUD(int iPad, void* initData, UILayer* parentLayer)
std::wstring UIScene_HUD::getMoviePath() {
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
m_bSplitscreen = true;
return L"HUDSplit";
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
m_bSplitscreen = false;
return L"HUD";
@ -71,43 +71,43 @@ void UIScene_HUD::updateSafeZone() {
F64 safeRight = 0.0;
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
safeTop = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
safeBottom = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
safeLeft = getSafeZoneHalfWidth();
safeTop = getSafeZoneHalfHeight();
safeBottom = getSafeZoneHalfHeight();
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
safeRight = getSafeZoneHalfWidth();
safeTop = getSafeZoneHalfHeight();
safeBottom = getSafeZoneHalfHeight();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
safeTop = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
safeTop = getSafeZoneHalfHeight();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
safeBottom = getSafeZoneHalfHeight();
safeLeft = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
safeBottom = getSafeZoneHalfHeight();
safeRight = getSafeZoneHalfWidth();
break;
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
case IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN:
default:
safeTop = getSafeZoneHalfHeight();
safeBottom = getSafeZoneHalfHeight();
@ -169,7 +169,7 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion* region) {
std::shared_ptr<ItemInstance> item = invSlot->getItem();
if (item != nullptr) {
unsigned char ucAlpha = app.GetGameSettings(
ProfileManager.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
PlatformProfile.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
float fVal;
if (ucAlpha < 80) {
@ -250,19 +250,19 @@ void UIScene_HUD::handleReload() {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localplayers[m_iPad] == nullptr ||
pMinecraft->localplayers[m_iPad]->m_iScreenSection ==
C4JRender::VIEWPORT_TYPE_FULLSCREEN) {
IPlatformRenderer::VIEWPORT_TYPE_FULLSCREEN) {
iGuiScale = app.GetGameSettings(m_iPad, eGameSetting_UISize);
} else {
iGuiScale = app.GetGameSettings(m_iPad, eGameSetting_UISizeSplitscreen);
}
SetHudSize(iGuiScale);
SetDisplayName(ProfileManager.GetDisplayName(m_iPad));
SetDisplayName(PlatformProfile.GetDisplayName(m_iPad));
repositionHud();
SetTooltipsEnabled(((ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) ||
(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
SetTooltipsEnabled(((ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad())) ||
(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_Tooltips) != 0)));
}
@ -669,20 +669,20 @@ void UIScene_HUD::SetHealthAbsorb(int healthAbsorb) {
}
void UIScene_HUD::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
IPlatformRenderer::eViewportType viewport) {
if (m_bSplitscreen) {
S32 xPos = 0;
S32 yPos = 0;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
@ -697,22 +697,22 @@ void UIScene_HUD::render(S32 width, S32 height,
S32 tileHeight = height;
switch (viewport) {
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
tileYStart = (S32)(m_movieHeight / 2);
break;
default:
@ -780,12 +780,12 @@ void UIScene_HUD::repositionHud() {
m_parentLayer->getRenderDimensions(width, height);
switch (m_parentLayer->getViewport()) {
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_LEFT:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_RIGHT:
height = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_TOP:
case IPlatformRenderer::VIEWPORT_TYPE_SPLIT_BOTTOM:
width = (S32)(ui.getScreenWidth());
break;
default:

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/IUIScene_HUD.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl.h"
@ -186,7 +186,7 @@ public:
// RENDERING
virtual void render(S32 width, S32 height,
C4JRender::eViewportType viewport);
IPlatformRenderer::eViewportType viewport);
protected:
void handleTimerComplete(int id);

View file

@ -2,7 +2,7 @@
#include <cmath>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_EnchantingMenu.h"
#include "app/linux/Iggy/include/iggy.h"

View file

@ -5,7 +5,7 @@
#include <memory>
#include <sstream>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_Button.h"

View file

@ -1,11 +1,11 @@
#include "app/common/UI/Controls/UIControl_MinecraftHorse.h"
#include <GL/gl.h>
#include <cmath>
#include <memory>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_HorseInventoryMenu.h"
#include "app/linux/Iggy/include/iggy.h"

View file

@ -1,11 +1,11 @@
#include "UIControl_MinecraftPlayer.h"
#include <GL/gl.h>
#include <cmath>
#include <memory>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_InventoryMenu.h"
#include "app/linux/Iggy/include/iggy.h"

View file

@ -6,7 +6,7 @@
#include <numbers>
#include <vector>
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/linux/Iggy/include/iggy.h"

View file

@ -3,9 +3,8 @@
#include <wchar.h>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -116,7 +115,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) {
else if (m_data->endZ < 0 && m_data->endZ % 2 == 0)
m_data->endZ += 1;
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_ExportSchematic,
(void*)m_data);
@ -130,12 +129,12 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) {
case eControl_EndY:
case eControl_EndZ:
m_keyboardCallbackControl = (eControls)((int)controlId);
InputManager.RequestKeyboard(
PlatformInput.RequestKeyboard(
L"Enter something", L"", 0, 25,
[this](bool bRes) -> int {
return handleKeyboardComplete(bRes);
},
C_4JInput::EKeyboardMode_Default);
IPlatformInput::EKeyboardMode_Default);
break;
};
}
@ -156,7 +155,7 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId,
}
int UIScene_DebugCreateSchematic::handleKeyboardComplete(bool bRes) {
const char* text = InputManager.GetText();
const char* text = PlatformInput.GetText();
if (text[0] != '\0') {
std::wstring value = convStringToWstring(text);
int iVal = 0;

View file

@ -1,14 +1,13 @@
#include "UIScene_DebugOptions.h"
#include "platform/InputActions.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/UI/Controls/UIControl_CheckBox.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/iggy.h"
#ifndef _ENABLEIGGY
#include "app/linux/Stubs/iggy_stubs.h"
#endif
#include "app/linux/LinuxGame.h"
#include "platform/input/InputConstants.h"
class UILayer;

View file

@ -5,8 +5,7 @@
#include <memory>
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -199,17 +198,17 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) {
// app.SetXuiServerAction(m_iPad, eXuiServerAction_DropItem, (void
// *)m_itemIds[id]);
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(GiveItemCommand::preparePacket(
std::dynamic_pointer_cast<Player>(
Minecraft::GetInstance()
->localplayers[ProfileManager.GetPrimaryPad()]),
->localplayers[PlatformProfile.GetPrimaryPad()]),
m_itemIds[id]));
} break;
case eControl_Mobs: {
int id = childId;
if (id < m_mobFactories.size()) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SpawnMob,
(void*)m_mobFactories[id]);
}
@ -217,50 +216,50 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) {
case eControl_Enchantments: {
int id = childId;
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(EnchantItemCommand::preparePacket(
std::dynamic_pointer_cast<Player>(
Minecraft::GetInstance()
->localplayers[ProfileManager.GetPrimaryPad()]),
->localplayers[PlatformProfile.GetPrimaryPad()]),
m_enchantmentIdAndLevels[id].first,
m_enchantmentIdAndLevels[id].second));
} break;
case eControl_Schematic: {
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DebugCreateSchematic, nullptr,
eUILayer_Debug);
#endif
} break;
case eControl_SetCamera: {
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DebugSetCamera, nullptr,
eUILayer_Debug);
#endif
} break;
case eControl_Rain: {
// app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleRain);
// app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),eXuiServerAction_ToggleRain);
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(ToggleDownfallCommand::preparePacket());
} break;
case eControl_Thunder:
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_ToggleThunder);
break;
case eControl_ResetTutorial:
Tutorial::debugResetPlayerSavedProgress(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
break;
case eControl_SetDay: {
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(TimeCommand::preparePacket(false));
} break;
case eControl_SetNight: {
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(TimeCommand::preparePacket(true));
} break;
};

View file

@ -5,9 +5,8 @@
#include <memory>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -109,7 +108,7 @@ void UIScene_DebugSetCamera::handleInput(int iPad, int key, bool repeat,
void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_Teleport:
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SetCameraLocation,
(void*)currentPosition);
break;
@ -119,12 +118,12 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) {
case eControl_YRot:
case eControl_Elevation:
m_keyboardCallbackControl = (eControls)((int)controlId);
InputManager.RequestKeyboard(
PlatformInput.RequestKeyboard(
L"Enter something", L"", 0, 25,
[this](bool bRes) -> int {
return handleKeyboardComplete(bRes);
},
C_4JInput::EKeyboardMode_Default);
IPlatformInput::EKeyboardMode_Default);
break;
};
}
@ -139,7 +138,7 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId,
}
int UIScene_DebugSetCamera::handleKeyboardComplete(bool bRes) {
const char* text = InputManager.GetText();
const char* text = PlatformInput.GetText();
if (text[0] != '\0') {
std::wstring value = convStringToWstring(text);
double val = 0;

View file

@ -4,7 +4,7 @@
#include <cstdint>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
@ -228,7 +228,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) {
// Give the player a warning about the texture pack missing
ui.RequestErrorMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
& : TexturePackDialogReturned, this);
// do set the texture pack id, and on the user pressing create world,
@ -242,10 +242,10 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) {
}
int IUIScene_StartGame::TrialTexturePackWarningReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
pScene->checkStateAndStartGame();
} else {
pScene->m_bIgnoreInput = false;
@ -254,11 +254,11 @@ int IUIScene_StartGame::TrialTexturePackWarningReturned(
}
int IUIScene_StartGame::UnlockTexturePackReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (ProfileManager.IsSignedIn(iPad)) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
if (PlatformProfile.IsSignedIn(iPad)) {
// the license change coming in when the offer has been installed
// will cause this scene to refresh
}
@ -271,7 +271,7 @@ int IUIScene_StartGame::UnlockTexturePackReturned(
}
int IUIScene_StartGame::TexturePackDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
IUIScene_StartGame* pClass = (IUIScene_StartGame*)pParam;
pClass->m_bIgnoreInput = false;

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
@ -53,9 +53,9 @@ protected:
void UpdateCurrentTexturePack(int iSlot);
static int TrialTexturePackWarningReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int UnlockTexturePackReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int TexturePackDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
};

View file

@ -7,9 +7,8 @@
#include <utility>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
@ -112,8 +111,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
m_pDLCPack = nullptr;
m_bRebuildTouchBoxes = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
// 4J-PB - read the settings for the online flag. We'll only save this
// setting if the user changed it.
bool bGameSetting_Online =
@ -125,9 +124,9 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
// create, but this matches the behaviour of load game, and lets the player
// know why they can't play online, instead of just greying out the online
// setting in the More Options #ifdef 0
// if(ProfileManager.IsSignedInLive( m_iPad ))
// if(PlatformProfile.IsSignedInLive( m_iPad ))
// {
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// PlatformProfile.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// }
// #endif
@ -159,7 +158,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
m_checkboxOnline.SetEnable(true);
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_iPad) == false) {
m_checkboxOnline.SetEnable(false);
}
@ -353,7 +352,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_EditWorldName: {
m_bIgnoreInput = true;
InputManager.RequestKeyboard(
PlatformInput.RequestKeyboard(
app.GetString(IDS_CREATE_NEW_WORLD), m_editWorldName.getLabel(),
0, 25,
[this](bool bRes) -> int {
@ -361,7 +360,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) {
// 4J HEG - No reason to set value if keyboard was cancelled
if (bRes) {
std::wstring str =
convStringToWstring(InputManager.GetText());
convStringToWstring(PlatformInput.GetText());
if (!str.empty()) {
m_editWorldName.setLabel(str);
m_worldName = std::move(str);
@ -370,7 +369,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) {
}
return 0;
},
C_4JInput::EKeyboardMode_Default);
IPlatformInput::EKeyboardMode_Default);
} break;
case eControl_GameModeToggle:
switch (m_iGameModeId) {
@ -438,7 +437,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
// Give the player a warning about the texture pack missing
ui.RequestAlertMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&TexturePackDialogReturned, this);
return;
}
@ -483,7 +482,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
if(!ProfileManager.IsSignedInLive(m_iPad))
if(!PlatformProfile.IsSignedInLive(m_iPad))
{
// need to be signed in to live
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
@ -531,8 +530,8 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) {
switch (id) {
case GAME_CREATE_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
@ -574,21 +573,21 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack) {
void UIScene_CreateWorldMenu::checkStateAndStartGame() {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
bool isSignedInLive = true;
bool isOnlineGame = m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; i++) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
(i == primaryPad || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive = isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -599,7 +598,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
uiIDA, 1, ProfileManager.GetPrimaryPad());
uiIDA, 1, PlatformProfile.GetPrimaryPad());
return;
}
@ -623,22 +622,22 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
// the sign-in UI again
int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
// Check if user-created content is allowed, as we cannot play
// multiplayer if it's not
// bool isClientSide =
// ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
// PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
// m_MoreOptionsParams.bOnlineGame;
bool noUGC = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
bool bContentRestricted = false;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
noUGC = !pccAllowed && !pccFriendsAllowed;
@ -655,15 +654,15 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
m_bIgnoreInput = false;
ui.RequestContentRestrictedMessageBox();
} else {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&CScene_MultiGameCreate::StartGame_SignInReturned,
// this,ProfileManager.GetPrimaryPad());
// this,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [this](bool bContinue, int pad) {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
} else {
@ -694,7 +693,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
#endif
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool isPrivate = pClass->m_MoreOptionsParams.bInviteOnly ? true : false;
@ -705,9 +704,9 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
// create the world and launch
std::wstring wWorldName = pClass->m_worldName;
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// Make our next save default to the name of the level
StorageManager.SetSaveTitle((wchar_t*)wWorldName.c_str());
PlatformStorage.SetSaveTitle((wchar_t*)wWorldName.c_str());
std::wstring wSeed;
if (!pClass->m_MoreOptionsParams.seed.empty()) {
@ -894,33 +893,33 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
if (bContinue == true) {
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(pClass->m_iPad)) {
if (PlatformProfile.IsSignedIn(pClass->m_iPad)) {
bool isOnlineGame =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
// bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
bool noPrivileges = false;
int localUsersMask = 0;
bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad);
bool isSignedInLive = PlatformProfile.IsSignedInLive(primaryPad);
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable =
app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == primaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
if (!ProfileManager.AllowedToPlayMultiplayer(i))
if (!PlatformProfile.AllowedToPlayMultiplayer(i))
noPrivileges = true;
localUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(i);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -932,7 +931,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -942,8 +941,8 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -955,7 +954,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnoreInput = false;
unsigned int uiIDA[1];
@ -963,7 +962,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
ui.RequestAlertMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
} else {
// This is NOT called from a storage manager thread, and is in
@ -978,45 +977,45 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
}
int UIScene_CreateWorldMenu::ConfirmCreateReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
// 4J Stu - If we only have one controller connected, then don't show
// the sign-in UI again
int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
if (isClientSide && app.IsLocalMultiplayerAvailable()) {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&UIScene_CreateWorldMenu::StartGame_SignInReturned,
// pClass,ProfileManager.GetPrimaryPad());
// pClass,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [pClass](bool bContinue, int pad) {
return StartGame_SignInReturned(pClass, bContinue, pad);
};
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
} else {
// Check if user-created content is allowed, as we cannot play
// multiplayer if it's not
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool noUGC = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -1027,7 +1026,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
CreateGame(pClass, 0);
}

View file

@ -4,7 +4,7 @@
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "IUIScene_StartGame.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -107,10 +107,10 @@ protected:
static void CreateGame(UIScene_CreateWorldMenu* pClass,
int32_t LocalUsersMask);
static int ConfirmCreateReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int StartGame_SignInReturned(void* pParam, bool bContinue, int iPad);
static int MustSignInReturnedPSN(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
virtual void checkStateAndStartGame();
};

View file

@ -1,7 +1,6 @@
#include "UIScene_DLCMainMenu.h"
#include "platform/InputActions.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl_ButtonList.h"
@ -95,7 +94,7 @@ void UIScene_DLCMainMenu::handlePress(F64 controlId, F64 childId) {
void UIScene_DLCMainMenu::handleTimerComplete(int id) {}
int UIScene_DLCMainMenu::ExitDLCMainMenu(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
UIScene_DLCMainMenu* pClass = (UIScene_DLCMainMenu*)pParam;
pClass->navigateBack();

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_ButtonList.h"
@ -31,7 +31,7 @@ private:
UI_END_MAP_ELEMENTS_AND_NAMES()
static int ExitDLCMainMenu(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
public:
UIScene_DLCMainMenu(int iPad, void* initData, UILayer* parentLayer);

View file

@ -4,8 +4,7 @@
#include <stdint.h>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Render.h"
#include "platform/renderer/renderer.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl_DLCList.h"
#include "app/common/UI/Controls/UIControl_HTMLLabel.h"
@ -35,7 +34,7 @@ UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void* initData,
// Alert the app the we want to be informed of ethernet connections
app.SetLiveLinkRequired(true);
m_bIsSD = !RenderManager.IsHiDef() && !RenderManager.IsWidescreen();
m_bIsSD = !PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen();
m_labelOffers.init(app.GetString(IDS_DOWNLOADABLE_CONTENT_OFFERS));
m_buttonListOffers.init(eControl_OffersList);
@ -59,7 +58,7 @@ UIScene_DLCOffersMenu::~UIScene_DLCOffersMenu() {
void UIScene_DLCOffersMenu::handleTimerComplete(int id) {}
int UIScene_DLCOffersMenu::ExitDLCOffersMenu(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_DLCOffersMenu* pClass = (UIScene_DLCOffersMenu*)pParam;
ui.NavigateToHomeMenu(); // iPad,eUIScene_MainMenu);
@ -187,8 +186,8 @@ void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId) {
int iIndex = (int)childId;
uint64_t ullIndexA[1];
ullIndexA[0] = StorageManager.GetOffer(iIndex).qwOfferID;
StorageManager.InstallOffer(1, ullIndexA, nullptr);
ullIndexA[0] = PlatformStorage.GetOffer(iIndex).qwOfferID;
PlatformStorage.InstallOffer(1, ullIndexA, nullptr);
} break;
}
}

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
@ -45,7 +45,7 @@ public:
UIScene_DLCOffersMenu(int iPad, void* initData, UILayer* parentLayer);
~UIScene_DLCOffersMenu();
static int ExitDLCOffersMenu(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
virtual EUIScene getSceneType() { return eUIScene_DLCOffersMenu; }
virtual void tick();

View file

@ -4,9 +4,8 @@
#include <vector>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -46,7 +45,7 @@ UIScene_EULA::UIScene_EULA(int iPad, void* initData, UILayer* parentLayer)
// 4J-PB - If we have a signed in user connected, let's get the DLC now
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if ((InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) {
if ((PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))) {
if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) {
app.StartInstallDLCProcess(i);
break;

View file

@ -1,6 +1,5 @@
#include "UIScene_Intro.h"
#include "platform/InputActions.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/Iggy/include/iggy.h"

View file

@ -5,8 +5,7 @@
#include <stdint.h>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
@ -223,7 +222,7 @@ void UIScene_JoinMenu::friendSessionUpdated(bool success, void* pParam) {
}
int UIScene_JoinMenu::ErrorDialogReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult) {
const IPlatformStorage::EMessageResult) {
UIScene_JoinMenu* scene = (UIScene_JoinMenu*)pParam;
ui.NavigateBack(scene->m_iPad);
@ -293,15 +292,15 @@ void UIScene_JoinMenu::StartSharedLaunchFlow() {
if (!app.IsLocalMultiplayerAvailable()) {
JoinGame(this);
} else {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&UIScene_JoinMenu::StartGame_SignInReturned,
// this,ProfileManager.GetPrimaryPad());
// this,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [this](bool bContinue, int pad) {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = true;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
}
@ -315,7 +314,7 @@ int UIScene_JoinMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
}
if (bContinue == true && pClass != nullptr &&
ProfileManager.IsSignedIn(iPad)) {
PlatformProfile.IsSignedIn(iPad)) {
JoinGame(pClass);
}
@ -336,35 +335,35 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
bool isSignedInLive = true;
int iPadNotSignedInLive = -1;
ProfileManager.SetLockedProfile(0); // TEMP!
PlatformProfile.SetLockedProfile(0); // TEMP!
// If we're in SD mode, then only the primary player gets to play
if (app.IsLocalMultiplayerAvailable()) {
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(index)) {
if (PlatformProfile.IsSignedIn(index)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(index)) {
// Record the first non signed in live pad
iPadNotSignedInLive = index;
}
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
dwLocalUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(index);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(index);
isSignedInLive && PlatformProfile.IsSignedInLive(index);
}
}
} else {
if (ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
if (!ProfileManager.AllowedToPlayMultiplayer(
ProfileManager.GetPrimaryPad()))
if (PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad())) {
if (!PlatformProfile.AllowedToPlayMultiplayer(
PlatformProfile.GetPrimaryPad()))
noPrivileges = true;
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
isSignedInLive =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad());
}
}
@ -377,7 +376,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
return;
}
@ -388,8 +387,8 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
if (noUGC) {
@ -408,7 +407,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
CGameNetworkManager::eJoinGameResult result = g_NetworkManager.JoinGame(
pClass->m_selectedSession, dwLocalUsersMask);
@ -434,7 +433,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_CONNECTION_FAILED,
exitReasonStringId, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
ui.NavigateToHomeMenu();

View file

@ -2,7 +2,7 @@
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/Controls/UIControl_ButtonList.h"
@ -72,7 +72,7 @@ public:
void tick();
static void friendSessionUpdated(bool success, void* pParam);
static int ErrorDialogReturned(void* pParam, int iPad,
const C4JStorage::EMessageResult);
const IPlatformStorage::EMessageResult);
virtual void updateTooltips();
virtual void updateComponents();

View file

@ -4,10 +4,9 @@
#include <utility>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_CheckBox.h"
@ -74,8 +73,8 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(
#endif
m_bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_params->iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.IsSignedInLive(m_params->iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
bool bOnlineGame, bInviteOnly, bAllowFriendsOfFriends;
bOnlineGame = m_params->bOnlineGame;
@ -83,7 +82,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(
bAllowFriendsOfFriends = m_params->bAllowFriendsOfFriends;
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_params->iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_params->iPad) == false) {
m_checkboxes[eLaunchCheckbox_Online].SetEnable(false);
}
@ -211,7 +210,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(
std::wstring wsText = app.GetString(IDS_GAMEOPTION_ONLINE);
#endif
EHTMLFontSize size = eHTMLSize_Normal;
if (!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) {
if (!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen()) {
size = eHTMLSize_Splitscreen;
}
wchar_t startTags[64];
@ -263,8 +262,8 @@ void UIScene_LaunchMoreOptionsMenu::tick() {
UIScene::tick();
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_params->iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.IsSignedInLive(m_params->iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
m_checkboxes[eLaunchCheckbox_Online].SetEnable(bMultiplayerAllowed);
@ -500,7 +499,7 @@ void UIScene_LaunchMoreOptionsMenu::handleFocusChange(F64 controlId,
std::wstring wsText = app.GetString(stringId);
EHTMLFontSize size = eHTMLSize_Normal;
if (!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) {
if (!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen()) {
size = eHTMLSize_Splitscreen;
}
wchar_t startTags[64];
@ -520,9 +519,9 @@ void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id) {
case GAME_CREATE_ONLINE_TIMER_ID:
{
bool bMultiplayerAllowed
= ProfileManager.IsSignedInLive(m_params->iPad)
= PlatformProfile.IsSignedInLive(m_params->iPad)
&&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed)
{
@ -547,21 +546,21 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_EditSeed: {
m_bIgnoreInput = true;
InputManager.RequestKeyboard(
PlatformInput.RequestKeyboard(
app.GetString(IDS_CREATE_NEW_WORLD_SEED), m_editSeed.getLabel(),
0, 60,
[this](bool bRes) -> int {
// 4J HEG - No reason to set value if keyboard was cancelled
if (bRes) {
std::wstring str =
convStringToWstring(InputManager.GetText());
convStringToWstring(PlatformInput.GetText());
m_editSeed.setLabel(str);
m_params->seed = std::move(str);
}
m_bIgnoreInput = false;
return 0;
},
C_4JInput::EKeyboardMode_Default);
IPlatformInput::EKeyboardMode_Default);
} break;
}
}

View file

@ -8,8 +8,7 @@
#include <memory>
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/Leaderboards/LeaderboardInterface.h"
#include "app/common/Leaderboards/LeaderboardManager.h"
@ -375,7 +374,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) {
} break;
case IPlatformLeaderboard::eFM_MyScore: {
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(), &uid, true);
PlatformProfile.GetXUID(PlatformProfile.GetPrimaryPad(), &uid, true);
m_interface.ReadStats_MyScore(
this, m_currentDifficulty,
(IPlatformLeaderboard::EStatsType)m_currentLeaderboard,
@ -383,7 +382,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) {
} break;
case IPlatformLeaderboard::eFM_Friends: {
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(), &uid, true);
PlatformProfile.GetXUID(PlatformProfile.GetPrimaryPad(), &uid, true);
m_interface.ReadStats_Friends(
this, m_currentDifficulty,
(IPlatformLeaderboard::EStatsType)m_currentLeaderboard,
@ -850,7 +849,7 @@ void UIScene_LeaderboardsMenu::handleRequestMoreData(F64 startIndex, bool up) {
void UIScene_LeaderboardsMenu::handleTimerComplete(int id) {}
int UIScene_LeaderboardsMenu::ExitLeaderboards(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LeaderboardsMenu* pClass = (UIScene_LeaderboardsMenu*)pParam;
pClass->navigateBack();

View file

@ -4,7 +4,7 @@
#include <vector>
#include "platform/PlatformTypes.h"
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/Leaderboards/LeaderboardInterface.h"
#include "app/common/Leaderboards/LeaderboardManager.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -113,7 +113,7 @@ private:
UI_END_MAP_ELEMENTS_AND_NAMES()
static int ExitLeaderboards(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
public:
UIScene_LeaderboardsMenu(int iPad, void* initData, UILayer* parentLayer);

View file

@ -5,9 +5,8 @@
#include <wchar.h>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
@ -123,8 +122,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void* initData,
m_seed = 0;
m_bIsCorrupt = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
// 4J-PB - read the settings for the online flag. We'll only save this
// setting if the user changed it.
bool bGameSetting_Online =
@ -159,7 +158,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void* initData,
m_checkboxOnline.SetEnable(true);
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_iPad) == false) {
m_checkboxOnline.SetEnable(false);
}
@ -250,7 +249,7 @@ void UIScene_LoadMenu::updateTooltips() {
void UIScene_LoadMenu::updateComponents() {
m_parentLayer->showComponent(m_iPad, eUIComponent_Panorama, true);
if (RenderManager.IsWidescreen()) {
if (PlatformRenderer.IsWidescreen()) {
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, true);
} else {
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, false);
@ -447,7 +446,7 @@ void UIScene_LoadMenu::tick() {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
@ -574,7 +573,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() {
// Give the player a warning about the texture pack missing
ui.RequestAlertMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&TexturePackDialogReturned, this);
return;
}
@ -619,7 +618,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() {
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
if(!ProfileManager.IsSignedInLive(m_iPad))
if(!PlatformProfile.IsSignedInLive(m_iPad))
{
// need to be signed in to live
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
@ -689,8 +688,8 @@ void UIScene_LoadMenu::handleTimerComplete(int id) {
switch (id) {
case GAME_CREATE_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
@ -765,15 +764,15 @@ void UIScene_LoadMenu::LaunchGame(void) {
} else {
// set the save to load
PSAVE_DETAILS pSaveDetails =
StorageManager.ReturnSavesInfo();
PlatformStorage.ReturnSavesInfo();
app.DebugPrintf(
"Loading save s [%s]\n",
pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex]
.UTF8SaveTitle,
pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex]
.UTF8SaveFilename);
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveData(
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveData(
&pSaveDetails
->SaveInfoA[(int)m_iSaveGameInfoIndex],
[this](bool bCorrupt, bool bOwner) {
@ -782,10 +781,10 @@ void UIScene_LoadMenu::LaunchGame(void) {
#if TO_BE_IMPLEMENTED
if (eLoadStatus ==
C4JStorage::ELoadGame_DeviceRemoved) {
IPlatformStorage::ELoadGame_DeviceRemoved) {
// disable saving
StorageManager.SetSaveDisabled(true);
StorageManager.SetSaveDeviceSelected(m_iPad, false);
PlatformStorage.SetSaveDisabled(true);
PlatformStorage.SetSaveDeviceSelected(m_iPad, false);
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(
@ -817,24 +816,24 @@ void UIScene_LoadMenu::LaunchGame(void) {
LoadDataComplete(this);
} else {
// set the save to load
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
app.DebugPrintf("Loading save %s [%s]\n",
pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex]
.UTF8SaveTitle,
pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex]
.UTF8SaveFilename);
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveData(
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveData(
&pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex],
[this](bool bCorrupt, bool bOwner) {
return loadSaveDataReturned(bCorrupt, bOwner);
});
#if TO_BE_IMPLEMENTED
if (eLoadStatus == C4JStorage::ELoadGame_DeviceRemoved) {
if (eLoadStatus == IPlatformStorage::ELoadGame_DeviceRemoved) {
// disable saving
StorageManager.SetSaveDisabled(true);
StorageManager.SetSaveDeviceSelected(m_iPad, false);
PlatformStorage.SetSaveDisabled(true);
PlatformStorage.SetSaveDeviceSelected(m_iPad, false);
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(
@ -850,14 +849,14 @@ void UIScene_LoadMenu::LaunchGame(void) {
}
int UIScene_LoadMenu::CheckResetNetherReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// continue and reset the nether
pClass->LaunchGame();
} else if (result == C4JStorage::EMessage_ResultAccept) {
} else if (result == IPlatformStorage::EMessage_ResultAccept) {
// turn off the reset nether and continue
pClass->m_MoreOptionsParams.bResetNether = false;
pClass->LaunchGame();
@ -869,34 +868,34 @@ int UIScene_LoadMenu::CheckResetNetherReturned(
}
int UIScene_LoadMenu::ConfirmLoadReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
if (pClass->m_levelGen != nullptr) {
pClass->m_bIsCorrupt = false;
pClass->LoadDataComplete(pClass);
} else {
// set the save to load
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
app.DebugPrintf(
"Loading save %s [%s]\n",
pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex]
.UTF8SaveTitle,
pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex]
.UTF8SaveFilename);
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveData(
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveData(
&pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex],
[pClass](const bool bCorrupt, const bool bOwner) {
return pClass->loadSaveDataReturned(bCorrupt, bOwner);
});
#if TO_BE_IMPLEMENTED
if (eLoadStatus == C4JStorage::ELoadGame_DeviceRemoved) {
if (eLoadStatus == IPlatformStorage::ELoadGame_DeviceRemoved) {
// disable saving
StorageManager.SetSaveDisabled(true);
StorageManager.SetSaveDeviceSelected(m_iPad, false);
PlatformStorage.SetSaveDisabled(true);
PlatformStorage.SetSaveDeviceSelected(m_iPad, false);
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(
@ -917,22 +916,22 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if (!pClass->m_bIsCorrupt) {
int iPrimaryPad = ProfileManager.GetPrimaryPad();
int iPrimaryPad = PlatformProfile.GetPrimaryPad();
bool isSignedInLive = true;
bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == iPrimaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -944,7 +943,7 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -954,8 +953,8 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
bool pccAllowed = true;
bool pccFriendsAllowed = true;
bool bContentRestricted = false;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
noUGC = !pccAllowed && !pccFriendsAllowed;
@ -974,7 +973,7 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
pClass->m_bIgnoreInput = false;
} else {
int localUsersMask = CGameNetworkManager::GetLocalPlayerMask(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
// No guest problems so we don't need to force a sign-in of
// players here
@ -1027,19 +1026,19 @@ int UIScene_LoadMenu::loadSaveDataReturned(bool bIsCorrupt, bool bIsOwner) {
}
int UIScene_LoadMenu::TrophyDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
return LoadDataComplete(pClass);
}
int UIScene_LoadMenu::DeleteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
StorageManager.DeleteSaveData(
if (result == IPlatformStorage::EMessage_ResultDecline) {
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
PlatformStorage.DeleteSaveData(
&pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex],
[pClass](const bool bSuccess) {
return pClass->deleteSaveDataReturned(bSuccess);
@ -1064,16 +1063,16 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass,
if (pClass->m_levelGen == nullptr) {
int32_t saveOrCheckpointId = 0;
bool validSave =
StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
PlatformStorage.GetSaveUniqueNumber(&saveOrCheckpointId);
} else {
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// Make our next save default to the name of the level
StorageManager.SetSaveTitle(
PlatformStorage.SetSaveTitle(
pClass->m_levelGen->getDefaultSaveName().c_str());
}
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool isPrivate =
@ -1081,7 +1080,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass,
? true
: false;
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
NetworkGameInitData* param = new NetworkGameInitData();
param->seed = pClass->m_seed;
@ -1176,7 +1175,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass,
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1202,30 +1201,30 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
if (bContinue == true) {
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(pClass->m_iPad)) {
int primaryPad = ProfileManager.GetPrimaryPad();
if (PlatformProfile.IsSignedIn(pClass->m_iPad)) {
int primaryPad = PlatformProfile.GetPrimaryPad();
bool noPrivileges = false;
int localUsersMask = 0;
bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad);
bool isSignedInLive = PlatformProfile.IsSignedInLive(primaryPad);
bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable =
app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == primaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
if (!ProfileManager.AllowedToPlayMultiplayer(i))
if (!PlatformProfile.AllowedToPlayMultiplayer(i))
noPrivileges = true;
localUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(i);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -1237,7 +1236,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -1247,8 +1246,8 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -1261,7 +1260,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnoreInput = false;
pClass->setVisible(true);
@ -1270,7 +1269,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
ui.RequestAlertMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
} else {
// This is NOT called from a storage manager thread, and is in

View file

@ -3,7 +3,7 @@
#include <cstdint>
#include <string>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "IUIScene_StartGame.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -120,19 +120,19 @@ private:
void LaunchGame(void);
static int ConfirmLoadReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static void StartGameFromSave(UIScene_LoadMenu* pClass, int localUsersMask);
int loadSaveDataReturned(bool bIsCorrupt, bool bIsOwner);
static int TrophyDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int LoadDataComplete(void* pParam);
static int CheckResetNetherReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int DeleteSaveDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
int deleteSaveDataReturned(bool bSuccess);
static int MustSignInReturnedPSN(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
public:
int loadSaveDataThumbnailReturned(std::uint8_t* pbThumbnail,

View file

@ -6,9 +6,8 @@
#include <compare>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
@ -115,8 +114,8 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void* initData,
m_bSaveTransferInProgress = false;
m_eAction = eAction_None;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
int iLB = -1;
@ -195,10 +194,10 @@ void UIScene_LoadOrJoinMenu::updateTooltips() {
} else if (DoesSavesListHaveFocus()) {
if ((m_iDefaultButtonsC > 0) &&
(m_iSaveListIndex >= m_iDefaultButtonsC)) {
if (StorageManager.GetSaveDisabled()) {
if (PlatformStorage.GetSaveDisabled()) {
iRB = IDS_TOOLTIPS_DELETESAVE;
} else {
if (StorageManager.EnoughSpaceForAMinSaveGame()) {
if (PlatformStorage.EnoughSpaceForAMinSaveGame()) {
iRB = IDS_TOOLTIPS_SAVEOPTIONS;
} else {
iRB = IDS_TOOLTIPS_DELETESAVE;
@ -217,7 +216,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() {
iLB = IDS_TOOLTIPS_PARTY_GAMES;
}
if (StorageManager.GetSaveDisabled()) {
if (PlatformStorage.GetSaveDisabled()) {
} else {
#if defined(SONY_REMOTE_STORAGE_DOWNLOAD)
// Is there a save from PS3 or PSVita available?
@ -226,7 +225,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() {
// available
// if(app.getRemoteStorage()->saveIsAvailable())
{
bool bSignedInLive = ProfileManager.IsSignedInLive(m_iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(m_iPad);
if (bSignedInLive) {
iX = IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD;
}
@ -248,9 +247,9 @@ void UIScene_LoadOrJoinMenu::Initialise() {
m_iDefaultButtonsC = 0;
m_iMashUpButtonsC = 0;
if (StorageManager.GetSaveDisabled()) {
if (PlatformStorage.GetSaveDisabled()) {
#if TO_BE_IMPLEMENTED
if (StorageManager.GetSaveDeviceSelected(m_iPad))
if (PlatformStorage.GetSaveDeviceSelected(m_iPad))
#endif
{
// saving is disabled, but we should still be able to load from a
@ -267,7 +266,7 @@ void UIScene_LoadOrJoinMenu::Initialise() {
} else {
// 4J-PB - we need to check that there is enough space left to create a
// copy of the save (for a rename)
bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame();
bool bCanRename = PlatformStorage.EnoughSpaceForAMinSaveGame();
GetSaveInfo();
}
@ -296,8 +295,8 @@ void UIScene_LoadOrJoinMenu::handleGainFocus(bool navBack) {
if (navBack) {
app.SetLiveLinkRequired(true);
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
// re-enable button presses
m_bIgnoreInput = false;
@ -377,7 +376,7 @@ void UIScene_LoadOrJoinMenu::tick() {
#endif
// Display the saves if we have them
if (!m_bSavesDisplayed) {
m_pSaveDetails = StorageManager.ReturnSavesInfo();
m_pSaveDetails = PlatformStorage.ReturnSavesInfo();
if (m_pSaveDetails != nullptr) {
// CD - Fix - Adding define for ORBIS/XBOXONE
@ -420,15 +419,15 @@ void UIScene_LoadOrJoinMenu::tick() {
m_bRetrievingSaveThumbnails = true;
app.DebugPrintf("Requesting the first thumbnail\n");
// set the save to load
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveDataThumbnail(
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveDataThumbnail(
&pSaveDetails->SaveInfoA[(int)m_iRequestingThumbnailId],
[this](std::uint8_t* data, unsigned int bytes) {
return loadSaveDataThumbnailReturned(data, bytes);
});
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
if (eLoadStatus != IPlatformStorage::ESaveGame_GetSaveThumbnail) {
// something went wrong
m_bRetrievingSaveThumbnails = false;
m_bAllLoaded = true;
@ -486,16 +485,16 @@ void UIScene_LoadOrJoinMenu::tick() {
app.DebugPrintf("Requesting another thumbnail\n");
// set the save to load
PSAVE_DETAILS pSaveDetails =
StorageManager.ReturnSavesInfo();
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveDataThumbnail(
PlatformStorage.ReturnSavesInfo();
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveDataThumbnail(
&pSaveDetails
->SaveInfoA[(int)m_iRequestingThumbnailId],
[this](std::uint8_t* data, unsigned int bytes) {
return loadSaveDataThumbnailReturned(data,
bytes);
});
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
if (eLoadStatus != IPlatformStorage::ESaveGame_GetSaveThumbnail) {
// something went wrong
m_bRetrievingSaveThumbnails = false;
m_bAllLoaded = true;
@ -542,7 +541,7 @@ void UIScene_LoadOrJoinMenu::tick() {
m_bSavesDisplayed = false;
m_iSaveInfoC = 0;
m_buttonListSaves.clearList();
StorageManager.ClearSavesInfo();
PlatformStorage.ClearSavesInfo();
GetSaveInfo();
m_iState = e_SavesIdle;
break;
@ -598,14 +597,14 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() {
m_iSaveInfoC = 0;
m_controlSavesTimer.setVisible(true);
m_pSaveDetails = StorageManager.ReturnSavesInfo();
m_pSaveDetails = PlatformStorage.ReturnSavesInfo();
if (m_pSaveDetails == nullptr) {
C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(
IPlatformStorage::ESaveGameState eSGIStatus = PlatformStorage.GetSavesInfo(
m_iPad, nullptr, (char*)"save");
}
#if TO_BE_IMPLEMENTED
if (eSGIStatus == C4JStorage::ESGIStatus_NoSaves) {
if (eSGIStatus == IPlatformStorage::ESGIStatus_NoSaves) {
uiSaveC = 0;
m_controlSavesTimer.setVisible(false);
m_SavesList.SetEnable(true);
@ -697,14 +696,14 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
// the SD screen, disconnects from LIVE, and then selects a SD, the
// title crashes.
m_bIgnoreInput = true;
StorageManager.SetSaveDevice(
PlatformStorage.SetSaveDevice(
&CScene_MultiGameJoinLoad::DeviceSelectReturned, this, true);
ui.PlayUISFX(eSFX_Press);
#endif
// Save Transfer
#if defined(SONY_REMOTE_STORAGE_DOWNLOAD)
{
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
if (bSignedInLive) {
LaunchSaveTransfer();
}
@ -722,7 +721,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
m_bIgnoreInput = true;
// Could be delete save or Save Options
if (StorageManager.GetSaveDisabled()) {
if (PlatformStorage.GetSaveDisabled()) {
// delete the save game
// Have to ask the player if they are sure they want to
// delete this game
@ -735,15 +734,15 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,
this);
} else {
if (StorageManager.EnoughSpaceForAMinSaveGame()) {
if (PlatformStorage.EnoughSpaceForAMinSaveGame()) {
unsigned int uiIDA[4];
uiIDA[0] = IDS_CONFIRM_CANCEL;
uiIDA[1] = IDS_TITLE_RENAMESAVE;
uiIDA[2] = IDS_TOOLTIPS_DELETESAVE;
int numOptions = 3;
#if defined(SONY_REMOTE_STORAGE_UPLOAD)
if (ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
numOptions = 4;
uiIDA[3] = IDS_TOOLTIPS_SAVETRANSFER_UPLOAD;
}
@ -823,7 +822,7 @@ int UIScene_LoadOrJoinMenu::handleKeyboardCompleteWorldName(bool bRes) {
// 4J HEG - No reason to set value if keyboard was cancelled
m_bIgnoreInput = false;
if (bRes) {
const char* text = InputManager.GetText();
const char* text = PlatformInput.GetText();
// check the name is valid
if (text[0] != '\0') {
} else {
@ -911,7 +910,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) {
params->saveDetails = nullptr;
// navigate to the settings scene
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadMenu, params);
}
} else {
@ -937,7 +936,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) {
{
// navigate to the settings scene
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadMenu, params);
}
}
@ -1011,7 +1010,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) {
m_controlJoinTimer.setVisible(false);
m_bIgnoreInput = true;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_JoinMenu,
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(), eUIScene_JoinMenu,
m_initData);
}
}
@ -1024,9 +1023,9 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions* levelGen) {
// clear out the app's terrain features list
app.ClearTerrainFeaturePosition();
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// Make our next save default to the name of the level
StorageManager.SetSaveTitle(levelGen->getDefaultSaveName().c_str());
PlatformStorage.SetSaveTitle(levelGen->getDefaultSaveName().c_str());
bool isClientSide = false;
bool isPrivate = false;
@ -1068,7 +1067,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions* levelGen) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1264,8 +1263,8 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id) {
switch (id) {
case JOIN_LOAD_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
// m_CheckboxOnline.SetEnable(true);
@ -1288,10 +1287,10 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(
File* saveFile, ESavePlatform savePlatform /*= SAVE_FILE_PLATFORM_LOCAL*/) {
// we'll only be coming in here when the tutorial is loaded now
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// Make our next save default to the name of the level
StorageManager.SetSaveTitle(saveFile->getName().c_str());
PlatformStorage.SetSaveTitle(saveFile->getName().c_str());
int64_t fileSize = saveFile->length();
FileInputStream fis(*saveFile);
@ -1336,7 +1335,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1348,14 +1347,14 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() {
strlen(app.getRemoteStorage()->getLocalFilename()) + 1); // plus null
File cloudFile(wFileName);
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// Make our next save default to the name of the level
wchar_t wSaveName[128];
mbstowcs(
wSaveName, app.getRemoteStorage()->getSaveNameUTF8(),
strlen(app.getRemoteStorage()->getSaveNameUTF8()) + 1); // plus null
StorageManager.SetSaveTitle(wSaveName);
PlatformStorage.SetSaveTitle(wSaveName);
int64_t fileSize = cloudFile.length();
FileInputStream fis(cloudFile);
@ -1401,14 +1400,14 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
#endif
int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
// results switched for this dialog
@ -1418,13 +1417,13 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(
pClass->m_iDefaultButtonsC != 0 &&
pClass->m_iSaveListIndex >= pClass->m_iDefaultButtonsC;
if (result == C4JStorage::EMessage_ResultDecline && validSelection) {
if (result == IPlatformStorage::EMessage_ResultDecline && validSelection) {
if (app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) {
pClass->m_bIgnoreInput = false;
} else {
{
size_t cbId = pClass->GetCallbackUniqueId();
StorageManager.DeleteSaveData(
PlatformStorage.DeleteSaveData(
&pClass->m_pSaveDetails
->SaveInfoA[pClass->m_iSaveListIndex -
pClass->m_iDefaultButtonsC],
@ -1471,13 +1470,13 @@ int UIScene_LoadOrJoinMenu::renameSaveDataReturned(bool bRes) {
}
int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
// results switched for this dialog
// EMessage_ResultAccept means cancel
switch (result) {
case C4JStorage::EMessage_ResultDecline: // rename
case IPlatformStorage::EMessage_ResultDecline: // rename
{
pClass->m_bIgnoreInput = true;
// bring up a keyboard
@ -1492,15 +1491,15 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
.UTF8SaveName,
strlen(pClass->m_saveDetails->UTF8SaveName) + 1); // plus null
wchar_t* ptr = wSaveName;
InputManager.RequestKeyboard(
PlatformInput.RequestKeyboard(
app.GetString(IDS_RENAME_WORLD_TITLE), wSaveName, 0, 25,
[pClass](bool bRes) -> int {
return pClass->handleKeyboardCompleteWorldName(bRes);
},
C_4JInput::EKeyboardMode_Default);
IPlatformInput::EKeyboardMode_Default);
} break;
case C4JStorage::EMessage_ResultThirdOption: // delete -
case IPlatformStorage::EMessage_ResultThirdOption: // delete -
{
// delete the save game
// Have to ask the player if they are sure they want to delete this
@ -1514,7 +1513,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
} break;
#if defined(SONY_REMOTE_STORAGE_UPLOAD)
case C4JStorage::EMessage_ResultFourthOption: // upload to cloud
case IPlatformStorage::EMessage_ResultFourthOption: // upload to cloud
{
unsigned int uiIDA[2];
uiIDA[0] = IDS_CONFIRM_OK;
@ -1527,7 +1526,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
} break;
#endif
case C4JStorage::EMessage_Cancelled:
case IPlatformStorage::EMessage_Cancelled:
default: {
// reset the tooltips
pClass->updateTooltips();
@ -1538,11 +1537,11 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
}
int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
// Exit with or without saving
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
// we need to enable background downloading for the DLC
// XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
}
@ -1607,7 +1606,7 @@ int UIScene_LoadOrJoinMenu::loadCrossSaveDataCallback(bool bIsCorrupt,
}
int UIScene_LoadOrJoinMenu::CrossSaveFinishedCallback(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
pClass->m_eSaveTransferState = eSaveTransfer_Idle;
return 0;
@ -1619,7 +1618,7 @@ int UIScene_LoadOrJoinMenu::crossSaveDeleteOnErrorReturned(bool bRes) {
}
int UIScene_LoadOrJoinMenu::RemoteSaveNotFoundCallback(
void* pParam, int iPad, C4JStorage::EMessageResult result) {
void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
pClass->m_eSaveTransferState = eSaveTransfer_Idle;
return 0;
@ -1680,7 +1679,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
ui.RequestAlertMessage(
IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_WRONG_VERSION, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
RemoteSaveNotFoundCallback, pClass);
}
} else {
@ -1691,33 +1690,33 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
ui.RequestAlertMessage(
IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_NOT_AVAILABLE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
RemoteSaveNotFoundCallback, pClass);
}
}
break;
case eSaveTransfer_CreateDummyFile: {
StorageManager.ResetSaveData();
byte* compData = (byte*)StorageManager.AllocateSaveData(
PlatformStorage.ResetSaveData();
byte* compData = (byte*)PlatformStorage.AllocateSaveData(
app.getRemoteStorage()->getSaveFilesize());
// Make our next save default to the name of the level
const char* pNameUTF8 =
app.getRemoteStorage()->getSaveNameUTF8();
mbstowcs(wSaveName, pNameUTF8,
strlen(pNameUTF8) + 1); // plus null
StorageManager.SetSaveTitle(wSaveName);
PlatformStorage.SetSaveTitle(wSaveName);
std::uint8_t* pbThumbnailData = nullptr;
unsigned int dwThumbnailDataSize = 0;
std::uint8_t* pbDataSaveImage = nullptr;
unsigned int dwDataSizeSaveImage = 0;
StorageManager.GetDefaultSaveImage(
PlatformStorage.GetDefaultSaveImage(
&pbDataSaveImage,
&dwDataSizeSaveImage); // Get the default save thumbnail
// (as set by SetDefaultImages) for
// use on saving games t
StorageManager.GetDefaultSaveThumbnail(
PlatformStorage.GetDefaultSaveThumbnail(
&pbThumbnailData,
&dwThumbnailDataSize); // Get the default save image (as
// set by SetDefaultImages) for use
@ -1732,17 +1731,17 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
hostOptions, app.getRemoteStorage()->getSaveTexturePack());
// set the icon and save image
StorageManager.SetSaveImages(
PlatformStorage.SetSaveImages(
pbThumbnailData, dwThumbnailDataSize, pbDataSaveImage,
dwDataSizeSaveImage, bTextMetadata, iTextMetadataBytes);
app.getRemoteStorage()->waitForStorageManagerIdle();
C4JStorage::ESaveGameState saveState =
StorageManager.SaveSaveData(
app.getRemoteStorage()->waitForPlatformStorageIdle();
IPlatformStorage::ESaveGameState saveState =
PlatformStorage.SaveSaveData(
[pClass](const bool bRes) {
return pClass->createDummySaveDataCallback(bRes);
});
if (saveState == C4JStorage::ESaveGame_Save) {
if (saveState == IPlatformStorage::ESaveGame_Save) {
pClass->m_eSaveTransferState =
eSaveTransfer_CreatingDummyFile;
} else {
@ -1767,10 +1766,10 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
m_wstrStageText);
}
app.getRemoteStorage()->waitForStorageManagerIdle();
app.getRemoteStorage()->waitForPlatformStorageIdle();
app.DebugPrintf("CALL GetSavesInfo B\n");
C4JStorage::ESaveGameState eSGIStatus =
StorageManager.GetSavesInfo(
IPlatformStorage::ESaveGameState eSGIStatus =
PlatformStorage.GetSavesInfo(
pClass->m_iPad,
[pClass](SAVE_DETAILS* pSaveDetails, const bool bRes) {
return pClass->crossSaveGetSavesInfoCallback(
@ -1795,16 +1794,16 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
case eSaveTransfer_GetFileData: {
bSaveFileCreated = true;
StorageManager.GetSaveUniqueFileDir(
PlatformStorage.GetSaveUniqueFileDir(
pClass->m_downloadedUniqueFilename);
if (pClass->m_saveTransferDownloadCancelled) {
pClass->m_eSaveTransferState = eSaveTransfer_Error;
break;
}
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
int idx = pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC;
app.getRemoteStorage()->waitForStorageManagerIdle();
app.getRemoteStorage()->waitForPlatformStorageIdle();
bool bGettingOK = app.getRemoteStorage()->getSaveData(
pClass->m_downloadedUniqueFilename, SaveTransferReturned,
pClass);
@ -1847,7 +1846,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
break;
}
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
PSAVE_DETAILS pSaveDetails = PlatformStorage.ReturnSavesInfo();
int saveInfoIndex = -1;
for (int i = 0; i < pSaveDetails->iSaveC; i++) {
if (strcmp(pSaveDetails->SaveInfoA[i].UTF8SaveFilename,
@ -1862,15 +1861,15 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
"CrossSaveGetSavesInfoCallback failed - couldn't find "
"save\n");
} else {
C4JStorage::ESaveGameState eLoadStatus =
StorageManager.LoadSaveData(
IPlatformStorage::ESaveGameState eLoadStatus =
PlatformStorage.LoadSaveData(
&pSaveDetails->SaveInfoA[saveInfoIndex],
[pClass](const bool bIsCorrupt,
const bool bIsOwner) {
return pClass->loadCrossSaveDataCallback(
bIsCorrupt, bIsOwner);
});
if (eLoadStatus == C4JStorage::ESaveGame_Load) {
if (eLoadStatus == IPlatformStorage::ESaveGame_Load) {
pClass->m_eSaveTransferState =
eSaveTransfer_LoadingSaveFromDisc;
} else {
@ -1882,12 +1881,12 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
break;
case eSaveTransfer_CreatingNewSave: {
unsigned int fileSize = StorageManager.GetSaveSize();
unsigned int fileSize = PlatformStorage.GetSaveSize();
std::vector<uint8_t> ba(fileSize);
StorageManager.GetSaveData(ba.data(), &fileSize);
PlatformStorage.GetSaveData(ba.data(), &fileSize);
assert(ba.size() == fileSize);
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
{
std::uint8_t* pbThumbnailData = nullptr;
unsigned int dwThumbnailDataSize = 0;
@ -1895,13 +1894,13 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
std::uint8_t* pbDataSaveImage = nullptr;
unsigned int dwDataSizeSaveImage = 0;
StorageManager.GetDefaultSaveImage(
PlatformStorage.GetDefaultSaveImage(
&pbDataSaveImage,
&dwDataSizeSaveImage); // Get the default save
// thumbnail (as set by
// SetDefaultImages) for use on
// saving games t
StorageManager.GetDefaultSaveThumbnail(
PlatformStorage.GetDefaultSaveThumbnail(
&pbThumbnailData,
&dwThumbnailDataSize); // Get the default save image
// (as set by SetDefaultImages)
@ -1919,7 +1918,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
app.getRemoteStorage()->getSaveTexturePack());
// set the icon and save image
StorageManager.SetSaveImages(
PlatformStorage.SetSaveImages(
pbThumbnailData, dwThumbnailDataSize, pbDataSaveImage,
dwDataSizeSaveImage, bTextMetadata, iTextMetadataBytes);
}
@ -1950,12 +1949,12 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
pClass->m_eSaveTransferState = eSaveTransfer_Saving;
pMinecraft->progressRenderer->progressStage(
IDS_SAVETRANSFER_STAGE_SAVING);
StorageManager.SetSaveTitle(wSaveName);
StorageManager.SetSaveUniqueFilename(
PlatformStorage.SetSaveTitle(wSaveName);
PlatformStorage.SetSaveUniqueFilename(
pClass->m_downloadedUniqueFilename);
app.getRemoteStorage()
->waitForStorageManagerIdle(); // we need to wait for the
->waitForPlatformStorageIdle(); // we need to wait for the
// save system to be idle
// here, as Flush doesn't
// check for it.
@ -1982,13 +1981,13 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
app.getRemoteStorage()
->waitForStorageManagerIdle(); // wait for everything to
->waitForPlatformStorageIdle(); // wait for everything to
// complete before we hand
// control back to the
// player
ui.RequestErrorMessage(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE,
uiIDA, 1, ProfileManager.GetPrimaryPad(),
uiIDA, 1, PlatformProfile.GetPrimaryPad(),
CrossSaveFinishedCallback, pClass);
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
} break;
@ -2016,7 +2015,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
// if the save file has already been created we have to
// delete it again if there's been an error
PSAVE_DETAILS pSaveDetails =
StorageManager.ReturnSavesInfo();
PlatformStorage.ReturnSavesInfo();
int saveInfoIndex = -1;
for (int i = 0; i < pSaveDetails->iSaveC; i++) {
if (strcmp(pSaveDetails->SaveInfoA[i].UTF8SaveFilename,
@ -2034,20 +2033,20 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
eSaveTransfer_ErrorMesssage;
} else {
// delete the save file
app.getRemoteStorage()->waitForStorageManagerIdle();
C4JStorage::ESaveGameState eDeleteStatus =
StorageManager.DeleteSaveData(
app.getRemoteStorage()->waitForPlatformStorageIdle();
IPlatformStorage::ESaveGameState eDeleteStatus =
PlatformStorage.DeleteSaveData(
&pSaveDetails->SaveInfoA[saveInfoIndex],
[pClass](const bool bRes) {
return pClass
->crossSaveDeleteOnErrorReturned(bRes);
});
if (eDeleteStatus == C4JStorage::ESaveGame_Delete) {
if (eDeleteStatus == IPlatformStorage::ESaveGame_Delete) {
pClass->m_eSaveTransferState =
eSaveTransfer_ErrorDeletingSave;
} else {
app.DebugPrintf(
"StorageManager.DeleteSaveData failed!!\n");
"PlatformStorage.DeleteSaveData failed!!\n");
pClass->m_eSaveTransferState =
eSaveTransfer_ErrorMesssage;
}
@ -2061,7 +2060,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
break;
case eSaveTransfer_ErrorMesssage: {
app.getRemoteStorage()
->waitForStorageManagerIdle(); // wait for everything to
->waitForPlatformStorageIdle(); // wait for everything to
// complete before we hand
// control back to the
// player
@ -2071,14 +2070,14 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
uint32_t errorMessage = IDS_SAVE_TRANSFER_DOWNLOADFAILED;
if (!ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
errorMessage =
IDS_ERROR_NETWORK; // show "A network error has
// occurred."
#if defined(__VITA__)
if (!ProfileManager.IsSignedInPSN(
ProfileManager.GetPrimaryPad())) {
if (!PlatformProfile.IsSignedInPSN(
PlatformProfile.GetPrimaryPad())) {
errorMessage =
IDS_PRO_NOTONLINE_TEXT; // show "not signed
// into PSN"
@ -2087,7 +2086,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
}
ui.RequestErrorMessage(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
errorMessage, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
CrossSaveFinishedCallback, pClass);
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
}

View file

@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl.h"
@ -140,11 +140,11 @@ public:
unsigned int thumbnailBytes);
static int LoadSaveCallback(void* lpParam, bool bRes);
static int DeleteSaveDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int SaveOptionsDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int TexturePackDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
int deleteSaveDataReturned(bool bRes);
int renameSaveDataReturned(bool bRes);
int handleKeyboardCompleteWorldName(bool bRes);
@ -202,10 +202,10 @@ private:
int crossSaveGetSavesInfoCallback(SAVE_DETAILS* pSaveDetails, bool bRes);
int loadCrossSaveDataCallback(bool bIsCorrupt, bool bIsOwner);
static int CrossSaveFinishedCallback(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
int crossSaveDeleteOnErrorReturned(bool bRes);
static int RemoteSaveNotFoundCallback(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int DownloadSonyCrossSaveThreadProc(void* lpParameter);
static void SaveTransferReturned(void* lpParam, SonyRemoteStorage::Status s,
int error_code);
@ -238,8 +238,8 @@ private:
int error_code);
static void CancelSaveUploadCallback(void* lpParam);
static int SaveTransferDialogReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int CrossSaveUploadFinishedCallback(
void* pParam, int iPad, C4JStorage::EMessageResult result);
void* pParam, int iPad, IPlatformStorage::EMessageResult result);
#endif
};

View file

@ -7,9 +7,8 @@
#include <numbers>
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/sdl2/Render.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
@ -145,13 +144,13 @@ void UIScene_MainMenu::handleGainFocus(bool navBack) {
if (!navBack) {
for (int iPad = 0; iPad < MAX_LOCAL_PLAYERS; iPad++) {
// For returning to menus after exiting a game.
if (ProfileManager.IsSignedIn(iPad)) {
ProfileManager.SetCurrentGameActivity(
if (PlatformProfile.IsSignedIn(iPad)) {
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MENUS, false);
}
}
}
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
m_bIgnorePress = false;
updateTooltips();
@ -214,8 +213,8 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
switch (key) {
case ACTION_MENU_OK:
if (pressed) {
ProfileManager.SetPrimaryPad(iPad);
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetPrimaryPad(iPad);
PlatformProfile.SetLockedProfile(-1);
sendInputToMovie(key, repeat, pressed, released);
}
break;
@ -228,7 +227,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
}
void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
std::function<int(bool, int)> signInReturnedFunc;
@ -287,16 +286,16 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
} break;
default:
__debugbreak();
assert(0);
}
bool confirmUser = false;
// Note: if no sign in returned func, assume this isn't required
if (signInReturnedFunc) {
if (ProfileManager.IsSignedIn(primaryPad)) {
if (PlatformProfile.IsSignedIn(primaryPad)) {
if (confirmUser) {
ProfileManager.RequestSignInUI(false, false, true, false, true,
PlatformProfile.RequestSignInUI(false, false, true, false, true,
signInReturnedFunc,
primaryPad);
} else {
@ -395,15 +394,15 @@ void UIScene_MainMenu::customDrawSplash(IggyCustomDrawCallbackRegion* region) {
}
int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (result == IPlatformStorage::EMessage_ResultAccept) {
// we need to specify local game here to display local and LIVE profiles
// in the list
switch (pClass->m_eAction) {
case eAction_RunGame:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, true, false, false, true,
[pClass](bool b, int p) {
return CreateLoad_SignInReturned(pClass, b, p);
@ -411,7 +410,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunHelpAndOptions:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return HelpAndOptions_SignInReturned(pClass, b, p);
@ -419,7 +418,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunLeaderboards:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return Leaderboards_SignInReturned(pClass, b, p);
@ -427,7 +426,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunAchievements:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return Achievements_SignInReturned(pClass, b, p);
@ -435,7 +434,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunUnlockOrDLC:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return UnlockFullGame_SignInReturned(pClass, b, p);
@ -448,11 +447,11 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -468,14 +467,14 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void* pParam,
if (bContinue) {
// 4J-JEV: Don't we only need to update rich-presence if the sign-in
// status changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
#if TO_BE_IMPLEMENTED
if (app.GetTMSDLCInfoRead())
#endif
{
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
}
#if TO_BE_IMPLEMENTED
@ -500,11 +499,11 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void* pParam,
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -520,24 +519,24 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
unsigned int uiIDA[1] = {IDS_OK};
if (ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsGuest(PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
{
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
// Check if we're signed in to LIVE
if (bSignedInLive) {
@ -545,7 +544,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
if (!app.DLCInstallProcessCompleted())
app.StartInstallDLCProcess(iPad);
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA,
@ -557,21 +556,21 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
if (app.GetTMSDLCInfoRead() &&
app.GetTMSXUIDsFileRead() &&
app.GetBanListRead(iPad)) {
if (StorageManager.SetSaveDevice(
if (PlatformStorage.SetSaveDevice(
&UIScene_MainMenu::DeviceSelectReturned,
pClass) == true) {
// save device already selected
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
// check for DLC
// start timer to track DLC check finished
pClass->m_Timer.SetShow(true);
XuiSetTimer(pClass->m_hObj,
DLC_INSTALLED_TIMER_ID,
DLC_INSTALLED_TIMER_TIME);
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
}
} else {
// Changing to async TMS calls
@ -595,29 +594,29 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
#else
Minecraft* pMinecraft = Minecraft::GetInstance();
pMinecraft->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
} else {
#if TO_BE_IMPLEMENTED
// offline
ProfileManager.DisplayOfflineProfile(
PlatformProfile.DisplayOfflineProfile(
[pClass](bool b, int p) {
return CScene_Main::CreateLoad_OfflineProfileReturned(
pClass, b, p);
},
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
#else
app.DebugPrintf(
"Offline Profile returned not implemented\n");
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
@ -627,11 +626,11 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -646,18 +645,18 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void* pParam, bool bContinue,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
unsigned int uiIDA[1] = {IDS_OK};
// guests can't look at leaderboards
if (ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsGuest(PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else if (!ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
} else if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1);
@ -672,22 +671,22 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void* pParam, bool bContinue,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE,
IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
#endif
} else {
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LeaderboardsMenu);
}
}
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -703,18 +702,18 @@ int UIScene_MainMenu::Achievements_SignInReturned(void* pParam, bool bContinue,
pClass->m_bIgnorePress = false;
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
// XShowAchievementsUI(ProfileManager.GetPrimaryPad());
// XShowAchievementsUI(PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -729,18 +728,18 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void* pParam,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
pClass->RunUnlockOrDLC(iPad);
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -750,11 +749,11 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void* pParam,
}
int UIScene_MainMenu::ExitGameReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
IPlatformStorage::EMessageResult result) {
// UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
// buttons reversed on this
if (result == C4JStorage::EMessage_ResultDecline) {
if (result == IPlatformStorage::EMessage_ResultDecline) {
// XLaunchNewImage(XLAUNCH_KEYWORD_DASH_ARCADE, 0);
app.ExitGame();
}
@ -770,7 +769,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
app.ReleaseSaveThumbnail();
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
@ -778,39 +777,39 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - Need to check for installed DLC
if (!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(iPad);
{
// are we offline?
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
if (!bSignedInLive) {
ProfileManager.SetLockedProfile(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
} else {
#if TO_BE_IMPLEMENTED
// Check if there is any new DLC
app.ClearNewDLCAvailable();
StorageManager.GetAvailableDLCCount(iPad);
PlatformStorage.GetAvailableDLCCount(iPad);
// check if all the TMS files are loaded
if (app.GetTMSDLCInfoRead() && app.GetTMSXUIDsFileRead() &&
app.GetBanListRead(iPad)) {
if (StorageManager.SetSaveDevice(
if (PlatformStorage.SetSaveDevice(
&CScene_Main::DeviceSelectReturned, this) == true) {
// change the minecraft player name
pMinecraft->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
// save device already selected
// ensure we've applied this player's settings
@ -841,12 +840,12 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
}
#else
pMinecraft->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
@ -859,10 +858,10 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) {
uiIDA[0] = IDS_OK;
// guests can't look at leaderboards
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else if (!ProfileManager.IsSignedInLive(iPad)) {
} else if (!PlatformProfile.IsSignedInLive(iPad)) {
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
uiIDA, 1);
} else {
@ -885,14 +884,14 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad(), nullptr, this);
PlatformProfile.GetPrimaryPad(), nullptr, this);
#endif
} else {
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
proceedToScene(iPad, eUIScene_LeaderboardsMenu);
}
@ -903,8 +902,8 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
uiIDA[0] = IDS_OK;
// downloadable content
if (ProfileManager.IsSignedInLive(iPad)) {
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsSignedInLive(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
@ -912,7 +911,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
{
bool bContentRestricted = false;
@ -925,12 +924,12 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE,
IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
nullptr, this);
#endif
} else {
ProfileManager.SetLockedProfile(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DLCMainMenu);
}
}
@ -941,7 +940,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
// We want to navigate to the DLC scene, but block input until
// we get the DLC file in from TMS Don't navigate - we might
// have an uplink disconnect
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DLCMainMenu);
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_DLCMainMenu);
}
} else {
unsigned int uiIDA[1];
@ -976,7 +975,7 @@ void UIScene_MainMenu::tick() {
#endif
if ((eNavigateWhenReady >= 0)) {
int lockedProfile = ProfileManager.GetLockedProfile();
int lockedProfile = PlatformProfile.GetLockedProfile();
{
app.DebugPrintf("[MainMenu] Navigating away from MainMenu.\n");
@ -992,7 +991,7 @@ void UIScene_MainMenu::RunAchievements(int iPad) {
uiIDA[0] = IDS_OK;
// guests can't look at achievements
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
@ -1002,7 +1001,7 @@ void UIScene_MainMenu::RunAchievements(int iPad) {
}
void UIScene_MainMenu::RunHelpAndOptions(int iPad) {
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
@ -1011,14 +1010,14 @@ void UIScene_MainMenu::RunHelpAndOptions(int iPad) {
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
#if TO_BE_IMPLEMENTED
// 4J-PB - You can be offline and still can go into help and options
if (app.GetTMSDLCInfoRead() || !ProfileManager.IsSignedInLive(iPad))
if (app.GetTMSDLCInfoRead() || !PlatformProfile.IsSignedInLive(iPad))
#endif
{
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
}
#if TO_BE_IMPLEMENTED
@ -1049,17 +1048,17 @@ void UIScene_MainMenu::LoadTrial(void) {
// clear out the app's terrain features list
app.ClearTerrainFeaturePosition();
StorageManager.ResetSaveData();
PlatformStorage.ResetSaveData();
// No saving in the trial
StorageManager.SetSaveDisabled(true);
PlatformStorage.SetSaveDisabled(true);
app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false);
// Set the global flag, so that we don't disable saving again once the save
// is complete
app.SetGameHostOption(eGameHostOption_DisableSaving, 1);
StorageManager.SetSaveTitle(L"Tutorial");
PlatformStorage.SetSaveTitle(L"Tutorial");
// Reset the autosave time
app.SetAutosaveTimerTime();
@ -1087,12 +1086,12 @@ void UIScene_MainMenu::LoadTrial(void) {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
loadingParams->completionData = completionData;
ui.ShowTrialTimer(true);
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}

View file

@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include "platform/sdl2/Storage.h"
#include "platform/storage/storage.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/Controls/UIControl.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -145,14 +145,14 @@ private:
static int Achievements_SignInReturned(void* pParam, bool bContinue,
int iPad);
static int MustSignInReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
static int Leaderboards_SignInReturned(void* pParam, bool bContinue,
int iPad);
static int UnlockFullGame_SignInReturned(void* pParam, bool bContinue,
int iPad);
static int ExitGameReturned(void* pParam, int iPad,
C4JStorage::EMessageResult result);
IPlatformStorage::EMessageResult result);
bool m_bRunGameChosen;
int32_t m_errorCode;
bool m_bErrorDialogRunning;

View file

@ -3,7 +3,6 @@
#include <vector>
#include "platform/InputActions.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_Button.h"

View file

@ -2,9 +2,8 @@
#include "UIScene_SaveMessage.h"
#include "platform/PlatformTypes.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/sdl2/Profile.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -39,7 +38,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void* initData,
// 4J-PB - If we have a signed in user connected, let's get the DLC now
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if ((InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) {
if ((PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))) {
if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) {
app.StartInstallDLCProcess(i);
break;

View file

@ -1,8 +1,7 @@
#include "UIScene_TrialExitUpsell.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/LinuxGame.h"
@ -49,7 +48,7 @@ void UIScene_TrialExitUpsell::handleInput(int iPad, int key, bool repeat,
}
break;
case ACTION_MENU_X:
if (ProfileManager.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedIn(iPad)) {
// CD - Added for audio
ui.PlayUISFX(eSFX_Press);
}

View file

@ -4,8 +4,7 @@
#include <memory>
#include "platform/InputActions.h"
#include "platform/sdl2/Input.h"
#include "platform/input/input.h"
#include "minecraft/GameEnums.h"
#include "app/common/BuildVer/BuildVer.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -251,7 +250,7 @@ void UIScene_ControlsMenu::PositionAllText(int iPad) {
void UIScene_ControlsMenu::PositionText(int iPad, int iTextID,
unsigned char ucAction) {
unsigned int uiVal = InputManager.GetGameJoypadMaps(
unsigned int uiVal = PlatformInput.GetGameJoypadMaps(
m_iCurrentNavigatedControlsLayout, ucAction);
if (uiVal & _360_JOY_BUTTON_A)

View file

@ -4,7 +4,6 @@
#include <string.h>
#include <wchar.h>
#include "platform/InputActions.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/LinuxGame.h"

View file

@ -1,8 +1,7 @@
#include "UIScene_HelpAndOptionsMenu.h"
#include "platform/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
@ -47,7 +46,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData,
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
// any content to be re-installed?
if (m_iPad == ProfileManager.GetPrimaryPad() && bNotInGame) {
if (m_iPad == PlatformProfile.GetPrimaryPad() && bNotInGame) {
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
} else {
@ -61,7 +60,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData,
#if TO_BE_IMPLEMENTED
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad, false);
#endif
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_HAO_REINSTALL], false);
}
}
@ -71,8 +70,8 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData,
// example)
doHorizontalResizeCheck();
// StorageManager.TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage_TitleUser,iPad);
// StorageManager.WebServiceRequestGetFriends(iPad);
// PlatformStorage.TMSPP_GetUserQuotaInfo(IPlatformStorage::eGlobalStorage_TitleUser,iPad);
// PlatformStorage.WebServiceRequestGetFriends(iPad);
}
UIScene_HelpAndOptionsMenu::~UIScene_HelpAndOptionsMenu() {}
@ -117,7 +116,7 @@ void UIScene_HelpAndOptionsMenu::handleReload() {
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
// any content to be re-installed?
if (m_iPad == ProfileManager.GetPrimaryPad() && bNotInGame) {
if (m_iPad == PlatformProfile.GetPrimaryPad() && bNotInGame) {
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
} else {
@ -131,7 +130,7 @@ void UIScene_HelpAndOptionsMenu::handleReload() {
#if TO_BE_IMPLEMENTED
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad, false);
#endif
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_HAO_REINSTALL], false);
}
}

View file

@ -6,7 +6,6 @@
#include <vector>
#include "platform/InputActions.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_Label.h"
#include "app/common/UI/UIScene.h"

View file

@ -3,7 +3,6 @@
#include <stdint.h>
#include "platform/InputActions.h"
#include "app/common/UI/Controls/UIControl_ButtonList.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"

View file

@ -1,6 +1,5 @@
#include "UIScene_LanguageSelector.h"
#include "platform/InputActions.h"
#include "app/common/UI/Controls/UIControl_ButtonList.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"

View file

@ -1,7 +1,6 @@
#include "UIScene_ReinstallMenu.h"
#include "platform/InputActions.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/LinuxGame.h"

Some files were not shown because too many files have changed in this diff Show more