first commit
177
Minecraft.Client/PSVita/4JLibs/inc/4J_Input.h
Normal file
@@ -0,0 +1,177 @@
|
||||
#pragma once
|
||||
|
||||
#include <ctrl.h>
|
||||
#include <touch.h>
|
||||
|
||||
#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
|
||||
|
||||
// PSVita equivalents
|
||||
|
||||
#define _PSV_JOY_BUTTON_X _360_JOY_BUTTON_A
|
||||
#define _PSV_JOY_BUTTON_O _360_JOY_BUTTON_B
|
||||
#define _PSV_JOY_BUTTON_SQUARE _360_JOY_BUTTON_X
|
||||
#define _PSV_JOY_BUTTON_TRIANGLE _360_JOY_BUTTON_Y
|
||||
#define _PSV_JOY_BUTTON_START _360_JOY_BUTTON_START
|
||||
#define _PSV_JOY_BUTTON_SELECT _360_JOY_BUTTON_BACK
|
||||
#define _PSV_JOY_BUTTON_R1 _360_JOY_BUTTON_RB
|
||||
#define _PSV_JOY_BUTTON_L1 _360_JOY_BUTTON_LB
|
||||
#define _PSV_JOY_BUTTON_R3 _360_JOY_BUTTON_RTHUMB
|
||||
#define _PSV_JOY_BUTTON_L3 _360_JOY_BUTTON_LTHUMB
|
||||
#define _PSV_JOY_BUTTON_DPAD_UP _360_JOY_BUTTON_DPAD_UP
|
||||
#define _PSV_JOY_BUTTON_DPAD_DOWN _360_JOY_BUTTON_DPAD_DOWN
|
||||
#define _PSV_JOY_BUTTON_DPAD_LEFT _360_JOY_BUTTON_DPAD_LEFT
|
||||
#define _PSV_JOY_BUTTON_DPAD_RIGHT _360_JOY_BUTTON_DPAD_RIGHT
|
||||
#define _PSV_JOY_BUTTON_LSTICK_RIGHT _360_JOY_BUTTON_LSTICK_RIGHT
|
||||
#define _PSV_JOY_BUTTON_LSTICK_LEFT _360_JOY_BUTTON_LSTICK_LEFT
|
||||
#define _PSV_JOY_BUTTON_RSTICK_DOWN _360_JOY_BUTTON_RSTICK_DOWN
|
||||
#define _PSV_JOY_BUTTON_RSTICK_UP _360_JOY_BUTTON_RSTICK_UP
|
||||
#define _PSV_JOY_BUTTON_RSTICK_RIGHT _360_JOY_BUTTON_RSTICK_RIGHT
|
||||
#define _PSV_JOY_BUTTON_RSTICK_LEFT _360_JOY_BUTTON_RSTICK_LEFT
|
||||
#define _PSV_JOY_BUTTON_LSTICK_DOWN _360_JOY_BUTTON_LSTICK_DOWN
|
||||
#define _PSV_JOY_BUTTON_LSTICK_UP _360_JOY_BUTTON_LSTICK_UP
|
||||
#define _PSV_JOY_BUTTON_R2 _360_JOY_BUTTON_RT
|
||||
#define _PSV_JOY_BUTTON_L2 _360_JOY_BUTTON_LT
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
enum EKeyboardResult
|
||||
{
|
||||
EKeyboard_Pending,
|
||||
EKeyboard_Cancelled,
|
||||
EKeyboard_ResultAccept,
|
||||
EKeyboard_ResultDecline,
|
||||
};
|
||||
|
||||
typedef struct _STRING_VERIFY_RESPONSE
|
||||
{
|
||||
WORD wNumStrings;
|
||||
HRESULT *pStringResult;
|
||||
}
|
||||
STRING_VERIFY_RESPONSE;
|
||||
|
||||
class C_4JInput
|
||||
{
|
||||
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,unsigned char ucActionC, unsigned char ucMenuActionC );
|
||||
void Tick(void);
|
||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
|
||||
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);
|
||||
bool IsPadConnected(int iPad);
|
||||
void SetCircleCrossSwapped(bool swapped);
|
||||
bool IsCircleCrossSwapped();
|
||||
|
||||
// Map touch input to buttons
|
||||
void MapTouchInput(int iPad, unsigned int uiActionVal);
|
||||
|
||||
// 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);
|
||||
|
||||
SceTouchData* GetTouchPadData(int iPad, bool bCheckMenuDisplay);
|
||||
|
||||
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, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
||||
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 IsVitaTV();
|
||||
|
||||
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JInput InputManager;
|
||||
194
Minecraft.Client/PSVita/4JLibs/inc/4J_Profile.h
Normal file
@@ -0,0 +1,194 @@
|
||||
#pragma once
|
||||
#include <np/np_common.h>
|
||||
#include <np_toolkit.h>
|
||||
#include <np.h>
|
||||
#include <message_dialog.h>
|
||||
|
||||
using namespace sce::Toolkit::NP;
|
||||
using namespace sce::Toolkit::NP::Utilities;
|
||||
|
||||
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,
|
||||
eUpsellResponse_UserNotSignedInPSN
|
||||
};
|
||||
|
||||
class C_4JProfile
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// INIT
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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 SceNpCommunicationConfig _commsId,
|
||||
const std::string _serviceID,
|
||||
unsigned short usProfileVersion,
|
||||
UINT uiProfileValuesC,
|
||||
UINT uiProfileSettingsC,
|
||||
DWORD *pdwProfileSettingsA,
|
||||
int iGameDefinedDataSizeX4,
|
||||
unsigned int *puiGameDefinedDataChangedBitmask);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SIGN-IN/USERS
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool IsSignedIn(int iQuadrant);
|
||||
bool IsSignedInLive(int iProf);
|
||||
bool IsSignedInPSN(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);
|
||||
void GetSceNpId(int iPad, SceNpId *npId);
|
||||
DWORD GetSignedInUsersMask();
|
||||
void SetNetworkStatus(bool bOnlinePSN, bool bSignedInPSN);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MISC
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int GetLockedProfile();
|
||||
void SetLockedProfile(int iProf);
|
||||
void SetGetStringFunc(LPCWSTR ( *Func)(int));
|
||||
void SetPlayerListTitleID(int id);
|
||||
bool AllowedToPlayMultiplayer(int iProf);
|
||||
bool HasPlayStationPlus(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 );
|
||||
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
||||
void Tick( void );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// AVATAR
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
{
|
||||
int iPad;
|
||||
int ( *m_fnFunc)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
|
||||
LPVOID m_fnFunc_Param;
|
||||
}
|
||||
FUNCPARAMS;
|
||||
bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam);
|
||||
void CancelProfileAvatarRequest();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SYS
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
|
||||
bool IsFullVersion();
|
||||
void SetFullVersion(bool bFull);
|
||||
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 SetSysUIShowing( bool bUIDisplayed );
|
||||
void DisplaySystemMessage( SceMsgDialogSystemMessageType _type, int iQuadrant);
|
||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
||||
void ShowSystemMessage( int _type, int _val );
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ACHIEVEMENTS & AWARDS
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void InitialiseTrophies(); //CD - Don't use this, auto setup after login
|
||||
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);
|
||||
void Terminate();
|
||||
void SetFatalTrophyErrorID(int id); //CD - Deprecated
|
||||
int WaitTrophyInitComplete(); //CD - Deprecated
|
||||
int tryWaitTrophyInitComplete(); //CD - Deprecated
|
||||
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
||||
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
||||
void SetHDDFreeKB(int iHDDFreeKB);
|
||||
void SetMinSaveKB(int iMinSaveKB);
|
||||
int GetHDDFreeKB(void);
|
||||
bool AreTrophiesInstalled();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RICH PRESENCE
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void RichPresenceRegisterPresenceString(int index, const char* str);
|
||||
void RichPresenceRegisterContext(int ctxID, const char* token);
|
||||
void RichPresenceRegisterContextString(int ctxID, int strIndex, const char* str);
|
||||
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
||||
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
|
||||
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
||||
void SetRichPresenceSettingFn(int ( *SetPresenceInfoFn)(const void *data));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Chat and content restrictions
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool GetChatAndContentRestrictions(int iPad, bool thisQuadrantOnly,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
||||
void SetServiceID(char *pchServiceID); // needed for the ticket request for the chat restrictions of secondary PSN players
|
||||
void HandleNetworkTicket(int result,void *arg);
|
||||
void SetMinimumAge(int iAge, int iRegion);// 0 - SCEE, 1- SCEA, 2 - SCEJ
|
||||
int GetMinimumAge();
|
||||
void SetGermanyMinimumAge(int iAge);
|
||||
int GetGermanyMinimumAge();
|
||||
void SetRussiaMinimumAge(int iAge);
|
||||
int GetRussiaMinimumAge();
|
||||
void SetAustraliaMinimumAge(int iAge);
|
||||
int GetAustraliaMinimumAge();
|
||||
void SetJapanMinimumAge(int iAge);
|
||||
int GetJapanMinimumAge();
|
||||
void SetKoreaMinimumAge(int iAge);
|
||||
int GetKoreaMinimumAge();
|
||||
int getUserID(int iQuadrant); // grab the PS4 userID for this quadrant (SCE_USER_SERVICE_USER_ID_INVALID if it's not signed in)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Http calls
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool SonyHttp_init();
|
||||
void SonyHttp_shutdown();
|
||||
bool SonyHttp_getDataFromURL(const char* szURL, void** ppOutData, int* pDataSize);
|
||||
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JProfile ProfileManager;
|
||||
|
||||
318
Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h
Normal file
@@ -0,0 +1,318 @@
|
||||
#pragma once
|
||||
|
||||
#include <gxm.h>
|
||||
|
||||
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 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_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);
|
||||
#ifdef __PSVITA__
|
||||
void DrawVerticesCutOut(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
#endif
|
||||
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);
|
||||
void CBuffClear(int index);
|
||||
int CBuffSize(int index);
|
||||
void CBuffEnd();
|
||||
bool CBuffCall(int index, bool full = true);
|
||||
#ifdef __PSVITA__
|
||||
bool CBuffCallCutOut(int index, bool full = true);
|
||||
#endif
|
||||
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();
|
||||
unsigned char * 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);
|
||||
void TextureGetStats();
|
||||
SceGxmTexture *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(SceGxmStencilFunc Function, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
|
||||
void StateSetForceLOD(int LOD);
|
||||
|
||||
// Event tracking
|
||||
void BeginEvent(LPCWSTR eventName);
|
||||
void EndEvent();
|
||||
|
||||
void* allocGPURWMem(const size_t size,const size_t alignment = 16);
|
||||
void freeGPURWMem(void* mem);
|
||||
void* allocGPUROMem(const size_t size,const size_t alignment = 16);
|
||||
void freeGPUROMem(void* mem);
|
||||
void* allocGPUCDMem(const size_t size,const size_t alignment = 16);
|
||||
void freeGPUCDMem(void* mem);
|
||||
int getDisplayBufferCount();
|
||||
volatile uint32_t *getNotificationRegion();
|
||||
SceGxmContext *getGXMContext();
|
||||
SceGxmColorSurface *getCurrentDisplaySurface();
|
||||
SceGxmDepthStencilSurface *getCurrentDepthSurface();
|
||||
SceGxmShaderPatcher *getGXMShaderPatcher();
|
||||
void setFragmentNotification(SceGxmNotification notification);
|
||||
bool GetIsInScene();
|
||||
void SetCameraPosition(float x, float y, float z);
|
||||
};
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
389
Minecraft.Client/PSVita/4JLibs/inc/4J_Storage.h
Normal file
@@ -0,0 +1,389 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
|
||||
#include <fios2.h>
|
||||
|
||||
//#define MAX_DISPLAYNAME_LENGTH 128 // SCE_SAVE_DATA_SUBTITLE_MAXSIZE on PS4
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // SCE_APPUTIL_SAVEDATA_SLOT_SUBTITLE_MAXSIZE on Vita
|
||||
|
||||
//#define MAX_SAVEFILENAME_LENGTH 32 // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE on PS4
|
||||
#define MAX_SAVEFILENAME_LENGTH 64//SCE_APPUTIL_SAVEDATA_SLOT_TITLE_MAXSIZE on Vita
|
||||
|
||||
#define USER_INDEX_ANY 0x000000FF
|
||||
#define RESULT LONG
|
||||
|
||||
class StringTable;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
time_t modifiedTime;
|
||||
PBYTE thumbnailData;
|
||||
unsigned int thumbnailSize;
|
||||
//int sizeKB;
|
||||
}
|
||||
SAVE_INFO,*PSAVE_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iSaveC;
|
||||
PSAVE_INFO SaveInfoA;
|
||||
}
|
||||
SAVE_DETAILS,*PSAVE_DETAILS;
|
||||
|
||||
class CONTENT_DATA
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
e_contentLocked,
|
||||
e_contentUnlocked
|
||||
};
|
||||
int DeviceID;
|
||||
DWORD dwContentType;
|
||||
WCHAR wszDisplayName[256];
|
||||
CHAR szFileName[SCE_FIOS_PATH_MAX];
|
||||
};
|
||||
typedef CONTENT_DATA XCONTENT_DATA, *PXCONTENT_DATA; // TODO - put back in when actually interfacing with game
|
||||
|
||||
#define MARKETPLACE_CONTENTOFFER_INFO int
|
||||
|
||||
// Current version of the dlc data creator
|
||||
#define CURRENT_DLC_VERSION_NUM 3
|
||||
|
||||
// MGH - moved these here from Orbis_App.h
|
||||
enum e_SONYDLCType
|
||||
{
|
||||
eSONYDLCType_SkinPack=0,
|
||||
eSONYDLCType_TexturePack,
|
||||
eSONYDLCType_MashUpPack,
|
||||
eSONYDLCType_All
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char chDLCKeyname[16];
|
||||
//char chDLCTitle[64];
|
||||
e_SONYDLCType eDLCType;
|
||||
int iFirstSkin;
|
||||
int iConfig; // used for texture pack data files
|
||||
}
|
||||
SONYDLC;
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
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_Load,
|
||||
ESaveGame_LoadCompleteSuccess,
|
||||
ESaveGame_LoadCompleteFail,
|
||||
|
||||
ESaveGame_Delete,
|
||||
ESaveGame_DeleteSuccess,
|
||||
ESaveGame_DeleteFail,
|
||||
|
||||
ESaveGame_Rename,
|
||||
ESaveGame_RenameSuccess,
|
||||
ESaveGame_RenameFail,
|
||||
|
||||
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
|
||||
ESaveGame_GetSaveInfo,
|
||||
|
||||
ESaveGame_SaveCache,
|
||||
ESaveGame_ReconstructCache
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// 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,LPCSTR szGroupID);
|
||||
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 pbOptionsImage,DWORD dwOptionsImageBytes,PBYTE pbSaveImage,DWORD dwSaveImageBytes, // Sets default save image and thumbnail, which can be used when saving a game that hasn't generated any yet
|
||||
PBYTE pbSaveThumbnail,DWORD dwSaveThumbnailBytes);
|
||||
|
||||
void SetIncompleteSaveCallback(void( *Func)(LPVOID, const ESaveIncompleteType, int blocksRequired), 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();
|
||||
|
||||
// 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); // 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
|
||||
bool GetSaveUniqueFileDir(char *pszName); // Get the full unique "filename" used as part of the folder name for the save
|
||||
|
||||
// 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();
|
||||
|
||||
ESaveIncompleteType GetSaveError(); // Returns the save error [SaveData]
|
||||
void ClearSaveError(); // Clears any save error
|
||||
ESaveIncompleteType GetOptionsSaveError(); // Returns the save error [Options]
|
||||
void ClearOptionsSaveError(); // Clears any save error
|
||||
|
||||
// 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 RenameSaveData(int iRenameIndex, uint16_t*pui16NewName, int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Renamed savedata with index from last established ReturnSavesInfo.
|
||||
|
||||
// Internal methods
|
||||
private:
|
||||
void GetSaveImage(PBYTE *ppbSaveImage, int *puiSaveImageBytes);
|
||||
void GetSaveThumbnail(PBYTE *ppbSaveThumbnail, int *puiSaveThumbnailBytes);
|
||||
public:
|
||||
void SetSaveUniqueFilename(char *szFilename); // MGH - made this public, used for the cross save stuff
|
||||
void EnableDownloadSave(); // CD - Used for cross/download-save, sets a flag for saving
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Profile data ////////////////////////////////////////////////////////////////////////////////////////
|
||||
public:
|
||||
// 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=XUSER_INDEX_ANY); // Force any queued profile writes to write now
|
||||
C4JStorage::ESaveGameState GetSaveState();
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////// Unimplemented stubs /////////////////////////////////////////////////////////////////////////////////
|
||||
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,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize) { return true; }
|
||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
|
||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; }
|
||||
|
||||
// DLC
|
||||
void SetDLCPackageRoot(char *pszDLCRoot);
|
||||
EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
CONTENT_DATA& GetDLC(DWORD dw);
|
||||
DWORD GetAvailableDLCCount( int iPad );
|
||||
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive = NULL);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
void SetDLCProductCode(const char* szProductCode);
|
||||
void SetProductUpgradeKey(const char* szKey);
|
||||
bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam);
|
||||
void SetDLCInfoMap(unordered_map<wstring, SONYDLC *>* pSONYDLCMap);
|
||||
void EntitlementsCallback(bool bFoundEntitlements);
|
||||
|
||||
};
|
||||
|
||||
extern C4JStorage StorageManager;
|
||||
20
Minecraft.Client/PSVita/Assert/assert.h
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
#include <libdbg.h>
|
||||
|
||||
#ifdef _CONTENT_PACKAGE
|
||||
#define PSVITA_ASSERT(val)
|
||||
#elif defined(_RELEASE_FOR_ART)
|
||||
#define PSVITA_ASSERT(val)
|
||||
#else
|
||||
#define PSVITA_ASSERT(val) if(!(val)) { printf("------------------------------------------ \n"); \
|
||||
printf("Func : %s \n", __FUNCTION__); \
|
||||
printf("File : %s \n", __FILE__); \
|
||||
printf("Line : %d \n",__LINE__ ); \
|
||||
printf("assert(%s) failed!!!\n", #val); \
|
||||
printf("------------------------------------------ \n"); \
|
||||
SCE_BREAK(); }
|
||||
#endif
|
||||
|
||||
#define assert PSVITA_ASSERT
|
||||
37
Minecraft.Client/PSVita/Builds/CreatePSVitaConfig.plx
Normal file
@@ -0,0 +1,37 @@
|
||||
#! /usr/bin/perl -w
|
||||
use warnings;
|
||||
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
|
||||
|
||||
open FH, '..\..\Common\BuildVer.h' or die $!;
|
||||
|
||||
my $lineno=1;
|
||||
my $index;
|
||||
|
||||
while(<FH>)
|
||||
{
|
||||
$lineno++;
|
||||
|
||||
$index = rindex($_,'#define VER_PRODUCTBUILD ');
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
if($index>-1)
|
||||
{
|
||||
@build = split(/ +/, $line);
|
||||
|
||||
$buildnum = sprintf("%4d", $build[2]);
|
||||
$buildnum=~ tr/ /0/;
|
||||
}
|
||||
}
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
##print 'Build num is Minecraft_', $year-100,'.',$mon+1,'.',$mday,'.',$buildnum;
|
||||
|
||||
$buildname=sprintf("Minecraft_%02d.%02d.%02d.%s_TU12", $year-100,$mon+1,$mday,$buildnum);
|
||||
|
||||
open FH, "+>", 'BuildName.txt' or die $!;
|
||||
|
||||
$configline = sprintf("MINECRAFTVIT%s,",$buildnum); ##build package name
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
51
Minecraft.Client/PSVita/Builds/CreatePSVitaConfig_SCEA.plx
Normal file
@@ -0,0 +1,51 @@
|
||||
#! /usr/bin/perl -w
|
||||
use warnings;
|
||||
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
|
||||
|
||||
open FH, '..\..\Common\BuildVer.h' or die $!;
|
||||
|
||||
my $lineno=1;
|
||||
my $index;
|
||||
|
||||
while(<FH>)
|
||||
{
|
||||
$lineno++;
|
||||
|
||||
$index = rindex($_,'#define VER_PRODUCTBUILD ');
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
if($index>-1)
|
||||
{
|
||||
@build = split(/ +/, $line);
|
||||
|
||||
$buildnum = sprintf("%4d", $build[2]);
|
||||
$buildnum=~ tr/ /0/;
|
||||
}
|
||||
}
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
open FH, "+>", 'BuildName.txt' or die $!;
|
||||
|
||||
$configline = sprintf("MINECRAFTVIT%s,",$buildnum); ##build package name
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
|
||||
## Copy the symbols file
|
||||
|
||||
open FH, "+>", 'move_pkg.cmd' or die $!;
|
||||
|
||||
$configline = sprintf("mkdir X:\\Builds\\PSVita\\%s\\\n",$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\UP4433-PCSE00491_00-MINECRAFTVIT0000.pkg X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-UP4433-PCSE00491_00-MINECRAFTVIT0000-A0100-V0100-spec.xml X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-UP4433-PCSE00491_00-MINECRAFTVIT0000-A0100-V0100-submission_materials.zip X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\%%TERRITORY%%.self X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
51
Minecraft.Client/PSVita/Builds/CreatePSVitaConfig_SCEE.plx
Normal file
@@ -0,0 +1,51 @@
|
||||
#! /usr/bin/perl -w
|
||||
use warnings;
|
||||
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
|
||||
|
||||
open FH, '..\..\Common\BuildVer.h' or die $!;
|
||||
|
||||
my $lineno=1;
|
||||
my $index;
|
||||
|
||||
while(<FH>)
|
||||
{
|
||||
$lineno++;
|
||||
|
||||
$index = rindex($_,'#define VER_PRODUCTBUILD ');
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
if($index>-1)
|
||||
{
|
||||
@build = split(/ +/, $line);
|
||||
|
||||
$buildnum = sprintf("%4d", $build[2]);
|
||||
$buildnum=~ tr/ /0/;
|
||||
}
|
||||
}
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
open FH, "+>", 'BuildName.txt' or die $!;
|
||||
|
||||
$configline = sprintf("MINECRAFTVIT%s,",$buildnum); ##build package name
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
|
||||
## Copy the symbols file
|
||||
|
||||
open FH, "+>", 'move_pkg.cmd' or die $!;
|
||||
|
||||
$configline = sprintf("mkdir X:\\Builds\\PSVita\\%s\\\n",$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\EP4433-PCSB00560_00-MINECRAFTVIT0000.pkg X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-EP4433-PCSB00560_00-MINECRAFTVIT0000-A0100-V0100-spec.xml X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-EP4433-PCSB00560_00-MINECRAFTVIT0000-A0100-V0100-submission_materials.zip X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\%%TERRITORY%%.self X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
51
Minecraft.Client/PSVita/Builds/CreatePSVitaConfig_SCEJ.plx
Normal file
@@ -0,0 +1,51 @@
|
||||
#! /usr/bin/perl -w
|
||||
use warnings;
|
||||
use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
|
||||
|
||||
open FH, '..\..\Common\BuildVer.h' or die $!;
|
||||
|
||||
my $lineno=1;
|
||||
my $index;
|
||||
|
||||
while(<FH>)
|
||||
{
|
||||
$lineno++;
|
||||
|
||||
$index = rindex($_,'#define VER_PRODUCTBUILD ');
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
if($index>-1)
|
||||
{
|
||||
@build = split(/ +/, $line);
|
||||
|
||||
$buildnum = sprintf("%4d", $build[2]);
|
||||
$buildnum=~ tr/ /0/;
|
||||
}
|
||||
}
|
||||
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||
|
||||
open FH, "+>", 'BuildName.txt' or die $!;
|
||||
|
||||
$configline = sprintf("MINECRAFTVIT%s,",$buildnum); ##build package name
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
|
||||
## Copy the symbols file
|
||||
|
||||
open FH, "+>", 'move_pkg.cmd' or die $!;
|
||||
|
||||
$configline = sprintf("mkdir X:\\Builds\\PSVita\\%s\\\n",$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\JP0127-PCSG00302_00-MINECRAFTVIT0000.pkg X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-JP0127-PCSG00302_00-MINECRAFTVIT0000-A0100-V0100-spec.xml X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\BUILD\\psvita-pkg-JP0127-PCSG00302_00-MINECRAFTVIT0000-A0100-V0100-submission_materials.zip X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
$configline = sprintf("move X:\\Builds\\PSVita\\%%TERRITORY%%\\%%TERRITORY%%.self X:\\Builds\\PSVita\\%s\\\n",$buildnum,$buildnum);
|
||||
print FH $configline;
|
||||
|
||||
close FH;
|
||||
1
Minecraft.Client/PSVita/Builds/PSVitaPackageTFS.conf
Normal file
@@ -0,0 +1 @@
|
||||
EP4433-PCSB00560_00-MINECRAFTVIT0370,0x8EC5D170888C9865D100F04EB42198BF,Free,Demo,GameExec,01.00
|
||||
BIN
Minecraft.Client/PSVita/GameConfig/Minecraft.gameconfig
Normal file
BIN
Minecraft.Client/PSVita/GameConfig/Minecraft.spa
Normal file
701
Minecraft.Client/PSVita/GameConfig/Minecraft.spa.h
Normal file
@@ -0,0 +1,701 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// C:\Work\4J\Mojang\Minecraft\Minecraft360-dev\Minecraft.Client\Xbox\GameConfig\Minecraft.spa.h
|
||||
//
|
||||
// Auto-generated on Thursday, 10 May 2012 at 21:23:22
|
||||
// Xbox LIVE Game Config project version 1.0.173.0
|
||||
// SPA Compiler version 1.0.0.0
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MINECRAFT_SPA_H__
|
||||
#define __MINECRAFT_SPA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// Title info
|
||||
//
|
||||
|
||||
#define TITLEID_MINECRAFT 0x584111F7
|
||||
|
||||
//
|
||||
// Context ids
|
||||
//
|
||||
// These values are passed as the dwContextId to XUserSetContext.
|
||||
//
|
||||
|
||||
#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_RIDING_PIG 1
|
||||
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
|
||||
#define CONTEXT_GAME_STATE_BOATING 3
|
||||
#define CONTEXT_GAME_STATE_FISHING 4
|
||||
#define CONTEXT_GAME_STATE_CRAFTING 5
|
||||
#define CONTEXT_GAME_STATE_FORGING 6
|
||||
#define CONTEXT_GAME_STATE_NETHER 7
|
||||
#define CONTEXT_GAME_STATE_CD 8
|
||||
#define CONTEXT_GAME_STATE_MAP 9
|
||||
#define CONTEXT_GAME_STATE_ENCHANTING 10
|
||||
#define CONTEXT_GAME_STATE_BREWING 11
|
||||
#define CONTEXT_GAME_STATE_ANVIL 12
|
||||
#define CONTEXT_GAME_STATE_TRADING 13
|
||||
|
||||
// Values for X_CONTEXT_PRESENCE
|
||||
|
||||
#define CONTEXT_PRESENCE_IDLE 0
|
||||
#define CONTEXT_PRESENCE_MENUS 1
|
||||
#define CONTEXT_PRESENCE_MULTIPLAYER 2
|
||||
#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3
|
||||
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
|
||||
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
|
||||
|
||||
// Values for X_CONTEXT_GAME_MODE
|
||||
|
||||
#define CONTEXT_GAME_MODE_GAMEMODE 0
|
||||
#define CONTEXT_GAME_MODE_MULTIPLAYER 1
|
||||
|
||||
//
|
||||
// Property ids
|
||||
//
|
||||
// These values are passed as the dwPropertyId value to XUserSetProperty
|
||||
// and as the dwPropertyId value in the XUSER_PROPERTY structure.
|
||||
//
|
||||
|
||||
#define PROPERTY_LOCALE 0x10000008
|
||||
#define PROPERTY_KILLS_ZOMBIE 0x1000000A
|
||||
#define PROPERTY_KILLS_SKELETON 0x1000000B
|
||||
#define PROPERTY_KILLS_CREEPER 0x1000000C
|
||||
#define PROPERTY_KILLS_SPIDER 0x1000000D
|
||||
#define PROPERTY_KILLS_SPIDERJOCKEY 0x1000000E
|
||||
#define PROPERTY_KILLS_ZOMBIEPIGMAN 0x1000000F
|
||||
#define PROPERTY_KILLS_SLIME 0x10000010
|
||||
#define PROPERTY_KILLS_GHAST 0x10000011
|
||||
#define PROPERTY_MINED_DIRT 0x10000012
|
||||
#define PROPERTY_MINED_STONE 0x10000013
|
||||
#define PROPERTY_MINED_SAND 0x10000014
|
||||
#define PROPERTY_MINED_COBBLESTONE 0x10000015
|
||||
#define PROPERTY_MINED_GRAVEL 0x10000016
|
||||
#define PROPERTY_MINED_CLAY 0x10000017
|
||||
#define PROPERTY_MINED_OBSIDIAN 0x10000018
|
||||
#define PROPERTY_MINED_COAL 0x10000019
|
||||
#define PROPERTY_MINED_IRON 0x1000001A
|
||||
#define PROPERTY_MINED_GOLD 0x1000001B
|
||||
#define PROPERTY_MINED_DIAMOND 0x1000001C
|
||||
#define PROPERTY_MINED_REDSTONE 0x1000001D
|
||||
#define PROPERTY_MINED_LAPISLAZULI 0x1000001E
|
||||
#define PROPERTY_MINED_NETHERRACK 0x1000001F
|
||||
#define PROPERTY_MINED_SOULSAND 0x10000020
|
||||
#define PROPERTY_MINED_GLOWSTONE 0x10000021
|
||||
#define PROPERTY_COLLECTED_EGG 0x10000022
|
||||
#define PROPERTY_COLLECTED_WHEAT 0x10000023
|
||||
#define PROPERTY_COLLECTED_MUSHROOM 0x10000024
|
||||
#define PROPERTY_COLLECTED_SUGARCANE 0x10000025
|
||||
#define PROPERTY_COLLECTED_MILK 0x10000026
|
||||
#define PROPERTY_COLLECTED_PUMPKIN 0x10000027
|
||||
#define PROPERTY_TRAVEL_WALK 0x10000028
|
||||
#define PROPERTY_TRAVEL_SWIM 0x10000029
|
||||
#define PROPERTY_TRAVEL_FALL 0x1000002A
|
||||
#define PROPERTY_TRAVEL_CLIMB 0x1000002B
|
||||
#define PROPERTY_TRAVEL_MINECART 0x1000002C
|
||||
#define PROPERTY_TRAVEL_BOAT 0x1000002D
|
||||
#define PROPERTY_PORTALS_CREATED 0x1000002F
|
||||
#define PROPERTY_COLLECTED_NETHERLAVA 0x10000030
|
||||
#define PROPERTY_RATING 0x20000009
|
||||
|
||||
//
|
||||
// Achievement ids
|
||||
//
|
||||
// These values are used in the dwAchievementId member of the
|
||||
// XUSER_ACHIEVEMENT structure that is used with
|
||||
// XUserWriteAchievements and XUserCreateAchievementEnumerator.
|
||||
//
|
||||
|
||||
#define ACHIEVEMENT_01 1
|
||||
#define ACHIEVEMENT_02 2
|
||||
#define ACHIEVEMENT_03 3
|
||||
#define ACHIEVEMENT_04 4
|
||||
#define ACHIEVEMENT_05 5
|
||||
#define ACHIEVEMENT_06 6
|
||||
#define ACHIEVEMENT_07 7
|
||||
#define ACHIEVEMENT_08 8
|
||||
#define ACHIEVEMENT_09 9
|
||||
#define ACHIEVEMENT_10 10
|
||||
#define ACHIEVEMENT_11 11
|
||||
#define ACHIEVEMENT_12 12
|
||||
#define ACHIEVEMENT_13 13//4 //CD - Changed these as they unlocked the next trophy
|
||||
#define ACHIEVEMENT_14 14//5
|
||||
#define ACHIEVEMENT_15 15//6
|
||||
#define ACHIEVEMENT_16 16//7
|
||||
#define ACHIEVEMENT_17 17//8
|
||||
#define ACHIEVEMENT_18 18//9
|
||||
#define ACHIEVEMENT_19 19//20
|
||||
#define ACHIEVEMENT_20 20//1
|
||||
#define ACHIEVEMENT_21 21//2
|
||||
#define ACHIEVEMENT_22 22//3
|
||||
#define ACHIEVEMENT_23 23//4
|
||||
#define ACHIEVEMENT_24 24//5
|
||||
#define ACHIEVEMENT_25 25//6
|
||||
#define ACHIEVEMENT_26 26//7
|
||||
#define ACHIEVEMENT_27 27//8
|
||||
#define ACHIEVEMENT_28 28//9
|
||||
|
||||
// 4J - Expanded Achivements (29-50), initially added for Durango.
|
||||
#define ACHIEVEMENT_29 29
|
||||
#define ACHIEVEMENT_30 30
|
||||
#define ACHIEVEMENT_31 31
|
||||
#define ACHIEVEMENT_32 32
|
||||
#define ACHIEVEMENT_33 33
|
||||
#define ACHIEVEMENT_34 34
|
||||
#define ACHIEVEMENT_35 35
|
||||
#define ACHIEVEMENT_36 36
|
||||
#define ACHIEVEMENT_37 37
|
||||
#define ACHIEVEMENT_38 38
|
||||
#define ACHIEVEMENT_39 39
|
||||
#define ACHIEVEMENT_40 40
|
||||
#define ACHIEVEMENT_41 41
|
||||
#define ACHIEVEMENT_42 42
|
||||
#define ACHIEVEMENT_43 43
|
||||
#define ACHIEVEMENT_44 44
|
||||
#define ACHIEVEMENT_45 45
|
||||
#define ACHIEVEMENT_46 46
|
||||
#define ACHIEVEMENT_47 47
|
||||
#define ACHIEVEMENT_48 48
|
||||
#define ACHIEVEMENT_49 49
|
||||
#define ACHIEVEMENT_50 50
|
||||
|
||||
|
||||
//
|
||||
// AvatarAssetAward ids
|
||||
//
|
||||
|
||||
#define AVATARASSETAWARD_PORKCHOP_TSHIRT 1
|
||||
#define AVATARASSETAWARD_WATCH 2
|
||||
#define AVATARASSETAWARD_CAP 5
|
||||
|
||||
//
|
||||
// Stats view ids
|
||||
//
|
||||
// These are used in the dwViewId member of the XUSER_STATS_SPEC structure
|
||||
// passed to the XUserReadStats* and XUserCreateStatsEnumerator* functions.
|
||||
//
|
||||
|
||||
// Skill leaderboards for ranked game modes
|
||||
|
||||
#define STATS_VIEW_SKILL_RANKED_GAMEMODE 0xFFFF0000
|
||||
#define STATS_VIEW_SKILL_RANKED_MULTIPLAYER 0xFFFF0001
|
||||
|
||||
// Skill leaderboards for unranked (standard) game modes
|
||||
|
||||
#define STATS_VIEW_SKILL_STANDARD_GAMEMODE 0xFFFE0000
|
||||
#define STATS_VIEW_SKILL_STANDARD_MULTIPLAYER 0xFFFE0001
|
||||
|
||||
// Title defined leaderboards
|
||||
|
||||
#define STATS_VIEW_KILLS_EASY 4
|
||||
#define STATS_VIEW_KILLS_NORMAL 5
|
||||
#define STATS_VIEW_KILLS_HARD 6
|
||||
#define STATS_VIEW_MINING_BLOCKS_PEACEFUL 7
|
||||
#define STATS_VIEW_MINING_BLOCKS_EASY 8
|
||||
#define STATS_VIEW_MINING_BLOCKS_NORMAL 9
|
||||
#define STATS_VIEW_MINING_BLOCKS_HARD 10
|
||||
#define STATS_VIEW_FARMING_PEACEFUL 15
|
||||
#define STATS_VIEW_FARMING_EASY 16
|
||||
#define STATS_VIEW_FARMING_NORMAL 17
|
||||
#define STATS_VIEW_FARMING_HARD 18
|
||||
#define STATS_VIEW_TRAVELLING_PEACEFUL 19
|
||||
#define STATS_VIEW_TRAVELLING_EASY 20
|
||||
#define STATS_VIEW_TRAVELLING_NORMAL 21
|
||||
#define STATS_VIEW_TRAVELLING_HARD 22
|
||||
#define STATS_VIEW_TRAVELLING_TOTAL 27
|
||||
|
||||
//
|
||||
// Stats view column ids
|
||||
//
|
||||
// These ids are used to read columns of stats views. They are specified in
|
||||
// the rgwColumnIds array of the XUSER_STATS_SPEC structure. Rank, rating
|
||||
// and gamertag are not retrieved as custom columns and so are not included
|
||||
// in the following definitions. They can be retrieved from each row's
|
||||
// header (e.g., pStatsResults->pViews[x].pRows[y].dwRank, etc.).
|
||||
//
|
||||
|
||||
// Column ids for KILLS_EASY
|
||||
|
||||
#define STATS_COLUMN_KILLS_EASY_LOCALE 9
|
||||
#define STATS_COLUMN_KILLS_EASY_ZOMBIES 1
|
||||
#define STATS_COLUMN_KILLS_EASY_SKELETONS 2
|
||||
#define STATS_COLUMN_KILLS_EASY_CREEPERS 3
|
||||
#define STATS_COLUMN_KILLS_EASY_SPIDERS 4
|
||||
#define STATS_COLUMN_KILLS_EASY_SPIDERJOCKEYS 5
|
||||
#define STATS_COLUMN_KILLS_EASY_ZOMBIEPIGMEN 6
|
||||
#define STATS_COLUMN_KILLS_EASY_SLIME 7
|
||||
|
||||
// Column ids for KILLS_NORMAL
|
||||
|
||||
#define STATS_COLUMN_KILLS_NORMAL_LOCALE 9
|
||||
#define STATS_COLUMN_KILLS_NORMAL_ZOMBIES 1
|
||||
#define STATS_COLUMN_KILLS_NORMAL_SKELETONS 2
|
||||
#define STATS_COLUMN_KILLS_NORMAL_CREEPERS 3
|
||||
#define STATS_COLUMN_KILLS_NORMAL_SPIDERS 4
|
||||
#define STATS_COLUMN_KILLS_NORMAL_SPIDERJOCKEYS 5
|
||||
#define STATS_COLUMN_KILLS_NORMAL_ZOMBIEPIGMEN 6
|
||||
#define STATS_COLUMN_KILLS_NORMAL_SLIME 7
|
||||
|
||||
// Column ids for KILLS_HARD
|
||||
|
||||
#define STATS_COLUMN_KILLS_HARD_LOCALE 9
|
||||
#define STATS_COLUMN_KILLS_HARD_ZOMBIES 1
|
||||
#define STATS_COLUMN_KILLS_HARD_SKELETONS 2
|
||||
#define STATS_COLUMN_KILLS_HARD_CREEPERS 3
|
||||
#define STATS_COLUMN_KILLS_HARD_SPIDERS 4
|
||||
#define STATS_COLUMN_KILLS_HARD_SPIDERJOCKEYS 5
|
||||
#define STATS_COLUMN_KILLS_HARD_ZOMBIEPIGMEN 6
|
||||
#define STATS_COLUMN_KILLS_HARD_SLIME 7
|
||||
|
||||
// Column ids for MINING_BLOCKS_PEACEFUL
|
||||
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_LOCALE 1
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_DIRT 2
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_STONE 3
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_SAND 4
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_COBBLESTONE 5
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_GRAVEL 6
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_CLAY 7
|
||||
#define STATS_COLUMN_MINING_BLOCKS_PEACEFUL_OBSIDIAN 8
|
||||
|
||||
// Column ids for MINING_BLOCKS_EASY
|
||||
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_LOCALE 1
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_DIRT 2
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_STONE 3
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_SAND 4
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_COBBLESTONE 5
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_GRAVEL 6
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_CLAY 7
|
||||
#define STATS_COLUMN_MINING_BLOCKS_EASY_OBSIDIAN 8
|
||||
|
||||
// Column ids for MINING_BLOCKS_NORMAL
|
||||
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_LOCALE 1
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_DIRT 2
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_STONE 3
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_SAND 4
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_COBBLESTONE 5
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_GRAVEL 6
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_CLAY 7
|
||||
#define STATS_COLUMN_MINING_BLOCKS_NORMAL_OBSIDIAN 8
|
||||
|
||||
// Column ids for MINING_BLOCKS_HARD
|
||||
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_LOCALE 1
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_DIRT 2
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_STONE 3
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_SAND 4
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_COBBLESTONE 5
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_GRAVEL 6
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_CLAY 7
|
||||
#define STATS_COLUMN_MINING_BLOCKS_HARD_OBSIDIAN 8
|
||||
|
||||
// Column ids for FARMING_PEACEFUL
|
||||
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_LOCALE 1
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_EGGS 2
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_WHEAT 3
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_MUSHROOMS 4
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_SUGARCANE 5
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_MILK 6
|
||||
#define STATS_COLUMN_FARMING_PEACEFUL_PUMPKINS 7
|
||||
|
||||
// Column ids for FARMING_EASY
|
||||
|
||||
#define STATS_COLUMN_FARMING_EASY_LOCALE 1
|
||||
#define STATS_COLUMN_FARMING_EASY_EGGS 2
|
||||
#define STATS_COLUMN_FARMING_EASY_WHEAT 3
|
||||
#define STATS_COLUMN_FARMING_EASY_MUSHROOMS 4
|
||||
#define STATS_COLUMN_FARMING_EASY_SUGARCANE 5
|
||||
#define STATS_COLUMN_FARMING_EASY_MILK 6
|
||||
#define STATS_COLUMN_FARMING_EASY_PUMPKINS 7
|
||||
|
||||
// Column ids for FARMING_NORMAL
|
||||
|
||||
#define STATS_COLUMN_FARMING_NORMAL_LOCALE 1
|
||||
#define STATS_COLUMN_FARMING_NORMAL_EGGS 2
|
||||
#define STATS_COLUMN_FARMING_NORMAL_WHEAT 3
|
||||
#define STATS_COLUMN_FARMING_NORMAL_MUSHROOMS 4
|
||||
#define STATS_COLUMN_FARMING_NORMAL_SUGARCANE 5
|
||||
#define STATS_COLUMN_FARMING_NORMAL_MILK 6
|
||||
#define STATS_COLUMN_FARMING_NORMAL_PUMPKINS 7
|
||||
|
||||
// Column ids for FARMING_HARD
|
||||
|
||||
#define STATS_COLUMN_FARMING_HARD_LOCALE 1
|
||||
#define STATS_COLUMN_FARMING_HARD_EGGS 2
|
||||
#define STATS_COLUMN_FARMING_HARD_WHEAT 3
|
||||
#define STATS_COLUMN_FARMING_HARD_MUSHROOMS 4
|
||||
#define STATS_COLUMN_FARMING_HARD_SUGARCANE 5
|
||||
#define STATS_COLUMN_FARMING_HARD_MILK 6
|
||||
#define STATS_COLUMN_FARMING_HARD_PUMPKINS 7
|
||||
|
||||
// Column ids for TRAVELLING_PEACEFUL
|
||||
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_LOCALE 1
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_WALKED 2
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_SWAM 3
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_FALLEN 4
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_CLIMBED 5
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_MINECART 6
|
||||
#define STATS_COLUMN_TRAVELLING_PEACEFUL_BOAT 7
|
||||
|
||||
// Column ids for TRAVELLING_EASY
|
||||
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_LOCALE 1
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_WALKED 2
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_SWAM 3
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_FALLEN 4
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_CLIMBED 5
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_MINECART 6
|
||||
#define STATS_COLUMN_TRAVELLING_EASY_BOAT 7
|
||||
|
||||
// Column ids for TRAVELLING_NORMAL
|
||||
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_LOCALE 1
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_WALKED 2
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_SWAM 3
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_FALLEN 4
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_CLIMBED 5
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_MINECART 6
|
||||
#define STATS_COLUMN_TRAVELLING_NORMAL_BOAT 7
|
||||
|
||||
// Column ids for TRAVELLING_HARD
|
||||
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_LOCALE 1
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_WALKED 2
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_SWAM 3
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_FALLEN 4
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_CLIMBED 5
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_MINECART 6
|
||||
#define STATS_COLUMN_TRAVELLING_HARD_BOAT 7
|
||||
|
||||
// Column ids for TRAVELLING_TOTAL
|
||||
|
||||
|
||||
//
|
||||
// Matchmaking queries
|
||||
//
|
||||
// These values are passed as the dwProcedureIndex parameter to
|
||||
// XSessionSearch to indicate which matchmaking query to run.
|
||||
//
|
||||
|
||||
#define SESSION_MATCH_QUERY_FRIENDS 0
|
||||
|
||||
//
|
||||
// Gamer pictures
|
||||
//
|
||||
// These ids are passed as the dwPictureId parameter to XUserAwardGamerTile.
|
||||
//
|
||||
|
||||
#define GAMER_PICTURE_GAMERPIC1 12
|
||||
#define GAMER_PICTURE_GAMERPIC2 13
|
||||
|
||||
//
|
||||
// Strings
|
||||
//
|
||||
// These ids are passed as the dwStringId parameter to XReadStringsFromSpaFile.
|
||||
//
|
||||
|
||||
#define SPASTRING_PRESENCE_IDLE_NAME 4
|
||||
#define SPASTRING_PRESENCE_MENUS_NAME 10
|
||||
#define SPASTRING_ACH_01_NAME 376
|
||||
#define SPASTRING_ACH_02_NAME 377
|
||||
#define SPASTRING_ACH_03_NAME 378
|
||||
#define SPASTRING_ACH_07_NAME 379
|
||||
#define SPASTRING_ACH_08_NAME 380
|
||||
#define SPASTRING_ACH_09_NAME 381
|
||||
#define SPASTRING_ACH_13_NAME 382
|
||||
#define SPASTRING_ACH_14_NAME 383
|
||||
#define SPASTRING_ACH_15_NAME 384
|
||||
#define SPASTRING_ACH_16_NAME 385
|
||||
#define SPASTRING_ACH_04_NAME 386
|
||||
#define SPASTRING_ACH_10_NAME 387
|
||||
#define SPASTRING_ACH_01_DESC 388
|
||||
#define SPASTRING_ACH_02_DESC 389
|
||||
#define SPASTRING_ACH_03_DESC 390
|
||||
#define SPASTRING_ACH_07_DESC 391
|
||||
#define SPASTRING_ACH_08_DESC 392
|
||||
#define SPASTRING_ACH_09_DESC 393
|
||||
#define SPASTRING_ACH_13_DESC 394
|
||||
#define SPASTRING_ACH_14_DESC 395
|
||||
#define SPASTRING_ACH_15_DESC 396
|
||||
#define SPASTRING_ACH_16_DESC 397
|
||||
#define SPASTRING_ACH_04_DESC 398
|
||||
#define SPASTRING_ACH_10_DESC 399
|
||||
#define SPASTRING_ACH_01_HOWTO 400
|
||||
#define SPASTRING_ACH_02_HOWTO 401
|
||||
#define SPASTRING_ACH_03_HOWTO 402
|
||||
#define SPASTRING_ACH_07_HOWTO 403
|
||||
#define SPASTRING_ACH_08_HOWTO 404
|
||||
#define SPASTRING_ACH_09_HOWTO 405
|
||||
#define SPASTRING_ACH_13_HOWTO 406
|
||||
#define SPASTRING_ACH_14_HOWTO 407
|
||||
#define SPASTRING_ACH_15_HOWTO 408
|
||||
#define SPASTRING_ACH_16_HOWTO 409
|
||||
#define SPASTRING_ACH_04_HOWTO 410
|
||||
#define SPASTRING_ACH_10_HOWTO 411
|
||||
#define SPASTRING_STR_GAMEMODE_SINGLEPLAYER 420
|
||||
#define SPASTRING_ACH_05_HOWTO 429
|
||||
#define SPASTRING_ACH_05_NAME 430
|
||||
#define SPASTRING_ACH_05_DESC 431
|
||||
#define SPASTRING_ACH_11_HOWTO 432
|
||||
#define SPASTRING_ACH_11_NAME 433
|
||||
#define SPASTRING_ACH_11_DESC 434
|
||||
#define SPASTRING_ACH_06_HOWTO 435
|
||||
#define SPASTRING_ACH_06_NAME 436
|
||||
#define SPASTRING_ACH_06_DESC 437
|
||||
#define SPASTRING_ACH_12_HOWTO 438
|
||||
#define SPASTRING_ACH_12_NAME 439
|
||||
#define SPASTRING_ACH_12_DESC 440
|
||||
#define SPASTRING_ACH_17_HOWTO 441
|
||||
#define SPASTRING_ACH_17_NAME 442
|
||||
#define SPASTRING_ACH_17_DESC 443
|
||||
#define SPASTRING_ACH_18_HOWTO 444
|
||||
#define SPASTRING_ACH_18_NAME 445
|
||||
#define SPASTRING_ACH_18_DESC 446
|
||||
#define SPASTRING_ACH_19_HOWTO 447
|
||||
#define SPASTRING_ACH_19_NAME 448
|
||||
#define SPASTRING_ACH_19_DESC 449
|
||||
#define SPASTRING_ACH_20_HOWTO 450
|
||||
#define SPASTRING_ACH_20_NAME 451
|
||||
#define SPASTRING_ACH_20_DESC 452
|
||||
#define SPASTRING_AV_PORKCHOP_TSHIRT_HOWTO 473
|
||||
#define SPASTRING_AV_PORKCHOP_TSHIRT_TITLE1 474
|
||||
#define SPASTRING_AV_PORKCHOP_TSHIRT_TITLE2 475
|
||||
#define SPASTRING_AV_PORKCHOP_TSHIRT_DESC 476
|
||||
#define SPASTRING_AV_WATCH_HOWTO 477
|
||||
#define SPASTRING_AV_WATCH_TITLE1 478
|
||||
#define SPASTRING_AV_WATCH_TITLE2 479
|
||||
#define SPASTRING_AV_WATCH_DESC 480
|
||||
#define SPASTRING_PRESENCE_MULTIPLAYER_NAME 490
|
||||
#define SPASTRING_CT_GAME_STATE_NAME 492
|
||||
#define SPASTRING_CV_GAME_STATE_BLANK_NAME 496
|
||||
#define SPASTRING_CV_GAME_STATE_RIDING_PIG_NAME 497
|
||||
#define SPASTRING_CV_GAME_STATE_RIDING_MINECART_NAME 498
|
||||
#define SPASTRING_CV_GAME_STATE_BOATING_NAME 499
|
||||
#define SPASTRING_CV_GAME_STATE_FISHING_NAME 500
|
||||
#define SPASTRING_CV_GAME_STATE_CRAFTING_NAME 501
|
||||
#define SPASTRING_CV_GAME_STATE_FORGING_NAME 502
|
||||
#define SPASTRING_CV_GAME_STATE_NETHER_NAME 503
|
||||
#define SPASTRING_CV_GAME_STATE_CD_NAME 504
|
||||
#define SPASTRING_CV_GAME_STATE_MAP_NAME 505
|
||||
#define SPASTRING_AV_CAP_HOWTO 506
|
||||
#define SPASTRING_AV_CAP_TITLE1 507
|
||||
#define SPASTRING_AV_CAP_TITLE2 508
|
||||
#define SPASTRING_AV_CAP_DESC 509
|
||||
#define SPASTRING_GM_MULTIPLAYER_NAME 517
|
||||
#define SPASTRING_PROPERTY_LOCALE_NAME 520
|
||||
#define SPASTRING_LB_KILLS_EASY_NAME 523
|
||||
#define SPASTRING_LB_KILLS_EASY_ZOMBIES_NAME 524
|
||||
#define SPASTRING_LB_KILLS_EASY_SKELETONS_NAME 525
|
||||
#define SPASTRING_LB_KILLS_EASY_CREEPERS_NAME 526
|
||||
#define SPASTRING_LB_KILLS_EASY_SPIDERS_NAME 527
|
||||
#define SPASTRING_LB_KILLS_EASY_SPIDERJOCKEYS_NAME 528
|
||||
#define SPASTRING_LB_KILLS_EASY_ZOMBIEPIGMEN_NAME 529
|
||||
#define SPASTRING_LB_KILLS_EASY_SLIME_NAME 530
|
||||
#define SPASTRING_LB_KILLS_EASY_RATING_NAME 531
|
||||
#define SPASTRING_PROPERTY_RATING_NAME 532
|
||||
#define SPASTRING_LB_KILLS_EASY_LOCALE_NAME 533
|
||||
#define SPASTRING_PROPERTY_KILLS_ZOMBIE_NAME 534
|
||||
#define SPASTRING_PROPERTY_KILLS_SKELETON_NAME 535
|
||||
#define SPASTRING_PROPERTY_KILLS_CREEPER_NAME 536
|
||||
#define SPASTRING_PROPERTY_KILLS_SPIDER_NAME 537
|
||||
#define SPASTRING_PROPERTY_KILLS_SPIDERJOCKEY_NAME 538
|
||||
#define SPASTRING_PROPERTY_KILLS_ZOMBIEPIGMAN_NAME 539
|
||||
#define SPASTRING_PROPERTY_KILLS_SLIME_NAME 540
|
||||
#define SPASTRING_PROPERTY_KILLS_GHAST_NAME 541
|
||||
#define SPASTRING_LB_KILLS_NORMAL_NAME 543
|
||||
#define SPASTRING_LB_KILLS_NORMAL_LOCALE_NAME 544
|
||||
#define SPASTRING_LB_KILLS_NORMAL_ZOMBIES_NAME 545
|
||||
#define SPASTRING_LB_KILLS_NORMAL_SKELETONS_NAME 546
|
||||
#define SPASTRING_LB_KILLS_NORMAL_CREEPERS_NAME 547
|
||||
#define SPASTRING_LB_KILLS_NORMAL_SPIDERS_NAME 548
|
||||
#define SPASTRING_LB_KILLS_NORMAL_SPIDERJOCKEYS_NAME 549
|
||||
#define SPASTRING_LB_KILLS_NORMAL_ZOMBIEPIGMEN_NAME 550
|
||||
#define SPASTRING_LB_KILLS_NORMAL_SLIME_NAME 551
|
||||
#define SPASTRING_LB_KILLS_NORMAL_RATING_NAME 552
|
||||
#define SPASTRING_LB_KILLS_HARD_NAME 554
|
||||
#define SPASTRING_LB_KILLS_HARD_LOCALE_NAME 555
|
||||
#define SPASTRING_LB_KILLS_HARD_ZOMBIES_NAME 556
|
||||
#define SPASTRING_LB_KILLS_HARD_SKELETONS_NAME 557
|
||||
#define SPASTRING_LB_KILLS_HARD_CREEPERS_NAME 558
|
||||
#define SPASTRING_LB_KILLS_HARD_SPIDERS_NAME 559
|
||||
#define SPASTRING_LB_KILLS_HARD_SPIDERJOCKEYS_NAME 560
|
||||
#define SPASTRING_LB_KILLS_HARD_ZOMBIEPIGMEN_NAME 561
|
||||
#define SPASTRING_LB_KILLS_HARD_SLIME_NAME 562
|
||||
#define SPASTRING_LB_KILLS_HARD_RATING_NAME 563
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_NAME 564
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_LOCALE_NAME 565
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_DIRT_NAME 566
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_STONE_NAME 567
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_SAND_NAME 568
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_COBBLESTONE_NAME 569
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_GRAVEL_NAME 570
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_CLAY_NAME 571
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_OBSIDIAN_NAME 572
|
||||
#define SPASTRING_LB_MINING_BLOCKS_PEACEFUL_RATING_NAME 573
|
||||
#define SPASTRING_PROPERTY_MINED_DIRT_NAME 574
|
||||
#define SPASTRING_PROPERTY_MINED_STONE_NAME 575
|
||||
#define SPASTRING_PROPERTY_MINED_SAND_NAME 576
|
||||
#define SPASTRING_PROPERTY_MINED_COBBLESTONE_NAME 577
|
||||
#define SPASTRING_PROPERTY_MINED_GRAVEL_NAME 578
|
||||
#define SPASTRING_PROPERTY_MINED_CLAY_NAME 579
|
||||
#define SPASTRING_PROPERTY_MINED_OBSIDIAN_NAME 580
|
||||
#define SPASTRING_PROPERTY_MINED_COAL_NAME 581
|
||||
#define SPASTRING_PROPERTY_MINED_IRON_NAME 582
|
||||
#define SPASTRING_PROPERTY_MINED_GOLD_NAME 583
|
||||
#define SPASTRING_PROPERTY_MINED_DIAMOND_NAME 584
|
||||
#define SPASTRING_PROPERTY_MINED_REDSTONE_NAME 585
|
||||
#define SPASTRING_PROPERTY_MINED_LAPISLAZULI_NAME 586
|
||||
#define SPASTRING_PROPERTY_MINED_NETHERRACK_NAME 587
|
||||
#define SPASTRING_PROPERTY_MINED_SOULSAND_NAME 588
|
||||
#define SPASTRING_PROPERTY_MINED_GLOWSTONE_NAME 589
|
||||
#define SPASTRING_PROPERTY_COLLECTED_EGG_NAME 590
|
||||
#define SPASTRING_PROPERTY_COLLECTED_WHEAT_NAME 591
|
||||
#define SPASTRING_PROPERTY_COLLECTED_MUSHROOM_NAME 592
|
||||
#define SPASTRING_PROPERTY_COLLECTED_SUGARCANE_NAME 593
|
||||
#define SPASTRING_PROPERTY_COLLECTED_MILK_NAME 594
|
||||
#define SPASTRING_PROPERTY_COLLECTED_PUMPKIN_NAME 595
|
||||
#define SPASTRING_PROPERTY_TRAVEL_WALK_NAME 596
|
||||
#define SPASTRING_PROPERTY_TRAVEL_SWIM_NAME 597
|
||||
#define SPASTRING_PROPERTY_TRAVEL_FALL_NAME 598
|
||||
#define SPASTRING_PROPERTY_TRAVEL_CLIMB_NAME 599
|
||||
#define SPASTRING_PROPERTY_TRAVEL_MINECART_NAME 600
|
||||
#define SPASTRING_PROPERTY_TRAVEL_BOAT_NAME 601
|
||||
#define SPASTRING_PROPERTY_PORTALS_CREATED_NAME 603
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_NAME 605
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_LOCALE_NAME 606
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_DIRT_NAME 607
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_STONE_NAME 608
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_SAND_NAME 609
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_COBBLESTONE_NAME 610
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_GRAVEL_NAME 611
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_CLAY_NAME 612
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_OBSIDIAN_NAME 613
|
||||
#define SPASTRING_LB_MINING_BLOCKS_EASY_RATING_NAME 614
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_NAME 616
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_LOCALE_NAME 617
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_DIRT_NAME 618
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_STONE_NAME 619
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_SAND_NAME 620
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_COBBLESTONE_NAME 621
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_GRAVEL_NAME 622
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_CLAY_NAME 623
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_OBSIDIAN_NAME 624
|
||||
#define SPASTRING_LB_MINING_BLOCKS_NORMAL_RATING_NAME 625
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_NAME 627
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_LOCALE_NAME 628
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_DIRT_NAME 629
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_STONE_NAME 630
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_SAND_NAME 631
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_COBBLESTONE_NAME 632
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_GRAVEL_NAME 633
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_CLAY_NAME 634
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_OBSIDIAN_NAME 635
|
||||
#define SPASTRING_LB_MINING_BLOCKS_HARD_RATING_NAME 636
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_NAME 676
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_LOCALE_NAME 677
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_EGGS_NAME 678
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_WHEAT_NAME 679
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_MUSHROOMS_NAME 680
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_SUGARCANE_NAME 681
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_MILK_NAME 682
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_PUMPKINS_NAME 683
|
||||
#define SPASTRING_LB_FARMING_PEACEFUL_RATING_NAME 684
|
||||
#define SPASTRING_LB_FARMING_EASY_NAME 686
|
||||
#define SPASTRING_LB_FARMING_EASY_LOCALE_NAME 687
|
||||
#define SPASTRING_LB_FARMING_EASY_EGGS_NAME 688
|
||||
#define SPASTRING_LB_FARMING_EASY_WHEAT_NAME 689
|
||||
#define SPASTRING_LB_FARMING_EASY_MUSHROOMS_NAME 690
|
||||
#define SPASTRING_LB_FARMING_EASY_SUGARCANE_NAME 691
|
||||
#define SPASTRING_LB_FARMING_EASY_MILK_NAME 692
|
||||
#define SPASTRING_LB_FARMING_EASY_PUMPKINS_NAME 693
|
||||
#define SPASTRING_LB_FARMING_EASY_RATING_NAME 694
|
||||
#define SPASTRING_LB_FARMING_NORMAL_NAME 696
|
||||
#define SPASTRING_LB_FARMING_NORMAL_LOCALE_NAME 697
|
||||
#define SPASTRING_LB_FARMING_NORMAL_EGGS_NAME 698
|
||||
#define SPASTRING_LB_FARMING_NORMAL_WHEAT_NAME 699
|
||||
#define SPASTRING_LB_FARMING_NORMAL_MUSHROOMS_NAME 700
|
||||
#define SPASTRING_LB_FARMING_NORMAL_SUGARCANE_NAME 701
|
||||
#define SPASTRING_LB_FARMING_NORMAL_MILK_NAME 702
|
||||
#define SPASTRING_LB_FARMING_NORMAL_PUMPKINS_NAME 703
|
||||
#define SPASTRING_LB_FARMING_NORMAL_RATING_NAME 704
|
||||
#define SPASTRING_LB_FARMING_HARD_NAME 706
|
||||
#define SPASTRING_LB_FARMING_HARD_LOCALE_NAME 707
|
||||
#define SPASTRING_LB_FARMING_HARD_EGGS_NAME 708
|
||||
#define SPASTRING_LB_FARMING_HARD_WHEAT_NAME 709
|
||||
#define SPASTRING_LB_FARMING_HARD_MUSHROOMS_NAME 710
|
||||
#define SPASTRING_LB_FARMING_HARD_SUGARCANE_NAME 711
|
||||
#define SPASTRING_LB_FARMING_HARD_MILK_NAME 712
|
||||
#define SPASTRING_LB_FARMING_HARD_PUMPKINS_NAME 713
|
||||
#define SPASTRING_LB_FARMING_HARD_RATING_NAME 714
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_NAME 715
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_LOCALE_NAME 716
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_WALKED_NAME 717
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_SWAM_NAME 718
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_FALLEN_NAME 719
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_CLIMBED_NAME 720
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_MINECART_NAME 721
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_BOAT_NAME 722
|
||||
#define SPASTRING_LB_TRAVELLING_PEACEFUL_RATING_NAME 724
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_NAME 726
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_LOCALE_NAME 727
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_WALKED_NAME 728
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_SWAM_NAME 729
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_FALLEN_NAME 730
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_CLIMBED_NAME 731
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_MINECART_NAME 732
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_BOAT_NAME 733
|
||||
#define SPASTRING_LB_TRAVELLING_EASY_RATING_NAME 735
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_NAME 737
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_LOCALE_NAME 738
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_WALKED_NAME 739
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_SWAM_NAME 740
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_FALLEN_NAME 741
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_CLIMBED_NAME 742
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_MINECART_NAME 743
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_BOAT_NAME 744
|
||||
#define SPASTRING_LB_TRAVELLING_NORMAL_RATING_NAME 746
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_NAME 748
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_LOCALE_NAME 749
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_WALKED_NAME 750
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_SWAM_NAME 751
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_FALLEN_NAME 752
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_CLIMBED_NAME 753
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_MINECART_NAME 754
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_BOAT_NAME 755
|
||||
#define SPASTRING_LB_TRAVELLING_HARD_RATING_NAME 757
|
||||
#define SPASTRING_LB_TRAVELLING_TOTAL_NAME 795
|
||||
#define SPASTRING_LB_TRAVELLING_TOTAL_RATING_NAME 796
|
||||
#define SPASTRING_LB_ARCADE_TRAVELLING_TOTAL_RATING_NAME 797
|
||||
#define SPASTRING_PROPERTY_COLLECTED_NETHERLAVA_NAME 799
|
||||
#define SPASTRING_PRESENCE_MULTIPLAYEROFFLINE_NAME 803
|
||||
#define SPASTRING_PRESENCE_MULTIPLAYER_1P_NAME 804
|
||||
#define SPASTRING_PRESENCE_MULTIPLAYER_1POFFLINE_NAME 805
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __MINECRAFT_SPA_H__
|
||||
|
||||
|
||||
BIN
Minecraft.Client/PSVita/GameConfig/Minecraft.trp
Normal file
BIN
Minecraft.Client/PSVita/GameConfig/Minecraft_signed.trp
Normal file
BIN
Minecraft.Client/PSVita/GameConfig/TROP000.PNG
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP001.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP002.PNG
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP003.PNG
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP004.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP005.PNG
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP006.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP007.PNG
Normal file
|
After Width: | Height: | Size: 993 B |
BIN
Minecraft.Client/PSVita/GameConfig/TROP008.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP009.PNG
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP010.PNG
Normal file
|
After Width: | Height: | Size: 1020 B |
BIN
Minecraft.Client/PSVita/GameConfig/TROP011.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP012.PNG
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP013.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP014.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP015.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP016.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP017.PNG
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP018.PNG
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP019.PNG
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP020.PNG
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP021.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP022.PNG
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP023.PNG
Normal file
|
After Width: | Height: | Size: 864 B |
BIN
Minecraft.Client/PSVita/GameConfig/TROP024.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP025.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP026.PNG
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP027.PNG
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP028.PNG
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP029.PNG
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP030.PNG
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP031.PNG
Normal file
|
After Width: | Height: | Size: 954 B |
BIN
Minecraft.Client/PSVita/GameConfig/TROP032.PNG
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP033.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP034.PNG
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP035.PNG
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP036.PNG
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP037.PNG
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP038.PNG
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP039.PNG
Normal file
|
After Width: | Height: | Size: 984 B |
BIN
Minecraft.Client/PSVita/GameConfig/TROP040.PNG
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP041.PNG
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP042.PNG
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP043.PNG
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP044.PNG
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP045.PNG
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP046.PNG
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP047.PNG
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP048.PNG
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP049.PNG
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Minecraft.Client/PSVita/GameConfig/TROP050.PNG
Normal file
|
After Width: | Height: | Size: 25 KiB |
69
Minecraft.Client/PSVita/GameConfig/rename.py
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
from os.path import isfile
|
||||
from shutil import move
|
||||
|
||||
trophynames = [
|
||||
"MCTrophy_All.png", # "All_Trophies.png", # Special for ps3/ps4
|
||||
"MCTrophy_00.png", # "TakingInventory_icon.png",
|
||||
"MCTrophy_01.png", # "GettingWood_icon.png",
|
||||
"MCTrophy_02.png", # "Benchmarking_icon.png",
|
||||
"MCTrophy_10.png", # "TimeToMine_icon.png",
|
||||
"MCTrophy_12.png", # "HotTopic_icon.png",
|
||||
"MCTrophy_14.png", # "AcquireHardware_icon.png",
|
||||
"MCTrophy_03.png", # "TimeToFarm_icon.png",
|
||||
"MCTrophy_04.png", # "BakeBread_icon.png",
|
||||
"MCTrophy_05.png", # "TheLie_icon.png",
|
||||
"MCTrophy_11.png", # "GettingAnUpgrade_icon.png",
|
||||
"MCTrophy_13.png", # "DeliciousFish_icon.png",
|
||||
"MCTrophy_15.png", # "OnARail_icon.png",
|
||||
"MCTrophy_06.png", # "TimeToStrike_icon.png",
|
||||
"MCTrophy_07.png", # "MonsterHunter_icon.png",
|
||||
"MCTrophy_08.png", # "CowTipper_icon.png",
|
||||
"MCTrophy_09.png", # "WhenPigsFly_icon.png",
|
||||
"MCTrophy_16.png", # "LeaderOfThePack_icon.png",
|
||||
"MCTrophy_17.png", # "MOARTools_icon.png",
|
||||
"MCTrophy_18.png", # "DispenseWithThis_icon.png",
|
||||
"MCTrophy_19.png", # "IntoTheNether_icon.png",
|
||||
"MCTrophy_20.png", # "SniperDuel_icon.png",
|
||||
"MCTrophy_21.png", # "Diamonds_icon.png",
|
||||
"MCTrophy_22.png", # "ReturnToSender_icon.png",
|
||||
"MCTrophy_23.png", # "IntoFire_icon.png",
|
||||
"MCTrophy_24.png", # "LocalBrewery_icon.png",
|
||||
"MCTrophy_25.png", # "TheEnd_icon.png",
|
||||
"MCTrophy_26.png", # "The_Other_End_icon.png",
|
||||
"MCTrophy_27.png", # "Enchanter_icon.png",
|
||||
"MCTrophy_28.png", # "Overkill_icon.png",
|
||||
"MCTrophy_29.png", # "Librarian_icon.png",
|
||||
"MCTrophy_30.png", # "AdventuringTime_icon.png",
|
||||
"MCTrophy_31.png", # "Repopulation_icon.png",
|
||||
"MCTrophy_32.png", # "DiamondsToYou_icon.png",
|
||||
"MCTrophy_33.png", # "PorkChop_icon.png",
|
||||
"MCTrophy_34.png", # "PassingTheTime_icon.png",
|
||||
"MCTrophy_35.png", # "Archer_icon.png",
|
||||
"MCTrophy_36.png", # "TheHaggler_icon.png",
|
||||
"MCTrophy_37.png", # "PotPlanter_icon.png",
|
||||
"MCTrophy_38.png", # "ItsASign_icon.png",
|
||||
"MCTrophy_39.png", # "IronBelly_icon.png",
|
||||
"MCTrophy_40.png", # "HaveAShearfulDay_icon.png",
|
||||
"MCTrophy_41.png", # "RainbowCollection_icon.png",
|
||||
"MCTrophy_42.png", # "StayinFrosty_icon.png",
|
||||
"MCTrophy_43.png", # "ChestfulOfCobblestone_icon.png",
|
||||
"MCTrophy_44.png", # "RenewableEnergy_icon.png",
|
||||
"MCTrophy_45.png", # "MusicToMyEars_icon.png",
|
||||
"MCTrophy_46.png", # "BodyGuard_icon.png",
|
||||
"MCTrophy_47.png", # "IronMan_icon.png",
|
||||
"MCTrophy_48.png", # "ZombieDoctor_icon.png",
|
||||
"MCTrophy_49.png", # "LionTamer_icon.png"
|
||||
]
|
||||
|
||||
def getTargetName(id):
|
||||
return 'TROP%03d.PNG' % id
|
||||
|
||||
if __name__=="__main__":
|
||||
for id, name in enumerate(trophynames):
|
||||
if isfile(name):
|
||||
print ("Found: " + name)
|
||||
move(name, getTargetName(id))
|
||||
else:
|
||||
print ("Can't find '"+name+"'")
|
||||
|
||||
2101
Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp
Normal file
264
Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.h
Normal file
@@ -0,0 +1,264 @@
|
||||
// gdraw_psp2.h - author: Fabian Giesen - copyright 2014 RAD Game Tools
|
||||
//
|
||||
// Interface for creating a PSP2 GDraw driver.
|
||||
|
||||
#include "gdraw.h"
|
||||
|
||||
#define IDOC
|
||||
//idoc(parent,GDraw_psp2)
|
||||
|
||||
// Size and alignment requirements of GDraw context memory.
|
||||
#define GDRAW_PSP2_CONTEXT_MEM_SIZE (16*1024)
|
||||
|
||||
// Alignment requirements for different resource types (in bytes)
|
||||
#define GDRAW_PSP2_TEXTURE_ALIGNMENT 16
|
||||
#define GDRAW_PSP2_VERTEXBUFFER_ALIGNMENT 16
|
||||
|
||||
typedef enum gdraw_psp2_resourcetype
|
||||
{
|
||||
GDRAW_PSP2_RESOURCE_texture,
|
||||
GDRAW_PSP2_RESOURCE_vertexbuffer,
|
||||
|
||||
GDRAW_PSP2_RESOURCE__count,
|
||||
} gdraw_psp2_resourcetype;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
U32 allocs_attempted; // number of allocations attempted from the staging buffer
|
||||
U32 allocs_succeeded; // number of allocations that succeeded
|
||||
U32 bytes_attempted; // number of bytes attempted to allocate
|
||||
U32 bytes_succeeded; // number of bytes successfully allocated
|
||||
U32 largest_bytes_attempted; // number of bytes in largest attempted alloc
|
||||
U32 largest_bytes_succeeded; // number of bytes in lagrest successful alloc
|
||||
} gdraw_psp2_dynamic_stats;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *start; // pointer to the start of the buffer
|
||||
U32 size_in_bytes; // size of the buffer in bytes
|
||||
U64 sync; // used internally by GDraw for synchronization.
|
||||
|
||||
gdraw_psp2_dynamic_stats stats; // stats on buffer usage - these are for your benefit!
|
||||
} gdraw_psp2_dynamic_buffer;
|
||||
|
||||
IDOC extern void gdraw_psp2_InitDynamicBuffer(gdraw_psp2_dynamic_buffer *buffer, void *ptr, U32 num_bytes);
|
||||
/* Initializes a GDraw dynamic buffer struct.
|
||||
|
||||
The "dynamic buffer" is where GDraw stores all transient data for a scene - dynamic
|
||||
vertex and index data, uniform buffers and the like. We wrap them in a struct
|
||||
so we can handle synchronization with the GPU.
|
||||
|
||||
"ptr" should point to non-cached, GPU-mapped readable memory. "num_bytes" is the size of
|
||||
the buffer in bytes. */
|
||||
|
||||
IDOC extern void gdraw_psp2_WaitForDynamicBufferIdle(gdraw_psp2_dynamic_buffer *buffer);
|
||||
/* Waits until a GDraw dynamic buffer is idle, i.e. not being used by the
|
||||
GPU anymore. You need to call this if you intend to free the allocated storage. */
|
||||
|
||||
IDOC extern int gdraw_psp2_SetResourceMemory(gdraw_psp2_resourcetype type, S32 num_handles, void *ptr, S32 num_bytes);
|
||||
/* Sets up the resource pools that GDraw uses for its video memory management.
|
||||
|
||||
It sets both the number of handles and the address and size of memory to use.
|
||||
GDraw keeps track of allocations in each pool, and will free old resources in
|
||||
a LRU manner to make space if one of the limits is about to be exceeded. It will
|
||||
also automatically defragment memory if necessary to fulfill an allocation
|
||||
request.
|
||||
|
||||
"ptr" points to the address of the resource pool. This memory needs to be
|
||||
mapped to the GPU and *writeable*. If it isn't, the GPU will crash during
|
||||
either this function or CreateContext!
|
||||
|
||||
Pass in NULL for "ptr" and zero "num_bytes" to free the memory allocated to
|
||||
a specific pool.
|
||||
|
||||
GDraw can run into cases where resource memory gets fragmented; we defragment
|
||||
automatically in that case. However, to make this work, GDraw on PSP2 needs
|
||||
resource pool memory equivalent to *twice* the largest working set in any
|
||||
scene. So for example, if you use 10MB worth of textures, GDraw needs at least
|
||||
a 20MB texture pool! On other platforms, we can avoid this extra cost by
|
||||
draining the GPU pipeline in the middle of a frame in certain rare cases, but
|
||||
doing so on PSP2 would mean not supporting deferred contexts.
|
||||
|
||||
You need to set up all of the resource pools before you can start rendering.
|
||||
If you modify this at runtime, you need to call IggyPlayerFlushAll on all
|
||||
active Iggys (if any) since this call invalidates all resource handles they
|
||||
currently hold.
|
||||
|
||||
Resource pool memory has certain alignment requirements - see the #defines
|
||||
above. If you pass in an unaligned pointer, GDraw will automatically clip off
|
||||
some bytes at the front to make the buffer aligned - in other words, you get
|
||||
somewhat less usable bytes, but it should work fine.
|
||||
|
||||
If any Iggy draw calls are in flight, this call will block waiting for
|
||||
those calls to finish (i.e. for the resource memory to become
|
||||
unused).
|
||||
*/
|
||||
|
||||
IDOC extern void gdraw_psp2_ResetAllResourceMemory();
|
||||
/* Frees all resource pools managed by GDraw.
|
||||
|
||||
Use this as a quick way of freeing (nearly) all memory allocated by GDraw
|
||||
without shutting it down completely. For example, you might want to use this
|
||||
to quickly flush all memory allocated by GDraw when transitioning between the
|
||||
main menu and the game proper. Like with SetResourceMemory, you need to call
|
||||
IggyPlayerFlushAll on all currently active Iggy players if you do this - although
|
||||
we recommend that you only use this function when there aren't any. */
|
||||
|
||||
IDOC extern GDrawFunctions * gdraw_psp2_CreateContext(SceGxmShaderPatcher *shader_patcher, void *context_mem, volatile U32 *notification, SceGxmOutputRegisterFormat reg_format);
|
||||
/* Creates a GDraw context for rendering using GXM. You need to pass in a pointer to
|
||||
the shader patcher to use, a pointer to "context memory" which holds a few persistent
|
||||
resources shared by all Iggys (it needs to hold GDRAW_PSP2_CONTEXT_MEM_SIZE bytes
|
||||
and must be mapped to be GPU readable), and a pointer to the notificaiton to use for
|
||||
GDraw sync.
|
||||
|
||||
"reg_format" specifies the output register format to specify when creating
|
||||
GDraw's fragment shaders. This should match your color surface. Typical choices
|
||||
are:
|
||||
- SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4 (32-bit output register size in color surface)
|
||||
- SCE_GXM_OUTPUT_REGISTER_FORMAT_HALF4 (64-bit output register size in color surface)
|
||||
|
||||
There can only be one GDraw context active at any one time. The shader_patcher must
|
||||
be valid for as long as a GDraw context is alive.
|
||||
|
||||
If initialization fails for some reason (the main reason would be an out of memory condition),
|
||||
NULL is returned. Otherwise, you can pass the return value to IggySetGDraw. */
|
||||
|
||||
IDOC extern void gdraw_psp2_DestroyContext(void);
|
||||
/* Destroys the current GDraw context, if any.
|
||||
|
||||
If any Iggy draw calls are in flight, this call will block waiting for
|
||||
those calls to finish (i.e. for the resource memory to become
|
||||
unused).
|
||||
*/
|
||||
|
||||
IDOC extern void gdraw_psp2_Begin(SceGxmContext *context, const SceGxmColorSurface *color, const SceGxmDepthStencilSurface *depth,
|
||||
gdraw_psp2_dynamic_buffer *dynamic_buffer);
|
||||
/* This sets the SceGxmContext that GDraw writes its commands to. It also specifies
|
||||
the dynamic buffer to use. Any GDraw / Iggy rendering calls outside a
|
||||
Begin / End bracket are an error and will be treated as such. The GXM context
|
||||
and dynamic buffer must be live during the entire Begin / End bracket.
|
||||
|
||||
NOTE: If you are passing in a deferred context, see important notes below!
|
||||
|
||||
GDraw uses the color and depth surfaces for parameter validation. Make sure to
|
||||
pass in the same values you passed in to sceGxmBeginScene. Also, inside a given
|
||||
scene, you may have only *one* $gdraw_psp2_Begin / $gdraw_psp2_End pair.
|
||||
|
||||
GDraw maintains a persistent resource cache shared across all Iggys. Because of this,
|
||||
it is *vital* that all command lists generated from GDraw be executed in the order
|
||||
they were generated, or the resource pools might get corrupted.
|
||||
|
||||
If the dynamic buffer is of insufficient size, GDraw will not be able to allocate dynamic
|
||||
vertex data or upload new texture/vertex buffer data during some frames, resulting in
|
||||
glitching! (When this happens, it will be reported as a warning, so make sure to install
|
||||
a warning callback).
|
||||
|
||||
You should use multiple dynamic buffers (at least double-buffer it); otherwise,
|
||||
GDraw needs to stall every frame to wait for the GPU to process the previous one.
|
||||
|
||||
GDraw starts no scenes of its own; you must call BeginScene before you issue
|
||||
gdraw_psp2_Begin.
|
||||
|
||||
If you are a using a deferred context:
|
||||
--------------------------------------
|
||||
|
||||
It's allowed to pass in a deferred context as "context". You may perform Iggy
|
||||
rendering on a separate thread. However, because there is only a single global
|
||||
resource pool that is modified directly by GDraw, rendering is *not* thread-safe;
|
||||
that is, you may do Iggy rendering on any thread, but only a single thread may
|
||||
be inside a GDraw Begin / End bracket at any given time.
|
||||
|
||||
Furthermore, if you use a deferred context, you must use (and execute!) the
|
||||
resulting command list and end the containing scene *before* you call
|
||||
$gdraw_psp2_Begin again. That is, usage must look like this:
|
||||
|
||||
Main thread: | Other thread:
|
||||
<other work> | gdraw_psp2_Begin(deferred_ctx, ...)
|
||||
| <render Iggys>
|
||||
| gdraw_psp2_End(deferred_ctx, ...)
|
||||
| ...
|
||||
| sceGxmEndCommandList(deferred_ctx, &cmd_list)
|
||||
|
|
||||
sceGxmBeginScene(...) | <other work>
|
||||
sceGxmExecuteCommandList(..., cmd_list) |
|
||||
sceGxmEndScene() |
|
||||
|
||||
The second thread may *not* start another $gdraw_psp2_Begin before the main thread
|
||||
calls sceGxmEndScene().
|
||||
|
||||
This is inconvenient, but unfortunately required by our resource management: every
|
||||
GDraw Begin / End Bracket may end up having to wait for the GPU to finish work done
|
||||
during a previous bracket, and this only works if the corresponding jobs have been
|
||||
submitted to the GPU by the point $gdraw_psp2_Begin is called!
|
||||
*/
|
||||
|
||||
IDOC extern SceGxmNotification gdraw_psp2_End();
|
||||
/* This marks the end of GDraw rendering for a frame. It also triggers end-of-frame processing,
|
||||
which is important for GDraw's internal resource management. GDraw will not touch the GXM context
|
||||
or staging buffer after this call, so you are free to append other rendering commands after
|
||||
this call returns.
|
||||
|
||||
This function will also update the "stats" field in the dynamic buffer you passed
|
||||
to "Begin".
|
||||
|
||||
You are *required* to pass the returned SceGxmNotification as your "fragment notification"
|
||||
when calling sceGxmEndScene. This is necessary to make GDraw's resource management work! */
|
||||
|
||||
IDOC extern void gdraw_psp2_SetTileOrigin(S32 x, S32 y);
|
||||
/* This sets the x/y position of the output location of the top-left pixel of the current
|
||||
tile. Iggy has support for manual splitting of rendering into multiple tiles; PSP2 is
|
||||
already a tiled renderer that handles all this in hardware, so in practice
|
||||
you will probably always pass (0,0) here.
|
||||
|
||||
You should call this inside a gdraw_psp2_Begin / gdraw_psp2_End bracket, before
|
||||
any Iggy / GDraw rendering takes place. */
|
||||
|
||||
IDOC extern void gdraw_psp2_ClearBeforeNextRender(const F32 clear_color_rgba[4]);
|
||||
/* You often want to clear the render target before you start Iggy rendering.
|
||||
|
||||
This is a convenience function, if you don't want to do the clear yourself.
|
||||
Iggy always clears the depth/stencil buffers when it starts rendering; if you
|
||||
call this function first, it will also clear the color surface to the
|
||||
specified color during that initial clear. If this function is not called
|
||||
before rendering, GDraw will leave the contents of the color surface alone.
|
||||
|
||||
This function does not do any rendering; it just sets some internal state
|
||||
that GDraw processes when it starts rendering. That state gets reset for every
|
||||
call to IggyPlayerDraw or IggyPlayerDrawTile. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_psp2_CalculateCustomDraw_4J(IggyCustomDrawCallbackRegion *region, float matrix[16]);
|
||||
IDOC extern void RADLINK gdraw_psp2_BeginCustomDraw(IggyCustomDrawCallbackRegion *region, float matrix[16]);
|
||||
/* Call at the beginning of Iggy custom draw callback to clear any odd render states GDraw has
|
||||
set, and to get the current 2D object-to-world transformation. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_psp2_EndCustomDraw(IggyCustomDrawCallbackRegion *region);
|
||||
/* Call at the end of Iggy custom draw callback so GDraw can restore its render states. */
|
||||
|
||||
IDOC extern GDrawTexture *gdraw_psp2_WrappedTextureCreate(SceGxmTexture *tex);
|
||||
/* Create a wrapped texture from a GXM texture.
|
||||
A wrapped texture can be used to let Iggy draw using the contents of a texture
|
||||
you create and manage on your own. For example, you might render to this texture,
|
||||
or stream video into it. Wrapped textures take up a handle. They will never be
|
||||
freed or otherwise modified by GDraw; nor will GDraw change any reference counts.
|
||||
All this is up to the application.
|
||||
GDraw makes a copy of the contents of the sceGxmTexture (the contents of the struct
|
||||
that is, not the data it points to). If you later modify the fields of "tex", you
|
||||
need to call $gdraw_psp2_WrappedTextureChange.
|
||||
*/
|
||||
|
||||
IDOC extern void gdraw_psp2_WrappedTextureChange(GDrawTexture *handle, SceGxmTexture *tex);
|
||||
/* Switch an existing GDrawTexture * that represents a wrapped texture to use
|
||||
a new underlying GXM texture. For example, you might internally double-buffer
|
||||
a dynamically updated texture. As above, GDraw will leave this texture alone
|
||||
and not touch any reference counts. */
|
||||
|
||||
IDOC extern void gdraw_psp2_WrappedTextureDestroy(GDrawTexture *handle);
|
||||
/* Destroys the GDraw wrapper for a wrapped texture object. This will free up
|
||||
a GDraw texture handle but not release the associated GXM texture; that is
|
||||
up to you. */
|
||||
|
||||
IDOC extern GDrawTexture * RADLINK gdraw_psp2_MakeTextureFromResource(U8 *file_in_memory, S32 length, IggyFileTexturePSP2 *tex);
|
||||
/* Sets up a texture loaded from a .psp2.iggytex file. */
|
||||
|
||||
extern void RADLINK gdraw_psp2_DestroyTextureFromResource(GDrawTexture *tex);
|
||||
|
||||
697
Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2_shaders.inl
Normal file
@@ -0,0 +1,697 @@
|
||||
// This file was automatically generated by shadergen. Do not edit by hand!
|
||||
|
||||
static unsigned char pshader_basic_0[340] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x51,0x01,0x00,0x00,0xb1,0xcf,0x41,0xdf,
|
||||
0x8a,0x6b,0xd3,0x79,0x05,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0xe4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x04,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xff,
|
||||
0xbc,0x0d,0xc0,0x40,0x02,0x80,0xb9,0xaf,0xbc,0x0d,0x80,0x40,0x7c,0x0f,0x04,0x00,
|
||||
0x86,0x47,0xa4,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x31,
|
||||
0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_1[356] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x61,0x01,0x00,0x00,0x49,0x0b,0xba,0x2a,
|
||||
0x3e,0xd8,0x8d,0x62,0x01,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x04,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x07,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xaf,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0xcf,0x84,0x4f,0xa4,0x08,0x02,0x01,0x4d,0xcf,
|
||||
0x80,0x8b,0xb1,0x18,0x7c,0x5f,0x04,0x0f,0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,
|
||||
0x7e,0x0d,0x81,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x31,
|
||||
0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_2[324] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x41,0x01,0x00,0x00,0x5c,0xcc,0x1b,0x49,
|
||||
0x32,0xab,0x31,0x63,0x05,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x04,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x06,0x00,0x00,0x00,
|
||||
0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x74,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x41,0x80,0x36,0x9f,0x88,0x1f,0x85,0x08,0x06,0x82,0xb9,0xff,
|
||||
0xbc,0x0d,0xc0,0x40,0x00,0x11,0x11,0xcf,0x80,0x87,0xb1,0x18,0x3c,0x8f,0x2d,0x00,
|
||||
0x86,0x47,0xc4,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x31,
|
||||
0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_3[384] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x7e,0x01,0x00,0x00,0xe7,0x9e,0xee,0x87,
|
||||
0xbb,0x31,0xff,0xe5,0x05,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x06,0x00,0x00,0x00,
|
||||
0xac,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x06,0x82,0x99,0xaf,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x8f,0x84,0x4f,0xa4,0x08,0x02,0x80,0xb9,0xff,
|
||||
0xbc,0x0d,0x80,0x40,0x3d,0x0f,0x04,0x00,0x86,0x47,0xa4,0x10,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_4[400] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x8e,0x01,0x00,0x00,0xbd,0xda,0xe1,0x5f,
|
||||
0x27,0xe6,0x61,0x9a,0x01,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0c,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x00,0x00,
|
||||
0xac,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x98,0x00,0x00,0x00,0xcc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x06,0x82,0x99,0xaf,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x8f,0x84,0x4f,0xa4,0x08,0x3c,0x00,0x04,0xcf,
|
||||
0x84,0x4f,0xa4,0x08,0x02,0x01,0x4d,0xcf,0x80,0x8b,0xb1,0x18,0x7c,0x5f,0x04,0x0f,
|
||||
0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,0x7e,0x0d,0x81,0x40,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_5[416] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x9e,0x01,0x00,0x00,0x6a,0xe8,0x8d,0x48,
|
||||
0xfa,0xd9,0xd7,0xda,0x07,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x1c,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x84,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x80,0x80,0x03,0x90,
|
||||
0x91,0xc2,0x09,0x48,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0xfd,0x81,0x00,0x40,0x80,
|
||||
0x0a,0x00,0x80,0x30,0x02,0x00,0x04,0xa0,0x86,0x01,0xa4,0x08,0x42,0x00,0x44,0xa0,
|
||||
0x8a,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xff,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x8f,0x84,0x4f,0xa4,0x08,0xc1,0x80,0x76,0x9f,
|
||||
0x88,0x1f,0x85,0x08,0x06,0x82,0xd9,0xff,0xbc,0x0d,0xc0,0x40,0x3c,0x21,0x11,0x1f,
|
||||
0x80,0x87,0xb1,0x18,0x3c,0x8f,0x2d,0x00,0x86,0x47,0xc4,0x10,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_6[376] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x76,0x01,0x00,0x00,0x48,0xfe,0x0b,0xe9,
|
||||
0x54,0x56,0xde,0x04,0x05,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x00,0x00,0x00,
|
||||
0xac,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf1,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0xf9,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x03,0x00,0x04,0xef,
|
||||
0x84,0x1f,0xa4,0x08,0x02,0x80,0xb9,0xaf,0xbc,0x0d,0x80,0x40,0x3d,0x0f,0x04,0x00,
|
||||
0x86,0x47,0xa4,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,
|
||||
0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_7[392] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x86,0x01,0x00,0x00,0x1f,0x4a,0xd5,0xc9,
|
||||
0x08,0xc3,0x7b,0x19,0x01,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x07,0x00,0x00,0x00,
|
||||
0xac,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbc,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf1,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0xf9,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x03,0x00,0x04,0xef,
|
||||
0x84,0x1f,0xa4,0x08,0x3c,0x00,0x04,0x8f,0x84,0x4f,0xa4,0x08,0x02,0x01,0x4d,0xcf,
|
||||
0x80,0x8b,0xb1,0x18,0x7c,0x5f,0x04,0x0f,0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,
|
||||
0x7e,0x0d,0x81,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,
|
||||
0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_8[368] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x6e,0x01,0x00,0x00,0x15,0x2c,0xa8,0x0d,
|
||||
0xfc,0x95,0x7c,0xda,0x05,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xec,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x07,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x84,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0xac,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xff,0xbc,0x0d,0xc0,0x40,0x43,0x80,0x4d,0x8f,
|
||||
0x80,0x88,0xe1,0x18,0x41,0x0f,0x00,0x2f,0x00,0x1c,0x80,0x08,0xbc,0x10,0x04,0xcf,
|
||||
0x84,0x47,0xa4,0x08,0x3c,0x8f,0x2d,0x00,0x86,0x47,0xc4,0x10,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_9[440] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xb6,0x01,0x00,0x00,0xb2,0x8c,0x0d,0xc0,
|
||||
0x79,0x78,0x36,0xe0,0x05,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x34,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x00,0x00,0xf0,0x83,
|
||||
0x20,0x0d,0x00,0x38,0x3c,0x42,0x3e,0x0f,0x80,0x88,0x01,0x18,0x01,0x3e,0x80,0x0f,
|
||||
0x00,0x02,0x00,0x30,0x03,0x3e,0x00,0x00,0x02,0x00,0x00,0x30,0x00,0x03,0x00,0xe0,
|
||||
0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x08,0x20,0xf9,0x04,0x81,0x99,0xaf,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,0x84,0x4f,0xa4,0x08,0x02,0x80,0xb9,0xff,
|
||||
0xbc,0x0d,0x80,0x40,0x3d,0x0f,0x04,0x00,0x86,0x47,0xa4,0x10,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,
|
||||
0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_10[456] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xc6,0x01,0x00,0x00,0x88,0xc8,0xca,0xdb,
|
||||
0xe6,0x2c,0x49,0x11,0x01,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x44,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0e,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe4,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x00,0x00,0xf0,0x83,
|
||||
0x20,0x0d,0x00,0x38,0x3c,0x42,0x3e,0x0f,0x80,0x88,0x01,0x18,0x01,0x3e,0x80,0x0f,
|
||||
0x00,0x02,0x00,0x30,0x03,0x3e,0x00,0x00,0x02,0x00,0x00,0x30,0x00,0x03,0x00,0xe0,
|
||||
0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x08,0x20,0xf9,0x04,0x81,0x99,0xaf,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,0x84,0x4f,0xa4,0x08,0x3c,0x00,0x04,0xcf,
|
||||
0x84,0x4f,0xa4,0x08,0x02,0x01,0x4d,0xcf,0x80,0x8b,0xb1,0x18,0x7c,0x5f,0x04,0x0f,
|
||||
0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,0x7e,0x0d,0x81,0x40,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,
|
||||
0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_11[480] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xde,0x01,0x00,0x00,0x47,0xd0,0x44,0x86,
|
||||
0xb9,0x20,0xfa,0x25,0x07,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x5c,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x00,0x00,0x00,
|
||||
0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x74,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x1c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x00,0x00,0xf0,0x83,0x20,0x0d,0x00,0x38,0x3c,0x42,0x3e,0x0f,
|
||||
0x80,0x88,0x01,0x18,0x01,0x3e,0x80,0x0f,0x00,0x02,0x00,0x30,0x03,0x3e,0x00,0x00,
|
||||
0x02,0x00,0x10,0x30,0x00,0x03,0x00,0xe0,0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x20,0xf9,0x80,0x80,0x03,0x10,0x91,0xc2,0x09,0x48,0x04,0x00,0x00,0x00,
|
||||
0x40,0x00,0x00,0xfd,0x81,0x00,0x00,0x00,0x0a,0x00,0x80,0x30,0x00,0x00,0x04,0x20,
|
||||
0x84,0x01,0xa4,0x08,0x40,0x00,0x44,0x20,0x88,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xff,0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,
|
||||
0x84,0x4f,0xa4,0x08,0x81,0x80,0x76,0x9f,0x88,0x1f,0x85,0x08,0x06,0x82,0xd9,0xff,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x21,0x11,0x1f,0x80,0x87,0xb1,0x18,0x3c,0x8f,0x2d,0x00,
|
||||
0x86,0x47,0xc4,0x10,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,
|
||||
0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_12[464] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xce,0x01,0x00,0x00,0x5e,0x9f,0x65,0x75,
|
||||
0x57,0x52,0xaa,0xe4,0x05,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x4c,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0f,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xec,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x0c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x04,0x10,0x00,0xb0,0x82,0x08,0x00,0x08,0x00,0x00,0x00,0xaf,
|
||||
0x80,0x00,0x00,0x08,0x3c,0x00,0x14,0x80,0x06,0x01,0x00,0x00,0x00,0x81,0x28,0xe0,
|
||||
0x84,0x49,0x24,0x08,0x00,0x00,0x00,0x0f,0x80,0x28,0x00,0x00,0x01,0x3e,0x80,0x0f,
|
||||
0x00,0x0a,0x00,0x30,0x01,0x3e,0x80,0x0f,0x00,0x00,0x00,0x30,0x3c,0x01,0x10,0xc0,
|
||||
0xa6,0x01,0x00,0x00,0x00,0x03,0x00,0xe0,0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x08,0x20,0xf9,0x04,0x81,0x99,0xaf,0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,
|
||||
0x84,0x4f,0xa4,0x08,0x02,0x80,0xb9,0xff,0xbc,0x0d,0x80,0x40,0x3d,0x0f,0x04,0x00,
|
||||
0x86,0x47,0xa4,0x10,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,
|
||||
0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_13[480] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xde,0x01,0x00,0x00,0x34,0xdb,0x2b,0x2d,
|
||||
0x0b,0xbf,0x65,0xd1,0x01,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x5c,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x11,0x00,0x00,0x00,
|
||||
0x9c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x1c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x07,0x44,0xfa,0x04,0x10,0x00,0xb0,0x82,0x08,0x00,0x08,0x00,0x00,0x00,0xaf,
|
||||
0x80,0x00,0x00,0x08,0x3c,0x00,0x14,0x80,0x06,0x01,0x00,0x00,0x00,0x81,0x28,0xe0,
|
||||
0x84,0x49,0x24,0x08,0x00,0x00,0x00,0x0f,0x80,0x28,0x00,0x00,0x01,0x3e,0x80,0x0f,
|
||||
0x00,0x0a,0x00,0x30,0x01,0x3e,0x80,0x0f,0x00,0x00,0x00,0x30,0x3c,0x01,0x10,0xc0,
|
||||
0xa6,0x01,0x00,0x00,0x00,0x03,0x00,0xe0,0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x08,0x20,0xf9,0x04,0x81,0x99,0xaf,0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,
|
||||
0x84,0x4f,0xa4,0x08,0x3c,0x00,0x04,0xcf,0x84,0x4f,0xa4,0x08,0x02,0x01,0x4d,0xcf,
|
||||
0x80,0x8b,0xb1,0x18,0x7c,0x5f,0x04,0x0f,0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,
|
||||
0x7e,0x0d,0x81,0x40,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,
|
||||
0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_14[504] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xf6,0x01,0x00,0x00,0x7b,0x93,0xc6,0xae,
|
||||
0xff,0x91,0x70,0x86,0x07,0x18,0x18,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x74,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x06,0x00,0x10,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x17,0x00,0x00,0x00,
|
||||
0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x74,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x34,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0x09,0x40,0x0e,0x01,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x04,0x10,0x00,0xb0,
|
||||
0x82,0x08,0x00,0x08,0x00,0x00,0x00,0xaf,0x80,0x00,0x00,0x08,0x3c,0x00,0x14,0x80,
|
||||
0x06,0x01,0x00,0x00,0x00,0x81,0x68,0xe0,0x86,0x49,0x24,0x08,0x41,0x10,0x00,0xaf,
|
||||
0x84,0x28,0x00,0x00,0x01,0x3e,0x80,0x0f,0x00,0x0a,0x00,0x30,0x01,0x3e,0x80,0x0f,
|
||||
0x00,0x00,0x00,0x30,0x3c,0x01,0x10,0xc0,0xa6,0x01,0x10,0x00,0x00,0x03,0x00,0xe0,
|
||||
0x04,0xc4,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xf9,0x80,0x80,0x03,0x10,
|
||||
0x91,0xc2,0x09,0x48,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0xfd,0x81,0x00,0x00,0x00,
|
||||
0x0a,0x00,0x80,0x30,0x00,0x00,0x04,0x20,0x84,0x01,0xa4,0x08,0x40,0x00,0x44,0x20,
|
||||
0x88,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xff,
|
||||
0xbc,0x0d,0xc0,0x40,0x3c,0x00,0x04,0x0f,0x84,0x4f,0xa4,0x08,0x81,0x80,0x76,0x9f,
|
||||
0x88,0x1f,0x85,0x08,0x06,0x82,0xd9,0xff,0xbc,0x0d,0xc0,0x40,0x3c,0x21,0x11,0x1f,
|
||||
0x80,0x87,0xb1,0x18,0x3c,0x8f,0x2d,0x00,0x86,0x47,0xc4,0x10,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0c,0x00,0x13,0x00,0x00,0x00,0x0c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,
|
||||
0x00,0x74,0x65,0x78,0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_15[436] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xb2,0x01,0x00,0x00,0xa4,0x49,0x85,0x88,
|
||||
0x51,0xb7,0x36,0xb2,0x09,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x30,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0a,0x00,0x00,0x00,
|
||||
0xb0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x01,0x00,0x00,0x00,0xcc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbc,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf1,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0xf9,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x01,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,
|
||||
0x03,0x00,0x04,0xef,0x84,0x1f,0xa4,0x08,0x00,0x81,0x11,0x80,0x82,0x81,0xe1,0x18,
|
||||
0x7c,0x00,0x44,0x80,0x8a,0xb1,0xc0,0x08,0x8c,0x80,0x03,0x90,0x15,0xc9,0x89,0x48,
|
||||
0x0c,0x06,0x00,0xf0,0x06,0x04,0x30,0xf9,0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x02,0x80,0x19,0xa0,0x7e,0x0d,0x80,0x40,
|
||||
0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,
|
||||
0x13,0x00,0x00,0x00,0x0c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,
|
||||
0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,
|
||||
0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_16[468] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xd2,0x01,0x00,0x00,0x4a,0xa5,0x50,0x5f,
|
||||
0x06,0x24,0xb9,0x90,0x09,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0e,0x00,0x00,0x00,
|
||||
0xb0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x01,0x00,0x00,0x00,0xec,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xe4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x01,0xf1,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0xf9,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x40,0x80,0x24,0xa0,0x82,0x41,0x84,0x08,0x41,0x80,0x54,0xa0,0x8a,0x41,0xc0,0x08,
|
||||
0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x01,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,
|
||||
0x03,0x00,0x04,0xef,0x84,0x1f,0xa4,0x08,0x00,0x81,0x11,0x80,0x82,0x81,0xe1,0x18,
|
||||
0x7c,0x00,0x44,0x80,0x8a,0xb1,0xc0,0x08,0x8c,0x80,0x03,0x90,0x15,0xc9,0x89,0x48,
|
||||
0x0c,0x06,0x00,0xf0,0x06,0x04,0x30,0xf9,0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,0x40,0x09,0x00,0xf8,
|
||||
0x02,0x80,0x99,0xaf,0xbc,0x0d,0xc0,0x40,0x02,0x01,0x4d,0xcf,0x80,0x8b,0xb1,0x18,
|
||||
0x7c,0x5f,0x04,0x0f,0x84,0x33,0xa4,0x08,0x00,0xbc,0x19,0x20,0x7e,0x0d,0x81,0x40,
|
||||
0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,
|
||||
0x13,0x00,0x00,0x00,0x0c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,
|
||||
0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,
|
||||
0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char pshader_basic_17[436] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xb2,0x01,0x00,0x00,0xcc,0xea,0x40,0x96,
|
||||
0xf9,0xf6,0xb3,0x74,0x09,0x08,0x18,0x00,0x01,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x30,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,0x84,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x01,0x00,0x00,0x00,0xcc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbc,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xf1,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x01,0xf9,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x44,0xfa,
|
||||
0x43,0x80,0x24,0xe0,0x82,0x10,0x84,0x08,0x00,0x01,0x40,0xe0,0x0a,0x00,0x81,0x50,
|
||||
0x01,0x00,0x41,0xa0,0x02,0x11,0x80,0x08,0x80,0x10,0x04,0xf0,0x86,0x41,0xa4,0x08,
|
||||
0xc1,0x10,0x64,0xe0,0x82,0x41,0x84,0x08,0x8c,0x80,0x03,0x90,0x15,0xc9,0x89,0x48,
|
||||
0x0c,0x06,0x00,0xf0,0x06,0x04,0x30,0xf9,0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x01,0x00,0x04,0xa0,0x86,0x11,0xa4,0x08,
|
||||
0x41,0x00,0x44,0xa0,0x8a,0x10,0xc0,0x08,0x02,0x80,0x19,0xa0,0x7e,0x0d,0x80,0x40,
|
||||
0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,
|
||||
0x13,0x00,0x00,0x00,0x0c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,
|
||||
0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x02,0x04,0x01,0x00,
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x03,0x01,0x03,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x30,0x00,0x74,0x65,0x78,
|
||||
0x31,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static ShaderCode pshader_basic_arr[18] = {
|
||||
{ pshader_basic_0, { NULL } },
|
||||
{ pshader_basic_1, { NULL } },
|
||||
{ pshader_basic_2, { NULL } },
|
||||
{ pshader_basic_3, { NULL } },
|
||||
{ pshader_basic_4, { NULL } },
|
||||
{ pshader_basic_5, { NULL } },
|
||||
{ pshader_basic_6, { NULL } },
|
||||
{ pshader_basic_7, { NULL } },
|
||||
{ pshader_basic_8, { NULL } },
|
||||
{ pshader_basic_9, { NULL } },
|
||||
{ pshader_basic_10, { NULL } },
|
||||
{ pshader_basic_11, { NULL } },
|
||||
{ pshader_basic_12, { NULL } },
|
||||
{ pshader_basic_13, { NULL } },
|
||||
{ pshader_basic_14, { NULL } },
|
||||
{ pshader_basic_15, { NULL } },
|
||||
{ pshader_basic_16, { NULL } },
|
||||
{ pshader_basic_17, { NULL } },
|
||||
};
|
||||
|
||||
static unsigned char pshader_manual_clear_0[220] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0xdc,0x00,0x00,0x00,0xe1,0x66,0xdd,0xe7,
|
||||
0x28,0x0f,0xc4,0xfd,0x01,0x00,0x18,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x02,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,
|
||||
0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x64,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x02,0x80,0x19,0xf0,
|
||||
0x7e,0x0d,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,
|
||||
0x94,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static ShaderCode pshader_manual_clear_arr[1] = {
|
||||
{ pshader_manual_clear_0, { NULL } },
|
||||
};
|
||||
|
||||
static unsigned char vshader_vspsp2_0[360] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x66,0x01,0x00,0x00,0x7a,0x09,0xc6,0xf5,
|
||||
0xbc,0x09,0x6e,0xf4,0x00,0x00,0x19,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x02,0x00,0x18,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x90,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,
|
||||
0x09,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x14,0x91,
|
||||
0x8a,0x11,0xc1,0x08,0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x01,0x04,0xc3,0x21,0x0d,0x80,0x38,
|
||||
0x02,0x80,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x12,0x80,0x80,0x88,0x91,0x18,
|
||||
0x06,0x82,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x12,0x80,0x00,0x81,0x91,0x18,
|
||||
0x8b,0x02,0x00,0xf0,0x81,0x99,0xa0,0x00,0x0e,0x86,0x99,0xff,0xbc,0x0d,0x80,0x40,
|
||||
0x00,0xc2,0x92,0x80,0x81,0x88,0x91,0x18,0x12,0x88,0x99,0xff,0xbc,0x0d,0x80,0x40,
|
||||
0x00,0xc2,0x92,0x80,0x01,0x81,0x91,0x18,0x80,0x00,0x0c,0x43,0x21,0x05,0x82,0x38,
|
||||
0x00,0x00,0x20,0xa0,0x00,0x50,0x27,0xfb,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
|
||||
0x20,0x00,0x00,0x00,0x30,0x01,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x76,0x64,0x61,0x74,0x61,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char vshader_vspsp2_1[584] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x46,0x02,0x00,0x00,0x4e,0x78,0x52,0xa2,
|
||||
0xf0,0x4e,0xd4,0x64,0x04,0x00,0x19,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0xf8,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x04,0x00,0x1e,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x1f,0x00,0x00,0x00,
|
||||
0xc8,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x01,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x02,0x00,0x00,0x00,0x8c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xa4,0x01,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x8c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x01,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x7c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,
|
||||
0x09,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x02,0x80,0x81,0xaf,0x9c,0x0d,0xc0,0x40,0x44,0x46,0xbe,0x83,
|
||||
0x82,0x88,0x81,0x18,0x80,0x00,0xf4,0x83,0x20,0x0d,0x80,0x38,0x44,0x46,0xbe,0x93,
|
||||
0x02,0x89,0x81,0x18,0x04,0x44,0x7e,0x83,0x82,0x90,0x80,0x18,0x01,0x0f,0x55,0x11,
|
||||
0x82,0x11,0x81,0x08,0x01,0x03,0x14,0x91,0x82,0x11,0x81,0x08,0x00,0x00,0x00,0x00,
|
||||
0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,
|
||||
0x00,0x01,0xc0,0xa0,0x85,0x09,0x81,0x40,0x01,0x01,0x40,0xa0,0x86,0x09,0x81,0x40,
|
||||
0x80,0x01,0x60,0xa0,0x86,0x09,0xc1,0x40,0x4c,0x00,0x44,0xbf,0x84,0x19,0xa4,0x08,
|
||||
0x3d,0x42,0x3e,0x1f,0x80,0x88,0x81,0x18,0x40,0x0f,0x00,0x03,0x20,0x0d,0x80,0x38,
|
||||
0x00,0x0f,0xf8,0x0f,0x00,0x0d,0x80,0x38,0x02,0x80,0x99,0xff,0xbc,0x0d,0xc0,0x40,
|
||||
0x00,0xc2,0x12,0x8f,0x80,0x88,0x91,0x18,0x06,0x82,0xb9,0xff,0xbc,0x0d,0xc0,0x40,
|
||||
0x00,0xc2,0x12,0x9f,0x00,0x89,0x91,0x18,0x40,0x01,0xf0,0xcc,0x40,0x0d,0x80,0x38,
|
||||
0x00,0xbf,0x03,0x10,0x81,0x82,0xc9,0x48,0x40,0x03,0x44,0xc0,0x86,0x09,0xa4,0x08,
|
||||
0x81,0x03,0x44,0xef,0x80,0x99,0x80,0x00,0x3d,0x42,0x7e,0x10,0x82,0x88,0x81,0x18,
|
||||
0xfd,0x08,0x1c,0x10,0x01,0x54,0x84,0x20,0x81,0x13,0x34,0x90,0x02,0x35,0xc0,0x28,
|
||||
0x81,0x00,0x20,0x80,0x02,0x0a,0x80,0x30,0x3c,0x10,0x40,0x4f,0x84,0x99,0x80,0x01,
|
||||
0x7c,0xef,0xf3,0x0f,0xa0,0x4d,0x80,0x38,0x8b,0xc2,0x03,0xff,0x80,0x99,0xa0,0x00,
|
||||
0x00,0x0f,0x00,0x03,0x21,0x05,0x80,0x38,0x00,0x0f,0x04,0x03,0x59,0x0d,0x80,0x38,
|
||||
0x0e,0x86,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x92,0x80,0x81,0x88,0x91,0x18,
|
||||
0x12,0x88,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x92,0x80,0x01,0x81,0x91,0x18,
|
||||
0xc4,0x00,0xd0,0x70,0x85,0x41,0xa4,0x08,0x00,0x00,0x20,0xa0,0x00,0x50,0x27,0xfb,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x3c,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x13,0x00,0x00,0x00,0x18,0x00,0x02,0x00,
|
||||
0x20,0x00,0x00,0x00,0x30,0x01,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x76,0x64,0x61,0x74,0x61,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static unsigned char vshader_vspsp2_2[336] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x4e,0x01,0x00,0x00,0xa9,0x68,0x75,0x9f,
|
||||
0xa5,0xeb,0x06,0xda,0x00,0x00,0x19,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x04,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0a,0x00,0x00,0x00,
|
||||
0x90,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xac,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x08,
|
||||
0x09,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x14,0x91,
|
||||
0x8a,0x11,0xc1,0x08,0x00,0x00,0x00,0x00,0x40,0x01,0x04,0xf8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x40,0x00,0x08,0x83,0x21,0x0d,0x80,0x38,
|
||||
0x02,0x80,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x52,0x80,0x82,0x88,0x91,0x18,
|
||||
0x06,0x82,0x99,0xff,0xbc,0x0d,0x80,0x40,0x00,0xc2,0x52,0x80,0x02,0x81,0x91,0x18,
|
||||
0x00,0x01,0x04,0xc3,0x21,0x05,0x80,0x38,0x8b,0x12,0x00,0xf0,0x85,0x91,0xa0,0x00,
|
||||
0x80,0x00,0x0c,0x43,0x21,0x05,0x82,0x38,0x00,0x00,0x20,0xa0,0x00,0x50,0x27,0xfb,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x20,0x00,0x00,0x00,0x30,0x01,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,
|
||||
0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x64,0x61,0x74,0x61,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static ShaderCode vshader_vspsp2_arr[3] = {
|
||||
{ vshader_vspsp2_0, { NULL } },
|
||||
{ vshader_vspsp2_1, { NULL } },
|
||||
{ vshader_vspsp2_2, { NULL } },
|
||||
};
|
||||
|
||||
static unsigned char vshader_vspsp2_mask_0[304] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x30,0x01,0x00,0x00,0x5d,0x89,0x60,0xf7,
|
||||
0x7b,0x8f,0xec,0x47,0x04,0x00,0x1b,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x01,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x00,0x00,0x00,0x00,0x3d,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x04,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x02,0x00,0x00,0xa0,0x05,0x00,0x81,0x68,
|
||||
0x80,0x01,0x20,0x90,0x02,0x00,0xca,0x50,0x80,0x01,0x80,0xaf,0x00,0x00,0xc2,0x50,
|
||||
0x00,0x32,0xa0,0x2f,0x08,0x00,0xc3,0x50,0x00,0x3e,0x20,0x20,0x0a,0x00,0xc9,0x50,
|
||||
0x00,0x30,0x00,0x20,0x09,0x00,0x83,0x50,0x80,0x3e,0x20,0x20,0x09,0x00,0x81,0x50,
|
||||
0x40,0x80,0x24,0x50,0x81,0x41,0x86,0x08,0x01,0x80,0x56,0x90,0x81,0x11,0x83,0x08,
|
||||
0x00,0x00,0x20,0xa0,0x00,0x50,0x27,0xfb,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,
|
||||
0x00,0x00,0x00,0x00,0x94,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
static ShaderCode vshader_vspsp2_mask_arr[1] = {
|
||||
{ vshader_vspsp2_mask_0, { NULL } },
|
||||
};
|
||||
|
||||
2599
Minecraft.Client/PSVita/Iggy/gdraw/gdraw_shared.inl
Normal file
726
Minecraft.Client/PSVita/Iggy/include/gdraw.h
Normal file
@@ -0,0 +1,726 @@
|
||||
// gdraw.h - author: Sean Barrett - copyright 2009 RAD Game Tools
|
||||
//
|
||||
// This is the graphics rendering abstraction that Iggy is implemented
|
||||
// on top of.
|
||||
|
||||
#ifndef __RAD_INCLUDE_GDRAW_H__
|
||||
#define __RAD_INCLUDE_GDRAW_H__
|
||||
|
||||
#include "rrcore.h"
|
||||
|
||||
#define IDOC
|
||||
|
||||
RADDEFSTART
|
||||
|
||||
//idoc(parent,GDrawAPI_Buffers)
|
||||
|
||||
#ifndef IGGY_GDRAW_SHARED_TYPEDEF
|
||||
|
||||
#define IGGY_GDRAW_SHARED_TYPEDEF
|
||||
typedef struct GDrawFunctions GDrawFunctions;
|
||||
|
||||
typedef struct GDrawTexture GDrawTexture;
|
||||
|
||||
#endif//IGGY_GDRAW_SHARED_TYPEDEF
|
||||
|
||||
|
||||
|
||||
IDOC typedef struct GDrawVertexBuffer GDrawVertexBuffer;
|
||||
/* An opaque handle to an internal GDraw vertex buffer. */
|
||||
|
||||
//idoc(parent,GDrawAPI_Base)
|
||||
|
||||
IDOC typedef struct gswf_recti
|
||||
{
|
||||
S32 x0,y0; // Minimum corner of the rectangle
|
||||
S32 x1,y1; // Maximum corner of the rectangle
|
||||
} gswf_recti;
|
||||
/* A 2D rectangle with integer coordinates specifying its minimum and maximum corners. */
|
||||
|
||||
IDOC typedef struct gswf_rectf
|
||||
{
|
||||
F32 x0,y0; // Minimum corner of the rectangle
|
||||
F32 x1,y1; // Maximum corner of the rectangle
|
||||
} gswf_rectf;
|
||||
/* A 2D rectangle with floating-point coordinates specifying its minimum and maximum corners. */
|
||||
|
||||
IDOC typedef struct gswf_matrix
|
||||
{
|
||||
union {
|
||||
F32 m[2][2]; // 2x2 transform matrix
|
||||
struct {
|
||||
F32 m00; // Alternate name for m[0][0], for coding convenience
|
||||
F32 m01; // Alternate name for m[0][1], for coding convenience
|
||||
F32 m10; // Alternate name for m[1][0], for coding convenience
|
||||
F32 m11; // Alternate name for m[1][1], for coding convenience
|
||||
};
|
||||
};
|
||||
F32 trans[2]; // 2D translation vector (the affine component of the matrix)
|
||||
} gswf_matrix;
|
||||
/* A 2D transform matrix plus a translation offset. */
|
||||
|
||||
#define GDRAW_STATS_batches 1
|
||||
#define GDRAW_STATS_blits 2
|
||||
#define GDRAW_STATS_alloc_tex 4
|
||||
#define GDRAW_STATS_frees 8
|
||||
#define GDRAW_STATS_defrag 16
|
||||
#define GDRAW_STATS_rendtarg 32
|
||||
#define GDRAW_STATS_clears 64
|
||||
IDOC typedef struct GDrawStats
|
||||
{
|
||||
S16 nonzero_flags; // which of the fields below are non-zero
|
||||
|
||||
U16 num_batches; // number of batches, e.g. DrawPrim, DrawPrimUP
|
||||
U16 num_blits; // number of blit operations (resolve, msaa resolve, blend readback)
|
||||
U16 freed_objects; // number of cached objects freed
|
||||
U16 defrag_objects; // number of cached objects defragmented
|
||||
U16 alloc_tex; // number of textures/buffers allocated
|
||||
U16 rendertarget_changes; // number of rendertarget changes
|
||||
U16 num_clears;
|
||||
//0 mod 8
|
||||
|
||||
U32 drawn_indices; // number of indices drawn (3 times number of triangles)
|
||||
U32 drawn_vertices; // number of unique vertices referenced
|
||||
U32 num_blit_pixels;// number of pixels in blit operations
|
||||
U32 alloc_tex_bytes;// number of bytes in textures/buffers allocated
|
||||
U32 freed_bytes; // number of bytes in freed cached objects
|
||||
U32 defrag_bytes; // number of bytes in defragmented cached objects
|
||||
U32 cleared_pixels; // number of pixels cleared by clear operation
|
||||
U32 reserved;
|
||||
//0 mod 8
|
||||
} GDrawStats;
|
||||
/* A structure with statistics information to show in resource browser/Telemetry */
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Queries
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Queries)
|
||||
|
||||
IDOC typedef enum gdraw_bformat
|
||||
{
|
||||
GDRAW_BFORMAT_vbib, // Platform uses vertex and index buffers
|
||||
GDRAW_BFORMAT_wii_dlist, // Platform uses Wii-style display lists
|
||||
GDRAW_BFORMAT_vbib_single_format, // Platform uses vertex and index buffers, but doesn't support multiple vertex formats in a single VB
|
||||
|
||||
GDRAW_BFORMAT__count,
|
||||
} gdraw_bformat;
|
||||
/* Specifies what data format GDraw expects in MakeVertexBuffer_* and DrawIndexedTriangles.
|
||||
|
||||
Most supported platforms prefer Vertex and Index buffers so that's what we use,
|
||||
but this format turns out to be somewhat awkward for Wii, so we use the native
|
||||
graphics processor display list format on that platform. */
|
||||
|
||||
IDOC typedef struct GDrawInfo
|
||||
{
|
||||
S32 num_stencil_bits; // number of (possibly emulated) stencil buffer bits
|
||||
U32 max_id; // number of unique values that can be easily encoded in zbuffer
|
||||
U32 max_texture_size; // edge length of largest square texture supported by hardware
|
||||
U32 buffer_format; // one of $gdraw_bformat
|
||||
rrbool shared_depth_stencil; // does 0'th framebuffer share depth & stencil with others? (on GL it can't?)
|
||||
rrbool always_mipmap; // if GDraw can generate mipmaps nearly for free, then set this flag
|
||||
rrbool conditional_nonpow2; // non-pow2 textures supported, but only using clamp and without mipmaps
|
||||
rrbool has_rendertargets; // if true, then there is no rendertarget stack support
|
||||
rrbool no_nonpow2; // non-pow2 textures aren't supported at all
|
||||
} GDrawInfo; // must be a multiple of 8
|
||||
/* $GDrawInfo contains the information that Iggy needs to know about
|
||||
what a GDraw implementation supports and what limits it places on
|
||||
certain important values. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_get_info(GDrawInfo *d);
|
||||
/* Iggy queries this at the beginning of rendering to get information
|
||||
about the viewport and the device capabilities. */
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Drawing State
|
||||
//
|
||||
//idoc(parent,GDrawAPI_DrawingState)
|
||||
|
||||
IDOC typedef enum gdraw_blend
|
||||
{
|
||||
GDRAW_BLEND_none, // Directly copy
|
||||
GDRAW_BLEND_alpha, // Use the source alpha channel to modulate its contribution
|
||||
GDRAW_BLEND_multiply, // Multiply colors componentwise
|
||||
GDRAW_BLEND_add, // Add the source and destination together
|
||||
|
||||
GDRAW_BLEND_filter, // Uses a secondary $gdraw_filter specification to determine how to blend
|
||||
GDRAW_BLEND_special, // Uses a secondary $gdraw_blendspecial specification to determine how to blend
|
||||
|
||||
GDRAW_BLEND__count,
|
||||
} gdraw_blend;
|
||||
/* Identifier indicating the type of blending operation to use when rendering.*/
|
||||
|
||||
IDOC typedef enum gdraw_blendspecial
|
||||
{
|
||||
GDRAW_BLENDSPECIAL_layer, // s
|
||||
GDRAW_BLENDSPECIAL_multiply, // s*d
|
||||
GDRAW_BLENDSPECIAL_screen, // sa*da - (da-d)*(sa-s)
|
||||
GDRAW_BLENDSPECIAL_lighten, // max(sa*d,s*da)
|
||||
GDRAW_BLENDSPECIAL_darken, // min(sa*d,s*da)
|
||||
GDRAW_BLENDSPECIAL_add, // min(d+s,1.0)
|
||||
GDRAW_BLENDSPECIAL_subtract, // max(d-s,0.0)
|
||||
GDRAW_BLENDSPECIAL_difference, // abs(sa*d-s*da)
|
||||
GDRAW_BLENDSPECIAL_invert, // sa*(da-d)
|
||||
GDRAW_BLENDSPECIAL_overlay, // d < da/2.0 ? (2.0*s*d) : (sa*da - 2.0*(da-d)*(sa-s))
|
||||
GDRAW_BLENDSPECIAL_hardlight, // s < sa/2.0 ? (2.0*s*d) : (sa*da - 2.0*(da-d)*(sa-s))
|
||||
|
||||
// these do extra-special math on the output alpha
|
||||
GDRAW_BLENDSPECIAL_erase, // d*(1.0-sa)
|
||||
GDRAW_BLENDSPECIAL_alpha_special, // d*sa
|
||||
|
||||
GDRAW_BLENDSPECIAL__count,
|
||||
} gdraw_blendspecial;
|
||||
/* Specifies a type of "special" blend mode, which is defined as one
|
||||
that has to read from the framebuffer to compute its effect.
|
||||
|
||||
These modes are only used with a 1-to-1 textured quad containing
|
||||
the exact output data in premultiplied alpha. They all need to
|
||||
read from the framebuffer to compute their effect, so a GDraw
|
||||
implementation will usually need a custom path to handle that.
|
||||
Users will not warn in advance whether you're going to need this
|
||||
operation, so implementations either need to always render to a
|
||||
texture in case it happens, or copy the framebuffer to a texture
|
||||
when it does.
|
||||
|
||||
Note that $(gdraw_blendspecial::GDRAW_BLENDSPECIAL_erase) and
|
||||
$(gdraw_blendspecial::GDRAW_BLENDSPECIAL_alpha_special) are unique
|
||||
among $gdraw_blendspecial modes in that they may not actually need
|
||||
to be implemented with the destination input as a texture if
|
||||
the destination buffer doesn't have an alpha channel. */
|
||||
|
||||
// (@OPTIMIZE: the last filter in each chain could be combined with
|
||||
// the final blend, although only worth doing if the final blend is
|
||||
// ALPHA/ADD/MULTIPLY--it's usually ALPHA though so worth doing!)
|
||||
IDOC typedef enum gdraw_filter
|
||||
{
|
||||
GDRAW_FILTER_blur, // Blurs the source image
|
||||
GDRAW_FILTER_colormatrix, // Transform RGB pixel values by a matrix
|
||||
GDRAW_FILTER_bevel, // Bevels the source image
|
||||
GDRAW_FILTER_dropshadow, // Adds a dropshadow underneath the source image
|
||||
|
||||
GDRAW_FILTER__count,
|
||||
} gdraw_filter;
|
||||
/* Specifies a type of post-processing graphics filter.
|
||||
|
||||
These modes are only used to implement filter effects, and will
|
||||
always be blending from a temporary buffer to another temporary
|
||||
buffer with no blending, so in general they should not require
|
||||
any additional input.
|
||||
*/
|
||||
|
||||
IDOC typedef enum gdraw_texture
|
||||
{
|
||||
GDRAW_TEXTURE_none, // No texture applied
|
||||
GDRAW_TEXTURE_normal, // Texture is bitmap or linear gradient
|
||||
GDRAW_TEXTURE_alpha, // Texture is an alpha-only font bitmap
|
||||
GDRAW_TEXTURE_radial, // Texture is a radial gradient
|
||||
GDRAW_TEXTURE_focal_gradient, // Texture is a "focal" radial gradient
|
||||
GDRAW_TEXTURE_alpha_test, // Texture is an alpha-only font bitmap, alpha test for alpha >= 0.5
|
||||
|
||||
GDRAW_TEXTURE__count,
|
||||
} gdraw_texture;
|
||||
/* Specifies how to apply a texture while rendering. */
|
||||
|
||||
IDOC typedef enum gdraw_wrap
|
||||
{
|
||||
GDRAW_WRAP_clamp, // Texture coordinates clamped to edges
|
||||
GDRAW_WRAP_repeat, // Texture repeats periodically
|
||||
GDRAW_WRAP_mirror, // Repeat periodically, mirror on odd repetititions
|
||||
GDRAW_WRAP_clamp_to_border, // only used internally by some GDraws
|
||||
|
||||
GDRAW_WRAP__count,
|
||||
} gdraw_wrap;
|
||||
/* Specifies what to do with texture coordinates outside [0,1]. */
|
||||
|
||||
typedef struct GDrawRenderState
|
||||
{
|
||||
S32 id; // Object "identifier" used for high-quality AA mode
|
||||
U32 test_id:1; // Whether to test zbuffer == id
|
||||
U32 set_id:1; // Whether to set zbuffer == id
|
||||
U32 use_world_space:1; // Whether primitive is defined in object space or world space
|
||||
U32 scissor:1; // Whether rendering will be clipped to $(GDrawRenderState::scissor_rect)
|
||||
U32 identical_state:1; // Whether state is identical to the one used for the previous draw call
|
||||
U32 unused:27;
|
||||
//aligned 0 mod 8
|
||||
|
||||
U8 texgen0_enabled; // Whether to use texgen for tex0
|
||||
U8 tex0_mode; // One of $gdraw_texture
|
||||
U8 wrap0; // One of $gdraw_wrap
|
||||
U8 nearest0; // Whether to sample texture 0 nearest neighbor
|
||||
|
||||
U8 blend_mode; // One of $gdraw_blend
|
||||
U8 special_blend; // One of $gdraw_blendspecial (used only if $(GDrawRenderState::blend_mode) == $(gdraw_blend::GDRAW_BLEND_special)
|
||||
U8 filter; // One of $gdraw_filter (used only if $(GDrawRenderState::blend_mode) == $(gdraw_blend::GDRAW_BLEND_filter)
|
||||
U8 filter_mode; // Used to select the right compositing operation for the $(gdraw_filter::GDRAW_FILTER_bevel) and $(gdraw_filter::GDRAW_FILTER_dropshadow) modes
|
||||
//aligned 0 mod 8
|
||||
U8 stencil_test; // Only draw if these stencil bits are "set"
|
||||
U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0)
|
||||
|
||||
U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit)
|
||||
S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run
|
||||
//align 0 mod 8
|
||||
|
||||
S16 *cxf_add; // Color transform addition (discourage additive alpha!)
|
||||
|
||||
GDrawTexture *tex[3]; // One or more textures to apply -- need 3 for gradient dropshadow.
|
||||
//0 mod 8
|
||||
F32 *edge_matrix; // Screen to object space matrix (for edge antialiasing)
|
||||
gswf_matrix *o2w; // Object-to-world matrix
|
||||
|
||||
// --- Everything below this point must be manually initialized
|
||||
|
||||
//0 mod 8
|
||||
F32 color[4]; // Color of the object
|
||||
|
||||
//0 mod 8
|
||||
gswf_recti scissor_rect; // The rectangle to which rendering will be clipped if $(GDrawRenderState::scissor) is set
|
||||
//0 mod 8
|
||||
// --- Everything below this point might be uninitialized if it's not used for this particular render state
|
||||
|
||||
F32 s0_texgen[4]; // "s" (x) row of texgen matrix
|
||||
F32 t0_texgen[4]; // "t" (y) row of texgen matrix
|
||||
//0 mod 8
|
||||
F32 focal_point[4]; // Data used for $(gdraw_texgen_mode::GDRAW_TEXTURE_focal_gradient)
|
||||
//0 mod 8
|
||||
F32 blur_x,blur_y; // The size of the box filter, where '1' is the identity and 2 adds half a pixel on each side
|
||||
//0 mod 8
|
||||
F32 shader_data[20]; // Various data that depends on filter (e.g. drop shadow direction, color)
|
||||
} GDrawRenderState;
|
||||
/* Encapsulation of the entire drawing state that affects a rendering command. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_set_view_size_and_world_scale(S32 w, S32 h, F32 x_world_to_pixel, F32 y_world_to_pixel);
|
||||
/* Sets the size of the rendering viewport and the world to pixel scaling.
|
||||
|
||||
Iggy calls this function with the full size that the viewport would
|
||||
be if it were rendered untiled, even if it will eventually be
|
||||
rendered as a collection of smaller tiles.
|
||||
|
||||
The world scale is used to compensate non-square pixel aspect ratios
|
||||
when rendering wide lines. Both scale factors are 1 unless Iggy is
|
||||
running on a display with non-square pixels. */
|
||||
|
||||
typedef void RADLINK gdraw_set_3d_transform(F32 *mat); /* mat[3][4] */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_render_tile_begin(S32 tx0, S32 ty0, S32 tx1, S32 ty1, S32 pad, GDrawStats *stats);
|
||||
/* Begins rendering of a sub-region of the rendered image. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_render_tile_end(GDrawStats *stats);
|
||||
/* Ends rendering of a sub-region of the rendered image. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_rendering_begin(void);
|
||||
/* Begins rendering; takes control of the graphics API. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_rendering_end(void);
|
||||
/* Ends rendering; gives up control of the graphics API. */
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Drawing
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Drawing)
|
||||
|
||||
IDOC typedef void RADLINK gdraw_clear_stencil_bits(U32 bits);
|
||||
/* Clears the 'bits' parts of the stencil value in the entire framebuffer to the default value. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_clear_id(void);
|
||||
/* Clears the 'id' buffer, which is typically the z-buffer but can also be the stencil buffer. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_filter_quad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1, S32 y1, GDrawStats *stats);
|
||||
/* Draws a special quad in viewport-relative pixel space.
|
||||
|
||||
May be normal, may be displaced by filters, etc. and require multiple passes,
|
||||
may apply special blending (and require extra resolves/rendertargets)
|
||||
for filter/blend.,
|
||||
|
||||
The x0,y0,x1,y1 always describes the "input" box. */
|
||||
|
||||
IDOC typedef struct GDrawPrimitive
|
||||
{
|
||||
F32 *vertices; // Pointer to an array of $gswf_vertex_xy, $gswf_vertex_xyst, or $gswf_vertex_xyoffs
|
||||
U16 *indices; // Pointer to an array of 16-bit indices into $(GDrawPrimitive::vertices)
|
||||
|
||||
S32 num_vertices; // Count of elements in $(GDrawPrimitive::vertices)
|
||||
S32 num_indices; // Count of elements in $(GDrawPrimitive::indices)
|
||||
|
||||
S32 vertex_format; // One of $gdraw_vformat, specifying the type of element in $(GDrawPrimitive::vertices)
|
||||
|
||||
U32 uniform_count;
|
||||
F32 *uniforms;
|
||||
|
||||
U8 drawprim_mode;
|
||||
} GDrawPrimitive;
|
||||
/* Specifies the vertex and index data necessary to draw a batch of graphics primitives. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDrawPrimitive *prim, GDrawVertexBuffer *buf, GDrawStats *stats);
|
||||
/* Draws a collection of indexed triangles, ignoring special filters or blend modes.
|
||||
|
||||
If buf is NULL, then the pointers in 'prim' are machine pointers, and
|
||||
you need to make a copy of the data (note currently all triangles
|
||||
implementing strokes (wide lines) go this path).
|
||||
|
||||
If buf is non-NULL, then use the appropriate vertex buffer, and the
|
||||
pointers in prim are actually offsets from the beginning of the
|
||||
vertex buffer -- i.e. offset = (char*) prim->whatever - (char*) NULL;
|
||||
(note there are separate spaces for vertices and indices; e.g. the
|
||||
first mesh in a given vertex buffer will normally have a 0 offset
|
||||
for the vertices and a 0 offset for the indices)
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba);
|
||||
/* Specifies the 1D texture data to be used for the antialiasing gradients.
|
||||
|
||||
'rgba' specifies the pixel values in rgba byte order. This will only be called
|
||||
once during initialization. */
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Texture and Vertex Buffers
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Buffers)
|
||||
|
||||
IDOC typedef enum gdraw_texture_format
|
||||
{
|
||||
// Platform-independent formats
|
||||
GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type)
|
||||
GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw.
|
||||
|
||||
// First platform-specific format index (for reference)
|
||||
GDRAW_TEXTURE_FORMAT__platform = 16,
|
||||
|
||||
// In the future, we will support platform-specific formats and add them to this list.
|
||||
} gdraw_texture_format;
|
||||
/* Describes the format of a texture submitted to GDraw. */
|
||||
|
||||
IDOC typedef enum gdraw_texture_type
|
||||
{
|
||||
GDRAW_TEXTURE_TYPE_rgba, // Raw 4-channel packed texels, in OpenGL-standard order
|
||||
GDRAW_TEXTURE_TYPE_bgra, // Raw 4-channel packed texels, in Direct3D-standard order
|
||||
GDRAW_TEXTURE_TYPE_argb, // Raw 4-channel packed texels, in Flash native order
|
||||
|
||||
GDRAW_TEXTURE_TYPE__count,
|
||||
} gdraw_texture_type;
|
||||
/* Describes the channel layout of a RGBA texture submitted to GDraw. */
|
||||
|
||||
IDOC typedef struct GDraw_MakeTexture_ProcessingInfo
|
||||
{
|
||||
U8 *texture_data; // Pointer to the texture image bits
|
||||
S32 num_rows; // Number of rows to upload in the current chunk
|
||||
S32 stride_in_bytes; // Distance between a given pixel and the first pixel in the next row
|
||||
S32 texture_type; // One of $gdraw_texture_type
|
||||
|
||||
U32 temp_buffer_bytes; // Size of temp buffer in bytes
|
||||
U8 *temp_buffer; // Temp buffer for GDraw to work in (used during mipmap creation)
|
||||
|
||||
void *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7; // Pointers for GDraw to store data across "passes" (never touched by Iggy)
|
||||
U32 i0, i1, i2, i3, i4, i5, i6, i7; // Integers for GDraw to store data across "passes" (never touched by Iggy)
|
||||
} GDraw_MakeTexture_ProcessingInfo;
|
||||
/* $GDraw_MakeTexture_ProcessingInfo is used when building a texture. */
|
||||
|
||||
IDOC typedef struct GDraw_Texture_Description {
|
||||
S32 width; // Width of the texture in pixels
|
||||
S32 height; // Height of the texture in pixels
|
||||
U32 size_in_bytes; // Size of the texture in bytes
|
||||
} GDraw_Texture_Description;
|
||||
/* $GDraw_Texture_Description contains information about a texture. */
|
||||
|
||||
IDOC typedef U32 gdraw_maketexture_flags;
|
||||
#define GDRAW_MAKETEXTURE_FLAGS_mipmap 1 IDOC // Generates mip-maps for the texture
|
||||
#define GDRAW_MAKETEXTURE_FLAGS_updatable 2 IDOC // Set if the texture might be updated subsequent to its initial submission
|
||||
#define GDRAW_MAKETEXTURE_FLAGS_never_flush 4 IDOC // Set to request that the texture never be flushed from the GDraw cache
|
||||
|
||||
/* Flags that control the submission and management of GDraw textures. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_set_texture_unique_id(GDrawTexture *tex, void *old_unique_id, void *new_unique_id);
|
||||
/* Changes unique id of a texture, only used for TextureSubstitution */
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_make_texture_begin(void *unique_id,
|
||||
S32 width, S32 height, gdraw_texture_format format, gdraw_maketexture_flags flags,
|
||||
GDraw_MakeTexture_ProcessingInfo *output_info, GDrawStats *stats);
|
||||
/* Begins specifying a new texture.
|
||||
|
||||
$:unique_id Unique value specified by Iggy that you can use to identify a reference to the same texture even if its handle has been discarded
|
||||
$:return Error code if there was a problem, IGGY_RESULT_OK otherwise
|
||||
*/
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_make_texture_more(GDraw_MakeTexture_ProcessingInfo *info);
|
||||
/* Continues specifying a new texture.
|
||||
|
||||
$:info The same handle initially passed to $gdraw_make_texture_begin
|
||||
$:return True if specification can continue, false if specification must be aborted
|
||||
*/
|
||||
|
||||
IDOC typedef GDrawTexture * RADLINK gdraw_make_texture_end(GDraw_MakeTexture_ProcessingInfo *info, GDrawStats *stats);
|
||||
/* Ends specification of a new texture.
|
||||
|
||||
$:info The same handle initially passed to $gdraw_make_texture_begin
|
||||
$:return Handle for the newly created texture, or NULL if an error occured
|
||||
*/
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_update_texture_begin(GDrawTexture *tex, void *unique_id, GDrawStats *stats);
|
||||
/* Begins updating a previously submitted texture.
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_texture_begin
|
||||
$:return True on success, false otherwise and the texture must be recreated
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_update_texture_rect(GDrawTexture *tex, void *unique_id, S32 x, S32 y, S32 stride, S32 w, S32 h, U8 *data, gdraw_texture_format format);
|
||||
/* Updates a rectangle in a previously submitted texture.
|
||||
|
||||
$:format Must be the $gdraw_texture_format that was originally passed to $gdraw_make_texture_begin for this texture.
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_update_texture_end(GDrawTexture *tex, void *unique_id, GDrawStats *stats);
|
||||
/* Ends an update to a previously submitted texture.
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_texture_begin (and hence $gdraw_update_texture_begin)
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_describe_texture(GDrawTexture *tex, GDraw_Texture_Description *desc);
|
||||
/* Returns a texture description for a given GDraw texture. */
|
||||
|
||||
IDOC typedef GDrawTexture * RADLINK gdraw_make_texture_from_resource(U8 *resource_file, S32 file_len, void *texture);
|
||||
/* Loads a texture from a resource file and returns a wrapped pointer. */
|
||||
|
||||
IDOC typedef void RADLINK gdraw_free_texture_from_resource(GDrawTexture *tex);
|
||||
/* Frees a texture created with gdraw_make_texture_from_resource. */
|
||||
|
||||
|
||||
IDOC typedef struct gswf_vertex_xy
|
||||
{
|
||||
F32 x,y; // Position of the vertex
|
||||
} gswf_vertex_xy;
|
||||
/* A 2D point with floating-point position. */
|
||||
|
||||
IDOC typedef struct gswf_vertex_xyoffs
|
||||
{
|
||||
F32 x,y; // Position of the vertex
|
||||
|
||||
S16 aa; // Stroke/aa texcoord
|
||||
S16 dx, dy; // Vector offset from the position, used for anti-aliasing (signed 11.5 fixed point)
|
||||
S16 unused;
|
||||
} gswf_vertex_xyoffs;
|
||||
/* A 2D point with floating-point position, additional integer parameter, and integer anti-aliasing offset vector. */
|
||||
|
||||
IDOC typedef struct gswf_vertex_xyst
|
||||
{
|
||||
F32 x,y; // Position of the vertex
|
||||
F32 s,t; // Explicit texture coordinates for rectangles
|
||||
} gswf_vertex_xyst;
|
||||
/* A 2D point with floating-point position and texture coordinates. */
|
||||
|
||||
typedef int gdraw_verify_size_xy [sizeof(gswf_vertex_xy ) == 8 ? 1 : -1];
|
||||
typedef int gdraw_verify_size_xyoffs[sizeof(gswf_vertex_xyoffs) == 16 ? 1 : -1];
|
||||
typedef int gdraw_verify_size_xyst [sizeof(gswf_vertex_xyst ) == 16 ? 1 : -1];
|
||||
|
||||
IDOC typedef enum gdraw_vformat
|
||||
{
|
||||
GDRAW_vformat_v2, // Indicates vertices of type $gswf_vertex_xy (8 bytes per vertex)
|
||||
GDRAW_vformat_v2aa, // Indicates vertices of type $gswf_vertex_xyoffs (16 bytes per vertex)
|
||||
GDRAW_vformat_v2tc2, // Indicates vertices of type $gswf_vertex_xyst (16 bytes per vertex)
|
||||
|
||||
GDRAW_vformat__basic_count,
|
||||
GDRAW_vformat_ihud1 = GDRAW_vformat__basic_count, // primary format for ihud, currently v2tc2mat4 (20 bytes per vertex)
|
||||
|
||||
GDRAW_vformat__count,
|
||||
GDRAW_vformat_mixed, // Special value that denotes a VB containing data in multiple vertex formats. Never used when drawing!
|
||||
} gdraw_vformat;
|
||||
/* Identifies one of the vertex data types. */
|
||||
|
||||
IDOC typedef struct GDraw_MakeVertexBuffer_ProcessingInfo
|
||||
{
|
||||
U8 *vertex_data; // location to write vertex data
|
||||
U8 *index_data; // location to write index data
|
||||
|
||||
S32 vertex_data_length; // size of buffer to write vertex data
|
||||
S32 index_data_length; // size of buffer to write index data
|
||||
|
||||
void *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7; // Pointers for GDraw to store data across "passes" (never touched by Iggy)
|
||||
U32 i0, i1, i2, i3, i4, i5, i6, i7; // Integers for GDraw to store data across "passes" (never touched by Iggy)
|
||||
} GDraw_MakeVertexBuffer_ProcessingInfo;
|
||||
/* $GDraw_MakeVertexBuffer_ProcessingInfo is used when building a vertex buffer. */
|
||||
|
||||
IDOC typedef struct GDraw_VertexBuffer_Description {
|
||||
S32 size_in_bytes; // Size of the vertex buffer in bytes
|
||||
} GDraw_VertexBuffer_Description;
|
||||
/* $GDraw_VertexBuffer_Description contains information about a vertex buffer. */
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_make_vertex_buffer_begin(void *unique_id, gdraw_vformat vformat, S32 vdata_len_in_bytes, S32 idata_len_in_bytes, GDraw_MakeVertexBuffer_ProcessingInfo *info, GDrawStats *stats);
|
||||
/* Begins specifying a new vertex buffer.
|
||||
|
||||
$:unique_id Unique value that identifies this texture, across potentially multiple flushes and re-creations of its $GDrawTexture handle in GDraw
|
||||
$:vformat One of $gdraw_vformat, denoting the format of the vertex data submitted
|
||||
$:return false if there was a problem, true if ok
|
||||
*/
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_make_vertex_buffer_more(GDraw_MakeVertexBuffer_ProcessingInfo *info);
|
||||
/* Continues specifying a new vertex buffer.
|
||||
|
||||
$:info The same handle initially passed to $gdraw_make_vertex_buffer_begin
|
||||
$:return True if specification can continue, false if specification must be aborted
|
||||
*/
|
||||
|
||||
IDOC typedef GDrawVertexBuffer * RADLINK gdraw_make_vertex_buffer_end(GDraw_MakeVertexBuffer_ProcessingInfo *info, GDrawStats *stats);
|
||||
/* Ends specification of a new vertex buffer.
|
||||
|
||||
$:info The same handle initially passed to $gdraw_make_texture_begin
|
||||
$:return Handle for the newly created vertex buffer
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_describe_vertex_buffer(GDrawVertexBuffer *buffer, GDraw_VertexBuffer_Description *desc);
|
||||
/* Returns a description for a given GDrawVertexBuffer */
|
||||
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_try_to_lock_texture(GDrawTexture *tex, void *unique_id, GDrawStats *stats);
|
||||
/* Tells GDraw that a $GDrawTexture is going to be referenced.
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_texture_begin
|
||||
*/
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_try_to_lock_vertex_buffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats);
|
||||
/* Tells GDraw that a $GDrawVertexBuffer is going to be referenced.
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_vertex_buffer_begin
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_unlock_handles(GDrawStats *stats);
|
||||
/* Indicates that the user of GDraw will not try to reference anything without locking it again.
|
||||
|
||||
Note that although a call to $gdraw_unlock_handles indicates that
|
||||
all $GDrawTexture and $GDrawVertexBuffer handles that have had a
|
||||
"unique_id" specified will no longer be referenced by the user of
|
||||
GDraw, it does not affect those $GDrawTexture handles that were
|
||||
created by $gdraw_start_texture_draw_buffer with a unique_id of 0.
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_free_vertex_buffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats);
|
||||
/* Free a vertex buffer and invalidate the handle
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_vertex_buffer_begin
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_free_texture(GDrawTexture *t, void *unique_id, GDrawStats *stats);
|
||||
/* Free a texture and invalidate the handle.
|
||||
|
||||
$:unique_id Must be the same value initially passed to $gdraw_make_texture_begin, or 0 for a texture created by $gdraw_end_texture_draw_buffer
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Render targets
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Targets)
|
||||
|
||||
IDOC typedef U32 gdraw_texturedrawbuffer_flags;
|
||||
#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color 1 IDOC // Tells GDraw that you will need the color channel when rendering a texture
|
||||
#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha 2 IDOC // Tells GDraw that you will need the alpha channel when rendering a texture
|
||||
#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_stencil 4 IDOC // Tells GDraw that you will need the stencil channel when rendering a texture
|
||||
#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_id 8 IDOC // Tells GDraw that you will need the id channel when rendering a texture
|
||||
|
||||
/* Flags that control rendering to a texture. */
|
||||
|
||||
IDOC typedef rrbool RADLINK gdraw_texture_draw_buffer_begin(gswf_recti *region, gdraw_texture_format format, gdraw_texturedrawbuffer_flags flags, void *unique_id, GDrawStats *stats);
|
||||
/* Starts rendering all GDraw commands to a new texture.
|
||||
|
||||
Creates a rendertarget with destination alpha, initializes to all 0s and prepares to render into it
|
||||
*/
|
||||
|
||||
|
||||
IDOC typedef GDrawTexture * RADLINK gdraw_texture_draw_buffer_end(GDrawStats *stats);
|
||||
/* Ends rendering GDraw commands to a texture, and returns the texture created.
|
||||
|
||||
You can get the size of the resulting texture with $gdraw_query_texture_size.
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Masking
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Masking)
|
||||
|
||||
IDOC typedef void RADLINK gdraw_draw_mask_begin(gswf_recti *region, S32 mask_bit, GDrawStats *stats);
|
||||
/* Start a masking operation on the given region for the specified mask bit.
|
||||
|
||||
For most drivers, no special preparation is necessary to start masking, so this is a no-op.
|
||||
*/
|
||||
|
||||
IDOC typedef void RADLINK gdraw_draw_mask_end(gswf_recti *region, S32 mask_bit, GDrawStats *stats);
|
||||
/* End a masking operation on the given region for the specified mask bit.
|
||||
|
||||
For most drivers, no special preparation is necessary to end masking, so this is a no-op.
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GDraw API Function table
|
||||
//
|
||||
//idoc(parent,GDrawAPI_Base)
|
||||
|
||||
IDOC struct GDrawFunctions
|
||||
{
|
||||
// queries
|
||||
gdraw_get_info *GetInfo;
|
||||
|
||||
// drawing state
|
||||
gdraw_set_view_size_and_world_scale * SetViewSizeAndWorldScale;
|
||||
gdraw_render_tile_begin * RenderTileBegin;
|
||||
gdraw_render_tile_end * RenderTileEnd;
|
||||
gdraw_set_antialias_texture * SetAntialiasTexture;
|
||||
|
||||
// drawing
|
||||
gdraw_clear_stencil_bits * ClearStencilBits;
|
||||
gdraw_clear_id * ClearID;
|
||||
gdraw_filter_quad * FilterQuad;
|
||||
gdraw_draw_indexed_triangles * DrawIndexedTriangles;
|
||||
gdraw_make_texture_begin * MakeTextureBegin;
|
||||
gdraw_make_texture_more * MakeTextureMore;
|
||||
gdraw_make_texture_end * MakeTextureEnd;
|
||||
gdraw_make_vertex_buffer_begin * MakeVertexBufferBegin;
|
||||
gdraw_make_vertex_buffer_more * MakeVertexBufferMore;
|
||||
gdraw_make_vertex_buffer_end * MakeVertexBufferEnd;
|
||||
gdraw_try_to_lock_texture * TryToLockTexture;
|
||||
gdraw_try_to_lock_vertex_buffer * TryToLockVertexBuffer;
|
||||
gdraw_unlock_handles * UnlockHandles;
|
||||
gdraw_free_texture * FreeTexture;
|
||||
gdraw_free_vertex_buffer * FreeVertexBuffer;
|
||||
gdraw_update_texture_begin * UpdateTextureBegin;
|
||||
gdraw_update_texture_rect * UpdateTextureRect;
|
||||
gdraw_update_texture_end * UpdateTextureEnd;
|
||||
|
||||
// rendertargets
|
||||
gdraw_texture_draw_buffer_begin * TextureDrawBufferBegin;
|
||||
gdraw_texture_draw_buffer_end * TextureDrawBufferEnd;
|
||||
|
||||
gdraw_describe_texture * DescribeTexture;
|
||||
gdraw_describe_vertex_buffer * DescribeVertexBuffer;
|
||||
|
||||
// new functions are always added at the end, so these have no structure
|
||||
gdraw_set_texture_unique_id * SetTextureUniqueID;
|
||||
|
||||
gdraw_draw_mask_begin * DrawMaskBegin;
|
||||
gdraw_draw_mask_end * DrawMaskEnd;
|
||||
|
||||
gdraw_rendering_begin * RenderingBegin;
|
||||
gdraw_rendering_end * RenderingEnd;
|
||||
|
||||
gdraw_make_texture_from_resource * MakeTextureFromResource;
|
||||
gdraw_free_texture_from_resource * FreeTextureFromResource;
|
||||
|
||||
gdraw_set_3d_transform * Set3DTransform;
|
||||
};
|
||||
/* The function interface called by Iggy to render graphics on all
|
||||
platforms.
|
||||
|
||||
So that Iggy can integrate with the widest possible variety of
|
||||
rendering scenarios, all of its renderer-specific drawing calls
|
||||
go through this table of function pointers. This allows you
|
||||
to dynamically configure which of RAD's supplied drawing layers
|
||||
you wish to use, or to integrate it directly into your own
|
||||
renderer by implementing your own versions of the drawing
|
||||
functions Iggy requires.
|
||||
*/
|
||||
|
||||
RADDEFEND
|
||||
|
||||
#endif
|
||||
1295
Minecraft.Client/PSVita/Iggy/include/iggy.h
Normal file
49
Minecraft.Client/PSVita/Iggy/include/iggyexpruntime.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef __RAD_INCLUDE_IGGYEXPRUNTIME_H__
|
||||
#define __RAD_INCLUDE_IGGYEXPRUNTIME_H__
|
||||
|
||||
#include "rrCore.h"
|
||||
|
||||
#define IDOC
|
||||
|
||||
RADDEFSTART
|
||||
|
||||
#ifndef __RAD_HIGGYEXP_
|
||||
#define __RAD_HIGGYEXP_
|
||||
typedef void * HIGGYEXP;
|
||||
#endif
|
||||
|
||||
//idoc(parent,IggyExpRuntime_API)
|
||||
|
||||
#define IGGYEXP_MIN_STORAGE 1024 IDOC
|
||||
/* The minimum-sized block you must provide to $IggyExpCreate */
|
||||
|
||||
IDOC RADEXPFUNC HIGGYEXP RADEXPLINK IggyExpCreate(char *ip_address, S32 port, void *storage, S32 storage_size_in_bytes);
|
||||
/* Opens a connection to $IggyExplorer and returns an $HIGGYEXP wrapping the connection.
|
||||
|
||||
$:ip_address The address of the machine running Iggy Explorer (can be numeric with dots, or textual, including "localhost")
|
||||
$:port The port number on which Iggy Explorer is listening for a network connection (the default is 9190)
|
||||
$:storage A small block of storage that needed to store the $HIGGYEXP, must be at least $IGGYEXP_MIN_STORAGE
|
||||
$:storage_size_in_bytes The size of the block pointer to by <tt>storage</tt>
|
||||
|
||||
Returns a NULL HIGGYEXP if the IP address/hostname can't be resolved, or no Iggy Explorer
|
||||
can be contacted at the specified address/port. Otherwise returns a non-NULL $HIGGYEXP
|
||||
which you can pass to $IggyUseExplorer. */
|
||||
|
||||
IDOC RADEXPFUNC void RADEXPLINK IggyExpDestroy(HIGGYEXP p);
|
||||
/* Closes and destroys a connection to $IggyExplorer */
|
||||
|
||||
IDOC RADEXPFUNC rrbool RADEXPLINK IggyExpCheckValidity(HIGGYEXP p);
|
||||
/* Checks if the connection represented by an $HIGGYEXP is still valid, i.e.
|
||||
still connected to $IggyExplorer.
|
||||
|
||||
Returns true if the connection is still valid; returns false if it is not valid.
|
||||
|
||||
This might happen if someone closes Iggy Explorer, Iggy Explorer crashes, or
|
||||
the network fails. You can this to poll and detect these conditions and do
|
||||
something in response, such as trying to open a new connection.
|
||||
|
||||
An invalid $HIGGYEXP must still be shutdown with $IggyExpDestroy. */
|
||||
|
||||
RADDEFEND
|
||||
|
||||
#endif//__RAD_INCLUDE_IGGYEXPRUNTIME_H__
|
||||
89
Minecraft.Client/PSVita/Iggy/include/iggyperfmon.h
Normal file
@@ -0,0 +1,89 @@
|
||||
// $$COPYRIGHT$$
|
||||
|
||||
#ifndef __RAD_INCLUDE_IGGYPERFMON_H__
|
||||
#define __RAD_INCLUDE_IGGYPERFMON_H__
|
||||
|
||||
#include "rrCore.h"
|
||||
|
||||
#define IDOC
|
||||
|
||||
RADDEFSTART
|
||||
|
||||
#ifndef __RAD_HIGGYPERFMON_
|
||||
#define __RAD_HIGGYPERFMON_
|
||||
typedef void * HIGGYPERFMON;
|
||||
#endif
|
||||
|
||||
//idoc(parent,IggyPerfmon_API)
|
||||
|
||||
typedef void * RADLINK iggyperfmon_malloc(void *handle, U32 size);
|
||||
typedef void RADLINK iggyperfmon_free(void *handle, void *ptr);
|
||||
|
||||
IDOC RADEXPFUNC HIGGYPERFMON RADEXPLINK IggyPerfmonCreate(iggyperfmon_malloc *perf_malloc, iggyperfmon_free *perf_free, void *callback_handle);
|
||||
/* Creates an IggyPerfmon.
|
||||
|
||||
You must supply allocator functions. The amount allocated depends on the complexity
|
||||
of the Iggys being profiled. */
|
||||
|
||||
typedef struct Iggy Iggy;
|
||||
typedef struct GDrawFunctions GDrawFunctions;
|
||||
|
||||
IDOC typedef union {
|
||||
U32 bits;
|
||||
struct {
|
||||
U32 dpad_up :1;
|
||||
U32 dpad_down :1;
|
||||
U32 dpad_left :1;
|
||||
U32 dpad_right :1;
|
||||
U32 button_up :1; // XBox Y, PS3 tri
|
||||
U32 button_down :1; // XBox A, PS3 X
|
||||
U32 button_left :1; // XBox X, PS3 square
|
||||
U32 button_right :1; // XBox B, PS3 circle
|
||||
U32 shoulder_left_hi :1; // LB/L1
|
||||
U32 shoulder_right_hi :1; // RB/R1
|
||||
U32 trigger_left_low :1;
|
||||
U32 trigger_right_low :1;
|
||||
} field;
|
||||
} IggyPerfmonPad;
|
||||
|
||||
#define IggyPerfmonPadFromXInputStatePointer(pad, xis) \
|
||||
(pad).bits = 0, \
|
||||
(pad).field.dpad_up = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP), \
|
||||
(pad).field.dpad_down = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN), \
|
||||
(pad).field.dpad_left = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT), \
|
||||
(pad).field.dpad_right = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT), \
|
||||
(pad).field.button_up = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_Y), \
|
||||
(pad).field.button_down = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_A), \
|
||||
(pad).field.button_left = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_X), \
|
||||
(pad).field.button_right = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_B), \
|
||||
(pad).field.shoulder_left_hi = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER), \
|
||||
(pad).field.shoulder_right_hi = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER), \
|
||||
(pad).field.trigger_left_low = 0 != ((xis)->Gamepad.bLeftTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD), \
|
||||
(pad).field.trigger_right_low = 0 != ((xis)->Gamepad.bRightTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD)
|
||||
|
||||
// All positions in window coords
|
||||
IDOC RADEXPFUNC void RADEXPLINK IggyPerfmonTickAndDraw(HIGGYPERFMON p, GDrawFunctions* gdraw_funcs,
|
||||
const IggyPerfmonPad* pad,
|
||||
int pm_tile_ul_x, int pm_tile_ul_y, int pm_tile_lr_x, int pm_tile_lr_y);
|
||||
/* Draw and tick an IggyPerfmon.
|
||||
|
||||
$:p A perfmon context previously created with IggyPerfmonCreate
|
||||
$:gdraw_functions The same GDraw handle used for rendering Iggy
|
||||
$:pad An abstracted gamepad state structure. iggyperfmon.h
|
||||
includes an example that initializes the abstract gamepad from a 360 controller
|
||||
as defined by XInput; this will work on both Windows and the Xbox 360.
|
||||
$:pm_tile_ul_x The left coordinate of the rectangle where the perfmon display should be drawn
|
||||
$:pm_tile_ul_y The top coordinate of the rectangle where the perfmon display should be drawn
|
||||
$:pm_tile_lr_x The right coordinate of the rectangle where the perfmon display should be drawn
|
||||
$:pm_tile_lr_y The bottom coordinate of the rectangle where the perfmon display should be drawn
|
||||
|
||||
You should only call this function when you want Iggy Perfmon to be visible.
|
||||
See $IggyPerfmon for more information. */
|
||||
|
||||
IDOC RADEXPFUNC void RADEXPLINK IggyPerfmonDestroy(HIGGYPERFMON p, GDrawFunctions* iggy_draw);
|
||||
/* Closes and destroys an IggyPerfmon */
|
||||
|
||||
|
||||
RADDEFEND
|
||||
|
||||
#endif//__RAD_INCLUDE_IGGYPERFMON_H__
|
||||
40
Minecraft.Client/PSVita/Iggy/include/iggyperfmon_psp2.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef __RAD_INCLUDE_IGGYPERFMON_PSP2_H__
|
||||
#define __RAD_INCLUDE_IGGYPERFMON_PSP2_H__
|
||||
|
||||
// You still need to include regular iggyperfmon.h first. This is just for convenience.
|
||||
|
||||
#define IggyPerfmonDPadWithShift(ctrldata, testfor) ((testfor) == ((ctrldata).buttons & ((testfor) | SCE_CTRL_L | SCE_CTRL_R)))
|
||||
|
||||
// From SceCtrlData (built-in controller)
|
||||
#define IggyPerfmonPadFromSceCtrlData(pad, ctrldata) \
|
||||
(pad).bits = 0, \
|
||||
(pad).field.dpad_up = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_UP), \
|
||||
(pad).field.dpad_down = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_DOWN), \
|
||||
(pad).field.dpad_left = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_LEFT), \
|
||||
(pad).field.dpad_right = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_RIGHT), \
|
||||
(pad).field.button_up = 0 != ((ctrldata).buttons & SCE_CTRL_TRIANGLE), \
|
||||
(pad).field.button_down = 0 != ((ctrldata).buttons & SCE_CTRL_CROSS), \
|
||||
(pad).field.button_left = 0 != ((ctrldata).buttons & SCE_CTRL_SQUARE), \
|
||||
(pad).field.button_right = 0 != ((ctrldata).buttons & SCE_CTRL_CIRCLE), \
|
||||
(pad).field.shoulder_left_hi = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_LEFT|SCE_CTRL_L), \
|
||||
(pad).field.shoulder_right_hi = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_RIGHT|SCE_CTRL_L),\
|
||||
(pad).field.trigger_left_low = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_LEFT|SCE_CTRL_R), \
|
||||
(pad).field.trigger_right_low = IggyPerfmonDPadWithShift(ctrldata, SCE_CTRL_RIGHT|SCE_CTRL_R)
|
||||
|
||||
// From SceCtrlData2 (wireless controller)
|
||||
#define IggyPerfmonPadFromSceCtrlData2(pad, ctrldata) \
|
||||
(pad).bits = 0, \
|
||||
(pad).field.dpad_up = 0 != ((ctrldata).buttons & SCE_CTRL_UP), \
|
||||
(pad).field.dpad_down = 0 != ((ctrldata).buttons & SCE_CTRL_DOWN), \
|
||||
(pad).field.dpad_left = 0 != ((ctrldata).buttons & SCE_CTRL_LEFT), \
|
||||
(pad).field.dpad_right = 0 != ((ctrldata).buttons & SCE_CTRL_RIGHT), \
|
||||
(pad).field.button_up = 0 != ((ctrldata).buttons & SCE_CTRL_TRIANGLE), \
|
||||
(pad).field.button_down = 0 != ((ctrldata).buttons & SCE_CTRL_CROSS), \
|
||||
(pad).field.button_left = 0 != ((ctrldata).buttons & SCE_CTRL_SQUARE), \
|
||||
(pad).field.button_right = 0 != ((ctrldata).buttons & SCE_CTRL_CIRCLE), \
|
||||
(pad).field.shoulder_left_hi = 0 != ((ctrldata).buttons & SCE_CTRL_L1), \
|
||||
(pad).field.shoulder_right_hi = 0 != ((ctrldata).buttons & SCE_CTRL_R1), \
|
||||
(pad).field.trigger_left_low = 0 != ((ctrldata).buttons & SCE_CTRL_L2), \
|
||||
(pad).field.trigger_right_low = 0 != ((ctrldata).buttons & SCE_CTRL_R2)
|
||||
|
||||
#endif//__RAD_INCLUDE_IGGYPERFMON_PSP2_H__
|
||||
2322
Minecraft.Client/PSVita/Iggy/include/rrCore.h
Normal file
1070
Minecraft.Client/PSVita/Leaderboards/PSVitaLeaderboardManager.cpp
Normal file
108
Minecraft.Client/PSVita/Leaderboards/PSVitaLeaderboardManager.h
Normal file
@@ -0,0 +1,108 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Leaderboards\LeaderboardManager.h"
|
||||
#include "Conf.h"
|
||||
|
||||
class PSVitaLeaderboardManager : public LeaderboardManager
|
||||
{
|
||||
protected:
|
||||
enum EStatsState
|
||||
{
|
||||
eStatsState_Idle,
|
||||
eStatsState_Getting,
|
||||
eStatsState_Failed,
|
||||
eStatsState_Ready,
|
||||
eStatsState_Canceled,
|
||||
//eStatsState_Writing,
|
||||
eStatsState_Max
|
||||
};
|
||||
|
||||
public:
|
||||
PSVitaLeaderboardManager();
|
||||
virtual ~PSVitaLeaderboardManager();
|
||||
|
||||
private:
|
||||
unsigned short m_openSessions;
|
||||
|
||||
C4JThread *m_threadScoreboard;
|
||||
bool m_running;
|
||||
|
||||
int m_titleContext;
|
||||
int32_t m_requestId;
|
||||
|
||||
//SceNpId m_myNpId;
|
||||
|
||||
static int scoreboardThreadEntry(LPVOID lpParam);
|
||||
void scoreboardThreadInternal();
|
||||
|
||||
bool getScoreByIds();
|
||||
bool getScoreByRange();
|
||||
|
||||
bool setScore();
|
||||
queue<RegisterScore> m_views;
|
||||
|
||||
CRITICAL_SECTION m_csViewsLock;
|
||||
|
||||
EStatsState m_eStatsState; //State of the stats read
|
||||
// EFilterMode m_eFilterMode;
|
||||
|
||||
ReadScore *m_scores;
|
||||
unsigned int m_maxRank;
|
||||
//SceNpScoreRankData *m_stats;
|
||||
|
||||
public:
|
||||
virtual void Tick();// {}
|
||||
|
||||
//Open a session
|
||||
virtual bool OpenSession();// { return true; }
|
||||
|
||||
//Close a session
|
||||
virtual void CloseSession();// {}
|
||||
|
||||
//Delete a session
|
||||
virtual void DeleteSession();// {}
|
||||
|
||||
//Write the given stats
|
||||
//This is called synchronously and will not free any memory allocated for views when it is done
|
||||
|
||||
virtual bool WriteStats(unsigned int viewCount, ViewIn views);// { return false; }
|
||||
|
||||
virtual bool ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount);// { return false; }
|
||||
virtual bool ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount);// { return false; }
|
||||
virtual bool ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount);// { return false; }
|
||||
|
||||
//Perform a flush of the stats
|
||||
virtual void FlushStats();// {}
|
||||
|
||||
//Cancel the current operation
|
||||
virtual void CancelOperation();// {}
|
||||
|
||||
//Is the leaderboard manager idle.
|
||||
virtual bool isIdle();// { return true; }
|
||||
|
||||
|
||||
private:
|
||||
int getBoardId(int difficulty, EStatsType);
|
||||
|
||||
//LeaderboardManager::ReadScore *filterJustScorers(unsigned int &num, LeaderboardManager::ReadScore *friendsData);
|
||||
|
||||
SceNpScorePlayerRankData *addPadding(unsigned int num, SceNpScoreRankData *rankData);
|
||||
|
||||
void convertToOutput(unsigned int &num, ReadScore *out, SceNpScorePlayerRankData *rankData, SceNpScoreComment *comm);
|
||||
|
||||
void toBinary(void *out, SceNpScoreComment *in);
|
||||
void fromBinary(SceNpScoreComment **out, void *in);
|
||||
|
||||
void toBase32(SceNpScoreComment *out, void *in);
|
||||
void fromBase32(void *out, SceNpScoreComment *in);
|
||||
|
||||
void toSymbols(char *);
|
||||
void fromSymbols(char *);
|
||||
|
||||
bool test_string(string);
|
||||
|
||||
void initReadScoreStruct(ReadScore &out, SceNpScoreRankData &);
|
||||
void fillReadScoreStruct(ReadScore &out, SceNpScoreComment &comment);
|
||||
|
||||
static bool SortByRank(const ReadScore &lhs, const ReadScore &rhs);
|
||||
};
|
||||
131
Minecraft.Client/PSVita/Leaderboards/base64.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
Copyright (C) 2004-2008 Ren<65> Nyffenegger
|
||||
|
||||
This source code is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented; you must not
|
||||
claim that you wrote the original source code. If you use this source code
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original source code.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Ren<65> Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "base64.h"
|
||||
#include <iostream>
|
||||
|
||||
static const std::string base64_chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
|
||||
|
||||
static inline bool is_base64(unsigned char c) {
|
||||
return (isalnum(c) || (c == '+') || (c == '/'));
|
||||
}
|
||||
|
||||
// 4J ADDED,
|
||||
std::string base64_encode(std::string str)
|
||||
{
|
||||
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
|
||||
}
|
||||
|
||||
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
|
||||
std::string ret;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
unsigned char char_array_3[3];
|
||||
unsigned char char_array_4[4];
|
||||
|
||||
while (in_len--) {
|
||||
char_array_3[i++] = *(bytes_to_encode++);
|
||||
if (i == 3) {
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for(int ii = 0; (ii <4) ; ii++)
|
||||
ret += base64_chars[char_array_4[ii]];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i)
|
||||
{
|
||||
for(j = i; j < 3; j++)
|
||||
char_array_3[j] = '\0';
|
||||
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for (j = 0; (j < i + 1); j++)
|
||||
ret += base64_chars[char_array_4[j]];
|
||||
|
||||
while((i++ < 3))
|
||||
ret += '=';
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
std::string base64_decode(std::string const& encoded_string) {
|
||||
int in_len = encoded_string.size();
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int in_ = 0;
|
||||
unsigned char char_array_4[4], char_array_3[3];
|
||||
std::string ret;
|
||||
|
||||
while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
|
||||
char_array_4[i++] = encoded_string[in_]; in_++;
|
||||
if (i ==4) {
|
||||
for (i = 0; i <4; i++)
|
||||
char_array_4[i] = base64_chars.find(char_array_4[i]);
|
||||
|
||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||
|
||||
for (i = 0; (i < 3); i++)
|
||||
ret += char_array_3[i];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i) {
|
||||
for (j = i; j <4; j++)
|
||||
char_array_4[j] = 0;
|
||||
|
||||
for (j = 0; j <4; j++)
|
||||
char_array_4[j] = base64_chars.find(char_array_4[j]);
|
||||
|
||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||
|
||||
for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
7
Minecraft.Client/PSVita/Leaderboards/base64.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string base64_encode(std::string str);
|
||||
std::string base64_encode(unsigned char const* , unsigned int len);
|
||||
std::string base64_decode(std::string const& s);
|
||||
8429
Minecraft.Client/PSVita/Miles/include/mss.h
Normal file
2322
Minecraft.Client/PSVita/Miles/include/rrCore.h
Normal file
491
Minecraft.Client/PSVita/Network/PSVita_NPToolkit.cpp
Normal file
@@ -0,0 +1,491 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "PSVita_NPToolkit.h"
|
||||
#include "PSVita/PSVitaExtras/Conf.h"
|
||||
#include "PSVita/Network/SonyCommerce_Vita.h"
|
||||
|
||||
// #define NP_TITLE_ID "CUSA00265_00"
|
||||
// #define NP_TITLE_SECRET_HEX "c37e30fa1f7fd29e3534834d62781143ae29aa7b51d02320e7aa0b45116ad600e4d309e8431bc37977d98b8db480e721876e7d736e11fd906778c0033bbb6370903477b1dc1e65106afc62007a5feee3158844d721b88c3f4bff2e56417b6910cedfdec78b130d2e0dd35a35a9e2ae31d5889f9398c1d62b52a3630bb03faa5b"
|
||||
// #define CLIENT_ID_FOR_SAMPLE "c8c483e7-f0b4-420b-877b-307fcb4c3cdc"
|
||||
|
||||
//#define _USE_STANDARD_ALLOC
|
||||
|
||||
// sce::Toolkit::NP::Utilities::Future< sce::Toolkit::NP::NpSessionInformation > PSVitaNPToolkit::sm_createJoinFuture;
|
||||
// sce::Toolkit::NP::NpSessionInformation PSVitaNPToolkit::m_currentSessionInfo;
|
||||
sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::MessageAttachment> PSVitaNPToolkit::m_messageData;
|
||||
|
||||
|
||||
void PSVitaNPToolkit::presenceCallback( const sce::Toolkit::NP::Event& event )
|
||||
{
|
||||
switch(event.event)
|
||||
{
|
||||
case sce::Toolkit::NP::Event::presenceSet:
|
||||
app.DebugPrintf("presenceSet Successfully\n");
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::presenceSetFailed:
|
||||
app.DebugPrintf("presenceSetFailed event received = 0x%x\n", event.returnCode);
|
||||
SQRNetworkManager_Vita::SetPresenceFailedCallback();
|
||||
// assert(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PSVitaNPToolkit::profileCallback( const sce::Toolkit::NP::Event& event )
|
||||
{
|
||||
switch(event.event)
|
||||
{
|
||||
case sce::Toolkit::NP::Event::profileError:
|
||||
app.DebugPrintf("User profile error: 0x%x\n", event.returnCode);
|
||||
break;
|
||||
default:
|
||||
app.DebugPrintf("User profile event: %i\n", event.event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PSVitaNPToolkit::messagingCallback( const sce::Toolkit::NP::Event& event )
|
||||
{
|
||||
switch(event.event)
|
||||
{
|
||||
case sce::Toolkit::NP::Event::serviceError:
|
||||
app.DebugPrintf("NP messagingCallback - serviceError: 0x%x\n", event.returnCode);
|
||||
ProfileManager.SetSysUIShowing( false );
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageSent:
|
||||
app.DebugPrintf("NP messagingCallback - messageSent: 0x%x\n", event.returnCode);
|
||||
ProfileManager.SetSysUIShowing( false );
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageError:
|
||||
app.DebugPrintf("NP messagingCallback - messageError: 0x%x\n", event.returnCode);
|
||||
if(SQRNetworkManager_Vita::m_bSendingInviteMessage) // MGH - added to fix a sysUI lockup on startup - devtrack #5883
|
||||
ProfileManager.SetSysUIShowing( false );
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageDialogTerminated:
|
||||
app.DebugPrintf("NP messagingCallback - messageDialogTerminated: 0x%x\n", event.returnCode);
|
||||
ProfileManager.SetSysUIShowing( false );
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageRetrieved:
|
||||
app.DebugPrintf("NP messagingCallback - messageRetrieved: 0x%x\n", event.returnCode);
|
||||
if(m_messageData.hasResult())
|
||||
{
|
||||
SQRNetworkManager_Vita::GetInviteDataAndProcess(m_messageData.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("messageRetrieved error 0x%08x\n", m_messageData.getError());
|
||||
}
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageInGameDataReceived:
|
||||
app.DebugPrintf("NP messagingCallback - messageInGameDataReceived: 0x%x\n", event.returnCode);
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::messageInGameDataRetrievalDone:
|
||||
app.DebugPrintf("NP messagingCallback - messageInGameDataRetrievalDone: 0x%x\n", event.returnCode);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PSVitaNPToolkit::coreCallback( const sce::Toolkit::NP::Event& event )
|
||||
{
|
||||
switch (event.event)
|
||||
{
|
||||
case sce::Toolkit::NP::Event::enetUp: ///< An event from the NetCtl service generated when a connection has been established.
|
||||
app.DebugPrintf("Received core callback: Network Up \n");
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::enetDown: ///< An event from the NetCtl service generated when the connection layer has gone down.
|
||||
app.DebugPrintf("Received core callback: Network down \n");
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::loggedIn: ///< An event from the NetCtl service generated when a connection to the PSN has been established.
|
||||
app.DebugPrintf("Received core callback: PSN sign in \n");
|
||||
ProfileManager.SetNetworkStatus(true, true);
|
||||
break;
|
||||
case sce::Toolkit::NP::Event::loggedOut: ///< An event from the NetCtl service generated when a connection to the PSN has been lost.
|
||||
app.DebugPrintf("Received core callback: PSN sign out \n");
|
||||
ProfileManager.SetNetworkStatus(false, true);
|
||||
break;
|
||||
default:
|
||||
app.DebugPrintf("Received core callback: event Num: %d \n", event.event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PSVitaNPToolkit::sceNpToolkitCallback( const sce::Toolkit::NP::Event& event)
|
||||
{
|
||||
switch(event.service)
|
||||
{
|
||||
case sce::Toolkit::NP::ServiceType::core:
|
||||
coreCallback(event);
|
||||
break;
|
||||
// case sce::Toolkit::NP::ServiceType::netInfo:
|
||||
// Menu::NetInfo::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::sessions:
|
||||
// sessionsCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::tss:
|
||||
// Menu::Tss::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::ranking:
|
||||
// Menu::Ranking::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::tus:
|
||||
// Menu::Tus::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
case sce::Toolkit::NP::ServiceType::profile:
|
||||
profileCallback(event);
|
||||
break;
|
||||
case sce::Toolkit::NP::ServiceType::messaging:
|
||||
messagingCallback(event);
|
||||
// case sce::Toolkit::NP::ServiceType::friends:
|
||||
// Menu::Friends::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::auth:
|
||||
// Menu::Auth::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
case sce::Toolkit::NP::ServiceType::trophy:
|
||||
// ProfileManager.trophySystemCallback(event);
|
||||
break;
|
||||
// case sce::Toolkit::NP::ServiceType::messaging:
|
||||
// messagingCallback(event);
|
||||
// case sce::Toolkit::NP::ServiceType::inGameMessage:
|
||||
// Menu::Messaging::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
|
||||
case sce::Toolkit::NP::ServiceType::commerce:
|
||||
SonyCommerce_Vita::commerce2Handler(event);
|
||||
break;
|
||||
case sce::Toolkit::NP::ServiceType::presence:
|
||||
presenceCallback(event);
|
||||
break;
|
||||
// case sce::Toolkit::NP::ServiceType::wordFilter:
|
||||
// Menu::WordFilter::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
// case sce::Toolkit::NP::ServiceType::sns:
|
||||
// Menu::Sns::sceNpToolkitCallback(event);
|
||||
// break;
|
||||
|
||||
// case sce::Toolkit::NP::ServiceType::gameCustomData:
|
||||
// gameCustomDataCallback(event);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// void PSVitaNPToolkit::sessionsCallback( const sce::Toolkit::NP::Event& event)
|
||||
// {
|
||||
// switch(event.event)
|
||||
// {
|
||||
// case sce::Toolkit::NP::Event::npSessionCreateResult: ///< An event generated when the %Np session creation process has been completed.
|
||||
// app.DebugPrintf("npSessionCreateResult");
|
||||
// if(sm_createJoinFuture.hasResult())
|
||||
// {
|
||||
// app.DebugPrintf("Session Created Successfully\n");
|
||||
// m_currentSessionInfo = *sm_createJoinFuture.get();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// app.DebugPrintf("Session Creation Failed 0x%x\n",sm_createJoinFuture.getError());
|
||||
// }
|
||||
// sm_createJoinFuture.reset();
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionJoinResult: ///< An event generated when the join %Np session process has been completed.
|
||||
// app.DebugPrintf("npSessionJoinResult");
|
||||
// if(sm_createJoinFuture.hasResult())
|
||||
// {
|
||||
// app.DebugPrintf("Session joined successfully\n");
|
||||
// m_currentSessionInfo = *sm_createJoinFuture.get();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// app.DebugPrintf("Session join Failed 0x%x\n",sm_createJoinFuture.getError());
|
||||
// }
|
||||
// sm_createJoinFuture.reset();
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionError: ///< An event generated when there was error performing the current %Np session process.
|
||||
// app.DebugPrintf("npSessionError");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionLeaveResult: ///< An event generated when the user has left the current %Np session.
|
||||
// app.DebugPrintf("npSessionLeaveResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionModified: ///< An event generated when the %Np session has been modified.
|
||||
// app.DebugPrintf("npSessionModified");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionUpdateResult: ///< An event generated when the %Np session has been updated.
|
||||
// app.DebugPrintf("npSessionUpdateResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionGetInfoResult: ///< An event generated when the %Np session info has been retrieved.
|
||||
// app.DebugPrintf("npSessionGetInfoResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionGetInfoListResult: ///< An event generated when the %Np session info has been retrieved.
|
||||
// app.DebugPrintf("npSessionGetInfoListResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionGetSessionDataResult: ///< An event generated when the %Np session data has been retrieved.
|
||||
// app.DebugPrintf("npSessionGetSessionDataResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionSearchResult: ///< An event generated when the %Np session search request has been completed.
|
||||
// app.DebugPrintf("npSessionSearchResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionInviteNotification: ///< An event generated when the %Np session push notification is received.
|
||||
// app.DebugPrintf("npSessionInviteNotification");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionInviteGetInfoResult: ///< An event generated when the %Np session info has been retrieved.
|
||||
// app.DebugPrintf("npSessionInviteGetInfoResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionInviteGetInfoListResult: ///< An event generated when the %Np session info has been retrieved.
|
||||
// app.DebugPrintf("npSessionInviteGetInfoListResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::npSessionInviteGetDataResult: ///< An event generated when the %Np session data has been retrieved.
|
||||
// app.DebugPrintf("npSessionInviteGetDataResult");
|
||||
// break;
|
||||
// default:
|
||||
// assert(0);
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
void PSVitaNPToolkit::gameCustomDataCallback( const sce::Toolkit::NP::Event& event)
|
||||
{
|
||||
// switch(event.event)
|
||||
// {
|
||||
//
|
||||
// case sce::Toolkit::NP::Event::gameCustomDataItemListResult:
|
||||
// app.DebugPrintf("gameCustomDataItemListResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::gameCustomDataGameDataResult:
|
||||
// app.DebugPrintf("gameCustomDataGameDataResult");
|
||||
// if(m_messageData.hasResult())
|
||||
// {
|
||||
// SQRNetworkManager_Orbis::GetInviteDataAndProcess(m_messageData.get());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// app.DebugPrintf("gameCustomDataMessageResult error 0x%08x\n", m_messageData.getError());
|
||||
// }
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::gameCustomDataMessageResult:
|
||||
// app.DebugPrintf("gameCustomDataMessageResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::gameCustomDataSetUseFlagResult:
|
||||
// app.DebugPrintf("gameCustomDataSetUseFlagResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::gameCustomDataGameThumbnailResult:
|
||||
// app.DebugPrintf("gameCustomDataGameThumbnailResult");
|
||||
// break;
|
||||
// case sce::Toolkit::NP::Event::messageError:
|
||||
// app.DebugPrintf("messageError : 0x%08x\n", event.returnCode);
|
||||
// assert(0);
|
||||
// break;
|
||||
// default:
|
||||
// assert(0);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
static uint8_t hexCharToUint(char ch)
|
||||
{
|
||||
uint8_t val = 0;
|
||||
|
||||
if ( isdigit(ch) ){
|
||||
val = (ch - '0');
|
||||
}
|
||||
else if ( isupper(ch) ){
|
||||
val = (ch - 'A' + 10);
|
||||
}
|
||||
else{
|
||||
val = (ch - 'a' + 10);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void hexStrToBin(
|
||||
const char *pHexStr,
|
||||
uint8_t *pBinBuf,
|
||||
size_t binBufSize
|
||||
)
|
||||
{
|
||||
uint8_t val = 0;
|
||||
int hexStrLen = strlen(pHexStr);
|
||||
|
||||
int binOffset = 0;
|
||||
for (int i = 0; i < hexStrLen; i++) {
|
||||
val |= hexCharToUint(*(pHexStr + i));
|
||||
if (i % 2 == 0) {
|
||||
val <<= 4;
|
||||
}
|
||||
else {
|
||||
if (pBinBuf != NULL && binOffset < binBufSize) {
|
||||
memcpy(pBinBuf + binOffset, &val, 1);
|
||||
val = 0;
|
||||
}
|
||||
binOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
if (val != 0 && pBinBuf != NULL && binOffset < binBufSize) {
|
||||
memcpy(pBinBuf + binOffset, &val, 1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void npStateCallback(SceNpServiceState state, int retCode, void *userdata)
|
||||
{
|
||||
//CD - Updates the online status of player
|
||||
switch(state)
|
||||
{
|
||||
case SCE_NP_SERVICE_STATE_SIGNED_OUT:
|
||||
ProfileManager.SetNetworkStatus(false, false);
|
||||
break;
|
||||
case SCE_NP_SERVICE_STATE_SIGNED_IN:
|
||||
ProfileManager.SetNetworkStatus(false, true);
|
||||
break;
|
||||
case SCE_NP_SERVICE_STATE_ONLINE:
|
||||
ProfileManager.SetNetworkStatus(true, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PSVitaNPToolkit::init()
|
||||
{
|
||||
// MenuApp menuApp;
|
||||
// sce::Toolkit::NP::NpTitleId nptTitleId;
|
||||
// nptTitleId.setTitleSecret(*SQRNetworkManager_Vita::GetSceNpTitleId(), *SQRNetworkManager_Vita::GetSceNpTitleSecret());
|
||||
sce::Toolkit::NP::CommunicationId commsIds(s_npCommunicationId, s_npCommunicationPassphrase, s_npCommunicationSignature);
|
||||
sce::Toolkit::NP::Parameters params(sceNpToolkitCallback,commsIds);
|
||||
params.m_title.setId(app.GetCommerceCategory());
|
||||
|
||||
|
||||
int ret = sce::Toolkit::NP::Interface::init(params);
|
||||
if (ret != SCE_OK)
|
||||
{
|
||||
app.DebugPrintf("Failed to initialize NP Toolkit Library : 0x%x\n", ret);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
||||
ret = sce::Toolkit::NP::Interface::registerNpCommsId(commsIds, sce::Toolkit::NP::matching);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("Failed to register TSS Comms ID : 0x%x\n", ret);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
// extern void npStateCallback(SceNpServiceState state, int retCode, void *userdata);
|
||||
|
||||
ret = sceNpRegisterServiceStateCallback(npStateCallback, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceNpRegisterServiceStateCallback() failed. ret = 0x%x\n", ret);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// // Register Client ID for Auth
|
||||
// ret = sce::Toolkit::NP::Interface::registerClientId(CLIENT_ID_FOR_SAMPLE);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// app.DebugPrintf("Failed to register Auth Client ID : 0x%x\n", ret);
|
||||
// assert(0);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// void PSVitaNPToolkit::createNPSession()
|
||||
// {
|
||||
// #define CURRENT_SESSION_ATTR_NUMS 5
|
||||
// #define SESSION_IMAGE_PATH "/app0/orbis/session_image.png"
|
||||
// #define SESSION_STATUS "Minecraft online game (this text needs defined and localised)"
|
||||
// #define SESSION_NAME "Minecraft(this text needs defined and localised)"
|
||||
//
|
||||
// static const int maxSlots = 8;
|
||||
//
|
||||
// SceUserServiceUserId userId = SCE_USER_SERVICE_USER_ID_INVALID;
|
||||
// int ret = sceUserServiceGetInitialUser(&userId);
|
||||
// if( ret < 0 )
|
||||
// {
|
||||
// app.DebugPrintf("Couldn't retrieve user ID 0x%x ...\n",ret);
|
||||
// }
|
||||
//
|
||||
// sce::Toolkit::NP::CreateNpSessionRequest createSessionRequest;
|
||||
// memset(&createSessionRequest,0,sizeof(createSessionRequest));
|
||||
// strncpy(createSessionRequest.sessionName,SESSION_NAME,strlen(SESSION_NAME));
|
||||
// createSessionRequest.sessionTypeFlag = SCE_TOOLKIT_NP_CREATE_SESSION_TYPE_PUBLIC;
|
||||
// createSessionRequest.maxSlots = maxSlots;
|
||||
// strncpy(createSessionRequest.sessionImgPath,SESSION_IMAGE_PATH,strlen(SESSION_IMAGE_PATH));
|
||||
// strncpy(createSessionRequest.sessionStatus,SESSION_STATUS,strlen(SESSION_STATUS));
|
||||
// createSessionRequest.userInfo.userId = userId;
|
||||
// char test[3] = {'R','K','B'};
|
||||
// createSessionRequest.sessionData= test;
|
||||
// createSessionRequest.sessionDataSize = 3;
|
||||
// ret = sce::Toolkit::NP::Sessions::Interface::create(&createSessionRequest,&sm_createJoinFuture);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// void PSVitaNPToolkit::joinNPSession()
|
||||
// {
|
||||
// SceUserServiceUserId userId = SCE_USER_SERVICE_USER_ID_INVALID;
|
||||
// int ret = sceUserServiceGetInitialUser(&userId);
|
||||
// if( ret < 0 )
|
||||
// {
|
||||
// app.DebugPrintf("Couldn't retrieve user ID 0x%x ...\n",ret);
|
||||
// }
|
||||
//
|
||||
// sce::Toolkit::NP::JoinNpSessionRequest joinSessionRequest;
|
||||
// memset(&joinSessionRequest,0,sizeof(joinSessionRequest));
|
||||
// // still to sort this out
|
||||
// ORBIS_STUBBED;
|
||||
// }
|
||||
//
|
||||
// void PSVitaNPToolkit::leaveNPSession()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
void PSVitaNPToolkit::getMessageData(SceAppUtilAppEventParam* paramData)
|
||||
{
|
||||
|
||||
if (SCE_APPUTIL_APPEVENT_TYPE_NP_INVITE_MESSAGE == paramData->type)
|
||||
{
|
||||
sce::Toolkit::NP::Messaging::Interface::retrieveMessageAttachment(paramData,&m_messageData);
|
||||
}
|
||||
else if (SCE_APPUTIL_APPEVENT_TYPE_NP_APP_DATA_MESSAGE == paramData->type)
|
||||
{
|
||||
sce::Toolkit::NP::Messaging::Interface::retrieveMessageAttachment(paramData,&m_messageData);
|
||||
}
|
||||
else if (SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE == paramData->type)
|
||||
{
|
||||
SceAppUtilNpBasicJoinablePresenceParam joinParam = {0};
|
||||
int ret = sceAppUtilAppEventParseNpBasicJoinablePresence(paramData, &joinParam);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceAppUtilAppEventParseNpBasicJoinablePresence() failed: 0x%x\n", ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
SQRNetworkManager_Vita::GetJoinablePresenceDataAndProcess(&joinParam);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
}
|
||||
32
Minecraft.Client/PSVita/Network/PSVita_NPToolkit.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <np_toolkit.h>
|
||||
// #include <np_toolkit/game_custom_data_interface.h>
|
||||
|
||||
|
||||
class PSVitaNPToolkit
|
||||
{
|
||||
public:
|
||||
static void init();
|
||||
static void sceNpToolkitCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void coreCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void presenceCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void profileCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void messagingCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void sessionsCallback( const sce::Toolkit::NP::Event& event);
|
||||
static void gameCustomDataCallback( const sce::Toolkit::NP::Event& event);
|
||||
|
||||
// static void createNPSession();
|
||||
// static void destroyNPSession();
|
||||
// static void joinNPSession();
|
||||
// static void leaveNPSession();
|
||||
// static SceNpSessionId* getNPSessionID() { return &m_currentSessionInfo.npSessionId; }
|
||||
|
||||
static void getMessageData(SceAppUtilAppEventParam* paramData);
|
||||
private:
|
||||
// static sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::NpSessionInformation> sm_createJoinFuture;
|
||||
// static sce::Toolkit::NP::NpSessionInformation m_currentSessionInfo;
|
||||
static sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::MessageAttachment> m_messageData;
|
||||
|
||||
};
|
||||
|
||||
3119
Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp
Normal file
352
Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.h
Normal file
@@ -0,0 +1,352 @@
|
||||
#pragma once
|
||||
#include <np.h>
|
||||
#include <libnetctl.h>
|
||||
#include <net.h>
|
||||
#include <np_toolkit.h>
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "..\..\Common\Network\Sony\SQRNetworkManager.h"
|
||||
//
|
||||
class SQRNetworkPlayer;
|
||||
class ISQRNetworkManagerListener;
|
||||
class SonyVoiceChat_Vita;
|
||||
class SQRVoiceConnection;
|
||||
class C4JThread;
|
||||
|
||||
|
||||
class HelloSyncInfo;
|
||||
|
||||
enum EAdhocDataTag
|
||||
{
|
||||
e_dataTag_Normal,
|
||||
e_dataTag_RoomSync
|
||||
};
|
||||
|
||||
class AdhocDataPacket
|
||||
{
|
||||
public:
|
||||
EAdhocDataTag m_tag;
|
||||
uint32_t m_pData[1];
|
||||
};
|
||||
|
||||
// This is the lowest level manager for providing network functionality on Sony platforms. This manages various network activities including the players within a gaming session.
|
||||
// The game shouldn't directly use this class, it is here to provide functionality required by PlatformNetworkManagerSony.
|
||||
|
||||
class SQRNetworkManager_AdHoc_Vita : public SQRNetworkManager
|
||||
{
|
||||
friend class SonyVoiceChat_Vita;
|
||||
friend class SQRNetworkPlayer;
|
||||
|
||||
static const eSQRNetworkManagerState m_INTtoEXTStateMappings[SNM_INT_STATE_COUNT];
|
||||
|
||||
|
||||
|
||||
public:
|
||||
SQRNetworkManager_AdHoc_Vita(ISQRNetworkManagerListener *listener);
|
||||
|
||||
// General
|
||||
void Tick();
|
||||
void Initialise();
|
||||
bool IsInitialised();
|
||||
void UnInitialise();
|
||||
void Terminate();
|
||||
eSQRNetworkManagerState GetState();
|
||||
bool IsHost();
|
||||
bool IsReadyToPlayOrIdle();
|
||||
bool IsInSession();
|
||||
|
||||
// Session management
|
||||
void CreateAndJoinRoom(int hostIndex, int localPlayerMask, void *extData, int extDataSize, bool offline);
|
||||
void UpdateExternalRoomData();
|
||||
bool FriendRoomManagerIsBusy();
|
||||
bool FriendRoomManagerSearch();
|
||||
bool FriendRoomManagerSearch2();
|
||||
int FriendRoomManagerGetCount();
|
||||
void FriendRoomManagerGetRoomInfo(int idx, SessionSearchResult *searchResult);
|
||||
bool JoinRoom(SessionSearchResult *searchResult, int localPlayerMask);
|
||||
bool JoinRoom(SceNetInAddr netAddr, int localPlayerMask, const HelloSyncInfo *presence);
|
||||
bool JoinRoom(SceNpMatching2RoomId roomId, SceNpMatching2ServerId serverId, int localPlayerMask, const PresenceSyncInfo *presence);
|
||||
void StartGame();
|
||||
void LeaveRoom(bool bActuallyLeaveRoom);
|
||||
void EndGame();
|
||||
bool SessionHasSpace(int spaceRequired);
|
||||
bool AddLocalPlayerByUserIndex(int idx);
|
||||
bool RemoveLocalPlayerByUserIndex(int idx);
|
||||
void SendInviteGUI();
|
||||
static void RecvInviteGUI();
|
||||
void TickInviteGUI();
|
||||
|
||||
|
||||
|
||||
// void GetInviteDataAndProcess(SceNpBasicAttachmentDataId id);
|
||||
static bool UpdateInviteData(HelloSyncInfo *invite);
|
||||
void GetExtDataForRoom( SceNpMatching2RoomId roomId, void *extData, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
|
||||
// Player retrieval
|
||||
int GetPlayerCount();
|
||||
int GetOnlinePlayerCount();
|
||||
SQRNetworkPlayer *GetPlayerByIndex(int idx);
|
||||
SQRNetworkPlayer *GetPlayerBySmallId(int idx);
|
||||
SQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx);
|
||||
SQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid);
|
||||
SQRNetworkPlayer *GetHostPlayer();
|
||||
|
||||
void removePlayerFromVoiceChat(SQRNetworkPlayer* pPlayer);
|
||||
// Communication parameter storage
|
||||
static const SceNpCommunicationId* GetSceNpCommsId();
|
||||
static const SceNpCommunicationSignature* GetSceNpCommsSig();
|
||||
static const SceNpTitleId* GetSceNpTitleId();
|
||||
static const SceNpTitleSecret* GetSceNpTitleSecret();
|
||||
|
||||
static void GetInviteDataAndProcess(sce::Toolkit::NP::MessageAttachment* pInvite);
|
||||
static bool GetAdhocStatus() { return m_adhocStatus; }
|
||||
|
||||
|
||||
int sendDataPacket(SceNetInAddr addr, EAdhocDataTag tag, void* data, int dataSize);
|
||||
int sendDataPacket(SceNetInAddr addr, void* data, int dataSize);
|
||||
|
||||
private:
|
||||
void InitialiseAfterOnline();
|
||||
void ErrorHandlingTick();
|
||||
void UpdateAdhocStatus(int status) { m_adhocStatus = status; }
|
||||
void UpdateLocalIPAddress();
|
||||
|
||||
ISQRNetworkManagerListener *m_listener;
|
||||
SQRNetworkPlayer *GetPlayerIfReady(SQRNetworkPlayer *player);
|
||||
|
||||
// Internal state
|
||||
void SetState(eSQRNetworkManagerInternalState state);
|
||||
void ResetToIdle();
|
||||
eSQRNetworkManagerInternalState m_state;
|
||||
eSQRNetworkManagerState m_stateExternal;
|
||||
bool m_nextIdleReasonIsFull;
|
||||
bool m_isHosting;
|
||||
SceNetInAddr m_localIPAddr;
|
||||
SceNpMatching2RoomMemberId m_localMemberId;
|
||||
SceNpMatching2RoomMemberId m_hostMemberId; // if we're not the host
|
||||
int m_localPlayerCount;
|
||||
int m_localPlayerJoined; // Client only, keep a count of how many local players we have confirmed as joined to the application
|
||||
SceNpMatching2RoomId m_room;
|
||||
unsigned char m_currentSmallId;
|
||||
int m_soc;
|
||||
bool m_offlineGame;
|
||||
bool m_offlineSQR;
|
||||
int m_resendExternalRoomDataCountdown;
|
||||
bool m_matching2initialised;
|
||||
// HelloSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES];
|
||||
// int m_inviteIndex;
|
||||
// static HelloSyncInfo *m_gameBootInvite;
|
||||
// static HelloSyncInfo m_gameBootInvite_data;
|
||||
// bool m_doBootInviteCheck;
|
||||
bool m_isInSession;
|
||||
// static SceNpBasicAttachmentDataId s_lastInviteIdToRetry;
|
||||
static int m_adhocStatus;
|
||||
bool m_bLinkDisconnected;
|
||||
|
||||
private:
|
||||
|
||||
CRITICAL_SECTION m_csRoomSyncData;
|
||||
RoomSyncData m_roomSyncData;
|
||||
void *m_joinExtData;
|
||||
int m_joinExtDataSize;
|
||||
|
||||
std::vector<SQRNetworkPlayer *> m_vecTempPlayers;
|
||||
SQRNetworkPlayer *m_aRoomSlotPlayers[MAX_ONLINE_PLAYER_COUNT]; // Maps from the players in m_roomSyncData, to SQRNetworkPlayers
|
||||
void FindOrCreateNonNetworkPlayer(int slot, int playerType, SceNpMatching2RoomMemberId memberId, int localPlayerIdx, int smallId);
|
||||
|
||||
void MapRoomSlotPlayers(int roomSlotPlayerCount =-1);
|
||||
void UpdateRoomSyncUIDsFromPlayers();
|
||||
void UpdatePlayersFromRoomSyncUIDs();
|
||||
void LocalDataSend(SQRNetworkPlayer *playerFrom, SQRNetworkPlayer *playerTo, const void *data, unsigned int dataSize);
|
||||
int GetSessionIndex(SQRNetworkPlayer *player);
|
||||
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = NULL );
|
||||
void RemoveRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int mask );
|
||||
void RemoveNetworkPlayers( int mask );
|
||||
void SetLocalPlayersAndSync();
|
||||
void SyncRoomData();
|
||||
SceNpMatching2RequestId m_setRoomDataRequestId;
|
||||
SceNpMatching2RequestId m_setRoomIntDataRequestId;
|
||||
SceNpMatching2RequestId m_roomExtDataRequestId;
|
||||
|
||||
// Server context management
|
||||
bool GetMatchingContext(eSQRNetworkManagerInternalState asyncState);
|
||||
bool GetServerContext();
|
||||
bool GetServerContext_AdHoc();
|
||||
bool GetServerContext2();
|
||||
bool GetServerContext(SceNpMatching2ServerId serverId);
|
||||
void DeleteServerContext();
|
||||
bool SelectRandomServer();
|
||||
void ServerContextTick();
|
||||
int m_totalServerCount;
|
||||
int m_serverCount;
|
||||
SceNpMatching2ServerId *m_aServerId;
|
||||
SceNpMatching2ServerId m_serverId;
|
||||
bool m_serverContextValid;
|
||||
SceNpMatching2RequestId m_serverSearchRequestId;
|
||||
SceNpMatching2RequestId m_serverContextRequestId;
|
||||
|
||||
// Room creation management
|
||||
SceNpMatching2RequestId m_getWorldRequestId;
|
||||
SceNpMatching2RequestId m_createRoomRequestId;
|
||||
SceNpMatching2WorldId m_worldId;
|
||||
void RoomCreateTick();
|
||||
|
||||
// Room joining management
|
||||
SceNpMatching2RoomId m_roomToJoin;
|
||||
int m_localPlayerJoinMask;
|
||||
SceNpMatching2RequestId m_joinRoomRequestId;
|
||||
SceNpMatching2RequestId m_kickRequestId;
|
||||
|
||||
// Room leaving management
|
||||
SceNpMatching2RequestId m_leaveRoomRequestId;
|
||||
|
||||
// Adding extra network players management
|
||||
SceNpMatching2RequestId m_setRoomMemberInternalDataRequestId;
|
||||
|
||||
// Player state management
|
||||
void NetworkPlayerConnectionComplete(SQRNetworkPlayer *player);
|
||||
void NetworkPlayerSmallIdAllocated(SQRNetworkPlayer *player, unsigned char smallId);
|
||||
void NetworkPlayerInitialDataReceived(SQRNetworkPlayer *player,void *data);
|
||||
void NonNetworkPlayerComplete(SQRNetworkPlayer *player, unsigned char smallId);
|
||||
void HandlePlayerJoined(SQRNetworkPlayer *player);
|
||||
CRITICAL_SECTION m_csPlayerState;
|
||||
|
||||
// State and thread for managing basic event type messages
|
||||
C4JThread *m_basicEventThread;
|
||||
// SceKernelEqueue m_basicEventQueue;
|
||||
static int BasicEventThreadProc( void *lpParameter);
|
||||
|
||||
// State and storage for managing search for friends' games
|
||||
eSQRNetworkManagerFriendSearchState m_friendSearchState;
|
||||
SceNpMatching2ContextId m_matchingContext;
|
||||
bool m_matchingContextServerValid;
|
||||
bool m_matchingContextClientValid;
|
||||
SceNpMatching2RequestId m_friendSearchRequestId;
|
||||
unsigned int m_friendCount;
|
||||
// C4JThread *m_getFriendCountThread;
|
||||
// static int GetFriendsThreadProc( void* lpParameter );
|
||||
void FriendSearchTick();
|
||||
SceNpMatching2RequestId m_roomDataExternalListRequestId;
|
||||
void (* m_FriendSessionUpdatedFn)(bool success, void *pParam);
|
||||
void *m_pParamFriendSessionUpdated;
|
||||
void *m_pExtDataToUpdate;
|
||||
|
||||
// Results from searching for rooms that friends are playing in - 5 matched arrays to store their NpIds, rooms, servers, whether a room was found, and whether the external data had been received for the room. Also a count of how many elements are used in this array.
|
||||
class FriendSearchResult
|
||||
{
|
||||
public:
|
||||
SceNpId m_NpId;
|
||||
SceNetInAddr m_netAddr;
|
||||
// SceNpMatching2RoomId m_RoomId;
|
||||
// SceNpMatching2ServerId m_ServerId;
|
||||
bool m_RoomFound;
|
||||
void *m_RoomExtDataReceived;
|
||||
void* m_gameSessionData;
|
||||
RoomSyncData m_roomSyncData;
|
||||
};
|
||||
std::vector<FriendSearchResult> m_aFriendSearchResults;
|
||||
bool m_bFriendsSearchChanged;
|
||||
|
||||
// Rudp management and local players
|
||||
std::unordered_map<int,SQRNetworkPlayer *> m_RudpCtxToPlayerMap;
|
||||
std::unordered_map<int,SceNetInAddr> m_RudpCtxToIPAddrMap;
|
||||
|
||||
std::unordered_map<SceNetInAddr_t, SQRVoiceConnection*> m_NetAddrToVoiceConnectionMap;
|
||||
|
||||
bool CreateRudpConnections(SceNetInAddr peer);
|
||||
bool CreateVoiceRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask);
|
||||
bool CreateSocket();
|
||||
SQRNetworkPlayer *GetPlayerFromRudpCtx(int rudpCtx);
|
||||
SceNetInAddr* GetIPAddrFromRudpCtx(int rudpCtx);
|
||||
SQRVoiceConnection* GetVoiceConnectionFromRudpCtx(int rudpCtx);
|
||||
|
||||
SQRNetworkPlayer *GetPlayerFromRoomMemberAndLocalIdx(int roomMember, int localIdx);
|
||||
SceNpMatching2RequestId m_roomMemberDataRequestId;
|
||||
|
||||
// Callbacks (for matching)
|
||||
bool RegisterCallbacks();
|
||||
void HandleMatchingContextStart();
|
||||
// #ifdef __PS3__
|
||||
// static void DefaultRequestCallback(SceNpMatching2ContextId id, SceNpMatching2RequestId reqId, SceNpMatching2Event event, SceNpMatching2EventKey eventKey, int errorCode, size_t dataSize, void *arg);
|
||||
// static void RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, SceNpMatching2EventKey eventKey, int errorCode, size_t dataSize, void *arg);
|
||||
// #else
|
||||
// static void DefaultRequestCallback(SceNpMatching2ContextId id, SceNpMatching2RequestId reqId, SceNpMatching2Event event, int errorCode, const void *data, void *arg);
|
||||
// static void RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, const void *data, void *arg);
|
||||
// #endif
|
||||
// static void SignallingCallback(SceNpMatching2ContextId ctxId, SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, SceNpMatching2Event event, int error_code, void *arg);
|
||||
|
||||
// Callback for NpBasic
|
||||
static int BasicEventCallback(int event, int retCode, uint32_t reqId, void *arg);
|
||||
|
||||
// Callback for NpManager
|
||||
static void ManagerCallback(int event, int result, void *arg);
|
||||
|
||||
// Callback for sys util
|
||||
static void SysUtilCallback(uint64_t status, uint64_t param, void *userdata);
|
||||
void updateNetCheckDialog(); // get the status of the dialog and run any callbacks needed [CD - Added to match SQRNetworkManager_Vita]
|
||||
|
||||
// Callbacks for rudp
|
||||
static void RudpContextCallback(int ctx_id, int event_id, int error_code, void *arg);
|
||||
static int RudpEventCallback(int event_id, int soc, uint8_t const *data, size_t datalen, struct SceNetSockaddr const *addr, SceNetSocklen_t addrlen, void *arg);
|
||||
|
||||
// Callback for netctl
|
||||
static void NetCtlCallback(int eventType, void *arg);
|
||||
|
||||
// Methods to be called when the server context has been created
|
||||
void ServerContextValid_CreateRoom();
|
||||
void ServerContextValid_JoinRoom();
|
||||
|
||||
// Mask utilities
|
||||
int GetOldMask(SceNpMatching2RoomMemberId memberId);
|
||||
int GetAddedMask(int newMask, int oldMask);
|
||||
int GetRemovedMask(int newMask, int oldMask);
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
static bool aForceError[SNM_FORCE_ERROR_COUNT];
|
||||
#endif
|
||||
bool ForceErrorPoint(eSQRForceError err);
|
||||
|
||||
|
||||
static void MatchingEventHandler(int id, int event, SceNetInAddr* peer, int optlen, void *opt);
|
||||
|
||||
|
||||
public:
|
||||
static void AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad), void *pParam, bool callIfFailed = false);
|
||||
static int (*s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad);
|
||||
static bool s_signInCompleteCallbackIfFailed;
|
||||
static void *s_SignInCompleteParam;
|
||||
|
||||
static int SetRichPresence(const void *data);
|
||||
void SetPresenceDataStartHostingGame();
|
||||
int GetJoiningReadyPercentage();
|
||||
|
||||
void startMatching();
|
||||
private:
|
||||
void UpdateRichPresenceCustomData(void *data, unsigned int dataBytes);
|
||||
static void TickRichPresence();
|
||||
static void SendLastPresenceInfo();
|
||||
void OnlineCheck();
|
||||
|
||||
bool CreateMatchingContext(bool bServer = false);
|
||||
void StopMatchingContext();
|
||||
|
||||
|
||||
static sce::Toolkit::NP::PresenceDetails s_lastPresenceInfo;
|
||||
static int s_resendPresenceCountdown;
|
||||
static bool s_presenceStatusDirty;
|
||||
static bool s_presenceDataDirty;
|
||||
static HelloSyncInfo s_lastPresenceSyncInfo;
|
||||
static HelloSyncInfo c_presenceSyncInfoNULL;
|
||||
static bool b_inviteRecvGUIRunning;
|
||||
// Debug
|
||||
static long long s_roomStartTime;
|
||||
|
||||
int m_hid;
|
||||
bool m_bIsInitialised;
|
||||
|
||||
};
|
||||
|
||||
4080
Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp
Normal file
324
Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.h
Normal file
@@ -0,0 +1,324 @@
|
||||
#pragma once
|
||||
#include <np.h>
|
||||
#include <libnetctl.h>
|
||||
#include <net.h>
|
||||
#include <np_toolkit.h>
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "..\..\Common\Network\Sony\SQRNetworkManager.h"
|
||||
|
||||
class SQRNetworkPlayer;
|
||||
class ISQRNetworkManagerListener;
|
||||
class SonyVoiceChat_Vita;
|
||||
class SQRVoiceConnection;
|
||||
class C4JThread;
|
||||
|
||||
// This is the lowest level manager for providing network functionality on Sony platforms. This manages various network activities including the players within a gaming session.
|
||||
// The game shouldn't directly use this class, it is here to provide functionality required by PlatformNetworkManagerSony.
|
||||
|
||||
class SQRNetworkManager_Vita : public SQRNetworkManager
|
||||
{
|
||||
friend class SonyVoiceChat_Vita;
|
||||
friend class SQRNetworkPlayer;
|
||||
|
||||
static const eSQRNetworkManagerState m_INTtoEXTStateMappings[SNM_INT_STATE_COUNT];
|
||||
|
||||
public:
|
||||
SQRNetworkManager_Vita(ISQRNetworkManagerListener *listener);
|
||||
|
||||
// General
|
||||
void Tick();
|
||||
void Initialise();
|
||||
bool IsInitialised();
|
||||
void UnInitialise();
|
||||
void Terminate();
|
||||
eSQRNetworkManagerState GetState();
|
||||
bool IsHost();
|
||||
bool IsReadyToPlayOrIdle();
|
||||
bool IsInSession();
|
||||
|
||||
// Session management
|
||||
void CreateAndJoinRoom(int hostIndex, int localPlayerMask, void *extData, int extDataSize, bool offline);
|
||||
void UpdateExternalRoomData();
|
||||
bool FriendRoomManagerIsBusy();
|
||||
bool FriendRoomManagerSearch();
|
||||
bool FriendRoomManagerSearch2();
|
||||
int FriendRoomManagerGetCount();
|
||||
void FriendRoomManagerGetRoomInfo(int idx, SessionSearchResult *searchResult);
|
||||
bool JoinRoom(SessionSearchResult *searchResult, int localPlayerMask);
|
||||
bool JoinRoom(SceNpMatching2RoomId roomId, SceNpMatching2ServerId serverId, int localPlayerMask, const SQRNetworkManager_Vita::PresenceSyncInfo *presence);
|
||||
void StartGame();
|
||||
void LeaveRoom(bool bActuallyLeaveRoom);
|
||||
void EndGame();
|
||||
bool SessionHasSpace(int spaceRequired);
|
||||
bool AddLocalPlayerByUserIndex(int idx);
|
||||
bool RemoveLocalPlayerByUserIndex(int idx);
|
||||
void SendInviteGUI();
|
||||
static void RecvInviteGUI();
|
||||
void TickInviteGUI();
|
||||
|
||||
|
||||
|
||||
// void GetInviteDataAndProcess(SceNpBasicAttachmentDataId id);
|
||||
static bool UpdateInviteData(SQRNetworkManager_Vita::PresenceSyncInfo *invite);
|
||||
void GetExtDataForRoom( SceNpMatching2RoomId roomId, void *extData, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
|
||||
// Player retrieval
|
||||
int GetPlayerCount();
|
||||
int GetOnlinePlayerCount();
|
||||
SQRNetworkPlayer *GetPlayerByIndex(int idx);
|
||||
SQRNetworkPlayer *GetPlayerBySmallId(int idx);
|
||||
SQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx);
|
||||
SQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid);
|
||||
SQRNetworkPlayer *GetHostPlayer();
|
||||
|
||||
void removePlayerFromVoiceChat(SQRNetworkPlayer* pPlayer);
|
||||
// Communication parameter storage
|
||||
static const SceNpCommunicationId* GetSceNpCommsId();
|
||||
static const SceNpCommunicationSignature* GetSceNpCommsSig();
|
||||
static const SceNpTitleId* GetSceNpTitleId();
|
||||
static const SceNpTitleSecret* GetSceNpTitleSecret();
|
||||
|
||||
static void GetInviteDataAndProcess(sce::Toolkit::NP::MessageAttachment* pInvite);
|
||||
static void GetJoinablePresenceDataAndProcess(SceAppUtilNpBasicJoinablePresenceParam* pJoinablePresenceData);
|
||||
static void ProcessJoinablePresenceData();
|
||||
static void TickJoinablePresenceData();
|
||||
|
||||
static int PSNSignInReturnedPresenceInvite(void* pParam, bool bContinue, int iPad);
|
||||
|
||||
|
||||
static bool m_bJoinablePresenceWaitingForOnline;
|
||||
static SceAppUtilNpBasicJoinablePresenceParam m_joinablePresenceParam;
|
||||
static bool m_bSendingInviteMessage;
|
||||
|
||||
private:
|
||||
void InitialiseAfterOnline();
|
||||
void ErrorHandlingTick();
|
||||
void UpdateOnlineStatus(int status) { m_onlineStatus = status; }
|
||||
int GetOnlineStatus() { return m_onlineStatus; }
|
||||
|
||||
ISQRNetworkManagerListener *m_listener;
|
||||
SQRNetworkPlayer *GetPlayerIfReady(SQRNetworkPlayer *player);
|
||||
|
||||
// Internal state
|
||||
void SetState(eSQRNetworkManagerInternalState state);
|
||||
void ResetToIdle();
|
||||
eSQRNetworkManagerInternalState m_state;
|
||||
eSQRNetworkManagerState m_stateExternal;
|
||||
bool m_nextIdleReasonIsFull;
|
||||
bool m_isHosting;
|
||||
SceNpMatching2RoomMemberId m_localMemberId;
|
||||
SceNpMatching2RoomMemberId m_hostMemberId; // if we're not the host
|
||||
int m_localPlayerCount;
|
||||
int m_localPlayerJoined; // Client only, keep a count of how many local players we have confirmed as joined to the application
|
||||
SceNpMatching2RoomId m_room;
|
||||
unsigned char m_currentSmallId;
|
||||
int m_soc;
|
||||
bool m_offlineGame;
|
||||
bool m_offlineSQR;
|
||||
int m_resendExternalRoomDataCountdown;
|
||||
bool m_matching2initialised;
|
||||
PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES];
|
||||
int m_inviteIndex;
|
||||
static PresenceSyncInfo *m_gameBootInvite;
|
||||
static PresenceSyncInfo m_gameBootInvite_data;
|
||||
bool m_doBootInviteCheck;
|
||||
bool m_isInSession;
|
||||
// static SceNpBasicAttachmentDataId s_lastInviteIdToRetry;
|
||||
int m_onlineStatus;
|
||||
bool m_bLinkDisconnected;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
CRITICAL_SECTION m_csRoomSyncData;
|
||||
RoomSyncData m_roomSyncData;
|
||||
void *m_joinExtData;
|
||||
int m_joinExtDataSize;
|
||||
|
||||
std::vector<SQRNetworkPlayer *> m_vecTempPlayers;
|
||||
SQRNetworkPlayer *m_aRoomSlotPlayers[MAX_ONLINE_PLAYER_COUNT]; // Maps from the players in m_roomSyncData, to SQRNetworkPlayers
|
||||
void FindOrCreateNonNetworkPlayer(int slot, int playerType, SceNpMatching2RoomMemberId memberId, int localPlayerIdx, int smallId);
|
||||
|
||||
void MapRoomSlotPlayers(int roomSlotPlayerCount =-1);
|
||||
void UpdateRoomSyncUIDsFromPlayers();
|
||||
void UpdatePlayersFromRoomSyncUIDs();
|
||||
void LocalDataSend(SQRNetworkPlayer *playerFrom, SQRNetworkPlayer *playerTo, const void *data, unsigned int dataSize);
|
||||
int GetSessionIndex(SQRNetworkPlayer *player);
|
||||
|
||||
bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = NULL );
|
||||
void RemoveRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int mask );
|
||||
void RemoveNetworkPlayers( int mask );
|
||||
void SetLocalPlayersAndSync();
|
||||
void SyncRoomData();
|
||||
SceNpMatching2RequestId m_setRoomDataRequestId;
|
||||
SceNpMatching2RequestId m_setRoomIntDataRequestId;
|
||||
SceNpMatching2RequestId m_roomExtDataRequestId;
|
||||
|
||||
// Server context management
|
||||
bool GetMatchingContext(eSQRNetworkManagerInternalState asyncState);
|
||||
bool GetServerContext();
|
||||
bool GetServerContext_AdHoc();
|
||||
bool GetServerContext2();
|
||||
bool GetServerContext(SceNpMatching2ServerId serverId);
|
||||
void DeleteServerContext();
|
||||
bool SelectRandomServer();
|
||||
void ServerContextTick();
|
||||
int m_totalServerCount;
|
||||
int m_serverCount;
|
||||
SceNpMatching2ServerId *m_aServerId;
|
||||
SceNpMatching2ServerId m_serverId;
|
||||
bool m_serverContextValid;
|
||||
SceNpMatching2RequestId m_serverSearchRequestId;
|
||||
SceNpMatching2RequestId m_serverContextRequestId;
|
||||
|
||||
// Room creation management
|
||||
SceNpMatching2RequestId m_getWorldRequestId;
|
||||
SceNpMatching2RequestId m_createRoomRequestId;
|
||||
SceNpMatching2WorldId m_worldId;
|
||||
void RoomCreateTick();
|
||||
|
||||
// Room joining management
|
||||
SceNpMatching2RoomId m_roomToJoin;
|
||||
int m_localPlayerJoinMask;
|
||||
SceNpMatching2RequestId m_joinRoomRequestId;
|
||||
SceNpMatching2RequestId m_kickRequestId;
|
||||
|
||||
// Room leaving management
|
||||
SceNpMatching2RequestId m_leaveRoomRequestId;
|
||||
|
||||
// Adding extra network players management
|
||||
SceNpMatching2RequestId m_setRoomMemberInternalDataRequestId;
|
||||
|
||||
// Player state management
|
||||
void NetworkPlayerConnectionComplete(SQRNetworkPlayer *player);
|
||||
void NetworkPlayerSmallIdAllocated(SQRNetworkPlayer *player, unsigned char smallId);
|
||||
void NetworkPlayerInitialDataReceived(SQRNetworkPlayer *player,void *data);
|
||||
void NonNetworkPlayerComplete(SQRNetworkPlayer *player, unsigned char smallId);
|
||||
void HandlePlayerJoined(SQRNetworkPlayer *player);
|
||||
CRITICAL_SECTION m_csPlayerState;
|
||||
|
||||
// State and thread for managing basic event type messages
|
||||
C4JThread *m_basicEventThread;
|
||||
// SceKernelEqueue m_basicEventQueue;
|
||||
static int BasicEventThreadProc( void *lpParameter);
|
||||
|
||||
// State and storage for managing search for friends' games
|
||||
eSQRNetworkManagerFriendSearchState m_friendSearchState;
|
||||
SceNpMatching2ContextId m_matchingContext;
|
||||
bool m_matchingContextValid;
|
||||
SceNpMatching2RequestId m_friendSearchRequestId;
|
||||
unsigned int m_friendCount;
|
||||
C4JThread *m_getFriendCountThread;
|
||||
static int GetFriendsThreadProc( void* lpParameter );
|
||||
void FriendSearchTick();
|
||||
SceNpMatching2RequestId m_roomDataExternalListRequestId;
|
||||
void (* m_FriendSessionUpdatedFn)(bool success, void *pParam);
|
||||
void *m_pParamFriendSessionUpdated;
|
||||
void *m_pExtDataToUpdate;
|
||||
|
||||
// Results from searching for rooms that friends are playing in - 5 matched arrays to store their NpIds, rooms, servers, whether a room was found, and whether the external data had been received for the room. Also a count of how many elements are used in this array.
|
||||
class FriendSearchResult
|
||||
{
|
||||
public:
|
||||
SceNpId m_NpId;
|
||||
SceNpMatching2RoomId m_RoomId;
|
||||
SceNpMatching2ServerId m_ServerId;
|
||||
bool m_RoomFound;
|
||||
void *m_RoomExtDataReceived;
|
||||
};
|
||||
std::vector<FriendSearchResult> m_aFriendSearchResults;
|
||||
|
||||
// Rudp management and local players
|
||||
std::unordered_map<int,SQRNetworkPlayer *> m_RudpCtxToPlayerMap;
|
||||
|
||||
std::unordered_map<SceNetInAddr_t, SQRVoiceConnection*> m_NetAddrToVoiceConnectionMap;
|
||||
|
||||
bool CreateRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask, SceNpMatching2RoomMemberId playersPeerMemberId);
|
||||
bool CreateVoiceRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask);
|
||||
bool CreateSocket();
|
||||
SQRNetworkPlayer *GetPlayerFromRudpCtx(int rudpCtx);
|
||||
SQRVoiceConnection* GetVoiceConnectionFromRudpCtx(int rudpCtx);
|
||||
|
||||
SQRNetworkPlayer *GetPlayerFromRoomMemberAndLocalIdx(int roomMember, int localIdx);
|
||||
SceNpMatching2RequestId m_roomMemberDataRequestId;
|
||||
|
||||
// Callbacks (for matching)
|
||||
bool RegisterCallbacks();
|
||||
static void ContextCallback(SceNpMatching2ContextId id, SceNpMatching2Event event, SceNpMatching2EventCause eventCause, int errorCode, void *arg);
|
||||
// #ifdef __PS3__
|
||||
// static void DefaultRequestCallback(SceNpMatching2ContextId id, SceNpMatching2RequestId reqId, SceNpMatching2Event event, SceNpMatching2EventKey eventKey, int errorCode, size_t dataSize, void *arg);
|
||||
// static void RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, SceNpMatching2EventKey eventKey, int errorCode, size_t dataSize, void *arg);
|
||||
// #else
|
||||
static void DefaultRequestCallback(SceNpMatching2ContextId id, SceNpMatching2RequestId reqId, SceNpMatching2Event event, int errorCode, const void *data, void *arg);
|
||||
static void RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, const void *data, void *arg);
|
||||
// #endif
|
||||
static void SignallingCallback(SceNpMatching2ContextId ctxId, SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, SceNpMatching2Event event, int error_code, void *arg);
|
||||
|
||||
// Callback for NpBasic
|
||||
static int BasicEventCallback(int event, int retCode, uint32_t reqId, void *arg);
|
||||
|
||||
// Callback for NpManager
|
||||
static void ManagerCallback(int event, int result, void *arg);
|
||||
|
||||
// Callback for sys util
|
||||
static void SysUtilCallback(uint64_t status, uint64_t param, void *userdata);
|
||||
void updateNetCheckDialog(); // get the status of the dialog and run any callbacks needed
|
||||
|
||||
// Callbacks for rudp
|
||||
static void RudpContextCallback(int ctx_id, int event_id, int error_code, void *arg);
|
||||
static int RudpEventCallback(int event_id, int soc, uint8_t const *data, size_t datalen, struct SceNetSockaddr const *addr, SceNetSocklen_t addrlen, void *arg);
|
||||
|
||||
// Callback for netctl
|
||||
static void NetCtlCallback(int eventType, void *arg);
|
||||
|
||||
// Methods to be called when the server context has been created
|
||||
void ServerContextValid_CreateRoom();
|
||||
void ServerContextValid_JoinRoom();
|
||||
|
||||
// Mask utilities
|
||||
int GetOldMask(SceNpMatching2RoomMemberId memberId);
|
||||
int GetAddedMask(int newMask, int oldMask);
|
||||
int GetRemovedMask(int newMask, int oldMask);
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
static bool aForceError[SNM_FORCE_ERROR_COUNT];
|
||||
#endif
|
||||
bool ForceErrorPoint(eSQRForceError err);
|
||||
|
||||
public:
|
||||
static void AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad), void *pParam, bool callIfFailed = false);
|
||||
static int (*s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad);
|
||||
static bool s_signInCompleteCallbackIfFailed;
|
||||
static void *s_SignInCompleteParam;
|
||||
|
||||
static int SetRichPresence(const void *data);
|
||||
void SetPresenceDataStartHostingGame();
|
||||
int GetJoiningReadyPercentage();
|
||||
static void SetPresenceFailedCallback();
|
||||
GameSessionUID GetHostUID() { return s_lastPresenceSyncInfo.hostPlayerUID; }
|
||||
private:
|
||||
static void UpdateRichPresenceCustomData(void *data, unsigned int dataBytes);
|
||||
static void TickRichPresence();
|
||||
static void SendLastPresenceInfo();
|
||||
void OnlineCheck();
|
||||
|
||||
static sce::Toolkit::NP::PresenceDetails s_lastPresenceInfo;
|
||||
static int s_resendPresenceCountdown;
|
||||
static bool s_presenceStatusDirty;
|
||||
static PresenceSyncInfo s_lastPresenceSyncInfo;
|
||||
static PresenceSyncInfo c_presenceSyncInfoNULL;
|
||||
static bool b_inviteRecvGUIRunning;
|
||||
// 4J-PB - so we can stop the crash when Iggy's LoadMovie is called from the ContextCallback
|
||||
static bool m_bCallPSNSignInCallback;
|
||||
// Debug
|
||||
static long long s_roomStartTime;
|
||||
|
||||
int m_hid;
|
||||
bool m_bIsInitialised;
|
||||
bool m_bShuttingDown;
|
||||
};
|
||||
|
||||
1519
Minecraft.Client/PSVita/Network/SonyCommerce_Vita.cpp
Normal file
204
Minecraft.Client/PSVita/Network/SonyCommerce_Vita.h
Normal file
@@ -0,0 +1,204 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Network\Sony\SonyCommerce.h"
|
||||
#include <np_toolkit.h>
|
||||
#include <libsysmodule.h>
|
||||
#include <netcheck_dialog.h>
|
||||
|
||||
class SonyCommerce_Vita : public SonyCommerce
|
||||
{
|
||||
friend class PSVitaNPToolkit;
|
||||
enum State
|
||||
{
|
||||
e_state_noSession,
|
||||
e_state_creatingSession,
|
||||
e_state_createSessionDone,
|
||||
e_state_idle,
|
||||
|
||||
|
||||
};
|
||||
/// This enum is used to verify the current utility that is running
|
||||
enum Phase
|
||||
{
|
||||
e_phase_stopped = 0,
|
||||
e_phase_idle,
|
||||
e_phase_voucherRedeemPhase,
|
||||
e_phase_productBrowsePhase,
|
||||
e_phase_creatingSessionPhase,
|
||||
e_phase_checkoutPhase,
|
||||
e_phase_downloadListPhase
|
||||
};
|
||||
|
||||
enum Message
|
||||
{
|
||||
e_message_commerceNone,
|
||||
e_message_commerceCreateSession, ///< Create a commerce session
|
||||
e_message_commerceRecreateSession, ///< Recreate a commerce session
|
||||
e_message_commerceGetCategoryInfo, ///< Information about a category in the Store
|
||||
e_message_commerceGetProductList, ///< Get a list of products available in the Store
|
||||
e_message_commerceGetDetailedProductInfo, ///< Get a list of products available in the Store, with additional details
|
||||
e_message_commerceAddDetailedProductInfo, ///< Add additional details to a ProdcutInfo already retrieved
|
||||
e_message_commerceStoreProductBrowse, ///< Launches the Store to a specified product
|
||||
e_message_commerceUpgradeTrial, ///< Upgrade a trial to full game
|
||||
e_message_commerceRedeemVoucher, ///< Redeem a voucher code
|
||||
e_message_commerceGetEntitlementList, ///< Get a list of entitlements associated with the current PSN user.
|
||||
e_message_commerceConsumeEntitlement, ///< Consume an amount from a consumable entitlement.
|
||||
e_message_commerceCheckout, ///< Launch the Store checkout
|
||||
e_message_commerceDownloadList, ///< Launch the download list
|
||||
e_message_commerceCheckout_Game, ///< Launch the Store checkout
|
||||
e_message_commerceDownloadList_Game, ///< Launch the download list
|
||||
e_message_commerceInstallContent, ///< Install content that's downloaded from the background download manager
|
||||
e_message_commerceEnd ///< End commerce2 processing
|
||||
};
|
||||
|
||||
enum Event
|
||||
{
|
||||
e_event_none,
|
||||
e_event_commerceSessionCreated, ///< An event generated when a commerce session has successfully been created.
|
||||
e_event_commerceSessionRecreated, ///< An event generated when a commerce session has successfully been recreated.
|
||||
e_event_commerceSessionAborted, ///< An event generated when the creation of commerce session has been aborted.
|
||||
e_event_commerceGotCategoryInfo, ///< An event generated when some category information has been retrieved from the store.
|
||||
e_event_commerceGotProductList, ///< An event generated when a list of products that are available has been retrieved from the store.
|
||||
e_event_commerceGotDetailedProductInfo, ///< An event generated when some detailed product information has been retrieved from the store.
|
||||
e_event_commerceAddedDetailedProductInfo, ///< An event generated when some detailed product information has been retrieved from the store.
|
||||
e_event_commerceProductBrowseStarted, ///< An event generated when product overlay has started.
|
||||
e_event_commerceProductBrowseSuccess, ///< An event generated when a product browse was completed successfully, and the user purchased the product.
|
||||
e_event_commerceProductBrowseAborted, ///< An event generated when a product browse was aborted by the user (the user pressed back).
|
||||
e_event_commerceProductBrowseFinished, ///< An event generated when a product browse has finished and it is now safe to free memory.
|
||||
e_event_commerceVoucherInputStarted, ///< An event generated when a voucher code input overlay was started.
|
||||
e_event_commerceVoucherInputSuccess, ///< An event generated when a voucher code input completed successfully.
|
||||
e_event_commerceVoucherInputAborted, ///< An event generated when a voucher code input was aborted by the user (user pressed back).
|
||||
e_event_commerceVoucherInputFinished, ///< An event generated when a voucher code input has finished. It is now safe to free memory.
|
||||
e_event_commerceGotEntitlementList, ///< An event generated when a the list of entitlements has been received for the current user.
|
||||
e_event_commerceConsumedEntitlement, ///< An event generated when the has successfully consumed an entitlement.
|
||||
e_event_commerceCheckoutStarted, ///< An event generated when a store checkout overlay has started.
|
||||
e_event_commerceCheckoutSuccess, ///< An event generated when user has successfully purchased from the checkout.
|
||||
e_event_commerceCheckoutAborted, ///< An event generated when the checkout was aborted by the user (user pressed back).
|
||||
e_event_commerceCheckoutFinished, ///< An event generated when a store checkout overlay has finished.
|
||||
e_event_commerceDownloadListStarted, ///< An event generated when a download list overlay has started.
|
||||
e_event_commerceDownloadListSuccess, ///< An event generated when the user has ended the download list.
|
||||
e_event_commerceDownloadListFinished, ///< An event generated when a download list overlay has finished.
|
||||
e_event_commerceInstallContentStarted,
|
||||
e_event_commerceInstallContentFinished,
|
||||
e_event_commerceError ///< An event generated when a commerce error has occurred.
|
||||
};
|
||||
|
||||
static bool m_bLicenseChecked;
|
||||
static bool m_bCommerceInitialised;
|
||||
// static SceNpCommerce2SessionInfo m_sessionInfo;
|
||||
static State m_state;
|
||||
static int m_errorCode;
|
||||
static LPVOID m_callbackParam;
|
||||
static Event m_event;
|
||||
static Message m_message;
|
||||
// static uint32_t m_requestID;
|
||||
static void* m_receiveBuffer;
|
||||
static std::vector<ProductInfo> *m_pProductInfoList;
|
||||
static ProductInfoDetailed *m_pProductInfoDetailed;
|
||||
static ProductInfo *m_pProductInfo;
|
||||
static CategoryInfo* m_pCategoryInfo;
|
||||
static char* m_pCategoryID;
|
||||
static const char* m_pProductID;
|
||||
static std::queue<Message> m_messageQueue;
|
||||
static CallbackFunc m_callbackFunc;
|
||||
static CheckoutInputParams m_checkoutInputParams;
|
||||
static DownloadListInputParams m_downloadInputParams;
|
||||
// static sys_memory_container_t m_memContainer;
|
||||
static bool m_bUpgradingTrial;
|
||||
static C4JThread* m_tickThread;
|
||||
static CallbackFunc m_trialUpgradeCallbackFunc;
|
||||
static LPVOID m_trialUpgradeCallbackParam;
|
||||
static CRITICAL_SECTION m_queueLock;
|
||||
static bool m_bLicenseInstalled;
|
||||
static bool m_bDownloadsPending;
|
||||
static bool m_bDownloadsReady;
|
||||
static bool m_bInstallingContent;
|
||||
static int m_iClearDLCCountdown;
|
||||
static bool m_bPurchasabilityUpdated;
|
||||
|
||||
static Message m_lastMessage;
|
||||
static void runCallback()
|
||||
{
|
||||
assert(m_callbackFunc);
|
||||
CallbackFunc func = m_callbackFunc;
|
||||
m_callbackFunc = NULL;
|
||||
if(func)
|
||||
func(m_callbackParam, m_errorCode);
|
||||
m_errorCode = SCE_OK;
|
||||
}
|
||||
static void setCallback(CallbackFunc cb,LPVOID lpParam)
|
||||
{
|
||||
assert(m_callbackFunc == NULL);
|
||||
m_callbackFunc = cb;
|
||||
m_callbackParam = lpParam;
|
||||
}
|
||||
|
||||
|
||||
static uint32_t m_contextId; ///< The npcommerce2 context ID
|
||||
static bool m_contextCreated; ///< npcommerce2 context ID created?
|
||||
static Phase m_currentPhase; ///< Current commerce2 util
|
||||
// static char m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE];
|
||||
|
||||
|
||||
|
||||
static void commerce2Handler( const sce::Toolkit::NP::Event& event);
|
||||
static void processMessage();
|
||||
static void processEvent();
|
||||
|
||||
static int createContext();
|
||||
static int createSession();
|
||||
static int recreateSession();
|
||||
static void setError(int err) { m_errorCode = err; }
|
||||
static int getCategoryInfo(CategoryInfo *info, char *categoryId);
|
||||
static int getProductList(std::vector<ProductInfo>* productList, char *categoryId);
|
||||
static int getDetailedProductInfo(ProductInfoDetailed *info, const char *productId, char *categoryId);
|
||||
static int addDetailedProductInfo(ProductInfo *info, const char *productId, char *categoryId);
|
||||
static int checkout(CheckoutInputParams ¶ms);
|
||||
static int downloadList(DownloadListInputParams ¶ms);
|
||||
static int checkout_game(CheckoutInputParams ¶ms);
|
||||
static int downloadList_game(DownloadListInputParams ¶ms);
|
||||
static int installContent();
|
||||
static void UpgradeTrialCallback1(LPVOID lpParam,int err);
|
||||
static void UpgradeTrialCallback2(LPVOID lpParam,int err);
|
||||
static void Delete();
|
||||
static void copyCategoryInfo(CategoryInfo *pInfo, sce::Toolkit::NP::CategoryInfo *pNPInfo);
|
||||
static void copyProductList(std::vector<ProductInfo>* pProductList, std::vector<sce::Toolkit::NP::ProductInfo>* pNPProductList);
|
||||
static void copyDetailedProductInfo(ProductInfoDetailed *pInfo, sce::Toolkit::NP::ProductInfoDetailed* pNPInfo);
|
||||
static void copyAddDetailedProductInfo(ProductInfo *pInfo, sce::Toolkit::NP::ProductInfoDetailed* pNPInfo);
|
||||
static void InstallContentCallback(LPVOID lpParam,int err);
|
||||
|
||||
static int commerceEnd();
|
||||
// static int upgradeTrial();
|
||||
|
||||
static int TickLoop(void* lpParam);
|
||||
//void Test();
|
||||
|
||||
static void Init();
|
||||
static int Shutdown();
|
||||
|
||||
static void CheckForTrialUpgradeKey_Callback(LPVOID param, bool bFullVersion);
|
||||
|
||||
public:
|
||||
static void checkBackgroundDownloadStatus();
|
||||
|
||||
virtual void CreateSession(CallbackFunc cb, LPVOID lpParam);
|
||||
virtual void CloseSession();
|
||||
|
||||
virtual void GetCategoryInfo(CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId);
|
||||
virtual void GetProductList(CallbackFunc cb, LPVOID lpParam, std::vector<ProductInfo>* productList, const char *categoryId);
|
||||
virtual void GetDetailedProductInfo(CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfoDetailed, const char *productId, const char *categoryId);
|
||||
virtual void AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId );
|
||||
virtual void Checkout(CallbackFunc cb, LPVOID lpParam, const char* skuID);
|
||||
virtual void Checkout(CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo);
|
||||
virtual void DownloadAlreadyPurchased(CallbackFunc cb, LPVOID lpParam, const char* skuID);
|
||||
virtual void Checkout_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID);
|
||||
virtual void DownloadAlreadyPurchased_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID);
|
||||
static void InstallContent(CallbackFunc cb, LPVOID lpParam);
|
||||
virtual void UpgradeTrial(CallbackFunc cb, LPVOID lpParam);
|
||||
virtual void CheckForTrialUpgradeKey();
|
||||
virtual bool LicenseChecked();
|
||||
|
||||
static bool getPurchasabilityUpdated();
|
||||
static bool getDLCUpgradePending();
|
||||
|
||||
};
|
||||
271
Minecraft.Client/PSVita/Network/SonyHttp_Vita.cpp
Normal file
@@ -0,0 +1,271 @@
|
||||
#include "stdafx.h"
|
||||
#include "SonyHttp_Vita.h"
|
||||
|
||||
static const int sc_SSLHeapSize = (304 * 1024U);
|
||||
static const int sc_HTTPHeapSize = (80 * 1024);
|
||||
static const int sc_NetHeapSize = (16 * 1024);
|
||||
|
||||
#define TEST_USER_AGENT "SimpleSample/1.00"
|
||||
|
||||
|
||||
// int SonyHttp_Vita::libnetMemId = 0;
|
||||
int SonyHttp_Vita::libsslCtxId = 0;
|
||||
int SonyHttp_Vita::libhttpCtxId = 0;
|
||||
bool SonyHttp_Vita:: bInitialised = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool SonyHttp_Vita::init()
|
||||
{
|
||||
// int ret = sceNetPoolCreate("simple", sc_NetHeapSize, 0);
|
||||
// assert(ret >= 0);
|
||||
// libnetMemId = ret;
|
||||
|
||||
// int ret = sceSslInit(sc_SSLHeapSize);
|
||||
// assert(ret >= 0 || ret == SCE_SSL_ERROR_ALREADY_INITED);
|
||||
// libsslCtxId = ret;
|
||||
//
|
||||
// ret = sceHttpInit(sc_HTTPHeapSize);
|
||||
// assert(ret >= 0 || ret == SCE_HTTP_ERROR_ALREADY_INITED);
|
||||
// libhttpCtxId = ret;
|
||||
|
||||
bInitialised = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SonyHttp_Vita::shutdown()
|
||||
{
|
||||
PSVITA_STUBBED;
|
||||
// int ret = sceHttpTerm(libhttpCtxId);
|
||||
// assert(ret == SCE_OK);
|
||||
//
|
||||
// ret = sceSslTerm(libsslCtxId);
|
||||
// assert(ret == SCE_OK);
|
||||
//
|
||||
// /* libnet */
|
||||
// ret = sceNetPoolDestroy(libnetMemId);
|
||||
// assert(ret == SCE_OK);
|
||||
|
||||
}
|
||||
void SonyHttp_Vita::printSslError(SceInt32 sslErr, SceUInt32 sslErrDetail)
|
||||
{
|
||||
switch (sslErr)
|
||||
{
|
||||
case (SCE_HTTPS_ERROR_CERT): /* Verify error */
|
||||
/* Internal error at verifying certificate*/
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_INTERNAL){
|
||||
app.DebugPrintf("ssl verify error: unexpcted error\n");
|
||||
}
|
||||
/* Error of server certificate or CA certificate */
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_INVALID_CERT){
|
||||
app.DebugPrintf("ssl verify error: invalid server cert or CA cert\n");
|
||||
}
|
||||
/* Server hostname and server certificate are mismatched*/
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_CN_CHECK){
|
||||
app.DebugPrintf("ssl verify error: invalid server hostname\n");
|
||||
}
|
||||
/* Server certificate or CA certificate is expired.*/
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_NOT_AFTER_CHECK){
|
||||
app.DebugPrintf("ssl verify error: server cert or CA cert had expired\n");
|
||||
}
|
||||
/* Server certificate or CA certificate is before validated.*/
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_NOT_BEFORE_CHECK){
|
||||
app.DebugPrintf("ssl verify error: server cert or CA cert isn't validated yet.\n");
|
||||
}
|
||||
/* Unknown CA error */
|
||||
if (sslErrDetail & SCE_HTTPS_ERROR_SSL_UNKNOWN_CA){
|
||||
app.DebugPrintf("ssl verify error: unknown CA\n");
|
||||
}
|
||||
break;
|
||||
case (SCE_HTTPS_ERROR_HANDSHAKE): /* fail to ssl-handshake */
|
||||
app.DebugPrintf("ssl error: handshake error\n");
|
||||
break;
|
||||
case (SCE_HTTPS_ERROR_IO): /* Error of Socket IO */
|
||||
app.DebugPrintf("ssl error: io error\n");
|
||||
break;
|
||||
case (SCE_HTTP_ERROR_OUT_OF_MEMORY): /* Out of memory*/
|
||||
app.DebugPrintf("ssl error: out of memory\n");
|
||||
break;
|
||||
case (SCE_HTTPS_ERROR_INTERNAL): /* Unexpected Internal Error*/
|
||||
app.DebugPrintf("ssl error: unexpcted error\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void SonyHttp_Vita::printSslCertInfo(SceSslCert *sslCert)
|
||||
{
|
||||
SceInt32 ret;
|
||||
const SceUChar8 *sboData;
|
||||
SceSize sboLen, counter;
|
||||
|
||||
ret = sceSslGetSerialNumber(sslCert, &sboData, &sboLen);
|
||||
if (ret < 0){
|
||||
app.DebugPrintf ("sceSslGetSerialNumber() returns 0x%x\n", ret);
|
||||
} else {
|
||||
app.DebugPrintf("Serial number=");
|
||||
for (counter = 0; counter < sboLen; counter++){
|
||||
app.DebugPrintf("%02X", sboData[counter]);
|
||||
}
|
||||
app.DebugPrintf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SonyHttp_Vita::getDataFromURL( const char* szURL, void** ppOutData, int* pDataSize)
|
||||
{
|
||||
if(!bInitialised)
|
||||
return false;
|
||||
return http_get(szURL, ppOutData, pDataSize);
|
||||
}
|
||||
|
||||
|
||||
int SonyHttp_Vita::sslCallback(SceUInt32 verifyErr, SceSslCert * const sslCert[], SceInt32 certNum, void *userArg)
|
||||
{
|
||||
SceInt32 i;
|
||||
(void)userArg;
|
||||
|
||||
app.DebugPrintf("Ssl callback:\n");
|
||||
app.DebugPrintf("\tbase tmpl[%x]\n", (SceInt32)userArg);
|
||||
|
||||
if (verifyErr != 0){
|
||||
printSslError((SceInt32)SCE_HTTPS_ERROR_CERT, verifyErr);
|
||||
}
|
||||
for (i = 0; i < certNum; i++){
|
||||
printSslCertInfo(sslCert[i]);
|
||||
}
|
||||
if (verifyErr == 0){
|
||||
return SCE_OK;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
bool SonyHttp_Vita::http_get_close(bool bOK, SceInt32 tmplId, SceInt32 connId, SceInt32 reqId)
|
||||
{
|
||||
SceInt32 ret;
|
||||
if (reqId > 0)
|
||||
{
|
||||
ret = sceHttpDeleteRequest(reqId);
|
||||
assert(ret >= 0);
|
||||
}
|
||||
if (connId > 0)
|
||||
{
|
||||
ret = sceHttpDeleteConnection(connId);
|
||||
assert(ret >= 0);
|
||||
}
|
||||
if (tmplId > 0)
|
||||
{
|
||||
ret = sceHttpDeleteTemplate(tmplId);
|
||||
assert(ret >= 0);
|
||||
}
|
||||
assert(bOK);
|
||||
return bOK;
|
||||
}
|
||||
|
||||
bool SonyHttp_Vita::http_get(const char *targetUrl, void** ppOutData, int* pDataSize)
|
||||
{
|
||||
SceInt32 ret, tmplId=0, connId=0, reqId=0, statusCode;
|
||||
SceULong64 contentLength=0;
|
||||
SceBool finFlag=SCE_FALSE;
|
||||
SceUChar8* recvBuf;
|
||||
|
||||
ret = sceHttpCreateTemplate(TEST_USER_AGENT, SCE_HTTP_VERSION_1_1, SCE_TRUE);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpCreateTemplate() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
tmplId = ret;
|
||||
|
||||
/* Perform http_get without server verification */
|
||||
ret = sceHttpsDisableOption(SCE_HTTPS_FLAG_SERVER_VERIFY);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpsDisableOption() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
|
||||
/* Register SSL callback */
|
||||
ret = sceHttpsSetSslCallback(tmplId, sslCallback, (void*)&tmplId);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpsSetSslCallback() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
|
||||
ret = sceHttpCreateConnectionWithURL(tmplId, targetUrl, SCE_TRUE);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpCreateConnectionWithURL() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
connId = ret;
|
||||
|
||||
ret = sceHttpCreateRequestWithURL(connId, SCE_HTTP_METHOD_GET, targetUrl, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpCreateRequestWithURL() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
reqId = ret;
|
||||
|
||||
ret = sceHttpSendRequest(reqId, NULL, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpSendRequest() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
|
||||
ret = sceHttpGetStatusCode(reqId, &statusCode);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpGetStatusCode() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
app.DebugPrintf("response code = %d\n", statusCode);
|
||||
|
||||
if(statusCode == 200)
|
||||
{
|
||||
ret = sceHttpGetResponseContentLength(reqId, &contentLength);
|
||||
if(ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceHttpGetContentLength() error: 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Content-Length = %lu\n", contentLength);
|
||||
}
|
||||
recvBuf = new SceUChar8[contentLength+1];
|
||||
int bufferLeft = contentLength+1;
|
||||
SceUChar8* pCurrBuffPos = recvBuf;
|
||||
int totalBytesRead = 0;
|
||||
while(finFlag != SCE_TRUE)
|
||||
{
|
||||
ret = sceHttpReadData(reqId, pCurrBuffPos, bufferLeft);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("\n sceHttpReadData() failed 0x%08X\n", ret);
|
||||
return http_get_close(false, tmplId, connId, reqId);
|
||||
}
|
||||
else if (ret == 0)
|
||||
{
|
||||
finFlag = SCE_TRUE;
|
||||
}
|
||||
app.DebugPrintf("\n sceHttpReadData() read %d bytes\n", ret);
|
||||
pCurrBuffPos += ret;
|
||||
totalBytesRead += ret;
|
||||
bufferLeft -= ret;
|
||||
}
|
||||
}
|
||||
|
||||
*ppOutData = recvBuf;
|
||||
*pDataSize = contentLength;
|
||||
return http_get_close(true, tmplId, connId, reqId);
|
||||
}
|
||||
26
Minecraft.Client/PSVita/Network/SonyHttp_Vita.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <libhttp.h>
|
||||
|
||||
class SonyHttp_Vita
|
||||
{
|
||||
static int sslCallback(SceUInt32 verifyErr, SceSslCert * const sslCert[], SceInt32 certNum, void *userArg);
|
||||
static bool http_get(const char *targetUrl, void** ppOutData, int* pDataSize);
|
||||
static bool http_get_close(bool bOK, SceInt32 tmplId, SceInt32 connId, SceInt32 reqId);
|
||||
|
||||
static void printSslError(SceInt32 sslErr, SceUInt32 sslErrDetail);
|
||||
static void printSslCertInfo(SceSslCert *sslCert);
|
||||
|
||||
// static int libnetMemId;
|
||||
static int libsslCtxId;
|
||||
static int libhttpCtxId;
|
||||
|
||||
static bool bInitialised;
|
||||
|
||||
public:
|
||||
bool init();
|
||||
void shutdown();
|
||||
bool getDataFromURL(const char* szURL, void** ppOutData, int* pDataSize);
|
||||
|
||||
static int getHTTPContextID() { return libhttpCtxId; }
|
||||
};
|
||||
398
Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.cpp
Normal file
@@ -0,0 +1,398 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "SonyRemoteStorage_Vita.h"
|
||||
#include "SonyHttp_Vita.h"
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
// #include <cell/sysmodule.h>
|
||||
// #include <cell/http.h>
|
||||
// #include <cell/ssl.h>
|
||||
// #include <netex/net.h>
|
||||
// #include <netex/libnetctl.h>
|
||||
// #include <np.h>
|
||||
// #include <sysutil/sysutil_common.h>
|
||||
// #include <sys/timer.h>
|
||||
// #include <sys/paths.h>
|
||||
// #include <sysutil\sysutil_savedata.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#define AUTH_SCOPE "psn:s2s"
|
||||
#define CLIENT_ID "969e9d21-527c-4c22-b539-f8e479f690bc"
|
||||
static SceRemoteStorageData s_getDataOutput;
|
||||
|
||||
|
||||
void SonyRemoteStorage_Vita::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData)
|
||||
{
|
||||
((SonyRemoteStorage_Vita*)userData)->internalCallback(event, retCode);
|
||||
}
|
||||
|
||||
void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, int32_t retCode)
|
||||
{
|
||||
m_lastErrorCode = retCode;
|
||||
|
||||
switch(event)
|
||||
{
|
||||
case ERROR_OCCURRED:
|
||||
app.DebugPrintf("An error occurred with retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
// shutdown(); // removed, as the remote storage lib now tries to reconnect if an error has occurred
|
||||
runCallback();
|
||||
m_bTransferStarted = false;
|
||||
break;
|
||||
|
||||
case GET_DATA_RESULT:
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Data success \n");
|
||||
m_status = e_getDataSucceeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
}
|
||||
runCallback();
|
||||
m_bTransferStarted = false;
|
||||
break;
|
||||
|
||||
case GET_DATA_PROGRESS:
|
||||
app.DebugPrintf("Get data progress: %i%%\n", retCode);
|
||||
m_status = e_getDataInProgress;
|
||||
m_dataProgress = retCode;
|
||||
m_startTime = System::currentTimeMillis();
|
||||
break;
|
||||
|
||||
case GET_STATUS_RESULT:
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Status success \n");
|
||||
app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs);
|
||||
app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles);
|
||||
for(int i = 0; i < outputGetStatus->numFiles; i++)
|
||||
{
|
||||
app.DebugPrintf("\n*** File %d information: ***\n", (i + 1));
|
||||
app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName);
|
||||
app.DebugPrintf("File description: %s \n", outputGetStatus->data[i].fileDescription);
|
||||
app.DebugPrintf("MD5 Checksum: %s \n", outputGetStatus->data[i].md5Checksum);
|
||||
app.DebugPrintf("Size of the file: %u bytes \n", outputGetStatus->data[i].fileSize);
|
||||
app.DebugPrintf("Timestamp: %s \n", outputGetStatus->data[i].timeStamp);
|
||||
app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write"));
|
||||
}
|
||||
m_status = e_getStatusSucceeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
}
|
||||
runCallback();
|
||||
break;
|
||||
|
||||
case PSN_SIGN_IN_REQUIRED:
|
||||
app.DebugPrintf("User's PSN sign-in through web browser is required \n");
|
||||
m_status = e_signInRequired;
|
||||
runCallback();
|
||||
break;
|
||||
|
||||
case SET_DATA_RESULT:
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Set Data success \n");
|
||||
m_status = e_setDataSucceeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
}
|
||||
runCallback();
|
||||
m_bTransferStarted = false;
|
||||
break;
|
||||
|
||||
case SET_DATA_PROGRESS:
|
||||
app.DebugPrintf("Set data progress: %i%%\n", retCode);
|
||||
m_status = e_setDataInProgress;
|
||||
m_dataProgress = retCode;
|
||||
|
||||
break;
|
||||
|
||||
case USER_ACCOUNT_LINKED:
|
||||
app.DebugPrintf("User's account has been linked with PSN \n");
|
||||
m_bInitialised = true;
|
||||
m_status = e_accountLinked;
|
||||
runCallback();
|
||||
break;
|
||||
|
||||
case WEB_BROWSER_RESULT:
|
||||
app.DebugPrintf("This function is not used on PS Vita, as the account will be linked, it is not needed to open a browser to link it \n");
|
||||
assert(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
app.DebugPrintf("This should never happen \n");
|
||||
assert(0);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool SonyRemoteStorage_Vita::init(CallbackFunc cb, LPVOID lpParam)
|
||||
{
|
||||
int ret = 0;
|
||||
int reqId = 0;
|
||||
|
||||
m_callbackFunc = cb;
|
||||
m_callbackParam = lpParam;
|
||||
m_lastErrorCode = SCE_OK;
|
||||
|
||||
if(m_bInitialised)
|
||||
{
|
||||
internalCallback(USER_ACCOUNT_LINKED, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
ret = sceNpAuthInit();
|
||||
if(ret < 0 && ret != SCE_NP_AUTH_ERROR_ALREADY_INITIALIZED)
|
||||
{
|
||||
app.DebugPrintf("sceNpAuthInit failed 0x%x\n", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = sceNpAuthCreateOAuthRequest();
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("Couldn't create auth request 0x%x\n", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
reqId = ret;
|
||||
|
||||
SceNpClientId clientId;
|
||||
memset(&clientId, 0x0, sizeof(clientId));
|
||||
|
||||
// SceNpAuthorizationCode authCode;
|
||||
// memset(&authCode, 0x0, sizeof(authCode));
|
||||
|
||||
SceNpAuthGetAuthorizationCodeParameter authParams;
|
||||
memset(&authParams, 0x0, sizeof(authParams));
|
||||
|
||||
authParams.size = sizeof(authParams);
|
||||
authParams.pScope = AUTH_SCOPE;
|
||||
|
||||
memcpy(clientId.id, CLIENT_ID, strlen(CLIENT_ID));
|
||||
authParams.pClientId = &clientId;
|
||||
|
||||
int issuerId = 0;
|
||||
// ret = sceNpAuthGetAuthorizationCode(reqId, &authParams, &authCode, &issuerId);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// app.DebugPrintf("Failed to get auth code 0x%x\n", ret);
|
||||
// sceNpAuthDeleteOAuthRequest(reqId);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
ret = sceNpAuthDeleteOAuthRequest(reqId);
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("Couldn't delete auth request 0x%x\n", ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
SceRemoteStorageInitParams params;
|
||||
|
||||
params.callback = SonyRemoteStorage_Vita::staticInternalCallback;
|
||||
params.userData = this;
|
||||
params.thread.threadAffinity = SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT;
|
||||
params.thread.threadPriority = SCE_KERNEL_DEFAULT_PRIORITY_USER;
|
||||
// memcpy(params.authCode, authCode.code, SCE_NP_AUTHORIZATION_CODE_MAX_LEN);
|
||||
strcpy(params.clientId, CLIENT_ID);
|
||||
params.timeout.connectMs = 30 * 1000; //30 seconds is the default
|
||||
params.timeout.resolveMs = 30 * 1000; //30 seconds is the default
|
||||
params.timeout.receiveMs = 120 * 1000; //120 seconds is the default
|
||||
params.timeout.sendMs = 120 * 1000; //120 seconds is the default
|
||||
params.pool.memPoolSize = 7 * 1024 * 1024;
|
||||
if(m_memPoolBuffer == NULL)
|
||||
m_memPoolBuffer = malloc(params.pool.memPoolSize);
|
||||
params.pool.memPoolBuffer = m_memPoolBuffer;
|
||||
|
||||
SceRemoteStorageAbortReqParams abortParams;
|
||||
|
||||
ret = sceRemoteStorageInit(params);
|
||||
if(ret >= 0)
|
||||
{
|
||||
abortParams.requestId = ret;
|
||||
app.DebugPrintf("Session will be created \n");
|
||||
}
|
||||
else if(ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED)
|
||||
{
|
||||
app.DebugPrintf("Session already created \n");
|
||||
runCallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error creating session: 0x%x \n", ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SonyRemoteStorage_Vita::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, LPVOID lpParam)
|
||||
{
|
||||
m_callbackFunc = cb;
|
||||
m_callbackParam = lpParam;
|
||||
outputGetStatus = pInfo;
|
||||
|
||||
SceRemoteStorageStatusReqParams params;
|
||||
reqId = sceRemoteStorageGetStatus(params, outputGetStatus);
|
||||
m_status = e_getStatusInProgress;
|
||||
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Status request sent \n");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void SonyRemoteStorage_Vita::abort()
|
||||
{
|
||||
m_bAborting = true;
|
||||
app.DebugPrintf("Aborting...\n");
|
||||
if(m_bTransferStarted)
|
||||
{
|
||||
app.DebugPrintf("transfer has started so we'll call sceRemoteStorageAbort...\n");
|
||||
|
||||
SceRemoteStorageAbortReqParams params;
|
||||
params.requestId = reqId;
|
||||
int ret = sceRemoteStorageAbort(params);
|
||||
|
||||
if(ret >= 0)
|
||||
{
|
||||
app.DebugPrintf("Abort request done \n");
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error in Abort request: 0x%x \n", ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SonyRemoteStorage_Vita::setDataInternal()
|
||||
{
|
||||
// CompressSaveData(); // check if we need to re-save the file compressed first
|
||||
|
||||
snprintf(m_saveFilename, sizeof(m_saveFilename), "%s:%s/GAMEDATA.bin", "savedata0", m_setDataSaveInfo->UTF8SaveFilename);
|
||||
strcpy(m_saveFileDesc, m_setDataSaveInfo->UTF8SaveTitle);
|
||||
m_status = e_setDataInProgress;
|
||||
|
||||
|
||||
SceRemoteStorageSetDataReqParams params;
|
||||
params.visibility = PUBLIC_READ_WRITE;
|
||||
strcpy(params.pathLocation, m_saveFilename);
|
||||
sprintf(params.fileName, getRemoteSaveFilename());
|
||||
|
||||
DescriptionData descData;
|
||||
ZeroMemory(&descData, sizeof(DescriptionData));
|
||||
descData.m_platform[0] = SAVE_FILE_PLATFORM_LOCAL & 0xff;
|
||||
descData.m_platform[1] = (SAVE_FILE_PLATFORM_LOCAL >> 8) & 0xff;
|
||||
descData.m_platform[2] = (SAVE_FILE_PLATFORM_LOCAL >> 16) & 0xff;
|
||||
descData.m_platform[3] = (SAVE_FILE_PLATFORM_LOCAL >> 24)& 0xff;
|
||||
|
||||
if(m_thumbnailData)
|
||||
{
|
||||
unsigned int uiHostOptions;
|
||||
bool bHostOptionsRead;
|
||||
DWORD uiTexturePack;
|
||||
char seed[22];
|
||||
app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack);
|
||||
|
||||
__int64 iSeed = strtoll(seed,NULL,10);
|
||||
char seedHex[17];
|
||||
sprintf(seedHex,"%016llx",iSeed);
|
||||
memcpy(descData.m_seed,seedHex,16); // Don't copy null
|
||||
|
||||
// Save the host options that this world was last played with
|
||||
char hostOptions[9];
|
||||
sprintf(hostOptions,"%08x",uiHostOptions);
|
||||
memcpy(descData.m_hostOptions,hostOptions,8); // Don't copy null
|
||||
|
||||
// Save the texture pack id
|
||||
char texturePack[9];
|
||||
sprintf(texturePack,"%08x",uiTexturePack);
|
||||
memcpy(descData.m_texturePack,texturePack,8); // Don't copy null
|
||||
}
|
||||
|
||||
memcpy(descData.m_saveNameUTF8, m_saveFileDesc, strlen(m_saveFileDesc)+1); // plus null
|
||||
memcpy(params.fileDescription, &descData, sizeof(descData));
|
||||
|
||||
|
||||
if(m_bAborting)
|
||||
{
|
||||
runCallback();
|
||||
return false;
|
||||
}
|
||||
reqId = sceRemoteStorageSetData(params);
|
||||
|
||||
app.DebugPrintf("\n*******************************\n");
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Set Data request sent \n");
|
||||
m_bTransferStarted = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SonyRemoteStorage_Vita::getData( const char* remotePath, const char* localPath, CallbackFunc cb, LPVOID lpParam )
|
||||
{
|
||||
m_callbackFunc = cb;
|
||||
m_callbackParam = lpParam;
|
||||
|
||||
SceRemoteStorageGetDataReqParams params;
|
||||
sprintf(params.pathLocation, "savedata0:%s/GAMEDATA.bin", localPath);
|
||||
// strcpy(params.pathLocation, localPath);
|
||||
// strcpy(params.fileName, "/test/small.txt");
|
||||
strcpy(params.fileName, remotePath);
|
||||
memset(¶ms.psVitaSaveDataSlot, 0, sizeof(params.psVitaSaveDataSlot));
|
||||
SceRemoteStorageData s_getDataOutput;
|
||||
reqId = sceRemoteStorageGetData(params, &s_getDataOutput);
|
||||
|
||||
app.DebugPrintf("\n*******************************\n");
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Data request sent \n");
|
||||
m_bTransferStarted = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void SonyRemoteStorage_Vita::runCallback()
|
||||
{
|
||||
assert(m_callbackFunc);
|
||||
if(m_callbackFunc)
|
||||
{
|
||||
m_callbackFunc(m_callbackParam, m_status, m_lastErrorCode);
|
||||
}
|
||||
m_lastErrorCode = SCE_OK;
|
||||
}
|
||||
43
Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "Common\Network\Sony\SonyRemoteStorage.h"
|
||||
|
||||
class SonyRemoteStorage_Vita : public SonyRemoteStorage
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
virtual bool init(CallbackFunc cb, LPVOID lpParam);
|
||||
|
||||
virtual bool getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, LPVOID lpParam);
|
||||
virtual bool getData(const char* remotePath, const char* localPath, CallbackFunc cb, LPVOID lpParam);
|
||||
|
||||
virtual void abort();
|
||||
virtual bool setDataInternal();
|
||||
|
||||
private:
|
||||
int reqId;
|
||||
void * psnTicket;
|
||||
size_t psnTicketSize;
|
||||
bool m_waitingForTicket;
|
||||
bool initialized;
|
||||
SceRemoteStorageStatus* outputGetStatus;
|
||||
SceRemoteStorageData outputGetData;
|
||||
|
||||
int32_t m_lastErrorCode;
|
||||
int m_getDataProgress;
|
||||
int m_setDataProgress;
|
||||
char m_saveFilename[SCE_REMOTE_STORAGE_DATA_NAME_MAX_LEN];
|
||||
char m_saveFileDesc[SCE_REMOTE_STORAGE_DATA_DESCRIPTION_MAX_LEN];
|
||||
char m_remoteFilename[SCE_REMOTE_STORAGE_DATA_NAME_MAX_LEN];
|
||||
|
||||
|
||||
static void staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData);
|
||||
void internalCallback(const SceRemoteStorageEvent event, int32_t retCode);
|
||||
|
||||
void runCallback();
|
||||
|
||||
|
||||
};
|
||||
|
||||
1092
Minecraft.Client/PSVita/Network/SonyVoiceChat_Vita.cpp
Normal file
222
Minecraft.Client/PSVita/Network/SonyVoiceChat_Vita.h
Normal file
@@ -0,0 +1,222 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <voice.h>
|
||||
#include "Common/Network/Sony/SQRNetworkPlayer.h"
|
||||
|
||||
static const int sc_maxVoiceDataSize = 2048;
|
||||
|
||||
|
||||
class VoicePacket
|
||||
{
|
||||
static const int MAX_LOCAL_PLAYER_COUNT = 1;
|
||||
|
||||
public:
|
||||
struct Flags
|
||||
{
|
||||
bool m_bTalking : 1;
|
||||
bool m_bHasMicConnected : 1;
|
||||
};
|
||||
|
||||
Flags m_localPlayerFlags[MAX_LOCAL_PLAYER_COUNT];
|
||||
uint32_t m_frameSendIndex;
|
||||
uint32_t m_numFrames;
|
||||
uint32_t m_checkSum;
|
||||
uint32_t m_playerIndexFlags;
|
||||
char m_data[sc_maxVoiceDataSize];
|
||||
|
||||
static int getPacketSize(int dataSize) { return (uint64_t)&((VoicePacket*)0)->m_data[dataSize];}
|
||||
void setChecksum(int dataSize)
|
||||
{
|
||||
m_checkSum = 0;
|
||||
for(int i=0;i<dataSize;i++)
|
||||
m_checkSum += m_data[i];
|
||||
}
|
||||
bool verifyData(int packetSize, int frameSize)
|
||||
{
|
||||
if(m_numFrames == 0)
|
||||
return false;
|
||||
int dataSize = m_numFrames*frameSize;
|
||||
if(packetSize != getPacketSize(dataSize))
|
||||
return false;
|
||||
int checkSum = 0;
|
||||
for(int i=0;i<dataSize;i++)
|
||||
checkSum += m_data[i];
|
||||
if(checkSum != m_checkSum)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// read-write-safe ring buffer implementation: does not use mutex protection
|
||||
// the writer thread changes pointer <buf_free>,
|
||||
// the reader thread changes pointer <buf_full>
|
||||
class RingBuffer
|
||||
{
|
||||
public:
|
||||
RingBuffer(int sizeBytes);
|
||||
~RingBuffer() { delete buffer; }
|
||||
void Reset(void) { buf_full = buf_free = 0; }
|
||||
unsigned int DataSize(void) { return (buf_free - buf_full); }
|
||||
int Write(char* data, int len_);
|
||||
int Read(char* data, int max_bytes_);
|
||||
int getDataSize() { return buf_free - buf_full; }
|
||||
void ResetByWriter(void) { buf_free = buf_full; }
|
||||
void ResetByReader(void) { buf_full = buf_free; }
|
||||
|
||||
private:
|
||||
char* buffer;
|
||||
unsigned int buf_size;
|
||||
unsigned int buf_full;
|
||||
unsigned int buf_free;
|
||||
};
|
||||
|
||||
|
||||
static const int sc_ringBufferSize = 16384;
|
||||
|
||||
class SQRLocalVoiceDevice
|
||||
{
|
||||
public:
|
||||
uint32_t m_headsetPort;
|
||||
uint32_t m_microphonePort;
|
||||
// int32_t m_micAudioDevicePort;
|
||||
uint8_t m_localConnections[4]; // connection between this devices mic and other local player's headsets
|
||||
bool m_bChatRestricted;
|
||||
|
||||
bool m_bValid;
|
||||
|
||||
public:
|
||||
SQRLocalVoiceDevice()
|
||||
: m_headsetPort(SCE_VOICE_INVALID_PORT_ID)
|
||||
, m_microphonePort(SCE_VOICE_INVALID_PORT_ID)
|
||||
, m_bValid(false)
|
||||
// , m_micAudioDevicePort(-1)
|
||||
{
|
||||
for(int i=0;i<4;i++)
|
||||
m_localConnections[i] = 0;
|
||||
}
|
||||
|
||||
void init(bool bChatRestricted);
|
||||
|
||||
void shutdown();
|
||||
bool isValid() { return m_bValid; }
|
||||
// void setBitRate()
|
||||
// {
|
||||
// int err = sceVoiceSetBitRate(uint32_t portId,
|
||||
// SceVoiceBitRate bitrate
|
||||
// );
|
||||
// }
|
||||
};
|
||||
|
||||
#define VOICE_ENCODED_FORMAT SCEVOICE_BITRATE_7300
|
||||
|
||||
|
||||
|
||||
class SQRVoiceConnection
|
||||
{
|
||||
static const int MAX_LOCAL_PLAYER_COUNT = 1;
|
||||
|
||||
static const int SNP_MAX_PAYLOAD = 1346; // This is the default RUDP payload size - if we want to change this we'll need to use cellRudpSetOption to set something else & adjust segment size
|
||||
class QueuedSendBlock
|
||||
{
|
||||
public:
|
||||
unsigned char *start;
|
||||
unsigned char *end;
|
||||
unsigned char *current;
|
||||
};
|
||||
|
||||
std::queue<QueuedSendBlock> m_sendQueue;
|
||||
CRITICAL_SECTION m_csQueue;
|
||||
|
||||
public:
|
||||
int m_rudpCtx;
|
||||
bool m_bConnected;
|
||||
uint32_t m_voiceInPort; // 1 input port per connection, incoming UDP packets are written to each of these, and then they're connected out to all headsets
|
||||
int m_headsetConnectionMask; // 1 bit per player, if the headset connection has been made
|
||||
RingBuffer m_playRingBuffer;
|
||||
SceNpMatching2RoomMemberId m_remoteRoomMemberId; // Assigned by Matching2 lib, we can use to indicate which machine this player belongs to (note - 16 bits)
|
||||
std::queue<VoicePacket> m_receivedVoicePackets;
|
||||
CRITICAL_SECTION m_csPacketQueue;
|
||||
VoicePacket::Flags m_remotePlayerFlags[MAX_LOCAL_PLAYER_COUNT];
|
||||
uint32_t m_nextExpectedFrameIndex;
|
||||
bool m_bFlaggedForShutdown;
|
||||
SQRVoiceConnection(int rudpCtx, SceNpMatching2RoomMemberId remoteRoomMemberId);
|
||||
~SQRVoiceConnection();
|
||||
|
||||
void SendInternal(const void *data, unsigned int dataSize);
|
||||
void SendMoreInternal();
|
||||
void readRemoteData();
|
||||
bool getNextPacket(VoicePacket& packet);
|
||||
void addPacket(VoicePacket& packet);
|
||||
|
||||
|
||||
};
|
||||
|
||||
class SonyVoiceChat_Vita
|
||||
{
|
||||
public:
|
||||
|
||||
static void init();
|
||||
static void start();
|
||||
static void shutdown();
|
||||
static void tick();
|
||||
static void checkFinished();
|
||||
static void setEnabled(bool bEnabled);
|
||||
static bool hasMicConnected(SQRNetworkPlayer* pNetPlayer);
|
||||
static bool isTalking(SQRNetworkPlayer* pNetPlayer);
|
||||
static void mute(bool bMute); //Turn chat audio on or off
|
||||
static void mutePlayer(const SceNpMatching2RoomMemberId member_id, bool bMute); //Turn chat audio from a specified player on or off;
|
||||
static void muteLocalPlayer(bool bMute); //Turn microphone input on or off;
|
||||
|
||||
static bool isMuted();
|
||||
static bool isMutedPlayer(const PlayerUID& memberUID);
|
||||
static bool isMutedLocalPlayer(); //Turn microphone input on or off;
|
||||
|
||||
static void initLocalPlayer(int playerIndex);
|
||||
|
||||
static SQRVoiceConnection* addRemoteConnection(int RudpCxt, SceNpMatching2RoomMemberId peerMemberId);
|
||||
static void connectPlayer(SQRVoiceConnection* pConnection, int playerIndex);
|
||||
static void connectPlayerToAll(int playerIndex);
|
||||
static void disconnectLocalPlayer(int localIdx);
|
||||
static void disconnectRemoteConnection( SQRVoiceConnection* pVoice );
|
||||
|
||||
static void VoiceEventCallback( SceVoiceEventData* pEvent );
|
||||
|
||||
static std::vector<SQRVoiceConnection*> m_remoteConnections;
|
||||
static void connectPorts(uint32_t inPort, uint32_t outPort);
|
||||
static void disconnectPorts(uint32_t inPort, uint32_t outPort);
|
||||
static void makeLocalConnections();
|
||||
static void breakLocalConnections(int playerIdx);
|
||||
|
||||
static void sendAllVoiceData();
|
||||
static void playAllReceivedData();
|
||||
|
||||
static void sendPCMMicData();
|
||||
static SQRVoiceConnection* getVoiceConnectionFromRoomMemberID(SceNpMatching2RoomMemberId roomMemberID);
|
||||
|
||||
static SQRVoiceConnection* GetVoiceConnectionFromRudpCtx(int RudpCtx);
|
||||
static void setConnected(int RudpCtx);
|
||||
|
||||
private:
|
||||
|
||||
static const int MAX_LOCAL_PLAYER_COUNT = 1;
|
||||
|
||||
static bool m_bVoiceStarted;
|
||||
static int m_numLocalDevicesConnected;
|
||||
static SQRLocalVoiceDevice m_localVoiceDevices[MAX_LOCAL_PLAYER_COUNT];
|
||||
|
||||
static uint32_t m_voiceOutPort; // single output port that all local devices are mixed to, and then sent out to all other remote machines
|
||||
|
||||
static RingBuffer m_recordRingBuffer;
|
||||
static RingBuffer m_playRingBuffer;
|
||||
static VoicePacket::Flags m_localPlayerFlags[MAX_LOCAL_PLAYER_COUNT];
|
||||
static bool m_forceSendPacket; // force a packet across the network, even if there's no data, so we can update flags
|
||||
static bool m_bInitialised;
|
||||
static CRITICAL_SECTION m_csRemoteConnections;
|
||||
|
||||
|
||||
};
|
||||
84
Minecraft.Client/PSVita/PSVitaExtras/Conf.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* SCE CONFIDENTIAL
|
||||
* Copyright (C) 2014 Sony Computer Entertainment Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SCE_NP_CONF_H__
|
||||
#define __SCE_NP_CONF_H__
|
||||
|
||||
#include <np.h>
|
||||
|
||||
static const SceNpCommunicationId s_npCommunicationId = {
|
||||
{'N', 'P', 'W', 'R', '0', '6', '8', '5', '9'},
|
||||
'\0',
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
/***
|
||||
SceNpCommunicationPassphrase
|
||||
|
||||
8129251a703ff265e6d2b777bcf1854d3c6ea7f656626170131163c6e8edcb4110dd6247d40e1d8d06ebdbb610f8046c85332bc4de7946da49635459628a0d13243a6cda7ae3462a4d65d20cb2839b2e311dd7ff5006ec1379c37d3b49f137e2981050601ba4efa2ccc445c1cfc0fbd6b2f075f19490830cb995a6ad779de1d8
|
||||
***/
|
||||
|
||||
static const SceNpCommunicationPassphrase s_npCommunicationPassphrase = {
|
||||
{
|
||||
0x81,0x29,0x25,0x1a,0x70,0x3f,0xf2,0x65,
|
||||
0xe6,0xd2,0xb7,0x77,0xbc,0xf1,0x85,0x4d,
|
||||
0x3c,0x6e,0xa7,0xf6,0x56,0x62,0x61,0x70,
|
||||
0x13,0x11,0x63,0xc6,0xe8,0xed,0xcb,0x41,
|
||||
0x10,0xdd,0x62,0x47,0xd4,0x0e,0x1d,0x8d,
|
||||
0x06,0xeb,0xdb,0xb6,0x10,0xf8,0x04,0x6c,
|
||||
0x85,0x33,0x2b,0xc4,0xde,0x79,0x46,0xda,
|
||||
0x49,0x63,0x54,0x59,0x62,0x8a,0x0d,0x13,
|
||||
0x24,0x3a,0x6c,0xda,0x7a,0xe3,0x46,0x2a,
|
||||
0x4d,0x65,0xd2,0x0c,0xb2,0x83,0x9b,0x2e,
|
||||
0x31,0x1d,0xd7,0xff,0x50,0x06,0xec,0x13,
|
||||
0x79,0xc3,0x7d,0x3b,0x49,0xf1,0x37,0xe2,
|
||||
0x98,0x10,0x50,0x60,0x1b,0xa4,0xef,0xa2,
|
||||
0xcc,0xc4,0x45,0xc1,0xcf,0xc0,0xfb,0xd6,
|
||||
0xb2,0xf0,0x75,0xf1,0x94,0x90,0x83,0x0c,
|
||||
0xb9,0x95,0xa6,0xad,0x77,0x9d,0xe1,0xd8
|
||||
}
|
||||
};
|
||||
|
||||
/***
|
||||
SceNpCommunicationSignature
|
||||
|
||||
b9dde13b01000000000000005c66a0cfc0c22c63dc050021c2e3537360ca40370ff68a60596b1fc84364cebe3459359579ca2ef8c151fc920ee4cf25eb4a926c572891b840eafa35ebfb5d67744b8f8bbd7cd53245ec12a639423a2eb520e8c381c5afa3095727c3ca1612351ed9921940b779dfbcf84b72b5978c5c07fadf11fe8f5a33c41405dea8d59673f1eedbda420cf48618c895c9d4271154d7c9e952
|
||||
***/
|
||||
|
||||
static const SceNpCommunicationSignature s_npCommunicationSignature = {
|
||||
{
|
||||
0xb9,0xdd,0xe1,0x3b,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x5c,0x66,0xa0,0xcf,
|
||||
0xc0,0xc2,0x2c,0x63,0xdc,0x05,0x00,0x21,
|
||||
0xc2,0xe3,0x53,0x73,0x60,0xca,0x40,0x37,
|
||||
0x0f,0xf6,0x8a,0x60,0x59,0x6b,0x1f,0xc8,
|
||||
0x43,0x64,0xce,0xbe,0x34,0x59,0x35,0x95,
|
||||
0x79,0xca,0x2e,0xf8,0xc1,0x51,0xfc,0x92,
|
||||
0x0e,0xe4,0xcf,0x25,0xeb,0x4a,0x92,0x6c,
|
||||
0x57,0x28,0x91,0xb8,0x40,0xea,0xfa,0x35,
|
||||
0xeb,0xfb,0x5d,0x67,0x74,0x4b,0x8f,0x8b,
|
||||
0xbd,0x7c,0xd5,0x32,0x45,0xec,0x12,0xa6,
|
||||
0x39,0x42,0x3a,0x2e,0xb5,0x20,0xe8,0xc3,
|
||||
0x81,0xc5,0xaf,0xa3,0x09,0x57,0x27,0xc3,
|
||||
0xca,0x16,0x12,0x35,0x1e,0xd9,0x92,0x19,
|
||||
0x40,0xb7,0x79,0xdf,0xbc,0xf8,0x4b,0x72,
|
||||
0xb5,0x97,0x8c,0x5c,0x07,0xfa,0xdf,0x11,
|
||||
0xfe,0x8f,0x5a,0x33,0xc4,0x14,0x05,0xde,
|
||||
0xa8,0xd5,0x96,0x73,0xf1,0xee,0xdb,0xda,
|
||||
0x42,0x0c,0xf4,0x86,0x18,0xc8,0x95,0xc9,
|
||||
0xd4,0x27,0x11,0x54,0xd7,0xc9,0xe9,0x52
|
||||
}
|
||||
};
|
||||
|
||||
static const SceNpCommunicationConfig s_npCommunicationConfig =
|
||||
{
|
||||
&s_npCommunicationId,
|
||||
&s_npCommunicationPassphrase,
|
||||
&s_npCommunicationSignature
|
||||
};
|
||||
|
||||
#endif /* __SCE_NP_CONF_H__ */
|
||||
132
Minecraft.Client/PSVita/PSVitaExtras/CustomMap.cpp
Normal file
@@ -0,0 +1,132 @@
|
||||
#include "stdafx.h"
|
||||
#include "CustomMap.h"
|
||||
|
||||
|
||||
CustomMap::CustomMap()
|
||||
{
|
||||
m_NodePool = NULL;
|
||||
m_NodePoolSize = 0;
|
||||
m_NodePoolIndex = 0;
|
||||
|
||||
m_HashSize = 1024;
|
||||
m_HashTable = (SCustomMapNode**) malloc(m_HashSize * sizeof(SCustomMapNode));
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
CustomMap::~CustomMap()
|
||||
{
|
||||
for( int i = 0;i < m_NodePoolSize; i += 1 )
|
||||
{
|
||||
free(m_NodePool[i]);
|
||||
}
|
||||
free(m_NodePool);
|
||||
|
||||
free(m_HashTable);
|
||||
}
|
||||
|
||||
void CustomMap::clear()
|
||||
{
|
||||
// reset the pool index
|
||||
m_NodePoolIndex = 0;
|
||||
|
||||
// clear the hash table
|
||||
memset(m_HashTable, 0, m_HashSize * sizeof(SCustomMapNode));
|
||||
}
|
||||
|
||||
SCustomMapNode* CustomMap::find(const ChunkPos &Key)
|
||||
{
|
||||
unsigned int Hash = (Key.x & 0x00000001f) | (Key.z << 5); // hopefully this will produce a good hash for a 1024 entry table
|
||||
unsigned int Index = Hash & (m_HashSize-1);
|
||||
|
||||
SCustomMapNode* Node = m_HashTable[Index];
|
||||
while( Node && Node->Hash != Hash )
|
||||
{
|
||||
Node = Node->Next;
|
||||
}
|
||||
|
||||
return Node;
|
||||
}
|
||||
|
||||
int CustomMap::end()
|
||||
{
|
||||
return m_NodePoolIndex;
|
||||
}
|
||||
|
||||
SCustomMapNode* CustomMap::get(int index)
|
||||
{
|
||||
return m_NodePool[index];
|
||||
}
|
||||
|
||||
void CustomMap::insert(const ChunkPos &Key, bool Value)
|
||||
{
|
||||
// see if this key already exists
|
||||
SCustomMapNode* Node = find(Key);
|
||||
|
||||
if( !Node )
|
||||
{
|
||||
// do we have any space in the pool
|
||||
if( m_NodePoolIndex >= m_NodePoolSize )
|
||||
{
|
||||
resize();
|
||||
}
|
||||
|
||||
// grab the next node from the pool
|
||||
Node = m_NodePool[m_NodePoolIndex];
|
||||
m_NodePoolIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Node->second = Value;
|
||||
return;
|
||||
}
|
||||
|
||||
// create the new node;
|
||||
unsigned int Hash = (Key.x & 0x00000001f) | (Key.z << 5); // hopefully this will produce a good hash for a 1024 entry table
|
||||
unsigned int Index = Hash & (m_HashSize-1);
|
||||
Node->Hash = Hash;
|
||||
Node->first = Key;
|
||||
Node->second = Value;
|
||||
Node->Next = NULL;
|
||||
|
||||
// are any nodes in this hash index
|
||||
if( !m_HashTable[Index] )
|
||||
{
|
||||
m_HashTable[Index] = Node;
|
||||
}
|
||||
else
|
||||
{
|
||||
// loop to the last node in the hash list
|
||||
SCustomMapNode* OldNode = m_HashTable[Index];
|
||||
while( OldNode->Next )
|
||||
{
|
||||
OldNode = OldNode->Next;
|
||||
}
|
||||
|
||||
// link the old last node to the new one
|
||||
OldNode->Next = Node;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomMap::resize()
|
||||
{
|
||||
int OldPoolSize = m_NodePoolSize;
|
||||
m_NodePoolSize += 512;
|
||||
SCustomMapNode **NodePool;
|
||||
if( m_NodePool )
|
||||
{
|
||||
NodePool = (SCustomMapNode**) realloc(m_NodePool, m_NodePoolSize * sizeof(SCustomMapNode));
|
||||
}
|
||||
else
|
||||
{
|
||||
NodePool = (SCustomMapNode**) malloc(m_NodePoolSize * sizeof(SCustomMapNode));
|
||||
}
|
||||
|
||||
for( int i = 0;i < m_NodePoolSize - OldPoolSize;i += 1 )
|
||||
{
|
||||
NodePool[i + OldPoolSize] = (SCustomMapNode*) malloc(sizeof(SCustomMapNode));
|
||||
}
|
||||
|
||||
m_NodePool = NodePool;
|
||||
}
|
||||
|
||||
43
Minecraft.Client/PSVita/PSVitaExtras/CustomMap.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef CustomMap_H
|
||||
#define CustomMap_H
|
||||
// AP - This replaces the std::unordered_map used in MobSpawner.h
|
||||
// The problem with the original system is that it calls malloc for every insert it does. Not only is that expensive in itself but it also
|
||||
// clashes with any other mallocs on other threads (specifically the large amount of mallocing being done in Level.h for the std::unordered_set)
|
||||
// causing huge stalls.
|
||||
// This isn't really a univeral replacement for std::unordered_map and is quite specific to MobSpawner.h
|
||||
|
||||
#include "../../../Minecraft.World/ChunkPos.h"
|
||||
|
||||
typedef struct SCustomMapNode
|
||||
{
|
||||
unsigned int Hash;
|
||||
ChunkPos first;
|
||||
bool second;
|
||||
struct SCustomMapNode *Next;
|
||||
} SCustomMapNode;
|
||||
|
||||
class CustomMap
|
||||
{
|
||||
private:
|
||||
SCustomMapNode **m_NodePool;
|
||||
int m_NodePoolSize;
|
||||
int m_NodePoolIndex;
|
||||
|
||||
int m_HashSize;
|
||||
SCustomMapNode **m_HashTable;
|
||||
|
||||
public:
|
||||
CustomMap();
|
||||
~CustomMap();
|
||||
|
||||
void clear();
|
||||
SCustomMapNode* find(const ChunkPos &Key);
|
||||
int end();
|
||||
SCustomMapNode* get(int index);
|
||||
void insert(const ChunkPos &Key, bool Value);
|
||||
|
||||
private:
|
||||
void resize();
|
||||
};
|
||||
|
||||
#endif // CustomMap_H
|
||||