mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 12:13:51 +00:00
Get rid of MSVC's __int64
Use either int64_t, uint64_t or long long and unsigned long long, defined as per C++11 standard
This commit is contained in:
parent
d6ec138710
commit
d63f79325f
308 changed files with 5371 additions and 5379 deletions
|
|
@ -13,7 +13,7 @@ private:
|
|||
wstring title;
|
||||
wstring desc;
|
||||
Achievement *ach;
|
||||
__int64 startTime;
|
||||
int64_t startTime;
|
||||
ItemRenderer *ir;
|
||||
bool isHelper;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -28,7 +28,7 @@ typedef struct _JoinFromInviteData
|
|||
DWORD dwUserIndex; // dwUserIndex
|
||||
DWORD dwLocalUsersMask; // dwUserMask
|
||||
const INVITE_INFO *pInviteInfo; // pInviteInfo
|
||||
}
|
||||
}
|
||||
JoinFromInviteData;
|
||||
|
||||
class Player;
|
||||
|
|
@ -50,7 +50,7 @@ class Merchant;
|
|||
|
||||
class CMinecraftAudio;
|
||||
|
||||
class CMinecraftApp
|
||||
class CMinecraftApp
|
||||
|
||||
#ifdef _XBOX
|
||||
: public CXuiModule
|
||||
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
#ifdef _EXTENDED_ACHIEVEMENTS
|
||||
/* 4J-JEV:
|
||||
* We need more space in the profile data because of the new achievements and statistics
|
||||
* We need more space in the profile data because of the new achievements and statistics
|
||||
* necessary for the new expanded achievement set.
|
||||
*/
|
||||
static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user
|
||||
|
|
@ -108,7 +108,7 @@ public:
|
|||
static const int USER_RR = 5;
|
||||
static const int USER_SR = 6;
|
||||
static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console
|
||||
|
||||
|
||||
void HandleButtonPresses();
|
||||
bool IntroRunning() { return m_bIntroRunning;}
|
||||
void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;}
|
||||
|
|
@ -152,14 +152,14 @@ public:
|
|||
void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;}
|
||||
eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];}
|
||||
void SetAction(int iPad, eXuiAction action, LPVOID param = NULL);
|
||||
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
|
||||
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
|
||||
eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];}
|
||||
eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];}
|
||||
LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];}
|
||||
void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
|
||||
eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
|
||||
void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
|
||||
|
||||
|
||||
DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; }
|
||||
void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; }
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ public:
|
|||
#endif
|
||||
virtual void SetRichPresenceContext(int iPad, int contextId) = 0;
|
||||
|
||||
|
||||
|
||||
void SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucVal);
|
||||
unsigned char GetGameSettings(int iPad,eGameSetting eVal);
|
||||
unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad
|
||||
|
|
@ -268,7 +268,7 @@ public:
|
|||
void SetGameSettingsDebugMask(int iPad, unsigned int uiVal);
|
||||
void ActionDebugMask(int iPad, bool bSetAllClear=false);
|
||||
|
||||
//
|
||||
//
|
||||
bool IsLocalMultiplayerAvailable();
|
||||
|
||||
// for sign in change monitoring
|
||||
|
|
@ -343,7 +343,7 @@ public:
|
|||
|
||||
// Texture Pack Data files (icon, banner, comparison shot & text)
|
||||
void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes);
|
||||
void RemoveMemoryTPDFile(int iConfig);
|
||||
void RemoveMemoryTPDFile(int iConfig);
|
||||
bool IsFileInTPD(int iConfig);
|
||||
void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes);
|
||||
int GetTPDSize() {return m_MEM_TPD.size();}
|
||||
|
|
@ -424,11 +424,11 @@ public:
|
|||
byteArray getArchiveFile(const wstring &filename);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
static int BannedLevelDialogReturned(void *pParam,int iPad,const C4JStorage::EMessageResult);
|
||||
static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
|
||||
VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT];
|
||||
|
||||
VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT];
|
||||
|
||||
void HandleButtonPresses(int iPad);
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ private:
|
|||
|
||||
static unsigned int m_uiLastSignInData;
|
||||
|
||||
// We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings
|
||||
// We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings
|
||||
GAME_SETTINGS *GameSettingsA[XUSER_MAX_COUNT];
|
||||
|
||||
// For promo work
|
||||
|
|
@ -489,7 +489,7 @@ public:
|
|||
// trial timer
|
||||
void SetTrialTimerStart(void);
|
||||
float getTrialTimer(void);
|
||||
|
||||
|
||||
// notifications from the game for qnet
|
||||
VNOTIFICATIONS *GetNotifications() {return &m_vNotifications;}
|
||||
|
||||
|
|
@ -501,7 +501,7 @@ private:
|
|||
eXuiAction m_eXuiAction[XUSER_MAX_COUNT];
|
||||
eTMSAction m_eTMSAction[XUSER_MAX_COUNT];
|
||||
LPVOID m_eXuiActionParam[XUSER_MAX_COUNT];
|
||||
eXuiAction m_eGlobalXuiAction;
|
||||
eXuiAction m_eGlobalXuiAction;
|
||||
eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT];
|
||||
LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT];
|
||||
eXuiServerAction m_eGlobalXuiServerAction;
|
||||
|
|
@ -525,20 +525,20 @@ private:
|
|||
// Trial timer
|
||||
float m_fTrialTimerStart,mfTrialPausedTime;
|
||||
typedef struct TimeInfo
|
||||
{
|
||||
LARGE_INTEGER qwTime;
|
||||
LARGE_INTEGER qwAppTime;
|
||||
{
|
||||
LARGE_INTEGER qwTime;
|
||||
LARGE_INTEGER qwAppTime;
|
||||
|
||||
float fAppTime;
|
||||
float fElapsedTime;
|
||||
float fSecsPerTick;
|
||||
} TIMEINFO;
|
||||
float fAppTime;
|
||||
float fElapsedTime;
|
||||
float fSecsPerTick;
|
||||
} TIMEINFO;
|
||||
|
||||
TimeInfo m_Time;
|
||||
|
||||
protected:
|
||||
static const int MAX_TIPS_GAMETIP = 50;
|
||||
static const int MAX_TIPS_TRIVIATIP = 20;
|
||||
static const int MAX_TIPS_GAMETIP = 50;
|
||||
static const int MAX_TIPS_TRIVIATIP = 20;
|
||||
static TIPSTRUCT m_GameTipA[MAX_TIPS_GAMETIP];
|
||||
static TIPSTRUCT m_TriviaTipA[MAX_TIPS_TRIVIATIP];
|
||||
static Random *TipRandom;
|
||||
|
|
@ -590,7 +590,7 @@ public:
|
|||
DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId);
|
||||
DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName);
|
||||
#else
|
||||
static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile);
|
||||
static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, uint64_t, uint64_t, WCHAR *, unsigned int, int, WCHAR *pDataFile);
|
||||
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
|
||||
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
|
||||
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
|
||||
|
|
@ -618,7 +618,7 @@ private:
|
|||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
||||
static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||
static unordered_map<string,DLC_INFO * > DLCInfo;
|
||||
static unordered_map<string,DLC_INFO * > DLCInfo;
|
||||
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
|
||||
#elif defined(_DURANGO)
|
||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
||||
|
|
@ -701,7 +701,7 @@ public:
|
|||
|
||||
// World seed from png image
|
||||
void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack);
|
||||
unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId);
|
||||
unsigned int CreateImageTextData(PBYTE bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId);
|
||||
|
||||
// Game rules
|
||||
GameRuleManager m_gameRules;
|
||||
|
|
@ -745,7 +745,7 @@ public:
|
|||
unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false);
|
||||
int GetDLCInfoTexturesOffersCount();
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
DLC_INFO *GetDLCInfo(int iIndex);
|
||||
DLC_INFO *GetDLCInfo(int iIndex);
|
||||
DLC_INFO *GetDLCInfo(char *);
|
||||
DLC_INFO *GetDLCInfoFromTPackID(int iTPID);
|
||||
bool GetDLCNameForPackID(const int iPackID,char **ppchKeyID);
|
||||
|
|
@ -887,15 +887,15 @@ public:
|
|||
#ifdef _XBOX
|
||||
// bool m_bTransferSavesToXboxOne;
|
||||
// unsigned int m_uiTransferSlotC;
|
||||
|
||||
|
||||
#elif defined (__PS3__)
|
||||
|
||||
|
||||
#elif defined _DURANGO
|
||||
|
||||
|
||||
#elif defined _WINDOWS64
|
||||
//CMinecraftAudio audio;
|
||||
#else // PS4
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
|
|
@ -907,5 +907,5 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
//singleton
|
||||
//singleton
|
||||
//extern CMinecraftApp app;
|
||||
|
|
|
|||
|
|
@ -19,17 +19,17 @@ private:
|
|||
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
||||
int m_dimension;
|
||||
|
||||
__int64 m_totalBlocksChanged;
|
||||
__int64 m_totalBlocksChangedLighting;
|
||||
int64_t m_totalBlocksChanged;
|
||||
int64_t m_totalBlocksChangedLighting;
|
||||
bool m_completed;
|
||||
|
||||
void updateLocationBox();
|
||||
public:
|
||||
public:
|
||||
ApplySchematicRuleDefinition(LevelGenerationOptions *levelGenOptions);
|
||||
~ApplySchematicRuleDefinition();
|
||||
|
||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; }
|
||||
|
||||
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos)
|
|||
dos->writeInt(m_zSize);
|
||||
|
||||
byteArray ba(new BYTE[ m_data.length ], m_data.length);
|
||||
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
||||
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
||||
m_data.data, m_data.length);
|
||||
|
||||
dos->writeInt(ba.length);
|
||||
|
|
@ -71,13 +71,13 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
|||
m_ySize = dis->readInt();
|
||||
m_zSize = dis->readInt();
|
||||
|
||||
int compressedSize = dis->readInt();
|
||||
int compressedSize = dis->readInt();
|
||||
byteArray compressedBuffer(compressedSize);
|
||||
dis->readFully(compressedBuffer);
|
||||
|
||||
if(m_data.data != NULL)
|
||||
{
|
||||
delete [] m_data.data;
|
||||
delete [] m_data.data;
|
||||
m_data.data = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
|||
double z = pos->get(2)->data;
|
||||
|
||||
if( type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
{
|
||||
x = ((IntTag *) eTag->get(L"TileX") )->data;
|
||||
y = ((IntTag *) eTag->get(L"TileY") )->data;
|
||||
z = ((IntTag *) eTag->get(L"TileZ") )->data;
|
||||
|
|
@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
|
|||
delete tag;
|
||||
}
|
||||
|
||||
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
{
|
||||
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
||||
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
||||
|
|
@ -281,7 +281,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
|||
// blockData[i] = Tile::whiteStone_Id;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
PIXBeginNamedEvent(0,"Setting Block data");
|
||||
chunk->setBlockData(blockData);
|
||||
PIXEndNamedEvent();
|
||||
|
|
@ -323,7 +323,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
|||
|
||||
// At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so
|
||||
// we can do the sort of lighting that might propagate out of the chunk.
|
||||
__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
{
|
||||
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
||||
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
||||
|
|
@ -447,7 +447,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
|||
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
|
||||
|
||||
if ( teCopy != NULL )
|
||||
{
|
||||
{
|
||||
CompoundTag *teData = new CompoundTag();
|
||||
te->save(teData);
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
|||
for(AUTO_VAR(it, m_entities.begin()); it != m_entities.end();)
|
||||
{
|
||||
Vec3 *source = it->first;
|
||||
|
||||
|
||||
double targetX = source->x;
|
||||
double targetY = source->y + destinationBox->y0;
|
||||
double targetZ = source->z;
|
||||
|
|
@ -500,7 +500,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
|||
if( e->GetType() == eTYPE_PAINTING )
|
||||
{
|
||||
shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
|
||||
|
||||
|
||||
double tileX = painting->xTile;
|
||||
double tileZ = painting->zTile;
|
||||
schematicCoordToChunkCoord(destinationBox, painting->xTile, painting->zTile, rot, tileX, tileZ);
|
||||
|
|
@ -513,7 +513,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
|||
else if( e->GetType() == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
|
||||
|
||||
|
||||
double tileX = frame->xTile;
|
||||
double tileZ = frame->zTile;
|
||||
schematicCoordToChunkCoord(destinationBox, frame->xTile, frame->zTile, rot, tileX, tileZ);
|
||||
|
|
@ -561,7 +561,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
|||
zStart-=1;
|
||||
else if(zStart < 0 && zStart%2 !=0)
|
||||
zStart-=1;
|
||||
|
||||
|
||||
// We want the end to be odd to have a total size that is even
|
||||
if(xEnd > 0 && xEnd%2 == 0)
|
||||
xEnd+=1;
|
||||
|
|
@ -615,7 +615,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
|||
|
||||
// Every x is a whole row
|
||||
for(int xPos = xStart; xPos < xStart + xSize; ++xPos)
|
||||
{
|
||||
{
|
||||
int xc = xPos >> 4;
|
||||
|
||||
int x0 = xPos - xc * 16;
|
||||
|
|
@ -624,7 +624,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
|||
if (x1 > 16) x1 = 16;
|
||||
|
||||
for(int zPos = zStart; zPos < zStart + zSize;)
|
||||
{
|
||||
{
|
||||
int zc = zPos >> 4;
|
||||
|
||||
int z0 = zStart - zc * 16;
|
||||
|
|
@ -718,7 +718,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
|||
{
|
||||
CompoundTag *eTag = new CompoundTag();
|
||||
if( e->save(eTag) )
|
||||
{
|
||||
{
|
||||
ListTag<DoubleTag> *pos = (ListTag<DoubleTag> *) eTag->getList(L"Pos");
|
||||
|
||||
pos->get(0)->data -= xStart;
|
||||
|
|
@ -726,7 +726,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
|||
pos->get(2)->data -= zStart;
|
||||
|
||||
if( e->GetType() == eTYPE_PAINTING || e->GetType() == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
{
|
||||
((IntTag *) eTag->get(L"TileX") )->data -= xStart;
|
||||
((IntTag *) eTag->get(L"TileY") )->data -= yStart;
|
||||
((IntTag *) eTag->get(L"TileZ") )->data -= zStart;
|
||||
|
|
@ -767,7 +767,7 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk *chunk, byteArray *data,
|
|||
// skyLightP += skyLightData.length;
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
bool bHasLower, bHasUpper;
|
||||
bHasLower = bHasUpper = false;
|
||||
int lowerY0, lowerY1, upperY0, upperY1;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ private:
|
|||
vector<shared_ptr<TileEntity> > m_tileEntities;
|
||||
vector< pair<Vec3 *, CompoundTag *> > m_entities;
|
||||
|
||||
public:
|
||||
public:
|
||||
byteArray m_data;
|
||||
|
||||
public:
|
||||
|
|
@ -72,8 +72,8 @@ public:
|
|||
void save(DataOutputStream *dos);
|
||||
void load(DataInputStream *dis);
|
||||
|
||||
__int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
__int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
|
||||
static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public:
|
|||
typedef struct _ValueType
|
||||
{
|
||||
union{
|
||||
__int64 i64;
|
||||
int64_t i64;
|
||||
int i;
|
||||
char c;
|
||||
bool b;
|
||||
|
|
@ -44,7 +44,7 @@ public:
|
|||
virtual ~GameRule();
|
||||
|
||||
Connection *getConnection() { return m_connection; }
|
||||
|
||||
|
||||
ValueType getParameter(const wstring ¶meterName);
|
||||
void setParameter(const wstring ¶meterName,ValueType value);
|
||||
GameRuleDefinition *getGameRuleDefinition();
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ WCHAR *GameRuleManager::wchAttrNameA[] =
|
|||
L"spawnY", // eGameRuleAttr_spawnY
|
||||
L"spawnZ", // eGameRuleAttr_spawnZ
|
||||
L"orientation",
|
||||
L"dimension",
|
||||
L"dimension",
|
||||
L"topTileId", // eGameRuleAttr_topTileId
|
||||
L"biomeId", // eGameRuleAttr_biomeId
|
||||
L"feature", // eGameRuleAttr_feature
|
||||
|
|
@ -114,7 +114,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||
readRuleFile(createdLevelGenerationOptions, dData, dSize, strings);
|
||||
|
||||
createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC );
|
||||
|
||||
|
||||
|
||||
//createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC );
|
||||
dlcHeader->lgo = createdLevelGenerationOptions;
|
||||
|
|
@ -130,12 +130,12 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||
// = loadGameRules(dData, dSize); //, strings);
|
||||
|
||||
|
||||
createdLevelGenerationOptions->setGrSource( new JustGrSource() );
|
||||
readRuleFile(createdLevelGenerationOptions, dData, dSize, strings);
|
||||
|
||||
createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_tutorial );
|
||||
|
||||
|
||||
//createdLevelGenerationOptions->set_DLCGameRulesFile( dlcFile );
|
||||
|
||||
createdLevelGenerationOptions->setLoadedData();
|
||||
|
|
@ -169,7 +169,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
app.DebugPrintf("\tversion=%d.\n", version);
|
||||
|
||||
for (int i = 0; i < 8; i++) dis.readByte();
|
||||
|
||||
|
||||
BYTE compression_type = dis.readByte();
|
||||
|
||||
app.DebugPrintf("\tcompressionType=%d.\n", compression_type);
|
||||
|
|
@ -179,11 +179,11 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
decomp_len = dis.readInt();
|
||||
|
||||
app.DebugPrintf("\tcompr_len=%d.\n\tdecomp_len=%d.\n", compr_len, decomp_len);
|
||||
|
||||
|
||||
|
||||
// Decompress File Body
|
||||
|
||||
byteArray content(new BYTE[decomp_len], decomp_len),
|
||||
byteArray content(new BYTE[decomp_len], decomp_len),
|
||||
compr_content(new BYTE[compr_len], compr_len);
|
||||
dis.read(compr_content);
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||
// Initialise output stream.
|
||||
ByteArrayOutputStream baos;
|
||||
DataOutputStream dos(&baos);
|
||||
|
||||
|
||||
// Write header.
|
||||
|
||||
// VERSION NUMBER
|
||||
|
|
@ -284,7 +284,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||
compr_dos.writeInt( 0 ); // XmlObjects.length
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
StringTable *st = m_currentGameRuleDefinitions->getStringTable();
|
||||
|
||||
if (st == NULL)
|
||||
|
|
@ -316,9 +316,9 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||
dos.writeInt( compr_ba.length ); // Write length
|
||||
dos.writeInt( compr_baos.buf.length );
|
||||
dos.write(compr_ba);
|
||||
|
||||
|
||||
delete [] compr_ba.data;
|
||||
|
||||
|
||||
compr_dos.close();
|
||||
compr_baos.close();
|
||||
// -- END COMPRESSED -- //
|
||||
|
|
@ -328,7 +328,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||
*dOut = baos.buf.data;
|
||||
|
||||
baos.buf.data = NULL;
|
||||
|
||||
|
||||
dos.close(); baos.close();
|
||||
}
|
||||
|
||||
|
|
@ -383,7 +383,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
//DWORD dwLen = 0;
|
||||
//PBYTE pbData = dlcFile->getData(dwLen);
|
||||
//byteArray data(pbData,dwLen);
|
||||
|
||||
|
||||
byteArray data(dIn, dSize);
|
||||
ByteArrayInputStream bais(data);
|
||||
DataInputStream dis(&bais);
|
||||
|
|
@ -391,7 +391,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
// Read File.
|
||||
|
||||
// version_number
|
||||
__int64 version = dis.readShort();
|
||||
int64_t version = dis.readShort();
|
||||
unsigned char compressionType = 0;
|
||||
if(version == 0)
|
||||
{
|
||||
|
|
@ -502,7 +502,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
}
|
||||
}*/
|
||||
|
||||
// subfile
|
||||
// subfile
|
||||
UINT numFiles = contentDis->readInt();
|
||||
for (UINT i = 0; i < numFiles; i++)
|
||||
{
|
||||
|
|
@ -570,10 +570,10 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
|
||||
LevelGenerationOptions *GameRuleManager::readHeader(DLCGameRulesHeader *grh)
|
||||
{
|
||||
LevelGenerationOptions *out =
|
||||
LevelGenerationOptions *out =
|
||||
new LevelGenerationOptions();
|
||||
|
||||
|
||||
|
||||
out->setSrc(LevelGenerationOptions::eSrc_fromDLC);
|
||||
out->setGrSource(grh);
|
||||
addLevelGenerationOptions(out);
|
||||
|
|
@ -733,7 +733,7 @@ LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key)
|
|||
LEVEL_GEN_ID GameRuleManager::addLevelGenerationOptions(LevelGenerationOptions *lgo)
|
||||
{
|
||||
vector<LevelGenerationOptions *> *lgs = m_levelGenerators.getLevelGenerators();
|
||||
|
||||
|
||||
for (int i = 0; i<lgs->size(); i++)
|
||||
if (lgs->at(i) == lgo)
|
||||
return i;
|
||||
|
|
@ -753,7 +753,7 @@ void GameRuleManager::unloadCurrentGameRules()
|
|||
if (m_currentLevelGenerationOptions->isFromSave())
|
||||
{
|
||||
m_levelGenerators.removeLevelGenerator( m_currentLevelGenerationOptions );
|
||||
|
||||
|
||||
delete m_currentLevelGenerationOptions;
|
||||
}
|
||||
else if (m_currentLevelGenerationOptions->isFromDLC())
|
||||
|
|
|
|||
|
|
@ -70,17 +70,17 @@ LevelGenerationOptions::~LevelGenerationOptions()
|
|||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
if (m_stringTable)
|
||||
if (!isTutorial())
|
||||
delete m_stringTable;
|
||||
|
|
@ -93,7 +93,7 @@ ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return
|
|||
void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
||||
{
|
||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||
|
||||
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnX);
|
||||
dos->writeUTF(_toString(m_spawnPos->x));
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnY);
|
||||
|
|
@ -110,12 +110,12 @@ void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttr
|
|||
void LevelGenerationOptions::getChildren(vector<GameRuleDefinition *> *children)
|
||||
{
|
||||
GameRuleDefinition::getChildren(children);
|
||||
|
||||
|
||||
vector<ApplySchematicRuleDefinition *> used_schematics;
|
||||
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); it++)
|
||||
if ( !(*it)->isComplete() )
|
||||
used_schematics.push_back( *it );
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_structureRules.begin()); it!=m_structureRules.end(); it++)
|
||||
children->push_back( *it );
|
||||
for(AUTO_VAR(it, used_schematics.begin()); it!=used_schematics.end(); it++)
|
||||
|
|
@ -162,7 +162,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
|||
{
|
||||
if(attributeName.compare(L"seed") == 0)
|
||||
{
|
||||
m_seed = _fromString<__int64>(attributeValue);
|
||||
m_seed = _fromString<int64_t>(attributeValue);
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed);
|
||||
}
|
||||
else if(attributeName.compare(L"spawnX") == 0)
|
||||
|
|
@ -213,7 +213,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
|||
app.DebugPrintf("LevelGenerationOptions: Adding parameter displayName=%ls\n", getDisplayName());
|
||||
}
|
||||
else if(attributeName.compare(L"texturePackId") == 0)
|
||||
{
|
||||
{
|
||||
setRequiredTexturePackId( _fromString<unsigned int>(attributeValue) );
|
||||
setRequiresTexturePack( true );
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter texturePackId=%0x\n", getRequiredTexturePackId());
|
||||
|
|
@ -290,14 +290,14 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, int
|
|||
|
||||
for( AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); it++ )
|
||||
{
|
||||
ConsoleGenerateStructure *structureStart = *it;
|
||||
ConsoleGenerateStructure *structureStart = *it;
|
||||
int minY = structureStart->getMinY();
|
||||
if(minY < m_minY) m_minY = minY;
|
||||
}
|
||||
|
||||
m_bHaveMinY = true;
|
||||
}
|
||||
|
||||
|
||||
// 4J Stu - We DO NOT intersect if our upper bound is below the lower bound for all schematics
|
||||
if( y1 < m_minY ) return false;
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, int
|
|||
{
|
||||
for( AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); it++ )
|
||||
{
|
||||
ConsoleGenerateStructure *structureStart = *it;
|
||||
ConsoleGenerateStructure *structureStart = *it;
|
||||
intersects = structureStart->checkIntersects(x0,y0,z0,x1,y1,z1);
|
||||
if(intersects) break;
|
||||
}
|
||||
|
|
@ -438,12 +438,12 @@ unordered_map<wstring, ConsoleSchematicFile *> *LevelGenerationOptions::getUnfin
|
|||
usedFiles.insert( (*it)->getSchematicName() );
|
||||
|
||||
// Clean schematic files.
|
||||
unordered_map<wstring, ConsoleSchematicFile *> *out
|
||||
unordered_map<wstring, ConsoleSchematicFile *> *out
|
||||
= new unordered_map<wstring, ConsoleSchematicFile *>();
|
||||
for (AUTO_VAR(it, usedFiles.begin()); it!=usedFiles.end(); it++)
|
||||
out->insert( pair<wstring, ConsoleSchematicFile *>(*it, getSchematicFile(*it)) );
|
||||
|
||||
return out;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void LevelGenerationOptions::reset_start()
|
||||
|
|
@ -505,7 +505,7 @@ void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete
|
|||
bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
|
||||
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
|
||||
|
||||
__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||
int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
|
||||
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class GrSource
|
|||
public:
|
||||
// 4J-JEV:
|
||||
// Moved all this here; I didn't like that all this header information
|
||||
// was being mixed in with all the game information as they have
|
||||
// was being mixed in with all the game information as they have
|
||||
// completely different lifespans.
|
||||
|
||||
virtual bool requiresTexturePack()=0;
|
||||
|
|
@ -146,7 +146,7 @@ public:
|
|||
|
||||
private:
|
||||
// This should match the "MapOptionsRule" definition in the XML schema
|
||||
__int64 m_seed;
|
||||
int64_t m_seed;
|
||||
bool m_useFlatWorld;
|
||||
Pos *m_spawnPos;
|
||||
vector<ApplySchematicRuleDefinition *> m_schematicRules;
|
||||
|
|
@ -167,13 +167,13 @@ public:
|
|||
~LevelGenerationOptions();
|
||||
|
||||
virtual ConsoleGameRules::EGameRuleType getActionType();
|
||||
|
||||
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
__int64 getLevelSeed();
|
||||
int64_t getLevelSeed();
|
||||
Pos *getSpawnPos();
|
||||
bool getuseFlatWorld();
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ public:
|
|||
private:
|
||||
void clearSchematics();
|
||||
|
||||
public:
|
||||
public:
|
||||
ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen);
|
||||
|
||||
public:
|
||||
|
|
@ -203,7 +203,7 @@ public:
|
|||
LPCWSTR getString(const wstring &key);
|
||||
|
||||
unordered_map<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();
|
||||
|
||||
|
||||
// 4J-JEV:
|
||||
// ApplySchematicRules contain limited state
|
||||
// which needs to be reset BEFORE a new game starts.
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@
|
|||
CGameNetworkManager g_NetworkManager;
|
||||
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
|
||||
|
||||
__int64 CGameNetworkManager::messageQueue[512];
|
||||
__int64 CGameNetworkManager::byteQueue[512];
|
||||
int64_t CGameNetworkManager::messageQueue[512];
|
||||
int64_t CGameNetworkManager::byteQueue[512];
|
||||
int CGameNetworkManager::messageQueuePos = 0;
|
||||
|
||||
CGameNetworkManager::CGameNetworkManager()
|
||||
|
|
@ -74,7 +74,7 @@ void CGameNetworkManager::Initialise()
|
|||
#else
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerStub();
|
||||
#endif
|
||||
s_pPlatformNetworkManager->Initialise( this, flagIndexSize );
|
||||
s_pPlatformNetworkManager->Initialise( this, flagIndexSize );
|
||||
m_bNetworkThreadRunning = false;
|
||||
m_bInitialised = true;
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ void CGameNetworkManager::DoWork()
|
|||
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XN_LIVE_INVITE_ACCEPTED:
|
||||
|
|
@ -161,12 +161,12 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
|||
|
||||
success = s_pPlatformNetworkManager->_RunNetworkGame();
|
||||
if(!success)
|
||||
{
|
||||
{
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(),eAppAction_ExitWorld,(void *)TRUE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( g_NetworkManager.IsLeavingGame() ) return false;
|
||||
|
||||
app.SetGameStarted(true);
|
||||
|
|
@ -188,12 +188,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
ProfileManager.SetDeferredSignoutEnabled(true);
|
||||
#endif
|
||||
|
||||
__int64 seed = 0;
|
||||
int64_t seed = 0;
|
||||
if(lpParameter != NULL)
|
||||
{
|
||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||
seed = param->seed;
|
||||
|
||||
|
||||
app.setLevelGenerationOptions(param->levelGen);
|
||||
if(param->levelGen != NULL)
|
||||
{
|
||||
|
|
@ -204,12 +204,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
}
|
||||
else
|
||||
{
|
||||
param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed();
|
||||
param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
||||
static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
||||
ServerStoppedCreate(false);
|
||||
if( g_NetworkManager.IsHost() )
|
||||
{
|
||||
|
|
@ -227,7 +227,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
ServerReadyWait();
|
||||
ServerReadyDestroy();
|
||||
|
||||
if( MinecraftServer::serverHalted() )
|
||||
if( MinecraftServer::serverHalted() )
|
||||
return false;
|
||||
|
||||
// printf("Server ready to go!\n");
|
||||
|
|
@ -238,7 +238,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
}
|
||||
|
||||
#ifndef _XBOX
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
// Make sure that we have transitioned through any joining/creating stages and are actually playing the game, so that we know the players should be valid
|
||||
bool changedMessage = false;
|
||||
while(!IsReadyToPlayOrIdle())
|
||||
|
|
@ -458,7 +458,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(g_NetworkManager.IsLeavingGame() || !IsInSession() )
|
||||
{
|
||||
for(AUTO_VAR(it, createdConnections.begin()); it < createdConnections.end(); ++it)
|
||||
|
|
@ -754,7 +754,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
|||
ProfileManager.SetPrimaryPad(iPad);
|
||||
|
||||
g_NetworkManager.SetLocalGame(false);
|
||||
|
||||
|
||||
// If the player was signed in before selecting play, we'll not have read the profile yet, so query the sign-in status to get this to happen
|
||||
ProfileManager.QuerySigninStatus();
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
|||
pInviteInfo ); // pInviteInfo
|
||||
if( !success )
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -816,7 +816,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
|||
Compression::UseDefaultThreadStorage();
|
||||
Tile::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
|
||||
|
||||
g_NetworkManager.m_bNetworkThreadRunning = true;
|
||||
bool success = g_NetworkManager._RunNetworkGame(lpParameter);
|
||||
g_NetworkManager.m_bNetworkThreadRunning = false;
|
||||
|
|
@ -828,7 +828,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
|||
Sleep(1);
|
||||
}
|
||||
ui.CleanUpSkinReload();
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
{
|
||||
app.SetDisconnectReason( DisconnectPacket::eDisconnect_ConnectionCreationFailed );
|
||||
}
|
||||
|
|
@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
|||
|
||||
int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
{
|
||||
__int64 seed = 0;
|
||||
int64_t seed = 0;
|
||||
if(lpParameter != NULL)
|
||||
{
|
||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||
|
|
@ -861,7 +861,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
|||
SetThreadName(-1, "Minecraft Server thread");
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
OldChunkStorage::UseDefaultThreadStorage();
|
||||
Entity::useSmallIds();
|
||||
|
|
@ -869,7 +869,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
|||
Tile::CreateNewThreadStorage();
|
||||
|
||||
MinecraftServer::main(seed, lpParameter); //saveData, app.GetGameHostOption(eGameHostOption_All));
|
||||
|
||||
|
||||
Tile::ReleaseThreadStorage();
|
||||
AABB::ReleaseThreadStorage();
|
||||
Vec3::ReleaseThreadStorage();
|
||||
|
|
@ -926,7 +926,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
|||
// The pair of methods MustSignInReturned_0 & PSNSignInReturned_0 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_0, pParam,true);
|
||||
|
|
@ -986,7 +986,7 @@ int CGameNetworkManager::PSNSignInReturned_0(void* pParam, bool bContinue, int i
|
|||
// The pair of methods MustSignInReturned_1 & PSNSignInReturned_1 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_1(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_1, pParam,true);
|
||||
|
|
@ -1018,7 +1018,7 @@ int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int i
|
|||
#elif defined __ORBIS__
|
||||
// TODO: No Orbis equivalent (should there be?)
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1043,7 +1043,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
Vec3::UseDefaultThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
MinecraftServer *pServer = MinecraftServer::getInstance();
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
|
|
@ -1082,7 +1082,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) );
|
||||
pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) );
|
||||
pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
|
|
@ -1096,7 +1096,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
|
||||
// wait for the server to be in a non-ticking state
|
||||
pServer->m_serverPausedEvent->WaitForSignal(INFINITE);
|
||||
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
// Swap these two messages around as one is too long to display at 480
|
||||
pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
|
|
@ -1158,7 +1158,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
{
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
|
||||
// Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same
|
||||
g_NetworkManager.m_bLastDisconnectWasLostRoomOnly = false;
|
||||
g_NetworkManager.m_bFullSessionMessageOnNextSessionChange = false;
|
||||
|
|
@ -1189,7 +1189,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
{
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
|
||||
// Restore the network player of all the server players that are local
|
||||
if( pServer != NULL )
|
||||
{
|
||||
|
|
@ -1218,7 +1218,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pMinecraft->progressRenderer->progressStagePercentage(100);
|
||||
|
||||
#ifndef _XBOX
|
||||
|
|
@ -1240,7 +1240,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||
#endif
|
||||
|
||||
// Start the game again
|
||||
app.SetGameStarted(true);
|
||||
app.SetGameStarted(true);
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetChangingSessionType(false);
|
||||
app.SetReallyChangingSessionType(false);
|
||||
|
|
@ -1294,7 +1294,7 @@ void CGameNetworkManager::StateChange_AnyToJoining()
|
|||
app.DebugPrintf("Disabling Guest Signin\n");
|
||||
XEnableGuestSignin(FALSE);
|
||||
Minecraft::GetInstance()->clearPendingClientTextureRequests();
|
||||
|
||||
|
||||
ConnectionProgressParams *param = new ConnectionProgressParams();
|
||||
param->iPad = ProfileManager.GetPrimaryPad();
|
||||
param->stringId = -1;
|
||||
|
|
@ -1342,7 +1342,7 @@ void CGameNetworkManager::StateChange_AnyToStarting()
|
|||
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
|
||||
completionData->iPad = ProfileManager.GetPrimaryPad();
|
||||
loadingParams->completionData = completionData;
|
||||
|
||||
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams);
|
||||
}
|
||||
}
|
||||
|
|
@ -1463,7 +1463,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
|||
bool multiplayer = g_NetworkManager.GetPlayerCount() > 1, localgame = g_NetworkManager.IsLocalGame();
|
||||
for (int iPad=0; iPad<XUSER_MAX_COUNT; ++iPad)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(iPad);
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(iPad);
|
||||
if (pNetworkPlayer == NULL) continue;
|
||||
|
||||
app.SetRichPresenceContext(iPad,CONTEXT_GAME_STATE_BLANK);
|
||||
|
|
@ -1488,7 +1488,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
|||
else
|
||||
{
|
||||
if( !pNetworkPlayer->IsHost() )
|
||||
{
|
||||
{
|
||||
for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(Minecraft::GetInstance()->localplayers[idx] != NULL)
|
||||
|
|
@ -1544,7 +1544,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
}
|
||||
|
||||
// Need to check we're signed in to PSN
|
||||
bool isSignedInLive = true;
|
||||
bool isSignedInLive = true;
|
||||
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
|
||||
int iPadNotSignedInLive = -1;
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++)
|
||||
|
|
@ -1584,7 +1584,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Not signed in to PSN
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
|
|
@ -1601,10 +1601,10 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
{
|
||||
m_pInviteInfo = (INVITE_INFO *) pInviteInfo;
|
||||
m_iPlayerInvited = userIndex;
|
||||
|
||||
|
||||
m_pUpsell = new PsPlusUpsellWrapper(index);
|
||||
m_pUpsell->displayUpsell();
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1612,7 +1612,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
|
||||
#ifdef __PSVITA__
|
||||
// Need to check we're signed in to PSN
|
||||
bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
|
||||
bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
|
||||
if (!isSignedInLive)
|
||||
{
|
||||
// Determine why they're not "signed in live"
|
||||
|
|
@ -1625,7 +1625,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
// ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
|
||||
// }
|
||||
// else
|
||||
{
|
||||
{
|
||||
// Not signed in to PSN
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
|
|
@ -1648,9 +1648,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
// 4J-PB we shouldn't bring any inactive players into the game, except for the invited player (who may be an inactive player)
|
||||
// 4J Stu - If we are not in a game, then bring in all players signed in
|
||||
if(index==userIndex || pMinecraft->localplayers[index]!=NULL )
|
||||
{
|
||||
{
|
||||
++joiningUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
|
|
@ -1667,7 +1667,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_XBOX) || defined(__PS3__)
|
||||
if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
|
|
@ -1716,9 +1716,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||
}
|
||||
#endif
|
||||
if( !g_NetworkManager.IsInSession() )
|
||||
{
|
||||
{
|
||||
#ifndef __PS3__
|
||||
HandleInviteWhenInMenus(userIndex, pInviteInfo);
|
||||
HandleInviteWhenInMenus(userIndex, pInviteInfo);
|
||||
#else
|
||||
// PS3 is more complicated here - we need to make sure that the player is online. If they are then we can do the same as the xbox, if not we need to try and get them online and then, if they do sign in, go down the same path
|
||||
if(ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()))
|
||||
|
|
@ -1771,7 +1771,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
|||
if(!ProfileManager.IsFullVersion())
|
||||
{
|
||||
// The marketplace will fail with the primary player set to -1
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
|
||||
app.SetAction(userIndex,eAppAction_DashboardTrialJoinFromInvite);
|
||||
}
|
||||
|
|
@ -1809,7 +1809,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
|||
ProfileManager.QuerySigninStatus();
|
||||
|
||||
// 4J-PB - clear any previous connection errors
|
||||
Minecraft::GetInstance()->clearConnectionFailed();
|
||||
Minecraft::GetInstance()->clearConnectionFailed();
|
||||
|
||||
g_NetworkManager.SetLocalGame(false);
|
||||
|
||||
|
|
@ -1819,7 +1819,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
|||
bool success = g_NetworkManager.JoinGameFromInviteInfo( userIndex, localUsersMask, pInviteInfo );
|
||||
if( !success )
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,11 +99,11 @@ public:
|
|||
void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
||||
void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
void ForceFriendsSessionRefresh();
|
||||
|
||||
|
||||
// Session joining and leaving
|
||||
|
||||
bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
||||
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
||||
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
||||
static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface
|
||||
bool LeaveGame(bool bMigrateHost);
|
||||
static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad);
|
||||
|
|
@ -112,13 +112,13 @@ public:
|
|||
void ResetLeavingGame();
|
||||
|
||||
// Threads
|
||||
|
||||
|
||||
bool IsNetworkThreadRunning();
|
||||
static int RunNetworkGameThreadProc( void* lpParameter );
|
||||
static int ServerThreadProc( void* lpParameter );
|
||||
static int ExitAndJoinFromInviteThreadProc( void* lpParam );
|
||||
|
||||
#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__)
|
||||
#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__)
|
||||
static int MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int PSNSignInReturned_0(void* pParam, bool bContinue, int iPad);
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ public:
|
|||
static void _LeaveGame();
|
||||
static int ChangeSessionTypeThreadProc( void* lpParam );
|
||||
|
||||
// System flags
|
||||
// System flags
|
||||
|
||||
void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
|
|
@ -144,8 +144,8 @@ public:
|
|||
|
||||
void ServerStoppedCreate(bool create); // Create the signal
|
||||
void ServerStopped(); // Signal that we are ready
|
||||
void ServerStoppedWait(); // Wait for the signal
|
||||
void ServerStoppedDestroy(); // Destroy signal
|
||||
void ServerStoppedWait(); // Wait for the signal
|
||||
void ServerStoppedDestroy(); // Destroy signal
|
||||
bool ServerStoppedValid(); // Is non-NULL
|
||||
|
||||
#ifdef __PSVITA__
|
||||
|
|
@ -163,9 +163,9 @@ public:
|
|||
|
||||
// Used for debugging output
|
||||
static const int messageQueue_length = 512;
|
||||
static __int64 messageQueue[messageQueue_length];
|
||||
static int64_t messageQueue[messageQueue_length];
|
||||
static const int byteQueue_length = 512;
|
||||
static __int64 byteQueue[byteQueue_length];
|
||||
static int64_t byteQueue[byteQueue_length];
|
||||
static int messageQueuePos;
|
||||
|
||||
// Methods called from PlatformNetworkManager
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ static SceRemoteStorageStatus statParams;
|
|||
// {
|
||||
// app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
// {
|
||||
// app.DebugPrintf("remoteStorageCallback err : 0x%08x\n");
|
||||
//
|
||||
//
|
||||
// app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, NULL);
|
||||
// }
|
||||
|
||||
|
|
@ -161,17 +161,17 @@ ESavePlatform SonyRemoteStorage::getSavePlatform()
|
|||
|
||||
}
|
||||
|
||||
__int64 SonyRemoteStorage::getSaveSeed()
|
||||
int64_t SonyRemoteStorage::getSaveSeed()
|
||||
{
|
||||
if(m_getInfoStatus != e_infoFound)
|
||||
return 0;
|
||||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char seedString[17];
|
||||
ZeroMemory(seedString,17);
|
||||
ZeroMemory(seedString,17);
|
||||
memcpy(seedString, pDescData->m_seed,16);
|
||||
|
||||
__uint64 seed = 0;
|
||||
uint64_t seed = 0;
|
||||
std::stringstream ss;
|
||||
ss << seedString;
|
||||
ss >> std::hex >> seed;
|
||||
|
|
@ -185,7 +185,7 @@ unsigned int SonyRemoteStorage::getSaveHostOptions()
|
|||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char optionsString[9];
|
||||
ZeroMemory(optionsString,9);
|
||||
ZeroMemory(optionsString,9);
|
||||
memcpy(optionsString, pDescData->m_hostOptions,8);
|
||||
|
||||
unsigned int uiHostOptions = 0;
|
||||
|
|
@ -202,7 +202,7 @@ unsigned int SonyRemoteStorage::getSaveTexturePack()
|
|||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
|
||||
char textureString[9];
|
||||
ZeroMemory(textureString,9);
|
||||
ZeroMemory(textureString,9);
|
||||
memcpy(textureString, pDescData->m_texturePack,8);
|
||||
|
||||
unsigned int uiTexturePack = 0;
|
||||
|
|
@ -219,9 +219,9 @@ const char* SonyRemoteStorage::getRemoteSaveFilename()
|
|||
|
||||
int SonyRemoteStorage::getSaveFilesize()
|
||||
{
|
||||
if(m_getInfoStatus == e_infoFound)
|
||||
if(m_getInfoStatus == e_infoFound)
|
||||
{
|
||||
return m_remoteFileInfo->fileSize;
|
||||
return m_remoteFileInfo->fileSize;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -284,9 +284,9 @@ bool SonyRemoteStorage::saveIsAvailable()
|
|||
if(m_getInfoStatus != e_infoFound)
|
||||
return false;
|
||||
#ifdef __PS3__
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA);
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA);
|
||||
#elif defined __PSVITA__
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3);
|
||||
return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3);
|
||||
#else // __ORBIS__
|
||||
return true;
|
||||
#endif
|
||||
|
|
@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable()
|
|||
|
||||
int SonyRemoteStorage::getDataProgress()
|
||||
{
|
||||
__int64 time = System::currentTimeMillis();
|
||||
int64_t time = System::currentTimeMillis();
|
||||
int elapsedSecs = (time - m_startTime) / 1000;
|
||||
int progVal = m_dataProgress + (elapsedSecs/3);
|
||||
if(progVal > 95)
|
||||
|
|
@ -310,15 +310,15 @@ bool SonyRemoteStorage::shutdown()
|
|||
if(m_bInitialised)
|
||||
{
|
||||
int ret = sceRemoteStorageTerm();
|
||||
if(ret >= 0)
|
||||
if(ret >= 0)
|
||||
{
|
||||
app.DebugPrintf("Term request done \n");
|
||||
m_bInitialised = false;
|
||||
free(m_memPoolBuffer);
|
||||
m_memPoolBuffer = NULL;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error in Term request: 0x%x \n", ret);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "..\..\Common\Network\Sony\sceRemoteStorage\header\sceRemoteStorage.h"
|
||||
|
|
@ -42,7 +42,7 @@ public:
|
|||
SceRemoteStorageData* m_remoteFileInfo;
|
||||
|
||||
class DescriptionData
|
||||
{
|
||||
{
|
||||
// this stuff is read from a JSON query, so it all has to be text based, max 256 bytes
|
||||
public:
|
||||
char m_platform[4];
|
||||
|
|
@ -72,7 +72,7 @@ public:
|
|||
const char* getLocalFilename();
|
||||
const char* getSaveNameUTF8();
|
||||
ESavePlatform getSavePlatform();
|
||||
__int64 getSaveSeed();
|
||||
int64_t getSaveSeed();
|
||||
unsigned int getSaveHostOptions();
|
||||
unsigned int getSaveTexturePack();
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ public:
|
|||
static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
|
||||
static int setDataThread(void* lpParam);
|
||||
|
||||
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
||||
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
||||
|
||||
protected:
|
||||
const char* getRemoteSaveFilename();
|
||||
|
|
@ -111,7 +111,7 @@ protected:
|
|||
unsigned int m_thumbnailDataSize;
|
||||
C4JThread* m_SetDataThread;
|
||||
PSAVE_INFO m_setDataSaveInfo;
|
||||
__int64 m_startTime;
|
||||
int64_t m_startTime;
|
||||
|
||||
bool m_bAborting;
|
||||
bool m_bTransferStarted;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ bool Tutorial::PopupMessageDetails::isSameContent(PopupMessageDetails *other)
|
|||
|
||||
void Tutorial::staticCtor()
|
||||
{
|
||||
//
|
||||
//
|
||||
/*
|
||||
*****
|
||||
*****
|
||||
|
|
@ -72,7 +72,7 @@ void Tutorial::staticCtor()
|
|||
s_completableTasks.push_back( e_Tutorial_State_Enchanting );
|
||||
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Hold_To_Mine );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Tool_Damaged );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Tool_Damaged );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Swim_Up );
|
||||
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Unused_2 );
|
||||
|
|
@ -164,7 +164,7 @@ void Tutorial::staticCtor()
|
|||
s_completableTasks.push_back( e_Tutorial_Hint_Thin_Glass );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Melon );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Vine );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Fence_Gate );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Fence_Gate );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Mycel );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Water_Lily );
|
||||
s_completableTasks.push_back( e_Tutorial_Hint_Nether_Brick );
|
||||
|
|
@ -448,7 +448,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad )
|
|||
if(!isHintCompleted(e_Tutorial_Hint_Detector_Rail)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Detector_Rail, this, detectorRailItems, 1 ) );
|
||||
|
||||
int tallGrassItems[] = {Tile::tallgrass_Id};
|
||||
if(!isHintCompleted(e_Tutorial_Hint_Tall_Grass))
|
||||
if(!isHintCompleted(e_Tutorial_Hint_Tall_Grass))
|
||||
{
|
||||
addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Tall_Grass, this, tallGrassItems, 1, -1, TallGrass::DEAD_SHRUB ) );
|
||||
addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Tall_Grass, this, tallGrassItems, 1, -1, TallGrass::TALL_GRASS ) );
|
||||
|
|
@ -731,7 +731,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad )
|
|||
|
||||
int potatoItems[] = {Tile::potatoes_Id};
|
||||
if(!isHintCompleted(e_Tutorial_Hint_Potato)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Potato, this, potatoItems, 1, -1, -1, 7 ) );
|
||||
|
||||
|
||||
int carrotItems[] = {Tile::carrots_Id};
|
||||
if(!isHintCompleted(e_Tutorial_Hint_Carrot)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Carrot, this, carrotItems, 1, -1, -1, 7 ) );
|
||||
|
||||
|
|
@ -1208,7 +1208,7 @@ void Tutorial::tick()
|
|||
}
|
||||
else if(m_freezeTime && m_timeFrozen && m_fullTutorialComplete)
|
||||
{
|
||||
__int64 currentTime = pMinecraft->level->getTime();
|
||||
int64_t currentTime = pMinecraft->level->getTime();
|
||||
int currentDayTime = (currentTime % Level::TICKS_PER_DAY);
|
||||
int timeToAdd = 0;
|
||||
if(currentDayTime > m_iTutorialFreezeTimeValue)
|
||||
|
|
@ -1219,7 +1219,7 @@ void Tutorial::tick()
|
|||
{
|
||||
timeToAdd = m_iTutorialFreezeTimeValue - currentDayTime;
|
||||
}
|
||||
__int64 targetTime = currentTime + timeToAdd;
|
||||
int64_t targetTime = currentTime + timeToAdd;
|
||||
MinecraftServer::SetTimeOfDay(-1);
|
||||
MinecraftServer::SetTime(targetTime);
|
||||
pMinecraft->level->setOverrideTimeOfDay(-1);
|
||||
|
|
@ -1228,7 +1228,7 @@ void Tutorial::tick()
|
|||
}
|
||||
|
||||
if(!m_allowShow)
|
||||
{
|
||||
{
|
||||
if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) )
|
||||
{
|
||||
uiTempDisabled = true;
|
||||
|
|
@ -1264,7 +1264,7 @@ void Tutorial::tick()
|
|||
app.TutorialSceneNavigateBack(m_iPad);
|
||||
m_bSceneIsSplitscreen=app.GetLocalPlayerCount()>1;
|
||||
if(m_bSceneIsSplitscreen)
|
||||
{
|
||||
{
|
||||
app.NavigateToScene(m_iPad, eUIComponent_TutorialPopup,(void *)this, false, false, &m_hTutorialScene);
|
||||
}
|
||||
else
|
||||
|
|
@ -1359,7 +1359,7 @@ void Tutorial::tick()
|
|||
{
|
||||
isCurrentTask = false;
|
||||
if(
|
||||
( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) )
|
||||
( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) )
|
||||
&& task->isCompleted()
|
||||
)
|
||||
{
|
||||
|
|
@ -1503,7 +1503,7 @@ void Tutorial::tick()
|
|||
message->m_promptId = currentTask[m_CurrentState]->getPromptId();
|
||||
message->m_allowFade = currentTask[m_CurrentState]->AllowFade();
|
||||
setMessage( message );
|
||||
currentTask[m_CurrentState]->TaskReminders()? m_iTaskReminders = 1 : m_iTaskReminders = 0;
|
||||
currentTask[m_CurrentState]->TaskReminders()? m_iTaskReminders = 1 : m_iTaskReminders = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1636,7 +1636,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message)
|
|||
bool messageShown = false;
|
||||
DWORD time = GetTickCount();
|
||||
if(message != NULL && (message->m_forceDisplay || hintsOn) &&
|
||||
(!message->m_delay ||
|
||||
(!message->m_delay ||
|
||||
(
|
||||
(m_hintDisplayed && (time - m_lastHintDisplayedTime) > m_iTutorialHintDelayTime ) ||
|
||||
(!m_hintDisplayed && (time - lastMessageTime) > m_iTutorialMinimumDisplayMessageTime )
|
||||
|
|
@ -1648,7 +1648,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message)
|
|||
|
||||
if(messageShown)
|
||||
{
|
||||
m_lastHintDisplayedTime = time;
|
||||
m_lastHintDisplayedTime = time;
|
||||
m_hintDisplayed = true;
|
||||
if(hint!=NULL) setHintCompleted( hint );
|
||||
}
|
||||
|
|
@ -1672,7 +1672,7 @@ void Tutorial::showTutorialPopup(bool show)
|
|||
m_allowShow = show;
|
||||
|
||||
if(!show)
|
||||
{
|
||||
{
|
||||
if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) )
|
||||
{
|
||||
uiTempDisabled = true;
|
||||
|
|
@ -2099,7 +2099,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*=
|
|||
// The action that caused the change of state may also have completed the current task
|
||||
if( currentTask[m_CurrentState] != NULL && currentTask[m_CurrentState]->isCompleted() )
|
||||
{
|
||||
activeTasks[m_CurrentState].erase( find( activeTasks[m_CurrentState].begin(), activeTasks[m_CurrentState].end(), currentTask[m_CurrentState]) );
|
||||
activeTasks[m_CurrentState].erase( find( activeTasks[m_CurrentState].begin(), activeTasks[m_CurrentState].end(), currentTask[m_CurrentState]) );
|
||||
|
||||
if( activeTasks[m_CurrentState].size() > 0 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void UIComponent_Panorama::tick()
|
|||
EnterCriticalSection(&pMinecraft->m_setLevelCS);
|
||||
if(pMinecraft->level!=NULL)
|
||||
{
|
||||
__int64 i64TimeOfDay =0;
|
||||
int64_t i64TimeOfDay =0;
|
||||
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight
|
||||
if(pMinecraft->level->dimension->id==0)
|
||||
{
|
||||
|
|
@ -104,7 +104,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp
|
|||
IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight );
|
||||
|
||||
IggyPlayerDrawTilesStart ( getMovie() );
|
||||
|
||||
|
||||
m_renderWidth = tileWidth;
|
||||
m_renderHeight = tileHeight;
|
||||
IggyPlayerDrawTile ( getMovie() ,
|
||||
|
|
@ -112,7 +112,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp
|
|||
tileYStart ,
|
||||
tileXStart + tileWidth ,
|
||||
tileYStart + tileHeight ,
|
||||
0 );
|
||||
0 );
|
||||
IggyPlayerDrawTilesEnd ( getMovie() );
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ bool UIControl_SpaceIndicatorBar::setupControl(UIScene *scene, IggyValuePath *pa
|
|||
return success;
|
||||
}
|
||||
|
||||
void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, __int64 min, __int64 max)
|
||||
void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, int64_t min, int64_t max)
|
||||
{
|
||||
m_label = label;
|
||||
m_id = id;
|
||||
|
|
@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset()
|
|||
setSaveGameOffset(0.0f);
|
||||
}
|
||||
|
||||
void UIControl_SpaceIndicatorBar::addSave(__int64 size)
|
||||
void UIControl_SpaceIndicatorBar::addSave(int64_t size)
|
||||
{
|
||||
float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min);
|
||||
|
||||
m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) );
|
||||
m_sizeAndOffsets.push_back( pair<int64_t, float>(size, startPercent) );
|
||||
|
||||
m_currentTotal += size;
|
||||
setTotalSize(m_currentTotal);
|
||||
|
|
@ -75,7 +75,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index)
|
|||
{
|
||||
if(index >= 0 && index < m_sizeAndOffsets.size())
|
||||
{
|
||||
pair<__int64,float> values = m_sizeAndOffsets[index];
|
||||
pair<int64_t,float> values = m_sizeAndOffsets[index];
|
||||
setSaveSize(values.first);
|
||||
setSaveGameOffset(values.second);
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index)
|
|||
}
|
||||
}
|
||||
|
||||
void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size)
|
||||
void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size)
|
||||
{
|
||||
m_currentSave = size;
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size)
|
|||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value );
|
||||
}
|
||||
|
||||
void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size)
|
||||
void UIControl_SpaceIndicatorBar::setTotalSize(int64_t size)
|
||||
{
|
||||
float percent = (float)((m_currentTotal-m_min))/(m_max-m_min);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,28 +6,28 @@ class UIControl_SpaceIndicatorBar : public UIControl_Base
|
|||
{
|
||||
private:
|
||||
IggyName m_setSaveSizeFunc, m_setTotalSizeFunc, m_setSaveGameOffsetFunc;
|
||||
__int64 m_min;
|
||||
__int64 m_max;
|
||||
__int64 m_currentSave, m_currentTotal;
|
||||
int64_t m_min;
|
||||
int64_t m_max;
|
||||
int64_t m_currentSave, m_currentTotal;
|
||||
float m_currentOffset;
|
||||
|
||||
vector<pair<__int64,float> > m_sizeAndOffsets;
|
||||
vector<pair<int64_t,float> > m_sizeAndOffsets;
|
||||
|
||||
public:
|
||||
UIControl_SpaceIndicatorBar();
|
||||
|
||||
virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName);
|
||||
|
||||
void init(const wstring &label, int id, __int64 min, __int64 max);
|
||||
void init(const wstring &label, int id, int64_t min, int64_t max);
|
||||
virtual void ReInit();
|
||||
void reset();
|
||||
|
||||
void addSave(__int64 size);
|
||||
void addSave(int64_t size);
|
||||
void selectSave(int index);
|
||||
|
||||
|
||||
private:
|
||||
void setSaveSize(__int64 size);
|
||||
void setTotalSize(__int64 totalSize);
|
||||
void setSaveSize(int64_t size);
|
||||
void setTotalSize(int64_t totalSize);
|
||||
void setSaveGameOffset(float offset);
|
||||
};
|
||||
|
|
@ -124,7 +124,7 @@ extern "C" void *__real_malloc(size_t t);
|
|||
extern "C" void __real_free(void *t);
|
||||
#endif
|
||||
|
||||
__int64 UIController::iggyAllocCount = 0;
|
||||
int64_t UIController::iggyAllocCount = 0;
|
||||
static unordered_map<void *,size_t> allocations;
|
||||
static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_t size_requested , size_t * size_returned )
|
||||
{
|
||||
|
|
@ -272,7 +272,7 @@ void UIController::postInit()
|
|||
IggySetTextureSubstitutionCallbacks ( &UIController::TextureSubstitutionCreateCallback , &UIController::TextureSubstitutionDestroyCallback, this );
|
||||
|
||||
SetupFont();
|
||||
//
|
||||
//
|
||||
loadSkins();
|
||||
|
||||
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
|
||||
|
|
@ -402,7 +402,7 @@ void UIController::tick()
|
|||
EnderDragonRenderer::bossInstance = nullptr;
|
||||
|
||||
// Clear out the cached movie file data
|
||||
__int64 currentTime = System::currentTimeMillis();
|
||||
int64_t currentTime = System::currentTimeMillis();
|
||||
for(AUTO_VAR(it, m_cachedMovieData.begin()); it != m_cachedMovieData.end();)
|
||||
{
|
||||
if(it->second.m_expiry < currentTime)
|
||||
|
|
@ -522,7 +522,7 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN
|
|||
IggyMemoryUseInfo memoryInfo;
|
||||
rrbool res;
|
||||
int iteration = 0;
|
||||
__int64 totalStatic = 0;
|
||||
int64_t totalStatic = 0;
|
||||
while(res = IggyDebugGetMemoryUseInfo ( NULL ,
|
||||
lib ,
|
||||
"" ,
|
||||
|
|
@ -632,7 +632,7 @@ void UIController::CleanUpSkinReload()
|
|||
{
|
||||
if(!Minecraft::GetInstance()->skins->getSelected()->hasAudio())
|
||||
{
|
||||
#ifdef _DURANGO
|
||||
#ifdef _DURANGO
|
||||
DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK");
|
||||
#else
|
||||
DWORD result = StorageManager.UnmountInstalledDLC("TPACK");
|
||||
|
|
@ -653,7 +653,7 @@ void UIController::CleanUpSkinReload()
|
|||
byteArray UIController::getMovieData(const wstring &filename)
|
||||
{
|
||||
// Cache everything we load in the current tick
|
||||
__int64 targetTime = System::currentTimeMillis() + (1000LL * 60);
|
||||
int64_t targetTime = System::currentTimeMillis() + (1000LL * 60);
|
||||
AUTO_VAR(it,m_cachedMovieData.find(filename));
|
||||
if(it == m_cachedMovieData.end() )
|
||||
{
|
||||
|
|
@ -699,7 +699,7 @@ void UIController::handleInput()
|
|||
{
|
||||
#ifdef _DURANGO
|
||||
// 4J-JEV: Added exception for primary play who migh've uttered speech commands.
|
||||
if(iPad != ProfileManager.GetPrimaryPad()
|
||||
if(iPad != ProfileManager.GetPrimaryPad()
|
||||
&& (!InputManager.IsPadConnected(iPad) || !InputManager.IsPadLocked(iPad)) ) continue;
|
||||
#endif
|
||||
for(unsigned int key = 0; key <= ACTION_MAX_MENU; ++key)
|
||||
|
|
@ -775,7 +775,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
|||
{
|
||||
// no active touch? clear active and highlighted touch UI elements
|
||||
m_ActiveUIElement = NULL;
|
||||
m_HighlightedUIElement = NULL;
|
||||
m_HighlightedUIElement = NULL;
|
||||
|
||||
// fullscreen first
|
||||
UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene();
|
||||
|
|
@ -825,7 +825,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(m_bTouchscreenPressed && pTouchData->reportNum==1)
|
||||
{
|
||||
// fullscreen first
|
||||
|
|
@ -1006,8 +1006,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
|||
//!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_ToggleFont)) &&
|
||||
key == ACTION_MENU_STICK_PRESS)
|
||||
{
|
||||
__int64 totalStatic = 0;
|
||||
__int64 totalDynamic = 0;
|
||||
int64_t totalStatic = 0;
|
||||
int64_t totalDynamic = 0;
|
||||
app.DebugPrintf(app.USER_SR, "********************************\n");
|
||||
app.DebugPrintf(app.USER_SR, "BEGIN TOTAL SWF MEMORY USAGE\n\n");
|
||||
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
|
||||
|
|
@ -1016,8 +1016,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
|||
}
|
||||
for(unsigned int i = 0; i < eLibrary_Count; ++i)
|
||||
{
|
||||
__int64 libraryStatic = 0;
|
||||
__int64 libraryDynamic = 0;
|
||||
int64_t libraryStatic = 0;
|
||||
int64_t libraryDynamic = 0;
|
||||
|
||||
if(m_iggyLibraries[i] != IGGY_INVALID_LIBRARY)
|
||||
{
|
||||
|
|
@ -1045,8 +1045,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
|||
app.DebugPrintf(app.USER_SR, "Total static: %d , Total dynamic: %d\n", totalStatic, totalDynamic);
|
||||
app.DebugPrintf(app.USER_SR, "\n\nEND TOTAL SWF MEMORY USAGE\n");
|
||||
app.DebugPrintf(app.USER_SR, "********************************\n\n");
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1243,7 +1243,7 @@ void UIController::setupCustomDrawGameState()
|
|||
glLoadIdentity();
|
||||
glOrtho(0, m_fScreenWidth, m_fScreenHeight, 0, 1000, 3000);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.1f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
|
|
@ -1343,10 +1343,10 @@ void RADLINK UIController::CustomDrawCallback(void *user_callback_data, Iggy *pl
|
|||
//Description
|
||||
//Callback to create a user-defined texture to replace SWF-defined textures.
|
||||
//Parameters
|
||||
//width - Input value: optional number of pixels wide specified from AS3, or -1 if not defined. Output value: the number of pixels wide to pretend to Iggy that the bitmap is. SWF and AS3 scales bitmaps based on their pixel dimensions, so you can use this to substitute a texture that is higher or lower resolution that ActionScript thinks it is.
|
||||
//height - Input value: optional number of pixels high specified from AS3, or -1 if not defined. Output value: the number of pixels high to pretend to Iggy that the bitmap is. SWF and AS3 scales bitmaps based on their pixel dimensions, so you can use this to substitute a texture that is higher or lower resolution that ActionScript thinks it is.
|
||||
//destroy_callback_data - Optional additional output value you can set; the value will be passed along to the corresponding Iggy_TextureSubstitutionDestroyCallback (e.g. you can store the pointer to your own internal structure here).
|
||||
//return - A platform-independent wrapped texture handle provided by GDraw, or NULL (NULL with throw an ActionScript 3 ArgumentError that the Flash developer can catch) Use by calling IggySetTextureSubstitutionCallbacks.
|
||||
//width - Input value: optional number of pixels wide specified from AS3, or -1 if not defined. Output value: the number of pixels wide to pretend to Iggy that the bitmap is. SWF and AS3 scales bitmaps based on their pixel dimensions, so you can use this to substitute a texture that is higher or lower resolution that ActionScript thinks it is.
|
||||
//height - Input value: optional number of pixels high specified from AS3, or -1 if not defined. Output value: the number of pixels high to pretend to Iggy that the bitmap is. SWF and AS3 scales bitmaps based on their pixel dimensions, so you can use this to substitute a texture that is higher or lower resolution that ActionScript thinks it is.
|
||||
//destroy_callback_data - Optional additional output value you can set; the value will be passed along to the corresponding Iggy_TextureSubstitutionDestroyCallback (e.g. you can store the pointer to your own internal structure here).
|
||||
//return - A platform-independent wrapped texture handle provided by GDraw, or NULL (NULL with throw an ActionScript 3 ArgumentError that the Flash developer can catch) Use by calling IggySetTextureSubstitutionCallbacks.
|
||||
//
|
||||
//Discussion
|
||||
//
|
||||
|
|
@ -1551,7 +1551,7 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
|
|||
void UIController::NavigateToHomeMenu()
|
||||
{
|
||||
ui.CloseAllPlayersScenes();
|
||||
|
||||
|
||||
// Alert the app the we no longer want to be informed of ethernet connections
|
||||
app.SetLiveLinkRequired( false );
|
||||
|
||||
|
|
@ -1714,7 +1714,7 @@ void UIController::CloseUIScenes(int iPad, bool forceIPad)
|
|||
|
||||
m_groups[(int)group]->closeAllScenes();
|
||||
m_groups[(int)group]->getTooltips()->SetTooltips(-1);
|
||||
|
||||
|
||||
// This should cause the popup to dissappear
|
||||
TutorialPopupInfo popupInfo;
|
||||
if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->SetTutorialDescription(&popupInfo);
|
||||
|
|
@ -1865,7 +1865,7 @@ void UIController::SetMenuDisplayed(int iPad,bool bVal)
|
|||
|
||||
#ifdef _DURANGO
|
||||
// 4J-JEV: When in-game, allow player to toggle the 'Pause' and 'IngameInfo' menus via Kinnect.
|
||||
if (Minecraft::GetInstance()->running)
|
||||
if (Minecraft::GetInstance()->running)
|
||||
InputManager.SetEnabledGtcButtons(_360_GTC_MENU | _360_GTC_PAUSE | _360_GTC_VIEW);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -2280,7 +2280,7 @@ void UIController::SetTrialTimerLimitSecs(unsigned int uiSeconds)
|
|||
|
||||
void UIController::UpdateTrialTimer(unsigned int iPad)
|
||||
{
|
||||
WCHAR wcTime[20];
|
||||
WCHAR wcTime[20];
|
||||
|
||||
DWORD dwTimeTicks=(DWORD)app.getTrialTimer();
|
||||
|
||||
|
|
@ -2342,7 +2342,7 @@ void UIController::ShowAutosaveCountdownTimer(bool show)
|
|||
void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
|
||||
{
|
||||
#if !(defined(_XBOX_ONE) || defined(__ORBIS__))
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
|
||||
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown);
|
||||
#endif
|
||||
|
|
@ -2507,7 +2507,7 @@ C4JStorage::EMessageResult UIController::RequestUGCMessageBox(UINT title/* = -1
|
|||
#ifdef __ORBIS__
|
||||
// Show the vague UGC system message in addition to our message
|
||||
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_UGC_RESTRICTION, iPad );
|
||||
return C4JStorage::EMessage_ResultAccept;
|
||||
return C4JStorage::EMessage_ResultAccept;
|
||||
#elif defined(__PSVITA__)
|
||||
ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, iPad );
|
||||
UINT uiIDA[1];
|
||||
|
|
@ -2544,7 +2544,7 @@ C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(UINT
|
|||
#ifdef __ORBIS__
|
||||
// Show the vague UGC system message in addition to our message
|
||||
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_UGC_RESTRICTION, iPad );
|
||||
return C4JStorage::EMessage_ResultAccept;
|
||||
return C4JStorage::EMessage_ResultAccept;
|
||||
#elif defined(__PSVITA__)
|
||||
ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_AGE_RESTRICTION, iPad );
|
||||
return C4JStorage::EMessage_ResultAccept;
|
||||
|
|
@ -2584,7 +2584,7 @@ void UIController::setFontCachingCalculationBuffer(int length)
|
|||
}
|
||||
}
|
||||
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
UIScene *UIController::FindScene(EUIScene sceneType)
|
||||
{
|
||||
UIScene *pScene = NULL;
|
||||
|
|
@ -2723,7 +2723,7 @@ void UIController::TouchBoxesClear(UIScene *pUIScene)
|
|||
for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++)
|
||||
{
|
||||
UIELEMENT *element=(UIELEMENT *)*it;
|
||||
delete element;
|
||||
delete element;
|
||||
}
|
||||
m_TouchBoxes[eUIGroup][eUILayer][eUIscene].clear();
|
||||
}
|
||||
|
|
@ -2759,7 +2759,7 @@ bool UIController::TouchBoxHit(UIScene *pUIScene,S32 x, S32 y)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//app.DebugPrintf("MISS at x = %i y = %i\n", (int)x, (int)y);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class UIControl;
|
|||
class UIController : public IUIController
|
||||
{
|
||||
public:
|
||||
static __int64 iggyAllocCount;
|
||||
static int64_t iggyAllocCount;
|
||||
|
||||
// MGH - added to prevent crash loading Iggy movies while the skins were being reloaded
|
||||
static CRITICAL_SECTION ms_reloadSkinCS;
|
||||
|
|
@ -29,7 +29,7 @@ private:
|
|||
CRITICAL_SECTION m_navigationLock;
|
||||
|
||||
static const int UI_REPEAT_KEY_DELAY_MS = 300; // How long from press until the first repeat
|
||||
static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats
|
||||
static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats
|
||||
DWORD m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1];
|
||||
|
||||
float m_fScreenWidth;
|
||||
|
|
@ -45,7 +45,7 @@ private:
|
|||
// 4J-PB - ui element type for PSVita touch control
|
||||
#ifdef __PSVITA__
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
UIControl *pControl;
|
||||
S32 x1,y1,x2,y2;
|
||||
|
|
@ -110,7 +110,7 @@ private:
|
|||
|
||||
C4JRender::eViewportType m_currentRenderViewport;
|
||||
bool m_bCustomRenderPosition;
|
||||
|
||||
|
||||
static DWORD m_dwTrialTimerLimitSecs;
|
||||
|
||||
unordered_map<wstring, byteArray> m_substitutionTextures;
|
||||
|
|
@ -118,7 +118,7 @@ private:
|
|||
typedef struct _CachedMovieData
|
||||
{
|
||||
byteArray m_ba;
|
||||
__int64 m_expiry;
|
||||
int64_t m_expiry;
|
||||
} CachedMovieData;
|
||||
unordered_map<wstring, CachedMovieData> m_cachedMovieData;
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ protected:
|
|||
void postInit();
|
||||
|
||||
|
||||
public:
|
||||
public:
|
||||
CRITICAL_SECTION m_Allocatorlock;
|
||||
void SetupFont();
|
||||
public:
|
||||
|
|
@ -208,7 +208,7 @@ private:
|
|||
void tickInput();
|
||||
void handleInput();
|
||||
void handleKeyPress(unsigned int iPad, unsigned int key);
|
||||
|
||||
|
||||
protected:
|
||||
static rrbool RADLINK ExternalFunctionCallback( void * user_callback_data , Iggy * player , IggyExternalFunctionCallUTF16 * call );
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ private:
|
|||
public:
|
||||
void CloseAllPlayersScenes();
|
||||
void CloseUIScenes(int iPad, bool forceIPad = false);
|
||||
|
||||
|
||||
virtual bool IsPauseMenuDisplayed(int iPad);
|
||||
virtual bool IsContainerMenuDisplayed(int iPad);
|
||||
virtual bool IsIgnorePlayerJoinMenuDisplayed(int iPad);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ void UIGroup::tick()
|
|||
}
|
||||
|
||||
// Handle deferred update focus
|
||||
if (m_updateFocusStateCountdown > 0)
|
||||
if (m_updateFocusStateCountdown > 0)
|
||||
{
|
||||
m_updateFocusStateCountdown--;
|
||||
if (m_updateFocusStateCountdown == 0)_UpdateFocusState();
|
||||
|
|
@ -233,7 +233,7 @@ void UIGroup::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel
|
|||
}
|
||||
}
|
||||
|
||||
// FOCUS
|
||||
// FOCUS
|
||||
|
||||
// Check that a layer may recieve focus, specifically that there is no infocus layer above
|
||||
bool UIGroup::RequestFocus(UILayer* layerPtr)
|
||||
|
|
@ -379,16 +379,16 @@ unsigned int UIGroup::GetLayerIndex(UILayer* layerPtr)
|
|||
// can't get here...
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIGroup::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic)
|
||||
|
||||
void UIGroup::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
|
||||
{
|
||||
__int64 groupStatic = 0;
|
||||
__int64 groupDynamic = 0;
|
||||
int64_t groupStatic = 0;
|
||||
int64_t groupDynamic = 0;
|
||||
app.DebugPrintf(app.USER_SR, "-- BEGIN GROUP %d\n",m_group);
|
||||
for(unsigned int i = 0; i < eUILayer_COUNT; ++i)
|
||||
{
|
||||
app.DebugPrintf(app.USER_SR, " \\- BEGIN LAYER %d\n",i);
|
||||
m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic);
|
||||
m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic);
|
||||
app.DebugPrintf(app.USER_SR, " \\- END LAYER %d\n",i);
|
||||
}
|
||||
app.DebugPrintf(app.USER_SR, "-- Group static: %d, Group dynamic: %d\n", groupStatic, groupDynamic);
|
||||
|
|
@ -402,7 +402,7 @@ int UIGroup::getCommandBufferList()
|
|||
return m_commandBufferList;
|
||||
}
|
||||
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
UIScene *UIGroup::FindScene(EUIScene sceneType)
|
||||
{
|
||||
UIScene *pScene = NULL;
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ private:
|
|||
UIScene_HUD *m_hud;
|
||||
|
||||
C4JRender::eViewportType m_viewportType;
|
||||
|
||||
|
||||
EUIGroup m_group;
|
||||
int m_iPad;
|
||||
|
||||
|
||||
bool m_bMenuDisplayed;
|
||||
bool m_bPauseMenuDisplayed;
|
||||
bool m_bContainerMenuDisplayed;
|
||||
|
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
void SetViewportType(C4JRender::eViewportType type);
|
||||
C4JRender::eViewportType GetViewportType();
|
||||
|
||||
|
||||
virtual void HandleDLCMountingComplete();
|
||||
virtual void HandleDLCInstalled();
|
||||
#ifdef _XBOX_ONE
|
||||
|
|
@ -99,15 +99,15 @@ public:
|
|||
bool IsFullscreenGroup();
|
||||
|
||||
void handleUnlockFullVersion();
|
||||
|
||||
void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic);
|
||||
|
||||
void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic);
|
||||
|
||||
unsigned int GetLayerIndex(UILayer* layerPtr);
|
||||
|
||||
int getCommandBufferList();
|
||||
UIScene *FindScene(EUIScene sceneType);
|
||||
|
||||
private:
|
||||
private:
|
||||
void _UpdateFocusState();
|
||||
void updateStackStates();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void UILayer::tick()
|
|||
m_scenesToDelete.push_back(scene);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while (!m_scenesToDestroy.empty())
|
||||
{
|
||||
UIScene *scene = m_scenesToDestroy.back();
|
||||
|
|
@ -46,13 +46,13 @@ void UILayer::tick()
|
|||
scene->destroyMovie();
|
||||
}
|
||||
m_scenesToDestroy.clear();
|
||||
|
||||
|
||||
for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it)
|
||||
{
|
||||
(*it)->tick();
|
||||
}
|
||||
// Note: reverse iterator, the last element is the top of the stack
|
||||
int sceneIndex = m_sceneStack.size() - 1;
|
||||
int sceneIndex = m_sceneStack.size() - 1;
|
||||
//for(AUTO_VAR(it,m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it)
|
||||
while( sceneIndex >= 0 && sceneIndex < m_sceneStack.size() )
|
||||
{
|
||||
|
|
@ -422,9 +422,9 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData)
|
|||
}
|
||||
|
||||
m_sceneStack.push_back(newScene);
|
||||
|
||||
|
||||
updateFocusState();
|
||||
|
||||
|
||||
newScene->tick();
|
||||
|
||||
return true;
|
||||
|
|
@ -706,12 +706,12 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */)
|
|||
|
||||
// 4J-PB - this should just be true
|
||||
m_bMenuDisplayed=true;
|
||||
|
||||
|
||||
EUIScene sceneType = scene->getSceneType();
|
||||
switch(sceneType)
|
||||
{
|
||||
case eUIScene_PauseMenu:
|
||||
m_bPauseMenuDisplayed = true;
|
||||
m_bPauseMenuDisplayed = true;
|
||||
break;
|
||||
case eUIScene_Crafting2x2Menu:
|
||||
case eUIScene_Crafting3x3Menu:
|
||||
|
|
@ -727,7 +727,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */)
|
|||
|
||||
// Intentional fall-through
|
||||
case eUIScene_DeathMenu:
|
||||
case eUIScene_FullscreenProgress:
|
||||
case eUIScene_FullscreenProgress:
|
||||
case eUIScene_SignEntryMenu:
|
||||
case eUIScene_EndPoem:
|
||||
m_bIgnoreAutosaveMenuDisplayed = true;
|
||||
|
|
@ -736,7 +736,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */)
|
|||
|
||||
switch(sceneType)
|
||||
{
|
||||
case eUIScene_FullscreenProgress:
|
||||
case eUIScene_FullscreenProgress:
|
||||
case eUIScene_EndPoem:
|
||||
case eUIScene_Credits:
|
||||
case eUIScene_LeaderboardsMenu:
|
||||
|
|
@ -775,8 +775,8 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel
|
|||
UIScene *scene = *it;
|
||||
if(scene->hasFocus(iPad) && scene->canHandleInput())
|
||||
{
|
||||
// 4J-PB - ignore repeats of action ABXY buttons
|
||||
// fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt.
|
||||
// 4J-PB - ignore repeats of action ABXY buttons
|
||||
// fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt.
|
||||
// 4J Stu - Changed this slightly to add the allowRepeat function so we can allow repeats in the crafting menu
|
||||
if(repeat && !scene->allowRepeat(key) )
|
||||
{
|
||||
|
|
@ -784,8 +784,8 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel
|
|||
}
|
||||
scene->handleInput(iPad, key, repeat, pressed, released, handled);
|
||||
}
|
||||
|
||||
// Fix for PS3 #444 - [IN GAME] If the user keeps pressing CROSS while on the 'Save Game' screen the title will crash.
|
||||
|
||||
// Fix for PS3 #444 - [IN GAME] If the user keeps pressing CROSS while on the 'Save Game' screen the title will crash.
|
||||
handled = handled || scene->hidesLowerScenes();
|
||||
if(handled ) break;
|
||||
}
|
||||
|
|
@ -842,10 +842,10 @@ void UILayer::handleUnlockFullVersion()
|
|||
}
|
||||
}
|
||||
|
||||
void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic)
|
||||
void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
|
||||
{
|
||||
__int64 layerStatic = 0;
|
||||
__int64 layerDynamic = 0;
|
||||
int64_t layerStatic = 0;
|
||||
int64_t layerDynamic = 0;
|
||||
for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it)
|
||||
{
|
||||
(*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic);
|
||||
|
|
@ -859,7 +859,7 @@ void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic)
|
|||
totalDynamic += layerDynamic;
|
||||
}
|
||||
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
// Returns the first scene of given type if it exists, NULL otherwise
|
||||
UIScene *UILayer::FindScene(EUIScene sceneType)
|
||||
{
|
||||
for (int i = 0; i < m_sceneStack.size(); i++)
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ public:
|
|||
|
||||
// INPUT
|
||||
void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
|
||||
#ifdef __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
// Current active scene
|
||||
UIScene *getCurrentScene();
|
||||
#endif
|
||||
// FOCUS
|
||||
|
||||
|
||||
bool updateFocusState(bool allowedFocus = false);
|
||||
|
||||
public:
|
||||
|
|
@ -85,7 +85,7 @@ public:
|
|||
#endif
|
||||
void handleUnlockFullVersion();
|
||||
UIScene *FindScene(EUIScene sceneType);
|
||||
|
||||
void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic);
|
||||
|
||||
void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic);
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer)
|
|||
m_iPad = iPad;
|
||||
swf = NULL;
|
||||
m_pItemRenderer = NULL;
|
||||
|
||||
|
||||
bHasFocus = false;
|
||||
m_hasTickedOnce = false;
|
||||
m_bFocussedOnce = false;
|
||||
|
|
@ -27,7 +27,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer)
|
|||
m_bUpdateOpacity = false;
|
||||
|
||||
m_backScene = NULL;
|
||||
|
||||
|
||||
m_cacheSlotRenders = false;
|
||||
m_needsCacheRendered = true;
|
||||
m_expectedCachedSlotCount = 0;
|
||||
|
|
@ -94,7 +94,7 @@ void UIScene::reloadMovie(bool force)
|
|||
}
|
||||
|
||||
handleReload();
|
||||
|
||||
|
||||
IggyDataValue result;
|
||||
IggyDataValue value[1];
|
||||
|
||||
|
|
@ -328,11 +328,11 @@ void UIScene::loadMovie()
|
|||
}
|
||||
|
||||
byteArray baFile = ui.getMovieData(moviePath.c_str());
|
||||
__int64 beforeLoad = ui.iggyAllocCount;
|
||||
int64_t beforeLoad = ui.iggyAllocCount;
|
||||
swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL);
|
||||
__int64 afterLoad = ui.iggyAllocCount;
|
||||
IggyPlayerInitializeAndTickRS ( swf );
|
||||
__int64 afterTick = ui.iggyAllocCount;
|
||||
int64_t afterLoad = ui.iggyAllocCount;
|
||||
IggyPlayerInitializeAndTickRS ( swf );
|
||||
int64_t afterTick = ui.iggyAllocCount;
|
||||
|
||||
if(!swf)
|
||||
{
|
||||
|
|
@ -343,7 +343,7 @@ void UIScene::loadMovie()
|
|||
app.FatalLoadError();
|
||||
}
|
||||
app.DebugPrintf( app.USER_SR, "Loaded iggy movie %ls\n", moviePath.c_str() );
|
||||
IggyProperties *properties = IggyPlayerProperties ( swf );
|
||||
IggyProperties *properties = IggyPlayerProperties ( swf );
|
||||
m_movieHeight = properties->movie_height_in_pixels;
|
||||
m_movieWidth = properties->movie_width_in_pixels;
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ void UIScene::loadMovie()
|
|||
m_renderHeight = m_movieHeight;
|
||||
|
||||
S32 width, height;
|
||||
m_parentLayer->getRenderDimensions(width, height);
|
||||
m_parentLayer->getRenderDimensions(width, height);
|
||||
IggyPlayerSetDisplaySize( swf, width, height );
|
||||
|
||||
IggyPlayerSetUserdata(swf,this);
|
||||
|
|
@ -361,8 +361,8 @@ void UIScene::loadMovie()
|
|||
IggyMemoryUseInfo memoryInfo;
|
||||
rrbool res;
|
||||
int iteration = 0;
|
||||
__int64 totalStatic = 0;
|
||||
__int64 totalDynamic = 0;
|
||||
int64_t totalStatic = 0;
|
||||
int64_t totalDynamic = 0;
|
||||
while(res = IggyDebugGetMemoryUseInfo ( swf ,
|
||||
NULL ,
|
||||
0 ,
|
||||
|
|
@ -372,7 +372,7 @@ void UIScene::loadMovie()
|
|||
{
|
||||
totalStatic += memoryInfo.static_allocation_bytes;
|
||||
totalDynamic += memoryInfo.dynamic_allocation_bytes;
|
||||
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), memoryInfo.subcategory_stringlen, memoryInfo.subcategory,
|
||||
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), memoryInfo.subcategory_stringlen, memoryInfo.subcategory,
|
||||
memoryInfo.static_allocation_bytes, memoryInfo.static_allocation_count, memoryInfo.dynamic_allocation_bytes, memoryInfo.dynamic_allocation_count);
|
||||
++iteration;
|
||||
//if(memoryInfo.static_allocation_bytes > 0) getDebugMemoryUseRecursive(moviePath, memoryInfo);
|
||||
|
|
@ -398,22 +398,22 @@ void UIScene::getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUse
|
|||
internalIteration ,
|
||||
&internalMemoryInfo ))
|
||||
{
|
||||
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory,
|
||||
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory,
|
||||
internalMemoryInfo.static_allocation_bytes, internalMemoryInfo.static_allocation_count, internalMemoryInfo.dynamic_allocation_bytes, internalMemoryInfo.dynamic_allocation_count);
|
||||
++internalIteration;
|
||||
if(internalMemoryInfo.subcategory_stringlen > memoryInfo.subcategory_stringlen) getDebugMemoryUseRecursive(moviePath, internalMemoryInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic)
|
||||
void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
|
||||
{
|
||||
if(!swf) return;
|
||||
|
||||
IggyMemoryUseInfo memoryInfo;
|
||||
rrbool res;
|
||||
int iteration = 0;
|
||||
__int64 sceneStatic = 0;
|
||||
__int64 sceneDynamic = 0;
|
||||
int64_t sceneStatic = 0;
|
||||
int64_t sceneDynamic = 0;
|
||||
while(res = IggyDebugGetMemoryUseInfo ( swf ,
|
||||
NULL ,
|
||||
"" ,
|
||||
|
|
@ -483,7 +483,7 @@ void UIScene::tickTimers()
|
|||
{
|
||||
it = m_timers.erase(it);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if(currentTime > it->second.targetTime)
|
||||
{
|
||||
|
|
@ -634,7 +634,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
|||
if(useCommandBuffers) RenderManager.CBuffStart(list, true);
|
||||
#endif
|
||||
PIXBeginNamedEvent(0,"Draw uncached");
|
||||
ui.setupCustomDrawMatrices(this, customDrawRegion);
|
||||
ui.setupCustomDrawMatrices(this, customDrawRegion);
|
||||
_customDrawSlotControl(customDrawRegion, iPad, item, fAlpha, isFoil, bDecorations, useCommandBuffers);
|
||||
delete customDrawRegion;
|
||||
PIXEndNamedEvent();
|
||||
|
|
@ -644,7 +644,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
|||
for(AUTO_VAR(it, m_cachedSlotDraw.begin()); it != m_cachedSlotDraw.end(); ++it)
|
||||
{
|
||||
CachedSlotDrawData *drawData = *it;
|
||||
ui.setupCustomDrawMatrices(this, drawData->customDrawRegion);
|
||||
ui.setupCustomDrawMatrices(this, drawData->customDrawRegion);
|
||||
_customDrawSlotControl(drawData->customDrawRegion, iPad, drawData->item, drawData->fAlpha, drawData->isFoil, drawData->bDecorations, useCommandBuffers);
|
||||
delete drawData->customDrawRegion;
|
||||
delete drawData;
|
||||
|
|
@ -698,7 +698,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
|||
// Finish GDraw and anything else that needs to be finalised
|
||||
ui.endCustomDraw(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer)
|
||||
|
|
@ -716,7 +716,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
|
|||
// we might want separate x & y scales here
|
||||
|
||||
float scaleX = bwidth / 16.0f;
|
||||
float scaleY = bheight / 16.0f;
|
||||
float scaleY = bheight / 16.0f;
|
||||
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
glPushMatrix();
|
||||
|
|
@ -751,8 +751,8 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
|
|||
if(bDecorations)
|
||||
{
|
||||
if((scaleX!=1.0f) ||(scaleY!=1.0f))
|
||||
{
|
||||
glPushMatrix();
|
||||
{
|
||||
glPushMatrix();
|
||||
glScalef(scaleX, scaleY, 1.0f);
|
||||
int iX= (int)(0.5f+((float)x)/scaleX);
|
||||
int iY= (int)(0.5f+((float)y)/scaleY);
|
||||
|
|
@ -975,8 +975,8 @@ int UIScene::convertGameActionToIggyKeycode(int action)
|
|||
|
||||
bool UIScene::allowRepeat(int key)
|
||||
{
|
||||
// 4J-PB - ignore repeats of action ABXY buttons
|
||||
// fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt.
|
||||
// 4J-PB - ignore repeats of action ABXY buttons
|
||||
// fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt.
|
||||
switch(key)
|
||||
{
|
||||
case ACTION_MENU_OK:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class UILayer;
|
|||
class UIScene
|
||||
{
|
||||
friend class UILayer;
|
||||
public:
|
||||
public:
|
||||
IggyValuePath *m_rootPath;
|
||||
|
||||
private:
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
|
||||
protected:
|
||||
ESceneResolution m_loadedResolution;
|
||||
|
||||
|
||||
bool m_bIsReloading;
|
||||
bool m_bFocussedOnce;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ protected:
|
|||
|
||||
public:
|
||||
virtual Iggy *getMovie() { return swf; }
|
||||
|
||||
|
||||
void destroyMovie();
|
||||
virtual void reloadMovie(bool force = false);
|
||||
virtual bool needsReloaded();
|
||||
|
|
@ -127,7 +127,7 @@ private:
|
|||
void getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUseInfo &memoryInfo);
|
||||
|
||||
public:
|
||||
void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic);
|
||||
void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic);
|
||||
|
||||
public:
|
||||
UIScene(int iPad, UILayer *parentLayer);
|
||||
|
|
@ -140,7 +140,7 @@ public:
|
|||
|
||||
IggyName registerFastName(const wstring &name);
|
||||
#ifdef __PSVITA__
|
||||
void SetFocusToElement(int iID);
|
||||
void SetFocusToElement(int iID);
|
||||
void UpdateSceneControls();
|
||||
#endif
|
||||
protected:
|
||||
|
|
@ -160,7 +160,7 @@ public:
|
|||
|
||||
void gainFocus();
|
||||
void loseFocus();
|
||||
|
||||
|
||||
virtual void updateTooltips();
|
||||
virtual void updateComponents() {}
|
||||
virtual void handleGainFocus(bool navBack);
|
||||
|
|
@ -188,7 +188,7 @@ public:
|
|||
protected:
|
||||
//void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, int iID, int iCount, int iAuxVal, float fAlpha, bool isFoil, bool bDecorations);
|
||||
void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations);
|
||||
|
||||
|
||||
bool m_cacheSlotRenders;
|
||||
bool m_needsCacheRendered;
|
||||
int m_expectedCachedSlotCount;
|
||||
|
|
@ -260,7 +260,7 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
#ifdef _DURANGO
|
||||
#ifdef _DURANGO
|
||||
virtual long long getDefaultGtcButtons() { return _360_GTC_BACK; }
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
|||
m_labelTexturePackDescription.init(L"");
|
||||
|
||||
WCHAR TempString[256];
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)]));
|
||||
m_sliderDifficulty.init(TempString,eControl_Difficulty,0,3,app.GetGameSettings(m_iPad,eGameSetting_Difficulty));
|
||||
|
||||
m_MoreOptionsParams.bGenerateOptions=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bFlatWorld=FALSE;
|
||||
m_MoreOptionsParams.bBonusChest=FALSE;
|
||||
m_MoreOptionsParams.bPVP = TRUE;
|
||||
|
|
@ -85,7 +85,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
|||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=false;
|
||||
|
||||
// 4J-PB - Removing this so that we can attempt to create an online game on PS3 when we are a restricted child account
|
||||
// It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online,
|
||||
// It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online,
|
||||
// instead of just greying out the online setting in the More Options
|
||||
// #ifdef __PS3__
|
||||
// if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
|
|
@ -118,9 +118,9 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
|||
{
|
||||
// The profile settings say Online, but either the player is offline, or they are not allowed to play online
|
||||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if(getSceneResolution() == eSceneResolution_1080)
|
||||
{
|
||||
|
|
@ -339,7 +339,7 @@ int UIScene_CreateWorldMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::E
|
|||
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
pClass->m_MoreOptionsParams.bOnlineGame=false;
|
||||
pClass->checkStateAndStartGame();
|
||||
|
|
@ -374,7 +374,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p
|
|||
if ( pressed && controlHasFocus(m_checkboxOnline.getId()) && !m_checkboxOnline.IsEnabled() )
|
||||
{
|
||||
UINT uiIDA[1] = { IDS_CONFIRM_OK };
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -385,7 +385,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p
|
|||
case ACTION_MENU_OTHER_STICK_UP:
|
||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if(getSceneResolution() == eSceneResolution_1080)
|
||||
{
|
||||
|
|
@ -557,7 +557,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
|
|||
if(m_MoreOptionsParams.dwTexturePack!=0)
|
||||
{
|
||||
// texture pack hasn't been set yet, so check what it will be
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack;
|
||||
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();
|
||||
|
||||
|
|
@ -609,7 +609,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
|
|||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
uiIDA[1]=IDS_CONFIRM_CANCEL;
|
||||
ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false);
|
||||
ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false);
|
||||
#endif
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__
|
||||
|
|
@ -636,7 +636,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue)
|
|||
m_sliderDifficulty.handleSliderMove(value);
|
||||
|
||||
app.SetGameSettings(m_iPad,eGameSetting_Difficulty,value);
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value]));
|
||||
m_sliderDifficulty.setLabel(TempString);
|
||||
break;
|
||||
}
|
||||
|
|
@ -683,7 +683,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
|
|||
m_MoreOptionsParams.bInviteOnly = FALSE;
|
||||
m_MoreOptionsParams.bAllowFriendsOfFriends = FALSE;
|
||||
}
|
||||
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if(getSceneResolution() == eSceneResolution_1080)
|
||||
{
|
||||
|
|
@ -721,7 +721,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
|
|||
PBYTE pbImageData=NULL;
|
||||
|
||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.iData = m_iConfigA[i];
|
||||
HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
||||
app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]);
|
||||
|
|
@ -803,7 +803,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
bool isOnlineGame = m_MoreOptionsParams.bOnlineGame;
|
||||
int iPadNotSignedInLive = -1;
|
||||
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
|
||||
|
||||
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++)
|
||||
{
|
||||
if (ProfileManager.IsSignedIn(i) && (i == primaryPad || isLocalMultiplayerAvailable))
|
||||
|
|
@ -855,7 +855,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL, app.GetStringTable());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Not signed in to PSN
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
|
|
@ -901,7 +901,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
SceNpCommerceDialogParam param;
|
||||
sceNpCommerceDialogParamInitialize(¶m);
|
||||
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
|
||||
iResult=sceNpCommerceDialogOpen(¶m);
|
||||
|
|
@ -916,7 +916,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
#endif
|
||||
|
||||
if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE)
|
||||
{
|
||||
{
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
uiIDA[1]=IDS_CONFIRM_CANCEL;
|
||||
|
|
@ -980,7 +980,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
SceNpCommerceDialogParam param;
|
||||
sceNpCommerceDialogParamInitialize(¶m);
|
||||
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
|
||||
iResult=sceNpCommerceDialogOpen(¶m);
|
||||
|
|
@ -1033,8 +1033,8 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
|||
SceNpCommerceDialogParam param;
|
||||
sceNpCommerceDialogParamInitialize(¶m);
|
||||
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
|
||||
iResult=sceNpCommerceDialogOpen(¶m);
|
||||
|
||||
|
|
@ -1107,13 +1107,13 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
|
|||
|
||||
// start the game
|
||||
bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE);
|
||||
__int64 seedValue = 0;
|
||||
int64_t seedValue = 0;
|
||||
|
||||
NetworkGameInitData *param = new NetworkGameInitData();
|
||||
|
||||
if (wSeed.length() != 0)
|
||||
{
|
||||
__int64 value = 0;
|
||||
int64_t value = 0;
|
||||
unsigned int len = (unsigned int)wSeed.length();
|
||||
|
||||
//Check if the input string contains a numerical value
|
||||
|
|
@ -1132,7 +1132,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
|
|||
|
||||
//If the input string is a numerical value, convert it to a number
|
||||
if( isNumber )
|
||||
value = _fromString<__int64>(wSeed);
|
||||
value = _fromString<int64_t>(wSeed);
|
||||
|
||||
//If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it
|
||||
if( value != 0 )
|
||||
|
|
@ -1336,7 +1336,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -1347,7 +1347,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
|
|||
{
|
||||
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
|
||||
|
|
@ -1392,7 +1392,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
|
|||
ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
#if defined( __ORBIS__) || defined(__PSVITA__)
|
||||
bool isOnlineGame = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
if(isOnlineGame)
|
||||
|
|
@ -1422,7 +1422,7 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor
|
|||
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu *)pParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass, false, iPad);
|
||||
}
|
||||
|
|
@ -1434,28 +1434,28 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor
|
|||
// {
|
||||
// int32_t iResult;
|
||||
// UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam;
|
||||
//
|
||||
//
|
||||
// // continue offline, or upsell PS Plus?
|
||||
// if(result==C4JStorage::EMessage_ResultDecline)
|
||||
// if(result==C4JStorage::EMessage_ResultDecline)
|
||||
// {
|
||||
// // upsell psplus
|
||||
// int32_t iResult=sceNpCommerceDialogInitialize();
|
||||
//
|
||||
//
|
||||
// SceNpCommerceDialogParam param;
|
||||
// sceNpCommerceDialogParamInitialize(¶m);
|
||||
// param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
// param.userId = ProfileManager.getUserID(pClass->m_iPad);
|
||||
//
|
||||
//
|
||||
// iResult=sceNpCommerceDialogOpen(¶m);
|
||||
// }
|
||||
// else if(result==C4JStorage::EMessage_ResultAccept)
|
||||
// else if(result==C4JStorage::EMessage_ResultAccept)
|
||||
// {
|
||||
// // continue offline
|
||||
// pClass->m_MoreOptionsParams.bOnlineGame=false;
|
||||
// pClass->checkStateAndStartGame();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// pClass->m_bIgnoreInput=false;
|
||||
// return 0;
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ private:
|
|||
};
|
||||
|
||||
static int m_iDifficultyTitleSettingA[4];
|
||||
|
||||
|
||||
UIControl m_controlMainPanel;
|
||||
UIControl_Label m_labelGameName, m_labelSeed, m_labelCreatedMode;
|
||||
UIControl_Button m_buttonGamemode, m_buttonMoreOptions, m_buttonLoadWorld;
|
||||
UIControl_Slider m_sliderDifficulty;
|
||||
UIControl_BitmapIcon m_bitmapIcon;
|
||||
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
UIControl_CheckBox m_checkboxOnline;
|
||||
#endif
|
||||
|
|
@ -35,7 +35,7 @@ private:
|
|||
UI_MAP_ELEMENT( m_labelSeed, "Seed")
|
||||
UI_MAP_ELEMENT( m_texturePackList, "TexturePackSelector")
|
||||
UI_MAP_ELEMENT( m_buttonGamemode, "GameModeToggle")
|
||||
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
UI_MAP_ELEMENT( m_checkboxOnline, "CheckboxOnline")
|
||||
#endif
|
||||
|
|
@ -48,7 +48,7 @@ private:
|
|||
|
||||
LevelGenerationOptions *m_levelGen;
|
||||
DLCPack * m_pDLCPack;
|
||||
|
||||
|
||||
int m_iSaveGameInfoIndex;
|
||||
int m_CurrentDifficulty;
|
||||
bool m_bGameModeSurvival;
|
||||
|
|
@ -61,7 +61,7 @@ private:
|
|||
bool m_bRequestQuadrantSignin;
|
||||
bool m_bIsCorrupt;
|
||||
bool m_bThumbnailGetFailed;
|
||||
__int64 m_seed;
|
||||
int64_t m_seed;
|
||||
|
||||
#ifdef __PS3__
|
||||
std::vector<SonyCommerce::ProductInfo>*m_pvProductInfo;
|
||||
|
|
@ -75,7 +75,7 @@ private:
|
|||
bool m_bRebuildTouchBoxes;
|
||||
public:
|
||||
UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
|
||||
|
||||
virtual void updateTooltips();
|
||||
virtual void updateComponents();
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ private:
|
|||
#ifdef _DURANGO
|
||||
static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad);
|
||||
#endif
|
||||
|
||||
|
||||
static int ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static void StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask);
|
||||
static int LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bIsOwner);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
|
|||
bool bTexturePackAlreadyListed;
|
||||
bool bNeedToGetTPD=false;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
|
||||
for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i)
|
||||
{
|
||||
|
|
@ -311,7 +311,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips()
|
|||
// update the tooltips
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should the the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
int iLB = -1;
|
||||
int iX=-1;
|
||||
|
|
@ -322,7 +322,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips()
|
|||
else if (DoesSavesListHaveFocus())
|
||||
{
|
||||
if((m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC))
|
||||
{
|
||||
{
|
||||
if(StorageManager.GetSaveDisabled())
|
||||
{
|
||||
iRB=IDS_TOOLTIPS_DELETESAVE;
|
||||
|
|
@ -378,7 +378,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips()
|
|||
// Is there a save from PS3 or PSVita available?
|
||||
// Sony asked that this be displayed at all times so users are aware of the functionality. We'll display some text when there's no save available
|
||||
//if(app.getRemoteStorage()->saveIsAvailable())
|
||||
{
|
||||
{
|
||||
bool bSignedInLive = ProfileManager.IsSignedInLive(m_iPad);
|
||||
if(bSignedInLive)
|
||||
{
|
||||
|
|
@ -393,7 +393,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips()
|
|||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, iX, iY,-1,-1,iLB,iRB);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
void UIScene_LoadOrJoinMenu::Initialise()
|
||||
{
|
||||
m_iSaveListIndex = 0;
|
||||
|
|
@ -481,7 +481,7 @@ void UIScene_LoadOrJoinMenu::handleGainFocus(bool navBack)
|
|||
{
|
||||
app.SetLiveLinkRequired( true );
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
// re-enable button presses
|
||||
m_bIgnoreInput=false;
|
||||
|
|
@ -825,7 +825,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo()
|
|||
m_pSaveDetails=StorageManager.ReturnSavesInfo();
|
||||
if(m_pSaveDetails==NULL)
|
||||
{
|
||||
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
|
||||
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -874,7 +874,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo()
|
|||
m_pSaveDetails=StorageManager.ReturnSavesInfo();
|
||||
if(m_pSaveDetails==NULL)
|
||||
{
|
||||
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
|
||||
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
|
||||
}
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
|
|
@ -918,7 +918,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons()
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_generators.push_back(levelGen);
|
||||
m_buttonListSaves.addItem(levelGen->getWorldName());
|
||||
|
||||
|
|
@ -969,7 +969,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
|||
case ACTION_MENU_X:
|
||||
#if TO_BE_IMPLEMENTED
|
||||
// Change device
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes.
|
||||
m_bIgnoreInput=true;
|
||||
StorageManager.SetSaveDevice(&CScene_MultiGameJoinLoad::DeviceSelectReturned,this,true);
|
||||
|
|
@ -987,7 +987,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
|||
{
|
||||
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
|
||||
if(bSignedInLive)
|
||||
{
|
||||
{
|
||||
LaunchSaveTransfer();
|
||||
}
|
||||
}
|
||||
|
|
@ -1171,7 +1171,7 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
|
|||
UIScene_LoadOrJoinMenu *pClass=(UIScene_LoadOrJoinMenu *)lpParam;
|
||||
pClass->m_bIgnoreInput=false;
|
||||
if (bRes)
|
||||
{
|
||||
{
|
||||
uint16_t ui16Text[128];
|
||||
ZeroMemory(ui16Text, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(ui16Text);
|
||||
|
|
@ -1184,13 +1184,13 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
|
|||
StorageManager.RenameSaveData(pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC, ui16Text,&UIScene_LoadOrJoinMenu::RenameSaveDataReturned,pClass);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
pClass->m_bIgnoreInput=false;
|
||||
pClass->updateTooltips();
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
pClass->m_bIgnoreInput=false;
|
||||
pClass->updateTooltips();
|
||||
|
|
@ -1204,13 +1204,13 @@ void UIScene_LoadOrJoinMenu::handleInitFocus(F64 controlId, F64 childId)
|
|||
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleInitFocus - %d , %d\n", (int)controlId, (int)childId);
|
||||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId)
|
||||
void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId)
|
||||
{
|
||||
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleFocusChange - %d , %d\n", (int)controlId, (int)childId);
|
||||
|
||||
|
||||
switch((int)controlId)
|
||||
{
|
||||
case eControl_GamesList:
|
||||
case eControl_GamesList:
|
||||
m_iGameListIndex = childId;
|
||||
m_buttonListGames.updateChildFocus( (int) childId );
|
||||
break;
|
||||
|
|
@ -1246,7 +1246,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
|
|||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
if((int)childId == JOIN_LOAD_CREATE_BUTTON_INDEX)
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
|
||||
m_controlJoinTimer.setVisible( false );
|
||||
|
|
@ -1298,7 +1298,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
|
|||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
|
|
@ -1340,7 +1340,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
|
|||
case eControl_GamesList:
|
||||
{
|
||||
m_bIgnoreInput=true;
|
||||
|
||||
|
||||
m_eAction = eAction_JoinGame;
|
||||
|
||||
//CD - Added for audio
|
||||
|
|
@ -1375,7 +1375,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
|||
|
||||
bool bPlayStationPlus=true;
|
||||
int iPadWithNoPlaystationPlus=0;
|
||||
bool isSignedInLive = true;
|
||||
bool isSignedInLive = true;
|
||||
int iPadNotSignedInLive = -1;
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
|
|
@ -1458,7 +1458,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
|||
SceNpCommerceDialogParam param;
|
||||
sceNpCommerceDialogParamInitialize(¶m);
|
||||
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
|
||||
iResult=sceNpCommerceDialogOpen(¶m);
|
||||
|
|
@ -1532,7 +1532,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
|||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
{
|
||||
{
|
||||
// Load data from disc
|
||||
//File saveFile( L"Tutorial\\Tutorial" );
|
||||
//LoadSaveFromDisk(&saveFile);
|
||||
|
|
@ -1630,7 +1630,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
|||
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
int iX=-1;
|
||||
|
||||
|
|
@ -1854,7 +1854,7 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id)
|
|||
|
||||
if(iImageDataBytes!=0)
|
||||
{
|
||||
// set the image
|
||||
// set the image
|
||||
registerSubstitutionTexture(textureName,pbImageData,iImageDataBytes,true);
|
||||
m_iConfigA[i]=-1;
|
||||
}
|
||||
|
|
@ -1867,7 +1867,7 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id)
|
|||
bool bAllDone=true;
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
if(m_iConfigA[i]!=-1)
|
||||
{
|
||||
bAllDone = false;
|
||||
}
|
||||
|
|
@ -1882,13 +1882,13 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id)
|
|||
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform savePlatform /*= SAVE_FILE_PLATFORM_LOCAL*/)
|
||||
{
|
||||
{
|
||||
// we'll only be coming in here when the tutorial is loaded now
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
|
|
@ -1896,7 +1896,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save
|
|||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle(saveFile->getName().c_str());
|
||||
|
||||
__int64 fileSize = saveFile->length();
|
||||
int64_t fileSize = saveFile->length();
|
||||
FileInputStream fis(*saveFile);
|
||||
byteArray ba(fileSize);
|
||||
fis.read(ba);
|
||||
|
|
@ -1946,7 +1946,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save
|
|||
|
||||
#ifdef SONY_REMOTE_STORAGE_DOWNLOAD
|
||||
void UIScene_LoadOrJoinMenu::LoadSaveFromCloud()
|
||||
{
|
||||
{
|
||||
|
||||
wchar_t wFileName[128];
|
||||
mbstowcs(wFileName, app.getRemoteStorage()->getLocalFilename(), strlen(app.getRemoteStorage()->getLocalFilename())+1); // plus null
|
||||
|
|
@ -1960,7 +1960,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud()
|
|||
mbstowcs(wSaveName, app.getRemoteStorage()->getSaveNameUTF8(), strlen(app.getRemoteStorage()->getSaveNameUTF8())+1); // plus null
|
||||
StorageManager.SetSaveTitle(wSaveName);
|
||||
|
||||
__int64 fileSize = cloudFile.length();
|
||||
int64_t fileSize = cloudFile.length();
|
||||
FileInputStream fis(cloudFile);
|
||||
byteArray ba(fileSize);
|
||||
fis.read(ba);
|
||||
|
|
@ -2019,7 +2019,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt
|
|||
// Check that we have a valid save selected (can get a bad index if the save list has been refreshed)
|
||||
bool validSelection= pClass->m_iDefaultButtonsC != 0 && pClass->m_iSaveListIndex >= pClass->m_iDefaultButtonsC;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultDecline && validSelection)
|
||||
if(result==C4JStorage::EMessage_ResultDecline && validSelection)
|
||||
{
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
{
|
||||
|
|
@ -2049,7 +2049,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes)
|
|||
if(bRes)
|
||||
{
|
||||
// wipe the list and repopulate it
|
||||
pClass->m_iState=e_SavesRepopulateAfterDelete;
|
||||
pClass->m_iState=e_SavesRepopulateAfterDelete;
|
||||
}
|
||||
else pClass->m_bIgnoreInput=false;
|
||||
|
||||
|
|
@ -2169,7 +2169,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
|||
UIScene_LoadOrJoinMenu *pClass = (UIScene_LoadOrJoinMenu *)pParam;
|
||||
|
||||
// Exit with or without saving
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// we need to enable background downloading for the DLC
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
|
|
@ -2194,9 +2194,9 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
|||
#endif
|
||||
|
||||
|
||||
#if defined _XBOX_ONE
|
||||
#if defined _XBOX_ONE
|
||||
if(ProfileManager.IsSignedIn(iPad))
|
||||
{
|
||||
{
|
||||
if (ProfileManager.IsSignedInLive(iPad))
|
||||
{
|
||||
wstring ProductId;
|
||||
|
|
@ -2205,13 +2205,13 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
|||
StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why.
|
||||
UINT uiIDA[1] = { IDS_CONFIRM_OK };
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
pClass->m_bIgnoreInput=false;
|
||||
|
|
@ -2223,7 +2223,7 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStora
|
|||
{
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#if defined(__PS3__)
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_LoadOrJoinMenu::PSN_SignInReturned, pClass);
|
||||
|
|
@ -2442,7 +2442,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
DWORD dwDataSizeSaveImage=0;
|
||||
|
||||
StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
|
||||
StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that
|
||||
StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that
|
||||
|
||||
BYTE bTextMetadata[88];
|
||||
ZeroMemory(bTextMetadata,88);
|
||||
|
|
@ -2470,7 +2470,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
{
|
||||
// we can't cancel here, we need the saves info so we can delete the file
|
||||
if(pClass->m_saveTransferDownloadCancelled)
|
||||
{
|
||||
{
|
||||
WCHAR wcTemp[256];
|
||||
swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download"
|
||||
m_wstrStageText=wcTemp;
|
||||
|
|
@ -2485,7 +2485,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
break;
|
||||
case eSaveTransfer_GettingSavesInfo:
|
||||
if(pClass->m_saveTransferDownloadCancelled)
|
||||
{
|
||||
{
|
||||
WCHAR wcTemp[256];
|
||||
swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download"
|
||||
m_wstrStageText=wcTemp;
|
||||
|
|
@ -2602,7 +2602,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
DWORD dwDataSizeSaveImage=0;
|
||||
|
||||
StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
|
||||
StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that
|
||||
StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that
|
||||
|
||||
BYTE bTextMetadata[88];
|
||||
ZeroMemory(bTextMetadata,88);
|
||||
|
|
@ -2613,12 +2613,12 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
}
|
||||
|
||||
|
||||
#ifdef SPLIT_SAVES
|
||||
#ifdef SPLIT_SAVES
|
||||
ConsoleSaveFileOriginal oldFormatSave( wSaveName, ba.data, ba.length, false, app.getRemoteStorage()->getSavePlatform() );
|
||||
pSave = new ConsoleSaveFileSplit( &oldFormatSave, false, pMinecraft->progressRenderer );
|
||||
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING);
|
||||
pSave->Flush(false,false);
|
||||
pSave->Flush(false,false);
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Saving;
|
||||
#else
|
||||
pSave = new ConsoleSaveFileOriginal( wSaveName, ba.data, ba.length, false, app.getRemoteStorage()->getSavePlatform() );
|
||||
|
|
@ -2654,7 +2654,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
|
||||
delete pSave;
|
||||
|
||||
|
||||
|
||||
pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC);
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Succeeded;
|
||||
}
|
||||
|
|
@ -2668,7 +2668,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
app.getRemoteStorage()->waitForStorageManagerIdle(); // wait for everything to complete before we hand control back to the player
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable());
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable());
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2683,7 +2683,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
if(bSaveFileCreated)
|
||||
{
|
||||
if(pClass->m_saveTransferDownloadCancelled)
|
||||
{
|
||||
{
|
||||
WCHAR wcTemp[256];
|
||||
swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download"
|
||||
m_wstrStageText=wcTemp;
|
||||
|
|
@ -2743,7 +2743,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
|
|||
{
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable());
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable());
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
|
||||
}
|
||||
if(bSaveFileCreated) // save file has been created, then deleted.
|
||||
|
|
@ -2887,7 +2887,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter )
|
|||
{
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable());
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable());
|
||||
pClass->m_eSaveUploadState = esaveUpload_Finished;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2904,7 +2904,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter )
|
|||
{
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable());
|
||||
ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable());
|
||||
pClass->m_eSaveUploadState = esaveUpload_Finished;
|
||||
}
|
||||
}
|
||||
|
|
@ -2953,7 +2953,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferDialogReturned(void *pParam,int iPad,C4J
|
|||
{
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// upload the save
|
||||
pClass->LaunchSaveUpload();
|
||||
|
|
@ -3062,13 +3062,13 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
ByteArrayInputStream bais(UIScene_LoadOrJoinMenu::s_transferData);
|
||||
DataInputStream dis(&bais);
|
||||
|
||||
wstring saveTitle = dis.readUTF();
|
||||
wstring saveTitle = dis.readUTF();
|
||||
StorageManager.SetSaveTitle(saveTitle.c_str());
|
||||
|
||||
wstring saveUniqueName = dis.readUTF();
|
||||
|
||||
// 4J Stu - Don't set this any more. We added it so that we could share the ban list data for this save
|
||||
// However if the player downloads the same save multiple times, it will overwrite the previous version
|
||||
// However if the player downloads the same save multiple times, it will overwrite the previous version
|
||||
// with that filname, and they could have made changes to it.
|
||||
//StorageManager.SetSaveUniqueFilename((wchar_t *)saveUniqueName.c_str());
|
||||
|
||||
|
|
@ -3091,13 +3091,13 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
case eSaveTransferFile_SaveData:
|
||||
{
|
||||
#ifdef SPLIT_SAVES
|
||||
if(!pStateContainer->m_bSaveTransferCancelled)
|
||||
if(!pStateContainer->m_bSaveTransferCancelled)
|
||||
{
|
||||
ConsoleSaveFileOriginal oldFormatSave( L"Temp name", UIScene_LoadOrJoinMenu::s_transferData.data, UIScene_LoadOrJoinMenu::s_transferData.length, false, SAVE_FILE_PLATFORM_X360 );
|
||||
pSave = new ConsoleSaveFileSplit( &oldFormatSave, false, pMinecraft->progressRenderer );
|
||||
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING);
|
||||
if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false);
|
||||
if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false);
|
||||
}
|
||||
pStateContainer->m_eSaveTransferState=C4JStorage::eSaveTransfer_Saving;
|
||||
|
||||
|
|
@ -3118,7 +3118,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
pSave->ConvertToLocalPlatform();
|
||||
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING);
|
||||
if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false);
|
||||
if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false);
|
||||
|
||||
pStateContainer->m_iProgress+=1;
|
||||
if(pStateContainer->m_iProgress==101)
|
||||
|
|
@ -3134,8 +3134,8 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
// On Durango/Orbis, we need to wait for all the asynchronous saving processes to complete before destroying the levels, as that will ultimately delete
|
||||
// the directory level storage & therefore the ConsoleSaveSplit instance, which needs to be around until all the sub files have completed saving.
|
||||
#if defined(_DURANGO) || defined(__ORBIS__)
|
||||
pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC);
|
||||
|
||||
pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC);
|
||||
|
||||
while(StorageManager.GetSaveState() != C4JStorage::ESaveGame_Idle )
|
||||
{
|
||||
Sleep(10);
|
||||
|
|
@ -3150,9 +3150,9 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
#ifdef _XBOX_ONE
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_AND_CONVERT_COMPLETE);
|
||||
#endif
|
||||
|
||||
|
||||
pStateContainer->m_eSaveTransferState=C4JStorage::eSaveTransfer_Idle;
|
||||
|
||||
|
||||
// wipe the list and repopulate it
|
||||
if(!pStateContainer->m_bSaveTransferCancelled) pStateContainer->m_pClass->m_iState=e_SavesRepopulateAfterTransferDownload;
|
||||
|
||||
|
|
@ -3192,7 +3192,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
|
|||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::RequestFileSize( SaveTransferStateContainer *pClass, wchar_t *filename )
|
||||
{
|
||||
{
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
|
||||
// get the save file size
|
||||
|
|
@ -3298,7 +3298,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferUpdateProgress(LPVOID lpParam,unsigned l
|
|||
|
||||
if(pClass->m_bSaveTransferCancelled) // was cancelled
|
||||
{
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING);
|
||||
pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING);
|
||||
swprintf(wcTemp,app.GetString(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING));
|
||||
m_wstrStageText=wcTemp;
|
||||
pMinecraft->progressRenderer->progressStage( m_wstrStageText );
|
||||
|
|
@ -3373,7 +3373,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDialogReturned(void *pParam,int iPad,C4JStor
|
|||
{
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
|
||||
LoadingInputParams *loadingParams = new LoadingInputParams();
|
||||
|
|
@ -3418,7 +3418,7 @@ int UIScene_LoadOrJoinMenu::CopySaveThreadProc( LPVOID lpParameter )
|
|||
ui.LeaveCallbackIdCriticalSection();
|
||||
// Copy save data takes two callbacks - one for completion, and one for progress. The progress callback also lets us cancel the operation, if we return false.
|
||||
StorageManager.CopySaveData(&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC],UIScene_LoadOrJoinMenu::CopySaveDataReturned,UIScene_LoadOrJoinMenu::CopySaveDataProgress,lpParameter);
|
||||
|
||||
|
||||
bool bContinue = true;
|
||||
do
|
||||
{
|
||||
|
|
@ -3455,7 +3455,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDataReturned(LPVOID lpParam, bool success, C
|
|||
{
|
||||
pClass->m_bCopying = false;
|
||||
// wipe the list and repopulate it
|
||||
pClass->m_iState=e_SavesRepopulateAfterDelete;
|
||||
pClass->m_iState=e_SavesRepopulateAfterDelete;
|
||||
ui.LeaveCallbackIdCriticalSection();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
CreateWorldMenuInitData *params = (CreateWorldMenuInitData *)pInitData->pvInitData;
|
||||
|
||||
m_MoreOptionsParams.bGenerateOptions=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bStructures=TRUE;
|
||||
m_MoreOptionsParams.bFlatWorld=FALSE;
|
||||
m_MoreOptionsParams.bBonusChest=FALSE;
|
||||
m_MoreOptionsParams.bPVP = TRUE;
|
||||
|
|
@ -96,7 +96,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
{
|
||||
// The profile settings say Online, but either the player is offline, or they are not allowed to play online
|
||||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonGameMode.SetText(app.GetString(IDS_GAMEMODE_SURVIVAL));
|
||||
|
|
@ -104,7 +104,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
|
||||
m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty);
|
||||
m_SliderDifficulty.SetValue(m_CurrentDifficulty);
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty]));
|
||||
m_SliderDifficulty.SetText(TempString);
|
||||
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
|
||||
|
|
@ -135,7 +135,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
m_NewWorld.SetEnable(true);
|
||||
|
||||
m_EditWorldName.SetTextLimit(XCONTENT_MAX_DISPLAYNAME_LENGTH);
|
||||
|
||||
|
||||
wstring wWorldName = m_EditWorldName.GetText();
|
||||
|
||||
// set the caret to the end of the default text
|
||||
|
|
@ -148,7 +148,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
|
||||
XuiSetTimer(m_hObj,GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME);
|
||||
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
|
||||
|
||||
|
||||
TelemetryManager->RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0);
|
||||
|
||||
// 4J-PB - Load up any texture pack data we have locally in the XZP
|
||||
|
|
@ -176,7 +176,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
m_pTexturePacksList->SetSelectionChangedHandle(m_hObj);
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
HRESULT hr;
|
||||
for(unsigned int i = 0; i < texturePacksCount; ++i)
|
||||
|
|
@ -189,7 +189,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||
if(pDLCTexPack)
|
||||
{
|
||||
|
|
@ -297,7 +297,7 @@ HRESULT CScene_MultiGameCreate::OnDestroy()
|
|||
app.RemoveMemoryTPDFile(app.TMSFileA[i].iConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
app.FreeLocalTMSFiles(eTMSFileType_TexturePack);
|
||||
|
||||
return S_OK;
|
||||
|
|
@ -338,7 +338,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
|
||||
// DLC might have been corrupt
|
||||
if(ullOfferID_Full!=0LL)
|
||||
{
|
||||
{
|
||||
TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF);
|
||||
|
||||
UINT uiIDA[3];
|
||||
|
|
@ -374,7 +374,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
// if the profile data has been changed, then force a profile write (we save the online/invite/friends of friends settings)
|
||||
// It seems we're allowed to break the 5 minute rule if it's the result of a user action
|
||||
// check the checkboxes
|
||||
|
||||
|
||||
// Only save the online setting if the user changed it - we may change it because we're offline, but don't want that saved
|
||||
if(!m_MoreOptionsParams.bOnlineSettingChangedBySystem)
|
||||
{
|
||||
|
|
@ -389,15 +389,15 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
if(m_MoreOptionsParams.dwTexturePack!=0)
|
||||
{
|
||||
// texture pack hasn't been set yet, so check what it will be
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
|
||||
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||
|
||||
if(pTexturePack==NULL)
|
||||
{
|
||||
// corrupt DLC so set it to the default textures
|
||||
m_MoreOptionsParams.dwTexturePack=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
m_pDLCPack=pTexturePack->getDLCPack();
|
||||
// do we have a license?
|
||||
if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
|
||||
|
|
@ -439,11 +439,11 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
return S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE)
|
||||
{
|
||||
{
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
uiIDA[1]=IDS_CONFIRM_CANCEL;
|
||||
|
|
@ -478,7 +478,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
{
|
||||
m_bIgnoreInput = false;
|
||||
|
|
@ -495,7 +495,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
|||
}
|
||||
}
|
||||
else if(hObjPressed==m_MoreOptions)
|
||||
{
|
||||
{
|
||||
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_LaunchMoreOptionsMenu,&m_MoreOptionsParams);
|
||||
}
|
||||
else if(hObjPressed == m_ButtonGameMode)
|
||||
|
|
@ -527,7 +527,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS
|
|||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(iPad))
|
||||
{
|
||||
{
|
||||
ULONGLONG ullIndexA[1];
|
||||
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId());
|
||||
|
||||
|
|
@ -542,7 +542,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS
|
|||
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
|
||||
// the license change coming in when the offer has been installed will cause this scene to refresh
|
||||
// the license change coming in when the offer has been installed will cause this scene to refresh
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -629,12 +629,12 @@ HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINot
|
|||
// Enable the done button when we have all of the necessary information
|
||||
wstring wWorldName = m_EditWorldName.GetText();
|
||||
BOOL bHasWorldName = ( wWorldName.length()!=0);
|
||||
m_NewWorld.SetEnable(bHasWorldName);
|
||||
m_NewWorld.SetEnable(bHasWorldName);
|
||||
}
|
||||
else if(hObjSource==m_SliderDifficulty.GetSlider() )
|
||||
{
|
||||
app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pValueChangedData->nValue);
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue]));
|
||||
swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue]));
|
||||
m_SliderDifficulty.SetText(TempString);
|
||||
}
|
||||
|
||||
|
|
@ -656,11 +656,11 @@ HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pCo
|
|||
|
||||
HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
switch(pTimer->nId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
case GAME_CREATE_ONLINE_TIMER_ID:
|
||||
{
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
|
@ -693,7 +693,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID:
|
||||
{
|
||||
// also check for any new texture packs info being available
|
||||
|
|
@ -718,7 +718,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
|||
PBYTE pbImageData=NULL;
|
||||
|
||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.iData = m_iConfigA[i];
|
||||
HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
||||
app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]);
|
||||
|
|
@ -734,7 +734,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
|||
bool bAllDone=true;
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
if(m_iConfigA[i]!=-1)
|
||||
{
|
||||
bAllDone = false;
|
||||
}
|
||||
|
|
@ -756,7 +756,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
|
|||
{
|
||||
CScene_MultiGameCreate* pClass = (CScene_MultiGameCreate*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
|
||||
|
|
@ -780,7 +780,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
|
|||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
|
@ -816,7 +816,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
|||
if(ProfileManager.IsSignedIn(iPad))
|
||||
{
|
||||
DWORD dwLocalUsersMask = 0;
|
||||
|
||||
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
bool noPrivileges = false;
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
|||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
|
||||
if(isClientSide && (noPrivileges || noUGC) )
|
||||
{
|
||||
if( noUGC )
|
||||
|
|
@ -863,7 +863,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
pClass->SetShow( TRUE );
|
||||
}
|
||||
|
|
@ -884,7 +884,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
|||
|
||||
// create the world and launch
|
||||
wstring wWorldName = pClass->m_EditWorldName.GetText();
|
||||
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str());
|
||||
|
|
@ -904,11 +904,11 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
|||
|
||||
// start the game
|
||||
bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE);
|
||||
__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
|
||||
int64_t 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
|
||||
|
||||
if (wSeed.length() != 0)
|
||||
{
|
||||
__int64 value = 0;
|
||||
int64_t value = 0;
|
||||
unsigned int len = (unsigned int)wSeed.length();
|
||||
|
||||
//Check if the input string contains a numerical value
|
||||
|
|
@ -923,7 +923,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
|||
|
||||
//If the input string is a numerical value, convert it to a number
|
||||
if( isNumber )
|
||||
value = _fromString<__int64>(wSeed);
|
||||
value = _fromString<int64_t>(wSeed);
|
||||
|
||||
//If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it
|
||||
if( value != 0 )
|
||||
|
|
@ -948,7 +948,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
|||
param->seed = seedValue;
|
||||
param->saveData = NULL;
|
||||
param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack;
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
pMinecraft->skins->selectTexturePackById(pClass->m_MoreOptionsParams.dwTexturePack);
|
||||
//pMinecraft->skins->updateUI();
|
||||
|
|
@ -956,7 +956,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw
|
|||
app.SetGameHostOption(eGameHostOption_Difficulty,Minecraft::GetInstance()->options->difficulty);
|
||||
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,pClass->m_MoreOptionsParams.bAllowFriendsOfFriends);
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags,app.GetGameSettings(pClass->m_iPad,eGameSetting_GamertagsVisible)?1:0);
|
||||
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_BedrockFog,app.GetGameSettings(pClass->m_iPad,eGameSetting_BedrockFog)?1:0);
|
||||
|
||||
// CXuiList listObject;
|
||||
|
|
@ -999,7 +999,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransi
|
|||
if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK;
|
||||
|
||||
if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
{
|
||||
m_SliderDifficulty.SetValueDisplay(FALSE);
|
||||
}
|
||||
|
||||
|
|
@ -1015,7 +1015,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransiti
|
|||
{
|
||||
}
|
||||
else if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
{
|
||||
if(m_bSetup && m_texturePackDescDisplayed)
|
||||
{
|
||||
XUITimeline *timeline;
|
||||
|
|
@ -1054,7 +1054,7 @@ HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotif
|
|||
if(hObjSource == m_pTexturePacksList->m_hObj)
|
||||
{
|
||||
UpdateTexturePackDescription(pNotifySelChangedData->iItem);
|
||||
|
||||
|
||||
// 4J-JEV: Removed expand description check, taken care of elsewhere.
|
||||
}
|
||||
|
||||
|
|
@ -1205,9 +1205,9 @@ void CScene_MultiGameCreate::UpdateCurrentTexturePack()
|
|||
StorageManager.RequestMessageBox(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE, IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CScene_MultiGameCreate::TexturePackDialogReturned,this,app.GetStringTable());
|
||||
}
|
||||
|
||||
// do set the texture pack id, and on the user pressing create world, check they have it
|
||||
// do set the texture pack id, and on the user pressing create world, check they have it
|
||||
m_MoreOptionsParams.dwTexturePack = ListItem.iData;
|
||||
return ;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1221,7 +1221,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
|||
pClass->m_currentTexturePackIndex = pClass->m_pTexturePacksList->GetCurSel();
|
||||
// Exit with or without saving
|
||||
// Decline means install full version of the texture pack in this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// we need to enable background downloading for the DLC
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
|
|
@ -1248,7 +1248,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
|||
ullIndexA[0]=pDLCInfo->ullOfferID_Trial;
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
|
|
@ -1274,12 +1274,12 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled()
|
|||
}
|
||||
|
||||
HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
|
||||
{
|
||||
{
|
||||
// refill the texture pack list
|
||||
m_pTexturePacksList->SetSelectionChangedHandle(m_hObj);
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
HRESULT hr;
|
||||
for(unsigned int i = 0; i < texturePacksCount; ++i)
|
||||
|
|
@ -1292,7 +1292,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
|
|||
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
ListInfo.fEnabled = TRUE;
|
||||
ListInfo.fEnabled = TRUE;
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
||||
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||
|
|
|
|||
|
|
@ -42,13 +42,13 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
|
||||
m_iTexturePacksNotInstalled=0;
|
||||
m_iConfigA=NULL;
|
||||
|
||||
|
||||
XuiControlSetText(m_LabelNoGames,app.GetString(IDS_NO_GAMES_FOUND));
|
||||
XuiControlSetText(m_GamesList,app.GetString(IDS_JOIN_GAME));
|
||||
XuiControlSetText(m_SavesList,app.GetString(IDS_START_GAME));
|
||||
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
|
@ -64,17 +64,17 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
|
||||
m_bRetrievingSaveInfo=false;
|
||||
m_bSaveTransferInProgress=false;
|
||||
|
||||
|
||||
// check for a default custom cloak in the global storage
|
||||
// 4J-PB - changed to a config file
|
||||
// if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
// {
|
||||
// {
|
||||
// app.InstallDefaultCape();
|
||||
// }
|
||||
|
||||
m_initData= new JoinMenuInitData();
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
|
||||
XPARTY_USER_LIST partyList;
|
||||
|
||||
if((XPartyGetUserList( &partyList ) != XPARTY_E_NOT_IN_PARTY ) && (partyList.dwUserCount>1))
|
||||
|
|
@ -90,7 +90,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
if(m_bInParty) iLB = IDS_TOOLTIPS_PARTY_GAMES;
|
||||
|
||||
XuiSetTimer(m_hObj,JOIN_LOAD_ONLINE_TIMER_ID,JOIN_LOAD_ONLINE_TIMER_TIME);
|
||||
|
||||
|
||||
m_iSaveInfoC=0;
|
||||
|
||||
VOID *pObj;
|
||||
|
|
@ -110,7 +110,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
{
|
||||
// if we're waiting for DLC to mount, don't fill the save list. The custom message on end of dlc mounting will do that
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
|
||||
|
||||
|
||||
m_iChangingSaveGameInfoIndex = 0;
|
||||
|
|
@ -135,7 +135,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
// saving is disabled, but we should still be able to load from a selected save device
|
||||
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,iLB,IDS_TOOLTIPS_DELETESAVE);
|
||||
|
||||
|
||||
GetSaveInfo();
|
||||
}
|
||||
else
|
||||
|
|
@ -153,7 +153,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
// 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename)
|
||||
bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame();
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,-1,bCanRename?IDS_TOOLTIPS_SAVEOPTIONS:IDS_TOOLTIPS_DELETESAVE);
|
||||
|
||||
|
||||
GetSaveInfo();
|
||||
}
|
||||
}
|
||||
|
|
@ -165,7 +165,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
|
||||
// 4J Stu - Fix for #12530 -TCR 001 BAS Game Stability: Title will crash if the player disconnects while starting a new world and then opts to play the tutorial once they have been returned to the Main Menu.
|
||||
MinecraftServer::resetFlags();
|
||||
|
||||
|
||||
// If we're not ignoring input, then we aren't still waiting for the DLC to mount, and can now check for corrupt dlc. Otherwise this will happen when the dlc has finished mounting.
|
||||
if( !m_bIgnoreInput)
|
||||
{
|
||||
|
|
@ -191,7 +191,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
|||
bool bTexturePackAlreadyListed;
|
||||
bool bNeedToGetTPD=false;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
||||
//CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
//HRESULT hr;
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons()
|
|||
// increment the count of the mash-up pack worlds in the save list
|
||||
m_iMashUpButtonsC++;
|
||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
||||
DWORD dwImageBytes;
|
||||
DWORD dwImageBytes;
|
||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
||||
HXUIBRUSH hXuiBrush;
|
||||
|
||||
|
|
@ -353,8 +353,8 @@ HRESULT CScene_MultiGameJoinLoad::GetSaveInfo( )
|
|||
ListInfo.fEnabled=TRUE;
|
||||
ListInfo.iData = -1;
|
||||
m_pSavesList->AddData(ListInfo);
|
||||
}
|
||||
m_pSavesList->SetCurSelVisible(0);
|
||||
}
|
||||
m_pSavesList->SetCurSelVisible(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -419,7 +419,7 @@ int CScene_MultiGameJoinLoad::DeviceRemovedDialogReturned(void *pParam,int iPad,
|
|||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
StorageManager.SetSaveDisabled(true);
|
||||
StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false);
|
||||
|
|
@ -462,7 +462,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
//CScene_MultiGameInfo::JoinMenuInitData *initData = new CScene_MultiGameInfo::JoinMenuInitData();
|
||||
m_initData->iPad = m_iPad;
|
||||
m_initData->selectedSession = currentSessions.at( nIndex );
|
||||
|
||||
|
||||
// check that we have the texture pack available
|
||||
// If it's not the default texture pack
|
||||
if(m_initData->selectedSession->data.texturePackParentId!=0)
|
||||
|
|
@ -513,7 +513,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
// Reset the background downloading, in case we changed it by attempting to download a texture pack
|
||||
|
|
@ -536,7 +536,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
CXuiCtrl4JList::LIST_ITEM_INFO info = m_pSavesList->GetData(iIndex);
|
||||
|
||||
if(iIndex == JOIN_LOAD_CREATE_BUTTON_INDEX)
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
|
|
@ -571,7 +571,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// check if this is a damaged save
|
||||
if(m_pSavesList->GetData(iIndex).bIsDamaged)
|
||||
{
|
||||
|
|
@ -582,7 +582,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
app.SetTutorialMode( false );
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
{
|
||||
|
|
@ -605,7 +605,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -632,11 +632,11 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
|||
|
||||
app.NavigateBack(XUSER_INDEX_ANY);
|
||||
rfHandled = TRUE;
|
||||
break;
|
||||
break;
|
||||
case VK_PAD_X:
|
||||
|
||||
// Change device
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
|
||||
// device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes.
|
||||
m_bIgnoreInput=true;
|
||||
StorageManager.SetSaveDevice(&CScene_MultiGameJoinLoad::DeviceSelectReturned,this,true);
|
||||
|
|
@ -657,7 +657,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
|||
{
|
||||
// save transfer - make sure they want to overwrite a save that is up there
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
{
|
||||
// 4J-PB - required for a delete of the save if it's found to be a corrupted save
|
||||
DWORD nIndex = m_pSavesList->GetCurSel();
|
||||
m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(nIndex).iIndex;
|
||||
|
|
@ -668,13 +668,13 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
|||
|
||||
ui.RequestMessageBox(IDS_SAVE_TRANSFER_TITLE, IDS_SAVE_TRANSFER_TEXT, uiIDA, 2, pInputData->UserIndex,&CScene_MultiGameJoinLoad::SaveTransferDialogReturned,this, app.GetStringTable());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VK_PAD_RSHOULDER:
|
||||
if(DoesSavesListHaveFocus())
|
||||
{
|
||||
m_bIgnoreInput = true;
|
||||
|
||||
|
||||
int iIndex=m_SavesList.GetCurSel();
|
||||
m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(iIndex).iIndex;
|
||||
|
||||
|
|
@ -755,19 +755,19 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled)
|
||||
{
|
||||
|
||||
|
||||
CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE );
|
||||
// start the texture pack timer again
|
||||
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
// re-enable button presses
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
|
|
@ -812,7 +812,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled
|
|||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -901,7 +901,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTran
|
|||
if(pTransition->dwTransType == XUI_TRANSITION_BACKTO)
|
||||
{
|
||||
// Can't call this here because if you back out of the load info screen and then go back in and load a game, it will attempt to use the dlc as it's running a mount of the dlc
|
||||
|
||||
|
||||
// block input if we're waiting for DLC to install, and wipe the saves list. The end of dlc mounting custom message will fill the list again
|
||||
if(app.StartInstallDLCProcess(m_iPad)==false)
|
||||
{
|
||||
|
|
@ -925,14 +925,14 @@ HRESULT CScene_MultiGameJoinLoad::OnFontRendererChange()
|
|||
// update the tooltips
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should the the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -986,12 +986,12 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotify
|
|||
// update the tooltips
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should the the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
|
|
@ -1118,7 +1118,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesListCallback(LPVOID lpParam)
|
|||
// check this there's no save transfer in progress
|
||||
if(!pClass->m_bSaveTransferInProgress)
|
||||
{
|
||||
pClass->UpdateGamesList();
|
||||
pClass->UpdateGamesList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1150,12 +1150,12 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
|||
delete (*it);
|
||||
}
|
||||
currentSessions.clear();
|
||||
|
||||
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
|
||||
if( DoesGamesListHaveFocus() )
|
||||
|
|
@ -1163,7 +1163,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
|||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -1282,7 +1282,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
|||
// is it in the tpd data ?
|
||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
|
|
@ -1291,7 +1291,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
|||
{
|
||||
pbImageData = tp->getPackIcon(dwImageBytes);
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
{
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
|
|
@ -1303,7 +1303,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
|||
XuiCreateTextureBrushFromMemory(m_DefaultMinecraftIconData,m_DefaultMinecraftIconSize,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0)
|
||||
{
|
||||
|
|
@ -1324,14 +1324,14 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
|||
|
||||
if(m_searches>0)
|
||||
--m_searches;
|
||||
|
||||
|
||||
if(m_searches==0)
|
||||
{
|
||||
m_NetGamesListTimer.SetShow( FALSE );
|
||||
|
||||
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
|
||||
if( DoesGamesListHaveFocus() )
|
||||
|
|
@ -1374,7 +1374,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
|||
}
|
||||
|
||||
unsigned int startOffset = m_GamesList.GetItemCount();
|
||||
//m_GamesList.InsertItems(startOffset,dwNumResults);
|
||||
//m_GamesList.InsertItems(startOffset,dwNumResults);
|
||||
//m_GamesList.SetEnable(TRUE);
|
||||
//XuiElementSetDisableFocusRecursion( m_GamesList.m_hObj, FALSE);
|
||||
|
||||
|
|
@ -1449,7 +1449,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( m_GamesList.GetItemCount() == 0)
|
||||
{
|
||||
m_LabelNoGames.SetShow( TRUE );
|
||||
|
|
@ -1537,14 +1537,14 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
|||
{
|
||||
// if the saves list has focus, then we should show the Delete Save tooltip
|
||||
// if the games list has focus, then we should show the View Gamercard tooltip
|
||||
int iRB=-1;
|
||||
int iRB=-1;
|
||||
int iY = -1;
|
||||
if( pClass->DoesGamesListHaveFocus() )
|
||||
{
|
||||
iY = IDS_TOOLTIPS_VIEW_GAMERCARD;
|
||||
}
|
||||
else if(pClass->DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( pClass->m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -1593,7 +1593,7 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
|||
pClass->GetSaveInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_SELECTDEVICE,iY,-1,-1,iLB,iRB);
|
||||
// clear the saves list
|
||||
pClass->m_pSavesList->RemoveAllData();
|
||||
|
|
@ -1623,11 +1623,11 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue)
|
|||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
switch(pTimer->nId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
case JOIN_LOAD_ONLINE_TIMER_ID:
|
||||
{
|
||||
XPARTY_USER_LIST partyList;
|
||||
|
|
@ -1673,7 +1673,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
|||
{
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -1737,7 +1737,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
|||
|
||||
//CXuiCtrl4JList::LIST_ITEM_INFO ListInfo;
|
||||
// for each iConfig, check if the data is available, and add it to the List, then remove it from the viConfig
|
||||
|
||||
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
|
|
@ -1760,7 +1760,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
|||
bool bAllDone=true;
|
||||
for(int i=0;i<m_iTexturePacksNotInstalled;i++)
|
||||
{
|
||||
if(m_iConfigA[i]!=-1)
|
||||
if(m_iConfigA[i]!=-1)
|
||||
{
|
||||
bAllDone = false;
|
||||
}
|
||||
|
|
@ -1878,25 +1878,25 @@ int CScene_MultiGameJoinLoad::DeleteSaveDataReturned(void *pParam,bool bSuccess)
|
|||
pClass->m_iSaveInfoC=0;
|
||||
pClass->GetSaveInfo();
|
||||
}
|
||||
|
||||
|
||||
pClass->m_bIgnoreInput=false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
{
|
||||
{
|
||||
// Load data from disc
|
||||
//File saveFile( L"Tutorial\\Tutorial" );
|
||||
//LoadSaveFromDisk(&saveFile);
|
||||
|
||||
// clear out the app's terrain features list
|
||||
app.ClearTerrainFeaturePosition();
|
||||
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle(levelGen->getDefaultSaveName().c_str());
|
||||
|
||||
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
|
|
@ -1918,7 +1918,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
|||
if(levelGen->requiresTexturePack())
|
||||
{
|
||||
param->texturePackId = levelGen->getRequiredTexturePackId();
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
pMinecraft->skins->selectTexturePackById(param->texturePackId);
|
||||
//pMinecraft->skins->updateUI();
|
||||
|
|
@ -1939,7 +1939,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen)
|
|||
}
|
||||
|
||||
void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
||||
{
|
||||
{
|
||||
// we'll only be coming in here when the tutorial is loaded now
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
|
|
@ -1947,12 +1947,12 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
|||
// Make our next save default to the name of the level
|
||||
StorageManager.SetSaveTitle(saveFile->getName().c_str());
|
||||
|
||||
__int64 fileSize = saveFile->length();
|
||||
int64_t fileSize = saveFile->length();
|
||||
FileInputStream fis(*saveFile);
|
||||
byteArray ba(fileSize);
|
||||
fis.read(ba);
|
||||
fis.close();
|
||||
|
||||
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
|
|
@ -1962,7 +1962,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile)
|
|||
isClientSide = false;
|
||||
maxPlayers = 4;
|
||||
}
|
||||
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId());
|
||||
|
||||
g_NetworkManager.HostGame(0,isClientSide,isPrivate,maxPlayers,0);
|
||||
|
|
@ -1992,7 +1992,7 @@ int CScene_MultiGameJoinLoad::DeleteSaveDialogReturned(void *pParam,int iPad,C4J
|
|||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
|
||||
{
|
||||
|
|
@ -2017,7 +2017,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C
|
|||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam;
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// upload the save
|
||||
|
||||
|
|
@ -2042,7 +2042,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C
|
|||
int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter )
|
||||
{
|
||||
CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParameter;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
pMinecraft->progressRenderer->progressStart(IDS_SAVE_TRANSFER_TITLE);
|
||||
pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADING );
|
||||
|
|
@ -2092,7 +2092,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter
|
|||
StorageManager.GetSaveCacheFileInfo(iIndex,XContentData);
|
||||
StorageManager.GetSaveCacheFileInfo(iIndex,&pbImageData,&dwImageBytes);
|
||||
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save
|
||||
if(pbImageData==NULL)
|
||||
{
|
||||
|
|
@ -2143,7 +2143,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter
|
|||
|
||||
return 0;
|
||||
}
|
||||
// change text for completion confirmation
|
||||
// change text for completion confirmation
|
||||
pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADCOMPLETE );
|
||||
|
||||
// done
|
||||
|
|
@ -2180,7 +2180,7 @@ void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char
|
|||
C4JStorage::TMS_FILETYPE_BINARY,
|
||||
C4JStorage::TMS_UGCTYPE_NONE,
|
||||
filename,
|
||||
(CHAR *)data,
|
||||
(CHAR *)data,
|
||||
size,
|
||||
&CScene_MultiGameJoinLoad::TransferComplete,pClass, 0,
|
||||
&CScene_MultiGameJoinLoad::Progress,pClass);
|
||||
|
|
@ -2219,7 +2219,7 @@ bool CScene_MultiGameJoinLoad::WaitForTransferComplete( CScene_MultiGameJoinLoad
|
|||
// cancelled
|
||||
return false;
|
||||
}
|
||||
Sleep(50);
|
||||
Sleep(50);
|
||||
// update the progress
|
||||
pMinecraft->progressRenderer->progressStagePercentage((unsigned int)(pClass->m_fProgress*100.0f));
|
||||
}
|
||||
|
|
@ -2235,7 +2235,7 @@ int CScene_MultiGameJoinLoad::SaveOptionsDialogReturned(void *pParam,int iPad,C4
|
|||
|
||||
// results switched for this dialog
|
||||
// EMessage_ResultAccept means cancel
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultDecline) // rename
|
||||
{
|
||||
|
|
@ -2302,9 +2302,9 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue)
|
|||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||
uiIDA[1]=IDS_CONFIRM_OK;
|
||||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2,
|
||||
StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2,
|
||||
pClass->m_iPad,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,pClass, app.GetStringTable());
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -2366,7 +2366,7 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet)
|
|||
|
||||
if(eLoadStatus==C4JStorage::ELoadGame_DeviceRemoved)
|
||||
{
|
||||
// disable saving
|
||||
// disable saving
|
||||
StorageManager.SetSaveDisabled(true);
|
||||
StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false);
|
||||
UINT uiIDA[1];
|
||||
|
|
@ -2375,11 +2375,11 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet)
|
|||
}
|
||||
#else
|
||||
// rename the save
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pClass->m_bIgnoreInput=false;
|
||||
}
|
||||
|
||||
|
|
@ -2400,7 +2400,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataForRenameReturned(void *pParam,bool bC
|
|||
StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,XContentData);
|
||||
StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,&pbImageData,&dwImageBytes);
|
||||
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// if there is no thumbnail, retrieve the default one from the file.
|
||||
// Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save
|
||||
if(pbImageData==NULL)
|
||||
{
|
||||
|
|
@ -2456,7 +2456,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
|||
|
||||
// Exit with or without saving
|
||||
// Decline means install full version of the texture pack in this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
// we need to enable background downloading for the DLC
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
|
|
@ -2480,7 +2480,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
|||
ullIndexA[0]=pDLCInfo->ullOfferID_Trial;
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
|
|
@ -2489,7 +2489,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4
|
|||
HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled()
|
||||
{
|
||||
// mounted DLC may have changed
|
||||
|
||||
|
||||
if(app.StartInstallDLCProcess(m_iPad)==false)
|
||||
{
|
||||
// not doing a mount, so re-enable input
|
||||
|
|
@ -2508,7 +2508,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled()
|
|||
}
|
||||
|
||||
HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete()
|
||||
{
|
||||
{
|
||||
|
||||
VOID *pObj;
|
||||
XuiObjectFromHandle( m_SavesList, &pObj );
|
||||
|
|
@ -2534,7 +2534,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete()
|
|||
|
||||
int iY=-1;
|
||||
if(DoesSavesListHaveFocus())
|
||||
{
|
||||
{
|
||||
if(ProfileManager.IsSignedInLive( m_iPad ))
|
||||
{
|
||||
iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE;
|
||||
|
|
@ -2627,7 +2627,7 @@ void CScene_MultiGameJoinLoad::UpdateTooltips()
|
|||
// 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename)
|
||||
bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame();
|
||||
|
||||
if(bCanRename)
|
||||
if(bCanRename)
|
||||
{
|
||||
iRB=IDS_TOOLTIPS_SAVEOPTIONS;
|
||||
}
|
||||
|
|
@ -2694,11 +2694,11 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave
|
|||
pbCurrentImagePtr=pbImageData+InfoA[i].dwImageOffset;
|
||||
hr=XuiCreateTextureBrushFromMemory(pbCurrentImagePtr,InfoA[i].dwImageBytes,&hXuiBrush);
|
||||
pClass->m_pSavesList->UpdateGraphic(i+pClass->m_iDefaultButtonsC,hXuiBrush );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// we could put in a damaged save icon here
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
||||
|
|
@ -2724,7 +2724,7 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave
|
|||
// It's possible that the games list is updated but we haven't displayed it yet as we were still waiting on saves list to load
|
||||
// This is to fix a bug where joining a game before the saves list has loaded causes a crash when this callback is called
|
||||
// as the scene no longer exists
|
||||
pClass->UpdateGamesList();
|
||||
pClass->UpdateGamesList();
|
||||
|
||||
// Fix for #45154 - Frontend: DLC: Content can only be downloaded from the frontend if you have not joined/exited multiplayer
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
|||
MapChildControls();
|
||||
|
||||
// Display the tooltips
|
||||
HRESULT hr = S_OK;
|
||||
HRESULT hr = S_OK;
|
||||
CXuiElement xuiElement = m_hObj;
|
||||
HXUIOBJ hTemp;
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
|
||||
// make sure there's not a mount going on before using the textures
|
||||
if(bCheckTexturePack && app.DLCInstallProcessCompleted() )
|
||||
{
|
||||
{
|
||||
TexturePack *tPack = pMinecraft->skins->getSelected();
|
||||
|
||||
if(tPack->getId()!=app.GetRequiredTexturePackID())
|
||||
|
|
@ -186,7 +186,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
|
||||
pMinecraft->skins->selectTexturePackById(app.GetRequiredTexturePackID());
|
||||
|
||||
// probably had background downloads enabled, so turn them off
|
||||
// probably had background downloads enabled, so turn them off
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO);
|
||||
}
|
||||
else
|
||||
|
|
@ -223,7 +223,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
{
|
||||
if(pMinecraft->localplayers[i] != NULL && pMinecraft->localplayers[i]->dimension == 1 && !ui.GetMenuDisplayed(i) && app.GetGameSettings(i,eGameSetting_DisplayHUD))
|
||||
{
|
||||
int iGuiScale;
|
||||
int iGuiScale;
|
||||
|
||||
if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
|
||||
{
|
||||
|
|
@ -234,7 +234,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
iGuiScale=app.GetGameSettings(i,eGameSetting_UISizeSplitscreen);
|
||||
}
|
||||
m_BossHealthGroup[i].SetShow(TRUE);
|
||||
m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) );
|
||||
m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) );
|
||||
|
||||
if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
|
||||
{
|
||||
|
|
@ -364,7 +364,7 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pBossHealthProgress[i].SetRange(0, boss->getMaxHealth() );
|
||||
m_pBossHealthProgress[i].SetValue( boss->getSynchedHealth() );
|
||||
|
|
@ -468,15 +468,15 @@ void CXuiSceneBase::_TickAllBaseScenes()
|
|||
XUIMessage xuiMsg;
|
||||
CustomMessage_TickScene( &xuiMsg );
|
||||
XuiSendMessage( app.GetCurrentHUDScene(i), &xuiMsg );
|
||||
|
||||
|
||||
bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(i) && !(app.GetXuiAction(i)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(i,eGameSetting_DisplayHUD)!=0;
|
||||
if(bDisplayGui && pMinecraft->localplayers[i] != NULL)
|
||||
{
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -495,18 +495,18 @@ HRESULT CXuiSceneBase::_SetEnableTooltips( unsigned int iPad, BOOL bVal )
|
|||
HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiTooltip, int iTextID )
|
||||
{
|
||||
ASSERT( uiTooltip < BUTTONS_TOOLTIP_MAX );
|
||||
|
||||
|
||||
XUIRect xuiRect, xuiRectSmall;
|
||||
HRESULT hr=S_OK;
|
||||
LPCWSTR pString=NULL;
|
||||
float fWidth,fHeight;
|
||||
|
||||
|
||||
// Want to be able to show just a button (for RB LB)
|
||||
if(iTextID>=0)
|
||||
{
|
||||
pString=app.GetString(iTextID);
|
||||
}
|
||||
|
||||
|
||||
if(hTooltipText[iPad][uiTooltip]==NULL)
|
||||
{
|
||||
HXUIOBJ hObj=NULL;
|
||||
|
|
@ -514,7 +514,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
|||
hr=XuiElementGetChildById(hObj,L"text_ButtonText",&hTooltipText[iPad][uiTooltip]);
|
||||
hr=XuiElementGetPosition(hTooltipText[iPad][uiTooltip],&m_vPosTextInTooltip[uiTooltip]);
|
||||
}
|
||||
|
||||
|
||||
if(hTooltipTextSmall[iPad][uiTooltip]==NULL)
|
||||
{
|
||||
HXUIOBJ hObj=NULL;
|
||||
|
|
@ -525,8 +525,8 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
|||
|
||||
if(iTextID>=0)
|
||||
{
|
||||
hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect);
|
||||
|
||||
hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect);
|
||||
|
||||
// Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic)
|
||||
XuiElementGetBounds(m_Buttons[iPad][uiTooltip].m_hObj,&fWidth, &fHeight);
|
||||
XuiElementSetBounds(m_Buttons[iPad][uiTooltip].m_hObj,xuiRect.right+1+m_vPosTextInTooltip[uiTooltip].x,fHeight);
|
||||
|
|
@ -537,7 +537,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti
|
|||
|
||||
|
||||
hr=XuiTextPresenterMeasureText(hTooltipTextSmall[iPad][uiTooltip], pString, &xuiRectSmall);
|
||||
|
||||
|
||||
// Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic)
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,&fWidth, &fHeight);
|
||||
XuiElementSetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,xuiRectSmall.right+1+m_vPosTextInTooltipSmall[uiTooltip].x,fHeight);
|
||||
|
|
@ -749,7 +749,7 @@ HRESULT CXuiSceneBase::_SetTooltipsEnabled( unsigned int iPad, bool bA, bool bB,
|
|||
m_Buttons[iPad][BUTTON_TOOLTIP_LB].SetEnable( bLB );
|
||||
m_Buttons[iPad][BUTTON_TOOLTIP_RB].SetEnable( bRB );
|
||||
m_Buttons[iPad][BUTTON_TOOLTIP_LS].SetEnable( bLS );
|
||||
|
||||
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_A].SetEnable( bA );
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_B].SetEnable( bB );
|
||||
m_ButtonsSmall[iPad][BUTTON_TOOLTIP_X].SetEnable( bX );
|
||||
|
|
@ -860,7 +860,7 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow )
|
|||
|
||||
if(bShow && pMinecraft->level!=NULL)
|
||||
{
|
||||
__int64 i64TimeOfDay =0;
|
||||
int64_t i64TimeOfDay =0;
|
||||
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight
|
||||
if(pMinecraft->level->dimension->id==0)
|
||||
{
|
||||
|
|
@ -945,11 +945,11 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad)
|
|||
int nStart, nEnd;
|
||||
// XuiElementFindNamedFrame( m_hObj, L"StartFlash", &nStart );
|
||||
// XuiElementFindNamedFrame( m_hObj, L"EndFlash", &nEnd );
|
||||
// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
XuiElementFindNamedFrame( hObj, L"StartFlash", &nStart );
|
||||
XuiElementFindNamedFrame( hObj, L"EndFlash", &nEnd );
|
||||
XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
|
||||
XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -960,7 +960,7 @@ HRESULT CXuiSceneBase::_HidePressStart()
|
|||
|
||||
HRESULT CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
|
||||
{
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
WCHAR wcAutosaveCountdown[100];
|
||||
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
|
||||
m_TrialTimer.SetText(wcAutosaveCountdown);
|
||||
return S_OK;
|
||||
|
|
@ -974,7 +974,7 @@ HRESULT CXuiSceneBase::_ShowAutosaveCountdownTimer(BOOL bVal)
|
|||
|
||||
HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad)
|
||||
{
|
||||
WCHAR wcTime[20];
|
||||
WCHAR wcTime[20];
|
||||
|
||||
DWORD dwTimeTicks=(DWORD)app.getTrialTimer();
|
||||
|
||||
|
|
@ -982,7 +982,7 @@ HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad)
|
|||
{
|
||||
dwTimeTicks=m_dwTrialTimerLimitSecs;
|
||||
}
|
||||
|
||||
|
||||
dwTimeTicks=m_dwTrialTimerLimitSecs-dwTimeTicks;
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
|
|
@ -1038,7 +1038,7 @@ bool CXuiSceneBase::_PressStartPlaying(unsigned int iPad)
|
|||
HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position )
|
||||
{
|
||||
// turn off the empty quadrant logo
|
||||
if(m_hEmptyQuadrantLogo!=NULL)
|
||||
if(m_hEmptyQuadrantLogo!=NULL)
|
||||
{
|
||||
XuiElementSetShow(m_hEmptyQuadrantLogo,FALSE);
|
||||
}
|
||||
|
|
@ -1086,12 +1086,12 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen
|
|||
XuiElementSetShow( m_TooltipGroupSmall[iPad].m_hObj, TRUE);
|
||||
}
|
||||
|
||||
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
|
||||
{
|
||||
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
|
||||
{
|
||||
//640x480 ->1280x720
|
||||
scale.x = 2.0f; scale.y = 1.5f; scale.z = 1.0f;
|
||||
XuiElementSetScale(m_hObj, &scale);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1127,7 +1127,7 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen
|
|||
// No position adjustment
|
||||
case e_BaseScene_Fullscreen:
|
||||
tooltipsPos.x=SAFEZONE_HALF_WIDTH;
|
||||
tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight;
|
||||
tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight;
|
||||
crouchIconPos.x=SAFEZONE_HALF_WIDTH;
|
||||
crouchIconPos.y=SAFEZONE_HALF_HEIGHT;
|
||||
fBackWidth=XUI_BASE_SCENE_WIDTH;
|
||||
|
|
@ -1303,7 +1303,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
|
||||
|
||||
// Only adjust if fullscreen for now, leaving code to move others if required, but it's too far up the screen when on the bottom quadrants
|
||||
if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) &&
|
||||
if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) &&
|
||||
(RenderManager.IsHiDef() || RenderManager.IsWidescreen()) )
|
||||
{
|
||||
D3DXVECTOR3 selectedItemPos;
|
||||
|
|
@ -1328,17 +1328,17 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
|
||||
// The move applies to the whole scene, so we'll need to move tooltips back in some cases
|
||||
|
||||
selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight;
|
||||
selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight;
|
||||
selectedItemPos.x = XUI_BASE_SCENE_WIDTH_HALF - (fSelectedItemWidth/2.0f);
|
||||
|
||||
// Adjust selectedItemPos based on what gui is displayed
|
||||
|
||||
|
||||
// 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival
|
||||
// 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival
|
||||
float fYOffset=0.0f;
|
||||
|
||||
unsigned char ucGuiScale=app.GetGameSettings(iPad,eGameSetting_UISize) + 2;
|
||||
|
||||
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer())
|
||||
{
|
||||
// SURVIVAL MODE - Move up further because of hearts, shield and xp
|
||||
|
|
@ -1353,7 +1353,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
default: // 2
|
||||
fYOffset = -94.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1368,7 +1368,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
default: // 2
|
||||
fYOffset = -58.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1425,14 +1425,14 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
// 4J-PB - If it's in split screen vertical, adjust the position
|
||||
// Adjust selectedItemPos based on what gui is displayed
|
||||
if((m_playerBaseScenePosition[iPad]==e_BaseScene_Left) || (m_playerBaseScenePosition[iPad]==e_BaseScene_Right))
|
||||
{
|
||||
{
|
||||
float scale=0.5f;
|
||||
selectedItemPos.y -= (scale * 88.0f);
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer())
|
||||
{
|
||||
selectedItemPos.y -= (scale * 80.0f);
|
||||
}
|
||||
|
||||
|
||||
// 4J-PB - selected the gui scale based on the slider settings
|
||||
unsigned char ucGuiScale;
|
||||
float fYOffset=0.0f;
|
||||
|
|
@ -1455,7 +1455,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad)
|
|||
default: // 2
|
||||
fYOffset = 85.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
selectedItemPos.y+=fYOffset;
|
||||
}
|
||||
|
||||
|
|
@ -1606,7 +1606,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay )
|
|||
{
|
||||
// The host decides whether these are on or off
|
||||
if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0)
|
||||
{
|
||||
{
|
||||
if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localplayers[iPad]!=NULL)
|
||||
{
|
||||
wstring wsGamertag = convStringToWstring( ProfileManager.GetGamertag(iPad));
|
||||
|
|
@ -1621,7 +1621,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay )
|
|||
}
|
||||
// The host decides whether these are on or off
|
||||
if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0)
|
||||
{
|
||||
{
|
||||
XuiElementSetShow(m_hGamerTagA[iPad],bDisplay);
|
||||
|
||||
// set the opacity of the gamertag
|
||||
|
|
@ -1712,11 +1712,11 @@ void CXuiSceneBase::_HideAllGameUIElements()
|
|||
m_uiSelectedItemOpacityCountDown[i] = 0;
|
||||
m_selectedItemA[i].SetShow(FALSE);
|
||||
m_selectedItemSmallA[i].SetShow(FALSE);
|
||||
|
||||
|
||||
m_BossHealthGroup[i].SetShow(FALSE);
|
||||
m_bossHealthVisible[i] = FALSE;
|
||||
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE);
|
||||
|
||||
_DisplayGamertag(i,FALSE);
|
||||
}
|
||||
|
|
@ -1845,12 +1845,12 @@ void CXuiSceneBase::ReLayout( unsigned int iPad )
|
|||
if( i>0 && lastVisible!=-1 )
|
||||
{
|
||||
float width, height;
|
||||
XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height);
|
||||
XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height);
|
||||
|
||||
// 4J Stu - This is for horizontal layout, will need changed if we do vertical layout
|
||||
lastPos.x += width + m_iTooltipSpacingGap;
|
||||
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height);
|
||||
XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height);
|
||||
// 4J Stu - This is for horizontal layout, will need changed if we do vertical layout
|
||||
lastPosSmall.x += width + m_iTooltipSpacingGapSmall;
|
||||
}
|
||||
|
|
@ -1948,15 +1948,15 @@ HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, i
|
|||
}
|
||||
else
|
||||
{
|
||||
// does the tooltip need to change?
|
||||
// does the tooltip need to change?
|
||||
if(CXuiSceneBase::Instance->m_iCurrentTooltipTextID[iPad][i]!=iTooptipsA[i] || forceUpdate)
|
||||
{
|
||||
CXuiSceneBase::Instance->SetTooltipText(iPad, i, iTooptipsA[i] );
|
||||
}
|
||||
}
|
||||
CXuiSceneBase::Instance->_ShowTooltip(iPad, i, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
|
@ -2067,14 +2067,14 @@ HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScen
|
|||
}
|
||||
|
||||
HRESULT CXuiSceneBase::UpdatePlayerBasePositions()
|
||||
{
|
||||
{
|
||||
EBaseScenePosition padPositions[XUSER_MAX_COUNT];
|
||||
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
padPositions[idx] = e_BaseScene_NotSet;
|
||||
}
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
// If the game is not started (or is being held paused for a bit) then display all scenes fullscreen
|
||||
|
|
@ -2134,7 +2134,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions()
|
|||
padPositions[idx] = e_BaseScene_Right;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
padPositions[idx] = e_BaseScene_Top_Left;
|
||||
padPositions[idx] = e_BaseScene_Top_Left;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
padPositions[idx] = e_BaseScene_Top_Right;
|
||||
|
|
@ -2168,7 +2168,7 @@ void CXuiSceneBase::UpdateSelectedItemPos(int iPad)
|
|||
CXuiSceneBase::Instance->_UpdateSelectedItemPos(iPad);
|
||||
}
|
||||
|
||||
HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad)
|
||||
HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad)
|
||||
{
|
||||
return CXuiSceneBase::Instance->_GetPlayerBaseScene(iPad);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ typedef uLong FAR uLongf;
|
|||
# define z_off64_t off64_t
|
||||
#else
|
||||
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
|
||||
# define z_off64_t __int64
|
||||
# define z_off64_t long long
|
||||
# else
|
||||
# define z_off64_t z_off_t
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ void CreateWorldScreen::buttonClicked(Button *button)
|
|||
if (done) return;
|
||||
done = true;
|
||||
|
||||
__int64 seedValue = (new Random())->nextLong();
|
||||
int64_t seedValue = (new Random())->nextLong();
|
||||
wstring seedString = seedEdit->getValue();
|
||||
|
||||
if (seedString.length() != 0)
|
||||
{
|
||||
// try to convert it to a long first
|
||||
// try { // 4J - removed try/catch
|
||||
__int64 value = _fromString<__int64>(seedString);
|
||||
int64_t value = _fromString<int64_t>(seedString);
|
||||
if (value != 0)
|
||||
{
|
||||
seedValue = value;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
class DemoLevel : public Level
|
||||
{
|
||||
private:
|
||||
static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode();
|
||||
static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode();
|
||||
static const int DEMO_SPAWN_X = 796;
|
||||
static const int DEMO_SPAWN_Y = 72;
|
||||
static const int DEMO_SPAWN_Z = -731;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ void DemoMode::tick()
|
|||
SurvivalMode::tick();
|
||||
|
||||
/* 4J - TODO - seems unlikely we need this demo mode anyway
|
||||
__int64 time = minecraft->level->getTime();
|
||||
__int64 day = (time / Level::TICKS_PER_DAY) + 1;
|
||||
int64_t time = minecraft->level->getTime();
|
||||
int64_t day = (time / Level::TICKS_PER_DAY) + 1;
|
||||
|
||||
demoHasEnded = (time > (500 + Level::TICKS_PER_DAY * DEMO_DAYS));
|
||||
if (demoHasEnded)
|
||||
|
|
@ -26,7 +26,7 @@ void DemoMode::tick()
|
|||
{
|
||||
if (day <= (DEMO_DAYS + 1))
|
||||
{
|
||||
minecraft->gui->displayClientMessage(L"demo.day." + _toString<__int64>(day));
|
||||
minecraft->gui->displayClientMessage(L"demo.day." + _toString<int64_t>(day));
|
||||
}
|
||||
}
|
||||
else if (day == 1)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void CConsoleMinecraftApp::HandleDLCLicenseChange()
|
|||
// Clear the DLC installed flag so the scenes will pick up the new dlc (could be a full pack install)
|
||||
app.ClearDLCInstalled();
|
||||
app.DebugPrintf(">>> HandleDLCLicenseChange - Updating license for DLC [%ls]\n",xOffer.wszOfferName);
|
||||
pack->updateLicenseMask(1);
|
||||
pack->updateLicenseMask(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -100,7 +100,7 @@ void CConsoleMinecraftApp::ExitGame()
|
|||
}
|
||||
void CConsoleMinecraftApp::FatalLoadError()
|
||||
{
|
||||
// 4J-PB -
|
||||
// 4J-PB -
|
||||
//for(int i=0;i<10;i++)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
|
|
@ -204,7 +204,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,D
|
|||
// load the local file
|
||||
WCHAR wchFilename[64];
|
||||
|
||||
|
||||
|
||||
// 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds
|
||||
swprintf(wchFilename,L"DLCImages/%s",wchName);
|
||||
HANDLE hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
|
@ -269,7 +269,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
||||
bool isFlat = false;
|
||||
__int64 seedValue = 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
|
||||
int64_t seedValue = 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;
|
||||
|
|
@ -308,7 +308,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
thread->Run();
|
||||
}
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
eDLCContentType e_DLC_Type;
|
||||
//WCHAR *wchDisplayName;
|
||||
|
|
@ -397,7 +397,7 @@ bool CConsoleMinecraftApp::UpdateProductId(XCONTENT_DATA &Data)
|
|||
app.DebugPrintf("Couldn't find %ls\n",Data.wszDisplayName);
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void CConsoleMinecraftApp::Shutdown()
|
||||
|
|
@ -455,7 +455,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in
|
|||
{
|
||||
app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n");
|
||||
C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData;
|
||||
|
||||
|
||||
CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam;
|
||||
|
||||
if(pFileData)
|
||||
|
|
@ -471,7 +471,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in
|
|||
// mark the level as not checked against banned levels - it'll be checked once the level starts
|
||||
app.SetBanListCheck(iPad,false);
|
||||
|
||||
// Xbox One will clear things within the DownloadBlob
|
||||
// Xbox One will clear things within the DownloadBlob
|
||||
#ifndef _XBOX_ONE
|
||||
delete [] pFileData->pbData;
|
||||
delete [] pFileData;
|
||||
|
|
@ -558,11 +558,11 @@ int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad,
|
|||
CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam;
|
||||
app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList\n");
|
||||
if(lpvData!=NULL)
|
||||
{
|
||||
{
|
||||
vector<C4JStorage::PTMSPP_FILE_DETAILS> *pvTmsFileDetails=(vector<C4JStorage::PTMSPP_FILE_DETAILS> *)lpvData;
|
||||
|
||||
if(pvTmsFileDetails->size()>0)
|
||||
{
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
// dump out the file list
|
||||
app.DebugPrintf("TMSPP filecount - %d\nFiles - \n",pvTmsFileDetails->size());
|
||||
|
|
@ -707,7 +707,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage:
|
|||
{
|
||||
CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam;
|
||||
|
||||
if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota
|
||||
if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota
|
||||
|| saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfLocalStorage )
|
||||
{
|
||||
StorageManager.SetSaveDisabled(true);
|
||||
|
|
@ -718,10 +718,10 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage:
|
|||
else message = IDS_SAVE_INCOMPLETE_EXPLANATION_LOCAL_STORAGE;
|
||||
|
||||
UINT uiIDA[3] =
|
||||
{
|
||||
IDS_SAVE_INCOMPLETE_RETRY_SAVING,
|
||||
IDS_SAVE_INCOMPLETE_DISABLE_SAVING,
|
||||
IDS_SAVE_INCOMPLETE_DELETE_SAVES
|
||||
{
|
||||
IDS_SAVE_INCOMPLETE_RETRY_SAVING,
|
||||
IDS_SAVE_INCOMPLETE_DISABLE_SAVING,
|
||||
IDS_SAVE_INCOMPLETE_DELETE_SAVES
|
||||
};
|
||||
|
||||
if ( ui.RequestMessageBox( IDS_SAVE_INCOMPLETE_TITLE, message, uiIDA,3,0,Callback_SaveGameIncompleteMessageBoxReturned,pClass, app.GetStringTable()) == C4JStorage::EMessage_Busy)
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed long long
|
||||
#define RAD_UINTa __w64 unsigned long long
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed long long
|
||||
#define RAD_UINTa __w64 unsigned long long
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ DQRNetworkManager::SessionInfo::SessionInfo()
|
|||
}
|
||||
|
||||
// This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type
|
||||
const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] =
|
||||
const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] =
|
||||
{
|
||||
DNM_STATE_INITIALISING, // DNM_INT_STATE_INITIALISING
|
||||
DNM_STATE_INITIALISE_FAILED, // DNM_INT_STATE_INITIALISE_FAILED
|
||||
|
|
@ -64,7 +64,7 @@ const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTSt
|
|||
DNM_STATE_PLAYING, // DNM_INT_STATE_PLAYING
|
||||
DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING
|
||||
DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING_FAILED
|
||||
DNM_STATE_ENDING, // DNM_INT_STATE_ENDING
|
||||
DNM_STATE_ENDING, // DNM_INT_STATE_ENDING
|
||||
};
|
||||
|
||||
DQRNetworkManager::DQRNetworkManager(IDQRNetworkManagerListener *listener)
|
||||
|
|
@ -146,7 +146,7 @@ void DQRNetworkManager::EnableDebugXBLContext(MXS::XboxLiveContext^ XBLContext)
|
|||
|
||||
// Show service calls from Xbox Services on the UI for easy debugging
|
||||
XBLContext->Settings->EnableServiceCallRoutedEvents = true;
|
||||
XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler<Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^>(
|
||||
XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler<Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^>(
|
||||
[=]( Platform::Object^, Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^ args )
|
||||
{
|
||||
//if( args->HttpStatus != 200 )
|
||||
|
|
@ -308,14 +308,14 @@ void DQRNetworkManager::JoinSession(int playerMask)
|
|||
m_isHosting = false;
|
||||
|
||||
sockaddr_in6 localSocketAddressStorage;
|
||||
|
||||
|
||||
ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage));
|
||||
|
||||
|
||||
localSocketAddressStorage.sin6_family = AF_INET6;
|
||||
localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower);
|
||||
|
||||
|
||||
memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any));
|
||||
|
||||
|
||||
m_localSocketAddress = Platform::ArrayReference<BYTE>(reinterpret_cast<BYTE*>(&localSocketAddressStorage), sizeof(localSocketAddressStorage));
|
||||
|
||||
m_joinCreateSessionAttempts = 0;
|
||||
|
|
@ -402,7 +402,7 @@ bool DQRNetworkManager::AddUsersToSession(int playerMask, MXSM::MultiplayerSessi
|
|||
// We need to get a MultiplayerSession for each player that is joining
|
||||
|
||||
MXSM::MultiplayerSession^ session = nullptr;
|
||||
|
||||
|
||||
WXS::User^ newUser = ProfileManager.GetUser(i);
|
||||
if( newUser == nullptr )
|
||||
{
|
||||
|
|
@ -451,12 +451,12 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex)
|
|||
// We need to handle this differently for the host and other machines. As the procedure for adding a reserved slot for a local player whilst on the host doesn't seem to work
|
||||
//
|
||||
// On the host machine, we:
|
||||
//
|
||||
//
|
||||
// (1) Get a MPSD for the player that is being added
|
||||
// (2) Call the join method
|
||||
// (3) Write the MPSD
|
||||
// (4) Update the player sync data, and broadcast out to all clients
|
||||
|
||||
|
||||
// On remote machines, we:
|
||||
//
|
||||
// (1) join the party
|
||||
|
|
@ -473,10 +473,10 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if( !m_isOfflineGame )
|
||||
{
|
||||
// This is going to involve some async processing
|
||||
// This is going to involve some async processing
|
||||
|
||||
MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser);
|
||||
if( newUserXBLContext == nullptr )
|
||||
|
|
@ -558,7 +558,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex)
|
|||
SendRoomSyncInfo();
|
||||
m_listener->HandlePlayerJoined(pPlayer); // This is for notifying of local players joining in an offline game
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// Can fail (notably if m_roomSyncData contains players who've left)
|
||||
assert(0);
|
||||
|
|
@ -571,7 +571,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex)
|
|||
{
|
||||
// Check if there's any available slots before attempting to add the player to the party. We can still fail joining later if
|
||||
// the host can't add a reserved slot for us for some reason but better checking on the client side before even attempting.
|
||||
|
||||
|
||||
WXS::User^ newUser = ProfileManager.GetUser(userIndex);
|
||||
|
||||
MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser);
|
||||
|
|
@ -622,16 +622,16 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex)
|
|||
|
||||
bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex)
|
||||
{
|
||||
// We need to handle this differently for the host and other machines.
|
||||
// We need to handle this differently for the host and other machines.
|
||||
//
|
||||
// On the host machine, we:
|
||||
//
|
||||
//
|
||||
// (1) Get a MPSD for the player that is being removed
|
||||
// (2) Call the leave method
|
||||
// (3) Write the MPSD
|
||||
// (4) Leave the party
|
||||
// (5) Update the player sync data, and broadcast out to all clients
|
||||
|
||||
|
||||
// On remote machines, we:
|
||||
//
|
||||
// (1) Get a MPSD for the player that is being removed
|
||||
|
|
@ -651,7 +651,7 @@ bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if( !m_isOfflineGame )
|
||||
{
|
||||
if( m_chat )
|
||||
|
|
@ -714,7 +714,7 @@ bool DQRNetworkManager::IsHost()
|
|||
}
|
||||
|
||||
// Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The
|
||||
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
|
||||
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
|
||||
// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false.
|
||||
bool DQRNetworkManager::IsInSession()
|
||||
{
|
||||
|
|
@ -788,7 +788,7 @@ wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag)
|
|||
{
|
||||
return m_displayNames[gamertag];
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
return gamertag;
|
||||
}
|
||||
|
|
@ -902,14 +902,14 @@ void DQRNetworkManager::Tick_VoiceChat()
|
|||
{
|
||||
m_chat->AddLocalUser(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_vecChatPlayersJoined.clear();
|
||||
LeaveCriticalSection(&m_csVecChatPlayers);
|
||||
}
|
||||
|
||||
void DQRNetworkManager::Tick_Party()
|
||||
{
|
||||
{
|
||||
// If the primary player has been flagged as having left the party, then we don't respond immediately as it is possible we are just transitioning from one party to another, and it would be much
|
||||
// nicer to handle this kind of transition directly. If we do get a new party within this time period, then we'll handle by asking the user if they want to leave the game they are currently in etc.
|
||||
if( m_playersLeftParty )
|
||||
|
|
@ -919,7 +919,7 @@ void DQRNetworkManager::Tick_Party()
|
|||
// We've waited long enough. User must (hopefully) have just left the party
|
||||
// Previously we'd switch to offline but that causes a world of pain with forced sign-outs
|
||||
if( m_playersLeftParty & 1 )
|
||||
{
|
||||
{
|
||||
// Before we switch to an offline game, check to see if there is currently a new party. If this is the case and
|
||||
// we're here, then its because we were added to a party, but didn't receive a gamesessionready event. So if we have
|
||||
// a party here that we've joined, and the number of players in the party (including us) is more than MAX_PLAYERS_IN_TEMPLATE,
|
||||
|
|
@ -955,7 +955,7 @@ void DQRNetworkManager::Tick_Party()
|
|||
m_playersLeftParty = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Forced sign out
|
||||
if (m_handleForcedSignOut)
|
||||
{
|
||||
|
|
@ -1064,7 +1064,7 @@ void DQRNetworkManager::Tick_ResolveGamertags()
|
|||
HostGamertagResolveDetails *details = m_hostGamertagResolveResults.front();
|
||||
|
||||
details->m_pPlayer->SetName(details->m_name.c_str());
|
||||
|
||||
|
||||
LogComment("Adding a player");
|
||||
if( AddRoomSyncPlayer(details->m_pPlayer, details->m_sessionAddress, details->m_channel ) )
|
||||
{
|
||||
|
|
@ -1154,7 +1154,7 @@ void DQRNetworkManager::Tick_StateMachine()
|
|||
break;
|
||||
case DNM_INT_STATE_JOINING_SENDING_UNRELIABLE:
|
||||
{
|
||||
__int64 timeNow = System::currentTimeMillis();
|
||||
int64_t timeNow = System::currentTimeMillis();
|
||||
// m_firstUnreliableSendTime of 0 indicates that we haven't tried sending an unreliable packet yet so need to send one and initialise things
|
||||
if( m_firstUnreliableSendTime == 0 )
|
||||
{
|
||||
|
|
@ -1188,7 +1188,7 @@ void DQRNetworkManager::Tick_StateMachine()
|
|||
{
|
||||
// Timeout if we've been waiting for reserved slots for our joining players for too long. This is most likely because the host doesn't have room for all the slots we wanted, and we weren't able to determine this
|
||||
// when we went to join the game (ie someone else was joining at the same time). At this point we need to remove any local players that did already join, from both the session and the party.
|
||||
__int64 timeNow = System::currentTimeMillis();
|
||||
int64_t timeNow = System::currentTimeMillis();
|
||||
if( ( timeNow - m_startedWaitingForReservationsTime ) > JOIN_RESERVATION_WAIT_TIME )
|
||||
{
|
||||
SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP);
|
||||
|
|
@ -1332,7 +1332,7 @@ void DQRNetworkManager::HandleSessionChange(MXSM::MultiplayerSession^ multiplaye
|
|||
{
|
||||
((DurangoStats*)GenericStats::getInstance())->setMultiplayerCorrelationId( nullptr );
|
||||
}
|
||||
|
||||
|
||||
m_multiplayerSession = multiplayerSession;
|
||||
}
|
||||
|
||||
|
|
@ -1362,7 +1362,7 @@ MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveCo
|
|||
})
|
||||
.wait();
|
||||
|
||||
if( outputMultiplayerSession != nullptr &&
|
||||
if( outputMultiplayerSession != nullptr &&
|
||||
outputMultiplayerSession->SessionReference != nullptr )
|
||||
{
|
||||
app.DebugPrintf( "Session written OK\n" );
|
||||
|
|
@ -1422,7 +1422,7 @@ WXM::MultiplayerSessionReference^ DQRNetworkManager::ConvertToWindowsXboxMultipl
|
|||
{
|
||||
return ref new WXM::MultiplayerSessionReference(
|
||||
sessionRef->SessionName,
|
||||
sessionRef->ServiceConfigurationId,
|
||||
sessionRef->ServiceConfigurationId,
|
||||
sessionRef->SessionTemplateName
|
||||
);
|
||||
}
|
||||
|
|
@ -1458,7 +1458,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData)
|
|||
// And when we are done, anything left in the temporary vector must be a player that left
|
||||
for( int i = 0; i < pNewSyncData->playerCount; i++ )
|
||||
{
|
||||
PlayerSyncData *pNewPlayer = &pNewSyncData->players[i];
|
||||
PlayerSyncData *pNewPlayer = &pNewSyncData->players[i];
|
||||
bool bAlreadyExisted = false;
|
||||
for( AUTO_VAR(it, tempPlayers.begin()); it != tempPlayers.end(); it++ )
|
||||
{
|
||||
|
|
@ -1491,7 +1491,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData)
|
|||
}
|
||||
|
||||
LogCommentFormat(L"Adding new player, index %d - type %d, small Id %d, name %s, xuid %s\n",i,m_players[i]->m_type,pNewPlayer->m_smallId,pNewPlayer->m_name,pNewPlayer->m_XUID);
|
||||
|
||||
|
||||
m_players[i]->SetSmallId(pNewPlayer->m_smallId);
|
||||
m_players[i]->SetName(pNewPlayer->m_name);
|
||||
m_players[i]->SetUID(PlayerUID(pNewPlayer->m_XUID));
|
||||
|
|
@ -1525,7 +1525,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData)
|
|||
bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel)
|
||||
{
|
||||
if( m_roomSyncData.playerCount == MAX_ONLINE_PLAYER_COUNT ) return false;
|
||||
|
||||
|
||||
EnterCriticalSection(&m_csRoomSyncData);
|
||||
// Find the first entry that isn't us, to decide what to sync before. Don't consider entry #0 as this is reserved to indicate the host.
|
||||
int insertAtIdx = m_roomSyncData.playerCount;
|
||||
|
|
@ -1552,11 +1552,11 @@ bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned in
|
|||
{
|
||||
m_roomSyncData.players[i] = m_roomSyncData.players[i-1];
|
||||
m_players[i] = m_players[i - 1];
|
||||
}
|
||||
}
|
||||
m_roomSyncData.players[insertAtIdx].m_channel = channel;
|
||||
m_roomSyncData.players[insertAtIdx].m_sessionAddress = sessionAddress;
|
||||
int xuidLength = pPlayer->GetUID().toString().length() + 1; // +1 for terminator
|
||||
m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength];
|
||||
m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength];
|
||||
wcsncpy(m_roomSyncData.players[insertAtIdx].m_XUID, pPlayer->GetUID().toString().c_str(), xuidLength);
|
||||
m_roomSyncData.players[insertAtIdx].m_smallId = pPlayer->GetSmallId();
|
||||
wcscpy_s(m_roomSyncData.players[insertAtIdx].m_name, pPlayer->GetName());
|
||||
|
|
@ -1587,7 +1587,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayersWithSessionAddress(unsigned int ses
|
|||
{
|
||||
m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i];
|
||||
m_players[iWriteIdx] = m_players[i];
|
||||
iWriteIdx++;
|
||||
iWriteIdx++;
|
||||
}
|
||||
}
|
||||
m_roomSyncData.playerCount = iWriteIdx;
|
||||
|
|
@ -1618,7 +1618,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer)
|
|||
{
|
||||
m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i];
|
||||
m_players[iWriteIdx] = m_players[i];
|
||||
iWriteIdx++;
|
||||
iWriteIdx++;
|
||||
}
|
||||
}
|
||||
m_roomSyncData.playerCount = iWriteIdx;
|
||||
|
|
@ -1659,13 +1659,13 @@ void DQRNetworkManager::SendRoomSyncInfo()
|
|||
uint32_t sizeHigh = internalBytes >> 8;
|
||||
uint32_t sizeLow = internalBytes & 0xff;
|
||||
|
||||
data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending
|
||||
data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending
|
||||
data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself
|
||||
data[2] = DQR_INTERNAL_PLAYER_TABLE;
|
||||
|
||||
memcpy(data + 3, &xuidBytes, 4);
|
||||
memcpy(data + 7, &m_roomSyncData, sizeof(RoomSyncData));
|
||||
unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData);
|
||||
unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData);
|
||||
|
||||
for( int i = 0 ; i < m_roomSyncData.playerCount; i++ )
|
||||
{
|
||||
|
|
@ -1701,12 +1701,12 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid)
|
|||
uint32_t sizeHigh = internalBytes >> 8;
|
||||
uint32_t sizeLow = internalBytes & 0xff;
|
||||
|
||||
data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending
|
||||
data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending
|
||||
data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself
|
||||
data[2] = DQR_INTERNAL_ADD_PLAYER_FAILED;
|
||||
|
||||
memcpy(data + 3, &xuidBytes, 4);
|
||||
memcpy(data + 7, xuid->Data(), xuidBytes);
|
||||
memcpy(data + 7, xuid->Data(), xuidBytes);
|
||||
|
||||
SendBytesRaw(-1, data, totalBytes, true);
|
||||
|
||||
|
|
@ -1927,7 +1927,7 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
// Actually create the session (locally), using the primary player's context
|
||||
try
|
||||
{
|
||||
session = ref new MXSM::MultiplayerSession( primaryUserXBLContext,
|
||||
session = ref new MXSM::MultiplayerSession( primaryUserXBLContext,
|
||||
ref new MXSM::MultiplayerSessionReference( SERVICE_CONFIG_ID, MATCH_SESSION_TEMPLATE_NAME, sessionName ),
|
||||
0, // this means that it will use the maxMembers specified in the session template.
|
||||
false,
|
||||
|
|
@ -1972,7 +1972,7 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
|
||||
session->Join( GetNextSmallIdAsJsonString(), true );
|
||||
session->SetCurrentUserStatus( MXSM::MultiplayerSessionMemberStatus::Active );
|
||||
|
||||
|
||||
// Get device ID for current user & set in the session
|
||||
Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String();
|
||||
session->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress );
|
||||
|
|
@ -1997,7 +1997,7 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
return 0;
|
||||
}
|
||||
m_partyController->SetJoinability(m_listener->IsSessionJoinable());
|
||||
|
||||
|
||||
// Add reservations for anyone in the party, who isn't the primary player. Just adding local players for now, but perhaps this should add
|
||||
// other party members at this stage?
|
||||
for ( WXM::PartyMember^ member : partyView->Members )
|
||||
|
|
@ -2029,8 +2029,8 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
session->SetHostDeviceToken( hostMember->DeviceToken );
|
||||
|
||||
m_partyController->RegisterGamePlayersChangedEventHandler();
|
||||
|
||||
// Update session on the server
|
||||
|
||||
// Update session on the server
|
||||
HRESULT hr = S_OK;
|
||||
session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr );
|
||||
|
||||
|
|
@ -2086,14 +2086,14 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
if( m_state == DNM_INT_STATE_HOSTING_FAILED) return 0;
|
||||
|
||||
sockaddr_in6 localSocketAddressStorage;
|
||||
|
||||
|
||||
ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage));
|
||||
|
||||
|
||||
localSocketAddressStorage.sin6_family = AF_INET6;
|
||||
localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower);
|
||||
|
||||
|
||||
memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any));
|
||||
|
||||
|
||||
m_localSocketAddress = Platform::ArrayReference<BYTE>(reinterpret_cast<BYTE*>(&localSocketAddressStorage), sizeof(localSocketAddressStorage));
|
||||
|
||||
// This shouldn't ever happen, but seems worth checking that we don't have a pre-existing session in case there's any way to get here with one already running
|
||||
|
|
@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i))
|
||||
{
|
||||
auto user = ProfileManager.GetUser(i);
|
||||
wstring displayName = ProfileManager.GetDisplayName(i);
|
||||
wstring displayName = ProfileManager.GetDisplayName(i);
|
||||
|
||||
DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress);
|
||||
pPlayer->SetSmallId(smallId);
|
||||
|
|
@ -2234,7 +2234,7 @@ int DQRNetworkManager::LeaveRoomThreadProc()
|
|||
|
||||
// Request RTS to be terminated
|
||||
RTS_Terminate();
|
||||
|
||||
|
||||
// Now leave the game session. We need to do this for each player in turn, writing each time
|
||||
bool bError = false;
|
||||
for( int i = 0; i < 4; i++ )
|
||||
|
|
@ -2339,7 +2339,7 @@ int DQRNetworkManager::TidyUpJoinThreadProc()
|
|||
|
||||
// We can fail to join at various points, and in at least one case (if it is down to RUDP unreliable packets timing out) then we don't have m_joinSessionUserMask bits set any more,
|
||||
// but we Do have m_currentUserMask set. Any of these should be considered users we should be attempting to remove from the session.
|
||||
int removeSessionMask = m_joinSessionUserMask | m_currentUserMask;
|
||||
int removeSessionMask = m_joinSessionUserMask | m_currentUserMask;
|
||||
for( int i = 0; i < 4; i++ )
|
||||
{
|
||||
if( removeSessionMask & ( 1 << i ) )
|
||||
|
|
@ -2428,7 +2428,7 @@ int DQRNetworkManager::UpdateCustomSessionDataThreadProc()
|
|||
{
|
||||
LogComment(L"Starting thread to update custom data");
|
||||
WXS::User^ primaryUser = ProfileManager.GetUser(0);
|
||||
|
||||
|
||||
if( primaryUser == nullptr )
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -2550,7 +2550,7 @@ void DQRNetworkManager::HandlePlayerRemovedFromParty(int playerMask)
|
|||
{
|
||||
// As a client, we don't have any messy changing to offline game or saving etc. to do, so we can respond immediately to leaving the party
|
||||
if( playerMask & 1 )
|
||||
{
|
||||
{
|
||||
DQRNetworkManager::LogComment(L"Primary player on this system has left the party - leaving game\n");
|
||||
app.SetDisconnectReason(DisconnectPacket::eDisconnect_ExitedGame);
|
||||
LeaveRoom();
|
||||
|
|
@ -2725,7 +2725,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes
|
|||
m_joinSessionUserMask = playerMask;
|
||||
m_isInSession = true;
|
||||
m_isOfflineGame = false;
|
||||
|
||||
|
||||
m_startedWaitingForReservationsTime = System::currentTimeMillis();
|
||||
SetState(DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS);
|
||||
|
||||
|
|
@ -2742,7 +2742,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes
|
|||
if( sessionRef != nullptr )
|
||||
{
|
||||
// Allow 2 seconds before we let the player cancel
|
||||
__int64 allowCancelTime = System::currentTimeMillis() + (1000 * 2);
|
||||
int64_t allowCancelTime = System::currentTimeMillis() + (1000 * 2);
|
||||
|
||||
// Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining
|
||||
// members *may* have a slot (reserved or active) depending on how far progressed the joining got.
|
||||
|
|
@ -2814,7 +2814,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes
|
|||
break;
|
||||
}
|
||||
|
||||
__int64 currentTime = System::currentTimeMillis();
|
||||
int64_t currentTime = System::currentTimeMillis();
|
||||
if( currentTime > allowCancelTime)
|
||||
{
|
||||
shownCancelScreen = true;
|
||||
|
|
@ -2893,7 +2893,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes
|
|||
SetState(DNM_INT_STATE_JOINING_FAILED);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
while(!ccTask.is_done())
|
||||
{
|
||||
|
|
@ -3013,7 +3013,7 @@ void DQRNetworkManager::RequestDisplayName(DQRNetworkPlayer *player)
|
|||
{
|
||||
if (player->IsLocal())
|
||||
{
|
||||
// Player is local so we can just ask profile manager
|
||||
// Player is local so we can just ask profile manager
|
||||
SetDisplayName(player->GetUID(), ProfileManager.GetDisplayName(player->GetLocalPlayerIndex()));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public:
|
|||
static const int MAX_ONLINE_PLAYER_COUNT = 8;
|
||||
static const int MAX_ONLINE_PLAYER_NAME_LENGTH = 21;
|
||||
|
||||
// This class stores everything about a player that must be synchronised between machines.
|
||||
// This class stores everything about a player that must be synchronised between machines.
|
||||
class PlayerSyncData
|
||||
{
|
||||
public:
|
||||
|
|
@ -210,7 +210,7 @@ public:
|
|||
DNM_STATE_JOINING,
|
||||
|
||||
DNM_STATE_STARTING,
|
||||
DNM_STATE_PLAYING,
|
||||
DNM_STATE_PLAYING,
|
||||
|
||||
DNM_STATE_LEAVING,
|
||||
DNM_STATE_ENDING,
|
||||
|
|
@ -339,9 +339,9 @@ private:
|
|||
static const eDQRNetworkManagerState m_INTtoEXTStateMappings[DNM_INT_STATE_COUNT];
|
||||
eDQRNetworkManagerInternalState m_state;
|
||||
eDQRNetworkManagerState m_stateExternal;
|
||||
__int64 m_lastUnreliableSendTime;
|
||||
__int64 m_firstUnreliableSendTime;
|
||||
__int64 m_startedWaitingForReservationsTime;
|
||||
int64_t m_lastUnreliableSendTime;
|
||||
int64_t m_firstUnreliableSendTime;
|
||||
int64_t m_startedWaitingForReservationsTime;
|
||||
unsigned char *m_customSessionData;
|
||||
unsigned int m_customSessionDataSize;
|
||||
int m_customDataDirtyUpdateTicks;
|
||||
|
|
@ -361,7 +361,7 @@ private:
|
|||
|
||||
CRITICAL_SECTION m_csRoomSyncData;
|
||||
RoomSyncData m_roomSyncData;
|
||||
DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT];
|
||||
DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT];
|
||||
|
||||
IDQRNetworkManagerListener *m_listener;
|
||||
PartyController *m_partyController;
|
||||
|
|
@ -389,7 +389,7 @@ private:
|
|||
int m_joinCreateSessionAttempts;
|
||||
|
||||
C4JThread *m_CreateSessionThread;
|
||||
C4JThread *m_LeaveRoomThread;
|
||||
C4JThread *m_LeaveRoomThread;
|
||||
C4JThread *m_TidyUpJoinThread;
|
||||
C4JThread *m_UpdateCustomSessionDataThread;
|
||||
C4JThread *m_RTS_DoWorkThread;
|
||||
|
|
@ -426,7 +426,7 @@ private:
|
|||
int GetQueueSizeMessages();
|
||||
void SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential);
|
||||
void SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast);
|
||||
|
||||
|
||||
bool AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel);
|
||||
void RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress);
|
||||
void RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer);
|
||||
|
|
@ -438,7 +438,7 @@ private:
|
|||
int GetSessionIndexForSmallId(unsigned char smallId);
|
||||
int GetSessionIndexAndSmallIdForHost(unsigned char *smallId);
|
||||
|
||||
static void LogComment( Platform::String^ strText );
|
||||
static void LogComment( Platform::String^ strText );
|
||||
static void LogCommentFormat( LPCWSTR strMsg, ... );
|
||||
static void LogCommentWithError( Platform::String^ strTest, HRESULT hr );
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ public:
|
|||
void SetDisplayName(PlayerUID xuid, wstring displayName);
|
||||
|
||||
private:
|
||||
__int64 m_playersLeftPartyTime;
|
||||
int64_t m_playersLeftPartyTime;
|
||||
int m_playersLeftParty;
|
||||
|
||||
bool GetBestPartyUserIndex();
|
||||
|
|
@ -502,7 +502,7 @@ private:
|
|||
bool GetGameSessionData(MXSM::MultiplayerSession^ session, void *gameSessionData);
|
||||
|
||||
public:
|
||||
static Platform::Collections::Vector<Platform::String^>^ GetFriends();
|
||||
static Platform::Collections::Vector<Platform::String^>^ GetFriends();
|
||||
|
||||
private:
|
||||
SessionSearchResult *m_sessionSearchResults;
|
||||
|
|
@ -551,7 +551,7 @@ private:
|
|||
void Process_RTS_MESSAGE_STATUS_TERMINATED(RTS_Message &message);
|
||||
|
||||
// Outgoing messages - to be called from the RTS work thread, to process requests from the main thread
|
||||
|
||||
|
||||
void ProcessRTSMessagesOutgoing();
|
||||
void Process_RTS_MESSAGE_START_CLIENT(RTS_Message &message);
|
||||
void Process_RTS_MESSAGE_START_HOST(RTS_Message &message);
|
||||
|
|
|
|||
|
|
@ -155,12 +155,12 @@ Routine Description:
|
|||
Register the provider with ETW+.
|
||||
|
||||
Arguments:
|
||||
|
||||
|
||||
None
|
||||
|
||||
Remarks:
|
||||
|
||||
ERROR_SUCCESS if success or if the provider was already registered.
|
||||
ERROR_SUCCESS if success or if the provider was already registered.
|
||||
Otherwise, an error code.
|
||||
|
||||
--*/
|
||||
|
|
@ -175,7 +175,7 @@ Routine Description:
|
|||
Arguments:
|
||||
None
|
||||
Remarks:
|
||||
ERROR_SUCCESS if success or if the provider was not registered.
|
||||
ERROR_SUCCESS if success or if the provider was not registered.
|
||||
Otherwise, an error code.
|
||||
--*/
|
||||
#define EventUnregisterXBLA_149E11AE() EtxUnregister(&XBLA_149E11AEProvider, &XBLA_149E11AEHandle)
|
||||
|
|
@ -265,7 +265,7 @@ EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount)
|
||||
EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const uint64_t BlockCount)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken 7
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount)
|
||||
EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const uint64_t BlockCount)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced 7
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __i
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 Distance, __in const signed int TravelMethodId)
|
||||
EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const uint64_t Distance, __in const signed int TravelMethodId)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled 6
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessio
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 TimePlayed)
|
||||
EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const uint64_t TimePlayed)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed 5
|
||||
|
||||
|
|
@ -570,7 +570,7 @@ EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount)
|
||||
EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const uint64_t ItemCount)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired 14
|
||||
|
||||
|
|
@ -601,7 +601,7 @@ EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId
|
|||
//
|
||||
__inline
|
||||
ULONG
|
||||
EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount, __in const signed int Hunger)
|
||||
EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const uint64_t ItemCount, __in const signed int Hunger)
|
||||
{
|
||||
#define ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed 14
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
// 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.
|
||||
// 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.cpp
|
||||
//
|
||||
//
|
||||
// Simple callback non-validating XML parser implementation.
|
||||
//
|
||||
// Xbox Advanced Technology Group.
|
||||
|
|
@ -35,7 +35,7 @@ XMLParser::XMLParser()
|
|||
// Name: XMLParser::~XMLParser
|
||||
//-------------------------------------------------------------------------------------
|
||||
XMLParser::~XMLParser()
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -51,11 +51,11 @@ VOID XMLParser::FillBuffer()
|
|||
|
||||
if( m_hFile == NULL )
|
||||
{
|
||||
if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE )
|
||||
if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE )
|
||||
NChars = XML_READ_BUFFER_SIZE;
|
||||
else
|
||||
NChars = m_uInXMLBufferCharsLeft;
|
||||
|
||||
|
||||
CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars );
|
||||
m_uInXMLBufferCharsLeft -= NChars;
|
||||
m_pInXMLBuffer += NChars;
|
||||
|
|
@ -69,7 +69,7 @@ VOID XMLParser::FillBuffer()
|
|||
}
|
||||
|
||||
m_dwCharsConsumed += NChars;
|
||||
__int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0;
|
||||
int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0;
|
||||
m_pISAXCallback->SetParseProgress( (DWORD)iProgress );
|
||||
|
||||
m_pReadBuf[ NChars ] = '\0';
|
||||
|
|
@ -89,7 +89,7 @@ VOID XMLParser::SkipNextAdvance()
|
|||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Name: XMLParser::ConsumeSpace
|
||||
// Desc: Skips spaces in the current stream
|
||||
// Desc: Skips spaces in the current stream
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::ConsumeSpace()
|
||||
{
|
||||
|
|
@ -104,29 +104,29 @@ HRESULT XMLParser::ConsumeSpace()
|
|||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
}
|
||||
SkipNextAdvance();
|
||||
}
|
||||
SkipNextAdvance();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Name: XMLParser::ConvertEscape
|
||||
// Desc: Copies and converts an escape sequence into m_pWriteBuf
|
||||
// Desc: Copies and converts an escape sequence into m_pWriteBuf
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::ConvertEscape()
|
||||
{
|
||||
{
|
||||
HRESULT hr;
|
||||
WCHAR wVal = 0;
|
||||
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
// all escape sequences start with &, so ignore the first character
|
||||
|
||||
// all escape sequences start with &, so ignore the first character
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
if ( m_Ch == '#' ) // character as hex or decimal
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
|
|
@ -135,9 +135,9 @@ HRESULT XMLParser::ConvertEscape()
|
|||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
while ( m_Ch != ';' )
|
||||
{
|
||||
{
|
||||
wVal *= 16;
|
||||
|
||||
if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) )
|
||||
|
|
@ -151,11 +151,11 @@ HRESULT XMLParser::ConvertEscape()
|
|||
else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) )
|
||||
{
|
||||
wVal += m_Ch - 'A' + 10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
|
|
@ -165,7 +165,7 @@ HRESULT XMLParser::ConvertEscape()
|
|||
else // decimal number
|
||||
{
|
||||
while ( m_Ch != ';' )
|
||||
{
|
||||
{
|
||||
wVal *= 10;
|
||||
|
||||
if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) )
|
||||
|
|
@ -174,7 +174,7 @@ HRESULT XMLParser::ConvertEscape()
|
|||
}
|
||||
else
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" );
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ HRESULT XMLParser::ConvertEscape()
|
|||
m_Ch = wVal;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// must be an entity reference
|
||||
|
||||
|
|
@ -197,13 +197,13 @@ HRESULT XMLParser::ConvertEscape()
|
|||
SkipNextAdvance();
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal );
|
||||
m_pWritePtr = pEntityRefVal;
|
||||
|
||||
if ( EntityRefLen == 0 )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" );
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ HRESULT XMLParser::ConvertEscape()
|
|||
wVal = '"';
|
||||
else
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" );
|
||||
Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" );
|
||||
return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence
|
||||
}
|
||||
|
||||
|
|
@ -228,10 +228,10 @@ HRESULT XMLParser::ConvertEscape()
|
|||
|
||||
if( m_Ch != ';' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" );
|
||||
Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" );
|
||||
return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ;
|
||||
}
|
||||
|
||||
|
||||
m_Ch = wVal;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
@ -250,41 +250,41 @@ HRESULT XMLParser::AdvanceAttrVal()
|
|||
return hr;
|
||||
|
||||
if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" );
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
wQuoteChar = m_Ch;
|
||||
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
else if( m_Ch == wQuoteChar )
|
||||
break;
|
||||
return hr;
|
||||
else if( m_Ch == wQuoteChar )
|
||||
break;
|
||||
else if( m_Ch == '&' )
|
||||
{
|
||||
SkipNextAdvance();
|
||||
if( FAILED( hr = ConvertEscape() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
}
|
||||
else if( m_Ch == '<' )
|
||||
else if( m_Ch == '<' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
|
||||
// copy character into the buffer
|
||||
|
||||
if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE )
|
||||
|
||||
if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
|
||||
*m_pWritePtr = m_Ch;
|
||||
m_pWritePtr++;
|
||||
m_pWritePtr++;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
|
@ -296,18 +296,18 @@ HRESULT XMLParser::AdvanceAttrVal()
|
|||
// Ignores leading whitespace. Currently does not support unicode names
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::AdvanceName()
|
||||
{
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
|
||||
if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) &&
|
||||
( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) &&
|
||||
( m_Ch != '_' ) && ( m_Ch != ':' ) )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) ||
|
||||
|
|
@ -319,17 +319,17 @@ HRESULT XMLParser::AdvanceName()
|
|||
|
||||
if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE );
|
||||
Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
}
|
||||
|
||||
*m_pWritePtr = m_Ch;
|
||||
m_pWritePtr++;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
SkipNextAdvance();
|
||||
return S_OK;
|
||||
}
|
||||
|
|
@ -343,7 +343,7 @@ HRESULT XMLParser::AdvanceName()
|
|||
// Returns S_OK if there are more characters, E_ABORT for no characters to read
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail )
|
||||
{
|
||||
{
|
||||
if( m_bSkipNextAdvance )
|
||||
{
|
||||
m_bSkipNextAdvance = FALSE;
|
||||
|
|
@ -351,20 +351,20 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail )
|
|||
}
|
||||
|
||||
// If we hit EOF in the middle of a character,
|
||||
// it's ok-- we'll just have a corrupt last character
|
||||
// it's ok-- we'll just have a corrupt last character
|
||||
// (the buffer is padded with double NULLs )
|
||||
|
||||
if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) )
|
||||
{
|
||||
// Read more from the file
|
||||
FillBuffer();
|
||||
FillBuffer();
|
||||
|
||||
// We are at EOF if it is still NULL
|
||||
if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) )
|
||||
{
|
||||
if( !bOkToFail )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" );
|
||||
Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
else
|
||||
|
|
@ -372,7 +372,7 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail )
|
|||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_bUnicode == FALSE )
|
||||
{
|
||||
|
|
@ -382,13 +382,13 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail )
|
|||
else // if( m_bUnicode == TRUE )
|
||||
{
|
||||
m_Ch = *((WCHAR *)m_pReadPtr);
|
||||
|
||||
|
||||
if( m_bReverseBytes )
|
||||
{
|
||||
m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 );
|
||||
}
|
||||
|
||||
m_pReadPtr += 2;
|
||||
|
||||
m_pReadPtr += 2;
|
||||
}
|
||||
|
||||
if( m_Ch == '\n' )
|
||||
|
|
@ -398,114 +398,114 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail )
|
|||
}
|
||||
else if( m_Ch != '\r' )
|
||||
m_pISAXCallback->m_LinePos++;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Name: XMLParser::AdvanceElement
|
||||
// Desc: Builds <element> data, calls callback
|
||||
// Desc: Builds <element> data, calls callback
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::AdvanceElement()
|
||||
{
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// write ptr at the beginning of the buffer
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
return hr;
|
||||
|
||||
// if first character wasn't '<', we wouldn't be here
|
||||
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
|
||||
if( m_Ch == '!' )
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if ( m_Ch == '-' )
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != '-' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != '-' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '-' after '<!-'" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceComment() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = AdvanceComment() ) )
|
||||
return hr;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if( m_Ch != '[' )
|
||||
|
||||
if( m_Ch != '[' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'C' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'C' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'D' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'D' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'A' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'A' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'T' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'T' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'A' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != 'A' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != '[' )
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( m_Ch != '[' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '<![CDATA['" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
if( FAILED( hr = AdvanceCDATA() ) )
|
||||
if( FAILED( hr = AdvanceCDATA() ) )
|
||||
return hr;
|
||||
}
|
||||
else if( m_Ch == '/' )
|
||||
else if( m_Ch == '/' )
|
||||
{
|
||||
WCHAR *pEntityRefVal = m_pWritePtr;
|
||||
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
return hr;
|
||||
|
||||
if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal,
|
||||
if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal,
|
||||
(UINT) ( m_pWritePtr - pEntityRefVal ) ) ) )
|
||||
return E_ABORT;
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
return hr;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
if( m_Ch != '>' )
|
||||
{
|
||||
|
|
@ -513,42 +513,42 @@ HRESULT XMLParser::AdvanceElement()
|
|||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
}
|
||||
else if( m_Ch == '?' )
|
||||
else if( m_Ch == '?' )
|
||||
{
|
||||
// just skip any xml header tag since not really important after identifying character set
|
||||
for( ;; )
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
if ( m_Ch == '>' )
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ];
|
||||
XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ];
|
||||
UINT NumAttrs;
|
||||
|
||||
WCHAR *pEntityRefVal = m_pWritePtr;
|
||||
UINT EntityRefLen;
|
||||
|
||||
NumAttrs = 0;
|
||||
|
||||
|
||||
SkipNextAdvance();
|
||||
|
||||
// Entity tag
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
return hr;
|
||||
|
||||
EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal );
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
return hr;
|
||||
|
||||
// read attributes
|
||||
while( ( m_Ch != '>' ) && ( m_Ch != '/' ) )
|
||||
{
|
||||
|
|
@ -556,31 +556,31 @@ HRESULT XMLParser::AdvanceElement()
|
|||
|
||||
if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
Attributes[ NumAttrs ].strName = m_pWritePtr;
|
||||
|
||||
|
||||
// Attribute name
|
||||
if( FAILED( hr = AdvanceName() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName );
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
return hr;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
if( m_Ch != '=' )
|
||||
if( m_Ch != '=' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
return hr;
|
||||
|
||||
Attributes[ NumAttrs ].strValue = m_pWritePtr;
|
||||
|
|
@ -588,29 +588,29 @@ HRESULT XMLParser::AdvanceElement()
|
|||
if( FAILED( hr = AdvanceAttrVal() ) )
|
||||
return hr;
|
||||
|
||||
Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr -
|
||||
Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr -
|
||||
Attributes[ NumAttrs ].strValue );
|
||||
|
||||
++NumAttrs;
|
||||
|
||||
|
||||
if( FAILED( hr = ConsumeSpace() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
}
|
||||
|
||||
if( m_Ch == '/' )
|
||||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
return hr;
|
||||
if( m_Ch != '>' )
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen,
|
||||
if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen,
|
||||
Attributes, NumAttrs ) ) )
|
||||
return E_ABORT;
|
||||
|
||||
|
|
@ -619,7 +619,7 @@ HRESULT XMLParser::AdvanceElement()
|
|||
}
|
||||
else
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen,
|
||||
if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen,
|
||||
Attributes, NumAttrs ) ) )
|
||||
return E_ABORT;
|
||||
}
|
||||
|
|
@ -637,7 +637,7 @@ HRESULT XMLParser::AdvanceCDATA()
|
|||
{
|
||||
HRESULT hr;
|
||||
WORD wStage = 0;
|
||||
|
||||
|
||||
if( FAILED( m_pISAXCallback->CDATABegin() ) )
|
||||
return E_ABORT;
|
||||
|
||||
|
|
@ -645,10 +645,10 @@ HRESULT XMLParser::AdvanceCDATA()
|
|||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
*m_pWritePtr = m_Ch;
|
||||
m_pWritePtr++;
|
||||
|
||||
|
||||
if( ( m_Ch == ']' ) && ( wStage == 0 ) )
|
||||
wStage = 1;
|
||||
else if( ( m_Ch == ']' ) && ( wStage == 1 ) )
|
||||
|
|
@ -666,9 +666,9 @@ HRESULT XMLParser::AdvanceCDATA()
|
|||
if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) )
|
||||
return E_ABORT;
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) )
|
||||
return E_ABORT;
|
||||
|
||||
|
|
@ -676,7 +676,7 @@ HRESULT XMLParser::AdvanceCDATA()
|
|||
|
||||
if( FAILED( m_pISAXCallback->CDATAEnd() ) )
|
||||
return E_ABORT;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -694,24 +694,24 @@ HRESULT XMLParser::AdvanceComment()
|
|||
{
|
||||
if( FAILED( hr = AdvanceCharacter() ) )
|
||||
return hr;
|
||||
|
||||
|
||||
if (( m_Ch == '-' ) && ( wStage == 0 ))
|
||||
wStage = 1;
|
||||
else if (( m_Ch == '-' ) && ( wStage == 1 ))
|
||||
wStage = 2;
|
||||
else if (( m_Ch == '>' ) && ( wStage == 2 ))
|
||||
break;
|
||||
else if (( m_Ch == '>' ) && ( wStage == 2 ))
|
||||
break;
|
||||
else
|
||||
wStage = 0;
|
||||
wStage = 0;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Name: XMLParser::RegisterSAXCallbackInterface
|
||||
// Desc: Registers callback interface
|
||||
// Desc: Registers callback interface
|
||||
//-------------------------------------------------------------------------------------
|
||||
VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback )
|
||||
{
|
||||
|
|
@ -721,7 +721,7 @@ VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback )
|
|||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Name: XMLParser::GetSAXCallbackInterface
|
||||
// Desc: Returns current callback interface
|
||||
// Desc: Returns current callback interface
|
||||
//-------------------------------------------------------------------------------------
|
||||
ISAXCallback* XMLParser::GetSAXCallbackInterface()
|
||||
{
|
||||
|
|
@ -740,7 +740,7 @@ HRESULT XMLParser::MainParseLoop()
|
|||
|
||||
if( FAILED( m_pISAXCallback->StartDocument() ) )
|
||||
return E_ABORT;
|
||||
|
||||
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
|
||||
FillBuffer();
|
||||
|
|
@ -751,57 +751,57 @@ HRESULT XMLParser::MainParseLoop()
|
|||
m_bReverseBytes = FALSE;
|
||||
m_pReadPtr += 2;
|
||||
}
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE )
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE )
|
||||
{
|
||||
m_bUnicode = TRUE;
|
||||
m_bReverseBytes = TRUE;
|
||||
m_pReadPtr += 2;
|
||||
m_pReadPtr += 2;
|
||||
}
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0x003C )
|
||||
{
|
||||
m_bUnicode = TRUE;
|
||||
m_bReverseBytes = FALSE;
|
||||
}
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 )
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0x003C )
|
||||
{
|
||||
m_bUnicode = TRUE;
|
||||
m_bReverseBytes = TRUE;
|
||||
m_bReverseBytes = FALSE;
|
||||
}
|
||||
else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 )
|
||||
{
|
||||
m_bUnicode = TRUE;
|
||||
m_bReverseBytes = TRUE;
|
||||
}
|
||||
else if ( m_pReadBuf[ 0 ] == 0x3C )
|
||||
{
|
||||
m_bUnicode = FALSE;
|
||||
m_bReverseBytes = FALSE;
|
||||
m_bUnicode = FALSE;
|
||||
m_bReverseBytes = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" );
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
return E_INVALID_XML_SYNTAX;
|
||||
}
|
||||
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
if( FAILED( AdvanceCharacter( TRUE ) ) )
|
||||
{
|
||||
if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) )
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) )
|
||||
return E_ABORT;
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) )
|
||||
return E_ABORT;
|
||||
|
||||
bWhiteSpaceOnly = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if( FAILED( m_pISAXCallback->EndDocument() ) )
|
||||
return E_ABORT;
|
||||
|
||||
return S_OK;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if( m_Ch == '<' )
|
||||
{
|
||||
if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) )
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) )
|
||||
return E_ABORT;
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) )
|
||||
return E_ABORT;
|
||||
|
||||
bWhiteSpaceOnly = TRUE;
|
||||
}
|
||||
|
|
@ -810,45 +810,45 @@ HRESULT XMLParser::MainParseLoop()
|
|||
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
|
||||
if( FAILED( hr = AdvanceElement() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = AdvanceElement() ) )
|
||||
return hr;
|
||||
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if( m_Ch == '&' )
|
||||
{
|
||||
SkipNextAdvance();
|
||||
if( FAILED( hr = ConvertEscape() ) )
|
||||
return hr;
|
||||
if( FAILED( hr = ConvertEscape() ) )
|
||||
return hr;
|
||||
}
|
||||
|
||||
if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) &&
|
||||
( m_Ch != '\t' ) )
|
||||
if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) &&
|
||||
( m_Ch != '\t' ) )
|
||||
{
|
||||
bWhiteSpaceOnly = FALSE;
|
||||
}
|
||||
|
||||
*m_pWritePtr = m_Ch;
|
||||
m_pWritePtr++;
|
||||
|
||||
|
||||
if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE )
|
||||
{
|
||||
if( !bWhiteSpaceOnly )
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf,
|
||||
( UINT ) ( m_pWritePtr - m_pWriteBuf ),
|
||||
{
|
||||
if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf,
|
||||
( UINT ) ( m_pWritePtr - m_pWriteBuf ),
|
||||
TRUE ) ) )
|
||||
{
|
||||
return E_ABORT;
|
||||
return E_ABORT;
|
||||
}
|
||||
}
|
||||
|
||||
m_pWritePtr = m_pWriteBuf;
|
||||
bWhiteSpaceOnly = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -858,36 +858,36 @@ HRESULT XMLParser::MainParseLoop()
|
|||
// Desc: Builds element data
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename )
|
||||
{
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if( m_pISAXCallback == NULL )
|
||||
return E_NOINTERFACE;
|
||||
|
||||
m_pISAXCallback->m_LineNum = 1;
|
||||
m_pISAXCallback->m_LineNum = 1;
|
||||
m_pISAXCallback->m_LinePos = 0;
|
||||
m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file
|
||||
|
||||
m_bSkipNextAdvance = FALSE;
|
||||
m_pReadPtr = m_pReadBuf;
|
||||
|
||||
m_pReadPtr = m_pReadBuf;
|
||||
|
||||
m_pReadBuf[ 0 ] = '\0';
|
||||
m_pReadBuf[ 1 ] = '\0';
|
||||
|
||||
m_pReadBuf[ 1 ] = '\0';
|
||||
|
||||
m_pInXMLBuffer = NULL;
|
||||
m_uInXMLBufferCharsLeft = 0;
|
||||
|
||||
|
||||
WCHAR wchFilename[ 64 ];
|
||||
|
||||
swprintf_s(wchFilename,64,L"%s",strFilename);
|
||||
|
||||
m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL );
|
||||
m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL );
|
||||
|
||||
if( m_hFile == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
{
|
||||
Error( E_COULD_NOT_OPEN_FILE, "Error opening file" );
|
||||
hr = E_COULD_NOT_OPEN_FILE;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -897,14 +897,14 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename )
|
|||
m_dwCharsConsumed = 0;
|
||||
hr = MainParseLoop();
|
||||
}
|
||||
|
||||
|
||||
// Close the file
|
||||
if( m_hFile != INVALID_HANDLE_VALUE )
|
||||
CloseHandle( m_hFile );
|
||||
m_hFile = INVALID_HANDLE_VALUE;
|
||||
|
||||
// we no longer own strFilename, so un-set it
|
||||
m_pISAXCallback->m_strFilename = NULL;
|
||||
m_pISAXCallback->m_strFilename = NULL;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
@ -914,38 +914,38 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename )
|
|||
// Desc: Builds element data
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize )
|
||||
{
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
|
||||
if( m_pISAXCallback == NULL )
|
||||
return E_NOINTERFACE;
|
||||
|
||||
m_pISAXCallback->m_LineNum = 1;
|
||||
m_pISAXCallback->m_LineNum = 1;
|
||||
m_pISAXCallback->m_LinePos = 0;
|
||||
m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file
|
||||
|
||||
m_bSkipNextAdvance = FALSE;
|
||||
m_pReadPtr = m_pReadBuf;
|
||||
|
||||
|
||||
m_pReadBuf[ 0 ] = '\0';
|
||||
m_pReadBuf[ 1 ] = '\0';
|
||||
m_pReadBuf[ 1 ] = '\0';
|
||||
|
||||
m_hFile = NULL;
|
||||
m_pInXMLBuffer = strBuffer;
|
||||
m_uInXMLBufferCharsLeft = uBufferSize;
|
||||
m_dwCharsTotal = uBufferSize;
|
||||
m_dwCharsConsumed = 0;
|
||||
|
||||
|
||||
hr = MainParseLoop();
|
||||
|
||||
// we no longer own strFilename, so un-set it
|
||||
m_pISAXCallback->m_strFilename = NULL;
|
||||
m_pISAXCallback->m_strFilename = NULL;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// XMLParser::Error()
|
||||
// XMLParser::Error()
|
||||
// Logs an error through the callback interface
|
||||
//-------------------------------------------------------------------------------------
|
||||
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
|
||||
|
|
@ -960,7 +960,7 @@ VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... )
|
|||
va_start( pArglist, strFormat );
|
||||
|
||||
vsprintf( strBuffer, strFormat, pArglist );
|
||||
|
||||
|
||||
m_pISAXCallback->Error( hErr, strBuffer );
|
||||
va_end( pArglist );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ GameRenderer::~GameRenderer()
|
|||
}
|
||||
|
||||
void GameRenderer::tick(bool first) // 4J - add bFirst
|
||||
{
|
||||
{
|
||||
tickFov();
|
||||
tickLightTexture(); // 4J - change brought forward from 1.8.2
|
||||
fogBrO = fogBr;
|
||||
|
|
@ -627,7 +627,7 @@ void GameRenderer::unZoomRegion()
|
|||
void GameRenderer::getFovAndAspect(float& fov, float& aspect, float a, bool applyEffects)
|
||||
{
|
||||
// 4J - split out aspect ratio and fov here so we can adjust for viewports - we might need to revisit these as
|
||||
// they are maybe be too generous for performance.
|
||||
// they are maybe be too generous for performance.
|
||||
aspect = mc->width / (float) mc->height;
|
||||
fov = getFov(a, applyEffects);
|
||||
|
||||
|
|
@ -679,7 +679,7 @@ void GameRenderer::setupCamera(float a, int eye)
|
|||
|
||||
// 4J-PB - this is a per-player option
|
||||
//if (mc->options->bobView) bobView(a);
|
||||
|
||||
|
||||
bool bNoLegAnim =(mc->player->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_NoLegAnim))!=0;
|
||||
bool bNoBobbingAnim =(mc->player->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_NoBobbing))!=0;
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ void GameRenderer::renderItemInHand(float a, int eye)
|
|||
//if (!mc->options->thirdPersonView && !mc->cameraTargetPlayer->isSleeping())
|
||||
if (!localplayer->ThirdPersonView() && !mc->cameraTargetPlayer->isSleeping())
|
||||
{
|
||||
if (!mc->options->hideGui && !mc->gameMode->isCutScene())
|
||||
if (!mc->options->hideGui && !mc->gameMode->isCutScene())
|
||||
{
|
||||
turnOnLightLayer(a);
|
||||
PIXBeginNamedEvent(0,"Item in hand render");
|
||||
|
|
@ -795,7 +795,7 @@ void GameRenderer::renderItemInHand(float a, int eye)
|
|||
// 4J - change brought forward from 1.8.2
|
||||
void GameRenderer::turnOffLightLayer(double alpha)
|
||||
{ // 4J - TODO
|
||||
#if 0
|
||||
#if 0
|
||||
if (SharedConstants::TEXTURE_LIGHTING)
|
||||
{
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
|
|
@ -868,7 +868,7 @@ void GameRenderer::updateLightTexture(float a)
|
|||
if (player == NULL) continue;
|
||||
|
||||
Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture
|
||||
|
||||
|
||||
float skyDarken1 = level->getSkyDarken((float) 1);
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
|
|
@ -1141,7 +1141,7 @@ int GameRenderer::runUpdate(LPVOID lpParam)
|
|||
Vec3::CreateNewThreadStorage();
|
||||
AABB::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Tesselator::CreateNewThreadStorage(1024*1024);
|
||||
Tesselator::CreateNewThreadStorage(1024*1024);
|
||||
Compression::UseDefaultThreadStorage();
|
||||
RenderManager.InitialiseContext();
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
|
@ -1210,12 +1210,12 @@ int GameRenderer::runUpdate(LPVOID lpParam)
|
|||
}
|
||||
m_deleteStackSparseDataStorage.clear();
|
||||
LeaveCriticalSection(&m_csDeleteStack);
|
||||
|
||||
|
||||
// PIXEndNamedEvent();
|
||||
|
||||
AABB::resetPool();
|
||||
Vec3::resetPool();
|
||||
IntCache::Reset();
|
||||
IntCache::Reset();
|
||||
m_updateEvents->Set(eUpdateEventIsFinished);
|
||||
}
|
||||
|
||||
|
|
@ -1247,12 +1247,12 @@ void GameRenderer::DisableUpdateThread()
|
|||
if( !updateRunning) return;
|
||||
app.DebugPrintf("------------------DisableUpdateThread--------------------\n");
|
||||
updateRunning = false;
|
||||
m_updateEvents->Clear(eUpdateCanRun);
|
||||
m_updateEvents->Clear(eUpdateCanRun);
|
||||
m_updateEvents->WaitForSingle(eUpdateEventIsFinished,INFINITE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GameRenderer::renderLevel(float a, __int64 until)
|
||||
void GameRenderer::renderLevel(float a, int64_t until)
|
||||
{
|
||||
// if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen
|
||||
|
||||
|
|
@ -1335,7 +1335,7 @@ void GameRenderer::renderLevel(float a, __int64 until)
|
|||
|
||||
if (until == 0) break;
|
||||
|
||||
__int64 diff = until - System::nanoTime();
|
||||
int64_t diff = until - System::nanoTime();
|
||||
if (diff < 0) break;
|
||||
if (diff > 1000000000) break;
|
||||
} while (true);
|
||||
|
|
@ -1594,7 +1594,7 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
|
||||
this->turnOnLightLayer(a);
|
||||
|
||||
if (rainXa == NULL)
|
||||
if (rainXa == NULL)
|
||||
{
|
||||
rainXa = new float[32 * 32];
|
||||
rainZa = new float[32 * 32];
|
||||
|
|
@ -1657,7 +1657,7 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
}
|
||||
|
||||
// 4J - some changes made here to access biome through new interface that caches results in levelchunk flags, as an optimisation
|
||||
|
||||
|
||||
int mode = -1;
|
||||
float time = _tick + a;
|
||||
|
||||
|
|
@ -1669,7 +1669,7 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
int rainSlot = (z - z0 + 16) * 32 + (x - x0 + 16);
|
||||
float xa = rainXa[rainSlot] * 0.5f;
|
||||
float za = rainZa[rainSlot] * 0.5f;
|
||||
|
||||
|
||||
// 4J - changes here brought forward from 1.8.2
|
||||
Biome *b = level->getBiome(x, z);
|
||||
if (!b->hasRain() && !b->hasSnow()) continue;
|
||||
|
|
@ -1715,9 +1715,9 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
float Alpha = ((1 - dd * dd) * 0.5f + 0.5f) * rainLevel;
|
||||
int tex2 = (level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4;
|
||||
t->tileRainQuad(x - xa + 0.5, yy0, z - za + 0.5, 0 * s, yy0 * s / 4.0f + ra * s,
|
||||
x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s,
|
||||
x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s,
|
||||
x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s,
|
||||
x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s,
|
||||
x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s,
|
||||
x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s,
|
||||
br, br, br, Alpha, br, br, br, 0, tex2);
|
||||
#else
|
||||
t->tex2(level->getLightColor(x, yl, z, 0));
|
||||
|
|
@ -1753,9 +1753,9 @@ void GameRenderer::renderSnowAndRain(float a)
|
|||
float Alpha = ((1 - dd * dd) * 0.3f + 0.5f) * rainLevel;
|
||||
int tex2 = (level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4;
|
||||
t->tileRainQuad(x - xa + 0.5, yy0, z - za + 0.5, 0 * s + uo, yy0 * s / 4.0f + ra * s + vo,
|
||||
x + xa + 0.5, yy0, z + za + 0.5, 1 * s + uo, yy0 * s / 4.0f + ra * s + vo,
|
||||
x + xa + 0.5, yy1, z + za + 0.5, 1 * s + uo, yy1 * s / 4.0f + ra * s + vo,
|
||||
x - xa + 0.5, yy1, z - za + 0.5, 0 * s + uo, yy1 * s / 4.0f + ra * s + vo,
|
||||
x + xa + 0.5, yy0, z + za + 0.5, 1 * s + uo, yy0 * s / 4.0f + ra * s + vo,
|
||||
x + xa + 0.5, yy1, z + za + 0.5, 1 * s + uo, yy1 * s / 4.0f + ra * s + vo,
|
||||
x - xa + 0.5, yy1, z - za + 0.5, 0 * s + uo, yy1 * s / 4.0f + ra * s + vo,
|
||||
br, br, br, Alpha, br, br, br, Alpha, tex2);
|
||||
#else
|
||||
t->tex2((level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4);
|
||||
|
|
@ -1861,7 +1861,7 @@ void GameRenderer::setupClearColor(float a)
|
|||
}
|
||||
else if (t != 0 && Tile::tiles[t]->material == Material::water)
|
||||
{
|
||||
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
|
|
@ -1873,7 +1873,7 @@ void GameRenderer::setupClearColor(float a)
|
|||
}
|
||||
else if (t != 0 && Tile::tiles[t]->material == Material::lava)
|
||||
{
|
||||
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
|
|
@ -2017,7 +2017,7 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06
|
||||
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
|
|
@ -2049,7 +2049,7 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
{
|
||||
glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06
|
||||
}
|
||||
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Fog_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
|
|
@ -2074,7 +2074,7 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
glFogf(GL_FOG_DENSITY, 2.0f); // was 0.06
|
||||
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ public:
|
|||
void setupCamera(float a, int eye);
|
||||
private:
|
||||
void renderItemInHand(float a, int eye);
|
||||
__int64 lastActiveTime;
|
||||
__int64 lastNsTime;
|
||||
int64_t lastActiveTime;
|
||||
int64_t lastNsTime;
|
||||
// 4J - changes brought forward from 1.8.2
|
||||
bool _updateLightTexture;
|
||||
public:
|
||||
|
|
@ -112,7 +112,7 @@ private:
|
|||
public:
|
||||
void render(float a, bool bFirst); // 4J added bFirst
|
||||
void renderLevel(float a);
|
||||
void renderLevel(float a, __int64 until);
|
||||
void renderLevel(float a, int64_t until);
|
||||
private:
|
||||
Random *random;
|
||||
int rainSoundTime;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
{
|
||||
// 4J Stu - I have copied this code for XUI_BaseScene. If/when it gets changed it should be broken out
|
||||
// 4J - altered to force full screen mode to 3X scaling, and any split screen modes to 2X scaling. This is so that the further scaling by 0.5 that
|
||||
// happens in split screen modes results in a final scaling of 1 rather than 1.5.
|
||||
// happens in split screen modes results in a final scaling of 1 rather than 1.5.
|
||||
int splitYOffset;// = 20; // This offset is applied when doing the 2X scaling above to move the gui out of the way of the tool tips
|
||||
int guiScale;// = ( minecraft->player->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN ? 3 : 2 );
|
||||
int iPad=minecraft->player->GetXboxPad();
|
||||
|
|
@ -97,7 +97,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
default: // 2
|
||||
splitYOffset = 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Check which screen section this player is in
|
||||
switch(minecraft->player->m_iScreenSection)
|
||||
|
|
@ -136,7 +136,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
currentGuiScaleFactor *= 0.5f;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneYHalf = splitYOffset + screenHeight/10;// 5% (need to treat the whole screen is 2x this screen)
|
||||
fScaleFactorHeight=0.5f;
|
||||
iHeightOffset=screenHeight;
|
||||
|
|
@ -151,7 +151,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
currentGuiScaleFactor *= 0.5f;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneYHalf = splitYOffset; // 5%
|
||||
iTooltipsYOffset=44;
|
||||
currentGuiScaleFactor *= 0.5f;
|
||||
|
|
@ -163,27 +163,27 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
currentGuiScaleFactor *= 0.5f;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneXHalf = 0;
|
||||
iSafezoneYHalf = splitYOffset + screenHeight/10; // 5% (the whole screen is 2x this screen)
|
||||
iTooltipsYOffset=44;
|
||||
currentGuiScaleFactor *= 0.5f;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 4J-PB - turn off the slot display if a xui menu is up, or if we're autosaving
|
||||
bool bDisplayGui=!ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail);
|
||||
|
||||
// if tooltips are off, set the y offset to zero
|
||||
if(app.GetGameSettings(iPad,eGameSetting_Tooltips)==0 && bDisplayGui)
|
||||
if(app.GetGameSettings(iPad,eGameSetting_Tooltips)==0 && bDisplayGui)
|
||||
{
|
||||
switch(minecraft->player->m_iScreenSection)
|
||||
{
|
||||
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
|
||||
iTooltipsYOffset=screenHeight/10;
|
||||
iTooltipsYOffset=screenHeight/10;
|
||||
break;
|
||||
default:
|
||||
//iTooltipsYOffset=screenHeight/10;
|
||||
//iTooltipsYOffset=screenHeight/10;
|
||||
switch(guiScale)
|
||||
{
|
||||
case 3:
|
||||
|
|
@ -195,11 +195,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
default: // 2
|
||||
iTooltipsYOffset=14;//screenHeight/10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 4J-PB - Turn off interface if eGameSetting_DisplayHUD is off - for screen shots/videos.
|
||||
if ( app.GetGameSettings(iPad,eGameSetting_DisplayHUD)==0 )
|
||||
{
|
||||
|
|
@ -210,13 +210,13 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
|
||||
|
||||
minecraft->gameRenderer->setupGuiScreen(guiScale);
|
||||
|
||||
|
||||
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // 4J - added - this did actually get set in renderVignette but that code is currently commented out
|
||||
|
||||
if (Minecraft::useFancyGraphics())
|
||||
if (Minecraft::useFancyGraphics())
|
||||
{
|
||||
renderVignette(minecraft->player->getBrightness(a), screenWidth, screenHeight);
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
if(bDisplayGui && bTwoPlayerSplitscreen)
|
||||
{
|
||||
// need to apply scale factors depending on the mode
|
||||
glPushMatrix();
|
||||
glPushMatrix();
|
||||
glScalef(fScaleFactorWidth, fScaleFactorHeight, fScaleFactorWidth);
|
||||
}
|
||||
#if RENDER_HUD
|
||||
|
|
@ -308,9 +308,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
// need to apply scale factors depending on the mode
|
||||
|
||||
// 4J Stu - Moved this push and scale further up as we still need to do it for the few HUD components not replaced by xui
|
||||
//glPushMatrix();
|
||||
//glPushMatrix();
|
||||
//glScalef(fScaleFactorWidth, fScaleFactorHeight, fScaleFactorWidth);
|
||||
|
||||
|
||||
// 4J-PB - move into the safe zone, and account for 2 player splitscreen
|
||||
blit(iWidthOffset + (screenWidth - quickSelectWidth)/2, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset , 0, 0, 182, 22);
|
||||
blit(iWidthOffset + (screenWidth - quickSelectWidth)/2 - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22);
|
||||
|
|
@ -358,13 +358,13 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
int food = foodData->getFoodLevel();
|
||||
int oldFood = foodData->getLastFoodLevel();
|
||||
|
||||
// if (false) //(true)
|
||||
// if (false) //(true)
|
||||
// {
|
||||
// renderBossHealth();
|
||||
// }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// Display the experience, food, armour, health and the air bubbles
|
||||
// Display the experience, food, armour, health and the air bubbles
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
if(bDisplayGui)
|
||||
{
|
||||
|
|
@ -451,7 +451,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
if (blink) bg = 1;
|
||||
int xo = xLeft + i * 8;
|
||||
int yo = yLine1;
|
||||
|
||||
|
||||
if (iHealth <= 4)
|
||||
{
|
||||
yo += random->nextInt(2);
|
||||
|
|
@ -538,12 +538,12 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
glEnable(GL_RESCALE_NORMAL);
|
||||
|
||||
Lighting::turnOnGui();
|
||||
|
||||
|
||||
|
||||
int x,y;
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
{
|
||||
if(bTwoPlayerSplitscreen)
|
||||
{
|
||||
x = iWidthOffset + screenWidth / 2 - 9 * 10 + i * 20 + 2;
|
||||
|
|
@ -580,11 +580,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
else if( minecraft->player->isSprinting() )
|
||||
{
|
||||
characterDisplayTimer[iPad] = 30;
|
||||
}
|
||||
}
|
||||
else if( minecraft->player->abilities.flying)
|
||||
{
|
||||
characterDisplayTimer[iPad] = 5; // quickly get rid of the player display if they stop flying
|
||||
}
|
||||
}
|
||||
else if( characterDisplayTimer[iPad] > 0 )
|
||||
{
|
||||
--characterDisplayTimer[iPad];
|
||||
|
|
@ -670,7 +670,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
|
||||
minecraft->player->onFire = 0;
|
||||
minecraft->player->setSharedFlag(Entity::FLAG_ONFIRE, false);
|
||||
|
||||
|
||||
glTranslatef(0, minecraft->player->heightOffset, 0);
|
||||
EntityRenderDispatcher::instance->playerRotY = 180;
|
||||
EntityRenderDispatcher::instance->isGuiRender = true;
|
||||
|
|
@ -712,7 +712,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
{
|
||||
y-=13;
|
||||
}
|
||||
|
||||
|
||||
if(bTwoPlayerSplitscreen)
|
||||
{
|
||||
y+=iHeightOffset;
|
||||
|
|
@ -784,7 +784,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
glPushMatrix();
|
||||
if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0);
|
||||
font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", iSafezoneXHalf+2, 20, 0xffffff);
|
||||
font->drawShadow(L"Seed: " + _toString<__int64>(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff);
|
||||
font->drawShadow(L"Seed: " + _toString<int64_t>(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf+2, 32 + 10, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats2(), iSafezoneXHalf+2, 32 + 20, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff);
|
||||
|
|
@ -866,7 +866,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
float t = overlayMessageTime - a;
|
||||
int alpha = (int) (t * 256 / 20);
|
||||
if (alpha > 255) alpha = 255;
|
||||
if (alpha > 0)
|
||||
if (alpha > 0)
|
||||
{
|
||||
glPushMatrix();
|
||||
|
||||
|
|
@ -893,7 +893,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
unsigned int max = 10;
|
||||
bool isChatting = false;
|
||||
if (dynamic_cast<ChatScreen *>(minecraft->screen) != NULL)
|
||||
|
|
@ -1026,35 +1026,35 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
// void Gui::renderBossHealth(void)
|
||||
// {
|
||||
// if (EnderDragonRenderer::bossInstance == NULL) return;
|
||||
//
|
||||
//
|
||||
// shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
|
||||
// EnderDragonRenderer::bossInstance = NULL;
|
||||
//
|
||||
//
|
||||
// Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
//
|
||||
//
|
||||
// Font *font = pMinecraft->font;
|
||||
//
|
||||
//
|
||||
// ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
|
||||
// int screenWidth = ssc.getWidth();
|
||||
//
|
||||
//
|
||||
// int w = 182;
|
||||
// int xLeft = screenWidth / 2 - w / 2;
|
||||
//
|
||||
//
|
||||
// int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1));
|
||||
//
|
||||
//
|
||||
// int yo = 12;
|
||||
// blit(xLeft, yo, 0, 74, w, 5);
|
||||
// blit(xLeft, yo, 0, 74, w, 5);
|
||||
// if (progress > 0)
|
||||
// if (progress > 0)
|
||||
// {
|
||||
// blit(xLeft, yo, 0, 79, progress, 5);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// wstring msg = L"Boss health - NON LOCALISED";
|
||||
// font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff);
|
||||
// glColor4f(1, 1, 1, 1);
|
||||
// glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png"));
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
void Gui::renderPumpkin(int w, int h)
|
||||
|
|
@ -1081,7 +1081,7 @@ void Gui::renderPumpkin(int w, int h)
|
|||
glColor4f(1, 1, 1, 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Gui::renderVignette(float br, int w, int h)
|
||||
{
|
||||
br = 1 - br;
|
||||
|
|
@ -1126,7 +1126,7 @@ void Gui::renderTp(float br, int w, int h)
|
|||
MemSect(31);
|
||||
minecraft->textures->bindTexture(TN_TERRAIN);//L"/terrain.png"));
|
||||
MemSect(0);
|
||||
|
||||
|
||||
Icon *slot = Tile::portalTile->getTexture(Facing::UP);
|
||||
float u0 = slot->getU0();
|
||||
float v0 = slot->getV0();
|
||||
|
|
@ -1178,7 +1178,7 @@ void Gui::tick()
|
|||
tickCount++;
|
||||
|
||||
for(int iPad=0;iPad<XUSER_MAX_COUNT;iPad++)
|
||||
{
|
||||
{
|
||||
// 4J Stu - Fix for #10929 - MP LAB: Network Disconnects: Host does not receive an error message stating the client left the game when viewing the Pause Menu.
|
||||
// We don't show the guiMessages when a menu is up, so don't fade them out
|
||||
if(!ui.GetMenuDisplayed(iPad))
|
||||
|
|
@ -1202,7 +1202,7 @@ void Gui::clearMessages(int iPad)
|
|||
{
|
||||
guiMessages[i].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1391,7 +1391,7 @@ void Gui::displayClientMessage(int messageId, int iPad)
|
|||
}
|
||||
|
||||
// 4J Added
|
||||
void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning)
|
||||
void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning)
|
||||
{
|
||||
int height = minecraft->height;
|
||||
// This causes us to cover xScale*dataLength pixels in the horizontal
|
||||
|
|
@ -1430,12 +1430,12 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc
|
|||
t->color(0xff000000 + cc * 256);
|
||||
}
|
||||
|
||||
__int64 aVal = dataA[i] / dataAScale;
|
||||
int64_t aVal = dataA[i] / dataAScale;
|
||||
|
||||
t->vertex((float)(xScale*i + 0.5f), (float)( height - aVal + 0.5f), (float)( 0));
|
||||
t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), (float)( 0));
|
||||
}
|
||||
|
||||
|
||||
if( dataB != NULL )
|
||||
{
|
||||
if (dataB[i]>dataBWarning)
|
||||
|
|
@ -1447,7 +1447,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc
|
|||
t->color(0xff808080 + cc/2 * 256);
|
||||
}
|
||||
|
||||
__int64 bVal = dataB[i] / dataBScale;
|
||||
int64_t bVal = dataB[i] / dataBScale;
|
||||
|
||||
t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height - bVal + 0.5f), (float)( 0));
|
||||
t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height + 0.5f), (float)( 0));
|
||||
|
|
@ -1458,7 +1458,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) )
|
||||
void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) )
|
||||
{
|
||||
int height = minecraft->height;
|
||||
|
||||
|
|
@ -1475,8 +1475,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int
|
|||
Tesselator *t = Tesselator::getInstance();
|
||||
|
||||
t->begin(GL_LINES);
|
||||
__int64 thisVal = 0;
|
||||
__int64 topVal = 0;
|
||||
int64_t thisVal = 0;
|
||||
int64_t topVal = 0;
|
||||
for (int i = 0; i < dataLength; i++)
|
||||
{
|
||||
thisVal = 0;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,6 @@ public:
|
|||
float getJukeboxOpacity(int iPad);
|
||||
|
||||
// 4J Added
|
||||
void renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning);
|
||||
void renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) );
|
||||
void renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning);
|
||||
void renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) );
|
||||
};
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ void LevelRenderer::allChanged(int playerIndex)
|
|||
zMaxChunk = zChunks;
|
||||
|
||||
// 4J removed - we now only fully clear this on exiting the game (setting level to NULL). Apart from that, the chunk rebuilding is responsible for maintaining this
|
||||
// renderableTileEntities.clear();
|
||||
// renderableTileEntities.clear();
|
||||
|
||||
for (int x = 0; x < xChunks; x++)
|
||||
{
|
||||
|
|
@ -565,7 +565,7 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a)
|
|||
|
||||
for( AUTO_VAR(it2, it->second.begin()); it2 != it->second.end(); it2++)
|
||||
{
|
||||
TileEntityRenderDispatcher::instance->render(*it2, a);
|
||||
TileEntityRenderDispatcher::instance->render(*it2, a);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -895,7 +895,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha)
|
|||
}
|
||||
|
||||
|
||||
void LevelRenderer::renderSameAsLast(int layer, double alpha)
|
||||
void LevelRenderer::renderSameAsLast(int layer, double alpha)
|
||||
{
|
||||
for (int i = 0; i < RENDERLISTS_LENGTH; i++)
|
||||
{
|
||||
|
|
@ -1127,7 +1127,7 @@ void LevelRenderer::renderSky(float alpha)
|
|||
glPopMatrix();
|
||||
|
||||
// 4J - can't work out what this big black box is for. Taking it out until someone misses it... it causes a big black box to visible appear in 3rd person mode whilst under the ground.
|
||||
#if 0
|
||||
#if 0
|
||||
float ss = 1;
|
||||
float yo = -(float) (yy + 65);
|
||||
float y0 = -ss;
|
||||
|
|
@ -1200,7 +1200,7 @@ void LevelRenderer::renderHaloRing(float alpha)
|
|||
|
||||
// Rough lumninance calculation
|
||||
float Y = (sr+sr+sb+sg+sg+sg)/6;
|
||||
float br = 0.6f + (Y*0.4f);
|
||||
float br = 0.6f + (Y*0.4f);
|
||||
//app.DebugPrintf("Luminance = %f, brightness = %f\n", Y, br);
|
||||
glColor3f(br,br,br);
|
||||
|
||||
|
|
@ -1369,7 +1369,7 @@ void LevelRenderer::createCloudMesh()
|
|||
t->vertexUV(x0, y0, z0, u, v );
|
||||
t->vertexUV(x1, y0, z0, u, v );
|
||||
t->vertexUV(x1, y0, z1, u, v );
|
||||
t->vertexUV(x0, y0, z1, u, v );
|
||||
t->vertexUV(x0, y0, z1, u, v );
|
||||
}
|
||||
}
|
||||
t->end();
|
||||
|
|
@ -1469,7 +1469,7 @@ void LevelRenderer::createCloudMesh()
|
|||
t->vertexUV(x0, y1, z0, u, v );
|
||||
t->vertexUV(x1, y1, z0, u, v );
|
||||
t->vertexUV(x1, y0, z0, u, v );
|
||||
t->vertexUV(x0, y0, z0, u, v );
|
||||
t->vertexUV(x0, y0, z0, u, v );
|
||||
}
|
||||
}
|
||||
t->end();
|
||||
|
|
@ -1491,10 +1491,10 @@ void LevelRenderer::createCloudMesh()
|
|||
float z1 = z0 + 1.0f;
|
||||
t->color(0.8f, 0.8f, 0.8f, 0.8f);
|
||||
t->normal(1, 0, 0);
|
||||
t->vertexUV(x0, y0, z1, u, v );
|
||||
t->vertexUV(x0, y0, z1, u, v );
|
||||
t->vertexUV(x1, y0, z1, u, v );
|
||||
t->vertexUV(x1, y1, z1, u, v );
|
||||
t->vertexUV(x0, y1, z1, u, v );
|
||||
t->vertexUV(x0, y1, z1, u, v );
|
||||
}
|
||||
}
|
||||
t->end();
|
||||
|
|
@ -1773,7 +1773,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha)
|
|||
t->end();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glColor4f(1, 1, 1, 1.0f);
|
||||
|
|
@ -1910,14 +1910,14 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
{
|
||||
// It's possible that the localplayers member can be set to NULL on the main thread when a player chooses to exit the game
|
||||
// So take a reference to the player object now. As it is a shared_ptr it should live as long as we need it
|
||||
shared_ptr<LocalPlayer> player = mc->localplayers[p];
|
||||
shared_ptr<LocalPlayer> player = mc->localplayers[p];
|
||||
if( player == NULL ) continue;
|
||||
if( chunks[p].data == NULL ) continue;
|
||||
if( level[p] == NULL ) continue;
|
||||
if( chunks[p].length != xChunks * zChunks * CHUNK_Y_COUNT ) continue;
|
||||
int px = (int)player->x;
|
||||
int py = (int)player->y;
|
||||
int pz = (int)player->z;
|
||||
int pz = (int)player->z;
|
||||
|
||||
// app.DebugPrintf("!! %d %d %d, %d %d %d {%d,%d} ",px,py,pz,stackChunkDirty,nonStackChunkDirty,onlyRebuild, xChunks, zChunks);
|
||||
|
||||
|
|
@ -1932,7 +1932,7 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
ClipChunk *pClipChunk = &chunks[p][(z * yChunks + y) * xChunks + x];
|
||||
// Get distance to this chunk - deliberately not calling the chunk's method of doing this to avoid overheads (passing entitie, type conversion etc.) that this involves
|
||||
int xd = pClipChunk->xm - px;
|
||||
int yd = pClipChunk->ym - py;
|
||||
int yd = pClipChunk->ym - py;
|
||||
int zd = pClipChunk->zm - pz;
|
||||
int distSq = xd * xd + yd * yd + zd * zd;
|
||||
int distSqWeighted = xd * xd + yd * yd * 4 + zd * zd; // Weighting against y to prioritise things in same x/z plane as player first
|
||||
|
|
@ -1974,7 +1974,7 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
// emptiness without actually testing as many data items as uncompressed data would.
|
||||
Chunk *chunk = pClipChunk->chunk;
|
||||
LevelChunk *lc = level[p]->getChunkAt(chunk->x,chunk->z);
|
||||
if( !lc->isRenderChunkEmpty(y * 16) )
|
||||
if( !lc->isRenderChunkEmpty(y * 16) )
|
||||
{
|
||||
nearChunk = pClipChunk;
|
||||
minDistSq = distSqWeighted;
|
||||
|
|
@ -2014,7 +2014,7 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Chunk *chunk = NULL;
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
|
@ -2058,21 +2058,21 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
if((veryNearCount > 0))
|
||||
bAtomic = true; //MGH - if veryNearCount, then we're trying to rebuild atomically, so do it all on the main thread
|
||||
|
||||
if( bAtomic || (index == 0) )
|
||||
if( bAtomic || (index == 0) )
|
||||
{
|
||||
//PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z);
|
||||
// static __int64 totalTime = 0;
|
||||
// static __int64 countTime = 0;
|
||||
// __int64 startTime = System::currentTimeMillis();
|
||||
// static int64_t totalTime = 0;
|
||||
// static int64_t countTime = 0;
|
||||
// int64_t startTime = System::currentTimeMillis();
|
||||
|
||||
//app.DebugPrintf("Rebuilding permaChunk %d\n", index);
|
||||
|
||||
permaChunk[index].rebuild();
|
||||
permaChunk[index].rebuild();
|
||||
|
||||
if(index !=0)
|
||||
if(index !=0)
|
||||
s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete
|
||||
|
||||
// __int64 endTime = System::currentTimeMillis();
|
||||
// int64_t endTime = System::currentTimeMillis();
|
||||
// totalTime += (endTime - startTime);
|
||||
// countTime++;
|
||||
// printf("%d : %f\n", countTime, (float)totalTime / (float)countTime);
|
||||
|
|
@ -2111,11 +2111,11 @@ bool LevelRenderer::updateDirtyChunks()
|
|||
static Chunk permaChunk;
|
||||
permaChunk.makeCopyForRebuild(chunk);
|
||||
LeaveCriticalSection(&m_csDirtyChunks);
|
||||
// static __int64 totalTime = 0;
|
||||
// static __int64 countTime = 0;
|
||||
// __int64 startTime = System::currentTimeMillis();
|
||||
// static int64_t totalTime = 0;
|
||||
// static int64_t countTime = 0;
|
||||
// int64_t startTime = System::currentTimeMillis();
|
||||
permaChunk.rebuild();
|
||||
// __int64 endTime = System::currentTimeMillis();
|
||||
// int64_t endTime = System::currentTimeMillis();
|
||||
// totalTime += (endTime - startTime);
|
||||
// countTime++;
|
||||
// printf("%d : %f\n", countTime, (float)totalTime / (float)countTime);
|
||||
|
|
@ -2315,7 +2315,7 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev
|
|||
{
|
||||
// 4J - level is passed if this is coming from setTilesDirty, which could come from when connection is being ticked outside of normal level tick, and player won't
|
||||
// be set up
|
||||
if( level == NULL ) level = this->level[mc->player->GetXboxPad()];
|
||||
if( level == NULL ) level = this->level[mc->player->GetXboxPad()];
|
||||
// EnterCriticalSection(&m_csDirtyChunks);
|
||||
int _x0 = Mth::intFloorDiv(x0, CHUNK_XZSIZE);
|
||||
int _y0 = Mth::intFloorDiv(y0, CHUNK_SIZE);
|
||||
|
|
@ -2346,10 +2346,10 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev
|
|||
|
||||
// AP - by the time we reach this function the area passed in has a 1 block border added to it to make sure geometry and lighting is updated correctly.
|
||||
// Some of those blocks will only need lighting updated so it is acceptable to not have those blocks grouped in the deferral system as the mismatch
|
||||
// will hardly be noticable. The blocks that need geometry updated will be adjacent to the original, non-bordered area.
|
||||
// will hardly be noticable. The blocks that need geometry updated will be adjacent to the original, non-bordered area.
|
||||
// This bit of code will mark a chunk as 'non-critical' if all of the blocks inside it are NOT adjacent to the original area. This has the greatest effect
|
||||
// when digging a single block. Only 6 of the blocks out of the possible 26 are actually adjacent to the original block. The other 20 only need lighting updated.
|
||||
// Note I have noticed a new side effect of this system where it's possible to see into the sides of water but this is acceptable compared to seeing through
|
||||
// Note I have noticed a new side effect of this system where it's possible to see into the sides of water but this is acceptable compared to seeing through
|
||||
// the entire landscape.
|
||||
// is the left or right most block just inside this chunk
|
||||
if( ((x0 & 15) == 15 && x == _x0) || ((x1 & 15) == 0 && x == _x1) )
|
||||
|
|
@ -2376,7 +2376,7 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev
|
|||
|
||||
dirtyChunksLockFreeStack.Push((int *)(index));
|
||||
#else
|
||||
dirtyChunksLockFreeStack.Push((int *)(index + 2));
|
||||
dirtyChunksLockFreeStack.Push((int *)(index + 2));
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
|
|
@ -2489,7 +2489,7 @@ void LevelRenderer::cull_SPU(int playerIndex, Culler *culler, float a)
|
|||
m_jobPort_CullSPU->submitSync();
|
||||
// static int doSort = false;
|
||||
// if(doSort)
|
||||
{
|
||||
{
|
||||
m_jobPort_CullSPU->submitJob(&sortJob);
|
||||
}
|
||||
// doSort ^= 1;
|
||||
|
|
@ -2591,7 +2591,7 @@ void LevelRenderer::playSound(shared_ptr<Entity> entity,int iSound, double x, do
|
|||
}
|
||||
|
||||
// 4J-PB - original function. I've changed to an enum instead of string compares
|
||||
// 4J removed -
|
||||
// 4J removed -
|
||||
/*
|
||||
void LevelRenderer::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za)
|
||||
{
|
||||
|
|
@ -2751,7 +2751,7 @@ shared_ptr<Particle> LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle
|
|||
float fStart=((float)(cStart&0xFF));
|
||||
float fDiff=(float)((cEnd-cStart)&0xFF);
|
||||
|
||||
float fCol = (fStart + (Math::random() * fDiff))/255.0f;
|
||||
float fCol = (fStart + (Math::random() * fDiff))/255.0f;
|
||||
particle->setColor( fCol, fCol, fCol );
|
||||
}
|
||||
}
|
||||
|
|
@ -2885,11 +2885,11 @@ void LevelRenderer::entityAdded(shared_ptr<Entity> entity)
|
|||
//if (entity->customTextureUrl2 != L"") textures->addHttpTexture(entity->customTextureUrl2, new MobSkinTextureProcessor());
|
||||
|
||||
// 4J-PB - adding these from global title storage
|
||||
if (entity->customTextureUrl != L"")
|
||||
if (entity->customTextureUrl != L"")
|
||||
{
|
||||
textures->addMemTexture(entity->customTextureUrl, new MobSkinMemTextureProcessor());
|
||||
}
|
||||
if (entity->customTextureUrl2 != L"")
|
||||
if (entity->customTextureUrl2 != L"")
|
||||
{
|
||||
textures->addMemTexture(entity->customTextureUrl2, new MobSkinMemTextureProcessor());
|
||||
}
|
||||
|
|
@ -2905,11 +2905,11 @@ void LevelRenderer::entityRemoved(shared_ptr<Entity> entity)
|
|||
if (entity->customTextureUrl != L"") textures->removeHttpTexture(entity->customTextureUrl);
|
||||
if (entity->customTextureUrl2 != L"") textures->removeHttpTexture(entity->customTextureUrl2);
|
||||
*/
|
||||
if (entity->customTextureUrl != L"")
|
||||
if (entity->customTextureUrl != L"")
|
||||
{
|
||||
textures->removeMemTexture(entity->customTextureUrl);
|
||||
}
|
||||
if (entity->customTextureUrl2 != L"")
|
||||
if (entity->customTextureUrl2 != L"")
|
||||
{
|
||||
textures->removeMemTexture(entity->customTextureUrl2);
|
||||
}
|
||||
|
|
@ -2944,7 +2944,7 @@ void LevelRenderer::levelEvent(shared_ptr<Player> source, int type, int x, int y
|
|||
{
|
||||
//case LevelEvent::SOUND_WITHER_BOSS_SPAWN:
|
||||
case LevelEvent::SOUND_DRAGON_DEATH:
|
||||
if (mc->cameraTargetPlayer != NULL)
|
||||
if (mc->cameraTargetPlayer != NULL)
|
||||
{
|
||||
// play the sound at an offset from the player
|
||||
double dx = x - mc->cameraTargetPlayer->x;
|
||||
|
|
@ -2956,7 +2956,7 @@ void LevelRenderer::levelEvent(shared_ptr<Player> source, int type, int x, int y
|
|||
double sy = mc->cameraTargetPlayer->y;
|
||||
double sz = mc->cameraTargetPlayer->z;
|
||||
|
||||
if (len > 0)
|
||||
if (len > 0)
|
||||
{
|
||||
sx += (dx / len) * 2;
|
||||
sy += (dy / len) * 2;
|
||||
|
|
@ -3185,7 +3185,7 @@ void LevelRenderer::destroyTileProgress(int id, int x, int y, int z, int progres
|
|||
if (progress < 0 || progress >= 10)
|
||||
{
|
||||
AUTO_VAR(it, destroyingBlocks.find(id));
|
||||
if(it != destroyingBlocks.end())
|
||||
if(it != destroyingBlocks.end())
|
||||
{
|
||||
delete it->second;
|
||||
destroyingBlocks.erase(it);
|
||||
|
|
@ -3373,7 +3373,7 @@ unsigned char LevelRenderer::incGlobalChunkRefCount(int x, int y, int z, Level *
|
|||
unsigned char refCount = (flags >> CHUNK_FLAG_REF_SHIFT ) & CHUNK_FLAG_REF_MASK;
|
||||
refCount++;
|
||||
flags &= ~(CHUNK_FLAG_REF_MASK<<CHUNK_FLAG_REF_SHIFT);
|
||||
flags |= refCount << CHUNK_FLAG_REF_SHIFT;
|
||||
flags |= refCount << CHUNK_FLAG_REF_SHIFT;
|
||||
globalChunkFlags[ index ] = flags;
|
||||
|
||||
return refCount;
|
||||
|
|
@ -3545,7 +3545,7 @@ void LevelRenderer::DestroyedTileManager::addAABBs( Level *level, AABB *box, AAB
|
|||
// without worrying about the lifespan of the copy we've passed out
|
||||
if( m_destroyedTiles[i]->boxes[j]->intersects( box ) )
|
||||
{
|
||||
boxes->push_back(AABB::newTemp( m_destroyedTiles[i]->boxes[j]->x0,
|
||||
boxes->push_back(AABB::newTemp( m_destroyedTiles[i]->boxes[j]->x0,
|
||||
m_destroyedTiles[i]->boxes[j]->y0,
|
||||
m_destroyedTiles[i]->boxes[j]->z0,
|
||||
m_destroyedTiles[i]->boxes[j]->x1,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ using namespace std;
|
|||
|
||||
// AP - this is a system that works out which chunks actually need to be grouped together via the deferral system when doing chunk::rebuild. Doing this will reduce the number
|
||||
// of chunks built in a single group and reduce the chance of seeing through the landscape when digging near the edges/corners of a chunk.
|
||||
// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have
|
||||
// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have
|
||||
// split screen reference counting.
|
||||
#ifdef __PSVITA__
|
||||
#define _CRITICAL_CHUNKS
|
||||
|
|
@ -203,7 +203,7 @@ public:
|
|||
// 4J - added for new render list handling
|
||||
// This defines the maximum size of renderable level, must be big enough to cope with actual size of level + view distance at each side
|
||||
// so that we can render the "infinite" sea at the edges
|
||||
static const int MAX_LEVEL_RENDER_SIZE[3];
|
||||
static const int MAX_LEVEL_RENDER_SIZE[3];
|
||||
static const int DIMENSION_OFFSETS[3];
|
||||
// This is the TOTAL area of columns of chunks to be allocated for render round the players. So for one player, it would be a region of
|
||||
// sqrt(PLAYER_RENDER_AREA) x sqrt(PLAYER_RENDER_AREA)
|
||||
|
|
@ -258,7 +258,7 @@ public:
|
|||
XLockFreeStack<int> dirtyChunksLockFreeStack;
|
||||
|
||||
bool dirtyChunkPresent;
|
||||
__int64 lastDirtyChunkFound;
|
||||
int64_t lastDirtyChunkFound;
|
||||
static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 250;
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
|
|
|||
|
|
@ -48,14 +48,14 @@ public:
|
|||
|
||||
void move(double xa, double ya, double za, bool noEntityCubes=false); // 4J - added noEntityCubes parameter
|
||||
|
||||
|
||||
|
||||
int m_iScreenSection; // assuming 4player splitscreen for now, or -1 for single player
|
||||
__uint64 ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft
|
||||
uint64_t ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft
|
||||
// player tick, and a button press and release combo can be missed in the minecraft::tick
|
||||
|
||||
__uint64 ullDpad_last;
|
||||
__uint64 ullDpad_this;
|
||||
__uint64 ullDpad_filtered;
|
||||
uint64_t ullDpad_last;
|
||||
uint64_t ullDpad_this;
|
||||
uint64_t ullDpad_filtered;
|
||||
|
||||
// 4J-PB - moved these in from the minecraft structure, since they are per player things for splitscreen
|
||||
//int ticks;
|
||||
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
private:
|
||||
float flyX, flyY, flyZ;
|
||||
|
||||
|
||||
protected:
|
||||
// 4J-PB - player's xbox pad
|
||||
int m_iPad;
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ void MinecartRenderer::render(shared_ptr<Entity> _cart, double x, double y, doub
|
|||
shared_ptr<Minecart> cart = dynamic_pointer_cast<Minecart>(_cart);
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
__int64 seed = cart->entityId * 493286711l;
|
||||
|
||||
int64_t seed = cart->entityId * 493286711l;
|
||||
seed = seed * seed * 4392167121l + seed * 98761;
|
||||
|
||||
float xo = ((((seed >> 16) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f;
|
||||
|
|
|
|||
|
|
@ -77,15 +77,15 @@
|
|||
//#define DEBUG_RENDER_SHOWS_PACKETS 1
|
||||
//#define SPLITSCREEN_TEST
|
||||
|
||||
// If not disabled, this creates an event queue on a seperate thread so that the Level::tick calls can be offloaded
|
||||
// If not disabled, this creates an event queue on a seperate thread so that the Level::tick calls can be offloaded
|
||||
// from the main thread, and have longer to run, since it's called at 20Hz instead of 60
|
||||
#define DISABLE_LEVELTICK_THREAD
|
||||
|
||||
Minecraft *Minecraft::m_instance = NULL;
|
||||
__int64 Minecraft::frameTimes[512];
|
||||
__int64 Minecraft::tickTimes[512];
|
||||
int64_t Minecraft::frameTimes[512];
|
||||
int64_t Minecraft::tickTimes[512];
|
||||
int Minecraft::frameTimePos = 0;
|
||||
__int64 Minecraft::warezTime = 0;
|
||||
int64_t Minecraft::warezTime = 0;
|
||||
File Minecraft::workDir = File(L"");
|
||||
|
||||
#ifdef __PSVITA__
|
||||
|
|
@ -94,7 +94,7 @@ TOUCHSCREENRECT QuickSelectRect[3]=
|
|||
{
|
||||
{ 560, 890, 1360, 980 },
|
||||
{ 450, 840, 1449, 960 },
|
||||
{ 320, 840, 1600, 970 },
|
||||
{ 320, 840, 1600, 970 },
|
||||
};
|
||||
|
||||
int QuickSelectBoxWidth[3]=
|
||||
|
|
@ -680,7 +680,7 @@ void Minecraft::run()
|
|||
return;
|
||||
}
|
||||
|
||||
__int64 lastTime = System::currentTimeMillis();
|
||||
int64_t lastTime = System::currentTimeMillis();
|
||||
int frames = 0;
|
||||
|
||||
while (running)
|
||||
|
|
@ -705,7 +705,7 @@ void Minecraft::run()
|
|||
timer->advanceTime();
|
||||
}
|
||||
|
||||
__int64 beforeTickTime = System::nanoTime();
|
||||
int64_t beforeTickTime = System::nanoTime();
|
||||
for (int i = 0; i < timer->ticks; i++)
|
||||
{
|
||||
ticks++;
|
||||
|
|
@ -717,7 +717,7 @@ void Minecraft::run()
|
|||
// setScreen(new LevelConflictScreen());
|
||||
// }
|
||||
}
|
||||
__int64 tickDuraction = System::nanoTime() - beforeTickTime;
|
||||
int64_t tickDuraction = System::nanoTime() - beforeTickTime;
|
||||
checkGlError(L"Pre render");
|
||||
|
||||
TileRenderer::fancy = options->fancyGraphics;
|
||||
|
|
@ -1272,7 +1272,7 @@ void Minecraft::applyFrameMouseLook()
|
|||
|
||||
void Minecraft::run_middle()
|
||||
{
|
||||
static __int64 lastTime = 0;
|
||||
static int64_t lastTime = 0;
|
||||
static bool bFirstTimeIntoGame = true;
|
||||
static bool bAutosaveTimerSet=false;
|
||||
static unsigned int uiAutosaveTimer=0;
|
||||
|
|
@ -1332,7 +1332,7 @@ void Minecraft::run_middle()
|
|||
if( pDLCPack )
|
||||
{
|
||||
if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
|
||||
{
|
||||
{
|
||||
bTrialTexturepack=true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1454,7 +1454,7 @@ void Minecraft::run_middle()
|
|||
{
|
||||
delete m_pPsPlusUpsell;
|
||||
m_pPsPlusUpsell = NULL;
|
||||
|
||||
|
||||
if ( ProfileManager.HasPlayStationPlus(i) )
|
||||
{
|
||||
app.DebugPrintf("<Minecraft.cpp> Player_%i is now authorised for PsPlus.\n", i);
|
||||
|
|
@ -1796,7 +1796,7 @@ void Minecraft::run_middle()
|
|||
timer->advanceTime();
|
||||
}
|
||||
|
||||
//__int64 beforeTickTime = System::nanoTime();
|
||||
//int64_t beforeTickTime = System::nanoTime();
|
||||
for (int i = 0; i < timer->ticks; i++)
|
||||
{
|
||||
bool bLastTimerTick = ( i == ( timer->ticks - 1 ) );
|
||||
|
|
@ -1882,7 +1882,7 @@ void Minecraft::run_middle()
|
|||
// CompressedTileStorage::tick(); // 4J added
|
||||
// SparseDataStorage::tick(); // 4J added
|
||||
}
|
||||
//__int64 tickDuraction = System::nanoTime() - beforeTickTime;
|
||||
//int64_t tickDuraction = System::nanoTime() - beforeTickTime;
|
||||
MemSect(31);
|
||||
checkGlError(L"Pre render");
|
||||
MemSect(0);
|
||||
|
|
@ -2084,14 +2084,14 @@ void Minecraft::emergencySave()
|
|||
setLevel(NULL);
|
||||
}
|
||||
|
||||
void Minecraft::renderFpsMeter(__int64 tickTime)
|
||||
void Minecraft::renderFpsMeter(int64_t tickTime)
|
||||
{
|
||||
int nsPer60Fps = 1000000000l / 60;
|
||||
if (lastTimer == -1)
|
||||
{
|
||||
lastTimer = System::nanoTime();
|
||||
}
|
||||
__int64 now = System::nanoTime();
|
||||
int64_t now = System::nanoTime();
|
||||
Minecraft::tickTimes[(Minecraft::frameTimePos) & (Minecraft::frameTimes_length - 1)] = tickTime;
|
||||
Minecraft::frameTimes[(Minecraft::frameTimePos++) & (Minecraft::frameTimes_length - 1)] = now - lastTimer;
|
||||
lastTimer = now;
|
||||
|
|
@ -2123,7 +2123,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime)
|
|||
t->vertex((float)(Minecraft::frameTimes_length), (float)( height - hh1 * 2), (float)( 0));
|
||||
|
||||
t->end();
|
||||
__int64 totalTime = 0;
|
||||
int64_t totalTime = 0;
|
||||
for (int i = 0; i < Minecraft::frameTimes_length; i++)
|
||||
{
|
||||
totalTime += Minecraft::frameTimes[i];
|
||||
|
|
@ -2153,8 +2153,8 @@ void Minecraft::renderFpsMeter(__int64 tickTime)
|
|||
t->color(0xff000000 + cc * 256);
|
||||
}
|
||||
|
||||
__int64 time = Minecraft::frameTimes[i] / 200000;
|
||||
__int64 time2 = Minecraft::tickTimes[i] / 200000;
|
||||
int64_t time = Minecraft::frameTimes[i] / 200000;
|
||||
int64_t time2 = Minecraft::tickTimes[i] / 200000;
|
||||
|
||||
t->vertex((float)(i + 0.5f), (float)( height - time + 0.5f), (float)( 0));
|
||||
t->vertex((float)(i + 0.5f), (float)( height + 0.5f), (float)( 0));
|
||||
|
|
@ -2234,7 +2234,7 @@ void Minecraft::levelTickThreadInitFunc()
|
|||
{
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
}
|
||||
|
||||
|
|
@ -2863,7 +2863,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
*piUse=IDS_TOOLTIPS_MILK;
|
||||
break;
|
||||
case Item::shears_Id:
|
||||
{
|
||||
{
|
||||
if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT;
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
if(!animal->isBaby()) *piUse=IDS_TOOLTIPS_SHEAR;
|
||||
|
|
@ -3136,7 +3136,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
}
|
||||
|
||||
if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT;
|
||||
|
||||
|
||||
if(ocelot->isTame())
|
||||
{
|
||||
// 4J-PB - if you have a raw fish in your hand, you will feed the ocelot rather than have it sit/follow
|
||||
|
|
@ -3153,7 +3153,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
}
|
||||
else
|
||||
{
|
||||
*piUse=IDS_TOOLTIPS_FEED;
|
||||
*piUse=IDS_TOOLTIPS_FEED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3182,9 +3182,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case eTYPE_PLAYER:
|
||||
{
|
||||
// Fix for #58576 - TU6: Content: Gameplay: Hit button prompt is available when attacking a host who has "Invisible" option turned on
|
||||
|
|
@ -3230,7 +3230,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
}
|
||||
*piAction=IDS_TOOLTIPS_HIT;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case eTYPE_ZOMBIE:
|
||||
{
|
||||
shared_ptr<Zombie> zomb = dynamic_pointer_cast<Zombie>(hitResult->entity);
|
||||
|
|
@ -3483,7 +3483,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
player->abilities.debugflying = !player->abilities.debugflying;
|
||||
player->abilities.flying = !player->abilities.flying;
|
||||
}
|
||||
#endif // PSVITA
|
||||
#endif // PSVITA
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3551,8 +3551,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
player->drop();
|
||||
}
|
||||
|
||||
__uint64 ullButtonsPressed=player->ullButtonsPressed;
|
||||
|
||||
uint64_t ullButtonsPressed=player->ullButtonsPressed;
|
||||
|
||||
bool selected = false;
|
||||
#ifdef __PSVITA__
|
||||
// 4J-PB - use the touchscreen for quickselect
|
||||
|
|
@ -3576,7 +3576,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
shared_ptr<ItemInstance> selectedItem = player->getSelectedItem();
|
||||
// Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item
|
||||
int iCount=0;
|
||||
|
||||
|
||||
if(selectedItem != NULL) iCount=selectedItem->GetCount();
|
||||
if(selectedItem != NULL && !( (player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) && selectedItem->GetCount() == 1))
|
||||
{
|
||||
|
|
@ -3885,7 +3885,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
}
|
||||
#ifdef __PS3__
|
||||
|
||||
// while(!g_tickLevelQueue.empty())
|
||||
// while(!g_tickLevelQueue.empty())
|
||||
// {
|
||||
// Level* pLevel = g_tickLevelQueue.front();
|
||||
// g_tickLevelQueue.pop();
|
||||
|
|
@ -4113,7 +4113,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt
|
|||
|
||||
player->resetPos();
|
||||
gameMode->initPlayer(player);
|
||||
|
||||
|
||||
player->SetXboxPad(iPrimaryPlayer);
|
||||
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
|
|
@ -4542,7 +4542,7 @@ void Minecraft::main()
|
|||
// 4J-PB - Can't call this for the first 5 seconds of a game - MS rule
|
||||
//if (ProfileManager.IsFullVersion())
|
||||
{
|
||||
name = L"Player" + _toString<__int64>(System::currentTimeMillis() % 1000);
|
||||
name = L"Player" + _toString<int64_t>(System::currentTimeMillis() % 1000);
|
||||
sessionId = L"-";
|
||||
/* 4J - TODO - get a session ID from somewhere?
|
||||
if (args.length > 0) name = args[0];
|
||||
|
|
@ -4647,7 +4647,7 @@ void Minecraft::delayTextureReload()
|
|||
reloadTextures = true;
|
||||
}
|
||||
|
||||
__int64 Minecraft::currentTimeMillis()
|
||||
int64_t Minecraft::currentTimeMillis()
|
||||
{
|
||||
return System::currentTimeMillis();//(Sys.getTime() * 1000) / Sys.getTimerResolution();
|
||||
}
|
||||
|
|
@ -5018,8 +5018,8 @@ int Minecraft::MustSignInReturnedPSN(void *pParam, int iPad, C4JStorage::EMessag
|
|||
{
|
||||
Minecraft* pMinecraft = (Minecraft *)pParam;
|
||||
|
||||
if(result == C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
if(result == C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&Minecraft::InGame_SignInReturned, pMinecraft, false, iPad);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ private:
|
|||
bool hasCrashed;
|
||||
|
||||
C4JThread::EventQueue* levelTickEventQueue;
|
||||
|
||||
|
||||
static void levelTickUpdateFunc(void* pParam);
|
||||
static void levelTickThreadInitFunc();
|
||||
|
||||
|
|
@ -165,11 +165,11 @@ private:
|
|||
LevelStorageSource *levelSource;
|
||||
public:
|
||||
static const int frameTimes_length = 512;
|
||||
static __int64 frameTimes[frameTimes_length];
|
||||
static int64_t frameTimes[frameTimes_length];
|
||||
static const int tickTimes_length = 512;
|
||||
static __int64 tickTimes[tickTimes_length];
|
||||
static int64_t tickTimes[tickTimes_length];
|
||||
static int frameTimePos;
|
||||
static __int64 warezTime;
|
||||
static int64_t warezTime;
|
||||
private:
|
||||
int rightClickDelay;
|
||||
public:
|
||||
|
|
@ -230,9 +230,9 @@ private:
|
|||
// String grabHugeScreenshot(File workDir2, int width, int height, int ssWidth, int ssHeight); // 4J - removed
|
||||
|
||||
// 4J - per player thing?
|
||||
__int64 lastTimer;
|
||||
int64_t lastTimer;
|
||||
|
||||
void renderFpsMeter(__int64 tickTime);
|
||||
void renderFpsMeter(int64_t tickTime);
|
||||
public:
|
||||
void stop();
|
||||
// 4J removed
|
||||
|
|
@ -253,7 +253,7 @@ public:
|
|||
//bool isRaining ;
|
||||
|
||||
// 4J - Moved to per player
|
||||
//__int64 lastTickTime;
|
||||
//int64_t lastTickTime;
|
||||
|
||||
private:
|
||||
// 4J- per player?
|
||||
|
|
@ -301,7 +301,7 @@ public:
|
|||
|
||||
static int maxSupportedTextureSize();
|
||||
void delayTextureReload();
|
||||
static __int64 currentTimeMillis();
|
||||
static int64_t currentTimeMillis();
|
||||
|
||||
#ifdef _DURANGO
|
||||
static void inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad);
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@
|
|||
//4J Added
|
||||
MinecraftServer *MinecraftServer::server = NULL;
|
||||
bool MinecraftServer::setTimeAtEndOfTick = false;
|
||||
__int64 MinecraftServer::setTime = 0;
|
||||
int64_t MinecraftServer::setTime = 0;
|
||||
bool MinecraftServer::setTimeOfDayAtEndOfTick = false;
|
||||
__int64 MinecraftServer::setTimeOfDay = 0;
|
||||
int64_t MinecraftServer::setTimeOfDay = 0;
|
||||
bool MinecraftServer::m_bPrimaryPlayerSignedOut=false;
|
||||
bool MinecraftServer::s_bServerHalted=false;
|
||||
bool MinecraftServer::s_bSaveOnExitAnswered=false;
|
||||
|
|
@ -99,7 +99,7 @@ MinecraftServer::~MinecraftServer()
|
|||
{
|
||||
}
|
||||
|
||||
bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed)
|
||||
bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed)
|
||||
{
|
||||
// 4J - removed
|
||||
#if 0
|
||||
|
|
@ -149,7 +149,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
//localIp = settings->getString(L"server-ip", L"");
|
||||
//onlineMode = settings->getBoolean(L"online-mode", true);
|
||||
//motd = settings->getString(L"motd", L"A Minecraft Server");
|
||||
//motd.replace('§', '$');
|
||||
//motd.replace('<EFBFBD>', '$');
|
||||
|
||||
setAnimals(settings->getBoolean(L"spawn-animals", true));
|
||||
setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true));
|
||||
|
|
@ -201,7 +201,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
// TODO: Stop loading, add error message.
|
||||
}
|
||||
|
||||
__int64 levelNanoTime = System::nanoTime();
|
||||
int64_t levelNanoTime = System::nanoTime();
|
||||
|
||||
wstring levelName = settings->getString(L"level-name", L"world");
|
||||
wstring levelTypeString;
|
||||
|
|
@ -221,7 +221,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
}
|
||||
|
||||
LevelType *pLevelType = LevelType::getLevelType(levelTypeString);
|
||||
if (pLevelType == NULL)
|
||||
if (pLevelType == NULL)
|
||||
{
|
||||
pLevelType = LevelType::lvl_normal;
|
||||
}
|
||||
|
|
@ -245,10 +245,10 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
|
||||
#if 0
|
||||
wstring levelSeedString = settings->getString(L"level-seed", L"");
|
||||
__int64 levelSeed = (new Random())->nextLong();
|
||||
int64_t levelSeed = (new Random())->nextLong();
|
||||
if (levelSeedString.length() > 0)
|
||||
{
|
||||
long newSeed = _fromString<__int64>(levelSeedString);
|
||||
long newSeed = _fromString<int64_t>(levelSeedString);
|
||||
if (newSeed != 0) {
|
||||
levelSeed = newSeed;
|
||||
}
|
||||
|
|
@ -280,7 +280,7 @@ int MinecraftServer::runPostUpdate(void* lpParam)
|
|||
Entity::useSmallIds(); // This thread can end up spawning entities as resources
|
||||
IntCache::CreateNewThreadStorage();
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
Level::enableLightingCache();
|
||||
Tile::CreateNewThreadStorage();
|
||||
|
|
@ -375,7 +375,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress)
|
|||
DeleteCriticalSection(&m_postProcessCS);
|
||||
}
|
||||
|
||||
bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData)
|
||||
bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData)
|
||||
{
|
||||
// 4J - TODO - do with new save stuff
|
||||
// if (storageSource->requiresConversion(name))
|
||||
|
|
@ -401,10 +401,10 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
{
|
||||
// We are loading a file from disk with the data passed in
|
||||
|
||||
#ifdef SPLIT_SAVES
|
||||
#ifdef SPLIT_SAVES
|
||||
ConsoleSaveFileOriginal oldFormatSave( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform );
|
||||
ConsoleSaveFile* pSave = new ConsoleSaveFileSplit( &oldFormatSave );
|
||||
|
||||
|
||||
//ConsoleSaveFile* pSave = new ConsoleSaveFileSplit( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform );
|
||||
#else
|
||||
ConsoleSaveFile* pSave = new ConsoleSaveFileOriginal( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform );
|
||||
|
|
@ -445,7 +445,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
}
|
||||
|
||||
// McRegionLevelStorage *storage = new McRegionLevelStorage(new ConsoleSaveFile( L"" ), L"", L"", 0); // original
|
||||
// McRegionLevelStorage *storage = new McRegionLevelStorage(File(L"."), name, true); // TODO
|
||||
// McRegionLevelStorage *storage = new McRegionLevelStorage(File(L"."), name, true); // TODO
|
||||
for (unsigned int i = 0; i < levels.length; i++)
|
||||
{
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() )
|
||||
|
|
@ -518,13 +518,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
m_postUpdateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL);
|
||||
m_postUpdateThread->Run();
|
||||
|
||||
__int64 startTime = System::currentTimeMillis();
|
||||
int64_t startTime = System::currentTimeMillis();
|
||||
|
||||
// 4J Stu - Added this to temporarily make starting games on vita faster
|
||||
#ifdef __PSVITA__
|
||||
int r = 48;
|
||||
#else
|
||||
int r = 196;
|
||||
int r = 196;
|
||||
#endif
|
||||
|
||||
// 4J JEV: load gameRules.
|
||||
|
|
@ -548,7 +548,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
csf->closeHandle(fe);
|
||||
}
|
||||
|
||||
__int64 lastTime = System::currentTimeMillis();
|
||||
int64_t lastTime = System::currentTimeMillis();
|
||||
|
||||
// 4J Stu - This loop is changed in 1.0.1 to only process the first level (ie the overworld), but I think we still want to do them all
|
||||
int i = 0;
|
||||
|
|
@ -564,7 +564,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
}
|
||||
|
||||
#if 0
|
||||
__int64 lastStorageTickTime = System::currentTimeMillis();
|
||||
int64_t lastStorageTickTime = System::currentTimeMillis();
|
||||
|
||||
// Test code to enable full creation of levels at start up
|
||||
int halfsidelen = ( i == 0 ) ? 27 : 9;
|
||||
|
|
@ -587,7 +587,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
}
|
||||
}
|
||||
#else
|
||||
__int64 lastStorageTickTime = System::currentTimeMillis();
|
||||
int64_t lastStorageTickTime = System::currentTimeMillis();
|
||||
Pos *spawnPos = level->getSharedSpawnPos();
|
||||
|
||||
int twoRPlusOne = r*2 + 1;
|
||||
|
|
@ -604,7 +604,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
return false;
|
||||
}
|
||||
// printf(">>>%d %d %d\n",i,x,z);
|
||||
// __int64 now = System::currentTimeMillis();
|
||||
// int64_t now = System::currentTimeMillis();
|
||||
// if (now < lastTime) lastTime = now;
|
||||
// if (now > lastTime + 1000)
|
||||
{
|
||||
|
|
@ -663,7 +663,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
|
||||
if(!levels[0]->getLevelData()->getHasStronghold())
|
||||
{
|
||||
int x,z;
|
||||
int x,z;
|
||||
if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z))
|
||||
{
|
||||
levels[0]->getLevelData()->setXStronghold(x);
|
||||
|
|
@ -691,7 +691,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
// printf("Lighting complete at %dms\n",System::currentTimeMillis() - startTime);
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
|
||||
if( levels[1]->isNew )
|
||||
{
|
||||
levels[1]->save(true, mcprogress);
|
||||
|
|
@ -710,7 +710,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
// 4J Stu - We also want to immediately save the tutorial
|
||||
if ( levels[0]->isNew )
|
||||
saveGameRules();
|
||||
|
||||
|
||||
if( levels[0]->isNew )
|
||||
{
|
||||
levels[0]->save(true, mcprogress);
|
||||
|
|
@ -819,7 +819,7 @@ void MinecraftServer::Suspend()
|
|||
// Save the start time
|
||||
QueryPerformanceCounter( &qwTime );
|
||||
if(m_bLoaded && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled()))
|
||||
{
|
||||
{
|
||||
if (players != NULL)
|
||||
{
|
||||
players->saveAll(NULL);
|
||||
|
|
@ -879,7 +879,7 @@ void MinecraftServer::stopServer()
|
|||
app.DebugPrintf("Stopping server\n");
|
||||
// logger.info("Stopping server");
|
||||
// 4J-PB - If the primary player has signed out, then don't attempt to save anything
|
||||
|
||||
|
||||
// also need to check for a profile switch here - primary player signs out, and another player signs in before dismissing the dash
|
||||
#ifdef _DURANGO
|
||||
// On Durango check if the primary user is signed in OR mid-sign-out
|
||||
|
|
@ -894,7 +894,7 @@ void MinecraftServer::stopServer()
|
|||
#endif
|
||||
// if trial version or saving is disabled, then don't save anything
|
||||
if(m_saveOnExit && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled()))
|
||||
{
|
||||
{
|
||||
if (players != NULL)
|
||||
{
|
||||
players->saveAll(Minecraft::GetInstance()->progressRenderer, true);
|
||||
|
|
@ -1044,7 +1044,7 @@ CommandDispatcher *MinecraftServer::getCommandDispatcher()
|
|||
}
|
||||
|
||||
extern int c0a, c0b, c1a, c1b, c1c, c2a, c2b;
|
||||
void MinecraftServer::run(__int64 seed, void *lpParameter)
|
||||
void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||
{
|
||||
NetworkGameInitData *initData = NULL;
|
||||
DWORD initSettings = 0;
|
||||
|
|
@ -1066,7 +1066,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
|
||||
if(pLevelData && pLevelData->getHasStronghold()==false)
|
||||
{
|
||||
int x,z;
|
||||
int x,z;
|
||||
if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z))
|
||||
{
|
||||
pLevelData->setXStronghold(x);
|
||||
|
|
@ -1075,18 +1075,18 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
}
|
||||
}
|
||||
|
||||
__int64 lastTime = System::currentTimeMillis();
|
||||
__int64 unprocessedTime = 0;
|
||||
int64_t lastTime = System::currentTimeMillis();
|
||||
int64_t unprocessedTime = 0;
|
||||
while (running && !s_bServerHalted)
|
||||
{
|
||||
__int64 now = System::currentTimeMillis();
|
||||
int64_t now = System::currentTimeMillis();
|
||||
|
||||
// 4J Stu - When we pause the server, we don't want to count that as time passed
|
||||
// 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused
|
||||
//Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost
|
||||
//if(m_isServerPaused) lastTime = now;
|
||||
|
||||
__int64 passedTime = now - lastTime;
|
||||
int64_t passedTime = now - lastTime;
|
||||
if (passedTime > MS_PER_TICK * 40)
|
||||
{
|
||||
// logger.warning("Can't keep up! Did the system time change, or is the server overloaded?");
|
||||
|
|
@ -1112,13 +1112,13 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
else
|
||||
{
|
||||
// int tickcount = 0;
|
||||
// __int64 beforeall = System::currentTimeMillis();
|
||||
// int64_t beforeall = System::currentTimeMillis();
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
// __int64 before = System::currentTimeMillis();
|
||||
// int64_t before = System::currentTimeMillis();
|
||||
tick();
|
||||
// __int64 after = System::currentTimeMillis();
|
||||
// int64_t after = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time",(float)(after-before));
|
||||
|
||||
// 4J Ensure that the slow queue owner keeps cycling if it's not been used in a while
|
||||
|
|
@ -1135,7 +1135,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
// app.DebugPrintf("Not considering cycling: %d - %d -> %d > %d\n",time, s_slowQueueLastTime, (time - s_slowQueueLastTime), (2*MINECRAFT_SERVER_SLOW_QUEUE_DELAY));
|
||||
// }
|
||||
}
|
||||
// __int64 afterall = System::currentTimeMillis();
|
||||
// int64_t afterall = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time all",(float)(afterall-beforeall));
|
||||
// PIXReportCounter(L"Server ticks",(float)tickcount);
|
||||
}
|
||||
|
|
@ -1179,7 +1179,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
}
|
||||
}
|
||||
|
||||
// Process delayed actions
|
||||
// Process delayed actions
|
||||
eXuiServerAction eAction;
|
||||
LPVOID param;
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
|
|
@ -1244,7 +1244,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
{
|
||||
players->saveAll(Minecraft::GetInstance()->progressRenderer);
|
||||
}
|
||||
|
||||
|
||||
players->broadcastAll( shared_ptr<UpdateProgressPacket>( new UpdateProgressPacket(20) ) );
|
||||
|
||||
for (unsigned int j = 0; j < levels.length; j++)
|
||||
|
|
@ -1255,14 +1255,14 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
// Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting.
|
||||
ServerLevel *level = levels[levels.length - 1 - j];
|
||||
level->save(true, Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame));
|
||||
|
||||
|
||||
players->broadcastAll( shared_ptr<UpdateProgressPacket>( new UpdateProgressPacket(33 + (j*33) ) ) );
|
||||
}
|
||||
if( !s_bServerHalted )
|
||||
{
|
||||
saveGameRules();
|
||||
|
||||
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame));
|
||||
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame));
|
||||
}
|
||||
app.LeaveSaveNotificationSection();
|
||||
break;
|
||||
|
|
@ -1287,19 +1287,19 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
case eXuiServerAction_PauseServer:
|
||||
m_isServerPaused = ( (size_t) param == TRUE );
|
||||
if( m_isServerPaused )
|
||||
{
|
||||
{
|
||||
m_serverPausedEvent->Set();
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleRain:
|
||||
{
|
||||
{
|
||||
bool isRaining = levels[0]->getLevelData()->isRaining();
|
||||
levels[0]->getLevelData()->setRaining(!isRaining);
|
||||
levels[0]->getLevelData()->setRainTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleThunder:
|
||||
{
|
||||
{
|
||||
bool isThundering = levels[0]->getLevelData()->isThundering();
|
||||
levels[0]->getLevelData()->setThundering(!isThundering);
|
||||
levels[0]->getLevelData()->setThunderTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
|
|
@ -1318,7 +1318,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
case eXuiServerAction_ExportSchematic:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.EnterSaveNotificationSection();
|
||||
|
||||
|
||||
//players->broadcastAll( shared_ptr<UpdateProgressPacket>( new UpdateProgressPacket(20) ) );
|
||||
|
||||
if( !s_bServerHalted )
|
||||
|
|
@ -1337,7 +1337,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
File dataFile = File( targetFileDir, wstring(filename) );
|
||||
if(dataFile.exists()) dataFile._delete();
|
||||
FileOutputStream fos = FileOutputStream(dataFile);
|
||||
DataOutputStream dos = DataOutputStream(&fos);
|
||||
DataOutputStream dos = DataOutputStream(&fos);
|
||||
ConsoleSchematicFile::generateSchematicFile(&dos, levels[0], initData->startX, initData->startY, initData->startZ, initData->endX, initData->endY, initData->endZ, initData->bSaveMobs, initData->compressionType);
|
||||
dos.close();
|
||||
|
||||
|
|
@ -1354,7 +1354,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
app.DebugPrintf( "DEBUG: Player=%i\n", pos->player );
|
||||
app.DebugPrintf( "DEBUG: Teleporting to pos=(%f.2, %f.2, %f.2), looking at=(%f.2,%f.2)\n",
|
||||
pos->m_camX, pos->m_camY, pos->m_camZ,
|
||||
pos->m_yRot, pos->m_elev
|
||||
pos->m_yRot, pos->m_elev
|
||||
);
|
||||
|
||||
shared_ptr<ServerPlayer> player = players->players.at(pos->player);
|
||||
|
|
@ -1368,7 +1368,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
app.SetXuiServerAction(i,eXuiServerAction_Idle);
|
||||
}
|
||||
|
||||
|
|
@ -1447,7 +1447,7 @@ void MinecraftServer::tick()
|
|||
|
||||
AABB::resetPool();
|
||||
Vec3::resetPool();
|
||||
|
||||
|
||||
tickCount++;
|
||||
|
||||
// 4J We need to update client difficulty levels based on the servers
|
||||
|
|
@ -1479,11 +1479,11 @@ void MinecraftServer::tick()
|
|||
players->broadcastAll( shared_ptr<SetTimePacket>( new SetTimePacket(level->getTime() ) ), level->dimension->id);
|
||||
}
|
||||
// #ifndef __PS3__
|
||||
static __int64 stc = 0;
|
||||
__int64 st0 = System::currentTimeMillis();
|
||||
static int64_t stc = 0;
|
||||
int64_t st0 = System::currentTimeMillis();
|
||||
PIXBeginNamedEvent(0,"Level tick %d",i);
|
||||
((Level *)level)->tick();
|
||||
__int64 st1 = System::currentTimeMillis();
|
||||
int64_t st1 = System::currentTimeMillis();
|
||||
PIXEndNamedEvent();
|
||||
PIXBeginNamedEvent(0,"Update lights %d",i);
|
||||
// 4J - used to be in a while loop, but we don't want the server locking up for a big chunk of time (could end up trying to process 1,000,000 lights...)
|
||||
|
|
@ -1491,7 +1491,7 @@ void MinecraftServer::tick()
|
|||
// printf("lights: %d\n",level->getLightsToUpdate());
|
||||
while(level->updateLights() )
|
||||
;
|
||||
__int64 st2 = System::currentTimeMillis();
|
||||
int64_t st2 = System::currentTimeMillis();
|
||||
PIXEndNamedEvent();
|
||||
PIXBeginNamedEvent(0,"Entity tick %d",i);
|
||||
// 4J added to stop ticking entities in levels when players are not in those levels.
|
||||
|
|
@ -1519,7 +1519,7 @@ void MinecraftServer::tick()
|
|||
level->getTracker()->tick();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
__int64 st3 = System::currentTimeMillis();
|
||||
int64_t st3 = System::currentTimeMillis();
|
||||
// printf(">>>>>>>>>>>>>>>>>>>>>> Tick %d %d %d : %d\n", st1 - st0, st2 - st1, st3 - st2, st0 - stc );
|
||||
stc = st0;
|
||||
// #endif// __PS3__
|
||||
|
|
@ -1564,7 +1564,7 @@ void MinecraftServer::handleConsoleInputs()
|
|||
}
|
||||
}
|
||||
|
||||
void MinecraftServer::main(__int64 seed, void *lpParameter)
|
||||
void MinecraftServer::main(int64_t seed, void *lpParameter)
|
||||
{
|
||||
#if __PS3__
|
||||
ShutdownManager::HasStarted(ShutdownManager::eServerThread );
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ class CommandDispatcher;
|
|||
typedef struct _LoadSaveDataThreadParam
|
||||
{
|
||||
LPVOID data;
|
||||
__int64 fileSize;
|
||||
int64_t fileSize;
|
||||
const wstring saveName;
|
||||
_LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {}
|
||||
_LoadSaveDataThreadParam(LPVOID data, int64_t filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {}
|
||||
} LoadSaveDataThreadParam;
|
||||
|
||||
typedef struct _NetworkGameInitData
|
||||
{
|
||||
__int64 seed;
|
||||
int64_t seed;
|
||||
LoadSaveDataThreadParam *saveData;
|
||||
DWORD settings;
|
||||
LevelGenerationOptions *levelGen;
|
||||
|
|
@ -125,9 +125,9 @@ public:
|
|||
~MinecraftServer();
|
||||
private:
|
||||
// 4J Added - LoadSaveDataThreadParam
|
||||
bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed);
|
||||
bool initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed);
|
||||
void postProcessTerminate(ProgressRenderer *mcprogress);
|
||||
bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData);
|
||||
bool loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData);
|
||||
void setProgress(const wstring& status, int progress);
|
||||
void endProgress();
|
||||
void saveAllChunks();
|
||||
|
|
@ -154,7 +154,7 @@ public:
|
|||
|
||||
public:
|
||||
void halt();
|
||||
void run(__int64 seed, void *lpParameter);
|
||||
void run(int64_t seed, void *lpParameter);
|
||||
|
||||
void broadcastStartSavingPacket();
|
||||
void broadcastStopSavingPacket();
|
||||
|
|
@ -165,7 +165,7 @@ public:
|
|||
void handleConsoleInput(const wstring& msg, ConsoleInputSource *source);
|
||||
void handleConsoleInputs();
|
||||
// void addTickable(Tickable tickable); // 4J removed
|
||||
static void main(__int64 seed, void *lpParameter);
|
||||
static void main(int64_t seed, void *lpParameter);
|
||||
static void HaltServer(bool bPrimaryPlayerSignedOut=false);
|
||||
|
||||
File *getFile(const wstring& name);
|
||||
|
|
@ -185,9 +185,9 @@ private:
|
|||
static MinecraftServer *server;
|
||||
|
||||
static bool setTimeOfDayAtEndOfTick;
|
||||
static __int64 setTimeOfDay;
|
||||
static int64_t setTimeOfDay;
|
||||
static bool setTimeAtEndOfTick;
|
||||
static __int64 setTime;
|
||||
static int64_t setTime;
|
||||
|
||||
static bool m_bPrimaryPlayerSignedOut; // 4J-PB added to tell the stopserver not to save the game - another player may have signed in in their place, so ProfileManager.IsSignedIn isn't enough
|
||||
static bool s_bServerHalted; // 4J Stu Added so that we can halt the server even before it's been created properly
|
||||
|
|
@ -211,9 +211,9 @@ public:
|
|||
|
||||
public:
|
||||
static PlayerList *getPlayerList() { if( server != NULL ) return server->players; else return NULL; }
|
||||
static void SetTimeOfDay(__int64 time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; }
|
||||
static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; }
|
||||
|
||||
static void SetTimeOfDay(int64_t time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; }
|
||||
static void SetTime(int64_t time) { setTimeAtEndOfTick = true; setTime = time; }
|
||||
|
||||
C4JThread::Event* m_serverPausedEvent;
|
||||
private:
|
||||
// 4J Added
|
||||
|
|
@ -241,5 +241,5 @@ public:
|
|||
void Suspend();
|
||||
bool IsSuspending();
|
||||
|
||||
// 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them
|
||||
// 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them
|
||||
};
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed int64_t
|
||||
#define RAD_UINTa __w64 uint64_t
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed long long
|
||||
#define RAD_UINTa __w64 unsigned long long
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ int (* SQRNetworkManager_Orbis::s_SignInCompleteCallbackFn)(void *pParam, bool b
|
|||
void * SQRNetworkManager_Orbis::s_SignInCompleteParam = NULL;
|
||||
sce::Toolkit::NP::PresenceDetails SQRNetworkManager_Orbis::s_lastPresenceInfo;
|
||||
|
||||
__int64 SQRNetworkManager_Orbis::s_lastPresenceTime = 0;
|
||||
__int64 SQRNetworkManager_Orbis::s_resendPresenceTime = 0;
|
||||
int64_t SQRNetworkManager_Orbis::s_lastPresenceTime = 0;
|
||||
int64_t SQRNetworkManager_Orbis::s_resendPresenceTime = 0;
|
||||
|
||||
bool SQRNetworkManager_Orbis::s_presenceStatusDirty = false;
|
||||
bool SQRNetworkManager_Orbis::s_presenceDataDirty = false;
|
||||
|
|
@ -51,7 +51,7 @@ int g_numRUDPContextsBound = 0;
|
|||
//unsigned int SQRNetworkManager_Orbis::RoomSyncData::playerCount = 0;
|
||||
|
||||
// This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type
|
||||
const SQRNetworkManager_Orbis::eSQRNetworkManagerState SQRNetworkManager_Orbis::m_INTtoEXTStateMappings[SQRNetworkManager_Orbis::SNM_INT_STATE_COUNT] =
|
||||
const SQRNetworkManager_Orbis::eSQRNetworkManagerState SQRNetworkManager_Orbis::m_INTtoEXTStateMappings[SQRNetworkManager_Orbis::SNM_INT_STATE_COUNT] =
|
||||
{
|
||||
SNM_STATE_INITIALISING, // SNM_INT_STATE_UNINITIALISED
|
||||
SNM_STATE_INITIALISING, // SNM_INT_STATE_SIGNING_IN
|
||||
|
|
@ -143,7 +143,7 @@ void SQRNetworkManager_Orbis::Initialise()
|
|||
|
||||
assert( m_state == SNM_INT_STATE_UNINITIALISED );
|
||||
|
||||
|
||||
|
||||
//Initialize libnetctl
|
||||
ret = sceNetCtlInit();
|
||||
if( ( ret < 0 /*&& ret != CELL_NET_CTL_ERROR_NOT_TERMINATED*/ ) || ForceErrorPoint( SNM_FORCE_ERROR_NET_CTL_INIT ) )
|
||||
|
|
@ -172,14 +172,14 @@ void SQRNetworkManager_Orbis::Initialise()
|
|||
|
||||
SonyHttp::init();
|
||||
ret = sceNpSetNpTitleId(GetSceNpTitleId(), GetSceNpTitleSecret());
|
||||
if (ret < 0)
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceNpSetNpTitleId failed, ret=%x\n", ret);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ret = sceRudpEnableInternalIOThread(RUDP_THREAD_STACK_SIZE, RUDP_THREAD_PRIORITY);
|
||||
if(ret < 0)
|
||||
if(ret < 0)
|
||||
{
|
||||
app.DebugPrintf("sceRudpEnableInternalIOThread failed with error code 0x%08x\n", ret);
|
||||
assert(0);
|
||||
|
|
@ -192,7 +192,7 @@ void SQRNetworkManager_Orbis::Initialise()
|
|||
else
|
||||
{
|
||||
// On Orbis, PSN sign in is only handled by the XMB
|
||||
SetState(SNM_INT_STATE_IDLE);
|
||||
SetState(SNM_INT_STATE_IDLE);
|
||||
}
|
||||
SonyVoiceChat_Orbis::init();
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ void SQRNetworkManager_Orbis::InitialiseAfterOnline()
|
|||
|
||||
|
||||
ret = sceNpMatching2CreateContext(¶m, &m_matchingContext);
|
||||
|
||||
|
||||
if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_CREATE_MATCHING_CONTEXT ) )
|
||||
{
|
||||
app.DebugPrintf("SQRNetworkManager_Orbis::InitialiseAfterOnline - sceNpMatching2CreateContext failed with error 0x%08x\n", ret);
|
||||
|
|
@ -398,7 +398,7 @@ void SQRNetworkManager_Orbis::Tick()
|
|||
{
|
||||
// make sure we've removed all the remote players and killed the udp connections before we bail out
|
||||
if(m_RudpCtxToPlayerMap.size() == 0)
|
||||
ResetToIdle();
|
||||
ResetToIdle();
|
||||
}
|
||||
|
||||
EnterCriticalSection(&m_csStateChangeQueue);
|
||||
|
|
@ -451,7 +451,7 @@ void SQRNetworkManager_Orbis::tickErrorDialog()
|
|||
if(s_errorDialogRunning)
|
||||
{
|
||||
SceErrorDialogStatus s = sceErrorDialogUpdateStatus();
|
||||
switch (s)
|
||||
switch (s)
|
||||
{
|
||||
case SCE_ERROR_DIALOG_STATUS_NONE:
|
||||
assert(0);
|
||||
|
|
@ -465,9 +465,9 @@ void SQRNetworkManager_Orbis::tickErrorDialog()
|
|||
case SCE_ERROR_DIALOG_STATUS_FINISHED:
|
||||
sceErrorDialogTerminate();
|
||||
s_errorDialogRunning = false;
|
||||
|
||||
|
||||
// Start callback timer
|
||||
s_SignInCompleteCallbackPending = true;
|
||||
s_SignInCompleteCallbackPending = true;
|
||||
s_errorDialogClosed = System::currentTimeMillis();
|
||||
break;
|
||||
}
|
||||
|
|
@ -490,9 +490,9 @@ void SQRNetworkManager_Orbis::tickErrorDialog()
|
|||
SceSystemServiceStatus status = SceSystemServiceStatus();
|
||||
sceSystemServiceGetStatus(&status);
|
||||
bool systemUiDisplayed = status.isInBackgroundExecution || status.isSystemUiOverlaid;
|
||||
|
||||
|
||||
if (systemUiDisplayed)
|
||||
{
|
||||
{
|
||||
// Wait till the system goes away
|
||||
}
|
||||
else
|
||||
|
|
@ -583,7 +583,7 @@ void SQRNetworkManager_Orbis::ErrorHandlingTick()
|
|||
DeleteServerContext();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Start hosting a game, by creating a room & joining it. We explicity create a server context here (via GetServerContext) as Sony suggest that
|
||||
|
|
@ -643,7 +643,7 @@ void SQRNetworkManager_Orbis::UpdateExternalRoomData()
|
|||
{
|
||||
if( m_offlineGame ) return;
|
||||
if( m_isHosting )
|
||||
{
|
||||
{
|
||||
SceNpMatching2SetRoomDataExternalRequest reqParam;
|
||||
memset( &reqParam, 0, sizeof(reqParam) );
|
||||
reqParam.roomId = m_room;
|
||||
|
|
@ -774,13 +774,13 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter )
|
|||
do
|
||||
{
|
||||
ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, NULL);
|
||||
|
||||
|
||||
// If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread
|
||||
if( event.udata == 0 )
|
||||
{
|
||||
// int iEvent;
|
||||
// SceNpUserInfo from;
|
||||
// uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE];
|
||||
// uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE];
|
||||
// size_t bufferSize = SCE_NP_BASIC_MAX_MESSAGE_SIZE;
|
||||
// int ret = sceNpBasicGetEvent(&iEvent, &from, &buffer, &bufferSize);
|
||||
// if( ret == 0 )
|
||||
|
|
@ -788,7 +788,7 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter )
|
|||
// if( iEvent == SCE_NP_BASIC_EVENT_INCOMING_BOOTABLE_INVITATION )
|
||||
// {
|
||||
// // 4J Stu - Don't do this here as it can be very disruptive to gameplay. Players can bring this up from LoadOrJoinMenu, PauseMenu and InGameInfoMenu
|
||||
// //sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
|
||||
// //sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
|
||||
// }
|
||||
// if( iEvent == SCE_NP_BASIC_EVENT_RECV_INVITATION_RESULT )
|
||||
// {
|
||||
|
|
@ -835,12 +835,12 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (friendList.hasResult())
|
||||
if (friendList.hasResult())
|
||||
{
|
||||
sce::Toolkit::NP::FriendsList::const_iterator iter ;
|
||||
sce::Toolkit::NP::FriendsList::const_iterator iter ;
|
||||
int i = 1 ;
|
||||
bool noFriends = true;
|
||||
for (iter = friendList.get()->begin(); iter != friendList.get()->end() ; ++iter,i++)
|
||||
for (iter = friendList.get()->begin(); iter != friendList.get()->end() ; ++iter,i++)
|
||||
{
|
||||
manager->m_friendCount++;
|
||||
noFriends = false;
|
||||
|
|
@ -848,7 +848,7 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
|||
app.DebugPrintf("Online Name: %s\n",iter->npid.handle.data);
|
||||
app.DebugPrintf("------------------------\n");
|
||||
|
||||
|
||||
|
||||
sce::Toolkit::NP::PresenceRequest presenceRequest;
|
||||
sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::PresenceInfo> presenceInfo;
|
||||
memset(&presenceRequest,0,sizeof(presenceRequest));
|
||||
|
|
@ -858,11 +858,11 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
|||
|
||||
|
||||
ret = sce::Toolkit::NP::Presence::Interface::getPresence(&presenceRequest,&presenceInfo,false);
|
||||
if( ret < 0 )
|
||||
if( ret < 0 )
|
||||
{
|
||||
app.DebugPrintf("getPresence() error. ret = 0x%x\n", ret);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("\nPresence Data Retrieved:\n");
|
||||
app.DebugPrintf("Platform Type: %s\n", presenceInfo.get()->platformType.c_str());
|
||||
|
|
@ -897,13 +897,13 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (friendList.hasError())
|
||||
else if (friendList.hasError())
|
||||
{
|
||||
app.DebugPrintf( "Error occurred while retrieving FriendsList, ret = 0x%x\n", friendList.getError());
|
||||
app.DebugPrintf("Check sign-in status\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -944,7 +944,7 @@ bool SQRNetworkManager_Orbis::IsReadyToPlayOrIdle()
|
|||
|
||||
|
||||
// Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The
|
||||
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
|
||||
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
|
||||
// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false.
|
||||
bool SQRNetworkManager_Orbis::IsInSession()
|
||||
{
|
||||
|
|
@ -1119,7 +1119,7 @@ bool SQRNetworkManager_Orbis::JoinRoom(SceNpMatching2RoomId roomId, SceNpMatchin
|
|||
m_localPlayerJoinMask = localPlayerMask;
|
||||
m_localPlayerCount = 0;
|
||||
m_localPlayerJoined = 0;
|
||||
|
||||
|
||||
for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ )
|
||||
{
|
||||
if( localPlayerMask & ( 1 << i ) ) m_localPlayerCount++;
|
||||
|
|
@ -1240,7 +1240,7 @@ bool SQRNetworkManager_Orbis::AddLocalPlayerByUserIndex(int idx)
|
|||
|
||||
// Sync this back out to our networked clients...
|
||||
SyncRoomData();
|
||||
|
||||
|
||||
UpdateRemotePlay();
|
||||
|
||||
// no connections being made because we're all on the host, so add this player to the existing connections
|
||||
|
|
@ -1264,7 +1264,7 @@ bool SQRNetworkManager_Orbis::AddLocalPlayerByUserIndex(int idx)
|
|||
|
||||
memset(&reqParam, 0, sizeof(reqParam));
|
||||
memset(&binAttr, 0, sizeof(binAttr));
|
||||
|
||||
|
||||
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
|
||||
binAttr.ptr = &m_localPlayerJoinMask;
|
||||
binAttr.size = sizeof(m_localPlayerJoinMask);
|
||||
|
|
@ -1357,7 +1357,7 @@ bool SQRNetworkManager_Orbis::RemoveLocalPlayerByUserIndex(int idx)
|
|||
|
||||
memset(&reqParam, 0, sizeof(reqParam));
|
||||
memset(&binAttr, 0, sizeof(binAttr));
|
||||
|
||||
|
||||
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
|
||||
binAttr.ptr = &m_localPlayerJoinMask;
|
||||
binAttr.size = sizeof(m_localPlayerJoinMask);
|
||||
|
|
@ -1395,7 +1395,7 @@ void SQRNetworkManager_Orbis::UpdateRemotePlay()
|
|||
|
||||
extern uint8_t *mallocAndCreateUTF8ArrayFromString(int iID);
|
||||
|
||||
// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that
|
||||
// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that
|
||||
void SQRNetworkManager_Orbis::SendInviteGUI()
|
||||
{
|
||||
if(s_bInviteDialogRunning)
|
||||
|
|
@ -1403,7 +1403,7 @@ void SQRNetworkManager_Orbis::SendInviteGUI()
|
|||
app.DebugPrintf("SendInviteGUI - Invite dialog is already running so ignoring request\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
s_bInviteDialogRunning = true;
|
||||
|
||||
//Set invitation information - this is now exactly the same as the presence information that we synchronise out.
|
||||
|
|
@ -1428,7 +1428,7 @@ void SQRNetworkManager_Orbis::SendInviteGUI()
|
|||
messData.dialogFlag = SCE_TOOLKIT_NP_DIALOG_TYPE_USER_EDITABLE;
|
||||
messData.npIdsCount = 2; // TODO: Set this to the number of available slots
|
||||
messData.npIds = NULL;
|
||||
messData.userInfo.userId = userId;
|
||||
messData.userInfo.userId = userId;
|
||||
|
||||
// Set expire to maximum
|
||||
messData.expireMinutes = 0;
|
||||
|
|
@ -1451,9 +1451,9 @@ void SQRNetworkManager_Orbis::SendInviteGUI()
|
|||
// int ret = sce::Toolkit::NP::Messaging::Interface::sendMessage(&messData, SCE_TOOLKIT_NP_MESSAGE_TYPE_INVITE);
|
||||
|
||||
free(subject);
|
||||
free(body);
|
||||
free(body);
|
||||
|
||||
if(ret < SCE_TOOLKIT_NP_SUCCESS )
|
||||
if(ret < SCE_TOOLKIT_NP_SUCCESS )
|
||||
{
|
||||
s_bInviteDialogRunning = false;
|
||||
app.DebugPrintf("Send Message failed 0x%x ...\n",ret);
|
||||
|
|
@ -1513,7 +1513,7 @@ void SQRNetworkManager_Orbis::TickInviteGUI()
|
|||
int32_t ret = sceGameCustomDataDialogGetResult( &dialogResult );
|
||||
|
||||
if( SCE_OK != ret )
|
||||
{
|
||||
{
|
||||
app.DebugPrintf( "***** sceGameCustomDataDialogGetResult error:0x%x\n", ret);
|
||||
}
|
||||
sceGameCustomDataDialogClose();
|
||||
|
|
@ -1536,7 +1536,7 @@ void SQRNetworkManager_Orbis::GetInviteDataAndProcess(sce::Toolkit::NP::MessageA
|
|||
}
|
||||
// InvitationInfoRequest requestInfo;
|
||||
// sce::Toolkit::NP::Utilities::Future< NpSessionInvitationInfo > inviteInfo;
|
||||
//
|
||||
//
|
||||
// requestInfo.invitationId = pInvite->invitationId;
|
||||
// requestInfo.userInfo.npId = pInvite->onlineId;
|
||||
// int err = sce::Toolkit::NP::Sessions::Interface::getInvitationInfo(&requestInfo, &inviteInfo, false);
|
||||
|
|
@ -1555,21 +1555,21 @@ void SQRNetworkManager_Orbis::GetInviteDataAndProcess(sce::Toolkit::NP::MessageA
|
|||
// {
|
||||
// app.DebugPrintf("getInvitationInfo error 0x%08x", err);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// INVITE_INFO *invite = &m_inviteReceived[m_inviteIndex];
|
||||
// m_inviteIndex = ( m_inviteIndex + 1 ) % MAX_SIMULTANEOUS_INVITES;
|
||||
// size_t dataSize = sizeof(INVITE_INFO);
|
||||
// int ret = sceNpBasicRecvMessageAttachmentLoad(id, invite, &dataSize);
|
||||
//
|
||||
//
|
||||
// // If we fail ( which we might do if we aren't online at this point) then zero the invite information and we'll try and get it later after (possibly) signing in
|
||||
// if( ret != 0 )
|
||||
// {
|
||||
// memset(invite, 0, sizeof( INVITE_INFO ) );
|
||||
// s_lastInviteIdToRetry = id;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// m_gameBootInvite = invite;
|
||||
}
|
||||
|
||||
|
|
@ -1647,7 +1647,7 @@ void SQRNetworkManager_Orbis::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
|
|||
{
|
||||
EnterCriticalSection(&m_csRoomSyncData);
|
||||
|
||||
// If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal.
|
||||
// If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal.
|
||||
bool zeroLastSlot = false;
|
||||
if( roomSlotPlayerCount == -1 )
|
||||
{
|
||||
|
|
@ -1751,7 +1751,7 @@ void SQRNetworkManager_Orbis::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
|
|||
}
|
||||
else
|
||||
{
|
||||
FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId);
|
||||
FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId);
|
||||
m_aRoomSlotPlayers[i]->SetUID(m_roomSyncData.players[i].m_UID); // On client, UIDs flow from m_roomSyncData->player data
|
||||
}
|
||||
}
|
||||
|
|
@ -1844,7 +1844,7 @@ bool SQRNetworkManager_Orbis::AddRemotePlayersAndSync( SceNpMatching2RoomMemberI
|
|||
}
|
||||
|
||||
// We want to keep all players from a particular machine together, so search through the room sync data to see if we can find
|
||||
// any pre-existing players from this machine.
|
||||
// any pre-existing players from this machine.
|
||||
int firstIdx = -1;
|
||||
for( int i = 0; i < m_roomSyncData.getPlayerCount(); i++ )
|
||||
{
|
||||
|
|
@ -1950,7 +1950,7 @@ void SQRNetworkManager_Orbis::RemoveRemotePlayersAndSync( SceNpMatching2RoomMemb
|
|||
|
||||
// Update mapping from the room slot players to SQRNetworkPlayer instances
|
||||
MapRoomSlotPlayers();
|
||||
|
||||
|
||||
|
||||
// And then synchronise this out to all other machines
|
||||
SyncRoomData();
|
||||
|
|
@ -1993,7 +1993,7 @@ void SQRNetworkManager_Orbis::RemoveNetworkPlayers( int mask )
|
|||
removePlayerFromVoiceChat(player);
|
||||
|
||||
// Delete the player itself and the mapping from context to player map as this context is no longer valid
|
||||
delete player;
|
||||
delete player;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2107,7 +2107,7 @@ bool SQRNetworkManager_Orbis::GetMatchingContext(eSQRNetworkManagerInternalState
|
|||
|
||||
// Starts the process of obtaining a server context. This is an asynchronous operation, at the end of which (if successful), we'll be creating
|
||||
// a room. General procedure followed here is as suggested by Sony - we get a list of servers, then pick a random one, and see if it is available.
|
||||
// If not we just cycle round trying other random ones until we either find an available one or fail.
|
||||
// If not we just cycle round trying other random ones until we either find an available one or fail.
|
||||
bool SQRNetworkManager_Orbis::GetServerContext()
|
||||
{
|
||||
assert(m_state == SNM_INT_STATE_IDLE);
|
||||
|
|
@ -2165,7 +2165,7 @@ bool SQRNetworkManager_Orbis::GetServerContext(SceNpMatching2ServerId serverId)
|
|||
// ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
|
||||
// {
|
||||
// sceNpMatching2DestroyContext(m_matchingContext);
|
||||
// m_matchingContextValid = false;
|
||||
// m_matchingContextValid = false;
|
||||
// if( !GetMatchingContext(SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT) ) return false;
|
||||
// }
|
||||
// }
|
||||
|
|
@ -2298,7 +2298,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerConnectionComplete(SQRNetworkPlayer *
|
|||
|
||||
if( ( !wasReady ) && ( isReady ) )
|
||||
{
|
||||
HandlePlayerJoined( player );
|
||||
HandlePlayerJoined( player );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2327,7 +2327,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerSmallIdAllocated(SQRNetworkPlayer *pl
|
|||
|
||||
if( ( !wasReady ) && ( isReady ) )
|
||||
{
|
||||
HandlePlayerJoined( player );
|
||||
HandlePlayerJoined( player );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2345,7 +2345,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerInitialDataReceived(SQRNetworkPlayer
|
|||
|
||||
if( ( !wasReady ) && ( isReady ) )
|
||||
{
|
||||
HandlePlayerJoined( player );
|
||||
HandlePlayerJoined( player );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2361,7 +2361,7 @@ void SQRNetworkManager_Orbis::HandlePlayerJoined(SQRNetworkPlayer *player)
|
|||
{
|
||||
if( m_listener )
|
||||
{
|
||||
m_listener->HandlePlayerJoined( player );
|
||||
m_listener->HandlePlayerJoined( player );
|
||||
}
|
||||
app.DebugPrintf(sc_verbose, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> HandlePlayerJoined\n");
|
||||
|
||||
|
|
@ -2425,7 +2425,7 @@ std::string getIPAddressString(SceNetInAddr add)
|
|||
{
|
||||
char str[32];
|
||||
unsigned char *vals = (unsigned char*)&add.s_addr;
|
||||
sprintf(str, "%d.%d.%d.%d", (int)vals[0], (int)vals[1], (int)vals[2], (int)vals[3]);
|
||||
sprintf(str, "%d.%d.%d.%d", (int)vals[0], (int)vals[1], (int)vals[2], (int)vals[3]);
|
||||
return std::string(str);
|
||||
}
|
||||
|
||||
|
|
@ -2495,7 +2495,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro
|
|||
SQRVoiceConnection* pConnection = SonyVoiceChat_Orbis::getVoiceConnectionFromRoomMemberID(peerMemberId);
|
||||
if(pConnection == NULL)
|
||||
{
|
||||
|
||||
|
||||
// Create an Rudp context for the voice connection, this will happen regardless of whether the peer is client or host
|
||||
int rudpCtx;
|
||||
ret = sceRudpCreateContext( RudpContextCallback, this, &rudpCtx );
|
||||
|
|
@ -2510,7 +2510,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro
|
|||
g_numRUDPContextsBound++;
|
||||
app.DebugPrintf(sc_verbose, "-----------------::::::::::::: sceRudpBind\n" );
|
||||
|
||||
ret = sceRudpInitiate( rudpCtx, (SceNetSockaddr*)&sinp2pPeer, sizeof(sinp2pPeer), 0);
|
||||
ret = sceRudpInitiate( rudpCtx, (SceNetSockaddr*)&sinp2pPeer, sizeof(sinp2pPeer), 0);
|
||||
if(ret < 0){ app.DebugPrintf("sceRudpInitiate %s failed : 0x%08x\n", getIPAddressString(sinp2pPeer.sin_addr).c_str(), ret); assert(0); }
|
||||
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_RUDP_INIT2) ) return false;
|
||||
app.DebugPrintf(sc_verbose, "-----------------::::::::::::: sceRudpInitiate\n" );
|
||||
|
|
@ -2521,7 +2521,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro
|
|||
|
||||
pConnection = SonyVoiceChat_Orbis::addRemoteConnection(rudpCtx, peerMemberId);
|
||||
}
|
||||
|
||||
|
||||
for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ )
|
||||
{
|
||||
bool bMaskVal = ( playerMask & ( 1 << i ) );
|
||||
|
|
@ -2544,11 +2544,11 @@ bool SQRNetworkManager_Orbis::CreateRudpConnections(SceNpMatching2RoomId roomId,
|
|||
memset(&sinp2pPeer, 0, sizeof(sinp2pPeer));
|
||||
sinp2pPeer.sin_len = sizeof(sinp2pPeer);
|
||||
sinp2pPeer.sin_family = AF_INET;
|
||||
|
||||
|
||||
int ret = sceNpMatching2SignalingGetConnectionStatus(m_matchingContext, roomId, peerMemberId, &connStatus, &sinp2pPeer.sin_addr, &sinp2pPeer.sin_port);
|
||||
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2SignalingGetConnectionStatus returned 0x%x, connStatus %d peer add:%s peer port:0x%x\n",ret, connStatus,getIPAddressString(sinp2pPeer.sin_addr).c_str(),sinp2pPeer.sin_port);
|
||||
|
||||
// Set vport
|
||||
// Set vport
|
||||
sinp2pPeer.sin_vport = sceNetHtons(1);
|
||||
|
||||
// Create socket & bind, if we don't already have one
|
||||
|
|
@ -2706,7 +2706,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp
|
|||
manager->m_state == SNM_INT_STATE_HOSTING_STARTING_MATCHING_CONTEXT ||
|
||||
manager->m_state == SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT)
|
||||
{
|
||||
// matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router
|
||||
// matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router
|
||||
// agent-0101.ww.sp-int.matching.playstation.net (198.107.157.191)
|
||||
// static-resource.sp-int.community.playstation.net (203.105.77.140)
|
||||
app.DebugPrintf("SQRNetworkManager_Orbis::ContextCallback - Error\n");
|
||||
|
|
@ -2771,7 +2771,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp
|
|||
// unsigned int type, attributes;
|
||||
// CellGameContentSize gameSize;`
|
||||
// char dirName[CELL_GAME_DIRNAME_SIZE];
|
||||
//
|
||||
//
|
||||
// if( g_bBootedFromInvite )
|
||||
// {
|
||||
// manager->GetInviteDataAndProcess(SCE_NP_BASIC_SELECTED_INVITATION_DATA);
|
||||
|
|
@ -2789,7 +2789,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp
|
|||
assert(false);
|
||||
break;
|
||||
case SCE_NP_MATCHING2_CONTEXT_EVENT_START_OVER:
|
||||
|
||||
|
||||
app.DebugPrintf("SCE_NP_MATCHING2_CONTEXT_EVENT_START_OVER\n");
|
||||
app.DebugPrintf("eventCause=%u, errorCode=0x%08x\n", eventCause, errorCode);
|
||||
|
||||
|
|
@ -2950,7 +2950,7 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id,
|
|||
if( success1 )
|
||||
{
|
||||
success2 = manager->CreateRudpConnections(manager->m_room, pRoomMemberData->roomMemberDataInternal->memberId, playerMask, pRoomMemberData->roomMemberDataInternal->memberId);
|
||||
if( success2 )
|
||||
if( success2 )
|
||||
{
|
||||
bool ret = manager->CreateVoiceRudpConnections( manager->m_room, pRoomMemberData->roomMemberDataInternal->memberId, 0);
|
||||
assert(ret == true);
|
||||
|
|
@ -3055,7 +3055,7 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id,
|
|||
void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, const void *data, void *arg)
|
||||
{
|
||||
SQRNetworkManager_Orbis *manager = (SQRNetworkManager_Orbis *)arg;
|
||||
|
||||
|
||||
bool gotEventData = false;
|
||||
switch( event )
|
||||
{
|
||||
|
|
@ -3186,7 +3186,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN
|
|||
int oldMask = manager->GetOldMask( pRoomMemberData->newRoomMemberDataInternal->memberId );
|
||||
int addedMask = manager->GetAddedMask(playerMask, oldMask );
|
||||
int removedMask = manager->GetRemovedMask(playerMask, oldMask );
|
||||
|
||||
|
||||
if( addedMask != 0 )
|
||||
{
|
||||
bool success = manager->AddRemotePlayersAndSync( pRoomMemberData->newRoomMemberDataInternal->memberId, addedMask );
|
||||
|
|
@ -3203,7 +3203,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN
|
|||
|
||||
memset(&reqParam, 0, sizeof(reqParam));
|
||||
memset(&binAttr, 0, sizeof(binAttr));
|
||||
|
||||
|
||||
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
|
||||
binAttr.ptr = &oldMask;
|
||||
binAttr.size = sizeof(oldMask);
|
||||
|
|
@ -3265,7 +3265,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -3426,7 +3426,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v
|
|||
// }
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if( netstart_result.result != 0 )
|
||||
// {
|
||||
// // Failed, or user may have decided not to sign in - maybe need to differentiate here
|
||||
|
|
@ -3440,7 +3440,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v
|
|||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// break;
|
||||
// case CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED:
|
||||
// break;
|
||||
|
|
@ -3608,7 +3608,7 @@ void SQRNetworkManager_Orbis::NetCtlCallback(int eventType, void *arg)
|
|||
if( eventType == SCE_NET_CTL_EVENT_TYPE_DISCONNECTED)// CELL_NET_CTL_EVENT_LINK_DISCONNECTED )
|
||||
{
|
||||
manager->m_bLinkDisconnected = true;
|
||||
manager->m_listener->HandleDisconnect(false);
|
||||
manager->m_listener->HandleDisconnect(false);
|
||||
}
|
||||
else //if( event == CELL_NET_CTL_EVENT_ESTABLISH )
|
||||
{
|
||||
|
|
@ -3762,7 +3762,7 @@ void SQRNetworkManager_Orbis::GetExtDataForRoom( SceNpMatching2RoomId roomId, vo
|
|||
if( ret == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) // Also checking for this as a means of simulating the previous error
|
||||
{
|
||||
sceNpMatching2DestroyContext(m_matchingContext);
|
||||
m_matchingContextValid = false;
|
||||
m_matchingContextValid = false;
|
||||
if( !GetMatchingContext(SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT) )
|
||||
{
|
||||
// No matching context, and failed to try and make one. We're really broken here.
|
||||
|
|
@ -3789,7 +3789,7 @@ bool SQRNetworkManager_Orbis::ForceErrorPoint(eSQRForceError error)
|
|||
return false;
|
||||
}
|
||||
#else
|
||||
bool SQRNetworkManager_Orbis::aForceError[SNM_FORCE_ERROR_COUNT] =
|
||||
bool SQRNetworkManager_Orbis::aForceError[SNM_FORCE_ERROR_COUNT] =
|
||||
{
|
||||
false, // SNM_FORCE_ERROR_NP2_INIT
|
||||
false, // SNM_FORCE_ERROR_NET_INITIALIZE_NETWORK
|
||||
|
|
@ -3919,7 +3919,7 @@ void SQRNetworkManager_Orbis::AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(v
|
|||
ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA,1,iPad,ErrorPSNDisconnectedDialogReturned,pParam, app.GetStringTable());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int SQRNetworkManager_Orbis::SetRichPresence(const void *data)
|
||||
{
|
||||
|
|
@ -3971,13 +3971,13 @@ void SQRNetworkManager_Orbis::SendLastPresenceInfo()
|
|||
|
||||
// On PS4 we can't set the status and the data at the same time
|
||||
unsigned int options = 0;
|
||||
if( s_presenceDataDirty )
|
||||
if( s_presenceDataDirty )
|
||||
{
|
||||
// Prioritise data over status as it is critical to discovering the network game
|
||||
s_lastPresenceInfo.presenceType = SCE_TOOLKIT_NP_PRESENCE_DATA;
|
||||
}
|
||||
else if( s_presenceStatusDirty )
|
||||
{
|
||||
else if( s_presenceStatusDirty )
|
||||
{
|
||||
s_lastPresenceInfo.presenceType = SCE_TOOLKIT_NP_PRESENCE_STATUS;
|
||||
}
|
||||
else
|
||||
|
|
@ -4065,7 +4065,7 @@ void SQRNetworkManager_Orbis::removePlayerFromVoiceChat( SQRNetworkPlayer* pPlay
|
|||
{
|
||||
if(pPlayer->IsLocal())
|
||||
{
|
||||
|
||||
|
||||
SonyVoiceChat_Orbis::disconnectLocalPlayer(pPlayer->GetLocalPlayerIndex());
|
||||
}
|
||||
else
|
||||
|
|
@ -4097,7 +4097,7 @@ void SQRNetworkManager_Orbis::removePlayerFromVoiceChat( SQRNetworkPlayer* pPlay
|
|||
void SQRNetworkManager_Orbis::TickNotify()
|
||||
{
|
||||
if (g_NetworkManager.IsInSession() && !g_NetworkManager.IsLocalGame())
|
||||
{
|
||||
{
|
||||
long long currentTime = System::currentTimeMillis();
|
||||
|
||||
// Note: interval at which to notify Sony of realtime play, according to docs an interval greater than 1 sec is bad
|
||||
|
|
@ -4109,7 +4109,7 @@ void SQRNetworkManager_Orbis::TickNotify()
|
|||
m_lastNotifyTime = currentTime;
|
||||
for(int i = 0; i < XUSER_MAX_COUNT; i++)
|
||||
{
|
||||
if (ProfileManager.IsSignedInLive(i))
|
||||
if (ProfileManager.IsSignedInLive(i))
|
||||
{
|
||||
NotifyRealtimePlusFeature(i);
|
||||
}
|
||||
|
|
@ -4143,8 +4143,8 @@ void SQRNetworkManager_Orbis::NotifyRealtimePlusFeature(int iQuadrant)
|
|||
// {
|
||||
// app.DebugPrintf("============ Calling CallSignInCompleteCallback and s_SignInCompleteCallbackFn is OK\n");
|
||||
// bool isSignedIn = ProfileManager.IsSignedInLive(s_SignInCompleteCallbackPad);
|
||||
//
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, isSignedIn, s_SignInCompleteCallbackPad);
|
||||
//
|
||||
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, isSignedIn, s_SignInCompleteCallbackPad);
|
||||
// s_SignInCompleteCallbackFn = NULL;
|
||||
// s_SignInCompleteCallbackPad = -1;
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SQRNetworkManager_Orbis : public SQRNetworkManager
|
|||
public:
|
||||
SQRNetworkManager_Orbis(ISQRNetworkManagerListener *listener);
|
||||
|
||||
// General
|
||||
// General
|
||||
void Tick();
|
||||
void Initialise();
|
||||
void Terminate();
|
||||
|
|
@ -111,7 +111,7 @@ private:
|
|||
bool m_offlineSQR;
|
||||
int m_resendExternalRoomDataCountdown;
|
||||
bool m_matching2initialised;
|
||||
PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES];
|
||||
PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES];
|
||||
int m_inviteIndex;
|
||||
static PresenceSyncInfo *m_gameBootInvite;
|
||||
static PresenceSyncInfo m_gameBootInvite_data;
|
||||
|
|
@ -222,9 +222,9 @@ private:
|
|||
std::vector<FriendSearchResult> m_aFriendSearchResults;
|
||||
|
||||
// Rudp management and local players
|
||||
std::unordered_map<int,SQRNetworkPlayer *> m_RudpCtxToPlayerMap;
|
||||
std::unordered_map<int,SQRNetworkPlayer *> m_RudpCtxToPlayerMap;
|
||||
|
||||
std::unordered_map<SceNetInAddr_t, SQRVoiceConnection*> m_NetAddrToVoiceConnectionMap;
|
||||
std::unordered_map<SceNetInAddr_t, SQRVoiceConnection*> m_NetAddrToVoiceConnectionMap;
|
||||
|
||||
bool CreateRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask, SceNpMatching2RoomMemberId playersPeerMemberId);
|
||||
bool CreateVoiceRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask);
|
||||
|
|
@ -325,8 +325,8 @@ private:
|
|||
static sce::Toolkit::NP::PresenceDetails s_lastPresenceInfo;
|
||||
|
||||
static const int MIN_PRESENCE_RESEND_TIME = 30 * 1000; // Minimum presence send rate - doesn't seem possible to find out what this actually should be
|
||||
static __int64 s_lastPresenceTime;
|
||||
static __int64 s_resendPresenceTime;
|
||||
static int64_t s_lastPresenceTime;
|
||||
static int64_t s_resendPresenceTime;
|
||||
|
||||
static bool s_presenceStatusDirty;
|
||||
static bool s_presenceDataDirty;
|
||||
|
|
@ -337,7 +337,7 @@ private:
|
|||
|
||||
// Debug
|
||||
static long long s_roomStartTime;
|
||||
|
||||
|
||||
// Error dialog
|
||||
static bool s_errorDialogRunning;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ int32_t hBGMAudio;
|
|||
//static char sc_loadPath[] = {"/app0/"};
|
||||
//const char* getConsoleHomePath() { return sc_loadPath; }
|
||||
|
||||
char* getUsrDirPath()
|
||||
{
|
||||
return usrdirPath;
|
||||
char* getUsrDirPath()
|
||||
{
|
||||
return usrdirPath;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src )
|
|||
{
|
||||
wchar_t f,l;
|
||||
|
||||
// validation section
|
||||
// validation section
|
||||
// _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR);
|
||||
// _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR);
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize)
|
|||
}
|
||||
|
||||
|
||||
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
||||
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
SceRtcDateTime dateTime;
|
||||
int err = sceRtcGetCurrentClock(&dateTime, 0);
|
||||
|
|
@ -78,8 +78,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
|||
}
|
||||
BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { ORBIS_STUBBED; return false; }
|
||||
BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { ORBIS_STUBBED; return false; }
|
||||
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
SceRtcDateTime dateTime;
|
||||
int err = sceRtcGetCurrentClockLocalTime(&dateTime);
|
||||
assert(err == SCE_OK );
|
||||
|
|
@ -95,21 +95,21 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
|||
}
|
||||
|
||||
HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { ORBIS_STUBBED; return NULL; }
|
||||
VOID Sleep(DWORD dwMilliseconds)
|
||||
{
|
||||
VOID Sleep(DWORD dwMilliseconds)
|
||||
{
|
||||
C4JThread::Sleep(dwMilliseconds);
|
||||
}
|
||||
|
||||
BOOL SetThreadPriority(HANDLE hThread, int nPriority) { ORBIS_STUBBED; return FALSE; }
|
||||
DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { ORBIS_STUBBED; return false; }
|
||||
|
||||
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
|
||||
{
|
||||
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
|
||||
{
|
||||
return sceAtomicCompareAndSwap32((int32_t*)Destination, (int32_t)Comperand, (int32_t)Exchange);
|
||||
}
|
||||
|
||||
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
|
||||
{
|
||||
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
|
||||
{
|
||||
return sceAtomicCompareAndSwap64((int64_t*)Destination, (int64_t)Comperand, (int64_t)Exchange);
|
||||
}
|
||||
|
||||
|
|
@ -135,10 +135,10 @@ VOID OrbisInit()
|
|||
sceSysmoduleLoadModule(SCE_SYSMODULE_RUDP);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_MATCHING2);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_INVITATION_DIALOG);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH );
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_NP_COMMERCE);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_REMOTE_PLAY);
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_ERROR_DIALOG);
|
||||
|
|
@ -173,7 +173,7 @@ VOID OrbisInit()
|
|||
hBGMAudio=sceAudioOutOpen(
|
||||
SCE_USER_SERVICE_USER_ID_SYSTEM,
|
||||
SCE_AUDIO_OUT_PORT_TYPE_BGM,0,
|
||||
256,
|
||||
256,
|
||||
48000,
|
||||
2);
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ int32_t GetAudioBGMHandle()
|
|||
return hBGMAudio;
|
||||
}
|
||||
|
||||
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
char name[1] = {0};
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
}
|
||||
|
||||
|
||||
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
|
||||
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
|
||||
{
|
||||
InitializeCriticalSection(CriticalSection);
|
||||
}
|
||||
|
|
@ -220,9 +220,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
assert(err == SCE_OK);
|
||||
}
|
||||
|
||||
extern CRITICAL_SECTION g_singleThreadCS;
|
||||
extern CRITICAL_SECTION g_singleThreadCS;
|
||||
|
||||
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
int err = scePthreadMutexLock(&CriticalSection->mutex);
|
||||
assert(err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK );
|
||||
|
|
@ -240,7 +240,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
}
|
||||
|
||||
|
||||
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
if(--CriticalSection->m_cLock == 0 )
|
||||
{
|
||||
|
|
@ -255,7 +255,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
|
||||
ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
int err = scePthreadMutexTrylock(&CriticalSection->mutex);
|
||||
int err = scePthreadMutexTrylock(&CriticalSection->mutex);
|
||||
if((err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK ))
|
||||
{
|
||||
CriticalSection->m_cLock++;
|
||||
|
|
@ -266,20 +266,20 @@ ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
|
||||
DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds) { ORBIS_STUBBED; return 0; }
|
||||
|
||||
BOOL CloseHandle(HANDLE hObject)
|
||||
{
|
||||
BOOL CloseHandle(HANDLE hObject)
|
||||
{
|
||||
sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)hObject));
|
||||
return true;
|
||||
// ORBIS_STUBBED;
|
||||
// return false;
|
||||
// ORBIS_STUBBED;
|
||||
// return false;
|
||||
}
|
||||
|
||||
BOOL SetEvent(HANDLE hEvent) { ORBIS_STUBBED; return false; }
|
||||
|
||||
HMODULE GetModuleHandle(LPCSTR lpModuleName) { ORBIS_STUBBED; return 0; }
|
||||
|
||||
DWORD GetCurrentThreadId(VOID)
|
||||
{
|
||||
DWORD GetCurrentThreadId(VOID)
|
||||
{
|
||||
return 0; // TODO
|
||||
}
|
||||
DWORD WaitForMultipleObjectsEx(DWORD nCount,CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds,BOOL bAlertable ) { ORBIS_STUBBED; return 0; }
|
||||
|
|
@ -302,10 +302,10 @@ public:
|
|||
void* m_virtualAddr;
|
||||
uint64_t m_size;
|
||||
|
||||
PageInfo(off_t physAddr, void* virtualAddr, uint64_t size)
|
||||
PageInfo(off_t physAddr, void* virtualAddr, uint64_t size)
|
||||
: m_physAddr(physAddr)
|
||||
, m_virtualAddr(virtualAddr)
|
||||
, m_size(size)
|
||||
, m_size(size)
|
||||
{}
|
||||
};
|
||||
void* m_virtualAddr;
|
||||
|
|
@ -313,7 +313,7 @@ public:
|
|||
std::vector<PageInfo> m_pagesAllocated;
|
||||
uint64_t m_allocatedSize;
|
||||
|
||||
OrbisVAlloc(void* addr, uint64_t size)
|
||||
OrbisVAlloc(void* addr, uint64_t size)
|
||||
: m_virtualAddr(addr)
|
||||
, m_virtualSize(size)
|
||||
, m_allocatedSize(0)
|
||||
|
|
@ -331,7 +331,7 @@ public:
|
|||
{
|
||||
uint64_t sizeToAdd = size - m_allocatedSize; // the extra memory size that we have to add on
|
||||
assert(sizeToAdd >= 0);
|
||||
|
||||
|
||||
if(sizeToAdd == 0)
|
||||
return m_virtualAddr; // nothing to add
|
||||
|
||||
|
|
@ -393,8 +393,8 @@ public:
|
|||
static std::vector<OrbisVAlloc*> s_orbisVAllocs;
|
||||
|
||||
|
||||
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
|
||||
{
|
||||
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
|
||||
{
|
||||
if(lpAddress == NULL)
|
||||
{
|
||||
void *pAddr = (void*)SCE_KERNEL_APP_MAP_AREA_START_ADDR;
|
||||
|
|
@ -446,14 +446,14 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
|
|||
else if(dwFreeType == MEM_RELEASE)
|
||||
{
|
||||
delete s_orbisVAllocs[idx];
|
||||
s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx);
|
||||
s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh )
|
||||
{
|
||||
DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh )
|
||||
{
|
||||
SceFiosSize FileSize;
|
||||
SceFiosFH fh = (SceFiosFH)((int64_t)hFile);
|
||||
//DWORD FileSizeLow;
|
||||
|
|
@ -468,15 +468,15 @@ DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh )
|
|||
return (DWORD)FileSize;
|
||||
}
|
||||
|
||||
BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize )
|
||||
{
|
||||
BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize )
|
||||
{
|
||||
SceFiosSize FileSize;
|
||||
SceFiosFH fh = (SceFiosFH)((int64_t)hFile);
|
||||
|
||||
FileSize=sceFiosFHGetSize(fh);
|
||||
lpFileSize->QuadPart=FileSize;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
BOOL WriteFile(
|
||||
HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped )
|
||||
|
|
@ -496,7 +496,7 @@ BOOL WriteFile(
|
|||
}
|
||||
}
|
||||
|
||||
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
|
||||
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
|
||||
{
|
||||
SceFiosFH fh = (SceFiosFH)((int64_t)hFile);
|
||||
// sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes.
|
||||
|
|
@ -537,7 +537,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi
|
|||
}
|
||||
|
||||
|
||||
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
{
|
||||
char filePath[256];
|
||||
std::string mountedPath = StorageManager.GetMountedPath(lpFileName);
|
||||
|
|
@ -549,7 +549,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
strcpy(filePath, lpFileName );
|
||||
else
|
||||
sprintf(filePath,"%s/%s",getUsrDirPath(), lpFileName );
|
||||
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("*** Opening %s\n",filePath);
|
||||
#endif
|
||||
|
|
@ -557,9 +557,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
SceFiosFH fh;
|
||||
SceFiosOpenParams openParams;
|
||||
ZeroMemory(&openParams, sizeof(SceFiosOpenParams));
|
||||
|
||||
|
||||
switch(dwDesiredAccess)
|
||||
{
|
||||
{
|
||||
case GENERIC_READ:
|
||||
openParams.openFlags = SCE_FIOS_O_RDONLY; break;
|
||||
case GENERIC_WRITE:
|
||||
|
|
@ -588,21 +588,21 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
//assert( err == SCE_FIOS_OK );
|
||||
|
||||
|
||||
return (void*)fh;
|
||||
}
|
||||
|
||||
BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes){ ORBIS_STUBBED; return false; }
|
||||
BOOL DeleteFileA(LPCSTR lpFileName) { ORBIS_STUBBED; return false; }
|
||||
|
||||
// BOOL XCloseHandle(HANDLE a)
|
||||
// BOOL XCloseHandle(HANDLE a)
|
||||
// {
|
||||
// sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)a));
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
DWORD GetFileAttributesA(LPCSTR lpFileName)
|
||||
DWORD GetFileAttributesA(LPCSTR lpFileName)
|
||||
{
|
||||
char filePath[256];
|
||||
std::string mountedPath = StorageManager.GetMountedPath(lpFileName);
|
||||
|
|
@ -633,7 +633,7 @@ BOOL MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName) { ORBIS_STUBBED;
|
|||
|
||||
|
||||
DWORD GetLastError(VOID) { ORBIS_STUBBED; return 0; }
|
||||
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
||||
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
||||
{
|
||||
SceLibcMallocManagedSize stat;
|
||||
int err = malloc_stats(&stat);
|
||||
|
|
@ -647,20 +647,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
|||
lpBuffer->dwAvailVirtual = stat.maxSystemSize - stat.currentInuseSize;
|
||||
}
|
||||
|
||||
DWORD GetTickCount()
|
||||
DWORD GetTickCount()
|
||||
{
|
||||
// This function returns the current system time at this function is called.
|
||||
// This function returns the current system time at this function is called.
|
||||
// The system time is represented the time elapsed since the system starts up in microseconds.
|
||||
uint64_t sysTime = sceKernelGetProcessTime();
|
||||
return (DWORD)(sysTime / 1000);
|
||||
return (DWORD)(sysTime / 1000);
|
||||
}
|
||||
|
||||
// we should really use libperf for this kind of thing, but this will do for now.
|
||||
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
// microseconds
|
||||
lpFrequency->QuadPart = (1000 * 1000);
|
||||
return false;
|
||||
lpFrequency->QuadPart = (1000 * 1000);
|
||||
return false;
|
||||
}
|
||||
BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
|
||||
{
|
||||
|
|
@ -671,24 +671,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
|
|||
|
||||
#ifndef _FINAL_BUILD
|
||||
|
||||
VOID OutputDebugStringW(LPCWSTR lpOutputString)
|
||||
{
|
||||
wprintf(lpOutputString);
|
||||
VOID OutputDebugStringW(LPCWSTR lpOutputString)
|
||||
{
|
||||
wprintf(lpOutputString);
|
||||
}
|
||||
|
||||
VOID OutputDebugStringA(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
VOID OutputDebugStringA(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
}
|
||||
|
||||
VOID OutputDebugString(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
VOID OutputDebugString(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
}
|
||||
#endif // _CONTENT_PACKAGE
|
||||
|
||||
BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation)
|
||||
{
|
||||
{
|
||||
ORBIS_STUBBED;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -696,15 +696,15 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { ORB
|
|||
BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { ORBIS_STUBBED; return false;}
|
||||
|
||||
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; }
|
||||
errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
|
||||
errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
|
||||
|
||||
DWORD XGetLanguage()
|
||||
{
|
||||
DWORD XGetLanguage()
|
||||
{
|
||||
unsigned char ucLang = app.GetMinecraftLanguage(0);
|
||||
int iLang;
|
||||
|
||||
// check if we should override the system language or not
|
||||
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
|
||||
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
|
||||
{
|
||||
sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang);
|
||||
}
|
||||
|
|
@ -747,8 +747,8 @@ DWORD XGetLanguage()
|
|||
}
|
||||
|
||||
}
|
||||
DWORD XGetLocale()
|
||||
{
|
||||
DWORD XGetLocale()
|
||||
{
|
||||
int iLang;
|
||||
sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang);
|
||||
switch(iLang)
|
||||
|
|
@ -784,7 +784,7 @@ DWORD XGetLocale()
|
|||
}
|
||||
}
|
||||
|
||||
DWORD XEnableGuestSignin(BOOL fEnable)
|
||||
{
|
||||
return 0;
|
||||
DWORD XEnableGuestSignin(BOOL fEnable)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ DWORD TlsAlloc(VOID);
|
|||
LPVOID TlsGetValue(DWORD dwTlsIndex);
|
||||
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
|
||||
|
||||
typedef struct _RECT
|
||||
typedef struct _RECT
|
||||
{
|
||||
LONG left;
|
||||
LONG top;
|
||||
|
|
@ -37,16 +37,16 @@ typedef int errno_t;
|
|||
// // The following field is used for blocking when there is contention for
|
||||
// // the resource
|
||||
// //
|
||||
//
|
||||
//
|
||||
// union {
|
||||
// ULONG_PTR RawEvent[4];
|
||||
// } Synchronization;
|
||||
//
|
||||
//
|
||||
// //
|
||||
// // The following three fields control entering and exiting the critical
|
||||
// // section for the resource
|
||||
// //
|
||||
//
|
||||
//
|
||||
// LONG LockCount;
|
||||
// LONG RecursionCount;
|
||||
// HANDLE OwningThread;
|
||||
|
|
@ -214,7 +214,7 @@ typedef struct _MEMORYSTATUS {
|
|||
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
|
||||
|
||||
#define WAIT_TIMEOUT 258L
|
||||
#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
|
||||
#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
|
||||
#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
|
||||
|
||||
#define MAXUINT_PTR (~((UINT_PTR)0))
|
||||
|
|
@ -256,17 +256,17 @@ typedef struct _MEMORYSTATUS {
|
|||
#define GENERIC_EXECUTE (0x20000000L)
|
||||
#define GENERIC_ALL (0x10000000L)
|
||||
|
||||
#define FILE_SHARE_READ 0x00000001
|
||||
#define FILE_SHARE_WRITE 0x00000002
|
||||
#define FILE_SHARE_DELETE 0x00000004
|
||||
#define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define FILE_ATTRIBUTE_DEVICE 0x00000040
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
|
||||
#define FILE_SHARE_READ 0x00000001
|
||||
#define FILE_SHARE_WRITE 0x00000002
|
||||
#define FILE_SHARE_DELETE 0x00000004
|
||||
#define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define FILE_ATTRIBUTE_DEVICE 0x00000040
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
|
||||
|
||||
#define FILE_FLAG_WRITE_THROUGH 0x80000000
|
||||
#define FILE_FLAG_OVERLAPPED 0x40000000
|
||||
|
|
@ -286,38 +286,38 @@ typedef struct _MEMORYSTATUS {
|
|||
#define OPEN_ALWAYS 4
|
||||
#define TRUNCATE_EXISTING 5
|
||||
|
||||
#define PAGE_NOACCESS 0x01
|
||||
#define PAGE_READONLY 0x02
|
||||
#define PAGE_READWRITE 0x04
|
||||
#define PAGE_WRITECOPY 0x08
|
||||
#define PAGE_EXECUTE 0x10
|
||||
#define PAGE_EXECUTE_READ 0x20
|
||||
#define PAGE_EXECUTE_READWRITE 0x40
|
||||
#define PAGE_EXECUTE_WRITECOPY 0x80
|
||||
#define PAGE_GUARD 0x100
|
||||
#define PAGE_NOCACHE 0x200
|
||||
#define PAGE_WRITECOMBINE 0x400
|
||||
#define PAGE_USER_READONLY 0x1000
|
||||
#define PAGE_USER_READWRITE 0x2000
|
||||
#define MEM_COMMIT 0x1000
|
||||
#define MEM_RESERVE 0x2000
|
||||
#define MEM_DECOMMIT 0x4000
|
||||
#define MEM_RELEASE 0x8000
|
||||
#define MEM_FREE 0x10000
|
||||
#define MEM_PRIVATE 0x20000
|
||||
#define MEM_RESET 0x80000
|
||||
#define MEM_TOP_DOWN 0x100000
|
||||
#define MEM_NOZERO 0x800000
|
||||
#define MEM_LARGE_PAGES 0x20000000
|
||||
#define MEM_HEAP 0x40000000
|
||||
#define MEM_16MB_PAGES 0x80000000
|
||||
#define PAGE_NOACCESS 0x01
|
||||
#define PAGE_READONLY 0x02
|
||||
#define PAGE_READWRITE 0x04
|
||||
#define PAGE_WRITECOPY 0x08
|
||||
#define PAGE_EXECUTE 0x10
|
||||
#define PAGE_EXECUTE_READ 0x20
|
||||
#define PAGE_EXECUTE_READWRITE 0x40
|
||||
#define PAGE_EXECUTE_WRITECOPY 0x80
|
||||
#define PAGE_GUARD 0x100
|
||||
#define PAGE_NOCACHE 0x200
|
||||
#define PAGE_WRITECOMBINE 0x400
|
||||
#define PAGE_USER_READONLY 0x1000
|
||||
#define PAGE_USER_READWRITE 0x2000
|
||||
#define MEM_COMMIT 0x1000
|
||||
#define MEM_RESERVE 0x2000
|
||||
#define MEM_DECOMMIT 0x4000
|
||||
#define MEM_RELEASE 0x8000
|
||||
#define MEM_FREE 0x10000
|
||||
#define MEM_PRIVATE 0x20000
|
||||
#define MEM_RESET 0x80000
|
||||
#define MEM_TOP_DOWN 0x100000
|
||||
#define MEM_NOZERO 0x800000
|
||||
#define MEM_LARGE_PAGES 0x20000000
|
||||
#define MEM_HEAP 0x40000000
|
||||
#define MEM_16MB_PAGES 0x80000000
|
||||
|
||||
#define IGNORE 0 // Ignore signal
|
||||
#define INFINITE 0xFFFFFFFF // Infinite timeout
|
||||
#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
|
||||
#define STATUS_WAIT_0 ((DWORD )0x00000000L)
|
||||
#define STATUS_WAIT_0 ((DWORD )0x00000000L)
|
||||
#define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
|
||||
#define STATUS_PENDING ((DWORD )0x00000103L)
|
||||
#define STATUS_PENDING ((DWORD )0x00000103L)
|
||||
#define STILL_ACTIVE STATUS_PENDING
|
||||
|
||||
DWORD GetLastError(VOID);
|
||||
|
|
@ -356,9 +356,9 @@ VOID OutputDebugString(LPCSTR lpOutputString);
|
|||
VOID OutputDebugStringA(LPCSTR lpOutputString);
|
||||
|
||||
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix);
|
||||
errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix);
|
||||
errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix);
|
||||
|
||||
#define __declspec(a)
|
||||
#define __declspec(a)
|
||||
extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src);
|
||||
|
||||
size_t wcsnlen(const wchar_t *wcs, size_t maxsize);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ typedef unsigned int *PUINT;
|
|||
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef long __int64;
|
||||
typedef unsigned long __uint64;
|
||||
typedef unsigned int DWORD;
|
||||
typedef int INT;
|
||||
typedef unsigned long ULONG_PTR, *PULONG_PTR;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
|
|||
|
||||
m_bVoiceChatAndUGCRestricted=false;
|
||||
m_bDisplayFullVersionPurchase=false;
|
||||
// #ifdef _DEBUG_MENUS_ENABLED
|
||||
// #ifdef _DEBUG_MENUS_ENABLED
|
||||
// debugOverlayCreated = false;
|
||||
// #endif
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo)
|
|||
|
||||
DWORD dwHigh=0;
|
||||
pDLCInfo->dwImageBytes = GetFileSize(hFile,&dwHigh);
|
||||
|
||||
|
||||
if(pDLCInfo->dwImageBytes!=0)
|
||||
{
|
||||
DWORD dwBytesRead;
|
||||
|
|
@ -400,7 +400,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
||||
bool isFlat = false;
|
||||
__int64 seedValue = 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
|
||||
int64_t seedValue = 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;
|
||||
|
|
@ -485,7 +485,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
|||
|
||||
break;
|
||||
case eCommerce_State_GetProductList:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_GetProductList_Pending;
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
std::list<SonyCommerce::CategoryInfoSub>::iterator iter = pCategories->subCategories.begin();
|
||||
|
|
@ -501,7 +501,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
|||
|
||||
break;
|
||||
case eCommerce_State_AddProductInfoDetailed:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending;
|
||||
|
||||
// for each of the products in the categories, get the detailed info. We really only need the long description and price info.
|
||||
|
|
@ -538,7 +538,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
|||
break;
|
||||
|
||||
case eCommerce_State_RegisterDLC:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_Online;
|
||||
// register the DLC info
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
|
|
@ -625,20 +625,20 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo()
|
|||
|
||||
return &m_CategoryInfo;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void CConsoleMinecraftApp::ClearCommerceDetails()
|
||||
{
|
||||
#ifdef ORBIS_COMMERCE_ENABLED
|
||||
for(int i=0;i<m_ProductListCategoriesC;i++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
pProductList->clear();
|
||||
}
|
||||
|
||||
if(m_ProductListA!=NULL)
|
||||
{
|
||||
delete [] m_ProductListA;
|
||||
delete [] m_ProductListA;
|
||||
m_ProductListA=NULL;
|
||||
}
|
||||
|
||||
|
|
@ -674,11 +674,11 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
|
|||
{
|
||||
SonyCommerce::ProductInfo Info=*it;
|
||||
if(strcmp(pchDLCProductID,Info.productId)==0)
|
||||
{
|
||||
{
|
||||
memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -689,7 +689,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
|
|||
void CConsoleMinecraftApp::Checkout(char *pchSkuID)
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
strcpy(m_pchSkuID,pchSkuID);
|
||||
m_eCommerce_State=eCommerce_State_Checkout;
|
||||
}
|
||||
|
|
@ -698,7 +698,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID)
|
|||
void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
strcpy(m_pchSkuID,pchSkuID);
|
||||
m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased;
|
||||
}
|
||||
|
|
@ -707,7 +707,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
|
|||
bool CConsoleMinecraftApp::UpgradeTrial()
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_UpgradeTrial;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -749,12 +749,12 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
|
|||
// {
|
||||
// std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
// AUTO_VAR(itEnd, pProductList->end());
|
||||
//
|
||||
//
|
||||
// for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
|
||||
// {
|
||||
// SonyCommerce::ProductInfo Info=*it;
|
||||
// if(strcmp(pchTitle,Info.skuId)==0)
|
||||
// {
|
||||
// {
|
||||
// ORBIS_STUBBED;
|
||||
// SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF
|
||||
// // if(Info.purchasabilityFlag==SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF)
|
||||
|
|
@ -766,7 +766,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
|
|||
// // return false;
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
#endif // #ifdef ORBIS_COMMERCE_ENABLED
|
||||
|
|
@ -804,7 +804,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err)
|
|||
if(err==0)
|
||||
{
|
||||
pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories;
|
||||
// allocate the memory for the product info for each categories
|
||||
// allocate the memory for the product info for each categories
|
||||
if(pClass->m_CategoryInfo.countOfSubCategories>0)
|
||||
{
|
||||
pClass->m_ProductListA = (std::vector<SonyCommerce::ProductInfo> *) new std::vector<SonyCommerce::ProductInfo> [pClass->m_CategoryInfo.countOfSubCategories];
|
||||
|
|
@ -838,7 +838,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
|
|||
{
|
||||
// we're done, so now retrieve the additional product details for each product
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -848,21 +848,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
|
|||
else
|
||||
{
|
||||
pClass->m_eCommerce_State=eCommerce_State_Error;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
}
|
||||
}
|
||||
|
||||
// void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err)
|
||||
// {
|
||||
// CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam;
|
||||
//
|
||||
//
|
||||
// if(err==0)
|
||||
// {
|
||||
// pScene->m_eCommerce_State=eCommerce_State_Idle;
|
||||
// //pScene->m_bCommerceProductListRetrieved=true;
|
||||
// //pScene->m_bCommerceProductListRetrieved=true;
|
||||
// }
|
||||
// //printf("Callback hit, error 0x%08x\n", err);
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err)
|
||||
|
|
@ -882,7 +882,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
|||
{
|
||||
// MGH - change this to a while loop so we can skip empty categories.
|
||||
do
|
||||
{
|
||||
{
|
||||
pClass->m_iCurrentCategory++;
|
||||
}while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategory<pClass->m_ProductListCategoriesC);
|
||||
|
||||
|
|
@ -891,12 +891,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
|||
{
|
||||
// there are no more categories, so we're done
|
||||
pClass->m_eCommerce_State=eCommerce_State_RegisterDLC;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// continue with the next category
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -908,7 +908,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
|||
else
|
||||
{
|
||||
pClass->m_eCommerce_State=eCommerce_State_Error;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_iCurrentProduct=0;
|
||||
pClass->m_iCurrentCategory=0;
|
||||
}
|
||||
|
|
@ -1062,9 +1062,9 @@ void CConsoleMinecraftApp::SystemServiceTick()
|
|||
for (int i = 0; i < status.eventNum; i++)
|
||||
{
|
||||
ret = sceSystemServiceReceiveEvent(&event);
|
||||
if (ret == SCE_OK)
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
switch(event.eventType)
|
||||
switch(event.eventType)
|
||||
{
|
||||
case SCE_SYSTEM_SERVICE_EVENT_GAME_CUSTOM_DATA:
|
||||
{
|
||||
|
|
@ -1072,7 +1072,7 @@ void CConsoleMinecraftApp::SystemServiceTick()
|
|||
// Processing after invitation
|
||||
//SceNpSessionInvitationEventParam* pInvite = (SceNpSessionInvitationEventParam*)event.data.param;
|
||||
//SQRNetworkManager_Orbis::GetInviteDataAndProcess(pInvite);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case SCE_SYSTEM_SERVICE_EVENT_ON_RESUME:
|
||||
// Resume means that the user signed out (but came back), sensible thing to do is exit to main menu
|
||||
|
|
@ -1217,7 +1217,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
|||
|
||||
bool bEmptyStore=true;
|
||||
if(pCategories!=NULL)
|
||||
{
|
||||
{
|
||||
if(pCategories->countOfProducts>0)
|
||||
{
|
||||
bEmptyStore=false;
|
||||
|
|
@ -1247,7 +1247,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
|||
void CConsoleMinecraftApp::ShowPatchAvailableError()
|
||||
{
|
||||
int32_t ret=sceErrorDialogInitialize();
|
||||
if ( ret==SCE_OK )
|
||||
if ( ret==SCE_OK )
|
||||
{
|
||||
m_bPatchAvailableDialogRunning = true;
|
||||
|
||||
|
|
@ -1256,7 +1256,7 @@ void CConsoleMinecraftApp::ShowPatchAvailableError()
|
|||
// 4J-PB - We want to display the option to get the patch now
|
||||
param.errorCode = SCE_NP_ERROR_LATEST_PATCH_PKG_DOWNLOADED;
|
||||
ret = sceUserServiceGetInitialUser( ¶m.userId );
|
||||
if ( ret == SCE_OK )
|
||||
if ( ret == SCE_OK )
|
||||
{
|
||||
ret=sceErrorDialogOpen( ¶m );
|
||||
}
|
||||
|
|
@ -1266,9 +1266,9 @@ void CConsoleMinecraftApp::ShowPatchAvailableError()
|
|||
void CConsoleMinecraftApp::PatchAvailableDialogTick()
|
||||
{
|
||||
if(m_bPatchAvailableDialogRunning)
|
||||
{
|
||||
{
|
||||
SceErrorDialogStatus stat = sceErrorDialogUpdateStatus();
|
||||
if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED )
|
||||
if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED )
|
||||
{
|
||||
sceErrorDialogTerminate();
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int user_malloc_init(void)
|
|||
int res;
|
||||
void *addr;
|
||||
uint64_t dmemSize = SCE_KERNEL_MAIN_DMEM_SIZE;
|
||||
|
||||
|
||||
s_heapLength = ((size_t)4608) * 1024 * 1024; // Initial allocation for the application
|
||||
s_heapLength -= ((size_t)4) * 1024 * 1024; // Allocated for TLS
|
||||
s_heapLength -= ((size_t)2) * 1024 * 1024; // 64K (sometimes?) allocated for razor - rounding up to 2MB here to match our alignment
|
||||
|
|
@ -106,10 +106,10 @@ void *user_malloc(size_t size)
|
|||
{
|
||||
#if 0
|
||||
static int throttle = 0;
|
||||
static __int64 lasttime = 0;
|
||||
static int64_t lasttime = 0;
|
||||
if( ( throttle % 100 ) == 0 )
|
||||
{
|
||||
__int64 nowtime = System::currentTimeMillis();
|
||||
int64_t nowtime = System::currentTimeMillis();
|
||||
if( ( nowtime - lasttime ) > 20000 )
|
||||
{
|
||||
lasttime = nowtime;
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed long long
|
||||
#define RAD_UINTa __w64 unsigned long long
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((uint64_t)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -114,8 +114,8 @@
|
|||
#define __RADLITTLEENDIAN__
|
||||
#ifdef __i386__
|
||||
#define __RADX86__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#else
|
||||
#define __RADARM__
|
||||
#endif
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
#define __RADX86__
|
||||
#else
|
||||
#error Unknown processor
|
||||
#endif
|
||||
#endif
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
#define __RADNACL__
|
||||
#define __RAD32__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define __RADX86__
|
||||
#define __RADX86__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
#define __RAD64REGS__
|
||||
#define __RADLITTLEENDIAN__
|
||||
#define RADINLINE inline
|
||||
#define RADRESTRICT __restrict
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
#endif
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
|
||||
|
||||
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
|
||||
|
||||
#define __RADWIIU__
|
||||
|
|
@ -480,7 +480,7 @@
|
|||
|
||||
#undef RADRESTRICT /* could have been defined above... */
|
||||
#define RADRESTRICT __restrict
|
||||
|
||||
|
||||
#undef RADSTRUCT
|
||||
#define RADSTRUCT struct __attribute__((__packed__))
|
||||
#endif
|
||||
|
|
@ -885,7 +885,7 @@
|
|||
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
|
||||
#else
|
||||
// NOTE: / / is a guaranteed parse error in C/C++.
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
|
||||
#endif
|
||||
|
||||
// WARNING : RAD_TLS should really only be used for debug/tools stuff
|
||||
|
|
@ -917,8 +917,8 @@
|
|||
#define RAD_S32 signed int
|
||||
// But pointers are 64 bits.
|
||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||
#define RAD_SINTa __w64 signed __int64
|
||||
#define RAD_UINTa __w64 unsigned __int64
|
||||
#define RAD_SINTa __w64 signed long long
|
||||
#define RAD_UINTa __w64 unsigned long long
|
||||
#else // non-vc.net compiler or /Wp64 turned off
|
||||
#define RAD_UINTa unsigned long long
|
||||
#define RAD_SINTa signed long long
|
||||
|
|
@ -976,8 +976,8 @@
|
|||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||
#define RAD_U64 unsigned __int64
|
||||
#define RAD_S64 signed __int64
|
||||
#define RAD_U64 unsigned long long
|
||||
#define RAD_S64 signed long long
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -1134,7 +1134,7 @@
|
|||
|
||||
// helpers for doing an if ( ) with expect :
|
||||
// if ( RAD_LIKELY(expr) ) { ... }
|
||||
|
||||
|
||||
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
|
||||
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
|
||||
|
||||
|
|
@ -1324,7 +1324,7 @@
|
|||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
} while(0) \
|
||||
__pragma(warning(pop))
|
||||
__pragma(warning(pop))
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
__pragma(warning(push)) \
|
||||
|
|
@ -1333,10 +1333,10 @@
|
|||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
#else
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#define RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
#endif
|
||||
|
||||
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
|
||||
|
|
@ -1345,7 +1345,7 @@
|
|||
|
||||
#define RAD_STATEMENT_END_FALSE \
|
||||
} while ( (void)0,0 )
|
||||
|
||||
|
||||
#define RAD_STATEMENT_END_TRUE \
|
||||
} while ( (void)1,1 )
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
RAD_STATEMENT_START \
|
||||
code \
|
||||
RAD_STATEMENT_END_FALSE
|
||||
|
||||
|
||||
#define RAD_INFINITE_LOOP( code ) \
|
||||
RAD_STATEMENT_START \
|
||||
code \
|
||||
|
|
@ -1363,7 +1363,7 @@
|
|||
|
||||
|
||||
// Must be placed after variable declarations for code compiled as .c
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
|
||||
# define RR_UNUSED_VARIABLE(x) (void) x
|
||||
#else
|
||||
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
|
||||
|
|
@ -1473,7 +1473,7 @@
|
|||
// just to make gcc shut up about derefing null :
|
||||
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
|
||||
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
|
||||
|
||||
|
||||
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
|
||||
// you should then RR_ASSERT( &(ret->member) == ptr );
|
||||
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
|
||||
|
|
@ -1482,7 +1482,7 @@
|
|||
// Cache / prefetch macros :
|
||||
|
||||
// RR_PREFETCH for various platforms :
|
||||
//
|
||||
//
|
||||
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
|
||||
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
|
||||
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
|
||||
|
|
@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
||||
// RAD_NO_BREAK : option if you don't like your assert to break
|
||||
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
|
||||
#ifdef RAD_NO_BREAK
|
||||
|
|
@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
|
|||
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
|
||||
|
||||
//-----------------------------------
|
||||
#ifdef RR_DO_ASSERTS
|
||||
#ifdef RR_DO_ASSERTS
|
||||
|
||||
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
|
||||
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
|
||||
|
|
@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
|
|||
#define RR_BSWAP16 _byteswap_ushort
|
||||
#define RR_BSWAP32 _byteswap_ulong
|
||||
|
||||
unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
|
||||
unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define RR_BSWAP64 _byteswap_uint64
|
||||
|
||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
|||
return _Long;
|
||||
}
|
||||
|
||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
||||
RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
|
||||
{
|
||||
__asm {
|
||||
mov eax, DWORD PTR _Long
|
||||
|
|
@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
|
|||
|
||||
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
|
||||
|
||||
unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
||||
unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
|
|||
|
||||
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
|
||||
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
|
||||
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
|
||||
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -27,21 +27,21 @@
|
|||
void SonyRemoteStorage_PS3::npauthhandler(int event, int result, void *arg)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0)
|
||||
if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0)
|
||||
{
|
||||
app.DebugPrintf("Could not retrieve ticket: 0x%x\n", result);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
psnTicketSize = result;
|
||||
psnTicket = malloc(psnTicketSize);
|
||||
if (psnTicket == NULL)
|
||||
if (psnTicket == NULL)
|
||||
{
|
||||
app.DebugPrintf("Failed to allocate for ticket\n");
|
||||
}
|
||||
|
||||
int ret = sceNpManagerGetTicket(psnTicket, &psnTicketSize);
|
||||
if (ret < 0)
|
||||
if (ret < 0)
|
||||
{
|
||||
app.DebugPrintf("Could not retrieve ticket: 0x%x\n", ret);
|
||||
free(psnTicket);
|
||||
|
|
@ -60,7 +60,7 @@ int SonyRemoteStorage_PS3::initPreconditions()
|
|||
SceNpId npId;
|
||||
|
||||
ret = sceNpManagerGetNpId(&npId);
|
||||
if(ret < 0)
|
||||
if(ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -68,12 +68,12 @@ int SonyRemoteStorage_PS3::initPreconditions()
|
|||
ticketVersion.major = 3;
|
||||
ticketVersion.minor = 0;
|
||||
ret = sceNpManagerRequestTicket2(&npId, &ticketVersion, TICKETING_SERVICE_ID, NULL, 0, NULL, 0);
|
||||
if(ret < 0)
|
||||
if(ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
m_waitingForTicket = true;
|
||||
while(m_waitingForTicket)
|
||||
while(m_waitingForTicket)
|
||||
{
|
||||
cellSysutilCheckCallback();
|
||||
sys_timer_usleep(50000); //50 milliseconds.
|
||||
|
|
@ -104,12 +104,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
|
|||
break;
|
||||
|
||||
case GET_DATA_RESULT:
|
||||
if(retCode >= 0)
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Data success \n");
|
||||
m_status = e_getDataSucceeded;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
|
|
@ -126,12 +126,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
|
|||
break;
|
||||
|
||||
case GET_STATUS_RESULT:
|
||||
if(retCode >= 0)
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Status success \n");
|
||||
app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs);
|
||||
app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles);
|
||||
for(int i = 0; i < outputGetStatus->numFiles; i++)
|
||||
for(int i = 0; i < outputGetStatus->numFiles; i++)
|
||||
{
|
||||
app.DebugPrintf("\n*** File %d information: ***\n", (i + 1));
|
||||
app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName);
|
||||
|
|
@ -142,8 +142,8 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
|
|||
app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write"));
|
||||
}
|
||||
m_status = e_getStatusSucceeded;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
|
|
@ -158,12 +158,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
|
|||
break;
|
||||
|
||||
case SET_DATA_RESULT:
|
||||
if(retCode >= 0)
|
||||
if(retCode >= 0)
|
||||
{
|
||||
app.DebugPrintf("Set Data success \n");
|
||||
m_status = e_setDataSucceeded;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode);
|
||||
m_status = e_error;
|
||||
|
|
@ -230,7 +230,7 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam)
|
|||
params.callback = staticInternalCallback;
|
||||
params.userData = this;
|
||||
params.thread.threadAffinity = 0; //Not used in PS3
|
||||
params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest.
|
||||
params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest.
|
||||
params.psnTicket = psnTicket;
|
||||
params.psnTicketSize = psnTicketSize;
|
||||
strcpy(params.clientId, CLIENT_ID);
|
||||
|
|
@ -246,20 +246,20 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam)
|
|||
// SceRemoteStorageAbortReqParams abortParams;
|
||||
|
||||
ret = sceRemoteStorageInit(params);
|
||||
if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED)
|
||||
if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED)
|
||||
{
|
||||
// abortParams.requestId = ret;
|
||||
//ret = sceRemoteStorageAbort(abortParams);
|
||||
app.DebugPrintf("Session will be created \n");
|
||||
//if(ret >= 0)
|
||||
//if(ret >= 0)
|
||||
//{
|
||||
// printf("Session aborted \n");
|
||||
//} else
|
||||
//} else
|
||||
//{
|
||||
// printf("Error aborting session: 0x%x \n", ret);
|
||||
//}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error creating session: 0x%x \n", ret);
|
||||
return false;
|
||||
|
|
@ -279,12 +279,12 @@ bool SonyRemoteStorage_PS3::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, Cal
|
|||
reqId = sceRemoteStorageGetStatus(params, outputGetStatus);
|
||||
m_status = e_getStatusInProgress;
|
||||
|
||||
if(reqId >= 0)
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Status request sent \n");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId);
|
||||
return false;
|
||||
|
|
@ -303,11 +303,11 @@ void SonyRemoteStorage_PS3::abort()
|
|||
params.requestId = reqId;
|
||||
int ret = sceRemoteStorageAbort(params);
|
||||
|
||||
if(ret >= 0)
|
||||
if(ret >= 0)
|
||||
{
|
||||
app.DebugPrintf("Abort request done \n");
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error in Abort request: 0x%x \n", ret);
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ bool SonyRemoteStorage_PS3::setDataInternal()
|
|||
char seed[22];
|
||||
app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack);
|
||||
|
||||
__int64 iSeed = strtoll(seed,NULL,10);
|
||||
int64_t iSeed = strtoll(seed,NULL,10);
|
||||
char seedHex[17];
|
||||
sprintf(seedHex,"%016llx",iSeed);
|
||||
memcpy(descData.m_seed,seedHex,16); // Don't copy null
|
||||
|
|
@ -377,14 +377,14 @@ bool SonyRemoteStorage_PS3::setDataInternal()
|
|||
reqId = sceRemoteStorageSetData(params);
|
||||
|
||||
app.DebugPrintf("\n*******************************\n");
|
||||
if(reqId >= 0)
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Set Data request sent \n");
|
||||
m_bTransferStarted = true;
|
||||
m_status = e_setDataInProgress;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId);
|
||||
return false;
|
||||
|
|
@ -406,12 +406,12 @@ bool SonyRemoteStorage_PS3::getData( const char* remotePath, const char* localPa
|
|||
reqId = sceRemoteStorageGetData(params, &outputGetData);
|
||||
|
||||
app.DebugPrintf("\n*******************************\n");
|
||||
if(reqId >= 0)
|
||||
if(reqId >= 0)
|
||||
{
|
||||
app.DebugPrintf("Get Data request sent \n");
|
||||
m_bTransferStarted = true;
|
||||
m_status = e_getDataInProgress;
|
||||
} else
|
||||
} else
|
||||
{
|
||||
app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ typedef unsigned int uint32;
|
|||
typedef unsigned long long uint64;
|
||||
typedef long long int64;
|
||||
#else
|
||||
typedef unsigned __int64 uint64;
|
||||
typedef __int64 int64;
|
||||
typedef uint64_t uint64;
|
||||
typedef int64_t int64;
|
||||
#endif
|
||||
|
||||
typedef char int8;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <libsn.h>
|
||||
#include <cell/cell_fs.h>
|
||||
#include <sys/vm.h>
|
||||
#include <sys/memory.h>
|
||||
#include <sys/memory.h>
|
||||
#undef __in
|
||||
#undef __out
|
||||
#include <cell/atomic.h>
|
||||
|
|
@ -31,49 +31,49 @@ vector<int> vOpenFileHandles;
|
|||
namespace boost
|
||||
{
|
||||
void assertion_failed(char const * expr,
|
||||
char const * function, char const * file, long line)
|
||||
{
|
||||
char const * function, char const * file, long line)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Assert failed!!!\n");
|
||||
printf(expr);
|
||||
printf("\n");
|
||||
printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line);
|
||||
printf("Assert failed!!!\n");
|
||||
printf(expr);
|
||||
printf("\n");
|
||||
printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line);
|
||||
snPause();
|
||||
#endif
|
||||
} // user defined
|
||||
} // namespace boost
|
||||
|
||||
char* getConsoleHomePath()
|
||||
{
|
||||
return contentInfoPath;
|
||||
char* getConsoleHomePath()
|
||||
{
|
||||
return contentInfoPath;
|
||||
}
|
||||
|
||||
char* getUsrDirPath()
|
||||
{
|
||||
return usrdirPath;
|
||||
char* getUsrDirPath()
|
||||
{
|
||||
return usrdirPath;
|
||||
}
|
||||
|
||||
char* getConsoleHomePathBDPatch()
|
||||
{
|
||||
return contentInfoPathBDPatch;
|
||||
char* getConsoleHomePathBDPatch()
|
||||
{
|
||||
return contentInfoPathBDPatch;
|
||||
}
|
||||
|
||||
char* getUsrDirPathBDPatch()
|
||||
{
|
||||
return usrdirPathBDPatch;
|
||||
char* getUsrDirPathBDPatch()
|
||||
{
|
||||
return usrdirPathBDPatch;
|
||||
}
|
||||
|
||||
|
||||
char* getDirName()
|
||||
{
|
||||
return dirName;
|
||||
char* getDirName()
|
||||
{
|
||||
return dirName;
|
||||
}
|
||||
|
||||
int _wcsicmp( const wchar_t * dst, const wchar_t * src )
|
||||
{
|
||||
wchar_t f,l;
|
||||
|
||||
// validation section
|
||||
// validation section
|
||||
// _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR);
|
||||
// _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR);
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize)
|
|||
|
||||
Cnullptr nullptr;
|
||||
|
||||
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
||||
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
CellRtcDateTime dateTime;
|
||||
int err = cellRtcGetCurrentClock(&dateTime, 0);
|
||||
|
|
@ -118,8 +118,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
|
|||
}
|
||||
BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { PS3_STUBBED; return false; }
|
||||
BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { PS3_STUBBED; return false; }
|
||||
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
||||
{
|
||||
CellRtcDateTime dateTime;
|
||||
int err = cellRtcGetCurrentClockLocalTime(&dateTime);
|
||||
assert(err == CELL_OK);
|
||||
|
|
@ -135,26 +135,26 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
|
|||
}
|
||||
|
||||
HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return NULL; }
|
||||
VOID Sleep(DWORD dwMilliseconds)
|
||||
{
|
||||
VOID Sleep(DWORD dwMilliseconds)
|
||||
{
|
||||
C4JThread::Sleep(dwMilliseconds);
|
||||
}
|
||||
|
||||
BOOL SetThreadPriority(HANDLE hThread, int nPriority) { PS3_STUBBED; return FALSE; }
|
||||
DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { PS3_STUBBED; return false; }
|
||||
|
||||
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
|
||||
{
|
||||
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
|
||||
{
|
||||
return cellAtomicCompareAndSwap32((uint32_t*)Destination, (uint32_t)Comperand, (uint32_t)Exchange);
|
||||
}
|
||||
|
||||
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
|
||||
{
|
||||
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
|
||||
{
|
||||
return cellAtomicCompareAndSwap64((uint64_t*)Destination, (uint64_t)Comperand, (uint64_t)Exchange);
|
||||
}
|
||||
|
||||
|
||||
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
sys_lwmutex_attribute_t attr;
|
||||
// from the defaults in sys_lwmutex_attribute_initialize
|
||||
|
|
@ -167,7 +167,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
}
|
||||
|
||||
|
||||
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
|
||||
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
|
||||
{
|
||||
// no spin count on PS3
|
||||
InitializeCriticalSection(CriticalSection);
|
||||
|
|
@ -179,9 +179,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
PS3_ASSERT_CELL_ERROR(err);
|
||||
}
|
||||
|
||||
extern CRITICAL_SECTION g_singleThreadCS;
|
||||
extern CRITICAL_SECTION g_singleThreadCS;
|
||||
|
||||
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
// if(CriticalSection != &g_singleThreadCS &&(C4JThread::isMainThread() == false) )
|
||||
// LeaveCriticalSection(&g_singleThreadCS);
|
||||
|
|
@ -192,7 +192,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
}
|
||||
|
||||
|
||||
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
int err = sys_lwmutex_unlock(CriticalSection);
|
||||
PS3_ASSERT_CELL_ERROR(err);
|
||||
|
|
@ -200,7 +200,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
|
|||
|
||||
ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||
{
|
||||
int err = sys_lwmutex_trylock(CriticalSection);
|
||||
int err = sys_lwmutex_trylock(CriticalSection);
|
||||
if(err == CELL_OK)
|
||||
return true;
|
||||
return false;
|
||||
|
|
@ -209,8 +209,8 @@ DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll
|
|||
|
||||
|
||||
|
||||
BOOL CloseHandle(HANDLE hObject)
|
||||
{
|
||||
BOOL CloseHandle(HANDLE hObject)
|
||||
{
|
||||
if(hObject==INVALID_HANDLE_VALUE)
|
||||
{
|
||||
//printf("\n\nTRYING TO CLOSE AN INVALID FILE HANDLE\n\n");
|
||||
|
|
@ -219,7 +219,7 @@ BOOL CloseHandle(HANDLE hObject)
|
|||
else
|
||||
{
|
||||
CellFsErrno err;
|
||||
err=cellFsClose(int(hObject));
|
||||
err=cellFsClose(int(hObject));
|
||||
if(err==CELL_FS_SUCCEEDED)
|
||||
{
|
||||
iFilesOpen--;
|
||||
|
|
@ -235,7 +235,7 @@ BOOL CloseHandle(HANDLE hObject)
|
|||
}
|
||||
}
|
||||
//printf("\n\nFiles Open - %d\n\n",iFilesOpen);
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -249,8 +249,8 @@ BOOL SetEvent(HANDLE hEvent) { PS3_STUBBED; return false; }
|
|||
|
||||
HMODULE GetModuleHandle(LPCSTR lpModuleName) { PS3_STUBBED; return 0; }
|
||||
|
||||
sys_ppu_thread_t GetCurrentThreadId(VOID)
|
||||
{
|
||||
sys_ppu_thread_t GetCurrentThreadId(VOID)
|
||||
{
|
||||
sys_ppu_thread_t id;
|
||||
int err = sys_ppu_thread_get_id(&id);
|
||||
PS3_ASSERT_CELL_ERROR(err);
|
||||
|
|
@ -264,8 +264,8 @@ BOOL TlsFree(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->Free(dwTlsInd
|
|||
LPVOID TlsGetValue(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->GetValue(dwTlsIndex); }
|
||||
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return TLSStoragePS3::Instance()->SetValue(dwTlsIndex, lpTlsValue); }
|
||||
|
||||
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
|
||||
{
|
||||
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
|
||||
{
|
||||
int err;
|
||||
sys_addr_t newAddress = NULL;
|
||||
if(lpAddress == NULL)
|
||||
|
|
@ -299,7 +299,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO
|
|||
return (LPVOID)newAddress;
|
||||
}
|
||||
|
||||
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
|
||||
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
|
||||
{
|
||||
if(dwFreeType == MEM_DECOMMIT)
|
||||
{
|
||||
|
|
@ -307,12 +307,12 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
|
|||
sys_vm_statistics_t stat;
|
||||
err = sys_vm_get_statistics((sys_addr_t)lpAddress, &stat);
|
||||
PS3_ASSERT(err == CELL_OK);
|
||||
|
||||
|
||||
// 4J Stu - We can only return what we have actually committed on PS3
|
||||
// From PS3 Docs:
|
||||
// The maximum amount of memory that can be returned is the difference of the total amount of physical memory used by the virtual memory area minus 1MB. When an amount exceeding this value is specified, EBUSY will return.
|
||||
SIZE_T memToFree = stat.pmem_total - (1024 * 1024);
|
||||
if(dwSize < memToFree)
|
||||
if(dwSize < memToFree)
|
||||
memToFree = dwSize;
|
||||
|
||||
app.DebugPrintf("VirtualFree: Requested size - %d, Actual size - %d\n", dwSize, memToFree);
|
||||
|
|
@ -349,10 +349,10 @@ BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPD
|
|||
uint64_t bytesWritten;
|
||||
CellFsErrno err = cellFsWrite(fd, lpBuffer, nNumberOfBytesToWrite, &bytesWritten);
|
||||
*lpNumberOfBytesWritten = (DWORD)bytesWritten;
|
||||
return (err == CELL_FS_OK);
|
||||
return (err == CELL_FS_OK);
|
||||
}
|
||||
|
||||
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
|
||||
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
|
||||
{
|
||||
int fd = (int)hFile;
|
||||
uint64_t bytesRead;
|
||||
|
|
@ -374,7 +374,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD
|
|||
break;
|
||||
}
|
||||
|
||||
return (err==CELL_FS_SUCCEEDED);
|
||||
return (err==CELL_FS_SUCCEEDED);
|
||||
}
|
||||
|
||||
BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
|
||||
|
|
@ -407,7 +407,7 @@ void replaceBackslashes(char* szFilename)
|
|||
}
|
||||
}
|
||||
|
||||
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
{
|
||||
char filePath[256];
|
||||
std::string mountedPath;
|
||||
|
|
@ -445,7 +445,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
int fd = 0;
|
||||
int flags = 0;
|
||||
switch(dwDesiredAccess)
|
||||
{
|
||||
{
|
||||
case GENERIC_READ:
|
||||
flags = CELL_FS_O_RDONLY; break;
|
||||
case GENERIC_WRITE:
|
||||
|
|
@ -508,7 +508,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
switch(err)
|
||||
{
|
||||
case CELL_FS_SUCCEEDED:
|
||||
{
|
||||
{
|
||||
app.DebugPrintf("CELL_FS_SUCCEEDED\n");
|
||||
DWORD dwFileSize = (DWORD)statData.st_size;
|
||||
|
||||
|
|
@ -522,7 +522,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
// fd is invalid or the file system on a removable media has been unmounted
|
||||
|
||||
// When cellFsFstat() returns CELL_FS_EBADF, it can be deduced that the above error occurred because a disc was ejected.
|
||||
// Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose().
|
||||
// Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose().
|
||||
|
||||
app.DebugPrintf("CELL_FS_EBADF\n");
|
||||
CloseHandle((HANDLE)fd);
|
||||
|
|
@ -531,7 +531,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
//ShutdownManager::StartShutdown();
|
||||
|
||||
return INVALID_HANDLE_VALUE;
|
||||
|
||||
|
||||
case CELL_FS_EIO:
|
||||
app.DebugPrintf("CELL_FS_EIO\n");
|
||||
break;
|
||||
|
|
@ -550,8 +550,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
|||
return (void*)fd;
|
||||
}
|
||||
|
||||
BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
|
||||
{
|
||||
BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
|
||||
{
|
||||
char filePath[256];
|
||||
sprintf(filePath,"%s/%s",usrdirPath, lpPathName );
|
||||
CellFsErrno err = cellFsMkdir(filePath, CELL_FS_DEFAULT_CREATE_MODE_1);
|
||||
|
|
@ -563,12 +563,12 @@ BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribu
|
|||
|
||||
BOOL DeleteFileA(LPCSTR lpFileName) { PS3_STUBBED; return false; }
|
||||
|
||||
// BOOL XCloseHandle(HANDLE a)
|
||||
// {
|
||||
// cellFsClose(int(a));
|
||||
// BOOL XCloseHandle(HANDLE a)
|
||||
// {
|
||||
// cellFsClose(int(a));
|
||||
// }
|
||||
|
||||
DWORD GetFileAttributesA(LPCSTR lpFileName)
|
||||
DWORD GetFileAttributesA(LPCSTR lpFileName)
|
||||
{
|
||||
char filePath[256];
|
||||
std::string mountedPath = StorageManager.GetMountedPath(lpFileName);
|
||||
|
|
@ -582,7 +582,7 @@ DWORD GetFileAttributesA(LPCSTR lpFileName)
|
|||
sprintf(filePath,"%s/%s",usrdirPath, lpFileName ); // set to load from host
|
||||
|
||||
//strcat(filePath,".edat");
|
||||
|
||||
|
||||
//printf("GetFileAttributesA - %s\n",filePath);
|
||||
|
||||
// check if the file exists first
|
||||
|
|
@ -606,7 +606,7 @@ VOID DebugBreak(VOID) { snPause(); }
|
|||
|
||||
|
||||
DWORD GetLastError(VOID) { PS3_STUBBED; return 0; }
|
||||
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
||||
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
||||
{
|
||||
malloc_managed_size stat;
|
||||
int err = malloc_stats(&stat);
|
||||
|
|
@ -620,20 +620,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
|
|||
lpBuffer->dwAvailVirtual = stat.max_system_size - stat.current_inuse_size;
|
||||
}
|
||||
|
||||
DWORD GetTickCount()
|
||||
DWORD GetTickCount()
|
||||
{
|
||||
// This function returns the current system time at this function is called.
|
||||
// This function returns the current system time at this function is called.
|
||||
// The system time is represented the time elapsed since the system starts up in microseconds.
|
||||
system_time_t sysTime = sys_time_get_system_time();
|
||||
return sysTime / 1000;
|
||||
return sysTime / 1000;
|
||||
}
|
||||
|
||||
// we should really use libperf for this kind of thing, but this will do for now.
|
||||
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
// microseconds
|
||||
lpFrequency->QuadPart = (1000 * 1000);
|
||||
return false;
|
||||
lpFrequency->QuadPart = (1000 * 1000);
|
||||
return false;
|
||||
}
|
||||
BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
|
||||
{
|
||||
|
|
@ -646,24 +646,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
|
|||
}
|
||||
|
||||
#ifndef _FINAL_BUILD
|
||||
VOID OutputDebugStringW(LPCWSTR lpOutputString)
|
||||
{
|
||||
wprintf(lpOutputString);
|
||||
VOID OutputDebugStringW(LPCWSTR lpOutputString)
|
||||
{
|
||||
wprintf(lpOutputString);
|
||||
}
|
||||
|
||||
VOID OutputDebugString(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
VOID OutputDebugString(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
}
|
||||
|
||||
VOID OutputDebugStringA(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
VOID OutputDebugStringA(LPCSTR lpOutputString)
|
||||
{
|
||||
printf(lpOutputString);
|
||||
}
|
||||
#endif // _CONTENT_PACKAGE
|
||||
|
||||
BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation)
|
||||
{
|
||||
{
|
||||
PS3_STUBBED;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -671,7 +671,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { PS3
|
|||
BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { PS3_STUBBED; return false;}
|
||||
|
||||
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; }
|
||||
errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
|
||||
errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
|
||||
|
||||
int _wtoi(const wchar_t *_Str)
|
||||
{
|
||||
|
|
@ -680,13 +680,13 @@ int _wtoi(const wchar_t *_Str)
|
|||
|
||||
|
||||
|
||||
DWORD XGetLanguage()
|
||||
{
|
||||
DWORD XGetLanguage()
|
||||
{
|
||||
unsigned char ucLang = app.GetMinecraftLanguage(0);
|
||||
int iLang;
|
||||
|
||||
// check if we should override the system language or not
|
||||
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
|
||||
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
|
||||
{
|
||||
cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang);
|
||||
}
|
||||
|
|
@ -701,7 +701,7 @@ DWORD XGetLanguage()
|
|||
case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LANGUAGE_ENGLISH;
|
||||
case CELL_SYSUTIL_LANG_FRENCH : return XC_LANGUAGE_FRENCH;
|
||||
|
||||
case CELL_SYSUTIL_LANG_SPANISH :
|
||||
case CELL_SYSUTIL_LANG_SPANISH :
|
||||
if(app.IsAmericanSKU())
|
||||
{
|
||||
return XC_LANGUAGE_LATINAMERICANSPANISH;
|
||||
|
|
@ -714,7 +714,7 @@ DWORD XGetLanguage()
|
|||
case CELL_SYSUTIL_LANG_GERMAN : return XC_LANGUAGE_GERMAN;
|
||||
case CELL_SYSUTIL_LANG_ITALIAN : return XC_LANGUAGE_ITALIAN;
|
||||
case CELL_SYSUTIL_LANG_PORTUGUESE_PT : return XC_LANGUAGE_PORTUGUESE;
|
||||
|
||||
|
||||
case CELL_SYSUTIL_LANG_RUSSIAN : return XC_LANGUAGE_RUSSIAN;
|
||||
case CELL_SYSUTIL_LANG_KOREAN : return XC_LANGUAGE_KOREAN;
|
||||
case CELL_SYSUTIL_LANG_CHINESE_T : return XC_LANGUAGE_TCHINESE;
|
||||
|
|
@ -735,8 +735,8 @@ DWORD XGetLanguage()
|
|||
}
|
||||
|
||||
}
|
||||
DWORD XGetLocale()
|
||||
{
|
||||
DWORD XGetLocale()
|
||||
{
|
||||
int iLang;
|
||||
cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang);
|
||||
switch(iLang)
|
||||
|
|
@ -745,7 +745,7 @@ DWORD XGetLocale()
|
|||
case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LOCALE_UNITED_STATES;
|
||||
case CELL_SYSUTIL_LANG_FRENCH : return XC_LOCALE_FRANCE;
|
||||
|
||||
case CELL_SYSUTIL_LANG_SPANISH :
|
||||
case CELL_SYSUTIL_LANG_SPANISH :
|
||||
if(app.IsAmericanSKU())
|
||||
{
|
||||
return XC_LOCALE_LATIN_AMERICA;
|
||||
|
|
@ -753,7 +753,7 @@ DWORD XGetLocale()
|
|||
else
|
||||
{
|
||||
return XC_LOCALE_SPAIN;
|
||||
}
|
||||
}
|
||||
return XC_LOCALE_SPAIN;
|
||||
|
||||
case CELL_SYSUTIL_LANG_GERMAN : return XC_LOCALE_GERMANY;
|
||||
|
|
@ -777,11 +777,11 @@ DWORD XGetLocale()
|
|||
|
||||
case CELL_SYSUTIL_LANG_CHINESE_S : return XC_LOCALE_CHINA;
|
||||
default : return XC_LOCALE_UNITED_STATES;
|
||||
}
|
||||
}
|
||||
}
|
||||
DWORD XEnableGuestSignin(BOOL fEnable)
|
||||
{
|
||||
return 0;
|
||||
DWORD XEnableGuestSignin(BOOL fEnable)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // __PS3__
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ LPVOID TlsGetValue(DWORD dwTlsIndex);
|
|||
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
|
||||
|
||||
|
||||
typedef struct _RECT
|
||||
typedef struct _RECT
|
||||
{
|
||||
LONG left;
|
||||
LONG top;
|
||||
|
|
@ -53,16 +53,16 @@ typedef int errno_t;
|
|||
// // The following field is used for blocking when there is contention for
|
||||
// // the resource
|
||||
// //
|
||||
//
|
||||
//
|
||||
// union {
|
||||
// ULONG_PTR RawEvent[4];
|
||||
// } Synchronization;
|
||||
//
|
||||
//
|
||||
// //
|
||||
// // The following three fields control entering and exiting the critical
|
||||
// // section for the resource
|
||||
// //
|
||||
//
|
||||
//
|
||||
// LONG LockCount;
|
||||
// LONG RecursionCount;
|
||||
// HANDLE OwningThread;
|
||||
|
|
@ -219,7 +219,7 @@ typedef struct _MEMORYSTATUS {
|
|||
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
|
||||
|
||||
#define WAIT_TIMEOUT 258L
|
||||
#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
|
||||
#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
|
||||
#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
|
||||
|
||||
#define MAXUINT_PTR (~((UINT_PTR)0))
|
||||
|
|
@ -261,17 +261,17 @@ typedef struct _MEMORYSTATUS {
|
|||
#define GENERIC_EXECUTE (0x20000000L)
|
||||
#define GENERIC_ALL (0x10000000L)
|
||||
|
||||
#define FILE_SHARE_READ 0x00000001
|
||||
#define FILE_SHARE_WRITE 0x00000002
|
||||
#define FILE_SHARE_DELETE 0x00000004
|
||||
#define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define FILE_ATTRIBUTE_DEVICE 0x00000040
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
|
||||
#define FILE_SHARE_READ 0x00000001
|
||||
#define FILE_SHARE_WRITE 0x00000002
|
||||
#define FILE_SHARE_DELETE 0x00000004
|
||||
#define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define FILE_ATTRIBUTE_DEVICE 0x00000040
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
|
||||
|
||||
#define FILE_FLAG_WRITE_THROUGH 0x80000000
|
||||
#define FILE_FLAG_OVERLAPPED 0x40000000
|
||||
|
|
@ -291,38 +291,38 @@ typedef struct _MEMORYSTATUS {
|
|||
#define OPEN_ALWAYS 4
|
||||
#define TRUNCATE_EXISTING 5
|
||||
|
||||
#define PAGE_NOACCESS 0x01
|
||||
#define PAGE_READONLY 0x02
|
||||
#define PAGE_READWRITE 0x04
|
||||
#define PAGE_WRITECOPY 0x08
|
||||
#define PAGE_EXECUTE 0x10
|
||||
#define PAGE_EXECUTE_READ 0x20
|
||||
#define PAGE_EXECUTE_READWRITE 0x40
|
||||
#define PAGE_EXECUTE_WRITECOPY 0x80
|
||||
#define PAGE_GUARD 0x100
|
||||
#define PAGE_NOCACHE 0x200
|
||||
#define PAGE_WRITECOMBINE 0x400
|
||||
#define PAGE_USER_READONLY 0x1000
|
||||
#define PAGE_USER_READWRITE 0x2000
|
||||
#define MEM_COMMIT 0x1000
|
||||
#define MEM_RESERVE 0x2000
|
||||
#define MEM_DECOMMIT 0x4000
|
||||
#define MEM_RELEASE 0x8000
|
||||
#define MEM_FREE 0x10000
|
||||
#define MEM_PRIVATE 0x20000
|
||||
#define MEM_RESET 0x80000
|
||||
#define MEM_TOP_DOWN 0x100000
|
||||
#define MEM_NOZERO 0x800000
|
||||
#define MEM_LARGE_PAGES 0x20000000
|
||||
#define MEM_HEAP 0x40000000
|
||||
#define MEM_16MB_PAGES 0x80000000
|
||||
#define PAGE_NOACCESS 0x01
|
||||
#define PAGE_READONLY 0x02
|
||||
#define PAGE_READWRITE 0x04
|
||||
#define PAGE_WRITECOPY 0x08
|
||||
#define PAGE_EXECUTE 0x10
|
||||
#define PAGE_EXECUTE_READ 0x20
|
||||
#define PAGE_EXECUTE_READWRITE 0x40
|
||||
#define PAGE_EXECUTE_WRITECOPY 0x80
|
||||
#define PAGE_GUARD 0x100
|
||||
#define PAGE_NOCACHE 0x200
|
||||
#define PAGE_WRITECOMBINE 0x400
|
||||
#define PAGE_USER_READONLY 0x1000
|
||||
#define PAGE_USER_READWRITE 0x2000
|
||||
#define MEM_COMMIT 0x1000
|
||||
#define MEM_RESERVE 0x2000
|
||||
#define MEM_DECOMMIT 0x4000
|
||||
#define MEM_RELEASE 0x8000
|
||||
#define MEM_FREE 0x10000
|
||||
#define MEM_PRIVATE 0x20000
|
||||
#define MEM_RESET 0x80000
|
||||
#define MEM_TOP_DOWN 0x100000
|
||||
#define MEM_NOZERO 0x800000
|
||||
#define MEM_LARGE_PAGES 0x20000000
|
||||
#define MEM_HEAP 0x40000000
|
||||
#define MEM_16MB_PAGES 0x80000000
|
||||
|
||||
#define IGNORE 0 // Ignore signal
|
||||
#define INFINITE 0xFFFFFFFF // Infinite timeout
|
||||
#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
|
||||
#define STATUS_WAIT_0 ((DWORD )0x00000000L)
|
||||
#define STATUS_WAIT_0 ((DWORD )0x00000000L)
|
||||
#define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
|
||||
#define STATUS_PENDING ((DWORD )0x00000103L)
|
||||
#define STATUS_PENDING ((DWORD )0x00000103L)
|
||||
#define STILL_ACTIVE STATUS_PENDING
|
||||
|
||||
DWORD GetLastError(VOID);
|
||||
|
|
@ -364,11 +364,11 @@ VOID OutputDebugString(LPCSTR lpOutputString);
|
|||
VOID OutputDebugStringA(LPCSTR lpOutputString);
|
||||
|
||||
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix);
|
||||
errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix);
|
||||
errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix);
|
||||
|
||||
int _wtoi(const wchar_t *_Str);
|
||||
|
||||
#define __declspec(a)
|
||||
#define __declspec(a)
|
||||
extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src);
|
||||
|
||||
size_t wcsnlen(const wchar_t *wcs, size_t maxsize);
|
||||
|
|
|
|||
|
|
@ -35,22 +35,22 @@ using boost::hash;
|
|||
|
||||
|
||||
// user the pool_allocator for all unordered_set and unordered_map instances
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = boost::pool_allocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = boost::pool_allocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// {};
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = boost::pool_allocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = boost::pool_allocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
// {};
|
||||
|
||||
|
||||
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = C4JPoolAllocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = C4JPoolAllocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// {};
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = C4JPoolAllocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = C4JPoolAllocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
// {};
|
||||
|
||||
|
||||
|
|
@ -111,21 +111,19 @@ typedef unsigned int *PUINT;
|
|||
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef long long __int64;
|
||||
typedef unsigned long long __uint64;
|
||||
typedef unsigned long DWORD;
|
||||
typedef int INT;
|
||||
typedef unsigned long ULONG_PTR, *PULONG_PTR;
|
||||
typedef ULONG_PTR SIZE_T, *PSIZE_T;
|
||||
|
||||
typedef __int64 LONG64, *PLONG64;
|
||||
typedef int64_t LONG64, *PLONG64;
|
||||
|
||||
#define VOID void
|
||||
typedef char CHAR;
|
||||
typedef short SHORT;
|
||||
typedef long LONG;
|
||||
typedef __int64 LONGLONG;
|
||||
typedef __uint64 ULONGLONG;
|
||||
typedef long long LONGLONG;
|
||||
typedef unsigned long long ULONGLONG;
|
||||
|
||||
|
||||
#define CONST const
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@ private:
|
|||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
virtual void load(__int64 & t){
|
||||
virtual void load(int64_t & t){
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
virtual void load(unsigned __int64 & t){
|
||||
virtual void load(uint64_t & t){
|
||||
ArchiveImplementation::load(t);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -187,7 +187,7 @@ public:
|
|||
}
|
||||
// register type function
|
||||
template<class T>
|
||||
const basic_pointer_iserializer *
|
||||
const basic_pointer_iserializer *
|
||||
register_type(T * t = NULL){
|
||||
return ArchiveImplementation::register_type(t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // std::size_t
|
||||
#include <climits> // ULONG_MAX
|
||||
#include <climits> // ULONG_MAX
|
||||
#include <string>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
|
@ -83,8 +83,8 @@ public:
|
|||
virtual void load(boost::long_long_type & t) = 0;
|
||||
virtual void load(boost::ulong_long_type & t) = 0;
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
virtual void load(__int64 & t) = 0;
|
||||
virtual void load(unsigned __int64 & t) = 0;
|
||||
virtual void load(int64_t & t) = 0;
|
||||
virtual void load(uint64_t & t) = 0;
|
||||
#endif
|
||||
|
||||
virtual void load(float & t) = 0;
|
||||
|
|
@ -161,10 +161,10 @@ public:
|
|||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class polymorphic_iarchive :
|
||||
class polymorphic_iarchive :
|
||||
public polymorphic_iarchive_impl,
|
||||
public detail::shared_ptr_helper
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <climits> // ULONG_MAX
|
||||
#include <climits> // ULONG_MAX
|
||||
#include <string>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
|
@ -82,8 +82,8 @@ public:
|
|||
virtual void save(const boost::long_long_type t) = 0;
|
||||
virtual void save(const boost::ulong_long_type t) = 0;
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
virtual void save(const __int64 t) = 0;
|
||||
virtual void save(const unsigned __int64 t) = 0;
|
||||
virtual void save(const int64_t t) = 0;
|
||||
virtual void save(const uint64_t t) = 0;
|
||||
#endif
|
||||
|
||||
virtual void save(const float t) = 0;
|
||||
|
|
@ -141,7 +141,7 @@ public:
|
|||
};
|
||||
|
||||
// note: preserve naming symmetry
|
||||
class polymorphic_oarchive :
|
||||
class polymorphic_oarchive :
|
||||
public polymorphic_oarchive_impl
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace detail {
|
|||
enum
|
||||
{
|
||||
sockaddr_storage_maxsize = 128, // Maximum size.
|
||||
sockaddr_storage_alignsize = (sizeof(__int64)), // Desired alignment.
|
||||
sockaddr_storage_alignsize = (sizeof(int64_t)), // Desired alignment.
|
||||
sockaddr_storage_pad1size = (sockaddr_storage_alignsize - sizeof(short)),
|
||||
sockaddr_storage_pad2size = (sockaddr_storage_maxsize -
|
||||
(sizeof(short) + sockaddr_storage_pad1size + sockaddr_storage_alignsize))
|
||||
|
|
@ -51,7 +51,7 @@ struct sockaddr_storage_emulation
|
|||
{
|
||||
short ss_family;
|
||||
char __ss_pad1[sockaddr_storage_pad1size];
|
||||
__int64 __ss_align;
|
||||
int64_t __ss_align;
|
||||
char __ss_pad2[sockaddr_storage_pad2size];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@
|
|||
#pragma intrinsic(_InterlockedOr64)
|
||||
#pragma intrinsic(_InterlockedXor64)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((__int64*)(dest), (__int64)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((int64_t*)(dest), (int64_t)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((int64_t*)(dest), (int64_t)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((int64_t*)(dest), (int64_t)(arg))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((int64_t*)(dest), (int64_t)(arg))
|
||||
|
||||
#pragma intrinsic(_InterlockedCompareExchangePointer)
|
||||
#pragma intrinsic(_InterlockedExchangePointer)
|
||||
|
|
@ -128,9 +128,9 @@
|
|||
|
||||
#if defined(_WIN64)
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) InterlockedExchange64((int64_t*)(dest), (int64_t)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
|
|
@ -168,16 +168,16 @@ BOOST_ATOMIC_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd(long volat
|
|||
|
||||
#if defined(_WIN64)
|
||||
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedCompareExchange64(__int64 volatile*, __int64, __int64);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchange64(__int64 volatile*, __int64);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchangeAdd64(__int64 volatile*, __int64);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedCompareExchange64(int64_t volatile*, int64_t, int64_t);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedExchange64(int64_t volatile*, int64_t);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedExchangeAdd64(int64_t volatile*, int64_t);
|
||||
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer(void* volatile *, void*, void*);
|
||||
BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer(void* volatile *, void*);
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) boost::atomics::detail::InterlockedExchange64((__int64*)(dest), (__int64)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) boost::atomics::detail::InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) boost::atomics::detail::InterlockedExchange64((int64_t*)(dest), (int64_t)(newval))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) boost::atomics::detail::InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend))
|
||||
|
||||
#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare))
|
||||
#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) boost::atomics::detail::InterlockedExchangePointer((void**)(dest), (void*)(newval))
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace chrono_detail
|
|||
#endif
|
||||
return system_clock::time_point(
|
||||
system_clock::duration(
|
||||
((static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)
|
||||
((static_cast<int64_t>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)
|
||||
-116444736000000000LL
|
||||
)
|
||||
);
|
||||
|
|
@ -124,14 +124,14 @@ namespace chrono_detail
|
|||
ec.clear();
|
||||
}
|
||||
return time_point(duration(
|
||||
(static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime));
|
||||
(static_cast<int64_t>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_CHRONO_INLINE
|
||||
std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_NOEXCEPT
|
||||
{
|
||||
__int64 temp = t.time_since_epoch().count();
|
||||
int64_t temp = t.time_since_epoch().count();
|
||||
|
||||
temp /= 10000000;
|
||||
return static_cast<std::time_t>( temp );
|
||||
|
|
@ -140,7 +140,7 @@ namespace chrono_detail
|
|||
BOOST_CHRONO_INLINE
|
||||
system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_NOEXCEPT
|
||||
{
|
||||
__int64 temp = t;
|
||||
int64_t temp = t;
|
||||
temp *= 10000000;
|
||||
|
||||
return time_point(duration(temp));
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ namespace boost
|
|||
template <> struct Integer< ::boost::long_long_type> {};
|
||||
template <> struct Integer< ::boost::ulong_long_type> {};
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
template <> struct Integer<__int64> {};
|
||||
template <> struct Integer<unsigned __int64> {};
|
||||
template <> struct Integer<int64_t> {};
|
||||
template <> struct Integer<uint64_t> {};
|
||||
# endif
|
||||
|
||||
BOOST_concept(SignedInteger,(T)) {
|
||||
|
|
@ -103,7 +103,7 @@ namespace boost
|
|||
# if defined(BOOST_HAS_LONG_LONG)
|
||||
template <> struct SignedInteger< ::boost::long_long_type> {};
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
template <> struct SignedInteger<__int64> {};
|
||||
template <> struct SignedInteger<int64_t> {};
|
||||
# endif
|
||||
|
||||
BOOST_concept(UnsignedInteger,(T)) {
|
||||
|
|
@ -121,7 +121,7 @@ namespace boost
|
|||
# if defined(BOOST_HAS_LONG_LONG)
|
||||
template <> struct UnsignedInteger< ::boost::ulong_long_type> {};
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
template <> struct UnsignedInteger<unsigned __int64> {};
|
||||
template <> struct UnsignedInteger<uint64_t> {};
|
||||
# endif
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
# define BOOST_NO_CXX11_DECLTYPE
|
||||
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
|
||||
# define BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
# define BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
# define BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
# define BOOST_NO_CXX11_STATIC_ASSERT
|
||||
#else
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
#include <float.h>
|
||||
#endif
|
||||
//
|
||||
// __int64:
|
||||
// int64_t:
|
||||
//
|
||||
#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
// all versions support __declspec:
|
||||
//
|
||||
#if defined(__STRICT_ANSI__)
|
||||
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
|
||||
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
|
||||
# define BOOST_SYMBOL_EXPORT
|
||||
#endif
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// (C) Copyright Douglas Gregor 2010
|
||||
//
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
# define BOOST_NO_TYPEID
|
||||
#endif
|
||||
|
||||
#if defined(__int64)
|
||||
#if defined(int64_t)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@
|
|||
#endif
|
||||
|
||||
//
|
||||
// __int64:
|
||||
// int64_t:
|
||||
//
|
||||
#if !defined(__STRICT_ANSI__)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
// all versions support __declspec:
|
||||
//
|
||||
#if defined(__STRICT_ANSI__)
|
||||
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
|
||||
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
|
||||
# define BOOST_SYMBOL_EXPORT
|
||||
#endif
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// (C) Copyright John Maddock 2001.
|
||||
// (C) Copyright Douglas Gregor 2001.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2003.
|
||||
// (C) Copyright Beman Dawes 2003.
|
||||
// (C) Copyright Jens Maurer 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// (C) Copyright John Maddock 2001.
|
||||
// (C) Copyright Douglas Gregor 2001.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2003.
|
||||
// (C) Copyright Beman Dawes 2003.
|
||||
// (C) Copyright Jens Maurer 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
#endif // version 4245
|
||||
|
||||
//
|
||||
// enable __int64 support in VC emulation mode
|
||||
// enable int64_t support in VC emulation mode
|
||||
//
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Darin Adler 2001 - 2002.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002.
|
||||
// (C) Copyright David Abrahams 2002 - 2003.
|
||||
// (C) Copyright Beman Dawes 2002 - 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Darin Adler 2001 - 2002.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002.
|
||||
// (C) Copyright David Abrahams 2002 - 2003.
|
||||
// (C) Copyright Beman Dawes 2002 - 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1400
|
||||
#if _MSC_VER < 1400
|
||||
// although a conforming signature for swprint exists in VC7.1
|
||||
// it appears not to actually work:
|
||||
# define BOOST_NO_SWPRINTF
|
||||
|
|
@ -119,9 +119,9 @@
|
|||
#endif
|
||||
|
||||
|
||||
// MSVC (including the latest checked version) has not yet completely
|
||||
// MSVC (including the latest checked version) has not yet completely
|
||||
// implemented value-initialization, as is reported:
|
||||
// "VC++ does not value-initialize members of derived classes without
|
||||
// "VC++ does not value-initialize members of derived classes without
|
||||
// user-declared constructor", reported in 2009 by Sylvester Hesp:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/484295
|
||||
// "Presence of copy constructor breaks member class initialization",
|
||||
|
|
@ -152,14 +152,14 @@
|
|||
# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
|
||||
#endif
|
||||
|
||||
//
|
||||
// check for exception handling support:
|
||||
//
|
||||
// check for exception handling support:
|
||||
#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
//
|
||||
// __int64 support:
|
||||
// int64_t support:
|
||||
//
|
||||
#if (_MSC_VER >= 1200)
|
||||
# define BOOST_HAS_MS_INT64
|
||||
|
|
@ -251,7 +251,7 @@
|
|||
|
||||
#ifndef BOOST_COMPILER
|
||||
// TODO:
|
||||
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
|
||||
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
|
||||
// artificial versions assigned to them only refer to the versions of some IDE
|
||||
// these compilers have been shipped with, and even that is not all of it. Some
|
||||
// were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
|
||||
|
|
@ -274,8 +274,8 @@
|
|||
# define BOOST_COMPILER_VERSION evc9
|
||||
# elif _MSC_VER < 1700
|
||||
# define BOOST_COMPILER_VERSION evc10
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION evc11
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION evc11
|
||||
# else
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
|
||||
|
|
@ -299,8 +299,8 @@
|
|||
# define BOOST_COMPILER_VERSION 9.0
|
||||
# elif _MSC_VER < 1700
|
||||
# define BOOST_COMPILER_VERSION 10.0
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION 11.0
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION 11.0
|
||||
# else
|
||||
# define BOOST_COMPILER_VERSION _MSC_VER
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2003.
|
||||
// (C) Copyright Boris Gubenko 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2003.
|
||||
// (C) Copyright Boris Gubenko 2007.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for most recent version.
|
||||
|
||||
// Rogue Wave std lib:
|
||||
|
||||
#define BOOST_RW_STDLIB 1
|
||||
#define BOOST_RW_STDLIB 1
|
||||
|
||||
#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
# endif
|
||||
|
||||
//
|
||||
// Borland version of numeric_limits lacks __int64 specialisation:
|
||||
// Borland version of numeric_limits lacks int64_t specialisation:
|
||||
//
|
||||
#ifdef __BORLANDC__
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
// Copyright (c) 2001-2003 John Maddock
|
||||
// Copyright (c) 2001 Darin Adler
|
||||
// Copyright (c) 2001 Peter Dimov
|
||||
// Copyright (c) 2002 Bill Kempf
|
||||
// Copyright (c) 2002 Bill Kempf
|
||||
// Copyright (c) 2002 Jens Maurer
|
||||
// Copyright (c) 2002-2003 David Abrahams
|
||||
// Copyright (c) 2003 Gennaro Prota
|
||||
|
|
@ -105,8 +105,8 @@
|
|||
#endif
|
||||
|
||||
//
|
||||
// if there is no __int64 then there is no specialisation
|
||||
// for numeric_limits<__int64> either:
|
||||
// if there is no int64_t then there is no specialisation
|
||||
// for numeric_limits<int64_t> either:
|
||||
//
|
||||
#if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
|
||||
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
# endif
|
||||
|
||||
//
|
||||
// Without partial specialization, partial
|
||||
// Without partial specialization, partial
|
||||
// specialization with default args won't work either:
|
||||
//
|
||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|
|
@ -632,7 +632,7 @@ namespace std{ using ::type_info; }
|
|||
// Set some default values GPU support
|
||||
//
|
||||
# ifndef BOOST_GPU_ENABLED
|
||||
# define BOOST_GPU_ENABLED
|
||||
# define BOOST_GPU_ENABLED
|
||||
# endif
|
||||
|
||||
// BOOST_FORCEINLINE ---------------------------------------------//
|
||||
|
|
@ -695,7 +695,7 @@ namespace std{ using ::type_info; }
|
|||
# define BOOST_NO_0X_HDR_FUTURE
|
||||
#endif
|
||||
|
||||
// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
// instead of BOOST_NO_0X_HDR_INITIALIZER_LIST or BOOST_NO_INITIALIZER_LISTS
|
||||
#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
# ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
|
||||
|
|
@ -884,7 +884,7 @@ namespace std{ using ::type_info; }
|
|||
|
||||
//
|
||||
// constexpr workarounds
|
||||
//
|
||||
//
|
||||
#if defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
#define BOOST_CONSTEXPR
|
||||
#define BOOST_CONSTEXPR_OR_CONST const
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// boost cstdint.hpp header file ------------------------------------------//
|
||||
|
||||
// (C) Copyright Beman Dawes 1999.
|
||||
// (C) Copyright Jens Mauer 2001
|
||||
// (C) Copyright John Maddock 2001
|
||||
// (C) Copyright Beman Dawes 1999.
|
||||
// (C) Copyright Jens Mauer 2001
|
||||
// (C) Copyright John Maddock 2001
|
||||
// Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
|
@ -24,9 +24,9 @@
|
|||
#define BOOST_CSTDINT_HPP
|
||||
|
||||
//
|
||||
// Since we always define the INT#_C macros as per C++0x,
|
||||
// Since we always define the INT#_C macros as per C++0x,
|
||||
// define __STDC_CONSTANT_MACROS so that <stdint.h> does the right
|
||||
// thing if possible, and so that the user knows that the macros
|
||||
// thing if possible, and so that the user knows that the macros
|
||||
// are actually defined as per C99.
|
||||
//
|
||||
#ifndef __STDC_CONSTANT_MACROS
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
# ifdef __STDC_32_MODE__
|
||||
// this is triggered with GCC, because it defines __cplusplus < 199707L
|
||||
# define BOOST_NO_INT64_T
|
||||
# endif
|
||||
# endif
|
||||
# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX)
|
||||
# include <inttypes.h>
|
||||
# else
|
||||
|
|
@ -100,40 +100,40 @@ typedef ::uintfast64_t uint_fast64_t;
|
|||
namespace boost
|
||||
{
|
||||
|
||||
using ::int8_t;
|
||||
using ::int_least8_t;
|
||||
using ::int_fast8_t;
|
||||
using ::uint8_t;
|
||||
using ::uint_least8_t;
|
||||
using ::uint_fast8_t;
|
||||
|
||||
using ::int16_t;
|
||||
using ::int_least16_t;
|
||||
using ::int_fast16_t;
|
||||
using ::uint16_t;
|
||||
using ::uint_least16_t;
|
||||
using ::uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
using ::int_least32_t;
|
||||
using ::int_fast32_t;
|
||||
using ::uint32_t;
|
||||
using ::uint_least32_t;
|
||||
using ::uint_fast32_t;
|
||||
|
||||
using ::int8_t;
|
||||
using ::int_least8_t;
|
||||
using ::int_fast8_t;
|
||||
using ::uint8_t;
|
||||
using ::uint_least8_t;
|
||||
using ::uint_fast8_t;
|
||||
|
||||
using ::int16_t;
|
||||
using ::int_least16_t;
|
||||
using ::int_fast16_t;
|
||||
using ::uint16_t;
|
||||
using ::uint_least16_t;
|
||||
using ::uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
using ::int_least32_t;
|
||||
using ::int_fast32_t;
|
||||
using ::uint32_t;
|
||||
using ::uint_least32_t;
|
||||
using ::uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
using ::int64_t;
|
||||
using ::int_least64_t;
|
||||
using ::int_fast64_t;
|
||||
using ::uint64_t;
|
||||
using ::uint_least64_t;
|
||||
using ::uint_fast64_t;
|
||||
|
||||
using ::int64_t;
|
||||
using ::int_least64_t;
|
||||
using ::int_fast64_t;
|
||||
using ::uint64_t;
|
||||
using ::uint_least64_t;
|
||||
using ::uint_fast64_t;
|
||||
|
||||
# endif
|
||||
|
||||
using ::intmax_t;
|
||||
using ::uintmax_t;
|
||||
using ::intmax_t;
|
||||
using ::uintmax_t;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
|
@ -143,35 +143,35 @@ namespace boost
|
|||
|
||||
namespace boost {
|
||||
|
||||
using ::int8_t;
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int8_t int_fast8_t;
|
||||
using ::uint8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
|
||||
using ::int16_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
using ::uint16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
using ::uint32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
using ::int8_t;
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int8_t int_fast8_t;
|
||||
using ::uint8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
|
||||
using ::int64_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
using ::uint64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
using ::int16_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
using ::uint16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
using ::uint32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
using ::int64_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
using ::uint64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
|
@ -235,15 +235,15 @@ namespace boost
|
|||
typedef unsigned short uint_least16_t;
|
||||
typedef unsigned short uint_fast16_t;
|
||||
# endif
|
||||
# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__)
|
||||
// On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified
|
||||
// MTA / XMT does support the following non-standard integer types
|
||||
typedef __short16 int16_t;
|
||||
typedef __short16 int_least16_t;
|
||||
typedef __short16 int_fast16_t;
|
||||
typedef unsigned __short16 uint16_t;
|
||||
typedef unsigned __short16 uint_least16_t;
|
||||
typedef unsigned __short16 uint_fast16_t;
|
||||
# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__)
|
||||
// On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified
|
||||
// MTA / XMT does support the following non-standard integer types
|
||||
typedef __short16 int16_t;
|
||||
typedef __short16 int_least16_t;
|
||||
typedef __short16 int_fast16_t;
|
||||
typedef unsigned __short16 uint16_t;
|
||||
typedef unsigned __short16 uint_least16_t;
|
||||
typedef unsigned __short16 uint_fast16_t;
|
||||
# elif (USHRT_MAX == 0xffffffff) && defined(CRAY)
|
||||
// no 16-bit types on Cray:
|
||||
typedef short int_least16_t;
|
||||
|
|
@ -277,14 +277,14 @@ namespace boost
|
|||
typedef unsigned long uint32_t;
|
||||
typedef unsigned long uint_least32_t;
|
||||
typedef unsigned long uint_fast32_t;
|
||||
# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__)
|
||||
// Integers are 64 bits on the MTA / XMT
|
||||
typedef __int32 int32_t;
|
||||
typedef __int32 int_least32_t;
|
||||
typedef __int32 int_fast32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int32 uint_least32_t;
|
||||
typedef unsigned __int32 uint_fast32_t;
|
||||
# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__)
|
||||
// Integers are 64 bits on the MTA / XMT
|
||||
typedef __int32 int32_t;
|
||||
typedef __int32 int_least32_t;
|
||||
typedef __int32 int_fast32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int32 uint_least32_t;
|
||||
typedef unsigned __int32 uint_fast32_t;
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
|
@ -337,16 +337,16 @@ namespace boost
|
|||
__extension__ typedef unsigned long long uint_fast64_t;
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
//
|
||||
// we have Borland/Intel/Microsoft __int64:
|
||||
// we have Borland/Intel/Microsoft int64_t:
|
||||
//
|
||||
typedef __int64 intmax_t;
|
||||
typedef unsigned __int64 uintmax_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef __int64 int_least64_t;
|
||||
typedef __int64 int_fast64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef unsigned __int64 uint_least64_t;
|
||||
typedef unsigned __int64 uint_fast64_t;
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
typedef int64_t int64_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint64_t uint64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
# else // assume no 64-bit integers
|
||||
# define BOOST_NO_INT64_T
|
||||
typedef int32_t intmax_t;
|
||||
|
|
@ -376,15 +376,15 @@ INT#_C macros if they're not already defined (John Maddock).
|
|||
#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \
|
||||
(!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C))
|
||||
//
|
||||
// For the following code we get several warnings along the lines of:
|
||||
//
|
||||
// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant
|
||||
//
|
||||
// So we declare this a system header to suppress these warnings.
|
||||
// For the following code we get several warnings along the lines of:
|
||||
//
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant
|
||||
//
|
||||
// So we declare this a system header to suppress these warnings.
|
||||
//
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
# define BOOST__STDC_CONSTANT_MACROS_DEFINED
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ extern "C" {
|
|||
//~ #if defined(BOOST_NO_INT64_T)
|
||||
//~ typedef double LONGLONG_;
|
||||
//~ #else
|
||||
//~ typedef __int64 LONGLONG_;
|
||||
//~ typedef int64_t LONGLONG_;
|
||||
//~ #endif
|
||||
//~ #else
|
||||
//~ typedef double LONGLONG_;
|
||||
|
|
@ -80,7 +80,7 @@ extern "C" {
|
|||
#if defined(__CYGWIN__)
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
#else
|
||||
typedef unsigned __int64 ULONG_PTR_;
|
||||
typedef uint64_t ULONG_PTR_;
|
||||
#endif
|
||||
# else
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace win32
|
|||
using ::TryEnterCriticalSection;
|
||||
using ::LeaveCriticalSection;
|
||||
using ::DeleteCriticalSection;
|
||||
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
using ::CreateMutexW;
|
||||
using ::CreateEventW;
|
||||
|
|
@ -56,67 +56,67 @@ extern "C" {
|
|||
void * OwningThread;
|
||||
void * LockSemaphore;
|
||||
#if defined(_WIN64)
|
||||
unsigned __int64 SpinCount;
|
||||
uint64_t SpinCount;
|
||||
#else
|
||||
unsigned long SpinCount;
|
||||
#endif
|
||||
};
|
||||
|
||||
__declspec(dllimport) void __stdcall
|
||||
__declspec(dllimport) void __stdcall
|
||||
InitializeCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
__declspec(dllimport) void __stdcall
|
||||
EnterCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) bool __stdcall
|
||||
__declspec(dllimport) bool __stdcall
|
||||
TryEnterCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
__declspec(dllimport) void __stdcall
|
||||
LeaveCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
__declspec(dllimport) void __stdcall
|
||||
DeleteCriticalSection(CRITICAL_SECTION_ *);
|
||||
|
||||
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
OpenEventW(unsigned long,int,wchar_t const*);
|
||||
# else
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
__declspec(dllimport) void* __stdcall
|
||||
OpenEventA(unsigned long,int,char const*);
|
||||
# endif
|
||||
__declspec(dllimport) int __stdcall
|
||||
__declspec(dllimport) int __stdcall
|
||||
ReleaseMutex(void*);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
WaitForSingleObject(void*,unsigned long);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
WaitForMultipleObjects(unsigned long nCount,
|
||||
void* const * lpHandles,
|
||||
int bWaitAll,
|
||||
unsigned long dwMilliseconds);
|
||||
__declspec(dllimport) int __stdcall
|
||||
__declspec(dllimport) int __stdcall
|
||||
ReleaseSemaphore(void*,long,long*);
|
||||
typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
|
||||
# ifndef UNDER_CE
|
||||
__declspec(dllimport) int __stdcall
|
||||
__declspec(dllimport) int __stdcall
|
||||
SetEvent(void*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
__declspec(dllimport) int __stdcall
|
||||
ResetEvent(void*);
|
||||
# else
|
||||
using ::SetEvent;
|
||||
using ::ResetEvent;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,15 +42,15 @@ namespace boost
|
|||
// fast integers from least integers
|
||||
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||
template< typename LeastInt >
|
||||
struct int_fast_t
|
||||
{
|
||||
typedef LeastInt fast;
|
||||
struct int_fast_t
|
||||
{
|
||||
typedef LeastInt fast;
|
||||
typedef fast type;
|
||||
}; // imps may specialize
|
||||
|
||||
namespace detail{
|
||||
|
||||
// convert category to type
|
||||
// convert category to type
|
||||
template< int Category > struct int_least_helper {}; // default is empty
|
||||
template< int Category > struct uint_least_helper {}; // default is empty
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ namespace boost
|
|||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template<> struct int_least_helper<1> { typedef boost::long_long_type least; };
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
template<> struct int_least_helper<1> { typedef __int64 least; };
|
||||
template<> struct int_least_helper<1> { typedef int64_t least; };
|
||||
#endif
|
||||
template<> struct int_least_helper<2> { typedef long least; };
|
||||
template<> struct int_least_helper<3> { typedef int least; };
|
||||
|
|
@ -69,7 +69,7 @@ namespace boost
|
|||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; };
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
template<> struct uint_least_helper<1> { typedef unsigned __int64 least; };
|
||||
template<> struct uint_least_helper<1> { typedef uint64_t least; };
|
||||
#endif
|
||||
template<> struct uint_least_helper<2> { typedef unsigned long least; };
|
||||
template<> struct uint_least_helper<3> { typedef unsigned int least; };
|
||||
|
|
@ -138,7 +138,7 @@ namespace boost
|
|||
"No suitable unsigned integer type with the requested number of bits is available.");
|
||||
#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T)
|
||||
// It's really not clear why this workaround should be needed... shrug I guess! JM
|
||||
BOOST_STATIC_CONSTANT(int, s =
|
||||
BOOST_STATIC_CONSTANT(int, s =
|
||||
6 +
|
||||
(Bits <= ::std::numeric_limits<unsigned long>::digits) +
|
||||
(Bits <= ::std::numeric_limits<unsigned int>::digits) +
|
||||
|
|
@ -147,7 +147,7 @@ namespace boost
|
|||
typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
|
||||
#else
|
||||
typedef typename detail::uint_least_helper
|
||||
<
|
||||
<
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
(Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
|
||||
#else
|
||||
|
|
@ -171,7 +171,7 @@ namespace boost
|
|||
#else
|
||||
template< long MaxValue > // maximum value to require support
|
||||
#endif
|
||||
struct int_max_value_t
|
||||
struct int_max_value_t
|
||||
{
|
||||
typedef typename detail::int_least_helper
|
||||
<
|
||||
|
|
@ -193,7 +193,7 @@ namespace boost
|
|||
#else
|
||||
template< long MinValue > // minimum value to require support
|
||||
#endif
|
||||
struct int_min_value_t
|
||||
struct int_min_value_t
|
||||
{
|
||||
typedef typename detail::int_least_helper
|
||||
<
|
||||
|
|
@ -216,12 +216,12 @@ namespace boost
|
|||
#else
|
||||
template< unsigned long MaxValue > // minimum value to require support
|
||||
#endif
|
||||
struct uint_value_t
|
||||
struct uint_value_t
|
||||
{
|
||||
#if (defined(__BORLANDC__) || defined(__CODEGEAR__))
|
||||
// It's really not clear why this workaround should be needed... shrug I guess! JM
|
||||
#if defined(BOOST_NO_INTEGRAL_INT64_T)
|
||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||
1 +
|
||||
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
||||
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
||||
|
|
@ -229,7 +229,7 @@ namespace boost
|
|||
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
||||
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
||||
#else // BOOST_NO_INTEGRAL_INT64_T
|
||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||
1 +
|
||||
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
||||
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
||||
|
|
@ -240,7 +240,7 @@ namespace boost
|
|||
#endif // BOOST_NO_INTEGRAL_INT64_T
|
||||
#else
|
||||
typedef typename detail::uint_least_helper
|
||||
<
|
||||
<
|
||||
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
||||
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_INTEGER_INTEGER_MASK_HPP
|
||||
#define BOOST_INTEGER_INTEGER_MASK_HPP
|
||||
|
|
@ -109,7 +109,7 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long );
|
|||
#endif
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
#if 18446744073709551615ui64 > ULONG_MAX
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 );
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( uint64_t );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -85,10 +85,10 @@ template < >
|
|||
class integer_traits< ::boost::ulong_long_type >;
|
||||
#elif !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_MS_INT64)
|
||||
template < >
|
||||
class integer_traits<__int64>;
|
||||
class integer_traits<int64_t>;
|
||||
|
||||
template < >
|
||||
class integer_traits<unsigned __int64>;
|
||||
class integer_traits<uint64_t>;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -239,15 +239,15 @@ class integer_traits< ::boost::ulong_long_type>
|
|||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
|
||||
template<>
|
||||
class integer_traits< __int64>
|
||||
: public std::numeric_limits< __int64>,
|
||||
public detail::integer_traits_base< __int64, _I64_MIN, _I64_MAX>
|
||||
class integer_traits< int64_t>
|
||||
: public std::numeric_limits< int64_t>,
|
||||
public detail::integer_traits_base< int64_t, _I64_MIN, _I64_MAX>
|
||||
{ };
|
||||
|
||||
template<>
|
||||
class integer_traits< unsigned __int64>
|
||||
: public std::numeric_limits< unsigned __int64>,
|
||||
public detail::integer_traits_base< unsigned __int64, 0, _UI64_MAX>
|
||||
class integer_traits< uint64_t>
|
||||
: public std::numeric_limits< uint64_t>,
|
||||
public detail::integer_traits_base< uint64_t, 0, _UI64_MAX>
|
||||
{ };
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ struct interprocess_section_basic_information
|
|||
{
|
||||
void * base_address;
|
||||
unsigned long section_attributes;
|
||||
__int64 section_size;
|
||||
int64_t section_size;
|
||||
};
|
||||
|
||||
struct interprocess_filetime
|
||||
|
|
@ -778,9 +778,9 @@ union system_timeofday_information
|
|||
{
|
||||
struct data_t
|
||||
{
|
||||
__int64 liKeBootTime;
|
||||
__int64 liKeSystemTime;
|
||||
__int64 liExpTimeZoneBias;
|
||||
int64_t liKeBootTime;
|
||||
int64_t liKeSystemTime;
|
||||
int64_t liExpTimeZoneBias;
|
||||
unsigned long uCurrentTimeZoneId;
|
||||
unsigned long dwReserved;
|
||||
} data;
|
||||
|
|
@ -877,7 +877,7 @@ extern "C" __declspec(dllimport) int __stdcall FlushViewOfFile (void *, std::siz
|
|||
extern "C" __declspec(dllimport) int __stdcall VirtualUnlock (void *, std::size_t);
|
||||
extern "C" __declspec(dllimport) int __stdcall VirtualProtect (void *, std::size_t, unsigned long, unsigned long *);
|
||||
extern "C" __declspec(dllimport) int __stdcall FlushFileBuffers (void *);
|
||||
extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, __int64 *size);
|
||||
extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, int64_t *size);
|
||||
extern "C" __declspec(dllimport) unsigned long __stdcall FormatMessageA
|
||||
(unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId,
|
||||
unsigned long dwLanguageId, char *lpBuffer, unsigned long nSize,
|
||||
|
|
@ -888,9 +888,9 @@ extern "C" __declspec(dllimport) int __stdcall CreateDirectoryA(const char *, in
|
|||
extern "C" __declspec(dllimport) int __stdcall RemoveDirectoryA(const char *lpPathName);
|
||||
extern "C" __declspec(dllimport) int __stdcall GetTempPathA(unsigned long length, char *buffer);
|
||||
extern "C" __declspec(dllimport) int __stdcall CreateDirectory(const char *, interprocess_security_attributes*);
|
||||
extern "C" __declspec(dllimport) int __stdcall SetFileValidData(void *, __int64 size);
|
||||
extern "C" __declspec(dllimport) int __stdcall SetFileValidData(void *, int64_t size);
|
||||
extern "C" __declspec(dllimport) int __stdcall SetEndOfFile(void *);
|
||||
extern "C" __declspec(dllimport) int __stdcall SetFilePointerEx(void *, __int64 distance, __int64 *new_file_pointer, unsigned long move_method);
|
||||
extern "C" __declspec(dllimport) int __stdcall SetFilePointerEx(void *, int64_t distance, int64_t *new_file_pointer, unsigned long move_method);
|
||||
extern "C" __declspec(dllimport) int __stdcall LockFile (void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high);
|
||||
extern "C" __declspec(dllimport) int __stdcall UnlockFile(void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high);
|
||||
extern "C" __declspec(dllimport) int __stdcall LockFileEx(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped);
|
||||
|
|
@ -908,7 +908,7 @@ extern "C" __declspec(dllimport) unsigned long __stdcall GetMappedFileNameW(void
|
|||
extern "C" __declspec(dllimport) long __stdcall RegOpenKeyExA(void *, const char *, unsigned long, unsigned long, void **);
|
||||
extern "C" __declspec(dllimport) long __stdcall RegQueryValueExA(void *, const char *, unsigned long*, unsigned long*, unsigned char *, unsigned long*);
|
||||
extern "C" __declspec(dllimport) long __stdcall RegCloseKey(void *);
|
||||
extern "C" __declspec(dllimport) int __stdcall QueryPerformanceCounter(__int64 *lpPerformanceCount);
|
||||
extern "C" __declspec(dllimport) int __stdcall QueryPerformanceCounter(int64_t *lpPerformanceCount);
|
||||
|
||||
//COM API
|
||||
extern "C" __declspec(dllimport) long __stdcall CoInitializeEx(void *pvReserved, unsigned long dwCoInit);
|
||||
|
|
@ -1091,7 +1091,7 @@ class interprocess_all_access_security
|
|||
{ return &sa; }
|
||||
};
|
||||
|
||||
inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec)
|
||||
inline void * create_file_mapping (void * handle, unsigned long access, uint64_t file_offset, const char * name, interprocess_security_attributes *psec)
|
||||
{
|
||||
const unsigned long high_size(file_offset >> 32), low_size((boost::uint32_t)file_offset);
|
||||
return CreateFileMappingA (handle, psec, access, high_size, low_size, name);
|
||||
|
|
@ -1100,9 +1100,9 @@ inline void * create_file_mapping (void * handle, unsigned long access, unsigned
|
|||
inline void * open_file_mapping (unsigned long access, const char *name)
|
||||
{ return OpenFileMappingA (access, 0, name); }
|
||||
|
||||
inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr)
|
||||
inline void *map_view_of_file_ex(void *handle, unsigned long file_access, uint64_t offset, std::size_t numbytes, void *base_addr)
|
||||
{
|
||||
const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF));
|
||||
const unsigned long offset_low = (unsigned long)(offset & ((uint64_t)0xFFFFFFFF));
|
||||
const unsigned long offset_high = offset >> 32;
|
||||
return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr);
|
||||
}
|
||||
|
|
@ -1146,7 +1146,7 @@ inline bool virtual_protect(void *base_addr, std::size_t numbytes, unsigned long
|
|||
inline bool flush_file_buffers(void *handle)
|
||||
{ return 0 != FlushFileBuffers(handle); }
|
||||
|
||||
inline bool get_file_size(void *handle, __int64 &size)
|
||||
inline bool get_file_size(void *handle, int64_t &size)
|
||||
{ return 0 != GetFileSizeEx(handle, &size); }
|
||||
|
||||
inline bool create_directory(const char *name)
|
||||
|
|
@ -1164,7 +1164,7 @@ inline unsigned long get_temp_path(unsigned long length, char *buffer)
|
|||
inline int set_end_of_file(void *handle)
|
||||
{ return 0 != SetEndOfFile(handle); }
|
||||
|
||||
inline bool set_file_pointer_ex(void *handle, __int64 distance, __int64 *new_file_pointer, unsigned long move_method)
|
||||
inline bool set_file_pointer_ex(void *handle, int64_t distance, int64_t *new_file_pointer, unsigned long move_method)
|
||||
{ return 0 != SetFilePointerEx(handle, distance, new_file_pointer, move_method); }
|
||||
|
||||
inline bool lock_file_ex(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped *overlapped)
|
||||
|
|
@ -1225,7 +1225,7 @@ inline long reg_query_value_ex(void *hKey, const char *lpValueName, unsigned lon
|
|||
inline long reg_close_key(void *hKey)
|
||||
{ return RegCloseKey(hKey); }
|
||||
|
||||
inline bool query_performance_counter(__int64 *lpPerformanceCount)
|
||||
inline bool query_performance_counter(int64_t *lpPerformanceCount)
|
||||
{
|
||||
return 0 != QueryPerformanceCounter(lpPerformanceCount);
|
||||
}
|
||||
|
|
@ -1812,7 +1812,7 @@ inline bool is_directory(const char *path)
|
|||
(attrib & file_attribute_directory));
|
||||
}
|
||||
|
||||
inline bool get_file_mapping_size(void *file_mapping_hnd, __int64 &size)
|
||||
inline bool get_file_mapping_size(void *file_mapping_hnd, int64_t &size)
|
||||
{
|
||||
NtQuerySection_t pNtQuerySection =
|
||||
(NtQuerySection_t)dll_func::get(dll_func::NtQuerySection);
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class windows_named_condition_any
|
|||
|
||||
class named_cond_callbacks : public windows_named_sync_interface
|
||||
{
|
||||
typedef __int64 sem_count_t;
|
||||
typedef int64_t sem_count_t;
|
||||
mutable sem_count_t sem_counts [2];
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class windows_named_semaphore
|
|||
class named_sem_callbacks : public windows_named_sync_interface
|
||||
{
|
||||
public:
|
||||
typedef __int64 sem_count_t;
|
||||
typedef int64_t sem_count_t;
|
||||
named_sem_callbacks(winapi_semaphore_wrapper &sem_wrapper, sem_count_t sem_cnt)
|
||||
: m_sem_wrapper(sem_wrapper), m_sem_count(sem_cnt)
|
||||
{}
|
||||
|
|
|
|||
|
|
@ -122,12 +122,12 @@ inline void windows_named_sync::open_or_create
|
|||
if(m_file_hnd != winapi::invalid_handle_value){
|
||||
//Now lock the file
|
||||
const std::size_t buflen = sync_interface.get_data_size();
|
||||
typedef __int64 unique_id_type;
|
||||
typedef int64_t unique_id_type;
|
||||
const std::size_t sizeof_file_info = sizeof(unique_id_type) + buflen;
|
||||
winapi::interprocess_overlapped overlapped;
|
||||
if(winapi::lock_file_ex
|
||||
(m_file_hnd, winapi::lockfile_exclusive_lock, 0, sizeof_file_info, 0, &overlapped)){
|
||||
__int64 filesize = 0;
|
||||
int64_t filesize = 0;
|
||||
//Obtain the unique id to open the native semaphore.
|
||||
//If file size was created
|
||||
if(winapi::get_file_size(m_file_hnd, filesize)){
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ inline bool bytes_to_str(const void *mem, const std::size_t mem_length, char *ou
|
|||
class sync_id
|
||||
{
|
||||
public:
|
||||
typedef __int64 internal_type;
|
||||
typedef int64_t internal_type;
|
||||
sync_id(const void *map_addr)
|
||||
: map_addr_(map_addr)
|
||||
{ winapi::query_performance_counter(&rand_); }
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue