mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-27 15:23:37 +00:00
Merge pull request #354 from 4jcraft/refactor/expand-auto-var
refactor: replace double-underscore MSVC integer types with stdint
This commit is contained in:
commit
e65a78d6a7
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
class DemoLevel : public Level {
|
||||
private:
|
||||
static const __int64 DEMO_LEVEL_SEED =
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ MinecraftServer::MinecraftServer() {
|
|||
|
||||
MinecraftServer::~MinecraftServer() {}
|
||||
|
||||
bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData* initData,
|
||||
bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData* initData,
|
||||
std::uint32_t initSettings, bool findSeed) {
|
||||
// 4J - removed
|
||||
settings = new Settings(new File(L"server.properties"));
|
||||
|
|
@ -323,7 +323,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer* mcprogress) {
|
|||
}
|
||||
|
||||
bool MinecraftServer::loadLevel(LevelStorageSource* storageSource,
|
||||
const std::wstring& name, __int64 levelSeed,
|
||||
const std::wstring& name, int64_t levelSeed,
|
||||
LevelType* pLevelType,
|
||||
NetworkGameInitData* initData) {
|
||||
// 4J - TODO - do with new save stuff
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ class CommandDispatcher;
|
|||
|
||||
typedef struct _LoadSaveDataThreadParam {
|
||||
void* data;
|
||||
__int64 fileSize;
|
||||
int64_t fileSize;
|
||||
const std::wstring saveName;
|
||||
_LoadSaveDataThreadParam(void* data, __int64 filesize,
|
||||
_LoadSaveDataThreadParam(void* data, int64_t filesize,
|
||||
const std::wstring& saveName)
|
||||
: data(data), fileSize(filesize), saveName(saveName) {}
|
||||
} LoadSaveDataThreadParam;
|
||||
|
|
@ -135,11 +135,11 @@ public:
|
|||
|
||||
private:
|
||||
// 4J Added - LoadSaveDataThreadParam
|
||||
bool initServer(__int64 seed, NetworkGameInitData* initData,
|
||||
bool initServer(int64_t seed, NetworkGameInitData* initData,
|
||||
std::uint32_t initSettings, bool findSeed);
|
||||
void postProcessTerminate(ProgressRenderer* mcprogress);
|
||||
bool loadLevel(LevelStorageSource* storageSource, const std::wstring& name,
|
||||
__int64 levelSeed, LevelType* pLevelType,
|
||||
int64_t levelSeed, LevelType* pLevelType,
|
||||
NetworkGameInitData* initData);
|
||||
void setProgress(const std::wstring& status, int progress);
|
||||
void endProgress();
|
||||
|
|
@ -184,7 +184,7 @@ public:
|
|||
|
||||
public:
|
||||
void halt();
|
||||
void run(__int64 seed, void* lpParameter);
|
||||
void run(int64_t seed, void* lpParameter);
|
||||
|
||||
void broadcastStartSavingPacket();
|
||||
void broadcastStopSavingPacket();
|
||||
|
|
|
|||
|
|
@ -5549,8 +5549,8 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
|
|||
}
|
||||
#elif defined(__linux__)
|
||||
HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
|
||||
int iGender, __uint64 ullOfferID_Full,
|
||||
__uint64 ullOfferID_Trial,
|
||||
int iGender, uint64_t ullOfferID_Full,
|
||||
uint64_t ullOfferID_Trial,
|
||||
WCHAR* pFirstSkin,
|
||||
unsigned int uiSortIndex, int iConfig,
|
||||
WCHAR* pDataFile) {
|
||||
|
|
|
|||
|
|
@ -810,7 +810,7 @@ public:
|
|||
void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes,
|
||||
unsigned char* seedText, unsigned int& uiHostOptions,
|
||||
bool& bHostOptionsRead, std::uint32_t& uiTexturePack);
|
||||
unsigned int CreateImageTextData(std::uint8_t* textMetadata, __int64 seed,
|
||||
unsigned int CreateImageTextData(std::uint8_t* textMetadata, int64_t seed,
|
||||
bool hasSeed, unsigned int uiHostOptions,
|
||||
unsigned int uiTexturePackId);
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData,
|
|||
return false;
|
||||
}
|
||||
|
||||
const __int64 endPosition = PortableFileIO::Tell(file);
|
||||
const int64_t endPosition = PortableFileIO::Tell(file);
|
||||
if (endPosition <= 0 ||
|
||||
endPosition > std::numeric_limits<unsigned int>::max()) {
|
||||
std::fclose(file);
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ 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();
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
|
|||
delete tag;
|
||||
}
|
||||
|
||||
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk,
|
||||
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk,
|
||||
AABB* chunkBox,
|
||||
AABB* destinationBox,
|
||||
ESchematicRotation rot) {
|
||||
|
|
@ -328,7 +328,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk,
|
|||
// 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,
|
||||
int64_t ConsoleSchematicFile::applyLighting(LevelChunk* chunk, AABB* chunkBox,
|
||||
AABB* destinationBox,
|
||||
ESchematicRotation rot) {
|
||||
int xStart = std::max(destinationBox->x0, (double)chunk->x * 16);
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ public:
|
|||
void save(DataOutputStream* dos);
|
||||
void load(DataInputStream* dis);
|
||||
|
||||
__int64 applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox,
|
||||
int64_t applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox,
|
||||
AABB* destinationBox, ESchematicRotation rot);
|
||||
__int64 applyLighting(LevelChunk* chunk, AABB* chunkBox,
|
||||
int64_t applyLighting(LevelChunk* chunk, AABB* chunkBox,
|
||||
AABB* destinationBox, ESchematicRotation rot);
|
||||
void applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
||||
AABB* destinationBox, ESchematicRotation rot);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class GameRule {
|
|||
public:
|
||||
typedef struct _ValueType {
|
||||
union {
|
||||
__int64 i64;
|
||||
int64_t i64;
|
||||
int i;
|
||||
char c;
|
||||
bool b;
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ bool GameRuleManager::readRuleFile(
|
|||
// Read File.
|
||||
|
||||
// version_number
|
||||
__int64 version = dis.readShort();
|
||||
int64_t version = dis.readShort();
|
||||
unsigned char compressionType = 0;
|
||||
if (version == 0) {
|
||||
for (int i = 0; i < 14; i++) dis.readByte(); // Read padding.
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ GameRuleDefinition* LevelGenerationOptions::addChild(
|
|||
void LevelGenerationOptions::addAttribute(const std::wstring& attributeName,
|
||||
const std::wstring& attributeValue) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -155,9 +155,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
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void UIComponent_Panorama::tick() {
|
|||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class UIControl;
|
|||
// Base class for all shared functions between UIControllers
|
||||
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
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ private:
|
|||
IggyMemoryUseInfo& memoryInfo);
|
||||
|
||||
public:
|
||||
void PrintTotalMemoryUsage(__int64& totalStatic, __int64& totalDynamic);
|
||||
void PrintTotalMemoryUsage(int64_t& totalStatic, int64_t& totalDynamic);
|
||||
|
||||
public:
|
||||
UIScene(int iPad, UILayer* parentLayer);
|
||||
|
|
|
|||
|
|
@ -708,12 +708,12 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
|||
|
||||
// start the game
|
||||
bool isFlat = pClass->m_MoreOptionsParams.bFlatWorld;
|
||||
__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
|
||||
|
|
@ -728,7 +728,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
|||
}
|
||||
|
||||
// If the input string is a numerical value, convert it to a number
|
||||
if (isNumber) value = _fromString<__int64>(wSeed);
|
||||
if (isNumber) 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
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ UITTFFont::UITTFFont(const std::string& name, const std::string& path,
|
|||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
const __int64 endPosition = PortableFileIO::Tell(file);
|
||||
const int64_t endPosition = PortableFileIO::Tell(file);
|
||||
if (endPosition < 0) {
|
||||
std::fclose(file);
|
||||
app.FatalLoadError();
|
||||
|
|
|
|||
|
|
@ -71,7 +71,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';
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() {
|
|||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
||||
bool isFlat = false;
|
||||
__int64 seedValue =
|
||||
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
|
||||
|
|
|
|||
|
|
@ -62,10 +62,7 @@ typedef size_t SIZE_T;
|
|||
typedef WCHAR *LPWSTR, *PWSTR;
|
||||
typedef unsigned char boolean; // java brainrot
|
||||
#define __debugbreak()
|
||||
#define __int32 int
|
||||
#define CONST const
|
||||
typedef int64_t __int64;
|
||||
typedef uint64_t __uint64;
|
||||
typedef unsigned long ULONG;
|
||||
// typedef unsigned char byte;
|
||||
typedef short SHORT;
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ public:
|
|||
void ClearDLCOffers();
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||
int GetOfferCount();
|
||||
DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
DWORD GetAvailableDLCCount( int iPad);
|
||||
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
|
|
|
|||
|
|
@ -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 unsigned int64_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 int64_t
|
||||
#define RAD_S64 signed int64_t
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -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 int64_t __cdecl _byteswap_uint64 (unsigned int64_t 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 int64_t RR_BSWAP64 (unsigned int64_t _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 int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ RADDEFSTART
|
|||
typedef CHAR *LPSTR, *PSTR;
|
||||
|
||||
#ifdef IS_WIN64
|
||||
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
|
||||
typedef unsigned int64_t ULONG_PTR, *PULONG_PTR;
|
||||
#else
|
||||
#ifdef _Wp64
|
||||
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
|
|
|
|||
|
|
@ -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 unsigned int64_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 int64_t
|
||||
#define RAD_S64 signed int64_t
|
||||
#else
|
||||
// 16-bit
|
||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
||||
|
|
@ -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 int64_t __cdecl _byteswap_uint64 (unsigned int64_t 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 int64_t RR_BSWAP64 (unsigned int64_t _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 int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift);
|
||||
#pragma intrinsic(_rotl64)
|
||||
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
|
||||
#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k))
|
||||
|
||||
#elif defined(__RADCELL__)
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
||||
bool isFlat = false;
|
||||
__int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
|
||||
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
|
||||
|
||||
NetworkGameInitData *param = new NetworkGameInitData();
|
||||
param->seed = seedValue;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#ifdef __linux__
|
||||
#include "../Platform/Linux/Stubs/LinuxStubs.h"
|
||||
#else
|
||||
typedef unsigned __int64 __uint64;
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
|
|
|
|||
|
|
@ -135,7 +135,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;
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
namespace {
|
||||
bool ReadPortableBinaryFile(File& file, std::uint8_t*& data,
|
||||
unsigned int& size) {
|
||||
const __int64 fileLength = file.length();
|
||||
const int64_t fileLength = file.length();
|
||||
if (fileLength < 0 ||
|
||||
fileLength >
|
||||
static_cast<__int64>(std::numeric_limits<unsigned int>::max())) {
|
||||
static_cast<int64_t>(std::numeric_limits<unsigned int>::max())) {
|
||||
data = NULL;
|
||||
size = 0;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -933,7 +933,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
|
|||
iSafezoneXHalf + 2, 20, 0xffffff);
|
||||
font->drawShadow(
|
||||
L"Seed: " +
|
||||
_toString<__int64>(minecraft->level->getLevelData()->getSeed()),
|
||||
_toString<int64_t>(minecraft->level->getLevelData()->getSeed()),
|
||||
iSafezoneXHalf + 2, 32 + 00, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf + 2, 32 + 10,
|
||||
0xffffff);
|
||||
|
|
@ -1506,8 +1506,8 @@ void Gui::displayClientMessage(int messageId, int iPad) {
|
|||
}
|
||||
|
||||
// 4J Added
|
||||
void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA,
|
||||
float dataAScale, int dataAWarning, __int64* dataB,
|
||||
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
|
||||
|
|
@ -1541,7 +1541,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA,
|
|||
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));
|
||||
|
|
@ -1556,7 +1556,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA,
|
|||
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));
|
||||
|
|
@ -1570,7 +1570,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA,
|
|||
}
|
||||
|
||||
void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources,
|
||||
__int64 (*func)(unsigned int dataPos,
|
||||
int64_t (*func)(unsigned int dataPos,
|
||||
unsigned int dataSource)) {
|
||||
int height = minecraft->height;
|
||||
|
||||
|
|
@ -1587,8 +1587,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources,
|
|||
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;
|
||||
topVal = 0;
|
||||
|
|
|
|||
|
|
@ -78,10 +78,10 @@ public:
|
|||
float getJukeboxOpacity(int iPad);
|
||||
|
||||
// 4J Added
|
||||
void renderGraph(int dataLength, int dataPos, __int64* dataA,
|
||||
float dataAScale, int dataAWarning, __int64* dataB,
|
||||
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 (*func)(unsigned int dataPos,
|
||||
int64_t (*func)(unsigned int dataPos,
|
||||
unsigned int dataSource));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ private:
|
|||
std::wstring title;
|
||||
std::wstring desc;
|
||||
Achievement* ach;
|
||||
__int64 startTime;
|
||||
int64_t startTime;
|
||||
ItemRenderer* ir;
|
||||
bool isHelper;
|
||||
|
||||
|
|
|
|||
|
|
@ -195,13 +195,13 @@ void CreateWorldScreen::buttonClicked(Button* button) {
|
|||
|
||||
std::wstring seedString = seedEdit->getValue();
|
||||
|
||||
__int64 seedValue = 0;
|
||||
int64_t seedValue = 0;
|
||||
NetworkGameInitData* param = new NetworkGameInitData();
|
||||
|
||||
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);
|
||||
|
||||
bool isNumber = true;
|
||||
for (unsigned int i = 0; i < seedString.length(); ++i) {
|
||||
|
|
@ -213,7 +213,7 @@ void CreateWorldScreen::buttonClicked(Button* button) {
|
|||
}
|
||||
}
|
||||
|
||||
if (isNumber) value = _fromString<__int64>(seedString);
|
||||
if (isNumber) value = _fromString<int64_t>(seedString);
|
||||
|
||||
if (value != 0) {
|
||||
seedValue = value;
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y,
|
|||
time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this
|
||||
id = id + L" (" + buffer;
|
||||
|
||||
__int64 size = levelSummary->getSizeOnDisk();
|
||||
int64_t size = levelSummary->getSizeOnDisk();
|
||||
id = id + L", " + _toString<float>(size / 1024 * 100 / 1024 / 100.0f) +
|
||||
L" MB)";
|
||||
std::wstring info;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ private:
|
|||
float yo;
|
||||
|
||||
int lastSelection;
|
||||
__int64 lastSelectionTime;
|
||||
int64_t lastSelectionTime;
|
||||
|
||||
bool renderSelection;
|
||||
bool _renderHeader;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ Timer::Timer(float ticksPerSecond) {
|
|||
}
|
||||
|
||||
void Timer::advanceTime() {
|
||||
__int64 nowMs = System::currentTimeMillis();
|
||||
__int64 passedMs = nowMs - lastMs;
|
||||
__int64 msSysTime = System::nanoTime() / 1000000;
|
||||
int64_t nowMs = System::currentTimeMillis();
|
||||
int64_t passedMs = nowMs - lastMs;
|
||||
int64_t msSysTime = System::nanoTime() / 1000000;
|
||||
double now = msSysTime / 1000.0;
|
||||
|
||||
if (passedMs > 1000) {
|
||||
|
|
@ -30,7 +30,7 @@ void Timer::advanceTime() {
|
|||
} else {
|
||||
accumMs += passedMs;
|
||||
if (accumMs > 1000) {
|
||||
__int64 passedMsSysTime = msSysTime - lastMsSysTime;
|
||||
int64_t passedMsSysTime = msSysTime - lastMsSysTime;
|
||||
|
||||
double adjustTimeT = accumMs / (double)passedMsSysTime;
|
||||
adjustTime += (adjustTimeT - adjustTime) * 0.2f;
|
||||
|
|
@ -76,9 +76,9 @@ void Timer::advanceTimeQuickly() {
|
|||
}
|
||||
|
||||
void Timer::skipTime() {
|
||||
__int64 nowMs = System::currentTimeMillis();
|
||||
__int64 passedMs = nowMs - lastMs;
|
||||
__int64 msSysTime = System::nanoTime() / 1000000;
|
||||
int64_t nowMs = System::currentTimeMillis();
|
||||
int64_t passedMs = nowMs - lastMs;
|
||||
int64_t msSysTime = System::nanoTime() / 1000000;
|
||||
double now = msSysTime / 1000.0;
|
||||
|
||||
if (passedMs > 1000) {
|
||||
|
|
@ -88,7 +88,7 @@ void Timer::skipTime() {
|
|||
} else {
|
||||
accumMs += passedMs;
|
||||
if (accumMs > 1000) {
|
||||
__int64 passedMsSysTime = msSysTime - lastMsSysTime;
|
||||
int64_t passedMsSysTime = msSysTime - lastMsSysTime;
|
||||
|
||||
double adjustTimeT = accumMs / (double)passedMsSysTime;
|
||||
adjustTime += (adjustTimeT - adjustTime) * 0.2f;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ public:
|
|||
float passedTime;
|
||||
|
||||
private:
|
||||
__int64 lastMs;
|
||||
__int64 lastMsSysTime;
|
||||
__int64 accumMs;
|
||||
int64_t lastMs;
|
||||
int64_t lastMsSysTime;
|
||||
int64_t accumMs;
|
||||
|
||||
double adjustTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) {
|
|||
|
||||
std::uint8_t bTextMetadata[88] = {};
|
||||
|
||||
__int64 seed = 0;
|
||||
int64_t seed = 0;
|
||||
bool hasSeed = false;
|
||||
if (MinecraftServer::getInstance() != NULL &&
|
||||
MinecraftServer::getInstance()->levels[0] != NULL) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ std::wstring ToFilename(const fs::path& path) {
|
|||
return filenametowstring(filename.c_str());
|
||||
}
|
||||
|
||||
__int64 ToEpochMilliseconds(const fs::file_time_type& fileTime) {
|
||||
int64_t ToEpochMilliseconds(const fs::file_time_type& fileTime) {
|
||||
using namespace std::chrono;
|
||||
|
||||
const auto systemTime = time_point_cast<milliseconds>(
|
||||
fileTime - fs::file_time_type::clock::now() + system_clock::now());
|
||||
return static_cast<__int64>(systemTime.time_since_epoch().count());
|
||||
return static_cast<int64_t>(systemTime.time_since_epoch().count());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
@ -326,14 +326,14 @@ bool File::isDirectory() const {
|
|||
// value is unspecified if this pathname denotes a directory. Returns: The
|
||||
// length, in bytes, of the file denoted by this abstract pathname, or 0L if the
|
||||
// file does not exist
|
||||
__int64 File::length() {
|
||||
int64_t File::length() {
|
||||
std::error_code error;
|
||||
const fs::path path = ToFilesystemPath(getPath());
|
||||
|
||||
if (fs::is_regular_file(path, error)) {
|
||||
const auto size = fs::file_size(path, error);
|
||||
if (!error) {
|
||||
return static_cast<__int64>(size);
|
||||
return static_cast<int64_t>(size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ __int64 File::length() {
|
|||
// modified. Returns: A long value representing the time the file was last
|
||||
// modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1,
|
||||
// 1970), or 0L if the file does not exist or if an I/O error occurs
|
||||
__int64 File::lastModified() {
|
||||
int64_t File::lastModified() {
|
||||
std::error_code error;
|
||||
const fs::path path = ToFilesystemPath(getPath());
|
||||
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ public:
|
|||
virtual double readDouble();
|
||||
virtual float readFloat();
|
||||
virtual int readInt();
|
||||
virtual __int64 readLong();
|
||||
virtual int64_t readLong();
|
||||
virtual short readShort();
|
||||
virtual unsigned short readUnsignedShort();
|
||||
virtual std::wstring readUTF();
|
||||
void deleteChildStream();
|
||||
virtual int readUTFChar();
|
||||
virtual PlayerUID readPlayerUID(); // 4J Added
|
||||
virtual __int64 skip(__int64 n);
|
||||
virtual int64_t skip(int64_t n);
|
||||
virtual int skipBytes(int n);
|
||||
};
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
class LevelConflictException : public RuntimeException {
|
||||
private:
|
||||
static const __int32 serialVersionUID = 1L;
|
||||
static const int32_t serialVersionUID = 1L;
|
||||
|
||||
public:
|
||||
LevelConflictException(const std::wstring& msg);
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@
|
|||
//
|
||||
#pragma once
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
typedef unsigned __int64 __uint64;
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue