mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
refactor: add platform interfaces, move GetPrimaryPad to Input, gut Profile stubs
This commit is contained in:
parent
adb3adfb8a
commit
9e207250cb
|
|
@ -65,6 +65,7 @@ miniaudio_dep = dependency('miniaudio')
|
||||||
|
|
||||||
subdir('minecraft/java')
|
subdir('minecraft/java')
|
||||||
subdir('minecraft/nbt')
|
subdir('minecraft/nbt')
|
||||||
|
subdir('minecraft/platform')
|
||||||
|
|
||||||
subdir('minecraft/4J.Render')
|
subdir('minecraft/4J.Render')
|
||||||
subdir('minecraft/4J.Input')
|
subdir('minecraft/4J.Input')
|
||||||
|
|
|
||||||
|
|
@ -658,3 +658,8 @@ void C_4JInput::CancelQueuedVerifyStrings(int (*)(void*,
|
||||||
STRING_VERIFY_RESPONSE*),
|
STRING_VERIFY_RESPONSE*),
|
||||||
void*) {}
|
void*) {}
|
||||||
void C_4JInput::CancelAllVerifyInProgress() {}
|
void C_4JInput::CancelAllVerifyInProgress() {}
|
||||||
|
|
||||||
|
// Primary pad (moved from Profile)
|
||||||
|
namespace { int s_inputPrimaryPad = 0; }
|
||||||
|
int C_4JInput::GetPrimaryPad() { return s_inputPrimaryPad; }
|
||||||
|
void C_4JInput::SetPrimaryPad(int iPad) { s_inputPrimaryPad = iPad; }
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "../platform/IPlatformInput.h"
|
||||||
|
|
||||||
#define MAP_STYLE_0 0
|
#define MAP_STYLE_0 0
|
||||||
#define MAP_STYLE_1 1
|
#define MAP_STYLE_1 1
|
||||||
#define MAP_STYLE_2 2
|
#define MAP_STYLE_2 2
|
||||||
|
|
@ -47,30 +49,8 @@
|
||||||
#define TRIGGER_MAP_0 0
|
#define TRIGGER_MAP_0 0
|
||||||
#define TRIGGER_MAP_1 1
|
#define TRIGGER_MAP_1 1
|
||||||
|
|
||||||
enum EKeyboardResult {
|
class C_4JInput : public IPlatformInput {
|
||||||
EKeyboard_Pending,
|
|
||||||
EKeyboard_Cancelled,
|
|
||||||
EKeyboard_ResultAccept,
|
|
||||||
EKeyboard_ResultDecline,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _STRING_VERIFY_RESPONSE {
|
|
||||||
std::uint16_t wNumStrings;
|
|
||||||
int* pStringResult;
|
|
||||||
} STRING_VERIFY_RESPONSE;
|
|
||||||
|
|
||||||
class C_4JInput {
|
|
||||||
public:
|
public:
|
||||||
enum EKeyboardMode {
|
|
||||||
EKeyboardMode_Default,
|
|
||||||
EKeyboardMode_Numeric,
|
|
||||||
EKeyboardMode_Password,
|
|
||||||
EKeyboardMode_Alphabet,
|
|
||||||
EKeyboardMode_Full,
|
|
||||||
EKeyboardMode_Alphabet_Extended,
|
|
||||||
EKeyboardMode_IP_Address,
|
|
||||||
EKeyboardMode_Phone
|
|
||||||
};
|
|
||||||
|
|
||||||
void Initialise(int iInputStateC, unsigned char ucMapC,
|
void Initialise(int iInputStateC, unsigned char ucMapC,
|
||||||
unsigned char ucActionC, unsigned char ucMenuActionC);
|
unsigned char ucActionC, unsigned char ucMenuActionC);
|
||||||
|
|
@ -157,6 +137,10 @@ public:
|
||||||
int GetMouseX();
|
int GetMouseX();
|
||||||
int GetMouseY();
|
int GetMouseY();
|
||||||
|
|
||||||
|
// Primary pad (moved from Profile)
|
||||||
|
int GetPrimaryPad();
|
||||||
|
void SetPrimaryPad(int iPad);
|
||||||
|
|
||||||
// bool InputDetected(int userIndex, wchar_t* inputText);
|
// bool InputDetected(int userIndex, wchar_t* inputText);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "4J_Profile.h"
|
#include "4J_Profile.h"
|
||||||
#include "../4J.Common/4J_ProfileConstants.h"
|
#include "../4J.Common/4J_ProfileConstants.h"
|
||||||
|
#include "../4J.Input/4J_Input.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
|
@ -45,7 +46,6 @@ void* s_profileData[XUSER_MAX_COUNT] = {};
|
||||||
C_4JProfile::PROFILESETTINGS s_dashboardSettings[XUSER_MAX_COUNT] = {};
|
C_4JProfile::PROFILESETTINGS s_dashboardSettings[XUSER_MAX_COUNT] = {};
|
||||||
char s_gamertags[XUSER_MAX_COUNT][16] = {};
|
char s_gamertags[XUSER_MAX_COUNT][16] = {};
|
||||||
std::wstring s_displayNames[XUSER_MAX_COUNT];
|
std::wstring s_displayNames[XUSER_MAX_COUNT];
|
||||||
int s_primaryPad = 0;
|
|
||||||
int s_lockedProfile = 0;
|
int s_lockedProfile = 0;
|
||||||
bool s_profileIsFullVersion = true;
|
bool s_profileIsFullVersion = true;
|
||||||
int (*s_defaultOptionsCallback)(void*, C_4JProfile::PROFILESETTINGS*,
|
int (*s_defaultOptionsCallback)(void*, C_4JProfile::PROFILESETTINGS*,
|
||||||
|
|
@ -102,14 +102,9 @@ void initialiseDefaultGameSettings(ProfileGameSettings* gameSettings) {
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void C_4JProfile::Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
|
void C_4JProfile::Initialise(std::uint32_t, std::uint32_t, unsigned short,
|
||||||
unsigned short usProfileVersion,
|
unsigned int, unsigned int, std::uint32_t*,
|
||||||
unsigned int uiProfileValuesC,
|
int iGameDefinedDataSizeX4, unsigned int*) {
|
||||||
unsigned int uiProfileSettingsC,
|
|
||||||
std::uint32_t* pdwProfileSettingsA,
|
|
||||||
int iGameDefinedDataSizeX4,
|
|
||||||
unsigned int* puiGameDefinedDataChangedBitmask) {
|
|
||||||
s_primaryPad = 0;
|
|
||||||
s_lockedProfile = 0;
|
s_lockedProfile = 0;
|
||||||
std::memset(s_dashboardSettings, 0, sizeof(s_dashboardSettings));
|
std::memset(s_dashboardSettings, 0, sizeof(s_dashboardSettings));
|
||||||
|
|
||||||
|
|
@ -122,46 +117,28 @@ void C_4JProfile::Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
|
||||||
ensureFakeIdentity(i);
|
ensureFakeIdentity(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void C_4JProfile::SetTrialTextStringTable(CXuiStringTable* pStringTable,
|
|
||||||
int iAccept, int iReject) {}
|
|
||||||
void C_4JProfile::SetTrialAwardText(eAwardType AwardType, int iTitle,
|
|
||||||
int iText) {}
|
|
||||||
int C_4JProfile::GetLockedProfile() { return s_lockedProfile; }
|
int C_4JProfile::GetLockedProfile() { return s_lockedProfile; }
|
||||||
void C_4JProfile::SetLockedProfile(int iProf) { s_lockedProfile = iProf; }
|
void C_4JProfile::SetLockedProfile(int iProf) { s_lockedProfile = iProf; }
|
||||||
bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; }
|
bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; }
|
||||||
bool C_4JProfile::IsSignedInLive(int iProf) { return IsSignedIn(iProf); }
|
bool C_4JProfile::IsSignedInLive(int iProf) { return IsSignedIn(iProf); }
|
||||||
bool C_4JProfile::IsGuest(int iQuadrant) { return false; }
|
bool C_4JProfile::IsGuest(int) { return false; }
|
||||||
unsigned int C_4JProfile::RequestSignInUI(
|
bool C_4JProfile::QuerySigninStatus() { return true; }
|
||||||
bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed,
|
|
||||||
bool bMultiplayerSignIn, bool bAddUser,
|
void C_4JProfile::GetXUID(int iPad, PlayerUID* pXuid, bool) {
|
||||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
|
||||||
int iQuadrant) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
unsigned int C_4JProfile::DisplayOfflineProfile(int (*Func)(void*, const bool,
|
|
||||||
const int iPad),
|
|
||||||
void* lpParam, int iQuadrant) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(
|
|
||||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
|
||||||
int iQuadrant) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {}
|
|
||||||
bool C_4JProfile::QuerySigninStatus(void) { return true; }
|
|
||||||
void C_4JProfile::GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid) {
|
|
||||||
if (pXuid)
|
if (pXuid)
|
||||||
*pXuid =
|
*pXuid =
|
||||||
kFakeXuidBase + static_cast<PlayerUID>(isValidPad(iPad) ? iPad : 0);
|
kFakeXuidBase + static_cast<PlayerUID>(isValidPad(iPad) ? iPad : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_4JProfile::AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2) {
|
bool C_4JProfile::AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2) {
|
||||||
return xuid1 == xuid2;
|
return xuid1 == xuid2;
|
||||||
}
|
}
|
||||||
bool C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; }
|
|
||||||
bool C_4JProfile::AllowedToPlayMultiplayer(int iProf) { return true; }
|
bool C_4JProfile::XUIDIsGuest(PlayerUID) { return false; }
|
||||||
bool C_4JProfile::GetChatAndContentRestrictions(int iPad,
|
bool C_4JProfile::AllowedToPlayMultiplayer(int) { return true; }
|
||||||
bool* pbChatRestricted,
|
|
||||||
|
bool C_4JProfile::GetChatAndContentRestrictions(int, bool* pbChatRestricted,
|
||||||
bool* pbContentRestricted,
|
bool* pbContentRestricted,
|
||||||
int* piAge) {
|
int* piAge) {
|
||||||
if (pbChatRestricted) *pbChatRestricted = false;
|
if (pbChatRestricted) *pbChatRestricted = false;
|
||||||
|
|
@ -169,105 +146,56 @@ bool C_4JProfile::GetChatAndContentRestrictions(int iPad,
|
||||||
if (piAge) *piAge = 18;
|
if (piAge) *piAge = 18;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void C_4JProfile::StartTrialGame() {}
|
|
||||||
void C_4JProfile::AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
|
||||||
bool* allAllowed,
|
|
||||||
bool* friendsAllowed) {
|
|
||||||
if (allAllowed) *allAllowed = true;
|
|
||||||
if (friendsAllowed) *friendsAllowed = true;
|
|
||||||
}
|
|
||||||
bool C_4JProfile::CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
|
||||||
PlayerUID* pXuids,
|
|
||||||
unsigned int xuidCount) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {}
|
|
||||||
bool C_4JProfile::GetProfileAvatar(int iPad,
|
|
||||||
int (*Func)(void* lpParam,
|
|
||||||
std::uint8_t* thumbnailData,
|
|
||||||
unsigned int thumbnailBytes),
|
|
||||||
void* lpParam) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
void C_4JProfile::CancelProfileAvatarRequest() {}
|
|
||||||
int C_4JProfile::GetPrimaryPad() { return s_primaryPad; }
|
|
||||||
void C_4JProfile::SetPrimaryPad(int iPad) { s_primaryPad = iPad; }
|
|
||||||
|
|
||||||
char* C_4JProfile::GetGamertag(int iPad) {
|
char* C_4JProfile::GetGamertag(int iPad) {
|
||||||
const int resolvedPad = isValidPad(iPad) ? iPad : 0;
|
const int p = isValidPad(iPad) ? iPad : 0;
|
||||||
ensureFakeIdentity(resolvedPad);
|
ensureFakeIdentity(p);
|
||||||
return s_gamertags[resolvedPad];
|
return s_gamertags[p];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring C_4JProfile::GetDisplayName(int iPad) {
|
std::wstring C_4JProfile::GetDisplayName(int iPad) {
|
||||||
const int resolvedPad = isValidPad(iPad) ? iPad : 0;
|
const int p = isValidPad(iPad) ? iPad : 0;
|
||||||
ensureFakeIdentity(resolvedPad);
|
ensureFakeIdentity(p);
|
||||||
return s_displayNames[resolvedPad];
|
return s_displayNames[p];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_4JProfile::IsFullVersion() { return s_profileIsFullVersion; }
|
bool C_4JProfile::IsFullVersion() { return s_profileIsFullVersion; }
|
||||||
void C_4JProfile::SetSignInChangeCallback(void (*Func)(void*, bool,
|
|
||||||
unsigned int),
|
int C_4JProfile::SetDefaultOptionsCallback(
|
||||||
void* lpParam) {}
|
int (*Func)(void*, PROFILESETTINGS*, const int iPad), void* lpParam) {
|
||||||
void C_4JProfile::SetNotificationsCallback(void (*Func)(void*, std::uint32_t,
|
|
||||||
unsigned int),
|
|
||||||
void* lpParam) {}
|
|
||||||
bool C_4JProfile::RegionIsNorthAmerica(void) { return false; }
|
|
||||||
bool C_4JProfile::LocaleIsUSorCanada(void) { return false; }
|
|
||||||
int C_4JProfile::GetLiveConnectionStatus() { return 0; }
|
|
||||||
bool C_4JProfile::IsSystemUIDisplayed() { return false; }
|
|
||||||
void C_4JProfile::SetProfileReadErrorCallback(void (*Func)(void*),
|
|
||||||
void* lpParam) {}
|
|
||||||
int C_4JProfile::SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
|
||||||
const int iPad),
|
|
||||||
void* lpParam) {
|
|
||||||
s_defaultOptionsCallback = Func;
|
s_defaultOptionsCallback = Func;
|
||||||
s_defaultOptionsCallbackParam = lpParam;
|
s_defaultOptionsCallbackParam = lpParam;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int C_4JProfile::SetOldProfileVersionCallback(int (*Func)(void*, unsigned char*,
|
|
||||||
const unsigned short,
|
|
||||||
const int),
|
|
||||||
void* lpParam) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
C_4JProfile::PROFILESETTINGS* C_4JProfile::GetDashboardProfileSettings(
|
C_4JProfile::PROFILESETTINGS* C_4JProfile::GetDashboardProfileSettings(
|
||||||
int iPad) {
|
int iPad) {
|
||||||
return &s_dashboardSettings[isValidPad(iPad) ? iPad : 0];
|
return &s_dashboardSettings[isValidPad(iPad) ? iPad : 0];
|
||||||
}
|
}
|
||||||
void C_4JProfile::WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged,
|
|
||||||
bool bOverride5MinuteLimitOnProfileWrites) {}
|
|
||||||
void C_4JProfile::ForceQueuedProfileWrites(int iPad) {}
|
|
||||||
void* C_4JProfile::GetGameDefinedProfileData(int iQuadrant) {
|
void* C_4JProfile::GetGameDefinedProfileData(int iQuadrant) {
|
||||||
return isValidPad(iQuadrant) ? s_profileData[iQuadrant] : nullptr;
|
return isValidPad(iQuadrant) ? s_profileData[iQuadrant] : nullptr;
|
||||||
}
|
}
|
||||||
void C_4JProfile::ResetProfileProcessState() {}
|
|
||||||
void C_4JProfile::Tick(void) {}
|
void C_4JProfile::AllowedPlayerCreatedContent(int, bool, bool* allAllowed,
|
||||||
void C_4JProfile::RegisterAward(int iAwardNumber, int iGamerconfigID,
|
bool* friendsAllowed) {
|
||||||
eAwardType eType, bool bLeaderboardAffected,
|
if (allAllowed) *allAllowed = true;
|
||||||
CXuiStringTable* pStringTable, int iTitleStr,
|
if (friendsAllowed) *friendsAllowed = true;
|
||||||
int iTextStr, int iAcceptStr,
|
|
||||||
char* pszThemeName, unsigned int uiThemeSize) {}
|
|
||||||
int C_4JProfile::GetAwardId(int iAwardNumber) { return 0; }
|
|
||||||
eAwardType C_4JProfile::GetAwardType(int iAwardNumber) {
|
|
||||||
return eAwardType_Achievement;
|
|
||||||
}
|
}
|
||||||
bool C_4JProfile::CanBeAwarded(int iQuadrant, int iAwardNumber) {
|
|
||||||
return false;
|
bool C_4JProfile::CanViewPlayerCreatedContent(int, bool, PlayerUID*,
|
||||||
|
unsigned int) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
void C_4JProfile::Award(int iQuadrant, int iAwardNumber, bool bForce) {}
|
|
||||||
bool C_4JProfile::IsAwardsFlagSet(int iQuadrant, int iAward) { return false; }
|
// GetPrimaryPad/SetPrimaryPad — delegates to InputManager.
|
||||||
void C_4JProfile::RichPresenceInit(int iPresenceCount, int iContextCount) {}
|
// Kept here temporarily for call sites that still use ProfileManager.
|
||||||
void C_4JProfile::RegisterRichPresenceContext(int iGameConfigContextID) {}
|
// These forward to the canonical copies in C_4JInput.
|
||||||
void C_4JProfile::SetRichPresenceContextValue(int iPad, int iContextID,
|
int C_4JProfile::GetPrimaryPad() {
|
||||||
int iVal) {}
|
extern C_4JInput InputManager;
|
||||||
void C_4JProfile::SetCurrentGameActivity(int iPad, int iNewPresence,
|
return InputManager.GetPrimaryPad();
|
||||||
bool bSetOthersToIdle) {}
|
}
|
||||||
void C_4JProfile::DisplayFullVersionPurchase(bool bRequired, int iQuadrant,
|
void C_4JProfile::SetPrimaryPad(int iPad) {
|
||||||
int iUpsellParam) {}
|
extern C_4JInput InputManager;
|
||||||
void C_4JProfile::SetUpsellCallback(void (*Func)(void* lpParam,
|
InputManager.SetPrimaryPad(iPad);
|
||||||
eUpsellType type,
|
|
||||||
eUpsellResponse response,
|
|
||||||
int iUserData),
|
|
||||||
void* lpParam) {}
|
|
||||||
void C_4JProfile::SetDebugFullOverride(bool bVal) {
|
|
||||||
s_profileIsFullVersion = bVal;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,51 +4,11 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../4J.Common/4J_Compat.h"
|
#include "../4J.Common/4J_Compat.h"
|
||||||
|
#include "../platform/IPlatformProfile.h"
|
||||||
enum eAwardType {
|
|
||||||
eAwardType_Achievement = 0,
|
|
||||||
eAwardType_GamerPic,
|
|
||||||
eAwardType_Theme,
|
|
||||||
eAwardType_AvatarItem,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum eUpsellType {
|
|
||||||
eUpsellType_Custom = 0, // This is the default, and means that the upsell
|
|
||||||
// dialog was initiated in the app code
|
|
||||||
eUpsellType_Achievement,
|
|
||||||
eUpsellType_GamerPic,
|
|
||||||
eUpsellType_Theme,
|
|
||||||
eUpsellType_AvatarItem,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum eUpsellResponse {
|
|
||||||
eUpsellResponse_Declined,
|
|
||||||
eUpsellResponse_Accepted_NoPurchase,
|
|
||||||
eUpsellResponse_Accepted_Purchase,
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Title info
|
|
||||||
//
|
|
||||||
|
|
||||||
#define TITLEID_MINECRAFT 0x584111F7
|
#define TITLEID_MINECRAFT 0x584111F7
|
||||||
|
|
||||||
//
|
|
||||||
// Context ids
|
|
||||||
//
|
|
||||||
// These values are passed as the dwContextId to XUserSetContext.
|
|
||||||
//
|
|
||||||
|
|
||||||
#define CONTEXT_GAME_STATE 0
|
#define CONTEXT_GAME_STATE 0
|
||||||
|
|
||||||
//
|
|
||||||
// Context values
|
|
||||||
//
|
|
||||||
// These values are passed as the dwContextValue to XUserSetContext.
|
|
||||||
//
|
|
||||||
|
|
||||||
// Values for CONTEXT_GAME_STATE
|
|
||||||
|
|
||||||
#define CONTEXT_GAME_STATE_BLANK 0
|
#define CONTEXT_GAME_STATE_BLANK 0
|
||||||
#define CONTEXT_GAME_STATE_RIDING_PIG 1
|
#define CONTEXT_GAME_STATE_RIDING_PIG 1
|
||||||
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
|
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
|
||||||
|
|
@ -59,12 +19,10 @@ enum eUpsellResponse {
|
||||||
#define CONTEXT_GAME_STATE_NETHER 7
|
#define CONTEXT_GAME_STATE_NETHER 7
|
||||||
#define CONTEXT_GAME_STATE_CD 8
|
#define CONTEXT_GAME_STATE_CD 8
|
||||||
#define CONTEXT_GAME_STATE_MAP 9
|
#define CONTEXT_GAME_STATE_MAP 9
|
||||||
#define CONTEXT_GAME_STATE_ENCHANTING 5 // TODO 10
|
#define CONTEXT_GAME_STATE_ENCHANTING 5
|
||||||
#define CONTEXT_GAME_STATE_BREWING 5 // TODO 11
|
#define CONTEXT_GAME_STATE_BREWING 5
|
||||||
#define CONTEXT_GAME_STATE_ANVIL 6 // TODO 12
|
#define CONTEXT_GAME_STATE_ANVIL 6
|
||||||
#define CONTEXT_GAME_STATE_TRADING 0 // TODO 13
|
#define CONTEXT_GAME_STATE_TRADING 0
|
||||||
|
|
||||||
// Values for X_CONTEXT_PRESENCE
|
|
||||||
|
|
||||||
#define CONTEXT_PRESENCE_IDLE 0
|
#define CONTEXT_PRESENCE_IDLE 0
|
||||||
#define CONTEXT_PRESENCE_MENUS 1
|
#define CONTEXT_PRESENCE_MENUS 1
|
||||||
|
|
@ -73,23 +31,10 @@ enum eUpsellResponse {
|
||||||
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
|
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
|
||||||
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
|
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
|
||||||
|
|
||||||
// Values for X_CONTEXT_GAME_MODE
|
class C_4JProfile : public IPlatformProfile {
|
||||||
|
|
||||||
#define CONTEXT_GAME_MODE_GAMEMODE 0
|
|
||||||
#define CONTEXT_GAME_MODE_MULTIPLAYER 1
|
|
||||||
|
|
||||||
class C_4JProfile {
|
|
||||||
public:
|
public:
|
||||||
struct PROFILESETTINGS {
|
// --- Methods with real logic (implemented in .cpp) ---
|
||||||
int iYAxisInversion;
|
|
||||||
int iControllerSensitivity;
|
|
||||||
int iVibration;
|
|
||||||
bool bSwapSticks;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs
|
|
||||||
// to be checked by the game side to see if there's an update needed - it'll
|
|
||||||
// have the bits set for players to be updated
|
|
||||||
void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
|
void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
|
||||||
unsigned short usProfileVersion,
|
unsigned short usProfileVersion,
|
||||||
unsigned int uiProfileValuesC,
|
unsigned int uiProfileValuesC,
|
||||||
|
|
@ -97,118 +42,85 @@ public:
|
||||||
std::uint32_t* pdwProfileSettingsA,
|
std::uint32_t* pdwProfileSettingsA,
|
||||||
int iGameDefinedDataSizeX4,
|
int iGameDefinedDataSizeX4,
|
||||||
unsigned int* puiGameDefinedDataChangedBitmask);
|
unsigned int* puiGameDefinedDataChangedBitmask);
|
||||||
void SetTrialTextStringTable(CXuiStringTable* pStringTable, int iAccept,
|
|
||||||
int iReject);
|
|
||||||
void SetTrialAwardText(eAwardType AwardType, int iTitle,
|
|
||||||
int iText); // achievement popup in the trial game
|
|
||||||
int GetLockedProfile();
|
int GetLockedProfile();
|
||||||
void SetLockedProfile(int iProf);
|
void SetLockedProfile(int iProf);
|
||||||
bool IsSignedIn(int iQuadrant);
|
bool IsSignedIn(int iQuadrant);
|
||||||
bool IsSignedInLive(int iProf);
|
bool IsSignedInLive(int iProf);
|
||||||
bool IsGuest(int iQuadrant);
|
bool IsGuest(int iQuadrant);
|
||||||
unsigned int RequestSignInUI(bool bFromInvite, bool bLocalGame,
|
bool QuerySigninStatus();
|
||||||
bool bNoGuestsAllowed, bool bMultiplayerSignIn,
|
|
||||||
bool bAddUser,
|
|
||||||
int (*Func)(void*, const bool, const int iPad),
|
|
||||||
void* lpParam,
|
|
||||||
int iQuadrant = XUSER_INDEX_ANY);
|
|
||||||
unsigned int DisplayOfflineProfile(int (*Func)(void*, const bool,
|
|
||||||
const int iPad),
|
|
||||||
void* lpParam,
|
|
||||||
int iQuadrant = XUSER_INDEX_ANY);
|
|
||||||
unsigned int RequestConvertOfflineToGuestUI(
|
|
||||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
|
||||||
int iQuadrant = XUSER_INDEX_ANY);
|
|
||||||
void SetPrimaryPlayerChanged(bool bVal);
|
|
||||||
bool QuerySigninStatus(void);
|
|
||||||
void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid);
|
void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid);
|
||||||
bool AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2);
|
bool AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2);
|
||||||
bool XUIDIsGuest(PlayerUID xuid);
|
bool XUIDIsGuest(PlayerUID xuid);
|
||||||
bool AllowedToPlayMultiplayer(int iProf);
|
bool AllowedToPlayMultiplayer(int iProf);
|
||||||
bool GetChatAndContentRestrictions(int iPad, bool* pbChatRestricted,
|
bool GetChatAndContentRestrictions(int iPad, bool* pbChatRestricted,
|
||||||
bool* pbContentRestricted, int* piAge);
|
bool* pbContentRestricted, int* piAge);
|
||||||
void StartTrialGame(); // disables saves and leaderboard, and change state
|
char* GetGamertag(int iPad);
|
||||||
// to readyforgame from pregame
|
std::wstring GetDisplayName(int iPad);
|
||||||
|
bool IsFullVersion();
|
||||||
|
int SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
||||||
|
const int iPad),
|
||||||
|
void* lpParam);
|
||||||
|
PROFILESETTINGS* GetDashboardProfileSettings(int iPad);
|
||||||
|
void* GetGameDefinedProfileData(int iQuadrant);
|
||||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
||||||
bool* allAllowed, bool* friendsAllowed);
|
bool* allAllowed, bool* friendsAllowed);
|
||||||
bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
||||||
PlayerUID* pXuids, unsigned int xuidCount);
|
PlayerUID* pXuids, unsigned int xuidCount);
|
||||||
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
|
||||||
bool GetProfileAvatar(int iPad,
|
|
||||||
int (*Func)(void* lpParam,
|
|
||||||
std::uint8_t* thumbnailData,
|
|
||||||
unsigned int thumbnailBytes),
|
|
||||||
void* lpParam);
|
|
||||||
void CancelProfileAvatarRequest();
|
|
||||||
|
|
||||||
// SYS
|
// --- Dead stubs (inline no-ops, kept for call-site compat) ---
|
||||||
|
|
||||||
|
void Tick() {}
|
||||||
|
void SetTrialTextStringTable(CXuiStringTable*, int, int) {}
|
||||||
|
void SetTrialAwardText(eAwardType, int, int) {}
|
||||||
|
void StartTrialGame() {}
|
||||||
|
unsigned int RequestSignInUI(bool, bool, bool, bool, bool,
|
||||||
|
int (*)(void*, const bool, const int),
|
||||||
|
void*, int = XUSER_INDEX_ANY) { return 0; }
|
||||||
|
unsigned int DisplayOfflineProfile(int (*)(void*, const bool, const int),
|
||||||
|
void*, int = XUSER_INDEX_ANY) { return 0; }
|
||||||
|
unsigned int RequestConvertOfflineToGuestUI(
|
||||||
|
int (*)(void*, const bool, const int), void*,
|
||||||
|
int = XUSER_INDEX_ANY) { return 0; }
|
||||||
|
void SetPrimaryPlayerChanged(bool) {}
|
||||||
|
void ShowProfileCard(int, PlayerUID) {}
|
||||||
|
bool GetProfileAvatar(int, int (*)(void*, std::uint8_t*, unsigned int),
|
||||||
|
void*) { return false; }
|
||||||
|
void CancelProfileAvatarRequest() {}
|
||||||
|
void SetSignInChangeCallback(void (*)(void*, bool, unsigned int), void*) {}
|
||||||
|
void SetNotificationsCallback(void (*)(void*, std::uint32_t, unsigned int),
|
||||||
|
void*) {}
|
||||||
|
bool RegionIsNorthAmerica() { return false; }
|
||||||
|
bool LocaleIsUSorCanada() { return false; }
|
||||||
|
int GetLiveConnectionStatus() { return 0; }
|
||||||
|
bool IsSystemUIDisplayed() { return false; }
|
||||||
|
void SetProfileReadErrorCallback(void (*)(void*), void*) {}
|
||||||
|
int SetOldProfileVersionCallback(int (*)(void*, unsigned char*,
|
||||||
|
const unsigned short, const int),
|
||||||
|
void*) { return 0; }
|
||||||
|
void WriteToProfile(int, bool = false, bool = false) {}
|
||||||
|
void ForceQueuedProfileWrites(int = XUSER_INDEX_ANY) {}
|
||||||
|
void ResetProfileProcessState() {}
|
||||||
|
void RegisterAward(int, int, eAwardType, bool = false,
|
||||||
|
CXuiStringTable* = nullptr, int = -1, int = -1,
|
||||||
|
int = -1, char* = nullptr, unsigned int = 0L) {}
|
||||||
|
int GetAwardId(int) { return 0; }
|
||||||
|
eAwardType GetAwardType(int) { return eAwardType_Achievement; }
|
||||||
|
bool CanBeAwarded(int, int) { return false; }
|
||||||
|
void Award(int, int, bool = false) {}
|
||||||
|
bool IsAwardsFlagSet(int, int) { return false; }
|
||||||
|
void RichPresenceInit(int, int) {}
|
||||||
|
void RegisterRichPresenceContext(int) {}
|
||||||
|
void SetRichPresenceContextValue(int, int, int) {}
|
||||||
|
void SetCurrentGameActivity(int, int, bool = false) {}
|
||||||
|
void DisplayFullVersionPurchase(bool, int, int = -1) {}
|
||||||
|
void SetUpsellCallback(void (*)(void*, eUpsellType, eUpsellResponse, int),
|
||||||
|
void*) {}
|
||||||
|
void SetDebugFullOverride(bool) {}
|
||||||
|
|
||||||
|
// GetPrimaryPad/SetPrimaryPad moved to InputManager
|
||||||
int GetPrimaryPad();
|
int GetPrimaryPad();
|
||||||
void SetPrimaryPad(int iPad);
|
void SetPrimaryPad(int iPad);
|
||||||
char* GetGamertag(int iPad);
|
|
||||||
std::wstring GetDisplayName(int iPad);
|
|
||||||
bool IsFullVersion();
|
|
||||||
void SetSignInChangeCallback(void (*Func)(void*, bool, unsigned int),
|
|
||||||
void* lpParam);
|
|
||||||
void SetNotificationsCallback(void (*Func)(void*, std::uint32_t,
|
|
||||||
unsigned int),
|
|
||||||
void* lpParam);
|
|
||||||
bool RegionIsNorthAmerica(void);
|
|
||||||
bool LocaleIsUSorCanada(void);
|
|
||||||
int GetLiveConnectionStatus();
|
|
||||||
bool IsSystemUIDisplayed();
|
|
||||||
void SetProfileReadErrorCallback(void (*Func)(void*), void* lpParam);
|
|
||||||
|
|
||||||
// PROFILE DATA
|
|
||||||
int SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
|
||||||
const int iPad),
|
|
||||||
void* lpParam);
|
|
||||||
int SetOldProfileVersionCallback(int (*Func)(void*, unsigned char*,
|
|
||||||
const unsigned short,
|
|
||||||
const int),
|
|
||||||
void* lpParam);
|
|
||||||
PROFILESETTINGS* GetDashboardProfileSettings(int iPad);
|
|
||||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged = false,
|
|
||||||
bool bOverride5MinuteLimitOnProfileWrites = false);
|
|
||||||
void ForceQueuedProfileWrites(int iPad = XUSER_INDEX_ANY);
|
|
||||||
void* GetGameDefinedProfileData(int iQuadrant);
|
|
||||||
void ResetProfileProcessState(); // after a sign out from the primary
|
|
||||||
// player, call this
|
|
||||||
void Tick(void);
|
|
||||||
|
|
||||||
// ACHIEVEMENTS & AWARDS
|
|
||||||
|
|
||||||
void RegisterAward(int iAwardNumber, int iGamerconfigID, eAwardType eType,
|
|
||||||
bool bLeaderboardAffected = false,
|
|
||||||
CXuiStringTable* pStringTable = nullptr,
|
|
||||||
int iTitleStr = -1, int iTextStr = -1,
|
|
||||||
int iAcceptStr = -1, char* pszThemeName = nullptr,
|
|
||||||
unsigned int uiThemeSize = 0L);
|
|
||||||
int GetAwardId(int iAwardNumber);
|
|
||||||
eAwardType GetAwardType(int iAwardNumber);
|
|
||||||
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
|
|
||||||
void Award(int iQuadrant, int iAwardNumber, bool bForce = false);
|
|
||||||
bool IsAwardsFlagSet(int iQuadrant, int iAward);
|
|
||||||
|
|
||||||
// RICH PRESENCE
|
|
||||||
|
|
||||||
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
|
||||||
void RegisterRichPresenceContext(int iGameConfigContextID);
|
|
||||||
void SetRichPresenceContextValue(int iPad, int iContextID, int iVal);
|
|
||||||
void SetCurrentGameActivity(int iPad, int iNewPresence,
|
|
||||||
bool bSetOthersToIdle = false);
|
|
||||||
|
|
||||||
// PURCHASE
|
|
||||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant,
|
|
||||||
int iUpsellParam = -1);
|
|
||||||
void SetUpsellCallback(void (*Func)(void* lpParam, eUpsellType type,
|
|
||||||
eUpsellResponse response,
|
|
||||||
int iUserData),
|
|
||||||
void* lpParam);
|
|
||||||
|
|
||||||
// Debug
|
|
||||||
void SetDebugFullOverride(
|
|
||||||
bool bVal); // To override the license version (trail/full). Only in
|
|
||||||
// debug/release, not ContentPackage
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Singleton
|
// Singleton
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
profile_sources = files(
|
profile_sources = files(
|
||||||
'4J_Profile.cpp',
|
'4J_Profile.cpp',
|
||||||
'PRO_AwardManager.cpp',
|
|
||||||
'PRO_Data.cpp',
|
|
||||||
'PRO_Main.cpp',
|
|
||||||
'PRO_RichPresence.cpp',
|
|
||||||
'PRO_Sys.cpp',
|
|
||||||
'stdafx.cpp',
|
'stdafx.cpp',
|
||||||
)
|
)
|
||||||
# 4jprofile stink
|
# 4jprofile stink
|
||||||
|
|
|
||||||
|
|
@ -3,40 +3,14 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "../platform/IPlatformRender.h"
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class ImageFileBuffer {
|
class C4JRender : public IPlatformRender {
|
||||||
public:
|
|
||||||
enum EImageType { e_typePNG, e_typeJPG };
|
|
||||||
EImageType m_type;
|
|
||||||
void* m_pBuffer;
|
|
||||||
int m_bufferSize;
|
|
||||||
int GetType() { return m_type; }
|
|
||||||
void* GetBufferPointer() { return m_pBuffer; }
|
|
||||||
int GetBufferSize() { return m_bufferSize; }
|
|
||||||
void Release() {
|
|
||||||
std::free(m_pBuffer);
|
|
||||||
m_pBuffer = nullptr;
|
|
||||||
}
|
|
||||||
bool Allocated() { return m_pBuffer != nullptr; }
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int Width;
|
|
||||||
int Height;
|
|
||||||
} D3DXIMAGE_INFO;
|
|
||||||
|
|
||||||
typedef struct _XSOCIAL_PREVIEWIMAGE {
|
|
||||||
std::uint8_t* pBytes;
|
|
||||||
std::uint32_t Pitch;
|
|
||||||
std::uint32_t Width;
|
|
||||||
std::uint32_t Height;
|
|
||||||
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
|
|
||||||
|
|
||||||
class C4JRender {
|
|
||||||
public:
|
public:
|
||||||
void Tick();
|
void Tick();
|
||||||
void UpdateGamma(unsigned short usGamma);
|
void UpdateGamma(unsigned short usGamma);
|
||||||
|
|
@ -78,55 +52,8 @@ public:
|
||||||
void BeginConditionalRendering(int identifier);
|
void BeginConditionalRendering(int identifier);
|
||||||
void EndConditionalRendering();
|
void EndConditionalRendering();
|
||||||
|
|
||||||
// Vertex data handling
|
|
||||||
typedef enum {
|
|
||||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x
|
|
||||||
// float, colour 4 x byte, normal 4 x
|
|
||||||
// byte, padding 1 32-bit word
|
|
||||||
VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of
|
|
||||||
// VS_PS3_TS2_CS1.hlsl for description of
|
|
||||||
// layout
|
|
||||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as
|
|
||||||
// VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1
|
|
||||||
// with lighting applied,
|
|
||||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as
|
|
||||||
// VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1
|
|
||||||
// with tex gen
|
|
||||||
VERTEX_TYPE_COUNT
|
|
||||||
} eVertexType;
|
|
||||||
|
|
||||||
// Pixel shader
|
|
||||||
typedef enum {
|
|
||||||
PIXEL_SHADER_TYPE_STANDARD,
|
|
||||||
PIXEL_SHADER_TYPE_PROJECTION,
|
|
||||||
PIXEL_SHADER_TYPE_FORCELOD,
|
|
||||||
PIXEL_SHADER_COUNT
|
|
||||||
} ePixelShaderType;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
VIEWPORT_TYPE_FULLSCREEN,
|
|
||||||
VIEWPORT_TYPE_SPLIT_TOP,
|
|
||||||
VIEWPORT_TYPE_SPLIT_BOTTOM,
|
|
||||||
VIEWPORT_TYPE_SPLIT_LEFT,
|
|
||||||
VIEWPORT_TYPE_SPLIT_RIGHT,
|
|
||||||
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
|
|
||||||
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
|
|
||||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
|
|
||||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
|
|
||||||
} eViewportType;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
PRIMITIVE_TYPE_TRIANGLE_LIST,
|
|
||||||
PRIMITIVE_TYPE_TRIANGLE_STRIP,
|
|
||||||
PRIMITIVE_TYPE_TRIANGLE_FAN,
|
|
||||||
PRIMITIVE_TYPE_QUAD_LIST,
|
|
||||||
PRIMITIVE_TYPE_LINE_LIST,
|
|
||||||
PRIMITIVE_TYPE_LINE_STRIP,
|
|
||||||
PRIMITIVE_TYPE_COUNT
|
|
||||||
} ePrimitiveType;
|
|
||||||
|
|
||||||
void DrawVertices(ePrimitiveType PrimitiveType, int count, void* dataIn,
|
void DrawVertices(ePrimitiveType PrimitiveType, int count, void* dataIn,
|
||||||
eVertexType vType, C4JRender::ePixelShaderType psType);
|
eVertexType vType, ePixelShaderType psType);
|
||||||
|
|
||||||
// Command buffers
|
// Command buffers
|
||||||
void CBuffLockStaticCreations();
|
void CBuffLockStaticCreations();
|
||||||
|
|
@ -141,18 +68,6 @@ public:
|
||||||
void CBuffDeferredModeStart();
|
void CBuffDeferredModeStart();
|
||||||
void CBuffDeferredModeEnd();
|
void CBuffDeferredModeEnd();
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per
|
|
||||||
// component
|
|
||||||
/* Don't think these are all directly available on D3D 11 - leaving for
|
|
||||||
now TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to
|
|
||||||
alpha channel, R=G=B=0 TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit
|
|
||||||
component mapped to alpha channel, R=G=B=1 TEXTURE_FORMAT_RxGxBxAx,
|
|
||||||
// One 8-bit component mapped to all channels
|
|
||||||
*/
|
|
||||||
MAX_TEXTURE_FORMATS
|
|
||||||
} eTextureFormat;
|
|
||||||
|
|
||||||
// Textures
|
// Textures
|
||||||
int TextureCreate();
|
int TextureCreate();
|
||||||
void TextureFree(int idx);
|
void TextureFree(int idx);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
// #include <xtms.h>
|
// #include <xtms.h>
|
||||||
|
|
||||||
#include "../4J.Common/4J_Compat.h"
|
#include "../4J.Common/4J_Compat.h"
|
||||||
|
#include "../platform/IPlatformStorage.h"
|
||||||
|
|
||||||
class C4JStringTable;
|
class C4JStringTable;
|
||||||
|
|
||||||
|
|
@ -14,23 +15,25 @@ class C4JStringTable;
|
||||||
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||||
#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE
|
#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE
|
||||||
|
|
||||||
typedef struct {
|
struct CONTAINER_METADATA {
|
||||||
time_t modifiedTime;
|
time_t modifiedTime;
|
||||||
unsigned int dataSize;
|
unsigned int dataSize;
|
||||||
unsigned int thumbnailSize;
|
unsigned int thumbnailSize;
|
||||||
} CONTAINER_METADATA;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct SAVE_INFO {
|
||||||
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||||
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||||
CONTAINER_METADATA metaData;
|
CONTAINER_METADATA metaData;
|
||||||
std::uint8_t* thumbnailData;
|
std::uint8_t* thumbnailData;
|
||||||
} SAVE_INFO, *PSAVE_INFO;
|
};
|
||||||
|
using PSAVE_INFO = SAVE_INFO*;
|
||||||
|
|
||||||
typedef struct {
|
struct SAVE_DETAILS {
|
||||||
int iSaveC;
|
int iSaveC;
|
||||||
PSAVE_INFO SaveInfoA;
|
PSAVE_INFO SaveInfoA;
|
||||||
} SAVE_DETAILS, *PSAVE_DETAILS;
|
};
|
||||||
|
using PSAVE_DETAILS = SAVE_DETAILS*;
|
||||||
|
|
||||||
typedef std::vector<PXMARKETPLACE_CONTENTOFFER_INFO> OfferDataArray;
|
typedef std::vector<PXMARKETPLACE_CONTENTOFFER_INFO> OfferDataArray;
|
||||||
typedef std::vector<PXCONTENT_DATA> XContentDataArray;
|
typedef std::vector<PXCONTENT_DATA> XContentDataArray;
|
||||||
|
|
@ -39,89 +42,32 @@ typedef std::vector<PXCONTENT_DATA> XContentDataArray;
|
||||||
// Current version of the dlc data creator
|
// Current version of the dlc data creator
|
||||||
#define CURRENT_DLC_VERSION_NUM 3
|
#define CURRENT_DLC_VERSION_NUM 3
|
||||||
|
|
||||||
class C4JStorage {
|
class C4JStorage : public IPlatformStorage {
|
||||||
public:
|
public:
|
||||||
// Structs defined in the DLC_Creator, but added here to be used in the app
|
struct DLC_FILE_DETAILS {
|
||||||
typedef struct {
|
|
||||||
unsigned int uiFileSize;
|
unsigned int uiFileSize;
|
||||||
std::uint32_t dwType;
|
std::uint32_t dwType;
|
||||||
std::uint32_t dwWchCount; // count of wchar_t in next array
|
std::uint32_t dwWchCount;
|
||||||
wchar_t wchFile[1];
|
wchar_t wchFile[1];
|
||||||
} DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
|
};
|
||||||
|
using PDLC_FILE_DETAILS = DLC_FILE_DETAILS*;
|
||||||
|
|
||||||
typedef struct {
|
struct DLC_FILE_PARAM {
|
||||||
std::uint32_t dwType;
|
std::uint32_t dwType;
|
||||||
std::uint32_t dwWchCount; // count of wchar_t in next array;
|
std::uint32_t dwWchCount;
|
||||||
wchar_t wchData[1]; // will be an array of size dwBytes
|
wchar_t wchData[1];
|
||||||
} DLC_FILE_PARAM, *PDLC_FILE_PARAM;
|
};
|
||||||
// End of DLC_Creator structs
|
using PDLC_FILE_PARAM = DLC_FILE_PARAM*;
|
||||||
|
|
||||||
typedef struct {
|
struct CACHEINFOSTRUCT {
|
||||||
wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
||||||
char szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
char szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
||||||
std::uint32_t dwImageOffset;
|
std::uint32_t dwImageOffset;
|
||||||
std::uint32_t dwImageBytes;
|
std::uint32_t dwImageBytes;
|
||||||
} CACHEINFOSTRUCT;
|
};
|
||||||
|
|
||||||
// structure to hold DLC info in TMS
|
|
||||||
typedef struct {
|
|
||||||
std::uint32_t dwVersion;
|
|
||||||
std::uint32_t dwNewOffers;
|
|
||||||
std::uint32_t dwTotalOffers;
|
|
||||||
std::uint32_t dwInstalledTotalOffers;
|
|
||||||
std::uint8_t bPadding[1024 - sizeof(std::uint32_t) * 4];
|
|
||||||
// future expansion
|
|
||||||
} DLC_TMS_DETAILS;
|
|
||||||
|
|
||||||
enum eGTS_FileTypes { eGTS_Type_Skin = 0, eGTS_Type_Cape, eGTS_Type_MAX };
|
enum eGTS_FileTypes { eGTS_Type_Skin = 0, eGTS_Type_Cape, eGTS_Type_MAX };
|
||||||
|
|
||||||
enum eGlobalStorage {
|
|
||||||
// eGlobalStorage_GameClip=0,
|
|
||||||
eGlobalStorage_Title = 0,
|
|
||||||
eGlobalStorage_TitleUser,
|
|
||||||
eGlobalStorage_Max
|
|
||||||
};
|
|
||||||
|
|
||||||
enum EMessageResult {
|
|
||||||
EMessage_Undefined = 0,
|
|
||||||
EMessage_Busy,
|
|
||||||
EMessage_Pending,
|
|
||||||
EMessage_Cancelled,
|
|
||||||
EMessage_ResultAccept,
|
|
||||||
EMessage_ResultDecline,
|
|
||||||
EMessage_ResultThirdOption,
|
|
||||||
EMessage_ResultFourthOption
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ESaveGameControlState {
|
|
||||||
ESaveGameControl_Idle = 0,
|
|
||||||
ESaveGameControl_Save,
|
|
||||||
ESaveGameControl_InternalRequestingDevice,
|
|
||||||
ESaveGameControl_InternalGetSaveName,
|
|
||||||
ESaveGameControl_InternalSaving,
|
|
||||||
ESaveGameControl_CopySave,
|
|
||||||
ESaveGameControl_CopyingSave,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ESaveGameState {
|
|
||||||
ESaveGame_Idle = 0,
|
|
||||||
ESaveGame_Save,
|
|
||||||
ESaveGame_InternalRequestingDevice,
|
|
||||||
ESaveGame_InternalGetSaveName,
|
|
||||||
ESaveGame_InternalSaving,
|
|
||||||
ESaveGame_CopySave,
|
|
||||||
ESaveGame_CopyingSave,
|
|
||||||
ESaveGame_Load,
|
|
||||||
ESaveGame_GetSavesInfo,
|
|
||||||
ESaveGame_Rename,
|
|
||||||
ESaveGame_Delete,
|
|
||||||
|
|
||||||
ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4,
|
|
||||||
// but the game expects this to be returned
|
|
||||||
// to indicate success when getting a
|
|
||||||
// thumbnail
|
|
||||||
|
|
||||||
};
|
|
||||||
enum ELoadGameStatus {
|
enum ELoadGameStatus {
|
||||||
ELoadGame_Idle = 0,
|
ELoadGame_Idle = 0,
|
||||||
ELoadGame_InProgress,
|
ELoadGame_InProgress,
|
||||||
|
|
@ -142,60 +88,20 @@ public:
|
||||||
ESGIStatus_NoSaves,
|
ESGIStatus_NoSaves,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EDLCStatus {
|
|
||||||
EDLC_Error = 0,
|
|
||||||
EDLC_Idle,
|
|
||||||
EDLC_NoOffers,
|
|
||||||
EDLC_AlreadyEnumeratedAllOffers,
|
|
||||||
EDLC_NoInstalledDLC,
|
|
||||||
EDLC_Pending,
|
|
||||||
EDLC_LoadInProgress,
|
|
||||||
EDLC_Loaded,
|
|
||||||
EDLC_ChangedDevice
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ESavingMessage {
|
|
||||||
ESavingMessage_None = 0,
|
|
||||||
ESavingMessage_Short,
|
|
||||||
ESavingMessage_Long
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ETMSStatus {
|
|
||||||
ETMSStatus_Idle = 0,
|
|
||||||
ETMSStatus_Fail,
|
|
||||||
ETMSStatus_Fail_ReadInProgress,
|
|
||||||
ETMSStatus_Fail_WriteInProgress,
|
|
||||||
ETMSStatus_Pending,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum eTMS_FileType {
|
|
||||||
eTMS_FileType_Normal = 0,
|
|
||||||
eTMS_FileType_Graphic,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum eTMS_FILETYPEVAL {
|
|
||||||
TMS_FILETYPE_BINARY,
|
|
||||||
TMS_FILETYPE_CONFIG,
|
|
||||||
TMS_FILETYPE_JSON,
|
|
||||||
TMS_FILETYPE_MAX
|
|
||||||
};
|
|
||||||
enum eTMS_UGCTYPE { TMS_UGCTYPE_NONE, TMS_UGCTYPE_IMAGE, TMS_UGCTYPE_MAX };
|
enum eTMS_UGCTYPE { TMS_UGCTYPE_NONE, TMS_UGCTYPE_IMAGE, TMS_UGCTYPE_MAX };
|
||||||
|
|
||||||
typedef struct {
|
struct TMSPP_FILE_DETAILS {
|
||||||
char szFilename[256];
|
char szFilename[256];
|
||||||
int iFileSize;
|
int iFileSize;
|
||||||
eTMS_FILETYPEVAL eFileTypeVal;
|
eTMS_FILETYPEVAL eFileTypeVal;
|
||||||
} TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS;
|
};
|
||||||
|
using PTMSPP_FILE_DETAILS = TMSPP_FILE_DETAILS*;
|
||||||
|
|
||||||
typedef struct {
|
struct TMSPP_FILE_LIST {
|
||||||
int iCount;
|
int iCount;
|
||||||
PTMSPP_FILE_DETAILS FileDetailsA;
|
PTMSPP_FILE_DETAILS FileDetailsA;
|
||||||
} TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
|
};
|
||||||
|
using PTMSPP_FILE_LIST = TMSPP_FILE_LIST*;
|
||||||
typedef struct {
|
|
||||||
unsigned int size;
|
|
||||||
std::uint8_t* pbData;
|
|
||||||
} TMSPP_FILEDATA, *PTMSPP_FILEDATA;
|
|
||||||
|
|
||||||
C4JStorage();
|
C4JStorage();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ CConsoleMinecraftApp app;
|
||||||
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() {}
|
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() {}
|
||||||
|
|
||||||
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) {
|
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) {
|
||||||
ProfileManager.SetRichPresenceContextValue(iPad, CONTEXT_GAME_STATE,
|
|
||||||
contextId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConsoleMinecraftApp::StoreLaunchData() {}
|
void CConsoleMinecraftApp::StoreLaunchData() {}
|
||||||
|
|
|
||||||
|
|
@ -655,7 +655,7 @@ void Minecraft::updatePlayerViewportAssignments() {
|
||||||
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
||||||
if (localplayers[i] != nullptr) {
|
if (localplayers[i] != nullptr) {
|
||||||
// Primary player settings decide what the mode is
|
// Primary player settings decide what the mode is
|
||||||
if (app.GetGameSettings(ProfileManager.GetPrimaryPad(),
|
if (app.GetGameSettings(InputManager.GetPrimaryPad(),
|
||||||
eGameSetting_SplitScreenVertical)) {
|
eGameSetting_SplitScreenVertical)) {
|
||||||
localplayers[i]->m_iScreenSection =
|
localplayers[i]->m_iScreenSection =
|
||||||
C4JRender::VIEWPORT_TYPE_SPLIT_LEFT + found;
|
C4JRender::VIEWPORT_TYPE_SPLIT_LEFT + found;
|
||||||
|
|
@ -926,7 +926,7 @@ void Minecraft::removeLocalPlayerIdx(int idx) {
|
||||||
}
|
}
|
||||||
localplayers[idx] = nullptr;
|
localplayers[idx] = nullptr;
|
||||||
|
|
||||||
if (idx == ProfileManager.GetPrimaryPad()) {
|
if (idx == InputManager.GetPrimaryPad()) {
|
||||||
// We should never try to remove the Primary player in this way
|
// We should never try to remove the Primary player in this way
|
||||||
assert(false);
|
assert(false);
|
||||||
/*
|
/*
|
||||||
|
|
@ -957,9 +957,9 @@ void Minecraft::createPrimaryLocalPlayer(int iPad) {
|
||||||
localplayers[iPad] = player;
|
localplayers[iPad] = player;
|
||||||
// gameRenderer->itemInHandRenderer = localitemInHandRenderers[iPad];
|
// gameRenderer->itemInHandRenderer = localitemInHandRenderers[iPad];
|
||||||
// Give them the gamertag if they're signed in
|
// Give them the gamertag if they're signed in
|
||||||
if (ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
|
if (ProfileManager.IsSignedIn(InputManager.GetPrimaryPad())) {
|
||||||
user->name = convStringToWstring(
|
user->name = convStringToWstring(
|
||||||
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
|
ProfileManager.GetGamertag(InputManager.GetPrimaryPad()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1021,17 +1021,17 @@ void Minecraft::run_middle() {
|
||||||
// player has a app action running , or has any crafting
|
// player has a app action running , or has any crafting
|
||||||
// or containers open, don't autosave
|
// or containers open, don't autosave
|
||||||
if (!StorageManager.GetSaveDisabled() &&
|
if (!StorageManager.GetSaveDisabled() &&
|
||||||
(app.GetXuiAction(ProfileManager.GetPrimaryPad()) ==
|
(app.GetXuiAction(InputManager.GetPrimaryPad()) ==
|
||||||
eAppAction_Idle)) {
|
eAppAction_Idle)) {
|
||||||
if (!ui.IsPauseMenuDisplayed(
|
if (!ui.IsPauseMenuDisplayed(
|
||||||
ProfileManager.GetPrimaryPad()) &&
|
InputManager.GetPrimaryPad()) &&
|
||||||
!ui.IsIgnoreAutosaveMenuDisplayed(
|
!ui.IsIgnoreAutosaveMenuDisplayed(
|
||||||
ProfileManager.GetPrimaryPad())) {
|
InputManager.GetPrimaryPad())) {
|
||||||
// check if the autotimer countdown has reached
|
// check if the autotimer countdown has reached
|
||||||
// zero
|
// zero
|
||||||
unsigned char ucAutosaveVal =
|
unsigned char ucAutosaveVal =
|
||||||
app.GetGameSettings(
|
app.GetGameSettings(
|
||||||
ProfileManager.GetPrimaryPad(),
|
InputManager.GetPrimaryPad(),
|
||||||
eGameSetting_Autosave);
|
eGameSetting_Autosave);
|
||||||
bool bTrialTexturepack = false;
|
bool bTrialTexturepack = false;
|
||||||
if (!Minecraft::GetInstance()
|
if (!Minecraft::GetInstance()
|
||||||
|
|
@ -1068,7 +1068,7 @@ void Minecraft::run_middle() {
|
||||||
app.DebugPrintf("+++Autosave\n");
|
app.DebugPrintf("+++Autosave\n");
|
||||||
app.DebugPrintf("+++++++++++\n");
|
app.DebugPrintf("+++++++++++\n");
|
||||||
app.SetAction(
|
app.SetAction(
|
||||||
ProfileManager.GetPrimaryPad(),
|
InputManager.GetPrimaryPad(),
|
||||||
eAppAction_AutosaveSaveGame);
|
eAppAction_AutosaveSaveGame);
|
||||||
// app.SetAutosaveTimerTime();
|
// app.SetAutosaveTimerTime();
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
|
|
@ -1320,7 +1320,7 @@ void Minecraft::run_middle() {
|
||||||
// exist? They'll be wanting to join the game then
|
// exist? They'll be wanting to join the game then
|
||||||
bool tryJoin = !pause &&
|
bool tryJoin = !pause &&
|
||||||
!ui.IsIgnorePlayerJoinMenuDisplayed(
|
!ui.IsIgnorePlayerJoinMenuDisplayed(
|
||||||
ProfileManager.GetPrimaryPad()) &&
|
InputManager.GetPrimaryPad()) &&
|
||||||
g_NetworkManager.SessionHasSpace() &&
|
g_NetworkManager.SessionHasSpace() &&
|
||||||
RenderManager.IsHiDef() &&
|
RenderManager.IsHiDef() &&
|
||||||
InputManager.ButtonPressed(i);
|
InputManager.ButtonPressed(i);
|
||||||
|
|
@ -1531,7 +1531,7 @@ void Minecraft::run_middle() {
|
||||||
|
|
||||||
ui.HandleGameTick();
|
ui.HandleGameTick();
|
||||||
|
|
||||||
setLocalPlayerIdx(ProfileManager.GetPrimaryPad());
|
setLocalPlayerIdx(InputManager.GetPrimaryPad());
|
||||||
|
|
||||||
// 4J - added - now do the equivalent of level::animateTick,
|
// 4J - added - now do the equivalent of level::animateTick,
|
||||||
// but taking into account the positions of all our players
|
// but taking into account the positions of all our players
|
||||||
|
|
@ -1583,7 +1583,7 @@ void Minecraft::run_middle() {
|
||||||
|
|
||||||
if (!noRender) {
|
if (!noRender) {
|
||||||
bool bFirst = true;
|
bool bFirst = true;
|
||||||
int iPrimaryPad = ProfileManager.GetPrimaryPad();
|
int iPrimaryPad = InputManager.GetPrimaryPad();
|
||||||
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
||||||
if (setLocalPlayerIdx(i)) {
|
if (setLocalPlayerIdx(i)) {
|
||||||
PIXBeginNamedEvent(0, "Game render player idx %d",
|
PIXBeginNamedEvent(0, "Game render player idx %d",
|
||||||
|
|
@ -3320,7 +3320,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
|
||||||
#if defined(_DEBUG_MENUS_ENABLED)
|
#if defined(_DEBUG_MENUS_ENABLED)
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
// 4J-PB - debugoverlay for primary player only
|
// 4J-PB - debugoverlay for primary player only
|
||||||
if (iPad == ProfileManager.GetPrimaryPad()) {
|
if (iPad == InputManager.GetPrimaryPad()) {
|
||||||
if ((player->ullButtonsPressed &
|
if ((player->ullButtonsPressed &
|
||||||
(1LL << MINECRAFT_ACTION_RENDER_DEBUG))) {
|
(1LL << MINECRAFT_ACTION_RENDER_DEBUG))) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
|
|
@ -3793,7 +3793,7 @@ void Minecraft::setLevel(MultiPlayerLevel* level, int message /*=-1*/,
|
||||||
// If no player has been set, then this is the first level to be set
|
// If no player has been set, then this is the first level to be set
|
||||||
// this game, so set up a primary player & initialise some other things
|
// this game, so set up a primary player & initialise some other things
|
||||||
if (player == nullptr) {
|
if (player == nullptr) {
|
||||||
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
|
int iPrimaryPlayer = InputManager.GetPrimaryPad();
|
||||||
|
|
||||||
player = gameMode->createPlayer(level);
|
player = gameMode->createPlayer(level);
|
||||||
|
|
||||||
|
|
@ -4007,11 +4007,11 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) {
|
||||||
cameraTargetPlayer = player;
|
cameraTargetPlayer = player;
|
||||||
|
|
||||||
// 4J-PB - are we the primary player or a local player?
|
// 4J-PB - are we the primary player or a local player?
|
||||||
if (iPad == ProfileManager.GetPrimaryPad()) {
|
if (iPad == InputManager.GetPrimaryPad()) {
|
||||||
createPrimaryLocalPlayer(iPad);
|
createPrimaryLocalPlayer(iPad);
|
||||||
|
|
||||||
// update the debugoptions
|
// update the debugoptions
|
||||||
app.SetGameSettingsDebugMask(ProfileManager.GetPrimaryPad(),
|
app.SetGameSettingsDebugMask(InputManager.GetPrimaryPad(),
|
||||||
app.GetGameSettingsDebugMask(-1, true));
|
app.GetGameSettingsDebugMask(-1, true));
|
||||||
} else {
|
} else {
|
||||||
storeExtraLocalPlayer(iPad);
|
storeExtraLocalPlayer(iPad);
|
||||||
|
|
@ -4456,7 +4456,7 @@ int Minecraft::InGame_SignInReturned(void* pParam, bool bContinue, int iPad) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ProfileManager.IsSignedInLive(
|
} else if (ProfileManager.IsSignedInLive(
|
||||||
ProfileManager.GetPrimaryPad()) &&
|
InputManager.GetPrimaryPad()) &&
|
||||||
!ProfileManager.AllowedToPlayMultiplayer(iPad)) {
|
!ProfileManager.AllowedToPlayMultiplayer(iPad)) {
|
||||||
// 4J Stu - Don't allow converting to guests as we don't allow
|
// 4J Stu - Don't allow converting to guests as we don't allow
|
||||||
// any guest sign-in while in the game Fix for #66516 - TCR
|
// any guest sign-in while in the game Fix for #66516 - TCR
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
|
||||||
// 4J - this is where to set the blend factor for gui things
|
// 4J - this is where to set the blend factor for gui things
|
||||||
// use the primary player's settings
|
// use the primary player's settings
|
||||||
unsigned char ucAlpha = app.GetGameSettings(
|
unsigned char ucAlpha = app.GetGameSettings(
|
||||||
ProfileManager.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
|
InputManager.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
|
||||||
|
|
||||||
// If the user has started to navigate their quickselect bar, ignore the
|
// If the user has started to navigate their quickselect bar, ignore the
|
||||||
// alpha setting, and display at default value
|
// alpha setting, and display at default value
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ void PauseScreen::init() {
|
||||||
// 4jcraft: solves the issue of client-side only pausing in the java gui
|
// 4jcraft: solves the issue of client-side only pausing in the java gui
|
||||||
if (g_NetworkManager.IsLocalGame() &&
|
if (g_NetworkManager.IsLocalGame() &&
|
||||||
g_NetworkManager.GetPlayerCount() == 1)
|
g_NetworkManager.GetPlayerCount() == 1)
|
||||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
|
app.SetXuiServerAction(InputManager.GetPrimaryPad(),
|
||||||
eXuiServerAction_PauseServer, (void*)true);
|
eXuiServerAction_PauseServer, (void*)true);
|
||||||
buttons.push_back(new Button(1, width / 2 - 100, height / 4 + 24 * 5 + yo,
|
buttons.push_back(new Button(1, width / 2 - 100, height / 4 + 24 * 5 + yo,
|
||||||
I18n::get(L"menu.returnToMenu")));
|
I18n::get(L"menu.returnToMenu")));
|
||||||
|
|
@ -83,7 +83,7 @@ void PauseScreen::buttonClicked(Button* button) {
|
||||||
exitWorld(minecraft, true);
|
exitWorld(minecraft, true);
|
||||||
}
|
}
|
||||||
if (button->id == 4) {
|
if (button->id == 4) {
|
||||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
|
app.SetXuiServerAction(InputManager.GetPrimaryPad(),
|
||||||
eXuiServerAction_PauseServer, (void*)false);
|
eXuiServerAction_PauseServer, (void*)false);
|
||||||
minecraft->setScreen(nullptr);
|
minecraft->setScreen(nullptr);
|
||||||
// minecraft->grabMouse(); // 4J - removed
|
// minecraft->grabMouse(); // 4J - removed
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) {
|
||||||
// unpausing is done in all scenarios
|
// unpausing is done in all scenarios
|
||||||
if (g_NetworkManager.IsLocalGame() &&
|
if (g_NetworkManager.IsLocalGame() &&
|
||||||
g_NetworkManager.GetPlayerCount() == 1)
|
g_NetworkManager.GetPlayerCount() == 1)
|
||||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
|
app.SetXuiServerAction(InputManager.GetPrimaryPad(),
|
||||||
eXuiServerAction_PauseServer, (void*)false);
|
eXuiServerAction_PauseServer, (void*)false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ ClientConnection::ClientConnection(Minecraft* minecraft, Socket* socket,
|
||||||
this->minecraft = minecraft;
|
this->minecraft = minecraft;
|
||||||
|
|
||||||
if (iUserIndex < 0) {
|
if (iUserIndex < 0) {
|
||||||
m_userIndex = ProfileManager.GetPrimaryPad();
|
m_userIndex = InputManager.GetPrimaryPad();
|
||||||
} else {
|
} else {
|
||||||
m_userIndex = iUserIndex;
|
m_userIndex = iUserIndex;
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
|
||||||
INetworkPlayer* networkPlayer = connection->getSocket()->getPlayer();
|
INetworkPlayer* networkPlayer = connection->getSocket()->getPlayer();
|
||||||
int iUserID = -1;
|
int iUserID = -1;
|
||||||
|
|
||||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) {
|
if (m_userIndex == InputManager.GetPrimaryPad()) {
|
||||||
iUserID = m_userIndex;
|
iUserID = m_userIndex;
|
||||||
} else {
|
} else {
|
||||||
if (!networkPlayer->IsGuest() && networkPlayer->IsLocal()) {
|
if (!networkPlayer->IsGuest() && networkPlayer->IsLocal()) {
|
||||||
|
|
@ -187,18 +187,18 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
|
||||||
app.SetBanListCheck(iUserID, false);
|
app.SetBanListCheck(iUserID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) {
|
if (m_userIndex == InputManager.GetPrimaryPad()) {
|
||||||
if (app.GetTutorialMode()) {
|
if (app.GetTutorialMode()) {
|
||||||
minecraft->gameMode = new FullTutorialMode(
|
minecraft->gameMode = new FullTutorialMode(
|
||||||
ProfileManager.GetPrimaryPad(), minecraft, this);
|
InputManager.GetPrimaryPad(), minecraft, this);
|
||||||
}
|
}
|
||||||
// check if we're in the trial version
|
// check if we're in the trial version
|
||||||
else if (ProfileManager.IsFullVersion() == false) {
|
else if (ProfileManager.IsFullVersion() == false) {
|
||||||
minecraft->gameMode =
|
minecraft->gameMode =
|
||||||
new TrialMode(ProfileManager.GetPrimaryPad(), minecraft, this);
|
new TrialMode(InputManager.GetPrimaryPad(), minecraft, this);
|
||||||
} else {
|
} else {
|
||||||
minecraft->gameMode = new ConsoleGameMode(
|
minecraft->gameMode = new ConsoleGameMode(
|
||||||
ProfileManager.GetPrimaryPad(), minecraft, this);
|
InputManager.GetPrimaryPad(), minecraft, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Level* dimensionLevel = minecraft->getLevel(packet->dimension);
|
Level* dimensionLevel = minecraft->getLevel(packet->dimension);
|
||||||
|
|
@ -233,7 +233,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
|
||||||
minecraft->player->setCustomSkin(app.GetPlayerSkinId(m_userIndex));
|
minecraft->player->setCustomSkin(app.GetPlayerSkinId(m_userIndex));
|
||||||
minecraft->player->setCustomCape(app.GetPlayerCapeId(m_userIndex));
|
minecraft->player->setCustomCape(app.GetPlayerCapeId(m_userIndex));
|
||||||
|
|
||||||
minecraft->createPrimaryLocalPlayer(ProfileManager.GetPrimaryPad());
|
minecraft->createPrimaryLocalPlayer(InputManager.GetPrimaryPad());
|
||||||
|
|
||||||
minecraft->player->dimension = packet->dimension;
|
minecraft->player->dimension = packet->dimension;
|
||||||
minecraft->setScreen(new ReceivingLevelScreen(this));
|
minecraft->setScreen(new ReceivingLevelScreen(this));
|
||||||
|
|
@ -258,7 +258,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
|
||||||
displayPrivilegeChanges(minecraft->player, startingPrivileges);
|
displayPrivilegeChanges(minecraft->player, startingPrivileges);
|
||||||
|
|
||||||
// update the debugoptions
|
// update the debugoptions
|
||||||
app.SetGameSettingsDebugMask(ProfileManager.GetPrimaryPad(),
|
app.SetGameSettingsDebugMask(InputManager.GetPrimaryPad(),
|
||||||
app.GetGameSettingsDebugMask(-1, true));
|
app.GetGameSettingsDebugMask(-1, true));
|
||||||
} else {
|
} else {
|
||||||
// 4J-PB - this isn't the level we want
|
// 4J-PB - this isn't the level we want
|
||||||
|
|
@ -1238,12 +1238,12 @@ void ClientConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
|
||||||
if (g_NetworkManager.IsHost() &&
|
if (g_NetworkManager.IsHost() &&
|
||||||
(reason == DisconnectPacket::eDisconnect_TimeOut ||
|
(reason == DisconnectPacket::eDisconnect_TimeOut ||
|
||||||
reason == DisconnectPacket::eDisconnect_Overflow) &&
|
reason == DisconnectPacket::eDisconnect_Overflow) &&
|
||||||
m_userIndex == ProfileManager.GetPrimaryPad() &&
|
m_userIndex == InputManager.GetPrimaryPad() &&
|
||||||
!MinecraftServer::saveOnExitAnswered()) {
|
!MinecraftServer::saveOnExitAnswered()) {
|
||||||
unsigned int uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0] = IDS_CONFIRM_OK;
|
uiIDA[0] = IDS_CONFIRM_OK;
|
||||||
ui.RequestErrorMessage(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1,
|
ui.RequestErrorMessage(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1,
|
||||||
ProfileManager.GetPrimaryPad(),
|
InputManager.GetPrimaryPad(),
|
||||||
&ClientConnection::HostDisconnectReturned,
|
&ClientConnection::HostDisconnectReturned,
|
||||||
nullptr);
|
nullptr);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1812,7 +1812,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
|
||||||
// 4J-PB - if we go straight in from the menus via an invite, we won't
|
// 4J-PB - if we go straight in from the menus via an invite, we won't
|
||||||
// have the DLC info
|
// have the DLC info
|
||||||
if (app.GetTMSGlobalFileListRead() == false) {
|
if (app.GetTMSGlobalFileListRead() == false) {
|
||||||
app.SetTMSAction(ProfileManager.GetPrimaryPad(),
|
app.SetTMSAction(InputManager.GetPrimaryPad(),
|
||||||
eTMSAction_TMSPP_RetrieveFiles_RunPlayGame);
|
eTMSAction_TMSPP_RetrieveFiles_RunPlayGame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1827,7 +1827,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
|
||||||
cantPlayContentRestricted) {
|
cantPlayContentRestricted) {
|
||||||
DisconnectPacket::eDisconnectReason reason =
|
DisconnectPacket::eDisconnectReason reason =
|
||||||
DisconnectPacket::eDisconnect_NoUGC_Remote;
|
DisconnectPacket::eDisconnect_NoUGC_Remote;
|
||||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) {
|
if (m_userIndex == InputManager.GetPrimaryPad()) {
|
||||||
if (!isFriendsWithHost)
|
if (!isFriendsWithHost)
|
||||||
reason = DisconnectPacket::eDisconnect_NotFriendsWithHost;
|
reason = DisconnectPacket::eDisconnect_NotFriendsWithHost;
|
||||||
else if (!isAtLeastOneFriend)
|
else if (!isAtLeastOneFriend)
|
||||||
|
|
@ -1843,7 +1843,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
|
||||||
"privileges: %d\n",
|
"privileges: %d\n",
|
||||||
reason);
|
reason);
|
||||||
app.SetDisconnectReason(reason);
|
app.SetDisconnectReason(reason);
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
|
app.SetAction(InputManager.GetPrimaryPad(), eAppAction_ExitWorld,
|
||||||
(void*)true);
|
(void*)true);
|
||||||
} else {
|
} else {
|
||||||
if (!isFriendsWithHost)
|
if (!isFriendsWithHost)
|
||||||
|
|
@ -1890,7 +1890,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
|
||||||
// send this before the LoginPacket so that it gets handled first, as
|
// send this before the LoginPacket so that it gets handled first, as
|
||||||
// once the LoginPacket is received on the client the game is close to
|
// once the LoginPacket is received on the client the game is close to
|
||||||
// starting
|
// starting
|
||||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) {
|
if (m_userIndex == InputManager.GetPrimaryPad()) {
|
||||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||||
if (pMinecraft->skins->selectTexturePackById(
|
if (pMinecraft->skins->selectTexturePackById(
|
||||||
packet->m_texturePackId)) {
|
packet->m_texturePackId)) {
|
||||||
|
|
@ -2890,12 +2890,12 @@ void ClientConnection::handleGameEvent(
|
||||||
app.DebugPrintf("handleGameEvent packet for WIN_GAME - %d\n",
|
app.DebugPrintf("handleGameEvent packet for WIN_GAME - %d\n",
|
||||||
m_userIndex);
|
m_userIndex);
|
||||||
// This just allows it to be shown
|
// This just allows it to be shown
|
||||||
if (minecraft->localgameModes[ProfileManager.GetPrimaryPad()] !=
|
if (minecraft->localgameModes[InputManager.GetPrimaryPad()] !=
|
||||||
nullptr)
|
nullptr)
|
||||||
minecraft->localgameModes[ProfileManager.GetPrimaryPad()]
|
minecraft->localgameModes[InputManager.GetPrimaryPad()]
|
||||||
->getTutorial()
|
->getTutorial()
|
||||||
->showTutorialPopup(false);
|
->showTutorialPopup(false);
|
||||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_EndPoem,
|
ui.NavigateToScene(InputManager.GetPrimaryPad(), eUIScene_EndPoem,
|
||||||
nullptr, eUILayer_Scene, eUIGroup_Fullscreen);
|
nullptr, eUILayer_Scene, eUIGroup_Fullscreen);
|
||||||
} else if (event == GameEventPacket::START_SAVING) {
|
} else if (event == GameEventPacket::START_SAVING) {
|
||||||
if (!g_NetworkManager.IsHost()) {
|
if (!g_NetworkManager.IsHost()) {
|
||||||
|
|
@ -2903,7 +2903,7 @@ void ClientConnection::handleGameEvent(
|
||||||
// back-to-back START/STOP packets leave the client stuck in the
|
// back-to-back START/STOP packets leave the client stuck in the
|
||||||
// loading screen
|
// loading screen
|
||||||
app.SetGameStarted(false);
|
app.SetGameStarted(false);
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(),
|
app.SetAction(InputManager.GetPrimaryPad(),
|
||||||
eAppAction_RemoteServerSave);
|
eAppAction_RemoteServerSave);
|
||||||
}
|
}
|
||||||
} else if (event == GameEventPacket::STOP_SAVING) {
|
} else if (event == GameEventPacket::STOP_SAVING) {
|
||||||
|
|
@ -3338,7 +3338,7 @@ int ClientConnection::HostDisconnectReturned(
|
||||||
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
||||||
uiIDA[1] = IDS_CONFIRM_OK;
|
uiIDA[1] = IDS_CONFIRM_OK;
|
||||||
ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME,
|
ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME,
|
||||||
uiIDA, 2, ProfileManager.GetPrimaryPad(),
|
uiIDA, 2, InputManager.GetPrimaryPad(),
|
||||||
&ClientConnection::ExitGameAndSaveReturned,
|
&ClientConnection::ExitGameAndSaveReturned,
|
||||||
nullptr);
|
nullptr);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3357,7 +3357,7 @@ int ClientConnection::ExitGameAndSaveReturned(
|
||||||
// int32_t saveOrCheckpointId = 0;
|
// int32_t saveOrCheckpointId = 0;
|
||||||
// bool validSave =
|
// bool validSave =
|
||||||
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
|
// SentientManager.RecordLevelSaveOrCheckpoint(InputManager.GetPrimaryPad(),
|
||||||
// saveOrCheckpointId);
|
// saveOrCheckpointId);
|
||||||
MinecraftServer::getInstance()->setSaveOnExit(true);
|
MinecraftServer::getInstance()->setSaveOnExit(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) {
|
||||||
(Tile::tiles[t]->getDestroyProgress(
|
(Tile::tiles[t]->getDestroyProgress(
|
||||||
minecraft->player, minecraft->player->level, x, y, z) >= 1
|
minecraft->player, minecraft->player->level, x, y, z) >= 1
|
||||||
// ||(app.DebugSettingsOn() &&
|
// ||(app.DebugSettingsOn() &&
|
||||||
// app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_InstantDestroy))
|
// app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad())&(1L<<eDebugSetting_InstantDestroy))
|
||||||
)) {
|
)) {
|
||||||
destroyBlock(x, y, z, face);
|
destroyBlock(x, y, z, face);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ void MultiPlayerLevel::tick() {
|
||||||
#if !defined(_FINAL_BUILD)
|
#if !defined(_FINAL_BUILD)
|
||||||
bool freezeTime =
|
bool freezeTime =
|
||||||
app.DebugSettingsOn() &&
|
app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime);
|
(1L << eDebugSetting_FreezeTime);
|
||||||
if (!freezeTime)
|
if (!freezeTime)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ void MultiplayerLocalPlayer::tick() {
|
||||||
// 4J Added
|
// 4J Added
|
||||||
// 4J-PB - changing this to a game host option ot hide gamertags
|
// 4J-PB - changing this to a game host option ot hide gamertags
|
||||||
// bool bIsisPrimaryHost=g_NetworkManager.IsHost() &&
|
// bool bIsisPrimaryHost=g_NetworkManager.IsHost() &&
|
||||||
// (ProfileManager.GetPrimaryPad()==m_iPad);
|
// (InputManager.GetPrimaryPad()==m_iPad);
|
||||||
|
|
||||||
/*if((app.GetGameSettings(m_iPad,eGameSetting_PlayerVisibleInMap)!=0) !=
|
/*if((app.GetGameSettings(m_iPad,eGameSetting_PlayerVisibleInMap)!=0) !=
|
||||||
m_bShownOnMaps)
|
m_bShownOnMaps)
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ void GameRenderer::tick(bool first) // 4J - add bFirst
|
||||||
1.0f / ((float)SharedConstants::TICKS_PER_SECOND * 4);
|
1.0f / ((float)SharedConstants::TICKS_PER_SECOND * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc->player != mc->localplayers[ProfileManager.GetPrimaryPad()])
|
if (mc->player != mc->localplayers[InputManager.GetPrimaryPad()])
|
||||||
return; // 4J added for split screen - only do rest of processing for
|
return; // 4J added for split screen - only do rest of processing for
|
||||||
// once per frame
|
// once per frame
|
||||||
|
|
||||||
|
|
@ -1192,7 +1192,7 @@ void GameRenderer::renderLevel(float a, int64_t until) {
|
||||||
// view whatever they have loaded in - we're sharing render data between
|
// view whatever they have loaded in - we're sharing render data between
|
||||||
// players.
|
// players.
|
||||||
bool updateChunks =
|
bool updateChunks =
|
||||||
(mc->player == mc->localplayers[ProfileManager.GetPrimaryPad()]);
|
(mc->player == mc->localplayers[InputManager.GetPrimaryPad()]);
|
||||||
|
|
||||||
// if (mc->cameraTargetPlayer == nullptr) // 4J - removed condition as we
|
// if (mc->cameraTargetPlayer == nullptr) // 4J - removed condition as we
|
||||||
// want to update this is mc->player changes for different local players
|
// want to update this is mc->player changes for different local players
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,7 @@ void LevelRenderer::setLevel(int playerIndex, MultiPlayerLevel* level) {
|
||||||
// tile entities in the world dissappear We should only do this when
|
// tile entities in the world dissappear We should only do this when
|
||||||
// actually exiting the game, so only when the primary player sets there
|
// actually exiting the game, so only when the primary player sets there
|
||||||
// level to nullptr
|
// level to nullptr
|
||||||
if (playerIndex == ProfileManager.GetPrimaryPad()) {
|
if (playerIndex == InputManager.GetPrimaryPad()) {
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_csRenderableTileEntities);
|
std::lock_guard<std::mutex> lock(m_csRenderableTileEntities);
|
||||||
renderableTileEntities.clear();
|
renderableTileEntities.clear();
|
||||||
|
|
@ -1117,7 +1117,7 @@ void LevelRenderer::renderClouds(float alpha) {
|
||||||
int playerIndex = mc->player->GetXboxPad();
|
int playerIndex = mc->player->GetXboxPad();
|
||||||
|
|
||||||
// if the primary player has clouds off, so do all players on this machine
|
// if the primary player has clouds off, so do all players on this machine
|
||||||
if (app.GetGameSettings(ProfileManager.GetPrimaryPad(),
|
if (app.GetGameSettings(InputManager.GetPrimaryPad(),
|
||||||
eGameSetting_Clouds) == 0) {
|
eGameSetting_Clouds) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1131,7 +1131,7 @@ void LevelRenderer::renderClouds(float alpha) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime)) {
|
(1L << eDebugSetting_FreezeTime)) {
|
||||||
iTicks = m_freezeticks;
|
iTicks = m_freezeticks;
|
||||||
}
|
}
|
||||||
|
|
@ -1209,7 +1209,7 @@ void LevelRenderer::renderClouds(float alpha) {
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
if (!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (!(app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime))) {
|
(1L << eDebugSetting_FreezeTime))) {
|
||||||
m_freezeticks = iTicks;
|
m_freezeticks = iTicks;
|
||||||
}
|
}
|
||||||
|
|
@ -1395,7 +1395,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) {
|
||||||
int iTicks = ticks;
|
int iTicks = ticks;
|
||||||
|
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime)) {
|
(1L << eDebugSetting_FreezeTime)) {
|
||||||
iTicks = m_freezeticks;
|
iTicks = m_freezeticks;
|
||||||
}
|
}
|
||||||
|
|
@ -1642,7 +1642,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) {
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
if (!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (!(app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime))) {
|
(1L << eDebugSetting_FreezeTime))) {
|
||||||
m_freezeticks = iTicks;
|
m_freezeticks = iTicks;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ void DLCTexturePack::loadData() {
|
||||||
int mountIndex = m_dlcInfoPack->GetDLCMountIndex();
|
int mountIndex = m_dlcInfoPack->GetDLCMountIndex();
|
||||||
|
|
||||||
if (mountIndex > -1) {
|
if (mountIndex > -1) {
|
||||||
if (StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),
|
if (StorageManager.MountInstalledDLC(InputManager.GetPrimaryPad(),
|
||||||
mountIndex,
|
mountIndex,
|
||||||
&DLCTexturePack::packMounted, this,
|
&DLCTexturePack::packMounted, this,
|
||||||
"TPACK") != ERROR_IO_PENDING) {
|
"TPACK") != ERROR_IO_PENDING) {
|
||||||
|
|
@ -227,7 +227,7 @@ void DLCTexturePack::loadData() {
|
||||||
if (app.getLevelGenerationOptions())
|
if (app.getLevelGenerationOptions())
|
||||||
app.getLevelGenerationOptions()->setLoadedData();
|
app.getLevelGenerationOptions()->setLoadedData();
|
||||||
app.DebugPrintf("Failed to mount texture pack DLC %d for pad %d\n",
|
app.DebugPrintf("Failed to mount texture pack DLC %d for pad %d\n",
|
||||||
mountIndex, ProfileManager.GetPrimaryPad());
|
mountIndex, InputManager.GetPrimaryPad());
|
||||||
} else {
|
} else {
|
||||||
m_bLoadingData = true;
|
m_bLoadingData = true;
|
||||||
app.DebugPrintf("Attempted to mount DLC data for texture pack %d\n",
|
app.DebugPrintf("Attempted to mount DLC data for texture pack %d\n",
|
||||||
|
|
@ -237,7 +237,7 @@ void DLCTexturePack::loadData() {
|
||||||
m_bHasLoadedData = true;
|
m_bHasLoadedData = true;
|
||||||
if (app.getLevelGenerationOptions())
|
if (app.getLevelGenerationOptions())
|
||||||
app.getLevelGenerationOptions()->setLoadedData();
|
app.getLevelGenerationOptions()->setLoadedData();
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(),
|
app.SetAction(InputManager.GetPrimaryPad(),
|
||||||
eAppAction_ReloadTexturePack);
|
eAppAction_ReloadTexturePack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -382,7 +382,7 @@ int DLCTexturePack::packMounted(void* pParam, int iPad, std::uint32_t dwErr,
|
||||||
texturePack->m_bHasLoadedData = true;
|
texturePack->m_bHasLoadedData = true;
|
||||||
if (app.getLevelGenerationOptions())
|
if (app.getLevelGenerationOptions())
|
||||||
app.getLevelGenerationOptions()->setLoadedData();
|
app.getLevelGenerationOptions()->setLoadedData();
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ReloadTexturePack);
|
app.SetAction(InputManager.GetPrimaryPad(), eAppAction_ReloadTexturePack);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) {
|
||||||
selectSkin(newPack);
|
selectSkin(newPack);
|
||||||
|
|
||||||
if (newPack->hasData()) {
|
if (newPack->hasData()) {
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(),
|
app.SetAction(InputManager.GetPrimaryPad(),
|
||||||
eAppAction_ReloadTexturePack);
|
eAppAction_ReloadTexturePack);
|
||||||
} else {
|
} else {
|
||||||
newPack->loadData();
|
newPack->loadData();
|
||||||
|
|
@ -169,7 +169,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) {
|
||||||
#endif
|
#endif
|
||||||
// Fail safely
|
// Fail safely
|
||||||
if (selectSkin(DEFAULT_TEXTURE_PACK)) {
|
if (selectSkin(DEFAULT_TEXTURE_PACK)) {
|
||||||
app.SetAction(ProfileManager.GetPrimaryPad(),
|
app.SetAction(InputManager.GetPrimaryPad(),
|
||||||
eAppAction_ReloadTexturePack);
|
eAppAction_ReloadTexturePack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -799,7 +799,7 @@ void MinecraftServer::saveAllChunks() {
|
||||||
void MinecraftServer::saveGameRules() {
|
void MinecraftServer::saveGameRules() {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_DistributableSave)) {
|
(1L << eDebugSetting_DistributableSave)) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else
|
} else
|
||||||
|
|
@ -883,7 +883,7 @@ void MinecraftServer::stopServer(bool didInit) {
|
||||||
// also need to check for a profile switch here - primary player signs out,
|
// also need to check for a profile switch here - primary player signs out,
|
||||||
// and another player signs in before dismissing the dash
|
// and another player signs in before dismissing the dash
|
||||||
if ((m_bPrimaryPlayerSignedOut == false) &&
|
if ((m_bPrimaryPlayerSignedOut == false) &&
|
||||||
ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
|
ProfileManager.IsSignedIn(InputManager.GetPrimaryPad())) {
|
||||||
// if trial version or saving is disabled, then don't save anything.
|
// if trial version or saving is disabled, then don't save anything.
|
||||||
// Also don't save anything if we didn't actually get through the server
|
// Also don't save anything if we didn't actually get through the server
|
||||||
// initialisation.
|
// initialisation.
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ void ServerLevel::tick() {
|
||||||
#if !defined(_FINAL_BUILD)
|
#if !defined(_FINAL_BUILD)
|
||||||
bool freezeTime =
|
bool freezeTime =
|
||||||
app.DebugSettingsOn() &&
|
app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_FreezeTime);
|
(1L << eDebugSetting_FreezeTime);
|
||||||
if (!freezeTime)
|
if (!freezeTime)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -507,7 +507,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) {
|
||||||
void ServerPlayer::doTickB() {
|
void ServerPlayer::doTickB() {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
// check if there's a debug dimension change requested
|
// check if there's a debug dimension change requested
|
||||||
// if(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_GoToNether))
|
// if(app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad())&(1L<<eDebugSetting_GoToNether))
|
||||||
//{
|
//{
|
||||||
// if(level->dimension->id == 0 )
|
// if(level->dimension->id == 0 )
|
||||||
// {
|
// {
|
||||||
|
|
@ -515,11 +515,11 @@ void ServerPlayer::doTickB() {
|
||||||
// portalTime=1;
|
// portalTime=1;
|
||||||
// }
|
// }
|
||||||
// unsigned int
|
// unsigned int
|
||||||
// uiVal=app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad());
|
// uiVal=app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad());
|
||||||
// app.SetGameSettingsDebugMask(ProfileManager.GetPrimaryPad(),uiVal&~(1L<<eDebugSetting_GoToNether));
|
// app.SetGameSettingsDebugMask(InputManager.GetPrimaryPad(),uiVal&~(1L<<eDebugSetting_GoToNether));
|
||||||
//}
|
//}
|
||||||
// else if
|
// else if
|
||||||
// (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_GoToEnd))
|
// (app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad())&(1L<<eDebugSetting_GoToEnd))
|
||||||
// {
|
// {
|
||||||
// if(level->dimension->id == 0 )
|
// if(level->dimension->id == 0 )
|
||||||
// {
|
// {
|
||||||
|
|
@ -527,20 +527,20 @@ void ServerPlayer::doTickB() {
|
||||||
// std::dynamic_pointer_cast<ServerPlayer>( shared_from_this() ), 1 );
|
// std::dynamic_pointer_cast<ServerPlayer>( shared_from_this() ), 1 );
|
||||||
// }
|
// }
|
||||||
// unsigned int
|
// unsigned int
|
||||||
// uiVal=app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad());
|
// uiVal=app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad());
|
||||||
// app.SetGameSettingsDebugMask(ProfileManager.GetPrimaryPad(),uiVal&~(1L<<eDebugSetting_GoToEnd));
|
// app.SetGameSettingsDebugMask(InputManager.GetPrimaryPad(),uiVal&~(1L<<eDebugSetting_GoToEnd));
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_GoToOverworld)) {
|
(1L << eDebugSetting_GoToOverworld)) {
|
||||||
if (level->dimension->id != 0) {
|
if (level->dimension->id != 0) {
|
||||||
isInsidePortal = true;
|
isInsidePortal = true;
|
||||||
portalTime = 1;
|
portalTime = 1;
|
||||||
}
|
}
|
||||||
unsigned int uiVal =
|
unsigned int uiVal =
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad());
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad());
|
||||||
app.SetGameSettingsDebugMask(
|
app.SetGameSettingsDebugMask(
|
||||||
ProfileManager.GetPrimaryPad(),
|
InputManager.GetPrimaryPad(),
|
||||||
uiVal & ~(1L << eDebugSetting_GoToOverworld));
|
uiVal & ~(1L << eDebugSetting_GoToOverworld));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,6 @@ void StatsCounter::save(int player, bool force) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileManager.WriteToProfile(player, true, force);
|
|
||||||
|
|
||||||
saveCounter = SAVE_DELAY;
|
saveCounter = SAVE_DELAY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ MobGroupData* Ocelot::finalizeMobSpawn(
|
||||||
setTame(true);
|
setTame(true);
|
||||||
setCatType(extraData - 1);
|
setCatType(extraData - 1);
|
||||||
setOwnerUUID(Minecraft::GetInstance()
|
setOwnerUUID(Minecraft::GetInstance()
|
||||||
->localplayers[ProfileManager.GetPrimaryPad()]
|
->localplayers[InputManager.GetPrimaryPad()]
|
||||||
->getUUID());
|
->getUUID());
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ bool EnderEyeItem::TestUse(std::shared_ptr<ItemInstance> itemInstance,
|
||||||
// app.DebugPrintf("=== FOUND stronghold in
|
// app.DebugPrintf("=== FOUND stronghold in
|
||||||
// terrain features list\n");
|
// terrain features list\n");
|
||||||
//
|
//
|
||||||
// app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_StrongholdPosition);
|
// app.SetXuiServerAction(InputManager.GetPrimaryPad(),eXuiServerAction_StrongholdPosition);
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2826,7 +2826,7 @@ void Level::tickWeather() {
|
||||||
#if !defined(_FINAL_BUILD)
|
#if !defined(_FINAL_BUILD)
|
||||||
// debug setting added to disable weather
|
// debug setting added to disable weather
|
||||||
if (app.DebugSettingsOn()) {
|
if (app.DebugSettingsOn()) {
|
||||||
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
if (app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_DisableWeather)) {
|
(1L << eDebugSetting_DisableWeather)) {
|
||||||
levelData->setThundering(false);
|
levelData->setThundering(false);
|
||||||
levelData->setThunderTime(random->nextInt(TICKS_PER_DAY * 7) +
|
levelData->setThunderTime(random->nextInt(TICKS_PER_DAY * 7) +
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ int64_t BiomeSource::findSeed(LevelType* generator) {
|
||||||
|
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ LevelChunk* McRegionChunkStorage::load(Level* level, int x, int z) {
|
||||||
}
|
}
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (levelChunk && app.DebugSettingsOn() &&
|
if (levelChunk && app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
// 4J Stu - This will force an update of the chunk's biome array
|
// 4J Stu - This will force an update of the chunk's biome array
|
||||||
levelChunk->reloadBiomes();
|
levelChunk->reloadBiomes();
|
||||||
|
|
|
||||||
|
|
@ -470,7 +470,7 @@ LevelChunk* OldChunkStorage::load(Level* level, DataInputStream* dis) {
|
||||||
|
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
// Read the biome data from the stream, but don't use it
|
// Read the biome data from the stream, but don't use it
|
||||||
std::vector<uint8_t> dummyBiomes(levelChunk->biomes.size());
|
std::vector<uint8_t> dummyBiomes(levelChunk->biomes.size());
|
||||||
|
|
@ -584,7 +584,7 @@ LevelChunk* OldChunkStorage::load(Level* level, CompoundTag* tag) {
|
||||||
|
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ void Dimension::init() {
|
||||||
// 4J Stu - Added to enable overriding the heightmap from a loaded in data
|
// 4J Stu - Added to enable overriding the heightmap from a loaded in data
|
||||||
// file
|
// file
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
biomeSource = new BiomeSource(level);
|
biomeSource = new BiomeSource(level);
|
||||||
} else
|
} else
|
||||||
|
|
@ -86,7 +86,7 @@ ChunkSource* Dimension::createRandomLevelSource() const {
|
||||||
// 4J Stu - Added to enable overriding the heightmap from a loaded in data
|
// 4J Stu - Added to enable overriding the heightmap from a loaded in data
|
||||||
// file
|
// file
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableHeightWaterOverride)) {
|
(1L << eDebugSetting_EnableHeightWaterOverride)) {
|
||||||
return new CustomLevelSource(
|
return new CustomLevelSource(
|
||||||
level, level->getSeed(),
|
level, level->getSeed(),
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ void HellDimension::updateLightRamp() {
|
||||||
ChunkSource* HellDimension::createRandomLevelSource() const {
|
ChunkSource* HellDimension::createRandomLevelSource() const {
|
||||||
#ifdef _DEBUG_MENUS_ENABLED
|
#ifdef _DEBUG_MENUS_ENABLED
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_SuperflatNether)) {
|
(1L << eDebugSetting_SuperflatNether)) {
|
||||||
return new HellFlatLevelSource(level, level->getSeed());
|
return new HellFlatLevelSource(level, level->getSeed());
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ std::vector<std::shared_ptr<Layer>> Layer::getDefaultLayers(int64_t seed, LevelT
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
#if defined(_BIOME_OVERRIDE)
|
#if defined(_BIOME_OVERRIDE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_EnableBiomeOverride)) {
|
(1L << eDebugSetting_EnableBiomeOverride)) {
|
||||||
biomeLayer =
|
biomeLayer =
|
||||||
std::shared_ptr<BiomeOverrideLayer>(new BiomeOverrideLayer(1));
|
std::shared_ptr<BiomeOverrideLayer>(new BiomeOverrideLayer(1));
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,7 @@ void DirectoryLevelStorage::clearOldPlayerFiles() {
|
||||||
if (playerFiles != nullptr) {
|
if (playerFiles != nullptr) {
|
||||||
#if !defined(_FINAL_BUILD)
|
#if !defined(_FINAL_BUILD)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_DistributableSave)) {
|
(1L << eDebugSetting_DistributableSave)) {
|
||||||
for (unsigned int i = 0; i < playerFiles->size(); ++i) {
|
for (unsigned int i = 0; i < playerFiles->size(); ++i) {
|
||||||
FileEntry* file = playerFiles->at(i);
|
FileEntry* file = playerFiles->at(i);
|
||||||
|
|
@ -500,7 +500,7 @@ std::wstring DirectoryLevelStorage::getLevelId() { return levelId; }
|
||||||
void DirectoryLevelStorage::flushSaveFile(bool autosave) {
|
void DirectoryLevelStorage::flushSaveFile(bool autosave) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (app.DebugSettingsOn() &&
|
if (app.DebugSettingsOn() &&
|
||||||
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
|
app.GetGameSettingsDebugMask(InputManager.GetPrimaryPad()) &
|
||||||
(1L << eDebugSetting_DistributableSave)) {
|
(1L << eDebugSetting_DistributableSave)) {
|
||||||
// Delete gamerules files if it exists
|
// Delete gamerules files if it exists
|
||||||
ConsoleSavePath gameRulesFiles(GAME_RULE_SAVENAME);
|
ConsoleSavePath gameRulesFiles(GAME_RULE_SAVENAME);
|
||||||
|
|
|
||||||
111
minecraft/platform/IPlatformInput.h
Normal file
111
minecraft/platform/IPlatformInput.h
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
enum EKeyboardResult {
|
||||||
|
EKeyboard_Pending,
|
||||||
|
EKeyboard_Cancelled,
|
||||||
|
EKeyboard_ResultAccept,
|
||||||
|
EKeyboard_ResultDecline,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _STRING_VERIFY_RESPONSE {
|
||||||
|
std::uint16_t wNumStrings;
|
||||||
|
int* pStringResult;
|
||||||
|
} STRING_VERIFY_RESPONSE;
|
||||||
|
|
||||||
|
class IPlatformInput {
|
||||||
|
public:
|
||||||
|
enum EKeyboardMode {
|
||||||
|
EKeyboardMode_Default,
|
||||||
|
EKeyboardMode_Numeric,
|
||||||
|
EKeyboardMode_Password,
|
||||||
|
EKeyboardMode_Alphabet,
|
||||||
|
EKeyboardMode_Full,
|
||||||
|
EKeyboardMode_Alphabet_Extended,
|
||||||
|
EKeyboardMode_IP_Address,
|
||||||
|
EKeyboardMode_Phone
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~IPlatformInput() = default;
|
||||||
|
|
||||||
|
virtual void Initialise(int iInputStateC, unsigned char ucMapC,
|
||||||
|
unsigned char ucActionC,
|
||||||
|
unsigned char ucMenuActionC) = 0;
|
||||||
|
virtual void Tick() = 0;
|
||||||
|
virtual void SetDeadzoneAndMovementRange(unsigned int uiDeadzone,
|
||||||
|
unsigned int uiMovementRangeMax) = 0;
|
||||||
|
|
||||||
|
// Joypad mapping
|
||||||
|
virtual void SetGameJoypadMaps(unsigned char ucMap, unsigned char ucAction,
|
||||||
|
unsigned int uiActionVal) = 0;
|
||||||
|
virtual unsigned int GetGameJoypadMaps(unsigned char ucMap,
|
||||||
|
unsigned char ucAction) = 0;
|
||||||
|
virtual void SetJoypadMapVal(int iPad, unsigned char ucMap) = 0;
|
||||||
|
virtual unsigned char GetJoypadMapVal(int iPad) = 0;
|
||||||
|
virtual void SetJoypadSensitivity(int iPad, float fSensitivity) = 0;
|
||||||
|
|
||||||
|
// Input queries
|
||||||
|
virtual unsigned int GetValue(int iPad, unsigned char ucAction,
|
||||||
|
bool bRepeat = false) = 0;
|
||||||
|
virtual bool ButtonPressed(int iPad, unsigned char ucAction = 255) = 0;
|
||||||
|
virtual bool ButtonReleased(int iPad, unsigned char ucAction) = 0;
|
||||||
|
virtual bool ButtonDown(int iPad, unsigned char ucAction = 255) = 0;
|
||||||
|
|
||||||
|
// Axis remapping
|
||||||
|
virtual void SetJoypadStickAxisMap(int iPad, unsigned int uiFrom,
|
||||||
|
unsigned int uiTo) = 0;
|
||||||
|
virtual void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom,
|
||||||
|
unsigned int uiTo) = 0;
|
||||||
|
virtual void SetKeyRepeatRate(float fRepeatDelaySecs,
|
||||||
|
float fRepeatRateSecs) = 0;
|
||||||
|
virtual void SetDebugSequence(const char* chSequenceA, int (*Func)(void*),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual float GetIdleSeconds(int iPad) = 0;
|
||||||
|
virtual bool IsPadConnected(int iPad) = 0;
|
||||||
|
|
||||||
|
// Analog sticks and triggers (remapped for Southpaw etc.)
|
||||||
|
virtual float GetJoypadStick_LX(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
virtual float GetJoypadStick_LY(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
virtual float GetJoypadStick_RX(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
virtual float GetJoypadStick_RY(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
virtual unsigned char GetJoypadLTrigger(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
virtual unsigned char GetJoypadRTrigger(int iPad,
|
||||||
|
bool bCheckMenuDisplay = true) = 0;
|
||||||
|
|
||||||
|
// Menu and misc
|
||||||
|
virtual void SetMenuDisplayed(int iPad, bool bVal) = 0;
|
||||||
|
virtual bool GetMenuDisplayed(int iPad) = 0;
|
||||||
|
virtual int GetHotbarSlotPressed(int iPad) = 0;
|
||||||
|
virtual int GetScrollDelta() = 0;
|
||||||
|
|
||||||
|
// Keyboard
|
||||||
|
virtual EKeyboardResult RequestKeyboard(const wchar_t* Title,
|
||||||
|
const wchar_t* Text, int iPad,
|
||||||
|
unsigned int uiMaxChars,
|
||||||
|
int (*Func)(void*, const bool),
|
||||||
|
void* lpParam,
|
||||||
|
EKeyboardMode eMode) = 0;
|
||||||
|
virtual const char* GetText() = 0;
|
||||||
|
|
||||||
|
// String verification (TCR 92)
|
||||||
|
virtual bool VerifyStrings(wchar_t** pwStringA, int iStringC,
|
||||||
|
int (*Func)(void*, STRING_VERIFY_RESPONSE*),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual void CancelQueuedVerifyStrings(
|
||||||
|
int (*Func)(void*, STRING_VERIFY_RESPONSE*), void* lpParam) = 0;
|
||||||
|
virtual void CancelAllVerifyInProgress() = 0;
|
||||||
|
|
||||||
|
// Mouse
|
||||||
|
virtual int GetMouseX() = 0;
|
||||||
|
virtual int GetMouseY() = 0;
|
||||||
|
|
||||||
|
// Primary pad (which controller is player 1)
|
||||||
|
virtual int GetPrimaryPad() = 0;
|
||||||
|
virtual void SetPrimaryPad(int iPad) = 0;
|
||||||
|
};
|
||||||
167
minecraft/platform/IPlatformProfile.h
Normal file
167
minecraft/platform/IPlatformProfile.h
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "../4J.Common/4J_Compat.h"
|
||||||
|
|
||||||
|
class CXuiStringTable;
|
||||||
|
|
||||||
|
enum eAwardType {
|
||||||
|
eAwardType_Achievement = 0,
|
||||||
|
eAwardType_GamerPic,
|
||||||
|
eAwardType_Theme,
|
||||||
|
eAwardType_AvatarItem,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eUpsellType {
|
||||||
|
eUpsellType_Custom = 0,
|
||||||
|
eUpsellType_Achievement,
|
||||||
|
eUpsellType_GamerPic,
|
||||||
|
eUpsellType_Theme,
|
||||||
|
eUpsellType_AvatarItem,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eUpsellResponse {
|
||||||
|
eUpsellResponse_Declined,
|
||||||
|
eUpsellResponse_Accepted_NoPurchase,
|
||||||
|
eUpsellResponse_Accepted_Purchase,
|
||||||
|
};
|
||||||
|
|
||||||
|
class IPlatformProfile {
|
||||||
|
public:
|
||||||
|
struct PROFILESETTINGS {
|
||||||
|
int iYAxisInversion;
|
||||||
|
int iControllerSensitivity;
|
||||||
|
int iVibration;
|
||||||
|
bool bSwapSticks;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~IPlatformProfile() = default;
|
||||||
|
|
||||||
|
// Lifecycle
|
||||||
|
virtual void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID,
|
||||||
|
unsigned short usProfileVersion,
|
||||||
|
unsigned int uiProfileValuesC,
|
||||||
|
unsigned int uiProfileSettingsC,
|
||||||
|
std::uint32_t* pdwProfileSettingsA,
|
||||||
|
int iGameDefinedDataSizeX4,
|
||||||
|
unsigned int* puiGameDefinedDataChangedBitmask) = 0;
|
||||||
|
virtual void Tick() = 0;
|
||||||
|
|
||||||
|
// Sign-in
|
||||||
|
virtual int GetLockedProfile() = 0;
|
||||||
|
virtual void SetLockedProfile(int iProf) = 0;
|
||||||
|
virtual bool IsSignedIn(int iQuadrant) = 0;
|
||||||
|
virtual bool IsSignedInLive(int iProf) = 0;
|
||||||
|
virtual bool IsGuest(int iQuadrant) = 0;
|
||||||
|
virtual unsigned int RequestSignInUI(
|
||||||
|
bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed,
|
||||||
|
bool bMultiplayerSignIn, bool bAddUser,
|
||||||
|
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||||
|
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||||
|
virtual unsigned int DisplayOfflineProfile(
|
||||||
|
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||||
|
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||||
|
virtual unsigned int RequestConvertOfflineToGuestUI(
|
||||||
|
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||||
|
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||||
|
virtual void SetPrimaryPlayerChanged(bool bVal) = 0;
|
||||||
|
virtual bool QuerySigninStatus() = 0;
|
||||||
|
virtual void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid) = 0;
|
||||||
|
virtual bool AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2) = 0;
|
||||||
|
virtual bool XUIDIsGuest(PlayerUID xuid) = 0;
|
||||||
|
virtual bool AllowedToPlayMultiplayer(int iProf) = 0;
|
||||||
|
virtual bool GetChatAndContentRestrictions(int iPad, bool* pbChatRestricted,
|
||||||
|
bool* pbContentRestricted,
|
||||||
|
int* piAge) = 0;
|
||||||
|
|
||||||
|
// System
|
||||||
|
virtual int GetPrimaryPad() = 0;
|
||||||
|
virtual void SetPrimaryPad(int iPad) = 0;
|
||||||
|
virtual char* GetGamertag(int iPad) = 0;
|
||||||
|
virtual std::wstring GetDisplayName(int iPad) = 0;
|
||||||
|
virtual bool IsFullVersion() = 0;
|
||||||
|
virtual void SetSignInChangeCallback(
|
||||||
|
void (*Func)(void*, bool, unsigned int), void* lpParam) = 0;
|
||||||
|
virtual void SetNotificationsCallback(
|
||||||
|
void (*Func)(void*, std::uint32_t, unsigned int), void* lpParam) = 0;
|
||||||
|
virtual bool RegionIsNorthAmerica() = 0;
|
||||||
|
virtual bool LocaleIsUSorCanada() = 0;
|
||||||
|
virtual int GetLiveConnectionStatus() = 0;
|
||||||
|
virtual bool IsSystemUIDisplayed() = 0;
|
||||||
|
virtual void SetProfileReadErrorCallback(void (*Func)(void*),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
|
||||||
|
// Profile data
|
||||||
|
virtual int SetDefaultOptionsCallback(
|
||||||
|
int (*Func)(void*, PROFILESETTINGS*, const int iPad),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual int SetOldProfileVersionCallback(
|
||||||
|
int (*Func)(void*, unsigned char*, const unsigned short, const int),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual PROFILESETTINGS* GetDashboardProfileSettings(int iPad) = 0;
|
||||||
|
virtual void WriteToProfile(int iQuadrant,
|
||||||
|
bool bGameDefinedDataChanged = false,
|
||||||
|
bool bOverrideTimeLimit = false) = 0;
|
||||||
|
virtual void ForceQueuedProfileWrites(int iPad = XUSER_INDEX_ANY) = 0;
|
||||||
|
virtual void* GetGameDefinedProfileData(int iQuadrant) = 0;
|
||||||
|
virtual void ResetProfileProcessState() = 0;
|
||||||
|
|
||||||
|
// Trial
|
||||||
|
virtual void StartTrialGame() = 0;
|
||||||
|
virtual void SetTrialTextStringTable(CXuiStringTable* pStringTable,
|
||||||
|
int iAccept, int iReject) = 0;
|
||||||
|
virtual void SetTrialAwardText(eAwardType AwardType, int iTitle,
|
||||||
|
int iText) = 0;
|
||||||
|
|
||||||
|
// Content
|
||||||
|
virtual void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
||||||
|
bool* allAllowed,
|
||||||
|
bool* friendsAllowed) = 0;
|
||||||
|
virtual bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
||||||
|
PlayerUID* pXuids,
|
||||||
|
unsigned int xuidCount) = 0;
|
||||||
|
virtual void ShowProfileCard(int iPad, PlayerUID targetUid) = 0;
|
||||||
|
virtual bool GetProfileAvatar(
|
||||||
|
int iPad,
|
||||||
|
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||||
|
unsigned int thumbnailBytes),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual void CancelProfileAvatarRequest() = 0;
|
||||||
|
|
||||||
|
// Achievements
|
||||||
|
virtual void RegisterAward(int iAwardNumber, int iGamerconfigID,
|
||||||
|
eAwardType eType,
|
||||||
|
bool bLeaderboardAffected = false,
|
||||||
|
CXuiStringTable* pStringTable = nullptr,
|
||||||
|
int iTitleStr = -1, int iTextStr = -1,
|
||||||
|
int iAcceptStr = -1,
|
||||||
|
char* pszThemeName = nullptr,
|
||||||
|
unsigned int uiThemeSize = 0L) = 0;
|
||||||
|
virtual int GetAwardId(int iAwardNumber) = 0;
|
||||||
|
virtual eAwardType GetAwardType(int iAwardNumber) = 0;
|
||||||
|
virtual bool CanBeAwarded(int iQuadrant, int iAwardNumber) = 0;
|
||||||
|
virtual void Award(int iQuadrant, int iAwardNumber,
|
||||||
|
bool bForce = false) = 0;
|
||||||
|
virtual bool IsAwardsFlagSet(int iQuadrant, int iAward) = 0;
|
||||||
|
|
||||||
|
// Rich presence
|
||||||
|
virtual void RichPresenceInit(int iPresenceCount, int iContextCount) = 0;
|
||||||
|
virtual void RegisterRichPresenceContext(int iGameConfigContextID) = 0;
|
||||||
|
virtual void SetRichPresenceContextValue(int iPad, int iContextID,
|
||||||
|
int iVal) = 0;
|
||||||
|
virtual void SetCurrentGameActivity(int iPad, int iNewPresence,
|
||||||
|
bool bSetOthersToIdle = false) = 0;
|
||||||
|
|
||||||
|
// Purchase
|
||||||
|
virtual void DisplayFullVersionPurchase(bool bRequired, int iQuadrant,
|
||||||
|
int iUpsellParam = -1) = 0;
|
||||||
|
virtual void SetUpsellCallback(void (*Func)(void* lpParam, eUpsellType type,
|
||||||
|
eUpsellResponse response,
|
||||||
|
int iUserData),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
virtual void SetDebugFullOverride(bool bVal) = 0;
|
||||||
|
};
|
||||||
234
minecraft/platform/IPlatformRender.h
Normal file
234
minecraft/platform/IPlatformRender.h
Normal file
|
|
@ -0,0 +1,234 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
class ImageFileBuffer {
|
||||||
|
public:
|
||||||
|
enum EImageType { e_typePNG, e_typeJPG };
|
||||||
|
EImageType m_type;
|
||||||
|
void* m_pBuffer;
|
||||||
|
int m_bufferSize;
|
||||||
|
int GetType() { return m_type; }
|
||||||
|
void* GetBufferPointer() { return m_pBuffer; }
|
||||||
|
int GetBufferSize() { return m_bufferSize; }
|
||||||
|
void Release() {
|
||||||
|
std::free(m_pBuffer);
|
||||||
|
m_pBuffer = nullptr;
|
||||||
|
}
|
||||||
|
bool Allocated() { return m_pBuffer != nullptr; }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct D3DXIMAGE_INFO {
|
||||||
|
int Width;
|
||||||
|
int Height;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct XSOCIAL_PREVIEWIMAGE {
|
||||||
|
std::uint8_t* pBytes;
|
||||||
|
std::uint32_t Pitch;
|
||||||
|
std::uint32_t Width;
|
||||||
|
std::uint32_t Height;
|
||||||
|
};
|
||||||
|
using PXSOCIAL_PREVIEWIMAGE = XSOCIAL_PREVIEWIMAGE*;
|
||||||
|
|
||||||
|
class IPlatformRender {
|
||||||
|
public:
|
||||||
|
enum eVertexType {
|
||||||
|
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1,
|
||||||
|
VERTEX_TYPE_COMPRESSED,
|
||||||
|
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT,
|
||||||
|
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN,
|
||||||
|
VERTEX_TYPE_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ePixelShaderType {
|
||||||
|
PIXEL_SHADER_TYPE_STANDARD,
|
||||||
|
PIXEL_SHADER_TYPE_PROJECTION,
|
||||||
|
PIXEL_SHADER_TYPE_FORCELOD,
|
||||||
|
PIXEL_SHADER_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eViewportType {
|
||||||
|
VIEWPORT_TYPE_FULLSCREEN,
|
||||||
|
VIEWPORT_TYPE_SPLIT_TOP,
|
||||||
|
VIEWPORT_TYPE_SPLIT_BOTTOM,
|
||||||
|
VIEWPORT_TYPE_SPLIT_LEFT,
|
||||||
|
VIEWPORT_TYPE_SPLIT_RIGHT,
|
||||||
|
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
|
||||||
|
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
|
||||||
|
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
|
||||||
|
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ePrimitiveType {
|
||||||
|
PRIMITIVE_TYPE_TRIANGLE_LIST,
|
||||||
|
PRIMITIVE_TYPE_TRIANGLE_STRIP,
|
||||||
|
PRIMITIVE_TYPE_TRIANGLE_FAN,
|
||||||
|
PRIMITIVE_TYPE_QUAD_LIST,
|
||||||
|
PRIMITIVE_TYPE_LINE_LIST,
|
||||||
|
PRIMITIVE_TYPE_LINE_STRIP,
|
||||||
|
PRIMITIVE_TYPE_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eTextureFormat {
|
||||||
|
TEXTURE_FORMAT_RxGyBzAw,
|
||||||
|
MAX_TEXTURE_FORMATS
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~IPlatformRender() = default;
|
||||||
|
|
||||||
|
// Lifecycle
|
||||||
|
virtual void Initialise() = 0;
|
||||||
|
virtual void InitialiseContext() = 0;
|
||||||
|
virtual void Tick() = 0;
|
||||||
|
virtual void StartFrame() = 0;
|
||||||
|
virtual void Present() = 0;
|
||||||
|
virtual void Clear(int flags) = 0;
|
||||||
|
virtual void SetClearColour(const float colourRGBA[4]) = 0;
|
||||||
|
virtual void Shutdown() = 0;
|
||||||
|
virtual void Suspend() = 0;
|
||||||
|
virtual bool Suspended() = 0;
|
||||||
|
virtual void Resume() = 0;
|
||||||
|
|
||||||
|
// Window
|
||||||
|
virtual void SetWindowSize(int w, int h) = 0;
|
||||||
|
virtual void SetFullscreen(bool fs) = 0;
|
||||||
|
virtual bool IsWidescreen() = 0;
|
||||||
|
virtual bool IsHiDef() = 0;
|
||||||
|
virtual void GetFramebufferSize(int& width, int& height) = 0;
|
||||||
|
virtual bool ShouldClose() = 0;
|
||||||
|
virtual void Close() = 0;
|
||||||
|
virtual void UpdateGamma(unsigned short usGamma) = 0;
|
||||||
|
|
||||||
|
// Matrix stack
|
||||||
|
virtual void MatrixMode(int type) = 0;
|
||||||
|
virtual void MatrixSetIdentity() = 0;
|
||||||
|
virtual void MatrixTranslate(float x, float y, float z) = 0;
|
||||||
|
virtual void MatrixRotate(float angle, float x, float y, float z) = 0;
|
||||||
|
virtual void MatrixScale(float x, float y, float z) = 0;
|
||||||
|
virtual void MatrixPerspective(float fovy, float aspect, float zNear,
|
||||||
|
float zFar) = 0;
|
||||||
|
virtual void MatrixOrthogonal(float left, float right, float bottom,
|
||||||
|
float top, float zNear, float zFar) = 0;
|
||||||
|
virtual void MatrixPop() = 0;
|
||||||
|
virtual void MatrixPush() = 0;
|
||||||
|
virtual void MatrixMult(float* mat) = 0;
|
||||||
|
virtual const float* MatrixGet(int type) = 0;
|
||||||
|
virtual void Set_matrixDirty() = 0;
|
||||||
|
|
||||||
|
// Draw calls
|
||||||
|
virtual void DrawVertices(ePrimitiveType PrimitiveType, int count,
|
||||||
|
void* dataIn, eVertexType vType,
|
||||||
|
ePixelShaderType psType) = 0;
|
||||||
|
|
||||||
|
// Command buffers
|
||||||
|
virtual void CBuffLockStaticCreations() = 0;
|
||||||
|
virtual int CBuffCreate(int count) = 0;
|
||||||
|
virtual void CBuffDelete(int first, int count) = 0;
|
||||||
|
virtual void CBuffStart(int index, bool full = false) = 0;
|
||||||
|
virtual void CBuffClear(int index) = 0;
|
||||||
|
virtual int CBuffSize(int index) = 0;
|
||||||
|
virtual void CBuffEnd() = 0;
|
||||||
|
virtual bool CBuffCall(int index, bool full = true) = 0;
|
||||||
|
virtual void CBuffTick() = 0;
|
||||||
|
virtual void CBuffDeferredModeStart() = 0;
|
||||||
|
virtual void CBuffDeferredModeEnd() = 0;
|
||||||
|
|
||||||
|
// Textures
|
||||||
|
virtual int TextureCreate() = 0;
|
||||||
|
virtual void TextureFree(int idx) = 0;
|
||||||
|
virtual void TextureBind(int idx) = 0;
|
||||||
|
virtual void TextureBindVertex(int idx, bool scaleLight = false) = 0;
|
||||||
|
virtual void TextureSetTextureLevels(int levels) = 0;
|
||||||
|
virtual int TextureGetTextureLevels() = 0;
|
||||||
|
virtual void TextureData(int width, int height, void* data, int level,
|
||||||
|
eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw) = 0;
|
||||||
|
virtual void TextureDataUpdate(int xoffset, int yoffset, int width,
|
||||||
|
int height, void* data, int level) = 0;
|
||||||
|
virtual void TextureSetParam(int param, int value) = 0;
|
||||||
|
virtual void TextureDynamicUpdateStart() = 0;
|
||||||
|
virtual void TextureDynamicUpdateEnd() = 0;
|
||||||
|
virtual int LoadTextureData(const char* szFilename,
|
||||||
|
D3DXIMAGE_INFO* pSrcInfo,
|
||||||
|
int** ppDataOut) = 0;
|
||||||
|
virtual int LoadTextureData(std::uint8_t* pbData, std::uint32_t byteCount,
|
||||||
|
D3DXIMAGE_INFO* pSrcInfo,
|
||||||
|
int** ppDataOut) = 0;
|
||||||
|
virtual int SaveTextureData(const char* szFilename,
|
||||||
|
D3DXIMAGE_INFO* pSrcInfo,
|
||||||
|
int* ppDataOut) = 0;
|
||||||
|
virtual int SaveTextureDataToMemory(void* pOutput, int outputCapacity,
|
||||||
|
int* outputLength, int width,
|
||||||
|
int height, int* ppDataIn) = 0;
|
||||||
|
virtual void ReadPixels(int x, int y, int w, int h, void* buf) = 0;
|
||||||
|
virtual void TextureGetStats() = 0;
|
||||||
|
virtual void* TextureGetTexture(int idx) = 0;
|
||||||
|
|
||||||
|
// Render state
|
||||||
|
virtual void StateSetColour(float r, float g, float b, float a) = 0;
|
||||||
|
virtual void StateSetDepthMask(bool enable) = 0;
|
||||||
|
virtual void StateSetBlendEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetBlendFunc(int src, int dst) = 0;
|
||||||
|
virtual void StateSetBlendFactor(unsigned int colour) = 0;
|
||||||
|
virtual void StateSetAlphaFunc(int func, float param) = 0;
|
||||||
|
virtual void StateSetDepthFunc(int func) = 0;
|
||||||
|
virtual void StateSetFaceCull(bool enable) = 0;
|
||||||
|
virtual void StateSetFaceCullCW(bool enable) = 0;
|
||||||
|
virtual void StateSetLineWidth(float width) = 0;
|
||||||
|
virtual void StateSetWriteEnable(bool red, bool green, bool blue,
|
||||||
|
bool alpha) = 0;
|
||||||
|
virtual void StateSetDepthTestEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetAlphaTestEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetDepthSlopeAndBias(float slope, float bias) = 0;
|
||||||
|
|
||||||
|
// Fog
|
||||||
|
virtual void StateSetFogEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetFogMode(int mode) = 0;
|
||||||
|
virtual void StateSetFogNearDistance(float dist) = 0;
|
||||||
|
virtual void StateSetFogFarDistance(float dist) = 0;
|
||||||
|
virtual void StateSetFogDensity(float density) = 0;
|
||||||
|
virtual void StateSetFogColour(float red, float green, float blue) = 0;
|
||||||
|
|
||||||
|
// Lighting
|
||||||
|
virtual void StateSetLightingEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetVertexTextureUV(float u, float v) = 0;
|
||||||
|
virtual void StateSetLightColour(int light, float red, float green,
|
||||||
|
float blue) = 0;
|
||||||
|
virtual void StateSetLightAmbientColour(float red, float green,
|
||||||
|
float blue) = 0;
|
||||||
|
virtual void StateSetLightDirection(int light, float x, float y,
|
||||||
|
float z) = 0;
|
||||||
|
virtual void StateSetLightEnable(int light, bool enable) = 0;
|
||||||
|
|
||||||
|
// Viewport & clipping
|
||||||
|
virtual void StateSetViewport(eViewportType viewportType) = 0;
|
||||||
|
virtual void StateSetEnableViewportClipPlanes(bool enable) = 0;
|
||||||
|
virtual void StateSetTexGenCol(int col, float x, float y, float z, float w,
|
||||||
|
bool eyeSpace) = 0;
|
||||||
|
virtual void StateSetStencil(int Function, std::uint8_t stencil_ref,
|
||||||
|
std::uint8_t stencil_func_mask,
|
||||||
|
std::uint8_t stencil_write_mask) = 0;
|
||||||
|
virtual void StateSetForceLOD(int LOD) = 0;
|
||||||
|
virtual void StateSetTextureEnable(bool enable) = 0;
|
||||||
|
virtual void StateSetActiveTexture(int tex) = 0;
|
||||||
|
|
||||||
|
// Chunks
|
||||||
|
virtual void SetChunkOffset(float x, float y, float z) = 0;
|
||||||
|
|
||||||
|
// Occlusion
|
||||||
|
virtual void BeginConditionalSurvey(int identifier) = 0;
|
||||||
|
virtual void EndConditionalSurvey() = 0;
|
||||||
|
virtual void BeginConditionalRendering(int identifier) = 0;
|
||||||
|
virtual void EndConditionalRendering() = 0;
|
||||||
|
|
||||||
|
// Screenshots
|
||||||
|
virtual void DoScreenGrabOnNextPresent() = 0;
|
||||||
|
virtual void CaptureThumbnail(ImageFileBuffer* pngOut) = 0;
|
||||||
|
virtual void CaptureScreen(ImageFileBuffer* jpgOut,
|
||||||
|
XSOCIAL_PREVIEWIMAGE* previewOut) = 0;
|
||||||
|
|
||||||
|
// Events
|
||||||
|
virtual void BeginEvent(const wchar_t* eventName) = 0;
|
||||||
|
virtual void EndEvent() = 0;
|
||||||
|
};
|
||||||
260
minecraft/platform/IPlatformStorage.h
Normal file
260
minecraft/platform/IPlatformStorage.h
Normal file
|
|
@ -0,0 +1,260 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <ctime>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../4J.Common/4J_Compat.h"
|
||||||
|
|
||||||
|
struct SAVE_INFO;
|
||||||
|
using PSAVE_INFO = SAVE_INFO*;
|
||||||
|
struct SAVE_DETAILS;
|
||||||
|
using PSAVE_DETAILS = SAVE_DETAILS*;
|
||||||
|
class C4JStringTable;
|
||||||
|
|
||||||
|
class IPlatformStorage {
|
||||||
|
public:
|
||||||
|
// Enums live here so both the interface consumer and the concrete
|
||||||
|
// implementation share the same values without a circular include.
|
||||||
|
enum EMessageResult {
|
||||||
|
EMessage_Undefined = 0,
|
||||||
|
EMessage_Busy,
|
||||||
|
EMessage_Pending,
|
||||||
|
EMessage_Cancelled,
|
||||||
|
EMessage_ResultAccept,
|
||||||
|
EMessage_ResultDecline,
|
||||||
|
EMessage_ResultThirdOption,
|
||||||
|
EMessage_ResultFourthOption
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ESaveGameState {
|
||||||
|
ESaveGame_Idle = 0,
|
||||||
|
ESaveGame_Save,
|
||||||
|
ESaveGame_InternalRequestingDevice,
|
||||||
|
ESaveGame_InternalGetSaveName,
|
||||||
|
ESaveGame_InternalSaving,
|
||||||
|
ESaveGame_CopySave,
|
||||||
|
ESaveGame_CopyingSave,
|
||||||
|
ESaveGame_Load,
|
||||||
|
ESaveGame_GetSavesInfo,
|
||||||
|
ESaveGame_Rename,
|
||||||
|
ESaveGame_Delete,
|
||||||
|
ESaveGame_GetSaveThumbnail
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ESaveGameControlState {
|
||||||
|
ESaveGameControl_Idle = 0,
|
||||||
|
ESaveGameControl_Save,
|
||||||
|
ESaveGameControl_InternalRequestingDevice,
|
||||||
|
ESaveGameControl_InternalGetSaveName,
|
||||||
|
ESaveGameControl_InternalSaving,
|
||||||
|
ESaveGameControl_CopySave,
|
||||||
|
ESaveGameControl_CopyingSave,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ESavingMessage {
|
||||||
|
ESavingMessage_None = 0,
|
||||||
|
ESavingMessage_Short,
|
||||||
|
ESavingMessage_Long
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EDLCStatus {
|
||||||
|
EDLC_Error = 0,
|
||||||
|
EDLC_Idle,
|
||||||
|
EDLC_NoOffers,
|
||||||
|
EDLC_AlreadyEnumeratedAllOffers,
|
||||||
|
EDLC_NoInstalledDLC,
|
||||||
|
EDLC_Pending,
|
||||||
|
EDLC_LoadInProgress,
|
||||||
|
EDLC_Loaded,
|
||||||
|
EDLC_ChangedDevice
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ETMSStatus {
|
||||||
|
ETMSStatus_Idle = 0,
|
||||||
|
ETMSStatus_Fail,
|
||||||
|
ETMSStatus_Fail_ReadInProgress,
|
||||||
|
ETMSStatus_Fail_WriteInProgress,
|
||||||
|
ETMSStatus_Pending,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eGlobalStorage {
|
||||||
|
eGlobalStorage_Title = 0,
|
||||||
|
eGlobalStorage_TitleUser,
|
||||||
|
eGlobalStorage_Max
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eTMS_FileType {
|
||||||
|
eTMS_FileType_Normal = 0,
|
||||||
|
eTMS_FileType_Graphic,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum eTMS_FILETYPEVAL {
|
||||||
|
TMS_FILETYPE_BINARY,
|
||||||
|
TMS_FILETYPE_CONFIG,
|
||||||
|
TMS_FILETYPE_JSON,
|
||||||
|
TMS_FILETYPE_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TMSPP_FILEDATA {
|
||||||
|
unsigned int size;
|
||||||
|
std::uint8_t* pbData;
|
||||||
|
};
|
||||||
|
using PTMSPP_FILEDATA = TMSPP_FILEDATA*;
|
||||||
|
|
||||||
|
struct DLC_TMS_DETAILS {
|
||||||
|
std::uint32_t dwVersion;
|
||||||
|
std::uint32_t dwNewOffers;
|
||||||
|
std::uint32_t dwTotalOffers;
|
||||||
|
std::uint32_t dwInstalledTotalOffers;
|
||||||
|
std::uint8_t bPadding[1024 - sizeof(std::uint32_t) * 4];
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~IPlatformStorage() = default;
|
||||||
|
|
||||||
|
// Lifecycle
|
||||||
|
virtual void Tick() = 0;
|
||||||
|
virtual void Init(unsigned int uiSaveVersion,
|
||||||
|
const wchar_t* pwchDefaultSaveName,
|
||||||
|
char* pszSavePackName, int iMinimumSaveSize,
|
||||||
|
int (*Func)(void*, const ESavingMessage, int),
|
||||||
|
void* lpParam, const char* szGroupID) = 0;
|
||||||
|
virtual void ResetSaveData() = 0;
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
virtual EMessageResult RequestMessageBox(
|
||||||
|
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
|
||||||
|
unsigned int uiOptionC, unsigned int pad = XUSER_INDEX_ANY,
|
||||||
|
int (*Func)(void*, int, const EMessageResult) = nullptr,
|
||||||
|
void* lpParam = nullptr, C4JStringTable* pStringTable = nullptr,
|
||||||
|
wchar_t* pwchFormatString = nullptr,
|
||||||
|
unsigned int focusButton = 0) = 0;
|
||||||
|
virtual EMessageResult GetMessageBoxResult() = 0;
|
||||||
|
|
||||||
|
// Save device
|
||||||
|
virtual bool SetSaveDevice(int (*Func)(void*, const bool), void* lpParam,
|
||||||
|
bool bForceResetOfSaveDevice = false) = 0;
|
||||||
|
virtual void SetSaveDeviceSelected(unsigned int uiPad,
|
||||||
|
bool bSelected) = 0;
|
||||||
|
virtual bool GetSaveDeviceSelected(unsigned int iPad) = 0;
|
||||||
|
|
||||||
|
// Save game
|
||||||
|
virtual void SetDefaultSaveNameForKeyboardDisplay(
|
||||||
|
const wchar_t* pwchDefaultSaveName) = 0;
|
||||||
|
virtual void SetSaveTitle(const wchar_t* pwchDefaultSaveName) = 0;
|
||||||
|
virtual bool GetSaveUniqueNumber(int* piVal) = 0;
|
||||||
|
virtual bool GetSaveUniqueFilename(char* pszName) = 0;
|
||||||
|
virtual void SetSaveUniqueFilename(char* szFilename) = 0;
|
||||||
|
virtual void SetState(ESaveGameControlState eControlState,
|
||||||
|
int (*Func)(void*, const bool), void* lpParam) = 0;
|
||||||
|
virtual void SetSaveDisabled(bool bDisable) = 0;
|
||||||
|
virtual bool GetSaveDisabled() = 0;
|
||||||
|
virtual unsigned int GetSaveSize() = 0;
|
||||||
|
virtual void GetSaveData(void* pvData, unsigned int* puiBytes) = 0;
|
||||||
|
virtual void* AllocateSaveData(unsigned int uiBytes) = 0;
|
||||||
|
virtual void SetSaveImages(std::uint8_t* pbThumbnail,
|
||||||
|
unsigned int thumbnailBytes,
|
||||||
|
std::uint8_t* pbImage, unsigned int imageBytes,
|
||||||
|
std::uint8_t* pbTextData,
|
||||||
|
unsigned int textDataBytes) = 0;
|
||||||
|
virtual ESaveGameState SaveSaveData(int (*Func)(void*, const bool),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual void CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
|
||||||
|
unsigned int cbThumbnail,
|
||||||
|
wchar_t* wchNewName,
|
||||||
|
int (*Func)(void* lpParam, bool),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual ESaveGameState DoesSaveExist(bool* pbExists) = 0;
|
||||||
|
virtual bool EnoughSpaceForAMinSaveGame() = 0;
|
||||||
|
virtual void SetSaveMessageVPosition(float fY) = 0;
|
||||||
|
virtual ESaveGameState GetSavesInfo(
|
||||||
|
int iPad,
|
||||||
|
int (*Func)(void* lpParam, SAVE_DETAILS* pSaveDetails, const bool),
|
||||||
|
void* lpParam, char* pszSavePackName) = 0;
|
||||||
|
virtual PSAVE_DETAILS ReturnSavesInfo() = 0;
|
||||||
|
virtual void ClearSavesInfo() = 0;
|
||||||
|
virtual ESaveGameState LoadSaveDataThumbnail(
|
||||||
|
PSAVE_INFO pSaveInfo,
|
||||||
|
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||||
|
unsigned int thumbnailBytes),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual void GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||||
|
XCONTENT_DATA& xContentData) = 0;
|
||||||
|
virtual void GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||||
|
std::uint8_t** ppbImageData,
|
||||||
|
unsigned int* pImageBytes) = 0;
|
||||||
|
virtual ESaveGameState LoadSaveData(
|
||||||
|
PSAVE_INFO pSaveInfo,
|
||||||
|
int (*Func)(void* lpParam, const bool, const bool),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual ESaveGameState DeleteSaveData(
|
||||||
|
PSAVE_INFO pSaveInfo, int (*Func)(void* lpParam, const bool),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
|
||||||
|
// DLC
|
||||||
|
virtual void RegisterMarketplaceCountsCallback(
|
||||||
|
int (*Func)(void* lpParam, DLC_TMS_DETAILS*, int),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual void SetDLCPackageRoot(char* pszDLCRoot) = 0;
|
||||||
|
virtual EDLCStatus GetDLCOffers(
|
||||||
|
int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam,
|
||||||
|
std::uint32_t dwOfferTypesBitmask =
|
||||||
|
XMARKETPLACE_OFFERING_TYPE_CONTENT) = 0;
|
||||||
|
virtual unsigned int CancelGetDLCOffers() = 0;
|
||||||
|
virtual void ClearDLCOffers() = 0;
|
||||||
|
virtual XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned int dw) = 0;
|
||||||
|
virtual int GetOfferCount() = 0;
|
||||||
|
virtual unsigned int InstallOffer(int iOfferIDC,
|
||||||
|
std::uint64_t* ullOfferIDA,
|
||||||
|
int (*Func)(void*, int, int),
|
||||||
|
void* lpParam, bool bTrial = false) = 0;
|
||||||
|
virtual unsigned int GetAvailableDLCCount(int iPad) = 0;
|
||||||
|
virtual EDLCStatus GetInstalledDLC(int iPad,
|
||||||
|
int (*Func)(void*, int, int),
|
||||||
|
void* lpParam) = 0;
|
||||||
|
virtual XCONTENT_DATA& GetDLC(unsigned int dw) = 0;
|
||||||
|
virtual std::uint32_t MountInstalledDLC(
|
||||||
|
int iPad, std::uint32_t dwDLC,
|
||||||
|
int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam,
|
||||||
|
const char* szMountDrive = nullptr) = 0;
|
||||||
|
virtual unsigned int UnmountInstalledDLC(
|
||||||
|
const char* szMountDrive = nullptr) = 0;
|
||||||
|
virtual void GetMountedDLCFileList(
|
||||||
|
const char* szMountDrive, std::vector<std::string>& fileList) = 0;
|
||||||
|
virtual std::string GetMountedPath(std::string szMount) = 0;
|
||||||
|
|
||||||
|
// Title storage
|
||||||
|
virtual ETMSStatus ReadTMSFile(
|
||||||
|
int iQuadrant, eGlobalStorage eStorageFacility,
|
||||||
|
eTMS_FileType eFileType, wchar_t* pwchFilename,
|
||||||
|
std::uint8_t** ppBuffer, unsigned int* pBufferSize,
|
||||||
|
int (*Func)(void*, wchar_t*, int, bool, int) = nullptr,
|
||||||
|
void* lpParam = nullptr, int iAction = 0) = 0;
|
||||||
|
virtual bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
|
||||||
|
wchar_t* pwchFilename, std::uint8_t* pBuffer,
|
||||||
|
unsigned int bufferSize) = 0;
|
||||||
|
virtual bool DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
|
||||||
|
wchar_t* pwchFilename) = 0;
|
||||||
|
virtual void StoreTMSPathName(wchar_t* pwchName = nullptr) = 0;
|
||||||
|
virtual ETMSStatus TMSPP_ReadFile(
|
||||||
|
int iPad, eGlobalStorage eStorageFacility,
|
||||||
|
eTMS_FILETYPEVAL eFileTypeVal, const char* szFilename,
|
||||||
|
int (*Func)(void*, int, int, PTMSPP_FILEDATA, const char*) = nullptr,
|
||||||
|
void* lpParam = nullptr, int iUserData = 0) = 0;
|
||||||
|
|
||||||
|
// Subfile management (save splitting)
|
||||||
|
virtual int AddSubfile(int regionIndex) = 0;
|
||||||
|
virtual unsigned int GetSubfileCount() = 0;
|
||||||
|
virtual void GetSubfileDetails(unsigned int i, int* regionIndex,
|
||||||
|
void** data, unsigned int* size) = 0;
|
||||||
|
virtual void ResetSubfiles() = 0;
|
||||||
|
virtual void UpdateSubfile(int index, void* data, unsigned int size) = 0;
|
||||||
|
virtual void SaveSubfiles(int (*Func)(void*, const bool),
|
||||||
|
void* param) = 0;
|
||||||
|
virtual ESaveGameState GetSaveState() = 0;
|
||||||
|
|
||||||
|
// Misc
|
||||||
|
virtual unsigned int CRC(unsigned char* buf, int len) = 0;
|
||||||
|
virtual void ContinueIncompleteOperation() = 0;
|
||||||
|
};
|
||||||
6
minecraft/platform/Platform.h
Normal file
6
minecraft/platform/Platform.h
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "IPlatformInput.h"
|
||||||
|
#include "IPlatformProfile.h"
|
||||||
|
#include "IPlatformRender.h"
|
||||||
|
#include "IPlatformStorage.h"
|
||||||
5
minecraft/platform/meson.build
Normal file
5
minecraft/platform/meson.build
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
platform_inc = include_directories('.')
|
||||||
|
|
||||||
|
platform_dep = declare_dependency(
|
||||||
|
include_directories: platform_inc,
|
||||||
|
)
|
||||||
Loading…
Reference in a new issue