mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-18 13:42:54 +00:00
remove more x64 stubs
This commit is contained in:
parent
5b9632dc15
commit
7f71a9b980
|
|
@ -343,7 +343,7 @@ ColourTable::ColourTable(std::uint8_t* pbData, std::uint32_t dataLength) {
|
|||
ColourTable::ColourTable(ColourTable* defaultColours, std::uint8_t* pbData,
|
||||
std::uint32_t dataLength) {
|
||||
// 4J Stu - Default the colours that of the table passed in
|
||||
XMemCpy((void*)m_colourValues, (void*)defaultColours->m_colourValues,
|
||||
memcpy((void*)m_colourValues, (void*)defaultColours->m_colourValues,
|
||||
sizeof(int) * eMinecraftColour_COUNT);
|
||||
loadColoursFromData(pbData, dataLength);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,25 +34,15 @@ void ATG::XMLParser::RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback) {
|
|||
}
|
||||
#endif
|
||||
|
||||
uint32_t XShowPartyUI(uint32_t dwUserIndex) { return 0; }
|
||||
uint32_t XShowFriendsUI(uint32_t dwUserIndex) { return 0; }
|
||||
int32_t XPartyGetUserList(void* pUserList) { return 0; }
|
||||
uint32_t XContentGetThumbnail(uint32_t dwUserIndex,
|
||||
const XCONTENT_DATA* pContentData,
|
||||
uint8_t* pbThumbnail, uint32_t* pcbThumbnail,
|
||||
PXOVERLAPPED* pOverlapped) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IsEqualXUID(PlayerUID a, PlayerUID b) { return false; }
|
||||
|
||||
void XMemCpy(void* a, const void* b, size_t s) { memcpy(a, b, s); }
|
||||
void XMemSet(void* a, int t, size_t s) { memset(a, t, s); }
|
||||
void XMemSet128(void* a, int t, size_t s) { memset(a, t, s); }
|
||||
void* XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, uint32_t d) {
|
||||
return malloc(a);
|
||||
}
|
||||
void XPhysicalFree(void* a) { free(a); }
|
||||
|
||||
D3DXVECTOR3::D3DXVECTOR3() {}
|
||||
D3DXVECTOR3::D3DXVECTOR3(float x, float y, float z) : x(x), y(y), z(z) {}
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(
|
|||
// Needs to be clamped to the end of our region
|
||||
uiCopyEnd = uiFromEnd;
|
||||
}
|
||||
XMemCpy((void*)(uiCopyStart + nNumberOfBytesToWrite),
|
||||
memcpy((void*)(uiCopyStart + nNumberOfBytesToWrite),
|
||||
(void*)uiCopyStart, uiCopyEnd - uiCopyStart);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1100,7 +1100,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry* file,
|
|||
// Needs to be clamped to the end of our region
|
||||
uiCopyEnd = uiFromEnd;
|
||||
}
|
||||
XMemCpy((void*)(uiCopyStart + nNumberOfBytesToWrite),
|
||||
memcpy((void*)(uiCopyStart + nNumberOfBytesToWrite),
|
||||
(void*)uiCopyStart, uiCopyEnd - uiCopyStart);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ CompressedTileStorage::CompressedTileStorage(CompressedTileStorage* copyFrom) {
|
|||
indicesAndData = (unsigned char*)XPhysicalAlloc(
|
||||
allocatedSize, MAXULONG_PTR, 4096,
|
||||
PAGE_READWRITE); //(unsigned char *)malloc(allocatedSize);
|
||||
XMemCpy(indicesAndData, copyFrom->indicesAndData, allocatedSize);
|
||||
memcpy(indicesAndData, copyFrom->indicesAndData, allocatedSize);
|
||||
} else {
|
||||
indicesAndData = nullptr;
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage* other) {
|
|||
}
|
||||
|
||||
CompressedTileStorage::~CompressedTileStorage() {
|
||||
if (indicesAndData) XPhysicalFree(indicesAndData);
|
||||
if (indicesAndData) free(indicesAndData);
|
||||
}
|
||||
|
||||
// Get an index into the normal ordering of tiles for the java game, given a
|
||||
|
|
@ -767,7 +767,7 @@ void CompressedTileStorage::tick() {
|
|||
do {
|
||||
toFree = deleteQueue[freeIndex].Pop();
|
||||
// if( toFree ) printf("Deleting 0x%x\n", toFree);
|
||||
if (toFree) XPhysicalFree(toFree);
|
||||
if (toFree) free(toFree);
|
||||
} while (toFree);
|
||||
|
||||
deleteQueueIndex = (deleteQueueIndex + 1) % 3;
|
||||
|
|
@ -981,7 +981,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) {
|
|||
INDEX_OFFSET_SHIFT) &
|
||||
INDEX_OFFSET_MASK);
|
||||
usDataOffset = (usDataOffset + 3) & 0xfffc;
|
||||
XMemCpy(pucData + usDataOffset, packed_data, 64);
|
||||
memcpy(pucData + usDataOffset, packed_data, 64);
|
||||
newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK)
|
||||
<< INDEX_OFFSET_SHIFT;
|
||||
usDataOffset += 64;
|
||||
|
|
@ -1000,7 +1000,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) {
|
|||
// store each tile type
|
||||
newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK)
|
||||
<< INDEX_OFFSET_SHIFT;
|
||||
XMemCpy(pucData + usDataOffset, packed_data, dataSize);
|
||||
memcpy(pucData + usDataOffset, packed_data, dataSize);
|
||||
usDataOffset += dataSize;
|
||||
done = true;
|
||||
}
|
||||
|
|
@ -1072,7 +1072,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) {
|
|||
usDataOffset =
|
||||
(usDataOffset + 3) &
|
||||
0xfffc; // Make sure offset is 4 byte aligned
|
||||
XMemCpy(pucData + usDataOffset, unpacked_data, 64);
|
||||
memcpy(pucData + usDataOffset, unpacked_data, 64);
|
||||
newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK)
|
||||
<< INDEX_OFFSET_SHIFT;
|
||||
usDataOffset += 64;
|
||||
|
|
@ -1229,7 +1229,7 @@ void CompressedTileStorage::read(DataInputStream* dis) {
|
|||
// chunk is fully read before any external reference is available to it
|
||||
// from another thread
|
||||
if (indicesAndData) {
|
||||
XPhysicalFree(indicesAndData);
|
||||
free(indicesAndData);
|
||||
}
|
||||
indicesAndData = (unsigned char*)XPhysicalAlloc(
|
||||
allocatedSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
|
|
|
|||
|
|
@ -295,11 +295,11 @@ void LevelChunk::stopSharingTilesAndData() {
|
|||
|
||||
/*
|
||||
newDataLayer = new DataLayer(skyLight->data.size()*2, level->depthBits);
|
||||
XMemCpy(newDataLayer->data.data(), skyLight->data.data(),
|
||||
memcpy(newDataLayer->data.data(), skyLight->data.data(),
|
||||
skyLight->data.size()); skyLight = newDataLayer;
|
||||
|
||||
newDataLayer = new DataLayer(blockLight->data.size()*2,
|
||||
level->depthBits); XMemCpy(newDataLayer->data.data(),
|
||||
level->depthBits); memcpy(newDataLayer->data.data(),
|
||||
blockLight->data.data(), blockLight->data.size()); blockLight =
|
||||
newDataLayer;
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage() {
|
|||
// from the pool of 4KB pages, the address will in the range of
|
||||
// MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the
|
||||
// allocation later, and so free it with the corresponding call to
|
||||
// XPhysicalFree.
|
||||
// free.
|
||||
unsigned char* planeIndices = (unsigned char*)malloc(128 * 128);
|
||||
unsigned char* data = planeIndices + 128;
|
||||
planeIndices[0] = ALL_0_INDEX;
|
||||
|
|
@ -65,7 +65,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) {
|
|||
// from the pool of 4KB pages, the address will in the range of
|
||||
// MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the
|
||||
// allocation later, and so free it with the corresponding call to
|
||||
// XPhysicalFree.
|
||||
// free.
|
||||
unsigned char* planeIndices = (unsigned char*)malloc(128);
|
||||
for (int i = 0; i < 128; i++) {
|
||||
planeIndices[i] = ALL_0_INDEX;
|
||||
|
|
@ -114,7 +114,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage* copyFrom) {
|
|||
dataAndCount = (sourceDataAndCount & 0xffff000000000000L) |
|
||||
(((int64_t)destIndicesAndData) & 0x0000ffffffffffffL);
|
||||
|
||||
XMemCpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128);
|
||||
memcpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128);
|
||||
|
||||
#if defined(DATA_COMPRESSION_STATS)
|
||||
count = sourceCount;
|
||||
|
|
@ -162,7 +162,7 @@ void SparseDataStorage::setData(std::vector<uint8_t>& dataIn, unsigned int inOff
|
|||
unsigned char* planeIndices =
|
||||
(unsigned char*)malloc(128 * allocatedPlaneCount + 128);
|
||||
unsigned char* data = planeIndices + 128;
|
||||
XMemCpy(planeIndices, _planeIndices, 128);
|
||||
memcpy(planeIndices, _planeIndices, 128);
|
||||
|
||||
// Second pass through to actually copy the data in to the storage allocated
|
||||
// for the required planes
|
||||
|
|
@ -408,7 +408,7 @@ void SparseDataStorage::addNewPlane(int y) {
|
|||
// initialise remainder
|
||||
unsigned char* dataPointer =
|
||||
(unsigned char*)malloc(linesUsed * 128 + 128);
|
||||
XMemCpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128);
|
||||
memcpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128);
|
||||
XMemSet(dataPointer + (128 * lastLinesUsed) + 128, 0, 128);
|
||||
dataPointer[y] = lastLinesUsed;
|
||||
|
||||
|
|
@ -551,11 +551,11 @@ int SparseDataStorage::compress() {
|
|||
unsigned char* newIndicesAndData =
|
||||
(unsigned char*)malloc(128 + 128 * planesToAlloc);
|
||||
unsigned char* pucData = newIndicesAndData + 128;
|
||||
XMemCpy(newIndicesAndData, _planeIndices, 128);
|
||||
memcpy(newIndicesAndData, _planeIndices, 128);
|
||||
|
||||
for (int i = 0; i < 128; i++) {
|
||||
if (newIndicesAndData[i] < ALL_0_INDEX) {
|
||||
XMemCpy(pucData, &data[128 * planeIndices[i]], 128);
|
||||
memcpy(pucData, &data[128 * planeIndices[i]], 128);
|
||||
pucData += 128;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ SparseLightStorage::SparseLightStorage(bool sky) {
|
|||
// from the pool of 4KB pages, the address will in the range of
|
||||
// MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the
|
||||
// allocation later, and so free it with the corresponding call to
|
||||
// XPhysicalFree.
|
||||
// free.
|
||||
unsigned char* planeIndices = (unsigned char*)malloc(128 * 128);
|
||||
unsigned char* data = planeIndices + 128;
|
||||
planeIndices[127] = sky ? ALL_15_INDEX : ALL_0_INDEX;
|
||||
|
|
@ -66,7 +66,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) {
|
|||
// from the pool of 4KB pages, the address will in the range of
|
||||
// MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the
|
||||
// allocation later, and so free it with the corresponding call to
|
||||
// XPhysicalFree.
|
||||
// free.
|
||||
unsigned char* planeIndices = (unsigned char*)malloc(128);
|
||||
for (int i = 0; i < 128; i++) {
|
||||
planeIndices[i] = sky ? ALL_15_INDEX : ALL_0_INDEX;
|
||||
|
|
@ -115,7 +115,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage* copyFrom) {
|
|||
dataAndCount = (sourceDataAndCount & 0xffff000000000000L) |
|
||||
(((int64_t)destIndicesAndData) & 0x0000ffffffffffffL);
|
||||
|
||||
XMemCpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128);
|
||||
memcpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128);
|
||||
|
||||
#if defined(LIGHT_COMPRESSION_STATS)
|
||||
count = sourceCount;
|
||||
|
|
@ -164,7 +164,7 @@ void SparseLightStorage::setData(std::vector<uint8_t>& dataIn, unsigned int inOf
|
|||
unsigned char* planeIndices =
|
||||
(unsigned char*)malloc(128 * allocatedPlaneCount + 128);
|
||||
unsigned char* data = planeIndices + 128;
|
||||
XMemCpy(planeIndices, _planeIndices, 128);
|
||||
memcpy(planeIndices, _planeIndices, 128);
|
||||
|
||||
// Second pass through to actually copy the data in to the storage allocated
|
||||
// for the required planes
|
||||
|
|
@ -411,7 +411,7 @@ void SparseLightStorage::addNewPlane(int y) {
|
|||
// initialise remainder
|
||||
unsigned char* dataPointer =
|
||||
(unsigned char*)malloc(linesUsed * 128 + 128);
|
||||
XMemCpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128);
|
||||
memcpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128);
|
||||
XMemSet(dataPointer + (128 * lastLinesUsed) + 128, prefill, 128);
|
||||
dataPointer[y] = lastLinesUsed;
|
||||
|
||||
|
|
@ -561,11 +561,11 @@ int SparseLightStorage::compress() {
|
|||
unsigned char* newIndicesAndData =
|
||||
(unsigned char*)malloc(128 + 128 * planesToAlloc);
|
||||
unsigned char* pucData = newIndicesAndData + 128;
|
||||
XMemCpy(newIndicesAndData, _planeIndices, 128);
|
||||
memcpy(newIndicesAndData, _planeIndices, 128);
|
||||
|
||||
for (int i = 0; i < 128; i++) {
|
||||
if (newIndicesAndData[i] < ALL_0_INDEX) {
|
||||
XMemCpy(pucData, &data[128 * planeIndices[i]], 128);
|
||||
memcpy(pucData, &data[128 * planeIndices[i]], 128);
|
||||
pucData += 128;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ LevelChunk* CustomLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// now need to free the passed in blocks as the LevelChunk doesn't use the
|
||||
// passed in allocation anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
|
||||
return levelChunk;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ LevelChunk* FlatLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// now need to free the passed in blocks as the LevelChunk doesn't use the
|
||||
// passed in allocation anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
|
||||
levelChunk->recalcHeightmap();
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ LevelChunk* HellFlatLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// passed in blocks as the LevelChunk doesn't use the passed in allocation
|
||||
// anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
return levelChunk;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ LevelChunk* HellRandomLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
levelChunk->setCheckAllLight();
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
return levelChunk;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@ LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// now need to free the passed in blocks as the LevelChunk doesn't use the
|
||||
// passed in allocation anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
|
||||
return levelChunk;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ LevelChunk* TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs) {
|
|||
// now need to free the passed in blocks as the LevelChunk doesn't use the
|
||||
// passed in allocation anymore.
|
||||
LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
free(tileData);
|
||||
|
||||
levelChunk->recalcHeightmap();
|
||||
|
||||
|
|
|
|||
|
|
@ -56,11 +56,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void XMemCpy(void* a, const void* b, size_t s);
|
||||
void XMemSet(void* a, int t, size_t s);
|
||||
void XMemSet128(void* a, int t, size_t s);
|
||||
void* XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, uint32_t d);
|
||||
void XPhysicalFree(void* a);
|
||||
|
||||
class DLCManager;
|
||||
class LevelRuleset;
|
||||
|
|
|
|||
Loading…
Reference in a new issue