mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-26 22:13:37 +00:00
fix: remove byte type alias
This commit is contained in:
parent
09eae49d21
commit
15af35eef2
|
|
@ -104,7 +104,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||
{
|
||||
DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
|
||||
DWORD dSize;
|
||||
byte *dData = dlcHeader->getData(dSize);
|
||||
uint8_t *dData = dlcHeader->getData(dSize);
|
||||
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||
// = loadGameRules(dData, dSize); //, strings);
|
||||
|
|
@ -126,7 +126,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||
DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i);
|
||||
|
||||
DWORD dSize;
|
||||
byte *dData = dlcFile->getData(dSize);
|
||||
uint8_t *dData = dlcFile->getData(dSize);
|
||||
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||
// = loadGameRules(dData, dSize); //, strings);
|
||||
|
|
@ -142,7 +142,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||
}
|
||||
}
|
||||
|
||||
LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize)
|
||||
LevelGenerationOptions *GameRuleManager::loadGameRules(uint8_t *dIn, UINT dSize)
|
||||
{
|
||||
LevelGenerationOptions *lgo = new LevelGenerationOptions();
|
||||
lgo->setGrSource( new JustGrSource() );
|
||||
|
|
@ -153,7 +153,7 @@ LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize)
|
|||
}
|
||||
|
||||
// 4J-JEV: Reverse of saveGameRules.
|
||||
void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize)
|
||||
void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize)
|
||||
{
|
||||
app.DebugPrintf("GameRuleManager::LoadingGameRules:\n");
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
}
|
||||
|
||||
// 4J-JEV: Reverse of loadGameRules.
|
||||
void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
||||
void GameRuleManager::saveGameRules(uint8_t **dOut, UINT *dSize)
|
||||
{
|
||||
if (m_currentGameRuleDefinitions == NULL &&
|
||||
m_currentLevelGenerationOptions == NULL)
|
||||
|
|
@ -373,7 +373,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos)
|
|||
m_currentGameRuleDefinitions->write(dos);
|
||||
}
|
||||
|
||||
bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings)
|
||||
bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings)
|
||||
{
|
||||
bool levelGenAdded = false;
|
||||
bool gameRulesAdded = false;
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ public:
|
|||
|
||||
void loadGameRules(DLCPack *);
|
||||
|
||||
LevelGenerationOptions *loadGameRules(byte *dIn, UINT dSize);
|
||||
void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize);
|
||||
LevelGenerationOptions *loadGameRules(uint8_t *dIn, UINT dSize);
|
||||
void loadGameRules(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize);
|
||||
|
||||
void saveGameRules(byte **dOut, UINT *dSize);
|
||||
void saveGameRules(uint8_t **dOut, UINT *dSize);
|
||||
|
||||
private:
|
||||
LevelGenerationOptions *readHeader(DLCGameRulesHeader *grh);
|
||||
|
|
@ -51,7 +51,7 @@ private:
|
|||
void writeRuleFile(DataOutputStream *dos);
|
||||
|
||||
public:
|
||||
bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings);
|
||||
bool readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings);
|
||||
|
||||
private:
|
||||
void readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule);
|
||||
|
|
|
|||
|
|
@ -406,8 +406,8 @@ void C_4JProfile::Initialise( DWORD dwTitleID,
|
|||
{
|
||||
for( int i = 0; i < 4; i++ )
|
||||
{
|
||||
profileData[i] = new byte[iGameDefinedDataSizeX4/4];
|
||||
ZeroMemory(profileData[i],sizeof(byte)*iGameDefinedDataSizeX4/4);
|
||||
profileData[i] = new uint8_t[iGameDefinedDataSizeX4/4];
|
||||
ZeroMemory(profileData[i],sizeof(uint8_t)*iGameDefinedDataSizeX4/4);
|
||||
|
||||
// Set some sane initial values!
|
||||
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)profileData[i];
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ bool ServerLevel::addGlobalEntity(shared_ptr<Entity> e)
|
|||
return false;
|
||||
}
|
||||
|
||||
void ServerLevel::broadcastEntityEvent(shared_ptr<Entity> e, byte event)
|
||||
void ServerLevel::broadcastEntityEvent(shared_ptr<Entity> e, uint8_t event)
|
||||
{
|
||||
shared_ptr<Packet> p = shared_ptr<EntityEventPacket>( new EntityEventPacket(e->entityId, event) );
|
||||
server->getLevel(dimension->id)->getTracker()->broadcastAndSend(e, p);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ protected:
|
|||
public:
|
||||
shared_ptr<Entity> getEntity(int id);
|
||||
virtual bool addGlobalEntity(shared_ptr<Entity> e);
|
||||
void broadcastEntityEvent(shared_ptr<Entity> e, byte event);
|
||||
void broadcastEntityEvent(shared_ptr<Entity> e, uint8_t event);
|
||||
virtual shared_ptr<Explosion> explode(shared_ptr<Entity> source, double x, double y, double z, float r, bool fire, bool destroyBlocks);
|
||||
virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1);
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
|
|||
|
||||
// 4J - changed to use new methods for lighting
|
||||
chunk->setSkyLightDataAllBright();
|
||||
// Arrays::fill(chunk->skyLight->data, (byte) 255);
|
||||
// Arrays::fill(chunk->skyLight->data, (uint8_t) 255);
|
||||
}
|
||||
|
||||
chunk->loaded = true;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate)
|
|||
else
|
||||
{
|
||||
// 4J As we only get here if changes is less than MAX_CHANGES_BEFORE_RESEND (10) we only need to send a byte value in the packet
|
||||
broadcast( shared_ptr<ChunkTilesUpdatePacket>( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (byte)changes, level) ) );
|
||||
broadcast( shared_ptr<ChunkTilesUpdatePacket>( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (uint8_t)changes, level) ) );
|
||||
for (int i = 0; i < changes; i++)
|
||||
{
|
||||
int x = pos.x * 16 + ((changedTiles[i] >> 12) & 15);
|
||||
|
|
|
|||
|
|
@ -1205,7 +1205,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptr<SetCreativeModeSlotP
|
|||
// 4J-PB - for Xbox maps, we'll centre them on the origin of the world, since we can fit the whole world in our map
|
||||
data->x = centreXC;
|
||||
data->z = centreZC;
|
||||
data->dimension = (byte) player->level->dimension->id;
|
||||
data->dimension = (uint8_t) player->level->dimension->id;
|
||||
data->setDirty();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr<ServerPlayer>
|
|||
addPlayerToReceiving( player );
|
||||
|
||||
playerConnection->send( shared_ptr<LoginPacket>( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(),
|
||||
(byte) level->dimension->id, (byte) level->getMaxBuildHeight(), (byte) getMaxPlayers(),
|
||||
(uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) getMaxPlayers(),
|
||||
level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), (BYTE)playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(),
|
||||
level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) );
|
||||
playerConnection->send( shared_ptr<SetSpawnPositionPacket>( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) );
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener)
|
|||
}
|
||||
|
||||
LevelChunk *chunk = NULL;
|
||||
byte workingThreads;
|
||||
uint8_t workingThreads;
|
||||
bool chunkSet = false;
|
||||
|
||||
// Created a roughly sorted list to match the order that the files were created in McRegionChunkStorage::McRegionChunkStorage.
|
||||
|
|
|
|||
|
|
@ -2114,7 +2114,7 @@ static bool alloc_dynbuffer(U32 size)
|
|||
//
|
||||
// 1. filled polygons. these are triangulated simple polygons and thus have
|
||||
// roughly as many triangles as they have vertices. they use either 8- or
|
||||
// 16-byte vertex formats; this makes a worst case of 6 bytes of indices
|
||||
// 16-uint8_t vertex formats; this makes a worst case of 6 bytes of indices
|
||||
// for every 8 bytes of vertex data.
|
||||
// 2. strokes and edge antialiasing. they use a 16-byte vertex format and
|
||||
// worst-case write a "double quadstrip" which has 4 triangles for every
|
||||
|
|
|
|||
|
|
@ -386,8 +386,8 @@ void DurangoStatsDebugger::retrieveStats(int iPad)
|
|||
|
||||
// ----------------------------------------- //
|
||||
|
||||
byte runningThreads = 0;
|
||||
byte *r_runningThreads = &runningThreads;
|
||||
uint8_t runningThreads = 0;
|
||||
uint8_t *r_runningThreads = &runningThreads;
|
||||
|
||||
if (xuid.toString().compare(L"") == 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ void ChatIntegrationLayer::OnOutgoingChatPacketReady(
|
|||
__in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args
|
||||
)
|
||||
{
|
||||
byte *bytes;
|
||||
uint8_t *bytes;
|
||||
int byteCount;
|
||||
|
||||
GetBufferBytes(args->PacketBuffer, &bytes);
|
||||
|
|
@ -300,7 +300,7 @@ void ChatIntegrationLayer::OnOutgoingChatPacketReady(
|
|||
|
||||
void ChatIntegrationLayer::OnIncomingChatMessage(
|
||||
unsigned int sessionAddress,
|
||||
Platform::Array<byte>^ message
|
||||
Platform::Array<uint8_t>^ message
|
||||
)
|
||||
{
|
||||
// To integrate the Chat DLL in your game, change the following code to use your game's network layer.
|
||||
|
|
@ -797,7 +797,7 @@ void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuff
|
|||
srcBufferByteAccess->Buffer(ppOut);
|
||||
}
|
||||
|
||||
Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array<byte>^ array )
|
||||
Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array<uint8_t>^ array )
|
||||
{
|
||||
Windows::Storage::Streams::DataWriter^ writer = ref new Windows::Storage::Streams::DataWriter();
|
||||
writer->WriteBytes(array);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public:
|
|||
/// <param name="uniqueRemoteConsoleIdentifier">A unique ID for the remote console</param>
|
||||
void OnIncomingChatMessage(
|
||||
unsigned int sessionAddress,
|
||||
Platform::Array<byte>^ message
|
||||
Platform::Array<uint8_t>^ message
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -217,7 +217,7 @@ public:
|
|||
|
||||
private:
|
||||
void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut );
|
||||
Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array<byte>^ array );
|
||||
Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array<uint8_t>^ array );
|
||||
|
||||
Concurrency::critical_section m_lock;
|
||||
Microsoft::Xbox::GameChat::ChatManager^ m_chatManager;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo,
|
|||
|
||||
do
|
||||
{
|
||||
BYTE byte = *pNextByte;
|
||||
BYTE uint8_t = *pNextByte;
|
||||
switch( connectionInfo->m_internalDataState )
|
||||
{
|
||||
case DQRConnectionInfo::ConnectionState_InternalHeaderByte:
|
||||
|
|
@ -123,7 +123,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo,
|
|||
// We therefore have to be able to handle (and ignore) this being received more than once - hence the check of the bool above.
|
||||
// At this point, the connection is considered properly active from the point of view of the host.
|
||||
|
||||
int sessionIndex = GetSessionIndexForSmallId(byte);
|
||||
int sessionIndex = GetSessionIndexForSmallId(uint8_t);
|
||||
if( sessionIndex != -1 )
|
||||
{
|
||||
connectionInfo->m_channelActive[channel] = true;
|
||||
|
|
@ -136,7 +136,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo,
|
|||
DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,byte);
|
||||
|
||||
DQRNetworkPlayer *pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_REMOTE, true, 0, sessionAddress);
|
||||
pPlayer->SetSmallId(byte);
|
||||
pPlayer->SetSmallId(uint8_t);
|
||||
pPlayer->SetUID(PlayerUID(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId->Data()));
|
||||
|
||||
HostGamertagResolveDetails *resolveDetails = new HostGamertagResolveDetails();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ int SonyRemoteStorage_PS3::LoadCompressCallback(void *pParam,bool bIsCorrupt, bo
|
|||
// We add 4 bytes to the start so that we can signal compressed data
|
||||
// And another 4 bytes to store the decompressed data size
|
||||
unsigned int compLength = origFilesize+8;
|
||||
byte *compData = (byte *)malloc( compLength );
|
||||
uint8_t *compData = (uint8_t *)malloc( compLength );
|
||||
Compression::UseDefaultThreadStorage();
|
||||
Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize);
|
||||
ZeroMemory(compData,8);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void pipe_select_interrupter::recreate()
|
|||
|
||||
void pipe_select_interrupter::interrupt()
|
||||
{
|
||||
char byte = 0;
|
||||
char uint8_t = 0;
|
||||
signed_size_type result = ::write(write_descriptor_, &byte, 1);
|
||||
(void)result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ void socket_select_interrupter::recreate()
|
|||
|
||||
void socket_select_interrupter::interrupt()
|
||||
{
|
||||
char byte = 0;
|
||||
char uint8_t = 0;
|
||||
socket_ops::buf b;
|
||||
socket_ops::init_buf(b, &byte, 1);
|
||||
boost::system::error_code ec;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public:
|
|||
// External Operations
|
||||
void process_bit( bool bit );
|
||||
void process_bits( unsigned char bits, std::size_t bit_count );
|
||||
void process_byte( unsigned char byte );
|
||||
void process_byte( unsigned char uint8_t );
|
||||
void process_block( void const *bytes_begin, void const *bytes_end );
|
||||
void process_bytes( void const *buffer, std::size_t byte_count );
|
||||
|
||||
|
|
@ -223,14 +223,14 @@ public:
|
|||
void reset( value_type new_rem = InitRem );
|
||||
|
||||
// External Operations
|
||||
void process_byte( unsigned char byte );
|
||||
void process_byte( unsigned char uint8_t );
|
||||
void process_block( void const *bytes_begin, void const *bytes_end );
|
||||
void process_bytes( void const *buffer, std::size_t byte_count );
|
||||
|
||||
value_type checksum() const;
|
||||
|
||||
// Operators
|
||||
void operator ()( unsigned char byte );
|
||||
void operator ()( unsigned char uint8_t );
|
||||
value_type operator ()() const;
|
||||
|
||||
private:
|
||||
|
|
@ -777,7 +777,7 @@ crc_basic<Bits>::process_byte
|
|||
unsigned char byte
|
||||
)
|
||||
{
|
||||
process_bits( (rft_in_ ? detail::reflector<CHAR_BIT>::reflect(byte)
|
||||
process_bits( (rft_in_ ? detail::reflector<CHAR_BIT>::reflect(uint8_t)
|
||||
: byte), CHAR_BIT );
|
||||
}
|
||||
|
||||
|
|
@ -938,7 +938,7 @@ BOOST_CRC_OPTIMAL_NAME::process_byte
|
|||
unsigned char byte
|
||||
)
|
||||
{
|
||||
process_bytes( &byte, sizeof(byte) );
|
||||
process_bytes( &byte, sizeof(uint8_t) );
|
||||
}
|
||||
|
||||
template < std::size_t Bits, BOOST_CRC_PARM_TYPE TruncPoly,
|
||||
|
|
@ -1004,7 +1004,7 @@ BOOST_CRC_OPTIMAL_NAME::operator ()
|
|||
unsigned char byte
|
||||
)
|
||||
{
|
||||
process_byte( byte );
|
||||
process_byte( uint8_t );
|
||||
}
|
||||
|
||||
template < std::size_t Bits, BOOST_CRC_PARM_TYPE TruncPoly,
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ inline void sha1::reset()
|
|||
|
||||
inline void sha1::process_byte(unsigned char byte)
|
||||
{
|
||||
process_byte_impl(byte);
|
||||
process_byte_impl(uint8_t);
|
||||
|
||||
// size_t max value = 0xFFFFFFFF
|
||||
//if (bit_count_low + 8 >= 0x100000000) { // would overflow
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ public:
|
|||
unsigned int minColour = ms_pTileData->stemTile_minColour;
|
||||
unsigned int maxColour = ms_pTileData->stemTile_maxColour;
|
||||
|
||||
byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f));
|
||||
byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f));
|
||||
byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f));
|
||||
uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f));
|
||||
uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f));
|
||||
uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f));
|
||||
|
||||
colour = redComponent<<16 | greenComponent<<8 | blueComponent;
|
||||
return colour;
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ void Tesselator_SPU::color(int r, int g, int b, int a)
|
|||
col = (r << 24) | (g << 16) | (b << 8) | (a);
|
||||
}
|
||||
|
||||
void Tesselator_SPU::color(byte r, byte g, byte b)
|
||||
void Tesselator_SPU::color(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
color(r & 0xff, g & 0xff, b & 0xff);
|
||||
}
|
||||
|
|
@ -723,9 +723,9 @@ void Tesselator_SPU::noColor()
|
|||
void Tesselator_SPU::normal(float x, float y, float z)
|
||||
{
|
||||
hasNormal = true;
|
||||
byte xx = (byte) (x * 127);
|
||||
byte yy = (byte) (y * 127);
|
||||
byte zz = (byte) (z * 127);
|
||||
uint8_t xx = (uint8_t) (x * 127);
|
||||
uint8_t yy = (uint8_t) (y * 127);
|
||||
uint8_t zz = (uint8_t) (z * 127);
|
||||
|
||||
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ public:
|
|||
void color(float r, float g, float b, float a);
|
||||
void color(int r, int g, int b);
|
||||
void color(int r, int g, int b, int a);
|
||||
void color(byte r, byte g, byte b);
|
||||
void color(uint8_t r, uint8_t g, uint8_t b);
|
||||
void vertexUV(float x, float y, float z, float u, float v);
|
||||
void vertex(float x, float y, float z);
|
||||
void color(int c);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
|||
compressor and decompressor must use exactly the same dictionary (see
|
||||
inflateSetDictionary).
|
||||
|
||||
The dictionary should consist of strings (byte sequences) that are likely
|
||||
The dictionary should consist of strings (uint8_t sequences) that are likely
|
||||
to be encountered later in the data to be compressed, with the most commonly
|
||||
used strings preferably put towards the end of the dictionary. Using a
|
||||
dictionary is most useful when the data to be compressed is short and can be
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -2114,7 +2114,7 @@ static bool alloc_dynbuffer(U32 size)
|
|||
//
|
||||
// 1. filled polygons. these are triangulated simple polygons and thus have
|
||||
// roughly as many triangles as they have vertices. they use either 8- or
|
||||
// 16-byte vertex formats; this makes a worst case of 6 bytes of indices
|
||||
// 16-uint8_t vertex formats; this makes a worst case of 6 bytes of indices
|
||||
// for every 8 bytes of vertex data.
|
||||
// 2. strokes and edge antialiasing. they use a 16-byte vertex format and
|
||||
// worst-case write a "double quadstrip" which has 4 triangles for every
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ bool MinecraftDynamicConfigurations::s_bUpdatedConfigs[MinecraftDynamicConfigura
|
|||
MinecraftDynamicConfigurations::EDynamic_Configs MinecraftDynamicConfigurations::s_eCurrentConfig = MinecraftDynamicConfigurations::eDynamic_Config_Max;
|
||||
size_t MinecraftDynamicConfigurations::s_currentConfigSize = 0;
|
||||
size_t MinecraftDynamicConfigurations::s_dataWrittenSize = 0;
|
||||
byte *MinecraftDynamicConfigurations::s_dataWritten = NULL;
|
||||
uint8_t *MinecraftDynamicConfigurations::s_dataWritten = NULL;
|
||||
|
||||
void MinecraftDynamicConfigurations::Tick()
|
||||
{
|
||||
|
|
@ -90,7 +90,7 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult
|
|||
{
|
||||
if( HRESULT_SUCCEEDED(taskResult) )
|
||||
{
|
||||
s_dataWritten = new byte[s_currentConfigSize];
|
||||
s_dataWritten = new uint8_t[s_currentConfigSize];
|
||||
HRESULT hr = Sentient::SenDynamicConfigGetBytes(
|
||||
s_eCurrentConfig,
|
||||
s_currentConfigSize,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ private:
|
|||
static size_t s_currentConfigSize;
|
||||
|
||||
static size_t s_dataWrittenSize;
|
||||
static byte *s_dataWritten;
|
||||
static uint8_t *s_dataWritten;
|
||||
|
||||
public:
|
||||
static void Tick();
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector<shared_ptr<Player> > *pl
|
|||
)
|
||||
{
|
||||
teleportDelay = 0;
|
||||
packet = shared_ptr<TeleportEntityPacket>( new TeleportEntityPacket(e->entityId, xn, yn, zn, (byte) yRotn, (byte) xRotn) );
|
||||
packet = shared_ptr<TeleportEntityPacket>( new TeleportEntityPacket(e->entityId, xn, yn, zn, (uint8_t) yRotn, (uint8_t) xRotn) );
|
||||
// printf("%d: New teleport rot %d\n",e->entityId,yRotn);
|
||||
yRotp = yRotn;
|
||||
xRotp = xRotn;
|
||||
|
|
@ -262,7 +262,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector<shared_ptr<Player> > *pl
|
|||
int yHeadRot = Mth::floor(e->getYHeadRot() * 256 / 360);
|
||||
if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL)
|
||||
{
|
||||
broadcast(shared_ptr<RotateHeadPacket>(new RotateHeadPacket(e->entityId, (byte) yHeadRot)));
|
||||
broadcast(shared_ptr<RotateHeadPacket>(new RotateHeadPacket(e->entityId, (uint8_t) yHeadRot)));
|
||||
yHeadRotp = yHeadRot;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2598,9 +2598,9 @@ bool TileRenderer::tesselateDustInWorld( Tile* tt, int x, int y, int z )
|
|||
unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMin );
|
||||
unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMax );
|
||||
|
||||
byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f));
|
||||
byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f));
|
||||
byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f));
|
||||
|
||||
colour = redComponent<<16 | greenComponent<<8 | blueComponent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ C4JThread* GameRenderer::m_updateThread;
|
|||
C4JThread::EventArray* GameRenderer::m_updateEvents;
|
||||
bool GameRenderer::nearThingsToDo = false;
|
||||
bool GameRenderer::updateRunning = false;
|
||||
vector<byte *> GameRenderer::m_deleteStackByte;
|
||||
vector<uint8_t *> GameRenderer::m_deleteStackByte;
|
||||
vector<SparseLightStorage *> GameRenderer::m_deleteStackSparseLightStorage;
|
||||
vector<CompressedTileStorage *> GameRenderer::m_deleteStackCompressedTileStorage;
|
||||
vector<SparseDataStorage *> GameRenderer::m_deleteStackSparseDataStorage;
|
||||
|
|
@ -1112,7 +1112,7 @@ void GameRenderer::renderLevel(float a)
|
|||
|
||||
#ifdef MULTITHREAD_ENABLE
|
||||
// Request that an item be deleted, when it is safe to do so
|
||||
void GameRenderer::AddForDelete(byte *deleteThis)
|
||||
void GameRenderer::AddForDelete(uint8_t *deleteThis)
|
||||
{
|
||||
EnterCriticalSection(&m_csDeleteStack);
|
||||
m_deleteStackByte.push_back(deleteThis);
|
||||
|
|
@ -1869,9 +1869,9 @@ void GameRenderer::setupClearColor(float a)
|
|||
{
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
fr = (float)redComponent/256;//0.02f;
|
||||
fg = (float)greenComponent/256;//0.02f;
|
||||
|
|
@ -1881,9 +1881,9 @@ void GameRenderer::setupClearColor(float a)
|
|||
{
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
fr = (float)redComponent/256;//0.6f;
|
||||
fg = (float)greenComponent/256;//0.1f;
|
||||
|
|
@ -2025,9 +2025,9 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
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);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
float rr = (float)redComponent/256;//1.0f;
|
||||
float gg = (float)greenComponent/256;//1.0f;
|
||||
|
|
@ -2057,9 +2057,9 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
}
|
||||
|
||||
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Fog_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
float rr = (float)redComponent/256;//0.4f;
|
||||
float gg = (float)greenComponent/256;//0.4f;
|
||||
|
|
@ -2082,9 +2082,9 @@ void GameRenderer::setupFog(int i, float alpha)
|
|||
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);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
float rr = (float)redComponent/256;//0.4f;
|
||||
float gg = (float)greenComponent/256;//0.3f;
|
||||
|
|
|
|||
|
|
@ -156,12 +156,12 @@ public:
|
|||
static bool nearThingsToDo;
|
||||
static bool updateRunning;
|
||||
#endif
|
||||
static vector<byte *> m_deleteStackByte;
|
||||
static vector<uint8_t *> m_deleteStackByte;
|
||||
static vector<SparseLightStorage *> m_deleteStackSparseLightStorage;
|
||||
static vector<CompressedTileStorage *> m_deleteStackCompressedTileStorage;
|
||||
static vector<SparseDataStorage *> m_deleteStackSparseDataStorage;
|
||||
static CRITICAL_SECTION m_csDeleteStack;
|
||||
static void AddForDelete(byte *deleteThis);
|
||||
static void AddForDelete(uint8_t *deleteThis);
|
||||
static void AddForDelete(SparseLightStorage *deleteThis);
|
||||
static void AddForDelete(CompressedTileStorage *deleteThis);
|
||||
static void AddForDelete(SparseDataStorage *deleteThis);
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ void Tesselator::color(int r, int g, int b, int a)
|
|||
col = (r << 24) | (g << 16) | (b << 8) | (a);
|
||||
}
|
||||
|
||||
void Tesselator::color(byte r, byte g, byte b)
|
||||
void Tesselator::color(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
color(r & 0xff, g & 0xff, b & 0xff);
|
||||
}
|
||||
|
|
@ -1043,9 +1043,9 @@ void Tesselator::normal(float x, float y, float z)
|
|||
int8_t zz = (int8_t) (z * 127);
|
||||
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
|
||||
#else
|
||||
byte xx = (byte) (x * 127);
|
||||
byte yy = (byte) (y * 127);
|
||||
byte zz = (byte) (z * 127);
|
||||
uint8_t xx = (uint8_t) (x * 127);
|
||||
uint8_t yy = (uint8_t) (y * 127);
|
||||
uint8_t zz = (uint8_t) (z * 127);
|
||||
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public:
|
|||
void color(float r, float g, float b, float a);
|
||||
void color(int r, int g, int b);
|
||||
void color(int r, int g, int b, int a);
|
||||
void color(byte r, byte g, byte b);
|
||||
void color(uint8_t r, uint8_t g, uint8_t b);
|
||||
void vertexUV(float x, float y, float z, float u, float v);
|
||||
void vertex(float x, float y, float z);
|
||||
void color(int c);
|
||||
|
|
|
|||
|
|
@ -269,10 +269,10 @@ void Texture::writeAsBMP(const wstring &name)
|
|||
// Write the header
|
||||
outStream->writeShort((short)0x424d); // 0x0000: ID - 'BM'
|
||||
int byteSize = width * height * 4 + 54;
|
||||
outStream->writeByte((byte)(byteSize >> 0)); // 0x0002: Raw file size
|
||||
outStream->writeByte((byte)(byteSize >> 8));
|
||||
outStream->writeByte((byte)(byteSize >> 16));
|
||||
outStream->writeByte((byte)(byteSize >> 24));
|
||||
outStream->writeByte((uint8_t)(byteSize >> 0)); // 0x0002: Raw file size
|
||||
outStream->writeByte((uint8_t)(byteSize >> 8));
|
||||
outStream->writeByte((uint8_t)(byteSize >> 16));
|
||||
outStream->writeByte((uint8_t)(byteSize >> 24));
|
||||
outStream->writeInt(0); // 0x0006: Reserved
|
||||
outStream->writeByte(54); // 0x000A: Start of pixel data
|
||||
outStream->writeByte(0);
|
||||
|
|
@ -282,31 +282,31 @@ void Texture::writeAsBMP(const wstring &name)
|
|||
outStream->writeByte(0);
|
||||
outStream->writeByte(0);
|
||||
outStream->writeByte(0);
|
||||
outStream->writeByte((byte)(width >> 0)); // 0x0012: Image width, in pixels
|
||||
outStream->writeByte((byte)(width >> 8));
|
||||
outStream->writeByte((byte)(width >> 16));
|
||||
outStream->writeByte((byte)(width >> 24));
|
||||
outStream->writeByte((byte)(height >> 0)); // 0x0016: Image height, in pixels
|
||||
outStream->writeByte((byte)(height >> 8));
|
||||
outStream->writeByte((byte)(height >> 16));
|
||||
outStream->writeByte((byte)(height >> 24));
|
||||
outStream->writeByte((uint8_t)(width >> 0)); // 0x0012: Image width, in pixels
|
||||
outStream->writeByte((uint8_t)(width >> 8));
|
||||
outStream->writeByte((uint8_t)(width >> 16));
|
||||
outStream->writeByte((uint8_t)(width >> 24));
|
||||
outStream->writeByte((uint8_t)(height >> 0)); // 0x0016: Image height, in pixels
|
||||
outStream->writeByte((uint8_t)(height >> 8));
|
||||
outStream->writeByte((uint8_t)(height >> 16));
|
||||
outStream->writeByte((uint8_t)(height >> 24));
|
||||
outStream->writeByte(1); // 0x001A: Number of color planes, must be 1
|
||||
outStream->writeByte(0);
|
||||
outStream->writeByte(32); // 0x001C: Bit depth (32bpp)
|
||||
outStream->writeByte(0);
|
||||
outStream->writeInt(0); // 0x001E: Compression mode (BI_RGB, uncompressed)
|
||||
int bufSize = width * height * 4;
|
||||
outStream->writeInt((byte)(bufSize >> 0)); // 0x0022: Raw size of bitmap data
|
||||
outStream->writeInt((byte)(bufSize >> 8));
|
||||
outStream->writeInt((byte)(bufSize >> 16));
|
||||
outStream->writeInt((byte)(bufSize >> 24));
|
||||
outStream->writeInt((uint8_t)(bufSize >> 0)); // 0x0022: Raw size of bitmap data
|
||||
outStream->writeInt((uint8_t)(bufSize >> 8));
|
||||
outStream->writeInt((uint8_t)(bufSize >> 16));
|
||||
outStream->writeInt((uint8_t)(bufSize >> 24));
|
||||
outStream->writeInt(0); // 0x0026: Horizontal resolution in ppm
|
||||
outStream->writeInt(0); // 0x002A: Vertical resolution in ppm
|
||||
outStream->writeInt(0); // 0x002E: Palette size (0 to match bit depth)
|
||||
outStream->writeInt(0); // 0x0032: Number of important colors, 0 for all
|
||||
|
||||
// Pixels follow in inverted Y order
|
||||
byte[] bytes = new byte[width * height * 4];
|
||||
byte[] bytes = new uint8_t[width * height * 4];
|
||||
data.position(0);
|
||||
data.get(bytes);
|
||||
for (int y = height - 1; y >= 0; y--)
|
||||
|
|
@ -335,7 +335,7 @@ void Texture::writeAsPNG(const wstring &filename)
|
|||
#if 0
|
||||
BufferedImage *image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
|
||||
ByteBuffer *buffer = this->getData();
|
||||
byte[] bytes = new byte[width * height * 4];
|
||||
byte[] bytes = new uint8_t[width * height * 4];
|
||||
|
||||
buffer.position(0);
|
||||
buffer.get(bytes);
|
||||
|
|
@ -529,10 +529,10 @@ void Texture::transferFromBuffer(intArray buffer)
|
|||
{
|
||||
int texel = column + x * 4;
|
||||
data[0]->position(0);
|
||||
data[0]->put(texel + byteRemap[0], (byte)((buffer[texel >> 2] >> 24) & 0xff));
|
||||
data[0]->put(texel + byteRemap[1], (byte)((buffer[texel >> 2] >> 16) & 0xff));
|
||||
data[0]->put(texel + byteRemap[2], (byte)((buffer[texel >> 2] >> 8) & 0xff));
|
||||
data[0]->put(texel + byteRemap[3], (byte)((buffer[texel >> 2] >> 0) & 0xff));
|
||||
data[0]->put(texel + byteRemap[0], (uint8_t)((buffer[texel >> 2] >> 24) & 0xff));
|
||||
data[0]->put(texel + byteRemap[1], (uint8_t)((buffer[texel >> 2] >> 16) & 0xff));
|
||||
data[0]->put(texel + byteRemap[2], (uint8_t)((buffer[texel >> 2] >> 8) & 0xff));
|
||||
data[0]->put(texel + byteRemap[3], (uint8_t)((buffer[texel >> 2] >> 0) & 0xff));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -588,10 +588,10 @@ void Texture::transferFromImage(BufferedImage *image)
|
|||
|
||||
// Pull ARGB bytes into either RGBA or BGRA depending on format
|
||||
|
||||
tempBytes[byteIndex + byteRemap[0]] = (byte)((tempPixels[intIndex] >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (byte)((tempPixels[intIndex] >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (byte)((tempPixels[intIndex] >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (byte)((tempPixels[intIndex] >> 0) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((tempPixels[intIndex] >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((tempPixels[intIndex] >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((tempPixels[intIndex] >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((tempPixels[intIndex] >> 0) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -640,10 +640,10 @@ void Texture::transferFromImage(BufferedImage *image)
|
|||
|
||||
// Pull ARGB bytes into either RGBA or BGRA depending on format
|
||||
|
||||
tempBytes[byteIndex + byteRemap[0]] = (byte)((tempData[intIndex] >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (byte)((tempData[intIndex] >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (byte)((tempData[intIndex] >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (byte)((tempData[intIndex] >> 0) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((tempData[intIndex] >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((tempData[intIndex] >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((tempData[intIndex] >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((tempData[intIndex] >> 0) & 0xff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -675,10 +675,10 @@ void Texture::transferFromImage(BufferedImage *image)
|
|||
|
||||
// Pull ARGB bytes into either RGBA or BGRA depending on format
|
||||
|
||||
tempBytes[byteIndex + byteRemap[0]] = (byte)((col >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (byte)((col >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (byte)((col >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (byte)((col >> 0) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((col >> 24) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((col >> 16) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((col >> 8) & 0xff);
|
||||
tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((col >> 0) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -828,7 +828,7 @@ void Texture::updateOnGPU()
|
|||
// the ram based buffer to it any more inside RenderManager.TextureDataUpdate
|
||||
unsigned char *newData = RenderManager.TextureData(width,height,data[0]->getBuffer(),0,C4JRender::TEXTURE_FORMAT_RxGyBzAw);
|
||||
ByteBuffer *oldBuffer = data[0];
|
||||
data[0] = new ByteBuffer(data[0]->getSize(), (byte*) newData);
|
||||
data[0] = new ByteBuffer(data[0]->getSize(), (uint8_t*) newData);
|
||||
delete oldBuffer;
|
||||
newData += width * height * 4;
|
||||
#else
|
||||
|
|
@ -847,7 +847,7 @@ void Texture::updateOnGPU()
|
|||
// the ram based buffer to it any more inside RenderManager.TextureDataUpdate
|
||||
RenderManager.TextureDataUpdate(0, 0,levelWidth,levelHeight,data[level]->getBuffer(),level);
|
||||
ByteBuffer *oldBuffer = data[level];
|
||||
data[level] = new ByteBuffer(data[level]->getSize(), (byte*) newData);
|
||||
data[level] = new ByteBuffer(data[level]->getSize(), (uint8_t*) newData);
|
||||
delete oldBuffer;
|
||||
newData += levelWidth * levelHeight * 4;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -555,15 +555,15 @@ void Textures::loadTexture(BufferedImage *img, int id, bool blur, bool clamp)
|
|||
int b = (rawPixels[i]) & 0xff;
|
||||
|
||||
#ifdef _XBOX
|
||||
newPixels[i * 4 + 0] = (byte) a;
|
||||
newPixels[i * 4 + 1] = (byte) r;
|
||||
newPixels[i * 4 + 2] = (byte) g;
|
||||
newPixels[i * 4 + 3] = (byte) b;
|
||||
newPixels[i * 4 + 0] = (uint8_t) a;
|
||||
newPixels[i * 4 + 1] = (uint8_t) r;
|
||||
newPixels[i * 4 + 2] = (uint8_t) g;
|
||||
newPixels[i * 4 + 3] = (uint8_t) b;
|
||||
#else
|
||||
newPixels[i * 4 + 0] = (byte) r;
|
||||
newPixels[i * 4 + 1] = (byte) g;
|
||||
newPixels[i * 4 + 2] = (byte) b;
|
||||
newPixels[i * 4 + 3] = (byte) a;
|
||||
newPixels[i * 4 + 0] = (uint8_t) r;
|
||||
newPixels[i * 4 + 1] = (uint8_t) g;
|
||||
newPixels[i * 4 + 2] = (uint8_t) b;
|
||||
newPixels[i * 4 + 3] = (uint8_t) a;
|
||||
#endif
|
||||
}
|
||||
// 4J - now creating a buffer of the size we require dynamically
|
||||
|
|
@ -731,10 +731,10 @@ void Textures::replaceTexture(intArray rawPixels, int w, int h, int id)
|
|||
b = bb;
|
||||
}
|
||||
|
||||
newPixels[i * 4 + 0] = (byte) r;
|
||||
newPixels[i * 4 + 1] = (byte) g;
|
||||
newPixels[i * 4 + 2] = (byte) b;
|
||||
newPixels[i * 4 + 3] = (byte) a;
|
||||
newPixels[i * 4 + 0] = (uint8_t) r;
|
||||
newPixels[i * 4 + 1] = (uint8_t) g;
|
||||
newPixels[i * 4 + 2] = (uint8_t) b;
|
||||
newPixels[i * 4 + 3] = (uint8_t) a;
|
||||
}
|
||||
ByteBuffer *pixels = MemoryTracker::createByteBuffer(w * h * 4); // 4J - now creating dynamically
|
||||
pixels->put(newPixels);
|
||||
|
|
|
|||
|
|
@ -181,9 +181,9 @@ void FallingTile::causeFallDamage(float distance)
|
|||
|
||||
void FallingTile::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
tag->putByte(L"Tile", (byte) tile);
|
||||
tag->putByte(L"Data", (byte) data);
|
||||
tag->putByte(L"Time", (byte) time);
|
||||
tag->putByte(L"Tile", (uint8_t) tile);
|
||||
tag->putByte(L"Data", (uint8_t) data);
|
||||
tag->putByte(L"Time", (uint8_t) time);
|
||||
tag->putBoolean(L"DropItem", dropItem);
|
||||
tag->putBoolean(L"HurtEntities", hurtEntities);
|
||||
tag->putFloat(L"FallHurtAmount", fallDamageAmount);
|
||||
|
|
|
|||
|
|
@ -353,9 +353,9 @@ void RedStoneDustTile::animateTick(Level *level, int x, int y, int z, Random *ra
|
|||
unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMin );
|
||||
unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMax );
|
||||
|
||||
byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f));
|
||||
byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f));
|
||||
byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f));
|
||||
uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f));
|
||||
|
||||
colour = redComponent<<16 | greenComponent<<8 | blueComponent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,9 +126,9 @@ int StemTile::getColor(int data)
|
|||
unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_StemMin );
|
||||
unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_StemMax );
|
||||
|
||||
byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f));
|
||||
byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f));
|
||||
byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f));
|
||||
uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f));
|
||||
uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f));
|
||||
uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f));
|
||||
|
||||
colour = redComponent<<16 | greenComponent<<8 | blueComponent;
|
||||
return colour;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ void BrewingStandTileEntity::save(CompoundTag *base)
|
|||
if (items[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
items[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ void ChestTileEntity::save(CompoundTag *base)
|
|||
if (items->data[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
items->data[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ void DispenserTileEntity::save(CompoundTag *base)
|
|||
if (items->data[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
items->data[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ void FurnaceTileEntity::save(CompoundTag *base)
|
|||
if ((*items)[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
(*items)[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void MusicTileEntity::load(CompoundTag *tag)
|
|||
|
||||
void MusicTileEntity::tune()
|
||||
{
|
||||
note = (byte) ((note + 1) % 25);
|
||||
note = (uint8_t) ((note + 1) % 25);
|
||||
setChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public:
|
|||
static TileEntity *create() { return new MusicTileEntity(); }
|
||||
|
||||
public:
|
||||
byte note;
|
||||
uint8_t note;
|
||||
|
||||
bool on;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ template <class T> void System::arraycopy(arrayWithLength<T> src, unsigned int s
|
|||
ArrayCopyFunctionDefinition(Node *)
|
||||
ArrayCopyFunctionDefinition(Biome *)
|
||||
|
||||
void System::arraycopy(arrayWithLength<byte> src, unsigned int srcPos, arrayWithLength<byte> *dst, unsigned int dstPos, unsigned int length)
|
||||
void System::arraycopy(arrayWithLength<uint8_t> src, unsigned int srcPos, arrayWithLength<uint8_t> *dst, unsigned int dstPos, unsigned int length)
|
||||
{
|
||||
assert( srcPos >=0 && srcPos <= src.length);
|
||||
assert( srcPos + length <= src.length );
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class System
|
|||
template <class T> static void arraycopy(arrayWithLength<T> src, unsigned int srcPos, arrayWithLength<T> *dst, unsigned int dstPos, unsigned int length);
|
||||
|
||||
public:
|
||||
ArrayCopyFunctionDeclaration(byte)
|
||||
ArrayCopyFunctionDeclaration(uint8_t)
|
||||
ArrayCopyFunctionDeclaration(Node *)
|
||||
ArrayCopyFunctionDeclaration(Biome *)
|
||||
ArrayCopyFunctionDeclaration(int)
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ public:
|
|||
bool IsHost();
|
||||
bool IsGuest();
|
||||
bool IsLocal();
|
||||
PlayerUID GetXuid();
|
||||
PlayerUID GetXuid();
|
||||
LPCWSTR GetGamertag();
|
||||
int GetSessionIndex();
|
||||
bool IsTalking();
|
||||
|
|
@ -383,7 +383,7 @@ typedef struct _XMARKETPLACE_CONTENTOFFER_INFO
|
|||
DWORD dwPointsPrice;
|
||||
} XMARKETPLACE_CONTENTOFFER_INFO, *PXMARKETPLACE_CONTENTOFFER_INFO;
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
XMARKETPLACE_OFFERING_TYPE_CONTENT = 0x00000002,
|
||||
XMARKETPLACE_OFFERING_TYPE_GAME_DEMO = 0x00000020,
|
||||
|
|
@ -403,7 +403,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0;
|
|||
struct XRNM_SEND_BUFFER
|
||||
{
|
||||
DWORD dwDataSize;
|
||||
byte *pbyData;
|
||||
uint8_t *pbyData;
|
||||
};
|
||||
|
||||
const int D3DBLEND_CONSTANTALPHA = 0;
|
||||
|
|
@ -531,7 +531,7 @@ typedef struct {
|
|||
// const int XC_LANGUAGE_POLISH =17;
|
||||
// const int XC_LANGUAGE_TURKISH =18;
|
||||
// const int XC_LANGUAGE_LATINAMERICANSPANISH =19;
|
||||
//
|
||||
//
|
||||
// const int XC_LANGUAGE_GREEK =20;
|
||||
// #else
|
||||
// const int XC_LANGUAGE_UKENGLISH =11;
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ ListTag<CompoundTag> *Inventory::save(ListTag<CompoundTag> *listTag)
|
|||
if (items[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
items[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
@ -485,7 +485,7 @@ ListTag<CompoundTag> *Inventory::save(ListTag<CompoundTag> *listTag)
|
|||
if (armor[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) (i + 100));
|
||||
tag->putByte(L"Slot", (uint8_t) (i + 100));
|
||||
armor[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(shared_ptr<ItemInstance
|
|||
|
||||
void MerchantRecipeList::writeToStream(DataOutputStream *stream)
|
||||
{
|
||||
stream->writeByte((byte) (m_recipes.size() & 0xff));
|
||||
stream->writeByte((uint8_t) (m_recipes.size() & 0xff));
|
||||
for (int i = 0; i < m_recipes.size(); i++)
|
||||
{
|
||||
MerchantRecipe *r = m_recipes.at(i);
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ Entity::Entity(Level *level, bool useSmallId) // 4J - added useSmallId parameter
|
|||
// resetPos();
|
||||
setPos(0, 0, 0);
|
||||
|
||||
entityData->define(DATA_SHARED_FLAGS_ID, (byte) 0);
|
||||
entityData->define(DATA_SHARED_FLAGS_ID, (uint8_t) 0);
|
||||
entityData->define(DATA_AIR_SUPPLY_ID, TOTAL_AIR_SUPPLY); // 4J Stu - Brought forward from 1.2.3 to fix 38654 - Gameplay: Player will take damage when air bubbles are present if resuming game from load/autosave underwater.
|
||||
|
||||
// 4J Stu - We cannot call virtual functions in ctors, as at this point the object
|
||||
|
|
@ -1677,7 +1677,7 @@ void Entity::lerpMotion(double xd, double yd, double zd)
|
|||
this->zd = zd;
|
||||
}
|
||||
|
||||
void Entity::handleEntityEvent(byte eventId)
|
||||
void Entity::handleEntityEvent(uint8_t eventId)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1781,14 +1781,14 @@ bool Entity::getSharedFlag(int flag)
|
|||
|
||||
void Entity::setSharedFlag(int flag, bool value)
|
||||
{
|
||||
byte currentValue = entityData->getByte(DATA_SHARED_FLAGS_ID);
|
||||
uint8_t currentValue = entityData->getByte(DATA_SHARED_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_SHARED_FLAGS_ID, (byte) (currentValue | (1 << flag)));
|
||||
entityData->set(DATA_SHARED_FLAGS_ID, (uint8_t) (currentValue | (1 << flag)));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_SHARED_FLAGS_ID, (byte) (currentValue & ~(1 << flag)));
|
||||
entityData->set(DATA_SHARED_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ public:
|
|||
virtual Vec3 *getLookAngle();
|
||||
virtual void handleInsidePortal();
|
||||
virtual void lerpMotion(double xd, double yd, double zd);
|
||||
virtual void handleEntityEvent(byte eventId);
|
||||
virtual void handleEntityEvent(uint8_t eventId);
|
||||
virtual void animateHurt();
|
||||
virtual void prepareCustomTextures();
|
||||
virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[]
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ void HangingEntity::push(double xa, double ya, double za)
|
|||
|
||||
void HangingEntity::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
tag->putByte(L"Direction", (byte) dir);
|
||||
tag->putByte(L"Direction", (uint8_t) dir);
|
||||
tag->putInt(L"TileX", xTile);
|
||||
tag->putInt(L"TileY", yTile);
|
||||
tag->putInt(L"TileZ", zTile);
|
||||
|
|
@ -245,16 +245,16 @@ void HangingEntity::addAdditonalSaveData(CompoundTag *tag)
|
|||
switch (dir)
|
||||
{
|
||||
case Direction::NORTH:
|
||||
tag->putByte(L"Dir", (byte) 0);
|
||||
tag->putByte(L"Dir", (uint8_t) 0);
|
||||
break;
|
||||
case Direction::WEST:
|
||||
tag->putByte(L"Dir", (byte) 1);
|
||||
tag->putByte(L"Dir", (uint8_t) 1);
|
||||
break;
|
||||
case Direction::SOUTH:
|
||||
tag->putByte(L"Dir", (byte) 2);
|
||||
tag->putByte(L"Dir", (uint8_t) 2);
|
||||
break;
|
||||
case Direction::EAST:
|
||||
tag->putByte(L"Dir", (byte) 3);
|
||||
tag->putByte(L"Dir", (uint8_t) 3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ bool ItemEntity::hurt(DamageSource *source, int damage)
|
|||
|
||||
void ItemEntity::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
{
|
||||
entityTag->putShort(L"Health", (byte) health);
|
||||
entityTag->putShort(L"Health", (uint8_t) health);
|
||||
entityTag->putShort(L"Age", (short) age);
|
||||
if (getItem() != NULL) entityTag->putCompound(L"Item", getItem()->save(new CompoundTag()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1591,7 +1591,7 @@ shared_ptr<ItemInstance> Mob::getArmor(int pos)
|
|||
//return equipment[pos + 1];
|
||||
}
|
||||
|
||||
void Mob::handleEntityEvent(byte id)
|
||||
void Mob::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::HURT)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ public:
|
|||
virtual int getMaxSpawnClusterSize();
|
||||
virtual shared_ptr<ItemInstance> getCarriedItem();
|
||||
virtual shared_ptr<ItemInstance> getArmor(int pos);
|
||||
virtual void handleEntityEvent(byte id);
|
||||
virtual void handleEntityEvent(uint8_t id);
|
||||
virtual bool isSleeping();
|
||||
virtual Icon *getItemInHandIcon(shared_ptr<ItemInstance> item, int layer);
|
||||
virtual bool shouldRender(Vec3 *c);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ Arrow::Arrow(Level *level, shared_ptr<Mob> mob, float power) : Entity( level )
|
|||
|
||||
void Arrow::defineSynchedData()
|
||||
{
|
||||
entityData->define(ID_FLAGS, (byte) 0);
|
||||
entityData->define(ID_FLAGS, (uint8_t) 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -432,11 +432,11 @@ void Arrow::addAdditonalSaveData(CompoundTag *tag)
|
|||
tag->putShort(L"xTile", (short) xTile);
|
||||
tag->putShort(L"yTile", (short) yTile);
|
||||
tag->putShort(L"zTile", (short) zTile);
|
||||
tag->putByte(L"inTile", (byte) lastTile);
|
||||
tag->putByte(L"inData", (byte) lastData);
|
||||
tag->putByte(L"shake", (byte) shakeTime);
|
||||
tag->putByte(L"inGround", (byte) (inGround ? 1 : 0));
|
||||
tag->putByte(L"pickup", (byte) pickup);
|
||||
tag->putByte(L"inTile", (uint8_t) lastTile);
|
||||
tag->putByte(L"inData", (uint8_t) lastData);
|
||||
tag->putByte(L"shake", (uint8_t) shakeTime);
|
||||
tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0));
|
||||
tag->putByte(L"pickup", (uint8_t) pickup);
|
||||
tag->putDouble(L"damage", baseDamage);
|
||||
}
|
||||
|
||||
|
|
@ -513,19 +513,19 @@ bool Arrow::isAttackable()
|
|||
|
||||
void Arrow::setCritArrow(bool critArrow)
|
||||
{
|
||||
byte flags = entityData->getByte(ID_FLAGS);
|
||||
uint8_t flags = entityData->getByte(ID_FLAGS);
|
||||
if (critArrow)
|
||||
{
|
||||
entityData->set(ID_FLAGS, (byte) (flags | FLAG_CRIT));
|
||||
entityData->set(ID_FLAGS, (uint8_t) (flags | FLAG_CRIT));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(ID_FLAGS, (byte) (flags & ~FLAG_CRIT));
|
||||
entityData->set(ID_FLAGS, (uint8_t) (flags & ~FLAG_CRIT));
|
||||
}
|
||||
}
|
||||
|
||||
bool Arrow::isCritArrow()
|
||||
{
|
||||
byte flags = entityData->getByte(ID_FLAGS);
|
||||
uint8_t flags = entityData->getByte(ID_FLAGS);
|
||||
return (flags & FLAG_CRIT) != 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void Blaze::defineSynchedData()
|
|||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_FLAGS_ID, (byte) 0);
|
||||
entityData->define(DATA_FLAGS_ID, (uint8_t) 0);
|
||||
}
|
||||
|
||||
int Blaze::getAmbientSound()
|
||||
|
|
@ -209,7 +209,7 @@ bool Blaze::isCharged()
|
|||
|
||||
void Blaze::setCharged(bool value)
|
||||
{
|
||||
byte flags = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t flags = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
flags |= 0x1;
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ void Creeper::defineSynchedData()
|
|||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_SWELL_DIR, (byte) -1);
|
||||
entityData->define(DATA_IS_POWERED, (byte) 0);
|
||||
entityData->define(DATA_SWELL_DIR, (uint8_t) -1);
|
||||
entityData->define(DATA_IS_POWERED, (uint8_t) 0);
|
||||
}
|
||||
|
||||
void Creeper::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
|
|
@ -76,7 +76,7 @@ void Creeper::addAdditonalSaveData(CompoundTag *entityTag)
|
|||
void Creeper::readAdditionalSaveData(CompoundTag *tag)
|
||||
{
|
||||
Monster::readAdditionalSaveData(tag);
|
||||
entityData->set(DATA_IS_POWERED, (byte) (tag->getBoolean(L"powered") ? 1 : 0));
|
||||
entityData->set(DATA_IS_POWERED, (uint8_t) (tag->getBoolean(L"powered") ? 1 : 0));
|
||||
}
|
||||
|
||||
void Creeper::tick()
|
||||
|
|
@ -159,11 +159,11 @@ int Creeper::getSwellDir()
|
|||
|
||||
void Creeper::setSwellDir(int dir)
|
||||
{
|
||||
entityData->set(DATA_SWELL_DIR, (byte) dir);
|
||||
entityData->set(DATA_SWELL_DIR, (uint8_t) dir);
|
||||
}
|
||||
|
||||
void Creeper::thunderHit(const LightningBolt *lightningBolt)
|
||||
{
|
||||
Monster::thunderHit(lightningBolt);
|
||||
entityData->set(DATA_IS_POWERED, (byte) 1);
|
||||
entityData->set(DATA_IS_POWERED, (uint8_t) 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ void EnderMan::defineSynchedData()
|
|||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_CARRY_ITEM_ID, (byte) 0);
|
||||
entityData->define(DATA_CARRY_ITEM_DATA, (byte) 0);
|
||||
entityData->define(DATA_CREEPY, (byte) 0);
|
||||
entityData->define(DATA_CARRY_ITEM_ID, (uint8_t) 0);
|
||||
entityData->define(DATA_CARRY_ITEM_DATA, (uint8_t) 0);
|
||||
entityData->define(DATA_CREEPY, (uint8_t) 0);
|
||||
}
|
||||
|
||||
void EnderMan::addAdditonalSaveData(CompoundTag *tag)
|
||||
|
|
@ -368,7 +368,7 @@ void EnderMan::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel)
|
|||
// 4J Brought forward from 1.2.3 to help fix Enderman behaviour
|
||||
void EnderMan::setCarryingTile(int carryingTile)
|
||||
{
|
||||
entityData->set(DATA_CARRY_ITEM_ID, (byte) (carryingTile & 0xff));
|
||||
entityData->set(DATA_CARRY_ITEM_ID, (uint8_t) (carryingTile & 0xff));
|
||||
}
|
||||
|
||||
int EnderMan::getCarryingTile()
|
||||
|
|
@ -378,7 +378,7 @@ int EnderMan::getCarryingTile()
|
|||
|
||||
void EnderMan::setCarryingData(int carryingData)
|
||||
{
|
||||
entityData->set(DATA_CARRY_ITEM_DATA, (byte) (carryingData & 0xff));
|
||||
entityData->set(DATA_CARRY_ITEM_DATA, (uint8_t) (carryingData & 0xff));
|
||||
}
|
||||
|
||||
int EnderMan::getCarryingData()
|
||||
|
|
@ -406,5 +406,5 @@ bool EnderMan::isCreepy()
|
|||
|
||||
void EnderMan::setCreepy(bool creepy)
|
||||
{
|
||||
entityData->set(DATA_CREEPY, (byte)(creepy ? 1 : 0));
|
||||
entityData->set(DATA_CREEPY, (uint8_t)(creepy ? 1 : 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ bool ExperienceOrb::hurt(DamageSource *source, int damage)
|
|||
|
||||
void ExperienceOrb::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
{
|
||||
entityTag->putShort(L"Health", (byte) health);
|
||||
entityTag->putShort(L"Health", (uint8_t) health);
|
||||
entityTag->putShort(L"Age", (short) age);
|
||||
entityTag->putShort(L"Value", (short) value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,8 +320,8 @@ void Fireball::addAdditonalSaveData(CompoundTag *tag)
|
|||
tag->putShort(L"xTile", (short) xTile);
|
||||
tag->putShort(L"yTile", (short) yTile);
|
||||
tag->putShort(L"zTile", (short) zTile);
|
||||
tag->putByte(L"inTile", (byte) lastTile);
|
||||
tag->putByte(L"inGround", (byte) (inGround ? 1 : 0));
|
||||
tag->putByte(L"inTile", (uint8_t) lastTile);
|
||||
tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0));
|
||||
tag->put(L"direction", this->newDoubleList(3, this->xd, this->yd, this->zd));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -381,9 +381,9 @@ void FishingHook::addAdditonalSaveData(CompoundTag *tag)
|
|||
tag->putShort(L"xTile", (short) xTile);
|
||||
tag->putShort(L"yTile", (short) yTile);
|
||||
tag->putShort(L"zTile", (short) zTile);
|
||||
tag->putByte(L"inTile", (byte) lastTile);
|
||||
tag->putByte(L"shake", (byte) shakeTime);
|
||||
tag->putByte(L"inGround", (byte) (inGround ? 1 : 0));
|
||||
tag->putByte(L"inTile", (uint8_t) lastTile);
|
||||
tag->putByte(L"shake", (uint8_t) shakeTime);
|
||||
tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0));
|
||||
}
|
||||
|
||||
void FishingHook::readAdditionalSaveData(CompoundTag *tag)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void Ghast::defineSynchedData()
|
|||
{
|
||||
FlyingMob::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_IS_CHARGING, (byte) 0);
|
||||
entityData->define(DATA_IS_CHARGING, (uint8_t) 0);
|
||||
}
|
||||
|
||||
int Ghast::getMaxHealth()
|
||||
|
|
@ -77,7 +77,7 @@ int Ghast::getMaxHealth()
|
|||
void Ghast::tick()
|
||||
{
|
||||
FlyingMob::tick();
|
||||
byte current = entityData->getByte(DATA_IS_CHARGING);
|
||||
uint8_t current = entityData->getByte(DATA_IS_CHARGING);
|
||||
// this->textureName = current == 1 ? L"/mob/ghast_fire.png" : L"/mob/ghast.png"; // 4J replaced with following line
|
||||
this->textureIdx = current == 1 ? TN_MOB_GHAST_FIRE : TN_MOB_GHAST;
|
||||
}
|
||||
|
|
@ -174,8 +174,8 @@ void Ghast::serverAiStep()
|
|||
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
byte old = entityData->getByte(DATA_IS_CHARGING);
|
||||
byte current = (byte) (charge > 10 ? 1 : 0);
|
||||
uint8_t old = entityData->getByte(DATA_IS_CHARGING);
|
||||
uint8_t current = (uint8_t) (charge > 10 ? 1 : 0);
|
||||
if (old != current)
|
||||
{
|
||||
entityData->set(DATA_IS_CHARGING, current);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ ItemFrame::ItemFrame(Level *level, int xTile, int yTile, int zTile, int dir) : H
|
|||
void ItemFrame::defineSynchedData()
|
||||
{
|
||||
getEntityData()->defineNULL(DATA_ITEM, NULL);
|
||||
getEntityData()->define(DATA_ROTATION, (byte) 0);
|
||||
getEntityData()->define(DATA_ROTATION, (uint8_t) 0);
|
||||
}
|
||||
|
||||
void ItemFrame::dropItem()
|
||||
|
|
@ -79,7 +79,7 @@ int ItemFrame::getRotation()
|
|||
|
||||
void ItemFrame::setRotation(int rotation)
|
||||
{
|
||||
getEntityData()->set(DATA_ROTATION, (byte) (rotation % 4));
|
||||
getEntityData()->set(DATA_ROTATION, (uint8_t) (rotation % 4));
|
||||
}
|
||||
|
||||
void ItemFrame::addAdditonalSaveData(CompoundTag *tag)
|
||||
|
|
@ -87,7 +87,7 @@ void ItemFrame::addAdditonalSaveData(CompoundTag *tag)
|
|||
if (getItem() != NULL)
|
||||
{
|
||||
tag->putCompound(L"Item", getItem()->save(new CompoundTag()));
|
||||
tag->putByte(L"ItemRotation", (byte) getRotation());
|
||||
tag->putByte(L"ItemRotation", (uint8_t) getRotation());
|
||||
//tag->putFloat(L"ItemDropChance", dropChance);
|
||||
}
|
||||
HangingEntity::addAdditonalSaveData(tag);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ bool Minecart::makeStepSound()
|
|||
|
||||
void Minecart::defineSynchedData()
|
||||
{
|
||||
entityData->define(DATA_ID_FUEL, (byte) 0);
|
||||
entityData->define(DATA_ID_FUEL, (uint8_t) 0);
|
||||
entityData->define(DATA_ID_HURT, 0);
|
||||
entityData->define(DATA_ID_HURTDIR, 1);
|
||||
entityData->define(DATA_ID_DAMAGE, 0);
|
||||
|
|
@ -861,7 +861,7 @@ void Minecart::addAdditonalSaveData(CompoundTag *base)
|
|||
if ( (*items)[i] != NULL)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
tag->putByte(L"Slot", (byte) i);
|
||||
tag->putByte(L"Slot", (uint8_t) i);
|
||||
(*items)[i]->save(tag);
|
||||
listTag->add(tag);
|
||||
}
|
||||
|
|
@ -1158,11 +1158,11 @@ void Minecart::setHasFuel(bool fuel)
|
|||
{
|
||||
if (fuel)
|
||||
{
|
||||
entityData->set(DATA_ID_FUEL, (byte) (entityData->getByte(DATA_ID_FUEL) | 1));
|
||||
entityData->set(DATA_ID_FUEL, (uint8_t) (entityData->getByte(DATA_ID_FUEL) | 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_ID_FUEL, (byte) (entityData->getByte(DATA_ID_FUEL) & ~1));
|
||||
entityData->set(DATA_ID_FUEL, (uint8_t) (entityData->getByte(DATA_ID_FUEL) & ~1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ void Ozelot::defineSynchedData()
|
|||
{
|
||||
TamableAnimal::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_TYPE_ID, (byte) TYPE_OZELOT);
|
||||
entityData->define(DATA_TYPE_ID, (uint8_t) TYPE_OZELOT);
|
||||
}
|
||||
|
||||
void Ozelot::serverAiMobStep()
|
||||
|
|
@ -294,7 +294,7 @@ int Ozelot::getCatType()
|
|||
|
||||
void Ozelot::setCatType(int type)
|
||||
{
|
||||
entityData->set(DATA_TYPE_ID, (byte) type);
|
||||
entityData->set(DATA_TYPE_ID, (uint8_t) type);
|
||||
}
|
||||
|
||||
bool Ozelot::canSpawn()
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ bool Pig::canBeControlledByRider()
|
|||
void Pig::defineSynchedData()
|
||||
{
|
||||
Animal::defineSynchedData();
|
||||
entityData->define(DATA_SADDLE_ID, (byte) 0);
|
||||
entityData->define(DATA_SADDLE_ID, (uint8_t) 0);
|
||||
}
|
||||
|
||||
void Pig::addAdditonalSaveData(CompoundTag *tag)
|
||||
|
|
@ -142,11 +142,11 @@ void Pig::setSaddle(bool value)
|
|||
{
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_SADDLE_ID, (byte) 1);
|
||||
entityData->set(DATA_SADDLE_ID, (uint8_t) 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_SADDLE_ID, (byte) 0);
|
||||
entityData->set(DATA_SADDLE_ID, (uint8_t) 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ void PrimedTnt::explode()
|
|||
|
||||
void PrimedTnt::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
{
|
||||
entityTag->putByte(L"Fuse", (byte) life);
|
||||
entityTag->putByte(L"Fuse", (uint8_t) life);
|
||||
}
|
||||
|
||||
void PrimedTnt::readAdditionalSaveData(CompoundTag *tag)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ void Sheep::defineSynchedData()
|
|||
Animal::defineSynchedData();
|
||||
|
||||
// sheared and color share a byte
|
||||
entityData->define(DATA_WOOL_ID, ((byte) 0)); //was new Byte((byte), 0)
|
||||
entityData->define(DATA_WOOL_ID, ((uint8_t) 0)); //was new Byte((uint8_t), 0)
|
||||
}
|
||||
|
||||
void Sheep::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel)
|
||||
|
|
@ -117,7 +117,7 @@ int Sheep::getDeathLoot()
|
|||
return Tile::cloth_Id;
|
||||
}
|
||||
|
||||
void Sheep::handleEntityEvent(byte id)
|
||||
void Sheep::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::EAT_GRASS)
|
||||
{
|
||||
|
|
@ -195,7 +195,7 @@ void Sheep::addAdditonalSaveData(CompoundTag *tag)
|
|||
{
|
||||
Animal::addAdditonalSaveData(tag);
|
||||
tag->putBoolean(L"Sheared", isSheared());
|
||||
tag->putByte(L"Color", (byte) getColor());
|
||||
tag->putByte(L"Color", (uint8_t) getColor());
|
||||
}
|
||||
|
||||
void Sheep::readAdditionalSaveData(CompoundTag *tag)
|
||||
|
|
@ -227,8 +227,8 @@ int Sheep::getColor()
|
|||
|
||||
void Sheep::setColor(int color)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_WOOL_ID);
|
||||
entityData->set(DATA_WOOL_ID, (byte) ((current & 0xf0) | (color & 0x0f)));
|
||||
uint8_t current = entityData->getByte(DATA_WOOL_ID);
|
||||
entityData->set(DATA_WOOL_ID, (uint8_t) ((current & 0xf0) | (color & 0x0f)));
|
||||
}
|
||||
|
||||
bool Sheep::isSheared()
|
||||
|
|
@ -238,14 +238,14 @@ bool Sheep::isSheared()
|
|||
|
||||
void Sheep::setSheared(bool value)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_WOOL_ID);
|
||||
uint8_t current = entityData->getByte(DATA_WOOL_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_WOOL_ID, (byte) (current | 0x10));
|
||||
entityData->set(DATA_WOOL_ID, (uint8_t) (current | 0x10));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_WOOL_ID, (byte) (current & ~0x10));
|
||||
entityData->set(DATA_WOOL_ID, (uint8_t) (current & ~0x10));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
virtual int getDeathLoot();
|
||||
|
||||
public:
|
||||
virtual void handleEntityEvent(byte id);
|
||||
virtual void handleEntityEvent(uint8_t id);
|
||||
|
||||
public:
|
||||
float getHeadEatPositionScale(float a);
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ void Slime::defineSynchedData()
|
|||
{
|
||||
Mob::defineSynchedData();
|
||||
|
||||
entityData->define(ID_SIZE, (byte) 1);
|
||||
entityData->define(ID_SIZE, (uint8_t) 1);
|
||||
}
|
||||
|
||||
void Slime::setSize(int size)
|
||||
{
|
||||
entityData->set(ID_SIZE, (byte) size);
|
||||
entityData->set(ID_SIZE, (uint8_t) size);
|
||||
Mob::setSize(0.6f * size, 0.6f * size);
|
||||
this->setPos(x, y, z);
|
||||
setHealth(getMaxHealth());
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void Spider::defineSynchedData()
|
|||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
entityData->define(DATA_FLAGS_ID, (byte) 0);
|
||||
entityData->define(DATA_FLAGS_ID, (uint8_t) 0);
|
||||
}
|
||||
|
||||
void Spider::tick()
|
||||
|
|
@ -179,7 +179,7 @@ bool Spider::isClimbing()
|
|||
|
||||
void Spider::setClimbing(bool value)
|
||||
{
|
||||
byte flags = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t flags = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
flags |= 0x1;
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ int Villager::getPurchaseCost(int itemId, Random *random)
|
|||
return minMax.first + random->nextInt(minMax.second - minMax.first);
|
||||
}
|
||||
|
||||
void Villager::handleEntityEvent(byte id)
|
||||
void Villager::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::LOVE_HEARTS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
void setLastHurtByMob(shared_ptr<Mob> mob);
|
||||
void die(DamageSource *source);
|
||||
|
||||
void handleEntityEvent(byte id);
|
||||
void handleEntityEvent(uint8_t id);
|
||||
|
||||
private:
|
||||
void addParticlesAroundSelf(ePARTICLE_TYPE particle);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ VillagerGolem::VillagerGolem(Level *level) : Golem(level)
|
|||
void VillagerGolem::defineSynchedData()
|
||||
{
|
||||
Golem::defineSynchedData();
|
||||
entityData->define(DATA_FLAGS_ID, (byte) 0);
|
||||
entityData->define(DATA_FLAGS_ID, (uint8_t) 0);
|
||||
}
|
||||
|
||||
bool VillagerGolem::useNewAi()
|
||||
|
|
@ -143,7 +143,7 @@ bool VillagerGolem::doHurtTarget(shared_ptr<Entity> target)
|
|||
return hurt;
|
||||
}
|
||||
|
||||
void VillagerGolem::handleEntityEvent(byte id)
|
||||
void VillagerGolem::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::START_ATTACKING)
|
||||
{
|
||||
|
|
@ -219,14 +219,14 @@ bool VillagerGolem::isPlayerCreated()
|
|||
|
||||
void VillagerGolem::setPlayerCreated(bool value)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t current = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current | 0x01));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x01));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x01));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x01));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
virtual void addAdditonalSaveData(CompoundTag *tag);
|
||||
virtual void readAdditionalSaveData(CompoundTag *tag);
|
||||
virtual bool doHurtTarget(shared_ptr<Entity> target);
|
||||
virtual void handleEntityEvent(byte id);
|
||||
virtual void handleEntityEvent(uint8_t id);
|
||||
virtual shared_ptr<Village> getVillage();
|
||||
virtual int getAttackAnimationTick();
|
||||
virtual void offerFlower(bool offer);
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ void Wolf::defineSynchedData()
|
|||
{
|
||||
TamableAnimal::defineSynchedData();
|
||||
entityData->define(DATA_HEALTH_ID, getHealth());
|
||||
entityData->define(DATA_INTERESTED_ID, (byte)0);
|
||||
entityData->define(DATA_COLLAR_COLOR, (byte) ClothTile::getTileDataForItemAuxValue(DyePowderItem::RED));
|
||||
entityData->define(DATA_INTERESTED_ID, (uint8_t)0);
|
||||
entityData->define(DATA_COLLAR_COLOR, (uint8_t) ClothTile::getTileDataForItemAuxValue(DyePowderItem::RED));
|
||||
}
|
||||
|
||||
bool Wolf::makeStepSound()
|
||||
|
|
@ -118,7 +118,7 @@ void Wolf::addAdditonalSaveData(CompoundTag *tag)
|
|||
TamableAnimal::addAdditonalSaveData(tag);
|
||||
|
||||
tag->putBoolean(L"Angry", isAngry());
|
||||
tag->putByte(L"CollarColor", (byte) getCollarColor());
|
||||
tag->putByte(L"CollarColor", (uint8_t) getCollarColor());
|
||||
}
|
||||
|
||||
void Wolf::readAdditionalSaveData(CompoundTag *tag)
|
||||
|
|
@ -424,7 +424,7 @@ bool Wolf::interact(shared_ptr<Player> player)
|
|||
return TamableAnimal::interact(player);
|
||||
}
|
||||
|
||||
void Wolf::handleEntityEvent(byte id)
|
||||
void Wolf::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::SHAKE_WETNESS)
|
||||
{
|
||||
|
|
@ -471,14 +471,14 @@ bool Wolf::isAngry()
|
|||
|
||||
void Wolf::setAngry(bool value)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t current = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current | 0x02));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x02));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x02));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x02));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ int Wolf::getCollarColor()
|
|||
|
||||
void Wolf::setCollarColor(int color)
|
||||
{
|
||||
entityData->set(DATA_COLLAR_COLOR, (byte) (color & 0xF));
|
||||
entityData->set(DATA_COLLAR_COLOR, (uint8_t) (color & 0xF));
|
||||
}
|
||||
|
||||
// 4J-PB added for tooltips
|
||||
|
|
@ -520,15 +520,15 @@ shared_ptr<AgableMob> Wolf::getBreedOffspring(shared_ptr<AgableMob> target)
|
|||
|
||||
void Wolf::setIsInterested(bool value)
|
||||
{
|
||||
//byte current = entityData->getByte(DATA_INTERESTED_ID);
|
||||
//uint8_t current = entityData->getByte(DATA_INTERESTED_ID);
|
||||
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_INTERESTED_ID, (byte) 1);
|
||||
entityData->set(DATA_INTERESTED_ID, (uint8_t) 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_INTERESTED_ID, (byte) 0);
|
||||
entityData->set(DATA_INTERESTED_ID, (uint8_t) 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
virtual bool hurt(DamageSource *source, int dmg);
|
||||
virtual bool doHurtTarget(shared_ptr<Entity> target);
|
||||
virtual bool interact(shared_ptr<Player> player);
|
||||
virtual void handleEntityEvent(byte id);
|
||||
virtual void handleEntityEvent(uint8_t id);
|
||||
float getTailAngle();
|
||||
virtual bool isFood(shared_ptr<ItemInstance> item);
|
||||
virtual int getMaxSpawnClusterSize();
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ void Zombie::defineSynchedData()
|
|||
{
|
||||
Monster::defineSynchedData();
|
||||
|
||||
getEntityData()->define(DATA_BABY_ID, (byte) 0);
|
||||
getEntityData()->define(DATA_VILLAGER_ID, (byte) 0);
|
||||
getEntityData()->define(DATA_CONVERTING_ID, (byte) 0);
|
||||
getEntityData()->define(DATA_BABY_ID, (uint8_t) 0);
|
||||
getEntityData()->define(DATA_VILLAGER_ID, (uint8_t) 0);
|
||||
getEntityData()->define(DATA_CONVERTING_ID, (uint8_t) 0);
|
||||
}
|
||||
|
||||
float Zombie::getWalkingSpeedModifier()
|
||||
|
|
@ -87,23 +87,23 @@ bool Zombie::useNewAi()
|
|||
|
||||
bool Zombie::isBaby()
|
||||
{
|
||||
return getEntityData()->getByte(DATA_BABY_ID) == (byte) 1;
|
||||
return getEntityData()->getByte(DATA_BABY_ID) == (uint8_t) 1;
|
||||
}
|
||||
|
||||
void Zombie::setBaby(bool baby)
|
||||
{
|
||||
getEntityData()->set(DATA_BABY_ID, (byte) 1);
|
||||
getEntityData()->set(DATA_BABY_ID, (uint8_t) 1);
|
||||
updateSize(isBaby());
|
||||
}
|
||||
|
||||
bool Zombie::isVillager()
|
||||
{
|
||||
return getEntityData()->getByte(DATA_VILLAGER_ID) == (byte) 1;
|
||||
return getEntityData()->getByte(DATA_VILLAGER_ID) == (uint8_t) 1;
|
||||
}
|
||||
|
||||
void Zombie::setVillager(bool villager)
|
||||
{
|
||||
getEntityData()->set(DATA_VILLAGER_ID, (byte) (villager ? 1 : 0));
|
||||
getEntityData()->set(DATA_VILLAGER_ID, (uint8_t) (villager ? 1 : 0));
|
||||
}
|
||||
|
||||
void Zombie::aiStep()
|
||||
|
|
@ -292,7 +292,7 @@ bool Zombie::interact(shared_ptr<Player> player)
|
|||
void Zombie::startConverting(int time)
|
||||
{
|
||||
villagerConversionTime = time;
|
||||
getEntityData()->set(DATA_CONVERTING_ID, (byte) 1);
|
||||
getEntityData()->set(DATA_CONVERTING_ID, (uint8_t) 1);
|
||||
|
||||
removeEffect(MobEffect::weakness->id);
|
||||
addEffect(new MobEffectInstance(MobEffect::damageBoost->id, time, min(level->difficulty - 1, 0)));
|
||||
|
|
@ -300,7 +300,7 @@ void Zombie::startConverting(int time)
|
|||
level->broadcastEntityEvent(shared_from_this(), EntityEvent::ZOMBIE_CONVERTING);
|
||||
}
|
||||
|
||||
void Zombie::handleEntityEvent(byte id)
|
||||
void Zombie::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::ZOMBIE_CONVERTING)
|
||||
{
|
||||
|
|
@ -314,7 +314,7 @@ void Zombie::handleEntityEvent(byte id)
|
|||
|
||||
bool Zombie::isConverting()
|
||||
{
|
||||
return getEntityData()->getByte(DATA_CONVERTING_ID) == (byte) 1;
|
||||
return getEntityData()->getByte(DATA_CONVERTING_ID) == (uint8_t) 1;
|
||||
}
|
||||
|
||||
void Zombie::finishConversion()
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ protected:
|
|||
void startConverting(int time);
|
||||
|
||||
public:
|
||||
void handleEntityEvent(byte id);
|
||||
void handleEntityEvent(uint8_t id);
|
||||
bool isConverting();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void SynchedEntityData::define(int id, int value)
|
|||
m_isEmpty = false;
|
||||
}
|
||||
|
||||
void SynchedEntityData::define(int id, byte value)
|
||||
void SynchedEntityData::define(int id, uint8_t value)
|
||||
{
|
||||
MemSect(17);
|
||||
checkId(id);
|
||||
|
|
@ -82,7 +82,7 @@ void SynchedEntityData::checkId(int id)
|
|||
#endif
|
||||
}
|
||||
|
||||
byte SynchedEntityData::getByte(int id)
|
||||
uint8_t SynchedEntityData::getByte(int id)
|
||||
{
|
||||
return itemsById[id]->getValue_byte();
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ void SynchedEntityData::set(int id, int value)
|
|||
}
|
||||
}
|
||||
|
||||
void SynchedEntityData::set(int id, byte value)
|
||||
void SynchedEntityData::set(int id, uint8_t value)
|
||||
{
|
||||
shared_ptr<DataItem> dataItem = itemsById[id];
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ vector<shared_ptr<SynchedEntityData::DataItem> > *SynchedEntityData::unpack(Data
|
|||
{
|
||||
case TYPE_BYTE:
|
||||
{
|
||||
byte dataRead = input->readByte();
|
||||
uint8_t dataRead = input->readByte();
|
||||
item = shared_ptr<DataItem>( new DataItem(itemType, itemId, dataRead) );
|
||||
}
|
||||
break;
|
||||
|
|
@ -462,7 +462,7 @@ SynchedEntityData::DataItem::DataItem(int type, int id, int value) : type( type
|
|||
this->dirty = true;
|
||||
}
|
||||
|
||||
SynchedEntityData::DataItem::DataItem(int type, int id, byte value) : type( type ), id( id )
|
||||
SynchedEntityData::DataItem::DataItem(int type, int id, uint8_t value) : type( type ), id( id )
|
||||
{
|
||||
this->value_byte = value;
|
||||
this->dirty = true;
|
||||
|
|
@ -496,7 +496,7 @@ void SynchedEntityData::DataItem::setValue(int value)
|
|||
this->value_int = value;
|
||||
}
|
||||
|
||||
void SynchedEntityData::DataItem::setValue(byte value)
|
||||
void SynchedEntityData::DataItem::setValue(uint8_t value)
|
||||
{
|
||||
this->value_byte = value;
|
||||
}
|
||||
|
|
@ -526,7 +526,7 @@ short SynchedEntityData::DataItem::getValue_short()
|
|||
return value_short;
|
||||
}
|
||||
|
||||
byte SynchedEntityData::DataItem::getValue_byte()
|
||||
uint8_t SynchedEntityData::DataItem::getValue_byte()
|
||||
{
|
||||
return value_byte;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public:
|
|||
const int id;
|
||||
// 4J - there used to be one "value" type here of general type Object, just storing the different (used) varieties
|
||||
// here separately for us
|
||||
byte value_byte;
|
||||
uint8_t value_byte;
|
||||
int value_int;
|
||||
short value_short;
|
||||
wstring value_wstring;
|
||||
|
|
@ -24,19 +24,19 @@ public:
|
|||
|
||||
public:
|
||||
// There was one type here that took a generic Object type, using overloading here instead
|
||||
DataItem(int type, int id, byte value);
|
||||
DataItem(int type, int id, uint8_t value);
|
||||
DataItem(int type, int id, int value);
|
||||
DataItem(int type, int id, const wstring& value);
|
||||
DataItem(int type, int id, shared_ptr<ItemInstance> itemInstance);
|
||||
DataItem(int type, int id, short value);
|
||||
|
||||
int getId();
|
||||
void setValue(byte value);
|
||||
void setValue(uint8_t value);
|
||||
void setValue(int value);
|
||||
void setValue(short value);
|
||||
void setValue(const wstring& value);
|
||||
void setValue(shared_ptr<ItemInstance> value);
|
||||
byte getValue_byte();
|
||||
uint8_t getValue_byte();
|
||||
int getValue_int();
|
||||
short getValue_short();
|
||||
wstring getValue_wstring();
|
||||
|
|
@ -79,14 +79,14 @@ public:
|
|||
|
||||
// 4J - this function used to be a template, but there's only 3 varieties of use I've found so just hard-coding now, as
|
||||
// the original had some automatic Class to type sort of conversion that's a real pain for us to actually do
|
||||
void define(int id, byte value);
|
||||
void define(int id, uint8_t value);
|
||||
void define(int id, const wstring& value);
|
||||
void define(int id, int value);
|
||||
void define(int id, short value);
|
||||
void defineNULL(int id, void *pVal);
|
||||
|
||||
void checkId(int id); // 4J - added to contain common code from overloaded define functions above
|
||||
byte getByte(int id);
|
||||
uint8_t getByte(int id);
|
||||
short getShort(int id);
|
||||
int getInteger(int id);
|
||||
float getFloat(int id);
|
||||
|
|
@ -94,7 +94,7 @@ public:
|
|||
shared_ptr<ItemInstance> getItemInstance(int id);
|
||||
Pos *getPos(int id);
|
||||
// 4J - using overloads rather than template here
|
||||
void set(int id, byte value);
|
||||
void set(int id, uint8_t value);
|
||||
void set(int id, int value);
|
||||
void set(int id, short value);
|
||||
void set(int id, const wstring& value);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ TamableAnimal::~TamableAnimal()
|
|||
void TamableAnimal::defineSynchedData()
|
||||
{
|
||||
Animal::defineSynchedData();
|
||||
entityData->define(DATA_FLAGS_ID, (byte) 0);
|
||||
entityData->define(DATA_FLAGS_ID, (uint8_t) 0);
|
||||
entityData->define(DATA_OWNERUUID_ID, L"");
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ void TamableAnimal::spawnTamingParticles(bool success)
|
|||
}
|
||||
}
|
||||
|
||||
void TamableAnimal::handleEntityEvent(byte id)
|
||||
void TamableAnimal::handleEntityEvent(uint8_t id)
|
||||
{
|
||||
if (id == EntityEvent::TAMING_SUCCEEDED)
|
||||
{
|
||||
|
|
@ -109,14 +109,14 @@ bool TamableAnimal::isTame()
|
|||
|
||||
void TamableAnimal::setTame(bool value)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t current = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current | 0x04));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x04));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x04));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x04));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -127,14 +127,14 @@ bool TamableAnimal::isSitting()
|
|||
|
||||
void TamableAnimal::setSitting(bool value)
|
||||
{
|
||||
byte current = entityData->getByte(DATA_FLAGS_ID);
|
||||
uint8_t current = entityData->getByte(DATA_FLAGS_ID);
|
||||
if (value)
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current | 0x01));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x01));
|
||||
}
|
||||
else
|
||||
{
|
||||
entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x01));
|
||||
entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x01));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ protected:
|
|||
virtual void spawnTamingParticles(bool success);
|
||||
|
||||
public:
|
||||
virtual void handleEntityEvent(byte id);
|
||||
virtual void handleEntityEvent(uint8_t id);
|
||||
virtual bool isTame();
|
||||
virtual void setTame(bool value);
|
||||
virtual bool isSitting();
|
||||
|
|
|
|||
|
|
@ -260,9 +260,9 @@ void Throwable::addAdditonalSaveData(CompoundTag *tag)
|
|||
tag->putShort(L"xTile", (short) xTile);
|
||||
tag->putShort(L"yTile", (short) yTile);
|
||||
tag->putShort(L"zTile", (short) zTile);
|
||||
tag->putByte(L"inTile", (byte) lastTile);
|
||||
tag->putByte(L"shake", (byte) shakeTime);
|
||||
tag->putByte(L"inGround", (byte) (inGround ? 1 : 0));
|
||||
tag->putByte(L"inTile", (uint8_t) lastTile);
|
||||
tag->putByte(L"shake", (uint8_t) shakeTime);
|
||||
tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0));
|
||||
}
|
||||
|
||||
void Throwable::readAdditionalSaveData(CompoundTag *tag)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi
|
|||
DWORD numberOfBytesRead = 0;
|
||||
DWORD numberOfBytesWritten = 0;
|
||||
|
||||
byte *data = new byte[sourceFileEntry->getFileSize()];
|
||||
uint8_t *data = new uint8_t[sourceFileEntry->getFileSize()];
|
||||
|
||||
// Read from source
|
||||
sourceSave->readFile(sourceFileEntry, data, sourceFileEntry->getFileSize(), &numberOfBytesRead);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile
|
|||
//the next byte of data, or -1 if the end of the file is reached.
|
||||
int ConsoleSaveFileInputStream::read()
|
||||
{
|
||||
byte byteRead = static_cast<byte>(0);
|
||||
uint8_t byteRead = static_cast<uint8_t>(0);
|
||||
DWORD numberOfBytesRead;
|
||||
|
||||
BOOL result = m_saveFile->readFile(
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file )
|
|||
|
||||
const int bufferSize = 4096;
|
||||
int amountToRead = bufferSize;
|
||||
byte buffer[bufferSize];
|
||||
uint8_t buffer[bufferSize];
|
||||
DWORD bufferDataSize = 0;
|
||||
|
||||
|
||||
|
|
@ -474,8 +474,8 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt
|
|||
const DWORD bufferSize = 4096;
|
||||
DWORD amountToRead = bufferSize;
|
||||
//assert( nNumberOfBytesToWrite <= bufferSize );
|
||||
static byte buffer1[bufferSize];
|
||||
static byte buffer2[bufferSize];
|
||||
static uint8_t buffer1[bufferSize];
|
||||
static uint8_t buffer2[bufferSize];
|
||||
DWORD buffer1Size = 0;
|
||||
DWORD buffer2Size = 0;
|
||||
|
||||
|
|
@ -666,11 +666,11 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
|
|||
// On PS3, don't compress the data as we can't really afford the extra memory this requires for the output buffer. Instead we'll be writing
|
||||
// directly from the save data.
|
||||
StorageManager.SetSaveData(pvSaveMem,fileSize);
|
||||
byte *compData = (byte *)pvSaveMem;
|
||||
uint8_t *compData = (uint8_t *)pvSaveMem;
|
||||
#else
|
||||
// Attempt to allocate the required memory
|
||||
// We do not own this, it belongs to the StorageManager
|
||||
byte *compData = (byte *)StorageManager.AllocateSaveData( compLength );
|
||||
uint8_t *compData = (uint8_t *)StorageManager.AllocateSaveData( compLength );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
// AP - make sure we always allocate just what is needed so it will only SAVE what is needed.
|
||||
|
|
@ -708,7 +708,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
|
|||
compLength = compLength+8;
|
||||
|
||||
// Attempt to allocate the required memory
|
||||
compData = (byte *)StorageManager.AllocateSaveData( compLength );
|
||||
compData = (uint8_t *)StorageManager.AllocateSaveData( compLength );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b)
|
|||
{
|
||||
DWORD numberOfBytesWritten;
|
||||
|
||||
byte value = (byte) b;
|
||||
uint8_t value = (uint8_t) b;
|
||||
|
||||
BOOL result = m_saveFile->writeFile(
|
||||
m_file,
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ void ConsoleSaveFileSplit::deleteFile( FileEntry *file )
|
|||
|
||||
const int bufferSize = 4096;
|
||||
int amountToRead = bufferSize;
|
||||
byte buffer[bufferSize];
|
||||
uint8_t buffer[bufferSize];
|
||||
DWORD bufferDataSize = 0;
|
||||
|
||||
|
||||
|
|
@ -1044,8 +1044,8 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT
|
|||
const DWORD bufferSize = 4096;
|
||||
DWORD amountToRead = bufferSize;
|
||||
//assert( nNumberOfBytesToWrite <= bufferSize );
|
||||
static byte buffer1[bufferSize];
|
||||
static byte buffer2[bufferSize];
|
||||
static uint8_t buffer1[bufferSize];
|
||||
static uint8_t buffer2[bufferSize];
|
||||
DWORD buffer1Size = 0;
|
||||
DWORD buffer2Size = 0;
|
||||
|
||||
|
|
@ -1352,7 +1352,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail)
|
|||
|
||||
// Attempt to allocate the required memory
|
||||
// We do not own this, it belongs to the StorageManager
|
||||
byte *compData = (byte *)StorageManager.AllocateSaveData( compLength );
|
||||
uint8_t *compData = (uint8_t *)StorageManager.AllocateSaveData( compLength );
|
||||
|
||||
// If we failed to allocate then compData will be NULL
|
||||
// Pre-calculate the compressed data size so that we can attempt to allocate a smaller buffer
|
||||
|
|
@ -1379,7 +1379,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail)
|
|||
compLength = compLength+8;
|
||||
|
||||
// Attempt to allocate the required memory
|
||||
compData = (byte *)StorageManager.AllocateSaveData( compLength );
|
||||
compData = (uint8_t *)StorageManager.AllocateSaveData( compLength );
|
||||
}
|
||||
|
||||
if(compData != NULL)
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ ssize_t ReadFile(int fd, void* buffer, size_t byteRead, DWORD* numberOfBytesRead
|
|||
//the next byte of data, or -1 if the end of the file is reached.
|
||||
int FileInputStream::read()
|
||||
{
|
||||
byte byteRead = static_cast<byte>(0);
|
||||
uint8_t byteRead = static_cast<uint8_t>(0);
|
||||
DWORD numberOfBytesRead;
|
||||
|
||||
BOOL bSuccess = ReadFile(
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ FileOutputStream::~FileOutputStream()
|
|||
//b - the byte to be written.
|
||||
void FileOutputStream::write(unsigned int b)
|
||||
{
|
||||
byte value = (byte) b;
|
||||
uint8_t value = (uint8_t) b;
|
||||
|
||||
#if defined(_WIN32)
|
||||
BOOL result = WriteFile(
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public:
|
|||
dis->readFully(data);
|
||||
}
|
||||
|
||||
byte getId() { return TAG_Byte_Array; }
|
||||
uint8_t getId() { return TAG_Byte_Array; }
|
||||
|
||||
wstring toString()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
class ByteTag : public Tag
|
||||
{
|
||||
public:
|
||||
byte data;
|
||||
uint8_t data;
|
||||
ByteTag(const wstring &name) : Tag(name) {}
|
||||
ByteTag(const wstring &name, byte data) : Tag(name) {this->data = data; }
|
||||
ByteTag(const wstring &name, uint8_t data) : Tag(name) {this->data = data; }
|
||||
|
||||
void write(DataOutput *dos) { dos->writeByte(data); }
|
||||
void load(DataInput *dis) { data = dis->readByte(); }
|
||||
|
||||
byte getId() { return TAG_Byte; }
|
||||
uint8_t getId() { return TAG_Byte; }
|
||||
wstring toString()
|
||||
{
|
||||
static wchar_t buf[32];
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
return ret;
|
||||
}
|
||||
|
||||
byte getId()
|
||||
uint8_t getId()
|
||||
{
|
||||
return TAG_Compound;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ public:
|
|||
tags[name] = tag->setName(wstring( name ));
|
||||
}
|
||||
|
||||
void putByte(const wchar_t * name, byte value)
|
||||
void putByte(const wchar_t * name, uint8_t value)
|
||||
{
|
||||
tags[name] = (new ByteTag(name,value));
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ public:
|
|||
|
||||
void putBoolean(const wchar_t * string, bool val)
|
||||
{
|
||||
putByte(string, val?static_cast<byte>(1):static_cast<byte>(0));
|
||||
putByte(string, val?static_cast<uint8_t>(1):static_cast<uint8_t>(0));
|
||||
}
|
||||
|
||||
Tag *get(const wchar_t *name)
|
||||
|
|
@ -132,9 +132,9 @@ public:
|
|||
return tags.find(name) != tags.end();
|
||||
}
|
||||
|
||||
byte getByte(const wchar_t * name)
|
||||
uint8_t getByte(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (byte)0;
|
||||
if (tags.find(name) == tags.end()) return (uint8_t)0;
|
||||
return ((ByteTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ public:
|
|||
|
||||
bool getBoolean(const wchar_t *string)
|
||||
{
|
||||
return getByte(string) != static_cast<byte>(0);
|
||||
return getByte(string) != static_cast<uint8_t>(0);
|
||||
}
|
||||
|
||||
void remove(const wstring &name)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue