first commit
This commit is contained in:
165
Minecraft.Client/Durango/4JLibs/inc/4J_Input.h
Normal file
165
Minecraft.Client/Durango/4JLibs/inc/4J_Input.h
Normal file
@@ -0,0 +1,165 @@
|
||||
#pragma once
|
||||
|
||||
#define MAP_STYLE_0 0
|
||||
#define MAP_STYLE_1 1
|
||||
#define MAP_STYLE_2 2
|
||||
|
||||
#define _360_JOY_BUTTON_A 0x00000001
|
||||
#define _360_JOY_BUTTON_B 0x00000002
|
||||
#define _360_JOY_BUTTON_X 0x00000004
|
||||
#define _360_JOY_BUTTON_Y 0x00000008
|
||||
|
||||
#define _360_JOY_BUTTON_START 0x00000010
|
||||
#define _360_JOY_BUTTON_BACK 0x00000020
|
||||
#define _360_JOY_BUTTON_RB 0x00000040
|
||||
#define _360_JOY_BUTTON_LB 0x00000080
|
||||
|
||||
#define _360_JOY_BUTTON_RTHUMB 0x00000100
|
||||
#define _360_JOY_BUTTON_LTHUMB 0x00000200
|
||||
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
|
||||
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
|
||||
|
||||
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
|
||||
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
|
||||
// fake digital versions of analog values
|
||||
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
|
||||
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
|
||||
|
||||
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
|
||||
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
|
||||
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
|
||||
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
|
||||
|
||||
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
|
||||
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
|
||||
#define _360_JOY_BUTTON_RT 0x00400000
|
||||
#define _360_JOY_BUTTON_LT 0x00800000
|
||||
|
||||
#define _360_GTC_PLAY 0x01000000
|
||||
#define _360_GTC_PAUSE 0x02000000
|
||||
#define _360_GTC_MENU 0x04000000
|
||||
#define _360_GTC_VIEW 0x08000000
|
||||
#define _360_GTC_BACK 0x10000000
|
||||
|
||||
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
|
||||
#define AXIS_MAP_LX 0
|
||||
#define AXIS_MAP_LY 1
|
||||
#define AXIS_MAP_RX 2
|
||||
#define AXIS_MAP_RY 3
|
||||
|
||||
// Trigger map - to allow for swap triggers in-game
|
||||
#define TRIGGER_MAP_0 0
|
||||
#define TRIGGER_MAP_1 1
|
||||
|
||||
typedef struct _STRING_VERIFY_RESPONSE
|
||||
{
|
||||
WORD wNumStrings;
|
||||
HRESULT *pStringResult;
|
||||
}
|
||||
STRING_VERIFY_RESPONSE;
|
||||
|
||||
class C4JStringTable
|
||||
{
|
||||
public:
|
||||
LPCWSTR Lookup(LPCWSTR szId) {return NULL;}
|
||||
LPCWSTR Lookup(UINT nIndex) {return NULL;}
|
||||
void Clear();
|
||||
HRESULT Load(LPCWSTR szId) {return S_OK;}
|
||||
};
|
||||
|
||||
class C_4JInput
|
||||
{
|
||||
public:
|
||||
static const int MAX_GAMEPADS = 8;
|
||||
enum EKeyboardResult
|
||||
{
|
||||
EKeyboard_Pending,
|
||||
EKeyboard_Cancelled,
|
||||
EKeyboard_ResultAccept,
|
||||
EKeyboard_ResultDecline,
|
||||
};
|
||||
|
||||
enum EKeyboardMode
|
||||
{
|
||||
EKeyboardMode_Default,
|
||||
EKeyboardMode_Numeric,
|
||||
EKeyboardMode_Password,
|
||||
EKeyboardMode_Alphabet,
|
||||
EKeyboardMode_Full,
|
||||
EKeyboardMode_Alphabet_Extended,
|
||||
EKeyboardMode_IP_Address,
|
||||
EKeyboardMode_Phone,
|
||||
EKeyboardMode_URL,
|
||||
EKeyboardMode_Email
|
||||
|
||||
};
|
||||
|
||||
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
|
||||
void Tick(void);
|
||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzoneAnalog, unsigned int uiDeadzoneDigital ,unsigned int uiAnalogMovementRangeMax );
|
||||
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
|
||||
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
|
||||
void SetJoypadMapVal(int iPad,unsigned char ucMap);
|
||||
unsigned char GetJoypadMapVal(int iPad);
|
||||
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
||||
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
|
||||
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
|
||||
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
|
||||
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
|
||||
// Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc
|
||||
void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs);
|
||||
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
|
||||
FLOAT GetIdleSeconds(int iPad);
|
||||
unsigned int GetConnectedGamepadCount();
|
||||
bool IsPadConnected(int iPad);
|
||||
bool IsPadLocked(int iPad);
|
||||
|
||||
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
||||
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
|
||||
void SetMenuDisplayed(int iPad, bool bVal);
|
||||
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, int iMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
||||
void DestroyKeyboard();
|
||||
|
||||
bool IsCircleCrossSwapped();
|
||||
void GetText(uint16_t *UTF16String);
|
||||
// Online check strings against offensive list - TCR 92
|
||||
// TCR # 092 CMTV Player Text String Verification
|
||||
// Requirement Any player-entered text visible to another player on Xbox LIVE must be verified using the Xbox LIVE service before being transmitted. Text that is rejected by the Xbox LIVE service must not be displayed.
|
||||
//
|
||||
// Remarks
|
||||
// This requirement applies to any player-entered string that can be exposed to other players on Xbox LIVE. It includes session names, content descriptions, text messages, tags, team names, mottos, comments, and so on.
|
||||
//
|
||||
// Games may decide to not send the text, blank it out, or use generic text if the text was rejected by the Xbox LIVE service.
|
||||
//
|
||||
// Games verify the text by calling the XStringVerify function.
|
||||
//
|
||||
// Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat.
|
||||
//
|
||||
// Intent Protect players from inappropriate language.
|
||||
bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelAllVerifyInProgress(void);
|
||||
|
||||
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
|
||||
|
||||
void SetEnabledGtcButtons(long long llEnabledButtons);
|
||||
|
||||
Windows::Xbox::System::User^ GetUserForGamepad(int iPad);
|
||||
|
||||
// Handle PLM events
|
||||
void Resume();
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JInput InputManager;
|
||||
162
Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h
Normal file
162
Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h
Normal file
@@ -0,0 +1,162 @@
|
||||
#pragma once
|
||||
|
||||
namespace WXAMS = Windows::Xbox::ApplicationModel::Store;
|
||||
namespace WXS = Windows::Xbox::System;
|
||||
namespace MXS = Microsoft::Xbox::Services;
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
// Public version of PlayerUID that hides any C++/Cx functions
|
||||
class PlayerUID
|
||||
{
|
||||
protected:
|
||||
std::wstring m_UID;
|
||||
|
||||
public:
|
||||
class Hash
|
||||
{
|
||||
public:
|
||||
std::size_t operator()(PlayerUID const& k) const;
|
||||
};
|
||||
|
||||
PlayerUID();
|
||||
PlayerUID(std::wstring fromString);
|
||||
|
||||
bool operator==(const PlayerUID &rhs) const;
|
||||
bool operator!=(const PlayerUID &rhs);
|
||||
|
||||
std::wstring toString() const;
|
||||
};
|
||||
typedef PlayerUID *PPlayerUID;
|
||||
|
||||
class C_4JProfile
|
||||
{
|
||||
public:
|
||||
struct PROFILESETTINGS
|
||||
{
|
||||
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( const std::wstring &serviceConfigId, const std::wstring &titleProductId );
|
||||
//void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
||||
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
||||
int GetLockedProfile();
|
||||
void SetLockedProfile(int iProf);
|
||||
bool IsSignedIn(int iQuadrant);
|
||||
bool IsSignedInLive(int iProf);
|
||||
bool IsGuest(int iQuadrant);
|
||||
UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
void SetPrimaryPlayerChanged(bool bVal);
|
||||
bool QuerySigninStatus(void);
|
||||
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
||||
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
||||
BOOL XUIDIsGuest(PlayerUID xuid);
|
||||
bool AllowedToPlayMultiplayer(int iProf);
|
||||
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed);
|
||||
BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
|
||||
bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam);
|
||||
void CancelProfileAvatarRequest();
|
||||
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
||||
void ShowAddFriend(int iPad, PlayerUID targetUid);
|
||||
|
||||
void CheckPrivilege(int iPad, bool thisQuadrantOnly, WXAMS::KnownPrivileges privilege, void( *Func)(LPVOID, bool, int),LPVOID lpParam);
|
||||
void CheckPrivileges(int iPad, bool thisQuadrantOnly, const std::vector<WXAMS::KnownPrivileges> &privileges, void( *Func)(LPVOID, bool, int),LPVOID lpParam);
|
||||
|
||||
// Some helper functions to wrap common combinations of privileges
|
||||
void CheckMultiplayerPrivileges(int iPad, bool thisQuadrantOnly, void( *Func)(LPVOID, bool, int),LPVOID lpParam);
|
||||
|
||||
|
||||
// SYS
|
||||
WXS::User^ GetUser(int iPad, bool incUsersSigningOut = false);
|
||||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
int AddGamepadToGame(int iPad);
|
||||
void RemoveGamepadFromGame(int iPad);
|
||||
void ClearGameUsers();
|
||||
char* GetGamertag(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
bool RegionIsNorthAmerica(void);
|
||||
bool LocaleIsUSorCanada(void);
|
||||
HRESULT GetLiveConnectionStatus();
|
||||
bool IsSystemUIDisplayed();
|
||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
||||
void CompleteDeferredSignouts();
|
||||
void SetDeferredSignoutEnabled(bool enabled);
|
||||
|
||||
// PROFILE DATA
|
||||
//int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
|
||||
//int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID 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 );
|
||||
|
||||
void GetProfile(PlayerUID xuid, void (*func)(LPVOID, Microsoft::Xbox::Services::Social::XboxUserProfile^), LPVOID param);
|
||||
void GetProfiles(std::vector<PlayerUID> xuids, void (*func)(LPVOID, std::vector<Microsoft::Xbox::Services::Social::XboxUserProfile^>), LPVOID param);
|
||||
|
||||
// ACHIEVEMENTS & AWARDS
|
||||
|
||||
//void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
||||
// CXuiStringTable*pStringTable=NULL, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=NULL, 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 RegisterPresence(int presenceId, const std::wstring &presence);
|
||||
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
||||
void SetGameActivityForAllActiveUsers(int iNewPresence);
|
||||
|
||||
// PURCHASE
|
||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
||||
void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam);
|
||||
|
||||
// Debug
|
||||
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
||||
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JProfile ProfileManager;
|
||||
|
||||
302
Minecraft.Client/Durango/4JLibs/inc/4J_Render.h
Normal file
302
Minecraft.Client/Durango/4JLibs/inc/4J_Render.h
Normal file
@@ -0,0 +1,302 @@
|
||||
#pragma once
|
||||
|
||||
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() { free(m_pBuffer); m_pBuffer = NULL; }
|
||||
bool Allocated() { return m_pBuffer != NULL; }
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int Width;
|
||||
int Height;
|
||||
}D3DXIMAGE_INFO;
|
||||
|
||||
typedef struct _XSOCIAL_PREVIEWIMAGE {
|
||||
BYTE *pBytes;
|
||||
DWORD Pitch;
|
||||
DWORD Width;
|
||||
DWORD Height;
|
||||
// D3DFORMAT Format;
|
||||
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
|
||||
|
||||
class C4JRender
|
||||
{
|
||||
public:
|
||||
void Tick();
|
||||
void UpdateGamma(unsigned short usGamma);
|
||||
|
||||
// Matrix stack
|
||||
void MatrixMode(int type);
|
||||
void MatrixSetIdentity();
|
||||
void MatrixTranslate(float x,float y,float z);
|
||||
void MatrixRotate(float angle, float x, float y, float z);
|
||||
void MatrixScale(float x, float y, float z);
|
||||
void MatrixPerspective(float fovy, float aspect, float zNear, float zFar);
|
||||
void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar);
|
||||
void MatrixPop();
|
||||
void MatrixPush();
|
||||
void MatrixMult(float *mat);
|
||||
const float *MatrixGet(int type);
|
||||
void Set_matrixDirty();
|
||||
|
||||
// Core
|
||||
void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
|
||||
void InitialiseContext();
|
||||
void StartFrame();
|
||||
void DoScreenGrabOnNextPresent();
|
||||
void Present();
|
||||
void Clear(int flags, D3D11_RECT *pRect = NULL);
|
||||
void SetClearColour(const float colourRGBA[4]);
|
||||
bool IsWidescreen();
|
||||
bool IsHiDef();
|
||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||
void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut);
|
||||
void BeginConditionalSurvey(int identifier);
|
||||
void EndConditionalSurvey();
|
||||
void BeginConditionalRendering(int identifier);
|
||||
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 DWORD
|
||||
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, eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
|
||||
// Command buffers
|
||||
void CBuffLockStaticCreations();
|
||||
int CBuffCreate(int count);
|
||||
void CBuffDelete(int first, int count);
|
||||
void CBuffStart(int index, bool full = false);
|
||||
void CBuffClear(int index);
|
||||
int CBuffSize(int index);
|
||||
void CBuffEnd();
|
||||
bool CBuffCall(int index, bool full = true);
|
||||
void CBuffTick();
|
||||
void CBuffDeferredModeStart();
|
||||
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
|
||||
int TextureCreate();
|
||||
void TextureFree(int idx);
|
||||
void TextureBind(int idx);
|
||||
void TextureBindVertex(int idx);
|
||||
void TextureSetTextureLevels(int levels);
|
||||
int TextureGetTextureLevels();
|
||||
void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw);
|
||||
void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level);
|
||||
void TextureSetParam(int param, int value);
|
||||
void TextureDynamicUpdateStart();
|
||||
void TextureDynamicUpdateEnd();
|
||||
HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut);
|
||||
HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn);
|
||||
void TextureGetStats();
|
||||
ID3D11ShaderResourceView *TextureGetTexture(int idx);
|
||||
|
||||
// State control
|
||||
void StateSetColour(float r, float g, float b, float a);
|
||||
void StateSetDepthMask(bool enable);
|
||||
void StateSetBlendEnable(bool enable);
|
||||
void StateSetBlendFunc(int src, int dst);
|
||||
void StateSetBlendFactor(unsigned int colour);
|
||||
void StateSetAlphaFunc(int func, float param);
|
||||
void StateSetDepthFunc(int func);
|
||||
void StateSetFaceCull(bool enable);
|
||||
void StateSetFaceCullCW(bool enable);
|
||||
void StateSetLineWidth(float width);
|
||||
void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha);
|
||||
void StateSetDepthTestEnable(bool enable);
|
||||
void StateSetAlphaTestEnable(bool enable);
|
||||
void StateSetDepthSlopeAndBias(float slope, float bias);
|
||||
void StateSetFogEnable(bool enable);
|
||||
void StateSetFogMode(int mode);
|
||||
void StateSetFogNearDistance(float dist);
|
||||
void StateSetFogFarDistance(float dist);
|
||||
void StateSetFogDensity(float density);
|
||||
void StateSetFogColour(float red, float green, float blue);
|
||||
void StateSetLightingEnable(bool enable);
|
||||
void StateSetVertexTextureUV( float u, float v);
|
||||
void StateSetLightColour(int light, float red, float green, float blue);
|
||||
void StateSetLightAmbientColour(float red, float green, float blue);
|
||||
void StateSetLightDirection(int light, float x, float y, float z);
|
||||
void StateSetLightEnable(int light, bool enable);
|
||||
void StateSetViewport(eViewportType viewportType);
|
||||
void StateSetEnableViewportClipPlanes(bool enable);
|
||||
void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace);
|
||||
void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
|
||||
void StateSetForceLOD(int LOD);
|
||||
|
||||
// Event tracking
|
||||
void BeginEvent(LPCWSTR eventName);
|
||||
void EndEvent();
|
||||
|
||||
// PLM event handling
|
||||
void Suspend();
|
||||
bool Suspended();
|
||||
void Resume();
|
||||
};
|
||||
|
||||
|
||||
const int GL_MODELVIEW_MATRIX = 0;
|
||||
const int GL_PROJECTION_MATRIX = 1;
|
||||
const int GL_MODELVIEW = 0;
|
||||
const int GL_PROJECTION = 1;
|
||||
const int GL_TEXTURE = 2;
|
||||
|
||||
// These things required for tex gen
|
||||
|
||||
const int GL_S = 0;
|
||||
const int GL_T = 1;
|
||||
const int GL_R = 2;
|
||||
const int GL_Q = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_S = 0;
|
||||
const int GL_TEXTURE_GEN_T = 1;
|
||||
const int GL_TEXTURE_GEN_Q = 2;
|
||||
const int GL_TEXTURE_GEN_R = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_MODE = 0;
|
||||
const int GL_OBJECT_LINEAR = 0;
|
||||
const int GL_EYE_LINEAR = 1;
|
||||
const int GL_OBJECT_PLANE = 0;
|
||||
const int GL_EYE_PLANE = 1;
|
||||
|
||||
|
||||
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
|
||||
const int GL_TEXTURE_2D = 1;
|
||||
const int GL_BLEND = 2;
|
||||
const int GL_CULL_FACE = 3;
|
||||
const int GL_ALPHA_TEST = 4;
|
||||
const int GL_DEPTH_TEST = 5;
|
||||
const int GL_FOG = 6;
|
||||
const int GL_LIGHTING = 7;
|
||||
const int GL_LIGHT0 = 8;
|
||||
const int GL_LIGHT1 = 9;
|
||||
|
||||
const int CLEAR_DEPTH_FLAG = 1;
|
||||
const int CLEAR_COLOUR_FLAG = 2;
|
||||
|
||||
const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG;
|
||||
const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG;
|
||||
|
||||
const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA;
|
||||
const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA;
|
||||
const int GL_ONE = D3D11_BLEND_ONE;
|
||||
const int GL_ZERO = D3D11_BLEND_ZERO;
|
||||
const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA;
|
||||
const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR;
|
||||
const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR;
|
||||
const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR;
|
||||
const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR;
|
||||
|
||||
const int GL_GREATER = D3D11_COMPARISON_GREATER;
|
||||
const int GL_EQUAL = D3D11_COMPARISON_EQUAL;
|
||||
const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL;
|
||||
const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL;
|
||||
const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS;
|
||||
|
||||
const int GL_TEXTURE_MIN_FILTER = 1;
|
||||
const int GL_TEXTURE_MAG_FILTER = 2;
|
||||
const int GL_TEXTURE_WRAP_S = 3;
|
||||
const int GL_TEXTURE_WRAP_T = 4;
|
||||
|
||||
const int GL_NEAREST = 0;
|
||||
const int GL_LINEAR = 1;
|
||||
const int GL_EXP = 2;
|
||||
const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this
|
||||
|
||||
const int GL_CLAMP = 0;
|
||||
const int GL_REPEAT = 1;
|
||||
|
||||
const int GL_FOG_START = 1;
|
||||
const int GL_FOG_END = 2;
|
||||
const int GL_FOG_MODE = 3;
|
||||
const int GL_FOG_DENSITY = 4;
|
||||
const int GL_FOG_COLOR = 5;
|
||||
|
||||
const int GL_POSITION = 1;
|
||||
const int GL_AMBIENT = 2;
|
||||
const int GL_DIFFUSE = 3;
|
||||
const int GL_SPECULAR = 4;
|
||||
|
||||
const int GL_LIGHT_MODEL_AMBIENT = 1;
|
||||
|
||||
const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST;
|
||||
const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP;
|
||||
const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST;
|
||||
const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN;
|
||||
const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP;
|
||||
|
||||
// Singleton
|
||||
extern C4JRender RenderManager;
|
||||
|
||||
|
||||
492
Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h
Normal file
492
Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h
Normal file
@@ -0,0 +1,492 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // SCE_SAVE_DATA_SUBTITLE_MAXSIZE on PS4
|
||||
#define MAX_SAVEFILENAME_LENGTH 32 // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE
|
||||
#define USER_INDEX_ANY 0x000000FF
|
||||
#define RESULT LONG
|
||||
|
||||
class StringTable;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
time_t modifiedTime;
|
||||
unsigned int dataSize;
|
||||
unsigned int thumbnailSize;
|
||||
}
|
||||
CONTAINER_METADATA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wchar_t UTF16SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
wchar_t UTF16SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
CONTAINER_METADATA metaData;
|
||||
PBYTE thumbnailData;
|
||||
uint64 totalSize;
|
||||
bool needsSync;
|
||||
//int sizeKB;
|
||||
}
|
||||
SAVE_INFO,*PSAVE_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iSaveC;
|
||||
int iThumbnailC;
|
||||
PSAVE_INFO SaveInfoA;
|
||||
}
|
||||
SAVE_DETAILS,*PSAVE_DETAILS;
|
||||
|
||||
class CONTENT_DATA
|
||||
{
|
||||
public:
|
||||
int DeviceID;
|
||||
DWORD dwContentType;
|
||||
WCHAR wszDisplayName[256];
|
||||
WCHAR wszProductID[64];
|
||||
bool bTrialLicense;
|
||||
//WCHAR szFileName[MAX_SAVEFILENAME_LENGTH];
|
||||
};
|
||||
|
||||
typedef CONTENT_DATA XCONTENT_DATA, *PXCONTENT_DATA;
|
||||
|
||||
typedef struct _MARKETPLACE_CONTENTOFFER_INFO
|
||||
{
|
||||
WCHAR *wszProductID;
|
||||
WCHAR *wszOfferName;
|
||||
BOOL fUserHasPurchased;
|
||||
WCHAR *wszSellText;
|
||||
WCHAR *wszCurrencyPrice;
|
||||
WCHAR *wszSignedOfferID;
|
||||
} MARKETPLACE_CONTENTOFFER_INFO, *PMARKETPLACE_CONTENTOFFER_INFO;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XMARKETPLACE_OFFERING_TYPE_CONTENT = 0x00000002,
|
||||
//XMARKETPLACE_OFFERING_TYPE_GAME_DEMO = 0x00000020,
|
||||
//XMARKETPLACE_OFFERING_TYPE_GAME_TRAILER = 0x00000040,
|
||||
XMARKETPLACE_OFFERING_TYPE_THEME = 0x00000080,
|
||||
XMARKETPLACE_OFFERING_TYPE_TILE = 0x00000800,
|
||||
//XMARKETPLACE_OFFERING_TYPE_ARCADE = 0x00002000,
|
||||
//XMARKETPLACE_OFFERING_TYPE_VIDEO = 0x00004000,
|
||||
//XMARKETPLACE_OFFERING_TYPE_CONSUMABLE = 0x00010000,
|
||||
XMARKETPLACE_OFFERING_TYPE_AVATARITEM = 0x00100000
|
||||
} XMARKETPLACE_OFFERING_TYPE;
|
||||
|
||||
|
||||
|
||||
enum eWebServiceState
|
||||
{
|
||||
eWebService_idle,
|
||||
eWebService_notsignedin,
|
||||
eWebService_pending,
|
||||
eWebService_error,
|
||||
eWebService_busy
|
||||
};
|
||||
|
||||
enum eTitleStorageState
|
||||
{
|
||||
eTitleStorage_idle,
|
||||
eTitleStorage_notsignedin,
|
||||
eTitleStorage_pending,
|
||||
eTitleStorage_complete,
|
||||
eTitleStorage_readcomplete,
|
||||
eTitleStorage_readfilelistcomplete,
|
||||
eTitleStorage_writecomplete,
|
||||
eTitleStorage_deletecomplete,
|
||||
eTitleStorage_error,
|
||||
eTitleStorage_readerror,
|
||||
eTitleStorage_readfilelisterror,
|
||||
eTitleStorage_writeerror,
|
||||
eTitleStorage_deleteerror,
|
||||
eTitleStorage_busy
|
||||
};
|
||||
|
||||
// Current version of the dlc data creator
|
||||
#define CURRENT_DLC_VERSION_NUM 3
|
||||
|
||||
class C4JStorage
|
||||
{
|
||||
public:
|
||||
|
||||
struct PROFILESETTINGS
|
||||
{
|
||||
int iYAxisInversion;
|
||||
int iControllerSensitivity;
|
||||
int iVibration;
|
||||
bool bSwapSticks;
|
||||
};
|
||||
|
||||
// Structs defined in the DLC_Creator, but added here to be used in the app
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uiFileSize;
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array
|
||||
WCHAR wchFile[1];
|
||||
}
|
||||
DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array;
|
||||
WCHAR wchData[1]; // will be an array of size dwBytes
|
||||
}
|
||||
DLC_FILE_PARAM, *PDLC_FILE_PARAM;
|
||||
// End of DLC_Creator structs
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwVersion;
|
||||
DWORD dwNewOffers;
|
||||
DWORD dwTotalOffers;
|
||||
DWORD dwInstalledTotalOffers;
|
||||
BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion
|
||||
}
|
||||
DLC_TMS_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwSize;
|
||||
PBYTE pbData;
|
||||
}
|
||||
TMSPP_FILEDATA, *PTMSPP_FILEDATA;
|
||||
|
||||
enum eTMS_FILETYPEVAL
|
||||
{
|
||||
TMS_FILETYPE_BINARY=0,
|
||||
TMS_FILETYPE_CONFIG=1,
|
||||
TMS_FILETYPE_JSON=2,
|
||||
TMS_FILETYPE_MAX,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WCHAR wchFilename[64];
|
||||
unsigned long ulFileSize;
|
||||
eTMS_FILETYPEVAL eFileTypeVal;
|
||||
}
|
||||
TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iCount;
|
||||
PTMSPP_FILE_DETAILS FileDetailsA;
|
||||
}
|
||||
TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PBYTE pbData;
|
||||
unsigned long ulFileLen;
|
||||
}
|
||||
SAVETRANSFER_FILE_DETAILS;
|
||||
|
||||
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 ESaveGameState
|
||||
{
|
||||
ESaveGame_Idle=0,
|
||||
|
||||
ESaveGame_Save,
|
||||
ESaveGame_SaveCompleteSuccess,
|
||||
ESaveGame_SaveCompleteFail,
|
||||
ESaveGame_SaveIncomplete,
|
||||
ESaveGame_SaveIncomplete_WaitingOnResponse,
|
||||
|
||||
ESaveGame_SaveSubfiles,
|
||||
ESaveGame_SaveSubfilesCompleteSuccess,
|
||||
ESaveGame_SaveSubfilesCompleteFail,
|
||||
ESaveGame_SaveSubfilesIncomplete,
|
||||
ESaveGame_SaveSubfilesIncomplete_WaitingOnResponse,
|
||||
|
||||
ESaveGame_Load,
|
||||
ESaveGame_LoadComplete,
|
||||
ESaveGame_EnumerateSubfiles,
|
||||
ESaveGame_EnumerateSubfilesComplete,
|
||||
ESaveGame_LoadSubfiles,
|
||||
ESaveGame_LoadCompleteSuccess,
|
||||
|
||||
ESaveGame_LoadCompleteFail,
|
||||
|
||||
ESaveGame_Delete,
|
||||
ESaveGame_DeleteSuccess,
|
||||
ESaveGame_DeleteFail,
|
||||
|
||||
ESaveGame_Rename,
|
||||
ESaveGame_RenameSuccess,
|
||||
ESaveGame_RenameFail,
|
||||
|
||||
ESaveGame_GetSaveThumbnail,
|
||||
ESaveGame_GetSaveThumbnailComplete,
|
||||
|
||||
ESaveGame_Copy,
|
||||
ESaveGame_CopyCompleteSuccess,
|
||||
ESaveGame_CopyCompleteFail,
|
||||
};
|
||||
|
||||
enum EOptionsState
|
||||
{
|
||||
EOptions_Idle=0,
|
||||
EOptions_Save,
|
||||
EOptions_Load,
|
||||
EOptions_Delete,
|
||||
EOptions_NoSpace,
|
||||
EOptions_Corrupt,
|
||||
};
|
||||
|
||||
enum ESaveGameStatus
|
||||
{
|
||||
EDeleteGame_Idle=0,
|
||||
EDeleteGame_InProgress,
|
||||
};
|
||||
|
||||
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 ESaveIncompleteType
|
||||
{
|
||||
ESaveIncomplete_None,
|
||||
ESaveIncomplete_OutOfQuota,
|
||||
ESaveIncomplete_OutOfLocalStorage,
|
||||
ESaveIncomplete_Unknown
|
||||
};
|
||||
|
||||
enum ETMSStatus
|
||||
{
|
||||
ETMSStatus_Idle=0,
|
||||
ETMSStatus_Fail,
|
||||
ETMSStatus_ReadInProgress,
|
||||
ETMSStatus_ReadFileListInProgress,
|
||||
ETMSStatus_WriteInProgress,
|
||||
ETMSStatus_Fail_ReadInProgress,
|
||||
ETMSStatus_Fail_ReadFileListInProgress,
|
||||
ETMSStatus_Fail_ReadDetailsNotRetrieved,
|
||||
ETMSStatus_Fail_WriteInProgress,
|
||||
ETMSStatus_DeleteInProgress,
|
||||
ETMSStatus_Pending,
|
||||
};
|
||||
|
||||
enum eTMS_FileType
|
||||
{
|
||||
eTMS_FileType_Normal=0,
|
||||
eTMS_FileType_Graphic,
|
||||
};
|
||||
|
||||
enum ESGIStatus
|
||||
{
|
||||
ESGIStatus_Error=0,
|
||||
ESGIStatus_Idle,
|
||||
ESGIStatus_ReadInProgress,
|
||||
ESGIStatus_NoSaves,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROFILE_READTYPE_ALL,
|
||||
PROFILE_READTYPE_XBOXSETTINGS // just read the settings (after a notification of settings change)
|
||||
};
|
||||
|
||||
enum eOptionsCallback
|
||||
{
|
||||
eOptions_Callback_Idle,
|
||||
eOptions_Callback_Write,
|
||||
eOptions_Callback_Write_Fail_NoSpace,
|
||||
eOptions_Callback_Write_Fail,
|
||||
eOptions_Callback_Read,
|
||||
eOptions_Callback_Read_Fail,
|
||||
eOptions_Callback_Read_FileNotFound,
|
||||
eOptions_Callback_Read_Corrupt,
|
||||
eOptions_Callback_Read_CorruptDeletePending,
|
||||
eOptions_Callback_Read_CorruptDeleted
|
||||
};
|
||||
|
||||
enum eSaveTransferState
|
||||
{
|
||||
eSaveTransfer_Idle,
|
||||
eSaveTransfer_Busy,
|
||||
eSaveTransfer_GettingFileSize,
|
||||
eSaveTransfer_FileSizeRetrieved,
|
||||
eSaveTransfer_GetFileData,
|
||||
eSaveTransfer_GettingFileData,
|
||||
eSaveTransfer_FileDataRetrieved,
|
||||
eSaveTransfer_Converting,
|
||||
eSaveTransfer_Saving,
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Global storage manager //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
C4JStorage();
|
||||
void Tick(void); // General storage manager tick to be called from game
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Savegame data ///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Initialisation
|
||||
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, // General manager initialisation
|
||||
int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,
|
||||
bool(*SetRetrieveProductIDFn)(XCONTENT_DATA &Data),WCHAR *pwchSCID,WCHAR *pwchTitleId);
|
||||
void SetGameSaveFolderTitle(WCHAR *wszGameSaveFolderTitle); // Sets the title to be set in the param.sfo of saves (this doesn't vary, the sub-title is used for the user cho
|
||||
void SetSaveCacheFolderTitle(WCHAR *wszSaveCacheFolderTitle); // Sets the title to be set in the param.sfo of the save cache
|
||||
void SetOptionsFolderTitle(WCHAR *wszOptionsFolderTitle); // Sets the title to be set in the param.sfo of the options file
|
||||
void SetGameSaveFolderPrefix(char *szGameSaveFolderPrefix); // Sets the prefix to be added to the unique filename of each save to construct a final folder name
|
||||
void SetMaxSaves(int iMaxC); // Sets the maximum number of saves to be evaluated by GetSavesInfo etc.
|
||||
void SetDefaultImages(PBYTE pbSaveThumbnail,DWORD dwSaveThumbnailBytes); // Sets default save thumbnail, which can be used when saving a game that hasn't generated any yet
|
||||
void SetIncompleteSaveCallback(void( *Func)(LPVOID, const ESaveIncompleteType), LPVOID param); // Sets callback to be used in the event of a save method not being able to complete
|
||||
|
||||
// Miscellaneous control
|
||||
void SetSaveDisabled(bool bDisable); // Sets saving disabled/enabled state
|
||||
bool GetSaveDisabled(void); // Determines whether saving has been disabled
|
||||
void ResetSaveData(); // Releases any internal storage being held for previously saved/loaded data
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); // Determine if current savegame exists on storage device
|
||||
bool EnoughSpaceForAMinSaveGame();
|
||||
C4JStorage::ESaveGameState GetSaveState();
|
||||
|
||||
// Get details of existing savedata
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); // Start search
|
||||
PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or NULL if not yet received)
|
||||
void ClearSavesInfo(); // Clears results
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam, bool force=false); // Get the thumbnail for an individual save referenced by pSaveInfo
|
||||
|
||||
// Loading savedata & obtaining information from just-loaded file
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); // Loads savedata referenced by pSaveInfo, calls callback once complete
|
||||
unsigned int GetSaveSize(); // Obtains sizse of just-loaded save
|
||||
void GetSaveData(void *pvData,unsigned int *puiBytes); // Obtains pointer to, and size, of just-loaded save
|
||||
bool GetSaveUniqueNumber(INT *piVal); // Gets the unique numeric portion of the folder name used for the save (encodes m
|
||||
bool GetSaveUniqueFilename(char *pszName); // Get the full unique "filename" used as part of the folder name for the save
|
||||
|
||||
// Handling of sub-files (numerically indexed ) within the save
|
||||
unsigned int GetSubfileCount(); // Get the number of sub-files in the just-loaded save
|
||||
void ResetSubfiles(); // Reset storage manager's references to sub-files, to be called when we are finished with the save game
|
||||
void GetSubfileDetails(int idx, unsigned int *subfileId, unsigned char **data, unsigned int *sizeOut); // Gets details for sub-file from 0 to GetSubfileCount() - 1. Caller is responsible for data allocation after this point.
|
||||
void UpdateSubfile(int idx, unsigned char *data, unsigned int size); // Update internal details for a sub-file, from 0 to GetSubfileCount() - 1.
|
||||
int AddSubfile(unsigned int subfileId); // Adds an additional sub-file with a given subfileId, returns index
|
||||
C4JStorage::ESaveGameState SaveSubfiles(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Writes all modified sub-files, calling callback on completion
|
||||
|
||||
// Saving savedata
|
||||
void SetSaveTitle(const wchar_t *UTF16String); // Sets the name which is used as a sub-title in the savedata param.sfo
|
||||
PVOID AllocateSaveData(unsigned int uiBytes); // Allocate storage manager owned memory to the data which is to be saved to
|
||||
void SetSaveDataSize(unsigned int uiBytes); // Set the actual size of data to be saved
|
||||
void GetDefaultSaveImage(PBYTE *ppbSaveImage,DWORD *pdwSaveImageBytes); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
|
||||
void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail,DWORD *pdwSaveThumbnailBytes); // Get the default save image (as set by SetDefaultImages) for use on saving games that
|
||||
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
|
||||
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Save the actual data, calling callback on completion
|
||||
|
||||
// Handling of incomplete saves (either sub-files or save data). To be used after game has had callback for an incomplete save event
|
||||
void ContinueIncompleteOperation();
|
||||
void CancelIncompleteOperation();
|
||||
|
||||
// Other file operations
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Deletes savedata referenced by pSaveInfo, calls callback when comple
|
||||
C4JStorage::ESaveGameState CopySaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID ,const bool,C4JStorage::ESaveGameState state),bool( *FuncProg)(LPVOID ,const int),LPVOID lpParam); // Copies savedata referenced by pSaveInfo, calls callback when complete
|
||||
C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex,uint16_t*pui16NewName,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Renamed savedata with index from last established ReturnSavesInfo.
|
||||
|
||||
// Internal methods
|
||||
void GetSaveImage(PBYTE *ppbSaveImage, int *puiSaveImageBytes);
|
||||
void GetSaveThumbnail(PBYTE *ppbSaveThumbnail, int *puiSaveThumbnailBytes);
|
||||
void SetSaveUniqueFilename(wchar_t *szFilename);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Profile data ////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Initialisation
|
||||
void InitialiseProfileData(unsigned short usProfileVersion, UINT uiProfileValuesC, UINT uiProfileSettingsC, DWORD *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); // General initialisation
|
||||
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); // Set a callback that can initialise a profile's storage to its default settings
|
||||
void SetOptionsDataCallback(int( *Func)(LPVOID, int iPad, unsigned short usVersion, C4JStorage::eOptionsCallback),LPVOID lpParam); // Sets callback that is called when status of any options has changed
|
||||
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
|
||||
|
||||
// Getting and setting of profile data
|
||||
PROFILESETTINGS * GetDashboardProfileSettings(int iPad); // Get pointer to the standard (originally xbox dashboard) profile data for one user
|
||||
void *GetGameDefinedProfileData(int iQuadrant); // Get pointer to the game-defined profile data for one user
|
||||
|
||||
// Reading and writing profiles
|
||||
void ReadFromProfile(int iQuadrant, int iReadType=PROFILE_READTYPE_ALL); // Initiate read profile data for one user - read type is ignored on this platform
|
||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); // Initiate write profile for one user
|
||||
void DeleteOptionsData(int iPad); // Delete profile data for one user
|
||||
void ForceQueuedProfileWrites(int iPad=-1); // Force any queued profile writes to write now
|
||||
|
||||
// DLC
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
void SetLicenseChangeFn(void( *Func)(void));
|
||||
|
||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPWSTR szMountDrive = NULL);
|
||||
DWORD UnmountInstalledDLC(LPWSTR szMountDrive = NULL);
|
||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::wstring>& fileList);
|
||||
std::wstring GetMountedPath(std::wstring szMount);
|
||||
XCONTENT_DATA * GetInstalledDLC(WCHAR *wszProductID);
|
||||
|
||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT);
|
||||
MARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||
DWORD InstallOffer(int iOfferIDC,WCHAR *pwchProductId,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
|
||||
void UpdateDLCProductIDs(); // once we have the dlc info, we can give local installed DLC their product ids
|
||||
|
||||
//void SetRetrieveProductIDFn(int( *Func)(XCONTENT_DATA&)); // Retrieve a product id for the dlc from the game
|
||||
|
||||
void Suspend();
|
||||
bool Suspended();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Unimplemented stubs /////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma warning(disable: 4100)
|
||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {}
|
||||
bool GetSaveDeviceSelected(unsigned int iPad) { return true; }
|
||||
void ClearDLCOffers();
|
||||
// C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction);// { return C4JStorage::ETMSStatus_Idle; }
|
||||
// bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename,BYTE *pBuffer,DWORD dwBufferSize);
|
||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename);
|
||||
|
||||
// TMS++
|
||||
C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage eStorageFacility,int iPad);//,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0);
|
||||
eTitleStorageState TMSPP_WriteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,BYTE *pbBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0);
|
||||
eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData);
|
||||
eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData);
|
||||
eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,LPVOID lpParam=NULL, int iUserData=0);
|
||||
bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename);
|
||||
|
||||
eTitleStorageState TMSPP_GetTitleStorageState(int iPad);
|
||||
void TMSPP_ClearTitleStorageState(int iPad);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SAVE TRANSFERS
|
||||
C4JStorage::eSaveTransferState SaveTransferClearState();
|
||||
C4JStorage::eSaveTransferState SaveTransferGetDetails(int iPad, eGlobalStorage source, wchar_t *file, int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),LPVOID lpParam);
|
||||
C4JStorage::eSaveTransferState SaveTransferGetData(int iPad, eGlobalStorage source, wchar_t *file,int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),int ( *ProgressFunc)(LPVOID lpParam,unsigned long),LPVOID lpParam,LPVOID lpProgressParam);
|
||||
void CancelSaveTransfer(int ( *CancelCompleteFunc)(LPVOID lpParam),LPVOID lpParam);
|
||||
};
|
||||
|
||||
extern C4JStorage StorageManager;
|
||||
Reference in New Issue
Block a user