Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions Minecraft.Client/AchievementScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@ void AchievementScreen::renderBg(int xm, int ym, float a)

for ( Achievement *ach : *Achievements::achievements )
{
if ( ach == nullptr || ach->requires == nullptr) continue;
if ( ach == nullptr || ach->requirements == nullptr) continue;

int x1 = ach->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap;
int y1 = ach->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap;

int x2 = ach->requires->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap;
int y2 = ach->requires->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap;
int x2 = ach->requirements->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap;
int y2 = ach->requirements->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap;

int color = 0;

Expand Down Expand Up @@ -400,7 +400,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
else
{
int width = Math::_max(font->width(name), 120);
wstring msg = I18n::get(L"achievement.requires", ach->requires->name);
wstring msg = I18n::get(L"achievement.requires", ach->requirements->name);
int height = font->wordWrapHeight(msg, width);
fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000);
font->drawWordWrap(msg, x, y + 12, width, 0xff705050);
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/Audio/SoundEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ char SoundEngine::m_szRedistName[]={"redist"};

#endif

char *SoundEngine::m_szStreamFileA[eStream_Max]=
const char *SoundEngine::m_szStreamFileA[eStream_Max]=
{
"calm1",
"calm2",
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/Audio/SoundEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class SoundEngine : public ConsoleSoundEngine
static char m_szSoundPath[];
static char m_szMusicPath[];
static char m_szRedistName[];
static char *m_szStreamFileA[eStream_Max];
static const char *m_szStreamFileA[eStream_Max];

AUDIO_LISTENER m_ListenerA[MAX_LOCAL_PLAYERS];
int m_validListenerCount;
Expand Down
24 changes: 12 additions & 12 deletions Minecraft.Client/Common/Audio/miniaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ any other library. Note that ABI compatibility is not guaranteed between version
fix releases, so take care if compiling as a shared object.

miniaudio includes both low level and high level APIs. The low level API is good for those who want
to do all of their mixing themselves and only require a light weight interface to the underlying
to do all of their mixing themselves and only require a light weight interface to the underlying1 uint8_t
audio device. The high level API is good for those who have complex mixing and effect requirements.

In miniaudio, objects are transparent structures. Unlike many other libraries, there are no handles
Expand Down Expand Up @@ -11981,7 +11981,7 @@ static MA_INLINE ma_uint32 ma_swap_endian_uint32(ma_uint32 n)
return __builtin_bswap32(n);
#endif
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & 0xFF000000) >> 24) |
Expand Down Expand Up @@ -80011,7 +80011,7 @@ static MA_INLINE ma_uint16 ma_dr_wav__bswap16(ma_uint16 n)
#elif defined(__GNUC__) || defined(__clang__)
return __builtin_bswap16(n);
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & 0xFF00) >> 8) |
Expand All @@ -80038,7 +80038,7 @@ static MA_INLINE ma_uint32 ma_dr_wav__bswap32(ma_uint32 n)
return __builtin_bswap32(n);
#endif
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & 0xFF000000) >> 24) |
Expand All @@ -80055,7 +80055,7 @@ static MA_INLINE ma_uint64 ma_dr_wav__bswap64(ma_uint64 n)
#elif defined(__GNUC__) || defined(__clang__)
return __builtin_bswap64(n);
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & ((ma_uint64)0xFF000000 << 32)) >> 56) |
Expand Down Expand Up @@ -81733,11 +81733,11 @@ MA_PRIVATE size_t ma_dr_wav__write(ma_dr_wav* pWav, const void* pData, size_t da
MA_DR_WAV_ASSERT(pWav->onWrite != NULL);
return pWav->onWrite(pWav->pUserData, pData, dataSize);
}
MA_PRIVATE size_t ma_dr_wav__write_byte(ma_dr_wav* pWav, ma_uint8 byte)
MA_PRIVATE size_t ma_dr_wav__write_byte(ma_dr_wav* pWav, ma_uint8 uint8_t)
{
MA_DR_WAV_ASSERT(pWav != NULL);
MA_DR_WAV_ASSERT(pWav->onWrite != NULL);
return pWav->onWrite(pWav->pUserData, &byte, 1);
return pWav->onWrite(pWav->pUserData, &uint8_t, 1);
}
MA_PRIVATE size_t ma_dr_wav__write_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value)
{
Expand Down Expand Up @@ -81787,12 +81787,12 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count(ma_dr_wav* pWav, const void* pData,
}
return ma_dr_wav__write(pWav, pData, dataSize);
}
MA_PRIVATE size_t ma_dr_wav__write_or_count_byte(ma_dr_wav* pWav, ma_uint8 byte)
MA_PRIVATE size_t ma_dr_wav__write_or_count_byte(ma_dr_wav* pWav, ma_uint8 uint8_t)
{
if (pWav == NULL) {
return 1;
}
return ma_dr_wav__write_byte(pWav, byte);
return ma_dr_wav__write_byte(pWav, uint8_t);
}
MA_PRIVATE size_t ma_dr_wav__write_or_count_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value)
{
Expand Down Expand Up @@ -85149,7 +85149,7 @@ static MA_INLINE ma_uint16 ma_dr_flac__swap_endian_uint16(ma_uint16 n)
#elif defined(__WATCOMC__) && defined(__386__)
return _watcom_bswap16(n);
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & 0xFF00) >> 8) |
Expand Down Expand Up @@ -85178,7 +85178,7 @@ static MA_INLINE ma_uint32 ma_dr_flac__swap_endian_uint32(ma_uint32 n)
#elif defined(__WATCOMC__) && defined(__386__)
return _watcom_bswap32(n);
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & 0xFF000000) >> 24) |
Expand All @@ -85197,7 +85197,7 @@ static MA_INLINE ma_uint64 ma_dr_flac__swap_endian_uint64(ma_uint64 n)
#elif defined(__WATCOMC__) && defined(__386__)
return _watcom_bswap64(n);
#else
#error "This compiler does not support the byte swap intrinsic."
#error "This compiler does not support the uint8_t swap intrinsic."
#endif
#else
return ((n & ((ma_uint64)0xFF000000 << 32)) >> 56) |
Expand Down
8 changes: 4 additions & 4 deletions Minecraft.Client/Common/Audio/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ enum STBVorbisError
// STB_VORBIS_MAX_CHANNELS [number]
// globally define this to the maximum number of channels you need.
// The spec does not put a restriction on channels except that
// the count is stored in a byte, so 255 is the hard limit.
// the count is stored in a uint8_t, so 255 is the hard limit.
// Reducing this saves about 16 bytes per value, so using 16 saves
// (255-16)*16 or around 4KB. Plus anything other memory usage
// I forgot to account for. Can probably go as low as 8 (7.1 audio),
Expand Down Expand Up @@ -996,9 +996,9 @@ static void crc32_init(void)
}
}

static __forceinline uint32 crc32_update(uint32 crc, uint8 byte)
static __forceinline uint32 crc32_update(uint32 crc, uint8 uint8_t)
{
return (crc << 8) ^ crc_table[byte ^ (crc >> 24)];
return (crc << 8) ^ crc_table[uint8_t ^ (crc >> 24)];
}


Expand Down Expand Up @@ -4356,7 +4356,7 @@ static int vorbis_search_for_page_pushdata(vorb *f, uint8 *data, int data_len)
// they may cause us to stop early if their header is incomplete
if (f->page_crc_tests < STB_VORBIS_PUSHDATA_CRC_COUNT) {
if (data_len < 4) return 0;
data_len -= 3; // need to look for 4-byte sequence, so don't miss
data_len -= 3; // need to look for 4-uint8_t sequence, so don't miss
// one that straddles a boundary
for (i=0; i < data_len; ++i) {
if (data[i] == 0x4f) {
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/C4JMemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class C4JMemoryPoolGrow : public C4JMemoryPool

virtual void* Alloc(size_t size)
{
size = Align(size, 4); // 4 byte align the memory
size = Align(size, 4); // 4 uint8_t align the memory
assert((m_currentOffset + size) < m_totalSize); // make sure we haven't ran out of space
void* returnMem = &m_pMemory[m_currentOffset]; // grab the return memory
m_currentOffset += size;
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/Colours/ColourTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

unordered_map<wstring,eMinecraftColour> ColourTable::s_colourNamesMap;

wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
{
L"NOTSET",

Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/Colours/ColourTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ColourTable
private:
unsigned int m_colourValues[eMinecraftColour_COUNT];

static wchar_t *ColourTableElements[eMinecraftColour_COUNT];
static const wchar_t *ColourTableElements[eMinecraftColour_COUNT];
static unordered_map<wstring,eMinecraftColour> s_colourNamesMap;

public:
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/DLC/DLCAudioFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PBYTE DLCAudioFile::getData(DWORD &dwBytes)
return m_pbData;
}

WCHAR *DLCAudioFile::wchTypeNamesA[]=
const WCHAR *DLCAudioFile::wchTypeNamesA[]=
{
L"CUENAME",
L"CREDIT",
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/DLC/DLCAudioFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DLCAudioFile : public DLCFile
e_AudioParamType_Max,

};
static WCHAR *wchTypeNamesA[e_AudioParamType_Max];
static const WCHAR *wchTypeNamesA[e_AudioParamType_Max];

DLCAudioFile(const wstring &path);

Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes)

// Init values.
int version_number;
byte compression_type;
uint8_t compression_type;
wstring texturepackid;

// Read Datastream.
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/DLC/DLCManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "..\..\Minecraft.h"
#include "..\..\TexturePackRepository.h"

WCHAR *DLCManager::wchTypeNamesA[]=
const WCHAR *DLCManager::wchTypeNamesA[]=
{
L"DISPLAYNAME",
L"THEMENAME",
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/DLC/DLCManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DLCManager
e_DLCParamType_Max,

};
static WCHAR *wchTypeNamesA[e_DLCParamType_Max];
static const WCHAR *wchTypeNamesA[e_DLCParamType_Max];

private:
vector<DLCPack *> m_packs;
Expand Down
16 changes: 8 additions & 8 deletions Minecraft.Client/Common/GameRules/GameRuleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "ConsoleGameRules.h"
#include "GameRuleManager.h"

WCHAR *GameRuleManager::wchTagNameA[] =
const WCHAR *GameRuleManager::wchTagNameA[] =
{
L"", // eGameRuleType_Root
L"MapOptions", // eGameRuleType_LevelGenerationOptions
Expand All @@ -34,7 +34,7 @@ WCHAR *GameRuleManager::wchTagNameA[] =
L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule
};

WCHAR *GameRuleManager::wchAttrNameA[] =
const WCHAR *GameRuleManager::wchAttrNameA[] =
{
L"descriptionName", // eGameRuleAttr_descriptionName
L"promptName", // eGameRuleAttr_promptName
Expand Down Expand Up @@ -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(pack);
// = loadGameRules(dData, dSize); //, strings);
Expand All @@ -123,7 +123,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(pack);
// = loadGameRules(dData, dSize); //, strings);
Expand All @@ -137,7 +137,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() );
Expand All @@ -148,7 +148,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");

Expand Down Expand Up @@ -235,7 +235,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)
Expand Down Expand Up @@ -367,7 +367,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;
Expand Down
12 changes: 6 additions & 6 deletions Minecraft.Client/Common/GameRules/GameRuleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class WstringLookup;
class GameRuleManager
{
public:
static WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
static WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
static const WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
static const WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];

static const short version_number = 2;

Expand All @@ -40,18 +40,18 @@ class GameRuleManager

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);

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);
Expand Down
4 changes: 2 additions & 2 deletions Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer,
return _override;
}

void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/)
void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/)
{
/////////////////////////////////
// Create firecharge
Expand Down Expand Up @@ -1358,7 +1358,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
expTags->add(expTag);

fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags);
fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphur);
fireTag->putByte(FireworksItem::TAG_FLIGHT, (uint8_t) sulphur);

itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag);

Expand Down
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ class IUIScene_CreativeMenu : public virtual IUIScene_AbstractContainerMenu
EToolTipItem &buttonBack
);

static void BuildFirework(vector<shared_ptr<ItemInstance> > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1);
static void BuildFirework(vector<shared_ptr<ItemInstance> > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1);
};
2 changes: 1 addition & 1 deletion Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UIScene_InGameInfoMenu : public UIScene

typedef struct _PlayerInfo
{
byte m_smallId;
uint8_t m_smallId;
char m_voiceStatus;
short m_colorState;
wstring m_name;
Expand Down
Loading