diff --git a/Minecraft.Client/AchievementScreen.cpp b/Minecraft.Client/AchievementScreen.cpp index 902aed174..0b41efe86 100644 --- a/Minecraft.Client/AchievementScreen.cpp +++ b/Minecraft.Client/AchievementScreen.cpp @@ -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; @@ -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.requirements", 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); diff --git a/Minecraft.Client/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h index a7552ec06..4b221db7f 100644 --- a/Minecraft.Client/Common/App_structs.h +++ b/Minecraft.Client/Common/App_structs.h @@ -33,7 +33,7 @@ typedef struct unsigned char ucSoundFXVolume; unsigned char ucSensitivity; unsigned char ucGamma; - unsigned char ucPad01; // 1 byte of padding inserted here + unsigned char ucPad01; // 1 uint8_t of padding inserted here unsigned short usBitmaskValues; // bit 0,1 - difficulty // bit 2 - view bob // bit 3 - player visible in a map diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index b2ca2be33..12e4368c1 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -64,9 +64,9 @@ void SoundEngine::playMusicTick() {}; #else #ifdef _WINDOWS64 -char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"}; -char SoundEngine::m_szMusicPath[]={"music\\"}; -char SoundEngine::m_szRedistName[]={"redist64"}; +const char SoundEngine::m_szSoundPath[] = {"Windows64Media\\Sound\\"}; +const char SoundEngine::m_szMusicPath[] = {"music\\"}; +const char SoundEngine::m_szRedistName[] = {"redist64"}; #elif defined _DURANGO char SoundEngine::m_szSoundPath[]={"Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; @@ -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", diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 5bd2fe4b9..2cbd9f59a 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Audio/SoundEngine.h @@ -148,10 +148,10 @@ private: ma_sound m_musicStream; bool m_musicStreamActive; - static char m_szSoundPath[]; - static char m_szMusicPath[]; - static char m_szRedistName[]; - static char *m_szStreamFileA[eStream_Max]; + static const char m_szSoundPath[]; + static const char m_szMusicPath[]; + static const char m_szRedistName[]; + static const char *m_szStreamFileA[eStream_Max]; AUDIO_LISTENER m_ListenerA[MAX_LOCAL_PLAYERS]; int m_validListenerCount; diff --git a/Minecraft.Client/Common/Audio/miniaudio.h b/Minecraft.Client/Common/Audio/miniaudio.h index 24e676bb2..2e7e41380 100644 --- a/Minecraft.Client/Common/Audio/miniaudio.h +++ b/Minecraft.Client/Common/Audio/miniaudio.h @@ -199,7 +199,7 @@ use a specific one you will need to specify the device ID in the configuration, config.capture.pDeviceID = pMyCaptureDeviceID; // Only if requesting a capture, duplex or loopback device. ``` -To retrieve the device ID you will need to perform device enumeration, however this requires the +To retrieve the device ID you will need to perform device enumeration, however this requirements the use of a new concept called the "context". Conceptually speaking the context sits above the device. There is one context to many devices. The purpose of the context is to represent the backend at a more global level and to perform operations outside the scope of an individual device. Mainly it is @@ -396,7 +396,7 @@ The start/stop time needs to be specified based on the absolute timer which is c engine. The current global time in PCM frames can be retrieved with `ma_engine_get_time_in_pcm_frames()`. The engine's global time can be changed with `ma_engine_set_time_in_pcm_frames()` for synchronization purposes if required. Note that scheduling -a start time still requires an explicit call to `ma_sound_start()` before anything will play: +a start time still requirements an explicit call to `ma_sound_start()` before anything will play: ```c ma_sound_set_start_time_in_pcm_frames(&sound, ma_engine_get_time_in_pcm_frames(&engine) + (ma_engine_get_sample_rate(&engine) * 2); @@ -480,7 +480,7 @@ symbol for `ActivateAudioInterfaceAsync()`. The macOS build should compile cleanly without the need to download any dependencies nor link to any libraries or frameworks. The iOS build needs to be compiled as Objective-C and will need to link the relevant frameworks but should compile cleanly out of the box with Xcode. Compiling -through the command line requires linking to `-lpthread` and `-lm`. +through the command line requirements linking to `-lpthread` and `-lm`. Due to the way miniaudio links to frameworks at runtime, your application may not pass Apple's notarization process. To fix this there are two options. The first is to compile with @@ -502,13 +502,13 @@ See this discussion for more info: https://github.com/mackron/miniaudio/issues/2 2.3. Linux ---------- -The Linux build only requires linking to `-ldl`, `-lpthread` and `-lm`. You do not need any +The Linux build only requirements linking to `-ldl`, `-lpthread` and `-lm`. You do not need any development packages. You may need to link with `-latomic` if you're compiling for 32-bit ARM. 2.4. BSD -------- -The BSD build only requires linking to `-lpthread` and `-lm`. NetBSD uses audio(4), OpenBSD uses +The BSD build only requirements linking to `-lpthread` and `-lm`. NetBSD uses audio(4), OpenBSD uses sndio and FreeBSD uses OSS. You may need to link with `-latomic` if you're compiling for 32-bit ARM. @@ -517,7 +517,7 @@ ARM. ------------ AAudio is the highest priority backend on Android. This should work out of the box without needing any kind of compiler configuration. Support for AAudio starts with Android 8 which means older -versions will fall back to OpenSL|ES which requires API level 16+. +versions will fall back to OpenSL|ES which requirements API level 16+. There have been reports that the OpenSL|ES backend fails to initialize on some Android based devices due to `dlopen()` failing to open "libOpenSLES.so". If this happens on your platform @@ -581,7 +581,7 @@ To run locally, you'll need to use emrun: +----------------------------------+--------------------------------------------------------------------+ | MA_NO_NULL | Disables the null backend. | +----------------------------------+--------------------------------------------------------------------+ - | MA_ENABLE_ONLY_SPECIFIC_BACKENDS | Disables all backends by default and requires `MA_ENABLE_*` to | + | MA_ENABLE_ONLY_SPECIFIC_BACKENDS | Disables all backends by default and requirements `MA_ENABLE_*` to | | | enable specific backends. | +----------------------------------+--------------------------------------------------------------------+ | MA_ENABLE_WASAPI | Used in conjunction with MA_ENABLE_ONLY_SPECIFIC_BACKENDS to | @@ -1467,7 +1467,7 @@ can be useful to schedule a sound to start or stop: ma_sound_set_stop_time_in_pcm_frames(&sound, ma_engine_get_time_in_pcm_frames(&engine) + (ma_engine_get_sample_rate(&engine) * 2)); ``` -Note that scheduling a start time still requires an explicit call to `ma_sound_start()` before +Note that scheduling a start time still requirements an explicit call to `ma_sound_start()` before anything will play. The time is specified in global time which is controlled by the engine. You can get the engine's @@ -3592,9 +3592,9 @@ move the read pointer forward via the consumer thread, and the write pointer for producer thread. If there is too much space between the pointers, move the read pointer forward. If there is too little space between the pointers, move the write pointer forward. -You can use a ring buffer at the byte level instead of the PCM frame level by using the `ma_rb` +You can use a ring buffer at the uint8_t level instead of the PCM frame level by using the `ma_rb` API. This is exactly the same, only you will use the `ma_rb` functions instead of `ma_pcm_rb` and -instead of frame counts you will pass around byte counts. +instead of frame counts you will pass around uint8_t counts. The maximum size of the buffer in bytes is `0x7FFFFFFF-(MA_SIMD_ALIGNMENT-1)` due to the most significant bit being used to encode a loop flag and the internally managed buffers always being @@ -3674,7 +3674,7 @@ BSD 15.4. UWP --------- - UWP only supports default playback and capture devices. -- UWP requires the Microphone capability to be enabled in the application's manifest (Package.appxmanifest): +- UWP requirements the Microphone capability to be enabled in the application's manifest (Package.appxmanifest): ``` @@ -7275,7 +7275,7 @@ easier, some helper callbacks are available. If the backend uses a blocking read backend uses a callback for data delivery, that callback must call `ma_device_handle_backend_data_callback()` from within its callback. This allows miniaudio to then process any necessary data conversion and then pass it to the miniaudio data callback. -If the backend requires absolute flexibility with its data delivery, it can optionally implement the `onDeviceDataLoop()` callback +If the backend requirements absolute flexibility with its data delivery, it can optionally implement the `onDeviceDataLoop()` callback which will allow it to implement the logic that will run on the audio thread. This is much more advanced and is completely optional. The audio thread should run data delivery logic in a loop while `ma_device_get_state() == ma_device_state_started` and no errors have been @@ -11301,7 +11301,7 @@ typedef struct ma_uint32 defaultVolumeSmoothTimeInPCMFrames; /* Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. High values means more smoothing at the expense of high latency (will take longer to reach the new volume). */ ma_uint32 preMixStackSizeInBytes; /* A stack is used for internal processing in the node graph. This allows you to configure the size of this stack. Smaller values will reduce the maximum depth of your node graph. You should rarely need to modify this. */ ma_allocation_callbacks allocationCallbacks; - ma_bool32 noAutoStart; /* When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */ + ma_bool32 noAutoStart; /* When set to true, requirements an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */ ma_bool32 noDevice; /* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */ ma_mono_expansion_mode monoExpansionMode; /* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */ ma_vfs* pResourceManagerVFS; /* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */ @@ -11813,7 +11813,7 @@ static MA_INLINE ma_bool32 ma_has_avx() #if defined(_AVX_) || defined(__AVX__) return MA_TRUE; /* If the compiler is allowed to freely generate AVX code we can assume support. */ #else - /* AVX requires both CPU and OS support. */ + /* AVX requirements both CPU and OS support. */ #if defined(MA_NO_CPUID) || defined(MA_NO_XGETBV) return MA_FALSE; #else @@ -11847,7 +11847,7 @@ static MA_INLINE ma_bool32 ma_has_avx2(void) #if defined(_AVX2_) || defined(__AVX2__) return MA_TRUE; /* If the compiler is allowed to freely generate AVX2 code we can assume support. */ #else - /* AVX2 requires both CPU and OS support. */ + /* AVX2 requirements both CPU and OS support. */ #if defined(MA_NO_CPUID) || defined(MA_NO_XGETBV) return MA_FALSE; #else @@ -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) | @@ -30346,13 +30346,13 @@ PulseAudio. In PulseAudio, the data callback will *only* be called if you wrote writing data, and if you don't have anything to write, just write silence. That's fine until you want to drain the stream. You see, if you're continuously writing data to the stream, the stream will never get drained! That means in order to drain the stream, you need to *not* write data to it! But remember, when you don't write data to the stream, the callback won't get fired again! Why is draining -important? Because that's how we've defined stopping to work in miniaudio. In miniaudio, stopping the device requires it to be drained -before returning from ma_device_stop(). So we've stopped the device, which requires us to drain, but draining requires us to *not* write +important? Because that's how we've defined stopping to work in miniaudio. In miniaudio, stopping the device requirements it to be drained +before returning from ma_device_stop(). So we've stopped the device, which requirements us to drain, but draining requirements us to *not* write data to the stream (or else it won't ever complete draining), but not writing to the stream means the callback won't get fired again! -This becomes a problem when stopping and then restarting the device. When the device is stopped, it's drained, which requires us to *not* +This becomes a problem when stopping and then restarting the device. When the device is stopped, it's drained, which requirements us to *not* write anything to the stream. But then, since we didn't write anything to it, the write callback will *never* get called again if we just -resume the stream naively. This means that starting the stream requires us to write data to the stream from outside the callback. This +resume the stream naively. This means that starting the stream requirements us to write data to the stream from outside the callback. This disconnect is something PulseAudio has got seriously wrong - there should only ever be a single source of data delivery, that being the callback. (I have tried using `pa_stream_flush()` to trigger the write callback to fire, but this just doesn't work for some reason.) @@ -42076,7 +42076,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co } #else { - /* ScriptProcessorNode. This path requires us to do almost everything in JS, but we'll do as much as we can in C. */ + /* ScriptProcessorNode. This path requirements us to do almost everything in JS, but we'll do as much as we can in C. */ ma_uint32 deviceIndex; ma_uint32 channels; ma_uint32 sampleRate; @@ -56784,7 +56784,7 @@ static ma_result ma_data_converter_process_pcm_frames__channels_first(ma_data_co /* Before doing any processing we need to determine how many frames we should try processing - this iteration, for both input and output. The resampler requires us to perform format and + this iteration, for both input and output. The resampler requirements us to perform format and channel conversion before passing any data into it. If we get our input count wrong, we'll end up performing redundant pre-processing. This isn't the end of the world, but it does result in some inefficiencies proportionate to how far our estimates are off. @@ -63155,7 +63155,7 @@ static ma_result ma_decoder_init_custom__internal(const ma_decoder_config* pConf if (result == MA_SUCCESS) { return MA_SUCCESS; } else { - /* Initialization failed. Move on to the next one, but seek back to the start first so the next vtable starts from the first byte of the file. */ + /* Initialization failed. Move on to the next one, but seek back to the start first so the next vtable starts from the first uint8_t of the file. */ result = ma_decoder_seek_bytes(pDecoder, 0, ma_seek_origin_start); if (result != MA_SUCCESS) { return result; /* Failed to seek back to the start. */ @@ -75444,7 +75444,7 @@ static void ma_data_source_node_process_pcm_frames(ma_node* pNode, const float** MA_ASSERT(frameCount > 0); if (ma_data_source_get_data_format(pDataSourceNode->pDataSource, &format, &channels, NULL, NULL, 0) == MA_SUCCESS) { /* <-- Don't care about sample rate here. */ - /* The node graph system requires samples be in floating point format. This is checked in ma_data_source_node_init(). */ + /* The node graph system requirements samples be in floating point format. This is checked in ma_data_source_node_init(). */ MA_ASSERT(format == ma_format_f32); (void)format; /* Just to silence some static analysis tools. */ @@ -76413,7 +76413,7 @@ static ma_node_vtable g_ma_delay_node_vtable = NULL, 1, /* 1 input channels. */ 1, /* 1 output channel. */ - MA_NODE_FLAG_CONTINUOUS_PROCESSING /* Delay requires continuous processing to ensure the tail get's processed. */ + MA_NODE_FLAG_CONTINUOUS_PROCESSING /* Delay requirements continuous processing to ensure the tail get's processed. */ }; MA_API ma_result ma_delay_node_init(ma_node_graph* pNodeGraph, const ma_delay_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_delay_node* pDelayNode) @@ -78471,7 +78471,7 @@ MA_API ma_result ma_sound_init_from_file_internal(ma_engine* pEngine, const ma_s ma_resource_manager_pipeline_notifications notifications; /* - The engine requires knowledge of the channel count of the underlying data source before it can + The engine requirements knowledge of the channel count of the underlying data source before it can initialize the sound. Therefore, we need to make the resource manager wait until initialization of the underlying data source to be initialized so we can get access to the channel count. To do this, the MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT is forced. @@ -78766,7 +78766,7 @@ MA_API ma_result ma_sound_stop_with_fade_in_pcm_frames(ma_sound* pSound, ma_uint return MA_INVALID_ARGS; } - /* Stopping with a fade out requires us to schedule the stop into the future by the fade length. */ + /* Stopping with a fade out requirements us to schedule the stop into the future by the fade length. */ ma_sound_set_stop_time_with_fade_in_pcm_frames(pSound, ma_engine_get_time_in_pcm_frames(ma_sound_get_engine(pSound)) + fadeLengthInFrames, fadeLengthInFrames); return MA_SUCCESS; @@ -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) | @@ -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) | @@ -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) | @@ -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) { @@ -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) { @@ -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) | @@ -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) | @@ -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) | diff --git a/Minecraft.Client/Common/Audio/stb_vorbis.h b/Minecraft.Client/Common/Audio/stb_vorbis.h index 9192b162a..55616a803 100644 --- a/Minecraft.Client/Common/Audio/stb_vorbis.h +++ b/Minecraft.Client/Common/Audio/stb_vorbis.h @@ -353,7 +353,7 @@ extern int stb_vorbis_get_frame_short (stb_vorbis *f, int num_c, shor extern int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats); extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples); -// gets num_samples samples, not necessarily on a frame boundary--this requires +// gets num_samples samples, not necessarily on a frame boundary--this requirements // buffering so you have to supply the buffers. DOES NOT APPLY THE COERCION RULES. // Returns the number of samples stored per channel; it may be less than requested // at the end of the file. If there are no more samples in the file, returns 0. @@ -362,7 +362,7 @@ extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buf extern int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts); extern int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int num_samples); #endif -// gets num_samples samples, not necessarily on a frame boundary--this requires +// gets num_samples samples, not necessarily on a frame boundary--this requirements // buffering so you have to supply the buffers. Applies the coercion rules above // to produce 'channels' channels. Returns the number of samples stored per channel; // it may be less than requested at the end of the file. If there are no more @@ -446,14 +446,14 @@ enum STBVorbisError // STB_VORBIS_NO_FAST_SCALED_FLOAT // does not use a fast float-to-int trick to accelerate float-to-int on -// most platforms which requires endianness be defined correctly. +// most platforms which requirements endianness be defined correctly. //#define STB_VORBIS_NO_FAST_SCALED_FLOAT // 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), @@ -503,7 +503,7 @@ enum STBVorbisError // STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH // If the 'fast huffman' search doesn't succeed, then stb_vorbis falls -// back on binary searching for the correct one. This requires storing +// back on binary searching for the correct one. This requirements storing // extra tables with the huffman codes in sorted order. Defining this // symbol trades off space for speed by forcing a linear search in the // non-fast case, except for "sparse" codebooks. @@ -541,7 +541,7 @@ enum STBVorbisError // STB_VORBIS_NO_DEFER_FLOOR // Normally we only decode the floor without synthesizing the actual // full curve. We can instead synthesize the curve immediately. This -// requires more memory and is very likely slower, so I don't think +// requirements more memory and is very likely slower, so I don't think // you'd ever want to do it except for debugging. // #define STB_VORBIS_NO_DEFER_FLOOR @@ -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)]; } @@ -1066,7 +1066,7 @@ static float float32_unpack(uint32 x) // increasing frequencies--they rely on the lengths being sorted; // this makes for a very simple generation algorithm. // vorbis allows a huffman table with non-sorted lengths. This -// requires a more sophisticated construction, since symbols in +// requirements a more sophisticated construction, since symbols in // order do not map to huffman codes "in order". static void add_entry(Codebook *c, uint32 huff_code, int symbol, int count, int len, uint32 *values) { @@ -1198,7 +1198,7 @@ static void compute_sorted_huffman(Codebook *c, uint8 *lengths, uint32 *values) // #1: sort a different data structure that says who they correspond to // #2: for each sorted entry, search the original list to find who corresponds // #3: for each original entry, find the sorted entry - // #1 requires extra storage, #2 is slow, #3 can use binary search! + // #1 requirements extra storage, #2 is slow, #3 can use binary search! for (i=0; i < len; ++i) { int huff_len = c->sparse ? lengths[values[i]] : lengths[i]; if (include_in_sort(c,huff_len)) { @@ -2325,7 +2325,7 @@ void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) } #elif 0 // transform to use a slow dct-iv; this is STILL basically trivial, -// but only requires half as many ops +// but only requirements half as many ops void dct_iv_slow(float *buffer, int n) { float mcos[16384]; @@ -3491,7 +3491,7 @@ static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right) if (!prev) // there was no previous packet, so this data isn't valid... // this isn't entirely true, only the would-have-overlapped data - // isn't valid, but this seems to be what the spec requires + // isn't valid, but this seems to be what the spec requirements return 0; // truncate a short frame @@ -3515,7 +3515,7 @@ static int vorbis_pump_first_frame(stb_vorbis *f) static int is_whole_packet_present(stb_vorbis *f) { // make sure that we have the packet available before continuing... - // this requires a full ogg parse, but we know we can fetch from f->stream + // this requirements a full ogg parse, but we know we can fetch from f->stream // instead of coding this out explicitly, we could save the current read state, // read the next packet with get8() until end-of-packet, check f->eof, then @@ -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) { @@ -5518,7 +5518,7 @@ int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, in 0.996 - bugfix: fast-huffman decode initialized incorrectly for sparse codebooks; fixing gives 10% speedup - found by Terje Mathisen 0.995 - bugfix: fix to 'effective' overrun detection - found by Terje Mathisen 0.994 - bugfix: garbage decode on final VQ symbol of a non-multiple - found by Terje Mathisen - 0.993 - bugfix: pushdata API required 1 extra byte for empty page (failed to consume final page if empty) - found by Terje Mathisen + 0.993 - bugfix: pushdata API required 1 extra uint8_t for empty page (failed to consume final page if empty) - found by Terje Mathisen 0.992 - fixes for MinGW warning 0.991 - turn fast-float-conversion on by default 0.990 - fix push-mode seek recovery if you seek into the headers diff --git a/Minecraft.Client/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Colours/ColourTable.cpp index e4bfe7327..d973fd258 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Colours/ColourTable.cpp @@ -4,8 +4,8 @@ unordered_map ColourTable::s_colourNamesMap; -wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = -{ +const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = + { L"NOTSET", L"Foliage_Evergreen", diff --git a/Minecraft.Client/Common/Colours/ColourTable.h b/Minecraft.Client/Common/Colours/ColourTable.h index 8e0a348c0..af99a8ed5 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.h +++ b/Minecraft.Client/Common/Colours/ColourTable.h @@ -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 s_colourNamesMap; public: diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 3aae68d2c..a2dd73b02 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -3310,7 +3310,7 @@ void CMinecraftApp::HandleXuiActions(void) // In split screen mode, we don't want to do any async loading or flushing of the cache, just a simple respawn pMinecraft->localplayers[i]->respawn(); - // If the respawn requires a dimension change then the action will have changed + // If the respawn requirements a dimension change then the action will have changed //if(app.GetXuiAction(i) == eAppAction_Respawn) //{ // SetAction(i,eAppAction_Idle); diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp index 6faf0c3b3..0b7edb6a8 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp @@ -26,8 +26,8 @@ PBYTE DLCAudioFile::getData(DWORD &dwBytes) return m_pbData; } -WCHAR *DLCAudioFile::wchTypeNamesA[]= -{ +const WCHAR *DLCAudioFile::wchTypeNamesA[] = + { L"CUENAME", L"CREDIT", }; diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.h b/Minecraft.Client/Common/DLC/DLCAudioFile.h index 728512d76..392b847b2 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.h +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.h @@ -28,7 +28,7 @@ public: e_AudioParamType_Max, }; - static WCHAR *wchTypeNamesA[e_AudioParamType_Max]; + static const WCHAR *wchTypeNamesA[e_AudioParamType_Max]; DLCAudioFile(const wstring &path); diff --git a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp index 39b852190..44b78549e 100644 --- a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp +++ b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp @@ -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. diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index 36f4d7f7e..cdb195aab 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -7,8 +7,8 @@ #include "..\..\Minecraft.h" #include "..\..\TexturePackRepository.h" -WCHAR *DLCManager::wchTypeNamesA[]= -{ +const WCHAR *DLCManager::wchTypeNamesA[] = + { L"DISPLAYNAME", L"THEMENAME", L"FREE", diff --git a/Minecraft.Client/Common/DLC/DLCManager.h b/Minecraft.Client/Common/DLC/DLCManager.h index 277652329..df83f435d 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.h +++ b/Minecraft.Client/Common/DLC/DLCManager.h @@ -48,7 +48,7 @@ public: e_DLCParamType_Max, }; - static WCHAR *wchTypeNamesA[e_DLCParamType_Max]; + static const WCHAR *wchTypeNamesA[e_DLCParamType_Max]; private: vector m_packs; diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp index f18aa7ae2..25f30b682 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp @@ -12,8 +12,8 @@ #include "ConsoleGameRules.h" #include "GameRuleManager.h" -WCHAR *GameRuleManager::wchTagNameA[] = -{ +const WCHAR *GameRuleManager::wchTagNameA[] = + { L"", // eGameRuleType_Root L"MapOptions", // eGameRuleType_LevelGenerationOptions L"ApplySchematic", // eGameRuleType_ApplySchematic @@ -34,8 +34,8 @@ WCHAR *GameRuleManager::wchTagNameA[] = L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule }; -WCHAR *GameRuleManager::wchAttrNameA[] = -{ +const WCHAR *GameRuleManager::wchAttrNameA[] = + { L"descriptionName", // eGameRuleAttr_descriptionName L"promptName", // eGameRuleAttr_promptName L"dataTag", // eGameRuleAttr_dataTag @@ -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); @@ -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); @@ -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() ); @@ -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"); @@ -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) @@ -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; diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Common/GameRules/GameRuleManager.h index e9e983b85..129490bb2 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.h @@ -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; @@ -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 *tagsAndAtts, GameRuleDefinition *rule); diff --git a/Minecraft.Client/Common/Network/SessionInfo.h b/Minecraft.Client/Common/Network/SessionInfo.h index ce6365bc4..4be0af14a 100644 --- a/Minecraft.Client/Common/Network/SessionInfo.h +++ b/Minecraft.Client/Common/Network/SessionInfo.h @@ -16,9 +16,9 @@ typedef struct _GameSessionData char szPlayers[MINECRAFT_NET_MAX_PLAYERS][XUSER_NAME_SIZE]; // 128 bytes ( 8*16) unsigned int m_uiGameHostSettings; // 4 bytes unsigned int texturePackParentId; // 4 bytes - unsigned char subTexturePackId; // 1 byte + unsigned char subTexturePackId; // 1 uint8_t - bool isJoinable; // 1 byte + bool isJoinable; // 1 uint8_t _GameSessionData() { @@ -40,12 +40,12 @@ typedef struct _GameSessionData GameSessionUID players[MINECRAFT_NET_MAX_PLAYERS]; // 64 bytes ( 8*8 ) on xbox, 192 ( 24*8) on PS3 unsigned int m_uiGameHostSettings; // 4 bytes unsigned int texturePackParentId; // 4 bytes - unsigned char subTexturePackId; // 1 byte + unsigned char subTexturePackId; // 1 uint8_t - bool isJoinable; // 1 byte + bool isJoinable; // 1 uint8_t - unsigned char playerCount; // 1 byte - bool isReadyToJoin; // 1 byte + unsigned char playerCount; // 1 uint8_t + bool isReadyToJoin; // 1 uint8_t _GameSessionData() { diff --git a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp index a040b28bd..9bbdb73c8 100644 --- a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp +++ b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp @@ -207,7 +207,7 @@ bool SQRNetworkPlayer::HasSmallIdConfirmed() return ( m_flags & SNP_FLAG_SMALLID_CONFIRMED ); } -// To confirm to the host that we are ready, send a single byte with our small id. +// To confirm to the host that we are ready, send a single uint8_t with our small id. void SQRNetworkPlayer::ConfirmReady() { SendInternal(&m_ISD, sizeof(InitSendData), e_flag_AckNotRequested); diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h index 36b327984..c5b0e09c3 100644 --- a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h +++ b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h @@ -2,7 +2,7 @@ #include "TutorialTask.h" -// A tutorial task that requires each of the task to be completed in order until the last one is complete. +// A tutorial task that requirements each of the task to be completed in order until the last one is complete. // If an earlier task that was complete is now not complete then it's hint should be shown. class ProcedureCompoundTask : public TutorialTask { diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 0d3f7dace..0d1bbc8b0 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -1309,7 +1309,7 @@ bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, return _override; } -void IUIScene_CreativeMenu::BuildFirework(vector > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/) +void IUIScene_CreativeMenu::BuildFirework(vector > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/) { ///////////////////////////////// // Create firecharge @@ -1370,7 +1370,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector > *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); diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h index 64b78029b..7cb8a12b8 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h @@ -137,5 +137,5 @@ protected: EToolTipItem &buttonBack ); - static void BuildFirework(vector > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1); + static void BuildFirework(vector > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 95423642a..68a028bf0 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -608,7 +608,7 @@ void UIController::loadSkins() IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinName) { IggyLibrary lib = IGGY_INVALID_LIBRARY; - // 4J Stu - We need to load the platformskin before the normal skin, as the normal skin requires some elements from the platform skin + // 4J Stu - We need to load the platformskin before the normal skin, as the normal skin requirements some elements from the platform skin if(!skinPath.empty() && app.hasArchiveFile(skinPath)) { byteArray baFile = app.getArchiveFile(skinPath); @@ -967,7 +967,7 @@ void UIController::handleInput() } #ifdef __PSVITA__ - //CD - Vita requires key press 40 - select [MINECRAFT_ACTION_GAME_INFO] + //CD - Vita requirements key press 40 - select [MINECRAFT_ACTION_GAME_INFO] handleKeyPress(iPad, MINECRAFT_ACTION_GAME_INFO); #endif } @@ -1942,7 +1942,7 @@ size_t UIController::RegisterForCallbackId(UIScene *scene) { EnterCriticalSection(&m_registeredCallbackScenesCS); size_t newId = GetTickCount(); - newId &= 0xFFFFFF; // Chop off the top byte, we don't need any more accuracy than that + newId &= 0xFFFFFF; // Chop off the top uint8_t, we don't need any more accuracy than that newId |= (scene->getSceneType() << 24); // Add in the scene's type to help keep this unique m_registeredCallbackScenes[newId] = scene; LeaveCriticalSection(&m_registeredCallbackScenesCS); diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp index 66d8c41ee..eaaf73151 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp @@ -375,7 +375,7 @@ void UIScene_CraftingMenu::handleTimerComplete(int id) { if(id == GAME_CRAFTING_TOUCHUPDATE_TIMER_ID) { - // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requirements further iggy calls GetMainPanel()->UpdateControl(); ui.TouchBoxRebuild(this); killTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID); diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp index 2bd06bc63..9114b78e2 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp @@ -702,7 +702,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) void UIScene_CreateWorldMenu::handleTimerComplete(int id) { #ifdef __PSVITA__ - // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requirements further iggy calls if(m_bRebuildTouchBoxes) { GetMainPanel()->UpdateControl(); diff --git a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp index 0895cdffe..3dbb5d7be 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp @@ -123,7 +123,7 @@ void UIScene_CreativeMenu::handleTimerComplete(int id) { if(id == GAME_CREATIVE_TOUCHUPDATE_TIMER_ID) { - // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requirements further iggy calls GetMainPanel()->UpdateControl(); ui.TouchBoxRebuild(this); killTimer(GAME_CREATIVE_TOUCHUPDATE_TIMER_ID); diff --git a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h index 464c83a06..87369cee6 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h @@ -13,7 +13,7 @@ private: typedef struct _PlayerInfo { - byte m_smallId; + uint8_t m_smallId; char m_voiceStatus; short m_colorState; wstring m_name; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp index ed3c8137e..ce4fcd7f0 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp @@ -968,7 +968,7 @@ void UIScene_LoadMenu::handleTouchBoxRebuild() void UIScene_LoadMenu::handleTimerComplete(int id) { #ifdef __PSVITA__ - // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requirements further iggy calls if(m_bRebuildTouchBoxes) { GetMainPanel()->UpdateControl(); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 8664aca12..6779e3a10 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -117,7 +117,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath) if (off >= 12 && off + len <= saveSize && len > 0 && len < 4 * 1024 * 1024) { byteArray ba; - ba.data = (byte*)(saveData + off); + ba.data = (uint8_t*)(saveData + off); ba.length = len; CompoundTag *root = NbtIo::decompress(ba); if (root != NULL) @@ -1051,7 +1051,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() m_pSaveDetails=StorageManager.ReturnSavesInfo(); if(m_pSaveDetails==NULL) { - C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); + C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(m_iPad, NULL, this, const_cast("save")); // needs to be casted as we dont have the library the function derives from as part of the build } #if TO_BE_IMPLEMENTED @@ -2852,7 +2852,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter case eSaveTransfer_CreateDummyFile: { StorageManager.ResetSaveData(); - byte *compData = (byte *)StorageManager.AllocateSaveData( app.getRemoteStorage()->getSaveFilesize() ); + uint8_t *compData = (uint8_t *)StorageManager.AllocateSaveData( app.getRemoteStorage()->getSaveFilesize() ); // Make our next save default to the name of the level const char* pNameUTF8 = app.getRemoteStorage()->getSaveNameUTF8(); mbstowcs(wSaveName, pNameUTF8, strlen(pNameUTF8)+1); // plus null diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp index d4f26ae71..1b2c2429c 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp @@ -13,8 +13,8 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]= -{ +const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[] = + { L"USE LOCALISED VERSION", // Server selected L"Steve", L"Tennis Steve", diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h index e8d760967..42e5bec02 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h @@ -6,7 +6,7 @@ class UIScene_SkinSelectMenu : public UIScene { private: - static WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; + static const WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; // 4J Stu - How many to show on each side of the main control static const BYTE sidePreviewControls = 4; diff --git a/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp b/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp index b3608b068..aa912e479 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp @@ -592,7 +592,7 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa } else { - // This is called from a storage manager thread... need to set up thread storage for IntCache as CreateGame requires this to search for a suitable seed if we haven't set a seed. + // This is called from a storage manager thread... need to set up thread storage for IntCache as CreateGame requirements this to search for a suitable seed if we haven't set a seed. IntCache::CreateNewThreadStorage(); CreateGame(pScene, 0); IntCache::ReleaseThreadStorage(); @@ -791,7 +791,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora } else { - // This is called from a storage manager thread... need to set up thread storage for IntCache as CreateGame requires this to search for a suitable seed if we haven't set a seed. + // This is called from a storage manager thread... need to set up thread storage for IntCache as CreateGame requirements this to search for a suitable seed if we haven't set a seed. IntCache::CreateNewThreadStorage(); CreateGame(pClass, 0); IntCache::ReleaseThreadStorage(); diff --git a/Minecraft.Client/Common/zlib/adler32.c b/Minecraft.Client/Common/zlib/adler32.c index 33d70c606..1687d0d79 100644 --- a/Minecraft.Client/Common/zlib/adler32.c +++ b/Minecraft.Client/Common/zlib/adler32.c @@ -73,7 +73,7 @@ uLong ZEXPORT adler32(adler, buf, len) sum2 = (adler >> 16) & 0xffff; adler &= 0xffff; - /* in case user likes doing a byte at a time, keep it fast */ + /* in case user likes doing a uint8_t at a time, keep it fast */ if (len == 1) { adler += buf[0]; if (adler >= BASE) @@ -100,7 +100,7 @@ uLong ZEXPORT adler32(adler, buf, len) return adler | (sum2 << 16); } - /* do length NMAX blocks -- requires just one modulo operation */ + /* do length NMAX blocks -- requirements just one modulo operation */ while (len >= NMAX) { len -= NMAX; n = NMAX / 16; /* NMAX is divisible by 16 */ diff --git a/Minecraft.Client/Common/zlib/compress.c b/Minecraft.Client/Common/zlib/compress.c index 6f3f2593f..d7ddd3e5f 100644 --- a/Minecraft.Client/Common/zlib/compress.c +++ b/Minecraft.Client/Common/zlib/compress.c @@ -10,7 +10,7 @@ /* =========================================================================== Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte + parameter has the same meaning as in deflateInit. sourceLen is the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least 0.1% larger than sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. diff --git a/Minecraft.Client/Common/zlib/crc32.c b/Minecraft.Client/Common/zlib/crc32.c index 979a7190a..7deaa7276 100644 --- a/Minecraft.Client/Common/zlib/crc32.c +++ b/Minecraft.Client/Common/zlib/crc32.c @@ -62,15 +62,15 @@ local void make_crc_table OF((void)); local void write_table OF((FILE *, const z_crc_t FAR *)); #endif /* MAKECRCH */ /* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: + Generate tables for a uint8_t-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. Polynomials over GF(2) are represented in binary, one bit per coefficient, with the lowest powers in the most significant bit. Then adding polynomials is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the + one. If we call the above polynomial p, and represent a uint8_t as the polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + uint8_t 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and @@ -82,7 +82,7 @@ local void make_crc_table OF((void)); q and repeat for all eight bits of q. The first table is simply the CRC of all possible eight bit values. This is - all the information needed to generate CRCs on data a byte at a time for all + all the information needed to generate CRCs on data a uint8_t at a time for all combinations of CRC register values and incoming bytes. The remaining tables allow for word-at-a-time CRC calculation for both big-endian and little- endian machines, where a word is four bytes. @@ -117,7 +117,7 @@ local void make_crc_table() #ifdef BYFOUR /* generate crc for each value followed by one, two, and three zeros, - and then the byte reversal of those as well as the first table */ + and then the uint8_t reversal of those as well as the first table */ for (n = 0; n < 256; n++) { c = crc_table[0][n]; crc_table[4][n] = ZSWAP32(c); @@ -179,7 +179,7 @@ local void write_table(out, table) #else /* !DYNAMIC_CRC_TABLE */ /* ======================================================================== - * Tables of CRC-32s of all single-byte values, made by make_crc_table(). + * Tables of CRC-32s of all single-uint8_t values, made by make_crc_table(). */ #include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ @@ -381,7 +381,7 @@ local uLong crc32_combine_(crc1, crc2, len2) gf2_matrix_square(odd, even); /* apply len2 zeros to crc1 (first square will put the operator for one - zero byte, eight zero bits, in even) */ + zero uint8_t, eight zero bits, in even) */ do { /* apply zeros operator for this bit of len2 */ gf2_matrix_square(even, odd); diff --git a/Minecraft.Client/Common/zlib/deflate.c b/Minecraft.Client/Common/zlib/deflate.c index 696957705..dcb1c77c7 100644 --- a/Minecraft.Client/Common/zlib/deflate.c +++ b/Minecraft.Client/Common/zlib/deflate.c @@ -143,7 +143,7 @@ local const config configuration_table[10] = { /* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ #endif -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 +/* Note: the deflate() code requirements max_lazy >= MIN_MATCH and max_chain >= 4 * For deflate_fast() (levels <= 3) good is ignored and lazy has a different * meaning. */ @@ -159,7 +159,7 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ #define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) /* =========================================================================== - * Update a hash value with the given input byte + * Update a hash value with the given input uint8_t * IN assertion: all calls to to UPDATE_HASH are made with consecutive * input characters, so that a running hash key can be computed from the * previous key instead of complete recalculation each time. @@ -273,7 +273,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } - if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ + if (windowBits == 8) windowBits = 9; /* until 256-uint8_t window bug fixed */ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); if (s == Z_NULL) return Z_MEM_ERROR; strm->state = (struct internal_state FAR *)s; @@ -1383,7 +1383,7 @@ local void check_match(s, start, match, length) * * IN assertion: lookahead < MIN_LOOKAHEAD * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are + * At least one uint8_t has been read, or avail_in == 0; reads are * performed for at least two bytes (required for the zip translate_eol * option -- not supported here). */ @@ -1407,7 +1407,7 @@ local void fill_window(s) } else if (more == (unsigned)(-1)) { /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) + * strstart == 0 && lookahead == 1 (input done a uint8_t at time) */ more--; } @@ -1566,7 +1566,7 @@ local block_state deflate_stored(s, flush) int flush; { /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: + * to pending_buf_size, and each stored block has a 5 uint8_t header: */ ulg max_block_size = 0xffff; ulg max_start; @@ -1703,7 +1703,7 @@ local block_state deflate_fast(s, flush) */ } } else { - /* No match, output a literal byte */ + /* No match, output a literal uint8_t */ Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); s->lookahead--; @@ -1863,7 +1863,7 @@ local block_state deflate_rle(s, flush) int flush; { int bflush; /* set if current block must be flushed */ - uInt prev; /* byte at distance one to match */ + uInt prev; /* uint8_t at distance one to match */ Bytef *scan, *strend; /* scan goes up to strend for length of run */ for (;;) { @@ -1879,7 +1879,7 @@ local block_state deflate_rle(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* See how many times the previous byte repeats */ + /* See how many times the previous uint8_t repeats */ s->match_length = 0; if (s->lookahead >= MIN_MATCH && s->strstart > 0) { scan = s->window + s->strstart - 1; @@ -1909,7 +1909,7 @@ local block_state deflate_rle(s, flush) s->strstart += s->match_length; s->match_length = 0; } else { - /* No match, output a literal byte */ + /* No match, output a literal uint8_t */ Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); s->lookahead--; @@ -1948,7 +1948,7 @@ local block_state deflate_huff(s, flush) } } - /* Output a literal byte */ + /* Output a literal uint8_t */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); diff --git a/Minecraft.Client/Common/zlib/deflate.h b/Minecraft.Client/Common/zlib/deflate.h index ce0299edd..84f22e1e7 100644 --- a/Minecraft.Client/Common/zlib/deflate.h +++ b/Minecraft.Client/Common/zlib/deflate.h @@ -99,7 +99,7 @@ typedef struct internal_state { int status; /* as the name implies */ Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ + Bytef *pending_out; /* next pending uint8_t to output to the stream */ uInt pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ @@ -144,7 +144,7 @@ typedef struct internal_state { uInt hash_shift; /* Number of bits by which ins_h must be shifted at each input * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: + * uint8_t no longer takes part in the hash key, that is: * hash_shift * MIN_MATCH >= hash_bits */ @@ -272,7 +272,7 @@ typedef struct internal_state { } FAR deflate_state; -/* Output a byte on the stream. +/* Output a uint8_t on the stream. * IN assertion: there is enough room in pending_buf. */ #define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} diff --git a/Minecraft.Client/Common/zlib/gzread.c b/Minecraft.Client/Common/zlib/gzread.c index bf4538eb2..db447ff16 100644 --- a/Minecraft.Client/Common/zlib/gzread.c +++ b/Minecraft.Client/Common/zlib/gzread.c @@ -128,11 +128,11 @@ local int gz_look(state) /* look for gzip magic bytes -- if there, do gzip decoding (note: there is a logical dilemma here when considering the case of a partially written - gzip file, to wit, if a single 31 byte is written, then we cannot tell - whether this is a single-byte file, or just a partially written gzip + gzip file, to wit, if a single 31 uint8_t is written, then we cannot tell + whether this is a single-uint8_t file, or just a partially written gzip file -- for here we assume that if a gzip file is being written, then the header will be written in a single operation, so that reading a - single byte is sufficient indication that it is not a gzip file) */ + single uint8_t is sufficient indication that it is not a gzip file) */ if (strm->avail_in > 1 && strm->next_in[0] == 31 && strm->next_in[1] == 139) { inflateReset(strm); @@ -447,7 +447,7 @@ int ZEXPORT gzungetc(c, file) if (c < 0) return -1; - /* if output buffer empty, put byte at end (allows more pushing) */ + /* if output buffer empty, put uint8_t at end (allows more pushing) */ if (state->x.have == 0) { state->x.have = 1; state->x.next = state->out + (state->size << 1) - 1; @@ -463,7 +463,7 @@ int ZEXPORT gzungetc(c, file) return -1; } - /* slide output data if needed and insert byte before existing data */ + /* slide output data if needed and insert uint8_t before existing data */ if (state->x.next == state->out) { unsigned char *src = state->out + state->x.have; unsigned char *dest = state->out + (state->size << 1); diff --git a/Minecraft.Client/Common/zlib/infback.c b/Minecraft.Client/Common/zlib/infback.c index f3833c2e4..24ab6c4e4 100644 --- a/Minecraft.Client/Common/zlib/infback.c +++ b/Minecraft.Client/Common/zlib/infback.c @@ -167,7 +167,7 @@ struct inflate_state FAR *state; } \ } while (0) -/* Get a byte of input into the bit accumulator, or return from inflateBack() +/* Get a uint8_t of input into the bit accumulator, or return from inflateBack() with an error if there is no input available. */ #define PULLBYTE() \ do { \ @@ -197,7 +197,7 @@ struct inflate_state FAR *state; bits -= (unsigned)(n); \ } while (0) -/* Remove zero to seven bits as needed to go to a byte boundary */ +/* Remove zero to seven bits as needed to go to a uint8_t boundary */ #define BYTEBITS() \ do { \ hold >>= bits & 7; \ @@ -325,7 +325,7 @@ void FAR *out_desc; case STORED: /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ + BYTEBITS(); /* go to uint8_t boundary */ NEEDBITS(32); if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { strm->msg = (char *)"invalid stored block lengths"; diff --git a/Minecraft.Client/Common/zlib/inffast.c b/Minecraft.Client/Common/zlib/inffast.c index bda59ceb6..f91ba23de 100644 --- a/Minecraft.Client/Common/zlib/inffast.c +++ b/Minecraft.Client/Common/zlib/inffast.c @@ -61,7 +61,7 @@ - The maximum bytes that a single length/distance pair can output is 258 bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for + requirements strm->avail_out >= 258 for each loop to avoid checking for output space. */ void ZLIB_INTERNAL inflate_fast(strm, start) diff --git a/Minecraft.Client/Common/zlib/inflate.c b/Minecraft.Client/Common/zlib/inflate.c index 870f89bb4..9c118e531 100644 --- a/Minecraft.Client/Common/zlib/inflate.c +++ b/Minecraft.Client/Common/zlib/inflate.c @@ -16,7 +16,7 @@ * - Use pointers for available input and output checking in inffast.c * - Remove input and output counters in inffast.c * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 - * - Remove unnecessary second byte pull from length extra in inffast.c + * - Remove unnecessary second uint8_t pull from length extra in inffast.c * - Unroll direct copy to three copies per loop in inffast.c * * 1.2.beta2 4 Dec 2002 @@ -30,7 +30,7 @@ * - Add comments on state->bits assertion in inffast.c * - Add comments on op field in inftrees.h * - Fix bug in reuse of allocated window after inflateReset() - * - Remove bit fields--back to byte structure for speed + * - Remove bit fields--back to uint8_t structure for speed * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths * - Change post-increments to pre-increments in inflate_fast(), PPC biased? * - Add compile time option, POSTINC, to use post-increments instead (Intel?) @@ -484,7 +484,7 @@ unsigned copy; bits = 0; \ } while (0) -/* Get a byte of input into the bit accumulator, or return from inflate() +/* Get a uint8_t of input into the bit accumulator, or return from inflate() if there is no input available. */ #define PULLBYTE() \ do { \ @@ -513,7 +513,7 @@ unsigned copy; bits -= (unsigned)(n); \ } while (0) -/* Remove zero to seven bits as needed to go to a byte boundary */ +/* Remove zero to seven bits as needed to go to a uint8_t boundary */ #define BYTEBITS() \ do { \ hold >>= bits & 7; \ @@ -552,10 +552,10 @@ unsigned copy; gives the low n bits in the accumulator. When done, DROPBITS(n) drops the low n bits off the accumulator. INITBITS() clears the accumulator and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. + enough bits to put the accumulator on a uint8_t boundary. After BYTEBITS() + and a NEEDBITS(8), then BITS(8) would return the next uint8_t in the stream. - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return + NEEDBITS(n) uses PULLBYTE() to get an available uint8_t of input, or to return if there is no input available. The decoding of variable length codes uses PULLBYTE() directly in order to pull just enough bytes to decode the next code, and no more. @@ -580,7 +580,7 @@ unsigned copy; A state may also return if there is not enough output space available to complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. + literal uint8_t, and copying a matching string. When returning, a "goto inf_leave" is used to update the total counters, update the check value, and determine whether any progress has been made @@ -862,7 +862,7 @@ int flush; DROPBITS(2); break; case STORED: - BYTEBITS(); /* go to byte boundary */ + BYTEBITS(); /* go to uint8_t boundary */ NEEDBITS(32); if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { strm->msg = (char *)"invalid stored block lengths"; @@ -1345,7 +1345,7 @@ gz_headerp head; or when out of input. When called, *have is the number of pattern bytes found in order so far, in 0..3. On return *have is updated to the new state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the + return value is how many bytes were read including the last uint8_t of the pattern. If *have is less than four, then the pattern has not been found yet and the return value is len. In the latter case, syncsearch() can be called again with more data and the *have state. *have is initialized to @@ -1379,7 +1379,7 @@ z_streamp strm; { unsigned len; /* number of bytes to look at or looked at */ unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ + unsigned char buf[4]; /* to restore bit buffer to uint8_t string */ struct inflate_state FAR *state; /* check parameters */ diff --git a/Minecraft.Client/Common/zlib/inftrees.h b/Minecraft.Client/Common/zlib/inftrees.h index baa53a0b1..ef52c2629 100644 --- a/Minecraft.Client/Common/zlib/inftrees.h +++ b/Minecraft.Client/Common/zlib/inftrees.h @@ -18,7 +18,7 @@ that table. For a length or distance, the low four bits of op is the number of extra bits to get after the code. bits is the number of bits in this code or part of the code to drop off - of the bit buffer. val is the actual byte to output in the case + of the bit buffer. val is the actual uint8_t to output in the case of a literal, the base length or distance, or the offset from the current table to the next table. Each entry is four bytes. */ typedef struct { diff --git a/Minecraft.Client/Common/zlib/trees.c b/Minecraft.Client/Common/zlib/trees.c index 1fd7759ef..5a372e671 100644 --- a/Minecraft.Client/Common/zlib/trees.c +++ b/Minecraft.Client/Common/zlib/trees.c @@ -640,7 +640,7 @@ local void build_tree(s, desc) } } - /* The pkzip format requires that at least one distance code exists, + /* The pkzip format requirements that at least one distance code exists, * and that at least one bit should be sent even if there is only one * possible code. So to avoid special checks later on we force at least * two codes of non zero frequency. @@ -814,7 +814,7 @@ local int build_bl_tree(s) */ /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says + * requirements that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { @@ -996,7 +996,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) if (last) { bi_windup(s); #ifdef DEBUG - s->compressed_len += 7; /* align on byte boundary */ + s->compressed_len += 7; /* align on uint8_t boundary */ #endif } Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, @@ -1072,7 +1072,7 @@ local void compress_block(s, ltree, dtree) dist = s->d_buf[lx]; lc = s->l_buf[lx++]; if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ + send_code(s, lc, ltree); /* send a literal uint8_t */ Tracecv(isgraph(lc), (stderr," '%c' ", lc)); } else { /* Here, lc is the match length - MIN_MATCH */ @@ -1181,7 +1181,7 @@ local void bi_flush(s) } /* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary + * Flush the bit buffer and align the output on a uint8_t boundary */ local void bi_windup(s) deflate_state *s; @@ -1208,7 +1208,7 @@ local void copy_block(s, buf, len, header) unsigned len; /* its length */ int header; /* true if block header must be written */ { - bi_windup(s); /* align on byte boundary */ + bi_windup(s); /* align on uint8_t boundary */ if (header) { put_short(s, (ush)len); diff --git a/Minecraft.Client/Common/zlib/uncompr.c b/Minecraft.Client/Common/zlib/uncompr.c index 242e9493d..4f152d9d1 100644 --- a/Minecraft.Client/Common/zlib/uncompr.c +++ b/Minecraft.Client/Common/zlib/uncompr.c @@ -10,7 +10,7 @@ /* =========================================================================== Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor diff --git a/Minecraft.Client/Common/zlib/zlib.h b/Minecraft.Client/Common/zlib/zlib.h index 3e0c7672a..ece5c1030 100644 --- a/Minecraft.Client/Common/zlib/zlib.h +++ b/Minecraft.Client/Common/zlib/zlib.h @@ -83,11 +83,11 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ + z_const Bytef *next_in; /* next input uint8_t */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ - Bytef *next_out; /* next output byte should be put there */ + Bytef *next_out; /* next output uint8_t should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ @@ -278,17 +278,17 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so + flushed to the output buffer and the output is aligned on a uint8_t boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes + that is three bits plus filler bits to the next uint8_t, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the + output buffer, but the output is not aligned to a uint8_t boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output @@ -296,8 +296,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after + for Z_SYNC_FLUSH, but the output is not aligned on a uint8_t boundary, and up to + seven bits of the current block are held to be written as the next uint8_t after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next @@ -429,10 +429,10 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if + number of unused bits in the last uint8_t taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate + decoding the complete header up to just before the first uint8_t of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of @@ -588,7 +588,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the compression dictionary from the given byte sequence + Initializes the compression dictionary from the given uint8_t sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this @@ -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 @@ -718,7 +718,7 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending + await more bits to join them in order to fill out a full uint8_t. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -752,7 +752,7 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + a zero uint8_t, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part @@ -820,7 +820,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the decompression dictionary from the given uncompressed byte + Initializes the decompression dictionary from the given uncompressed uint8_t sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. @@ -917,7 +917,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used + middle of a uint8_t. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the @@ -1011,7 +1011,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general + and a 32K uint8_t window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. @@ -1161,7 +1161,7 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. @@ -1176,7 +1176,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, int level)); /* Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte + parameter has the same meaning as in deflateInit. sourceLen is the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the @@ -1198,7 +1198,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some @@ -1252,7 +1252,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- - byte gzip header. + uint8_t gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was @@ -1390,7 +1390,7 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* - Reads one byte from the compressed file. gzgetc returns this byte or -1 + Reads one uint8_t from the compressed file. gzgetc returns this uint8_t or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file diff --git a/Minecraft.Client/DirtyChunkSorter.h b/Minecraft.Client/DirtyChunkSorter.h index 1bf8b61f7..2c34d4bff 100644 --- a/Minecraft.Client/DirtyChunkSorter.h +++ b/Minecraft.Client/DirtyChunkSorter.h @@ -2,7 +2,7 @@ class Chunk; class Mob; -class DirtyChunkSorter : public std::binary_function +class DirtyChunkSorter { private: shared_ptr cameraEntity; diff --git a/Minecraft.Client/DistanceChunkSorter.h b/Minecraft.Client/DistanceChunkSorter.h index 4789070d0..224737ab6 100644 --- a/Minecraft.Client/DistanceChunkSorter.h +++ b/Minecraft.Client/DistanceChunkSorter.h @@ -2,7 +2,7 @@ class Entity; class Chunk; -class DistanceChunkSorter : public std::binary_function +class DistanceChunkSorter { private: double ix, iy, iz; diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h index 737caa98b..5e6087eb0 100644 --- a/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h @@ -74,7 +74,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp index 0c106b3fd..51f854eb2 100644 --- a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp @@ -56,7 +56,7 @@ typedef ID3D11DeviceContext ID3D1XContext; typedef F32 ViewCoord; typedef gdraw_d3d11_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(HRESULT hr, const char *call, const char *context); static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) { diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl index 1ab1f13f7..450746554 100644 --- a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -200,7 +200,7 @@ static void safe_release(T *&p) } } -static void report_d3d_error(HRESULT hr, char *call, char *context) +static void report_d3d_error(HRESULT hr, const char *call, const char *context) { if (hr == E_OUTOFMEMORY) IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); @@ -478,7 +478,7 @@ static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingI D3D1X_(SUBRESOURCE_DATA) mipdata[24]; S32 i, w, h, nmips, bpp; HRESULT hr = S_OK; - char *failed_call; + const char *failed_call; U8 *ptr; // generate mip maps and set up descriptors for them @@ -700,7 +700,7 @@ static void RADLINK gdraw_DescribeVertexBuffer(GDrawVertexBuffer *vbuf, GDraw_Ve static GDrawHandle *get_color_rendertarget(GDrawStats *stats) { - char *failed_call; + const char *failed_call; // try to recycle LRU rendertarget GDrawHandle *t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); @@ -762,7 +762,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static ID3D1X(DepthStencilView) *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->depth_buffer[1]) { - char *failed_call; + const char *failed_call; assert(!gdraw->rt_depth_buffer); D3D1X_(TEXTURE2D_DESC) desc = { gdraw->frametex_width, gdraw->frametex_height, 1, 1, DXGI_FORMAT_D24_UNORM_S8_UINT, { 1, 0 }, @@ -2114,13 +2114,13 @@ 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 + // 2. strokes and edge antialiasing. they use a 16-uint8_t vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every // 3 vertices, which means 24 bytes of index data for every 48 bytes // of vertex data. - // 3. textured quads. they use a 16-byte vertex format, have exactly 2 + // 3. textured quads. they use a 16-uint8_t vertex format, have exactly 2 // triangles for every 4 vertices, and use either a static index buffer // (quad_ib) or a single triangle strip, so for our purposes they need no // space to store indices at all. @@ -2379,9 +2379,8 @@ static S32 num_pixels(S32 w, S32 h, S32 mipmaps) return pixels; } -GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture) -{ - char *failed_call=""; +GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture){ + const char *failed_call = ""; U8 *free_data = 0; GDrawTexture *t=0; S32 width, height, mipmaps, size, blk; @@ -2399,8 +2398,8 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, mipmaps = texture->mipmaps; blk = 1; - D3D1X_(TEXTURE2D_DESC) desc = { width, height, mipmaps, 1, DXGI_FORMAT_UNKNOWN, { 1, 0 }, - D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_SHADER_RESOURCE), 0, 0 }; + D3D1X_(TEXTURE2D_DESC) desc = { static_cast(width), static_cast(height), static_cast(mipmaps), 1U, DXGI_FORMAT_UNKNOWN, { 1, 0 }, + D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_SHADER_RESOURCE), 0U, 0U }; switch (texture->format) { case IFT_FORMAT_rgba_8888 : size= 4; d3dfmt = DXGI_FORMAT_R8G8B8A8_UNORM; break; @@ -2409,7 +2408,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, case IFT_FORMAT_DXT5 : size=16; d3dfmt = DXGI_FORMAT_BC3_UNORM; blk = 4; break; default: { IggyGDrawSendWarning(NULL, "GDraw .iggytex raw texture format %d not supported by hardware", texture->format); - goto done; + return 0; } } @@ -2425,7 +2424,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, free_data = (U8 *) IggyGDrawMalloc(total_size); if (!free_data) { IggyGDrawSendWarning(NULL, "GDraw out of memory to store texture data to pass to D3D for %d x %d texture", width, height); - goto done; + return 0; } U8 *cur = free_data; @@ -2454,21 +2453,23 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, failed_call = "CreateTexture2D"; hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &tex); - if (FAILED(hr)) goto done; + + if (SUCCEEDED(hr)) { + failed_call = "CreateShaderResourceView for texture creation"; + hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); + + if (SUCCEEDED(hr)) { + t = gdraw_D3D1X_(WrappedTextureCreate)(view); + } + } - failed_call = "CreateShaderResourceView for texture creation"; - hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); - if (FAILED(hr)) goto done; - - t = gdraw_D3D1X_(WrappedTextureCreate)(view); - -done: if (FAILED(hr)) { report_d3d_error(hr, failed_call, ""); } - if (free_data) + if (free_data) { IggyGDrawFree(free_data); + } if (!t) { if (view) @@ -2478,6 +2479,7 @@ done: } else { ((GDrawHandle *) t)->handle.tex.d3d = tex; } + return t; } diff --git a/Minecraft.Client/Durango/Iggy/include/gdraw.h b/Minecraft.Client/Durango/Iggy/include/gdraw.h index 404a2642b..e959d788e 100644 --- a/Minecraft.Client/Durango/Iggy/include/gdraw.h +++ b/Minecraft.Client/Durango/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) @@ -718,7 +718,7 @@ IDOC struct GDrawFunctions to dynamically configure which of RAD's supplied drawing layers you wish to use, or to integrate it directly into your own renderer by implementing your own versions of the drawing - functions Iggy requires. + functions Iggy requirements. */ RADDEFEND diff --git a/Minecraft.Client/Durango/Iggy/include/iggy.h b/Minecraft.Client/Durango/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Durango/Iggy/include/iggy.h +++ b/Minecraft.Client/Durango/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp index caa5857e9..7dfe8f679 100644 --- a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp +++ b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp @@ -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) { diff --git a/Minecraft.Client/Durango/Miles/include/mss.h b/Minecraft.Client/Durango/Miles/include/mss.h index 531dcbc92..162451b2d 100644 --- a/Minecraft.Client/Durango/Miles/include/mss.h +++ b/Minecraft.Client/Durango/Miles/include/mss.h @@ -512,7 +512,7 @@ RADDEFSTART #define MAX_LOCK_CHAN (16-1) // Max channel available for locking #define PERCUSS_CHAN (10-1) // Percussion channel (no locking) -#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requirements at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -1900,7 +1900,7 @@ typedef struct _SMPBUF { void const *start; // Sample buffer address (W) U32 len; // Sample buffer size in bytes (W) - U32 pos; // Index to next byte (R/W) + U32 pos; // Index to next uint8_t (R/W) U32 done; // Nonzero if buffer with len=0 sent by app S32 reset_ASI; // Reset the ASI decoder at the end of the buffer S32 reset_seek_pos; // New destination offset in stream source data, for ASI codecs that care @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requirements if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the uint8_t size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp index 232b4dd3e..669065b99 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp @@ -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^ message + Platform::Array^ message ) { // To integrate the Chat DLL in your game, change the following code to use your game's network layer. @@ -312,10 +312,10 @@ void ChatIntegrationLayer::OnIncomingChatMessage( // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. - // This is how you would convert from byte array to a IBuffer^ + // This is how you would convert from uint8_t array to a IBuffer^ // // Windows::Storage::Streams::IBuffer^ destBuffer = ref new Windows::Storage::Streams::Buffer( sourceByteBufferSize ); - // byte* destBufferBytes = nullptr; + // uint8_t* destBufferBytes = nullptr; // GetBufferBytes( destBuffer, &destBufferBytes ); // errno_t err = memcpy_s( destBufferBytes, destBuffer->Capacity, sourceByteBuffer, sourceByteBufferSize ); // THROW_HR_IF(err != 0, E_FAIL); @@ -782,7 +782,7 @@ void ChatIntegrationLayer::ToggleRenderTargetVolume() } -void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ) +void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out uint8_t** ppOut ) { if ( ppOut == nullptr || buffer == nullptr ) { @@ -797,7 +797,7 @@ void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuff srcBufferByteAccess->Buffer(ppOut); } -Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array^ array ) +Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array^ array ) { Windows::Storage::Streams::DataWriter^ writer = ref new Windows::Storage::Streams::DataWriter(); writer->WriteBytes(array); diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h index 80b4e10a3..84b6f4961 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h @@ -94,7 +94,7 @@ public: /// A unique ID for the remote console void OnIncomingChatMessage( unsigned int sessionAddress, - Platform::Array^ message + Platform::Array^ message ); /// @@ -216,8 +216,8 @@ public: void ToggleRenderTargetVolume(); private: - void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ); - Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); + void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out uint8_t** ppOut ); + Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); Concurrency::critical_section m_lock; Microsoft::Xbox::GameChat::ChatManager^ m_chatManager; diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp index 8d502d232..7cfa030de 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp @@ -714,8 +714,8 @@ bool DQRNetworkManager::IsHost() } // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and -// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +// game code requirements IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// it also requirements that it is informed of the state changes leading up to not being in the session, before this should report false. bool DQRNetworkManager::IsInSession() { return m_isInSession; @@ -1639,8 +1639,8 @@ void DQRNetworkManager::SendRoomSyncInfo() EnterCriticalSection(&m_csRoomSyncData); // Calculate the size of data we are going to be sending. This is composed of: - // (1) 2 byte general header - // (2) A single byte internal data tag + // (1) 2 uint8_t general header + // (2) A single uint8_t internal data tag // (3) An unsigned int encoding the size of the combined size of all the strings in stage (5) // (4) The RoomSyncData structure itself // (5) A wchar NULL terminated string for every active player to encode the XUID @@ -1660,7 +1660,7 @@ void DQRNetworkManager::SendRoomSyncInfo() uint32_t sizeLow = internalBytes & 0xff; data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending - data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself + data[1] = sizeLow; // Data following has the a single uint8_t to say what it is, followed by the room sync data itself data[2] = DQR_INTERNAL_PLAYER_TABLE; memcpy(data + 3, &xuidBytes, 4); @@ -1686,8 +1686,8 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) if( m_isOfflineGame ) return; // Calculate the size of data we are going to be sending. This is composed of: - // (1) 2 byte general header - // (2) A single byte internal data tag + // (1) 2 uint8_t general header + // (2) A single uint8_t internal data tag // (3) An unsigned int encoding the size size of the string // (5) A wchar NULL terminated string storing the xuid of the player which has failed to join @@ -1702,7 +1702,7 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) uint32_t sizeLow = internalBytes & 0xff; data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending - data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself + data[1] = sizeLow; // Data following has the a single uint8_t to say what it is, followed by the room sync data itself data[2] = DQR_INTERNAL_ADD_PLAYER_FAILED; memcpy(data + 3, &xuidBytes, 4); @@ -1779,7 +1779,7 @@ void DQRNetworkManager::SendUnassignSmallId(int playerIndex) LogCommentFormat( L"SendUnassignSmallId, channel %d\n", playerIndex); // Send data with small Id setting mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler BYTE data[4]; - data[0] = 0x80 | ( playerIndex << 5 ); // Send 1 byte, internal mode + data[0] = 0x80 | ( playerIndex << 5 ); // Send 1 uint8_t, internal mode data[1] = 1; data[2] = DQR_INTERNAL_UNASSIGN_SMALL_ID; // Internal data type diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp index 9232d0959..71ea91361 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp @@ -51,11 +51,11 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, do { - BYTE byte = *pNextByte; + BYTE uint8_t = *pNextByte; switch( connectionInfo->m_internalDataState ) { case DQRConnectionInfo::ConnectionState_InternalHeaderByte: - switch( byte ) + switch( uint8_t ) { case DQR_INTERNAL_ASSIGN_SMALL_IDS: connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask; @@ -93,14 +93,14 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask: - // Up to 4 smallIds are assigned at once, with the ones that are being assigned dictated by a mask byte which is passed in first. + // Up to 4 smallIds are assigned at once, with the ones that are being assigned dictated by a mask uint8_t which is passed in first. // The small Ids themselves follow, always 4 bytes, and any that are masked as being assigned are processed, the other bytes ignored. // In order work around a bug with the networking library, this particular packet (being the first this that is sent from a client) // is at first sent unreliably, with retries, until a message is received back to the client, or it times out. We therefore have to be able // to handle (and ignore) this being received more than once DQRNetworkManager::LogCommentFormat(L"Small Ids being received"); - connectionInfo->m_smallIdReadMask = byte; - // Create a uniquely allocated byte to which names have been resolved, as another one of these packets could be received whilst that asyncronous process is going o n + connectionInfo->m_smallIdReadMask = uint8_t; + // Create a uniquely allocated uint8_t to which names have been resolved, as another one of these packets could be received whilst that asyncronous process is going o n connectionInfo->m_pucsmallIdReadMaskResolved = new unsigned char; *connectionInfo->m_pucsmallIdReadMaskResolved = 0; connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId0; @@ -123,20 +123,20 @@ 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; - connectionInfo->m_smallId[channel] = byte; + connectionInfo->m_smallId[channel] = uint8_t; - m_sessionAddressFromSmallId[byte] = sessionAddress; - m_channelFromSmallId[byte] = channel; + m_sessionAddressFromSmallId[uint8_t] = sessionAddress; + m_channelFromSmallId[uint8_t] = channel; auto pAsyncOp = m_primaryUserXboxLiveContext->ProfileService->GetUserProfileAsync(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId); - DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,byte); + DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,uint8_t); 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(); @@ -208,11 +208,11 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalRoomSyncData: - connectionInfo->m_pucRoomSyncData[connectionInfo->m_roomSyncDataBytesRead++] = byte; - // The room sync info is sent as a 4 byte count of the length of XUID strings, then the RoomSyncData, then the XUID strings + connectionInfo->m_pucRoomSyncData[connectionInfo->m_roomSyncDataBytesRead++] = uint8_t; + // The room sync info is sent as a 4 uint8_t count of the length of XUID strings, then the RoomSyncData, then the XUID strings if( connectionInfo->m_roomSyncDataBytesToRead == 0 ) { - // At first stage of reading the 4 byte count + // At first stage of reading the 4 uint8_t count if( connectionInfo->m_roomSyncDataBytesRead == 4 ) { memcpy( &connectionInfo->m_roomSyncDataBytesToRead, connectionInfo->m_pucRoomSyncData, 4); @@ -289,11 +289,11 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalAddPlayerFailedData: - connectionInfo->m_pucAddFailedPlayerData[connectionInfo->m_addFailedPlayerDataBytesRead++] = byte; - // The failed player info is sent as a 4 byte count of the length of XUID string, then the string itself + connectionInfo->m_pucAddFailedPlayerData[connectionInfo->m_addFailedPlayerDataBytesRead++] = uint8_t; + // The failed player info is sent as a 4 uint8_t count of the length of XUID string, then the string itself if( connectionInfo->m_addFailedPlayerDataBytesToRead == 0 ) { - // At first stage of reading the 4 byte count + // At first stage of reading the 4 uint8_t count if( connectionInfo->m_addFailedPlayerDataBytesRead == 4 ) { memcpy( &connectionInfo->m_addFailedPlayerDataBytesToRead, connectionInfo->m_pucAddFailedPlayerData, 4); diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp index c985a191f..2daa902d6 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp @@ -281,24 +281,24 @@ void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED(RTS_Message &message) BYTE *pEndByte = pNextByte + message.m_dataSize; do { - BYTE byte = *pNextByte; + BYTE uint8_t = *pNextByte; switch( connectionInfo->m_state ) { case DQRConnectionInfo::ConnectionState_HeaderByte0: - connectionInfo->m_currentChannel = ( byte >> 5 ) & 3; - connectionInfo->m_internalFlag = ( ( byte & 0x80 ) == 0x80 ); + connectionInfo->m_currentChannel = ( uint8_t >> 5 ) & 3; + connectionInfo->m_internalFlag = ( ( uint8_t & 0x80 ) == 0x80 ); - // Byte transfer mode. Bits 0-4 of this byte represent the upper 5 bits of our count of bytes to transfer... lower 8-bits will follow - connectionInfo->m_bytesRemaining = ((int)( byte & 0x1f )) << 8; + // Byte transfer mode. Bits 0-4 of this uint8_t represent the upper 5 bits of our count of bytes to transfer... lower 8-bits will follow + connectionInfo->m_bytesRemaining = ((int)( uint8_t & 0x1f )) << 8; connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte1; connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; pNextByte++; break; case DQRConnectionInfo::ConnectionState_HeaderByte1: - // Add in the lower 8 bits of our byte count, the upper 5 were obtained from the first header byte. - connectionInfo->m_bytesRemaining |= byte; + // Add in the lower 8 bits of our uint8_t count, the upper 5 were obtained from the first header uint8_t. + connectionInfo->m_bytesRemaining |= uint8_t; - // If there isn't any data following, then just go back to the initial state expecting another header byte. + // If there isn't any data following, then just go back to the initial state expecting another header uint8_t. if( connectionInfo->m_bytesRemaining == 0 ) { connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte0; diff --git a/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/Durango/Sentient/TelemetryEnum.h b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h index 3148f33d7..2f226b336 100644 --- a/Minecraft.Client/Durango/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index 9e693d1a0..4af355aad 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -69,10 +69,10 @@ void XShowAchievementsUI(int i) {} DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } #ifndef _DURANGO -void PIXAddNamedCounter(int a, char* b, ...) {} +void PIXAddNamedCounter(int a, const char* b, ...) {} //#define PS3_USE_PIX_EVENTS //#define PS4_USE_PIX_EVENTS -void PIXBeginNamedEvent(int a, char* b, ...) +void PIXBeginNamedEvent(int a, const char *b, ...) { #ifdef PS4_USE_PIX_EVENTS char buf[512]; @@ -125,7 +125,7 @@ void PIXEndNamedEvent() PixDepth -= 1; #endif } -void PIXSetMarkerDeprecated(int a, char* b, ...) {} +void PIXSetMarkerDeprecated(int a, const char* b, ...) {} #else // 4J Stu - Removed this implementation in favour of a macro that will convert our string format // conversion at compile time rather than at runtime @@ -524,8 +524,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]; diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 390f114de..850744f7b 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -61,7 +61,7 @@ C4JThread* GameRenderer::m_updateThread; C4JThread::EventArray* GameRenderer::m_updateEvents; bool GameRenderer::nearThingsToDo = false; bool GameRenderer::updateRunning = false; -vector GameRenderer::m_deleteStackByte; +vector GameRenderer::m_deleteStackByte; vector GameRenderer::m_deleteStackSparseLightStorage; vector GameRenderer::m_deleteStackCompressedTileStorage; vector GameRenderer::m_deleteStackSparseDataStorage; @@ -1205,7 +1205,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); @@ -1987,9 +1987,9 @@ void GameRenderer::setupClearColor(float a) float clearness = EnchantmentHelper::getOxygenBonus(player) * 0.2f; 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 + clearness;//0.02f; fg = (float)greenComponent/256 + clearness;//0.02f; @@ -1998,9 +1998,9 @@ void GameRenderer::setupClearColor(float a) else if (t != 0 && Tile::tiles[t]->material == Material::lava) { unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour ); - byte redComponent = ((colour>>16)&0xFF); - byte greenComponent = ((colour>>8)&0xFF); - 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; diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index 70fbe8b36..4268cf829 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -178,12 +178,12 @@ public: static bool nearThingsToDo; static bool updateRunning; #endif - static vector m_deleteStackByte; + static vector m_deleteStackByte; static vector m_deleteStackSparseLightStorage; static vector m_deleteStackCompressedTileStorage; static vector 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); diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index bb2c0d13c..3279b8351 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -240,7 +240,7 @@ public: void setGlobalChunkFlag(int index, unsigned char flag, unsigned char shift = 0); void clearGlobalChunkFlag(int x, int y, int z, Level *level, unsigned char flag, unsigned char shift = 0); - // Get/set whole byte of flags + // Get/set whole uint8_t of flags unsigned char getGlobalChunkFlags(int x, int y, int z, Level *level); void setGlobalChunkFlags(int x, int y, int z, Level *level, unsigned char flags); diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 8f2547d83..38fbcf0dc 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -235,6 +235,7 @@ SAK Xbox360Proj title + 10.0 @@ -288,65 +289,65 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application Unicode - v143 + v145 false Application MultiByte - v143 + v145 true Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application Unicode - v143 + v145 true Application Unicode - v143 + v145 true @@ -422,97 +423,97 @@ Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application Unicode true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application @@ -1567,6 +1568,8 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata" Default false /FS %(AdditionalOptions) + stdcpplatest + stdclatest true diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 7ae206cf9..232d63d42 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -190,7 +190,7 @@ Minecraft::Minecraft(Component *mouseComponent, Canvas *parent, MinecraftApplet this->parent = parent; // 4J - Our actual physical frame buffer is always 1280x720 ie in a 16:9 ratio. If we want to do a 4:3 mode, we are telling the original minecraft code - // that the width is 3/4 what it actually is, to correctly present a 4:3 image. Have added width_phys and height_phys for any code we add that requires + // that the width is 3/4 what it actually is, to correctly present a 4:3 image. Have added width_phys and height_phys for any code we add that requirements // to know the real physical dimensions of the frame buffer. if( RenderManager.IsWidescreen() ) { diff --git a/Minecraft.Client/Minimap.cpp b/Minecraft.Client/Minimap.cpp index 65c6d5f2c..ec86d05ae 100644 --- a/Minecraft.Client/Minimap.cpp +++ b/Minecraft.Client/Minimap.cpp @@ -52,12 +52,12 @@ Minimap::Minimap(Font *font, Options *options, Textures *textures, bool optimise void Minimap::reloadColours() { ColourTable *colourTable = Minecraft::GetInstance()->getColourTable(); - // 4J note that this code has been extracted pretty much as it was in Minimap::render, although with some byte order changes + // 4J note that this code has been extracted pretty much as it was in Minimap::render, although with some uint8_t order changes for( int i = 0; i < (14 * 4); i++ ) // 14 material colours currently, 4 brightnesses of each { if (i / 4 == 0) { - // 4J - changed byte order to save having to reorder later + // 4J - changed uint8_t order to save having to reorder later #ifdef __ORBIS__ LUT[i] = 0; #else @@ -78,7 +78,7 @@ void Minimap::reloadColours() int g = ((color >> 8) & 0xff) * br / 255; int b = ((color) & 0xff) * br / 255; - // 4J - changed byte order to save having to reorder later + // 4J - changed uint8_t order to save having to reorder later #if ( defined _DURANGO || defined _WIN64 || __PSVITA__ ) LUT[i] = 255 << 24 | b << 16 | g << 8 | r; #elif defined _XBOX diff --git a/Minecraft.Client/MultiPlayerChunkCache.cpp b/Minecraft.Client/MultiPlayerChunkCache.cpp index a4c200bed..b43a6801b 100644 --- a/Minecraft.Client/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/MultiPlayerChunkCache.cpp @@ -196,7 +196,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; diff --git a/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h index 6083654d2..18e035282 100644 --- a/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h @@ -77,7 +77,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp index 122333607..60c861e55 100644 --- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp +++ b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp @@ -93,7 +93,7 @@ struct ShaderCode struct GDraw { - // 16-byte aligned! + // 16-uint8_t aligned! F32 projection[4]; // always 2D scale+2D translate. first two are scale, last two are translate. // scale factor converting worldspace to viewspace <0,0>.. diff --git a/Minecraft.Client/Orbis/Iggy/include/gdraw.h b/Minecraft.Client/Orbis/Iggy/include/gdraw.h index 404a2642b..e959d788e 100644 --- a/Minecraft.Client/Orbis/Iggy/include/gdraw.h +++ b/Minecraft.Client/Orbis/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) @@ -718,7 +718,7 @@ IDOC struct GDrawFunctions to dynamically configure which of RAD's supplied drawing layers you wish to use, or to integrate it directly into your own renderer by implementing your own versions of the drawing - functions Iggy requires. + functions Iggy requirements. */ RADDEFEND diff --git a/Minecraft.Client/Orbis/Iggy/include/iggy.h b/Minecraft.Client/Orbis/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Orbis/Iggy/include/iggy.h +++ b/Minecraft.Client/Orbis/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Orbis/Miles/include/mss.h b/Minecraft.Client/Orbis/Miles/include/mss.h index 531dcbc92..162451b2d 100644 --- a/Minecraft.Client/Orbis/Miles/include/mss.h +++ b/Minecraft.Client/Orbis/Miles/include/mss.h @@ -512,7 +512,7 @@ RADDEFSTART #define MAX_LOCK_CHAN (16-1) // Max channel available for locking #define PERCUSS_CHAN (10-1) // Percussion channel (no locking) -#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requirements at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -1900,7 +1900,7 @@ typedef struct _SMPBUF { void const *start; // Sample buffer address (W) U32 len; // Sample buffer size in bytes (W) - U32 pos; // Index to next byte (R/W) + U32 pos; // Index to next uint8_t (R/W) U32 done; // Nonzero if buffer with len=0 sent by app S32 reset_ASI; // Reset the ASI decoder at the end of the buffer S32 reset_seek_pos; // New destination offset in stream source data, for ASI codecs that care @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requirements if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the uint8_t size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp index 650683b0a..078b9d7c2 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp @@ -233,7 +233,7 @@ void SQRNetworkManager_Orbis::Terminate() } while( m_basicEventThread->isRunning() ); } -// Second stage of initialisation, that requires NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// Second stage of initialisation, that requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context // for Np Matching 2. Initialisation is finally complete when we get a callback to ContextCallback. The SQRNetworkManager_Orbis is then finally moved // into SNM_INT_STATE_IDLE at this stage. void SQRNetworkManager_Orbis::InitialiseAfterOnline() @@ -944,8 +944,8 @@ bool SQRNetworkManager_Orbis::IsReadyToPlayOrIdle() // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and -// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +// game code requirements IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// it also requirements that it is informed of the state changes leading up to not being in the session, before this should report false. bool SQRNetworkManager_Orbis::IsInSession() { return m_isInSession; @@ -1235,7 +1235,7 @@ bool SQRNetworkManager_Orbis::AddLocalPlayerByUserIndex(int idx) m_roomSyncData.setPlayerCount(m_roomSyncData.getPlayerCount()+1); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(); // Sync this back out to our networked clients... @@ -1324,7 +1324,7 @@ bool SQRNetworkManager_Orbis::RemoveLocalPlayerByUserIndex(int idx) memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData)); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also delete the SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(roomSlotPlayerCount); m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL; @@ -2040,7 +2040,7 @@ void SQRNetworkManager_Orbis::SyncRoomData() sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId ); } -// Check if the matching context is valid, and if not attempt to create one. If to do this requires starting an asynchronous process, then sets the internal state to the state passed in +// Check if the matching context is valid, and if not attempt to create one. If to do this requirements starting an asynchronous process, then sets the internal state to the state passed in // before doing this. // Returns true on success. bool SQRNetworkManager_Orbis::GetMatchingContext(eSQRNetworkManagerInternalState asyncState) @@ -2413,7 +2413,7 @@ void SQRNetworkManager_Orbis::DeleteServerContext() } } -// Creates a set of Rudp connections by the "active open" method. This requires that both ends of the connection call cellRudpInitiate to fully create a connection. We +// Creates a set of Rudp connections by the "active open" method. This requirements that both ends of the connection call cellRudpInitiate to fully create a connection. We // create one connection per local play on any remote machine. // // peerMemberId is the room member Id of the remote end of the connection @@ -2930,7 +2930,7 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id, break; // This is the response to sceNpMatching2GetRoomMemberDataInternal.This only happens on the host, as a response to an incoming connection being established, when we // kick off the request for room member internal data so that we can determine what local players that remote machine is intending to bring into the game. At this point we can - // activate the host end of each of the Rupd connection that this machine requires. We can also update our player slot data (which gets syncronised back out to other room members) at this point. + // activate the host end of each of the Rupd connection that this machine requirements. We can also update our player slot data (which gets syncronised back out to other room members) at this point. case SCE_NP_MATCHING2_REQUEST_EVENT_GET_ROOM_MEMBER_DATA_INTERNAL: if( errorCode == 0 ) { @@ -3525,7 +3525,7 @@ void SQRNetworkManager_Orbis::RudpContextCallback(int ctx_id, int event_id, int else { unsigned int dataSize = sceRudpGetSizeReadable(ctx_id); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h index b91f37147..a954e4a74 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h @@ -33,7 +33,7 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char byte; +typedef unsigned char uint8_t; typedef long __int64; typedef unsigned long __uint64; typedef unsigned int DWORD; @@ -61,7 +61,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/Orbis/OrbisExtras/winerror.h b/Minecraft.Client/Orbis/OrbisExtras/winerror.h index 6956d8de0..f25db115e 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/winerror.h +++ b/Minecraft.Client/Orbis/OrbisExtras/winerror.h @@ -2495,7 +2495,7 @@ // // MessageText: // -// No mapping for the Unicode character exists in the target multi-byte code page. +// No mapping for the Unicode character exists in the target multi-uint8_t code page. // #define ERROR_NO_UNICODE_TRANSLATION 1113L @@ -2704,7 +2704,7 @@ // // MessageText: // -// The specified program requires a newer version of Windows. +// The specified program requirements a newer version of Windows. // #define ERROR_OLD_WIN_VERSION 1150L @@ -2830,7 +2830,7 @@ // // MessageText: // -// The indicated device requires reinitialization due to hardware errors. +// The indicated device requirements reinitialization due to hardware errors. // #define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164L // dderror @@ -4940,7 +4940,7 @@ // // MessageText: // -// This operation requires an interactive window station. +// This operation requirements an interactive window station. // #define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 1459L @@ -6117,7 +6117,7 @@ // // MessageText: // -// The byte count is too small. +// The uint8_t count is too small. // #define RPC_X_BYTE_COUNT_TOO_SMALL 1782L @@ -9717,7 +9717,7 @@ // // MessageText: // -// This request requires a secure connection. +// This request requirements a secure connection. // #define ERROR_DS_CONFIDENTIALITY_REQUIRED 8237L @@ -11097,7 +11097,7 @@ // // MessageText: // -// A root object requires a class of 'top'. +// A root object requirements a class of 'top'. // #define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 8432L @@ -11511,7 +11511,7 @@ // // MessageText: // -// The requested operation requires a directory service, and none was available. +// The requested operation requirements a directory service, and none was available. // #define ERROR_DS_DS_REQUIRED 8478L @@ -11619,7 +11619,7 @@ // // MessageText: // -// Another operation which requires exclusive access to the PDC FSMO is already in progress. +// Another operation which requirements exclusive access to the PDC FSMO is already in progress. // #define ERROR_DS_PDC_OPERATION_IN_PROGRESS 8490L @@ -12009,7 +12009,7 @@ // // MessageText: // -// The connection between client and server requires packet privacy or better. +// The connection between client and server requirements packet privacy or better. // #define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 8533L @@ -12036,7 +12036,7 @@ // // MessageText: // -// The operation requires that destination domain auditing be enabled. +// The operation requirements that destination domain auditing be enabled. // #define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 8536L @@ -12182,7 +12182,7 @@ // // MessageText: // -// The operation requires that source domain auditing be enabled. +// The operation requirements that source domain auditing be enabled. // #define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 8552L @@ -12722,7 +12722,7 @@ // // MessageText: // -// Secondary DNS zone requires master IP address. +// Secondary DNS zone requirements master IP address. // #define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 9612L @@ -12799,7 +12799,7 @@ // // MessageText: // -// Primary DNS zone requires datafile. +// Primary DNS zone requirements datafile. // #define DNS_ERROR_PRIMARY_REQUIRES_DATAFILE 9651L @@ -15890,7 +15890,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The requested operation requires that JIT be in the current context and it is not +// The requested operation requirements that JIT be in the current context and it is not // #define CONTEXT_E_NOJIT _HRESULT_TYPEDEF_(0x8004E026L) @@ -15899,7 +15899,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The requested operation requires that the current context have a Transaction, and it does not +// The requested operation requirements that the current context have a Transaction, and it does not // #define CONTEXT_E_NOTRANSACTION _HRESULT_TYPEDEF_(0x8004E027L) @@ -18864,7 +18864,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The streamed cryptographic message requires more data to complete the decode operation. +// The streamed cryptographic message requirements more data to complete the decode operation. // #define CRYPT_E_STREAM_INSUFFICIENT_DATA _HRESULT_TYPEDEF_(0x80091011L) @@ -21062,7 +21062,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The operation requires a Smart Card, but no Smart Card is currently in the device. +// The operation requirements a Smart Card, but no Smart Card is currently in the device. // #define SCARD_E_NO_SMARTCARD _HRESULT_TYPEDEF_(0x8010000CL) diff --git a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp index 646165652..99e1c69a2 100644 --- a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp +++ b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp @@ -920,7 +920,7 @@ int main(int argc, const char *argv[] ) StorageManager.SetSaveTitleExtraFileSuffix(app.GetString(IDS_SAVE_SUBTITLE_SUFFIX)); StorageManager.SetDLCInfoMap(app.GetSonyDLCMap()); app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL - // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requirements ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); //////////////// diff --git a/Minecraft.Client/Orbis/Orbis_UIController.cpp b/Minecraft.Client/Orbis/Orbis_UIController.cpp index 38cc79e94..4e1ffe7f3 100644 --- a/Minecraft.Client/Orbis/Orbis_UIController.cpp +++ b/Minecraft.Client/Orbis/Orbis_UIController.cpp @@ -34,7 +34,7 @@ void ConsoleUIController::init(S32 w, S32 h) render targets or shadow maps. The texture and vertex buffer pools contain multiple textures and - vertex buffers. Each object requires a bit of main memory for management + vertex buffers. Each object requirements a bit of main memory for management overhead. We need to specify how many object handles can be in use at the same time in any given pool. If Iggy runs out of GDraw handles, it won't crash, but instead throw out old cache data in a LRU fashion. diff --git a/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h b/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h b/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp index f3d2729f0..58a15bbb8 100644 --- a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp +++ b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp @@ -33,7 +33,7 @@ int32_t CTSS::TssSizeCheck(size_t size) if (size == 0) { - printf("Tss File size is 0 byte. Maybe, data isn't set on the server.\n\n"); + printf("Tss File size is 0 uint8_t. Maybe, data isn't set on the server.\n\n"); printf("\tThe data is set with scp. The account is generable in PS3 Developer Network.\n"); printf("\tThere are three server environments. for development, environment for test, and product.\n"); } diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h index d55f440bf..ceb20304b 100644 --- a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h @@ -75,7 +75,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp index 997e8d837..c75e34781 100644 --- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp +++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp @@ -615,7 +615,7 @@ static void swizzle_subrect_32bpp_small(U8 * RADRESTRICT dest, U32 dx, U32 dy, U { // determine morton-order stepping constants U32 minor = RR_MIN(dw, dh); - S64 xinc = (S32) rsx_morton_encode(-1, 0, minor) * 4; // *4 since we work with byte offsets + S64 xinc = (S32) rsx_morton_encode(-1, 0, minor) * 4; // *4 since we work with uint8_t offsets S64 yinc = (S32) rsx_morton_encode(-1, 1, minor) * 4; // determine start offsets along x/y axis @@ -705,7 +705,7 @@ static void swizzle_subrect_32bpp(U8 * RADRESTRICT dest, U32 dx, U32 dy, U32 dw, // main part: go through image in blocks of 8x4 pixels. (8x4 since that's one full cache line, // so we write pixels one cache line at a time) minor = RR_MIN(dw, dh); - incx = (S32) rsx_morton_encode(-8, 0, minor) * 4; // *4 since it's all byte offsets + incx = (S32) rsx_morton_encode(-8, 0, minor) * 4; // *4 since it's all uint8_t offsets incy = (S32) rsx_morton_encode(-4, 1, minor) * 4; outx0 = rsx_morton_encode(dx0, 0, minor) * 4; outy = rsx_morton_encode(dy0, 1, minor) * 4; diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h index f8ec8705e..8829ed48a 100644 --- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h +++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h @@ -43,7 +43,7 @@ IDOC extern int gdraw_GCM_SetRendertargetMemory(void *ptr, S32 num_bytes, S32 wi All render targets allocated by GDraw have the same size (width x height pixels) and will use the same pitch; thus you can pack them all into one tile region, which is recommended from a performance perspective. - Pitch must allow for 4-byte-per-pixel rendertargets (so pitch must be at least width*4). + Pitch must allow for 4-uint8_t-per-pixel rendertargets (so pitch must be at least width*4). On other platforms, Iggy does not require you to correctly specify the width and height of the rendertargets; the size you specify is a hint, and GDraw will detect the actual diff --git a/Minecraft.Client/PS3/Iggy/include/gdraw.h b/Minecraft.Client/PS3/Iggy/include/gdraw.h index 404a2642b..e959d788e 100644 --- a/Minecraft.Client/PS3/Iggy/include/gdraw.h +++ b/Minecraft.Client/PS3/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) @@ -718,7 +718,7 @@ IDOC struct GDrawFunctions to dynamically configure which of RAD's supplied drawing layers you wish to use, or to integrate it directly into your own renderer by implementing your own versions of the drawing - functions Iggy requires. + functions Iggy requirements. */ RADDEFEND diff --git a/Minecraft.Client/PS3/Iggy/include/iggy.h b/Minecraft.Client/PS3/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/PS3/Iggy/include/iggy.h +++ b/Minecraft.Client/PS3/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/PS3/Miles/include/mss.h b/Minecraft.Client/PS3/Miles/include/mss.h index 531dcbc92..162451b2d 100644 --- a/Minecraft.Client/PS3/Miles/include/mss.h +++ b/Minecraft.Client/PS3/Miles/include/mss.h @@ -512,7 +512,7 @@ RADDEFSTART #define MAX_LOCK_CHAN (16-1) // Max channel available for locking #define PERCUSS_CHAN (10-1) // Percussion channel (no locking) -#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requirements at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -1900,7 +1900,7 @@ typedef struct _SMPBUF { void const *start; // Sample buffer address (W) U32 len; // Sample buffer size in bytes (W) - U32 pos; // Index to next byte (R/W) + U32 pos; // Index to next uint8_t (R/W) U32 done; // Nonzero if buffer with len=0 sent by app S32 reset_ASI; // Reset the ASI decoder at the end of the buffer S32 reset_seek_pos; // New destination offset in stream source data, for ASI codecs that care @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requirements if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the uint8_t size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp index 8ab30bebd..6c802180a 100644 --- a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp @@ -240,7 +240,7 @@ void SQRNetworkManager_PS3::Terminate() } while( m_basicEventThread->isRunning() ); } -// Second stage of initialisation, that requires NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// Second stage of initialisation, that requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context // for Np Matching 2. Initialisation is finally complete when we get a callback to ContextCallback. The SQRNetworkManager_PS3 is then finally moved // into SNM_INT_STATE_IDLE at this stage. void SQRNetworkManager_PS3::InitialiseAfterOnline() @@ -778,8 +778,8 @@ bool SQRNetworkManager_PS3::IsReadyToPlayOrIdle() // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and -// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +// game code requirements IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// it also requirements that it is informed of the state changes leading up to not being in the session, before this should report false. bool SQRNetworkManager_PS3::IsInSession() { return m_isInSession; @@ -1066,7 +1066,7 @@ bool SQRNetworkManager_PS3::AddLocalPlayerByUserIndex(int idx) m_roomSyncData.setPlayerCount(m_roomSyncData.getPlayerCount()+1); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(); // Sync this back out to our networked clients... @@ -1146,7 +1146,7 @@ bool SQRNetworkManager_PS3::RemoveLocalPlayerByUserIndex(int idx) memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData)); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also delete the SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(roomSlotPlayerCount); m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL; @@ -1714,7 +1714,7 @@ void SQRNetworkManager_PS3::SyncRoomData() sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId ); } -// Check if the matching context is valid, and if not attempt to create one. If to do this requires starting an asynchronous process, then sets the internal state to the state passed in +// Check if the matching context is valid, and if not attempt to create one. If to do this requirements starting an asynchronous process, then sets the internal state to the state passed in // before doing this. // Returns true on success. bool SQRNetworkManager_PS3::GetMatchingContext(eSQRNetworkManagerInternalState asyncState) @@ -2137,7 +2137,7 @@ void SQRNetworkManager_PS3::DeleteServerContext() } } -// Creates a set of Rudp connections by the "active open" method. This requires that both ends of the connection call cellRudpInitiate to fully create a connection. We +// Creates a set of Rudp connections by the "active open" method. This requirements that both ends of the connection call cellRudpInitiate to fully create a connection. We // create one connection per local play on any remote machine. // // peerMemberId is the room member Id of the remote end of the connection @@ -2414,7 +2414,7 @@ void SQRNetworkManager_PS3::DefaultRequestCallback(SceNpMatching2ContextId id, S SQRNetworkManager_PS3 *manager = (SQRNetworkManager_PS3 *)arg; if( id != manager->m_matchingContext ) return; - // PS3 requires a call to get any data that is passed with the callback. On PS3, the data is just passed in directly - do the getting of data here on PS3 to get it into the same state as the PS4 + // PS3 requirements a call to get any data that is passed with the callback. On PS3, the data is just passed in directly - do the getting of data here on PS3 to get it into the same state as the PS4 #ifdef __PS3__ void *data = 0; bool dataError = false; @@ -2679,7 +2679,7 @@ void SQRNetworkManager_PS3::DefaultRequestCallback(SceNpMatching2ContextId id, S break; // This is the response to sceNpMatching2GetRoomMemberDataInternal.This only happens on the host, as a response to an incoming connection being established, when we // kick off the request for room member internal data so that we can determine what local players that remote machine is intending to bring into the game. At this point we can - // activate the host end of each of the Rupd connection that this machine requires. We can also update our player slot data (which gets syncronised back out to other room members) at this point. + // activate the host end of each of the Rupd connection that this machine requirements. We can also update our player slot data (which gets syncronised back out to other room members) at this point. case SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomMemberDataInternal: if( errorCode == 0 ) { @@ -3195,7 +3195,7 @@ void SQRNetworkManager_PS3::RudpContextCallback(int ctx_id, int event_id, int er if( manager->m_listener ) { unsigned int dataSize = cellRudpGetSizeReadable(ctx_id); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp index bdd58e17c..1a4de1d2b 100644 --- a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp @@ -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); diff --git a/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp b/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp index 2b0a523fe..41996c2cf 100644 --- a/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp +++ b/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp @@ -208,7 +208,7 @@ bool EdgeZLib::Compress(void* pDestination, uint32_t* pDestSize, const void* pSo pDst = ((uint32_t*)pDestination); } - pDst[0] = SrcSize; // 4 byte header added for source size + pDst[0] = SrcSize; // 4 uint8_t header added for source size s_numElementsToCompress = 1; //Must be set correctly before any elements are added @@ -275,7 +275,7 @@ bool EdgeZLib::Compress(void* pDestination, uint32_t* pDestSize, const void* pSo (int)SrcSize, (int)s_compressedSize, compressionPercent, kNumDeflateTasks ); #endif - *pDestSize = s_compressedSize + 4; // 4 byte header for size + *pDestSize = s_compressedSize + 4; // 4 uint8_t header for size if(findingSizeOnly) free(pDst); LeaveCriticalSection(&s_critSect); diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h index d3d8cc6a1..d24271614 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h @@ -109,7 +109,7 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char byte; +typedef unsigned char uint8_t; typedef long long __int64; typedef unsigned long long __uint64; typedef unsigned long DWORD; @@ -137,7 +137,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/PS3/PS3Extras/winerror.h b/Minecraft.Client/PS3/PS3Extras/winerror.h index 88763467a..f1b522aff 100644 --- a/Minecraft.Client/PS3/PS3Extras/winerror.h +++ b/Minecraft.Client/PS3/PS3Extras/winerror.h @@ -2495,7 +2495,7 @@ // // MessageText: // -// No mapping for the Unicode character exists in the target multi-byte code page. +// No mapping for the Unicode character exists in the target multi-uint8_t code page. // #define ERROR_NO_UNICODE_TRANSLATION 1113L @@ -2704,7 +2704,7 @@ // // MessageText: // -// The specified program requires a newer version of Windows. +// The specified program requirements a newer version of Windows. // #define ERROR_OLD_WIN_VERSION 1150L @@ -2830,7 +2830,7 @@ // // MessageText: // -// The indicated device requires reinitialization due to hardware errors. +// The indicated device requirements reinitialization due to hardware errors. // #define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164L // dderror @@ -4940,7 +4940,7 @@ // // MessageText: // -// This operation requires an interactive window station. +// This operation requirements an interactive window station. // #define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 1459L @@ -6117,7 +6117,7 @@ // // MessageText: // -// The byte count is too small. +// The uint8_t count is too small. // #define RPC_X_BYTE_COUNT_TOO_SMALL 1782L @@ -9717,7 +9717,7 @@ // // MessageText: // -// This request requires a secure connection. +// This request requirements a secure connection. // #define ERROR_DS_CONFIDENTIALITY_REQUIRED 8237L @@ -11097,7 +11097,7 @@ // // MessageText: // -// A root object requires a class of 'top'. +// A root object requirements a class of 'top'. // #define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 8432L @@ -11511,7 +11511,7 @@ // // MessageText: // -// The requested operation requires a directory service, and none was available. +// The requested operation requirements a directory service, and none was available. // #define ERROR_DS_DS_REQUIRED 8478L @@ -11619,7 +11619,7 @@ // // MessageText: // -// Another operation which requires exclusive access to the PDC FSMO is already in progress. +// Another operation which requirements exclusive access to the PDC FSMO is already in progress. // #define ERROR_DS_PDC_OPERATION_IN_PROGRESS 8490L @@ -12009,7 +12009,7 @@ // // MessageText: // -// The connection between client and server requires packet privacy or better. +// The connection between client and server requirements packet privacy or better. // #define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 8533L @@ -12036,7 +12036,7 @@ // // MessageText: // -// The operation requires that destination domain auditing be enabled. +// The operation requirements that destination domain auditing be enabled. // #define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 8536L @@ -12182,7 +12182,7 @@ // // MessageText: // -// The operation requires that source domain auditing be enabled. +// The operation requirements that source domain auditing be enabled. // #define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 8552L @@ -12722,7 +12722,7 @@ // // MessageText: // -// Secondary DNS zone requires master IP address. +// Secondary DNS zone requirements master IP address. // #define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 9612L @@ -12799,7 +12799,7 @@ // // MessageText: // -// Primary DNS zone requires datafile. +// Primary DNS zone requirements datafile. // #define DNS_ERROR_PRIMARY_REQUIRES_DATAFILE 9651L @@ -15890,7 +15890,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The requested operation requires that JIT be in the current context and it is not +// The requested operation requirements that JIT be in the current context and it is not // #define CONTEXT_E_NOJIT _HRESULT_TYPEDEF_(0x8004E026L) @@ -15899,7 +15899,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The requested operation requires that the current context have a Transaction, and it does not +// The requested operation requirements that the current context have a Transaction, and it does not // #define CONTEXT_E_NOTRANSACTION _HRESULT_TYPEDEF_(0x8004E027L) @@ -18864,7 +18864,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The streamed cryptographic message requires more data to complete the decode operation. +// The streamed cryptographic message requirements more data to complete the decode operation. // #define CRYPT_E_STREAM_INSUFFICIENT_DATA _HRESULT_TYPEDEF_(0x80091011L) @@ -21062,7 +21062,7 @@ __forceinline HRESULT HRESULT_FROM_WIN32(long x) { return x <= 0 ? (HRESULT)x : // // MessageText: // -// The operation requires a Smart Card, but no Smart Card is currently in the device. +// The operation requirements a Smart Card, but no Smart Card is currently in the device. // #define SCARD_E_NO_SMARTCARD _HRESULT_TYPEDEF_(0x8010000CL) diff --git a/Minecraft.Client/PS3/PS3_Minecraft.cpp b/Minecraft.Client/PS3/PS3_Minecraft.cpp index 53b47d2d0..e8481bf2d 100644 --- a/Minecraft.Client/PS3/PS3_Minecraft.cpp +++ b/Minecraft.Client/PS3/PS3_Minecraft.cpp @@ -839,7 +839,7 @@ int main() ui.init(1280,480); app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL - // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requirements ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); static bool bTrialTimerDisplayed=true; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h index c733a9285..b4239d699 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h @@ -34,7 +34,7 @@ public: // private: static const int sc_size = 20; - unsigned char m_tileIds[sc_size*sc_size*sc_size]; // byte + unsigned char m_tileIds[sc_size*sc_size*sc_size]; // uint8_t unsigned char m_brightness[sc_size*sc_size*sc_size]; // 2x 4bit unsigned char m_data_flags[sc_size*sc_size*sc_size]; // 2x 4bit int m_grassColor[sc_size*sc_size]; @@ -59,7 +59,7 @@ public: int m_lastHitBlockX; int m_lastHitBlockY; int m_lastHitBlockZ; - unsigned int m_pad[3];// padding to 16 byte alignment + unsigned int m_pad[3];// padding to 16 uint8_t alignment int getTileIdx(int x, int y, int z) { return (( x - m_x0 )*sc_size*sc_size) + (( y - m_y0 )*sc_size) + ( z - m_z0 ); } diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h index 89cd3739c..b6fa2445e 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h @@ -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; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp index 3d1007af1..2fc0c73ee 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp @@ -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); } @@ -396,7 +396,7 @@ void Tesselator_SPU::vertexUV(float x, float y, float z, float u, float v) // 4 - not axis aligned, use uv stored in the vertex data 4 on from this one // ll is an 8-bit (4 bit per u/v) index into the current lighting texture // -// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 byte vertex +// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 uint8_t vertex // is followed by a further 8 bytes which have explicit UVs defined for each vertex: // // 0000 0000 uuuu vvvv (vertex 0) @@ -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); } diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h index 66e8424ea..ba359cc03 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h @@ -3,7 +3,7 @@ #ifdef __PS3__ #ifdef SN_TARGET_PS3_SPU typedef unsigned int DWORD; -typedef unsigned char byte; +typedef unsigned char uint8_t; #include #else #include "..\..\..\stdafx.h" @@ -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); diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h index 51937a873..eab370291 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h @@ -36,8 +36,8 @@ // Some notes on the logic of all of this... // (1) Large numbers of blocks in the world really don't need to be stored at a full 8 bits per tile. // In a worst-case scenario, all planes would be 256 bytes and we'd have to store offsets of up to 32704 ( 64 x 511). This would require 15 bits per offset to store, but since in all cases -// the data can be stored with a 2 byte alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have -// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-byte aligned, and +// the data can be stored with a 2 uint8_t alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have +// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-uint8_t aligned, and // then use the extra bit to determine whether its a 0 or 8-bit per tile index. In the 0 bit case, we can use the bits used for the offset to store the actual tile value represented throughout the plane. // (2) The compression is done per 4x4x4 block rather than planes like the lighting, as that gives many more regions that have a small number of tile types than per plane, and can therefore // be compressed using less bits per tile. This is at the expense of a larger index, and more overhead from storing the tile types in each block (since there are more blocks than planes). However @@ -136,7 +136,7 @@ public: class OutputData { public: - unsigned char m_tileIds[sc_size*sc_size*sc_size]; // byte + unsigned char m_tileIds[sc_size*sc_size*sc_size]; // uint8_t unsigned char m_brightness[sc_size*sc_size*sc_size]; // 2x 4bit unsigned char m_data_flags[sc_size*sc_size*sc_size]; // 2x 4bit }; diff --git a/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h b/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/PS3/Sentient/TelemetryEnum.h b/Minecraft.Client/PS3/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/PS3/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/PS3/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h b/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h index b08c9fba6..b44f2b845 100644 --- a/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h @@ -77,7 +77,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp b/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp index fc5b190ad..c170b6098 100644 --- a/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp +++ b/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp @@ -91,7 +91,7 @@ enum gdraw_outstanding_transfer struct GDraw { - // 16-byte aligned! + // 16-uint8_t aligned! F32 projection[4]; // always 2D scale+2D translate. first two are scale, last two are translate. // scale factor converting worldspace to viewspace <0,0>.. @@ -366,7 +366,7 @@ static void gdraw_gpu_memcpy(GDrawHandleCache *c, void *dst, void *src, U32 num_ } // handle the rest - // NOTE: our 16-byte alignment guarantees that despite rounding up, we're not going + // NOTE: our 16-uint8_t alignment guarantees that despite rounding up, we're not going // to overwrite memory belonging to another resource. if (offs < num_bytes) { U32 remaining_pixels = (num_bytes - offs + GPU_MEMCPY_ALIGN - 1) / GPU_MEMCPY_ALIGN; diff --git a/Minecraft.Client/PSVita/Iggy/include/gdraw.h b/Minecraft.Client/PSVita/Iggy/include/gdraw.h index 404a2642b..e959d788e 100644 --- a/Minecraft.Client/PSVita/Iggy/include/gdraw.h +++ b/Minecraft.Client/PSVita/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) @@ -718,7 +718,7 @@ IDOC struct GDrawFunctions to dynamically configure which of RAD's supplied drawing layers you wish to use, or to integrate it directly into your own renderer by implementing your own versions of the drawing - functions Iggy requires. + functions Iggy requirements. */ RADDEFEND diff --git a/Minecraft.Client/PSVita/Iggy/include/iggy.h b/Minecraft.Client/PSVita/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/PSVita/Iggy/include/iggy.h +++ b/Minecraft.Client/PSVita/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/PSVita/Miles/include/mss.h b/Minecraft.Client/PSVita/Miles/include/mss.h index 531dcbc92..162451b2d 100644 --- a/Minecraft.Client/PSVita/Miles/include/mss.h +++ b/Minecraft.Client/PSVita/Miles/include/mss.h @@ -512,7 +512,7 @@ RADDEFSTART #define MAX_LOCK_CHAN (16-1) // Max channel available for locking #define PERCUSS_CHAN (10-1) // Percussion channel (no locking) -#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requirements at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -1900,7 +1900,7 @@ typedef struct _SMPBUF { void const *start; // Sample buffer address (W) U32 len; // Sample buffer size in bytes (W) - U32 pos; // Index to next byte (R/W) + U32 pos; // Index to next uint8_t (R/W) U32 done; // Nonzero if buffer with len=0 sent by app S32 reset_ASI; // Reset the ASI decoder at the end of the buffer S32 reset_seek_pos; // New destination offset in stream source data, for ASI codecs that care @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requirements if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the uint8_t size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp index dc9ad61e6..360c02e35 100644 --- a/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp +++ b/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp @@ -430,7 +430,7 @@ bool SQRNetworkManager_AdHoc_Vita::CreateMatchingContext(bool bServer /*= false* -// Second stage of initialisation, that requires NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// Second stage of initialisation, that requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context // for Np Matching 2. Initialisation is finally complete when we get a callback to ContextCallback. The SQRNetworkManager_AdHoc_Vita is then finally moved // into SNM_INT_STATE_IDLE at this stage. void SQRNetworkManager_AdHoc_Vita::InitialiseAfterOnline() @@ -960,8 +960,8 @@ bool SQRNetworkManager_AdHoc_Vita::IsReadyToPlayOrIdle() // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state P hasn't really caught up with this request yet), and -// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +// game code requirements IsInSession to return true as soon as it has asked to do one of these things (even if the state P hasn't really caught up with this request yet), and +// it also requirements that it is informed of the state changes leading up to not being in the session, before this should report false. bool SQRNetworkManager_AdHoc_Vita::IsInSession() { return m_isInSession; @@ -2184,7 +2184,7 @@ void SQRNetworkManager_AdHoc_Vita::DeleteServerContext() SetState(SNM_INT_STATE_SERVER_DELETING_CONTEXT); } -// Creates a set of Rudp connections by the "active open" method. This requires that both ends of the connection call cellRudpInitiate to fully create a connection. We +// Creates a set of Rudp connections by the "active open" method. This requirements that both ends of the connection call cellRudpInitiate to fully create a connection. We // create one connection per local play on any remote machine. // // peerMemberId is the room member Id of the remote end of the connection @@ -2652,7 +2652,7 @@ void SQRNetworkManager_AdHoc_Vita::RudpContextCallback(int ctx_id, int event_id, { SQRNetworkPlayer *playerIncomingData = manager->GetPlayerFromRudpCtx( ctx_id ); unsigned int dataSize = playerIncomingData->GetPacketDataSize(); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp index a1534f541..ac03f7f4a 100644 --- a/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp +++ b/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp @@ -273,7 +273,7 @@ void SQRNetworkManager_Vita::Terminate() // } while( m_basicEventThread->isRunning() ); } -// Second stage of initialisation, that requires NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// Second stage of initialisation, that requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context // for Np Matching 2. Initialisation is finally complete when we get a callback to ContextCallback. The SQRNetworkManager_Vita is then finally moved // into SNM_INT_STATE_IDLE at this stage. void SQRNetworkManager_Vita::InitialiseAfterOnline() @@ -855,8 +855,8 @@ bool SQRNetworkManager_Vita::IsReadyToPlayOrIdle() // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and -// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +// game code requirements IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// it also requirements that it is informed of the state changes leading up to not being in the session, before this should report false. bool SQRNetworkManager_Vita::IsInSession() { return m_isInSession; @@ -1176,7 +1176,7 @@ bool SQRNetworkManager_Vita::AddLocalPlayerByUserIndex(int idx) m_roomSyncData.setPlayerCount(m_roomSyncData.getPlayerCount()+1); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(); // Sync this back out to our networked clients... @@ -1262,7 +1262,7 @@ bool SQRNetworkManager_Vita::RemoveLocalPlayerByUserIndex(int idx) memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData)); // And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers. - // This will also delete the SQRNetworkPlayer and do all the callbacks that requires etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requirements etc. MapRoomSlotPlayers(roomSlotPlayerCount); m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL; @@ -2007,7 +2007,7 @@ void SQRNetworkManager_Vita::SyncRoomData() sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId ); } -// Check if the matching context is valid, and if not attempt to create one. If to do this requires starting an asynchronous process, then sets the internal state to the state passed in +// Check if the matching context is valid, and if not attempt to create one. If to do this requirements starting an asynchronous process, then sets the internal state to the state passed in // before doing this. // Returns true on success. bool SQRNetworkManager_Vita::GetMatchingContext(eSQRNetworkManagerInternalState asyncState) @@ -2388,7 +2388,7 @@ void SQRNetworkManager_Vita::DeleteServerContext() } } -// Creates a set of Rudp connections by the "active open" method. This requires that both ends of the connection call cellRudpInitiate to fully create a connection. We +// Creates a set of Rudp connections by the "active open" method. This requirements that both ends of the connection call cellRudpInitiate to fully create a connection. We // create one connection per local play on any remote machine. // // peerMemberId is the room member Id of the remote end of the connection @@ -2918,7 +2918,7 @@ void SQRNetworkManager_Vita::DefaultRequestCallback(SceNpMatching2ContextId id, break; // This is the response to sceNpMatching2GetRoomMemberDataInternal.This only happens on the host, as a response to an incoming connection being established, when we // kick off the request for room member internal data so that we can determine what local players that remote machine is intending to bring into the game. At this point we can - // activate the host end of each of the Rupd connection that this machine requires. We can also update our player slot data (which gets syncronised back out to other room members) at this point. + // activate the host end of each of the Rupd connection that this machine requirements. We can also update our player slot data (which gets syncronised back out to other room members) at this point. case SCE_NP_MATCHING2_REQUEST_EVENT_GET_ROOM_MEMBER_DATA_INTERNAL: app.DebugPrintf("SCE_NP_MATCHING2_REQUEST_EVENT_GET_ROOM_MEMBER_DATA_INTERNAL\n"); if( manager->m_state == SNM_INT_STATE_INITIALISE_FAILED || @@ -3565,7 +3565,7 @@ void SQRNetworkManager_Vita::RudpContextCallback(int ctx_id, int event_id, int e { SQRNetworkPlayer *playerIncomingData = manager->GetPlayerFromRudpCtx( ctx_id ); unsigned int dataSize = playerIncomingData->GetPacketDataSize(); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h index bb3d3503e..96041184f 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h @@ -33,7 +33,7 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char byte; +typedef unsigned char uint8_t; typedef long long __int64; typedef unsigned long long __uint64; typedef unsigned int DWORD; @@ -61,7 +61,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp index b96682501..cc5ef4a9f 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp +++ b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp @@ -338,7 +338,7 @@ VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (DestOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Dest = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -376,7 +376,7 @@ VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (DestOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Dest = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -415,7 +415,7 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) int SrcOffset = ((int)(lpSrcOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = SrcOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (SrcOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Src = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -452,11 +452,11 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) VOID VirtualMove(LPVOID lpDestOffset, LPVOID lpSrcOffset, SIZE_T dwSize) { int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset - int DestChunkOffset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int DestChunkOffset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page int DestPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int SrcOffset = ((int)(lpSrcOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset - int SrcChunkOffset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int SrcChunkOffset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page int SrcPage = SrcOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on while( dwSize ) { diff --git a/Minecraft.Client/PSVita/PSVitaExtras/zlib.h b/Minecraft.Client/PSVita/PSVitaExtras/zlib.h index 3e0c7672a..ece5c1030 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/zlib.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/zlib.h @@ -83,11 +83,11 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ + z_const Bytef *next_in; /* next input uint8_t */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ - Bytef *next_out; /* next output byte should be put there */ + Bytef *next_out; /* next output uint8_t should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ @@ -278,17 +278,17 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so + flushed to the output buffer and the output is aligned on a uint8_t boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes + that is three bits plus filler bits to the next uint8_t, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the + output buffer, but the output is not aligned to a uint8_t boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output @@ -296,8 +296,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after + for Z_SYNC_FLUSH, but the output is not aligned on a uint8_t boundary, and up to + seven bits of the current block are held to be written as the next uint8_t after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next @@ -429,10 +429,10 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if + number of unused bits in the last uint8_t taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate + decoding the complete header up to just before the first uint8_t of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of @@ -588,7 +588,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the compression dictionary from the given byte sequence + Initializes the compression dictionary from the given uint8_t sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this @@ -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 @@ -718,7 +718,7 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending + await more bits to join them in order to fill out a full uint8_t. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -752,7 +752,7 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + a zero uint8_t, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part @@ -820,7 +820,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the decompression dictionary from the given uncompressed byte + Initializes the decompression dictionary from the given uncompressed uint8_t sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. @@ -917,7 +917,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used + middle of a uint8_t. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the @@ -1011,7 +1011,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general + and a 32K uint8_t window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. @@ -1161,7 +1161,7 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. @@ -1176,7 +1176,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, int level)); /* Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte + parameter has the same meaning as in deflateInit. sourceLen is the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the @@ -1198,7 +1198,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some @@ -1252,7 +1252,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- - byte gzip header. + uint8_t gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was @@ -1390,7 +1390,7 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* - Reads one byte from the compressed file. gzgetc returns this byte or -1 + Reads one uint8_t from the compressed file. gzgetc returns this uint8_t or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file diff --git a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp index a82adf00f..afd01352b 100644 --- a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp +++ b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp @@ -657,7 +657,7 @@ int main() StorageManager.SetDLCInfoMap(app.GetSonyDLCMap()); app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL - // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requirements ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); diff --git a/Minecraft.Client/PSVita/PSVita_UIController.cpp b/Minecraft.Client/PSVita/PSVita_UIController.cpp index c3a03acea..f783e7bc9 100644 --- a/Minecraft.Client/PSVita/PSVita_UIController.cpp +++ b/Minecraft.Client/PSVita/PSVita_UIController.cpp @@ -32,7 +32,7 @@ void ConsoleUIController::init(S32 w, S32 h) textures). The texture and vertex buffer pools contain multiple textures and - vertex buffers. Each object requires a bit of main memory for management + vertex buffers. Each object requirements a bit of main memory for management overhead. We need to specify how many object handles can be in use at the same time in any given pool. If Iggy runs out of GDraw handles, it won't crash, but instead throw out old cache data in a LRU fashion. diff --git a/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h b/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h b/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h index 3c120f13d..721e9a4cb 100644 --- a/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h @@ -234,5 +234,5 @@ enum ETelemetryChallenges eTelemetryTutorial_Hopper, eTelemetryTutorial_HopperMenu, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index ae81bd699..57b91d154 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -364,8 +364,8 @@ 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( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (byte)changes, level) ) ); + // 4J As we only get here if changes is less than MAX_CHANGES_BEFORE_RESEND (10) we only need to send a uint8_t value in the packet + broadcast( shared_ptr( 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); diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index ab8ae20bc..efe6df828 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -1214,7 +1214,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptrx = centreXC; data->z = centreZC; - data->dimension = (byte) player->level->dimension->id; + data->dimension = (uint8_t) player->level->dimension->id; data->setDirty(); } diff --git a/Minecraft.Client/PlayerList.cpp b/Minecraft.Client/PlayerList.cpp index 42724a4f4..40b26d8cd 100644 --- a/Minecraft.Client/PlayerList.cpp +++ b/Minecraft.Client/PlayerList.cpp @@ -234,7 +234,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr addPlayerToReceiving( player ); playerConnection->send( shared_ptr( 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( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); diff --git a/Minecraft.Client/Screen.cpp b/Minecraft.Client/Screen.cpp index 131cf0134..da8a5e1a7 100644 --- a/Minecraft.Client/Screen.cpp +++ b/Minecraft.Client/Screen.cpp @@ -43,7 +43,7 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) wstring Screen::getClipboard() { // 4J - removed - return NULL; + return L""; } void Screen::setClipboard(const wstring& str) diff --git a/Minecraft.Client/ServerChunkCache.cpp b/Minecraft.Client/ServerChunkCache.cpp index 3af98ca66..2f554ce20 100644 --- a/Minecraft.Client/ServerChunkCache.cpp +++ b/Minecraft.Client/ServerChunkCache.cpp @@ -756,7 +756,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. diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index 1e00b591f..cacd0e011 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -1091,7 +1091,7 @@ bool ServerLevel::addGlobalEntity(shared_ptr e) return false; } -void ServerLevel::broadcastEntityEvent(shared_ptr e, byte event) +void ServerLevel::broadcastEntityEvent(shared_ptr e, uint8_t event) { shared_ptr p = shared_ptr( new EntityEventPacket(e->entityId, event) ); server->getLevel(dimension->id)->getTracker()->broadcastAndSend(e, p); diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index 45f3114d5..dff214f5d 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -106,7 +106,7 @@ protected: public: shared_ptr getEntity(int id); virtual bool addGlobalEntity(shared_ptr e); - void broadcastEntityEvent(shared_ptr e, byte event); + void broadcastEntityEvent(shared_ptr e, uint8_t event); virtual shared_ptr explode(shared_ptr 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); diff --git a/Minecraft.Client/Tesselator.cpp b/Minecraft.Client/Tesselator.cpp index 7bae7aca9..87214d0d4 100644 --- a/Minecraft.Client/Tesselator.cpp +++ b/Minecraft.Client/Tesselator.cpp @@ -326,7 +326,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); } @@ -362,7 +362,7 @@ void Tesselator::vertexUV(float x, float y, float z, float u, float v) // 4 - not axis aligned, use uv stored in the vertex data 4 on from this one // ll is an 8-bit (4 bit per u/v) index into the current lighting texture // -// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 byte vertex +// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 uint8_t vertex // is followed by a further 8 bytes which have explicit UVs defined for each vertex: // // 0000 0000 uuuu vvvv (vertex 0) @@ -833,7 +833,7 @@ void Tesselator::vertex(float x, float y, float z) int16_t u2 = ((int16_t*)&_tex2)[0]; int16_t v2 = ((int16_t*)&_tex2)[1]; #if defined _XBOX_ONE || defined __ORBIS__ - // Optimisation - pack the second UVs into a single short (they could actually go in a byte), which frees up a short to store the x offset for this chunk in the vertex itself. + // Optimisation - pack the second UVs into a single short (they could actually go in a uint8_t), which frees up a short to store the x offset for this chunk in the vertex itself. // This means that when rendering chunks, we don't need to update the vertex constants that specify the location for a chunk, when only the x offset has changed. pShortData[6] = ( u2 << 8 ) | v2; pShortData[7] = -xoo; @@ -1034,15 +1034,15 @@ void Tesselator::normal(float x, float y, float z) #ifdef __PS3__ _normal = _ConvertF32toX11Y11Z10N(x,y,z); #elif __PSVITA__ - // AP - casting a negative value to 'byte' on Vita results in zero. changed to a signed 8 value + // AP - casting a negative value to 'uint8_t' on Vita results in zero. changed to a signed 8 value int8_t xx = (int8_t) (x * 127); int8_t yy = (int8_t) (y * 127); 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 } diff --git a/Minecraft.Client/Tesselator.h b/Minecraft.Client/Tesselator.h index 72a458c22..6c0f30a23 100644 --- a/Minecraft.Client/Tesselator.h +++ b/Minecraft.Client/Tesselator.h @@ -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); diff --git a/Minecraft.Client/Texture.cpp b/Minecraft.Client/Texture.cpp index 809f606aa..082035c4c 100644 --- a/Minecraft.Client/Texture.cpp +++ b/Minecraft.Client/Texture.cpp @@ -270,10 +270,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); @@ -283,31 +283,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]; + uint8_t[] bytes = new uint8_t[width * height * 4]; data.position(0); data.get(bytes); for (int y = height - 1; y >= 0; y--) @@ -336,7 +336,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]; + uint8_t[] bytes = new uint8_t[width * height * 4]; buffer.position(0); buffer.get(bytes); @@ -530,10 +530,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)); } } } @@ -589,10 +589,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); } } @@ -641,10 +641,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); } } } @@ -676,10 +676,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); } } @@ -829,7 +829,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 @@ -848,7 +848,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 diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index cd6e0bae1..11676e492 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -24,8 +24,8 @@ bool Textures::MIPMAP = true; C4JRender::eTextureFormat Textures::TEXTURE_FORMAT = C4JRender::TEXTURE_FORMAT_RxGyBzAw; int Textures::preLoadedIdx[TN_COUNT]; -wchar_t *Textures::preLoaded[TN_COUNT] = -{ +const wchar_t *Textures::preLoaded[TN_COUNT] = + { L"%blur%misc/pumpkinblur", // L"%blur%/misc/vignette", // Not currently used L"%clamp%misc/shadow", @@ -725,15 +725,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 @@ -901,10 +901,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); @@ -1520,8 +1520,8 @@ TEXTURE_NAME TUImages[] = }; // This is for any TU textures that aren't part of our enum indexed preload set -wchar_t *TUImagePaths[] = -{ +const wchar_t *TUImagePaths[] = + { L"font/Default", L"font/Mojangles_7", L"font/Mojangles_11", @@ -1579,8 +1579,8 @@ TEXTURE_NAME OriginalImages[] = TN_COUNT }; -wchar_t *OriginalImagesPaths[] = -{ +const wchar_t *OriginalImagesPaths[] = + { L"misc/watercolor.png", NULL diff --git a/Minecraft.Client/Textures.h b/Minecraft.Client/Textures.h index eb3d2f6d2..4ef072588 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -243,7 +243,7 @@ public: static C4JRender::eTextureFormat TEXTURE_FORMAT; private: - static wchar_t *preLoaded[TN_COUNT]; + static const wchar_t *preLoaded[TN_COUNT]; static int preLoadedIdx[TN_COUNT]; unordered_map idMap; diff --git a/Minecraft.Client/TileRenderer.cpp b/Minecraft.Client/TileRenderer.cpp index 2acc6170a..d2abdf70c 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -2771,9 +2771,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; } diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 0a5a02bff..e800e5988 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -152,7 +152,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ) { teleportDelay = 0; - packet = shared_ptr( new TeleportEntityPacket(e->entityId, xn, yn, zn, (byte) yRotn, (byte) xRotn) ); + packet = shared_ptr( 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; @@ -205,7 +205,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ( za >= -16 ) && ( za <= 15 ) && ( ya >= -32 ) && ( ya <= 31 ) ) { - // use the packet with small packet with rotation if we can - 5 bits each for x & z, and 6 for y - still a byte less than the alternative + // use the packet with small packet with rotation if we can - 5 bits each for x & z, and 6 for y - still a uint8_t less than the alternative packet = shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, 0, 0 )); c1b++; } @@ -291,7 +291,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl if (rot) { // 4J: Changed this to use deltas - broadcast( shared_ptr( new MoveEntityPacket::Rot(e->entityId, (byte) yRota, (byte) xRota)) ); + broadcast( shared_ptr( new MoveEntityPacket::Rot(e->entityId, (uint8_t) yRota, (uint8_t) xRota)) ); yRotp = yRotn; xRotp = xRotn; } @@ -308,7 +308,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl int yHeadRot = Mth::floor(e->getYHeadRot() * 256 / 360); if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL) { - broadcast(shared_ptr( new RotateHeadPacket(e->entityId, (byte) yHeadRot))); + broadcast(shared_ptr( new RotateHeadPacket(e->entityId, (uint8_t) yHeadRot))); yHeadRotp = yHeadRot; } diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h index 737caa98b..5e6087eb0 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h @@ -74,7 +74,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp index dea9e3155..9ebf6c5d9 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp @@ -56,7 +56,7 @@ typedef ID3D11DeviceContext ID3D1XContext; typedef F32 ViewCoord; typedef gdraw_d3d11_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(HRESULT hr, const char *call, const char *context); static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) { diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl index df42488c6..49fbc0131 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -200,7 +200,7 @@ static void safe_release(T *&p) } } -static void report_d3d_error(HRESULT hr, char *call, char *context) +static void report_d3d_error(HRESULT hr, const char *call, const char *context) { if (hr == E_OUTOFMEMORY) IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); @@ -478,7 +478,7 @@ static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingI D3D1X_(SUBRESOURCE_DATA) mipdata[24]; S32 i, w, h, nmips, bpp; HRESULT hr = S_OK; - char *failed_call; + const char *failed_call; U8 *ptr; // generate mip maps and set up descriptors for them @@ -700,7 +700,7 @@ static void RADLINK gdraw_DescribeVertexBuffer(GDrawVertexBuffer *vbuf, GDraw_Ve static GDrawHandle *get_color_rendertarget(GDrawStats *stats) { - char *failed_call; + const char *failed_call; // try to recycle LRU rendertarget GDrawHandle *t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); @@ -762,7 +762,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static ID3D1X(DepthStencilView) *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->depth_buffer[1]) { - char *failed_call; + const char *failed_call; assert(!gdraw->rt_depth_buffer); D3D1X_(TEXTURE2D_DESC) desc = { static_cast(gdraw->frametex_width), static_cast(gdraw->frametex_height), 1U, 1U, DXGI_FORMAT_D24_UNORM_S8_UINT, { 1, 0 }, @@ -2117,13 +2117,13 @@ 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 + // 2. strokes and edge antialiasing. they use a 16-uint8_t vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every // 3 vertices, which means 24 bytes of index data for every 48 bytes // of vertex data. - // 3. textured quads. they use a 16-byte vertex format, have exactly 2 + // 3. textured quads. they use a 16-uint8_t vertex format, have exactly 2 // triangles for every 4 vertices, and use either a static index buffer // (quad_ib) or a single triangle strip, so for our purposes they need no // space to store indices at all. @@ -2382,9 +2382,8 @@ static S32 num_pixels(S32 w, S32 h, S32 mipmaps) return pixels; } -GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture) -{ - char *failed_call=""; +GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture){ + const char *failed_call = ""; U8 *free_data = 0; GDrawTexture *t=0; S32 width, height, mipmaps, size, blk; @@ -2412,7 +2411,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, case IFT_FORMAT_DXT5 : size=16; d3dfmt = DXGI_FORMAT_BC3_UNORM; blk = 4; break; default: { IggyGDrawSendWarning(NULL, "GDraw .iggytex raw texture format %d not supported by hardware", texture->format); - goto done; + return 0; } } @@ -2428,7 +2427,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, free_data = (U8 *) IggyGDrawMalloc(total_size); if (!free_data) { IggyGDrawSendWarning(NULL, "GDraw out of memory to store texture data to pass to D3D for %d x %d texture", width, height); - goto done; + return 0; } U8 *cur = free_data; @@ -2457,21 +2456,23 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, failed_call = "CreateTexture2D"; hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &tex); - if (FAILED(hr)) goto done; + + if (SUCCEEDED(hr)) { + failed_call = "CreateShaderResourceView for texture creation"; + hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); + + if (SUCCEEDED(hr)) { + t = gdraw_D3D1X_(WrappedTextureCreate)(view); + } + } - failed_call = "CreateShaderResourceView for texture creation"; - hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); - if (FAILED(hr)) goto done; - - t = gdraw_D3D1X_(WrappedTextureCreate)(view); - -done: if (FAILED(hr)) { report_d3d_error(hr, failed_call, ""); } - if (free_data) + if (free_data) { IggyGDrawFree(free_data); + } if (!t) { if (view) @@ -2481,6 +2482,7 @@ done: } else { ((GDrawHandle *) t)->handle.tex.d3d = tex; } + return t; } diff --git a/Minecraft.Client/Windows64/Iggy/include/gdraw.h b/Minecraft.Client/Windows64/Iggy/include/gdraw.h index 404a2642b..e959d788e 100644 --- a/Minecraft.Client/Windows64/Iggy/include/gdraw.h +++ b/Minecraft.Client/Windows64/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) @@ -718,7 +718,7 @@ IDOC struct GDrawFunctions to dynamically configure which of RAD's supplied drawing layers you wish to use, or to integrate it directly into your own renderer by implementing your own versions of the drawing - functions Iggy requires. + functions Iggy requirements. */ RADDEFEND diff --git a/Minecraft.Client/Windows64/Iggy/include/iggy.h b/Minecraft.Client/Windows64/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Windows64/Iggy/include/iggy.h +++ b/Minecraft.Client/Windows64/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h b/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h index 5a5a709f0..b4f3f968c 100644 --- a/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h @@ -231,5 +231,5 @@ enum ETelemetryChallenges eTelemetryTutorial_FireworksMenu, eTelemetryTutorial_BeaconMenu - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx b/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx index c8243fc0a..e3bf7744e 100644 --- a/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx +++ b/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx @@ -118,7 +118,7 @@ This game has some features which require an Xbox LIVE enabled gamer profile, but you are currently offline. - This feature requires a gamer profile which is signed into Xbox LIVE. + This feature requirements a gamer profile which is signed into Xbox LIVE. Connect to Xbox LIVE diff --git a/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h b/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h index 5f113d5d7..41ef4dce4 100644 --- a/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h @@ -130,8 +130,8 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD - VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD + VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen VERTEX_TYPE_COUNT diff --git a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp index 5d2b97631..330a812b4 100644 --- a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp +++ b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp @@ -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, diff --git a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h @@ -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(); diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h index 1a1827a24..42f41e3f8 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h @@ -138,10 +138,10 @@ namespace Sentient const HRESULT SENTIENT_E_TIME_OUT = SENTIENT_E_FIRST_ERROR + 0x0008; // 0x80580008 // the operation took too long to complete and has been abandoned. const HRESULT SENTIENT_E_CANCELED = SENTIENT_E_FIRST_ERROR + 0x0009; // 0x80580009 // the operation was canceled by user sign-out or via an explicit call to SentientCancel const HRESULT SENTIENT_E_FORBIDDEN = SENTIENT_E_FIRST_ERROR + 0x000a; // 0x8058000a // the server has indicated that the supplied user is not permitted to perform this operation. - const HRESULT SENTIENT_E_USERINDEX_IS_ANY = SENTIENT_E_FIRST_ERROR + 0x000b; // 0x8058000b // userIndex of ANY passed to a routine that requires a specific user. - const HRESULT SENTIENT_E_USERINDEX_IS_NONE = SENTIENT_E_FIRST_ERROR + 0x000c; // 0x8058000c // userIndex of NONE passed to a routine that requires a user. + const HRESULT SENTIENT_E_USERINDEX_IS_ANY = SENTIENT_E_FIRST_ERROR + 0x000b; // 0x8058000b // userIndex of ANY passed to a routine that requirements a specific user. + const HRESULT SENTIENT_E_USERINDEX_IS_NONE = SENTIENT_E_FIRST_ERROR + 0x000c; // 0x8058000c // userIndex of NONE passed to a routine that requirements a user. const HRESULT SENTIENT_E_USERINDEX_IS_INVALID = SENTIENT_E_FIRST_ERROR + 0x000d; // 0x8058000d // userIndex is not a known value - const HRESULT SENTIENT_E_USERINDEX_IS_FOCUS = SENTIENT_E_FIRST_ERROR + 0x000e; // 0x8058000e // userIndex of FOCUS passed to a routine that requires a specific user. + const HRESULT SENTIENT_E_USERINDEX_IS_FOCUS = SENTIENT_E_FIRST_ERROR + 0x000e; // 0x8058000e // userIndex of FOCUS passed to a routine that requirements a specific user. const HRESULT SENTIENT_E_BUFFER_EXHAUSTED = SENTIENT_E_FIRST_ERROR + 0x000f; // 0x8058000f // no more space in buffer, operation was discarded const HRESULT SENTIENT_E_RETRY_INVALID_DATA = SENTIENT_E_FIRST_ERROR + 0x0010; // 0x80580010 // retry; data was found to be invalid either after step or whole operation finished const HRESULT SENTIENT_E_UNREACHABLE = SENTIENT_E_FIRST_ERROR + 0x0011; // 0x80580011 // Server was not reachable when called. Contact senhelp for assistance. diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h index da1b1f65d..ba53d3238 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h @@ -474,7 +474,7 @@ namespace Sentient // Parameter: SenSysCompletedCallback userCallback // Parameter: void * userCallbackData // Download a single blob of UGC data - // note that zero byte downloads will fail. + // note that zero uint8_t downloads will fail. // ID, blobVersion, and bufferSize should be coming // from SenUGCDownloadedMetaData. // outBuffer should be an preallocated array of bufferSize bytes. @@ -519,7 +519,7 @@ namespace Sentient // Parameter: SenSysCompletedCallback userCallback // Parameter: void * userCallbackData // Download a single blob of UGC data - // NOTE: zero byte downloads will fail. + // NOTE: zero uint8_t downloads will fail. // ID, mainDataRevision and bufferSize should be coming from a // SenUGCDownloadedMetaData2 (where bufferSize comes from // SenUGCDownloadedMetaData2's BlobInfo[mainDataBlobID].Size). diff --git a/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h b/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/stdafx.h b/Minecraft.Client/stdafx.h index 7614d0589..1a9255010 100644 --- a/Minecraft.Client/stdafx.h +++ b/Minecraft.Client/stdafx.h @@ -67,7 +67,7 @@ typedef unsigned __int64 __uint64; #include #include #include -// TODO: reference additional headers your program requires here +// TODO: reference additional headers your program requirements here #include #include using namespace DirectX; diff --git a/Minecraft.World/Achievement.cpp b/Minecraft.World/Achievement.cpp index a0dfd5332..65049dfe9 100644 --- a/Minecraft.World/Achievement.cpp +++ b/Minecraft.World/Achievement.cpp @@ -15,18 +15,18 @@ void Achievement::_init() if (y > Achievements::yMax) Achievements::yMax = y; } -Achievement::Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requirements(requirements) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requirements(requirements) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requirements(requirements) { } diff --git a/Minecraft.World/Achievement.h b/Minecraft.World/Achievement.h index b39c44b31..f8222d37b 100644 --- a/Minecraft.World/Achievement.h +++ b/Minecraft.World/Achievement.h @@ -9,7 +9,7 @@ class Achievement : public Stat { public: const int x, y; - Achievement *requires; + Achievement *requirements; private: const wstring desc; @@ -23,9 +23,9 @@ private: void _init(); public: - Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires); + Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requirements); + Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requirements); + Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requirements); Achievement *setAwardLocallyOnly(); Achievement *setGolden(); diff --git a/Minecraft.World/Achievements.cpp b/Minecraft.World/Achievements.cpp index a3d33cbd8..b8842b34d 100644 --- a/Minecraft.World/Achievements.cpp +++ b/Minecraft.World/Achievements.cpp @@ -108,7 +108,7 @@ void Achievements::staticCtor() // 4J Stu - The order of these achievemnts is very important, as they map directly to data stored in the profile data. New achievements should be added at the end. - // 4J : WESTY : Added new achievements. Note, params "x", "y", "icon" and "requires" are ignored on xbox. + // 4J : WESTY : Added new achievements. Note, params "x", "y", "icon" and "requirements" are ignored on xbox. Achievements::leaderOfThePack = (new Achievement(eAward_LeaderOfThePack, L"leaderOfThePack", 0, 0, Tile::treeTrunk, (Achievement *) buildSword))->setAwardLocallyOnly()->postConstruct(); Achievements::MOARTools = (new Achievement(eAward_MOARTools, L"MOARTools", 0, 0, Tile::treeTrunk, (Achievement *) buildSword))->setAwardLocallyOnly()->postConstruct(); Achievements::dispenseWithThis = (new Achievement(eAward_DispenseWithThis, L"dispenseWithThis", 0, 0, Tile::treeTrunk, (Achievement *) buildSword))->postConstruct(); diff --git a/Minecraft.World/AddEntityPacket.h b/Minecraft.World/AddEntityPacket.h index 293964796..121d3bd8f 100644 --- a/Minecraft.World/AddEntityPacket.h +++ b/Minecraft.World/AddEntityPacket.h @@ -36,7 +36,7 @@ public: int xa, ya, za; int type; int data; - byte yRot,xRot; // 4J added + uint8_t yRot,xRot; // 4J added private: void _init(shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp ); diff --git a/Minecraft.World/AddMobPacket.cpp b/Minecraft.World/AddMobPacket.cpp index 878e2ee72..a64337cea 100644 --- a/Minecraft.World/AddMobPacket.cpp +++ b/Minecraft.World/AddMobPacket.cpp @@ -29,7 +29,7 @@ AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, i { id = mob->entityId; - type = (byte) EntityIO::getId(mob); + type = (uint8_t) EntityIO::getId(mob); // 4J Stu - We should add entities at their "last sent" position so that the relative update packets // put them in the correct place x = xp;//Mth::floor(mob->x * 32); @@ -39,9 +39,9 @@ AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, i yRot = yRotp; xRot = xRotp; yHeadRot = yHeadRotp; - // yRot = (byte) (mob->yRot * 256 / 360); - // xRot = (byte) (mob->xRot * 256 / 360); - // yHeadRot = (byte) (mob->yHeadRot * 256 / 360); + // yRot = (uint8_t) (mob->yRot * 256 / 360); + // xRot = (uint8_t) (mob->xRot * 256 / 360); + // yHeadRot = (uint8_t) (mob->yHeadRot * 256 / 360); // From SetEntityMotionpacket double m = 3.9; diff --git a/Minecraft.World/AddMobPacket.h b/Minecraft.World/AddMobPacket.h index 6af72655e..3d1e19185 100644 --- a/Minecraft.World/AddMobPacket.h +++ b/Minecraft.World/AddMobPacket.h @@ -13,7 +13,7 @@ public: int type; int x, y, z; int xd, yd, zd; - byte yRot, xRot, yHeadRot; + uint8_t yRot, xRot, yHeadRot; private: shared_ptr entityData; diff --git a/Minecraft.World/AddPlayerPacket.cpp b/Minecraft.World/AddPlayerPacket.cpp index 939843679..11208d0b9 100644 --- a/Minecraft.World/AddPlayerPacket.cpp +++ b/Minecraft.World/AddPlayerPacket.cpp @@ -45,8 +45,8 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, Play yRot = yRotp; xRot = xRotp; yHeadRot = yHeadRotp; // 4J Added - // yRot = (byte) (player->yRot * 256 / 360); - // xRot = (byte) (player->xRot * 256 / 360); + // yRot = (uint8_t) (player->yRot * 256 / 360); + // xRot = (uint8_t) (player->xRot * 256 / 360); //printf("%d: New add player (%f,%f,%f) : (%d,%d,%d) : xRot %d, yRot %d\n",id,player->x,player->y,player->z,x,y,z,xRot,yRot); @@ -117,7 +117,7 @@ void AddPlayerPacket::handle(PacketListener *listener) int AddPlayerPacket::getEstimatedSize() { - int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(byte); + int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(uint8_t); if( entityData != NULL ) { diff --git a/Minecraft.World/AddPlayerPacket.h b/Minecraft.World/AddPlayerPacket.h index 30f6bcdda..f381a422d 100644 --- a/Minecraft.World/AddPlayerPacket.h +++ b/Minecraft.World/AddPlayerPacket.h @@ -25,7 +25,7 @@ public: DWORD m_skinId; // 4J Added DWORD m_capeId; // 4J Added unsigned int m_uiGamePrivileges; // 4J Added - byte yHeadRot; // 4J Added + uint8_t yHeadRot; // 4J Added AddPlayerPacket(); ~AddPlayerPacket(); diff --git a/Minecraft.World/Animal.cpp b/Minecraft.World/Animal.cpp index ecda8fc53..1f5398f80 100644 --- a/Minecraft.World/Animal.cpp +++ b/Minecraft.World/Animal.cpp @@ -427,7 +427,7 @@ bool Animal::canMate(shared_ptr partner) return isInLove() && partner->isInLove(); } -void Animal::handleEntityEvent(byte id) +void Animal::handleEntityEvent(uint8_t id) { if (id == EntityEvent::IN_LOVE_HEARTS) { diff --git a/Minecraft.World/Animal.h b/Minecraft.World/Animal.h index 85a20439f..67c392704 100644 --- a/Minecraft.World/Animal.h +++ b/Minecraft.World/Animal.h @@ -65,7 +65,7 @@ public: bool isInLove(); void resetLove(); virtual bool canMate(shared_ptr partner); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); // 4J added for determining whether animals are enclosed or not private: diff --git a/Minecraft.World/ArmorDyeRecipe.cpp b/Minecraft.World/ArmorDyeRecipe.cpp index c2f681fa9..9b05987cf 100644 --- a/Minecraft.World/ArmorDyeRecipe.cpp +++ b/Minecraft.World/ArmorDyeRecipe.cpp @@ -147,12 +147,12 @@ const int ArmorDyeRecipe::getGroup() } // 4J-PB -bool ArmorDyeRecipe::requires(int iRecipe) +bool ArmorDyeRecipe::requirements(int iRecipe) { return false; } -void ArmorDyeRecipe::requires(INGREDIENTS_REQUIRED *pIngReq) +void ArmorDyeRecipe::requirements(INGREDIENTS_REQUIRED *pIngReq) { //int iCount=0; //bool bFound; diff --git a/Minecraft.World/ArmorDyeRecipe.h b/Minecraft.World/ArmorDyeRecipe.h index b983ba7b2..586428277 100644 --- a/Minecraft.World/ArmorDyeRecipe.h +++ b/Minecraft.World/ArmorDyeRecipe.h @@ -18,6 +18,6 @@ public: virtual const int getGroup(); // 4J-PB - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; \ No newline at end of file diff --git a/Minecraft.World/ArrayWithLength.h b/Minecraft.World/ArrayWithLength.h index e22724c6a..d8df5bfea 100644 --- a/Minecraft.World/ArrayWithLength.h +++ b/Minecraft.World/ArrayWithLength.h @@ -84,7 +84,7 @@ class ClipChunk; typedef arrayWithLength doubleArray; typedef array2DWithLength coords2DArray; -typedef arrayWithLength byteArray; +typedef arrayWithLength byteArray; typedef arrayWithLength charArray; typedef arrayWithLength shortArray; typedef arrayWithLength intArray; diff --git a/Minecraft.World/Arrays.h b/Minecraft.World/Arrays.h index 6241a9841..f13cfdab2 100644 --- a/Minecraft.World/Arrays.h +++ b/Minecraft.World/Arrays.h @@ -15,9 +15,9 @@ public: static void fill(BiomeArray arr, unsigned int from, unsigned int to, Biome *value) { assert(from >=0); assert( from <= to ); assert( to <= arr.length ); std::fill( arr.data+from, arr.data+to, value ); } - static void fill(byteArray arr, unsigned int from, unsigned int to, byte value) + static void fill(byteArray arr, unsigned int from, unsigned int to, uint8_t value) { assert(from >=0); assert( from <= to ); assert( to <= arr.length ); std::fill( arr.data+from, arr.data+to, value ); } - static void fill(byteArray arr, byte value) + static void fill(byteArray arr, uint8_t value) { std::fill( arr.data, arr.data+arr.length, value ); } }; diff --git a/Minecraft.World/Arrow.cpp b/Minecraft.World/Arrow.cpp index ab942aac6..3198a1717 100644 --- a/Minecraft.World/Arrow.cpp +++ b/Minecraft.World/Arrow.cpp @@ -123,7 +123,7 @@ Arrow::Arrow(Level *level, shared_ptr mob, float power) : Entity( void Arrow::defineSynchedData() { - entityData->define(ID_FLAGS, (byte) 0); + entityData->define(ID_FLAGS, (uint8_t) 0); } @@ -459,11 +459,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); } @@ -545,19 +545,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; } diff --git a/Minecraft.World/AwardStatPacket.cpp b/Minecraft.World/AwardStatPacket.cpp index 43328794c..bcd9d9677 100644 --- a/Minecraft.World/AwardStatPacket.cpp +++ b/Minecraft.World/AwardStatPacket.cpp @@ -16,7 +16,7 @@ AwardStatPacket::AwardStatPacket(int statId, int count) { this->statId = statId; - this->m_paramData.data = (byte *) new int(count); + this->m_paramData.data = (uint8_t *) new int(count); this->m_paramData.length = sizeof(int); } diff --git a/Minecraft.World/BasicTree.cpp b/Minecraft.World/BasicTree.cpp index 01f10cb3d..dcb2aea4c 100644 --- a/Minecraft.World/BasicTree.cpp +++ b/Minecraft.World/BasicTree.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.tile.h" #include "BasicTree.h" -byte BasicTree::axisConversionArray[] = { 2, 0, 0, 1, 2, 1 }; +uint8_t BasicTree::axisConversionArray[] = { 2, 0, 0, 1, 2, 1 }; BasicTree::~BasicTree() { @@ -134,7 +134,7 @@ void BasicTree::prepare() } -void BasicTree::crossection(int x, int y, int z, float radius, byte direction, int material) +void BasicTree::crossection(int x, int y, int z, float radius, uint8_t direction, int material) { PIXBeginNamedEvent(0, "BasicTree crossection"); // Create a circular cross section. @@ -148,8 +148,8 @@ void BasicTree::crossection(int x, int y, int z, float radius, byte direction, i // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z // material is the index number for the material to use int rad = (int) (radius + 0.618); - byte secidx1 = axisConversionArray[direction]; - byte secidx2 = axisConversionArray[direction + 3]; + uint8_t secidx1 = axisConversionArray[direction]; + uint8_t secidx2 = axisConversionArray[direction + 3]; int center[] = { x, y, z }; int position[] = { 0, 0, 0 }; int offset1 = -rad; @@ -234,7 +234,7 @@ void BasicTree::foliageCluster(int x, int y, int z) while (cury >= y) { radius = foliageShape(cury - y); - crossection(x, cury, z, radius, (byte) 1, Tile::leaves_Id); + crossection(x, cury, z, radius, (uint8_t) 1, Tile::leaves_Id); cury--; } PIXEndNamedEvent(); @@ -248,8 +248,8 @@ void BasicTree::limb(int *start, int *end, int material) // Populate delta, the difference between start and end for all three axies. // Set primidx to the index with the largest overall distance traveled. int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + uint8_t idx = 0; + uint8_t primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -262,8 +262,8 @@ void BasicTree::limb(int *start, int *end, int material) // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return; // set up the other two axis indices. - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + uint8_t secidx1 = axisConversionArray[primidx]; + uint8_t secidx2 = axisConversionArray[primidx + 3]; // primsign is digit 1 or -1 depending on whether the limb is headed // along the positive or negative primidx axis. char primsign; @@ -389,8 +389,8 @@ int BasicTree::checkLine(int *start, int *end) // If the first block searched is lava, return 0 int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + uint8_t idx = 0; + uint8_t primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -403,11 +403,11 @@ int BasicTree::checkLine(int *start, int *end) // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return -1; // set up the other two axis indices. - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + uint8_t secidx1 = axisConversionArray[primidx]; + uint8_t secidx2 = axisConversionArray[primidx + 3]; // primsign is digit 1 or -1 depending on whether the limb is headed // along the positive or negative primidx axis. - char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + char primsign; // 4J Stu - Was uint8_t, but we use in a sum below and uint8_t=unsigned char so we were setting endoffset incorrectly if (delta[primidx] > 0) primsign = 1; else primsign = -1; // Initilize the per-step movement for the non-primary axies. diff --git a/Minecraft.World/BasicTree.h b/Minecraft.World/BasicTree.h index feb145815..7bc085270 100644 --- a/Minecraft.World/BasicTree.h +++ b/Minecraft.World/BasicTree.h @@ -23,7 +23,7 @@ private: // the index for the y axis. // Using this method, the secondary axis will always be horizontal (x or z), // and the tertiary always vertical (y), if possible. - static byte axisConversionArray[]; + static uint8_t axisConversionArray[]; // Set up the pseudorandom number generator Random *rnd; @@ -49,7 +49,7 @@ private: int **foliageCoords; int foliageCoordsLength; void prepare(); - void crossection(int x, int y, int z, float radius, byte direction, int material); + void crossection(int x, int y, int z, float radius, uint8_t direction, int material); float treeShape(int y); float foliageShape(int y); void foliageCluster(int x, int y, int z); diff --git a/Minecraft.World/BeachBiome.cpp b/Minecraft.World/BeachBiome.cpp index 50e7cc1ca..800a005b2 100644 --- a/Minecraft.World/BeachBiome.cpp +++ b/Minecraft.World/BeachBiome.cpp @@ -8,8 +8,8 @@ BeachBiome::BeachBiome(int id) : Biome(id) // remove default mob spawn settings friendlies.clear(); friendlies_chicken.clear(); // 4J added - topMaterial = (byte) Tile::sand_Id; - material = (byte) Tile::sand_Id; + topMaterial = (uint8_t) Tile::sand_Id; + material = (uint8_t) Tile::sand_Id; decorator->treeCount = -999; decorator->deadBushCount = 0; diff --git a/Minecraft.World/Biome.cpp b/Minecraft.World/Biome.cpp index 169db77e6..3af3d3874 100644 --- a/Minecraft.World/Biome.cpp +++ b/Minecraft.World/Biome.cpp @@ -86,8 +86,8 @@ Biome::Biome(int id) : id(id) color = 0; // snowCovered = false; // 4J - this isn't set by the java game any more so removing to save confusion - topMaterial = (byte) Tile::grass_Id; - material = (byte) Tile::dirt_Id; + topMaterial = (uint8_t) Tile::grass_Id; + material = (uint8_t) Tile::dirt_Id; leafColor = 0x4EE031; _hasRain = true; depth = 0.1f; diff --git a/Minecraft.World/Biome.h b/Minecraft.World/Biome.h index f7de31662..a535c2617 100644 --- a/Minecraft.World/Biome.h +++ b/Minecraft.World/Biome.h @@ -52,8 +52,8 @@ public: public: wstring m_name; int color; - byte topMaterial; - byte material; + uint8_t topMaterial; + uint8_t material; int leafColor; float depth; float scale; diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp index 8e2a56809..b39e9af8f 100644 --- a/Minecraft.World/BiomeSource.cpp +++ b/Minecraft.World/BiomeSource.cpp @@ -264,7 +264,7 @@ void BiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int intArray result = zoomedLayer->getArea(x, z, w, h); for (int i = 0; i < w * h; i++) { - biomeIndices[i] = (byte)result[i]; + biomeIndices[i] = (uint8_t)result[i]; } } diff --git a/Minecraft.World/Blaze.cpp b/Minecraft.World/Blaze.cpp index d87a83b2d..ab6e60f23 100644 --- a/Minecraft.World/Blaze.cpp +++ b/Minecraft.World/Blaze.cpp @@ -42,7 +42,7 @@ void Blaze::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); } int Blaze::getAmbientSound() @@ -207,7 +207,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; diff --git a/Minecraft.World/BlockRegionUpdatePacket.cpp b/Minecraft.World/BlockRegionUpdatePacket.cpp index bec943d8d..291e01394 100644 --- a/Minecraft.World/BlockRegionUpdatePacket.cpp +++ b/Minecraft.World/BlockRegionUpdatePacket.cpp @@ -12,7 +12,7 @@ #define BLOCK_REGION_UPDATE_FULLCHUNK 0x01 -#define BLOCK_REGION_UPDATE_ZEROHEIGHT 0x02 // added so we can still send a byte for ys, which really needs the range 0-256 +#define BLOCK_REGION_UPDATE_ZEROHEIGHT 0x02 // added so we can still send a uint8_t for ys, which really needs the range 0-256 BlockRegionUpdatePacket::~BlockRegionUpdatePacket() { @@ -87,7 +87,7 @@ BlockRegionUpdatePacket::BlockRegionUpdatePacket(int x, int y, int z, int xs, in void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException { - byte chunkFlags = dis->readByte(); + uint8_t chunkFlags = dis->readByte(); x = dis->readInt(); y = dis->readShort(); z = dis->readInt(); @@ -137,7 +137,7 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException void BlockRegionUpdatePacket::write(DataOutputStream *dos) // throws IOException { - byte chunkFlags = 0; + uint8_t chunkFlags = 0; if(bIsFullChunk) chunkFlags |= BLOCK_REGION_UPDATE_FULLCHUNK; if(ys == 0) chunkFlags |= BLOCK_REGION_UPDATE_ZEROHEIGHT; diff --git a/Minecraft.World/BlockReplacements.cpp b/Minecraft.World/BlockReplacements.cpp index 7b8aee511..6ab5d7466 100644 --- a/Minecraft.World/BlockReplacements.cpp +++ b/Minecraft.World/BlockReplacements.cpp @@ -8,7 +8,7 @@ void BlockReplacements::staticCtor() { for (int i = 0; i < 256; i++) { - byte b = (byte) i; + uint8_t b = (uint8_t) i; if (b != 0 && Tile::tiles[b & 0xff] == NULL) { b = 0; diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp index e33875817..9252b80c6 100644 --- a/Minecraft.World/Boat.cpp +++ b/Minecraft.World/Boat.cpp @@ -118,7 +118,7 @@ bool Boat::hurt(DamageSource *source, float hurtDamage) setDamage(getDamage() + hurtDamage * 10); markHurt(); - // 4J Stu - Brought froward from 12w36 to fix #46611 - TU5: Gameplay: Minecarts and boat requires more hits than one to be destroyed in creative mode + // 4J Stu - Brought froward from 12w36 to fix #46611 - TU5: Gameplay: Minecarts and boat requirements more hits than one to be destroyed in creative mode // 4J-PB - Fix for XB1 #175735 - [CRASH] [Multi-Plat]: Code: Gameplay: Placing a boat on harmful surfaces causes the game to crash bool creativePlayer = (source->getEntity() != NULL) && source->getEntity()->instanceof(eTYPE_PLAYER) && dynamic_pointer_cast(source->getEntity())->abilities.instabuild; diff --git a/Minecraft.World/BrewingStandTileEntity.cpp b/Minecraft.World/BrewingStandTileEntity.cpp index 5bc6fd27d..c2c78a0f6 100644 --- a/Minecraft.World/BrewingStandTileEntity.cpp +++ b/Minecraft.World/BrewingStandTileEntity.cpp @@ -330,7 +330,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); } diff --git a/Minecraft.World/BufferedOutputStream.cpp b/Minecraft.World/BufferedOutputStream.cpp index 19fc95aff..ac022d7cb 100644 --- a/Minecraft.World/BufferedOutputStream.cpp +++ b/Minecraft.World/BufferedOutputStream.cpp @@ -34,7 +34,7 @@ void BufferedOutputStream::close() stream->close(); } -//Writes len bytes from the specified byte array starting at offset off to this buffered output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this buffered output stream. //Ordinarily this method stores bytes from the given array into this stream's buffer, flushing the buffer to the //underlying output stream as needed. If the requested length is at least as large as this stream's buffer, however, //then this method will flush the buffer and write the bytes directly to the underlying output stream. @@ -72,14 +72,14 @@ void BufferedOutputStream::write(byteArray b) write( b, 0, b.length ); } -//Writes the specified byte to this buffered output stream. +//Writes the specified uint8_t to this buffered output stream. //Overrides: //write in class FilterOutputStream //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void BufferedOutputStream::write(unsigned int b) { - buf[count++] = (byte) b; + buf[count++] = (uint8_t) b; if( count == buf.length ) { flush(); diff --git a/Minecraft.World/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp index 394bda14a..346ee335f 100644 --- a/Minecraft.World/ByteArrayInputStream.cpp +++ b/Minecraft.World/ByteArrayInputStream.cpp @@ -7,7 +7,7 @@ //The buffer's mark is set to the specified offset. //Parameters: //buf - the input buffer. -//offset - the offset in the buffer of the first byte to read. +//offset - the offset in the buffer of the first uint8_t to read. //length - the maximum number of bytes to read from the buffer. ByteArrayInputStream::ByteArrayInputStream(byteArray buf, unsigned int offset, unsigned int length) : pos( offset ), count( min( offset+length, buf.length ) ), mark( offset ) @@ -25,11 +25,11 @@ ByteArrayInputStream::ByteArrayInputStream(byteArray buf) this->buf = buf; } -//Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to 255. -//If no byte is available because the end of the stream has been reached, the value -1 is returned. +//Reads the next uint8_t of data from this input stream. The value uint8_t is returned as an int in the range 0 to 255. +//If no uint8_t is available because the end of the stream has been reached, the value -1 is returned. //This read method cannot block. //Returns: -//the next byte of data, or -1 if the end of the stream has been reached. +//the next uint8_t of data, or -1 if the end of the stream has been reached. int ByteArrayInputStream::read() { if( pos >= count ) @@ -41,11 +41,11 @@ int ByteArrayInputStream::read() //Reads some number of bytes from the input stream and stores them into the buffer array b. //The number of bytes actually read is returned as an integer. This method blocks until input data is available, //end of file is detected, or an exception is thrown. -//If the length of b is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. -//If no byte is available because the stream is at the end of the file, the value -1 is returned; otherwise, -//at least one byte is read and stored into b. +//If the length of b is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one uint8_t. +//If no uint8_t is available because the stream is at the end of the file, the value -1 is returned; otherwise, +//at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, +//The first uint8_t read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, //at most, equal to the length of b. Let k be the number of bytes actually read; these bytes will be stored in elements b[0] through b[k-1], //leaving elements b[k] through b[b.length-1] unaffected. // diff --git a/Minecraft.World/ByteArrayOutputStream.cpp b/Minecraft.World/ByteArrayOutputStream.cpp index 9296fe5ea..b61aaafc5 100644 --- a/Minecraft.World/ByteArrayOutputStream.cpp +++ b/Minecraft.World/ByteArrayOutputStream.cpp @@ -2,14 +2,14 @@ #include "ByteArrayOutputStream.h" -// Creates a new byte array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary. +// Creates a new uint8_t array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary. ByteArrayOutputStream::ByteArrayOutputStream() { count = 0; buf = byteArray( 32 ); } -//Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes. +//Creates a new uint8_t array output stream, with a buffer capacity of the specified size, in bytes. //Parameters: //size - the initial size. ByteArrayOutputStream::ByteArrayOutputStream(unsigned int size) @@ -24,27 +24,27 @@ ByteArrayOutputStream::~ByteArrayOutputStream() delete[] buf.data; } -//Writes the specified byte to this byte array output stream. +//Writes the specified uint8_t to this uint8_t array output stream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void ByteArrayOutputStream::write(unsigned int b) { // If we will fill the buffer we need to make it bigger if( count + 1 >= buf.length ) buf.resize( buf.length * 2 ); - buf[count] = (byte) b; + buf[count] = (uint8_t) b; count++; } -// Writes b.length bytes from the specified byte array to this output stream. +// Writes b.length bytes from the specified uint8_t array to this output stream. //The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length). void ByteArrayOutputStream::write(byteArray b) { write(b, 0, b.length); } -//Writes len bytes from the specified byte array starting at offset off to this byte array output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this uint8_t array output stream. //Parameters: //b - the data. //off - the start offset in the data. @@ -69,9 +69,9 @@ void ByteArrayOutputStream::close() { } -//Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. +//Creates a newly allocated uint8_t array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. //Returns: -//the current contents of this output stream, as a byte array. +//the current contents of this output stream, as a uint8_t array. byteArray ByteArrayOutputStream::toByteArray() { byteArray out(count); diff --git a/Minecraft.World/ByteArrayTag.h b/Minecraft.World/ByteArrayTag.h index 598515ac8..f14eef6ae 100644 --- a/Minecraft.World/ByteArrayTag.h +++ b/Minecraft.World/ByteArrayTag.h @@ -27,7 +27,7 @@ public: dis->readFully(data); } - byte getId() { return TAG_Byte_Array; } + uint8_t getId() { return TAG_Byte_Array; } wstring toString() { diff --git a/Minecraft.World/ByteBuffer.cpp b/Minecraft.World/ByteBuffer.cpp index 665147373..fe5ae132b 100644 --- a/Minecraft.World/ByteBuffer.cpp +++ b/Minecraft.World/ByteBuffer.cpp @@ -7,25 +7,25 @@ ByteBuffer::ByteBuffer( unsigned int capacity ) : Buffer( capacity ) { hasBackingArray = false; - buffer = new byte[capacity]; - memset( buffer,0,sizeof(byte)*capacity); + buffer = new uint8_t[capacity]; + memset( buffer,0,sizeof(uint8_t)*capacity); byteOrder = BIGENDIAN; } -//Allocates a new direct byte buffer. +//Allocates a new direct uint8_t buffer. //The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined. Whether or not it has a backing array is unspecified. // //Parameters: //capacity - The new buffer's capacity, in bytes //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::allocateDirect(int capacity) { return new ByteBuffer(capacity); } -ByteBuffer::ByteBuffer( unsigned int capacity, byte *backingArray ) : Buffer( capacity ) +ByteBuffer::ByteBuffer( unsigned int capacity, uint8_t *backingArray ) : Buffer( capacity ) { hasBackingArray = true; buffer = backingArray; @@ -37,36 +37,36 @@ ByteBuffer::~ByteBuffer() delete[] buffer; } -//Wraps a byte array into a buffer. -//The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array +//Wraps a uint8_t array into a buffer. +//The new buffer will be backed by the given uint8_t array; that is, modifications to the buffer will cause the array //to be modified and vice versa. The new buffer's capacity and limit will be array.length, its position will be zero, //and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero. // //Parameters: //array - The array that will back this buffer //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::wrap(byteArray &b) { return new ByteBuffer( b.length, b.data ); } -//Allocates a new byte buffer. +//Allocates a new uint8_t buffer. //The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined. //It will have a backing array, and its array offset will be zero. // //Parameters: //capacity - The new buffer's capacity, in bytes //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::allocate(unsigned int capacity) { return new ByteBuffer( capacity ); } -//Modifies this buffer's byte order. +//Modifies this buffer's uint8_t order. //Parameters: -//bo - The new byte order, either BIGENDIAN or LITTLEENDIAN +//bo - The new uint8_t order, either BIGENDIAN or LITTLEENDIAN void ByteBuffer::order(ByteOrder bo) { byteOrder = bo; @@ -85,7 +85,7 @@ ByteBuffer *ByteBuffer::flip() } // 4J Added so we can write this to a file -byte *ByteBuffer::getBuffer() +uint8_t *ByteBuffer::getBuffer() { return buffer; } @@ -97,11 +97,11 @@ int ByteBuffer::getSize() } // End 4J -//Absolute get method. Reads the byte at the given index. +//Absolute get method. Reads the uint8_t at the given index. //Parameters: -//index - The index from which the byte will be read +//index - The index from which the uint8_t will be read //Returns: -//The byte at the given index +//The uint8_t at the given index //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit BYTE ByteBuffer::get(int index) @@ -114,7 +114,7 @@ BYTE ByteBuffer::get(int index) //Relative get method for reading an int value. //Reads the next four bytes at this buffer's current position, composing them into an int value according to the -//current byte order, and then increments the position by four. +//current uint8_t order, and then increments the position by four. // //Returns: //The int value at the buffer's current position @@ -143,7 +143,7 @@ int ByteBuffer::getInt() } //Absolute get method for reading an int value. -//Reads four bytes at the given index, composing them into a int value according to the current byte order. +//Reads four bytes at the given index, composing them into a int value according to the current uint8_t order. // //Parameters: //index - The index from which the bytes will be read @@ -171,7 +171,7 @@ int ByteBuffer::getInt(unsigned int index) } //Relative get method for reading a long value. -//Reads the next eight bytes at this buffer's current position, composing them into a long value according to the current byte order, +//Reads the next eight bytes at this buffer's current position, composing them into a long value according to the current uint8_t order, //and then increments the position by eight. // //Returns: @@ -206,7 +206,7 @@ __int64 ByteBuffer::getLong() //Relative get method for reading a short value. //Reads the next two bytes at this buffer's current position, composing them into a short value according to the current -//byte order, and then increments the position by two. +//uint8_t order, and then increments the position by two. // //Returns: //The short value at the buffer's current position @@ -243,17 +243,17 @@ void ByteBuffer::getShortArray(shortArray &s) } //Absolute put method (optional operation). -//Writes the given byte into this buffer at the given index. +//Writes the given uint8_t into this buffer at the given index. // //Parameters: -//index - The index at which the byte will be written -//b - The byte value to be written +//index - The index at which the uint8_t will be written +//b - The uint8_t value to be written //Returns: //This buffer //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit //ReadOnlyBufferException - If this buffer is read-only -ByteBuffer *ByteBuffer::put(int index, byte b) +ByteBuffer *ByteBuffer::put(int index, uint8_t b) { assert( index < m_limit ); assert( index >= 0 ); @@ -264,7 +264,7 @@ ByteBuffer *ByteBuffer::put(int index, byte b) //Relative put method for writing an int value (optional operation). -//Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, +//Writes four bytes containing the given int value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by four. // //Parameters: @@ -296,7 +296,7 @@ ByteBuffer *ByteBuffer::putInt(int value) } //Absolute put method for writing an int value (optional operation). -//Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index. +//Writes four bytes containing the given int value, in the current uint8_t order, into this buffer at the given index. // //Parameters: //index - The index at which the bytes will be written @@ -326,7 +326,7 @@ ByteBuffer *ByteBuffer::putInt(unsigned int index, int value) } //Relative put method for writing a short value (optional operation). -//Writes two bytes containing the given short value, in the current byte order, into this buffer at the current position, +//Writes two bytes containing the given short value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by two. // //Parameters: @@ -366,7 +366,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) } //Relative put method for writing a long value (optional operation). -//Writes eight bytes containing the given long value, in the current byte order, into this buffer at the current position, +//Writes eight bytes containing the given long value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by eight. // //Parameters: @@ -404,7 +404,7 @@ ByteBuffer *ByteBuffer::putLong(__int64 value) } //Relative bulk put method (optional operation). -//This method transfers the entire content of the given source byte array into this buffer. +//This method transfers the entire content of the given source uint8_t array into this buffer. //An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation // // dst.put(a, 0, a.length) @@ -427,7 +427,7 @@ byteArray ByteBuffer::array() return byteArray( buffer, m_capacity ); } -//Creates a view of this byte buffer as an int buffer. +//Creates a view of this uint8_t buffer as an int buffer. //The content of the new buffer will start at this buffer's current position. Changes to this buffer's content //will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent. // @@ -439,11 +439,11 @@ byteArray ByteBuffer::array() //A new int buffer IntBuffer *ByteBuffer::asIntBuffer() { - // TODO 4J Stu - Is it safe to just cast our byte array pointer to another type? + // TODO 4J Stu - Is it safe to just cast our uint8_t array pointer to another type? return new IntBuffer( (m_limit-m_position)/4, (int *) (buffer+m_position) ); } -//Creates a view of this byte buffer as a float buffer. +//Creates a view of this uint8_t buffer as a float buffer. //The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be //visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent. // @@ -455,7 +455,7 @@ IntBuffer *ByteBuffer::asIntBuffer() //A new float buffer FloatBuffer *ByteBuffer::asFloatBuffer() { - // TODO 4J Stu - Is it safe to just cast our byte array pointer to another type? + // TODO 4J Stu - Is it safe to just cast our uint8_t array pointer to another type? return new FloatBuffer( (m_limit-m_position)/4, (float *) (buffer+m_position) ); } @@ -464,9 +464,9 @@ FloatBuffer *ByteBuffer::asFloatBuffer() #ifdef __PS3__ // we're using the RSX now to upload textures to vram, so we need th main ram textures allocated from io space ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity ) - : ByteBuffer(capacity, (byte*)RenderManager.allocIOMem(capacity, 64)) + : ByteBuffer(capacity, (uint8_t*)RenderManager.allocIOMem(capacity, 64)) { - memset( buffer,0,sizeof(byte)*capacity); + memset( buffer,0,sizeof(uint8_t)*capacity); byteOrder = BIGENDIAN; } diff --git a/Minecraft.World/ByteBuffer.h b/Minecraft.World/ByteBuffer.h index 2d9363743..a00b1fba1 100644 --- a/Minecraft.World/ByteBuffer.h +++ b/Minecraft.World/ByteBuffer.h @@ -9,29 +9,29 @@ class FloatBuffer; class ByteBuffer : public Buffer { protected: - byte *buffer; + uint8_t *buffer; ByteOrder byteOrder; public: ByteBuffer(unsigned int capacity); static ByteBuffer *allocateDirect(int capacity); - ByteBuffer( unsigned int capacity, byte *backingArray ); + ByteBuffer( unsigned int capacity, uint8_t *backingArray ); virtual ~ByteBuffer(); static ByteBuffer *wrap(byteArray &b); static ByteBuffer *allocate(unsigned int capacity); void order(ByteOrder a); ByteBuffer *flip(); - byte *getBuffer(); + uint8_t *getBuffer(); int getSize(); int getInt(); int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO - byte get(int index); + uint8_t get(int index); __int64 getLong(); short getShort(); void getShortArray(shortArray &s); - ByteBuffer *put(int index, byte b); + ByteBuffer *put(int index, uint8_t b); ByteBuffer *putInt(int value); ByteBuffer *putInt(unsigned int index, int value); ByteBuffer *putShort(short value); diff --git a/Minecraft.World/ByteTag.h b/Minecraft.World/ByteTag.h index 6b319c0bb..313b41c67 100644 --- a/Minecraft.World/ByteTag.h +++ b/Minecraft.World/ByteTag.h @@ -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, int tagDepth) { data = dis->readByte(); } - byte getId() { return TAG_Byte; } + uint8_t getId() { return TAG_Byte; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/CanyonFeature.cpp b/Minecraft.World/CanyonFeature.cpp index 6d1dda64c..8f45ab38b 100644 --- a/Minecraft.World/CanyonFeature.cpp +++ b/Minecraft.World/CanyonFeature.cpp @@ -141,12 +141,12 @@ void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray bloc { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; } } } diff --git a/Minecraft.World/ChestTileEntity.cpp b/Minecraft.World/ChestTileEntity.cpp index b8f323f4f..4ed6fb726 100644 --- a/Minecraft.World/ChestTileEntity.cpp +++ b/Minecraft.World/ChestTileEntity.cpp @@ -157,7 +157,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); } diff --git a/Minecraft.World/ChunkTilesUpdatePacket.cpp b/Minecraft.World/ChunkTilesUpdatePacket.cpp index d90e6b2f0..f9f083094 100644 --- a/Minecraft.World/ChunkTilesUpdatePacket.cpp +++ b/Minecraft.World/ChunkTilesUpdatePacket.cpp @@ -24,7 +24,7 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket() count = 0; } -ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, byte count, Level *level) +ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, uint8_t count, Level *level) { shouldDelay = true; this->xc = xc; @@ -42,8 +42,8 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positi int y = (positions[i]) & 255; this->positions[i] = positions[i]; - blocks[i] = (byte) levelChunk->getTile(x, y, z); - data[i] = (byte) levelChunk->getData(x, y, z); + blocks[i] = (uint8_t) levelChunk->getTile(x, y, z); + data[i] = (uint8_t) levelChunk->getData(x, y, z); } levelIdx = ( ( level->dimension->id == 0 ) ? 0 : ( (level->dimension->id == -1) ? 1 : 2 ) ); } diff --git a/Minecraft.World/ChunkTilesUpdatePacket.h b/Minecraft.World/ChunkTilesUpdatePacket.h index a97f49a39..67fa10a43 100644 --- a/Minecraft.World/ChunkTilesUpdatePacket.h +++ b/Minecraft.World/ChunkTilesUpdatePacket.h @@ -12,12 +12,12 @@ public: shortArray positions; byteArray blocks; byteArray data; - byte count; // 4J Was int but never has a value higher than 10 + uint8_t count; // 4J Was int but never has a value higher than 10 int levelIdx; ChunkTilesUpdatePacket(); ~ChunkTilesUpdatePacket(); - ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, byte count, Level *level); + ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, uint8_t count, Level *level); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/ComplexItemDataPacket.cpp b/Minecraft.World/ComplexItemDataPacket.cpp index 38c39cb65..355af5f55 100644 --- a/Minecraft.World/ComplexItemDataPacket.cpp +++ b/Minecraft.World/ComplexItemDataPacket.cpp @@ -42,7 +42,7 @@ void ComplexItemDataPacket::write(DataOutputStream *dos) //throws IOException dos->writeShort(itemId); dos->writeUnsignedShort(data.length); - byteArray ba( (byte*)data.data, data.length ); + byteArray ba( (uint8_t*)data.data, data.length ); dos->write(ba); } diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h index f3a711d2d..98d2573a9 100644 --- a/Minecraft.World/CompoundTag.h +++ b/Minecraft.World/CompoundTag.h @@ -61,7 +61,7 @@ public: return ret; } - byte getId() + uint8_t getId() { return TAG_Compound; } @@ -71,7 +71,7 @@ public: tags[name] = tag->setName(name); } - void putByte(const wstring &name, byte value) + void putByte(const wstring &name, uint8_t value) { tags[name] = (new ByteTag(name,value)); } @@ -123,7 +123,7 @@ public: void putBoolean(const wstring &name, bool val) { - putByte(name, val?(byte)1:0); + putByte(name, val?(uint8_t)1:0); } Tag *get(const wstring &name) @@ -138,9 +138,9 @@ public: return tags.find(name) != tags.end(); } - byte getByte(const wstring &name) + uint8_t getByte(const wstring &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; } diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index 12c1ba3b7..8bf1cee6b 100644 --- a/Minecraft.World/CompressedTileStorage.cpp +++ b/Minecraft.World/CompressedTileStorage.cpp @@ -143,7 +143,7 @@ CompressedTileStorage::CompressedTileStorage(bool isEmpty) #endif } -bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) +bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 uint8_t range) { int block; unsigned short *blockIndices = (unsigned short *)indicesAndData; @@ -168,7 +168,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) return false; } - // Attempt to compare as much as we can in 64-byte chunks (8 groups of 8 bytes) + // Attempt to compare as much as we can in 64-uint8_t chunks (8 groups of 8 bytes) int quickCount = allocatedSize / 64; __int64 *pOld = (__int64 *)indicesAndData; __int64 *pNew = (__int64 *)other->indicesAndData; @@ -197,7 +197,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) pNew += 8; } - // Now test anything remaining just byte at a time + // Now test anything remaining just uint8_t at a time unsigned char *pucOld = (unsigned char *)pOld; unsigned char *pucNew = (unsigned char *)pNew; for( int i = 0; i < allocatedSize - (quickCount * 64); i++ ) @@ -376,7 +376,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) else { _blockIndices[i] = INDEX_TYPE_0_OR_8_BIT; - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; // type8++; } @@ -996,7 +996,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) else { _blockIndices[i] = INDEX_TYPE_0_OR_8_BIT; - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; } } @@ -1037,7 +1037,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) memToAlloc += 48; break; case INDEX_TYPE_0_OR_8_BIT: - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; break; // Note that INDEX_TYPE_8_BIT|INDEX_TYPE_0_BIT_FLAG not in here as it doesn't need any further allocation @@ -1169,7 +1169,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } else { - usDataOffset = (usDataOffset + 3 ) & 0xfffc; // Make sure offset is 4 byte aligned + usDataOffset = (usDataOffset + 3 ) & 0xfffc; // Make sure offset is 4 uint8_t aligned XMemCpy( pucData + usDataOffset, unpacked_data, 64 ); newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; usDataOffset += 64; diff --git a/Minecraft.World/CompressedTileStorage.h b/Minecraft.World/CompressedTileStorage.h index 3d4335477..7e7b5e469 100644 --- a/Minecraft.World/CompressedTileStorage.h +++ b/Minecraft.World/CompressedTileStorage.h @@ -25,8 +25,8 @@ // Some notes on the logic of all of this... // (1) Large numbers of blocks in the world really don't need to be stored at a full 8 bits per tile. // In a worst-case scenario, all planes would be 256 bytes and we'd have to store offsets of up to 32704 ( 64 x 511). This would require 15 bits per offset to store, but since in all cases -// the data can be stored with a 2 byte alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have -// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-byte aligned, and +// the data can be stored with a 2 uint8_t alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have +// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-uint8_t aligned, and // then use the extra bit to determine whether its a 0 or 8-bit per tile index. In the 0 bit case, we can use the bits used for the offset to store the actual tile value represented throughout the plane. // (2) The compression is done per 4x4x4 block rather than planes like the lighting, as that gives many more regions that have a small number of tile types than per plane, and can therefore // be compressed using less bits per tile. This is at the expense of a larger index, and more overhead from storing the tile types in each block (since there are more blocks than planes). However diff --git a/Minecraft.World/ConsoleSaveFileConverter.cpp b/Minecraft.World/ConsoleSaveFileConverter.cpp index 21de3cbea..51a6a0700 100644 --- a/Minecraft.World/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/ConsoleSaveFileConverter.cpp @@ -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); diff --git a/Minecraft.World/ConsoleSaveFileInputStream.cpp b/Minecraft.World/ConsoleSaveFileInputStream.cpp index 93d49956f..8e7e7d7ab 100644 --- a/Minecraft.World/ConsoleSaveFileInputStream.cpp +++ b/Minecraft.World/ConsoleSaveFileInputStream.cpp @@ -20,12 +20,12 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile m_saveFile->setFilePointer( m_file, 0, NULL, FILE_BEGIN ); } -//Reads a byte of data from this input stream. This method blocks if no input is yet available. +//Reads a uint8_t of data from this input stream. This method blocks if no input is yet available. //Returns: -//the next byte of data, or -1 if the end of the file is reached. +//the next uint8_t of data, or -1 if the end of the file is reached. int ConsoleSaveFileInputStream::read() { - byte byteRead = 0; + uint8_t byteRead = 0; DWORD numberOfBytesRead; BOOL result = m_saveFile->readFile( diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 3a2b5ef11..90bcbebdc 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -172,7 +172,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID Compression::getCompression()->SetDecompressionType(SAVE_FILE_PLATFORM_LOCAL); // and then set the decompression back to the local machine's standard type } - // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries + // Only ReAlloc if we need to (we might already have enough) and align to 512 uint8_t boundaries DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; DWORD desiredSize = decompSize; @@ -244,7 +244,7 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file ) const int bufferSize = 4096; int amountToRead = bufferSize; - byte buffer[bufferSize]; + uint8_t buffer[bufferSize]; DWORD bufferDataSize = 0; @@ -475,12 +475,12 @@ 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; - // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries + // Only ReAlloc if we need to (we might already have enough) and align to 512 uint8_t boundaries DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; DWORD desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; @@ -529,7 +529,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt uintptr_t uiFromStart = (uintptr_t)spaceStartOffset; uintptr_t uiFromEnd = (uintptr_t)beginEndOfDataOffset; - // Round both of these values to get 4096 byte chunks that we will need to at least partially move + // Round both of these values to get 4096 uint8_t chunks that we will need to at least partially move uintptr_t uiFromStartChunk = uiFromStart & ~((uintptr_t)4095); uintptr_t uiFromEndChunk = (uiFromEnd - 1 ) & ~((uintptr_t)4095); @@ -664,14 +664,14 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) // 4J Stu - Added TU-1 interim #ifdef __PS3__ - // 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 + // On PS3, don't compress the data as we can't really afford the extra memory this requirements 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. @@ -709,7 +709,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 diff --git a/Minecraft.World/ConsoleSaveFileOutputStream.cpp b/Minecraft.World/ConsoleSaveFileOutputStream.cpp index 3d8bb3f7c..0c714325f 100644 --- a/Minecraft.World/ConsoleSaveFileOutputStream.cpp +++ b/Minecraft.World/ConsoleSaveFileOutputStream.cpp @@ -31,14 +31,14 @@ ConsoleSaveFileOutputStream::ConsoleSaveFileOutputStream(ConsoleSaveFile *saveFi m_saveFile->setFilePointer( m_file, 0, NULL, FILE_BEGIN ); } -//Writes the specified byte to this file output stream. Implements the write method of OutputStream. +//Writes the specified uint8_t to this file output stream. Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. 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, @@ -57,7 +57,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b) } } -//Writes b.length bytes from the specified byte array to this file output stream. +//Writes b.length bytes from the specified uint8_t array to this file output stream. //Parameters: //b - the data. void ConsoleSaveFileOutputStream::write(byteArray b) @@ -81,7 +81,7 @@ void ConsoleSaveFileOutputStream::write(byteArray b) } } -//Writes len bytes from the specified byte array starting at offset off to this file output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this file output stream. //Parameters: //b - the data. //off - the start offset in the data. diff --git a/Minecraft.World/Creeper.cpp b/Minecraft.World/Creeper.cpp index 29be2c0ca..ac8a1d4ac 100644 --- a/Minecraft.World/Creeper.cpp +++ b/Minecraft.World/Creeper.cpp @@ -81,8 +81,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) @@ -90,13 +90,13 @@ void Creeper::addAdditonalSaveData(CompoundTag *entityTag) Monster::addAdditonalSaveData(entityTag); if (entityData->getByte(DATA_IS_POWERED) == 1) entityTag->putBoolean(L"powered", true); entityTag->putShort(L"Fuse", (short) maxSwell); - entityTag->putByte(L"ExplosionRadius", (byte) explosionRadius); + entityTag->putByte(L"ExplosionRadius", (uint8_t) explosionRadius); } 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)); if (tag->contains(L"Fuse")) maxSwell = tag->getShort(L"Fuse"); if (tag->contains(L"ExplosionRadius")) explosionRadius = tag->getByte(L"ExplosionRadius"); } @@ -182,11 +182,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); } diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 613162992..131b32692 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -204,11 +204,11 @@ void CustomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) // 4J - this comparison used to just be with 0.0f but is now varied by block above if (yc * CHUNK_HEIGHT + y < mapHeight) { - tileId = (byte) Tile::stone_Id; + tileId = (uint8_t) Tile::stone_Id; } else if (yc * CHUNK_HEIGHT + y < waterHeight) { - tileId = (byte) Tile::calmWater_Id; + tileId = (uint8_t) Tile::calmWater_Id; } // 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that @@ -266,8 +266,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi int run = -1; - byte top = b->topMaterial; - byte material = b->material; + uint8_t top = b->topMaterial; + uint8_t material = b->material; LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); if(lgo != NULL) @@ -290,7 +290,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in // if (y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -307,7 +307,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::stone_Id; + material = (uint8_t) Tile::stone_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -321,8 +321,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y < waterHeight && top == 0) { - if (temp < 0.15f) top = (byte) Tile::ice_Id; - else top = (byte) Tile::calmWater_Id; + if (temp < 0.15f) top = (uint8_t) Tile::ice_Id; + else top = (uint8_t) Tile::calmWater_Id; } run = runDepth; @@ -339,7 +339,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (run == 0 && material == Tile::sand_Id) { run = random->nextInt(4); - material = (byte) Tile::sandStone_Id; + material = (uint8_t) Tile::sandStone_Id; } } } @@ -368,7 +368,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs) // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int blocksSize = Level::maxBuildHeight * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,blocksSize); byteArray blocks = byteArray(tileData,blocksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/DataInput.h b/Minecraft.World/DataInput.h index 258b2717e..2b2e341c0 100644 --- a/Minecraft.World/DataInput.h +++ b/Minecraft.World/DataInput.h @@ -7,7 +7,7 @@ public: virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual bool readBoolean() = 0; - virtual byte readByte() = 0; + virtual uint8_t readByte() = 0; virtual unsigned char readUnsignedByte() = 0; virtual bool readFully(byteArray a) = 0; virtual double readDouble() = 0; diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index 97721c944..a7ce3d9d7 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -10,8 +10,8 @@ DataInputStream::DataInputStream(InputStream *in) : stream( in ) { } -//Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to 255. -//If no byte is available because the end of the stream has been reached, the value -1 is returned. +//Reads the next uint8_t of data from this input stream. The value uint8_t is returned as an int in the range 0 to 255. +//If no uint8_t is available because the end of the stream has been reached, the value -1 is returned. //This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. //This method simply performs in.read() and returns the result. int DataInputStream::read() @@ -23,10 +23,10 @@ int DataInputStream::read() //The number of bytes actually read is returned as an integer. This method blocks until input data is available, //end of file is detected, or an exception is thrown. //If b is null, a NullPointerException is thrown. If the length of b is zero, then no bytes are read and 0 is returned; -//otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, -//the value -1 is returned; otherwise, at least one byte is read and stored into b. +//otherwise, there is an attempt to read at least one uint8_t. If no uint8_t is available because the stream is at end of file, +//the value -1 is returned; otherwise, at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, at most, +//The first uint8_t read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, at most, //equal to the length of b. Let k be the number of bytes actually read; these bytes will be stored in elements b[0] through b[k-1], //leaving elements b[k] through b[b.length-1] unaffected. // @@ -49,10 +49,10 @@ int DataInputStream::read(byteArray b) //but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer. //This method blocks until input data is available, end of file is detected, or an exception is thrown. // -//If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. -//If no byte is available because the stream is at end of file, the value -1 is returned; otherwise, at least one byte is read and stored into b. +//If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one uint8_t. +//If no uint8_t is available because the stream is at end of file, the value -1 is returned; otherwise, at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, +//The first uint8_t read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, //at most, equal to len. Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], //leaving elements b[off+k] through b[off+len-1] unaffected. // @@ -77,8 +77,8 @@ void DataInputStream::close() stream->close(); } -//Reads one input byte and returns true if that byte is nonzero, false if that byte is zero. This method is suitable for reading -//the byte written by the writeBoolean method of interface DataOutput. +//Reads one input uint8_t and returns true if that uint8_t is nonzero, false if that uint8_t is zero. This method is suitable for reading +//the uint8_t written by the writeBoolean method of interface DataOutput. //Returns: //the boolean value read. bool DataInputStream::readBoolean() @@ -86,13 +86,13 @@ bool DataInputStream::readBoolean() return stream->read() != 0; } -//Reads and returns one input byte. The byte is treated as a signed value in the range -128 through 127, inclusive. -//This method is suitable for reading the byte written by the writeByte method of interface DataOutput. +//Reads and returns one input uint8_t. The uint8_t is treated as a signed value in the range -128 through 127, inclusive. +//This method is suitable for reading the uint8_t written by the writeByte method of interface DataOutput. //Returns: //the 8-bit value read. -byte DataInputStream::readByte() +uint8_t DataInputStream::readByte() { - return (byte) stream->read(); + return (uint8_t) stream->read(); } unsigned char DataInputStream::readUnsignedByte() @@ -100,7 +100,7 @@ unsigned char DataInputStream::readUnsignedByte() return (unsigned char) stream->read(); } -//Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is: +//Reads two input bytes and returns a char value. Let a be the first uint8_t read and b be the second uint8_t. The value returned is: //(char)((a << 8) | (b & 0xff)) // //This method is suitable for reading bytes written by the writeChar method of interface DataOutput. @@ -119,7 +119,7 @@ wchar_t DataInputStream::readChar() //b.length bytes of input data are available, in which case a normal return is made. //End of file is detected, in which case an EOFException is thrown. //An I/O error occurs, in which case an IOException other than EOFException is thrown. -//If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first byte read is +//If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first uint8_t read is //stored into element b[0], the next one into b[1], and so on. If an exception is thrown from this method, then it may be that some but //not all bytes of b have been updated with data from the input stream. // @@ -244,7 +244,7 @@ __int64 DataInputStream::readLong() return bits; } -//Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is: +//Reads two input bytes and returns a short value. Let a be the first uint8_t read and b be the second uint8_t. The value returned is: //(short)((a << 8) | (b & 0xff)) // //This method is suitable for reading the bytes written by the writeShort method of interface DataOutput. @@ -268,25 +268,25 @@ unsigned short DataInputStream::readUnsignedShort() //of a Unicode character string encoded in modified UTF-8 format; this string of characters is then returned as a String. //First, two bytes are read and used to construct an unsigned 16-bit integer in exactly the manner of the readUnsignedShort method . //This integer value is called the UTF length and specifies the number of additional bytes to be read. These bytes are then converted -//to characters by considering them in groups. The length of each group is computed from the value of the first byte of the group. -//The byte following a group, if any, is the first byte of the next group. +//to characters by considering them in groups. The length of each group is computed from the value of the first uint8_t of the group. +//The uint8_t following a group, if any, is the first uint8_t of the next group. // -//If the first byte of a group matches the bit pattern 0xxxxxxx (where x means "may be 0 or 1"), then the group consists of just that byte. -//The byte is zero-extended to form a character. +//If the first uint8_t of a group matches the bit pattern 0xxxxxxx (where x means "may be 0 or 1"), then the group consists of just that uint8_t. +//The uint8_t is zero-extended to form a character. // -//If the first byte of a group matches the bit pattern 110xxxxx, then the group consists of that byte a and a second byte b. -//If there is no byte b (because byte a was the last of the bytes to be read), or if byte b does not match the bit pattern 10xxxxxx, +//If the first uint8_t of a group matches the bit pattern 110xxxxx, then the group consists of that uint8_t a and a second uint8_t b. +//If there is no uint8_t b (because uint8_t a was the last of the bytes to be read), or if uint8_t b does not match the bit pattern 10xxxxxx, //then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // //(char)(((a& 0x1F) << 6) | (b & 0x3F)) // -//If the first byte of a group matches the bit pattern 1110xxxx, then the group consists of that byte a and two more bytes b and c. -//If there is no byte c (because byte a was one of the last two of the bytes to be read), or either byte b or byte c does not match the bit +//If the first uint8_t of a group matches the bit pattern 1110xxxx, then the group consists of that uint8_t a and two more bytes b and c. +//If there is no uint8_t c (because uint8_t a was one of the last two of the bytes to be read), or either uint8_t b or uint8_t c does not match the bit //pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // // (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)) // -//If the first byte of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown. +//If the first uint8_t of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown. //If end of file is encountered at any time during this entire process, then an EOFException is thrown. // //After every group has been converted to a character by this process, the characters are gathered, in the same order in which their @@ -330,11 +330,11 @@ wstring DataInputStream::readUTF() // 11110000 = 0xF0 // Match only highest four bits // Matching patterns: - // 10xxxxxx = 0x80 // ERROR, or second/third byte + // 10xxxxxx = 0x80 // ERROR, or second/third uint8_t // 1111xxxx = 0xF0 //ERROR - // 0xxxxxxx = 0x00 // One byte UTF - // 110xxxxx = 0xC0 // Two byte UTF - // 1110xxxx = 0xE0 // Three byte UTF + // 0xxxxxxx = 0x00 // One uint8_t UTF + // 110xxxxx = 0xC0 // Two uint8_t UTF + // 1110xxxx = 0xE0 // Three uint8_t UTF if( ( (firstByte & 0xC0 ) == 0x80 ) || ( (firstByte & 0xF0) == 0xF0) ) { // TODO 4J Stu - UTFDataFormatException @@ -342,14 +342,14 @@ wstring DataInputStream::readUTF() } else if( (firstByte & 0x80) == 0x00 ) { - // One byte UTF + // One uint8_t UTF wchar_t readChar = (wchar_t)firstByte; outputString.push_back( readChar ); continue; } else if( (firstByte & 0xE0) == 0xC0 ) { - // Two byte UTF + // Two uint8_t UTF // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -361,13 +361,13 @@ wstring DataInputStream::readUTF() int secondByte = stream->read(); currentByteIndex++; - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException break; } - // Incorrect second byte pattern + // Incorrect second uint8_t pattern else if( (secondByte & 0xC0 ) != 0x80 ) { // TODO 4J Stu - UTFDataFormatException @@ -380,7 +380,7 @@ wstring DataInputStream::readUTF() } else if( (firstByte & 0xF0) == 0xE0 ) { - // Three byte UTF + // Three uint8_t UTF // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -392,7 +392,7 @@ wstring DataInputStream::readUTF() int secondByte = stream->read(); currentByteIndex++; - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException @@ -409,13 +409,13 @@ wstring DataInputStream::readUTF() int thirdByte = stream->read(); currentByteIndex++; - // No third byte + // No third uint8_t if( thirdByte == -1 ) { // TODO 4J Stu - EOFException break; } - // Incorrect second or third byte pattern + // Incorrect second or third uint8_t pattern else if( ( (secondByte & 0xC0 ) != 0x80 ) || ( (thirdByte & 0xC0 ) != 0x80 ) ) { // TODO 4J Stu - UTFDataFormatException @@ -447,11 +447,11 @@ int DataInputStream::readUTFChar() // 11110000 = 0xF0 // Match only highest four bits // Matching patterns: - // 10xxxxxx = 0x80 // ERROR, or second/third byte + // 10xxxxxx = 0x80 // ERROR, or second/third uint8_t // 1111xxxx = 0xF0 //ERROR - // 0xxxxxxx = 0x00 // One byte UTF - // 110xxxxx = 0xC0 // Two byte UTF - // 1110xxxx = 0xE0 // Three byte UTF + // 0xxxxxxx = 0x00 // One uint8_t UTF + // 110xxxxx = 0xC0 // Two uint8_t UTF + // 1110xxxx = 0xE0 // Three uint8_t UTF if( ( (firstByte & 0xC0 ) == 0x80 ) || ( (firstByte & 0xF0) == 0xF0) ) { // TODO 4J Stu - UTFDataFormatException @@ -459,21 +459,21 @@ int DataInputStream::readUTFChar() } else if( (firstByte & 0x80) == 0x00 ) { - // One byte UTF + // One uint8_t UTF returnValue = firstByte; } else if( (firstByte & 0xE0) == 0xC0 ) { - // Two byte UTF + // Two uint8_t UTF int secondByte = stream->read(); - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException return returnValue; } - // Incorrect second byte pattern + // Incorrect second uint8_t pattern else if( (secondByte & 0xC0 ) != 0x80 ) { // TODO 4J Stu - UTFDataFormatException @@ -484,11 +484,11 @@ int DataInputStream::readUTFChar() } else if( (firstByte & 0xF0) == 0xE0 ) { - // Three byte UTF + // Three uint8_t UTF int secondByte = stream->read(); - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException @@ -497,13 +497,13 @@ int DataInputStream::readUTFChar() int thirdByte = stream->read(); - // No third byte + // No third uint8_t if( thirdByte == -1 ) { // TODO 4J Stu - EOFException return returnValue; } - // Incorrect second or third byte pattern + // Incorrect second or third uint8_t pattern else if( ( (secondByte & 0xC0 ) != 0x80 ) || ( (thirdByte & 0xC0 ) != 0x80 ) ) { // TODO 4J Stu - UTFDataFormatException diff --git a/Minecraft.World/DataInputStream.h b/Minecraft.World/DataInputStream.h index 0b228a0d1..bf96d1026 100644 --- a/Minecraft.World/DataInputStream.h +++ b/Minecraft.World/DataInputStream.h @@ -16,7 +16,7 @@ public: virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); virtual bool readBoolean(); - virtual byte readByte(); + virtual uint8_t readByte(); virtual unsigned char readUnsignedByte(); virtual unsigned short readUnsignedShort(); virtual wchar_t readChar(); diff --git a/Minecraft.World/DataLayer.cpp b/Minecraft.World/DataLayer.cpp index a5e7d0881..335f9ca59 100644 --- a/Minecraft.World/DataLayer.cpp +++ b/Minecraft.World/DataLayer.cpp @@ -40,10 +40,10 @@ void DataLayer::set(int x, int y, int z, int val) if (part == 0) { - data[slot] = (byte) ((data[slot] & 0xf0) | (val & 0xf)); + data[slot] = (uint8_t) ((data[slot] & 0xf0) | (val & 0xf)); } else { - data[slot] = (byte) ((data[slot] & 0x0f) | ((val & 0xf) << 4)); + data[slot] = (uint8_t) ((data[slot] & 0x0f) | ((val & 0xf) << 4)); } } @@ -54,7 +54,7 @@ bool DataLayer::isValid() void DataLayer::setAll(int br) { - byte val = (byte) (br & (br << 4)); + uint8_t val = (uint8_t) (br & (br << 4)); for (unsigned int i = 0; i < data.length; i++) { data[i] = val; diff --git a/Minecraft.World/DataOutput.h b/Minecraft.World/DataOutput.h index 648be6df2..9df3dd957 100644 --- a/Minecraft.World/DataOutput.h +++ b/Minecraft.World/DataOutput.h @@ -6,7 +6,7 @@ public: virtual void write(unsigned int b) = 0; virtual void write(byteArray b) = 0; virtual void write(byteArray b, unsigned int offset, unsigned int length) = 0; - virtual void writeByte(byte a) = 0; + virtual void writeByte(uint8_t a) = 0; virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; diff --git a/Minecraft.World/DataOutputStream.cpp b/Minecraft.World/DataOutputStream.cpp index 8d350f0b5..363a7dba5 100644 --- a/Minecraft.World/DataOutputStream.cpp +++ b/Minecraft.World/DataOutputStream.cpp @@ -17,11 +17,11 @@ void DataOutputStream::deleteChildStream() delete stream; } -//Writes the specified byte (the low eight bits of the argument b) to the underlying output stream. +//Writes the specified uint8_t (the low eight bits of the argument b) to the underlying output stream. //If no exception is thrown, the counter written is incremented by 1. //Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void DataOutputStream::write(unsigned int b) { stream->write( b ); @@ -34,7 +34,7 @@ void DataOutputStream::flush() stream->flush(); } -//Writes b.length bytes from the specified byte array to this output stream. +//Writes b.length bytes from the specified uint8_t array to this output stream. //The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length). //Parameters: //b - the data. @@ -43,7 +43,7 @@ void DataOutputStream::write(byteArray b) write(b, 0, b.length); } -//Writes len bytes from the specified byte array starting at offset off to the underlying output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to the underlying output stream. //If no exception is thrown, the counter written is incremented by len. //Parameters: //b - the data. @@ -63,17 +63,17 @@ void DataOutputStream::close() stream->close(); } -//Writes out a byte to the underlying output stream as a 1-byte value. If no exception is thrown, the counter written is incremented by 1. +//Writes out a uint8_t to the underlying output stream as a 1-uint8_t value. If no exception is thrown, the counter written is incremented by 1. //Parameters: -//v - a byte value to be written. -void DataOutputStream::writeByte(byte a) +//v - a uint8_t value to be written. +void DataOutputStream::writeByte(uint8_t a) { stream->write( a ); } //Converts the double argument to a long using the doubleToLongBits method in class Double, -//and then writes that long value to the underlying output stream as an 8-byte quantity, -//high byte first. If no exception is thrown, the counter written is incremented by 8. +//and then writes that long value to the underlying output stream as an 8-uint8_t quantity, +//high uint8_t first. If no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a double value to be written. void DataOutputStream::writeDouble(double a) @@ -86,7 +86,7 @@ void DataOutputStream::writeDouble(double a) } //Converts the float argument to an int using the floatToIntBits method in class Float, -//and then writes that int value to the underlying output stream as a 4-byte quantity, high byte first. +//and then writes that int value to the underlying output stream as a 4-uint8_t quantity, high uint8_t first. //If no exception is thrown, the counter written is incremented by 4. //Parameters: //v - a float value to be written. @@ -99,7 +99,7 @@ void DataOutputStream::writeFloat(float a) written += 4; } -//Writes an int to the underlying output stream as four bytes, high byte first. If no exception is thrown, the counter written is incremented by 4. +//Writes an int to the underlying output stream as four bytes, high uint8_t first. If no exception is thrown, the counter written is incremented by 4. //Parameters: //v - an int to be written. void DataOutputStream::writeInt(int a) @@ -112,7 +112,7 @@ void DataOutputStream::writeInt(int a) written += 4; } -//Writes a long to the underlying output stream as eight bytes, high byte first. +//Writes a long to the underlying output stream as eight bytes, high uint8_t first. //In no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a long to be written. @@ -130,7 +130,7 @@ void DataOutputStream::writeLong(__int64 a) written += 4; } -//Writes a short to the underlying output stream as two bytes, high byte first. +//Writes a short to the underlying output stream as two bytes, high uint8_t first. //If no exception is thrown, the counter written is incremented by 2. //Parameters: //v - a short to be written. @@ -150,7 +150,7 @@ void DataOutputStream::writeUnsignedShort(unsigned short a) written += 2; } -//Writes a char to the underlying output stream as a 2-byte value, high byte first. +//Writes a char to the underlying output stream as a 2-uint8_t value, high uint8_t first. //If no exception is thrown, the counter written is incremented by 2. //Parameters: //v - a char value to be written. @@ -177,14 +177,14 @@ void DataOutputStream::writeChars(const wstring& str) // Incrementing handled by the writeChar function } -//Writes a boolean to the underlying output stream as a 1-byte value. -//The value true is written out as the value (byte)1; the value false is written out as the value (byte)0. +//Writes a boolean to the underlying output stream as a 1-uint8_t value. +//The value true is written out as the value (uint8_t)1; the value false is written out as the value (uint8_t)0. //If no exception is thrown, the counter written is incremented by 1. //Parameters: //v - a boolean value to be written. void DataOutputStream::writeBoolean(bool b) { - stream->write( b ? (byte)1 : (byte)0 ); + stream->write( b ? (uint8_t)1 : (uint8_t)0 ); // TODO 4J Stu - Error handling? written += 1; } @@ -227,15 +227,15 @@ void DataOutputStream::writeUTF(const wstring& str) byteArray bytearr(utflen+2); - bytearr[count++] = (byte) ((utflen >> 8) & 0xFF); - bytearr[count++] = (byte) ((utflen >> 0) & 0xFF); + bytearr[count++] = (uint8_t) ((utflen >> 8) & 0xFF); + bytearr[count++] = (uint8_t) ((utflen >> 0) & 0xFF); int i=0; for (i=0; i= 0x0001) && (c <= 0x007F))) break; - bytearr[count++] = (byte) c; + bytearr[count++] = (uint8_t) c; } for (;i < strlen; i++) @@ -243,19 +243,19 @@ void DataOutputStream::writeUTF(const wstring& str) c = str.at(i); if ((c >= 0x0001) && (c <= 0x007F)) { - bytearr[count++] = (byte) c; + bytearr[count++] = (uint8_t) c; } else if (c > 0x07FF) { - bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); - bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); + bytearr[count++] = (uint8_t) (0xE0 | ((c >> 12) & 0x0F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 6) & 0x3F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 0) & 0x3F)); } else { - bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); + bytearr[count++] = (uint8_t) (0xC0 | ((c >> 6) & 0x1F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 0) & 0x3F)); } } write(bytearr, 0, utflen+2); diff --git a/Minecraft.World/DataOutputStream.h b/Minecraft.World/DataOutputStream.h index 8a8c0e125..ceb71377d 100644 --- a/Minecraft.World/DataOutputStream.h +++ b/Minecraft.World/DataOutputStream.h @@ -22,7 +22,7 @@ public: virtual void write(byteArray b); virtual void write(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual void writeByte(byte a); + virtual void writeByte(uint8_t a); virtual void writeDouble(double a); virtual void writeFloat(float a); virtual void writeInt(int a); diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index facd949af..b74257693 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #endif - ZeroMemory(dimensions,sizeof(byte)*(MAXIMUM_MAP_SAVE_DATA/4)); + ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/4)); } int _MapDataMappings::getDimension(int id) @@ -84,7 +84,7 @@ _MapDataMappings_old::_MapDataMappings_old() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #endif - ZeroMemory(dimensions,sizeof(byte)*(MAXIMUM_MAP_SAVE_DATA/8)); + ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/8)); } int _MapDataMappings_old::getDimension(int id) diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index 3c811ef3f..464eb8a3b 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -36,7 +36,7 @@ class ConsoleSaveFile; typedef struct _MapDataMappings { PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA]; - byte dimensions[MAXIMUM_MAP_SAVE_DATA/4]; + uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/4]; _MapDataMappings(); int getDimension(int id); @@ -47,7 +47,7 @@ typedef struct _MapDataMappings typedef struct _MapDataMappings_old { PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA]; - byte dimensions[MAXIMUM_MAP_SAVE_DATA/8]; + uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/8]; _MapDataMappings_old(); int getDimension(int id); diff --git a/Minecraft.World/DispenserTileEntity.cpp b/Minecraft.World/DispenserTileEntity.cpp index 3e743e22e..685ca4bea 100644 --- a/Minecraft.World/DispenserTileEntity.cpp +++ b/Minecraft.World/DispenserTileEntity.cpp @@ -189,7 +189,7 @@ void DispenserTileEntity::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); } diff --git a/Minecraft.World/DoubleTag.h b/Minecraft.World/DoubleTag.h index 1f768d5bf..35bd555e8 100644 --- a/Minecraft.World/DoubleTag.h +++ b/Minecraft.World/DoubleTag.h @@ -12,7 +12,7 @@ public: void write(DataOutput *dos) { dos->writeDouble(data); } void load(DataInput *dis, int tagDepth) { data = dis->readDouble(); } - byte getId() { return TAG_Double; } + uint8_t getId() { return TAG_Double; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/DungeonFeature.cpp b/Minecraft.World/DungeonFeature.cpp index 6c7dc6733..d8b37cd09 100644 --- a/Minecraft.World/DungeonFeature.cpp +++ b/Minecraft.World/DungeonFeature.cpp @@ -142,12 +142,12 @@ void DungeonFeature::addTunnel(int xOffs, int zOffs, byteArray blocks, double xC { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) Tile::grass_Id; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) Tile::grass_Id; } } } diff --git a/Minecraft.World/DurangoStats.cpp b/Minecraft.World/DurangoStats.cpp index 6e50fd20d..40b8cec70 100644 --- a/Minecraft.World/DurangoStats.cpp +++ b/Minecraft.World/DurangoStats.cpp @@ -193,7 +193,7 @@ byteArray DsItemEvent::createParamBlob(eAcquisitionMethod eMethod, int itemId, i { byteArray output; Param param = { eMethod, itemId, itemAux, itemCount }; - output.data = (byte *) new Param(param); + output.data = (uint8_t *) new Param(param); output.length = sizeof(Param); return output; } @@ -292,7 +292,7 @@ byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptrdistanceTo(player->x, player->y, player->z), 0/*not needed*/ }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -307,7 +307,7 @@ byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptrdistanceTo(player->x, player->y, player->z), 0/*not needed*/ }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -346,7 +346,7 @@ byteArray DsMobInteract::createParamBlob(eInteract interactionId, int entityId) { byteArray output; Param param = { interactionId, EntityIO::eTypeToIoid((eINSTANCEOF)entityId) }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -394,7 +394,7 @@ byteArray DsTravel::createParamBlob(eMethod method, int distance) { byteArray output; Param param = { method, distance }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -508,7 +508,7 @@ byteArray DsItemUsed::createParamBlob(int itemId, int aux, int count, int health { byteArray output; Param param = { itemId, aux, count, health, hunger }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -595,7 +595,7 @@ byteArray DsAchievement::createSmallParamBlob(eAward award) { byteArray output; SmallParam param = { award }; - output.data = (byte*) new SmallParam(param); + output.data = (uint8_t*) new SmallParam(param); output.length = sizeof(SmallParam); return output; } @@ -604,7 +604,7 @@ byteArray DsAchievement::createLargeParamBlob(eAward award, int count) { byteArray output; LargeParam param = { award, count }; - output.data = (byte*) new LargeParam(param); + output.data = (uint8_t*) new LargeParam(param); output.length = sizeof(LargeParam); return output; } @@ -632,7 +632,7 @@ byteArray DsChangedDimension::createParamBlob(int fromDimId, int toDimId) { byteArray output; Param param = { fromDimId, toDimId }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -663,7 +663,7 @@ byteArray DsEnteredBiome::createParamBlob(int biomeId) { byteArray output; Param param = { biomeId }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp index 1353ca4d1..7cc0a04cd 100644 --- a/Minecraft.World/EmptyLevelChunk.cpp +++ b/Minecraft.World/EmptyLevelChunk.cpp @@ -189,7 +189,7 @@ int EmptyLevelChunk::getBlocksAndData(byteArray data, int x0, int y0, int z0, in } - Arrays::fill(data, p, p + len, (byte) 0); + Arrays::fill(data, p, p + len, (uint8_t) 0); return len; } diff --git a/Minecraft.World/EmptyMapItem.cpp b/Minecraft.World/EmptyMapItem.cpp index 42adc3048..422a61d6e 100644 --- a/Minecraft.World/EmptyMapItem.cpp +++ b/Minecraft.World/EmptyMapItem.cpp @@ -19,7 +19,7 @@ shared_ptr EmptyMapItem::use(shared_ptr itemInstance //int scale = MapItemSavedData.MAP_SIZE * 2 * (1 << data.scale); //data.x = (int) (Math.round(player.x / scale) * scale); //data.z = (int) (Math.round(player.z / scale) * scale); - //data.dimension = (byte) level.dimension.id; + //data.dimension = (uint8_t) level.dimension.id; //data.setDirty(); diff --git a/Minecraft.World/EndTag.h b/Minecraft.World/EndTag.h index 2815a5770..fb58e3d99 100644 --- a/Minecraft.World/EndTag.h +++ b/Minecraft.World/EndTag.h @@ -10,7 +10,7 @@ public: void load(DataInput *dis, int tagDepth) {}; void write(DataOutput *dos) {}; - byte getId() { return TAG_End; } + uint8_t getId() { return TAG_End; } wstring toString() { return wstring( L"END" ); } Tag *copy() diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp index d099911c0..165bf04d5 100644 --- a/Minecraft.World/EnderMan.cpp +++ b/Minecraft.World/EnderMan.cpp @@ -67,9 +67,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) @@ -385,7 +385,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() @@ -395,7 +395,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() @@ -435,5 +435,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)); } \ No newline at end of file diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index e82331402..2d4432fb9 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -362,7 +362,7 @@ Entity::Entity(Level *level, bool useSmallId) // 4J - added useSmallId parameter if( entityData ) { - 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. } @@ -1711,7 +1711,7 @@ void Entity::lerpMotion(double xd, double yd, double zd) this->zd = zd; } -void Entity::handleEntityEvent(byte eventId) +void Entity::handleEntityEvent(uint8_t eventId) { } @@ -1820,14 +1820,14 @@ void Entity::setSharedFlag(int flag, bool value) { if( entityData ) { - 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))); } } } diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index a738c2ba7..1d3e5337a 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -329,7 +329,7 @@ public: virtual void handleInsidePortal(); virtual int getDimensionChangingDelay(); virtual void lerpMotion(double xd, double yd, double zd); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void animateHurt(); virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[] virtual void setEquippedSlot(int slot, shared_ptr item); // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game diff --git a/Minecraft.World/EntityEventPacket.cpp b/Minecraft.World/EntityEventPacket.cpp index e92d76926..fec293898 100644 --- a/Minecraft.World/EntityEventPacket.cpp +++ b/Minecraft.World/EntityEventPacket.cpp @@ -12,7 +12,7 @@ EntityEventPacket::EntityEventPacket() eventId = 0; } -EntityEventPacket::EntityEventPacket(int entityId, byte eventId) +EntityEventPacket::EntityEventPacket(int entityId, uint8_t eventId) { this->entityId = entityId; this->eventId = eventId; diff --git a/Minecraft.World/EntityEventPacket.h b/Minecraft.World/EntityEventPacket.h index a151dbdb4..716be4e4f 100644 --- a/Minecraft.World/EntityEventPacket.h +++ b/Minecraft.World/EntityEventPacket.h @@ -7,10 +7,10 @@ class EntityEventPacket : public Packet, public enable_shared_from_thisdefine(DATA_ID_HORSE_FLAGS, 0); - entityData->define(DATA_ID_TYPE, (byte) 0); + entityData->define(DATA_ID_TYPE, (uint8_t) 0); entityData->define(DATA_ID_TYPE_VARIANT, 0); entityData->define(DATA_ID_OWNER_NAME, L""); entityData->define(DATA_ID_ARMOR, 0); @@ -108,7 +108,7 @@ void EntityHorse::defineSynchedData() void EntityHorse::setType(int i) { - entityData->set(DATA_ID_TYPE, (byte) i); + entityData->set(DATA_ID_TYPE, (uint8_t) i); clearLayeredTextureInfo(); } @@ -1459,7 +1459,7 @@ void EntityHorse::addAdditonalSaveData(CompoundTag *tag) { CompoundTag *compoundTag = new CompoundTag(); - compoundTag->putByte(L"Slot", (byte) i); + compoundTag->putByte(L"Slot", (uint8_t) i); stack->save(compoundTag); listTag->add(compoundTag); @@ -1762,7 +1762,7 @@ void EntityHorse::spawnTamingParticles(bool success) } } -void EntityHorse::handleEntityEvent(byte id) +void EntityHorse::handleEntityEvent(uint8_t id) { if (id == EntityEvent::TAMING_SUCCEEDED) { diff --git a/Minecraft.World/EntityHorse.h b/Minecraft.World/EntityHorse.h index c2784491a..8a7a9ce57 100644 --- a/Minecraft.World/EntityHorse.h +++ b/Minecraft.World/EntityHorse.h @@ -316,7 +316,7 @@ protected: virtual void spawnTamingParticles(bool success); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual void positionRider(); private: diff --git a/Minecraft.World/ExperienceOrb.cpp b/Minecraft.World/ExperienceOrb.cpp index 9fed6d71b..55899041e 100644 --- a/Minecraft.World/ExperienceOrb.cpp +++ b/Minecraft.World/ExperienceOrb.cpp @@ -176,7 +176,7 @@ bool ExperienceOrb::hurt(DamageSource *source, float 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); } diff --git a/Minecraft.World/FallingTile.cpp b/Minecraft.World/FallingTile.cpp index c0eb7d226..59c832386 100644 --- a/Minecraft.World/FallingTile.cpp +++ b/Minecraft.World/FallingTile.cpp @@ -212,10 +212,10 @@ void FallingTile::causeFallDamage(float distance) void FallingTile::addAdditonalSaveData(CompoundTag *tag) { - tag->putByte(L"Tile", (byte) tile); + tag->putByte(L"Tile", (uint8_t) tile); tag->putInt(L"TileID", tile); - tag->putByte(L"Data", (byte) data); - tag->putByte(L"Time", (byte) time); + 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); diff --git a/Minecraft.World/FastNoise.cpp b/Minecraft.World/FastNoise.cpp index 91d039b3f..a6c7fbd42 100644 --- a/Minecraft.World/FastNoise.cpp +++ b/Minecraft.World/FastNoise.cpp @@ -15,10 +15,10 @@ FastNoise::FastNoise(Random *random, int levels) void FastNoise::init(Random *random, int levels) { this->levels = levels; - noiseMaps = new byte *[levels]; + noiseMaps = new uint8_t *[levels]; for (int i = 0; i < levels; i++) { - noiseMaps[i] = new byte[0x100000]; + noiseMaps[i] = new uint8_t[0x100000]; random->nextBytes(noiseMaps[i],0x100000); } } @@ -44,7 +44,7 @@ doubleArray FastNoise::getRegion(doubleArray buffer, double x, double y, double int BB = 21771; for (int i = 0; i < levels; i++) { - byte *map = noiseMaps[i]; + uint8_t *map = noiseMaps[i]; int pp = 0; for (int zp = 0; zp < zSize; zp++) diff --git a/Minecraft.World/FastNoise.h b/Minecraft.World/FastNoise.h index f41c32e83..e3bd991b3 100644 --- a/Minecraft.World/FastNoise.h +++ b/Minecraft.World/FastNoise.h @@ -3,7 +3,7 @@ class FastNoise { private: - byte **noiseMaps; + uint8_t **noiseMaps; int levels; public: diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp index 7c0e844f0..858f5d3b0 100644 --- a/Minecraft.World/FileInputStream.cpp +++ b/Minecraft.World/FileInputStream.cpp @@ -55,12 +55,12 @@ FileInputStream::~FileInputStream() CloseHandle( m_fileHandle ); } -//Reads a byte of data from this input stream. This method blocks if no input is yet available. +//Reads a uint8_t of data from this input stream. This method blocks if no input is yet available. //Returns: -//the next byte of data, or -1 if the end of the file is reached. +//the next uint8_t of data, or -1 if the end of the file is reached. int FileInputStream::read() { - byte byteRead = 0; + uint8_t byteRead = 0; DWORD numberOfBytesRead; BOOL bSuccess = ReadFile( diff --git a/Minecraft.World/FileOutputStream.cpp b/Minecraft.World/FileOutputStream.cpp index 557ba812d..0f07f3c19 100644 --- a/Minecraft.World/FileOutputStream.cpp +++ b/Minecraft.World/FileOutputStream.cpp @@ -54,14 +54,14 @@ FileOutputStream::~FileOutputStream() CloseHandle( m_fileHandle ); } -//Writes the specified byte to this file output stream. Implements the write method of OutputStream. +//Writes the specified uint8_t to this file output stream. Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void FileOutputStream::write(unsigned int b) { DWORD numberOfBytesWritten; - byte value = (byte) b; + uint8_t value = (uint8_t) b; BOOL result = WriteFile( m_fileHandle, // handle to file @@ -81,7 +81,7 @@ void FileOutputStream::write(unsigned int b) } } -//Writes b.length bytes from the specified byte array to this file output stream. +//Writes b.length bytes from the specified uint8_t array to this file output stream. //Parameters: //b - the data. void FileOutputStream::write(byteArray b) @@ -106,7 +106,7 @@ void FileOutputStream::write(byteArray b) } } -//Writes len bytes from the specified byte array starting at offset off to this file output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this file output stream. //Parameters: //b - the data. //off - the start offset in the data. diff --git a/Minecraft.World/Fireball.cpp b/Minecraft.World/Fireball.cpp index 2a538b064..1adb9b31a 100644 --- a/Minecraft.World/Fireball.cpp +++ b/Minecraft.World/Fireball.cpp @@ -300,8 +300,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", newDoubleList(3, xd, yd, zd)); } diff --git a/Minecraft.World/FireworksChargeItem.cpp b/Minecraft.World/FireworksChargeItem.cpp index 2de2be045..e460a3336 100644 --- a/Minecraft.World/FireworksChargeItem.cpp +++ b/Minecraft.World/FireworksChargeItem.cpp @@ -110,7 +110,7 @@ const unsigned int FIREWORKS_CHARGE_COLOUR_NAME[] = void FireworksChargeItem::appendHoverText(CompoundTag *expTag, vector *lines) { // shape - byte type = expTag->getByte(FireworksItem::TAG_E_TYPE); + uint8_t type = expTag->getByte(FireworksItem::TAG_E_TYPE); if (type >= FireworksItem::TYPE_MIN && type <= FireworksItem::TYPE_MAX) { lines->push_back(HtmlString(app.GetString(FIREWORKS_CHARGE_TYPE_NAME[type]))); diff --git a/Minecraft.World/FireworksItem.h b/Minecraft.World/FireworksItem.h index afc6cb594..d077db5de 100644 --- a/Minecraft.World/FireworksItem.h +++ b/Minecraft.World/FireworksItem.h @@ -15,14 +15,14 @@ public: static const wstring TAG_E_COLORS; static const wstring TAG_E_FADECOLORS; - static const byte TYPE_SMALL = 0; - static const byte TYPE_BIG = 1; - static const byte TYPE_STAR = 2; - static const byte TYPE_CREEPER = 3; - static const byte TYPE_BURST = 4; + static const uint8_t TYPE_SMALL = 0; + static const uint8_t TYPE_BIG = 1; + static const uint8_t TYPE_STAR = 2; + static const uint8_t TYPE_CREEPER = 3; + static const uint8_t TYPE_BURST = 4; - static const byte TYPE_MIN = TYPE_SMALL; - static const byte TYPE_MAX = TYPE_BURST; + static const uint8_t TYPE_MIN = TYPE_SMALL; + static const uint8_t TYPE_MAX = TYPE_BURST; FireworksItem(int id); diff --git a/Minecraft.World/FireworksRecipe.cpp b/Minecraft.World/FireworksRecipe.cpp index a357c9cbc..d431eb058 100644 --- a/Minecraft.World/FireworksRecipe.cpp +++ b/Minecraft.World/FireworksRecipe.cpp @@ -143,7 +143,7 @@ bool FireworksRecipe::matches(shared_ptr craftSlots, Level *l } fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags); - fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphurCount); + fireTag->putByte(FireworksItem::TAG_FLIGHT, (uint8_t) sulphurCount); itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag); resultItem->setTag(itemTag); @@ -159,7 +159,7 @@ bool FireworksRecipe::matches(shared_ptr craftSlots, Level *l CompoundTag *itemTag = new CompoundTag(); CompoundTag *expTag = new CompoundTag(FireworksItem::TAG_EXPLOSION); - byte type = 0; + uint8_t type = 0; vector colors; for (int slot = 0; slot < craftSlots->getContainerSize(); slot++) diff --git a/Minecraft.World/FireworksRecipe.h b/Minecraft.World/FireworksRecipe.h index ef2815ea9..d58b594d0 100644 --- a/Minecraft.World/FireworksRecipe.h +++ b/Minecraft.World/FireworksRecipe.h @@ -37,8 +37,8 @@ public: virtual const int getGroup() { return 0; } // 4J-PB - virtual bool requires(int iRecipe) { return false; }; - virtual void requires(INGREDIENTS_REQUIRED *pIngReq) {}; + virtual bool requirements(int iRecipe) { return false; }; + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq) {}; // 4J Added static void updatePossibleRecipes(shared_ptr craftSlots, bool *firework, bool *charge, bool *fade); diff --git a/Minecraft.World/FireworksRocketEntity.cpp b/Minecraft.World/FireworksRocketEntity.cpp index e84844f12..7c9ebc9ed 100644 --- a/Minecraft.World/FireworksRocketEntity.cpp +++ b/Minecraft.World/FireworksRocketEntity.cpp @@ -115,7 +115,7 @@ void FireworksRocketEntity::tick() } } -void FireworksRocketEntity::handleEntityEvent(byte eventId) +void FireworksRocketEntity::handleEntityEvent(uint8_t eventId) { if (eventId == EntityEvent::FIREWORKS_EXPLODE && level->isClientSide) { diff --git a/Minecraft.World/FireworksRocketEntity.h b/Minecraft.World/FireworksRocketEntity.h index 025a2778f..a28089394 100644 --- a/Minecraft.World/FireworksRocketEntity.h +++ b/Minecraft.World/FireworksRocketEntity.h @@ -28,7 +28,7 @@ public: virtual void lerpMotion(double xd, double yd, double zd); virtual void tick(); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); virtual float getShadowHeightOffs(); diff --git a/Minecraft.World/FishingHook.cpp b/Minecraft.World/FishingHook.cpp index e38a64b6a..9b496d06a 100644 --- a/Minecraft.World/FishingHook.cpp +++ b/Minecraft.World/FishingHook.cpp @@ -380,9 +380,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) diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp index 7a31374eb..a85badcef 100644 --- a/Minecraft.World/FlatLevelSource.cpp +++ b/Minecraft.World/FlatLevelSource.cpp @@ -55,7 +55,7 @@ void FlatLevelSource::prepareHeights(byteArray blocks) { block = Tile::grass_Id; } - blocks[xc << 11 | zc << 7 | yc] = (byte) block; + blocks[xc << 11 | zc << 7 | yc] = (uint8_t) block; } } } @@ -70,7 +70,7 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) { // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int chunksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,chunksSize); byteArray blocks = byteArray(tileData,chunksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/FloatTag.h b/Minecraft.World/FloatTag.h index 803016499..c5038f3af 100644 --- a/Minecraft.World/FloatTag.h +++ b/Minecraft.World/FloatTag.h @@ -12,7 +12,7 @@ public: void write(DataOutput *dos) { dos->writeFloat(data); } void load(DataInput *dis, int tagDepth) { data = dis->readFloat(); } - byte getId() { return TAG_Float; } + uint8_t getId() { return TAG_Float; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/FurnaceTileEntity.cpp b/Minecraft.World/FurnaceTileEntity.cpp index 1aa2c3005..05362e8b4 100644 --- a/Minecraft.World/FurnaceTileEntity.cpp +++ b/Minecraft.World/FurnaceTileEntity.cpp @@ -149,7 +149,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); } diff --git a/Minecraft.World/Ghast.cpp b/Minecraft.World/Ghast.cpp index f0817791c..88d9cda8b 100644 --- a/Minecraft.World/Ghast.cpp +++ b/Minecraft.World/Ghast.cpp @@ -72,7 +72,7 @@ void Ghast::defineSynchedData() { FlyingMob::defineSynchedData(); - entityData->define(DATA_IS_CHARGING, (byte) 0); + entityData->define(DATA_IS_CHARGING, (uint8_t) 0); } void Ghast::registerAttributes() @@ -175,8 +175,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); diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 26261710f..803ab005e 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -235,7 +235,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); @@ -244,16 +244,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; } } diff --git a/Minecraft.World/HellDimension.cpp b/Minecraft.World/HellDimension.cpp index 85e2a25ae..ebc375522 100644 --- a/Minecraft.World/HellDimension.cpp +++ b/Minecraft.World/HellDimension.cpp @@ -19,9 +19,9 @@ void HellDimension::init() Vec3 *HellDimension::getFogColor(float td, float a) const { int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Nether_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.2f; float gg = (float)greenComponent/256;//0.03f; diff --git a/Minecraft.World/HellFlatLevelSource.cpp b/Minecraft.World/HellFlatLevelSource.cpp index 4957f6176..ad21f2396 100644 --- a/Minecraft.World/HellFlatLevelSource.cpp +++ b/Minecraft.World/HellFlatLevelSource.cpp @@ -38,7 +38,7 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) block = Tile::netherRack_Id; } - blocks[xc << 11 | zc << 7 | yc] = (byte) block; + blocks[xc << 11 | zc << 7 | yc] = (uint8_t) block; } } } @@ -60,7 +60,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( z - random->nextInt( 4 ) <= 0 || xOffs < -(m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -68,7 +68,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( x - random->nextInt( 4 ) <= 0 || zOffs < -(m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -76,7 +76,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( z + random->nextInt(4) >= 15 || xOffs > (m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -84,7 +84,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( x + random->nextInt(4) >= 15 || zOffs > (m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -93,11 +93,11 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) if (y >= Level::genDepthMinusOne - random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else if (y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } } } @@ -115,7 +115,7 @@ LevelChunk *HellFlatLevelSource::getChunk(int xOffs, int zOffs) // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int chunksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,chunksSize); byteArray blocks = byteArray(tileData,chunksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp index 31bb3d696..47b81e9ac 100644 --- a/Minecraft.World/HellRandomLevelSource.cpp +++ b/Minecraft.World/HellRandomLevelSource.cpp @@ -104,7 +104,7 @@ void HellRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray block tileId = Tile::netherRack_Id; } - blocks[offs] = (byte) tileId; + blocks[offs] = (uint8_t) tileId; offs += step; val += vala; } @@ -147,8 +147,8 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks int run = -1; - byte top = (byte) Tile::netherRack_Id; - byte material = (byte) Tile::netherRack_Id; + uint8_t top = (uint8_t) Tile::netherRack_Id; + uint8_t material = (uint8_t) Tile::netherRack_Id; for (int y = Level::genDepthMinusOne; y >= 0; y--) { @@ -160,7 +160,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( z - random->nextInt( 4 ) <= 0 || xOffs < -(m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -168,7 +168,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( x - random->nextInt( 4 ) <= 0 || zOffs < -(m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -176,7 +176,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( z + random->nextInt(4) >= 15 || xOffs > (m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -184,7 +184,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( x + random->nextInt(4) >= 15 || zOffs > (m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -193,7 +193,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks if (y >= Level::genDepthMinusOne - random->nextInt(5) || y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -210,20 +210,20 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks if (runDepth <= 0) { top = 0; - material = (byte) Tile::netherRack_Id; + material = (uint8_t) Tile::netherRack_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { - top = (byte) Tile::netherRack_Id; - material = (byte) Tile::netherRack_Id; - if (gravel) top = (byte) Tile::gravel_Id; - if (gravel) material = (byte) Tile::netherRack_Id; + top = (uint8_t) Tile::netherRack_Id; + material = (uint8_t) Tile::netherRack_Id; + if (gravel) top = (uint8_t) Tile::gravel_Id; + if (gravel) material = (uint8_t) Tile::netherRack_Id; if (sand) { // 4J Stu - Make some nether wart spawn outside of the nether fortresses if(random->nextInt(16) == 0) { - top = (byte) Tile::netherStalk_Id; + top = (uint8_t) Tile::netherStalk_Id; // Place the nether wart on top of the soul sand y += 1; @@ -234,13 +234,13 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks } else { - top = (byte) Tile::soulsand_Id; + top = (uint8_t) Tile::soulsand_Id; } } - if (sand) material = (byte) Tile::soulsand_Id; + if (sand) material = (uint8_t) Tile::soulsand_Id; } - if (y < waterHeight && top == 0) top = (byte) Tile::calmLava_Id; + if (y < waterHeight && top == 0) top = (uint8_t) Tile::calmLava_Id; run = runDepth; // 4J Stu - If sand, then allow adding nether wart at heights below the water level @@ -273,7 +273,7 @@ LevelChunk *HellRandomLevelSource::getChunk(int xOffs, int zOffs) // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int blocksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,blocksSize); byteArray blocks = byteArray(tileData,blocksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/HopperTileEntity.cpp b/Minecraft.World/HopperTileEntity.cpp index 38a0e817d..b98c737f3 100644 --- a/Minecraft.World/HopperTileEntity.cpp +++ b/Minecraft.World/HopperTileEntity.cpp @@ -49,7 +49,7 @@ void HopperTileEntity::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); } diff --git a/Minecraft.World/IntArrayTag.h b/Minecraft.World/IntArrayTag.h index 48f4ce745..b3fd6cb27 100644 --- a/Minecraft.World/IntArrayTag.h +++ b/Minecraft.World/IntArrayTag.h @@ -44,7 +44,7 @@ public: } } - byte getId() { return TAG_Int_Array; } + uint8_t getId() { return TAG_Int_Array; } wstring toString() { diff --git a/Minecraft.World/IntTag.h b/Minecraft.World/IntTag.h index cce87da31..fd5e17742 100644 --- a/Minecraft.World/IntTag.h +++ b/Minecraft.World/IntTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeInt(data); } void load(DataInput *dis, int tagDepth) { data = dis->readInt(); } - byte getId() { return TAG_Int; } + uint8_t getId() { return TAG_Int; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/Inventory.cpp b/Minecraft.World/Inventory.cpp index 4a524bab8..aeed5f9af 100644 --- a/Minecraft.World/Inventory.cpp +++ b/Minecraft.World/Inventory.cpp @@ -515,7 +515,7 @@ ListTag *Inventory::save(ListTag *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); } @@ -525,7 +525,7 @@ ListTag *Inventory::save(ListTag *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); } diff --git a/Minecraft.World/ItemEntity.cpp b/Minecraft.World/ItemEntity.cpp index 66d271f72..595b567f8 100644 --- a/Minecraft.World/ItemEntity.cpp +++ b/Minecraft.World/ItemEntity.cpp @@ -204,7 +204,7 @@ bool ItemEntity::hurt(DamageSource *source, float 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())); } diff --git a/Minecraft.World/ItemFrame.cpp b/Minecraft.World/ItemFrame.cpp index 0d52b421b..287c6d89e 100644 --- a/Minecraft.World/ItemFrame.cpp +++ b/Minecraft.World/ItemFrame.cpp @@ -38,7 +38,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); } bool ItemFrame::shouldRenderAtSqrDistance(double distance) @@ -107,7 +107,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) @@ -115,7 +115,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); diff --git a/Minecraft.World/ItemInstance.cpp b/Minecraft.World/ItemInstance.cpp index 4dcde7aa5..fbfa82f8d 100644 --- a/Minecraft.World/ItemInstance.cpp +++ b/Minecraft.World/ItemInstance.cpp @@ -146,7 +146,7 @@ shared_ptr ItemInstance::useTimeDepleted(Level *level, shared_ptr< CompoundTag *ItemInstance::save(CompoundTag *compoundTag) { compoundTag->putShort(L"id", (short) id); - compoundTag->putByte(L"Count", (byte) count); + compoundTag->putByte(L"Count", (uint8_t) count); compoundTag->putShort(L"Damage", (short) auxValue); if (tag != NULL) compoundTag->put(L"tag", tag->copy()); return compoundTag; @@ -736,7 +736,7 @@ void ItemInstance::enchant(const Enchantment *enchantment, int level) ListTag *list = (ListTag *) tag->get(L"ench"); CompoundTag *ench = new CompoundTag(); ench->putShort((wchar_t *)TAG_ENCH_ID, (short) enchantment->id); - ench->putShort((wchar_t *)TAG_ENCH_LEVEL, (byte) level); + ench->putShort((wchar_t *)TAG_ENCH_LEVEL, (uint8_t) level); list->add(ench); } diff --git a/Minecraft.World/LargeCaveFeature.cpp b/Minecraft.World/LargeCaveFeature.cpp index c05447cf8..102f10adc 100644 --- a/Minecraft.World/LargeCaveFeature.cpp +++ b/Minecraft.World/LargeCaveFeature.cpp @@ -144,12 +144,12 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; } } } diff --git a/Minecraft.World/LargeHellCaveFeature.cpp b/Minecraft.World/LargeHellCaveFeature.cpp index b1e636eb4..8b726261a 100644 --- a/Minecraft.World/LargeHellCaveFeature.cpp +++ b/Minecraft.World/LargeHellCaveFeature.cpp @@ -138,7 +138,7 @@ void LargeHellCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArr int block = blocks[p]; if (block == Tile::netherRack_Id || block == Tile::dirt_Id || block == Tile::grass_Id) { - blocks[p] = (byte) 0; + blocks[p] = (uint8_t) 0; } } p--; diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index b977ad7d2..ce2d49c58 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -68,7 +68,7 @@ DWORD Level::tlsIdxLightCache = TlsAlloc(); // L - light value valid // B - blocking value valid // E - emission value valid -// W - lighting value requires write +// W - lighting value requirements write // xxxxxxxxxxxxxxxx - top 16 bits of x position // zzzzzzzzzzzzzzzz - top 16 bits of z position #else @@ -84,13 +84,13 @@ DWORD Level::tlsIdxLightCache = TlsAlloc(); // L - light value valid // B - blocking value valid // E - emission value valid -// W - lighting value requires write +// W - lighting value requirements write #endif void Level::enableLightingCache() { - // Allocate 16K (needs 32K for large worlds) for a 16x16x16x4 byte cache of results, plus 128K required for toCheck array. Rounding up to 256 to keep as multiple of alignement - aligning to 128K boundary for possible cache locking. + // Allocate 16K (needs 32K for large worlds) for a 16x16x16x4 uint8_t cache of results, plus 128K required for toCheck array. Rounding up to 256 to keep as multiple of alignement - aligning to 128K boundary for possible cache locking. void *cache = (unsigned char *)XPhysicalAlloc(256 * 1024, MAXULONG_PTR, 128 * 1024, PAGE_READWRITE | MEM_LARGE_PAGES); TlsSetValue(tlsIdxLightCache,cache); } @@ -229,7 +229,7 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, cacheValue = posbits; } - // Just written to it, so value is valid & requires writing back + // Just written to it, so value is valid & requirements writing back cacheValue &= ~(15 << LIGHTING_SHIFT ); cacheValue |= brightness << LIGHTING_SHIFT; cacheValue |= ( LIGHTING_WRITEBACK | LIGHTING_VALID ); @@ -4377,7 +4377,7 @@ bool Level::mayInteract(shared_ptr player, int xt, int yt, int zt, int c } -void Level::broadcastEntityEvent(shared_ptr e, byte event) +void Level::broadcastEntityEvent(shared_ptr e, uint8_t event) { } diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h index 6e6b28cd5..f4678c351 100644 --- a/Minecraft.World/Level.h +++ b/Minecraft.World/Level.h @@ -475,7 +475,7 @@ public: void setSpawnPos(Pos *spawnPos); void ensureAdded(shared_ptr entity); virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int content); - virtual void broadcastEntityEvent(shared_ptr e, byte event); + virtual void broadcastEntityEvent(shared_ptr e, uint8_t event); ChunkSource *getChunkSource(); virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); LevelStorage *getLevelStorage(); diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index d4be5ac23..ecbdbabc2 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -531,7 +531,7 @@ void LevelChunk::recalcHeightmapOnly() blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks; } #endif - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < min) min = y; } @@ -588,7 +588,7 @@ void LevelChunk::recalcHeightmap() blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks; } #endif - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < min) min = y; if (y < lowestHeightmap) lowestHeightmap = y; @@ -811,7 +811,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) if (y == yOld) return; // level->lightColumnChanged(x, z, y, yOld); // 4J - this call moved below & corrected - see comment further down - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < minHeight) { @@ -919,7 +919,7 @@ int LevelChunk::getTile(int x, int y, int z) bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) { - byte tile = (byte) _tile; + uint8_t tile = (uint8_t) _tile; // Optimisation brought forward from 1.8.2, change from int to unsigned char & this special value changed from -999 to 255 int slot = z << 4 | x; @@ -2047,7 +2047,7 @@ void LevelChunk::reloadBiomes() for(unsigned int z = 0; z < 16; ++z) { Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z); - biomes[(z << 4) | x] = (byte) ( (biome->id) & 0xff); + biomes[(z << 4) | x] = (uint8_t) ( (biome->id) & 0xff); } } } @@ -2059,7 +2059,7 @@ Biome *LevelChunk::getBiome(int x, int z, BiomeSource *biomeSource) { Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z); value = biome->id; - biomes[(z << 4) | x] = (byte) (value & 0xff); + biomes[(z << 4) | x] = (uint8_t) (value & 0xff); } if (Biome::biomes[value] == NULL) { @@ -2146,14 +2146,14 @@ void LevelChunk::updateBiomeFlags(int x, int z) } } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set; void LevelChunk::getDataData(byteArray data) { lowerData->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setDataData(byteArray data) { if( lowerData == NULL ) lowerData = new SparseDataStorage(); @@ -2162,21 +2162,21 @@ void LevelChunk::setDataData(byteArray data) if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set; void LevelChunk::getSkyLightData(byteArray data) { lowerSkyLight->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set; void LevelChunk::getBlockLightData(byteArray data) { lowerBlockLight->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperBlockLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set sky light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set sky light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setSkyLightData(byteArray data) { if( lowerSkyLight == NULL ) lowerSkyLight = new SparseLightStorage(true); @@ -2185,7 +2185,7 @@ void LevelChunk::setSkyLightData(byteArray data) if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set block light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set block light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setBlockLightData(byteArray data) { if( lowerBlockLight == NULL ) lowerBlockLight = new SparseLightStorage(false); diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h index 661fbdac0..f972ba816 100644 --- a/Minecraft.World/LevelChunk.h +++ b/Minecraft.World/LevelChunk.h @@ -75,10 +75,10 @@ private: SparseLightStorage *lowerBlockLight; // 0 - 127 SparseLightStorage *upperBlockLight; // 128 - 255 public: - void getSkyLightData(byteArray data); // Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version. - void getBlockLightData(byteArray data); // Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version. - void setSkyLightData(byteArray data); // Set sky light data to data passed in input byte array of length 16384. This data must be in original (java version) order - void setBlockLightData(byteArray data); // Set block light data to data passed in input byte array of length 16384. This data must be in original (java version) order + void getSkyLightData(byteArray data); // Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version. + void getBlockLightData(byteArray data); // Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version. + void setSkyLightData(byteArray data); // Set sky light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order + void setBlockLightData(byteArray data); // Set block light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order void setSkyLightDataAllBright(); // Set sky light data to be all fully lit bool isLowerBlockStorageCompressed(); int isLowerBlockLightStorageCompressed(); diff --git a/Minecraft.World/ListTag.h b/Minecraft.World/ListTag.h index 69e51aee1..bd796b34f 100644 --- a/Minecraft.World/ListTag.h +++ b/Minecraft.World/ListTag.h @@ -6,7 +6,7 @@ template class ListTag : public Tag { private: vector list; - byte type; + uint8_t type; public: ListTag() : Tag(L"") {} @@ -46,7 +46,7 @@ public: } } - byte getId() { return TAG_List; } + uint8_t getId() { return TAG_List; } wstring toString() { diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index ce702676c..50d293d31 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -132,8 +132,8 @@ LivingEntity::~LivingEntity() void LivingEntity::defineSynchedData() { entityData->define(DATA_EFFECT_COLOR_ID, 0); - entityData->define(DATA_EFFECT_AMBIENCE_ID, (byte) 0); - entityData->define(DATA_ARROW_COUNT_ID, (byte) 0); + entityData->define(DATA_EFFECT_AMBIENCE_ID, (uint8_t) 0); + entityData->define(DATA_ARROW_COUNT_ID, (uint8_t) 0); entityData->define(DATA_HEALTH_ID, 1.0f); } @@ -512,7 +512,7 @@ void LivingEntity::tickEffects() { if (activeEffects.empty()) { - entityData->set(DATA_EFFECT_AMBIENCE_ID, (byte) 0); + entityData->set(DATA_EFFECT_AMBIENCE_ID, (uint8_t) 0); entityData->set(DATA_EFFECT_COLOR_ID, 0); setInvisible(false); setWeakened(false); @@ -525,7 +525,7 @@ void LivingEntity::tickEffects() values.push_back(it.second); } int colorValue = PotionBrewing::getColorValue(&values); - entityData->set(DATA_EFFECT_AMBIENCE_ID, PotionBrewing::areAllEffectsAmbient(&values) ? (byte) 1 : (byte) 0); + entityData->set(DATA_EFFECT_AMBIENCE_ID, PotionBrewing::areAllEffectsAmbient(&values) ? (uint8_t) 1 : (uint8_t) 0); values.clear(); entityData->set(DATA_EFFECT_COLOR_ID, colorValue); setInvisible(hasEffect(MobEffect::invisibility->id)); @@ -1149,7 +1149,7 @@ int LivingEntity::getArrowCount() void LivingEntity::setArrowCount(int count) { - entityData->set(DATA_ARROW_COUNT_ID, (byte) count); + entityData->set(DATA_ARROW_COUNT_ID, (uint8_t) count); } int LivingEntity::getCurrentSwingDuration() @@ -1179,7 +1179,7 @@ void LivingEntity::swing() } } -void LivingEntity::handleEntityEvent(byte id) +void LivingEntity::handleEntityEvent(uint8_t id) { if (id == EntityEvent::HURT) { diff --git a/Minecraft.World/LivingEntity.h b/Minecraft.World/LivingEntity.h index 5869eeb29..4baa38fa5 100644 --- a/Minecraft.World/LivingEntity.h +++ b/Minecraft.World/LivingEntity.h @@ -218,7 +218,7 @@ private: public: virtual void swing(); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual void outOfWorld(); diff --git a/Minecraft.World/LongTag.h b/Minecraft.World/LongTag.h index 8cfae41d2..be034bb1e 100644 --- a/Minecraft.World/LongTag.h +++ b/Minecraft.World/LongTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis, int tagDepth) { data = dis->readLong(); } - byte getId() { return TAG_Long; } + uint8_t getId() { return TAG_Long; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/MapItem.cpp b/Minecraft.World/MapItem.cpp index 03529c1ad..97ed8b569 100644 --- a/Minecraft.World/MapItem.cpp +++ b/Minecraft.World/MapItem.cpp @@ -74,7 +74,7 @@ shared_ptr MapItem::getSavedData(shared_ptr item mapItemSavedData->x = Math::round((float) level->getLevelData()->getXSpawn() / scale) * scale; mapItemSavedData->z = Math::round(level->getLevelData()->getZSpawn() / scale) * scale; #endif - mapItemSavedData->dimension = (byte) level->dimension->id; + mapItemSavedData->dimension = (uint8_t) level->dimension->id; mapItemSavedData->setDirty(); @@ -236,8 +236,8 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptrcolors[x + z * w]; - byte newColor = (byte) (col * 4 + br); + uint8_t oldColor = data->colors[x + z * w]; + uint8_t newColor = (uint8_t) (col * 4 + br); if (oldColor != newColor) { if (yd0 > z) yd0 = z; @@ -335,7 +335,7 @@ void MapItem::onCraftedBy(shared_ptr itemInstance, Level *level, s // 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) level->dimension->id; + data->dimension = (uint8_t) level->dimension->id; data->setDirty(); } diff --git a/Minecraft.World/MapItemSavedData.cpp b/Minecraft.World/MapItemSavedData.cpp index c06c3facd..98f604460 100644 --- a/Minecraft.World/MapItemSavedData.cpp +++ b/Minecraft.World/MapItemSavedData.cpp @@ -310,10 +310,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(4, x, y, 0)); @@ -347,10 +347,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(7, x, y, 0)); @@ -379,10 +379,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(7, x, y, 0)); @@ -437,10 +437,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif @@ -572,8 +572,8 @@ void MapItemSavedData::mergeInMapData(shared_ptr dataToAdd) for (int z = 0; z < h; z++) { - byte oldColor = colors[x + z * w]; - byte newColor = dataToAdd->colors[x + z * w]; + uint8_t oldColor = colors[x + z * w]; + uint8_t newColor = dataToAdd->colors[x + z * w]; if (oldColor == 0 && oldColor != newColor) { if (yd0 > z) yd0 = z; diff --git a/Minecraft.World/MapItemSavedData.h b/Minecraft.World/MapItemSavedData.h index 213226447..051f11f45 100644 --- a/Minecraft.World/MapItemSavedData.h +++ b/Minecraft.World/MapItemSavedData.h @@ -61,7 +61,7 @@ public: public: int x, z; char dimension; - byte scale; + uint8_t scale; byteArray colors; vector > carriedBy; diff --git a/Minecraft.World/MerchantRecipeList.cpp b/Minecraft.World/MerchantRecipeList.cpp index c994081f2..e6c5324a1 100644 --- a/Minecraft.World/MerchantRecipeList.cpp +++ b/Minecraft.World/MerchantRecipeList.cpp @@ -85,7 +85,7 @@ MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(shared_ptrwriteByte((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); diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp index 4e1419cc4..762d29a2c 100644 --- a/Minecraft.World/Minecart.cpp +++ b/Minecraft.World/Minecart.cpp @@ -95,7 +95,7 @@ void Minecart::defineSynchedData() entityData->define(DATA_ID_DAMAGE, 0.0f); entityData->define(DATA_ID_DISPLAY_TILE, 0); entityData->define(DATA_ID_DISPLAY_OFFSET, 6); - entityData->define(DATA_ID_CUSTOM_DISPLAY, (byte) 0); + entityData->define(DATA_ID_CUSTOM_DISPLAY, (uint8_t) 0); } @@ -1015,7 +1015,7 @@ bool Minecart::hasCustomDisplay() void Minecart::setCustomDisplay(bool value) { - getEntityData()->set(DATA_ID_CUSTOM_DISPLAY, (byte) (value ? 1 : 0)); + getEntityData()->set(DATA_ID_CUSTOM_DISPLAY, (uint8_t) (value ? 1 : 0)); } void Minecart::setCustomName(const wstring &name) diff --git a/Minecraft.World/MinecartContainer.cpp b/Minecraft.World/MinecartContainer.cpp index 20bfc4ea8..fb8022952 100644 --- a/Minecraft.World/MinecartContainer.cpp +++ b/Minecraft.World/MinecartContainer.cpp @@ -188,7 +188,7 @@ void MinecartContainer::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); } diff --git a/Minecraft.World/MinecartFurnace.cpp b/Minecraft.World/MinecartFurnace.cpp index 24950d5c1..5ec6df6c7 100644 --- a/Minecraft.World/MinecartFurnace.cpp +++ b/Minecraft.World/MinecartFurnace.cpp @@ -37,7 +37,7 @@ int MinecartFurnace::getType() void MinecartFurnace::defineSynchedData() { Minecart::defineSynchedData(); - entityData->define(DATA_ID_FUEL, (byte) 0); + entityData->define(DATA_ID_FUEL, (uint8_t) 0); } void MinecartFurnace::tick() @@ -160,11 +160,11 @@ void MinecartFurnace::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)); } } diff --git a/Minecraft.World/MinecartSpawner.cpp b/Minecraft.World/MinecartSpawner.cpp index 3fcd4ef08..5b8061c13 100644 --- a/Minecraft.World/MinecartSpawner.cpp +++ b/Minecraft.World/MinecartSpawner.cpp @@ -10,7 +10,7 @@ MinecartSpawner::MinecartMobSpawner::MinecartMobSpawner(MinecartSpawner *parent) void MinecartSpawner::MinecartMobSpawner::broadcastEvent(int id) { - m_parent->level->broadcastEntityEvent(m_parent->shared_from_this(), (byte) id); + m_parent->level->broadcastEntityEvent(m_parent->shared_from_this(), (uint8_t) id); } Level *MinecartSpawner::MinecartMobSpawner::getLevel() @@ -78,7 +78,7 @@ void MinecartSpawner::addAdditonalSaveData(CompoundTag *tag) spawner->save(tag); } -void MinecartSpawner::handleEntityEvent(byte eventId) +void MinecartSpawner::handleEntityEvent(uint8_t eventId) { spawner->onEventTriggered(eventId); } diff --git a/Minecraft.World/MinecartSpawner.h b/Minecraft.World/MinecartSpawner.h index a0b7944f4..ef7d4bee8 100644 --- a/Minecraft.World/MinecartSpawner.h +++ b/Minecraft.World/MinecartSpawner.h @@ -39,7 +39,7 @@ protected: virtual void addAdditonalSaveData(CompoundTag *tag); public: - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void tick(); virtual BaseMobSpawner *getSpawner(); }; \ No newline at end of file diff --git a/Minecraft.World/MinecartTNT.cpp b/Minecraft.World/MinecartTNT.cpp index 26cac5cf5..85ef37f2b 100644 --- a/Minecraft.World/MinecartTNT.cpp +++ b/Minecraft.World/MinecartTNT.cpp @@ -105,7 +105,7 @@ void MinecartTNT::activateMinecart(int xt, int yt, int zt, bool state) } } -void MinecartTNT::handleEntityEvent(byte eventId) +void MinecartTNT::handleEntityEvent(uint8_t eventId) { if (eventId == EVENT_PRIME) { diff --git a/Minecraft.World/MinecartTNT.h b/Minecraft.World/MinecartTNT.h index 8637803cd..75e8021d2 100644 --- a/Minecraft.World/MinecartTNT.h +++ b/Minecraft.World/MinecartTNT.h @@ -9,7 +9,7 @@ public: static Entity *create(Level *level) { return new MinecartTNT(level); } private: - static const byte EVENT_PRIME = 10; + static const uint8_t EVENT_PRIME = 10; int fuse; @@ -30,7 +30,7 @@ protected: public: virtual void activateMinecart(int xt, int yt, int zt, bool state); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void primeFuse(); virtual int getFuse(); virtual bool isPrimed(); diff --git a/Minecraft.World/Minecraft.World.vcxproj b/Minecraft.World/Minecraft.World.vcxproj index c9191573e..e20faab7a 100644 --- a/Minecraft.World/Minecraft.World.vcxproj +++ b/Minecraft.World/Minecraft.World.vcxproj @@ -235,6 +235,7 @@ SAK SAK title + 10.0 @@ -286,63 +287,63 @@ StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary MultiByte - v143 + v145 true StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary @@ -405,82 +406,82 @@ StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary @@ -1279,6 +1280,8 @@ true Default /FS %(AdditionalOptions) + stdcpplatest + stdclatest true diff --git a/Minecraft.World/Mob.cpp b/Minecraft.World/Mob.cpp index 342400b49..275741f4a 100644 --- a/Minecraft.World/Mob.cpp +++ b/Minecraft.World/Mob.cpp @@ -155,7 +155,7 @@ void Mob::ate() void Mob::defineSynchedData() { LivingEntity::defineSynchedData(); - entityData->define(DATA_CUSTOM_NAME_VISIBLE, (byte) 0); + entityData->define(DATA_CUSTOM_NAME_VISIBLE, (uint8_t) 0); entityData->define(DATA_CUSTOM_NAME, L""); } @@ -865,7 +865,7 @@ bool Mob::hasCustomName() void Mob::setCustomNameVisible(bool visible) { - entityData->set(DATA_CUSTOM_NAME_VISIBLE, visible ? (byte) 1 : (byte) 0); + entityData->set(DATA_CUSTOM_NAME_VISIBLE, visible ? (uint8_t) 1 : (uint8_t) 0); } bool Mob::isCustomNameVisible() diff --git a/Minecraft.World/MobEffectInstance.cpp b/Minecraft.World/MobEffectInstance.cpp index 2ca696f61..c98e83ed7 100644 --- a/Minecraft.World/MobEffectInstance.cpp +++ b/Minecraft.World/MobEffectInstance.cpp @@ -172,8 +172,8 @@ bool MobEffectInstance::equals(MobEffectInstance *instance) CompoundTag *MobEffectInstance::save(CompoundTag *tag) { - tag->putByte(L"Id", (byte) getId()); - tag->putByte(L"Amplifier", (byte) getAmplifier()); + tag->putByte(L"Id", (uint8_t) getId()); + tag->putByte(L"Amplifier", (uint8_t) getAmplifier()); tag->putInt(L"Duration", getDuration()); tag->putBoolean(L"Ambient", isAmbient()); return tag; diff --git a/Minecraft.World/MobEffectInstance.h b/Minecraft.World/MobEffectInstance.h index 5d9e68f6c..9debee3e0 100644 --- a/Minecraft.World/MobEffectInstance.h +++ b/Minecraft.World/MobEffectInstance.h @@ -5,11 +5,11 @@ class Mob; class MobEffectInstance { private: - // sent as byte + // sent as uint8_t int id; // sent as short int duration; - // sent as byte + // sent as uint8_t int amplifier; bool splash; bool ambient; diff --git a/Minecraft.World/MushroomIslandBiome.cpp b/Minecraft.World/MushroomIslandBiome.cpp index fa7eafdbe..3191350dc 100644 --- a/Minecraft.World/MushroomIslandBiome.cpp +++ b/Minecraft.World/MushroomIslandBiome.cpp @@ -13,7 +13,7 @@ MushroomIslandBiome::MushroomIslandBiome(int id) : Biome(id) decorator->mushroomCount = 1; decorator->hugeMushrooms = 1; - topMaterial = (byte) Tile::mycel_Id; + topMaterial = (uint8_t) Tile::mycel_Id; enemies.clear(); friendlies.clear(); diff --git a/Minecraft.World/MusicTileEntity.cpp b/Minecraft.World/MusicTileEntity.cpp index d947cc69e..15c4b0e63 100644 --- a/Minecraft.World/MusicTileEntity.cpp +++ b/Minecraft.World/MusicTileEntity.cpp @@ -33,7 +33,7 @@ void MusicTileEntity::load(CompoundTag *tag) void MusicTileEntity::tune() { - note = (byte) ((note + 1) % 25); + note = (uint8_t) ((note + 1) % 25); setChanged(); } diff --git a/Minecraft.World/MusicTileEntity.h b/Minecraft.World/MusicTileEntity.h index a4941ff11..b5a23be6c 100644 --- a/Minecraft.World/MusicTileEntity.h +++ b/Minecraft.World/MusicTileEntity.h @@ -10,7 +10,7 @@ public: static TileEntity *create() { return new MusicTileEntity(); } public: - byte note; + uint8_t note; bool on; diff --git a/Minecraft.World/NbtIo.cpp b/Minecraft.World/NbtIo.cpp index b6c632777..7b59c19c2 100644 --- a/Minecraft.World/NbtIo.cpp +++ b/Minecraft.World/NbtIo.cpp @@ -16,7 +16,7 @@ CompoundTag *NbtIo::readCompressed(InputStream *in) void NbtIo::writeCompressed(CompoundTag *tag, OutputStream *out) { // 4J - this was using a try/finally block - // 4J Stu - Buffer output in 1024 byte chunks so that we can allocate properly in the save file + // 4J Stu - Buffer output in 1024 uint8_t chunks so that we can allocate properly in the save file BufferedOutputStream bos = BufferedOutputStream( out, 1024 ); DataOutputStream dos = DataOutputStream(&bos); // 4J - was new GZIPOutputStream as well NbtIo::write(tag, &dos); diff --git a/Minecraft.World/Ocelot.cpp b/Minecraft.World/Ocelot.cpp index 50285682a..0bc3401a1 100644 --- a/Minecraft.World/Ocelot.cpp +++ b/Minecraft.World/Ocelot.cpp @@ -57,7 +57,7 @@ void Ocelot::defineSynchedData() { TamableAnimal::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) 0); + entityData->define(DATA_TYPE_ID, (uint8_t) 0); } void Ocelot::serverAiMobStep() @@ -279,7 +279,7 @@ int Ocelot::getCatType() void Ocelot::setCatType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); } bool Ocelot::canSpawn() @@ -350,12 +350,12 @@ MobGroupData *Ocelot::finalizeMobSpawn(MobGroupData *groupData, int extraData /* void Ocelot::setSittingOnTile(bool val) { - byte current = entityData->getByte(DATA_FLAGS_ID); - entityData->set(DATA_FLAGS_ID, val ? (byte) (current | 0x02) : (byte) (current & ~0x02) ); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); + entityData->set(DATA_FLAGS_ID, val ? (uint8_t) (current | 0x02) : (uint8_t) (current & ~0x02) ); } bool Ocelot::isSittingOnTile() { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); return (current & 0x02) > 0; } \ No newline at end of file diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp index 24263d0d5..9bd4757b8 100644 --- a/Minecraft.World/OldChunkStorage.cpp +++ b/Minecraft.World/OldChunkStorage.cpp @@ -526,10 +526,10 @@ LevelChunk *OldChunkStorage::load(Level *level, CompoundTag *tag) delete [] levelChunk->heightmap.data; levelChunk->heightmap = tag->getByteArray(L"HeightMap"); - // 4J - TerrainPopulated was a bool (java), then changed to be a byte bitfield, then replaced with TerrainPopulatedShort to store a wider bitfield + // 4J - TerrainPopulated was a bool (java), then changed to be a uint8_t bitfield, then replaced with TerrainPopulatedShort to store a wider bitfield if( tag->get(L"TerrainPopulated") ) { - // Java bool type or byte bitfield + // Java bool type or uint8_t bitfield levelChunk->terrainPopulated = tag->getByte(L"TerrainPopulated"); if( levelChunk->terrainPopulated >= 1 ) levelChunk->terrainPopulated = LevelChunk::sTerrainPopulatedAllNeighbours | LevelChunk::sTerrainPostPostProcessed; // Convert from old bool type to new bitfield } diff --git a/Minecraft.World/Pig.cpp b/Minecraft.World/Pig.cpp index cc042f586..98a259d0c 100644 --- a/Minecraft.World/Pig.cpp +++ b/Minecraft.World/Pig.cpp @@ -70,7 +70,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) @@ -153,11 +153,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); } } diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index bd6b68a8e..a587dcc10 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -175,7 +175,7 @@ void Player::defineSynchedData() { LivingEntity::defineSynchedData(); - entityData->define(DATA_PLAYER_FLAGS_ID, (byte) 0); + entityData->define(DATA_PLAYER_FLAGS_ID, (uint8_t) 0); entityData->define(DATA_PLAYER_ABSORPTION_ID, (float) 0); entityData->define(DATA_SCORE_ID, (int) 0); } @@ -591,7 +591,7 @@ void Player::completeUsingItem() } } -void Player::handleEntityEvent(byte id) +void Player::handleEntityEvent(uint8_t id) { if (id == EntityEvent::USE_ITEM_COMPLETE) { @@ -2025,14 +2025,14 @@ bool Player::getPlayerFlag(int flag) void Player::setPlayerFlag(int flag, bool value) { - byte currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID); + uint8_t currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID); if (value) { - entityData->set(DATA_PLAYER_FLAGS_ID, (byte) (currentValue | (1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue | (1 << flag))); } else { - entityData->set(DATA_PLAYER_FLAGS_ID, (byte) (currentValue & ~(1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag))); } } diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index 2e223a1e5..aebad5171 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -168,7 +168,7 @@ protected: virtual void completeUsingItem(); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: bool isImmobile(); diff --git a/Minecraft.World/PlayerAbilitiesPacket.cpp b/Minecraft.World/PlayerAbilitiesPacket.cpp index d02f164cc..5052b8ab7 100644 --- a/Minecraft.World/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/PlayerAbilitiesPacket.cpp @@ -25,7 +25,7 @@ PlayerAbilitiesPacket::PlayerAbilitiesPacket(Abilities *abilities) void PlayerAbilitiesPacket::read(DataInputStream *dis) { - byte bitfield = dis->readByte(); + uint8_t bitfield = dis->readByte(); setInvulnerable((bitfield & FLAG_INVULNERABLE) > 0); setFlying((bitfield & FLAG_FLYING) > 0); @@ -37,7 +37,7 @@ void PlayerAbilitiesPacket::read(DataInputStream *dis) void PlayerAbilitiesPacket::write(DataOutputStream *dos) { - byte bitfield = 0; + uint8_t bitfield = 0; if (isInvulnerable()) bitfield |= FLAG_INVULNERABLE; if (isFlying()) bitfield |= FLAG_FLYING; diff --git a/Minecraft.World/PlayerEnderChestContainer.cpp b/Minecraft.World/PlayerEnderChestContainer.cpp index f0a1aaa3f..8d42363f9 100644 --- a/Minecraft.World/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/PlayerEnderChestContainer.cpp @@ -41,7 +41,7 @@ ListTag *PlayerEnderChestContainer::createTag() if (item != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); item->save(tag); items->add(tag); } diff --git a/Minecraft.World/PotionBrewing.cpp b/Minecraft.World/PotionBrewing.cpp index 8e27a6017..408a577e8 100644 --- a/Minecraft.World/PotionBrewing.cpp +++ b/Minecraft.World/PotionBrewing.cpp @@ -63,7 +63,7 @@ const int PotionBrewing::DEFAULT_APPEARANCES[] = /* 4J-JEV: Fix for #81196, * Bit 13 is always set in functional potions. * Therefore if bit 13 is on, don't use netherwart! - * Added "&!13" which requires that bit 13 be turned off. + * Added "&!13" which requirements that bit 13 be turned off. */ const wstring PotionBrewing::MOD_NETHERWART = L"+4&!13"; // L"+4" @@ -80,7 +80,7 @@ const wstring PotionBrewing::MOD_MAGMACREAM = L"+0+1-2-3&4-4+13"; const wstring PotionBrewing::MOD_REDSTONE = L"-5+6-7"; // redstone increases duration const wstring PotionBrewing::MOD_GLOWSTONE = L"+5-6-7"; // glowstone increases amplification // 4J Stu - Don't require bit 13 to be set. We don't use it in the creative menu. Side effect is you can make a (virtually useless) Splash Mundane potion with water bottle and gunpowder -const wstring PotionBrewing::MOD_GUNPOWDER = L"+14";//&13-13"; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 +const wstring PotionBrewing::MOD_GUNPOWDER = L"+14";//&13-13"; // gunpowder makes them throwable! // gunpowder requirements 13 and sets 14 #else const wstring PotionBrewing::MOD_WATER = L"-1-3-5-7-9-11-13"; const wstring PotionBrewing::MOD_SUGAR = L"+0"; @@ -92,7 +92,7 @@ const wstring PotionBrewing::MOD_BLAZEPOWDER = L"+14"; const wstring PotionBrewing::MOD_MAGMACREAM = L"+14+6+1"; const wstring PotionBrewing::MOD_REDSTONE = L""; // redstone increases duration const wstring PotionBrewing::MOD_GLOWSTONE = L""; // glowstone increases amplification -const wstring PotionBrewing::MOD_GUNPOWDER = L""; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 +const wstring PotionBrewing::MOD_GUNPOWDER = L""; // gunpowder makes them throwable! // gunpowder requirements 13 and sets 14 #endif PotionBrewing::intStringMap PotionBrewing::potionEffectDuration; diff --git a/Minecraft.World/PreLoginPacket.cpp b/Minecraft.World/PreLoginPacket.cpp index 4b4742141..5e8729e4f 100644 --- a/Minecraft.World/PreLoginPacket.cpp +++ b/Minecraft.World/PreLoginPacket.cpp @@ -92,7 +92,7 @@ void PreLoginPacket::write(DataOutputStream *dos) //throws IOException dos->writeByte(m_friendsOnlyBits); dos->writeInt(m_ugcPlayersVersion); - dos->writeByte((byte)m_dwPlayerCount); + dos->writeByte((uint8_t)m_dwPlayerCount); for(DWORD i = 0; i < m_dwPlayerCount; ++i) { dos->writePlayerUID( m_playerXuids[i] ); diff --git a/Minecraft.World/PrimedTnt.cpp b/Minecraft.World/PrimedTnt.cpp index 79fd760fb..ba54cf4a6 100644 --- a/Minecraft.World/PrimedTnt.cpp +++ b/Minecraft.World/PrimedTnt.cpp @@ -105,7 +105,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) diff --git a/Minecraft.World/Random.cpp b/Minecraft.World/Random.cpp index 9176bf384..091d0ff85 100644 --- a/Minecraft.World/Random.cpp +++ b/Minecraft.World/Random.cpp @@ -30,11 +30,11 @@ int Random::next(int bits) return (int)(seed >> (48 - bits)); } -void Random::nextBytes(byte *bytes, unsigned int count) +void Random::nextBytes(uint8_t *bytes, unsigned int count) { for(unsigned int i = 0; i < count; i++ ) { - bytes[i] = (byte)next(8); + bytes[i] = (uint8_t)next(8); } } diff --git a/Minecraft.World/Random.h b/Minecraft.World/Random.h index 9af3a3c25..ae36d48f3 100644 --- a/Minecraft.World/Random.h +++ b/Minecraft.World/Random.h @@ -12,7 +12,7 @@ public: Random(); Random(__int64 seed); void setSeed(__int64 s); - void nextBytes(byte *bytes, unsigned int count); + void nextBytes(uint8_t *bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp index 2b93578a6..8a6dc78ba 100644 --- a/Minecraft.World/RandomLevelSource.cpp +++ b/Minecraft.World/RandomLevelSource.cpp @@ -315,11 +315,11 @@ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) // 4J - this comparison used to just be with 0.0f but is now varied by block above if ((val += vala) > comp) { - tileId = (byte) Tile::stone_Id; + tileId = (uint8_t) Tile::stone_Id; } else if (yc * CHUNK_HEIGHT + y < waterHeight) { - tileId = (byte) Tile::calmWater_Id; + tileId = (uint8_t) Tile::calmWater_Id; } // 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that @@ -381,8 +381,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi int run = -1; - byte top = b->topMaterial; - byte material = b->material; + uint8_t top = b->topMaterial; + uint8_t material = b->material; LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); if(lgo != NULL) @@ -397,7 +397,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in // if (y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -414,7 +414,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::stone_Id; + material = (uint8_t) Tile::stone_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -428,8 +428,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y < waterHeight && top == 0) { - if (temp < 0.15f) top = (byte) Tile::ice_Id; - else top = (byte) Tile::calmWater_Id; + if (temp < 0.15f) top = (uint8_t) Tile::ice_Id; + else top = (uint8_t) Tile::calmWater_Id; } run = runDepth; @@ -445,7 +445,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (run == 0 && material == Tile::sand_Id) { run = random->nextInt(4); - material = (byte) Tile::sandStone_Id; + material = (uint8_t) Tile::sandStone_Id; } } } @@ -469,7 +469,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs) // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int blocksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,blocksSize); byteArray blocks = byteArray(tileData,blocksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/RangedAttackGoal.cpp b/Minecraft.World/RangedAttackGoal.cpp index 2923e0111..708143053 100644 --- a/Minecraft.World/RangedAttackGoal.cpp +++ b/Minecraft.World/RangedAttackGoal.cpp @@ -11,7 +11,7 @@ void RangedAttackGoal::_init(RangedAttackMob *rangedMob, Mob *mob, double speedM { //if (!(mob instanceof LivingEntity)) //{ - //throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + //throw new IllegalArgumentException("ArrowAttackGoal requirements Mob implements RangedAttackMob"); //} rangedAttackMob = rangedMob; this->mob = mob; diff --git a/Minecraft.World/Recipes.cpp b/Minecraft.World/Recipes.cpp index ef2cd7fde..f7ee08b7c 100644 --- a/Minecraft.World/Recipes.cpp +++ b/Minecraft.World/Recipes.cpp @@ -1312,7 +1312,7 @@ void Recipes::buildRecipeIngredientsArray(void) int iCount=0; for (auto& recipe : *recipies) { - recipe->requires(&m_pRecipeIngredientsRequired[iCount++]); + recipe->requirements(&m_pRecipeIngredientsRequired[iCount++]); } //printf("Total recipes in buildRecipeIngredientsArray - %d",iCount); diff --git a/Minecraft.World/Recipy.h b/Minecraft.World/Recipy.h index 88d9640a4..b08931bcb 100644 --- a/Minecraft.World/Recipy.h +++ b/Minecraft.World/Recipy.h @@ -49,7 +49,7 @@ public: virtual const int getGroup() = 0; // 4J-PB - virtual bool requires(int iRecipe) = 0; - virtual void requires(INGREDIENTS_REQUIRED *pIngReq) = 0; + virtual bool requirements(int iRecipe) = 0; + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq) = 0; }; diff --git a/Minecraft.World/RedStoneDustTile.cpp b/Minecraft.World/RedStoneDustTile.cpp index a4577bd32..06a48d11b 100644 --- a/Minecraft.World/RedStoneDustTile.cpp +++ b/Minecraft.World/RedStoneDustTile.cpp @@ -335,9 +335,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; } diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp index 2cfd9078f..4f71fafda 100644 --- a/Minecraft.World/RegionFile.cpp +++ b/Minecraft.World/RegionFile.cpp @@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) //if ((GetFileSize(file,NULL) & 0xfff) != 0) if ((fileEntry->getFileSize() & 0xfff) != 0) { - //byte zero = 0; + //uint8_t zero = 0; DWORD numberOfBytesWritten = 0; DWORD bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff); - byte *zeroBytes = new byte[ bytesToWrite ]; + uint8_t *zeroBytes = new uint8_t[ bytesToWrite ]; ZeroMemory(zeroBytes, bytesToWrite); /* the file size is not a multiple of 4KB, grow it */ @@ -207,7 +207,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was DWORD numberOfBytesRead = 0; - // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data + // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a uint8_t, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data m_saveFile->readFile(fileEntry,&length,4,&numberOfBytesRead); @@ -233,8 +233,8 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was } MemSect(50); - byte *data = new byte[length]; - byte *decomp = new byte[decompLength]; + uint8_t *data = new uint8_t[length]; + uint8_t *decomp = new uint8_t[decompLength]; MemSect(0); readDecompLength = decompLength; m_saveFile->readFile(fileEntry,data,length,&numberOfBytesRead); @@ -273,10 +273,10 @@ DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z) } /* write a chunk at (x,z) with length bytes of data to disk */ -void RegionFile::write(int x, int z, byte *data, int length) // TODO - was synchronized +void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was synchronized { // 4J Stu - Do the compression here so that we know how much space we need to store the compressed data - byte *compData = new byte[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those. + uint8_t *compData = new uint8_t[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those. unsigned int compLength = length; Compression::getCompression()->CompressLZXRLE(compData,&compLength,data,length); @@ -403,13 +403,13 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync } /* write a chunk data to the region file at specified sector number */ -void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength) +void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int compLength) { DWORD numberOfBytesWritten = 0; //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); - // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data + // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a uint8_t, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data // 4J Stu - We need to do the compression at a level above this, where it is checking for free space @@ -451,7 +451,7 @@ void RegionFile::insertInitialSectors() { m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_BEGIN ); DWORD numberOfBytesWritten = 0; - byte zeroBytes[ SECTOR_BYTES ]; + uint8_t zeroBytes[ SECTOR_BYTES ]; ZeroMemory(zeroBytes, SECTOR_BYTES); /* we need to write the chunk offset table */ diff --git a/Minecraft.World/RegionFile.h b/Minecraft.World/RegionFile.h index 0717c8c25..41a562b3f 100644 --- a/Minecraft.World/RegionFile.h +++ b/Minecraft.World/RegionFile.h @@ -71,11 +71,11 @@ public: /* write a chunk at (x,z) with length bytes of data to disk */ protected: - void write(int x, int z, byte *data, int length); + void write(int x, int z, uint8_t *data, int length); /* write a chunk data to the region file at specified sector number */ private: - void write(int sectorNumber, byte *data, int length, unsigned int compLength); + void write(int sectorNumber, uint8_t *data, int length, unsigned int compLength); void zero(int sectorNumber, int length); // 4J added /* is this an invalid chunk coordinate? */ diff --git a/Minecraft.World/RemoveMobEffectPacket.cpp b/Minecraft.World/RemoveMobEffectPacket.cpp index fcda69110..ee6808de2 100644 --- a/Minecraft.World/RemoveMobEffectPacket.cpp +++ b/Minecraft.World/RemoveMobEffectPacket.cpp @@ -13,7 +13,7 @@ RemoveMobEffectPacket::RemoveMobEffectPacket() RemoveMobEffectPacket::RemoveMobEffectPacket(int entityId, MobEffectInstance *effect) { this->entityId = entityId; - this->effectId = (byte) (effect->getId() & 0xff); + this->effectId = (uint8_t) (effect->getId() & 0xff); } void RemoveMobEffectPacket::read(DataInputStream *dis) diff --git a/Minecraft.World/ServerAuthDataPacket.h b/Minecraft.World/ServerAuthDataPacket.h index c56844d10..8857f4203 100644 --- a/Minecraft.World/ServerAuthDataPacket.h +++ b/Minecraft.World/ServerAuthDataPacket.h @@ -7,13 +7,13 @@ class ServerAuthDataPacket : public Packet #if 0 private String serverId; private PublicKey publicKey; - private byte[] nonce = new byte[]{}; + private uint8_t[] nonce = new uint8_t[]{}; public ServerAuthDataPacket() { // Needed } - public ServerAuthDataPacket(final String serverId, final PublicKey publicKey, final byte[] nonce) { + public ServerAuthDataPacket(final String serverId, final PublicKey publicKey, final uint8_t[] nonce) { this.serverId = serverId; this.publicKey = publicKey; this.nonce = nonce; @@ -51,7 +51,7 @@ class ServerAuthDataPacket : public Packet return publicKey; } - public byte[] getNonce() { + public uint8_t[] getNonce() { return nonce; } #endif diff --git a/Minecraft.World/ShapedRecipy.cpp b/Minecraft.World/ShapedRecipy.cpp index 15ccca2de..01fd1d09d 100644 --- a/Minecraft.World/ShapedRecipy.cpp +++ b/Minecraft.World/ShapedRecipy.cpp @@ -106,7 +106,7 @@ int ShapedRecipy::size() } // 4J-PB -bool ShapedRecipy::requires(int iRecipe) +bool ShapedRecipy::requirements(int iRecipe) { app.DebugPrintf("ShapedRecipy %d\n",iRecipe); int iCount=0; @@ -130,7 +130,7 @@ bool ShapedRecipy::requires(int iRecipe) return false; } -void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapedRecipy::requirements(INGREDIENTS_REQUIRED *pIngReq) { //printf("ShapedRecipy %d\n",iRecipe); diff --git a/Minecraft.World/ShapedRecipy.h b/Minecraft.World/ShapedRecipy.h index 56cae3fd7..e89e62893 100644 --- a/Minecraft.World/ShapedRecipy.h +++ b/Minecraft.World/ShapedRecipy.h @@ -26,7 +26,7 @@ public: ShapedRecipy *keepTag(); // 4J-PB - to return the items required to make a recipe - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; diff --git a/Minecraft.World/ShapelessRecipy.cpp b/Minecraft.World/ShapelessRecipy.cpp index 44bf6a54f..1b81640d6 100644 --- a/Minecraft.World/ShapelessRecipy.cpp +++ b/Minecraft.World/ShapelessRecipy.cpp @@ -77,7 +77,7 @@ int ShapelessRecipy::size() } // 4J-PB -bool ShapelessRecipy::requires(int iRecipe) +bool ShapelessRecipy::requirements(int iRecipe) { vector *tempList = new vector; @@ -97,7 +97,7 @@ bool ShapelessRecipy::requires(int iRecipe) return false; } -void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapelessRecipy::requirements(INGREDIENTS_REQUIRED *pIngReq) { int iCount=0; bool bFound; diff --git a/Minecraft.World/ShapelessRecipy.h b/Minecraft.World/ShapelessRecipy.h index 5f7f60765..58c7cb04b 100644 --- a/Minecraft.World/ShapelessRecipy.h +++ b/Minecraft.World/ShapelessRecipy.h @@ -17,7 +17,7 @@ public: virtual int size(); // 4J-PB - to return the items required to make a recipe - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; diff --git a/Minecraft.World/SharedKeyPacket.h b/Minecraft.World/SharedKeyPacket.h index 4f50ad5c6..054b01c3b 100644 --- a/Minecraft.World/SharedKeyPacket.h +++ b/Minecraft.World/SharedKeyPacket.h @@ -5,8 +5,8 @@ class SharedKeyPacket : public Packet { #if 0 - private byte[] keybytes = new byte[]{}; - private byte[] nonce = new byte[]{}; + private uint8_t[] keybytes = new uint8_t[]{}; + private uint8_t[] nonce = new uint8_t[]{}; private SecretKey secretKey; @@ -14,7 +14,7 @@ class SharedKeyPacket : public Packet // Needed } - public SharedKeyPacket(final SecretKey secretKey, final PublicKey publicKey, final byte[] nonce) { + public SharedKeyPacket(final SecretKey secretKey, final PublicKey publicKey, final uint8_t[] nonce) { this.secretKey = secretKey; this.keybytes = Crypt.encryptUsingKey(publicKey, secretKey.getEncoded()); this.nonce = Crypt.encryptUsingKey(publicKey, nonce); @@ -53,7 +53,7 @@ class SharedKeyPacket : public Packet return getSecretKey(null); } - public byte[] getNonce(PrivateKey privateKey) { + public uint8_t[] getNonce(PrivateKey privateKey) { if (privateKey == null) { return nonce; } diff --git a/Minecraft.World/Sheep.cpp b/Minecraft.World/Sheep.cpp index 32379c2a1..0dbf3676a 100644 --- a/Minecraft.World/Sheep.cpp +++ b/Minecraft.World/Sheep.cpp @@ -99,8 +99,8 @@ void Sheep::defineSynchedData() { Animal::defineSynchedData(); - // sheared and color share a byte - entityData->define(DATA_WOOL_ID, ((byte) 0)); //was new Byte((byte), 0) + // sheared and color share a uint8_t + 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::wool_Id; } -void Sheep::handleEntityEvent(byte id) +void Sheep::handleEntityEvent(uint8_t id) { if (id == EntityEvent::EAT_GRASS) { @@ -196,7 +196,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) @@ -233,8 +233,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() @@ -244,14 +244,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)); } } diff --git a/Minecraft.World/Sheep.h b/Minecraft.World/Sheep.h index 16ecfb4cf..db42cceb2 100644 --- a/Minecraft.World/Sheep.h +++ b/Minecraft.World/Sheep.h @@ -53,7 +53,7 @@ public: virtual int getDeathLoot(); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); public: float getHeadEatPositionScale(float a); diff --git a/Minecraft.World/ShortTag.h b/Minecraft.World/ShortTag.h index 989e1fb14..57870c694 100644 --- a/Minecraft.World/ShortTag.h +++ b/Minecraft.World/ShortTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeShort(data); } void load(DataInput *dis, int tagDepth) { data = dis->readShort(); } - byte getId() { return TAG_Short; } + uint8_t getId() { return TAG_Short; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/SignUpdatePacket.cpp b/Minecraft.World/SignUpdatePacket.cpp index 7b3a32179..cf2211008 100644 --- a/Minecraft.World/SignUpdatePacket.cpp +++ b/Minecraft.World/SignUpdatePacket.cpp @@ -62,8 +62,8 @@ int SignUpdatePacket::getEstimatedSize() l+=sizeof(int); l+=sizeof(short); l+=sizeof(int); - l+=sizeof(byte); - l+=sizeof(byte); + l+=sizeof(uint8_t); + l+=sizeof(uint8_t); for (int i = 0; i < MAX_SIGN_LINES; i++) l += (int)lines[i].length(); diff --git a/Minecraft.World/Skeleton.cpp b/Minecraft.World/Skeleton.cpp index 9afb95c6b..71f5c1dcd 100644 --- a/Minecraft.World/Skeleton.cpp +++ b/Minecraft.World/Skeleton.cpp @@ -63,7 +63,7 @@ void Skeleton::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) TYPE_DEFAULT); + entityData->define(DATA_TYPE_ID, (uint8_t) TYPE_DEFAULT); } bool Skeleton::useNewAi() @@ -311,7 +311,7 @@ int Skeleton::getSkeletonType() void Skeleton::setSkeletonType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); fireImmune = type == TYPE_WITHER; if (type == TYPE_WITHER) @@ -340,7 +340,7 @@ void Skeleton::readAdditionalSaveData(CompoundTag *tag) void Skeleton::addAdditonalSaveData(CompoundTag *entityTag) { Monster::addAdditonalSaveData(entityTag); - entityTag->putByte(L"SkeletonType", (byte) getSkeletonType()); + entityTag->putByte(L"SkeletonType", (uint8_t) getSkeletonType()); } void Skeleton::setEquippedSlot(int slot, shared_ptr item) diff --git a/Minecraft.World/Slime.cpp b/Minecraft.World/Slime.cpp index eb80d09c8..0555afca6 100644 --- a/Minecraft.World/Slime.cpp +++ b/Minecraft.World/Slime.cpp @@ -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); setSize(0.6f * size, 0.6f * size); setPos(x, y, z); getAttribute(SharedMonsterAttributes::MAX_HEALTH)->setBaseValue(size * size); diff --git a/Minecraft.World/Socket.cpp b/Minecraft.World/Socket.cpp index bd0c2032f..4aff17511 100644 --- a/Minecraft.World/Socket.cpp +++ b/Minecraft.World/Socket.cpp @@ -11,7 +11,7 @@ // link, the end (0 or 1) is passed as a parameter to the ctor. CRITICAL_SECTION Socket::s_hostQueueLock[2]; -std::queue Socket::s_hostQueue[2]; +std::queue Socket::s_hostQueue[2]; Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2]; Socket::SocketInputStreamLocal *Socket::s_hostInStream[2]; ServerConnection *Socket::s_serverConnection = NULL; @@ -29,7 +29,7 @@ void Socket::Initialise(ServerConnection *serverConnection) if(TryEnterCriticalSection(&s_hostQueueLock[i])) { // Clear the queue - std::queue empty; + std::queue empty; std::swap( s_hostQueue[i], empty ); LeaveCriticalSection(&s_hostQueueLock[i]); } @@ -256,7 +256,7 @@ Socket::SocketInputStreamLocal::SocketInputStreamLocal(int queueIdx) m_queueIdx = queueIdx; } -// Try and get an input byte, blocking until one is available +// Try and get an input uint8_t, blocking until one is available int Socket::SocketInputStreamLocal::read() { while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads)) @@ -265,7 +265,7 @@ int Socket::SocketInputStreamLocal::read() { if( s_hostQueue[m_queueIdx].size() ) { - byte retval = s_hostQueue[m_queueIdx].front(); + uint8_t retval = s_hostQueue[m_queueIdx].front(); s_hostQueue[m_queueIdx].pop(); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); return retval; @@ -330,7 +330,7 @@ void Socket::SocketOutputStreamLocal::write(unsigned int b) return; } EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); - s_hostQueue[m_queueIdx].push((byte)b); + s_hostQueue[m_queueIdx].push((uint8_t)b); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); } @@ -372,7 +372,7 @@ Socket::SocketInputStreamNetwork::SocketInputStreamNetwork(Socket *socket, int q m_socket = socket; } -// Try and get an input byte, blocking until one is available +// Try and get an input uint8_t, blocking until one is available int Socket::SocketInputStreamNetwork::read() { while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads)) @@ -381,7 +381,7 @@ int Socket::SocketInputStreamNetwork::read() { if( m_socket->m_queueNetwork[m_queueIdx].size() ) { - byte retval = m_socket->m_queueNetwork[m_queueIdx].front(); + uint8_t retval = m_socket->m_queueNetwork[m_queueIdx].front(); m_socket->m_queueNetwork[m_queueIdx].pop(); LeaveCriticalSection(&m_socket->m_queueLockNetwork[m_queueIdx]); return retval; @@ -441,8 +441,8 @@ void Socket::SocketOutputStreamNetwork::write(unsigned int b) { if( m_streamOpen != true ) return; byteArray barray; - byte bb; - bb = (byte)b; + uint8_t bb; + bb = (uint8_t)b; barray.data = &bb; barray.length = 1; write(barray, 0, 1); diff --git a/Minecraft.World/Socket.h b/Minecraft.World/Socket.h index 0019f9848..471bb1cdb 100644 --- a/Minecraft.World/Socket.h +++ b/Minecraft.World/Socket.h @@ -93,12 +93,12 @@ private: // For local connections between the host player and the server static CRITICAL_SECTION s_hostQueueLock[2]; - static std::queue s_hostQueue[2]; + static std::queue s_hostQueue[2]; static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketInputStreamLocal *s_hostInStream[2]; // For network connections - std::queue m_queueNetwork[2]; // For input data + std::queue m_queueNetwork[2]; // For input data CRITICAL_SECTION m_queueLockNetwork[2]; // For input data SocketInputStreamNetwork *m_inputStream[2]; SocketOutputStreamNetwork *m_outputStream[2]; diff --git a/Minecraft.World/SparseDataStorage.cpp b/Minecraft.World/SparseDataStorage.cpp index 6db131e78..cb9fb34a6 100644 --- a/Minecraft.World/SparseDataStorage.cpp +++ b/Minecraft.World/SparseDataStorage.cpp @@ -162,7 +162,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) //int shift = 4 * part; unsigned char *pucIn = &dataIn[ (y >> 1) + inOffset]; - for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination byte + for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination uint8_t { *pucOut = ( ( *pucIn ) >> ( part * 4 ) ) & 15; pucIn += 64; @@ -209,7 +209,7 @@ void SparseDataStorage::getData(byteArray retArray, unsigned int retOffset) int shift = 4 * part; unsigned char *pucOut = &retArray.data[ (y >> 1) + + retOffset]; unsigned char *pucIn = &data[ planeIndices[ y ] * 128 ]; - for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same byte + for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same uint8_t { unsigned char value = (*pucIn) & 15; *pucOut |= ( value << shift ); @@ -238,8 +238,8 @@ int SparseDataStorage::get(int x, int y, int z) else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; @@ -271,8 +271,8 @@ void SparseDataStorage::set(int x, int y, int z, int val) // Either data was already allocated, or we've just done that. Now store our value into the right place. int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int mask = 0xf0 >> shift; int idx = planeIndices[y] * 128 + byteIndex; diff --git a/Minecraft.World/SparseLightStorage.cpp b/Minecraft.World/SparseLightStorage.cpp index f9a2f0cbd..f81510e74 100644 --- a/Minecraft.World/SparseLightStorage.cpp +++ b/Minecraft.World/SparseLightStorage.cpp @@ -166,7 +166,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) //int shift = 4 * part; unsigned char *pucIn = &dataIn[ (y >> 1) + inOffset]; - for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination byte + for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination uint8_t { *pucOut = ( ( *pucIn ) >> ( part * 4 ) ) & 15; pucIn += 64; @@ -224,7 +224,7 @@ void SparseLightStorage::getData(byteArray retArray, unsigned int retOffset) int shift = 4 * part; unsigned char *pucOut = &retArray.data[ (y >> 1) + retOffset]; unsigned char *pucIn = &data[ planeIndices[ y ] * 128 ]; - for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same byte + for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same uint8_t { unsigned char value = (*pucIn) & 15; *pucOut |= ( value << shift ); @@ -257,8 +257,8 @@ int SparseLightStorage::get(int x, int y, int z) else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; @@ -294,8 +294,8 @@ void SparseLightStorage::set(int x, int y, int z, int val) // Either data was already allocated, or we've just done that. Now store our value into the right place. int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int mask = 0xf0 >> shift; int idx = planeIndices[y] * 128 + byteIndex; diff --git a/Minecraft.World/Spider.cpp b/Minecraft.World/Spider.cpp index 49997db39..65396e12d 100644 --- a/Minecraft.World/Spider.cpp +++ b/Minecraft.World/Spider.cpp @@ -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() @@ -172,7 +172,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; diff --git a/Minecraft.World/StemTile.cpp b/Minecraft.World/StemTile.cpp index bf9b058d1..937b6d9ca 100644 --- a/Minecraft.World/StemTile.cpp +++ b/Minecraft.World/StemTile.cpp @@ -128,9 +128,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; diff --git a/Minecraft.World/StringTag.h b/Minecraft.World/StringTag.h index 8eb0eb7fd..a926e4b03 100644 --- a/Minecraft.World/StringTag.h +++ b/Minecraft.World/StringTag.h @@ -18,7 +18,7 @@ public: data = dis->readUTF(); } - byte getId() { return TAG_String; } + uint8_t getId() { return TAG_String; } wstring toString() { diff --git a/Minecraft.World/SynchedEntityData.cpp b/Minecraft.World/SynchedEntityData.cpp index 655fa0c30..e53b9b391 100644 --- a/Minecraft.World/SynchedEntityData.cpp +++ b/Minecraft.World/SynchedEntityData.cpp @@ -25,7 +25,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); @@ -94,7 +94,7 @@ void SynchedEntityData::checkId(int id) #endif } -byte SynchedEntityData::getByte(int id) +uint8_t SynchedEntityData::getByte(int id) { return itemsById[id]->getValue_byte(); } @@ -144,7 +144,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 = itemsById[id]; @@ -359,7 +359,7 @@ vector > *SynchedEntityData::unpack(Data { case TYPE_BYTE: { - byte dataRead = input->readByte(); + uint8_t dataRead = input->readByte(); item = shared_ptr( new DataItem(itemType, itemId, dataRead) ); } break; @@ -488,7 +488,7 @@ int SynchedEntityData::getSizeInBytes() size += (int)dataItem->getValue_wstring().length() + 2; // Estimate, assuming all ascii chars break; case TYPE_ITEMINSTANCE: - // short + byte + short + // short + uint8_t + short size += 2 + 1 + 2; // Estimate, assuming all ascii chars break; default: @@ -510,7 +510,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; @@ -550,7 +550,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; } @@ -590,7 +590,7 @@ float SynchedEntityData::DataItem::getValue_float() return value_float; } -byte SynchedEntityData::DataItem::getValue_byte() +uint8_t SynchedEntityData::DataItem::getValue_byte() { return value_byte; } diff --git a/Minecraft.World/SynchedEntityData.h b/Minecraft.World/SynchedEntityData.h index 69d0f2487..b8141f899 100644 --- a/Minecraft.World/SynchedEntityData.h +++ b/Minecraft.World/SynchedEntityData.h @@ -16,7 +16,7 @@ public: // 4J - there used to be one "value" type here of general type Object, just storing the different (used) varieties // here separately for us union { - byte value_byte; + uint8_t value_byte; int value_int; short value_short; float value_float; @@ -27,7 +27,7 @@ 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); @@ -35,13 +35,13 @@ public: DataItem(int type, int id, float value); int getId(); - void setValue(byte value); + void setValue(uint8_t value); void setValue(int value); void setValue(short value); void setValue(float value); void setValue(const wstring& value); void setValue(shared_ptr value); - byte getValue_byte(); + uint8_t getValue_byte(); int getValue_int(); short getValue_short(); float getValue_float(); @@ -84,7 +84,7 @@ 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); @@ -92,7 +92,7 @@ public: 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); @@ -100,7 +100,7 @@ public: shared_ptr 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, float value); diff --git a/Minecraft.World/System.h b/Minecraft.World/System.h index 06e265cca..ae48ea68a 100644 --- a/Minecraft.World/System.h +++ b/Minecraft.World/System.h @@ -15,7 +15,7 @@ class System template static void arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length); public: - ArrayCopyFunctionDeclaration(byte) + ArrayCopyFunctionDeclaration(uint8_t) ArrayCopyFunctionDeclaration(Node *) ArrayCopyFunctionDeclaration(Biome *) ArrayCopyFunctionDeclaration(int) diff --git a/Minecraft.World/Tag.cpp b/Minecraft.World/Tag.cpp index adc753608..fefc469a4 100644 --- a/Minecraft.World/Tag.cpp +++ b/Minecraft.World/Tag.cpp @@ -84,7 +84,7 @@ Tag *Tag::readNamedTag(DataInput *dis) Tag *Tag::readNamedTag(DataInput *dis, int tagDepth) { - byte type = dis->readByte(); + uint8_t type = dis->readByte(); if (type == 0) return new EndTag(); // 4J Stu - readByte can return -1, so if it's that then also mark as the end tag @@ -101,7 +101,7 @@ Tag *Tag::readNamedTag(DataInput *dis, int tagDepth) Tag *tag = newTag(type, name); // short length = dis.readShort(); - // byte[] bytes = new byte[length]; + // uint8_t[] bytes = new uint8_t[length]; // dis.readFully(bytes); tag->load(dis, tagDepth); @@ -113,7 +113,7 @@ void Tag::writeNamedTag(Tag *tag, DataOutput *dos) dos->writeByte(tag->getId()); if (tag->getId() == Tag::TAG_End) return; - // byte[] bytes = tag.getName().getBytes("UTF-8"); + // uint8_t[] bytes = tag.getName().getBytes("UTF-8"); // dos.writeShort(bytes.length); // dos.write(bytes); dos->writeUTF(tag->getName()); @@ -121,7 +121,7 @@ void Tag::writeNamedTag(Tag *tag, DataOutput *dos) tag->write(dos); } -Tag *Tag::newTag(byte type, const wstring &name) +Tag *Tag::newTag(uint8_t type, const wstring &name) { switch (type) { @@ -153,7 +153,7 @@ Tag *Tag::newTag(byte type, const wstring &name) return NULL; } -wchar_t *Tag::getTagName(byte type) +const wchar_t *Tag::getTagName(uint8_t type) { switch (type) { diff --git a/Minecraft.World/Tag.h b/Minecraft.World/Tag.h index dcd067220..009672654 100644 --- a/Minecraft.World/Tag.h +++ b/Minecraft.World/Tag.h @@ -7,18 +7,18 @@ using namespace std; class Tag { public: - static const byte TAG_End = 0; - static const byte TAG_Byte = 1; - static const byte TAG_Short = 2; - static const byte TAG_Int = 3; - static const byte TAG_Long = 4; - static const byte TAG_Float = 5; - static const byte TAG_Double = 6; - static const byte TAG_Byte_Array = 7; - static const byte TAG_String = 8; - static const byte TAG_List = 9; - static const byte TAG_Compound = 10; - static const byte TAG_Int_Array = 11; + static const uint8_t TAG_End = 0; + static const uint8_t TAG_Byte = 1; + static const uint8_t TAG_Short = 2; + static const uint8_t TAG_Int = 3; + static const uint8_t TAG_Long = 4; + static const uint8_t TAG_Float = 5; + static const uint8_t TAG_Double = 6; + static const uint8_t TAG_Byte_Array = 7; + static const uint8_t TAG_String = 8; + static const uint8_t TAG_List = 9; + static const uint8_t TAG_Compound = 10; + static const uint8_t TAG_Int_Array = 11; static const int MAX_DEPTH = 512; private: wstring name; @@ -30,7 +30,7 @@ public: virtual void write(DataOutput *dos) = 0; virtual void load(DataInput *dis, int tagDepth) = 0; virtual wstring toString() = 0; - virtual byte getId() = 0; + virtual uint8_t getId() = 0; void print(ostream out); void print(char *prefix, wostream out); wstring getName(); @@ -38,8 +38,8 @@ public: static Tag *readNamedTag(DataInput *dis); static Tag *readNamedTag(DataInput *dis, int tagDepth); static void writeNamedTag(Tag *tag, DataOutput *dos); - static Tag *newTag(byte type, const wstring &name); - static wchar_t *getTagName(byte type); + static Tag *newTag(uint8_t type, const wstring &name); + static const wchar_t *getTagName(uint8_t type); virtual ~Tag() {} virtual bool equals(Tag *obj); // 4J Brought forward from 1.2 virtual Tag *copy() = 0; // 4J Brought foward from 1.2 diff --git a/Minecraft.World/TamableAnimal.cpp b/Minecraft.World/TamableAnimal.cpp index 2a3ea037f..14b250d1f 100644 --- a/Minecraft.World/TamableAnimal.cpp +++ b/Minecraft.World/TamableAnimal.cpp @@ -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""); } @@ -87,7 +87,7 @@ void TamableAnimal::spawnTamingParticles(bool success) } } -void TamableAnimal::handleEntityEvent(byte id) +void TamableAnimal::handleEntityEvent(uint8_t id) { if (id == EntityEvent::TAMING_SUCCEEDED) { @@ -110,14 +110,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)); } } @@ -128,14 +128,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)); } } diff --git a/Minecraft.World/TamableAnimal.h b/Minecraft.World/TamableAnimal.h index 7d17a43c4..85d1b84b9 100644 --- a/Minecraft.World/TamableAnimal.h +++ b/Minecraft.World/TamableAnimal.h @@ -27,7 +27,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(); diff --git a/Minecraft.World/TeleportEntityPacket.cpp b/Minecraft.World/TeleportEntityPacket.cpp index d31f5bc2f..45ee75e00 100644 --- a/Minecraft.World/TeleportEntityPacket.cpp +++ b/Minecraft.World/TeleportEntityPacket.cpp @@ -23,11 +23,11 @@ TeleportEntityPacket::TeleportEntityPacket(shared_ptr e) x = Mth::floor(e->x * 32); y = Mth::floor(e->y * 32); z = Mth::floor(e->z * 32); - yRot = (byte) (e->yRot * 256 / 360); - xRot = (byte) (e->xRot * 256 / 360); + yRot = (uint8_t) (e->yRot * 256 / 360); + xRot = (uint8_t) (e->xRot * 256 / 360); } -TeleportEntityPacket::TeleportEntityPacket(int id, int x, int y, int z, byte yRot, byte xRot) +TeleportEntityPacket::TeleportEntityPacket(int id, int x, int y, int z, uint8_t yRot, uint8_t xRot) { this->id = id; this->x = x; diff --git a/Minecraft.World/TeleportEntityPacket.h b/Minecraft.World/TeleportEntityPacket.h index 6fc28732b..8ceca4fa3 100644 --- a/Minecraft.World/TeleportEntityPacket.h +++ b/Minecraft.World/TeleportEntityPacket.h @@ -8,11 +8,11 @@ class TeleportEntityPacket : public Packet, public enable_shared_from_this e); - TeleportEntityPacket(int id, int x, int y, int z, byte yRot, byte xRot); + TeleportEntityPacket(int id, int x, int y, int z, uint8_t yRot, uint8_t xRot); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/TheEndBiome.cpp b/Minecraft.World/TheEndBiome.cpp index 9e2359ed0..fdab05511 100644 --- a/Minecraft.World/TheEndBiome.cpp +++ b/Minecraft.World/TheEndBiome.cpp @@ -14,8 +14,8 @@ TheEndBiome::TheEndBiome(int id) : Biome(id) ambientFriendlies.clear(); enemies.push_back(new MobSpawnerData(eTYPE_ENDERMAN, 10, 4, 4)); - topMaterial = (byte) Tile::dirt_Id; - material = (byte) Tile::dirt_Id; + topMaterial = (uint8_t) Tile::dirt_Id; + material = (uint8_t) Tile::dirt_Id; decorator = new TheEndBiomeDecorator(this); } diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp index 67d85a923..02d291de4 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp @@ -90,7 +90,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra } else { } - blocks[offs] = (byte) tileId; + blocks[offs] = (uint8_t) tileId; offs += step; val += vala; } @@ -119,8 +119,8 @@ void TheEndLevelRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray int runDepth = 1; int run = -1; - byte top = (byte) Tile::endStone_Id; - byte material = (byte) Tile::endStone_Id; + uint8_t top = (uint8_t) Tile::endStone_Id; + uint8_t material = (uint8_t) Tile::endStone_Id; for (int y = Level::genDepthMinusOne; y >= 0; y--) { @@ -139,7 +139,7 @@ void TheEndLevelRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray if (runDepth <= 0) { top = 0; - material = (byte) Tile::endStone_Id; + material = (uint8_t) Tile::endStone_Id; } run = runDepth; @@ -169,7 +169,7 @@ LevelChunk *TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs) BiomeArray biomes; // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed unsigned int blocksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,blocksSize); byteArray blocks = byteArray(tileData,blocksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/Throwable.cpp b/Minecraft.World/Throwable.cpp index 7d30b898d..c16998b1f 100644 --- a/Minecraft.World/Throwable.cpp +++ b/Minecraft.World/Throwable.cpp @@ -270,9 +270,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)); if (ownerName.empty() && (owner != NULL) && owner->instanceof(eTYPE_PLAYER) ) { diff --git a/Minecraft.World/TileEntityDataPacket.cpp b/Minecraft.World/TileEntityDataPacket.cpp index 41be45267..9b92c435c 100644 --- a/Minecraft.World/TileEntityDataPacket.cpp +++ b/Minecraft.World/TileEntityDataPacket.cpp @@ -50,7 +50,7 @@ void TileEntityDataPacket::write(DataOutputStream *dos) dos->writeInt(x); dos->writeShort(y); dos->writeInt(z); - dos->writeByte((byte) type); + dos->writeByte((uint8_t) type); writeNbt(tag, dos); } diff --git a/Minecraft.World/UpdateAttributesPacket.cpp b/Minecraft.World/UpdateAttributesPacket.cpp index e80ebe4ea..7268698d0 100644 --- a/Minecraft.World/UpdateAttributesPacket.cpp +++ b/Minecraft.World/UpdateAttributesPacket.cpp @@ -46,7 +46,7 @@ void UpdateAttributesPacket::read(DataInputStream *dis) { eMODIFIER_ID id = static_cast(dis->readInt()); double amount = dis->readDouble(); - byte operation = dis->readByte(); + uint8_t operation = dis->readByte(); modifiers.insert(new AttributeModifier(id, /*L"Unknown synced attribute modifier",*/ amount, operation)); } diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index f29012913..58cf21075 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -18,6 +18,8 @@ #include "Villager.h" #include "AbstractContainerMenu.h" +#include + unordered_map > Villager::MIN_MAX_VALUES; unordered_map > Villager::MIN_MAX_PRICES; @@ -513,7 +515,9 @@ void Villager::addOffers(int addCount) } // shuffle the list to make it more interesting - std::random_shuffle(newOffers->begin(), newOffers->end()); + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(newOffers->begin(), newOffers->end(), g); if (offers == NULL) { @@ -685,7 +689,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) { diff --git a/Minecraft.World/Villager.h b/Minecraft.World/Villager.h index d8aeb15a7..f015c2a2b 100644 --- a/Minecraft.World/Villager.h +++ b/Minecraft.World/Villager.h @@ -87,7 +87,7 @@ public: void setLastHurtByMob(shared_ptr mob); void die(DamageSource *source); - void handleEntityEvent(byte id); + void handleEntityEvent(uint8_t id); private: void addParticlesAroundSelf(ePARTICLE_TYPE particle); diff --git a/Minecraft.World/VillagerGolem.cpp b/Minecraft.World/VillagerGolem.cpp index dba80ffa7..0415570b7 100644 --- a/Minecraft.World/VillagerGolem.cpp +++ b/Minecraft.World/VillagerGolem.cpp @@ -53,7 +53,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() @@ -155,7 +155,7 @@ bool VillagerGolem::doHurtTarget(shared_ptr target) return hurt; } -void VillagerGolem::handleEntityEvent(byte id) +void VillagerGolem::handleEntityEvent(uint8_t id) { if (id == EntityEvent::START_ATTACKING) { @@ -231,14 +231,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)); } } diff --git a/Minecraft.World/VillagerGolem.h b/Minecraft.World/VillagerGolem.h index 55b6cae2a..3826fb52e 100644 --- a/Minecraft.World/VillagerGolem.h +++ b/Minecraft.World/VillagerGolem.h @@ -41,7 +41,7 @@ public: virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); virtual bool doHurtTarget(shared_ptr target); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual shared_ptr getVillage(); virtual int getAttackAnimationTick(); virtual void offerFlower(bool offer); diff --git a/Minecraft.World/Witch.cpp b/Minecraft.World/Witch.cpp index c697d4676..c4e05fde3 100644 --- a/Minecraft.World/Witch.cpp +++ b/Minecraft.World/Witch.cpp @@ -43,7 +43,7 @@ void Witch::defineSynchedData() { Monster::defineSynchedData(); - getEntityData()->define(DATA_USING_ITEM, (byte) 0); + getEntityData()->define(DATA_USING_ITEM, (uint8_t) 0); } int Witch::getAmbientSound() @@ -63,7 +63,7 @@ int Witch::getDeathSound() void Witch::setUsingItem(bool isUsing) { - getEntityData()->set(DATA_USING_ITEM, isUsing ? (byte) 1 : (byte) 0); + getEntityData()->set(DATA_USING_ITEM, isUsing ? (uint8_t) 1 : (uint8_t) 0); } bool Witch::isUsingItem() @@ -153,7 +153,7 @@ void Witch::aiStep() Monster::aiStep(); } -void Witch::handleEntityEvent(byte id) +void Witch::handleEntityEvent(uint8_t id) { if (id == EntityEvent::WITCH_HAT_MAGIC) { diff --git a/Minecraft.World/Witch.h b/Minecraft.World/Witch.h index 256f358f5..856cd6559 100644 --- a/Minecraft.World/Witch.h +++ b/Minecraft.World/Witch.h @@ -37,7 +37,7 @@ protected: public: virtual bool useNewAi(); virtual void aiStep(); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual float getDamageAfterMagicAbsorb(DamageSource *damageSource, float damage); diff --git a/Minecraft.World/WitherSkull.cpp b/Minecraft.World/WitherSkull.cpp index d67660c40..a7dd6a34c 100644 --- a/Minecraft.World/WitherSkull.cpp +++ b/Minecraft.World/WitherSkull.cpp @@ -111,7 +111,7 @@ bool WitherSkull::hurt(DamageSource *source, float damage) void WitherSkull::defineSynchedData() { - entityData->define(DATA_DANGEROUS, (byte) 0); + entityData->define(DATA_DANGEROUS, (uint8_t) 0); } bool WitherSkull::isDangerous() @@ -121,7 +121,7 @@ bool WitherSkull::isDangerous() void WitherSkull::setDangerous(bool value) { - entityData->set(DATA_DANGEROUS, value ? (byte) 1 : (byte) 0); + entityData->set(DATA_DANGEROUS, value ? (uint8_t) 1 : (uint8_t) 0); } bool WitherSkull::shouldBurn() diff --git a/Minecraft.World/Wolf.cpp b/Minecraft.World/Wolf.cpp index 1988382e1..2d4c5029a 100644 --- a/Minecraft.World/Wolf.cpp +++ b/Minecraft.World/Wolf.cpp @@ -100,8 +100,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) ColoredTile::getTileDataForItemAuxValue(DyePowderItem::RED)); + entityData->define(DATA_INTERESTED_ID, (uint8_t)0); + entityData->define(DATA_COLLAR_COLOR, (uint8_t) ColoredTile::getTileDataForItemAuxValue(DyePowderItem::RED)); } void Wolf::playStepSound(int xt, int yt, int zt, int t) @@ -114,7 +114,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) @@ -438,7 +438,7 @@ bool Wolf::mobInteract(shared_ptr player) return TamableAnimal::mobInteract(player); } -void Wolf::handleEntityEvent(byte id) +void Wolf::handleEntityEvent(uint8_t id) { if (id == EntityEvent::SHAKE_WETNESS) { @@ -485,14 +485,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)); } } @@ -503,7 +503,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 @@ -536,11 +536,11 @@ void Wolf::setIsInterested(bool value) { 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); } } diff --git a/Minecraft.World/Wolf.h b/Minecraft.World/Wolf.h index edfd38146..744562f92 100644 --- a/Minecraft.World/Wolf.h +++ b/Minecraft.World/Wolf.h @@ -63,7 +63,7 @@ public: virtual bool doHurtTarget(shared_ptr target); virtual void setTame(bool value); virtual bool mobInteract(shared_ptr player); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); float getTailAngle(); virtual bool isFood(shared_ptr item); virtual int getMaxSpawnClusterSize(); diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index 7cdc31809..c7ee2191c 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -68,9 +68,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); } int Zombie::getArmorValue() @@ -87,12 +87,12 @@ 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) (baby ? 1 : 0)); + getEntityData()->set(DATA_BABY_ID, (uint8_t) (baby ? 1 : 0)); if (level != NULL && !level->isClientSide) { @@ -107,12 +107,12 @@ void Zombie::setBaby(bool baby) 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() @@ -414,7 +414,7 @@ bool Zombie::mobInteract(shared_ptr 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))); @@ -422,7 +422,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) { @@ -441,7 +441,7 @@ bool Zombie::removeWhenFarAway() bool Zombie::isConverting() { - return getEntityData()->getByte(DATA_CONVERTING_ID) == (byte) 1; + return getEntityData()->getByte(DATA_CONVERTING_ID) == (uint8_t) 1; } void Zombie::finishConversion() diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index d79df1823..30a289e42 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -86,7 +86,7 @@ protected: virtual void startConverting(int time); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual bool removeWhenFarAway(); diff --git a/Minecraft.World/compression.cpp b/Minecraft.World/compression.cpp index 99c5228ab..47eed1661 100644 --- a/Minecraft.World/compression.cpp +++ b/Minecraft.World/compression.cpp @@ -64,9 +64,9 @@ HRESULT Compression::CompressLZXRLE(void *pDestination, unsigned int *pDestSize, unsigned char *pucOut = (unsigned char *)rleCompressBuf; // Compress with RLE first: - // 0 - 254 - encodes a single byte + // 0 - 254 - encodes a single uint8_t // 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s - // 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes + // 255 followed by 3-255, followed by a uint8_t - encodes a run of n + 1 bytes PIXBeginNamedEvent(0,"RLE compression"); do { @@ -123,9 +123,9 @@ HRESULT Compression::CompressRLE(void *pDestination, unsigned int *pDestSize, vo unsigned char *pucOut = (unsigned char *)rleCompressBuf; // Compress with RLE first: - // 0 - 254 - encodes a single byte + // 0 - 254 - encodes a single uint8_t // 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s - // 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes + // 255 followed by 3-255, followed by a uint8_t - encodes a run of n + 1 bytes PIXBeginNamedEvent(0,"RLE compression"); do { diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h index 37c3960ce..04b0328f5 100644 --- a/Minecraft.World/stdafx.h +++ b/Minecraft.World/stdafx.h @@ -18,7 +18,7 @@ typedef unsigned __int64 __uint64; #include #include #include -// TODO: reference additional headers your program requires here +// TODO: reference additional headers your program requirements here #include #endif diff --git a/Minecraft.World/x64headers/extraX64.h b/Minecraft.World/x64headers/extraX64.h index fa6ee0f99..cbf7dcafa 100644 --- a/Minecraft.World/x64headers/extraX64.h +++ b/Minecraft.World/x64headers/extraX64.h @@ -11,8 +11,6 @@ #define MULTITHREAD_ENABLE -typedef unsigned char byte; - const int XUSER_INDEX_ANY = 255; const int XUSER_INDEX_FOCUS = 254; @@ -332,10 +330,10 @@ public: #define PIXSetMarkerDeprecated(a, b, ...) PIXSetMarker(a, L ## b, __VA_ARGS__) #define PIXAddNamedCounter(a, b) PIXReportCounter( L ## b, a) #else -void PIXAddNamedCounter(int a, char *b, ...); -void PIXBeginNamedEvent(int a, char *b, ...); +void PIXAddNamedCounter(int a, const char *b, ...); +void PIXBeginNamedEvent(int a, const char *b, ...); void PIXEndNamedEvent(); -void PIXSetMarkerDeprecated(int a, char *b, ...); +void PIXSetMarkerDeprecated(int a, const char *b, ...); #endif void XSetThreadProcessor(HANDLE a, int b); @@ -418,7 +416,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0; struct XRNM_SEND_BUFFER { DWORD dwDataSize; - byte *pbyData; + uint8_t *pbyData; }; const int D3DBLEND_CONSTANTALPHA = 0;