mirror of
https://github.com/Patoke/LCERenewed.git
synced 2026-10-16 01:14:48 +00:00
feat: init
This commit is contained in:
commit
25809b8455
18807 files changed
+3944357
No files matched your search
@@ -0,0 +1,137 @@
|
||||
#pragma once
|
||||
|
||||
#define MAP_STYLE_0 0
|
||||
#define MAP_STYLE_1 1
|
||||
#define MAP_STYLE_2 2
|
||||
|
||||
#define _360_JOY_BUTTON_A 0x00000001
|
||||
#define _360_JOY_BUTTON_B 0x00000002
|
||||
#define _360_JOY_BUTTON_X 0x00000004
|
||||
#define _360_JOY_BUTTON_Y 0x00000008
|
||||
|
||||
#define _360_JOY_BUTTON_START 0x00000010
|
||||
#define _360_JOY_BUTTON_BACK 0x00000020
|
||||
#define _360_JOY_BUTTON_RB 0x00000040
|
||||
#define _360_JOY_BUTTON_LB 0x00000080
|
||||
|
||||
#define _360_JOY_BUTTON_RTHUMB 0x00000100
|
||||
#define _360_JOY_BUTTON_LTHUMB 0x00000200
|
||||
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
|
||||
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
|
||||
|
||||
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
|
||||
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
|
||||
// fake digital versions of analog values
|
||||
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
|
||||
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
|
||||
|
||||
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
|
||||
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
|
||||
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
|
||||
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
|
||||
|
||||
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
|
||||
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
|
||||
#define _360_JOY_BUTTON_RT 0x00400000
|
||||
#define _360_JOY_BUTTON_LT 0x00800000
|
||||
|
||||
// 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);
|
||||
|
||||
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
||||
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
|
||||
void SetMenuDisplayed(int iPad, bool bVal);
|
||||
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
|
||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, 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 InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JInput InputManager;
|
||||
@@ -0,0 +1,128 @@
|
||||
#pragma once
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
|
||||
|
||||
class C_4JProfile
|
||||
{
|
||||
public:
|
||||
struct PROFILESETTINGS
|
||||
{
|
||||
int iYAxisInversion;
|
||||
int iControllerSensitivity;
|
||||
int iVibration;
|
||||
bool bSwapSticks;
|
||||
};
|
||||
|
||||
|
||||
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated
|
||||
void Initialise( DWORD dwTitleID,
|
||||
DWORD dwOfferID,
|
||||
unsigned short usProfileVersion,
|
||||
UINT uiProfileValuesC,
|
||||
UINT uiProfileSettingsC,
|
||||
DWORD *pdwProfileSettingsA,
|
||||
int iGameDefinedDataSizeX4,
|
||||
unsigned int *puiGameDefinedDataChangedBitmask);
|
||||
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
||||
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
||||
int GetLockedProfile();
|
||||
void SetLockedProfile(int iProf);
|
||||
bool IsSignedIn(int iQuadrant);
|
||||
bool IsSignedInLive(int iProf);
|
||||
bool IsGuest(int iQuadrant);
|
||||
UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
void SetPrimaryPlayerChanged(bool bVal);
|
||||
bool QuerySigninStatus(void);
|
||||
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
||||
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
||||
BOOL XUIDIsGuest(PlayerUID xuid);
|
||||
bool AllowedToPlayMultiplayer(int iProf);
|
||||
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
||||
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 ShowProfileCard(int iPad, PlayerUID targetUid);
|
||||
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 SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
bool RegionIsNorthAmerica(void);
|
||||
bool LocaleIsUSorCanada(void);
|
||||
HRESULT GetLiveConnectionStatus();
|
||||
bool IsSystemUIDisplayed();
|
||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
||||
|
||||
|
||||
// PROFILE DATA
|
||||
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
|
||||
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
|
||||
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
||||
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
||||
void *GetGameDefinedProfileData(int iQuadrant);
|
||||
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
||||
void Tick( void );
|
||||
|
||||
// ACHIEVEMENTS & AWARDS
|
||||
|
||||
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
||||
CXuiStringTable*pStringTable=NULL, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=NULL, unsigned int uiThemeSize=0L);
|
||||
int GetAwardId(int iAwardNumber);
|
||||
eAwardType GetAwardType(int iAwardNumber);
|
||||
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
|
||||
void Award(int iQuadrant, int iAwardNumber, bool bForce=false);
|
||||
bool IsAwardsFlagSet(int iQuadrant, int iAward);
|
||||
|
||||
// RICH PRESENCE
|
||||
|
||||
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
||||
void RegisterRichPresenceContext(int iGameConfigContextID);
|
||||
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
|
||||
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
||||
|
||||
// PURCHASE
|
||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
||||
void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam);
|
||||
|
||||
// Debug
|
||||
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
||||
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JProfile ProfileManager;
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
#pragma once
|
||||
|
||||
class ImageFileBuffer
|
||||
{
|
||||
public:
|
||||
enum EImageType
|
||||
{
|
||||
e_typePNG,
|
||||
e_typeJPG
|
||||
};
|
||||
|
||||
EImageType m_type;
|
||||
void* m_pBuffer;
|
||||
int m_bufferSize;
|
||||
|
||||
int GetType() { return m_type; }
|
||||
void *GetBufferPointer() { return m_pBuffer; }
|
||||
int GetBufferSize() { return m_bufferSize; }
|
||||
void Release() { free(m_pBuffer); m_pBuffer = NULL; }
|
||||
bool Allocated() { return m_pBuffer != NULL; }
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int Width;
|
||||
int Height;
|
||||
}D3DXIMAGE_INFO;
|
||||
|
||||
typedef struct _XSOCIAL_PREVIEWIMAGE {
|
||||
BYTE *pBytes;
|
||||
DWORD Pitch;
|
||||
DWORD Width;
|
||||
DWORD Height;
|
||||
// D3DFORMAT Format;
|
||||
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
|
||||
|
||||
class C4JRender
|
||||
{
|
||||
public:
|
||||
void Tick();
|
||||
void UpdateGamma(unsigned short usGamma);
|
||||
|
||||
// Matrix stack
|
||||
void MatrixMode(int type);
|
||||
void MatrixSetIdentity();
|
||||
void MatrixTranslate(float x,float y,float z);
|
||||
void MatrixRotate(float angle, float x, float y, float z);
|
||||
void MatrixScale(float x, float y, float z);
|
||||
void MatrixPerspective(float fovy, float aspect, float zNear, float zFar);
|
||||
void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar);
|
||||
void MatrixPop();
|
||||
void MatrixPush();
|
||||
void MatrixMult(float *mat);
|
||||
const float *MatrixGet(int type);
|
||||
void Set_matrixDirty();
|
||||
|
||||
// Core
|
||||
void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
|
||||
void InitialiseContext();
|
||||
void StartFrame();
|
||||
void DoScreenGrabOnNextPresent();
|
||||
void Present();
|
||||
void Clear(int flags, D3D11_RECT *pRect = NULL);
|
||||
void SetClearColour(const float colourRGBA[4]);
|
||||
bool IsWidescreen();
|
||||
bool IsHiDef();
|
||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||
void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut);
|
||||
void BeginConditionalSurvey(int identifier);
|
||||
void EndConditionalSurvey();
|
||||
void BeginConditionalRendering(int identifier);
|
||||
void EndConditionalRendering();
|
||||
|
||||
// Vertex data handling
|
||||
typedef enum
|
||||
{
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD
|
||||
VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied,
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen
|
||||
VERTEX_TYPE_COUNT
|
||||
} eVertexType;
|
||||
|
||||
// Pixel shader
|
||||
typedef enum
|
||||
{
|
||||
PIXEL_SHADER_TYPE_STANDARD,
|
||||
PIXEL_SHADER_TYPE_STANDARD2,
|
||||
PIXEL_SHADER_TYPE_STANDARD3,
|
||||
PIXEL_SHADER_TYPE_STANDARD4,
|
||||
PIXEL_SHADER_TYPE_PROJECTION,
|
||||
PIXEL_SHADER_TYPE_FORCELOD,
|
||||
PIXEL_SHADER_COUNT
|
||||
} ePixelShaderType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VIEWPORT_TYPE_FULLSCREEN,
|
||||
VIEWPORT_TYPE_SPLIT_TOP,
|
||||
VIEWPORT_TYPE_SPLIT_BOTTOM,
|
||||
VIEWPORT_TYPE_SPLIT_LEFT,
|
||||
VIEWPORT_TYPE_SPLIT_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
|
||||
} eViewportType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PRIMITIVE_TYPE_TRIANGLE_LIST,
|
||||
PRIMITIVE_TYPE_TRIANGLE_STRIP,
|
||||
PRIMITIVE_TYPE_TRIANGLE_FAN,
|
||||
PRIMITIVE_TYPE_QUAD_LIST,
|
||||
PRIMITIVE_TYPE_LINE_LIST,
|
||||
PRIMITIVE_TYPE_LINE_STRIP,
|
||||
PRIMITIVE_TYPE_COUNT
|
||||
} ePrimitiveType;
|
||||
|
||||
void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
|
||||
// Command buffers
|
||||
void CBuffLockStaticCreations();
|
||||
int CBuffCreate(int count);
|
||||
void CBuffDelete(int first, int count);
|
||||
void CBuffStart(int index, bool full = false);
|
||||
void CBuffClear(int index);
|
||||
int CBuffSize(int index);
|
||||
void CBuffEnd();
|
||||
bool CBuffCall(int index, bool full = true);
|
||||
void CBuffTick();
|
||||
void CBuffDeferredModeStart();
|
||||
void CBuffDeferredModeEnd();
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component
|
||||
/* Don't think these are all directly available on D3D 11 - leaving for now
|
||||
TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0
|
||||
TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1
|
||||
TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels
|
||||
*/
|
||||
MAX_TEXTURE_FORMATS
|
||||
} eTextureFormat;
|
||||
|
||||
// Textures
|
||||
int TextureCreate();
|
||||
void TextureFree(int idx);
|
||||
void TextureBind(int idx);
|
||||
void TextureBind(int layer, int idx);
|
||||
void TextureBindVertex(int idx);
|
||||
void TextureSetTextureLevels(int levels);
|
||||
int TextureGetTextureLevels();
|
||||
void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw);
|
||||
void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level);
|
||||
void TextureSetParam(int param, int value);
|
||||
void TextureDynamicUpdateStart();
|
||||
void TextureDynamicUpdateEnd();
|
||||
HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut);
|
||||
HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn);
|
||||
void TextureGetStats();
|
||||
ID3D11ShaderResourceView *TextureGetTexture(int idx);
|
||||
|
||||
// State control
|
||||
void StateSetColour(float r, float g, float b, float a);
|
||||
void StateSetDepthMask(bool enable);
|
||||
void StateSetBlendEnable(bool enable);
|
||||
void StateSetBlendFunc(int src, int dst);
|
||||
void StateSetBlendFactor(unsigned int colour);
|
||||
void StateSetAlphaFunc(int func, float param);
|
||||
void StateSetDepthFunc(int func);
|
||||
void StateSetFaceCull(bool enable);
|
||||
void StateSetFaceCullCW(bool enable);
|
||||
void StateSetLineWidth(float width);
|
||||
void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha);
|
||||
void StateSetDepthTestEnable(bool enable);
|
||||
void StateSetAlphaTestEnable(bool enable);
|
||||
void StateSetDepthSlopeAndBias(float slope, float bias);
|
||||
void StateSetFogEnable(bool enable);
|
||||
void StateSetFogMode(int mode);
|
||||
void StateSetFogNearDistance(float dist);
|
||||
void StateSetFogFarDistance(float dist);
|
||||
void StateSetFogDensity(float density);
|
||||
void StateSetFogColour(float red, float green, float blue);
|
||||
void StateSetLightingEnable(bool enable);
|
||||
void StateSetVertexTextureUV( float u, float v);
|
||||
void StateSetLightColour(int light, float red, float green, float blue);
|
||||
void StateSetLightAmbientColour(float red, float green, float blue);
|
||||
void StateSetLightDirection(int light, float x, float y, float z);
|
||||
void StateSetLightEnable(int light, bool enable);
|
||||
void StateSetViewport(eViewportType viewportType);
|
||||
void StateSetEnableViewportClipPlanes(bool enable);
|
||||
void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace);
|
||||
void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
|
||||
void StateSetForceLOD(int LOD);
|
||||
|
||||
// Event tracking
|
||||
void BeginEvent(LPCWSTR eventName);
|
||||
void EndEvent();
|
||||
|
||||
// PLM event handling
|
||||
void Suspend();
|
||||
bool Suspended();
|
||||
void Resume();
|
||||
};
|
||||
|
||||
|
||||
const int GL_MODELVIEW_MATRIX = 0;
|
||||
const int GL_PROJECTION_MATRIX = 1;
|
||||
const int GL_MODELVIEW = 0;
|
||||
const int GL_PROJECTION = 1;
|
||||
const int GL_TEXTURE = 2;
|
||||
|
||||
// These things required for tex gen
|
||||
|
||||
const int GL_S = 0;
|
||||
const int GL_T = 1;
|
||||
const int GL_R = 2;
|
||||
const int GL_Q = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_S = 0;
|
||||
const int GL_TEXTURE_GEN_T = 1;
|
||||
const int GL_TEXTURE_GEN_Q = 2;
|
||||
const int GL_TEXTURE_GEN_R = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_MODE = 0;
|
||||
const int GL_OBJECT_LINEAR = 0;
|
||||
const int GL_EYE_LINEAR = 1;
|
||||
const int GL_OBJECT_PLANE = 0;
|
||||
const int GL_EYE_PLANE = 1;
|
||||
|
||||
|
||||
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
|
||||
const int GL_TEXTURE_2D = 1;
|
||||
const int GL_BLEND = 2;
|
||||
const int GL_CULL_FACE = 3;
|
||||
const int GL_ALPHA_TEST = 4;
|
||||
const int GL_DEPTH_TEST = 5;
|
||||
const int GL_FOG = 6;
|
||||
const int GL_LIGHTING = 7;
|
||||
const int GL_LIGHT0 = 8;
|
||||
const int GL_LIGHT1 = 9;
|
||||
|
||||
const int CLEAR_DEPTH_FLAG = 1;
|
||||
const int CLEAR_COLOUR_FLAG = 2;
|
||||
|
||||
const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG;
|
||||
const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG;
|
||||
|
||||
const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA;
|
||||
const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA;
|
||||
const int GL_ONE = D3D11_BLEND_ONE;
|
||||
const int GL_ZERO = D3D11_BLEND_ZERO;
|
||||
const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA;
|
||||
const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR;
|
||||
const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR;
|
||||
const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR;
|
||||
const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR;
|
||||
|
||||
const int GL_GREATER = D3D11_COMPARISON_GREATER;
|
||||
const int GL_EQUAL = D3D11_COMPARISON_EQUAL;
|
||||
const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL;
|
||||
const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL;
|
||||
const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS;
|
||||
|
||||
const int GL_TEXTURE_MIN_FILTER = 1;
|
||||
const int GL_TEXTURE_MAG_FILTER = 2;
|
||||
const int GL_TEXTURE_WRAP_S = 3;
|
||||
const int GL_TEXTURE_WRAP_T = 4;
|
||||
|
||||
const int GL_NEAREST = 0;
|
||||
const int GL_LINEAR = 1;
|
||||
const int GL_EXP = 2;
|
||||
const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this
|
||||
|
||||
const int GL_CLAMP = 0;
|
||||
const int GL_REPEAT = 1;
|
||||
|
||||
const int GL_FOG_START = 1;
|
||||
const int GL_FOG_END = 2;
|
||||
const int GL_FOG_MODE = 3;
|
||||
const int GL_FOG_DENSITY = 4;
|
||||
const int GL_FOG_COLOR = 5;
|
||||
|
||||
const int GL_POSITION = 1;
|
||||
const int GL_AMBIENT = 2;
|
||||
const int GL_DIFFUSE = 3;
|
||||
const int GL_SPECULAR = 4;
|
||||
|
||||
const int GL_LIGHT_MODEL_AMBIENT = 1;
|
||||
|
||||
const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST;
|
||||
const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP;
|
||||
const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST;
|
||||
const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN;
|
||||
const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP;
|
||||
|
||||
// Singleton
|
||||
extern C4JRender RenderManager;
|
||||
@@ -0,0 +1,344 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
//#include <xtms.h>
|
||||
class C4JStringTable;
|
||||
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
time_t modifiedTime;
|
||||
unsigned int dataSize;
|
||||
unsigned int thumbnailSize;
|
||||
}
|
||||
CONTAINER_METADATA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
CONTAINER_METADATA metaData;
|
||||
PBYTE thumbnailData;
|
||||
}
|
||||
SAVE_INFO,*PSAVE_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iSaveC;
|
||||
PSAVE_INFO SaveInfoA;
|
||||
}
|
||||
SAVE_DETAILS,*PSAVE_DETAILS;
|
||||
|
||||
typedef std::vector <PXMARKETPLACE_CONTENTOFFER_INFO> OfferDataArray;
|
||||
typedef std::vector <PXCONTENT_DATA> XContentDataArray;
|
||||
//typedef std::vector <PSAVE_DETAILS> SaveDetailsArray;
|
||||
|
||||
// Current version of the dlc data creator
|
||||
#define CURRENT_DLC_VERSION_NUM 3
|
||||
|
||||
class C4JStorage
|
||||
{
|
||||
|
||||
public:
|
||||
// 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
|
||||
{
|
||||
WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
||||
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
||||
DWORD dwImageOffset;
|
||||
DWORD dwImageBytes;
|
||||
}
|
||||
CACHEINFOSTRUCT;
|
||||
|
||||
// structure to hold DLC info in TMS
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwVersion;
|
||||
DWORD dwNewOffers;
|
||||
DWORD dwTotalOffers;
|
||||
DWORD dwInstalledTotalOffers;
|
||||
BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion
|
||||
}
|
||||
DLC_TMS_DETAILS;
|
||||
|
||||
enum eGTS_FileTypes
|
||||
{
|
||||
eGTS_Type_Skin=0,
|
||||
eGTS_Type_Cape,
|
||||
eGTS_Type_MAX
|
||||
};
|
||||
|
||||
enum eGlobalStorage
|
||||
{
|
||||
//eGlobalStorage_GameClip=0,
|
||||
eGlobalStorage_Title=0,
|
||||
eGlobalStorage_TitleUser,
|
||||
eGlobalStorage_Max
|
||||
};
|
||||
|
||||
enum EMessageResult
|
||||
{
|
||||
EMessage_Undefined=0,
|
||||
EMessage_Busy,
|
||||
EMessage_Pending,
|
||||
EMessage_Cancelled,
|
||||
EMessage_ResultAccept,
|
||||
EMessage_ResultDecline,
|
||||
EMessage_ResultThirdOption,
|
||||
EMessage_ResultFourthOption
|
||||
};
|
||||
|
||||
enum ESaveGameControlState
|
||||
{
|
||||
ESaveGameControl_Idle=0,
|
||||
ESaveGameControl_Save,
|
||||
ESaveGameControl_InternalRequestingDevice,
|
||||
ESaveGameControl_InternalGetSaveName,
|
||||
ESaveGameControl_InternalSaving,
|
||||
ESaveGameControl_CopySave,
|
||||
ESaveGameControl_CopyingSave,
|
||||
};
|
||||
|
||||
enum ESaveGameState
|
||||
{
|
||||
ESaveGame_Idle=0,
|
||||
ESaveGame_Save,
|
||||
ESaveGame_InternalRequestingDevice,
|
||||
ESaveGame_InternalGetSaveName,
|
||||
ESaveGame_InternalSaving,
|
||||
ESaveGame_CopySave,
|
||||
ESaveGame_CopyingSave,
|
||||
ESaveGame_Load,
|
||||
ESaveGame_GetSavesInfo,
|
||||
ESaveGame_Rename,
|
||||
ESaveGame_Delete,
|
||||
|
||||
ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail
|
||||
|
||||
};
|
||||
enum ELoadGameStatus
|
||||
{
|
||||
ELoadGame_Idle=0,
|
||||
ELoadGame_InProgress,
|
||||
ELoadGame_NoSaves,
|
||||
ELoadGame_ChangedDevice,
|
||||
ELoadGame_DeviceRemoved
|
||||
};
|
||||
|
||||
enum EDeleteGameStatus
|
||||
{
|
||||
EDeleteGame_Idle=0,
|
||||
EDeleteGame_InProgress,
|
||||
};
|
||||
|
||||
|
||||
enum ESGIStatus
|
||||
{
|
||||
ESGIStatus_Error=0,
|
||||
ESGIStatus_Idle,
|
||||
ESGIStatus_ReadInProgress,
|
||||
ESGIStatus_NoSaves,
|
||||
};
|
||||
|
||||
enum EDLCStatus
|
||||
{
|
||||
EDLC_Error=0,
|
||||
EDLC_Idle,
|
||||
EDLC_NoOffers,
|
||||
EDLC_AlreadyEnumeratedAllOffers,
|
||||
EDLC_NoInstalledDLC,
|
||||
EDLC_Pending,
|
||||
EDLC_LoadInProgress,
|
||||
EDLC_Loaded,
|
||||
EDLC_ChangedDevice
|
||||
};
|
||||
|
||||
enum ESavingMessage
|
||||
{
|
||||
ESavingMessage_None=0,
|
||||
ESavingMessage_Short,
|
||||
ESavingMessage_Long
|
||||
};
|
||||
|
||||
enum ETMSStatus
|
||||
{
|
||||
ETMSStatus_Idle=0,
|
||||
ETMSStatus_Fail,
|
||||
ETMSStatus_Fail_ReadInProgress,
|
||||
ETMSStatus_Fail_WriteInProgress,
|
||||
ETMSStatus_Pending,
|
||||
};
|
||||
|
||||
enum eTMS_FileType
|
||||
{
|
||||
eTMS_FileType_Normal=0,
|
||||
eTMS_FileType_Graphic,
|
||||
};
|
||||
|
||||
enum eTMS_FILETYPEVAL
|
||||
{
|
||||
TMS_FILETYPE_BINARY,
|
||||
TMS_FILETYPE_CONFIG,
|
||||
TMS_FILETYPE_JSON,
|
||||
TMS_FILETYPE_MAX
|
||||
};
|
||||
enum eTMS_UGCTYPE
|
||||
{
|
||||
TMS_UGCTYPE_NONE,
|
||||
TMS_UGCTYPE_IMAGE,
|
||||
TMS_UGCTYPE_MAX
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHAR szFilename[256];
|
||||
int iFileSize;
|
||||
eTMS_FILETYPEVAL eFileTypeVal;
|
||||
}
|
||||
TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iCount;
|
||||
PTMSPP_FILE_DETAILS FileDetailsA;
|
||||
}
|
||||
TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwSize;
|
||||
PBYTE pbData;
|
||||
}
|
||||
TMSPP_FILEDATA, *PTMSPP_FILEDATA;
|
||||
|
||||
|
||||
C4JStorage();
|
||||
|
||||
void Tick(void);
|
||||
|
||||
// Messages
|
||||
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY,
|
||||
int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, C4JStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0);
|
||||
|
||||
|
||||
C4JStorage::EMessageResult GetMessageBoxResult();
|
||||
|
||||
// save device
|
||||
bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false);
|
||||
|
||||
// savegame
|
||||
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID);
|
||||
void ResetSaveData(); // Call before a new save to clear out stored save file name
|
||||
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam);
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
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);
|
||||
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
||||
bool EnoughSpaceForAMinSaveGame();
|
||||
|
||||
void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed
|
||||
// Get the info for the saves
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
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
|
||||
|
||||
void GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData);
|
||||
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes);
|
||||
|
||||
// Load the save. Need to call GetSaveData once the callback is called
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam);
|
||||
|
||||
// DLC
|
||||
void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam );
|
||||
void SetDLCPackageRoot(char *pszDLCRoot);
|
||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
DWORD CancelGetDLCOffers();
|
||||
void ClearDLCOffers();
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||
int GetOfferCount();
|
||||
DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
DWORD GetAvailableDLCCount( int iPad);
|
||||
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||
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);
|
||||
|
||||
// Global title storage
|
||||
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,
|
||||
WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=NULL,LPVOID lpParam=NULL, int iAction=0);
|
||||
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
|
||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
|
||||
void StoreTMSPathName(WCHAR *pwchName=NULL);
|
||||
|
||||
// TMS++
|
||||
#ifdef _XBOX
|
||||
C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,TMSCLIENT_CALLBACK Func,LPVOID lpParam);
|
||||
HRESULT GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam);
|
||||
#endif
|
||||
|
||||
// C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0);
|
||||
C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0);
|
||||
// bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename);
|
||||
// unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// enum eXBLWS
|
||||
// {
|
||||
// eXBLWS_GET,
|
||||
// eXBLWS_POST,
|
||||
// eXBLWS_PUT,
|
||||
// eXBLWS_DELETE,
|
||||
// };
|
||||
//bool XBLWS_Command(eXBLWS eCommand);
|
||||
|
||||
|
||||
unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// #ifdef _DEBUG
|
||||
// void SetSaveName(int i);
|
||||
// #endif
|
||||
// string table for all the Storage problems. Loaded by the application
|
||||
C4JStringTable *m_pStringTable;
|
||||
};
|
||||
|
||||
extern C4JStorage StorageManager;
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,668 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 5 //TODO 10
|
||||
#define CONTEXT_GAME_STATE_BREWING 5 //TODO 11
|
||||
#define CONTEXT_GAME_STATE_ANVIL 6 //TODO 12
|
||||
#define CONTEXT_GAME_STATE_TRADING 0 //TODO 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 14
|
||||
#define ACHIEVEMENT_14 15
|
||||
#define ACHIEVEMENT_15 16
|
||||
#define ACHIEVEMENT_16 17
|
||||
#define ACHIEVEMENT_17 18
|
||||
#define ACHIEVEMENT_18 19
|
||||
#define ACHIEVEMENT_19 20
|
||||
#define ACHIEVEMENT_20 21
|
||||
|
||||
//
|
||||
// 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__
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,107 @@
|
||||
// gdraw_d3d.h - author: Sean Barrett - copyright 2009-2011 RAD Game Tools
|
||||
//
|
||||
// Interface for creating a D3D GDraw driver.
|
||||
|
||||
#include "gdraw.h"
|
||||
|
||||
#define IDOC
|
||||
//idoc(parent,GDraw_d3d9)
|
||||
|
||||
typedef enum gdraw_d3d_resourcetype
|
||||
{
|
||||
GDRAW_D3D_RESOURCE_rendertarget,
|
||||
GDRAW_D3D_RESOURCE_texture,
|
||||
GDRAW_D3D_RESOURCE_vertexbuffer,
|
||||
|
||||
GDRAW_D3D_RESOURCE__count,
|
||||
} gdraw_d3d_resourcetype;
|
||||
|
||||
IDOC extern int gdraw_D3D_SetResourceLimits(gdraw_d3d_resourcetype type, S32 num_handles, S32 num_bytes);
|
||||
/* This sets how large the memory pool for a given resource types is, and how many handles
|
||||
GDraw should allocate for it. 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.
|
||||
|
||||
Returns 1 if value successfully changed, 0 on error.
|
||||
You need to call IggyPlayerFlushAll on all active Iggys before you do this to make
|
||||
them flush their resources since changing the resource limits invalidates all handles.
|
||||
You also need to call IggyFlushInstalledFonts if you have any installed fonts.
|
||||
*/
|
||||
|
||||
IDOC extern GDrawFunctions * gdraw_D3D_CreateContext(IDirect3DDevice9 *dev, S32 w, S32 h);
|
||||
/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D device
|
||||
and the width/height of the content you're displaying.
|
||||
|
||||
The width/height is used solely for sizing internal rendertargets. They will be
|
||||
allocated to the larger of this size and the size of any rendered tiles (with padding).
|
||||
In other words, you can pass in (0,0) and the rendertargets will be allocated to the
|
||||
right size. However, if you draw multiple Iggy files or tiles of different sizes,
|
||||
they might first be allocated too small; it's best to pass in the correct size initially
|
||||
to avoid unnecessary allocation/deallocation of too-small rendertargets.
|
||||
|
||||
There can only be one D3D GDraw context active at any one time.
|
||||
|
||||
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_D3D_SetRendertargetSize(S32 w, S32 h);
|
||||
/* Reset the size used for internal rendertargets defined by CreateContext. Flushes
|
||||
all existing rendertargets if the size changes. */
|
||||
|
||||
IDOC extern void gdraw_D3D_DestroyContext(void);
|
||||
/* Destroys the current GDraw context, if any. */
|
||||
|
||||
IDOC extern void gdraw_D3D_SetTileOrigin(IDirect3DSurface9 *rt, IDirect3DSurface9 *depth, S32 x, S32 y);
|
||||
/* This sets the main rendertarget that GDraw should render to, the corresponding
|
||||
depth/stencil surface, and the x/y position where to draw the top-left of the current tile (to be used for tiled
|
||||
rendering). You need to call this before Iggy calls any rendering functions. */
|
||||
|
||||
IDOC extern void gdraw_D3D_NoMoreGDrawThisFrame(void);
|
||||
/* Tells GDraw that no more rendering operations will occur this frame. This triggers
|
||||
some end-of-frame processing; most importantly, GDraw uses this call as a marker to
|
||||
detect thrashing (and react accordingly), so please do not forget to call this
|
||||
every frame! (As long as Iggy does any rendering, that is) */
|
||||
|
||||
IDOC extern void gdraw_D3D_PreReset(void);
|
||||
/* Call this before D3D device Reset(); it will free all default pool resources allocated
|
||||
by GDraw. */
|
||||
|
||||
IDOC extern void gdraw_D3D_PostReset(void);
|
||||
/* Call after D3D device Reset(). */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D_BeginCustomDraw(IggyCustomDrawCallbackRegion *Region, D3DMATRIX *mat);
|
||||
/* Call at the beginning of Iggy custom draw callback to clear any odd render states GDraw has
|
||||
set on the D3D device, and to get the current 2D object-to-world transformation. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D_EndCustomDraw(IggyCustomDrawCallbackRegion *Region);
|
||||
/* Call at the end of Iggy custom draw callback so GDraw can restore its render states. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D_GetResourceUsageStats(gdraw_d3d_resourcetype type, S32 *handles_used, S32 *bytes_used);
|
||||
/* D3D only: Get resource usage stats for last frame.
|
||||
This can be used to get an estimate of how much graphics memory got used by GDraw
|
||||
during the last frame.
|
||||
Caveat: This counts the number of bytes that GDraw knows about. 3D hardware usually
|
||||
has its own management overhead, alignment requirements, allocation granularity
|
||||
and so on. In short, this is not an accurate estimate of how much memory is actually
|
||||
used by the GPU - it is a lower bound, though, and makes for a useful ballpark estimate. */
|
||||
|
||||
IDOC extern GDrawTexture *gdraw_D3D_WrappedTextureCreate(IDirect3DTexture9 *tex_handle);
|
||||
/* Create a wrapped texture from a D3D 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. */
|
||||
|
||||
IDOC extern void gdraw_D3D_WrappedTextureChange(GDrawTexture *tex, IDirect3DTexture9 *tex_handle);
|
||||
/* Switch an existing GDrawTexture * that represents a wrapped texture to use
|
||||
a new underlying D3D 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_D3D_WrappedTextureDestroy(GDrawTexture *tex);
|
||||
/* Destroys the GDraw wrapper for a wrapped texture object. This will free up
|
||||
a GDraw texture handle but not release the associated D3D texture; that is
|
||||
up to you. */
|
||||
|
||||
extern GDrawTexture * RADLINK gdraw_D3D_MakeTextureFromResource(U8 *resource_file, S32 length, IggyFileTextureRaw *texture);
|
||||
extern void RADLINK gdraw_D3D_DestroyTextureFromResource(GDrawTexture *tex);
|
||||
@@ -0,0 +1,138 @@
|
||||
// gdraw_d3d10.cpp - author: Fabian Giesen - copyright 2011 RAD Game Tools
|
||||
//
|
||||
// This implements the Iggy graphics driver layer for D3D 10.
|
||||
|
||||
// GDraw consists of several components that interact fairly loosely with each other;
|
||||
// e.g. the resource management, drawing and filtering parts are all fairly independent
|
||||
// of each other. If you want to modify some aspect of GDraw - say the texture allocation
|
||||
// logic - your best bet is usually to just look for one of the related entry points,
|
||||
// e.g. MakeTextureBegin, and take it from there. There's a bunch of code in this file,
|
||||
// but none of it is really complicated.
|
||||
//
|
||||
// The one bit you might want to change that's not that localized is to integrate
|
||||
// GDraw with an existing state caching system. The following bits all modify D3D state
|
||||
// in some way:
|
||||
// - The rendering helpers (set_viewport_raw, set_projection_raw, set_*_renderstate)
|
||||
// - RenderTile*/TextureDrawBuffer* may change the active rendertarget and depth/stencil surface,
|
||||
// as do D3D1X_(NoMoreGDrawThisFrame) and set_render_target
|
||||
// - set_texture
|
||||
// - set_renderstate and set_renderstate_full. These are the main places where render state changes occur;
|
||||
// you should probably start here.
|
||||
// - DrawIndexedTriangles sets the active vertex/index buffers and vertex declaration
|
||||
// - Most of the functions in the "filter effects" section modify D3D state, mostly
|
||||
// pixel shader constants and textures
|
||||
|
||||
#define GDRAW_ASSERTS
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
// We temporarily disable this warning for the shared interface portions
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union
|
||||
|
||||
#include <windows.h>
|
||||
#include <d3d10.h>
|
||||
#include "gdraw.h"
|
||||
#include "iggy.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "gdraw_d3d10.h"
|
||||
|
||||
#pragma warning (pop)
|
||||
|
||||
// Some macros to allow as much sharing between D3D10 and D3D11 code as possible.
|
||||
#define D3D1X_(id) D3D10_##id
|
||||
#define ID3D1X(id) ID3D10##id
|
||||
#define gdraw_D3D1X_(id) gdraw_D3D10_##id
|
||||
#define GDRAW_D3D1X_(id) GDRAW_D3D10_##id
|
||||
|
||||
typedef ID3D10Device ID3D1XDevice;
|
||||
typedef ID3D10Device ID3D1XContext;
|
||||
typedef S32 ViewCoord;
|
||||
typedef gdraw_d3d10_resourcetype gdraw_resourcetype;
|
||||
|
||||
static void report_d3d_error(HRESULT hr, char *call, char *context);
|
||||
|
||||
static void *map_buffer(ID3D1XContext *, ID3D10Buffer *buf, bool discard)
|
||||
{
|
||||
void *ptr;
|
||||
if (FAILED(buf->Map(discard ? D3D10_MAP_WRITE_DISCARD : D3D10_MAP_WRITE_NO_OVERWRITE, 0, &ptr)))
|
||||
return NULL;
|
||||
else
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static void unmap_buffer(ID3D1XContext *, ID3D10Buffer *buf)
|
||||
{
|
||||
buf->Unmap();
|
||||
}
|
||||
|
||||
static RADINLINE void set_pixel_shader(ID3D10Device *ctx, ID3D10PixelShader *shader)
|
||||
{
|
||||
ctx->PSSetShader(shader);
|
||||
}
|
||||
|
||||
static RADINLINE void set_vertex_shader(ID3D10Device *ctx, ID3D10VertexShader *shader)
|
||||
{
|
||||
ctx->VSSetShader(shader);
|
||||
}
|
||||
|
||||
static ID3D10BlendState *create_blend_state(ID3D10Device *dev, BOOL blend, D3D10_BLEND src, D3D10_BLEND dst)
|
||||
{
|
||||
D3D10_BLEND_DESC desc = {};
|
||||
desc.BlendEnable[0] = blend;
|
||||
desc.SrcBlend = src;
|
||||
desc.DestBlend = dst;
|
||||
desc.BlendOp = D3D10_BLEND_OP_ADD;
|
||||
desc.SrcBlendAlpha = (src == D3D10_BLEND_DEST_COLOR ) ? D3D10_BLEND_DEST_ALPHA : src;
|
||||
desc.DestBlendAlpha = dst;
|
||||
desc.BlendOpAlpha = D3D10_BLEND_OP_ADD;
|
||||
desc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL;
|
||||
|
||||
ID3D10BlendState *res;
|
||||
HRESULT hr = dev->CreateBlendState(&desc, &res);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreateBlendState", "");
|
||||
res = NULL;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#define GDRAW_SHADER_FILE "gdraw_d3d10_shaders.inl"
|
||||
#include "gdraw_d3d1x_shared.inl"
|
||||
|
||||
static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src)
|
||||
{
|
||||
*p = *src;
|
||||
if(p->bytecode) {
|
||||
HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, &p->pshader);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreatePixelShader", "");
|
||||
p->pshader = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src)
|
||||
{
|
||||
*p = *src;
|
||||
if(p->bytecode) {
|
||||
HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, &p->vshader);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreateVertexShader", "");
|
||||
p->vshader = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GDrawFunctions *gdraw_D3D10_CreateContext(ID3D10Device *dev, S32 w, S32 h)
|
||||
{
|
||||
return create_context(dev, dev, w, h);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
// gdraw_d3d10.h - author: Fabian Giesen - copyright 2011 RAD Game Tools
|
||||
//
|
||||
// Interface for creating a D3D10 GDraw driver.
|
||||
|
||||
#define IDOC
|
||||
//idoc(parent,GDraw_d3d10)
|
||||
|
||||
typedef enum gdraw_d3d10_resourcetype
|
||||
{
|
||||
GDRAW_D3D10_RESOURCE_rendertarget,
|
||||
GDRAW_D3D10_RESOURCE_texture,
|
||||
GDRAW_D3D10_RESOURCE_vertexbuffer,
|
||||
GDRAW_D3D10_RESOURCE_dynbuffer, // Streaming buffer for dynamic vertex/index data (handle count ignored)
|
||||
|
||||
GDRAW_D3D10_RESOURCE__count,
|
||||
} gdraw_d3d10_resourcetype;
|
||||
|
||||
IDOC extern int gdraw_D3D10_SetResourceLimits(gdraw_d3d10_resourcetype type, S32 num_handles, S32 num_bytes);
|
||||
/* This sets how large the memory pool for a given resource types is, and how many handles
|
||||
GDraw should allocate for it. 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.
|
||||
|
||||
Returns 1 if value successfully changed, 0 on error.
|
||||
You need to call IggyPlayerFlushAll on all active Iggys before you do this to make
|
||||
them flush their resources since changing the resource limits invalidates all handles.
|
||||
You also need to call IggyFlushInstalledFonts if you have any installed fonts.
|
||||
*/
|
||||
|
||||
IDOC extern GDrawFunctions * gdraw_D3D10_CreateContext(ID3D10Device *dev, S32 w, S32 h);
|
||||
/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D device
|
||||
and the width/height of render target textures.
|
||||
|
||||
The width/height is used solely for sizing internal rendertargets. They will be
|
||||
allocated to the larger of this size and the size of any rendered tiles (with padding).
|
||||
In other words, you can pass in (0,0) and the rendertargets will be allocated to the
|
||||
right size. However, if you draw multiple Iggy files or tiles of different sizes,
|
||||
they might first be allocated too small; it's best to pass in the correct size initially
|
||||
to avoid unnecessary allocation/deallocation of too-small rendertargets.
|
||||
|
||||
There can only be one D3D GDraw context active at any one time.
|
||||
|
||||
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_D3D10_DestroyContext(void);
|
||||
/* Destroys the current GDraw context, if any. */
|
||||
|
||||
IDOC extern void gdraw_D3D10_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr));
|
||||
/* Sets the GDraw D3D error handler.
|
||||
|
||||
This will get called with the respective D3D error code if GDraw encounters an error
|
||||
that it can't handle by itself (e.g. running out of state objects). */
|
||||
|
||||
IDOC extern void gdraw_D3D10_SetRendertargetSize(S32 w, S32 h);
|
||||
/* Changes the current render target size (and recreates all rendertargets if necessary).
|
||||
This allows you to shrink the rendertargets if the new needed size is smaller
|
||||
than it was previously. As with $gdraw_D3D10_CreateContext, the width and
|
||||
height specified here are only minimums; GDraw will reallocate larger rendertargets
|
||||
as needed. */
|
||||
|
||||
IDOC extern void gdraw_D3D10_SetTileOrigin(ID3D10RenderTargetView *main_rt, ID3D10DepthStencilView *main_ds,
|
||||
ID3D10ShaderResourceView *non_msaa_rt, S32 x, S32 y);
|
||||
/* This sets the main rendertarget and matching depth/stencil buffer that GDraw
|
||||
should render to and the x/y position of the output location of the top-left
|
||||
of the current tile (allowing you to finely-position content, or to do tiled
|
||||
rendering).
|
||||
|
||||
If your rendertarget uses multisampling, you also need to specify a shader
|
||||
resource view for a non-MSAA rendertarget texture (identically sized to main_rt)
|
||||
in non_msaa_rt. This is only used if the Flash content includes non-standard
|
||||
blend modes which have to use a special blend shader, so you can leave it NULL
|
||||
if you forbid such content.
|
||||
|
||||
You need to call this before Iggy calls any rendering functions. */
|
||||
|
||||
IDOC extern void gdraw_D3D10_NoMoreGDrawThisFrame(void);
|
||||
/* Tells GDraw that no more rendering operations will occur this frame. This triggers
|
||||
some end-of-frame processing; most importantly, GDraw uses this call as a marker to
|
||||
detect thrashing (and react accordingly), so please do not forget to call this
|
||||
every frame! (As long as Iggy does any rendering, that is) */
|
||||
|
||||
IDOC extern void gdraw_D3D10_PreReset(void);
|
||||
/* Call this before D3D device Reset(); it will free all default pool resources allocated
|
||||
by GDraw. */
|
||||
|
||||
IDOC extern void gdraw_D3D10_PostReset(void);
|
||||
/* Call after D3D device Reset(). */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D10_BeginCustomDraw(IggyCustomDrawCallbackRegion *Region, F32 mat[4][4]);
|
||||
/* Call at the beginning of Iggy custom draw callback to clear any odd render states GDraw has
|
||||
set on the D3D device, and to get the current 2D object-to-world transformation. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D10_EndCustomDraw(IggyCustomDrawCallbackRegion *Region);
|
||||
/* Call at the end of Iggy custom draw callback so GDraw can restore its render states. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D10_GetResourceUsageStats(gdraw_d3d10_resourcetype type, S32 *handles_used, S32 *bytes_used);
|
||||
/* D3D only: Get resource usage stats for last frame.
|
||||
This can be used to get an estimate of how much graphics memory got used by GDraw
|
||||
during the last frame.
|
||||
|
||||
For the dynbuffer, this always returns 0 in handles_used and the *size of the largest
|
||||
single allocation* in bytes_used. It needs to be sized so that this allocation fits;
|
||||
make it smaller and it won't work, but if you make it much larger (say more than 2x
|
||||
as big), it's just a waste of memory. That said, we still recommend to make it no
|
||||
smaller than 64k, and the default is 256k.
|
||||
|
||||
Caveat: This counts the number of bytes that GDraw knows about. 3D hardware usually
|
||||
has its own management overhead, alignment requirements, allocation granularity
|
||||
and so on. In short, this is not an accurate estimate of how much memory is actually
|
||||
used by the GPU - it is a lower bound, though, and makes for a useful ballpark estimate. */
|
||||
|
||||
IDOC extern GDrawTexture *gdraw_D3D10_WrappedTextureCreate(ID3D10ShaderResourceView *tex_view);
|
||||
/* Create a wrapped texture from a shader resource view.
|
||||
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. */
|
||||
|
||||
IDOC extern void gdraw_D3D10_WrappedTextureChange(GDrawTexture *tex, ID3D10ShaderResourceView *tex_view);
|
||||
/* Switch an existing GDrawTexture * that represents a wrapped texture to use
|
||||
a new underlying D3D view. 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_D3D10_WrappedTextureDestroy(GDrawTexture *tex);
|
||||
/* Destroys the GDraw wrapper for a wrapped texture object. This will free up
|
||||
a GDraw texture handle but not release the associated D3D texture; that is
|
||||
up to you. */
|
||||
|
||||
extern GDrawTexture * RADLINK gdraw_D3D10_MakeTextureFromResource(U8 *resource_file, S32 length, IggyFileTextureRaw *texture);
|
||||
extern void RADLINK gdraw_D3D10_DestroyTextureFromResource(GDrawTexture *tex);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,147 @@
|
||||
#include "stdafx.h" // 4J
|
||||
|
||||
// gdraw_d3d11.cpp - author: Fabian Giesen - copyright 2011 RAD Game Tools
|
||||
//
|
||||
// This implements the Iggy graphics driver layer for D3D 11.
|
||||
|
||||
// GDraw consists of several components that interact fairly loosely with each other;
|
||||
// e.g. the resource management, drawing and filtering parts are all fairly independent
|
||||
// of each other. If you want to modify some aspect of GDraw - say the texture allocation
|
||||
// logic - your best bet is usually to just look for one of the related entry points,
|
||||
// e.g. MakeTextureBegin, and take it from there. There's a bunch of code in this file,
|
||||
// but none of it is really complicated.
|
||||
//
|
||||
// The one bit you might want to change that's not that localized is to integrate
|
||||
// GDraw with an existing state caching system. The following bits all modify D3D state
|
||||
// in some way:
|
||||
// - The rendering helpers (set_viewport_raw, set_projection_raw, set_*_renderstate)
|
||||
// - RenderTile*/TextureDrawBuffer* may change the active rendertarget and depth/stencil surface,
|
||||
// as do D3D1X_(NoMoreGDrawThisFrame) and set_render_target
|
||||
// - set_texture
|
||||
// - set_renderstate and set_renderstate_full. These are the main places where render state changes occur;
|
||||
// you should probably start here.
|
||||
// - DrawIndexedTriangles sets the active vertex/index buffers and vertex declaration
|
||||
// - Most of the functions in the "filter effects" section modify D3D state, mostly
|
||||
// pixel shader constants and textures
|
||||
|
||||
#define GDRAW_ASSERTS
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
// We temporarily disable this warning for the shared interface portions
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union
|
||||
|
||||
#include <windows.h>
|
||||
#include <d3d11.h>
|
||||
#include "gdraw.h"
|
||||
#include "iggy.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "gdraw_d3d11.h"
|
||||
|
||||
#pragma warning (pop)
|
||||
|
||||
// Some macros to allow as much sharing between D3D10 and D3D11 code as possible.
|
||||
#define D3D1X_(id) D3D11_##id
|
||||
#define ID3D1X(id) ID3D11##id
|
||||
#define gdraw_D3D1X_(id) gdraw_D3D11_##id
|
||||
#define GDRAW_D3D1X_(id) GDRAW_D3D11_##id
|
||||
|
||||
typedef ID3D11Device ID3D1XDevice;
|
||||
typedef ID3D11DeviceContext ID3D1XContext;
|
||||
typedef F32 ViewCoord;
|
||||
typedef gdraw_d3d11_resourcetype gdraw_resourcetype;
|
||||
|
||||
static void report_d3d_error(HRESULT hr, char *call, char *context);
|
||||
|
||||
static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE msr;
|
||||
HRESULT hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "Map", "of buffer");
|
||||
return NULL;
|
||||
} else
|
||||
return msr.pData;
|
||||
}
|
||||
|
||||
static void unmap_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf)
|
||||
{
|
||||
ctx->Unmap(buf, 0);
|
||||
}
|
||||
|
||||
static RADINLINE void set_pixel_shader(ID3D11DeviceContext *ctx, ID3D11PixelShader *shader)
|
||||
{
|
||||
ctx->PSSetShader(shader, NULL, 0);
|
||||
}
|
||||
|
||||
static RADINLINE void set_vertex_shader(ID3D11DeviceContext *ctx, ID3D11VertexShader *shader)
|
||||
{
|
||||
ctx->VSSetShader(shader, NULL, 0);
|
||||
}
|
||||
|
||||
static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11_BLEND src, D3D11_BLEND dst)
|
||||
{
|
||||
D3D11_BLEND_DESC desc = {};
|
||||
desc.RenderTarget[0].BlendEnable = blend;
|
||||
desc.RenderTarget[0].SrcBlend = src;
|
||||
desc.RenderTarget[0].DestBlend = dst;
|
||||
desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
|
||||
desc.RenderTarget[0].SrcBlendAlpha = (src == D3D11_BLEND_DEST_COLOR ) ? D3D11_BLEND_DEST_ALPHA : src;
|
||||
desc.RenderTarget[0].DestBlendAlpha = dst;
|
||||
desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
|
||||
desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
|
||||
|
||||
ID3D11BlendState *res;
|
||||
HRESULT hr = dev->CreateBlendState(&desc, &res);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreateBlendState", "");
|
||||
res = NULL;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#define GDRAW_SHADER_FILE "gdraw_d3d10_shaders.inl"
|
||||
#include "gdraw_d3d1x_shared.inl"
|
||||
|
||||
static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src)
|
||||
{
|
||||
*p = *src;
|
||||
if(p->bytecode) {
|
||||
HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreatePixelShader", "");
|
||||
p->pshader = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src)
|
||||
{
|
||||
*p = *src;
|
||||
if(p->bytecode) {
|
||||
HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader);
|
||||
if (FAILED(hr)) {
|
||||
report_d3d_error(hr, "CreateVertexShader", "");
|
||||
p->vshader = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GDrawFunctions *gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11DeviceContext *ctx, S32 w, S32 h)
|
||||
{
|
||||
return create_context(dev, ctx, w, h);
|
||||
}
|
||||
|
||||
// 4J added - interface so we can set the viewport back to the one that Iggy last set up
|
||||
void gdraw_D3D11_setViewport_4J()
|
||||
{
|
||||
set_viewport();
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
#pragma once // 4J
|
||||
|
||||
// gdraw_d3d11.h - author: Fabian Giesen - copyright 2011 RAD Game Tools
|
||||
//
|
||||
// Interface for creating a D3D11 GDraw driver.
|
||||
|
||||
#define IDOC
|
||||
//idoc(parent,GDraw_d3d11)
|
||||
|
||||
typedef enum gdraw_d3d11_resourcetype
|
||||
{
|
||||
GDRAW_D3D11_RESOURCE_rendertarget,
|
||||
GDRAW_D3D11_RESOURCE_texture,
|
||||
GDRAW_D3D11_RESOURCE_vertexbuffer,
|
||||
GDRAW_D3D11_RESOURCE_dynbuffer, // Streaming buffer for dynamic vertex/index data (handle count ignored)
|
||||
|
||||
GDRAW_D3D11_RESOURCE__count,
|
||||
} gdraw_d3d11_resourcetype;
|
||||
|
||||
IDOC extern int gdraw_D3D11_SetResourceLimits(gdraw_d3d11_resourcetype type, S32 num_handles, S32 num_bytes);
|
||||
/* This sets how large the memory pool for a given resource types is, and how many handles
|
||||
GDraw should allocate for it. 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.
|
||||
|
||||
Returns 1 if value successfully changed, 0 on error.
|
||||
You need to call IggyPlayerFlushAll on all active Iggys before you do this to make
|
||||
them flush their resources since changing the resource limits invalidates all handles.
|
||||
You also need to call IggyFlushInstalledFonts if you have any installed fonts.
|
||||
*/
|
||||
|
||||
IDOC extern GDrawFunctions * gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11DeviceContext *ctx, S32 w, S32 h);
|
||||
/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D device,
|
||||
the device context to use for rendering, and the width/height of render target textures.
|
||||
|
||||
The width/height is used solely for sizing internal rendertargets. They will be
|
||||
allocated to the larger of this size and the size of any rendered tiles (with padding).
|
||||
In other words, you can pass in (0,0) and the rendertargets will be allocated to the
|
||||
right size. However, if you draw multiple Iggy files or tiles of different sizes,
|
||||
they might first be allocated too small; it's best to pass in the correct size initially
|
||||
to avoid unnecessary allocation/deallocation of too-small rendertargets.
|
||||
|
||||
There can only be one D3D GDraw context active at any one time.
|
||||
|
||||
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_D3D11_DestroyContext(void);
|
||||
/* Destroys the current GDraw context, if any. */
|
||||
|
||||
IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr));
|
||||
/* Sets the GDraw D3D error handler.
|
||||
|
||||
This will get called with the respective D3D error code if GDraw encounters an error
|
||||
that it can't handle by itself (e.g. running out of state objects). */
|
||||
|
||||
IDOC extern void gdraw_D3D11_SetRendertargetSize(S32 w, S32 h);
|
||||
/* Changes the current render target size (and recreates all rendertargets if necessary).
|
||||
This allows you to shrink the rendertargets if the new needed size is smaller
|
||||
than it was previously. As with $gdraw_D3D11_CreateContext, the width and
|
||||
height specified here are only minimums; GDraw will reallocate larger rendertargets
|
||||
as needed. */
|
||||
|
||||
IDOC extern void gdraw_D3D11_SetTileOrigin(ID3D11RenderTargetView *main_rt, ID3D11DepthStencilView *main_ds,
|
||||
ID3D11ShaderResourceView *non_msaa_rt, S32 x, S32 y);
|
||||
/* This sets the main rendertarget and matching depth/stencil buffer that GDraw
|
||||
should render to and the x/y position of the output location of the top-left
|
||||
of the current tile (allowing you to finely-position content, or to do tiled
|
||||
rendering).
|
||||
|
||||
If your rendertarget uses multisampling, you also need to specify a shader
|
||||
resource view for a non-MSAA rendertarget texture (identically sized to main_rt)
|
||||
in non_msaa_rt. This is only used if the Flash content includes non-standard
|
||||
blend modes which have to use a special blend shader, so you can leave it NULL
|
||||
if you forbid such content.
|
||||
|
||||
You need to call this before Iggy calls any rendering functions. */
|
||||
|
||||
IDOC extern void gdraw_D3D11_NoMoreGDrawThisFrame(void);
|
||||
/* Tells GDraw that no more rendering operations will occur this frame. This triggers
|
||||
some end-of-frame processing; most importantly, GDraw uses this call as a marker to
|
||||
detect thrashing (and react accordingly), so please do not forget to call this
|
||||
every frame! (As long as Iggy does any rendering, that is) */
|
||||
|
||||
IDOC extern void gdraw_D3D11_PreReset(void);
|
||||
/* Call this before D3D device Reset(); it will free all default pool resources allocated
|
||||
by GDraw. */
|
||||
|
||||
IDOC extern void gdraw_D3D11_PostReset(void);
|
||||
/* Call after D3D device Reset(). */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D11_BeginCustomDraw_4J(IggyCustomDrawCallbackRegion *Region, F32 mat[16]);
|
||||
IDOC extern void RADLINK gdraw_D3D11_CalculateCustomDraw_4J(IggyCustomDrawCallbackRegion *Region, F32 mat[16]);
|
||||
IDOC extern void RADLINK gdraw_D3D11_BeginCustomDraw(IggyCustomDrawCallbackRegion *Region, F32 mat[4][4]);
|
||||
/* Call at the beginning of Iggy custom draw callback to clear any odd render states GDraw has
|
||||
set on the D3D device, and to get the current 2D object-to-world transformation. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D11_EndCustomDraw(IggyCustomDrawCallbackRegion *Region);
|
||||
/* Call at the end of Iggy custom draw callback so GDraw can restore its render states. */
|
||||
|
||||
IDOC extern void RADLINK gdraw_D3D11_GetResourceUsageStats(gdraw_d3d11_resourcetype type, S32 *handles_used, S32 *bytes_used);
|
||||
/* D3D only: Get resource usage stats for last frame.
|
||||
This can be used to get an estimate of how much graphics memory got used by GDraw
|
||||
during the last frame.
|
||||
|
||||
For the dynbuffer, this always returns 0 in handles_used and the *size of the largest
|
||||
single allocation* in bytes_used. It needs to be sized so that this allocation fits;
|
||||
make it smaller and it won't work, but if you make it much larger (say more than 2x
|
||||
as big), it's just a waste of memory. That said, we still recommend to make it no
|
||||
smaller than 64k, and the default is 256k.
|
||||
|
||||
Caveat: This counts the number of bytes that GDraw knows about. 3D hardware usually
|
||||
has its own management overhead, alignment requirements, allocation granularity
|
||||
and so on. In short, this is not an accurate estimate of how much memory is actually
|
||||
used by the GPU - it is a lower bound, though, and makes for a useful ballpark estimate. */
|
||||
|
||||
IDOC extern GDrawTexture *gdraw_D3D11_WrappedTextureCreate(ID3D11ShaderResourceView *tex_view);
|
||||
/* Create a wrapped texture from a shader resource view.
|
||||
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. */
|
||||
|
||||
IDOC extern void gdraw_D3D11_WrappedTextureChange(GDrawTexture *tex, ID3D11ShaderResourceView *tex_view);
|
||||
/* Switch an existing GDrawTexture * that represents a wrapped texture to use
|
||||
a new underlying D3D view. 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_D3D11_WrappedTextureDestroy(GDrawTexture *tex);
|
||||
/* Destroys the GDraw wrapper for a wrapped texture object. This will free up
|
||||
a GDraw texture handle but not release the associated D3D texture; that is
|
||||
up to you. */
|
||||
|
||||
GDrawTexture * RADLINK gdraw_D3D11_MakeTextureFromResource(U8 *resource_file, S32 length, IggyFileTextureRaw *texture);
|
||||
void RADLINK gdraw_D3D11_DestroyTextureFromResource(GDrawTexture *tex);
|
||||
|
||||
// 4J added
|
||||
extern void RADLINK gdraw_D3D11_setViewport_4J();
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,202 @@
|
||||
// gdraw_wgl.c - copyright 2011-2012 RAD Game Tools
|
||||
//
|
||||
// This implements the Iggy graphics driver layer for GL on Windows.
|
||||
|
||||
#define GDRAW_ASSERTS
|
||||
|
||||
#include "iggy.h"
|
||||
#include "gdraw.h"
|
||||
#include "gdraw_wgl.h"
|
||||
#include <windows.h>
|
||||
#include <gl/gl.h>
|
||||
#include "glext.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Extensions (we map to GL 2.0 function names for a uniform interface
|
||||
// across platforms)
|
||||
//
|
||||
|
||||
#define GDRAW_GL_EXTENSION_LIST \
|
||||
/* identifier import procname */ \
|
||||
/* GL_ARB_multitexture */ \
|
||||
GLE(ActiveTexture, "ActiveTextureARB", ACTIVETEXTUREARB) \
|
||||
/* GL_ARB_texture_compression */ \
|
||||
GLE(CompressedTexImage2D, "CompressedTexImage2DARB", COMPRESSEDTEXIMAGE2DARB) \
|
||||
/* GL_ARB_vertex_buffer_object */ \
|
||||
GLE(GenBuffers, "GenBuffersARB", GENBUFFERSARB) \
|
||||
GLE(DeleteBuffers, "DeleteBuffersARB", DELETEBUFFERSARB) \
|
||||
GLE(BindBuffer, "BindBufferARB", BINDBUFFERARB) \
|
||||
GLE(BufferData, "BufferDataARB", BUFFERDATAARB) \
|
||||
GLE(MapBuffer, "MapBufferARB", MAPBUFFERARB) \
|
||||
GLE(UnmapBuffer, "UnmapBufferARB", UNMAPBUFFERARB) \
|
||||
GLE(VertexAttribPointer, "VertexAttribPointerARB", VERTEXATTRIBPOINTERARB) \
|
||||
GLE(EnableVertexAttribArray, "EnableVertexAttribArrayARB", ENABLEVERTEXATTRIBARRAYARB) \
|
||||
GLE(DisableVertexAttribArray, "DisableVertexAttribArrayARB", DISABLEVERTEXATTRIBARRAYARB) \
|
||||
/* GL_ARB_shader_objects */ \
|
||||
GLE(CreateShader, "CreateShaderObjectARB", CREATESHADEROBJECTARB) \
|
||||
GLE(DeleteShader, "DeleteObjectARB", DELETEOBJECTARB) \
|
||||
GLE(ShaderSource, "ShaderSourceARB", SHADERSOURCEARB) \
|
||||
GLE(CompileShader, "CompileShaderARB", COMPILESHADERARB) \
|
||||
GLE(GetShaderiv, "GetObjectParameterivARB", GETOBJECTPARAMETERIVARB) \
|
||||
GLE(GetShaderInfoLog, "GetInfoLogARB", GETINFOLOGARB) \
|
||||
GLE(CreateProgram, "CreateProgramObjectARB", CREATEPROGRAMOBJECTARB) \
|
||||
GLE(DeleteProgram, "DeleteObjectARB", DELETEOBJECTARB) \
|
||||
GLE(AttachShader, "AttachObjectARB", ATTACHOBJECTARB) \
|
||||
GLE(LinkProgram, "LinkProgramARB", LINKPROGRAMARB) \
|
||||
GLE(GetUniformLocation, "GetUniformLocationARB", GETUNIFORMLOCATIONARB) \
|
||||
GLE(UseProgram, "UseProgramObjectARB", USEPROGRAMOBJECTARB) \
|
||||
GLE(GetProgramiv, "GetObjectParameterivARB", GETOBJECTPARAMETERIVARB) \
|
||||
GLE(GetProgramInfoLog, "GetInfoLogARB", GETINFOLOGARB) \
|
||||
GLE(Uniform1i, "Uniform1iARB", UNIFORM1IARB) \
|
||||
GLE(Uniform4f, "Uniform4fARB", UNIFORM4FARB) \
|
||||
GLE(Uniform4fv, "Uniform4fvARB", UNIFORM4FVARB) \
|
||||
/* GL_ARB_vertex_shader */ \
|
||||
GLE(BindAttribLocation, "BindAttribLocationARB", BINDATTRIBLOCATIONARB) \
|
||||
/* GL_EXT_framebuffer_object */ \
|
||||
GLE(GenRenderbuffers, "GenRenderbuffersEXT", GENRENDERBUFFERSEXT) \
|
||||
GLE(DeleteRenderbuffers, "DeleteRenderbuffersEXT", DELETERENDERBUFFERSEXT) \
|
||||
GLE(BindRenderbuffer, "BindRenderbufferEXT", BINDRENDERBUFFEREXT) \
|
||||
GLE(RenderbufferStorage, "RenderbufferStorageEXT", RENDERBUFFERSTORAGEEXT) \
|
||||
GLE(GenFramebuffers, "GenFramebuffersEXT", GENFRAMEBUFFERSEXT) \
|
||||
GLE(DeleteFramebuffers, "DeleteFramebuffersEXT", DELETEFRAMEBUFFERSEXT) \
|
||||
GLE(BindFramebuffer, "BindFramebufferEXT", BINDFRAMEBUFFEREXT) \
|
||||
GLE(CheckFramebufferStatus, "CheckFramebufferStatusEXT", CHECKFRAMEBUFFERSTATUSEXT) \
|
||||
GLE(FramebufferRenderbuffer, "FramebufferRenderbufferEXT", FRAMEBUFFERRENDERBUFFEREXT) \
|
||||
GLE(FramebufferTexture2D, "FramebufferTexture2DEXT", FRAMEBUFFERTEXTURE2DEXT) \
|
||||
GLE(GenerateMipmap, "GenerateMipmapEXT", GENERATEMIPMAPEXT) \
|
||||
/* GL_EXT_framebuffer_blit */ \
|
||||
GLE(BlitFramebuffer, "BlitFramebufferEXT", BLITFRAMEBUFFEREXT) \
|
||||
/* GL_EXT_framebuffer_multisample */ \
|
||||
GLE(RenderbufferStorageMultisample, "RenderbufferStorageMultisampleEXT",RENDERBUFFERSTORAGEMULTISAMPLEEXT) \
|
||||
/* <end> */
|
||||
|
||||
#define gdraw_GLx_(id) gdraw_GL_##id
|
||||
#define GDRAW_GLx_(id) GDRAW_GL_##id
|
||||
#define GDRAW_SHADERS "gdraw_gl_shaders.inl"
|
||||
|
||||
typedef GLhandleARB GLhandle;
|
||||
typedef gdraw_gl_resourcetype gdraw_resourcetype;
|
||||
|
||||
// Extensions
|
||||
#define GLE(id, import, procname) static PFNGL##procname##PROC gl##id;
|
||||
GDRAW_GL_EXTENSION_LIST
|
||||
#undef GLE
|
||||
|
||||
static void load_extensions(void)
|
||||
{
|
||||
#define GLE(id, import, procname) gl##id = (PFNGL##procname##PROC) wglGetProcAddress("gl" import);
|
||||
GDRAW_GL_EXTENSION_LIST
|
||||
#undef GLE
|
||||
}
|
||||
|
||||
static void clear_renderstate_platform_specific(void)
|
||||
{
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
static void error_msg_platform_specific(const char *msg)
|
||||
{
|
||||
OutputDebugStringA(msg);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Shared code
|
||||
//
|
||||
|
||||
#define GDRAW_MULTISAMPLING
|
||||
#include "gdraw_gl_shared.inl"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Initialization and platform-specific functionality
|
||||
//
|
||||
|
||||
GDrawFunctions *gdraw_GL_CreateContext(S32 w, S32 h, S32 msaa_samples)
|
||||
{
|
||||
static const TextureFormatDesc tex_formats[] = {
|
||||
{ IFT_FORMAT_rgba_8888, 1, 1, 4, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_rgba_4444_LE, 1, 1, 2, GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4 },
|
||||
{ IFT_FORMAT_rgba_5551_LE, 1, 1, 2, GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1 },
|
||||
{ IFT_FORMAT_la_88, 1, 1, 2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_la_44, 1, 1, 1, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_i_8, 1, 1, 1, GL_INTENSITY8, GL_ALPHA, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_i_4, 1, 1, 1, GL_INTENSITY4, GL_ALPHA, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_l_8, 1, 1, 1, GL_LUMINANCE8, GL_LUMINANCE, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_l_4, 1, 1, 1, GL_LUMINANCE4, GL_LUMINANCE, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_DXT1, 4, 4, 8, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_DXT3, 4, 4, 16, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0, GL_UNSIGNED_BYTE },
|
||||
{ IFT_FORMAT_DXT5, 4, 4, 16, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0, GL_UNSIGNED_BYTE },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
};
|
||||
|
||||
GDrawFunctions *funcs;
|
||||
const char *s;
|
||||
GLint n;
|
||||
|
||||
// check for the extensions we need
|
||||
s = (const char *) glGetString(GL_EXTENSIONS);
|
||||
if (s == NULL) {
|
||||
assert(s != NULL); // if this is NULL, you're probably trying to create the device too early
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// check for the extensions we won't work without
|
||||
if (!hasext(s, "GL_ARB_multitexture") ||
|
||||
!hasext(s, "GL_ARB_texture_compression") ||
|
||||
!hasext(s, "GL_ARB_texture_mirrored_repeat") ||
|
||||
!hasext(s, "GL_ARB_texture_non_power_of_two") || // with caveats - see below!
|
||||
!hasext(s, "GL_ARB_vertex_buffer_object") ||
|
||||
!hasext(s, "GL_EXT_framebuffer_object") ||
|
||||
!hasext(s, "GL_ARB_shader_objects") ||
|
||||
!hasext(s, "GL_ARB_vertex_shader") ||
|
||||
!hasext(s, "GL_ARB_fragment_shader"))
|
||||
return NULL;
|
||||
|
||||
// if user requests multisampling and HW doesn't support it, bail
|
||||
if (!hasext(s, "GL_EXT_framebuffer_multisample") && msaa_samples > 1)
|
||||
return NULL;
|
||||
|
||||
load_extensions();
|
||||
funcs = create_context(w, h);
|
||||
if (!funcs)
|
||||
return NULL;
|
||||
|
||||
gdraw->tex_formats = tex_formats;
|
||||
|
||||
// check for optional extensions
|
||||
gdraw->has_mapbuffer = true; // part of core VBO extension on regular GL
|
||||
gdraw->has_depth24 = true; // we just assume.
|
||||
gdraw->has_texture_max_level = true; // core on regular GL
|
||||
|
||||
if (hasext(s, "GL_EXT_packed_depth_stencil")) gdraw->has_packed_depth_stencil = true;
|
||||
|
||||
// we require ARB_texture_non_power_of_two - on actual HW, this may either give us
|
||||
// "full" non-power-of-two support, or "conditional" non-power-of-two (wrap mode must
|
||||
// be CLAMP_TO_EDGE, no mipmaps). figure out which it is using this heuristic by
|
||||
// Unity's Aras Pranckevicius (thanks!):
|
||||
// http://www.aras-p.info/blog/2012/10/17/non-power-of-two-textures/
|
||||
//
|
||||
// we use the second heuristic (texture size <8192 for cards without full NPOT support)
|
||||
// since we don't otherwise use ARB_fragment_program and don't want to create a program
|
||||
// just to be able to query MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB!
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &n);
|
||||
gdraw->has_conditional_non_power_of_two = n < 8192;
|
||||
|
||||
// clamp number of multisampling levels to max supported
|
||||
if (msaa_samples > 1) {
|
||||
glGetIntegerv(GL_MAX_SAMPLES, &n);
|
||||
gdraw->multisampling = RR_MIN(msaa_samples, n);
|
||||
}
|
||||
|
||||
opengl_check();
|
||||
|
||||
return funcs;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef __RAD_INCLUDE_GDRAW_GL_H__
|
||||
#define __RAD_INCLUDE_GDRAW_GL_H__
|
||||
|
||||
#include "rrCore.h"
|
||||
#include "gdraw.h"
|
||||
|
||||
RADDEFSTART
|
||||
|
||||
typedef enum gdraw_gl_resourcetype
|
||||
{
|
||||
GDRAW_GL_RESOURCE_rendertarget,
|
||||
GDRAW_GL_RESOURCE_texture,
|
||||
GDRAW_GL_RESOURCE_vertexbuffer,
|
||||
|
||||
GDRAW_GL_RESOURCE__count,
|
||||
} gdraw_gl_resourcetype;
|
||||
|
||||
struct IggyCustomDrawCallbackRegion;
|
||||
|
||||
extern int gdraw_GL_SetResourceLimits(gdraw_gl_resourcetype type, S32 num_handles, S32 num_bytes);
|
||||
extern GDrawFunctions * gdraw_GL_CreateContext(S32 min_w, S32 min_h, S32 msaa_samples);
|
||||
extern void gdraw_GL_DestroyContext(void);
|
||||
extern void gdraw_GL_SetTileOrigin(S32 vx, S32 vy, U32 framebuffer); // framebuffer=FBO handle, or 0 for main frame buffer
|
||||
extern void gdraw_GL_NoMoreGDrawThisFrame(void);
|
||||
|
||||
extern GDrawTexture *gdraw_GL_WrappedTextureCreate(S32 gl_texture_handle, S32 width, S32 height, rrbool has_mipmaps);
|
||||
extern void gdraw_GL_WrappedTextureChange(GDrawTexture *tex, S32 new_gl_texture_handle, S32 new_width, S32 new_height, rrbool new_has_mipmaps);
|
||||
extern void gdraw_GL_WrappedTextureDestroy(GDrawTexture *tex);
|
||||
|
||||
extern void gdraw_GL_BeginCustomDraw(struct IggyCustomDrawCallbackRegion *region, F32 *matrix);
|
||||
extern void gdraw_GL_EndCustomDraw(struct IggyCustomDrawCallbackRegion *region);
|
||||
|
||||
extern GDrawTexture * RADLINK gdraw_GL_MakeTextureFromResource(U8 *resource_file, S32 resource_len, IggyFileTextureRaw *texture);
|
||||
extern void RADLINK gdraw_GL_DestroyTextureFromResource(GDrawTexture *tex);
|
||||
|
||||
RADDEFEND
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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__
|
||||
@@ -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__
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "WindowsLeaderboardManager.h"
|
||||
|
||||
LeaderboardManager *LeaderboardManager::m_instance = new WindowsLeaderboardManager(); //Singleton instance of the LeaderboardManager
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Leaderboards\LeaderboardManager.h"
|
||||
|
||||
class WindowsLeaderboardManager : public LeaderboardManager
|
||||
{
|
||||
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) { 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; }
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// 3 bit user index
|
||||
// 5 bits alpha
|
||||
// 1 bit decoration
|
||||
// 3 bits poptime
|
||||
// 8 bits unused // was 11 bits aux val but needed 15 bits for potions so moved to item bitmask
|
||||
// 6 bits count
|
||||
// 6 bits scale
|
||||
|
||||
// uiCount is up to 64, but can't ever be 0, so to make it 6 bits, subtract one from the packing, and add one on the unpacking
|
||||
#define MAKE_SLOTDISPLAY_DATA_BITMASK(uiUserIndex,uiAlpha,bDecorations,uiCount,uiScale,uiPopTime) ((((uiUserIndex&0x7)<<29) | (uiAlpha&0x1F)<<24) | (bDecorations?0x800000:0) | ((uiPopTime&0x7)<<20) | ((uiCount-1)<<6) | (uiScale&0x3F))
|
||||
|
||||
#define GET_SLOTDISPLAY_USERINDEX_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>29)&0x7)
|
||||
#define GET_SLOTDISPLAY_ALPHA_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>24)&0x1F)
|
||||
#define GET_SLOTDISPLAY_DECORATIONS_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)&0x800000)?true:false)
|
||||
//#define GET_SLOTDISPLAY_AUXVAL_FROM_DATA_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)>>12)&0x7FF)
|
||||
#define GET_SLOTDISPLAY_COUNT_FROM_DATA_BITMASK(uiBitmask) (((((unsigned int)uiBitmask)>>6)&0x3F)+1)
|
||||
#define GET_SLOTDISPLAY_SCALE_FROM_DATA_BITMASK(uiBitmask) (((unsigned int)uiBitmask)&0x3F)
|
||||
#define GET_SLOTDISPLAY_POPTIME_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>20)&0x7)
|
||||
|
||||
// 16 bits for id (either item id or xzp icon id)
|
||||
// 15 bits for aux value
|
||||
// 1 bit for foil
|
||||
#define MAKE_SLOTDISPLAY_ITEM_BITMASK(uiId,uiAuxValue,bFoil) ( (uiId & 0xFFFF) | ((uiAuxValue & 0x7FFF) << 16) | (bFoil?0x80000000:0) )
|
||||
|
||||
#define GET_SLOTDISPLAY_ID_FROM_ITEM_BITMASK(uiBitmask) (((unsigned int)uiBitmask)&0xFFFF)
|
||||
#define GET_SLOTDISPLAY_AUXVAL_FROM_ITEM_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>16) & 0x7FFF)
|
||||
#define GET_SLOTDISPLAY_FOIL_FROM_ITEM_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)&0x80000000)?true:false)
|
||||
|
||||
|
||||
// For encoding the players skin selection in their profile
|
||||
// bDlcSkin = false is a players skin, bDlcSkin = true is a DLC skin
|
||||
#define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) )
|
||||
#define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF)
|
||||
|
||||
#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF)
|
||||
#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0)
|
||||
#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F)
|
||||
#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false)
|
||||
@@ -0,0 +1,31 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by DurangoRenderTest.rc
|
||||
//
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_DURANGORENDERTEST_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MINECRAFTWINDOWS 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MINECRAFTWINDOWS 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
// 4J Stu - This file defines the id's for the dynamic configurations that we are currently using
|
||||
// as well as the format of the data in them
|
||||
|
||||
/***********************
|
||||
*
|
||||
* TRIAL TIMER
|
||||
*
|
||||
************************/
|
||||
|
||||
#define DYNAMIC_CONFIG_TRIAL_ID 0
|
||||
#define DYNAMIC_CONFIG_TRIAL_VERSION 1
|
||||
#define DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME 2400 //40 mins 1200 // 20 mins //300; // 5 minutes
|
||||
|
||||
class MinecraftDynamicConfigurations
|
||||
{
|
||||
private:
|
||||
enum EDynamic_Configs
|
||||
{
|
||||
eDynamic_Config_Trial,
|
||||
|
||||
eDynamic_Config_Max,
|
||||
};
|
||||
|
||||
/***********************
|
||||
*
|
||||
* TRIAL TIMER
|
||||
*
|
||||
************************/
|
||||
|
||||
// 4J Stu - The first 4 bytes define a version number, that defines the structure of the data
|
||||
// After reading those bytes into a DWORD, the remainder of the data should be the size of the
|
||||
// relevant struct and can be cast to the struct
|
||||
struct _dynamic_config_trial_data_version1
|
||||
{
|
||||
// The time in seconds that the player can play the trial for
|
||||
DWORD trialTimeSeconds;
|
||||
|
||||
_dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
|
||||
};
|
||||
|
||||
typedef _dynamic_config_trial_data_version1 Dynamic_Config_Trial_Data;
|
||||
|
||||
// Stored configurations
|
||||
static Dynamic_Config_Trial_Data trialData;
|
||||
|
||||
static bool s_bFirstUpdateStarted;
|
||||
static bool s_bUpdatedConfigs[eDynamic_Config_Max];
|
||||
static EDynamic_Configs s_eCurrentConfig;
|
||||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
||||
static DWORD GetTrialTime();
|
||||
|
||||
private:
|
||||
static void UpdateAllConfigurations();
|
||||
static void UpdateNextConfiguration();
|
||||
static void UpdateConfiguration(EDynamic_Configs id);
|
||||
|
||||
static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData);
|
||||
static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "SentientTelemetryCommon.h"
|
||||
#include "TelemetryEnum.h"
|
||||
#include "SentientStats.h"
|
||||
@@ -0,0 +1,83 @@
|
||||
#pragma once
|
||||
#include "MinecraftTelemetry.h"
|
||||
|
||||
class CSentientManager
|
||||
{
|
||||
public:
|
||||
enum ETelemetryEvent
|
||||
{
|
||||
eTelemetry_PlayerSessionStart,
|
||||
eTelemetry_PlayerSessionExit,
|
||||
eTelemetry_HeartBeat,
|
||||
eTelemetry_LevelStart,
|
||||
eTelemetry_LevelExit,
|
||||
eTelemetry_LevelSaveOrCheckpoint,
|
||||
eTelemetry_PauseOrInactive,
|
||||
eTelemetry_UnpauseOrActive,
|
||||
eTelemetry_MenuShown,
|
||||
eTelemetry_AchievementUnlocked,
|
||||
eTelemetry_MediaShareUpload,
|
||||
eTelemetry_UpsellPresented,
|
||||
eTelemetry_UpsellResponded,
|
||||
eTelemetry_PlayerDiedOrFailed,
|
||||
eTelemetry_EnemyKilledOrOvercome,
|
||||
};
|
||||
|
||||
HRESULT Init();
|
||||
HRESULT Tick();
|
||||
|
||||
HRESULT Flush();
|
||||
|
||||
BOOL RecordPlayerSessionStart(DWORD dwUserId);
|
||||
BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus);
|
||||
BOOL RecordHeartBeat(DWORD dwUserId);
|
||||
BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers);
|
||||
BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus);
|
||||
BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes);
|
||||
BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID);
|
||||
BOOL RecordPauseOrInactive(DWORD dwUserId);
|
||||
BOOL RecordUnpauseOrActive(DWORD dwUserId);
|
||||
BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID);
|
||||
BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore);
|
||||
BOOL RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType);
|
||||
BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID);
|
||||
BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome);
|
||||
BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID);
|
||||
BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID);
|
||||
|
||||
BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId);
|
||||
BOOL RecordBanLevel(DWORD dwUserId);
|
||||
BOOL RecordUnBanLevel(DWORD dwUserId);
|
||||
|
||||
INT GetMultiplayerInstanceID();
|
||||
INT GenerateMultiplayerInstanceId();
|
||||
void SetMultiplayerInstanceId(INT value);
|
||||
|
||||
private:
|
||||
float m_initialiseTime;
|
||||
float m_lastHeartbeat;
|
||||
bool m_bFirstFlush;
|
||||
|
||||
float m_fLevelStartTime[XUSER_MAX_COUNT];
|
||||
|
||||
INT m_multiplayerInstanceID;
|
||||
DWORD m_levelInstanceID;
|
||||
|
||||
// Helper functions to get the various common settings
|
||||
INT GetSecondsSinceInitialize();
|
||||
INT GetMode(DWORD dwUserId);
|
||||
INT GetSubMode(DWORD dwUserId);
|
||||
INT GetLevelId(DWORD dwUserId);
|
||||
INT GetSubLevelId(DWORD dwUserId);
|
||||
INT GetTitleBuildId();
|
||||
INT GetLevelInstanceID();
|
||||
INT GetSingleOrMultiplayer();
|
||||
INT GetDifficultyLevel(INT diff);
|
||||
INT GetLicense();
|
||||
INT GetDefaultGameControls();
|
||||
INT GetAudioSettings(DWORD dwUserId);
|
||||
INT GetLevelExitProgressStat1();
|
||||
INT GetLevelExitProgressStat2();
|
||||
};
|
||||
|
||||
extern CSentientManager SentientManager;
|
||||
@@ -0,0 +1,88 @@
|
||||
/************************************************************************/
|
||||
/* THIS FILE WAS AUTOMATICALLY GENERATED */
|
||||
/* PLEASE DO NOT MODIFY */
|
||||
/************************************************************************/
|
||||
// Generated from Version: 20, on (6/19/2012 9:21:23 AM)
|
||||
|
||||
#pragma once
|
||||
|
||||
/************************************************************************/
|
||||
/* STATS */
|
||||
/************************************************************************/
|
||||
|
||||
// PlayerSessionStart
|
||||
// Player signed in or joined
|
||||
BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView );
|
||||
|
||||
// PlayerSessionExit
|
||||
// Player signed out or left
|
||||
BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID );
|
||||
|
||||
// HeartBeat
|
||||
// Sent every 60 seconds by title
|
||||
BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize );
|
||||
|
||||
// LevelStart
|
||||
// Level started
|
||||
BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView );
|
||||
|
||||
// LevelExit
|
||||
// Level exited
|
||||
BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds );
|
||||
|
||||
// LevelSaveOrCheckpoint
|
||||
// Level saved explicitly or implicitly
|
||||
BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID );
|
||||
|
||||
// LevelResume
|
||||
// Level resumed from a save or restarted at a checkpoint
|
||||
BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView );
|
||||
|
||||
// PauseOrInactive
|
||||
// Player paused game or has become inactive, level and mode are for what the player is leaving
|
||||
BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID );
|
||||
|
||||
// UnpauseOrActive
|
||||
// Player unpaused game or has become active, level and mode are for what the player is entering into
|
||||
BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID );
|
||||
|
||||
// MenuShown
|
||||
// A menu screen or major menu area has been shown
|
||||
BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID );
|
||||
|
||||
// AchievementUnlocked
|
||||
// An achievement was unlocked
|
||||
BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore );
|
||||
|
||||
// MediaShareUpload
|
||||
// The user uploaded something to Kinect Share
|
||||
BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType );
|
||||
|
||||
// UpsellPresented
|
||||
// The user is shown an upsell to purchase something
|
||||
BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID );
|
||||
|
||||
// UpsellResponded
|
||||
// The user responded to the upsell
|
||||
BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome );
|
||||
|
||||
// PlayerDiedOrFailed
|
||||
// The player died or failed a challenge - can be used for many types of failure
|
||||
BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize );
|
||||
|
||||
// EnemyKilledOrOvercome
|
||||
// The player killed an enemy or overcame or solved a major challenge
|
||||
BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize );
|
||||
|
||||
// SkinChanged
|
||||
// The player has changed their skin, level and mode are for what the player is currently in
|
||||
BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID );
|
||||
|
||||
// BanLevel
|
||||
// The player has banned a level, level and mode are for what the player is currently in and banning
|
||||
BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID );
|
||||
|
||||
// UnBanLevel
|
||||
// The player has ubbanned a level, level and mode are for what the player is currently in and unbanning
|
||||
BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID );
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
#pragma once
|
||||
// 4J Stu - Enums as defined by the common Sentient telemetry format
|
||||
|
||||
//##################################
|
||||
// DO NOT CHANGE ANY OF THESE VALUES
|
||||
//##################################
|
||||
|
||||
|
||||
/*************************************
|
||||
AudioSettings
|
||||
*************************************
|
||||
Are players changing default audio settings?
|
||||
*/
|
||||
enum ESen_AudioSettings
|
||||
{
|
||||
eSen_AudioSettings_Undefined = 0,
|
||||
eSen_AudioSettings_Off = 1,
|
||||
eSen_AudioSettings_On_Default = 2,
|
||||
eSen_AudioSettings_On_CustomSetting = 3,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
CompeteOrCoop
|
||||
*************************************
|
||||
Indicates whether players are playing a cooperative mode or a competitive mode.
|
||||
*/
|
||||
enum ESen_CompeteOrCoop
|
||||
{
|
||||
eSen_CompeteOrCoop_Undefined = 0,
|
||||
eSen_CompeteOrCoop_Cooperative = 1,
|
||||
eSen_CompeteOrCoop_Competitive = 2,
|
||||
eSen_CompeteOrCoop_Coop_and_Competitive = 3,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
DefaultGameControls
|
||||
*************************************
|
||||
This is intended to capture whether players played using default control scheme or customized the control scheme.
|
||||
*/
|
||||
enum ESen_DefaultGameControls
|
||||
{
|
||||
eSen_DefaultGameControls_Undefined = 0,
|
||||
eSen_DefaultGameControls_Default_controls = 1,
|
||||
eSen_DefaultGameControls_Custom_controls = 2,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
DifficultyLevel
|
||||
*************************************
|
||||
An in-game setting that differentiates the challenge imposed on the user. Normalized to a standard 5-point scale.
|
||||
*/
|
||||
enum ESen_DifficultyLevel
|
||||
{
|
||||
eSen_DifficultyLevel_Undefined = 0,
|
||||
eSen_DifficultyLevel_Easiest = 1,
|
||||
eSen_DifficultyLevel_Easier = 2,
|
||||
eSen_DifficultyLevel_Normal = 3,
|
||||
eSen_DifficultyLevel_Harder = 4,
|
||||
eSen_DifficultyLevel_Hardest = 5,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
GameInputType
|
||||
*************************************
|
||||
Used to determine the different modes of input used in the game. For gamepad/keyboard/mouse usage, it is not necessary to call this for every single input.
|
||||
Also, if polling is used, calling this event occasionally may also work.
|
||||
*/
|
||||
enum ESen_GameInputType
|
||||
{
|
||||
eSen_GameInputType_Undefined = 0,
|
||||
eSen_GameInputType_Xbox_Controller = 1,
|
||||
eSen_GameInputType_Gesture = 2,
|
||||
eSen_GameInputType_Voice = 3,
|
||||
eSen_GameInputType_Voice_and_Gesture_Together = 4,
|
||||
eSen_GameInputType_Touch = 5,
|
||||
eSen_GameInputType_Keyboard = 6,
|
||||
eSen_GameInputType_Mouse = 7,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
LevelExitStatus
|
||||
*************************************
|
||||
Indicates whether the player successfully completed the level. Critical for understanding the difficulty of a game with checkpoints or saves.
|
||||
*/
|
||||
enum ESen_LevelExitStatus
|
||||
{
|
||||
eSen_LevelExitStatus_Undefined = 0,
|
||||
eSen_LevelExitStatus_Exited = 1,
|
||||
eSen_LevelExitStatus_Succeeded = 2,
|
||||
eSen_LevelExitStatus_Failed = 3,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
License
|
||||
*************************************
|
||||
Differentiates trial/demo from full purchased titles
|
||||
*/
|
||||
enum ESen_License
|
||||
{
|
||||
eSen_License_Undefined = 0,
|
||||
eSen_License_Trial_or_Demo = 1,
|
||||
eSen_License_Full_Purchased_Title = 2,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
MediaDestination
|
||||
*************************************
|
||||
Tracks where media is uploaded to (like facebook)
|
||||
*/
|
||||
enum ESen_MediaDestination
|
||||
{
|
||||
ESen_MediaDestination_Undefined = 0,
|
||||
ESen_MediaDestination_Kinect_Share = 1,
|
||||
ESen_MediaDestination_Facebook = 2,
|
||||
ESen_MediaDestination_YouTube = 3,
|
||||
ESen_MediaDestination_Other = 4
|
||||
};
|
||||
|
||||
/*************************************
|
||||
MediaType
|
||||
*************************************
|
||||
Used to capture the type of media players are uploading to KinectShare
|
||||
*/
|
||||
enum ESen_MediaType
|
||||
{
|
||||
eSen_MediaType_Undefined = 0,
|
||||
eSen_MediaType_Picture = 1,
|
||||
eSen_MediaType_Video = 2,
|
||||
eSen_MediaType_Other_UGC = 3,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
SingleOrMultiplayer
|
||||
*************************************
|
||||
Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live.
|
||||
*/
|
||||
enum ESen_SingleOrMultiplayer
|
||||
{
|
||||
eSen_SingleOrMultiplayer_Undefined = 0,
|
||||
eSen_SingleOrMultiplayer_Single_Player = 1,
|
||||
eSen_SingleOrMultiplayer_Multiplayer_Local = 2,
|
||||
eSen_SingleOrMultiplayer_Multiplayer_Live = 3,
|
||||
eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live = 4,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
FriendOrMatch
|
||||
*************************************
|
||||
Are players playing with friends or were they matched?
|
||||
*/
|
||||
enum ESen_FriendOrMatch
|
||||
{
|
||||
eSen_FriendOrMatch_Undefined = 0, // (use if a single player game)
|
||||
eSen_FriendOrMatch_Playing_With_Invited_Friends = 1,
|
||||
eSen_FriendOrMatch_Playing_With_Match_Made_Opponents = 2,
|
||||
eSen_FriendOrMatch_Playing_With_Both_Friends_And_Matched_Opponents = 3,
|
||||
eSen_FriendOrMatch_Joined_Through_An_Xbox_Live_Party = 4,
|
||||
eSen_FriendOrMatch_Joined_Through_An_In_Game_Party = 5,
|
||||
};
|
||||
|
||||
/*************************************
|
||||
UpsellID
|
||||
*************************************
|
||||
Which upsell has been presented?
|
||||
*/
|
||||
enum ESen_UpsellID
|
||||
{
|
||||
eSen_UpsellID_Undefined = 0,
|
||||
eSen_UpsellID_Full_Version_Of_Game = 1,
|
||||
|
||||
// Added TU3
|
||||
eSet_UpsellID_Skin_DLC = 2,
|
||||
eSet_UpsellID_Texture_DLC = 3,
|
||||
|
||||
//2-max= Up to game
|
||||
};
|
||||
|
||||
/*************************************
|
||||
UpsellOutcome
|
||||
*************************************
|
||||
What was the outcome of the upsell?
|
||||
*/
|
||||
enum ESen_UpsellOutcome
|
||||
{
|
||||
eSen_UpsellOutcome_Undefined = 0,
|
||||
eSen_UpsellOutcome_Accepted = 1,
|
||||
eSen_UpsellOutcome_Declined = 2,
|
||||
eSen_UpsellOutcome_Went_To_Guide = 3,
|
||||
eSen_UpsellOutcome_Other = 4,
|
||||
};
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
AchievementGamerscore Value in gamerscore of the achievement
|
||||
AchievementID ID of achievement unlocked
|
||||
EnemyTypeID What type of enemy or challenge was the player facing? To prevent data-loss by overflowing the buffer, we recommend enemy type.
|
||||
EnemyWeaponID What weapon the enemy is holding or what counter/AI the enemy is taking to overcome a challenge
|
||||
EnrollmentType How did players enroll? (Using Kinect)
|
||||
LandscapeOrPortrait Are you currently showing in landscape or portrait mode? (Win8 only)
|
||||
LevelDurationInSeconds How long, total, has the user been playing in this level - whatever best represents this duration for attempting the level you'd like to track.
|
||||
LevelExitProgressStat1 Refers to the highest level performance metric for your game. For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed in the level before exiting.
|
||||
LevelExitProgressStat2 Refers to the highest level performance metric for your game. For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed in the level before exiting.
|
||||
LevelID This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game. Teams will have to provide the game mappings that correspond to the integers. The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game. The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand. Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. LevelID = 0 means undefined or unknown.
|
||||
LevelInstanceID Generated by the game every time LevelStart or LevelResume is called. This should be a unique ID (can be sequential) within a session.
|
||||
LowResMapX Player position normalized to 0-255
|
||||
LowResMapY Player position normalized to 0-255
|
||||
LowResMapZ Player position normalized to 0-255
|
||||
MapID Unique ID for the current map the player is on
|
||||
MarketplaceOfferID Unique ID for the Xbox LIVE marketplace offer that the upsell links to
|
||||
MicroGoodTypeID Describes the type of consumable or microgood
|
||||
MultiplayerInstanceID multiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session.
|
||||
NumberOfLocalPlayers the number of players that are playing together in the game locally in the current session (on the same piece of hardware)
|
||||
NumberOfOnlinePlayers the number of players that are playing together in the game online in the current session (not on the same piece of hardware)
|
||||
NumberOfSkeletonsInView the max and min of skeletons that were in view, regardless of enrollment
|
||||
OptionalSubLevelID Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown.
|
||||
OptionalSubModeID Used when a title has more heirarchy required. OptionalSubMode ID = 0 means undefined or unknown.
|
||||
PlayerLevelUpProgressStat1 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed.
|
||||
PlayerLevelUpProgressStat2 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed.
|
||||
PlayerWeaponID What weapon the player is holding or what approach/tact the player is taking to overcome a challenge
|
||||
PlayspaceFeedbackWarningDirection identifies which side of the playspace players are getting too close to that results in the playspace feedback
|
||||
SaveOrCheckpointID It is important that you also generate and save a unique SaveOrCheckpointID that can be read and reported when the player resumes from this save file or checkpoint. These IDs should be completely unique across the player’s experience, even if they play the same level multiple times. These IDs are critical to allowing us to re-stitch a player’s experience in your title and provide an accurate measure of time in level.
|
||||
SecondsSinceInitialize Number of seconds elapsed since Sentient initialize.
|
||||
SecondsSinceInitializeMax Number of seconds elapsed since Sentient initialize.
|
||||
SecondsSinceInitializeMin Number of seconds elapsed since Sentient initialize.
|
||||
SkeletonDistanceInInches Identifies the distance of the skeleton from the Kinect sensor
|
||||
TitleBuildID Build version of the title, used to track changes in development as well as patches/title updates
|
||||
*/
|
||||
|
||||
/*
|
||||
ModeID
|
||||
An in-game setting that significantly differentiates the play style of the game.
|
||||
(This should be captured as an integer and correspond to mode specific to the game.)
|
||||
Teams will have to provide the game mappings that correspond to the integers.
|
||||
The intent is to allow teams to capture data on the highest level categories of gameplay in their game.
|
||||
For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown.
|
||||
*/
|
||||
enum ETelem_ModeId
|
||||
{
|
||||
eTelem_ModeId_Undefined = 0,
|
||||
eTelem_ModeId_Survival,
|
||||
eTelem_ModeId_Creative, // Unused in current game version
|
||||
};
|
||||
|
||||
/*
|
||||
OptionalSubModeID
|
||||
Used when a title has more heirarchy required.
|
||||
OptionalSubMode ID = 0 means undefined or unknown.
|
||||
*/
|
||||
enum ETelem_SubModeId
|
||||
{
|
||||
eTelem_SubModeId_Undefined = 0,
|
||||
eTelem_SubModeId_Normal,
|
||||
eTelem_SubModeId_Tutorial,
|
||||
};
|
||||
|
||||
/*
|
||||
LevelID
|
||||
This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game.
|
||||
Teams will have to provide the game mappings that correspond to the integers.
|
||||
The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game.
|
||||
The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand.
|
||||
Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels.
|
||||
LevelID = 0 means undefined or unknown.
|
||||
*/
|
||||
enum ETelem_LevelId
|
||||
{
|
||||
eTelem_LevelId_Undefined = 0,
|
||||
eTelem_LevelId_PlayerGeneratedLevel = 1,
|
||||
// 4J Stu - We currently do not have any specific levels (other than the tutorial which is tracked as a mode) so this is unused at the moment
|
||||
};
|
||||
|
||||
/*
|
||||
OptionalSubLevelID
|
||||
Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown.
|
||||
*/
|
||||
enum ETelem_SubLevelId
|
||||
{
|
||||
eTelem_SubLevelId_Undefined = 0,
|
||||
eTelem_SubLevelId_Overworld,
|
||||
eTelem_SubLevelId_Nether,
|
||||
eTelem_SubLevelId_End,
|
||||
};
|
||||
|
||||
/*
|
||||
MenuID
|
||||
Describes the specific menu seen. MenuID = 0 means undefined or unknown.
|
||||
*/
|
||||
// 4J Stu - FOR REFERENCE ONLY - Should map 1:1 with the CConsoleMinecraftApp:EUIScene enum
|
||||
// Values that are commented out here are not currently reported
|
||||
enum ETelem_MenuId
|
||||
{
|
||||
//eTelemMenuId_PartnernetPassword = 0,
|
||||
//eTelemMenuId_Intro = 1,
|
||||
//eTelemMenuId_SaveMessage = 2,
|
||||
//eTelemMenuId_Main = 3,
|
||||
//eTelemMenuId_FullscreenProgress = 4,
|
||||
eTelemMenuId_Pause = 5,
|
||||
//eTelemMenuId_CraftingPanel_2x2 = 6,
|
||||
//eTelemMenuId_CraftingPanel_3x3 = 7,
|
||||
//eTelemMenuId_Furnace = 8,
|
||||
//eTelemMenuId_Container = 9,
|
||||
//eTelemMenuId_Largecontainer_small = 10,// for splitscreen
|
||||
//eTelemMenuId_Inventory = 11,
|
||||
//eTelemMenuId_Trap = 12,
|
||||
//eTelemMenuId_Debug = 13,
|
||||
//eTelemMenuId_DebugTips = 14,
|
||||
//eTelemMenuId_HelpAndOptions = 15,
|
||||
eTelemMenuId_HowToPlay = 16,
|
||||
//eTelemMenuId_HowToPlayMenu = 17,
|
||||
//eTelemMenuId_Controls = 18,
|
||||
//eTelemMenuId_Settings_Menu = 19,
|
||||
//eTelemMenuId_Settings_All = 20,
|
||||
//eTelemMenuId_Leaderboards = 21,
|
||||
//eTelemMenuId_Credits = 22,
|
||||
//eTelemMenuId_Death = 23,
|
||||
//eTelemMenuId_TutorialPopup = 24,
|
||||
eTelemMenuId_MultiGameCreate = 25,
|
||||
//eTelemMenuId_MultiGameJoinLoad = 26,
|
||||
eTelemMenuId_MultiGameInfo = 27,
|
||||
//eTelemMenuId_SignEntry = 28,
|
||||
//eTelemMenuId_InGameInfo = 29,
|
||||
//eTelemMenuId_ConnectingProgress = 30,
|
||||
eTelemMenuId_DLCOffers = 31,
|
||||
eTelemMenuId_SocialPost = 32,
|
||||
//eTelemMenuId_TrialExitUpsell = 33,
|
||||
eTelemMenuId_LoadSettings = 34,
|
||||
//eTelemMenuId_Chat = 35,
|
||||
//eTelemMenuId_Reinstall = 36,
|
||||
};
|
||||
|
||||
/*
|
||||
OptionalSubMenuID
|
||||
Used when a title has more heirarchy required. OptionalSubMenuID = 0 means undefined or unknown.
|
||||
*/
|
||||
enum ETelemetry_HowToPlay_SubMenuId
|
||||
{
|
||||
eTelemetryHowToPlay_Basics = 0,
|
||||
eTelemetryHowToPlay_HUD,
|
||||
eTelemetryHowToPlay_Inventory,
|
||||
eTelemetryHowToPlay_Chest,
|
||||
eTelemetryHowToPlay_LargeChest,
|
||||
eTelemetryHowToPlay_InventoryCrafting,
|
||||
eTelemetryHowToPlay_CraftTable,
|
||||
eTelemetryHowToPlay_Furnace,
|
||||
eTelemetryHowToPlay_Dispenser,
|
||||
eTelemetryHowToPlay_NetherPortal,
|
||||
};
|
||||
|
||||
/*
|
||||
EnemyTypeID What type of enemy or challenge was the player facing?
|
||||
To prevent data-loss by overflowing the buffer, we recommend enemy type.
|
||||
*/
|
||||
enum ETelemetryChallenges
|
||||
{
|
||||
eTelemetryChallenges_Unknown = 0,
|
||||
|
||||
eTelemetryTutorial_TrialStart,
|
||||
eTelemetryTutorial_Halfway,
|
||||
eTelemetryTutorial_Complete,
|
||||
|
||||
eTelemetryTutorial_Inventory,
|
||||
eTelemetryTutorial_Crafting,
|
||||
eTelemetryTutorial_Furnace,
|
||||
eTelemetryTutorial_Fishing,
|
||||
eTelemetryTutorial_Minecart,
|
||||
eTelemetryTutorial_Boat,
|
||||
eTelemetryTutorial_Bed,
|
||||
|
||||
eTelemetryTutorial_Redstone_And_Pistons,
|
||||
eTelemetryTutorial_Portal,
|
||||
eTelemetryTutorial_FoodBar,
|
||||
eTelemetryTutorial_CreativeMode,
|
||||
eTelemetryTutorial_BrewingMenu,
|
||||
|
||||
eTelemetryInGame_Ride_Minecart,
|
||||
eTelemetryInGame_Ride_Boat,
|
||||
eTelemetryInGame_Ride_Pig,
|
||||
eTelemetryInGame_UseBed,
|
||||
|
||||
eTelemetryTutorial_CreativeInventory, // Added TU5
|
||||
|
||||
eTelemetryTutorial_EnchantingMenu,
|
||||
eTelemetryTutorial_Brewing,
|
||||
eTelemetryTutorial_Enchanting,
|
||||
eTelemetryTutorial_Farming,
|
||||
|
||||
eTelemetryPlayerDeathSource_Fall,
|
||||
eTelemetryPlayerDeathSource_Lava,
|
||||
eTelemetryPlayerDeathSource_Fire,
|
||||
eTelemetryPlayerDeathSource_Water,
|
||||
eTelemetryPlayerDeathSource_Suffocate,
|
||||
eTelemetryPlayerDeathSource_OutOfWorld,
|
||||
eTelemetryPlayerDeathSource_Cactus,
|
||||
|
||||
eTelemetryPlayerDeathSource_Player_Weapon,
|
||||
eTelemetryPlayerDeathSource_Player_Arrow,
|
||||
|
||||
eTelemetryPlayerDeathSource_Explosion_Tnt,
|
||||
eTelemetryPlayerDeathSource_Explosion_Creeper,
|
||||
|
||||
eTelemetryPlayerDeathSource_Wolf,
|
||||
eTelemetryPlayerDeathSource_Zombie,
|
||||
eTelemetryPlayerDeathSource_Skeleton,
|
||||
eTelemetryPlayerDeathSource_Spider,
|
||||
eTelemetryPlayerDeathSource_Slime,
|
||||
eTelemetryPlayerDeathSource_Ghast,
|
||||
eTelemetryPlayerDeathSource_ZombiePigman,
|
||||
|
||||
eTelemetryTutorial_Breeding,
|
||||
eTelemetryTutorial_Golem,
|
||||
|
||||
eTelemetryTutorial_Anvil, // Added TU14
|
||||
eTelemetryTutorial_AnvilMenu,
|
||||
eTelemetryTutorial_Trading,
|
||||
eTelemetryTutorial_TradingMenu,
|
||||
eTelemetryTutorial_Enderchest,
|
||||
|
||||
eTelemetryTutorial_Horse,
|
||||
eTelemetryTutorial_HorseMenu,
|
||||
eTelemetryTutorial_Fireworks,
|
||||
eTelemetryTutorial_FireworksMenu,
|
||||
eTelemetryTutorial_Beacon,
|
||||
eTelemetryTutorial_BeaconMenu,
|
||||
eTelemetryTutorial_Hopper,
|
||||
eTelemetryTutorial_HopperMenu,
|
||||
|
||||
// Sent over network as a byte
|
||||
};
|
||||
@@ -0,0 +1,137 @@
|
||||
//
|
||||
// Class to handle and manage integration with social networks.
|
||||
// 4J Studios Ltd, 2011.
|
||||
// Andy West
|
||||
//
|
||||
|
||||
#ifndef _SOCIAL_MANAGER_H
|
||||
#define _SOCIAL_MANAGER_H
|
||||
|
||||
#include <xsocialpost.h>
|
||||
|
||||
#define MAX_SOCIALPOST_CAPTION 60
|
||||
#define MAX_SOCIALPOST_DESC 100
|
||||
|
||||
// XDK only provides for facebook so far. Others may follow!?
|
||||
enum ESocialNetwork
|
||||
{
|
||||
eFacebook = 0,
|
||||
eNumSocialNetworks
|
||||
};
|
||||
|
||||
|
||||
// Class follows singleton design pattern.
|
||||
class CSocialManager
|
||||
{
|
||||
private:
|
||||
// Default constructor, copy constructor and assignment operator are all private.
|
||||
CSocialManager();
|
||||
CSocialManager( const CSocialManager& );
|
||||
CSocialManager& operator= ( const CSocialManager& );
|
||||
|
||||
// Static private instance.
|
||||
static CSocialManager* m_pInstance;
|
||||
|
||||
// Bitset of title posting capability flags ( XSOCIAL_CAPABILITY_POSTIMAGE, XSOCIAL_CAPABILITY_POSTLINK ).
|
||||
DWORD m_dwSocialPostingCapability;
|
||||
|
||||
// Index of user who made current active request.
|
||||
DWORD m_dwCurrRequestUser;
|
||||
|
||||
// WESTY : Not sure if we even need to get social access key!
|
||||
/*
|
||||
// Size of the social network access key text buffer.
|
||||
DWORD m_dwAccessKeyTextSize;
|
||||
|
||||
// Pointer to the social network access key text buffer.
|
||||
LPWSTR m_pAccessKeyText;
|
||||
*/
|
||||
|
||||
// The various states of the manager.
|
||||
enum EState
|
||||
{
|
||||
eStateUnitialised = 0,
|
||||
eStateReady,
|
||||
eStateGetPostingCapability,
|
||||
eStatePostingImage,
|
||||
eStatePostingLink,
|
||||
};
|
||||
|
||||
|
||||
// Current state that manager is in.
|
||||
EState m_eCurrState;
|
||||
|
||||
// For xsocial asyncronous operations.
|
||||
XOVERLAPPED m_Overlapped;
|
||||
DWORD m_dwOverlappedResultCode;
|
||||
|
||||
// Social post preview image struct.
|
||||
XSOCIAL_PREVIEWIMAGE m_PostPreviewImage;
|
||||
|
||||
#ifdef _XBOX
|
||||
// Social post image params.
|
||||
XSOCIAL_IMAGEPOSTPARAMS m_PostImageParams;
|
||||
|
||||
// Social post link params.
|
||||
XSOCIAL_LINKPOSTPARAMS m_PostLinkParams;
|
||||
#endif
|
||||
|
||||
// Image details for posting an image to social network.
|
||||
unsigned char* m_pMainImageBuffer;
|
||||
DWORD m_dwMainImageBufferSize;
|
||||
|
||||
void DestroyMainPostImage();
|
||||
void DestroyPreviewPostImage();
|
||||
|
||||
// WESTY : Not sure if we even need to get social access key!
|
||||
/*
|
||||
bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect, DWORD dwUserTrackingIndex, bool bShowNetworkSignin );
|
||||
*/
|
||||
|
||||
public:
|
||||
// Retrieve singleton instance.
|
||||
static CSocialManager* Instance();
|
||||
|
||||
// To be called once during game init.
|
||||
void Initialise();
|
||||
|
||||
// Tick the social manager. Only does anything in async mode, polls for results of async actions.
|
||||
void Tick();
|
||||
|
||||
// May need to be called if something changes (i.e. player signs in to live ).
|
||||
bool RefreshPostingCapability();
|
||||
|
||||
// Returns true if any social newtork posting is allowed by us, false if not (if false, game must not display any social network UI).
|
||||
bool IsTitleAllowedToPostAnything();
|
||||
|
||||
// Returns true if we are allowed to post images to social networks.
|
||||
bool IsTitleAllowedToPostImages();
|
||||
|
||||
// Returns true if we are allowed to post links to social networks.
|
||||
bool IsTitleAllowedToPostLinks();
|
||||
|
||||
// Returns false if any of the live signed in users have disabled XPRIVILEGE_SOCIAL_NETWORK_SHARING
|
||||
bool AreAllUsersAllowedToPostImages();
|
||||
|
||||
// Post a test link to social network.
|
||||
bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect );
|
||||
|
||||
// Post a test image to social network.
|
||||
bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect );
|
||||
|
||||
void SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc);
|
||||
|
||||
// WESTY : Not sure if we even need to get social access key!
|
||||
/*
|
||||
// We do not currently know what this is used for. We may not even need it?
|
||||
bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect );
|
||||
*/
|
||||
|
||||
private:
|
||||
WCHAR m_wchTitleA[MAX_SOCIALPOST_CAPTION+1];
|
||||
WCHAR m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1];
|
||||
WCHAR m_wchDescA[MAX_SOCIALPOST_DESC+1];
|
||||
|
||||
};
|
||||
|
||||
#endif //_SOCIAL_MANAGER_H
|
||||
@@ -0,0 +1,133 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\Common\Consoles_App.h"
|
||||
#include "..\User.h"
|
||||
#include "..\..\Minecraft.Client\Minecraft.h"
|
||||
#include "..\..\Minecraft.Client\MinecraftServer.h"
|
||||
#include "..\..\Minecraft.Client\PlayerList.h"
|
||||
#include "..\..\Minecraft.Client\ServerPlayer.h"
|
||||
#include "..\..\Minecraft.World\Level.h"
|
||||
#include "..\..\Minecraft.World\LevelSettings.h"
|
||||
#include "..\..\Minecraft.World\BiomeSource.h"
|
||||
#include "..\..\Minecraft.World\LevelType.h"
|
||||
|
||||
CConsoleMinecraftApp app;
|
||||
|
||||
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
|
||||
{
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId)
|
||||
{
|
||||
ProfileManager.SetRichPresenceContextValue(iPad,CONTEXT_GAME_STATE,contextId);
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::StoreLaunchData()
|
||||
{
|
||||
}
|
||||
void CConsoleMinecraftApp::ExitGame()
|
||||
{
|
||||
}
|
||||
void CConsoleMinecraftApp::FatalLoadError()
|
||||
{
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::CaptureSaveThumbnail()
|
||||
{
|
||||
}
|
||||
void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize)
|
||||
{
|
||||
}
|
||||
void CConsoleMinecraftApp::ReleaseSaveThumbnail()
|
||||
{
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize)
|
||||
{
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit
|
||||
|
||||
app.setLevelGenerationOptions(NULL);
|
||||
|
||||
// From CScene_Main::RunPlayGame
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
app.ReleaseSaveThumbnail();
|
||||
ProfileManager.SetLockedProfile(0);
|
||||
pMinecraft->user->name = L"Windows";
|
||||
app.ApplyGameSettingsChanged(0);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameJoinLoad::OnInit
|
||||
MinecraftServer::resetFlags();
|
||||
|
||||
// From CScene_MultiGameJoinLoad::OnNotifyPressEx
|
||||
app.SetTutorialMode( false );
|
||||
app.SetCorruptSaveDeleted(false);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
||||
bool isFlat = false;
|
||||
__int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
|
||||
|
||||
NetworkGameInitData *param = new NetworkGameInitData();
|
||||
param->seed = seedValue;
|
||||
param->saveData = NULL;
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_Difficulty,0);
|
||||
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0);
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags,1);
|
||||
app.SetGameHostOption(eGameHostOption_BedrockFog,1);
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId() ); // LevelSettings::GAMETYPE_SURVIVAL
|
||||
app.SetGameHostOption(eGameHostOption_LevelType, 0 );
|
||||
app.SetGameHostOption(eGameHostOption_Structures, 1 );
|
||||
app.SetGameHostOption(eGameHostOption_BonusChest, 0 );
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_PvP, 1);
|
||||
app.SetGameHostOption(eGameHostOption_TrustPlayers, 1 );
|
||||
app.SetGameHostOption(eGameHostOption_FireSpreads, 1 );
|
||||
app.SetGameHostOption(eGameHostOption_TNT, 1 );
|
||||
app.SetGameHostOption(eGameHostOption_HostCanFly, 1);
|
||||
app.SetGameHostOption(eGameHostOption_HostCanChangeHunger, 1);
|
||||
app.SetGameHostOption(eGameHostOption_HostCanBeInvisible, 1 );
|
||||
|
||||
param->settings = app.GetGameHostOption( eGameHostOption_All );
|
||||
|
||||
g_NetworkManager.FakeLocalPlayerJoined();
|
||||
|
||||
LoadingInputParams *loadingParams = new LoadingInputParams();
|
||||
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
|
||||
loadingParams->lpParam = (LPVOID)param;
|
||||
|
||||
// Reset the autosave time
|
||||
app.SetAutosaveTimerTime();
|
||||
|
||||
C4JThread* thread = new C4JThread(loadingParams->func, loadingParams->lpParam, "RunNetworkGame");
|
||||
thread->Run();
|
||||
}
|
||||
|
||||
int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
class CConsoleMinecraftApp : public CMinecraftApp
|
||||
{
|
||||
public:
|
||||
CConsoleMinecraftApp();
|
||||
|
||||
virtual void SetRichPresenceContext(int iPad, int contextId);
|
||||
|
||||
virtual void StoreLaunchData();
|
||||
virtual void ExitGame();
|
||||
virtual void FatalLoadError();
|
||||
|
||||
virtual void CaptureSaveThumbnail();
|
||||
virtual void GetSaveThumbnail(PBYTE*,DWORD*);
|
||||
virtual void ReleaseSaveThumbnail();
|
||||
virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize);
|
||||
|
||||
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile);
|
||||
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt);
|
||||
|
||||
virtual void FreeLocalTMSFiles(eTMSFileType eType);
|
||||
virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG);
|
||||
|
||||
// BANNED LEVEL LIST
|
||||
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {}
|
||||
|
||||
C4JStringTable *GetStringTable() { return NULL;}
|
||||
|
||||
// original code
|
||||
virtual void TemporaryCreateGameStart();
|
||||
};
|
||||
|
||||
extern CConsoleMinecraftApp app;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,189 @@
|
||||
#include "stdafx.h"
|
||||
#include "Windows64_UIController.h"
|
||||
|
||||
// Temp
|
||||
#include "..\Minecraft.h"
|
||||
#include "..\Textures.h"
|
||||
|
||||
#define _ENABLEIGGY
|
||||
|
||||
ConsoleUIController ui;
|
||||
|
||||
void ConsoleUIController::init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D11RenderTargetView* pRenderTargetView, ID3D11DepthStencilView* pDepthStencilView, S32 w, S32 h)
|
||||
{
|
||||
#ifdef _ENABLEIGGY
|
||||
m_pRenderTargetView = pRenderTargetView;
|
||||
m_pDepthStencilView = pDepthStencilView;
|
||||
|
||||
// Shared init
|
||||
preInit(w,h);
|
||||
|
||||
gdraw_funcs = gdraw_D3D11_CreateContext(dev, ctx, w, h);
|
||||
|
||||
if(!gdraw_funcs)
|
||||
{
|
||||
app.DebugPrintf("Failed to initialise GDraw!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
/* For each of the resource types, we specify the size of the cache that
|
||||
GDraw will use. We specify both the number of possible objects
|
||||
(the number of "handles") of each type, and the maximum memory
|
||||
to use for each one.
|
||||
|
||||
For some platforms, we would actually pass
|
||||
in the memory to use, and the GDraw will strictly obey the resource
|
||||
request. For D3D, storage is managed by D3D, and GDraw only
|
||||
approximates the requested storage amount. In fact, you don't
|
||||
even have to set these at all for D3D, which has some "reasonable" defaults,
|
||||
but we'll set it here for clarity.
|
||||
(The storage required for
|
||||
the handles is separate, and always allocated through the global allocator
|
||||
specified in IggyInit.)
|
||||
|
||||
The size that's actually needed here depends on the content of your
|
||||
Flash file. There's more info in the documentation about how to
|
||||
determine how big they should be. But for now, we'll just set them
|
||||
really big so if you substitute a different file it should work. */
|
||||
gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_vertexbuffer, 5000, 16 * 1024 * 1024);
|
||||
gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_texture , 5000, 128 * 1024 * 1024);
|
||||
gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_rendertarget, 10, 32 * 1024 * 1024);
|
||||
|
||||
/* GDraw is all set, so we'll point Iggy at it. */
|
||||
IggySetGDraw(gdraw_funcs);
|
||||
|
||||
/* Flash content can have audio embedded. We'd like to be able
|
||||
to play back any audio there is in the Flash that we load,
|
||||
but in this tutorial we don't care about processing the sound
|
||||
ourselves. So we call $IggyAudioUseDirectSound to tell Iggy
|
||||
to go ahead and send any sound from the Flash movie directly
|
||||
to Win32's default DirectSound device. */
|
||||
IggyAudioUseDirectSound();
|
||||
|
||||
// Shared init
|
||||
postInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConsoleUIController::render()
|
||||
{
|
||||
#ifdef _ENABLEIGGY
|
||||
/* Now that we've cleared, we need to tell GDraw which
|
||||
render target to use, what depth/stencil buffer to use,
|
||||
and where the origin should be.
|
||||
|
||||
If we were using multisampling, we'd also need to give
|
||||
GDraw a render target view for a non-multisampled texture
|
||||
the size of main_rtv as a resolve target (this is the third
|
||||
parameter). But since we're not using multisampling in this
|
||||
example, no resolve targets are required. */
|
||||
gdraw_D3D11_SetTileOrigin( m_pRenderTargetView,
|
||||
m_pDepthStencilView,
|
||||
NULL,
|
||||
0,
|
||||
0 );
|
||||
|
||||
renderScenes();
|
||||
|
||||
/* Finally we're ready to display the frame. We call GDraw to
|
||||
let it know we're done rendering, so it can do any finalization
|
||||
it needs to do. */
|
||||
gdraw_D3D11_NoMoreGDrawThisFrame();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConsoleUIController::beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion)
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Starting Iggy custom draw\n");
|
||||
|
||||
PIXBeginNamedEvent(0,"Gdraw setup");
|
||||
// get the correct object-to-world matrix from GDraw, and set the render state to a normal state
|
||||
gdraw_D3D11_BeginCustomDraw_4J(region, customDrawRegion->mat);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
CustomDrawData *ConsoleUIController::setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region)
|
||||
{
|
||||
CustomDrawData *customDrawRegion = new CustomDrawData();
|
||||
customDrawRegion->x0 = region->x0;
|
||||
customDrawRegion->x1 = region->x1;
|
||||
customDrawRegion->y0 = region->y0;
|
||||
customDrawRegion->y1 = region->y1;
|
||||
|
||||
PIXBeginNamedEvent(0,"Starting Iggy custom draw\n");
|
||||
// get the correct object-to-world matrix from GDraw, and set the render state to a normal state
|
||||
gdraw_D3D11_BeginCustomDraw_4J(region, customDrawRegion->mat);
|
||||
|
||||
setupCustomDrawGameStateAndMatrices(scene, customDrawRegion);
|
||||
|
||||
return customDrawRegion;
|
||||
}
|
||||
|
||||
CustomDrawData *ConsoleUIController::calculateCustomDraw(IggyCustomDrawCallbackRegion *region)
|
||||
{
|
||||
CustomDrawData *customDrawRegion = new CustomDrawData();
|
||||
customDrawRegion->x0 = region->x0;
|
||||
customDrawRegion->x1 = region->x1;
|
||||
customDrawRegion->y0 = region->y0;
|
||||
customDrawRegion->y1 = region->y1;
|
||||
|
||||
gdraw_D3D11_CalculateCustomDraw_4J(region, customDrawRegion->mat);
|
||||
|
||||
return customDrawRegion;
|
||||
}
|
||||
|
||||
void ConsoleUIController::endCustomDraw(IggyCustomDrawCallbackRegion *region)
|
||||
{
|
||||
endCustomDrawGameStateAndMatrices();
|
||||
|
||||
gdraw_D3D11_EndCustomDraw(region);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
void ConsoleUIController::setTileOrigin(S32 xPos, S32 yPos)
|
||||
{
|
||||
gdraw_D3D11_SetTileOrigin( m_pRenderTargetView,
|
||||
m_pDepthStencilView,
|
||||
NULL,
|
||||
xPos,
|
||||
yPos );
|
||||
}
|
||||
|
||||
GDrawTexture *ConsoleUIController::getSubstitutionTexture(int textureId)
|
||||
{
|
||||
/* Create a wrapped texture from a shader resource view.
|
||||
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. */
|
||||
ID3D11ShaderResourceView *tex = RenderManager.TextureGetTexture(textureId);
|
||||
ID3D11Resource *resource;
|
||||
tex->GetResource(&resource);
|
||||
ID3D11Texture2D *tex2d = (ID3D11Texture2D *)resource;
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
tex2d->GetDesc(&desc);
|
||||
GDrawTexture *gdrawTex = gdraw_D3D11_WrappedTextureCreate(tex);
|
||||
return gdrawTex;
|
||||
}
|
||||
|
||||
void ConsoleUIController::destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle)
|
||||
{
|
||||
/* Destroys the GDraw wrapper for a wrapped texture object. This will free up
|
||||
a GDraw texture handle but not release the associated D3D texture; that is
|
||||
up to you. */
|
||||
gdraw_D3D11_WrappedTextureDestroy(handle);
|
||||
}
|
||||
|
||||
void ConsoleUIController::shutdown()
|
||||
{
|
||||
#ifdef _ENABLEIGGY
|
||||
/* Destroy the GDraw context. This frees all resources, shaders etc.
|
||||
allocated by GDraw. Note this is only safe to call after all
|
||||
active Iggy player have been destroyed! */
|
||||
gdraw_D3D11_DestroyContext();
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "..\Common\UI\UIController.h"
|
||||
|
||||
class ConsoleUIController : public UIController
|
||||
{
|
||||
private:
|
||||
ID3D11RenderTargetView* m_pRenderTargetView;
|
||||
ID3D11DepthStencilView* m_pDepthStencilView;
|
||||
public:
|
||||
void init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D11RenderTargetView* pRenderTargetView, ID3D11DepthStencilView* pDepthStencilView, S32 w, S32 h);
|
||||
|
||||
void render();
|
||||
void beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion);
|
||||
virtual CustomDrawData *setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region);
|
||||
virtual CustomDrawData *calculateCustomDraw(IggyCustomDrawCallbackRegion *region);
|
||||
virtual void endCustomDraw(IggyCustomDrawCallbackRegion *region);
|
||||
|
||||
protected:
|
||||
virtual void setTileOrigin(S32 xPos, S32 yPos);
|
||||
|
||||
public:
|
||||
GDrawTexture *getSubstitutionTexture(int textureId);
|
||||
void destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle);
|
||||
|
||||
public:
|
||||
void shutdown();
|
||||
};
|
||||
|
||||
extern ConsoleUIController ui;
|
||||
@@ -0,0 +1,156 @@
|
||||
// 4J-PB -
|
||||
// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG).
|
||||
// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples.
|
||||
// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples.
|
||||
// You are encouraged to incorporate this code into your titles.
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// AtgXmlParser.h
|
||||
//
|
||||
// XMLParser and SAX interface declaration
|
||||
//
|
||||
// Xbox Advanced Technology Group
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
#ifndef ATGXMLPARSER_H
|
||||
#define ATGXMLPARSER_H
|
||||
|
||||
namespace ATG
|
||||
{
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// error returns from XMLParse
|
||||
//-----------------------------------------------------------------------------
|
||||
#define _ATGFAC 0x61B
|
||||
#define E_COULD_NOT_OPEN_FILE MAKE_HRESULT(1, _ATGFAC, 0x0001 )
|
||||
#define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002 )
|
||||
|
||||
|
||||
CONST UINT XML_MAX_ATTRIBUTES_PER_ELEMENT = 32;
|
||||
CONST UINT XML_MAX_NAME_LENGTH = 128;
|
||||
CONST UINT XML_READ_BUFFER_SIZE = 2048;
|
||||
CONST UINT XML_WRITE_BUFFER_SIZE = 2048;
|
||||
|
||||
// No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned if
|
||||
// it is
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
struct XMLAttribute
|
||||
{
|
||||
WCHAR* strName;
|
||||
UINT NameLen;
|
||||
WCHAR* strValue;
|
||||
UINT ValueLen;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
class ISAXCallback
|
||||
{
|
||||
friend class XMLParser;
|
||||
public:
|
||||
ISAXCallback() {};
|
||||
virtual ~ISAXCallback() {};
|
||||
|
||||
virtual HRESULT StartDocument() = 0;
|
||||
virtual HRESULT EndDocument() = 0;
|
||||
|
||||
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
|
||||
CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0;
|
||||
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0;
|
||||
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0;
|
||||
|
||||
virtual HRESULT CDATABegin( ) = 0;
|
||||
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0;
|
||||
virtual HRESULT CDATAEnd( ) = 0;
|
||||
|
||||
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
|
||||
|
||||
virtual VOID SetParseProgress( DWORD dwProgress ) { }
|
||||
|
||||
const CHAR* GetFilename() { return m_strFilename; }
|
||||
UINT GetLineNumber() { return m_LineNum; }
|
||||
UINT GetLinePosition() { return m_LinePos; }
|
||||
|
||||
private:
|
||||
CONST CHAR *m_strFilename;
|
||||
UINT m_LineNum;
|
||||
UINT m_LinePos;
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
class XMLParser
|
||||
{
|
||||
public:
|
||||
XMLParser();
|
||||
~XMLParser();
|
||||
|
||||
// Register an interface inheiriting from ISAXCallback
|
||||
VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback );
|
||||
|
||||
// Get the registered interface
|
||||
ISAXCallback* GetSAXCallbackInterface();
|
||||
|
||||
// ParseXMLFile returns one of the following:
|
||||
// E_COULD_NOT_OPEN_FILE - couldn't open the file
|
||||
// E_INVALID_XML_SYNTAX - bad XML syntax according to this parser
|
||||
// E_NOINTERFACE - RegisterSAXCallbackInterface not called
|
||||
// E_ABORT - callback returned a fail code
|
||||
// S_OK - file parsed and completed
|
||||
|
||||
HRESULT ParseXMLFile( CONST CHAR *strFilename );
|
||||
|
||||
// Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will
|
||||
// correctly detect it and use unicode instead. Return codes are the
|
||||
// same as for ParseXMLFile
|
||||
|
||||
HRESULT ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize );
|
||||
|
||||
private:
|
||||
HRESULT MainParseLoop();
|
||||
|
||||
HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE );
|
||||
VOID SkipNextAdvance();
|
||||
|
||||
HRESULT ConsumeSpace();
|
||||
HRESULT ConvertEscape();
|
||||
HRESULT AdvanceElement();
|
||||
HRESULT AdvanceName();
|
||||
HRESULT AdvanceAttrVal();
|
||||
HRESULT AdvanceCDATA();
|
||||
HRESULT AdvanceComment();
|
||||
|
||||
VOID FillBuffer();
|
||||
|
||||
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
|
||||
VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... );
|
||||
#else
|
||||
VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... );
|
||||
#endif
|
||||
|
||||
ISAXCallback* m_pISAXCallback;
|
||||
|
||||
HANDLE m_hFile;
|
||||
CONST CHAR* m_pInXMLBuffer;
|
||||
UINT m_uInXMLBufferCharsLeft;
|
||||
DWORD m_dwCharsTotal;
|
||||
DWORD m_dwCharsConsumed;
|
||||
|
||||
BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL
|
||||
WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
|
||||
|
||||
BYTE* m_pReadPtr;
|
||||
WCHAR* m_pWritePtr; // write pointer within m_pBuf
|
||||
|
||||
BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
|
||||
BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
|
||||
|
||||
BOOL m_bSkipNextAdvance;
|
||||
WCHAR m_Ch; // Current character being parsed
|
||||
};
|
||||
|
||||
} // namespace ATG
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define VER_PRODUCTMAJORVERSION 0
|
||||
#define VER_PRODUCTMINORVERSION 0
|
||||
#define VER_PRODUCTBUILD 170
|
||||
#define VER_PRODUCTBUILD_QFE 0
|
||||
|
||||
#define VER_FILEVERSION_STRING "1.1"
|
||||
#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING
|
||||
#define VER_FILEVERSION_STRING_W L"1.1"
|
||||
#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W
|
||||
|
||||
#define VER_FILEBETA_STR ""
|
||||
#undef VER_FILEVERSION
|
||||
#define VER_FILEVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE
|
||||
#define VER_PRODUCTVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE
|
||||
|
||||
#if (VER_PRODUCTBUILD < 10)
|
||||
#define VER_FILEBPAD "000"
|
||||
#define VER_FILEBPAD_W L"000"
|
||||
#elif (VER_PRODUCTBUILD < 100)
|
||||
#define VER_FILEBPAD "00"
|
||||
#define VER_FILEBPAD_W L"00"
|
||||
#elif (VER_PRODUCTBUILD < 1000)
|
||||
#define VER_FILEBPAD "0"
|
||||
#define VER_FILEBPAD_W L"0"
|
||||
#else
|
||||
#define VER_FILEBPAD
|
||||
#define VER_FILEBPAD_W
|
||||
#endif
|
||||
|
||||
#define VER_WIDE_PREFIX(x) L##x
|
||||
|
||||
#define VER_FILEVERSION_STR2(x,y) VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y
|
||||
#define VER_FILEVERSION_STR2_W(x,y) VER_FILEVERSION_STRING_W L"." VER_FILEBPAD_W VER_WIDE_PREFIX(#x) L"." VER_WIDE_PREFIX(#y)
|
||||
#define VER_FILEVERSION_STR1(x,y) VER_FILEVERSION_STR2(x, y)
|
||||
#define VER_FILEVERSION_STR1_W(x,y) VER_FILEVERSION_STR2_W(x, y)
|
||||
|
||||
#undef VER_FILEVERSION_STR
|
||||
#define VER_FILEVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
#define VER_FILEVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
#define VER_PRODUCTVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
#if (VER_PRODUCTBUILD_QFE >= 256)
|
||||
#error "QFE number cannot exceed 255"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user