diff --git a/.gitignore b/.gitignore index ef12716d3..9abf75075 100644 --- a/.gitignore +++ b/.gitignore @@ -436,3 +436,4 @@ Minecraft.Client/Saves/ # Visual Studio Per-User Config *.user +/out diff --git a/CMakeLists.txt b/CMakeLists.txt index dbdef3f63..327958f43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ target_include_directories(MinecraftClient PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/include" "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/Sentient/Include" "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers" + "${CMAKE_CURRENT_SOURCE_DIR}/include/" ) target_compile_definitions(MinecraftClient PRIVATE $<$:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64> diff --git a/Minecraft.Client/AchievementPopup.h b/Minecraft.Client/AchievementPopup.h index 3085dc6e0..4304a7e57 100644 --- a/Minecraft.Client/AchievementPopup.h +++ b/Minecraft.Client/AchievementPopup.h @@ -13,7 +13,7 @@ private: wstring title; wstring desc; Achievement *ach; - __int64 startTime; + int64_t startTime; ItemRenderer *ir; bool isHelper; diff --git a/Minecraft.Client/AchievementScreen.cpp b/Minecraft.Client/AchievementScreen.cpp index 0b41efe86..f6960e3ed 100644 --- a/Minecraft.Client/AchievementScreen.cpp +++ b/Minecraft.Client/AchievementScreen.cpp @@ -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.requirements", ach->requirements->name); + wstring msg = I18n::get(L"achievement.requires", ach->requirements->name); int height = font->wordWrapHeight(msg, width); fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000); font->drawWordWrap(msg, x, y + 12, width, 0xff705050); diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 315a80329..9b955cae9 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -830,8 +830,9 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) // Current Win64 path: identify QNet player by name and attach packet XUID. if (matchedQNetPlayer == NULL) { - for (BYTE smallId = 0; smallId < MINECRAFT_NET_MAX_PLAYERS; ++smallId) + for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { + BYTE smallId = static_cast(i); INetworkPlayer* np = g_NetworkManager.GetPlayerBySmallId(smallId); if (np == NULL) continue; diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index e8e0d147e..15a179787 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -133,7 +133,9 @@ enum eGameSetting { eGameSetting_MusicVolume=0, eGameSetting_SoundFXVolume, + eGameSetting_RenderDistance, eGameSetting_Gamma, + eGameSetting_FOV, eGameSetting_Difficulty, eGameSetting_Sensitivity_InGame, eGameSetting_Sensitivity_InMenu, diff --git a/Minecraft.Client/Common/App_structs.h b/Minecraft.Client/Common/App_structs.h index 4b221db7f..77e6e45ec 100644 --- a/Minecraft.Client/Common/App_structs.h +++ b/Minecraft.Client/Common/App_structs.h @@ -65,8 +65,8 @@ typedef struct // In-Menu sensitivity unsigned char ucMenuSensitivity; unsigned char ucInterfaceOpacity; - unsigned char ucPad02;//2 bytes of padding added here - unsigned char usPad03; + unsigned char ucPad02; // 1 uint8_t padding + unsigned char ucFov; // Adding another bitmask flag for more settings for 1.8.2 unsigned int uiBitmaskValues; // 0x00000001 - eGameSetting_Clouds - on diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 12e4368c1..4b8f5f5ba 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -25,7 +25,7 @@ #include #include #include -#include "..\Filesystem\Filesystem.h" +#include #ifdef __ORBIS__ #include @@ -64,9 +64,9 @@ void SoundEngine::playMusicTick() {}; #else #ifdef _WINDOWS64 -const char SoundEngine::m_szSoundPath[] = {"Windows64Media\\Sound\\"}; -const char SoundEngine::m_szMusicPath[] = {"music\\"}; -const char SoundEngine::m_szRedistName[] = {"redist64"}; +char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"}; +char SoundEngine::m_szMusicPath[]={"music\\"}; +char SoundEngine::m_szRedistName[]={"redist64"}; #elif defined _DURANGO char SoundEngine::m_szSoundPath[]={"Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; @@ -187,7 +187,7 @@ void SoundEngine::init(Options* pOptions) m_bSystemMusicPlaying = false; app.DebugPrintf("---miniaudio initialized\n"); - + return; } @@ -265,7 +265,6 @@ void SoundEngine::updateMiniAudio() finalVolume = 1.0f; ma_sound_set_volume(&s->sound, finalVolume); - ma_sound_set_pitch(&s->sound, s->info.pitch); if (s->info.bIs3D) @@ -471,67 +470,64 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa char finalPath[256]; sprintf_s(finalPath, "%s.wav", basePath); - if (!FileExists(finalPath)) - { - int count = 0; + const char* extensions[] = { ".ogg", ".wav", ".mp3" }; + size_t extCount = sizeof(extensions) / sizeof(extensions[0]); + bool found = false; - for (size_t i = 1; i < 32; i++) - { - char numberedFolder[256]; - sprintf_s(numberedFolder, "%s%d", basePath, i); - - DWORD attr = GetFileAttributesA(numberedFolder); - - if (attr != INVALID_FILE_ATTRIBUTES && - (attr & FILE_ATTRIBUTE_DIRECTORY)) - { - count++; - } - else - { - break; - } - } - - char chosenFolder[256]; - - if (count == 0) - { - sprintf_s(chosenFolder, "%s", basePath); - } - else - { - int chosen = (rand() % count) + 1; - sprintf_s(chosenFolder, "%s%d", basePath, chosen); - } - - char searchPattern[256]; - sprintf_s(searchPattern, "%s\\*.wav", chosenFolder); - - WIN32_FIND_DATAA findData; - HANDLE hFind = FindFirstFileA(searchPattern, &findData); - - const char* extensions[] = { ".ogg", ".wav", ".mp3" }; - size_t extCount = sizeof(extensions) / sizeof(extensions[0]); - bool found = false; - for (size_t i = 0; i < extCount; i++) + for (size_t extIdx = 0; extIdx < extCount; extIdx++) + { + char basePlusExt[256]; + sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]); + + DWORD attr = GetFileAttributesA(basePlusExt); + if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) { - sprintf_s(searchPattern, "%s\\*%s", chosenFolder, extensions[i]); - hFind = FindFirstFileA(searchPattern, &findData); - if (hFind != INVALID_HANDLE_VALUE) + sprintf_s(finalPath, "%s", basePlusExt); + found = true; + break; + } + } + + if (!found) + { + int count = 0; + + for (size_t extIdx = 0; extIdx < extCount; extIdx++) + { + for (size_t i = 1; i < 32; i++) { - found = true; - break; + char numberedPath[256]; + sprintf_s(numberedPath, "%s%d%s", basePath, i, extensions[extIdx]); + + DWORD attr = GetFileAttributesA(numberedPath); + if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) + { + count = i; + } } } - if (hFind == INVALID_HANDLE_VALUE) - { - app.DebugPrintf("No sound files found in %s\n", chosenFolder); - return; - } - sprintf_s(finalPath, "%s\\%s", chosenFolder, findData.cFileName); - FindClose(hFind); + if (count > 0) + { + int chosen = (rand() % count) + 1; + for (size_t extIdx = 0; extIdx < extCount; extIdx++) + { + char numberedPath[256]; + sprintf_s(numberedPath, "%s%d%s", basePath, chosen, extensions[extIdx]); + + DWORD attr = GetFileAttributesA(numberedPath); + if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) + { + sprintf_s(finalPath, "%s", numberedPath); + found = true; + break; + } + } + if (!found) + { + sprintf_s(finalPath, "%s%d.wav", basePath, chosen); + } + } } MiniAudioSound* s = new MiniAudioSound(); @@ -649,6 +645,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) float finalVolume = volume * m_MasterEffectsVolume; if (finalVolume > 1.0f) finalVolume = 1.0f; + printf("UI Sound volume set to %f\nEffects volume: %f\n", finalVolume, m_MasterEffectsVolume); ma_sound_set_volume(&s->sound, finalVolume); ma_sound_set_pitch(&s->sound, pitch); diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 2cbd9f59a..5417dcec9 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 const char m_szSoundPath[]; - static const char m_szMusicPath[]; - static const char m_szRedistName[]; - static const char *m_szStreamFileA[eStream_Max]; + static char m_szSoundPath[]; + static char m_szMusicPath[]; + static 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/SoundNames.cpp b/Minecraft.Client/Common/Audio/SoundNames.cpp index 1ab709b2e..ebb7e9ee1 100644 --- a/Minecraft.Client/Common/Audio/SoundNames.cpp +++ b/Minecraft.Client/Common/Audio/SoundNames.cpp @@ -6,14 +6,14 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= { - L"mob.chicken", // eSoundType_MOB_CHICKEN_AMBIENT - L"mob.chickenhurt", // eSoundType_MOB_CHICKEN_HURT - L"mob.chickenplop", // eSoundType_MOB_CHICKENPLOP - L"mob.cow", // eSoundType_MOB_COW_AMBIENT - L"mob.cowhurt", // eSoundType_MOB_COW_HURT - L"mob.pig", // eSoundType_MOB_PIG_AMBIENT - L"mob.pigdeath", // eSoundType_MOB_PIG_DEATH - L"mob.sheep", // eSoundType_MOB_SHEEP_AMBIENT + L"mob.chicken.say", // eSoundType_MOB_CHICKEN_AMBIENT + L"mob.chicken.hurt", // eSoundType_MOB_CHICKEN_HURT + L"mob.chicken.plop", // eSoundType_MOB_CHICKENPLOP + L"mob.cow.say", // eSoundType_MOB_COW_AMBIENT + L"mob.cow.hurt", // eSoundType_MOB_COW_HURT + L"mob.pig.say", // eSoundType_MOB_PIG_AMBIENT + L"mob.pig.death", // eSoundType_MOB_PIG_DEATH + L"mob.sheep.say", // eSoundType_MOB_SHEEP_AMBIENT L"mob.wolf.growl", // eSoundType_MOB_WOLF_GROWL L"mob.wolf.whine", // eSoundType_MOB_WOLF_WHINE L"mob.wolf.panting", // eSoundType_MOB_WOLF_PANTING @@ -43,15 +43,15 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= L"mob.silverfish.step", // eSoundType_MOB_SILVERFISH_STEP, L"mob.skeleton", // eSoundType_MOB_SKELETON_AMBIENT, L"mob.skeletonhurt", // eSoundType_MOB_SKELETON_HURT, - L"mob.spider", // eSoundType_MOB_SPIDER_AMBIENT, - L"mob.spiderdeath", // eSoundType_MOB_SPIDER_DEATH, + L"mob.spider.say", // eSoundType_MOB_SPIDER_AMBIENT, + L"mob.spider.death", // eSoundType_MOB_SPIDER_DEATH, L"mob.slime", // eSoundType_MOB_SLIME, - L"mob.slimeattack", // eSoundType_MOB_SLIME_ATTACK, - L"mob.creeper", // eSoundType_MOB_CREEPER_HURT, - L"mob.creeperdeath", // eSoundType_MOB_CREEPER_DEATH, - L"mob.zombie", // eSoundType_MOB_ZOMBIE_AMBIENT, - L"mob.zombiehurt", // eSoundType_MOB_ZOMBIE_HURT, - L"mob.zombiedeath", // eSoundType_MOB_ZOMBIE_DEATH, + L"mob.slime.attack", // eSoundType_MOB_SLIME_ATTACK, + L"mob.creeper.say", // eSoundType_MOB_CREEPER_HURT, + L"mob.creeper.death", // eSoundType_MOB_CREEPER_DEATH, + L"mob.zombie.say", // eSoundType_MOB_ZOMBIE_AMBIENT, + L"mob.zombie.hurt", // eSoundType_MOB_ZOMBIE_HURT, + L"mob.zombie.death", // eSoundType_MOB_ZOMBIE_DEATH, L"mob.zombie.wood", // eSoundType_MOB_ZOMBIE_WOOD, L"mob.zombie.woodbreak", // eSoundType_MOB_ZOMBIE_WOOD_BREAK, L"mob.zombie.metal", // eSoundType_MOB_ZOMBIE_METAL, @@ -86,7 +86,7 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= L"random.door_close", // eSoundType_RANDOM_DOOR_CLOSE, L"ambient.weather.rain", // eSoundType_AMBIENT_WEATHER_RAIN, L"ambient.weather.thunder", // eSoundType_AMBIENT_WEATHER_THUNDER, - L"ambient.cave.cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!! + L"ambient.cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!! #ifdef _XBOX L"ambient.cave.cave2", // eSoundType_CAVE_CAVE2 - removed the two sounds that were at 192k in the first ambient cave event #endif @@ -210,9 +210,9 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= L"mob.horse.soft", //eSoundType_MOB_HORSE_SOFT, L"mob.horse.jump", //eSoundType_MOB_HORSE_JUMP, - L"mob.witch.idle", //eSoundType_MOB_WITCH_IDLE, <--- missing - L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT, <--- missing - L"mob.witch.death", //eSoundType_MOB_WITCH_DEATH, <--- missing + L"mob.witch.ambient", //eSoundType_MOB_WITCH_IDLE, + L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT, + L"mob.witch.death", //eSoundType_MOB_WITCH_DEATH, L"mob.slime.big", //eSoundType_MOB_SLIME_BIG, L"mob.slime.small", //eSoundType_MOB_SLIME_SMALL, diff --git a/Minecraft.Client/Common/Audio/miniaudio.h b/Minecraft.Client/Common/Audio/miniaudio.h index 2e7e41380..2ee282e78 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 requirements the +To retrieve the device ID you will need to perform device enumeration, however this requires 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 requirements an explicit call to `ma_sound_start()` before anything will play: +a start time still requires 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 requirements linking to `-lpthread` and `-lm`. +through the command line requires 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 requirements linking to `-ldl`, `-lpthread` and `-lm`. You do not need any +The Linux build only requires 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 requirements linking to `-lpthread` and `-lm`. NetBSD uses audio(4), OpenBSD uses +The BSD build only requires 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 requirements API level 16+. +versions will fall back to OpenSL|ES which requires 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 requirements `MA_ENABLE_*` to | + | MA_ENABLE_ONLY_SPECIFIC_BACKENDS | Disables all backends by default and requires `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 requirements an explicit call to `ma_sound_start()` before +Note that scheduling a start time still requires 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 @@ -3674,7 +3674,7 @@ BSD 15.4. UWP --------- - UWP only supports default playback and capture devices. -- UWP requirements the Microphone capability to be enabled in the application's manifest (Package.appxmanifest): +- UWP requires the Microphone capability to be enabled in the application's manifest (Package.appxmanifest): ``` @@ -3791,8 +3791,8 @@ extern "C" { typedef signed int ma_int32; typedef unsigned int ma_uint32; #if defined(_MSC_VER) && !defined(__clang__) - typedef signed __int64 ma_int64; - typedef unsigned __int64 ma_uint64; + typedef signed long long ma_int64; + typedef unsigned long long ma_uint64; #else #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) #pragma GCC diagnostic push @@ -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 requirements absolute flexibility with its data delivery, it can optionally implement the `onDeviceDataLoop()` callback +If the backend requires 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 @@ -11249,7 +11249,7 @@ struct ma_sound float* pProcessingCache; /* Will be null if pDataSource is null. */ ma_uint32 processingCacheFramesRemaining; ma_uint32 processingCacheCap; - ma_bool8 ownsDataSource; + ma_bool8 ownsDataSource; /* We're declaring a resource manager data source object here to save us a malloc when loading a @@ -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, 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 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 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. */ @@ -11596,7 +11596,7 @@ IMPLEMENTATION #include /* select() (used for ma_sleep()). */ #include /* For nanosleep() */ - #include + #include #endif /* For fstat(), etc. */ @@ -11729,7 +11729,7 @@ IMPLEMENTATION #endif #if _MSC_VER >= 1600 && (defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219) - static MA_INLINE unsigned __int64 ma_xgetbv(int reg) + static MA_INLINE unsigned long long ma_xgetbv(int reg) { return _xgetbv(reg); } @@ -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 requirements both CPU and OS support. */ + /* AVX requires 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 requirements both CPU and OS support. */ + /* AVX2 requires both CPU and OS support. */ #if defined(MA_NO_CPUID) || defined(MA_NO_XGETBV) return MA_FALSE; #else @@ -17622,7 +17622,7 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority (void)stackSize; /* Suppress unused parameter warning. */ } #endif - + if (scheduler != -1) { int priorityMin = sched_get_priority_min(scheduler); @@ -23061,7 +23061,7 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device CoInitializeResult = ma_CoInitializeEx(pContext, NULL, MA_COINIT_VALUE); { hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); - } + } if (CoInitializeResult == S_OK || CoInitializeResult == S_FALSE) { ma_CoUninitialize(pContext); } if (FAILED(hr)) { /* <-- This is checking the call above to ma_CoCreateInstance(). */ @@ -29687,7 +29687,7 @@ static ma_result ma_device_start__alsa(ma_device* pDevice) } if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) { - /* + /* When data is written to the device we wait for the device to get ready to receive data with poll(). In my testing I have observed that poll() can sometimes block forever unless the device is started explicitly with snd_pcm_start() or some data is written with snd_pcm_writei(). @@ -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 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 +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 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 requirements us to *not* +This becomes a problem when stopping and then restarting the device. When the device is stopped, it's drained, which requires 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 requirements us to write data to the stream from outside the callback. This +resume the stream naively. This means that starting the stream requires 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.) @@ -35996,7 +35996,7 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev #endif } - + status = ((ma_AudioUnitSetProperty_proc)pContext->coreaudio.AudioUnitSetProperty)(pData->audioUnit, kAudioUnitProperty_StreamFormat, formatScope, formatElement, &bestFormat, sizeof(bestFormat)); if (status != noErr) { ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit); @@ -39310,7 +39310,7 @@ static void ma_stream_error_callback__aaudio(ma_AAudioStream* pStream, void* pUs (void)error; ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[AAudio] ERROR CALLBACK: error=%d, AAudioStream_getState()=%d\n", error, ((MA_PFN_AAudioStream_getState)pDevice->pContext->aaudio.AAudioStream_getState)(pStream)); - + /* When we get an error, we'll assume that the stream is in an erroneous state and needs to be restarted. From the documentation, we cannot do this from the error callback. Therefore we are going to use an event thread for the AAudio backend to do this @@ -39322,13 +39322,13 @@ static void ma_stream_error_callback__aaudio(ma_AAudioStream* pStream, void* pUs else { job = ma_job_init(MA_JOB_TYPE_DEVICE_AAUDIO_REROUTE); job.data.device.aaudio.reroute.pDevice = pDevice; - + if (pStream == pDevice->aaudio.pStreamCapture) { job.data.device.aaudio.reroute.deviceType = ma_device_type_capture; } else { job.data.device.aaudio.reroute.deviceType = ma_device_type_playback; } - + result = ma_device_job_thread_post(&pDevice->pContext->aaudio.jobThread, &job); if (result != MA_SUCCESS) { ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_INFO, "[AAudio] Device Disconnected. Failed to post job for rerouting.\n"); @@ -39925,7 +39925,7 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev /* We got disconnected! Retry a few times, until we find a connected device! */ iAttempt = 0; - while (iAttempt++ < maxAttempts) { + while (iAttempt++ < maxAttempts) { /* Device tearing down? No need to reroute! */ if (ma_atomic_bool32_get(&pDevice->aaudio.isTearingDown)) { result = MA_SUCCESS; /* Caller should continue as normal. */ @@ -40023,7 +40023,7 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev break; } } - + return result; } @@ -42076,7 +42076,7 @@ static ma_result ma_device_init__webaudio(ma_device* pDevice, const ma_device_co } #else { - /* ScriptProcessorNode. This path requirements us to do almost everything in JS, but we'll do as much as we can in C. */ + /* ScriptProcessorNode. This path requires 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 requirements us to perform format and + this iteration, for both input and output. The resampler requires 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. @@ -61704,7 +61704,7 @@ static ma_result ma_default_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_inf /* Not implemented. Fall back to seek/tell/seek. */ ma_int64 cursor; ma_int64 sizeInBytes; - + result = ma_default_vfs_tell(pVFS, file, &cursor); if (result != MA_SUCCESS) { return result; @@ -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 requirements samples be in floating point format. This is checked in ma_data_source_node_init(). */ + /* The node graph system requires 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 requirements continuous processing to ensure the tail get's processed. */ + MA_NODE_FLAG_CONTINUOUS_PROCESSING /* Delay requires 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) @@ -76937,7 +76937,7 @@ static void ma_engine_node_process_pcm_frames__sound(ma_node* pNode, const float if (pSound->processingCacheFramesRemaining > 0) { MA_MOVE_MEMORY(pSound->pProcessingCache, ma_offset_pcm_frames_ptr_f32(pSound->pProcessingCache, frameCountIn, dataSourceChannels), pSound->processingCacheFramesRemaining * ma_get_bytes_per_frame(ma_format_f32, dataSourceChannels)); } - + totalFramesRead += (ma_uint32)frameCountOut; /* Safe cast. */ if (result != MA_SUCCESS || ma_sound_at_end(pSound)) { @@ -78439,7 +78439,7 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con if (pSound->processingCacheCap == 0) { pSound->processingCacheCap = 512; } - + pSound->pProcessingCache = (float*)ma_calloc(pSound->processingCacheCap * ma_get_bytes_per_frame(ma_format_f32, engineNodeConfig.channelsIn), &pEngine->allocationCallbacks); if (pSound->pProcessingCache == NULL) { ma_engine_node_uninit(&pSound->engineNode, &pEngine->allocationCallbacks); @@ -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 requirements knowledge of the channel count of the underlying data source before it can + The engine requires 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 requirements us to schedule the stop into the future by the fade length. */ + /* Stopping with a fade out requires 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; diff --git a/Minecraft.Client/Common/Audio/stb_vorbis.h b/Minecraft.Client/Common/Audio/stb_vorbis.h index 55616a803..5f61df6a2 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 requirements +// gets num_samples samples, not necessarily on a frame boundary--this requires // 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 requirements +// gets num_samples samples, not necessarily on a frame boundary--this requires // 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,7 +446,7 @@ 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 requirements endianness be defined correctly. +// most platforms which requires endianness be defined correctly. //#define STB_VORBIS_NO_FAST_SCALED_FLOAT @@ -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 requirements storing +// back on binary searching for the correct one. This requires 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 -// requirements more memory and is very likely slower, so I don't think +// requires 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 @@ -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 -// requirements a more sophisticated construction, since symbols in +// requires 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 requirements extra storage, #2 is slow, #3 can use binary search! + // #1 requires 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 requirements half as many ops +// but only requires 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 requirements + // isn't valid, but this seems to be what the spec requires 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 requirements a full ogg parse, but we know we can fetch from f->stream + // this requires 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 diff --git a/Minecraft.Client/Common/C4JMemoryPool.h b/Minecraft.Client/Common/C4JMemoryPool.h index e1e795ec2..78f5629de 100644 --- a/Minecraft.Client/Common/C4JMemoryPool.h +++ b/Minecraft.Client/Common/C4JMemoryPool.h @@ -153,7 +153,7 @@ public: virtual void* Alloc(size_t size) { - size = Align(size, 4); // 4 byte align the memory + size = Align(size, 4); // 4 uint8_t align the memory assert((m_currentOffset + size) < m_totalSize); // make sure we haven't ran out of space void* returnMem = &m_pMemory[m_currentOffset]; // grab the return memory m_currentOffset += size; diff --git a/Minecraft.Client/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Colours/ColourTable.cpp index d973fd258..fa1e9d691 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Colours/ColourTable.cpp @@ -5,7 +5,7 @@ unordered_map ColourTable::s_colourNamesMap; const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = - { +{ L"NOTSET", L"Foliage_Evergreen", diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index a2dd73b02..43cf73e15 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -207,7 +207,7 @@ CMinecraftApp::CMinecraftApp() #ifdef _XBOX // m_bTransferSavesToXboxOne=false; // m_uiTransferSlotC=5; -#endif +#endif #if (defined _CONTENT_PACAKGE) || (defined _XBOX) m_bUseDPadForDebug = false; @@ -224,7 +224,7 @@ CMinecraftApp::CMinecraftApp() for(int i=0;i; + m_vBannedListA[i] = new vector; } LocaleAndLanguageInit(); @@ -270,7 +270,7 @@ void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...) { SceUID tty2 = sceIoOpen("tty2:", SCE_O_WRONLY, 0); if(tty2>=0) - { + { std::string string1(buf); sceIoWrite(tty2, string1.c_str(), string1.length()); sceIoClose(tty2); @@ -281,7 +281,7 @@ void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...) { SceUID tty3 = sceIoOpen("tty3:", SCE_O_WRONLY, 0); if(tty3>=0) - { + { std::string string1(buf); sceIoWrite(tty3, string1.c_str(), string1.length()); sceIoClose(tty3); @@ -331,7 +331,7 @@ void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param) m_eXuiAction[iPad]=action; m_eXuiActionParam[iPad] = param; } -} +} bool CMinecraftApp::IsAppPaused() { @@ -367,7 +367,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad) // // test an update of the profile data // void *pData=ProfileManager.GetGameDefinedProfileData(iPad); - // + // // unsigned char *pchData= (unsigned char *)pData; // int iCount=0; // for(int i=0;i player, CraftingPanelScreenInput* initData = new CraftingPanelScreenInput(); initData->player = player; - initData->iContainerType=RECIPE_TYPE_3x3; + initData->iContainerType=RECIPE_TYPE_3x3; initData->iPad = iPad; initData->x = x; initData->y = y; @@ -589,7 +589,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr inventory, initData->container = container; initData->iPad = iPad; - // Load the scene. + // Load the scene. if(app.GetLocalPlayerCount()>1) { initData->bSplitscreen=true; @@ -835,7 +835,9 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con { SetGameSettings(iPad,eGameSetting_MusicVolume,DEFAULT_VOLUME_LEVEL); SetGameSettings(iPad,eGameSetting_SoundFXVolume,DEFAULT_VOLUME_LEVEL); + SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); + SetGameSettings(iPad,eGameSetting_FOV,0); // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==NULL) @@ -912,7 +914,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con // 4J-JEV: We cannot change these in-game, as they could affect localised strings and font. // XB1: Fix for #172947 - Content: Gameplay: While playing in language different form system default one and resetting options to their defaults in active gameplay causes in-game language to change and HUD to disappear - if (!app.GetGameStarted()) + if (!app.GetGameStarted()) { GameSettingsA[iPad]->ucLanguage = MINECRAFT_LANGUAGE_DEFAULT; // use the system language GameSettingsA[iPad]->ucLocale = MINECRAFT_LANGUAGE_DEFAULT; // use the system locale @@ -1022,7 +1024,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat case PROFILE_VERSION_1: case PROFILE_VERSION_2: // need to fill in values for the new profile data. No need to save the profile - that'll happen if they get changed, or if the auto save for the profile kicks in - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu pGameSettings->ucInterfaceOpacity=80; //eGameSetting_Sensitivity_InMenu @@ -1068,7 +1070,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_3: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->uiBitmaskValues=0L; // reset pGameSettings->uiBitmaskValues|=GAMESETTING_CLOUDS; //eGameSetting_Clouds - on @@ -1202,7 +1204,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_7: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; // reset the display new message counter pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) @@ -1225,7 +1227,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; #endif case PROFILE_VERSION_8: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; // reset the display new message counter pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) @@ -1243,7 +1245,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_9: // PS3DEC13 - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) pGameSettings->uiBitmaskValues&=~GAMESETTING_PS3EULAREAD; //eGameSetting_PS3_EULA_Read - off @@ -1254,7 +1256,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat } break; case PROFILE_VERSION_10: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) pGameSettings->ucLanguage = MINECRAFT_LANGUAGE_DEFAULT; // use the system language @@ -1273,7 +1275,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat } break; default: - { + { // This might be from a version during testing of new profile updates app.DebugPrintf("Don't know what to do with this profile version!\n"); #ifndef _CONTENT_PACKAGE @@ -1329,7 +1331,9 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad) { ActionGameSettings(iPad,eGameSetting_MusicVolume ); ActionGameSettings(iPad,eGameSetting_SoundFXVolume ); + ActionGameSettings(iPad,eGameSetting_RenderDistance ); ActionGameSettings(iPad,eGameSetting_Gamma ); + ActionGameSettings(iPad,eGameSetting_FOV ); ActionGameSettings(iPad,eGameSetting_Difficulty ); ActionGameSettings(iPad,eGameSetting_Sensitivity_InGame ); ActionGameSettings(iPad,eGameSetting_ViewBob ); @@ -1375,7 +1379,16 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) if(iPad==ProfileManager.GetPrimaryPad()) { pMinecraft->options->set(Options::Option::SOUND,((float)GameSettingsA[iPad]->ucSoundFXVolume)/100.0f); - } + } + break; + case eGameSetting_RenderDistance: + if(iPad == ProfileManager.GetPrimaryPad()) + { + int dist = (GameSettingsA[iPad]->uiBitmaskValues >> 16) & 0xFF; + + int level = UIScene_SettingsGraphicsMenu::DistanceToLevel(dist); + pMinecraft->options->set(Options::Option::RENDER_DISTANCE, 3 - level); + } break; case eGameSetting_Gamma: if(iPad==ProfileManager.GetPrimaryPad()) @@ -1387,8 +1400,16 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) float fVal=((float)GameSettingsA[iPad]->ucGamma)*327.68f; RenderManager.UpdateGamma((unsigned short)fVal); #endif - } + } + break; + case eGameSetting_FOV: + if(iPad==ProfileManager.GetPrimaryPad()) + { + float fovDeg = 70.0f + (float)GameSettingsA[iPad]->ucFov * 40.0f / 100.0f; + pMinecraft->gameRenderer->SetFovVal(fovDeg); + pMinecraft->options->set(Options::Option::FOV, (float)GameSettingsA[iPad]->ucFov / 100.0f); + } break; case eGameSetting_Difficulty: if(iPad==ProfileManager.GetPrimaryPad()) @@ -1538,7 +1559,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) //nothing to do here break; case eGameSetting_BedrockFog: - { + { bool bInGame=pMinecraft->level!=NULL; // Game Host only @@ -1618,7 +1639,7 @@ DWORD CMinecraftApp::GetPlayerSkinId(int iPad) // 4J Stu - DLC skins are numbered using decimal rather than hex to make it easier to number manually swprintf(chars, 256, L"dlcskin%08d.png", GET_DLC_SKIN_ID_FROM_BITMASK(dwSkin)); - Pack=app.m_dlcManager.getPackContainingSkin(chars); + Pack=app.m_dlcManager.getPackContainingSkin(chars); if(Pack) { @@ -1742,7 +1763,7 @@ void CMinecraftApp::ValidateFavoriteSkins(int iPad) if( pDLCPack->hasPurchasedFile(DLCManager::e_DLCType_Skin, L"") || (pSkinFile && pSkinFile->isFree())) { - GameSettingsA[iPad]->uiFavoriteSkinA[uiValidSkin++]=GameSettingsA[iPad]->uiFavoriteSkinA[i]; + GameSettingsA[iPad]->uiFavoriteSkinA[uiValidSkin++]=GameSettingsA[iPad]->uiFavoriteSkinA[i]; } } } @@ -1774,7 +1795,7 @@ unsigned int CMinecraftApp::GetMashupPackWorlds(int iPad) void CMinecraftApp::SetMinecraftLanguage(int iPad, unsigned char ucLanguage) { - GameSettingsA[iPad]->ucLanguage = ucLanguage; + GameSettingsA[iPad]->ucLanguage = ucLanguage; GameSettingsA[iPad]->bSettingsChanged = true; } @@ -1793,7 +1814,7 @@ unsigned char CMinecraftApp::GetMinecraftLanguage(int iPad) void CMinecraftApp::SetMinecraftLocale(int iPad, unsigned char ucLocale) { - GameSettingsA[iPad]->ucLocale = ucLocale; + GameSettingsA[iPad]->ucLocale = ucLocale; GameSettingsA[iPad]->bSettingsChanged = true; } @@ -1834,10 +1855,21 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV if(iPad==ProfileManager.GetPrimaryPad()) { ActionGameSettings(iPad,eVal); - } + } GameSettingsA[iPad]->bSettingsChanged=true; } break; + case eGameSetting_RenderDistance: + { + unsigned int val = ucVal & 0xFF; + + GameSettingsA[iPad]->uiBitmaskValues &= ~(0xFF << 16); + GameSettingsA[iPad]->uiBitmaskValues |= val << 16; + if(iPad == ProfileManager.GetPrimaryPad()) + ActionGameSettings(iPad,eVal); + GameSettingsA[iPad]->bSettingsChanged = true; + } + break; case eGameSetting_Gamma: if(GameSettingsA[iPad]->ucGamma!=ucVal) { @@ -1849,6 +1881,17 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; + case eGameSetting_FOV: + if(GameSettingsA[iPad]->ucFov!=ucVal) + { + GameSettingsA[iPad]->ucFov=ucVal; + if(iPad==ProfileManager.GetPrimaryPad()) + { + ActionGameSettings(iPad,eVal); + } + GameSettingsA[iPad]->bSettingsChanged=true; + } + break; case eGameSetting_Difficulty: if((GameSettingsA[iPad]->usBitmaskValues&0x03)!=(ucVal&0x03)) { @@ -2194,9 +2237,9 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; - case eGameSetting_UISize: + } + break; + case eGameSetting_UISize: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE)!=((ucVal&0x03)<<11)) { GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_UISIZE; @@ -2208,7 +2251,7 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; - case eGameSetting_UISizeSplitscreen: + case eGameSetting_UISizeSplitscreen: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE_SPLITSCREEN)!=((ucVal&0x03)<<13)) { GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_UISIZE_SPLITSCREEN; @@ -2233,8 +2276,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; case eGameSetting_PS3_EULA_Read: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PS3EULAREAD)!=(ucVal&0x01)<<16) { @@ -2248,8 +2291,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; case eGameSetting_PSVita_NetworkModeAdhoc: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PSVITANETWORKMODEADHOC)!=(ucVal&0x01)<<17) { @@ -2263,8 +2306,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; } } @@ -2286,9 +2329,19 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_SoundFXVolume: return GameSettingsA[iPad]->ucSoundFXVolume; break; + case eGameSetting_RenderDistance: + { + int val = (GameSettingsA[iPad]->uiBitmaskValues >> 16) & 0xFF; + if(val == 0) return val = 16; //brain + return val; + break; + } case eGameSetting_Gamma: return GameSettingsA[iPad]->ucGamma; break; + case eGameSetting_FOV: + return GameSettingsA[iPad]->ucFov; + break; case eGameSetting_Difficulty: return GameSettingsA[iPad]->usBitmaskValues&0x0003; break; @@ -2353,7 +2406,7 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) break; case eGameSetting_DisplayUpdateMessage: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_DISPLAYUPDATEMSG)>>4; - break; + break; case eGameSetting_BedrockFog: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_BEDROCKFOG)>>6; break; @@ -2685,13 +2738,13 @@ void CMinecraftApp::HandleXuiActions(void) param = m_eXuiActionParam[i]; if(eAction!=eAppAction_Idle) - { + { switch(eAction) { // the renderer will capture a screenshot case eAppAction_SocialPost: if(ProfileManager.IsFullVersion()) - { + { // Facebook Share if( CSocialManager::Instance()->IsTitleAllowedToPostImages() && CSocialManager::Instance()->AreAllUsersAllowedToPostImages() ) { @@ -2761,7 +2814,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_AutosaveSaveGame: - { + { // Need to run a check to see if the save exists in order to stop the dialog asking if we want to overwrite it coming up on an autosave bool bSaveExists; StorageManager.DoesSaveExist(&bSaveExists); @@ -2771,7 +2824,7 @@ void CMinecraftApp::HandleXuiActions(void) { // flag the render to capture the screenshot for the save - SetAction(i,eAppAction_AutosaveSaveGameCapturedThumbnail); + SetAction(i,eAppAction_AutosaveSaveGameCapturedThumbnail); } } @@ -2834,7 +2887,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_AutosaveSaveGameCapturedThumbnail: - { + { app.SetAutosaveTimerTime(); SetAction(i,eAppAction_Idle); @@ -2884,7 +2937,7 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_ExitPlayer: // a secondary player has chosen to quit { - int iPlayerC=g_NetworkManager.GetPlayerCount(); + int iPlayerC=g_NetworkManager.GetPlayerCount(); // Since the player is exiting, let's flush any profile writes for them, and hope we're not breaking TCR 136... #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) @@ -2905,7 +2958,7 @@ void CMinecraftApp::HandleXuiActions(void) // not required - it's done within the removeLocalPlayerIdx // if(pMinecraft->level->isClientSide) - // { + // { // // we need to remove the qnetplayer, or this player won't be able to get back into the game until qnet times out and removes them // g_NetworkManager.NotifyPlayerLeaving(g_NetworkManager.GetLocalPlayerByUserIndex(i)); // } @@ -2944,9 +2997,9 @@ void CMinecraftApp::HandleXuiActions(void) if(iPlayerC>2) // one player is about to leave here - they'll be set to idle in the qnet manager player leave { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false); @@ -2961,9 +3014,9 @@ void CMinecraftApp::HandleXuiActions(void) else { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); @@ -2978,7 +3031,7 @@ void CMinecraftApp::HandleXuiActions(void) #ifdef _DURANGO ProfileManager.RemoveGamepadFromGame(i); -#endif +#endif SetAction(i,eAppAction_Idle); } @@ -2991,7 +3044,7 @@ void CMinecraftApp::HandleXuiActions(void) StorageManager.ForceQueuedProfileWrites(i); #else ProfileManager.ForceQueuedProfileWrites(i); -#endif +#endif // if there are any tips showing, we need to close them pMinecraft->gui->clearMessages(i); @@ -3026,9 +3079,9 @@ void CMinecraftApp::HandleXuiActions(void) if(iPlayerC>2) // one player is about to leave here - they'll be set to idle in the qnet manager player leave { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false); @@ -3043,9 +3096,9 @@ void CMinecraftApp::HandleXuiActions(void) else { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); @@ -3100,7 +3153,7 @@ void CMinecraftApp::HandleXuiActions(void) SetAction(i,eAppAction_Idle); // If we're already leaving don't exit - if (g_NetworkManager.IsLeavingGame()) + if (g_NetworkManager.IsLeavingGame()) { break; } @@ -3131,7 +3184,7 @@ void CMinecraftApp::HandleXuiActions(void) Minecraft::GetInstance()->forceStatsSave(j); } } - LeaderboardManager::Instance()->CloseSession(); + LeaderboardManager::Instance()->CloseSession(); #elif (defined _XBOX) ProfileManager.ForceQueuedProfileWrites(); #endif @@ -3151,7 +3204,7 @@ void CMinecraftApp::HandleXuiActions(void) #ifdef _DURANGO ProfileManager.RemoveGamepadFromGame(i); -#endif +#endif SetAction(i,eAppAction_Idle); return; } @@ -3173,9 +3226,9 @@ void CMinecraftApp::HandleXuiActions(void) if(g_NetworkManager.GetPlayerCount()>1) { for(int j=0;jlocalplayers[j]) - { + { if(g_NetworkManager.IsLocalGame()) { app.SetRichPresenceContext(j,CONTEXT_GAME_STATE_BLANK); @@ -3194,7 +3247,7 @@ void CMinecraftApp::HandleXuiActions(void) { app.SetRichPresenceContext(i,CONTEXT_GAME_STATE_BLANK); if(g_NetworkManager.IsLocalGame()) - { + { ProfileManager.SetCurrentGameActivity(i,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); } else @@ -3230,7 +3283,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::ExitWorldThreadProc; - loadingParams->lpParam = param; + loadingParams->lpParam = param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); // If param is non-null then this is a forced exit by the server, so make sure the player knows why @@ -3243,11 +3296,11 @@ void CMinecraftApp::HandleXuiActions(void) completionData->iPad = DEFAULT_XUI_MENU_USER; loadingParams->completionData = completionData; - ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } break; case eAppAction_ExitWorldTrial: - { + { SetAction(i,eAppAction_Idle); pMinecraft->gui->clearMessages(); @@ -3274,7 +3327,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::ExitWorldThreadProc; - loadingParams->lpParam = param; + loadingParams->lpParam = param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3310,7 +3363,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 requirements a dimension change then the action will have changed + // If the respawn requires a dimension change then the action will have changed //if(app.GetXuiAction(i) == eAppAction_Respawn) //{ // SetAction(i,eAppAction_Idle); @@ -3344,7 +3397,7 @@ void CMinecraftApp::HandleXuiActions(void) //app.NavigateToScene(i,eUIScene_FullscreenProgress, loadingParams, true); } - } + } break; case eAppAction_WaitForRespawnComplete: player = pMinecraft->localplayers[i]; @@ -3384,8 +3437,8 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_PrimaryPlayerSignedOut: - { - //SetAction(i,eAppAction_Idle); + { + //SetAction(i,eAppAction_Idle); // clear the autosavetimer that might be displayed ui.ShowAutosaveCountdownTimer(false); @@ -3403,10 +3456,10 @@ void CMinecraftApp::HandleXuiActions(void) // 4J-PB - the libs will display the Returned to Title screen // UINT uiIDA[1]; // uiIDA[0]=IDS_CONFIRM_OK; - // + // // ui.RequestMessageBox(IDS_RETURNEDTOMENU_TITLE, IDS_RETURNEDTOTITLESCREEN_TEXT, uiIDA, 1, i,&CMinecraftApp::PrimaryPlayerSignedOutReturned,this,app.GetStringTable()); if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(i,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -3454,7 +3507,7 @@ void CMinecraftApp::HandleXuiActions(void) if (!gameStarted) { - // 1. Exit + // 1. Exit MinecraftServer::HaltServer(); // Fix for #12530 - TCR 001 BAS Game Stability: Title will crash if the player disconnects while starting a new world and then opts to play the tutorial once they have been returned to the Main Menu. @@ -3478,7 +3531,7 @@ void CMinecraftApp::HandleXuiActions(void) } else { -#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ +#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ if(UIScene_LoadOrJoinMenu::isSaveTransferRunning()) { // the save transfer is still in progress, delay jumping back to the main menu until we've cleaned up @@ -3547,7 +3600,7 @@ void CMinecraftApp::HandleXuiActions(void) } LoadingInputParams *loadingParams = new LoadingInputParams(); - loadingParams->func = &CMinecraftApp::SignoutExitWorldThreadProc; + loadingParams->func = &CMinecraftApp::SignoutExitWorldThreadProc; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3585,7 +3638,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_TrialOver: - { + { SetAction(i,eAppAction_Idle); UINT uiIDA[2]; uiIDA[0]=IDS_UNLOCK_TITLE; @@ -3597,7 +3650,7 @@ void CMinecraftApp::HandleXuiActions(void) // INVITES case eAppAction_DashboardTrialJoinFromInvite: - { + { TelemetryManager->RecordUpsellPresented(i, eSen_UpsellID_Full_Version_Of_Game, app.m_dwOfferID); SetAction(i,eAppAction_Idle); @@ -3609,7 +3662,7 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_ExitAndJoinFromInvite: - { + { UINT uiIDA[3]; SetAction(i,eAppAction_Idle); @@ -3618,7 +3671,7 @@ void CMinecraftApp::HandleXuiActions(void) #if defined(_XBOX_ONE) || defined(__ORBIS__) // Show save option is saves ARE disabled if(ProfileManager.IsFullVersion() && StorageManager.GetSaveDisabled() && i==ProfileManager.GetPrimaryPad() && g_NetworkManager.IsHost() && GetGameStarted() ) - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; @@ -3628,7 +3681,7 @@ void CMinecraftApp::HandleXuiActions(void) else #else if(ProfileManager.IsFullVersion() && !StorageManager.GetSaveDisabled() && i==ProfileManager.GetPrimaryPad() && g_NetworkManager.IsHost() && GetGameStarted() ) - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; @@ -3648,7 +3701,7 @@ void CMinecraftApp::HandleXuiActions(void) ui.RequestErrorMessage(IDS_UNLOCK_TITLE, IDS_UNLOCK_ACCEPT_INVITE, uiIDA, 2, i,&CMinecraftApp::UnlockFullInviteReturned,this); } else - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_LEAVE_VIA_INVITE, uiIDA, 2,i,&CMinecraftApp::ExitAndJoinFromInvite,this); @@ -3736,7 +3789,7 @@ void CMinecraftApp::HandleXuiActions(void) if(ProfileManager.IsSignedIn(index) ) { if(index==i || pMinecraft->localplayers[index]!=NULL ) - { + { m_InviteData.dwLocalUsersMask |= g_NetworkManager.GetLocalPlayerMask( index ); } } @@ -3745,7 +3798,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::ExitAndJoinFromInviteThreadProc; - loadingParams->lpParam = (LPVOID)&m_InviteData; + loadingParams->lpParam = (LPVOID)&m_InviteData; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3783,7 +3836,7 @@ void CMinecraftApp::HandleXuiActions(void) if( index != inviteData->dwUserIndex && ProfileManager.IsSignedIn(index) ) { if( (m_InviteData.dwLocalUsersMask & g_NetworkManager.GetLocalPlayerMask( index ) ) == 0 ) - { + { ProfileManager.RemoveGamepadFromGame(index); } } @@ -3824,7 +3877,7 @@ void CMinecraftApp::HandleXuiActions(void) if( !GetChangingSessionType() && !g_NetworkManager.IsLocalGame() ) { - SetGameStarted(false); + SetGameStarted(false); SetChangingSessionType(true); SetReallyChangingSessionType(true); @@ -3843,7 +3896,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::ChangeSessionTypeThreadProc; - loadingParams->lpParam = NULL; + loadingParams->lpParam = NULL; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); #ifdef __PS3__ @@ -3865,7 +3918,7 @@ void CMinecraftApp::HandleXuiActions(void) } loadingParams->completionData = completionData; - ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } } else if( g_NetworkManager.IsLeavingGame() ) @@ -3892,9 +3945,9 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_SetDefaultOptions: SetAction(i,eAppAction_Idle); #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) - SetDefaultOptions((C4JStorage::PROFILESETTINGS *)param,i); + SetDefaultOptions((C4JStorage::PROFILESETTINGS *)param,i); #else - SetDefaultOptions((C_4JProfile::PROFILESETTINGS *)param,i); + SetDefaultOptions((C_4JProfile::PROFILESETTINGS *)param,i); #endif // if the profile data has been changed, then force a profile write @@ -3924,7 +3977,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CMinecraftApp::RemoteSaveThreadProc; - loadingParams->lpParam = NULL; + loadingParams->lpParam = NULL; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bRequiresUserAction=FALSE; @@ -3966,7 +4019,7 @@ void CMinecraftApp::HandleXuiActions(void) if(!app.GetGameStarted()) MinecraftServer::HaltServer(true); if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(i,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -3983,12 +4036,12 @@ void CMinecraftApp::HandleXuiActions(void) { TelemetryManager->RecordBanLevel(i); -#if defined _XBOX - INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); +#if defined _XBOX + INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); // write the level to the banned level list, and exit the world AddLevelToBannedLevelList(i,((NetworkPlayerXbox *)pHost)->GetUID(),GetUniqueMapName(),true); #elif defined _XBOX_ONE - INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); + INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); AddLevelToBannedLevelList(i,pHost->GetUID(),GetUniqueMapName(),true); #endif // primary player would exit the world, secondary would exit the player @@ -4004,7 +4057,7 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_LevelInBanLevelList: - { + { UINT uiIDA[2]; uiIDA[0]=IDS_BUTTON_REMOVE_FROM_BAN_LIST; uiIDA[1]=IDS_EXIT_GAME; @@ -4043,7 +4096,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_ReloadTexturePack: - { + { SetAction(i,eAppAction_Idle); Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->textures->reloadAll(); @@ -4051,7 +4104,7 @@ void CMinecraftApp::HandleXuiActions(void) if(!pMinecraft->skins->isUsingDefaultSkin()) { - TexturePack *pTexturePack = pMinecraft->skins->getSelected(); + TexturePack *pTexturePack = pMinecraft->skins->getSelected(); DLCPack *pDLCPack=pTexturePack->getDLCPack(); @@ -4069,7 +4122,7 @@ void CMinecraftApp::HandleXuiActions(void) // 4J-PB - If the texture pack has audio, we need to switch to this if(pMinecraft->skins->getSelected()->hasAudio()) { - Minecraft::GetInstance()->soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); + Minecraft::GetInstance()->soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); } } break; @@ -4078,7 +4131,7 @@ void CMinecraftApp::HandleXuiActions(void) { #ifndef _XBOX app.DebugPrintf( - "[Consoles_App] eAppAction_ReloadFont, ingame='%s'.\n", + "[Consoles_App] eAppAction_ReloadFont, ingame='%s'.\n", app.GetGameStarted() ? "Yes" : "No" ); SetAction(i,eAppAction_Idle); @@ -4129,7 +4182,7 @@ void CMinecraftApp::HandleXuiActions(void) eTMS = app.GetTMSAction(i); if(eTMS!=eTMSAction_Idle) - { + { switch(eTMS) { // TMS++ actions @@ -4154,7 +4207,7 @@ void CMinecraftApp::HandleXuiActions(void) #endif case eTMSAction_TMSPP_UserFileList: // retrieve the file list first -#if defined _XBOX +#if defined _XBOX SetTMSAction(i,eTMSAction_TMSPP_UserFileList_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_TitleUser,"\\",eTMSAction_TMSPP_XUIDSFile); #elif defined _XBOX_ONE @@ -4173,7 +4226,7 @@ void CMinecraftApp::HandleXuiActions(void) SetTMSAction(i,eTMSAction_TMSPP_DLCFile); #endif - break; + break; case eTMSAction_TMSPP_DLCFile: #if defined _XBOX || defined _XBOX_ONE SetTMSAction(i,eTMSAction_TMSPP_DLCFile_Waiting); @@ -4207,7 +4260,7 @@ void CMinecraftApp::HandleXuiActions(void) case eTMSAction_TMSPP_RetrieveFiles_HelpAndOptions: case eTMSAction_TMSPP_RetrieveFiles_DLCMain: // retrieve the file list first -#if defined _XBOX +#if defined _XBOX // pass in the next app action on the call or callback completing SetTMSAction(i,eTMSAction_TMSPP_XUIDSFile_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_Title,"\\",eTMSAction_TMSPP_DLCFileOnly); @@ -4219,7 +4272,7 @@ void CMinecraftApp::HandleXuiActions(void) #endif break; case eTMSAction_TMSPP_RetrieveUserFilelist_DLCFileOnly: -#if defined _XBOX +#if defined _XBOX SetTMSAction(i,eTMSAction_TMSPP_UserFileList_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_TitleUser,"\\",eTMSAction_TMSPP_XUIDSFile); #elif defined _XBOX_ONE @@ -4361,7 +4414,7 @@ void CMinecraftApp::loadMediaArchive() mediapath = L"Common\\Media\\MediaPSVita.arc"; #endif - if (!mediapath.empty()) + if (!mediapath.empty()) { m_mediaArchive = new ArchiveFile( File(mediapath) ); } @@ -4442,7 +4495,7 @@ int CMinecraftApp::PrimaryPlayerSignedOutReturned(void *pParam,int iPad,const C4 // We always create a session before kicking of any of the game code, so even though we may still be joining/creating a game // at this point we want to handle it differently from just being in a menu if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(iPad,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -4459,7 +4512,7 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto // if the player is null, we're in the menus if(Minecraft::GetInstance()->player!=NULL) - { + { app.SetAction(pMinecraft->player->GetXboxPad(),eAppAction_EthernetDisconnectedReturned); } else @@ -4587,7 +4640,7 @@ int CMinecraftApp::SignoutExitWorldThreadProc( void* lpParameter ) // 4J-JEV: Fix for #106402 - TCR #014 BAS Debug Output: // TU12: Mass Effect Mash-UP: Save file "Default_DisplayName" is created on all storage devices after signing out from a re-launched pre-generated world - app.m_gameRules.unloadCurrentGameRules(); // + app.m_gameRules.unloadCurrentGameRules(); // MinecraftServer::resetFlags(); @@ -4690,7 +4743,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes } #elif defined(__ORBIS__) else - { + { // Determine why they're not "signed in live" if (ProfileManager.isSignedInPSN(iPad)) { @@ -4702,7 +4755,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes ui.RequestErrorMessage( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -4759,7 +4812,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes } #elif defined(__ORBIS__) else - { + { // Determine why they're not "signed in live" if (ProfileManager.isSignedInPSN(iPad)) { @@ -4773,7 +4826,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes pApp->SetAction(pMinecraft->player->GetXboxPad(),eAppAction_ExitWorldTrial); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -4858,7 +4911,7 @@ void CMinecraftApp::ProfileReadErrorCallback(void *pParam) void CMinecraftApp::ClearSignInChangeUsersMask() { - // 4J-PB - When in the main menu, the user is on pad 0, and any change they make to their profile will be to pad 0 data + // 4J-PB - When in the main menu, the user is on pad 0, and any change they make to their profile will be to pad 0 data // If they then go in as a secondary player to a splitscreen game, their profile will not be read again on pad 1 if they were previously in a splitscreen game // This is because m_uiLastSignInData remembers they were in previously, and doesn't read the profile data for them again // Fix this by resetting the m_uiLastSignInData on pressing play game for secondary users. The Primary user does a read profile on play game anyway @@ -4964,12 +5017,12 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange bool bPlayerChanged=(uiChangedPlayers&(1<m_currentSigninInfo[i].xuid, info.xuid) ) )) + if( bPlayerChanged && (!bPlayerSignedIn || (bPlayerSignedIn && !ProfileManager.AreXUIDSEqual(pApp->m_currentSigninInfo[i].xuid, info.xuid) ) )) { // 4J-PB - invalidate their banned level list pApp->DebugPrintf("Player at index %d Left - invalidating their banned list\n",i); pApp->InvalidateBannedList(i); - + // 4J-HG: If either the player is in the network manager or in the game, need to exit player // TODO: Do we need to check the network manager? if (g_NetworkManager.GetLocalPlayerByUserIndex(i) != NULL || Minecraft::GetInstance()->localplayers[i] != NULL) @@ -5020,7 +5073,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange // 4J-JEV: Need to kick of loading of profile data for sub-sign in players. for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if( i != iPrimaryPlayer + if( i != iPrimaryPlayer && ( uiChangedPlayers & (1<RecordUpsellResponded(ProfileManager.GetPrimaryPad(), eSen_UpsellID_Full_Version_Of_Game, app.m_dwOfferID, senResponse); } @@ -5255,7 +5308,7 @@ int CMinecraftApp::DebugInputCallback(LPVOID pParam) { if(app.DebugSettingsOn()) { - app.ActionDebugMask(i); + app.ActionDebugMask(i); } else { @@ -5347,7 +5400,7 @@ void CMinecraftApp::MountNextDLC(int iPad) if(StorageManager.MountInstalledDLC(iPad,m_iTotalDLCInstalled,&CMinecraftApp::DLCMountedCallback,this)!=ERROR_IO_PENDING ) { // corrupt DLC - app.DebugPrintf("Failed to mount DLC %d for pad %d\n",m_iTotalDLCInstalled,iPad); + app.DebugPrintf("Failed to mount DLC %d for pad %d\n",m_iTotalDLCInstalled,iPad); ++m_iTotalDLCInstalled; app.MountNextDLC(iPad); } @@ -5475,15 +5528,15 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // void CMinecraftApp::InstallDefaultCape() // { // if(!m_bDefaultCapeInstallAttempted) -// { +// { // // we only attempt to install the cape once per launch of the game // m_bDefaultCapeInstallAttempted=true; -// +// // wstring wTemp=L"Default_Cape.png"; // bool bRes=app.IsFileInMemoryTextures(wTemp); // // if the file is not already in the memory textures, then read it from TMS // if(!bRes) -// { +// { // BYTE *pBuffer=NULL; // DWORD dwSize=0; // // 4J-PB - out for now for DaveK so he doesn't get the birthday cape @@ -5493,13 +5546,13 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // if(eTMSStatus==C4JStorage::ETMSStatus_Idle) // { // app.AddMemoryTextureFile(wTemp,pBuffer,dwSize); -// } +// } // #endif // } // } // } -void CMinecraftApp::HandleDLC(DLCPack *pack) +void CMinecraftApp::HandleDLC(DLCPack *pack) { DWORD dwFilesProcessed = 0; #ifndef _XBOX @@ -5552,9 +5605,9 @@ void CMinecraftApp::HandleDLC(DLCPack *pack) File texturePCKPath(wsTemp ); if(texturePCKPath.exists()) { - app.DebugPrintf("Found a replacement .pck\n"); + app.DebugPrintf("Found a replacement .pck\n"); m_dlcManager.readDLCDataFile(dwFilesProcessed, wsTemp,pack); - } + } else { m_dlcManager.readDLCDataFile(dwFilesProcessed, szFullFilename,pack); @@ -5564,7 +5617,7 @@ void CMinecraftApp::HandleDLC(DLCPack *pack) #endif } - } + } while( FindNextFile( hFind, &wfd ) ); // Close the find handle. @@ -5577,8 +5630,8 @@ void CMinecraftApp::HandleDLC(DLCPack *pack) // int CMinecraftApp::DLCReadCallback(LPVOID pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData) // { -// -// +// +// // return 0; // } @@ -5587,7 +5640,7 @@ void CMinecraftApp::HandleDLC(DLCPack *pack) // Desc: Initializes the timer variables //------------------------------------------------------------------------------------- void CMinecraftApp::InitTime() -{ +{ // Get the frequency of the timer LARGE_INTEGER qwTicksPerSec; @@ -5599,8 +5652,8 @@ void CMinecraftApp::InitTime() // Zero out the elapsed and total time m_Time.qwAppTime.QuadPart = 0; - m_Time.fAppTime = 0.0f; - m_Time.fElapsedTime = 0.0f; + m_Time.fAppTime = 0.0f; + m_Time.fElapsedTime = 0.0f; } //------------------------------------------------------------------------------------- @@ -5612,14 +5665,14 @@ void CMinecraftApp::UpdateTime() LARGE_INTEGER qwNewTime; LARGE_INTEGER qwDeltaTime; - QueryPerformanceCounter( &qwNewTime ); + QueryPerformanceCounter( &qwNewTime ); qwDeltaTime.QuadPart = qwNewTime.QuadPart - m_Time.qwTime.QuadPart; - m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart; + m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart; m_Time.qwTime.QuadPart = qwNewTime.QuadPart; m_Time.fElapsedTime = m_Time.fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); - m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart)); + m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart)); } @@ -5652,8 +5705,8 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) return false; } -void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) -{ +void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) +{ EnterCriticalSection(&csMemFilesLock); // check it's not already in PMEMDATA pData=NULL; @@ -5729,7 +5782,7 @@ bool CMinecraftApp::DefaultCapeExists() EnterCriticalSection(&csMemFilesLock); auto it = m_MEM_Files.find(wTex); - if(it != m_MEM_Files.end()) val = true; + if(it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); return val; @@ -5741,7 +5794,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const wstring &wName) EnterCriticalSection(&csMemFilesLock); auto it = m_MEM_Files.find(wName); - if(it != m_MEM_Files.end()) val = true; + if(it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); return val; @@ -5760,14 +5813,14 @@ void CMinecraftApp::GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD LeaveCriticalSection(&csMemFilesLock); } -void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) -{ +void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) +{ EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData=NULL; auto it = m_MEM_TPD.find(iConfig); if(it == m_MEM_TPD.end()) - { + { pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)]; ZeroMemory( pData, sizeof(MEMDATA) ); pData->pbData=pbData; @@ -5780,8 +5833,8 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) LeaveCriticalSection(&csMemTPDLock); } -void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) -{ +void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) +{ EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData=NULL; @@ -5843,7 +5896,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) EnterCriticalSection(&csMemTPDLock); auto it = m_MEM_TPD.find(iConfig); - if(it != m_MEM_TPD.end()) val = true; + if(it != m_MEM_TPD.end()) val = true; LeaveCriticalSection(&csMemTPDLock); return val; @@ -5869,18 +5922,18 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) // #ifndef _CONTENT_PACKAGE // // read the local file // File gtsFile( wsFile->c_str() ); -// -// __int64 fileSize = gtsFile.length(); -// +// +// int64_t fileSize = gtsFile.length(); +// // if(fileSize!=0) // { // FileInputStream fis(gtsFile); // byteArray ba((int)fileSize); // fis.read(ba); // fis.close(); -// +// // bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(WCHAR *)wsFile->c_str(),ba.data, ba.length); -// +// // } // #endif // return bRes; @@ -5930,7 +5983,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad CMinecraftApp *pClass = (CMinecraftApp *)pParam; // Exit with or without saving // Decline means save in this dialog - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) { if( result==C4JStorage::EMessage_ResultDecline ) // Save { @@ -5942,7 +5995,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad DLCPack * pDLCPack=tPack->getDLCPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { // upsell // get the dlc texture pack @@ -5962,7 +6015,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad // Give the player a warning about the trial version of the texture pack ui.RequestErrorMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, iPad,&CMinecraftApp::WarningTrialTexturePackReturned,pClass); - return S_OK; + return S_OK; } } #ifndef _XBOX_ONE @@ -6035,7 +6088,7 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack(); const char *pchPackName=wstringtofilename(pDLCPack->getName()); app.DebugPrintf("Texture Pack - %s\n",pchPackName); - SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName); + SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName); if(pSONYDLCInfo!=NULL) { @@ -6056,27 +6109,27 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor #if defined __ORBIS__ || defined __PSVITA__ || defined __PS3__ if(app.CheckForEmptyStore(iPad)==false) #endif - { + { if(app.DLCAlreadyPurchased(chSkuID)) { app.DownloadAlreadyPurchased(chSkuID); } else { - app.Checkout(chSkuID); + app.Checkout(chSkuID); } } } } } } -#endif // +#endif // #ifdef _XBOX_ONE if(result==C4JStorage::EMessage_ResultAccept) { if(ProfileManager.IsSignedIn(iPad)) - { + { if (ProfileManager.IsSignedInLive(iPad)) { TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); @@ -6089,17 +6142,17 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor StorageManager.InstallOffer(1,(WCHAR *)pDLCInfo->wsProductId.c_str(),NULL,NULL); - // the license change coming in when the offer has been installed will cause this scene to refresh + // the license change coming in when the offer has been installed will cause this scene to refresh } else - { + { // 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why. UINT uiIDA[1] = { IDS_CONFIRM_OK }; - ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad); + ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad); } } } - + #endif #ifdef _XBOX @@ -6116,7 +6169,7 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor if(result==C4JStorage::EMessage_ResultAccept) { if(ProfileManager.IsSignedIn(iPad)) - { + { // need to allow downloads here, or the player would need to quit the game to let the download of a texture pack happen. This might affect the network traffic, since the download could take all the bandwidth... XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -6136,7 +6189,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 //CMinecraftApp* pClass = (CMinecraftApp*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { INT saveOrCheckpointId = 0; @@ -6148,7 +6201,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 DLCPack * pDLCPack=tPack->getDLCPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { // upsell // get the dlc texture pack @@ -6168,7 +6221,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 // Give the player a warning about the trial version of the texture pack ui.RequestErrorMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, iPad,&CMinecraftApp::WarningTrialTexturePackReturned,NULL); - return S_OK; + return S_OK; } } //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); @@ -6183,7 +6236,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 int CMinecraftApp::ExitAndJoinFromInviteDeclineSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { #if defined(_XBOX_ONE) || defined(__ORBIS__) StorageManager.SetSaveDisabled(false); @@ -6372,7 +6425,7 @@ UINT CMinecraftApp::GetNextTip() } else { - if(bShowSkinDLCTip && ProfileManager.IsFullVersion()) + if(bShowSkinDLCTip && ProfileManager.IsFullVersion()) { bShowSkinDLCTip=false; if( app.DLCInstallProcessCompleted() ) @@ -6484,7 +6537,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado text = replaceAll(text, L"{*CONTROLLER_ACTION_DROP*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DROP ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_CAMERA*}", GetActionReplacement(iPad,MINECRAFT_ACTION_RENDER_THIRD_PERSON ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_MENU_PAGEDOWN*}", GetActionReplacement(iPad,ACTION_MENU_PAGEDOWN ) ); - text = replaceAll(text, L"{*CONTROLLER_ACTION_DISMOUNT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_SNEAK_TOGGLE ) ); + text = replaceAll(text, L"{*CONTROLLER_ACTION_DISMOUNT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_SNEAK_TOGGLE ) ); text = replaceAll(text, L"{*CONTROLLER_VK_A*}", GetVKReplacement(VK_PAD_A) ); text = replaceAll(text, L"{*CONTROLLER_VK_B*}", GetVKReplacement(VK_PAD_B) ); text = replaceAll(text, L"{*CONTROLLER_VK_X*}", GetVKReplacement(VK_PAD_X) ); @@ -6499,7 +6552,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado text = replaceAll(text, L"{*ICON_SHANK_03*}", GetIconReplacement(XZP_ICON_SHANK_03) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_UP*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_UP ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_DOWN ) ); - text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) ); + text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_LEFT ) ); #if defined _XBOX_ONE || defined __PSVITA__ text = replaceAll(text, L"{*CONTROLLER_VK_START*}", GetVKReplacement(VK_PAD_START ) ); @@ -6515,13 +6568,13 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado text = replaceAll(text, L"{*IMAGEROOT*}", imageRoot); #endif // _XBOX - // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good + // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good DWORD dwLanguage = XGetLanguage( ); switch(dwLanguage) { - case XC_LANGUAGE_KOREAN: + case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_JAPANESE: - case XC_LANGUAGE_TCHINESE: + case XC_LANGUAGE_TCHINESE: text = replaceAll(text, L" ", L"" ); break; } @@ -6664,7 +6717,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey) case VK_PAD_LTHUMB_UPLEFT : case VK_PAD_LTHUMB_UPRIGHT : case VK_PAD_LTHUMB_DOWNRIGHT: - case VK_PAD_LTHUMB_DOWNLEFT : + case VK_PAD_LTHUMB_DOWNLEFT : return app.GetString( IDS_CONTROLLER_LEFT_STICK ); case VK_PAD_RTHUMB_UP : case VK_PAD_RTHUMB_DOWN : @@ -6673,7 +6726,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey) case VK_PAD_RTHUMB_UPLEFT : case VK_PAD_RTHUMB_UPRIGHT : case VK_PAD_RTHUMB_DOWNRIGHT: - case VK_PAD_RTHUMB_DOWNLEFT : + case VK_PAD_RTHUMB_DOWNLEFT : return app.GetString( IDS_CONTROLLER_RIGHT_STICK ); default: break; @@ -6836,7 +6889,7 @@ HRESULT CMinecraftApp::RegisterMojangData(WCHAR *pXuidName, PlayerUID xuid, WCHA // ignore the names if we don't recognize them if(pXuidName!=NULL) - { + { if( wcscmp( pXuidName, L"XUID_NOTCH" ) == 0 ) { eTempXuid = eXUID_Notch; // might be needed for the apple at some point @@ -6876,7 +6929,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) // #ifdef _XBOX // if(pType!=NULL) - // { + // { // if(wcscmp(pType,L"XboxOneTransfer")==0) // { // if(iValue>0) @@ -6892,7 +6945,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) // { // app.m_uiTransferSlotC=iValue; // } - // + // // } // #endif @@ -6901,7 +6954,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) } #if (defined _XBOX || defined _WINDOWS64) -HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) +HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, uint64_t ullOfferID_Full, uint64_t ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) { HRESULT hr=S_OK; DLC_INFO *pDLCData=new DLC_INFO; @@ -6916,18 +6969,18 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGe #ifndef __ORBIS__ // ignore the names if we don't recognize them if(pBannerName!=L"") - { + { wcsncpy_s( pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE); } if(pDataFile[0]!=0) - { + { wcsncpy_s( pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE); } #endif if(pType!=NULL) - { + { if(wcscmp(pType,L"Skin")==0) { pDLCData->eDLCType=e_DLC_SkinPack; @@ -7006,12 +7059,12 @@ HRESULT CMinecraftApp::RegisterDLCData(eDLCContentType eType, WCHAR *pwchBannerN // ignore the names if we don't recognize them if(pwchBannerName!=L"") - { + { wcsncpy_s( pDLCData->wchBanner, pwchBannerName, MAX_BANNERNAME_SIZE); } if(pwchProductName[0]!=0) - { + { pDLCData->wsDisplayName=pwchProductName; } @@ -7053,7 +7106,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde pDLCData->iConfig = app.GetiConfigFromName(pchDLCName); pDLCData->uiSortIndex=uiSortIndex; - pDLCData->eDLCType = app.GetDLCTypeFromName(pchDLCName); + pDLCData->eDLCType = app.GetDLCTypeFromName(pchDLCName); strcpy(pDLCData->chImageURL,pchImageURL); //bool bIsTrialDLC = app.GetTrialFromName(pchDLCName); @@ -7125,7 +7178,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfo(char *pchDLCName) string tempString=pchDLCName; if(DLCInfo.size()>0) - { + { auto it = DLCInfo.find(tempString); if( it == DLCInfo.end() ) @@ -7198,7 +7251,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,wstring &Produc { auto it = DLCTextures_PackID.find(iPackID); if( it == DLCTextures_PackID.end() ) - { + { return false; } else @@ -7270,7 +7323,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) { //DLC_INFO *pDLCInfo=NULL; if(DLCInfo_Trial.size()>0) - { + { auto it = DLCInfo_Trial.find(ullOfferID_Trial); if( it == DLCInfo_Trial.end() ) @@ -7327,7 +7380,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID) { wstring wsTemp = pwchProductID; if(DLCInfo_Full.size()>0) - { + { auto it = DLCInfo_Full.find(wsTemp); if( it == DLCInfo_Full.end() ) @@ -7367,7 +7420,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) { if(DLCInfo_Full.size()>0) - { + { auto it = DLCInfo_Full.find(ullOfferID_Full); if( it == DLCInfo_Full.end() ) @@ -7479,11 +7532,11 @@ int CMinecraftApp::ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4 //CScene_Pause* pClass = (CScene_Pause*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { app.SetAction(iPad,eAppAction_ExitWorld); } - else + else { #ifndef _XBOX // Inform fullscreen progress scene that it's not being cancelled after all @@ -7564,7 +7617,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps m_vBannedListA[iPad]->push_back(pBannedListData); if(bWriteToTMS) - { + { DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new CHAR [dwDataBytes]); int iCount=0; @@ -7592,7 +7645,7 @@ bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid, char *pszLevel #ifdef _XBOX_ONE PlayerUID bannedPlayerUID = pData->wchPlayerUID; if(IsEqualXUID (bannedPlayerUID,xuid) && (strcmp(pData->pszLevelName,pszLevelName)==0)) -#else +#else if(IsEqualXUID (pData->xuid,xuid) && (strcmp(pData->pszLevelName,pszLevelName)==0)) #endif { @@ -7693,7 +7746,7 @@ bool CMinecraftApp::AlreadySeenCreditText(const wstring &wstemp) wstring temp=m_vCreditText.at(i); // if they are the same, break out of the case - if(temp.compare(wstemp)==0) + if(temp.compare(wstemp)==0) { return true; } @@ -8081,7 +8134,7 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame break; case eGameHostOption_FireSpreads: return (uiHostSettings&GAME_HOST_OPTION_BITMASK_FIRESPREADS); - break; + break; case eGameHostOption_CheatsEnabled: return (uiHostSettings&(GAME_HOST_OPTION_BITMASK_HOSTFLY|GAME_HOST_OPTION_BITMASK_HOSTHUNGER|GAME_HOST_OPTION_BITMASK_HOSTINVISIBLE)); break; @@ -8099,7 +8152,7 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame break; case eGameHostOption_DisableSaving: return (uiHostSettings&GAME_HOST_OPTION_BITMASK_DISABLESAVE); - break; + break; case eGameHostOption_WasntSaveOwner: return (uiHostSettings&GAME_HOST_OPTION_BITMASK_NOTOWNER); case eGameHostOption_WorldSize: @@ -8118,7 +8171,7 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame return !(uiHostSettings&GAME_HOST_OPTION_BITMASK_NATURALREGEN); case eGameHostOption_DoDaylightCycle: return !(uiHostSettings&GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE); - break; + break; } return false; @@ -8178,7 +8231,7 @@ unsigned int CMinecraftApp::FromBigEndian(unsigned int uiValue) // Keep it in big endian return uiValue; #else - unsigned int uiReturn = ( ( uiValue >> 24 ) & 0x000000ff ) | + unsigned int uiReturn = ( ( uiValue >> 24 ) & 0x000000ff ) | ( ( uiValue >> 8 ) & 0x0000ff00 ) | ( ( uiValue << 8 ) & 0x00ff0000 ) | ( ( uiValue << 24 ) & 0xff000000 ); @@ -8204,7 +8257,7 @@ void CMinecraftApp::GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsig uiCount+=8; while(uiCountx; *pZ=pFeatureData->z; return true; - } + } } return false; @@ -8494,7 +8547,7 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType, bool bPromo { // promote if(bPromote) - { + { m_DLCDownloadQueue.erase(m_DLCDownloadQueue.begin()+iPosition); m_DLCDownloadQueue.insert(m_DLCDownloadQueue.begin(),pCurrent); } @@ -8506,10 +8559,10 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType, bool bPromo } DLCRequest *pDLCreq = new DLCRequest; - pDLCreq->dwType=m_dwContentTypeA[eType]; + pDLCreq->dwType=m_dwContentTypeA[eType]; pDLCreq->eState=e_DLC_ContentState_Idle; - m_DLCDownloadQueue.push_back(pDLCreq); + m_DLCDownloadQueue.push_back(pDLCreq); m_bAllDLCContentRetrieved=false; LeaveCriticalSection(&csDLCDownloadQueue); @@ -8541,7 +8594,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool { // promote if(bPromote) - { + { m_TMSPPDownloadQueue.erase(m_TMSPPDownloadQueue.begin()+iPosition); m_TMSPPDownloadQueue.insert(m_TMSPPDownloadQueue.begin(),pCurrent); bPromoted=true; @@ -8575,17 +8628,17 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool { // first check if the image is already in the memory textures, since we might be loading some from the Title Update partition if(pDLC->wchDataFile[0]!=0) - { + { //WCHAR *cString = pDLC->wchDataFile; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first //int iIndex = app.GetLocalTMSFileIndex(pDLC->wchDataFile,true); //if(iIndex!=-1) - { + { bool bPresent = app.IsFileInTPD(pDLC->iConfig); if(!bPresent) - { + { // this may already be present in the vector because of a previous trial/full offer bool bAlreadyInQueue=false; @@ -8599,7 +8652,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { TMSPPRequest *pTMSPPreq = new TMSPPRequest; pTMSPPreq->CallbackFunc=&CMinecraftApp::TMSPPFileReturned; @@ -8611,7 +8664,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; m_TMSPPDownloadQueue.push_back(pTMSPPreq); - } + } } else { @@ -8635,20 +8688,20 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool // is this the right type? if(pDLC->eDLCType==eType) - { + { WCHAR *cString = pDLC->wchBanner; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first - // is the file in the TMS XZP? + // is the file in the TMS XZP? //int iIndex = app.GetLocalTMSFileIndex(cString,true); //if(iIndex!=-1) - { - bool bPresent = app.IsFileInMemoryTextures(cString); + { + bool bPresent = app.IsFileInMemoryTextures(cString); if(!bPresent) // retrieve it from TMSPP - { + { bool bAlreadyInQueue=false; for( TMSPPRequest *pCurrent : m_TMSPPDownloadQueue ) { @@ -8660,7 +8713,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { TMSPPRequest *pTMSPPreq = new TMSPPRequest; pTMSPPreq->CallbackFunc=&CMinecraftApp::TMSPPFileReturned; @@ -8673,7 +8726,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; - m_TMSPPDownloadQueue.push_back(pTMSPPreq); + m_TMSPPDownloadQueue.push_back(pTMSPPreq); app.DebugPrintf("===m_TMSPPDownloadQueue Adding %ls, q size is %d\n",pTMSPPreq->wchFilename,m_TMSPPDownloadQueue.size()); } } @@ -8697,11 +8750,11 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool //int iIndex = app.GetLocalTMSFileIndex(cString,true); //if(iIndex!=-1) - { + { bool bPresent = app.IsFileInMemoryTextures(cString); if(!bPresent) - { + { // this may already be present in the vector because of a previous trial/full offer bool bAlreadyInQueue=false; @@ -8715,7 +8768,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { //app.DebugPrintf("Adding a request to the TMSPP download queue - %ls\n",pDLC->wchBanner); TMSPPRequest *pTMSPPreq = new TMSPPRequest; ZeroMemory(pTMSPPreq,sizeof(TMSPPRequest)); @@ -8734,7 +8787,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool m_bAllTMSContentRetrieved=false; m_TMSPPDownloadQueue.push_back(pTMSPPreq); app.DebugPrintf("===m_TMSPPDownloadQueue Adding %ls, q size is %d\n",pTMSPPreq->wchFilename,m_TMSPPDownloadQueue.size()); - } + } } } } @@ -8845,7 +8898,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto pCurrent->eState=e_TMS_ContentState_Retrieved; if(pFileData!=NULL) - { + { #ifdef _XBOX_ONE @@ -8853,7 +8906,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto switch(pCurrent->eType) { case e_DLC_TexturePackData: - { + { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory PBYTE pbData = new BYTE [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); @@ -8862,13 +8915,13 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto app.DebugPrintf("Got texturepack data\n"); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize); } break; default: // 4J-PB - check the data is an image if(pFileData->pbData[0]==0x89) - { + { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory PBYTE pbData = new BYTE [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); @@ -8888,11 +8941,11 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto switch(pCurrent->eType) { case e_DLC_TexturePackData: - { + { app.DebugPrintf("--- Got texturepack data %ls\n",pCurrent->wchFilename); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize); } break; default: @@ -9149,7 +9202,7 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D for(unsigned int i=0;iAddOrRetrievePart(&SkinBoxA[i]); pvModelPart->push_back(pModelPart); pvSkinBoxes->push_back(&SkinBoxA[i]); @@ -9179,7 +9232,7 @@ vector * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect for( auto& it : *pvSkinBoxA ) { if(pModel) - { + { ModelPart *pModelPart=pModel->AddOrRetrievePart(it); pvModelPart->push_back(pModelPart); } @@ -9266,7 +9319,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOve DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin) { - bool dlcSkin = false; + bool dlcSkin = false; unsigned int skinId = 0; if(skin.size() >= 14) @@ -9323,7 +9376,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E #if defined __PSVITA__ || defined __PS3__ || defined __ORBIS__ - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { Minecraft *pMinecraft = Minecraft::GetInstance(); if( pMinecraft->skins->selectTexturePackById(app.GetRequiredTexturePackID()) ) @@ -9334,7 +9387,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo(app.GetRequiredTexturePackID()); + SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo(app.GetRequiredTexturePackID()); if(pSONYDLCInfo!=NULL) { char chName[42]; @@ -9363,7 +9416,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E } else { - app.Checkout(chSkuID); + app.Checkout(chSkuID); } } } @@ -9379,7 +9432,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E if(result!=C4JStorage::EMessage_Cancelled) { if(app.GetRequiredTexturePackID()!=0) - { + { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -9397,7 +9450,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); ullIndexA[0]=pDLCInfo->ullOfferID_Trial; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); - } + } } } #endif @@ -9440,39 +9493,39 @@ byteArray CMinecraftApp::getArchiveFile(const wstring &filename) // DLC #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) -int CMinecraftApp::GetDLCInfoCount() -{ +int CMinecraftApp::GetDLCInfoCount() +{ return (int)DLCInfo.size(); } #elif defined _XBOX_ONE -int CMinecraftApp::GetDLCInfoTrialOffersCount() -{ +int CMinecraftApp::GetDLCInfoTrialOffersCount() +{ return 0; } -int CMinecraftApp::GetDLCInfoFullOffersCount() -{ +int CMinecraftApp::GetDLCInfoFullOffersCount() +{ return (int)DLCInfo_Full.size(); } #else -int CMinecraftApp::GetDLCInfoTrialOffersCount() -{ +int CMinecraftApp::GetDLCInfoTrialOffersCount() +{ return (int)DLCInfo_Trial.size(); } -int CMinecraftApp::GetDLCInfoFullOffersCount() -{ +int CMinecraftApp::GetDLCInfoFullOffersCount() +{ return (int)DLCInfo_Full.size(); } #endif -int CMinecraftApp::GetDLCInfoTexturesOffersCount() -{ +int CMinecraftApp::GetDLCInfoTexturesOffersCount() +{ return (int)DLCTextures_PackID.size(); } // AUTOSAVE -void CMinecraftApp::SetAutosaveTimerTime(void) +void CMinecraftApp::SetAutosaveTimerTime(void) { #if defined(_XBOX_ONE) || defined(__ORBIS__) m_uiAutosaveTimer= GetTickCount()+1000*60; @@ -9481,23 +9534,23 @@ void CMinecraftApp::SetAutosaveTimerTime(void) #endif }// value x 15 to get mins, x60 for secs -bool CMinecraftApp::AutosaveDue(void) -{ +bool CMinecraftApp::AutosaveDue(void) +{ return (GetTickCount()>m_uiAutosaveTimer); } -unsigned int CMinecraftApp::SecondsToAutosave() -{ - return (m_uiAutosaveTimer - GetTickCount() ) / 1000; +unsigned int CMinecraftApp::SecondsToAutosave() +{ + return (m_uiAutosaveTimer - GetTickCount() ) / 1000; } -void CMinecraftApp::SetTrialTimerStart(void) +void CMinecraftApp::SetTrialTimerStart(void) { m_fTrialTimerStart=m_Time.fAppTime; mfTrialPausedTime=0.0f; } -float CMinecraftApp::getTrialTimer(void) -{ +float CMinecraftApp::getTrialTimer(void) +{ return m_Time.fAppTime-m_fTrialTimerStart-mfTrialPausedTime; } @@ -9532,7 +9585,7 @@ bool CMinecraftApp::IsLocalMultiplayerAvailable() //#else // for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) // { - // if( (i!=userIndex) && (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ) + // if( (i!=userIndex) && (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ) // { // iOtherConnectedControllers++; // } @@ -9607,7 +9660,7 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) case XC_LOCALE_UNITED_ARAB_EMIRATES: case XC_LOCALE_GREAT_BRITAIN: locales.push_back(eMCLang_enGB); - break; + break; default: //XC_LOCALE_UNITED_STATES break; } @@ -9707,7 +9760,7 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) break; case XC_LANGUAGE_BNORWEGIAN : locales.push_back(eMCLang_nbNO); - locales.push_back(eMCLang_noNO); + locales.push_back(eMCLang_noNO); locales.push_back(eMCLang_nnNO); break; case XC_LANGUAGE_DUTCH : diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index ec36b7652..40674088f 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -28,7 +28,7 @@ typedef struct _JoinFromInviteData DWORD dwUserIndex; // dwUserIndex DWORD dwLocalUsersMask; // dwUserMask const INVITE_INFO *pInviteInfo; // pInviteInfo -} +} JoinFromInviteData; class Player; @@ -55,7 +55,7 @@ class Merchant; class CMinecraftAudio; -class CMinecraftApp +class CMinecraftApp #ifdef _XBOX : public CXuiModule @@ -92,7 +92,7 @@ public: #ifdef _EXTENDED_ACHIEVEMENTS /* 4J-JEV: - * We need more space in the profile data because of the new achievements and statistics + * We need more space in the profile data because of the new achievements and statistics * necessary for the new expanded achievement set. */ static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user @@ -164,7 +164,7 @@ public: void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;} eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];} void SetAction(int iPad, eXuiAction action, LPVOID param = NULL); - void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } + void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];} eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];} LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];} @@ -282,7 +282,7 @@ public: void SetGameSettingsDebugMask(int iPad, unsigned int uiVal); void ActionDebugMask(int iPad, bool bSetAllClear=false); - // + // bool IsLocalMultiplayerAvailable(); // for sign in change monitoring @@ -359,7 +359,7 @@ public: // Texture Pack Data files (icon, banner, comparison shot & text) void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes); - void RemoveMemoryTPDFile(int iConfig); + void RemoveMemoryTPDFile(int iConfig); bool IsFileInTPD(int iConfig); void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes); int GetTPDSize() {return m_MEM_TPD.size();} @@ -444,7 +444,7 @@ private: static int BannedLevelDialogReturned(void *pParam,int iPad,const C4JStorage::EMessageResult); static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; + VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; void HandleButtonPresses(int iPad); @@ -472,7 +472,7 @@ private: static unsigned int m_uiLastSignInData; - // We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings + // We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings GAME_SETTINGS *GameSettingsA[XUSER_MAX_COUNT]; // For promo work @@ -517,7 +517,7 @@ private: eXuiAction m_eXuiAction[XUSER_MAX_COUNT]; eTMSAction m_eTMSAction[XUSER_MAX_COUNT]; LPVOID m_eXuiActionParam[XUSER_MAX_COUNT]; - eXuiAction m_eGlobalXuiAction; + eXuiAction m_eGlobalXuiAction; eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT]; LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT]; eXuiServerAction m_eGlobalXuiServerAction; @@ -541,20 +541,20 @@ private: // Trial timer float m_fTrialTimerStart,mfTrialPausedTime; typedef struct TimeInfo - { - LARGE_INTEGER qwTime; - LARGE_INTEGER qwAppTime; + { + LARGE_INTEGER qwTime; + LARGE_INTEGER qwAppTime; - float fAppTime; - float fElapsedTime; - float fSecsPerTick; - } TIMEINFO; + float fAppTime; + float fElapsedTime; + float fSecsPerTick; + } TIMEINFO; TimeInfo m_Time; protected: - static const int MAX_TIPS_GAMETIP = 50; - static const int MAX_TIPS_TRIVIATIP = 20; + static const int MAX_TIPS_GAMETIP = 50; + static const int MAX_TIPS_TRIVIATIP = 20; static TIPSTRUCT m_GameTipA[MAX_TIPS_GAMETIP]; static TIPSTRUCT m_TriviaTipA[MAX_TIPS_TRIVIATIP]; static Random *TipRandom; @@ -606,7 +606,7 @@ public: DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId); DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName); #else - static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile); + static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, uint64_t, uint64_t, WCHAR *, unsigned int, int, WCHAR *pDataFile); bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); @@ -634,7 +634,7 @@ private: #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) static unordered_map MojangData; static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs - static unordered_map DLCInfo; + static unordered_map DLCInfo; static unordered_map DLCInfo_SkinName; // skin name, full offer id #elif defined(_DURANGO) static unordered_map MojangData; @@ -729,7 +729,7 @@ public: // World seed from png image void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack); - unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); + unsigned int CreateImageTextData(PBYTE bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); // Game rules GameRuleManager m_gameRules; @@ -773,7 +773,7 @@ public: unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false); int GetDLCInfoTexturesOffersCount(); #if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - DLC_INFO *GetDLCInfo(int iIndex); + DLC_INFO *GetDLCInfo(int iIndex); DLC_INFO *GetDLCInfo(char *); DLC_INFO *GetDLCInfoFromTPackID(int iTPID); bool GetDLCNameForPackID(const int iPackID,char **ppchKeyID); @@ -935,5 +935,5 @@ private: #endif }; -//singleton +//singleton //extern CMinecraftApp app; diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp index 0b7edb6a8..7116f62d8 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; } -const 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 392b847b2..f1a356fe9 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.h +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.h @@ -28,7 +28,7 @@ public: e_AudioParamType_Max, }; - static const WCHAR *wchTypeNamesA[e_AudioParamType_Max]; + static const WCHAR *wchTypeNamesA[e_AudioParamType_Max]; DLCAudioFile(const wstring &path); diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index cdb195aab..dd34e67f9 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" -const 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 df83f435d..d4dd2508e 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.h +++ b/Minecraft.Client/Common/DLC/DLCManager.h @@ -48,7 +48,7 @@ public: e_DLCParamType_Max, }; - static const WCHAR *wchTypeNamesA[e_DLCParamType_Max]; + static const WCHAR *wchTypeNamesA[e_DLCParamType_Max]; private: vector m_packs; diff --git a/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h index 21c42dead..e5dffb3cc 100644 --- a/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h @@ -19,17 +19,17 @@ private: ConsoleSchematicFile::ESchematicRotation m_rotation; int m_dimension; - __int64 m_totalBlocksChanged; - __int64 m_totalBlocksChangedLighting; + int64_t m_totalBlocksChanged; + int64_t m_totalBlocksChangedLighting; bool m_completed; void updateLocationBox(); -public: +public: ApplySchematicRuleDefinition(LevelGenerationOptions *levelGenOptions); ~ApplySchematicRuleDefinition(); virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; } - + virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp index 01a8119e3..7b69c4b4e 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp @@ -38,7 +38,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos) dos->writeInt(m_zSize); byteArray ba(new BYTE[ m_data.length ], m_data.length); - Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length, + Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length, m_data.data, m_data.length); dos->writeInt(ba.length); @@ -71,13 +71,13 @@ void ConsoleSchematicFile::load(DataInputStream *dis) m_ySize = dis->readInt(); m_zSize = dis->readInt(); - int compressedSize = dis->readInt(); + int compressedSize = dis->readInt(); byteArray compressedBuffer(compressedSize); dis->readFully(compressedBuffer); if(m_data.data != NULL) { - delete [] m_data.data; + delete [] m_data.data; m_data.data = NULL; } @@ -145,7 +145,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis) double z = pos->get(2)->data; if( type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME ) - { + { x = ((IntTag *) eTag->get(L"TileX") )->data; y = ((IntTag *) eTag->get(L"TileY") )->data; z = ((IntTag *) eTag->get(L"TileZ") )->data; @@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos) delete tag; } -__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = static_cast(std::fmax(destinationBox->x0, (double)chunk->x*16)); int xEnd = static_cast(std::fmin(destinationBox->x1, (double)((xStart >> 4) << 4) + 16)); @@ -281,7 +281,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB // blockData[i] = Tile::endStone_Id; // } //} - + PIXBeginNamedEvent(0,"Setting Block data"); chunk->setBlockData(blockData); PIXEndNamedEvent(); @@ -323,7 +323,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB // At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so // we can do the sort of lighting that might propagate out of the chunk. -__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = max(destinationBox->x0, (double)chunk->x*16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); @@ -445,7 +445,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, shared_ptr teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); if ( teCopy != NULL ) - { + { CompoundTag *teData = new CompoundTag(); te->save(teData); @@ -478,7 +478,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, for (auto it = m_entities.begin(); it != m_entities.end();) { Vec3 *source = it->first; - + double targetX = source->x; double targetY = source->y + destinationBox->y0; double targetZ = source->z; @@ -498,7 +498,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, if( e->GetType() == eTYPE_PAINTING ) { shared_ptr painting = dynamic_pointer_cast(e); - + double tileX = painting->xTile; double tileZ = painting->zTile; schematicCoordToChunkCoord(destinationBox, painting->xTile, painting->zTile, rot, tileX, tileZ); @@ -511,7 +511,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, else if( e->GetType() == eTYPE_ITEM_FRAME ) { shared_ptr frame = dynamic_pointer_cast(e); - + double tileX = frame->xTile; double tileZ = frame->zTile; schematicCoordToChunkCoord(destinationBox, frame->xTile, frame->zTile, rot, tileX, tileZ); @@ -559,7 +559,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l zStart-=1; else if(zStart < 0 && zStart%2 !=0) zStart-=1; - + // We want the end to be odd to have a total size that is even if(xEnd > 0 && xEnd%2 == 0) xEnd+=1; @@ -613,7 +613,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l // Every x is a whole row for(int xPos = xStart; xPos < xStart + xSize; ++xPos) - { + { int xc = xPos >> 4; int x0 = xPos - xc * 16; @@ -622,7 +622,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l if (x1 > 16) x1 = 16; for(int zPos = zStart; zPos < zStart + zSize;) - { + { int zc = zPos >> 4; int z0 = zStart - zc * 16; @@ -713,11 +713,11 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l } // 4J-JEV: Changed to check for instances of minecarts and hangingEntities instead of just eTYPE_PAINTING, eTYPE_ITEM_FRAME and eTYPE_MINECART - if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY)) + if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY)) { CompoundTag *eTag = new CompoundTag(); if( e->save(eTag) ) - { + { ListTag *pos = (ListTag *) eTag->getList(L"Pos"); pos->get(0)->data -= xStart; @@ -725,7 +725,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l pos->get(2)->data -= zStart; if( e->instanceof(eTYPE_HANGING_ENTITY) ) - { + { ((IntTag *) eTag->get(L"TileX") )->data -= xStart; ((IntTag *) eTag->get(L"TileY") )->data -= yStart; ((IntTag *) eTag->get(L"TileZ") )->data -= zStart; @@ -766,7 +766,7 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk *chunk, byteArray *data, // skyLightP += skyLightData.length; // return; //} - + bool bHasLower, bHasUpper; bHasLower = bHasUpper = false; int lowerY0, lowerY1, upperY0, upperY1; diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h index f37a60585..b0eebf9e8 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h @@ -58,7 +58,7 @@ private: vector > m_tileEntities; vector< pair > m_entities; -public: +public: byteArray m_data; public: @@ -72,8 +72,8 @@ public: void save(DataOutputStream *dos); void load(DataInputStream *dis); - __int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); - __int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes); diff --git a/Minecraft.Client/Common/GameRules/GameRule.h b/Minecraft.Client/Common/GameRules/GameRule.h index bdc2ceff5..3b9dba7ed 100644 --- a/Minecraft.Client/Common/GameRules/GameRule.h +++ b/Minecraft.Client/Common/GameRules/GameRule.h @@ -14,7 +14,7 @@ public: typedef struct _ValueType { union{ - __int64 i64; + int64_t i64; int i; char c; bool b; @@ -44,7 +44,7 @@ public: virtual ~GameRule(); Connection *getConnection() { return m_connection; } - + ValueType getParameter(const wstring ¶meterName); void setParameter(const wstring ¶meterName,ValueType value); GameRuleDefinition *getGameRuleDefinition(); diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp index 25f30b682..3091b8acd 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp @@ -13,7 +13,7 @@ #include "GameRuleManager.h" const WCHAR *GameRuleManager::wchTagNameA[] = - { +{ L"", // eGameRuleType_Root L"MapOptions", // eGameRuleType_LevelGenerationOptions L"ApplySchematic", // eGameRuleType_ApplySchematic @@ -35,7 +35,7 @@ const WCHAR *GameRuleManager::wchTagNameA[] = }; const WCHAR *GameRuleManager::wchAttrNameA[] = - { +{ L"descriptionName", // eGameRuleAttr_descriptionName L"promptName", // eGameRuleAttr_promptName L"dataTag", // eGameRuleAttr_dataTag @@ -385,7 +385,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UI // Read File. // version_number - __int64 version = dis.readShort(); + int64_t version = dis.readShort(); unsigned char compressionType = 0; if(version == 0) { diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Common/GameRules/GameRuleManager.h index 129490bb2..481fc723d 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.h @@ -24,7 +24,7 @@ class WstringLookup; class GameRuleManager { public: - static const WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; + static const WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; static const WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; static const short version_number = 2; diff --git a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp index e49ee293d..59fde56e0 100644 --- a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp @@ -175,7 +175,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws { if(attributeName.compare(L"seed") == 0) { - m_seed = _fromString<__int64>(attributeValue); + m_seed = _fromString(attributeValue); app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed); } else if(attributeName.compare(L"spawnX") == 0) @@ -700,7 +700,7 @@ void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; } void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; } -__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; } +int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; } int LevelGenerationOptions::getLevelHasBeenInCreative() { return m_bHasBeenInCreative; } Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; } bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; } diff --git a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h index aa128ff84..cf669019a 100644 --- a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h +++ b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h @@ -19,7 +19,7 @@ class GrSource public: // 4J-JEV: // Moved all this here; I didn't like that all this header information - // was being mixed in with all the game information as they have + // was being mixed in with all the game information as they have // completely different lifespans. virtual bool requiresTexturePack()=0; @@ -146,7 +146,7 @@ public: private: // This should match the "MapOptionsRule" definition in the XML schema - __int64 m_seed; + int64_t m_seed; bool m_useFlatWorld; Pos *m_spawnPos; int m_bHasBeenInCreative; @@ -171,13 +171,13 @@ public: ~LevelGenerationOptions(); virtual ConsoleGameRules::EGameRuleType getActionType(); - + virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - __int64 getLevelSeed(); + int64_t getLevelSeed(); int getLevelHasBeenInCreative(); Pos *getSpawnPos(); bool getuseFlatWorld(); @@ -190,7 +190,7 @@ public: private: void clearSchematics(); -public: +public: ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen); public: @@ -211,7 +211,7 @@ public: void loadBaseSaveData(); static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask); - + // 4J-JEV: // ApplySchematicRules contain limited state // which needs to be reset BEFORE a new game starts. diff --git a/Minecraft.Client/Common/Media/MediaWindows64.arc b/Minecraft.Client/Common/Media/MediaWindows64.arc index 4c17b74b4..6ce552c53 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64.arc and b/Minecraft.Client/Common/Media/MediaWindows64.arc differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf index 3a48abc9d..f6866abf1 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenu480.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenu480.swf index 4fb884a94..c360db92d 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenu480.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenu480.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenu720.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenu720.swf index 94996803c..418b1ba2b 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenu720.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenuVita.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenuVita.swf index 5e937d4d0..f7f5644ad 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenuVita.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenuVita.swf differ diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index dbae30103..92ea8ad03 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -45,8 +45,8 @@ CGameNetworkManager g_NetworkManager; CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager; -__int64 CGameNetworkManager::messageQueue[512]; -__int64 CGameNetworkManager::byteQueue[512]; +int64_t CGameNetworkManager::messageQueue[512]; +int64_t CGameNetworkManager::byteQueue[512]; int CGameNetworkManager::messageQueuePos = 0; CGameNetworkManager::CGameNetworkManager() @@ -194,7 +194,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame ProfileManager.SetDeferredSignoutEnabled(true); #endif - __int64 seed = 0; + int64_t seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; @@ -287,7 +287,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame } } - static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running + static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running ServerStoppedCreate(false); if( g_NetworkManager.IsHost() ) { @@ -929,7 +929,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) int CGameNetworkManager::ServerThreadProc( void* lpParameter ) { - __int64 seed = 0; + int64_t seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.h b/Minecraft.Client/Common/Network/GameNetworkManager.h index bb7633c28..15c7f0b06 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.h +++ b/Minecraft.Client/Common/Network/GameNetworkManager.h @@ -100,11 +100,11 @@ public: void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); void ForceFriendsSessionRefresh(); - + // Session joining and leaving bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo); - eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask); + eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask); static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface bool LeaveGame(bool bMigrateHost); static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad); @@ -113,13 +113,13 @@ public: void ResetLeavingGame(); // Threads - + bool IsNetworkThreadRunning(); static int RunNetworkGameThreadProc( void* lpParameter ); static int ServerThreadProc( void* lpParameter ); static int ExitAndJoinFromInviteThreadProc( void* lpParam ); -#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__) +#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__) static int MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result); static int PSNSignInReturned_0(void* pParam, bool bContinue, int iPad); @@ -130,7 +130,7 @@ public: static void _LeaveGame(); static int ChangeSessionTypeThreadProc( void* lpParam ); - // System flags + // System flags void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index); bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index); @@ -145,8 +145,8 @@ public: void ServerStoppedCreate(bool create); // Create the signal void ServerStopped(); // Signal that we are ready - void ServerStoppedWait(); // Wait for the signal - void ServerStoppedDestroy(); // Destroy signal + void ServerStoppedWait(); // Wait for the signal + void ServerStoppedDestroy(); // Destroy signal bool ServerStoppedValid(); // Is non-NULL #ifdef __PSVITA__ @@ -164,9 +164,9 @@ public: // Used for debugging output static const int messageQueue_length = 512; - static __int64 messageQueue[messageQueue_length]; + static int64_t messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static __int64 byteQueue[byteQueue_length]; + static int64_t byteQueue[byteQueue_length]; static int messageQueuePos; // Methods called from PlatformNetworkManager diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index 80fbd98cf..970dfd241 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -8,6 +8,8 @@ #include "..\..\Windows64\Windows64_Xuid.h" #include "..\..\Minecraft.h" #include "..\..\User.h" +#include "..\..\MinecraftServer.h" +#include "..\..\PlayerList.h" #include #endif @@ -238,15 +240,33 @@ void CPlatformNetworkManagerStub::DoWork() qnetPlayer->m_resolvedXuid = INVALID_XUID; qnetPlayer->m_gamertag[0] = 0; qnetPlayer->SetCustomDataValue(0); - WinsockNetLayer::PushFreeSmallId(disconnectedSmallId); if (IQNet::s_playerCount > 1) IQNet::s_playerCount--; } + // Always return smallId to the free pool so it can be reused (game may have already cleared the slot). + WinsockNetLayer::PushFreeSmallId(disconnectedSmallId); + // Clear O(1) socket lookup so GetSocketForSmallId stays fast (s_connections never shrinks). + WinsockNetLayer::ClearSocketForSmallId(disconnectedSmallId); + // Clear chunk visibility flags for this system so rejoin gets fresh chunk state. + SystemFlagRemoveBySmallId((int)disconnectedSmallId); } } #endif } +bool CPlatformNetworkManagerStub::CanAcceptMoreConnections() +{ +#ifdef _WINDOWS64 + MinecraftServer* server = MinecraftServer::getInstance(); + if (server == NULL) return true; + PlayerList* list = server->getPlayerList(); + if (list == NULL) return true; + return (unsigned int)list->players.size() < (unsigned int)list->getMaxPlayers(); +#else + return true; +#endif +} + int CPlatformNetworkManagerStub::GetPlayerCount() { return m_pIQNet->GetPlayerCount(); @@ -581,6 +601,7 @@ CPlatformNetworkManagerStub::PlayerFlags::PlayerFlags(INetworkPlayer *pNetworkPl this->flags = new unsigned char [ count / 8 ]; memset( this->flags, 0, count / 8 ); this->count = count; + this->m_smallId = (pNetworkPlayer && pNetworkPlayer->IsLocal()) ? 256 : (pNetworkPlayer ? (int)pNetworkPlayer->GetSmallId() : -1); } CPlatformNetworkManagerStub::PlayerFlags::~PlayerFlags() { @@ -618,6 +639,23 @@ void CPlatformNetworkManagerStub::SystemFlagRemovePlayer(INetworkPlayer *pNetwor } } +// Clear chunk flags for a system when they disconnect (by smallId). Call even when we don't find the player, +// so we always clear and the smallId can be reused without stale "chunk seen" state. +void CPlatformNetworkManagerStub::SystemFlagRemoveBySmallId(int smallId) +{ + if (smallId < 0) return; + for (unsigned int i = 0; i < m_playerFlags.size(); i++) + { + if (m_playerFlags[i]->m_smallId == smallId) + { + delete m_playerFlags[i]; + m_playerFlags[i] = m_playerFlags.back(); + m_playerFlags.pop_back(); + return; + } + } +} + void CPlatformNetworkManagerStub::SystemFlagReset() { for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) @@ -734,7 +772,7 @@ void CPlatformNetworkManagerStub::SearchForGames() info->data.playerCount = lanSessions[i].playerCount; info->data.maxPlayers = lanSessions[i].maxPlayers; - info->sessionId = (SessionID)((unsigned __int64)inet_addr(lanSessions[i].hostIP) | ((unsigned __int64)lanSessions[i].hostPort << 32)); + info->sessionId = (SessionID)((uint64_t)inet_addr(lanSessions[i].hostIP) | ((uint64_t)lanSessions[i].hostPort << 32)); friendsSessions[0].push_back(info); } diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h index 28953cecb..261639f2a 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h @@ -98,12 +98,14 @@ private: INetworkPlayer *m_pNetworkPlayer; unsigned char *flags; unsigned int count; + int m_smallId; PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count); ~PlayerFlags(); }; vector m_playerFlags; void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer); void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer); + void SystemFlagRemoveBySmallId(int smallId); void SystemFlagReset(); public: virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index); @@ -161,6 +163,9 @@ public: virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void ForceFriendsSessionRefresh(); + // Win64: used by accept thread to reject connections when server is at max players (so we don't assign smallId > max). + bool CanAcceptMoreConnections(); + public: void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer ); void NotifyPlayerLeaving(IQNetPlayer* pQNetPlayer); diff --git a/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.cpp b/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.cpp index a7a4628b1..21cd82aad 100644 --- a/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.cpp +++ b/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.cpp @@ -132,6 +132,6 @@ int NetworkPlayerSony::GetTimeSinceLastChunkPacket_ms() return INT_MAX; } - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); return (int)( currentTime - m_lastChunkPacketTime ); } diff --git a/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.h b/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.h index f3415a41a..2c61f78df 100644 --- a/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.h +++ b/Minecraft.Client/Common/Network/Sony/NetworkPlayerSony.h @@ -39,5 +39,5 @@ public: private: SQRNetworkPlayer *m_sqrPlayer; Socket *m_pSocket; - __int64 m_lastChunkPacketTime; + int64_t m_lastChunkPacketTime; }; diff --git a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp index 9bbdb73c8..6448c208b 100644 --- a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp +++ b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.cpp @@ -145,7 +145,7 @@ bool SQRNetworkPlayer::IsReady() { return ( ( m_flags & SNP_FLAG_READY_MASK ) == SNP_FLAG_READY_MASK ); } - + PlayerUID SQRNetworkPlayer::GetUID() { return m_ISD.m_UID; @@ -224,7 +224,7 @@ void SQRNetworkPlayer::SendData( SQRNetworkPlayer *pPlayerTarget, const void *da { AckFlags ackFlags = ack ? e_flag_AckRequested : e_flag_AckNotRequested; // Our network is connected as a star. If we are the host, then we can send to any remote player. If we're a client, we can send only to the host. - // The host can also send to other local players, but this doesn't need to go through Rudp. + // The host can also send to other local players, but this doesn't need to go through Rudp. if( m_host ) { if( ( m_type == SNP_TYPE_HOST ) && ( pPlayerTarget->m_type == SNP_TYPE_LOCAL ) ) @@ -286,7 +286,7 @@ void SQRNetworkPlayer::SendInternal(const void *data, unsigned int dataSize, Ack sendBlock.end = NULL; sendBlock.current = NULL; sendBlock.ack = ackFlags; - m_sendQueue.push(sendBlock); + m_sendQueue.push(sendBlock); } else { @@ -299,13 +299,13 @@ void SQRNetworkPlayer::SendInternal(const void *data, unsigned int dataSize, Ack sendBlock.current = sendBlock.start; sendBlock.ack = ackFlags; memcpy( sendBlock.start, dataCurrent, dataSize); - m_sendQueue.push(sendBlock); + m_sendQueue.push(sendBlock); dataRemaining -= dataSize; dataCurrent += dataSize; } } - m_totalBytesInSendQueue += dataSize; + m_totalBytesInSendQueue += dataSize; // if the queue had something in it already, then the UDP callback will fire and call SendMoreInternal // so we don't call it here, to avoid a deadlock @@ -343,7 +343,7 @@ int SQRNetworkPlayer::WriteDataPacket(const void* data, int dataSize, AckFlags a // nothing was sent! } else - { + { assert(ret==packetSize || ret > headerSize); // we must make sure we've sent the entire packet or the header and some data at least ret -= headerSize; if(ackFlags == e_flag_AckRequested) @@ -443,7 +443,7 @@ void SQRNetworkPlayer::ReadAck() #ifndef _CONTENT_PACKAGE #ifdef PRINT_ACK_STATS - __int64 timeTaken = System::currentTimeMillis() - m_ackStats[0]; + int64_t timeTaken = System::currentTimeMillis() - m_ackStats[0]; if(timeTaken < m_minAckTime) m_minAckTime = timeTaken; if(timeTaken > m_maxAckTime) @@ -525,7 +525,7 @@ void SQRNetworkPlayer::SendMoreInternal() { keepSending = true; } - } + } else if( ( ret >= 0 ) || ( ret == sc_wouldBlockFlag ) ) { @@ -543,7 +543,7 @@ void SQRNetworkPlayer::SendMoreInternal() // Is CELL_RUDP_ERROR_WOULDBLOCK, nothing has yet been sent remainingBytes = dataSize; } - m_sendQueue.front().current = m_sendQueue.front().end - remainingBytes; + m_sendQueue.front().current = m_sendQueue.front().end - remainingBytes; } } } while (keepSending); diff --git a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.h b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.h index d0efe635d..a72e5a41b 100644 --- a/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.h +++ b/Minecraft.Client/Common/Network/Sony/SQRNetworkPlayer.h @@ -68,11 +68,11 @@ class SQRNetworkPlayer }; #ifndef _CONTENT_PACKAGE - std::vector<__int64> m_ackStats; + std::vector m_ackStats; int m_minAckTime; int m_maxAckTime; int m_totalAcks; - __int64 m_totalAckTime; + int64_t m_totalAckTime; int m_averageAckTime; #endif @@ -89,7 +89,7 @@ class SQRNetworkPlayer { public: unsigned char m_smallId; // Id to uniquely and permanently identify this player between machines - assigned by the server - PlayerUID m_UID; + PlayerUID m_UID; }; SQRNetworkPlayer(SQRNetworkManager *manager, eSQRNetworkPlayerType playerType, bool onHost, SceNpMatching2RoomMemberId roomMemberId, int localPlayerIdx, int rudpCtx, PlayerUID *pUID); @@ -114,7 +114,7 @@ class SQRNetworkPlayer int WriteDataPacket(const void* data, int dataSize, AckFlags ackFlags); void ReadAck(); void WriteAck(); - + int GetOutstandingAckCount(); int GetSendQueueSizeBytes(); int GetSendQueueSizeMessages(); diff --git a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp index 4468d163a..02fc73cf6 100644 --- a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp +++ b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp @@ -25,11 +25,11 @@ static SceRemoteStorageStatus statParams; // { // app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n"); // } -// +// // void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) // { // app.DebugPrintf("remoteStorageCallback err : 0x%08x\n"); -// +// // app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, NULL); // } @@ -193,7 +193,7 @@ ESavePlatform SonyRemoteStorage::getSavePlatform() } -__int64 SonyRemoteStorage::getSaveSeed() +int64_t SonyRemoteStorage::getSaveSeed() { if(m_getInfoStatus != e_infoFound) return 0; @@ -223,9 +223,9 @@ const char* SonyRemoteStorage::getRemoteSaveFilename() int SonyRemoteStorage::getSaveFilesize() { - if(m_getInfoStatus == e_infoFound) + if(m_getInfoStatus == e_infoFound) { - return m_remoteFileInfo->fileSize; + return m_remoteFileInfo->fileSize; } return 0; } @@ -288,9 +288,9 @@ bool SonyRemoteStorage::saveIsAvailable() if(m_getInfoStatus != e_infoFound) return false; #ifdef __PS3__ - return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA); + return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA); #elif defined __PSVITA__ - return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3); + return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3); #else // __ORBIS__ return true; #endif @@ -320,7 +320,7 @@ int SonyRemoteStorage::getDataProgress() int nextChunk = ((sizeTransferred + chunkSize) * 100) / totalSize; - __int64 time = System::currentTimeMillis(); + int64_t time = System::currentTimeMillis(); int elapsedSecs = (time - m_startTime) / 1000; float estimatedTransfered = float(elapsedSecs * transferRatePerSec); int progVal = m_dataProgress + (estimatedTransfered / float(totalSize)) * 100; @@ -341,15 +341,15 @@ bool SonyRemoteStorage::shutdown() if(m_bInitialised) { int ret = sceRemoteStorageTerm(); - if(ret >= 0) + if(ret >= 0) { app.DebugPrintf("Term request done \n"); m_bInitialised = false; free(m_memPoolBuffer); m_memPoolBuffer = NULL; return true; - } - else + } + else { app.DebugPrintf("Error in Term request: 0x%x \n", ret); return false; @@ -409,7 +409,7 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData& descData) char seed[22]; app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack); - __int64 iSeed = strtoll(seed,NULL,10); + int64_t iSeed = strtoll(seed,NULL,10); SetU64HexBytes(descData.m_seed, iSeed); // Save the host options that this world was last played with SetU32HexBytes(descData.m_hostOptions, uiHostOptions); @@ -433,7 +433,7 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData_V2& descData) char descDataVersion[9]; sprintf(descDataVersion,"%08x",sc_CurrentDescDataVersion); memcpy(descData.m_descDataVersion,descDataVersion,8); // Don't copy null - + descData.m_platform[0] = SAVE_FILE_PLATFORM_LOCAL & 0xff; descData.m_platform[1] = (SAVE_FILE_PLATFORM_LOCAL >> 8) & 0xff; @@ -448,7 +448,7 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData_V2& descData) char seed[22]; app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack); - __int64 iSeed = strtoll(seed,NULL,10); + int64_t iSeed = strtoll(seed,NULL,10); SetU64HexBytes(descData.m_seed, iSeed); // Save the host options that this world was last played with SetU32HexBytes(descData.m_hostOptions, uiHostOptions); @@ -468,7 +468,7 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData_V2& descData) uint32_t SonyRemoteStorage::GetU32FromHexBytes(char* hexBytes) { char hexString[9]; - ZeroMemory(hexString,9); + ZeroMemory(hexString,9); memcpy(hexString, hexBytes,8); uint32_t u32Val = 0; @@ -481,7 +481,7 @@ uint32_t SonyRemoteStorage::GetU32FromHexBytes(char* hexBytes) uint64_t SonyRemoteStorage::GetU64FromHexBytes(char* hexBytes) { char hexString[17]; - ZeroMemory(hexString,17); + ZeroMemory(hexString,17); memcpy(hexString, hexBytes,16); uint64_t u64Val = 0; diff --git a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h index d38a06e2c..89ecc066c 100644 --- a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h +++ b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "..\..\Common\Network\Sony\sceRemoteStorage\header\sceRemoteStorage.h" @@ -43,7 +43,7 @@ public: char m_saveFileDesc[128]; class DescriptionData - { + { // this stuff is read from a JSON query, so it all has to be text based, max 256 bytes public: char m_platform[4]; @@ -54,7 +54,7 @@ public: }; class DescriptionData_V2 - { + { // this stuff is read from a JSON query, so it all has to be text based, max 256 bytes public: char m_platformNone[4]; // set to no platform, to indicate we're using the newer version of the data @@ -73,7 +73,7 @@ public: public: int m_descDataVersion; ESavePlatform m_savePlatform; - __int64 m_seed; + int64_t m_seed; uint32_t m_hostOptions; uint32_t m_texturePack; uint32_t m_saveVersion; @@ -115,7 +115,7 @@ public: const char* getLocalFilename(); const char* getSaveNameUTF8(); ESavePlatform getSavePlatform(); - __int64 getSaveSeed(); + int64_t getSaveSeed(); unsigned int getSaveHostOptions(); unsigned int getSaveTexturePack(); @@ -140,7 +140,7 @@ public: static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); static int setDataThread(void* lpParam); - SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {} + SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {} protected: const char* getRemoteSaveFilename(); @@ -154,7 +154,7 @@ protected: unsigned int m_thumbnailDataSize; C4JThread* m_SetDataThread; PSAVE_INFO m_setDataSaveInfo; - __int64 m_startTime; + int64_t m_startTime; bool m_bAborting; bool m_bTransferStarted; diff --git a/Minecraft.Client/Common/Network/Sony/sceRemoteStorage/header/sceRemoteStorage.h b/Minecraft.Client/Common/Network/Sony/sceRemoteStorage/header/sceRemoteStorage.h index de70398d7..1a0102940 100644 --- a/Minecraft.Client/Common/Network/Sony/sceRemoteStorage/header/sceRemoteStorage.h +++ b/Minecraft.Client/Common/Network/Sony/sceRemoteStorage/header/sceRemoteStorage.h @@ -97,12 +97,12 @@ int32_t sceRemoteStorageGetStatus(const SceRemoteStorageStatusReqParams & params /// Gets section of data from a file specified. /// /// Gets section of data from a file specified. The amount of data requested can be of any size. To request this information the name of file, the number of bytes and -/// the byte to start reading along with a buffer to store such data must be provided. +/// the uint8_t to start reading along with a buffer to store such data must be provided. /// Metadata information of the file, as description or visibility, will be provided only in the case the first amount of bytes for the file are requested (offset = 0). /// This method does make use of the callback to inform the user of success termination. The SceRemoteStorageData pointer must be a pointer to a valid /// location in memory until the callback is called as the output information will be stored in such location. /// -/// @param params The structure containing the file name to read, the start byte to start reading and the amount of bytes to read. +/// @param params The structure containing the file name to read, the start uint8_t to start reading and the amount of bytes to read. /// @param status The structure where the output information will be stored. The memory location being pointed must be valid until the callback gets called. /// /// @retval SCE_REMOTE_STORAGE_SUCCESS The operation was successfully registered on the thread. diff --git a/Minecraft.Client/Common/PostProcesser.h b/Minecraft.Client/Common/PostProcesser.h index ab7aedf6d..35fa50809 100644 --- a/Minecraft.Client/Common/PostProcesser.h +++ b/Minecraft.Client/Common/PostProcesser.h @@ -45,6 +45,8 @@ private: bool m_wineMode = false; D3D11_VIEWPORT m_customViewport; bool m_useCustomViewport = false; + UINT m_gammaTexWidth = 0; + UINT m_gammaTexHeight = 0; struct GammaCBData { diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h index c5b0e09c3..36b327984 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 requirements each of the task to be completed in order until the last one is complete. +// A tutorial task that requires 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_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp index 882584211..e55f207d4 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -1379,8 +1379,8 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b { int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection); - bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex); - if (bSlotHasItem) + bool bcanPlaySound = !isSlotEmpty(m_eCurrSection, currentIndex); + if (bcanPlaySound) ui.PlayUISFX(eSFX_Press); } } @@ -1390,8 +1390,8 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b { int currentIndex = getCurrentIndex(m_eCurrSection) - getSectionStartOffset(m_eCurrSection); - bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex); - if (bSlotHasItem) + bool bcanPlaySound = !isSlotEmpty(m_eCurrSection, currentIndex); + if (bcanPlaySound) ui.PlayUISFX(eSFX_Press); } // @@ -1486,12 +1486,26 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b } break; case ACTION_MENU_UP: +#ifdef _WINDOWS64 + if (g_KBMInput.WasMouseWheelConsumed()) + { + handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_UP); + break; + } +#endif { //ui.PlayUISFX(eSFX_Focus); m_eCurrTapState = eTapStateUp; } break; case ACTION_MENU_DOWN: +#ifdef _WINDOWS64 + if (g_KBMInput.WasMouseWheelConsumed()) + { + handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_DOWN); + break; + } +#endif { //ui.PlayUISFX(eSFX_Focus); m_eCurrTapState = eTapStateDown; diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 0d1bbc8b0..1020e1e09 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -1099,13 +1099,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) break; case ACTION_MENU_OTHER_STICK_DOWN: { - int pageStep = TabSpec::rows; -#ifdef _WINDOWS64 - if (g_KBMInput.WasMouseWheelConsumed()) - { - pageStep = 1; - } -#endif + int pageStep = 1; m_tabPage[m_curTab] += pageStep; if(m_tabPage[m_curTab] >= specs[m_curTab]->getPageCount()) { @@ -1119,13 +1113,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) break; case ACTION_MENU_OTHER_STICK_UP: { - int pageStep = TabSpec::rows; -#ifdef _WINDOWS64 - if (g_KBMInput.WasMouseWheelConsumed()) - { - pageStep = 1; - } -#endif + int pageStep = 1; m_tabPage[m_curTab] -= pageStep; if(m_tabPage[m_curTab] < 0) { diff --git a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp index cb6443a17..a52ebd727 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp @@ -47,7 +47,7 @@ void UIComponent_Panorama::tick() EnterCriticalSection(&pMinecraft->m_setLevelCS); if(pMinecraft->level!=NULL) { - __int64 i64TimeOfDay =0; + int64_t i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { @@ -104,7 +104,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); IggyPlayerDrawTilesStart ( getMovie() ); - + m_renderWidth = tileWidth; m_renderHeight = tileHeight; IggyPlayerDrawTile ( getMovie() , @@ -112,7 +112,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp tileYStart , tileXStart + tileWidth , tileYStart + tileHeight , - 0 ); + 0 ); IggyPlayerDrawTilesEnd ( getMovie() ); } else diff --git a/Minecraft.Client/Common/UI/UIControl.cpp b/Minecraft.Client/Common/UI/UIControl.cpp index be267ada6..3d853ac46 100644 --- a/Minecraft.Client/Common/UI/UIControl.cpp +++ b/Minecraft.Client/Common/UI/UIControl.cpp @@ -12,6 +12,8 @@ UIControl::UIControl() m_isVisible = true; m_bHidden = false; m_eControlType = eNoControl; + m_id = -1; + m_pParentPanel = NULL; } bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) diff --git a/Minecraft.Client/Common/UI/UIControl.h b/Minecraft.Client/Common/UI/UIControl.h index 29770df28..8445af0fc 100644 --- a/Minecraft.Client/Common/UI/UIControl.h +++ b/Minecraft.Client/Common/UI/UIControl.h @@ -38,12 +38,14 @@ protected: bool m_bHidden; // set by the Remove call public: + UIControl *m_pParentPanel; // set by UI_MAP_ELEMENT macro during mapElementsAndNames void setControlType(eUIControlType eType) {m_eControlType=eType;} eUIControlType getControlType() {return m_eControlType;} void setId(int iID) { m_id=iID; } int getId() { return m_id; } UIScene * getParentScene() {return m_parentScene;} + UIControl* getParentPanel() { return m_pParentPanel; } protected: IggyValuePath m_iggyPath; @@ -62,10 +64,8 @@ public: virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); void UpdateControl(); -#ifdef __PSVITA__ void setHidden(bool bHidden) {m_bHidden=bHidden;} bool getHidden(void) {return m_bHidden;} -#endif IggyValuePath *getIggyValuePath(); diff --git a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp index 68a3d655a..4d60a477c 100644 --- a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp @@ -159,7 +159,7 @@ void UIControl_ButtonList::setButtonLabel(int iButtonId, const wstring &label) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcSetButtonLabel, 2 , value ); } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIControl_ButtonList::SetTouchFocus(S32 iX, S32 iY, bool bRepeat) { IggyDataValue result; diff --git a/Minecraft.Client/Common/UI/UIControl_ButtonList.h b/Minecraft.Client/Common/UI/UIControl_ButtonList.h index 44484ac3f..666b1f0af 100644 --- a/Minecraft.Client/Common/UI/UIControl_ButtonList.h +++ b/Minecraft.Client/Common/UI/UIControl_ButtonList.h @@ -37,7 +37,7 @@ public: void setButtonLabel(int iButtonId, const wstring &label); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void SetTouchFocus(S32 iX, S32 iY, bool bRepeat); bool CanTouchTrigger(S32 iX, S32 iY); #endif diff --git a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp index 74683a62e..653b05926 100644 --- a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp +++ b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp @@ -24,7 +24,7 @@ bool UIControl_SpaceIndicatorBar::setupControl(UIScene *scene, IggyValuePath *pa return success; } -void UIControl_SpaceIndicatorBar::init(UIString label, int id, __int64 min, __int64 max) +void UIControl_SpaceIndicatorBar::init(UIString label, int id, int64_t min, int64_t max) { m_label = label; m_id = id; @@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset() setSaveGameOffset(0.0f); } -void UIControl_SpaceIndicatorBar::addSave(__int64 size) +void UIControl_SpaceIndicatorBar::addSave(int64_t size) { float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min); - m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) ); + m_sizeAndOffsets.push_back( pair(size, startPercent) ); m_currentTotal += size; setTotalSize(m_currentTotal); @@ -75,7 +75,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) { if(index >= 0 && index < m_sizeAndOffsets.size()) { - pair<__int64,float> values = m_sizeAndOffsets[index]; + pair values = m_sizeAndOffsets[index]; setSaveSize(values.first); setSaveGameOffset(values.second); } @@ -86,7 +86,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) } } -void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) +void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) { m_currentSave = size; @@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value ); } -void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size) +void UIControl_SpaceIndicatorBar::setTotalSize(int64_t size) { float percent = (float)((m_currentTotal-m_min))/(m_max-m_min); diff --git a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h index 8eed3944b..52eb3f6d9 100644 --- a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h +++ b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h @@ -6,28 +6,28 @@ class UIControl_SpaceIndicatorBar : public UIControl_Base { private: IggyName m_setSaveSizeFunc, m_setTotalSizeFunc, m_setSaveGameOffsetFunc; - __int64 m_min; - __int64 m_max; - __int64 m_currentSave, m_currentTotal; + int64_t m_min; + int64_t m_max; + int64_t m_currentSave, m_currentTotal; float m_currentOffset; - vector > m_sizeAndOffsets; + vector > m_sizeAndOffsets; public: UIControl_SpaceIndicatorBar(); virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); - void init(UIString label, int id, __int64 min, __int64 max); + void init(UIString label, int id, int64_t min, int64_t max); virtual void ReInit(); void reset(); - void addSave(__int64 size); + void addSave(int64_t size); void selectSave(int index); private: - void setSaveSize(__int64 size); - void setTotalSize(__int64 totalSize); + void setSaveSize(int64_t size); + void setTotalSize(int64_t totalSize); void setSaveGameOffset(float offset); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp index dc7bc5326..8e679b7c7 100644 --- a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp +++ b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp @@ -5,6 +5,15 @@ UIControl_TextInput::UIControl_TextInput() { m_bHasFocus = false; + m_bHasCaret = false; + m_bCaretChecked = false; +#ifdef _WINDOWS64 + m_bDirectEditing = false; + m_iCursorPos = 0; + m_iCharLimit = 0; + m_iDirectEditCooldown = 0; + m_iCaretBlinkTimer = 0; +#endif } bool UIControl_TextInput::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) @@ -16,6 +25,7 @@ bool UIControl_TextInput::setupControl(UIScene *scene, IggyValuePath *parent, co m_textName = registerFastName(L"text"); m_funcChangeState = registerFastName(L"ChangeState"); m_funcSetCharLimit = registerFastName(L"SetCharLimit"); + m_funcSetCaretIndex = registerFastName(L"SetCaretIndex"); return success; } @@ -81,3 +91,197 @@ void UIControl_TextInput::SetCharLimit(int iLimit) value[0].number = iLimit; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcSetCharLimit , 1 , value ); } + +void UIControl_TextInput::setCaretVisible(bool visible) +{ + if (!m_parentScene || !m_parentScene->getMovie()) + return; + + // Check once whether this SWF's FJ_TextInput actually has a m_mcCaret child. + // IggyValuePathMakeNameRef always succeeds (creates a ref to undefined), + // so we validate by trying to read a property from the resolved path. + if (!m_bCaretChecked) + { + IggyValuePath caretPath; + if (IggyValuePathMakeNameRef(&caretPath, getIggyValuePath(), "m_mcCaret")) + { + rrbool test = false; + IggyResult res = IggyValueGetBooleanRS(&caretPath, m_nameVisible, NULL, &test); + m_bHasCaret = (res == 0); + } + else + { + m_bHasCaret = false; + } + m_bCaretChecked = true; + } + if (!m_bHasCaret) + return; + + IggyValuePath caretPath; + if (IggyValuePathMakeNameRef(&caretPath, getIggyValuePath(), "m_mcCaret")) + { + IggyValueSetBooleanRS(&caretPath, m_nameVisible, NULL, visible); + } +} + +void UIControl_TextInput::setCaretIndex(int index) +{ + if (!m_parentScene || !m_parentScene->getMovie()) + return; + + IggyDataValue result; + IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; + value[0].number = index; + IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcSetCaretIndex , 1 , value ); +} + +#ifdef _WINDOWS64 + +void UIControl_TextInput::beginDirectEdit(int charLimit) +{ + const wchar_t* current = getLabel(); + m_editBuffer = current ? current : L""; + m_textBeforeEdit = m_editBuffer; + m_iCursorPos = (int)m_editBuffer.length(); + m_iCharLimit = charLimit; + m_bDirectEditing = true; + m_iDirectEditCooldown = 0; + m_iCaretBlinkTimer = 0; + g_KBMInput.ClearCharBuffer(); + setCaretVisible(true); + setCaretIndex(m_iCursorPos); +} + +UIControl_TextInput::EDirectEditResult UIControl_TextInput::tickDirectEdit() +{ + if (m_iDirectEditCooldown > 0) + m_iDirectEditCooldown--; + + if (!m_bDirectEditing) + { + setCaretVisible(false); + return eDirectEdit_Continue; + } + + // Enforce caret visibility and position every tick — setLabel() and Flash + // focus changes can reset both at any time. + setCaretVisible(true); + setCaretIndex(m_iCursorPos); + + // For SWFs without m_mcCaret, insert '_' at the cursor position. + // All characters remain visible — '_' sits between them like a cursor. + if (!m_bHasCaret) + { + wstring display = m_editBuffer; + display.insert(m_iCursorPos, 1, L'_'); + setLabel(display.c_str()); + } + + EDirectEditResult result = eDirectEdit_Continue; + bool changed = false; + + // Consume typed characters from the KBM buffer + wchar_t ch; + while (g_KBMInput.ConsumeChar(ch)) + { + if (ch == 0x08) // Backspace + { + if (m_iCursorPos > 0) + { + m_editBuffer.erase(m_iCursorPos - 1, 1); + m_iCursorPos--; + changed = true; + } + } + else if (ch == 0x0D) // Enter — confirm edit + { + m_bDirectEditing = false; + m_iDirectEditCooldown = 4; + setLabel(m_editBuffer.c_str(), true); + setCaretVisible(false); + return eDirectEdit_Confirmed; + } + else if (m_iCharLimit <= 0 || (int)m_editBuffer.length() < m_iCharLimit) + { + m_editBuffer.insert(m_iCursorPos, 1, ch); + m_iCursorPos++; + changed = true; + } + } + + // Arrow keys, Home, End, Delete for cursor movement + if (g_KBMInput.IsKeyPressed(VK_LEFT) && m_iCursorPos > 0) + { + m_iCursorPos--; + setCaretIndex(m_iCursorPos); + } + if (g_KBMInput.IsKeyPressed(VK_RIGHT) && m_iCursorPos < (int)m_editBuffer.length()) + { + m_iCursorPos++; + setCaretIndex(m_iCursorPos); + } + if (g_KBMInput.IsKeyPressed(VK_HOME)) + { + m_iCursorPos = 0; + setCaretIndex(m_iCursorPos); + } + if (g_KBMInput.IsKeyPressed(VK_END)) + { + m_iCursorPos = (int)m_editBuffer.length(); + setCaretIndex(m_iCursorPos); + } + if (g_KBMInput.IsKeyPressed(VK_DELETE) && m_iCursorPos < (int)m_editBuffer.length()) + { + m_editBuffer.erase(m_iCursorPos, 1); + changed = true; + } + + // Escape — cancel edit and restore original text + if (g_KBMInput.IsKeyPressed(VK_ESCAPE)) + { + m_editBuffer = m_textBeforeEdit; + m_bDirectEditing = false; + m_iDirectEditCooldown = 4; + setLabel(m_editBuffer.c_str()); + setCaretVisible(false); + return eDirectEdit_Cancelled; + } + + if (changed) + { + if (m_bHasCaret) + { + setLabel(m_editBuffer.c_str()); + setCaretIndex(m_iCursorPos); + } + // SWFs without caret: the cursor block above already updates the label every tick + } + + return eDirectEdit_Continue; +} + +void UIControl_TextInput::cancelDirectEdit() +{ + if (m_bDirectEditing) + { + m_editBuffer = m_textBeforeEdit; + m_bDirectEditing = false; + m_iDirectEditCooldown = 4; + setLabel(m_editBuffer.c_str(), true); + setCaretVisible(false); + } +} + +void UIControl_TextInput::confirmDirectEdit() +{ + if (m_bDirectEditing) + { + m_bDirectEditing = false; + setLabel(m_editBuffer.c_str(), true); + setCaretVisible(false); + } +} + +#endif diff --git a/Minecraft.Client/Common/UI/UIControl_TextInput.h b/Minecraft.Client/Common/UI/UIControl_TextInput.h index 98032d858..3ff289309 100644 --- a/Minecraft.Client/Common/UI/UIControl_TextInput.h +++ b/Minecraft.Client/Common/UI/UIControl_TextInput.h @@ -6,7 +6,20 @@ class UIControl_TextInput : public UIControl_Base { private: IggyName m_textName, m_funcChangeState, m_funcSetCharLimit; + IggyName m_funcSetCaretIndex; bool m_bHasFocus; + bool m_bHasCaret; + bool m_bCaretChecked; + +#ifdef _WINDOWS64 + bool m_bDirectEditing; + wstring m_textBeforeEdit; + wstring m_editBuffer; + int m_iCursorPos; + int m_iCharLimit; + int m_iDirectEditCooldown; + int m_iCaretBlinkTimer; +#endif public: UIControl_TextInput(); @@ -19,4 +32,24 @@ public: virtual void setFocus(bool focus); void SetCharLimit(int iLimit); + + void setCaretVisible(bool visible); + void setCaretIndex(int index); + +#ifdef _WINDOWS64 + enum EDirectEditResult + { + eDirectEdit_Continue, + eDirectEdit_Confirmed, + eDirectEdit_Cancelled, + }; + + void beginDirectEdit(int charLimit = 0); + EDirectEditResult tickDirectEdit(); + void cancelDirectEdit(); + void confirmDirectEdit(); + bool isDirectEditing() const { return m_bDirectEditing; } + int getDirectEditCooldown() const { return m_iDirectEditCooldown; } + const wstring& getEditBuffer() const { return m_editBuffer; } +#endif }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 68a028bf0..e34788bff 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -3,6 +3,7 @@ #include "UI.h" #include "UIScene.h" #include "UIControl_Slider.h" +#include "UIControl_TexturePackList.h" #include "..\..\..\Minecraft.World\StringHelpers.h" #include "..\..\LocalPlayer.h" #include "..\..\DLCTexturePack.h" @@ -143,7 +144,7 @@ extern "C" void *__real_malloc(size_t t); extern "C" void __real_free(void *t); #endif -__int64 UIController::iggyAllocCount = 0; +int64_t UIController::iggyAllocCount = 0; static unordered_map allocations; static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_t size_requested , size_t * size_returned ) { @@ -237,6 +238,8 @@ UIController::UIController() m_winUserIndex = 0; m_mouseDraggingSliderScene = eUIScene_COUNT; m_mouseDraggingSliderId = -1; + m_mouseClickConsumedByScene = false; + m_bMouseHoverHorizontalList = false; m_lastHoverMouseX = -1; m_lastHoverMouseY = -1; m_accumulatedTicks = 0; @@ -499,7 +502,7 @@ void UIController::tick() } // Clear out the cached movie file data - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); for (auto it = m_cachedMovieData.begin(); it != m_cachedMovieData.end();) { if(it->second.m_expiry < currentTime) @@ -608,7 +611,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 requirements some elements from the platform skin + // 4J Stu - We need to load the platformskin before the normal skin, as the normal skin requires some elements from the platform skin if(!skinPath.empty() && app.hasArchiveFile(skinPath)) { byteArray baFile = app.getArchiveFile(skinPath); @@ -619,7 +622,7 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 totalStatic = 0; + int64_t totalStatic = 0; while(res = IggyDebugGetMemoryUseInfo ( NULL , lib , "" , @@ -750,7 +753,7 @@ void UIController::CleanUpSkinReload() byteArray UIController::getMovieData(const wstring &filename) { // Cache everything we load in the current tick - __int64 targetTime = System::currentTimeMillis() + (1000LL * 60); + int64_t targetTime = System::currentTimeMillis() + (1000LL * 60); auto it = m_cachedMovieData.find(filename); if(it == m_cachedMovieData.end() ) { @@ -784,40 +787,36 @@ void UIController::tickInput() #endif { #ifdef _WINDOWS64 + m_mouseClickConsumedByScene = false; if (!g_KBMInput.IsMouseGrabbed() && g_KBMInput.IsKBMActive()) { UIScene *pScene = NULL; - for (int grp = 0; grp < eUIGroup_COUNT && !pScene; ++grp) + // Search by layer priority across all groups (layer-first). + // Tooltip layer is skipped because it holds non-interactive + // overlays (button hints, timer) that should never capture mouse. + // Old group-first order found those tooltips on eUIGroup_Fullscreen + // before reaching in-game menus on eUIGroup_Player1. + static const EUILayer mouseLayers[] = { +#ifndef _CONTENT_PACKAGE + eUILayer_Debug, +#endif + eUILayer_Error, + eUILayer_Alert, + eUILayer_Popup, + eUILayer_Fullscreen, + eUILayer_Scene, + }; + for (int l = 0; l < _countof(mouseLayers) && !pScene; ++l) { - pScene = m_groups[grp]->GetTopScene(eUILayer_Debug); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Tooltips); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Error); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Alert); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Popup); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Fullscreen); - if (!pScene) pScene = m_groups[grp]->GetTopScene(eUILayer_Scene); + for (int grp = 0; grp < eUIGroup_COUNT && !pScene; ++grp) + { + pScene = m_groups[grp]->GetTopScene(mouseLayers[l]); + } } if (pScene && pScene->getMovie()) { - Iggy *movie = pScene->getMovie(); int rawMouseX = g_KBMInput.GetMouseX(); int rawMouseY = g_KBMInput.GetMouseY(); - F32 mouseX = (F32)rawMouseX; - F32 mouseY = (F32)rawMouseY; - - extern HWND g_hWnd; - if (g_hWnd) - { - RECT rc; - GetClientRect(g_hWnd, &rc); - int winW = rc.right - rc.left; - int winH = rc.bottom - rc.top; - if (winW > 0 && winH > 0) - { - mouseX = mouseX * (m_fScreenWidth / (F32)winW); - mouseY = mouseY * (m_fScreenHeight / (F32)winH); - } - } // Only update hover focus when the mouse has actually moved, // so that mouse-wheel scrolling can change list selection @@ -826,43 +825,21 @@ void UIController::tickInput() m_lastHoverMouseX = rawMouseX; m_lastHoverMouseY = rawMouseY; - if (mouseMoved) + // Convert mouse to scene/movie coordinates + F32 sceneMouseX = (F32)rawMouseX; + F32 sceneMouseY = (F32)rawMouseY; { - IggyFocusHandle currentFocus = IGGY_FOCUS_NULL; - IggyFocusableObject focusables[64]; - S32 numFocusables = 0; - IggyPlayerGetFocusableObjects(movie, ¤tFocus, focusables, 64, &numFocusables); - - if (numFocusables > 0 && numFocusables <= 64) + extern HWND g_hWnd; + RECT rc; + if (g_hWnd && GetClientRect(g_hWnd, &rc)) { - IggyFocusHandle hitObject = IGGY_FOCUS_NULL; - for (S32 i = 0; i < numFocusables; ++i) + int winW = rc.right - rc.left; + int winH = rc.bottom - rc.top; + if (winW > 0 && winH > 0) { - if (mouseX >= focusables[i].x0 && mouseX <= focusables[i].x1 && - mouseY >= focusables[i].y0 && mouseY <= focusables[i].y1) - { - hitObject = focusables[i].object; - break; - } + sceneMouseX = sceneMouseX * ((F32)pScene->getRenderWidth() / (F32)winW); + sceneMouseY = sceneMouseY * ((F32)pScene->getRenderHeight() / (F32)winH); } - - if (hitObject != currentFocus) - { - IggyPlayerSetFocusRS(movie, hitObject, 0); - } - } - } - - // Convert mouse to scene/movie coordinates for slider hit testing - F32 sceneMouseX = mouseX; - F32 sceneMouseY = mouseY; - { - S32 displayWidth = 0, displayHeight = 0; - pScene->GetParentLayer()->getRenderDimensions(displayWidth, displayHeight); - if (displayWidth > 0 && displayHeight > 0) - { - sceneMouseX = mouseX * ((F32)pScene->getRenderWidth() / (F32)displayWidth); - sceneMouseY = mouseY * ((F32)pScene->getRenderHeight() / (F32)displayHeight); } } @@ -876,6 +853,110 @@ void UIController::tickInput() panelOffsetY = pMainPanel->getYPos(); } + // Mouse hover — hit test against C++ control bounds. + // Simple controls use SetFocusToElement; list controls + // use their own SetTouchFocus for Flash-side hit testing. + if (mouseMoved) + { + m_bMouseHoverHorizontalList = false; + vector *controls = pScene->GetControls(); + if (controls) + { + int hitControlId = -1; + S32 hitArea = INT_MAX; + UIControl *hitCtrl = NULL; + for (size_t i = 0; i < controls->size(); ++i) + { + UIControl *ctrl = (*controls)[i]; + if (!ctrl || ctrl->getHidden() || !ctrl->getVisible() || ctrl->getId() < 0) + continue; + + UIControl::eUIControlType type = ctrl->getControlType(); + if (type != UIControl::eButton && type != UIControl::eTextInput && + type != UIControl::eCheckBox && type != UIControl::eSlider && + type != UIControl::eButtonList && type != UIControl::eTexturePackList) + continue; + + // If the scene has an active panel (e.g. tab menus), + // skip controls that aren't children of that panel. + if (pMainPanel && ctrl->getParentPanel() != pMainPanel) + continue; + + ctrl->UpdateControl(); + S32 cx = ctrl->getXPos() + panelOffsetX; + S32 cy = ctrl->getYPos() + panelOffsetY; + S32 cw = ctrl->getWidth(); + S32 ch = ctrl->getHeight(); + // TexturePackList origin is where the slot area starts, + // not the top-left of the whole control — use GetRealHeight. + if (type == UIControl::eTexturePackList) + ch = ((UIControl_TexturePackList *)ctrl)->GetRealHeight(); + if (cw <= 0 || ch <= 0) + continue; + + if (sceneMouseX >= cx && sceneMouseX <= cx + cw && + sceneMouseY >= cy && sceneMouseY <= cy + ch) + { + if (type == UIControl::eButtonList) + { + // ButtonList manages focus internally via Flash — + // pass mouse coords so it can highlight the right item. + ((UIControl_ButtonList *)ctrl)->SetTouchFocus( + (S32)sceneMouseX, (S32)sceneMouseY, false); + hitControlId = -1; + hitArea = INT_MAX; + hitCtrl = NULL; + break; // ButtonList takes priority + } + if (type == UIControl::eTexturePackList) + { + // TexturePackList expects coords relative to its origin. + UIControl_TexturePackList *pList = (UIControl_TexturePackList *)ctrl; + pScene->SetFocusToElement(ctrl->getId()); + pList->SetTouchFocus( + (S32)(sceneMouseX - cx), (S32)(sceneMouseY - cy), false); + m_bMouseHoverHorizontalList = true; + hitControlId = -1; + hitArea = INT_MAX; + hitCtrl = NULL; + break; + } + S32 area = cw * ch; + if (area < hitArea) + { + hitControlId = ctrl->getId(); + hitArea = area; + hitCtrl = ctrl; + if (type == UIControl::eSlider) + m_bMouseHoverHorizontalList = true; + } + } + } + + if (hitControlId >= 0 && pScene->getControlFocus() != hitControlId) + { + // During direct editing, don't let hover move focus + // away to other TextInputs (e.g. sign lines). + if (hitCtrl && hitCtrl->getControlType() == UIControl::eTextInput + && pScene->isDirectEditBlocking()) + { + // Skip — keep focus on the actively-edited input + } + else + { + pScene->SetFocusToElement(hitControlId); + // TextInput: SetFocusToElement triggers ChangeState which + // shows the caret. Hide it immediately — the render pass + // happens after both tickInput and scene tick, so no flicker. + if (hitCtrl && hitCtrl->getControlType() == UIControl::eTextInput) + { + ((UIControl_TextInput *)hitCtrl)->setCaretVisible(false); + } + } + } + } + } + bool leftPressed = g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT); bool leftDown = leftPressed || g_KBMInput.IsMouseButtonDown(KeyboardMouseInput::MOUSE_LEFT); @@ -890,12 +971,51 @@ void UIController::tickInput() vector *controls = pScene->GetControls(); if (controls) { + // Set Iggy dispatch focus for TextInput on click (not hover) + // so ACTION_MENU_OK targets the correct text field. + for (size_t i = 0; i < controls->size(); ++i) + { + UIControl *ctrl = (*controls)[i]; + if (!ctrl || ctrl->getControlType() != UIControl::eTextInput || !ctrl->getVisible()) + continue; + if (pMainPanel && ctrl->getParentPanel() != pMainPanel) + continue; + ctrl->UpdateControl(); + S32 cx = ctrl->getXPos() + panelOffsetX; + S32 cy = ctrl->getYPos() + panelOffsetY; + S32 cw = ctrl->getWidth(); + S32 ch = ctrl->getHeight(); + if (cw > 0 && ch > 0 && + sceneMouseX >= cx && sceneMouseX <= cx + cw && + sceneMouseY >= cy && sceneMouseY <= cy + ch) + { + Iggy *movie = pScene->getMovie(); + IggyFocusHandle currentFocus = IGGY_FOCUS_NULL; + IggyFocusableObject focusables[64]; + S32 numFocusables = 0; + IggyPlayerGetFocusableObjects(movie, ¤tFocus, focusables, 64, &numFocusables); + for (S32 fi = 0; fi < numFocusables && fi < 64; ++fi) + { + if (sceneMouseX >= focusables[fi].x0 && sceneMouseX <= focusables[fi].x1 && + sceneMouseY >= focusables[fi].y0 && sceneMouseY <= focusables[fi].y1) + { + IggyPlayerSetFocusRS(movie, focusables[fi].object, 0); + break; + } + } + break; + } + } + for (size_t i = 0; i < controls->size(); ++i) { UIControl *ctrl = (*controls)[i]; if (!ctrl || ctrl->getControlType() != UIControl::eSlider || !ctrl->getVisible()) continue; + if (pMainPanel && ctrl->getParentPanel() != pMainPanel) + continue; + UIControl_Slider *pSlider = (UIControl_Slider *)ctrl; pSlider->UpdateControl(); S32 cx = pSlider->getXPos() + panelOffsetX; @@ -942,6 +1062,12 @@ void UIController::tickInput() m_mouseDraggingSliderScene = eUIScene_COUNT; m_mouseDraggingSliderId = -1; } + + // Let the scene handle mouse clicks for custom navigation (e.g. crafting slots) + if (leftPressed && m_mouseDraggingSliderId < 0) + { + m_mouseClickConsumedByScene = pScene->handleMouseClick(sceneMouseX, sceneMouseY); + } } } #endif @@ -967,7 +1093,7 @@ void UIController::handleInput() } #ifdef __PSVITA__ - //CD - Vita requirements key press 40 - select [MINECRAFT_ACTION_GAME_INFO] + //CD - Vita requires key press 40 - select [MINECRAFT_ACTION_GAME_INFO] handleKeyPress(iPad, MINECRAFT_ACTION_GAME_INFO); #endif } @@ -1206,7 +1332,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) if ((key == ACTION_MENU_OK || key == ACTION_MENU_A) && !g_KBMInput.IsMouseGrabbed()) { - if (m_mouseDraggingSliderId < 0) + if (m_mouseDraggingSliderId < 0 && !m_mouseClickConsumedByScene) { if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT)) { pressed = true; down = true; } if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_LEFT)) { released = true; down = false; } @@ -1214,6 +1340,14 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) } } + // Right click → ACTION_MENU_X (pick up half stack in inventory) + if (key == ACTION_MENU_X && !g_KBMInput.IsMouseGrabbed()) + { + if (g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_RIGHT)) { pressed = true; down = true; } + if (g_KBMInput.IsMouseButtonReleased(KeyboardMouseInput::MOUSE_RIGHT)) { released = true; down = false; } + if (!pressed && !released && g_KBMInput.IsMouseButtonDown(KeyboardMouseInput::MOUSE_RIGHT)) { down = true; } + } + // Scroll wheel for list scrolling — only consume the wheel value when the // action key actually matches, so the other direction isn't lost. if (!g_KBMInput.IsMouseGrabbed() && (key == ACTION_MENU_OTHER_STICK_UP || key == ACTION_MENU_OTHER_STICK_DOWN)) @@ -1231,6 +1365,16 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) pressed = true; down = true; } + + // Remap scroll wheel to navigation actions. Use LEFT/RIGHT when + // hovering a horizontal list (e.g. TexturePackList), UP/DOWN otherwise. + if (pressed && g_KBMInput.IsKBMActive()) + { + if (m_bMouseHoverHorizontalList) + key = (key == ACTION_MENU_OTHER_STICK_UP) ? ACTION_MENU_LEFT : ACTION_MENU_RIGHT; + else + key = (key == ACTION_MENU_OTHER_STICK_UP) ? ACTION_MENU_UP : ACTION_MENU_DOWN; + } } } #endif @@ -1297,8 +1441,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) //!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L< m_substitutionTextures; @@ -149,7 +149,7 @@ private: typedef struct _CachedMovieData { byteArray m_ba; - __int64 m_expiry; + int64_t m_expiry; } CachedMovieData; unordered_map m_cachedMovieData; @@ -164,6 +164,8 @@ private: unsigned int m_winUserIndex; EUIScene m_mouseDraggingSliderScene; int m_mouseDraggingSliderId; + bool m_mouseClickConsumedByScene; + bool m_bMouseHoverHorizontalList; int m_lastHoverMouseX; int m_lastHoverMouseY; //bool m_bSysUIShowing; @@ -171,7 +173,7 @@ private: C4JThread *m_reloadSkinThread; bool m_navigateToHomeOnReload; int m_accumulatedTicks; - __uint64 m_lastUiSfx; // Tracks time (ms) of last UI sound effect + uint64_t m_lastUiSfx; // Tracks time (ms) of last UI sound effect D3D11_RECT m_customRenderingClearRect; @@ -215,7 +217,7 @@ protected: void postInit(); -public: +public: CRITICAL_SECTION m_Allocatorlock; void SetupFont(); bool PendingFontChange(); @@ -247,7 +249,7 @@ private: void tickInput(); void handleInput(); void handleKeyPress(unsigned int iPad, unsigned int key); - + protected: static rrbool RADLINK ExternalFunctionCallback( void * user_callback_data , Iggy * player , IggyExternalFunctionCallUTF16 * call ); @@ -317,7 +319,7 @@ private: public: void CloseAllPlayersScenes(); void CloseUIScenes(int iPad, bool forceIPad = false); - + virtual bool IsPauseMenuDisplayed(int iPad); virtual bool IsContainerMenuDisplayed(int iPad); virtual bool IsIgnorePlayerJoinMenuDisplayed(int iPad); diff --git a/Minecraft.Client/Common/UI/UIGroup.cpp b/Minecraft.Client/Common/UI/UIGroup.cpp index e8bb9fe66..79d3c38f7 100644 --- a/Minecraft.Client/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Common/UI/UIGroup.cpp @@ -81,7 +81,7 @@ void UIGroup::tick() } // Handle deferred update focus - if (m_updateFocusStateCountdown > 0) + if (m_updateFocusStateCountdown > 0) { m_updateFocusStateCountdown--; if (m_updateFocusStateCountdown == 0)_UpdateFocusState(); @@ -233,7 +233,7 @@ void UIGroup::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel } } -// FOCUS +// FOCUS // Check that a layer may recieve focus, specifically that there is no infocus layer above bool UIGroup::RequestFocus(UILayer* layerPtr) @@ -389,16 +389,16 @@ unsigned int UIGroup::GetLayerIndex(UILayer* layerPtr) // can't get here... return 0; } - -void UIGroup::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) + +void UIGroup::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 groupStatic = 0; - __int64 groupDynamic = 0; + int64_t groupStatic = 0; + int64_t groupDynamic = 0; app.DebugPrintf(app.USER_SR, "-- BEGIN GROUP %d\n",m_group); for(unsigned int i = 0; i < eUILayer_COUNT; ++i) { app.DebugPrintf(app.USER_SR, " \\- BEGIN LAYER %d\n",i); - m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic); + m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic); app.DebugPrintf(app.USER_SR, " \\- END LAYER %d\n",i); } app.DebugPrintf(app.USER_SR, "-- Group static: %d, Group dynamic: %d\n", groupStatic, groupDynamic); @@ -412,7 +412,7 @@ int UIGroup::getCommandBufferList() return m_commandBufferList; } -// Returns the first scene of given type if it exists, NULL otherwise +// Returns the first scene of given type if it exists, NULL otherwise UIScene *UIGroup::FindScene(EUIScene sceneType) { UIScene *pScene = NULL; diff --git a/Minecraft.Client/Common/UI/UIGroup.h b/Minecraft.Client/Common/UI/UIGroup.h index 28369f276..403a32ae6 100644 --- a/Minecraft.Client/Common/UI/UIGroup.h +++ b/Minecraft.Client/Common/UI/UIGroup.h @@ -19,10 +19,10 @@ private: UIScene_HUD *m_hud; C4JRender::eViewportType m_viewportType; - + EUIGroup m_group; int m_iPad; - + bool m_bMenuDisplayed; bool m_bPauseMenuDisplayed; bool m_bContainerMenuDisplayed; @@ -88,7 +88,7 @@ public: void SetViewportType(C4JRender::eViewportType type); C4JRender::eViewportType GetViewportType(); - + virtual void HandleDLCMountingComplete(); virtual void HandleDLCInstalled(); #ifdef _XBOX_ONE @@ -99,15 +99,15 @@ public: bool IsFullscreenGroup(); void handleUnlockFullVersion(); - - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); unsigned int GetLayerIndex(UILayer* layerPtr); int getCommandBufferList(); UIScene *FindScene(EUIScene sceneType); -private: +private: void _UpdateFocusState(); void updateStackStates(); }; diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index b3cf72a0c..2063778b6 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -877,10 +877,10 @@ void UILayer::handleUnlockFullVersion() } } -void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 layerStatic = 0; - __int64 layerDynamic = 0; + int64_t layerStatic = 0; + int64_t layerDynamic = 0; for(auto& it : m_components) { it->PrintTotalMemoryUsage(layerStatic, layerDynamic); diff --git a/Minecraft.Client/Common/UI/UILayer.h b/Minecraft.Client/Common/UI/UILayer.h index 47c776ab7..ec6a1f8a8 100644 --- a/Minecraft.Client/Common/UI/UILayer.h +++ b/Minecraft.Client/Common/UI/UILayer.h @@ -66,12 +66,12 @@ public: // INPUT void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); -#ifdef __PSVITA__ +#ifdef __PSVITA__ // Current active scene UIScene *getCurrentScene(); #endif // FOCUS - + bool updateFocusState(bool allowedFocus = false); public: @@ -87,7 +87,7 @@ public: void handleUnlockFullVersion(); UIScene *FindScene(EUIScene sceneType); - - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); }; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 6ef6d0e82..3f204414f 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -234,7 +234,7 @@ void UIScene::initialiseMovie() m_bUpdateOpacity = true; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIScene::SetFocusToElement(int iID) { IggyDataValue result; @@ -329,11 +329,11 @@ void UIScene::loadMovie() } byteArray baFile = ui.getMovieData(moviePath.c_str()); - __int64 beforeLoad = ui.iggyAllocCount; + int64_t beforeLoad = ui.iggyAllocCount; swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL); - __int64 afterLoad = ui.iggyAllocCount; + int64_t afterLoad = ui.iggyAllocCount; IggyPlayerInitializeAndTickRS ( swf ); - __int64 afterTick = ui.iggyAllocCount; + int64_t afterTick = ui.iggyAllocCount; if(!swf) { @@ -362,8 +362,8 @@ void UIScene::loadMovie() IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 totalStatic = 0; - __int64 totalDynamic = 0; + int64_t totalStatic = 0; + int64_t totalDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , 0 , @@ -406,15 +406,15 @@ void UIScene::getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUse } } -void UIScene::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { if(!swf) return; IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 sceneStatic = 0; - __int64 sceneDynamic = 0; + int64_t sceneStatic = 0; + int64_t sceneDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , "" , @@ -447,6 +447,19 @@ void UIScene::tick() IggyPlayerTickRS( swf ); m_hasTickedOnce = true; } + +#ifdef _WINDOWS64 + { + vector inputs; + getDirectEditInputs(inputs); + for (size_t i = 0; i < inputs.size(); i++) + { + UIControl_TextInput::EDirectEditResult result = inputs[i]->tickDirectEdit(); + if (result != UIControl_TextInput::eDirectEdit_Continue) + onDirectEditFinished(inputs[i], result); + } + } +#endif } UIControl* UIScene::GetMainPanel() @@ -454,6 +467,113 @@ UIControl* UIScene::GetMainPanel() return NULL; } +#ifdef _WINDOWS64 +bool UIScene::isDirectEditBlocking() +{ + vector inputs; + getDirectEditInputs(inputs); + for (size_t i = 0; i < inputs.size(); i++) + { + if (inputs[i]->isDirectEditing() || inputs[i]->getDirectEditCooldown() > 0) + return true; + } + return false; +} + +bool UIScene::handleMouseClick(F32 x, F32 y) +{ + S32 panelOffsetX = 0, panelOffsetY = 0; + UIControl *pMainPanel = GetMainPanel(); + if (pMainPanel) + { + pMainPanel->UpdateControl(); + panelOffsetX = pMainPanel->getXPos(); + panelOffsetY = pMainPanel->getYPos(); + } + + // Click-outside-to-deselect: confirm any active direct edit if + // the click landed outside the editing text input. + { + vector deInputs; + getDirectEditInputs(deInputs); + for (size_t i = 0; i < deInputs.size(); i++) + { + if (!deInputs[i]->isDirectEditing()) + continue; + deInputs[i]->UpdateControl(); + S32 cx = deInputs[i]->getXPos() + panelOffsetX; + S32 cy = deInputs[i]->getYPos() + panelOffsetY; + S32 cw = deInputs[i]->getWidth(); + S32 ch = deInputs[i]->getHeight(); + if (!(cw > 0 && ch > 0 && x >= cx && x <= cx + cw && y >= cy && y <= cy + ch)) + { + deInputs[i]->confirmDirectEdit(); + onDirectEditFinished(deInputs[i], UIControl_TextInput::eDirectEdit_Confirmed); + } + } + } + + vector *controls = GetControls(); + if (!controls) return false; + + // Hit-test controls and pick the smallest-area match to handle + // overlapping Flash bounds correctly without sacrificing precision. + int bestId = -1; + S32 bestArea = INT_MAX; + UIControl *bestCtrl = NULL; + + for (size_t i = 0; i < controls->size(); ++i) + { + UIControl *ctrl = (*controls)[i]; + if (!ctrl || ctrl->getHidden() || !ctrl->getVisible() || ctrl->getId() < 0) + continue; + + UIControl::eUIControlType type = ctrl->getControlType(); + if (type != UIControl::eButton && type != UIControl::eTextInput && + type != UIControl::eCheckBox) + continue; + + if (pMainPanel && ctrl->getParentPanel() != pMainPanel) + continue; + + ctrl->UpdateControl(); + S32 cx = ctrl->getXPos() + panelOffsetX; + S32 cy = ctrl->getYPos() + panelOffsetY; + S32 cw = ctrl->getWidth(); + S32 ch = ctrl->getHeight(); + if (cw <= 0 || ch <= 0) + continue; + + if (x >= cx && x <= cx + cw && y >= cy && y <= cy + ch) + { + S32 area = cw * ch; + if (area < bestArea) + { + bestArea = area; + bestId = ctrl->getId(); + bestCtrl = ctrl; + } + } + } + + if (bestId >= 0 && bestCtrl) + { + if (bestCtrl->getControlType() == UIControl::eCheckBox) + { + UIControl_CheckBox *cb = (UIControl_CheckBox *)bestCtrl; + bool newState = !cb->IsChecked(); + cb->setChecked(newState); + handleCheckboxToggled((F64)bestId, newState); + } + else + { + handlePress((F64)bestId, 0); + } + return true; + } + return false; +} +#endif void UIScene::addTimer(int id, int ms) { @@ -534,12 +654,13 @@ void UIScene::removeControl( UIControl_Base *control, bool centreScene) // update the button positions since they may have changed UpdateSceneControls(); - // mark the button as removed - control->setHidden(true); // remove it from the touchboxes ui.TouchBoxRebuild(control->getParentScene()); #endif + // mark the button as removed so hover/touch hit-tests skip it + control->setHidden(true); + } void UIScene::slideLeft() @@ -900,6 +1021,25 @@ void UIScene::sendInputToMovie(int key, bool repeat, bool pressed, bool released app.DebugPrintf("UI WARNING: Ignoring input as game action does not translate to an Iggy keycode\n"); return; } + +#ifdef _WINDOWS64 + // If a navigation key is pressed with no focused element, focus the first + // available one so arrow keys work even when the mouse is over empty space. + if(pressed && (iggyKeyCode == IGGY_KEYCODE_UP || iggyKeyCode == IGGY_KEYCODE_DOWN || + iggyKeyCode == IGGY_KEYCODE_LEFT || iggyKeyCode == IGGY_KEYCODE_RIGHT)) + { + IggyFocusHandle currentFocus = IGGY_FOCUS_NULL; + IggyFocusableObject focusables[64]; + S32 numFocusables = 0; + IggyPlayerGetFocusableObjects(swf, ¤tFocus, focusables, 64, &numFocusables); + if(currentFocus == IGGY_FOCUS_NULL && numFocusables > 0) + { + IggyPlayerSetFocusRS(swf, focusables[0].object, 0); + return; + } + } +#endif + IggyEvent keyEvent; // 4J Stu - Keyloc is always standard as we don't care about shift/alt IggyMakeEventKey( &keyEvent, pressed?IGGY_KEYEVENT_Down:IGGY_KEYEVENT_Up, (IggyKeycode)iggyKeyCode, IGGY_KEYLOC_Standard ); diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index b4008fa01..e45ecdd11 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -6,6 +6,7 @@ using namespace std; #include "UIEnums.h" #include "UIControl_Base.h" +#include "UIControl_TextInput.h" class ItemRenderer; class UILayer; @@ -16,22 +17,26 @@ class UILayer; virtual bool mapElementsAndNames() \ { \ parentClass::mapElementsAndNames(); \ - IggyValuePath *currentRoot = IggyPlayerRootPath ( getMovie() ); + IggyValuePath *currentRoot = IggyPlayerRootPath ( getMovie() ); \ + UIControl *_mapPanel = NULL; #define UI_END_MAP_ELEMENTS_AND_NAMES() \ return true; \ } #define UI_MAP_ELEMENT( var, name) \ - { var.setupControl(this, currentRoot , name ); m_controls.push_back(&var); } + { var.setupControl(this, currentRoot , name ); var.m_pParentPanel = _mapPanel; m_controls.push_back(&var); } #define UI_BEGIN_MAP_CHILD_ELEMENTS( parent ) \ { \ IggyValuePath *lastRoot = currentRoot; \ - currentRoot = parent.getIggyValuePath(); + UIControl *_lastPanel = _mapPanel; \ + currentRoot = parent.getIggyValuePath(); \ + _mapPanel = &parent; #define UI_END_MAP_CHILD_ELEMENTS() \ currentRoot = lastRoot; \ + _mapPanel = _lastPanel; \ } #define UI_MAP_NAME( var, name ) \ @@ -40,7 +45,7 @@ class UILayer; class UIScene { friend class UILayer; -public: +public: IggyValuePath *m_rootPath; private: @@ -80,7 +85,7 @@ public: protected: ESceneResolution m_loadedResolution; - + bool m_bIsReloading; bool m_bFocussedOnce; @@ -96,7 +101,7 @@ protected: public: virtual Iggy *getMovie() { return swf; } - + void destroyMovie(); virtual void reloadMovie(bool force = false); virtual bool needsReloaded(); @@ -129,7 +134,7 @@ private: void getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUseInfo &memoryInfo); public: - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); public: UIScene(int iPad, UILayer *parentLayer); @@ -141,8 +146,10 @@ public: virtual void tick(); IggyName registerFastName(const wstring &name); +#if defined(__PSVITA__) || defined(_WINDOWS64) + void SetFocusToElement(int iID); +#endif #ifdef __PSVITA__ - void SetFocusToElement(int iID); void UpdateSceneControls(); #endif protected: @@ -162,7 +169,7 @@ public: void gainFocus(); void loseFocus(); - + virtual void updateTooltips(); virtual void updateComponents() {} virtual void handleGainFocus(bool navBack); @@ -177,6 +184,19 @@ public: // returns main panel if controls are not living in the root virtual UIControl* GetMainPanel(); +#ifdef _WINDOWS64 + // Direct edit support: scenes override to register their text inputs. + // Base class handles tickDirectEdit in tick(), click-outside-to-deselect + // in handleMouseClick(), and provides isDirectEditBlocking() for guards. + virtual void getDirectEditInputs(vector &inputs) {} + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) {} + bool isDirectEditBlocking(); + + // Mouse click dispatch. Hit-tests C++ controls and picks the smallest-area + // match, then calls handlePress. Override for custom behaviour (e.g. crafting). + virtual bool handleMouseClick(F32 x, F32 y); +#endif + void removeControl( UIControl_Base *control, bool centreScene); void slideLeft(); void slideRight(); @@ -193,7 +213,7 @@ public: protected: //void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, int iID, int iCount, int iAuxVal, float fAlpha, bool isFoil, bool bDecorations); void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations); - + bool m_cacheSlotRenders; bool m_needsCacheRendered; int m_expectedCachedSlotCount; @@ -269,7 +289,7 @@ public: protected: -#ifdef _DURANGO +#ifdef _DURANGO virtual long long getDefaultGtcButtons() { return _360_GTC_BACK; } #endif diff --git a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp index c810ad455..4d43a638b 100644 --- a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp @@ -96,6 +96,19 @@ void UIScene_AnvilMenu::tick() { UIScene_AbstractContainerMenu::tick(); +#ifdef _WINDOWS64 + // Live update: sync item name per-keystroke while editing (like Java edition) + if (m_textInputAnvil.isDirectEditing()) + { + const wstring& buf = m_textInputAnvil.getEditBuffer(); + if (buf != m_itemName) + { + m_itemName = buf; + updateItemName(); + } + } +#endif + handleTick(); } @@ -306,26 +319,67 @@ UIControl *UIScene_AnvilMenu::getSection(ESceneSection eSection) return control; } +#ifdef _WINDOWS64 +void UIScene_AnvilMenu::getDirectEditInputs(vector &inputs) +{ + inputs.push_back(&m_textInputAnvil); +} + +void UIScene_AnvilMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + m_itemName = input->getEditBuffer(); + updateItemName(); +} +#endif + int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) { - // 4J HEG - No reason to set value if keyboard was cancelled UIScene_AnvilMenu *pClass=(UIScene_AnvilMenu *)lpParam; pClass->setIgnoreInput(false); if (bRes) { +#ifdef _WINDOWS64 + uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(uint16_t)); + Win64_GetKeyboardText(pchText, 128); + pClass->setEditNameValue((wchar_t *)pchText); + pClass->m_itemName = (wchar_t *)pchText; + pClass->updateItemName(); +#else uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); InputManager.GetText(pchText); pClass->setEditNameValue((wchar_t *)pchText); pClass->m_itemName = (wchar_t *)pchText; pClass->updateItemName(); +#endif } return 0; } void UIScene_AnvilMenu::handleEditNamePressed() { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) + return; + + if (g_KBMInput.IsKBMActive()) + { + m_textInputAnvil.beginDirectEdit(30); + } + else + { + setIgnoreInput(true); + UIKeyboardInitData kbData; + kbData.title = app.GetString(IDS_TITLE_RENAME); + kbData.defaultText = m_textInputAnvil.getLabel(); + kbData.maxChars = 30; + kbData.callback = &UIScene_AnvilMenu::KeyboardCompleteCallback; + kbData.lpParam = this; + ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen); + } +#else setIgnoreInput(true); #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ int language = XGetLanguage(); @@ -337,13 +391,13 @@ void UIScene_AnvilMenu::handleEditNamePressed() InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); break; default: - // 4J Stu - Use a different keyboard for non-asian languages so we don't have prediction on InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); break; } #else InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); #endif +#endif } void UIScene_AnvilMenu::setEditNameValue(const wstring &name) @@ -357,6 +411,8 @@ void UIScene_AnvilMenu::setEditNameEditable(bool enabled) void UIScene_AnvilMenu::setCostLabel(const wstring &label, bool canAfford) { + if (!getMovie()) return; + IggyDataValue result; IggyDataValue value[2]; @@ -375,6 +431,8 @@ void UIScene_AnvilMenu::showCross(bool show) { if(m_showingCross != show) { + if (!getMovie()) return; + IggyDataValue result; IggyDataValue value[1]; diff --git a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.h b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.h index 3afc63338..44f759929 100644 --- a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.h @@ -55,6 +55,10 @@ protected: virtual UIControl *getSection(ESceneSection eSection); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); +#endif static int KeyboardCompleteCallback(LPVOID lpParam,bool bRes); virtual void handleEditNamePressed(); virtual void setEditNameValue(const wstring &name); diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp index eaaf73151..2d1b4302f 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp @@ -4,6 +4,9 @@ #include "..\..\MultiplayerLocalPlayer.h" #include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h" #include "UIScene_CraftingMenu.h" +#ifdef _WINDOWS64 +#include "..\..\Windows64\Iggy\gdraw\gdraw_d3d11.h" +#endif #ifdef __PSVITA__ #define GAME_CRAFTING_TOUCHUPDATE_TIMER_ID 0 @@ -12,6 +15,11 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { +#ifdef _WINDOWS64 + m_hSlotBoundsValid = false; + m_hSlotX0 = m_hSlotY0 = m_hSlotY1 = 0; + m_hSlotSpacing = 0; +#endif m_bIgnoreKeyPresses = false; CraftingPanelScreenInput* initData = (CraftingPanelScreenInput*)_initData; @@ -254,12 +262,14 @@ wstring UIScene_CraftingMenu::getMoviePath() } } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl* UIScene_CraftingMenu::GetMainPanel() { return &m_controlMainPanel; } +#endif +#ifdef __PSVITA__ void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) { // perform action on release @@ -375,7 +385,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 requirements further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls GetMainPanel()->UpdateControl(); ui.TouchBoxRebuild(this); killTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID); @@ -383,6 +393,85 @@ void UIScene_CraftingMenu::handleTimerComplete(int id) } #endif +#ifdef _WINDOWS64 +bool UIScene_CraftingMenu::handleMouseClick(F32 x, F32 y) +{ + if (!m_hSlotBoundsValid || m_hSlotSpacing <= 0) + return false; + + // Tab click — tabs sit directly above the H slot row. We derive their + // bounds from the H slot positions cached in customDraw, since the Vita + // TouchPanel controls are full-screen overlays with unusable bounds. + int maxTabs = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroup3x3 : m_iMaxGroup2x2; + F32 slotHeight = m_hSlotY1 - m_hSlotY0; + F32 tabRowY0 = (m_hSlotY0 * 0.75f) - slotHeight * 1.55f; + F32 tabRowY1 = tabRowY0 + (slotHeight * 1.7f); + F32 tabRowWidth = m_hSlotSpacing * m_iCraftablesMaxHSlotC; + F32 tabWidth = tabRowWidth / maxTabs; + + if (tabWidth > 0 && x >= m_hSlotX0 && x < m_hSlotX0 + tabRowWidth && + y >= tabRowY0 && y < tabRowY1) + { + int iTab = (int)((x - m_hSlotX0) / tabWidth); + if (iTab >= 0 && iTab < maxTabs && iTab != m_iGroupIndex) + { + showTabHighlight(m_iGroupIndex, false); + m_iGroupIndex = iTab; + showTabHighlight(m_iGroupIndex, true); + m_iCurrentSlotHIndex = 0; + m_iCurrentSlotVIndex = 1; + CheckRecipesAvailable(); + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + ui.PlayUISFX(eSFX_Focus); + UpdateVerticalSlots(); + UpdateHighlight(); + setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex])); + } + return true; + } + + // H slot click — select or craft + F32 rowWidth = m_hSlotSpacing * m_iCraftablesMaxHSlotC; + if (x >= m_hSlotX0 && x < m_hSlotX0 + rowWidth && + y >= m_hSlotY0 && y < m_hSlotY1) + { + int iNewSlot = (int)((x - m_hSlotX0) / m_hSlotSpacing); + if (iNewSlot >= 0 && iNewSlot < m_iCraftablesMaxHSlotC) + { + // Only interact with populated slots + if (CanBeMadeA[iNewSlot].iCount == 0) + return true; + + if (iNewSlot == m_iCurrentSlotHIndex) + { + // Click on already-selected slot — craft the item + handleKeyDown(m_iPad, ACTION_MENU_A, false); + } + else + { + int iOldHSlot = m_iCurrentSlotHIndex; + m_iCurrentSlotHIndex = iNewSlot; + m_iCurrentSlotVIndex = 1; + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + UpdateVerticalSlots(); + UpdateHighlight(); + if (CanBeMadeA[iOldHSlot].iCount > 0) + setShowCraftHSlot(iOldHSlot, true); + ui.PlayUISFX(eSFX_Focus); + } + return true; + } + } + // Consume all mouse clicks so misses don't generate ACTION_MENU_A + // and accidentally craft. Only blocks mouse-originated presses. + return true; +} +#endif + void UIScene_CraftingMenu::handleReload() { m_slotListInventory.addSlots(CRAFTING_INVENTORY_SLOT_START,CRAFTING_INVENTORY_SLOT_END - CRAFTING_INVENTORY_SLOT_START); @@ -478,6 +567,32 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region) { decorations = false; int iIndex = slotId - CRAFTING_H_SLOT_START; +#ifdef _WINDOWS64 + // Cache H slot SWF-space positions from the custom draw transform matrix + if (iIndex == 0 || iIndex == 1) + { + F32 mat[16]; + gdraw_D3D11_CalculateCustomDraw_4J(region, mat); + // Matrix to SWF coords (same formula as setupCustomDrawMatrices) + F32 sw = (F32)getRenderWidth(); + F32 sh = (F32)getRenderHeight(); + F32 swfX = sw * (1.0f + mat[3]) / 2.0f; + F32 swfY = sh * (1.0f - mat[7]) / 2.0f; + if (iIndex == 0) + { + m_hSlotX0 = swfX; + m_hSlotY0 = swfY; + // Slot visual height from matrix scale and region height + F32 slotH = sh * (-mat[5]) / 2.0f * region->y1; + m_hSlotY1 = swfY + slotH; + } + else + { + m_hSlotSpacing = swfX - m_hSlotX0; + m_hSlotBoundsValid = (m_hSlotSpacing > 0); + } + } +#endif if(m_hSlotsInfo[iIndex].show) { item = m_hSlotsInfo[iIndex].item; diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h index 84c9ba659..2f52b8ba8 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h @@ -66,10 +66,19 @@ public: #ifdef __PSVITA__ virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); - virtual UIControl* GetMainPanel(); virtual void handleTouchBoxRebuild(); virtual void handleTimerComplete(int id); #endif +#if defined(__PSVITA__) || defined(_WINDOWS64) + virtual UIControl* GetMainPanel(); +#endif +#ifdef _WINDOWS64 + virtual bool handleMouseClick(F32 x, F32 y); + // Cached from customDraw — H slot bounding boxes in SWF space + F32 m_hSlotX0, m_hSlotY0, m_hSlotY1; + F32 m_hSlotSpacing; // x distance between slot 0 and slot 1 + bool m_hSlotBoundsValid; +#endif protected: UIControl m_controlMainPanel; @@ -97,7 +106,7 @@ protected: ETouchInput_TouchPanel_5, ETouchInput_TouchPanel_6, ETouchInput_CraftingHSlots, - + ETouchInput_Count, }; UIControl_Touch m_TouchInput[ETouchInput_Count]; diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp index 9114b78e2..67c0fd8c4 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp @@ -58,11 +58,11 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_labelTexturePackDescription.init(L""); WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); m_sliderDifficulty.init(TempString,eControl_Difficulty,0,3,app.GetGameSettings(m_iPad,eGameSetting_Difficulty)); m_MoreOptionsParams.bGenerateOptions=TRUE; - m_MoreOptionsParams.bStructures=TRUE; + m_MoreOptionsParams.bStructures=TRUE; m_MoreOptionsParams.bFlatWorld=FALSE; m_MoreOptionsParams.bBonusChest=FALSE; m_MoreOptionsParams.bPVP = TRUE; @@ -84,10 +84,6 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_iGameModeId = GameType::SURVIVAL->getId(); m_pDLCPack = NULL; m_bRebuildTouchBoxes = false; -#ifdef _WINDOWS64 - m_bDirectEditing = false; - m_iDirectEditCooldown = 0; -#endif m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); // 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it. @@ -95,7 +91,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_MoreOptionsParams.bOnlineSettingChangedBySystem=false; // 4J-PB - Removing this so that we can attempt to create an online game on PS3 when we are a restricted child account - // It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online, + // It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online, // instead of just greying out the online setting in the More Options // #ifdef __PS3__ // if(ProfileManager.IsSignedInLive( m_iPad )) @@ -128,9 +124,9 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay { // The profile settings say Online, but either the player is offline, or they are not allowed to play online m_MoreOptionsParams.bOnlineSettingChangedBySystem=true; - } + } } - + // Set up online game checkbox bool bOnlineGame = m_MoreOptionsParams.bOnlineGame; m_checkboxOnline.SetEnable(true); @@ -293,53 +289,6 @@ void UIScene_CreateWorldMenu::tick() { UIScene::tick(); -#ifdef _WINDOWS64 - if (m_iDirectEditCooldown > 0) - m_iDirectEditCooldown--; - - if (m_bDirectEditing) - { - wchar_t ch; - bool changed = false; - while (g_KBMInput.ConsumeChar(ch)) - { - if (ch == 0x08) // backspace - { - if (!m_worldName.empty()) - { - m_worldName.pop_back(); - changed = true; - } - } - else if (ch == 0x0D) // enter - confirm - { - m_bDirectEditing = false; - m_iDirectEditCooldown = 4; // absorb the matching ACTION_MENU_OK that follows - m_editWorldName.setLabel(m_worldName.c_str()); - } - else if ((int)m_worldName.length() < 25) - { - m_worldName += ch; - changed = true; - } - } - - // Escape cancels and restores the original name - if (m_bDirectEditing && g_KBMInput.IsKeyPressed(VK_ESCAPE)) - { - m_worldName = m_worldNameBeforeEdit; - m_bDirectEditing = false; - m_iDirectEditCooldown = 4; - m_editWorldName.setLabel(m_worldName.c_str()); - m_buttonCreateWorld.setEnable(!m_worldName.empty()); - } - else if (changed) - { - m_editWorldName.setLabel(m_worldName.c_str()); - m_buttonCreateWorld.setEnable(!m_worldName.empty()); - } - } -#endif if(m_iSetTexturePackDescription >= 0 ) { @@ -393,7 +342,7 @@ int UIScene_CreateWorldMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::E UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { pClass->m_MoreOptionsParams.bOnlineGame=false; pClass->checkStateAndStartGame(); @@ -403,11 +352,24 @@ int UIScene_CreateWorldMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::E #endif +#ifdef _WINDOWS64 +void UIScene_CreateWorldMenu::getDirectEditInputs(vector &inputs) +{ + inputs.push_back(&m_editWorldName); +} + +void UIScene_CreateWorldMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + m_worldName = input->getEditBuffer(); + m_buttonCreateWorld.setEnable(!m_worldName.empty()); +} +#endif + void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { if(m_bIgnoreInput) return; #ifdef _WINDOWS64 - if (m_bDirectEditing || m_iDirectEditCooldown > 0) { handled = true; return; } + if (isDirectEditBlocking()) { handled = true; return; } #endif ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released); @@ -431,7 +393,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p if ( pressed && controlHasFocus(m_checkboxOnline.getId()) && !m_checkboxOnline.IsEnabled() ) { UINT uiIDA[1] = { IDS_CONFIRM_OK }; - ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad); + ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad); } #endif @@ -442,7 +404,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p case ACTION_MENU_OTHER_STICK_UP: case ACTION_MENU_OTHER_STICK_DOWN: sendInputToMovie(key, repeat, pressed, released); - + bool bOnlineGame = m_checkboxOnline.IsChecked(); if (m_MoreOptionsParams.bOnlineGame != bOnlineGame) { @@ -464,7 +426,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { if(m_bIgnoreInput) return; #ifdef _WINDOWS64 - if (m_bDirectEditing || m_iDirectEditCooldown > 0) return; + if (isDirectEditBlocking()) return; #endif //CD - Added for audio @@ -476,7 +438,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { m_bIgnoreInput=true; #ifdef _WINDOWS64 - if (Win64_IsControllerConnected()) + if (!g_KBMInput.IsKBMActive()) { UIKeyboardInitData kbData; kbData.title = app.GetString(IDS_CREATE_NEW_WORLD); @@ -488,11 +450,8 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) } else { - // PC without controller: edit the name field directly in-place. - m_bIgnoreInput = false; // Don't block input - m_bDirectEditing is the guard - m_worldNameBeforeEdit = m_worldName; - m_bDirectEditing = true; - g_KBMInput.ClearCharBuffer(); + m_bIgnoreInput = false; + m_editWorldName.beginDirectEdit(25); } #else InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD),m_editWorldName.getLabel(),(DWORD)0,25,&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,this,C_4JInput::EKeyboardMode_Default); @@ -502,16 +461,20 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) case eControl_GameModeToggle: switch(m_iGameModeId) { - case 0: // Survival + case 0: // Creative m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_CREATIVE)); m_iGameModeId = GameType::CREATIVE->getId(); m_bGameModeCreative = true; break; - case 1: // Creative + case 1: // Adventure + m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_ADVENTURE)); + m_iGameModeId = GameType::ADVENTURE->getId(); + m_bGameModeCreative = false; + break; + case 2: // Survival m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_SURVIVAL)); m_iGameModeId = GameType::SURVIVAL->getId(); m_bGameModeCreative = false; - break; }; break; case eControl_MoreOptions: @@ -614,7 +577,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() if(m_MoreOptionsParams.dwTexturePack!=0) { // texture pack hasn't been set yet, so check what it will be - TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); + TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack; m_pDLCPack=pDLCTexPack->getDLCInfoParentPack(); @@ -666,7 +629,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; - ui.RequestAlertMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this); + ui.RequestAlertMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this); #endif #if defined _XBOX_ONE || defined __ORBIS__ @@ -693,7 +656,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderDifficulty.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Difficulty,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); m_sliderDifficulty.setLabel(TempString); break; } @@ -702,7 +665,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 requirements further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls if(m_bRebuildTouchBoxes) { GetMainPanel()->UpdateControl(); @@ -740,7 +703,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) m_MoreOptionsParams.bInviteOnly = FALSE; m_MoreOptionsParams.bAllowFriendsOfFriends = FALSE; } - + m_checkboxOnline.SetEnable(bMultiplayerAllowed); m_checkboxOnline.setChecked(m_MoreOptionsParams.bOnlineGame); @@ -774,7 +737,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) PBYTE pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; ListInfo.iData = m_iConfigA[i]; HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); @@ -832,7 +795,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() bool isOnlineGame = m_MoreOptionsParams.bOnlineGame; int iPadNotSignedInLive = -1; bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable(); - + for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++) { if (ProfileManager.IsSignedIn(i) && (i == primaryPad || isLocalMultiplayerAvailable)) @@ -884,7 +847,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() ui.RequestErrorMessage(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad()); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; @@ -940,7 +903,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -955,7 +918,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() #endif if(m_bGameModeCreative == true || m_MoreOptionsParams.bHostPrivileges == TRUE) - { + { UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -1028,7 +991,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -1091,8 +1054,8 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; - param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -1165,14 +1128,14 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE); - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData *param = new NetworkGameInitData(); param->levelName = wWorldName; if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -1191,7 +1154,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString<__int64>(wSeed); + value = _fromString(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -1235,7 +1198,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD app.SetGameHostOption(eGameHostOption_HostCanFly,pClass->m_MoreOptionsParams.bHostPrivileges); app.SetGameHostOption(eGameHostOption_HostCanChangeHunger,pClass->m_MoreOptionsParams.bHostPrivileges); app.SetGameHostOption(eGameHostOption_HostCanBeInvisible,pClass->m_MoreOptionsParams.bHostPrivileges ); - + app.SetGameHostOption(eGameHostOption_MobGriefing, pClass->m_MoreOptionsParams.bMobGriefing); app.SetGameHostOption(eGameHostOption_KeepInventory, pClass->m_MoreOptionsParams.bKeepInventory); app.SetGameHostOption(eGameHostOption_DoMobSpawning, pClass->m_MoreOptionsParams.bDoMobSpawning); @@ -1243,8 +1206,8 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD app.SetGameHostOption(eGameHostOption_DoTileDrops, pClass->m_MoreOptionsParams.bDoTileDrops); app.SetGameHostOption(eGameHostOption_NaturalRegeneration, pClass->m_MoreOptionsParams.bNaturalRegeneration); app.SetGameHostOption(eGameHostOption_DoDaylightCycle, pClass->m_MoreOptionsParams.bDoDaylightCycle); - - app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false); + + app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false); #ifdef _LARGE_WORLDS app.SetGameHostOption(eGameHostOption_WorldSize, pClass->m_MoreOptionsParams.worldSize+1 ); // 0 is GAME_HOST_OPTION_WORLDSIZE_UNKNOWN pClass->m_MoreOptionsParams.currentWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1); @@ -1407,7 +1370,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu } } else - { + { pClass->m_bIgnoreInput = false; } return 0; @@ -1418,7 +1381,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor { UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; @@ -1463,7 +1426,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor ui.RequestAlertMessage( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad()); } else - { + { #if defined( __ORBIS__) || defined(__PSVITA__) bool isOnlineGame = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; if(isOnlineGame) @@ -1493,7 +1456,7 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu *)pParam; pClass->m_bIgnoreInput = false; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass, false, iPad); } @@ -1505,28 +1468,28 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor // { // int32_t iResult; // UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam; -// +// // // continue offline, or upsell PS Plus? -// if(result==C4JStorage::EMessage_ResultDecline) +// if(result==C4JStorage::EMessage_ResultDecline) // { // // upsell psplus // int32_t iResult=sceNpCommerceDialogInitialize(); -// +// // SceNpCommerceDialogParam param; // sceNpCommerceDialogParamInitialize(¶m); // param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; -// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; +// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; // param.userId = ProfileManager.getUserID(pClass->m_iPad); -// +// // iResult=sceNpCommerceDialogOpen(¶m); // } -// else if(result==C4JStorage::EMessage_ResultAccept) +// else if(result==C4JStorage::EMessage_ResultAccept) // { // // continue offline // pClass->m_MoreOptionsParams.bOnlineGame=false; // pClass->checkStateAndStartGame(); // } -// +// // pClass->m_bIgnoreInput=false; // return 0; // } diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h index 13f38a3b7..75bfe602b 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h @@ -51,11 +51,6 @@ private: DLCPack * m_pDLCPack; bool m_bRebuildTouchBoxes; -#ifdef _WINDOWS64 - bool m_bDirectEditing; - wstring m_worldNameBeforeEdit; - int m_iDirectEditCooldown; -#endif public: UIScene_CreateWorldMenu(int iPad, void *initData, UILayer *parentLayer); @@ -83,6 +78,10 @@ protected: public: // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); +#endif private: void StartSharedLaunchFlow(); diff --git a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp index 3dbb5d7be..0895cdffe 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 requirements further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls GetMainPanel()->UpdateControl(); ui.TouchBoxRebuild(this); killTimer(GAME_CREATIVE_TOUCHUPDATE_TIMER_ID); diff --git a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp index 2a8ac9f8e..d3da08709 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.cpp @@ -41,8 +41,72 @@ wstring UIScene_DebugCreateSchematic::getMoviePath() return L"DebugCreateSchematic"; } +UIControl_TextInput* UIScene_DebugCreateSchematic::getTextInputForControl(eControls ctrl) +{ + switch (ctrl) + { + case eControl_Name: return &m_textInputName; + case eControl_StartX: return &m_textInputStartX; + case eControl_StartY: return &m_textInputStartY; + case eControl_StartZ: return &m_textInputStartZ; + case eControl_EndX: return &m_textInputEndX; + case eControl_EndY: return &m_textInputEndY; + case eControl_EndZ: return &m_textInputEndZ; + default: return NULL; + } +} + +#ifdef _WINDOWS64 +void UIScene_DebugCreateSchematic::getDirectEditInputs(vector &inputs) +{ + inputs.push_back(&m_textInputName); + inputs.push_back(&m_textInputStartX); + inputs.push_back(&m_textInputStartY); + inputs.push_back(&m_textInputStartZ); + inputs.push_back(&m_textInputEndX); + inputs.push_back(&m_textInputEndY); + inputs.push_back(&m_textInputEndZ); +} + +void UIScene_DebugCreateSchematic::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + wstring value = input->getEditBuffer(); + int iVal = 0; + if (!value.empty()) + iVal = _fromString(value); + + if (input == &m_textInputName) + { + if (!value.empty()) + swprintf(m_data->name, 64, L"%ls", value.c_str()); + else + swprintf(m_data->name, 64, L"schematic"); + } + else if (input == &m_textInputStartX) m_data->startX = iVal; + else if (input == &m_textInputStartY) m_data->startY = iVal; + else if (input == &m_textInputStartZ) m_data->startZ = iVal; + else if (input == &m_textInputEndX) m_data->endX = iVal; + else if (input == &m_textInputEndY) m_data->endY = iVal; + else if (input == &m_textInputEndZ) m_data->endZ = iVal; +} + +bool UIScene_DebugCreateSchematic::handleMouseClick(F32 x, F32 y) +{ + UIScene::handleMouseClick(x, y); + return true; // always consume to prevent Iggy re-entry on empty space +} +#endif + +void UIScene_DebugCreateSchematic::tick() +{ + UIScene::tick(); +} + void UIScene_DebugCreateSchematic::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif ui.AnimateKeyPress(iPad, key, repeat, pressed, released); switch(key) @@ -67,6 +131,9 @@ void UIScene_DebugCreateSchematic::handleInput(int iPad, int key, bool repeat, b void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif switch((int)controlId) { case eControl_Create: @@ -112,8 +179,28 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) case eControl_EndX: case eControl_EndY: case eControl_EndZ: - m_keyboardCallbackControl = (eControls)((int)controlId); - InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); + { + m_keyboardCallbackControl = (eControls)((int)controlId); +#ifdef _WINDOWS64 + if (g_KBMInput.IsKBMActive()) + { + UIControl_TextInput* input = getTextInputForControl(m_keyboardCallbackControl); + if (input) input->beginDirectEdit(25); + } + else + { + UIKeyboardInitData kbData; + kbData.title = L"Enter something"; + kbData.defaultText = L""; + kbData.maxChars = 25; + kbData.callback = &UIScene_DebugCreateSchematic::KeyboardCompleteCallback; + kbData.lpParam = this; + ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen); + } +#else + InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); +#endif + } break; }; } @@ -138,9 +225,15 @@ int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(LPVOID lpParam,bool b { UIScene_DebugCreateSchematic *pClass=(UIScene_DebugCreateSchematic *)lpParam; +#ifdef _WINDOWS64 + uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(uint16_t)); + Win64_GetKeyboardText(pchText, 128); +#else uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); InputManager.GetText(pchText); +#endif if(pchText[0]!=0) { diff --git a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.h b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.h index cbfe785d0..e18d9f5d0 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.h +++ b/Minecraft.Client/Common/UI/UIScene_DebugCreateSchematic.h @@ -24,6 +24,7 @@ private: ConsoleSchematicFile::XboxSchematicInitParam *m_data; + public: UIScene_DebugCreateSchematic(int iPad, void *initData, UILayer *parentLayer); @@ -58,8 +59,14 @@ protected: UI_END_MAP_ELEMENTS_AND_NAMES() virtual wstring getMoviePath(); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); + virtual bool handleMouseClick(F32 x, F32 y); +#endif public: + virtual void tick(); // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); @@ -68,6 +75,7 @@ protected: virtual void handleCheckboxToggled(F64 controlId, bool selected); private: + UIControl_TextInput* getTextInputForControl(eControls ctrl); static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes); }; #endif \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index af86d4b81..fafcea027 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -23,8 +23,10 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa Minecraft *pMinecraft = Minecraft::GetInstance(); WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)pMinecraft->gameRenderer->GetFovVal()); - m_sliderFov.init(TempString,eControl_FOV,0,100,(int)pMinecraft->gameRenderer->GetFovVal()); + int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV); + int fovDeg = 70 + fovSliderVal * 40 / 100; + swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg); + m_sliderFov.init(TempString,eControl_FOV,0,100,fovSliderVal); float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000; swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); @@ -273,10 +275,15 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) case eControl_FOV: { Minecraft *pMinecraft = Minecraft::GetInstance(); - pMinecraft->gameRenderer->SetFovVal((float)currentValue); + int v = (int)currentValue; + if (v < 0) v = 0; + if (v > 100) v = 100; + int fovDeg = 70 + v * 40 / 100; + pMinecraft->gameRenderer->SetFovVal((float)fovDeg); + app.SetGameSettings(m_iPad, eGameSetting_FOV, v); WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)currentValue); + swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg); m_sliderFov.setLabel(TempString); } break; diff --git a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp index dd5a429f0..62ee60b13 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp @@ -31,19 +31,19 @@ UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void *initData, UILayer WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camX); + swprintf( (WCHAR *)TempString, 256, L"%.2f", currentPosition->m_camX); m_textInputX.init(TempString, eControl_CamX); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camY); + swprintf( (WCHAR *)TempString, 256, L"%.2f", currentPosition->m_camY); m_textInputY.init(TempString, eControl_CamY); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camZ); + swprintf( (WCHAR *)TempString, 256, L"%.2f", currentPosition->m_camZ); m_textInputZ.init(TempString, eControl_CamZ); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_yRot); + swprintf( (WCHAR *)TempString, 256, L"%.2f", currentPosition->m_yRot); m_textInputYRot.init(TempString, eControl_YRot); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_elev); + swprintf( (WCHAR *)TempString, 256, L"%.2f", currentPosition->m_elev); m_textInputElevation.init(TempString, eControl_Elevation); m_checkboxLockPlayer.init(L"Lock Player", eControl_LockPlayer, app.GetFreezePlayers()); @@ -55,6 +55,7 @@ UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void *initData, UILayer m_labelCamY.init(L"CamY"); m_labelCamZ.init(L"CamZ"); m_labelYRotElev.init(L"Y-Rot & Elevation (Degs)"); + } wstring UIScene_DebugSetCamera::getMoviePath() @@ -62,8 +63,59 @@ wstring UIScene_DebugSetCamera::getMoviePath() return L"DebugSetCamera"; } +#ifdef _WINDOWS64 +UIControl_TextInput* UIScene_DebugSetCamera::getTextInputForControl(eControls ctrl) +{ + switch (ctrl) + { + case eControl_CamX: return &m_textInputX; + case eControl_CamY: return &m_textInputY; + case eControl_CamZ: return &m_textInputZ; + case eControl_YRot: return &m_textInputYRot; + case eControl_Elevation: return &m_textInputElevation; + default: return NULL; + } +} + +void UIScene_DebugSetCamera::getDirectEditInputs(vector &inputs) +{ + inputs.push_back(&m_textInputX); + inputs.push_back(&m_textInputY); + inputs.push_back(&m_textInputZ); + inputs.push_back(&m_textInputYRot); + inputs.push_back(&m_textInputElevation); +} + +void UIScene_DebugSetCamera::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + wstring value = input->getEditBuffer(); + double val = 0; + if (!value.empty()) val = _fromString(value); + + if (input == &m_textInputX) currentPosition->m_camX = val; + else if (input == &m_textInputY) currentPosition->m_camY = val; + else if (input == &m_textInputZ) currentPosition->m_camZ = val; + else if (input == &m_textInputYRot) currentPosition->m_yRot = val; + else if (input == &m_textInputElevation) currentPosition->m_elev = val; +} + +bool UIScene_DebugSetCamera::handleMouseClick(F32 x, F32 y) +{ + UIScene::handleMouseClick(x, y); + return true; // always consume to prevent Iggy re-entry on empty space +} +#endif + +void UIScene_DebugSetCamera::tick() +{ + UIScene::tick(); +} + void UIScene_DebugSetCamera::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) { handled = true; return; } +#endif ui.AnimateKeyPress(iPad, key, repeat, pressed, released); switch(key) @@ -88,11 +140,14 @@ void UIScene_DebugSetCamera::handleInput(int iPad, int key, bool repeat, bool pr void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif switch((int)controlId) { case eControl_Teleport: app.SetXuiServerAction( ProfileManager.GetPrimaryPad(), - eXuiServerAction_SetCameraLocation, + eXuiServerAction_SetCameraLocation, (void *)currentPosition); break; case eControl_CamX: @@ -100,8 +155,26 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) case eControl_CamZ: case eControl_YRot: case eControl_Elevation: - m_keyboardCallbackControl = (eControls)((int)controlId); + m_keyboardCallbackControl = (eControls)((int)controlId); +#ifdef _WINDOWS64 + if (g_KBMInput.IsKBMActive()) + { + UIControl_TextInput* input = getTextInputForControl(m_keyboardCallbackControl); + if (input) input->beginDirectEdit(25); + } + else + { + UIKeyboardInitData kbData; + kbData.title = L"Enter value"; + kbData.defaultText = L""; + kbData.maxChars = 25; + kbData.callback = &UIScene_DebugSetCamera::KeyboardCompleteCallback; + kbData.lpParam = this; + ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen); + } +#else InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); +#endif break; }; } @@ -119,9 +192,13 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected) int UIScene_DebugSetCamera::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) { UIScene_DebugSetCamera *pClass=(UIScene_DebugSetCamera *)lpParam; - uint16_t pchText[2048];//[128]; - ZeroMemory(pchText, 2048/*128*/ * sizeof(uint16_t) ); + uint16_t pchText[2048]; + ZeroMemory(pchText, 2048 * sizeof(uint16_t)); +#ifdef _WINDOWS64 + Win64_GetKeyboardText(pchText, 2048); +#else InputManager.GetText(pchText); +#endif if(pchText[0]!=0) { diff --git a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.h b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.h index 38db1258b..d758e049e 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.h +++ b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.h @@ -26,6 +26,9 @@ private: FreezePlayerParam *fpp; eControls m_keyboardCallbackControl; +#ifdef _WINDOWS64 + UIControl_TextInput* getTextInputForControl(eControls ctrl); +#endif public: UIScene_DebugSetCamera(int iPad, void *initData, UILayer *parentLayer); @@ -54,6 +57,12 @@ protected: UI_END_MAP_ELEMENTS_AND_NAMES() virtual wstring getMoviePath(); + virtual void tick(); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); + virtual bool handleMouseClick(F32 x, F32 y); +#endif public: // INPUT diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index e01757abe..5f401c39d 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -753,7 +753,7 @@ void UIScene_HUD::handleTimerComplete(int id) float opacity = pGui->getOpacity(m_iPad, i); if( opacity > 0 ) { -#ifdef _WINDOWS64 +#if 0 // def _WINDOWS64 // Use Iggy chat until Gui::render has visual parity // Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats. m_controlLabelBackground[i].setOpacity(0); m_labelChatText[i].setOpacity(0); diff --git a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp index d442553fd..292b77aff 100644 --- a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp @@ -121,7 +121,7 @@ void UIScene_HelpAndOptionsMenu::updateComponents() void UIScene_HelpAndOptionsMenu::handleReload() { -#ifdef _FINAL_BUILD +#ifndef _DEBUG // def _FINAL_BUILD // disable debug settings in release builds removeControl( &m_buttons[BUTTON_HAO_DEBUG], false); #else if(!app.DebugSettingsOn()) removeControl( &m_buttons[BUTTON_HAO_DEBUG], false); diff --git a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp index d7196849f..db9c1d4d0 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp @@ -61,7 +61,7 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void if(m_editingSelf) { -#if (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) +#ifndef _DEBUG // (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) removeControl( &m_checkboxes[eControl_Op], true ); #else m_checkboxes[eControl_Op].init(L"DEBUG: Creative",eControl_Op,Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode)); @@ -254,7 +254,7 @@ void UIScene_InGamePlayerOptionsMenu::handleReload() if(m_editingSelf) { -#if (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) +#ifndef _DEBUG //(defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) removeControl( &m_checkboxes[eControl_Op], true ); #endif @@ -348,7 +348,7 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; if(m_editingSelf) { -#if (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) +#ifndef _DEBUG // (defined(_CONTENT_PACKAGE) || defined(_FINAL_BUILD) && !defined(_DEBUG_MENUS_ENABLED)) #else Player::setPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode,m_checkboxes[eControl_Op].IsChecked()); #endif diff --git a/Minecraft.Client/Common/UI/UIScene_Intro.cpp b/Minecraft.Client/Common/UI/UIScene_Intro.cpp index 7fc435b22..f4aefc405 100644 --- a/Minecraft.Client/Common/UI/UIScene_Intro.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Intro.cpp @@ -83,17 +83,23 @@ void UIScene_Intro::handleInput(int iPad, int key, bool repeat, bool pressed, bo case C4JStorage::eOptions_Callback_Read: case C4JStorage::eOptions_Callback_Read_FileNotFound: // we've either read it, or it wasn't found + #if 0 if(app.GetGameSettings(0,eGameSetting_PS3_EULA_Read)==0) { ui.NavigateToScene(0,eUIScene_EULA); } else + #endif { ui.NavigateToScene(0,eUIScene_SaveMessage); } break; default: - ui.NavigateToScene(0,eUIScene_EULA); + #if 0 + ui.NavigateToScene(0,eUIScene_EULA); + #else + ui.NavigateToScene(0,eUIScene_SaveMessage); + #endif break; } #elif defined _XBOX_ONE @@ -131,17 +137,23 @@ void UIScene_Intro::handleAnimationEnd() case C4JStorage::eOptions_Callback_Read: case C4JStorage::eOptions_Callback_Read_FileNotFound: // we've either read it, or it wasn't found + #if 0 if(app.GetGameSettings(0,eGameSetting_PS3_EULA_Read)==0) { ui.NavigateToScene(0,eUIScene_EULA); } else + #endif { ui.NavigateToScene(0,eUIScene_SaveMessage); } break; default: - ui.NavigateToScene(0,eUIScene_EULA); + #if 0 + ui.NavigateToScene(0,eUIScene_EULA); + #else + ui.NavigateToScene(0,eUIScene_SaveMessage); + #endif break; } diff --git a/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp index c036f7bf9..6e3549221 100644 --- a/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp @@ -532,6 +532,48 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) break; } + if( exitReasonStringId == -1 ) + { + Minecraft* pMinecraft = Minecraft::GetInstance(); + int primaryPad = ProfileManager.GetPrimaryPad(); + if( pMinecraft->m_connectionFailed[primaryPad] ) + { + switch( pMinecraft->m_connectionFailedReason[primaryPad] ) + { + case DisconnectPacket::eDisconnect_LoginTooLong: + exitReasonStringId = IDS_DISCONNECTED_LOGIN_TOO_LONG; + break; + case DisconnectPacket::eDisconnect_ServerFull: + exitReasonStringId = IDS_DISCONNECTED_SERVER_FULL; + break; + case DisconnectPacket::eDisconnect_Kicked: + exitReasonStringId = IDS_DISCONNECTED_KICKED; + break; + case DisconnectPacket::eDisconnect_NoUGC_AllLocal: + exitReasonStringId = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_ALL_LOCAL; + break; + case DisconnectPacket::eDisconnect_NoUGC_Single_Local: + exitReasonStringId = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL; + break; + case DisconnectPacket::eDisconnect_NoFlying: + exitReasonStringId = IDS_DISCONNECTED_FLYING; + break; + case DisconnectPacket::eDisconnect_Quitting: + exitReasonStringId = IDS_DISCONNECTED_SERVER_QUIT; + break; + case DisconnectPacket::eDisconnect_OutdatedServer: + exitReasonStringId = IDS_DISCONNECTED_SERVER_OLD; + break; + case DisconnectPacket::eDisconnect_OutdatedClient: + exitReasonStringId = IDS_DISCONNECTED_CLIENT_OLD; + break; + default: + exitReasonStringId = IDS_CONNECTION_LOST_SERVER; + break; + } + } + } + if( exitReasonStringId == -1 ) { ui.NavigateBack(pClass->m_iPad); diff --git a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp index 9e46a42e9..b28564c3a 100644 --- a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp @@ -163,6 +163,12 @@ void UIScene_Keyboard::tick() { UIScene::tick(); + // Sync our buffer from Flash so we pick up changes made via controller/on-screen buttons. + // Without this, switching between controller and keyboard would use stale text. + const wchar_t* flashText = m_KeyboardTextInput.getLabel(); + if (flashText) + m_win64TextBuffer = flashText; + // Accumulate physical keyboard chars into our own buffer, then push to Flash via setLabel. // This bypasses Iggy's focus system (char events only route to the focused element). // The char buffer is cleared on open so Enter/clicks from the triggering action don't leak in. diff --git a/Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp b/Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp index e9dc7eb92..070391356 100644 --- a/Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp @@ -126,4 +126,4 @@ void UIScene_LanguageSelector::handlePress(F64 controlId, F64 childId) app.CheckGameSettingsChanged(true, m_iPad); } -} +} \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index d6f89832c..96dd744e9 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -257,6 +257,9 @@ void UIScene_LaunchMoreOptionsMenu::handleDestroy() void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { if(m_bIgnoreInput) return; +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif //app.DebugPrintf("UIScene_DebugOverlay handling input for pad %d, key %d, down- %s, pressed- %s, released- %s\n", iPad, key, down?"TRUE":"FALSE", pressed?"TRUE":"FALSE", released?"TRUE":"FALSE"); ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released); @@ -334,7 +337,9 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S } } } +#endif +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel() { if(m_tabIndex == 0) @@ -546,11 +551,16 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b { UIScene_LaunchMoreOptionsMenu *pClass=(UIScene_LaunchMoreOptionsMenu *)lpParam; pClass->m_bIgnoreInput=false; - // 4J HEG - No reason to set value if keyboard was cancelled if (bRes) { +#ifdef _WINDOWS64 + uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(uint16_t)); + Win64_GetKeyboardText(pchText, 128); + pClass->m_editSeed.setLabel((wchar_t *)pchText); + pClass->m_params->seed = (wchar_t *)pchText; +#else #ifdef __PSVITA__ - //CD - Changed to 2048 [SCE_IME_MAX_TEXT_LENGTH] uint16_t pchText[2048]; ZeroMemory(pchText, 2048 * sizeof(uint16_t) ); #else @@ -560,18 +570,52 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b InputManager.GetText(pchText); pClass->m_editSeed.setLabel((wchar_t *)pchText); pClass->m_params->seed = (wchar_t *)pchText; +#endif } return 0; } +#ifdef _WINDOWS64 +void UIScene_LaunchMoreOptionsMenu::getDirectEditInputs(vector &inputs) +{ + inputs.push_back(&m_editSeed); +} + +void UIScene_LaunchMoreOptionsMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + if (result == UIControl_TextInput::eDirectEdit_Confirmed) + m_params->seed = input->getEditBuffer(); +} +#endif + void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) { if(m_bIgnoreInput) return; +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif switch((int)controlId) { case eControl_EditSeed: { +#ifdef _WINDOWS64 + if (g_KBMInput.IsKBMActive()) + { + m_editSeed.beginDirectEdit(60); + } + else + { + m_bIgnoreInput = true; + UIKeyboardInitData kbData; + kbData.title = app.GetString(IDS_CREATE_NEW_WORLD_SEED); + kbData.defaultText = m_editSeed.getLabel(); + kbData.maxChars = 60; + kbData.callback = &UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback; + kbData.lpParam = this; + ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData); + } +#else m_bIgnoreInput=true; #ifdef __PS3__ int language = XGetLanguage(); @@ -583,12 +627,12 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); break; default: - // 4J Stu - Use a different keyboard for non-asian languages so we don't have prediction on InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); break; } #else InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); +#endif #endif } break; diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h index 367db10d3..caf9a71f0 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h @@ -140,6 +140,10 @@ protected: public: virtual void tick(); virtual void handleDestroy(); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); +#endif // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); virtual void handleFocusChange(F64 controlId, F64 childId); @@ -160,6 +164,8 @@ private: #ifdef __PSVITA__ virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); - virtual UIControl* GetMainPanel(); #endif //__PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) + virtual UIControl* GetMainPanel(); +#endif }; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp index ce4fcd7f0..ed3c8137e 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 requirements further iggy calls + // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls if(m_bRebuildTouchBoxes) { GetMainPanel()->UpdateControl(); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h index 085cb67f5..53d66d555 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h @@ -16,7 +16,7 @@ private: }; static int m_iDifficultyTitleSettingA[4]; - + UIControl m_controlMainPanel; UIControl_Label m_labelGameName, m_labelSeed, m_labelCreatedMode; UIControl_Button m_buttonGamemode, m_buttonMoreOptions, m_buttonLoadWorld; @@ -43,7 +43,7 @@ private: LevelGenerationOptions *m_levelGen; DLCPack * m_pDLCPack; - + int m_iSaveGameInfoIndex; int m_CurrentDifficulty; bool m_bGameModeCreative; @@ -58,7 +58,7 @@ private: bool m_bRequestQuadrantSignin; bool m_bIsCorrupt; bool m_bThumbnailGetFailed; - __int64 m_seed; + int64_t m_seed; wstring m_levelName; #ifdef __PS3__ @@ -73,7 +73,7 @@ private: bool m_bRebuildTouchBoxes; public: UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLayer); - + virtual void updateTooltips(); virtual void updateComponents(); @@ -107,7 +107,7 @@ private: #ifdef _DURANGO static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); #endif - + static int ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static void StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask); static int LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bIsOwner); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 6779e3a10..856d1c447 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -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, const_cast("save")); // needs to be casted as we dont have the library the function derives from as part of the build + C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,const_cast("save")); } #if TO_BE_IMPLEMENTED @@ -1168,6 +1168,43 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr LaunchSaveTransfer(); } } +#endif +#ifdef _WINDOWS64 + // Right click on a save opens save options (same as RB / ACTION_MENU_RIGHT_SCROLL) + if(pressed && !repeat && ProfileManager.IsFullVersion() && !StorageManager.GetSaveDisabled()) + { + if(DoesSavesListHaveFocus() && (m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC)) + { + m_bIgnoreInput = true; + if(StorageManager.EnoughSpaceForAMinSaveGame()) + { + UINT uiIDA[3]; + uiIDA[0]=IDS_CONFIRM_CANCEL; + uiIDA[1]=IDS_TITLE_RENAMESAVE; + uiIDA[2]=IDS_TOOLTIPS_DELETESAVE; + ui.RequestAlertMessage(IDS_TOOLTIPS_SAVEOPTIONS, IDS_TEXT_SAVEOPTIONS, uiIDA, 3, iPad,&UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned,this); + } + else + { + UINT uiIDA[2]; + uiIDA[0]=IDS_CONFIRM_CANCEL; + uiIDA[1]=IDS_CONFIRM_OK; + ui.RequestAlertMessage(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, iPad,&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,this); + } + ui.PlayUISFX(eSFX_Press); + } + else if(DoesMashUpWorldHaveFocus() && (m_iSaveListIndex != JOIN_LOAD_CREATE_BUTTON_INDEX)) + { + LevelGenerationOptions *levelGen = m_generators.at(m_iSaveListIndex - 1); + if(!levelGen->isTutorial() && levelGen->requiresTexturePack()) + { + m_bIgnoreInput = true; + app.HideMashupPackWorld(m_iPad, levelGen->getRequiredTexturePackId()); + m_iState = e_SavesRepopulateAfterMashupHide; + } + ui.PlayUISFX(eSFX_Press); + } + } #endif break; case ACTION_MENU_Y: @@ -2134,7 +2171,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save // Make our next save default to the name of the level StorageManager.SetSaveTitle(saveFile->getName().c_str()); - __int64 fileSize = saveFile->length(); + int64_t fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); @@ -2198,7 +2235,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() mbstowcs(wSaveName, app.getRemoteStorage()->getSaveNameUTF8(), strlen(app.getRemoteStorage()->getSaveNameUTF8())+1); // plus null StorageManager.SetSaveTitle(wSaveName); - __int64 fileSize = cloudFile.length(); + int64_t fileSize = cloudFile.length(); FileInputStream fis(cloudFile); byteArray ba(fileSize); fis.read(ba); @@ -2394,7 +2431,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS kbData.maxChars = 25; kbData.callback = &UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback; kbData.lpParam = pClass; - kbData.pcMode = !Win64_IsControllerConnected(); + kbData.pcMode = g_KBMInput.IsKBMActive(); ui.NavigateToScene(pClass->m_iPad, eUIScene_Keyboard, &kbData); } #elif defined _DURANGO @@ -3542,7 +3579,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) bool bHostOptionsRead = false; unsigned int uiHostOptions = 0; DWORD dwTexturePack; - __int64 seedVal; + int64_t seedVal; char szSeed[50]; ZeroMemory(szSeed,50); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 0a76a5e5d..423c8f4b2 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -2,6 +2,7 @@ #include "UI.h" #include "UIScene_SettingsGraphicsMenu.h" #include "..\..\Minecraft.h" +#include "..\..\Options.h" #include "..\..\GameRenderer.h" namespace @@ -31,6 +32,24 @@ namespace } } +int UIScene_SettingsGraphicsMenu::LevelToDistance(int level) +{ + static const int table[6] = {2,4,8,16,32,64}; + if(level < 0) level = 0; + if(level > 5) level = 5; + return table[level]; +} + +int UIScene_SettingsGraphicsMenu::DistanceToLevel(int dist) +{ + static const int table[6] = {2,4,8,16,32,64}; + for(int i = 0; i < 6; i++){ + if(table[i] == dist) + return i; + } + return 3; +} + UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { // Setup all the Iggy references we need for this scene @@ -45,13 +64,17 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD WCHAR TempString[256]; + + swprintf((WCHAR*)TempString, 256, L"Render Distance: %d",app.GetGameSettings(m_iPad,eGameSetting_RenderDistance)); + m_sliderRenderDistance.init(TempString,eControl_RenderDistance,0,5,DistanceToLevel(app.GetGameSettings(m_iPad,eGameSetting_RenderDistance))); swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - int initialFov = clampFov((int)(pMinecraft->gameRenderer->GetFovVal() + 0.5f)); - swprintf((WCHAR*)TempString, 256, L"FOV: %d", initialFov); - m_sliderFOV.init(TempString, eControl_FOV, 0, FOV_SLIDER_MAX, fovToSliderValue((float)initialFov)); + int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV); + int initialFovDeg = sliderValueToFov(initialFovSlider); + swprintf((WCHAR*)TempString, 256, L"FOV: %d", initialFovDeg); + m_sliderFOV.init(TempString, eControl_FOV, 0, FOV_SLIDER_MAX, initialFovSlider); swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); m_sliderInterfaceOpacity.init(TempString,eControl_InterfaceOpacity,0,100,app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); @@ -167,6 +190,21 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal int value = (int)currentValue; switch((int)sliderId) { + case eControl_RenderDistance: + { + m_sliderRenderDistance.handleSliderMove(value); + + int dist = LevelToDistance(value); + + app.SetGameSettings(m_iPad,eGameSetting_RenderDistance,dist); + + Minecraft* mc = Minecraft::GetInstance(); + mc->options->viewDistance = 3 - value; + swprintf((WCHAR*)TempString,256,L"Render Distance: %d",dist); + m_sliderRenderDistance.setLabel(TempString); + } + break; + case eControl_Gamma: m_sliderGamma.handleSliderMove(value); @@ -182,6 +220,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal Minecraft* pMinecraft = Minecraft::GetInstance(); int fovValue = sliderValueToFov(value); pMinecraft->gameRenderer->SetFovVal((float)fovValue); + app.SetGameSettings(m_iPad, eGameSetting_FOV, value); WCHAR TempString[256]; swprintf((WCHAR*)TempString, 256, L"FOV: %d", fovValue); m_sliderFOV.setLabel(TempString); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.h b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.h index c6e1e394f..99022c83f 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.h @@ -1,6 +1,8 @@ #pragma once #include "UIScene.h" +#include "Common/UI/UIControl_CheckBox.h" +#include "Common/UI/UIControl_Slider.h" class UIScene_SettingsGraphicsMenu : public UIScene { @@ -10,17 +12,19 @@ private: eControl_Clouds, eControl_BedrockFog, eControl_CustomSkinAnim, + eControl_RenderDistance, eControl_Gamma, eControl_FOV, eControl_InterfaceOpacity }; UIControl_CheckBox m_checkboxClouds, m_checkboxBedrockFog, m_checkboxCustomSkinAnim; // Checkboxes - UIControl_Slider m_sliderGamma, m_sliderFOV, m_sliderInterfaceOpacity; // Sliders + UIControl_Slider m_sliderRenderDistance, m_sliderGamma, m_sliderFOV, m_sliderInterfaceOpacity; // Sliders UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_MAP_ELEMENT( m_checkboxClouds, "Clouds") UI_MAP_ELEMENT( m_checkboxBedrockFog, "BedrockFog") UI_MAP_ELEMENT( m_checkboxCustomSkinAnim, "CustomSkinAnim") + UI_MAP_ELEMENT( m_sliderRenderDistance, "RenderDistance") UI_MAP_ELEMENT( m_sliderGamma, "Gamma") UI_MAP_ELEMENT(m_sliderFOV, "FOV") UI_MAP_ELEMENT( m_sliderInterfaceOpacity, "InterfaceOpacity") @@ -45,4 +49,8 @@ public: virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); virtual void handleSliderMove(F64 sliderId, F64 currentValue); + + static int LevelToDistance(int dist); + + static int DistanceToLevel(int dist); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp index c29bac2d3..9f049c8c9 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp @@ -18,6 +18,12 @@ UIScene_SignEntryMenu::UIScene_SignEntryMenu(int iPad, void *_initData, UILayer m_bConfirmed = false; m_bIgnoreInput = false; + m_iSignCursorFrame = 0; +#ifdef _WINDOWS64 + m_iActiveDirectEditLine = -1; + m_bNeedsInitialEdit = true; + m_bSkipTickNav = false; +#endif m_buttonConfirm.init(app.GetString(IDS_DONE), eControl_Confirm); m_labelMessage.init(app.GetString(IDS_EDIT_SIGN_MESSAGE)); @@ -53,6 +59,7 @@ UIScene_SignEntryMenu::UIScene_SignEntryMenu(int iPad, void *_initData, UILayer UIScene_SignEntryMenu::~UIScene_SignEntryMenu() { + m_sign->SetSelectedLine(-1); m_parentLayer->removeComponent(eUIComponent_MenuBackground); } @@ -77,6 +84,79 @@ void UIScene_SignEntryMenu::tick() { UIScene::tick(); +#ifdef _WINDOWS64 + // On first tick, auto-start editing line 1 if KBM is active (Java-style flow) + if (m_bNeedsInitialEdit) + { + m_bNeedsInitialEdit = false; + if (g_KBMInput.IsKBMActive()) + { + SetFocusToElement(eControl_Line1); + m_iActiveDirectEditLine = 0; + m_textInputLines[0].beginDirectEdit(15); + } + } + + // UP/DOWN navigation — must happen after tickDirectEdit (so typed chars are consumed) + // and before sign cursor update (so the cursor is correct for this frame's render) + // m_bSkipTickNav prevents double-processing when handleInput auto-started editing this frame + if (m_iActiveDirectEditLine >= 0 && !m_bSkipTickNav) + { + int navDir = 0; + if (g_KBMInput.IsKeyPressed(VK_DOWN)) navDir = 1; + else if (g_KBMInput.IsKeyPressed(VK_UP)) navDir = -1; + + if (navDir != 0) + { + int newLine = m_iActiveDirectEditLine + navDir; + if (newLine >= eControl_Line1 && newLine <= eControl_Line4) + { + m_textInputLines[m_iActiveDirectEditLine].confirmDirectEdit(); + SetFocusToElement(newLine); + m_iActiveDirectEditLine = newLine; + m_textInputLines[newLine].beginDirectEdit(15); + } + else if (navDir > 0) + { + m_textInputLines[m_iActiveDirectEditLine].confirmDirectEdit(); + SetFocusToElement(eControl_Confirm); + m_iActiveDirectEditLine = -1; + } + } + } + m_bSkipTickNav = false; + + if (m_iActiveDirectEditLine >= 0 && !m_textInputLines[m_iActiveDirectEditLine].isDirectEditing()) + m_iActiveDirectEditLine = -1; +#endif + + // Blinking > text < cursor on the 3D sign + m_iSignCursorFrame++; + if (m_iSignCursorFrame / 6 % 2 == 0) + { +#ifdef _WINDOWS64 + if (m_iActiveDirectEditLine >= 0) + m_sign->SetSelectedLine(m_iActiveDirectEditLine); + else +#endif + { + int focusedLine = -1; + for (int i = eControl_Line1; i <= eControl_Line4; i++) + { + if (controlHasFocus(i)) + { + focusedLine = i; + break; + } + } + m_sign->SetSelectedLine(focusedLine); + } + } + else + { + m_sign->SetSelectedLine(-1); + } + if(m_bConfirmed) { m_bConfirmed = false; @@ -107,6 +187,9 @@ void UIScene_SignEntryMenu::tick() void UIScene_SignEntryMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { if(m_bConfirmed || m_bIgnoreInput) return; +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) { handled = true; return; } +#endif ui.AnimateKeyPress(iPad, key, repeat, pressed, released); @@ -132,31 +215,124 @@ void UIScene_SignEntryMenu::handleInput(int iPad, int key, bool repeat, bool pre #ifdef __ORBIS__ case ACTION_MENU_TOUCHPAD_PRESS: #endif + sendInputToMovie(key, repeat, pressed, released); + handled = true; + break; case ACTION_MENU_UP: case ACTION_MENU_DOWN: sendInputToMovie(key, repeat, pressed, released); +#ifdef _WINDOWS64 + // Auto-start editing if focus moved to a line (e.g. UP from Confirm) + if (g_KBMInput.IsKBMActive()) + { + for (int i = eControl_Line1; i <= eControl_Line4; i++) + { + if (controlHasFocus(i)) + { + m_iActiveDirectEditLine = i; + m_textInputLines[i].beginDirectEdit(15); + m_bSkipTickNav = true; + break; + } + } + } +#endif handled = true; break; } } +#ifdef _WINDOWS64 +void UIScene_SignEntryMenu::getDirectEditInputs(vector &inputs) +{ + for (int i = 0; i < 4; i++) + inputs.push_back(&m_textInputLines[i]); +} + +void UIScene_SignEntryMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result) +{ + int line = -1; + for (int i = 0; i < 4; i++) + { + if (input == &m_textInputLines[i]) { line = i; break; } + } + if (line != m_iActiveDirectEditLine) return; + + if (result == UIControl_TextInput::eDirectEdit_Confirmed) + { + int newLine = line + 1; + if (newLine <= eControl_Line4) + { + SetFocusToElement(newLine); + m_iActiveDirectEditLine = newLine; + m_textInputLines[newLine].beginDirectEdit(15); + } + else + { + m_iActiveDirectEditLine = -1; + m_bConfirmed = true; + } + } + else if (result == UIControl_TextInput::eDirectEdit_Cancelled) + { + m_iActiveDirectEditLine = -1; + wstring temp = L""; + for (int j = 0; j < 4; j++) + m_sign->SetMessage(j, temp); + navigateBack(); + ui.PlayUISFX(eSFX_Back); + } +} + +bool UIScene_SignEntryMenu::handleMouseClick(F32 x, F32 y) +{ + if (m_iActiveDirectEditLine >= 0) + { + // During direct edit, only the Done button is clickable. + // Hit-test it manually — all other clicks are consumed but ignored. + m_buttonConfirm.UpdateControl(); + S32 cx = m_buttonConfirm.getXPos(); + S32 cy = m_buttonConfirm.getYPos(); + S32 cw = m_buttonConfirm.getWidth(); + S32 ch = m_buttonConfirm.getHeight(); + if (cw > 0 && ch > 0 && x >= cx && x <= cx + cw && y >= cy && y <= cy + ch) + { + m_textInputLines[m_iActiveDirectEditLine].confirmDirectEdit(); + m_iActiveDirectEditLine = -1; + m_bConfirmed = true; + } + return true; + } + return UIScene::handleMouseClick(x, y); +} +#endif + int UIScene_SignEntryMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) { - // 4J HEG - No reason to set value if keyboard was cancelled UIScene_SignEntryMenu *pClass=(UIScene_SignEntryMenu *)lpParam; pClass->m_bIgnoreInput = false; if (bRes) { +#ifdef _WINDOWS64 + uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(uint16_t)); + Win64_GetKeyboardText(pchText, 128); + pClass->m_textInputLines[pClass->m_iEditingLine].setLabel((wchar_t *)pchText); +#else uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); InputManager.GetText(pchText); pClass->m_textInputLines[pClass->m_iEditingLine].setLabel((wchar_t *)pchText); +#endif } return 0; } void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) { +#ifdef _WINDOWS64 + if (isDirectEditBlocking()) return; +#endif switch((int)controlId) { case eControl_Confirm: @@ -170,6 +346,28 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) case eControl_Line4: { m_iEditingLine = (int)controlId; +#ifdef _WINDOWS64 + if (g_KBMInput.IsKBMActive()) + { + // Only start editing from keyboard (Enter on focused line), not mouse clicks + if (!g_KBMInput.IsMouseButtonPressed(KeyboardMouseInput::MOUSE_LEFT)) + { + m_iActiveDirectEditLine = m_iEditingLine; + m_textInputLines[m_iEditingLine].beginDirectEdit(15); + } + } + else + { + m_bIgnoreInput = true; + UIKeyboardInitData kbData; + kbData.title = app.GetString(IDS_SIGN_TITLE); + kbData.defaultText = m_textInputLines[m_iEditingLine].getLabel(); + kbData.maxChars = 15; + kbData.callback = &UIScene_SignEntryMenu::KeyboardCompleteCallback; + kbData.lpParam = this; + ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen); + } +#else m_bIgnoreInput = true; #ifdef _XBOX_ONE // 4J-PB - Xbox One uses the Windows virtual keyboard, and doesn't have the Xbox 360 Latin keyboard type, so we can't restrict the input set to alphanumeric. The closest we get is the emailSmtpAddress type. @@ -187,6 +385,7 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) } #else InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); +#endif #endif } break; diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h index 28b37d531..4e1c2a5ba 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h @@ -21,6 +21,12 @@ private: int m_iEditingLine; bool m_bConfirmed; bool m_bIgnoreInput; + int m_iSignCursorFrame; +#ifdef _WINDOWS64 + int m_iActiveDirectEditLine; + bool m_bNeedsInitialEdit; + bool m_bSkipTickNav; +#endif UIControl_Button m_buttonConfirm; UIControl_Label m_labelMessage; @@ -50,6 +56,11 @@ protected: public: // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); +#ifdef _WINDOWS64 + virtual void getDirectEditInputs(vector &inputs); + virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result); + virtual bool handleMouseClick(F32 x, F32 y); +#endif protected: void handlePress(F64 controlId, F64 childId); diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp index 1b2c2429c..9e0059f3b 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 -const 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 42e5bec02..60579ac60 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 const 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 aa912e479..b949aafab 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp @@ -55,7 +55,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle CreateWorldMenuInitData *params = (CreateWorldMenuInitData *)pInitData->pvInitData; m_MoreOptionsParams.bGenerateOptions=TRUE; - m_MoreOptionsParams.bStructures=TRUE; + m_MoreOptionsParams.bStructures=TRUE; m_MoreOptionsParams.bFlatWorld=FALSE; m_MoreOptionsParams.bBonusChest=FALSE; m_MoreOptionsParams.bPVP = TRUE; @@ -96,7 +96,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle { // The profile settings say Online, but either the player is offline, or they are not allowed to play online m_MoreOptionsParams.bOnlineSettingChangedBySystem=true; - } + } } m_ButtonGameMode.SetText(app.GetString(IDS_GAMEMODE_SURVIVAL)); @@ -104,7 +104,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty); m_SliderDifficulty.SetValue(m_CurrentDifficulty); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); m_SliderDifficulty.SetText(TempString); ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); @@ -135,7 +135,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_NewWorld.SetEnable(true); m_EditWorldName.SetTextLimit(XCONTENT_MAX_DISPLAYNAME_LENGTH); - + wstring wWorldName = m_EditWorldName.GetText(); // set the caret to the end of the default text @@ -148,7 +148,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle XuiSetTimer(m_hObj,GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME); XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME); - + TelemetryManager->RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0); // 4J-PB - Load up any texture pack data we have locally in the XZP @@ -176,7 +176,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; HRESULT hr; for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -189,7 +189,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle if(dwImageBytes > 0 && pbImageData) { - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp; if(pDLCTexPack) { @@ -297,7 +297,7 @@ HRESULT CScene_MultiGameCreate::OnDestroy() app.RemoveMemoryTPDFile(app.TMSFileA[i].iConfig); } } - + app.FreeLocalTMSFiles(eTMSFileType_TexturePack); return S_OK; @@ -338,7 +338,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // DLC might have been corrupt if(ullOfferID_Full!=0LL) - { + { TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); UINT uiIDA[3]; @@ -374,7 +374,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // if the profile data has been changed, then force a profile write (we save the online/invite/friends of friends settings) // It seems we're allowed to break the 5 minute rule if it's the result of a user action // check the checkboxes - + // Only save the online setting if the user changed it - we may change it because we're offline, but don't want that saved if(!m_MoreOptionsParams.bOnlineSettingChangedBySystem) { @@ -389,15 +389,15 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr if(m_MoreOptionsParams.dwTexturePack!=0) { // texture pack hasn't been set yet, so check what it will be - TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); - + TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); + if(pTexturePack==NULL) { // corrupt DLC so set it to the default textures m_MoreOptionsParams.dwTexturePack=0; } else - { + { m_pDLCPack=pTexturePack->getDLCPack(); // do we have a license? if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) @@ -439,11 +439,11 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr return S_OK; } } - } + } } if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE) - { + { UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -478,7 +478,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && noUGC ) { m_bIgnoreInput = false; @@ -495,7 +495,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr } } else if(hObjPressed==m_MoreOptions) - { + { app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_LaunchMoreOptionsMenu,&m_MoreOptionsParams); } else if(hObjPressed == m_ButtonGameMode) @@ -527,7 +527,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS if(result==C4JStorage::EMessage_ResultAccept) { if(ProfileManager.IsSignedIn(iPad)) - { + { ULONGLONG ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId()); @@ -542,7 +542,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); - // the license change coming in when the offer has been installed will cause this scene to refresh + // the license change coming in when the offer has been installed will cause this scene to refresh } } else @@ -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 requirements 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 requires this to search for a suitable seed if we haven't set a seed. IntCache::CreateNewThreadStorage(); CreateGame(pScene, 0); IntCache::ReleaseThreadStorage(); @@ -629,12 +629,12 @@ HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINot // Enable the done button when we have all of the necessary information wstring wWorldName = m_EditWorldName.GetText(); BOOL bHasWorldName = ( wWorldName.length()!=0); - m_NewWorld.SetEnable(bHasWorldName); + m_NewWorld.SetEnable(bHasWorldName); } else if(hObjSource==m_SliderDifficulty.GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pValueChangedData->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); m_SliderDifficulty.SetText(TempString); } @@ -656,11 +656,11 @@ HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pCo HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) { - // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly + // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) { - + case GAME_CREATE_ONLINE_TIMER_ID: { bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); @@ -693,7 +693,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled } } break; - + case CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID: { // also check for any new texture packs info being available @@ -718,7 +718,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled PBYTE pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; ListInfo.iData = m_iConfigA[i]; HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); @@ -734,7 +734,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled bool bAllDone=true; for(int i=0;im_MoreOptionsParams.bOnlineGame; @@ -780,7 +780,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && noUGC ) { pClass->m_bIgnoreInput = false; @@ -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 requirements 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 requires this to search for a suitable seed if we haven't set a seed. IntCache::CreateNewThreadStorage(); CreateGame(pClass, 0); IntCache::ReleaseThreadStorage(); @@ -816,7 +816,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue if(ProfileManager.IsSignedIn(iPad)) { DWORD dwLocalUsersMask = 0; - + bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -835,7 +835,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && (noPrivileges || noUGC) ) { if( noUGC ) @@ -863,7 +863,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue } } else - { + { pClass->m_bIgnoreInput = false; pClass->SetShow( TRUE ); } @@ -884,7 +884,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // create the world and launch wstring wWorldName = pClass->m_EditWorldName.GetText(); - + StorageManager.ResetSaveData(); // Make our next save default to the name of the level StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str()); @@ -904,11 +904,11 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE); - __int64 seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -923,7 +923,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString<__int64>(wSeed); + value = _fromString(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -948,7 +948,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw param->seed = seedValue; param->saveData = NULL; param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack; - + Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->skins->selectTexturePackById(pClass->m_MoreOptionsParams.dwTexturePack); //pMinecraft->skins->updateUI(); @@ -956,7 +956,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw app.SetGameHostOption(eGameHostOption_Difficulty,Minecraft::GetInstance()->options->difficulty); app.SetGameHostOption(eGameHostOption_FriendsOfFriends,pClass->m_MoreOptionsParams.bAllowFriendsOfFriends); app.SetGameHostOption(eGameHostOption_Gamertags,app.GetGameSettings(pClass->m_iPad,eGameSetting_GamertagsVisible)?1:0); - + app.SetGameHostOption(eGameHostOption_BedrockFog,app.GetGameSettings(pClass->m_iPad,eGameSetting_BedrockFog)?1:0); // CXuiList listObject; @@ -999,7 +999,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransi if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) - { + { m_SliderDifficulty.SetValueDisplay(FALSE); } @@ -1015,7 +1015,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransiti { } else if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) - { + { if(m_bSetup && m_texturePackDescDisplayed) { XUITimeline *timeline; @@ -1054,7 +1054,7 @@ HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotif if(hObjSource == m_pTexturePacksList->m_hObj) { UpdateTexturePackDescription(pNotifySelChangedData->iItem); - + // 4J-JEV: Removed expand description check, taken care of elsewhere. } @@ -1205,9 +1205,9 @@ void CScene_MultiGameCreate::UpdateCurrentTexturePack() StorageManager.RequestMessageBox(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE, IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CScene_MultiGameCreate::TexturePackDialogReturned,this,app.GetStringTable()); } - // do set the texture pack id, and on the user pressing create world, check they have it + // do set the texture pack id, and on the user pressing create world, check they have it m_MoreOptionsParams.dwTexturePack = ListItem.iData; - return ; + return ; } else { @@ -1221,7 +1221,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS pClass->m_currentTexturePackIndex = pClass->m_pTexturePacksList->GetCurSel(); // Exit with or without saving // Decline means install full version of the texture pack in this dialog - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -1248,7 +1248,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS ullIndexA[0]=pDLCInfo->ullOfferID_Trial; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); } - } + } } pClass->m_bIgnoreInput=false; return 0; @@ -1274,12 +1274,12 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled() } HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() -{ +{ // refill the texture pack list m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; HRESULT hr; for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -1292,7 +1292,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() if(dwImageBytes > 0 && pbImageData) { - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp; diff --git a/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp index c5e2fe9af..5894519d8 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -1945,7 +1945,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) // Make our next save default to the name of the level StorageManager.SetSaveTitle(saveFile->getName().c_str()); - __int64 fileSize = saveFile->length(); + int64_t fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp index 03782c79c..1a679f586 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp @@ -36,7 +36,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) MapChildControls(); // Display the tooltips - HRESULT hr = S_OK; + HRESULT hr = S_OK; CXuiElement xuiElement = m_hObj; HXUIOBJ hTemp; @@ -169,7 +169,7 @@ void CXuiSceneBase::_TickAllBaseScenes() // make sure there's not a mount going on before using the textures if(bCheckTexturePack && app.DLCInstallProcessCompleted() ) - { + { TexturePack *tPack = pMinecraft->skins->getSelected(); if(tPack->getId()!=app.GetRequiredTexturePackID()) @@ -186,7 +186,7 @@ void CXuiSceneBase::_TickAllBaseScenes() pMinecraft->skins->selectTexturePackById(app.GetRequiredTexturePackID()); - // probably had background downloads enabled, so turn them off + // probably had background downloads enabled, so turn them off XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO); } else @@ -223,7 +223,7 @@ void CXuiSceneBase::_TickAllBaseScenes() { if(pMinecraft->localplayers[i] != NULL && pMinecraft->localplayers[i]->dimension == 1 && !ui.GetMenuDisplayed(i) && app.GetGameSettings(i,eGameSetting_DisplayHUD)) { - int iGuiScale; + int iGuiScale; if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -234,7 +234,7 @@ void CXuiSceneBase::_TickAllBaseScenes() iGuiScale=app.GetGameSettings(i,eGameSetting_UISizeSplitscreen); } m_BossHealthGroup[i].SetShow(TRUE); - m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) ); + m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) ); if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -364,7 +364,7 @@ void CXuiSceneBase::_TickAllBaseScenes() break; } } - } + } m_pBossHealthProgress[i].SetRange(0, boss->getMaxHealth() ); m_pBossHealthProgress[i].SetValue( boss->getSynchedHealth() ); @@ -468,15 +468,15 @@ void CXuiSceneBase::_TickAllBaseScenes() XUIMessage xuiMsg; CustomMessage_TickScene( &xuiMsg ); XuiSendMessage( app.GetCurrentHUDScene(i), &xuiMsg ); - + bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(i) && !(app.GetXuiAction(i)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(i,eGameSetting_DisplayHUD)!=0; if(bDisplayGui && pMinecraft->localplayers[i] != NULL) { - XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE); + XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE); } else { - XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); + XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); } } } @@ -495,18 +495,18 @@ HRESULT CXuiSceneBase::_SetEnableTooltips( unsigned int iPad, BOOL bVal ) HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiTooltip, int iTextID ) { ASSERT( uiTooltip < BUTTONS_TOOLTIP_MAX ); - + XUIRect xuiRect, xuiRectSmall; HRESULT hr=S_OK; LPCWSTR pString=NULL; float fWidth,fHeight; - + // Want to be able to show just a button (for RB LB) if(iTextID>=0) { pString=app.GetString(iTextID); } - + if(hTooltipText[iPad][uiTooltip]==NULL) { HXUIOBJ hObj=NULL; @@ -514,7 +514,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti hr=XuiElementGetChildById(hObj,L"text_ButtonText",&hTooltipText[iPad][uiTooltip]); hr=XuiElementGetPosition(hTooltipText[iPad][uiTooltip],&m_vPosTextInTooltip[uiTooltip]); } - + if(hTooltipTextSmall[iPad][uiTooltip]==NULL) { HXUIOBJ hObj=NULL; @@ -525,8 +525,8 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti if(iTextID>=0) { - hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect); - + hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect); + // Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic) XuiElementGetBounds(m_Buttons[iPad][uiTooltip].m_hObj,&fWidth, &fHeight); XuiElementSetBounds(m_Buttons[iPad][uiTooltip].m_hObj,xuiRect.right+1+m_vPosTextInTooltip[uiTooltip].x,fHeight); @@ -537,7 +537,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti hr=XuiTextPresenterMeasureText(hTooltipTextSmall[iPad][uiTooltip], pString, &xuiRectSmall); - + // Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic) XuiElementGetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,&fWidth, &fHeight); XuiElementSetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,xuiRectSmall.right+1+m_vPosTextInTooltipSmall[uiTooltip].x,fHeight); @@ -749,7 +749,7 @@ HRESULT CXuiSceneBase::_SetTooltipsEnabled( unsigned int iPad, bool bA, bool bB, m_Buttons[iPad][BUTTON_TOOLTIP_LB].SetEnable( bLB ); m_Buttons[iPad][BUTTON_TOOLTIP_RB].SetEnable( bRB ); m_Buttons[iPad][BUTTON_TOOLTIP_LS].SetEnable( bLS ); - + m_ButtonsSmall[iPad][BUTTON_TOOLTIP_A].SetEnable( bA ); m_ButtonsSmall[iPad][BUTTON_TOOLTIP_B].SetEnable( bB ); m_ButtonsSmall[iPad][BUTTON_TOOLTIP_X].SetEnable( bX ); @@ -860,7 +860,7 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow ) if(bShow && pMinecraft->level!=NULL) { - __int64 i64TimeOfDay =0; + int64_t i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { @@ -945,11 +945,11 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad) int nStart, nEnd; // XuiElementFindNamedFrame( m_hObj, L"StartFlash", &nStart ); // XuiElementFindNamedFrame( m_hObj, L"EndFlash", &nEnd ); -// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE ); +// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE ); XuiElementFindNamedFrame( hObj, L"StartFlash", &nStart ); XuiElementFindNamedFrame( hObj, L"EndFlash", &nEnd ); - XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE ); - + XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE ); + return S_OK; } @@ -960,7 +960,7 @@ HRESULT CXuiSceneBase::_HidePressStart() HRESULT CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { - WCHAR wcAutosaveCountdown[100]; + WCHAR wcAutosaveCountdown[100]; swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); m_TrialTimer.SetText(wcAutosaveCountdown); return S_OK; @@ -974,7 +974,7 @@ HRESULT CXuiSceneBase::_ShowAutosaveCountdownTimer(BOOL bVal) HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) { - WCHAR wcTime[20]; + WCHAR wcTime[20]; DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); @@ -982,7 +982,7 @@ HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) { dwTimeTicks=m_dwTrialTimerLimitSecs; } - + dwTimeTicks=m_dwTrialTimerLimitSecs-dwTimeTicks; #ifndef _CONTENT_PACKAGE @@ -1038,7 +1038,7 @@ bool CXuiSceneBase::_PressStartPlaying(unsigned int iPad) HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ) { // turn off the empty quadrant logo - if(m_hEmptyQuadrantLogo!=NULL) + if(m_hEmptyQuadrantLogo!=NULL) { XuiElementSetShow(m_hEmptyQuadrantLogo,FALSE); } @@ -1086,12 +1086,12 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen XuiElementSetShow( m_TooltipGroupSmall[iPad].m_hObj, TRUE); } - if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) - { + if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) + { //640x480 ->1280x720 scale.x = 2.0f; scale.y = 1.5f; scale.z = 1.0f; XuiElementSetScale(m_hObj, &scale); - + return S_OK; } @@ -1127,7 +1127,7 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen // No position adjustment case e_BaseScene_Fullscreen: tooltipsPos.x=SAFEZONE_HALF_WIDTH; - tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight; + tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight; crouchIconPos.x=SAFEZONE_HALF_WIDTH; crouchIconPos.y=SAFEZONE_HALF_HEIGHT; fBackWidth=XUI_BASE_SCENE_WIDTH; @@ -1303,7 +1303,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // Only adjust if fullscreen for now, leaving code to move others if required, but it's too far up the screen when on the bottom quadrants - if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) && + if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) && (RenderManager.IsHiDef() || RenderManager.IsWidescreen()) ) { D3DXVECTOR3 selectedItemPos; @@ -1328,17 +1328,17 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // The move applies to the whole scene, so we'll need to move tooltips back in some cases - selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight; + selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight; selectedItemPos.x = XUI_BASE_SCENE_WIDTH_HALF - (fSelectedItemWidth/2.0f); // Adjust selectedItemPos based on what gui is displayed - // 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival + // 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival float fYOffset=0.0f; unsigned char ucGuiScale=app.GetGameSettings(iPad,eGameSetting_UISize) + 2; - + if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer()) { // SURVIVAL MODE - Move up further because of hearts, shield and xp @@ -1353,7 +1353,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = -94.0f; break; - } + } } else { @@ -1368,7 +1368,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = -58.0f; break; - } + } } @@ -1425,14 +1425,14 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // 4J-PB - If it's in split screen vertical, adjust the position // Adjust selectedItemPos based on what gui is displayed if((m_playerBaseScenePosition[iPad]==e_BaseScene_Left) || (m_playerBaseScenePosition[iPad]==e_BaseScene_Right)) - { + { float scale=0.5f; selectedItemPos.y -= (scale * 88.0f); if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer()) { selectedItemPos.y -= (scale * 80.0f); } - + // 4J-PB - selected the gui scale based on the slider settings unsigned char ucGuiScale; float fYOffset=0.0f; @@ -1455,7 +1455,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = 85.0f; break; - } + } selectedItemPos.y+=fYOffset; } @@ -1606,7 +1606,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay ) { // The host decides whether these are on or off if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0) - { + { if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localplayers[iPad]!=NULL) { wstring wsGamertag = convStringToWstring( ProfileManager.GetGamertag(iPad)); @@ -1621,7 +1621,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay ) } // The host decides whether these are on or off if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0) - { + { XuiElementSetShow(m_hGamerTagA[iPad],bDisplay); // set the opacity of the gamertag @@ -1712,11 +1712,11 @@ void CXuiSceneBase::_HideAllGameUIElements() m_uiSelectedItemOpacityCountDown[i] = 0; m_selectedItemA[i].SetShow(FALSE); m_selectedItemSmallA[i].SetShow(FALSE); - + m_BossHealthGroup[i].SetShow(FALSE); m_bossHealthVisible[i] = FALSE; - XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); + XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); _DisplayGamertag(i,FALSE); } @@ -1845,12 +1845,12 @@ void CXuiSceneBase::ReLayout( unsigned int iPad ) if( i>0 && lastVisible!=-1 ) { float width, height; - XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height); + XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height); // 4J Stu - This is for horizontal layout, will need changed if we do vertical layout lastPos.x += width + m_iTooltipSpacingGap; - XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height); + XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height); // 4J Stu - This is for horizontal layout, will need changed if we do vertical layout lastPosSmall.x += width + m_iTooltipSpacingGapSmall; } @@ -1948,15 +1948,15 @@ HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, i } else { - // does the tooltip need to change? + // does the tooltip need to change? if(CXuiSceneBase::Instance->m_iCurrentTooltipTextID[iPad][i]!=iTooptipsA[i] || forceUpdate) { CXuiSceneBase::Instance->SetTooltipText(iPad, i, iTooptipsA[i] ); - } + } CXuiSceneBase::Instance->_ShowTooltip(iPad, i, true ); } } - + } return S_OK; } @@ -2067,14 +2067,14 @@ HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScen } HRESULT CXuiSceneBase::UpdatePlayerBasePositions() -{ +{ EBaseScenePosition padPositions[XUSER_MAX_COUNT]; for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { padPositions[idx] = e_BaseScene_NotSet; } - + Minecraft *pMinecraft = Minecraft::GetInstance(); // If the game is not started (or is being held paused for a bit) then display all scenes fullscreen @@ -2134,7 +2134,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions() padPositions[idx] = e_BaseScene_Right; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT: - padPositions[idx] = e_BaseScene_Top_Left; + padPositions[idx] = e_BaseScene_Top_Left; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT: padPositions[idx] = e_BaseScene_Top_Right; @@ -2168,7 +2168,7 @@ void CXuiSceneBase::UpdateSelectedItemPos(int iPad) CXuiSceneBase::Instance->_UpdateSelectedItemPos(iPad); } -HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad) +HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad) { return CXuiSceneBase::Instance->_GetPlayerBaseScene(iPad); } diff --git a/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp b/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp index ee7066108..daf13eb87 100644 --- a/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp +++ b/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp @@ -7,7 +7,7 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= +const WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= { L"USE LOCALISED VERSION", // Server selected L"Steve", diff --git a/Minecraft.Client/Common/XUI/XUI_SkinSelect.h b/Minecraft.Client/Common/XUI/XUI_SkinSelect.h index dbbb388ce..cea08314c 100644 --- a/Minecraft.Client/Common/XUI/XUI_SkinSelect.h +++ b/Minecraft.Client/Common/XUI/XUI_SkinSelect.h @@ -12,7 +12,7 @@ class CXuiCtrlMinecraftSkinPreview; class CScene_SkinSelect : public CXuiSceneImpl { 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_TrialExitUpsell.cpp b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp index 511210999..3b2e2cbc5 100644 --- a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp +++ b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp @@ -2,7 +2,7 @@ #include "XUI_TrialExitUpsell.h" // wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT] -WCHAR *CScene_TrialExitUpsell::wchImages[]= +const WCHAR *CScene_TrialExitUpsell::wchImages[]= { L"Graphics/UpsellScreenshots/Screenshot1.png", L"Graphics/UpsellScreenshots/Screenshot2.png", diff --git a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h index 748b36a2b..94800dc0e 100644 --- a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h +++ b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h @@ -9,7 +9,7 @@ class CScene_TrialExitUpsell : public CXuiSceneImpl { private: - static WCHAR *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; + static const WCHAR *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; protected: CXuiImageElement m_image1, m_image2; diff --git a/Minecraft.Client/Common/zlib/adler32.c b/Minecraft.Client/Common/zlib/adler32.c index 1687d0d79..33d70c606 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 uint8_t at a time, keep it fast */ + /* in case user likes doing a byte 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 -- requirements just one modulo operation */ + /* do length NMAX blocks -- requires 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 d7ddd3e5f..6f3f2593f 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 uint8_t + parameter has the same meaning as in deflateInit. sourceLen is the byte 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 7deaa7276..979a7190a 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 uint8_t-wise 32-bit CRC calculation on the polynomial: + Generate tables for a byte-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 uint8_t as the + one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the - uint8_t 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + byte 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 uint8_t at a time for all + all the information needed to generate CRCs on data a byte 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 uint8_t reversal of those as well as the first table */ + and then the byte 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-uint8_t values, made by make_crc_table(). + * Tables of CRC-32s of all single-byte 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 uint8_t, eight zero bits, in even) */ + zero byte, 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 dcb1c77c7..696957705 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 requirements max_lazy >= MIN_MATCH and max_chain >= 4 +/* Note: the deflate() code requires 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 uint8_t + * Update a hash value with the given input byte * 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-uint8_t window bug fixed */ + if (windowBits == 8) windowBits = 9; /* until 256-byte 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 uint8_t has been read, or avail_in == 0; reads are + * At least one byte 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 uint8_t at time) + * strstart == 0 && lookahead == 1 (input done a byte 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 uint8_t header: + * to pending_buf_size, and each stored block has a 5 byte 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 uint8_t */ + /* No match, output a literal byte */ 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; /* uint8_t at distance one to match */ + uInt prev; /* byte 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 uint8_t repeats */ + /* See how many times the previous byte 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 uint8_t */ + /* No match, output a literal byte */ 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 uint8_t */ + /* Output a literal byte */ 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/gzread.c b/Minecraft.Client/Common/zlib/gzread.c index db447ff16..bf4538eb2 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 uint8_t is written, then we cannot tell - whether this is a single-uint8_t file, or just a partially written gzip + 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 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 uint8_t is sufficient indication that it is not a gzip file) */ + single byte 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 uint8_t at end (allows more pushing) */ + /* if output buffer empty, put byte 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 uint8_t before existing data */ + /* slide output data if needed and insert byte 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 24ab6c4e4..f3833c2e4 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 uint8_t of input into the bit accumulator, or return from inflateBack() +/* Get a byte 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 uint8_t boundary */ +/* Remove zero to seven bits as needed to go to a byte 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 uint8_t boundary */ + BYTEBITS(); /* go to byte 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 f91ba23de..bda59ceb6 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() - requirements strm->avail_out >= 258 for each loop to avoid checking for + requires 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 9c118e531..870f89bb4 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 uint8_t pull from length extra in inffast.c + * - Remove unnecessary second byte 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 uint8_t structure for speed + * - Remove bit fields--back to byte 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 uint8_t of input into the bit accumulator, or return from inflate() +/* Get a byte 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 uint8_t boundary */ +/* Remove zero to seven bits as needed to go to a byte 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 uint8_t boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next uint8_t in the stream. + 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. - NEEDBITS(n) uses PULLBYTE() to get an available uint8_t of input, or to return + NEEDBITS(n) uses PULLBYTE() to get an available byte 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 uint8_t, and copying a matching string. + literal byte, 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 uint8_t boundary */ + BYTEBITS(); /* go to byte 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 uint8_t of the + return value is how many bytes were read including the last byte 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 uint8_t string */ + unsigned char buf[4]; /* to restore bit buffer to byte string */ struct inflate_state FAR *state; /* check parameters */ diff --git a/Minecraft.Client/Common/zlib/trees.c b/Minecraft.Client/Common/zlib/trees.c index 5a372e671..1fd7759ef 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 requirements that at least one distance code exists, + /* The pkzip format requires 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 - * requirements that at least 4 bit length codes be sent. (appnote.txt says + * requires 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 uint8_t boundary */ + s->compressed_len += 7; /* align on byte 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 uint8_t */ + send_code(s, lc, ltree); /* send a literal byte */ 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 uint8_t boundary + * Flush the bit buffer and align the output on a byte 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 uint8_t boundary */ + bi_windup(s); /* align on byte 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 4f152d9d1..242e9493d 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 uint8_t length of the source buffer. Upon entry, destLen is the total + the byte 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/zconf.h b/Minecraft.Client/Common/zlib/zconf.h index 9987a7755..8fd83696d 100644 --- a/Minecraft.Client/Common/zlib/zconf.h +++ b/Minecraft.Client/Common/zlib/zconf.h @@ -485,7 +485,7 @@ typedef uLong FAR uLongf; # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 +# define z_off64_t long long # else # define z_off64_t z_off_t # endif diff --git a/Minecraft.Client/CreateWorldScreen.cpp b/Minecraft.Client/CreateWorldScreen.cpp index b9856c7e3..1a8972035 100644 --- a/Minecraft.Client/CreateWorldScreen.cpp +++ b/Minecraft.Client/CreateWorldScreen.cpp @@ -97,14 +97,14 @@ void CreateWorldScreen::buttonClicked(Button *button) if (done) return; done = true; - __int64 seedValue = (new Random())->nextLong(); + int64_t seedValue = (new Random())->nextLong(); wstring seedString = seedEdit->getValue(); if (seedString.length() != 0) { // try to convert it to a long first // try { // 4J - removed try/catch - __int64 value = _fromString<__int64>(seedString); + int64_t value = _fromString(seedString); if (value != 0) { seedValue = value; diff --git a/Minecraft.Client/DemoLevel.h b/Minecraft.Client/DemoLevel.h index 8364d5b49..6464c32b7 100644 --- a/Minecraft.Client/DemoLevel.h +++ b/Minecraft.Client/DemoLevel.h @@ -4,7 +4,7 @@ class DemoLevel : public Level { private: - static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); + static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; static const int DEMO_SPAWN_Z = -731; diff --git a/Minecraft.Client/DemoMode.cpp b/Minecraft.Client/DemoMode.cpp index c52580c33..2a5664e47 100644 --- a/Minecraft.Client/DemoMode.cpp +++ b/Minecraft.Client/DemoMode.cpp @@ -13,8 +13,8 @@ void DemoMode::tick() SurvivalMode::tick(); /* 4J - TODO - seems unlikely we need this demo mode anyway - __int64 time = minecraft->level->getTime(); - __int64 day = (time / Level::TICKS_PER_DAY) + 1; + int64_t time = minecraft->level->getTime(); + int64_t day = (time / Level::TICKS_PER_DAY) + 1; demoHasEnded = (time > (500 + Level::TICKS_PER_DAY * DEMO_DAYS)); if (demoHasEnded) diff --git a/Minecraft.Client/Durango/Durango_App.cpp b/Minecraft.Client/Durango/Durango_App.cpp index 59ac8ba0b..672d6435c 100644 --- a/Minecraft.Client/Durango/Durango_App.cpp +++ b/Minecraft.Client/Durango/Durango_App.cpp @@ -50,7 +50,7 @@ void CConsoleMinecraftApp::HandleDLCLicenseChange() // Clear the DLC installed flag so the scenes will pick up the new dlc (could be a full pack install) app.ClearDLCInstalled(); app.DebugPrintf(">>> HandleDLCLicenseChange - Updating license for DLC [%ls]\n",xOffer.wszOfferName); - pack->updateLicenseMask(1); + pack->updateLicenseMask(1); } else { @@ -100,7 +100,7 @@ void CConsoleMinecraftApp::ExitGame() } void CConsoleMinecraftApp::FatalLoadError() { - // 4J-PB - + // 4J-PB - //for(int i=0;i<10;i++) { #ifndef _CONTENT_PACKAGE @@ -204,7 +204,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,D // load the local file WCHAR wchFilename[64]; - + // 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds swprintf(wchFilename,L"DLCImages/%s",wchName); HANDLE hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -269,7 +269,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -308,7 +308,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() thread->Run(); } -typedef struct +typedef struct { eDLCContentType e_DLC_Type; //WCHAR *wchDisplayName; @@ -397,7 +397,7 @@ bool CConsoleMinecraftApp::UpdateProductId(XCONTENT_DATA &Data) app.DebugPrintf("Couldn't find %ls\n",Data.wszDisplayName); } - return false; + return false; } void CConsoleMinecraftApp::Shutdown() @@ -455,7 +455,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n"); C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData; - + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; if(pFileData) @@ -471,7 +471,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in // mark the level as not checked against banned levels - it'll be checked once the level starts app.SetBanListCheck(iPad,false); - // Xbox One will clear things within the DownloadBlob + // Xbox One will clear things within the DownloadBlob #ifndef _XBOX_ONE delete [] pFileData->pbData; delete [] pFileData; @@ -558,11 +558,11 @@ int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList\n"); if(lpvData!=NULL) - { + { vector *pvTmsFileDetails=(vector *)lpvData; if(pvTmsFileDetails->size()>0) - { + { #ifdef _DEBUG // dump out the file list app.DebugPrintf("TMSPP filecount - %d\nFiles - \n",pvTmsFileDetails->size()); @@ -707,7 +707,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: { CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; - if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota + if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota || saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfLocalStorage ) { StorageManager.SetSaveDisabled(true); @@ -718,10 +718,10 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: else message = IDS_SAVE_INCOMPLETE_EXPLANATION_LOCAL_STORAGE; UINT uiIDA[3] = - { - IDS_SAVE_INCOMPLETE_RETRY_SAVING, - IDS_SAVE_INCOMPLETE_DISABLE_SAVING, - IDS_SAVE_INCOMPLETE_DELETE_SAVES + { + IDS_SAVE_INCOMPLETE_RETRY_SAVING, + IDS_SAVE_INCOMPLETE_DISABLE_SAVING, + IDS_SAVE_INCOMPLETE_DELETE_SAVES }; if ( ui.RequestMessageBox( IDS_SAVE_INCOMPLETE_TITLE, message, uiIDA,3,0,Callback_SaveGameIncompleteMessageBoxReturned,pClass, app.GetStringTable()) == C4JStorage::EMessage_Busy) diff --git a/Minecraft.Client/Durango/Durango_Minecraft.cpp b/Minecraft.Client/Durango/Durango_Minecraft.cpp index a563c9f3e..7fdab1bef 100644 --- a/Minecraft.Client/Durango/Durango_Minecraft.cpp +++ b/Minecraft.Client/Durango/Durango_Minecraft.cpp @@ -27,6 +27,7 @@ #include "Leaderboards\DurangoLeaderboardManager.h" #include "..\..\Minecraft.Client\Tesselator.h" #include "..\..\Minecraft.Client\Options.h" +#include "..\GameRenderer.h" #include "Sentient\SentientManager.h" #include "..\..\Minecraft.World\IntCache.h" #include "..\Textures.h" @@ -832,6 +833,9 @@ void oldWinMainTick() #endif ui.tick(); ui.render(); + + pMinecraft->gameRenderer->ApplyGammaPostProcess(); + #if 0 app.HandleButtonPresses(); diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp index 51f854eb2..0c106b3fd 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, const char *call, const char *context); +static void report_d3d_error(HRESULT hr, char *call, 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 450746554..5435c30bb 100644 --- a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -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-uint8_t vertex formats; this makes a worst case of 6 bytes of indices + // 16-byte 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-uint8_t vertex format and + // 2. strokes and edge antialiasing. they use a 16-byte vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every // 3 vertices, which means 24 bytes of index data for every 48 bytes // of vertex data. - // 3. textured quads. they use a 16-uint8_t vertex format, have exactly 2 + // 3. textured quads. they use a 16-byte 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,8 +2379,9 @@ static S32 num_pixels(S32 w, S32 h, S32 mipmaps) return pixels; } -GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture){ - const 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; @@ -2398,8 +2399,8 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, mipmaps = texture->mipmaps; blk = 1; - 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 }; + D3D1X_(TEXTURE2D_DESC) desc = { width, height, mipmaps, 1, DXGI_FORMAT_UNKNOWN, { 1, 0 }, + D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_SHADER_RESOURCE), 0, 0 }; switch (texture->format) { case IFT_FORMAT_rgba_8888 : size= 4; d3dfmt = DXGI_FORMAT_R8G8B8A8_UNORM; break; @@ -2408,7 +2409,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); - return 0; + goto done; } } @@ -2424,7 +2425,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); - return 0; + goto done; } U8 *cur = free_data; @@ -2453,23 +2454,21 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, failed_call = "CreateTexture2D"; hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &tex); - - 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); - } - } + if (FAILED(hr)) goto done; + 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) @@ -2479,7 +2478,6 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, } 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 e959d788e..607843266 100644 --- a/Minecraft.Client/Durango/Iggy/include/gdraw.h +++ b/Minecraft.Client/Durango/Iggy/include/gdraw.h @@ -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 requirements. + functions Iggy requires. */ RADDEFEND diff --git a/Minecraft.Client/Durango/Iggy/include/rrCore.h b/Minecraft.Client/Durango/Iggy/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/Durango/Iggy/include/rrCore.h +++ b/Minecraft.Client/Durango/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Durango/Miles/include/mss.h b/Minecraft.Client/Durango/Miles/include/mss.h index 162451b2d..80be1aa3a 100644 --- a/Minecraft.Client/Durango/Miles/include/mss.h +++ b/Minecraft.Client/Durango/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned long long ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -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() requirements at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -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 uint8_t count the asset requirements if fully loaded. + $:DataLen The uint8_t count the asset requires 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 uint8_t 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 @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/Durango/Miles/include/rrCore.h b/Minecraft.Client/Durango/Miles/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/Durango/Miles/include/rrCore.h +++ b/Minecraft.Client/Durango/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp index 7cfa030de..2c052092c 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp @@ -43,7 +43,7 @@ DQRNetworkManager::SessionInfo::SessionInfo() } // This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type -const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] = +const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] = { DNM_STATE_INITIALISING, // DNM_INT_STATE_INITIALISING DNM_STATE_INITIALISE_FAILED, // DNM_INT_STATE_INITIALISE_FAILED @@ -64,7 +64,7 @@ const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTSt DNM_STATE_PLAYING, // DNM_INT_STATE_PLAYING DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING_FAILED - DNM_STATE_ENDING, // DNM_INT_STATE_ENDING + DNM_STATE_ENDING, // DNM_INT_STATE_ENDING }; DQRNetworkManager::DQRNetworkManager(IDQRNetworkManagerListener *listener) @@ -146,7 +146,7 @@ void DQRNetworkManager::EnableDebugXBLContext(MXS::XboxLiveContext^ XBLContext) // Show service calls from Xbox Services on the UI for easy debugging XBLContext->Settings->EnableServiceCallRoutedEvents = true; - XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler( + XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler( [=]( Platform::Object^, Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^ args ) { //if( args->HttpStatus != 200 ) @@ -308,14 +308,14 @@ void DQRNetworkManager::JoinSession(int playerMask) m_isHosting = false; sockaddr_in6 localSocketAddressStorage; - + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); - + localSocketAddressStorage.sin6_family = AF_INET6; localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); - + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); m_joinCreateSessionAttempts = 0; @@ -402,7 +402,7 @@ bool DQRNetworkManager::AddUsersToSession(int playerMask, MXSM::MultiplayerSessi // We need to get a MultiplayerSession for each player that is joining MXSM::MultiplayerSession^ session = nullptr; - + WXS::User^ newUser = ProfileManager.GetUser(i); if( newUser == nullptr ) { @@ -451,12 +451,12 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) // We need to handle this differently for the host and other machines. As the procedure for adding a reserved slot for a local player whilst on the host doesn't seem to work // // On the host machine, we: - // + // // (1) Get a MPSD for the player that is being added // (2) Call the join method // (3) Write the MPSD // (4) Update the player sync data, and broadcast out to all clients - + // On remote machines, we: // // (1) join the party @@ -473,10 +473,10 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) { return false; } - + if( !m_isOfflineGame ) { - // This is going to involve some async processing + // This is going to involve some async processing MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); if( newUserXBLContext == nullptr ) @@ -558,7 +558,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) SendRoomSyncInfo(); m_listener->HandlePlayerJoined(pPlayer); // This is for notifying of local players joining in an offline game } - else + else { // Can fail (notably if m_roomSyncData contains players who've left) assert(0); @@ -571,7 +571,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) { // Check if there's any available slots before attempting to add the player to the party. We can still fail joining later if // the host can't add a reserved slot for us for some reason but better checking on the client side before even attempting. - + WXS::User^ newUser = ProfileManager.GetUser(userIndex); MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); @@ -622,16 +622,16 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) { - // We need to handle this differently for the host and other machines. + // We need to handle this differently for the host and other machines. // // On the host machine, we: - // + // // (1) Get a MPSD for the player that is being removed // (2) Call the leave method // (3) Write the MPSD // (4) Leave the party // (5) Update the player sync data, and broadcast out to all clients - + // On remote machines, we: // // (1) Get a MPSD for the player that is being removed @@ -651,7 +651,7 @@ bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) { return false; } - + if( !m_isOfflineGame ) { if( m_chat ) @@ -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 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. +// 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. bool DQRNetworkManager::IsInSession() { return m_isInSession; @@ -788,7 +788,7 @@ wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag) { return m_displayNames[gamertag]; } - else + else { return gamertag; } @@ -902,14 +902,14 @@ void DQRNetworkManager::Tick_VoiceChat() { m_chat->AddLocalUser(user); } - } + } } m_vecChatPlayersJoined.clear(); LeaveCriticalSection(&m_csVecChatPlayers); } void DQRNetworkManager::Tick_Party() -{ +{ // If the primary player has been flagged as having left the party, then we don't respond immediately as it is possible we are just transitioning from one party to another, and it would be much // nicer to handle this kind of transition directly. If we do get a new party within this time period, then we'll handle by asking the user if they want to leave the game they are currently in etc. if( m_playersLeftParty ) @@ -919,7 +919,7 @@ void DQRNetworkManager::Tick_Party() // We've waited long enough. User must (hopefully) have just left the party // Previously we'd switch to offline but that causes a world of pain with forced sign-outs if( m_playersLeftParty & 1 ) - { + { // Before we switch to an offline game, check to see if there is currently a new party. If this is the case and // we're here, then its because we were added to a party, but didn't receive a gamesessionready event. So if we have // a party here that we've joined, and the number of players in the party (including us) is more than MAX_PLAYERS_IN_TEMPLATE, @@ -955,7 +955,7 @@ void DQRNetworkManager::Tick_Party() m_playersLeftParty = 0; } } - + // Forced sign out if (m_handleForcedSignOut) { @@ -1064,7 +1064,7 @@ void DQRNetworkManager::Tick_ResolveGamertags() HostGamertagResolveDetails *details = m_hostGamertagResolveResults.front(); details->m_pPlayer->SetName(details->m_name.c_str()); - + LogComment("Adding a player"); if( AddRoomSyncPlayer(details->m_pPlayer, details->m_sessionAddress, details->m_channel ) ) { @@ -1154,7 +1154,7 @@ void DQRNetworkManager::Tick_StateMachine() break; case DNM_INT_STATE_JOINING_SENDING_UNRELIABLE: { - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); // m_firstUnreliableSendTime of 0 indicates that we haven't tried sending an unreliable packet yet so need to send one and initialise things if( m_firstUnreliableSendTime == 0 ) { @@ -1188,7 +1188,7 @@ void DQRNetworkManager::Tick_StateMachine() { // Timeout if we've been waiting for reserved slots for our joining players for too long. This is most likely because the host doesn't have room for all the slots we wanted, and we weren't able to determine this // when we went to join the game (ie someone else was joining at the same time). At this point we need to remove any local players that did already join, from both the session and the party. - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); if( ( timeNow - m_startedWaitingForReservationsTime ) > JOIN_RESERVATION_WAIT_TIME ) { SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP); @@ -1332,7 +1332,7 @@ void DQRNetworkManager::HandleSessionChange(MXSM::MultiplayerSession^ multiplaye { ((DurangoStats*)GenericStats::getInstance())->setMultiplayerCorrelationId( nullptr ); } - + m_multiplayerSession = multiplayerSession; } @@ -1362,7 +1362,7 @@ MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveCo }) .wait(); - if( outputMultiplayerSession != nullptr && + if( outputMultiplayerSession != nullptr && outputMultiplayerSession->SessionReference != nullptr ) { app.DebugPrintf( "Session written OK\n" ); @@ -1422,7 +1422,7 @@ WXM::MultiplayerSessionReference^ DQRNetworkManager::ConvertToWindowsXboxMultipl { return ref new WXM::MultiplayerSessionReference( sessionRef->SessionName, - sessionRef->ServiceConfigurationId, + sessionRef->ServiceConfigurationId, sessionRef->SessionTemplateName ); } @@ -1458,7 +1458,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) // And when we are done, anything left in the temporary vector must be a player that left for( int i = 0; i < pNewSyncData->playerCount; i++ ) { - PlayerSyncData *pNewPlayer = &pNewSyncData->players[i]; + PlayerSyncData *pNewPlayer = &pNewSyncData->players[i]; bool bAlreadyExisted = false; for (auto it = tempPlayers.begin(); it != tempPlayers.end(); it++) { @@ -1491,7 +1491,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) } LogCommentFormat(L"Adding new player, index %d - type %d, small Id %d, name %s, xuid %s\n",i,m_players[i]->m_type,pNewPlayer->m_smallId,pNewPlayer->m_name,pNewPlayer->m_XUID); - + m_players[i]->SetSmallId(pNewPlayer->m_smallId); m_players[i]->SetName(pNewPlayer->m_name); m_players[i]->SetUID(PlayerUID(pNewPlayer->m_XUID)); @@ -1525,7 +1525,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel) { if( m_roomSyncData.playerCount == MAX_ONLINE_PLAYER_COUNT ) return false; - + EnterCriticalSection(&m_csRoomSyncData); // Find the first entry that isn't us, to decide what to sync before. Don't consider entry #0 as this is reserved to indicate the host. int insertAtIdx = m_roomSyncData.playerCount; @@ -1552,11 +1552,11 @@ bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned in { m_roomSyncData.players[i] = m_roomSyncData.players[i-1]; m_players[i] = m_players[i - 1]; - } + } m_roomSyncData.players[insertAtIdx].m_channel = channel; m_roomSyncData.players[insertAtIdx].m_sessionAddress = sessionAddress; int xuidLength = pPlayer->GetUID().toString().length() + 1; // +1 for terminator - m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength]; + m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength]; wcsncpy(m_roomSyncData.players[insertAtIdx].m_XUID, pPlayer->GetUID().toString().c_str(), xuidLength); m_roomSyncData.players[insertAtIdx].m_smallId = pPlayer->GetSmallId(); wcscpy_s(m_roomSyncData.players[insertAtIdx].m_name, pPlayer->GetName()); @@ -1587,7 +1587,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayersWithSessionAddress(unsigned int ses { m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; m_players[iWriteIdx] = m_players[i]; - iWriteIdx++; + iWriteIdx++; } } m_roomSyncData.playerCount = iWriteIdx; @@ -1618,7 +1618,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer) { m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; m_players[iWriteIdx] = m_players[i]; - iWriteIdx++; + iWriteIdx++; } } m_roomSyncData.playerCount = iWriteIdx; @@ -1659,13 +1659,13 @@ void DQRNetworkManager::SendRoomSyncInfo() uint32_t sizeHigh = internalBytes >> 8; uint32_t sizeLow = internalBytes & 0xff; - data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending 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); memcpy(data + 7, &m_roomSyncData, sizeof(RoomSyncData)); - unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData); + unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData); for( int i = 0 ; i < m_roomSyncData.playerCount; i++ ) { @@ -1701,12 +1701,12 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) uint32_t sizeHigh = internalBytes >> 8; uint32_t sizeLow = internalBytes & 0xff; - data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending 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); - memcpy(data + 7, xuid->Data(), xuidBytes); + memcpy(data + 7, xuid->Data(), xuidBytes); SendBytesRaw(-1, data, totalBytes, true); @@ -1927,7 +1927,7 @@ int DQRNetworkManager::HostGameThreadProc() // Actually create the session (locally), using the primary player's context try { - session = ref new MXSM::MultiplayerSession( primaryUserXBLContext, + session = ref new MXSM::MultiplayerSession( primaryUserXBLContext, ref new MXSM::MultiplayerSessionReference( SERVICE_CONFIG_ID, MATCH_SESSION_TEMPLATE_NAME, sessionName ), 0, // this means that it will use the maxMembers specified in the session template. false, @@ -1972,7 +1972,7 @@ int DQRNetworkManager::HostGameThreadProc() session->Join( GetNextSmallIdAsJsonString(), true ); session->SetCurrentUserStatus( MXSM::MultiplayerSessionMemberStatus::Active ); - + // Get device ID for current user & set in the session Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String(); session->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress ); @@ -1997,7 +1997,7 @@ int DQRNetworkManager::HostGameThreadProc() return 0; } m_partyController->SetJoinability(m_listener->IsSessionJoinable()); - + // Add reservations for anyone in the party, who isn't the primary player. Just adding local players for now, but perhaps this should add // other party members at this stage? for ( WXM::PartyMember^ member : partyView->Members ) @@ -2029,8 +2029,8 @@ int DQRNetworkManager::HostGameThreadProc() session->SetHostDeviceToken( hostMember->DeviceToken ); m_partyController->RegisterGamePlayersChangedEventHandler(); - - // Update session on the server + + // Update session on the server HRESULT hr = S_OK; session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); @@ -2086,14 +2086,14 @@ int DQRNetworkManager::HostGameThreadProc() if( m_state == DNM_INT_STATE_HOSTING_FAILED) return 0; sockaddr_in6 localSocketAddressStorage; - + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); - + localSocketAddressStorage.sin6_family = AF_INET6; localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); - + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); // This shouldn't ever happen, but seems worth checking that we don't have a pre-existing session in case there's any way to get here with one already running @@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc() if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i)) { auto user = ProfileManager.GetUser(i); - wstring displayName = ProfileManager.GetDisplayName(i); + wstring displayName = ProfileManager.GetDisplayName(i); DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress); pPlayer->SetSmallId(smallId); @@ -2234,7 +2234,7 @@ int DQRNetworkManager::LeaveRoomThreadProc() // Request RTS to be terminated RTS_Terminate(); - + // Now leave the game session. We need to do this for each player in turn, writing each time bool bError = false; for( int i = 0; i < 4; i++ ) @@ -2339,7 +2339,7 @@ int DQRNetworkManager::TidyUpJoinThreadProc() // We can fail to join at various points, and in at least one case (if it is down to RUDP unreliable packets timing out) then we don't have m_joinSessionUserMask bits set any more, // but we Do have m_currentUserMask set. Any of these should be considered users we should be attempting to remove from the session. - int removeSessionMask = m_joinSessionUserMask | m_currentUserMask; + int removeSessionMask = m_joinSessionUserMask | m_currentUserMask; for( int i = 0; i < 4; i++ ) { if( removeSessionMask & ( 1 << i ) ) @@ -2428,7 +2428,7 @@ int DQRNetworkManager::UpdateCustomSessionDataThreadProc() { LogComment(L"Starting thread to update custom data"); WXS::User^ primaryUser = ProfileManager.GetUser(0); - + if( primaryUser == nullptr ) { return 0; @@ -2550,7 +2550,7 @@ void DQRNetworkManager::HandlePlayerRemovedFromParty(int playerMask) { // As a client, we don't have any messy changing to offline game or saving etc. to do, so we can respond immediately to leaving the party if( playerMask & 1 ) - { + { DQRNetworkManager::LogComment(L"Primary player on this system has left the party - leaving game\n"); app.SetDisconnectReason(DisconnectPacket::eDisconnect_ExitedGame); LeaveRoom(); @@ -2725,7 +2725,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes m_joinSessionUserMask = playerMask; m_isInSession = true; m_isOfflineGame = false; - + m_startedWaitingForReservationsTime = System::currentTimeMillis(); SetState(DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS); @@ -2742,7 +2742,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes if( sessionRef != nullptr ) { // Allow 2 seconds before we let the player cancel - __int64 allowCancelTime = System::currentTimeMillis() + (1000 * 2); + int64_t allowCancelTime = System::currentTimeMillis() + (1000 * 2); // Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining // members *may* have a slot (reserved or active) depending on how far progressed the joining got. @@ -2814,7 +2814,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes break; } - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); if( currentTime > allowCancelTime) { shownCancelScreen = true; @@ -2893,7 +2893,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes SetState(DNM_INT_STATE_JOINING_FAILED); } }); - + while(!ccTask.is_done()) { @@ -3013,7 +3013,7 @@ void DQRNetworkManager::RequestDisplayName(DQRNetworkPlayer *player) { if (player->IsLocal()) { - // Player is local so we can just ask profile manager + // Player is local so we can just ask profile manager SetDisplayName(player->GetUID(), ProfileManager.GetDisplayName(player->GetLocalPlayerIndex())); } else diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.h b/Minecraft.Client/Durango/Network/DQRNetworkManager.h index 5f7b8d908..3c4a742cf 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.h +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.h @@ -131,7 +131,7 @@ public: static const int MAX_ONLINE_PLAYER_COUNT = 8; static const int MAX_ONLINE_PLAYER_NAME_LENGTH = 21; - // This class stores everything about a player that must be synchronised between machines. + // This class stores everything about a player that must be synchronised between machines. class PlayerSyncData { public: @@ -210,7 +210,7 @@ public: DNM_STATE_JOINING, DNM_STATE_STARTING, - DNM_STATE_PLAYING, + DNM_STATE_PLAYING, DNM_STATE_LEAVING, DNM_STATE_ENDING, @@ -339,9 +339,9 @@ private: static const eDQRNetworkManagerState m_INTtoEXTStateMappings[DNM_INT_STATE_COUNT]; eDQRNetworkManagerInternalState m_state; eDQRNetworkManagerState m_stateExternal; - __int64 m_lastUnreliableSendTime; - __int64 m_firstUnreliableSendTime; - __int64 m_startedWaitingForReservationsTime; + int64_t m_lastUnreliableSendTime; + int64_t m_firstUnreliableSendTime; + int64_t m_startedWaitingForReservationsTime; unsigned char *m_customSessionData; unsigned int m_customSessionDataSize; int m_customDataDirtyUpdateTicks; @@ -361,7 +361,7 @@ private: CRITICAL_SECTION m_csRoomSyncData; RoomSyncData m_roomSyncData; - DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT]; + DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT]; IDQRNetworkManagerListener *m_listener; PartyController *m_partyController; @@ -389,7 +389,7 @@ private: int m_joinCreateSessionAttempts; C4JThread *m_CreateSessionThread; - C4JThread *m_LeaveRoomThread; + C4JThread *m_LeaveRoomThread; C4JThread *m_TidyUpJoinThread; C4JThread *m_UpdateCustomSessionDataThread; C4JThread *m_RTS_DoWorkThread; @@ -426,7 +426,7 @@ private: int GetQueueSizeMessages(); void SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential); void SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast); - + bool AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel); void RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress); void RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer); @@ -438,7 +438,7 @@ private: int GetSessionIndexForSmallId(unsigned char smallId); int GetSessionIndexAndSmallIdForHost(unsigned char *smallId); - static void LogComment( Platform::String^ strText ); + static void LogComment( Platform::String^ strText ); static void LogCommentFormat( LPCWSTR strMsg, ... ); static void LogCommentWithError( Platform::String^ strTest, HRESULT hr ); @@ -491,7 +491,7 @@ public: void SetDisplayName(PlayerUID xuid, wstring displayName); private: - __int64 m_playersLeftPartyTime; + int64_t m_playersLeftPartyTime; int m_playersLeftParty; bool GetBestPartyUserIndex(); @@ -502,7 +502,7 @@ private: bool GetGameSessionData(MXSM::MultiplayerSession^ session, void *gameSessionData); public: - static Platform::Collections::Vector^ GetFriends(); + static Platform::Collections::Vector^ GetFriends(); private: SessionSearchResult *m_sessionSearchResults; @@ -551,7 +551,7 @@ private: void Process_RTS_MESSAGE_STATUS_TERMINATED(RTS_Message &message); // Outgoing messages - to be called from the RTS work thread, to process requests from the main thread - + void ProcessRTSMessagesOutgoing(); void Process_RTS_MESSAGE_START_CLIENT(RTS_Message &message); void Process_RTS_MESSAGE_START_HOST(RTS_Message &message); diff --git a/Minecraft.Client/Durango/XML/ATGXmlParser.cpp b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp index fc5aed08a..771ba2682 100644 --- a/Minecraft.Client/Durango/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp @@ -1,13 +1,13 @@ -// 4J-PB - -// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). -// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. -// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. -// You are encouraged to incorporate this code into your titles. +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. //------------------------------------------------------------------------------------- // AtgXmlParser.cpp -// +// // Simple callback non-validating XML parser implementation. // // Xbox Advanced Technology Group. @@ -35,7 +35,7 @@ XMLParser::XMLParser() // Name: XMLParser::~XMLParser //------------------------------------------------------------------------------------- XMLParser::~XMLParser() -{ +{ } @@ -51,11 +51,11 @@ VOID XMLParser::FillBuffer() if( m_hFile == NULL ) { - if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) + if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) NChars = XML_READ_BUFFER_SIZE; else NChars = m_uInXMLBufferCharsLeft; - + CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars ); m_uInXMLBufferCharsLeft -= NChars; m_pInXMLBuffer += NChars; @@ -69,7 +69,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; @@ -89,7 +89,7 @@ VOID XMLParser::SkipNextAdvance() //------------------------------------------------------------------------------------- // Name: XMLParser::ConsumeSpace -// Desc: Skips spaces in the current stream +// Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- HRESULT XMLParser::ConsumeSpace() { @@ -104,29 +104,29 @@ HRESULT XMLParser::ConsumeSpace() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - } - SkipNextAdvance(); + } + SkipNextAdvance(); return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::ConvertEscape -// Desc: Copies and converts an escape sequence into m_pWriteBuf +// Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- HRESULT XMLParser::ConvertEscape() -{ +{ HRESULT hr; WCHAR wVal = 0; - + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - // all escape sequences start with &, so ignore the first character - + // all escape sequences start with &, so ignore the first character + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if ( m_Ch == '#' ) // character as hex or decimal { if( FAILED( hr = AdvanceCharacter() ) ) @@ -135,9 +135,9 @@ HRESULT XMLParser::ConvertEscape() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + while ( m_Ch != ';' ) - { + { wVal *= 16; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -151,11 +151,11 @@ HRESULT XMLParser::ConvertEscape() else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) ) { wVal += m_Ch - 'A' + 10; - } + } else { - Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); + return E_INVALID_XML_SYNTAX; } if( FAILED( hr = AdvanceCharacter() ) ) @@ -165,7 +165,7 @@ HRESULT XMLParser::ConvertEscape() else // decimal number { while ( m_Ch != ';' ) - { + { wVal *= 10; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -174,7 +174,7 @@ HRESULT XMLParser::ConvertEscape() } else { - Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); + Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); return E_INVALID_XML_SYNTAX; } @@ -187,7 +187,7 @@ HRESULT XMLParser::ConvertEscape() m_Ch = wVal; return S_OK; - } + } // must be an entity reference @@ -197,13 +197,13 @@ HRESULT XMLParser::ConvertEscape() SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) { - Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); + Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); return E_INVALID_XML_SYNTAX; } @@ -219,7 +219,7 @@ HRESULT XMLParser::ConvertEscape() wVal = '"'; else { - Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); + Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence } @@ -228,10 +228,10 @@ HRESULT XMLParser::ConvertEscape() if( m_Ch != ';' ) { - Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); + Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ; } - + m_Ch = wVal; return S_OK; } @@ -250,41 +250,41 @@ HRESULT XMLParser::AdvanceAttrVal() return hr; if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) ) - { - Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); + { + Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); return E_INVALID_XML_SYNTAX; } wQuoteChar = m_Ch; - + for( ;; ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - else if( m_Ch == wQuoteChar ) - break; + return hr; + else if( m_Ch == wQuoteChar ) + break; else if( m_Ch == '&' ) { SkipNextAdvance(); if( FAILED( hr = ConvertEscape() ) ) - return hr; + return hr; } - else if( m_Ch == '<' ) + else if( m_Ch == '<' ) { - Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); + return E_INVALID_XML_SYNTAX; } - + // copy character into the buffer - - if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; } - + *m_pWritePtr = m_Ch; - m_pWritePtr++; + m_pWritePtr++; } return S_OK; } @@ -296,18 +296,18 @@ HRESULT XMLParser::AdvanceAttrVal() // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceName() -{ +{ HRESULT hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) && ( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) && ( m_Ch != '_' ) && ( m_Ch != ':' ) ) { - Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); + return E_INVALID_XML_SYNTAX; } while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) || @@ -319,17 +319,17 @@ HRESULT XMLParser::AdvanceName() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); return E_INVALID_XML_SYNTAX; - } + } *m_pWritePtr = m_Ch; m_pWritePtr++; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } - + SkipNextAdvance(); return S_OK; } @@ -343,7 +343,7 @@ HRESULT XMLParser::AdvanceName() // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) -{ +{ if( m_bSkipNextAdvance ) { m_bSkipNextAdvance = FALSE; @@ -351,20 +351,20 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } // If we hit EOF in the middle of a character, - // it's ok-- we'll just have a corrupt last character + // it's ok-- we'll just have a corrupt last character // (the buffer is padded with double NULLs ) if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { // Read more from the file - FillBuffer(); + FillBuffer(); // We are at EOF if it is still NULL if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { if( !bOkToFail ) { - Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); + Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); return E_INVALID_XML_SYNTAX; } else @@ -372,7 +372,7 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) return E_FAIL; } } - } + } if( m_bUnicode == FALSE ) { @@ -382,13 +382,13 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) else // if( m_bUnicode == TRUE ) { m_Ch = *((WCHAR *)m_pReadPtr); - + if( m_bReverseBytes ) { m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 ); } - - m_pReadPtr += 2; + + m_pReadPtr += 2; } if( m_Ch == '\n' ) @@ -398,114 +398,114 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } else if( m_Ch != '\r' ) m_pISAXCallback->m_LinePos++; - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::AdvanceElement -// Desc: Builds data, calls callback +// Desc: Builds data, calls callback //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceElement() -{ +{ HRESULT hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // if first character wasn't '<', we wouldn't be here - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch == '!' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if ( m_Ch == '-' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - if( m_Ch != '-' ) + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '-' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '-' after 'ElementEnd( pEntityRefVal, + if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if( m_Ch != '>' ) { @@ -513,42 +513,42 @@ HRESULT XMLParser::AdvanceElement() return E_INVALID_XML_SYNTAX; } } - else if( m_Ch == '?' ) + else if( m_Ch == '?' ) { // just skip any xml header tag since not really important after identifying character set for( ;; ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == '>' ) return S_OK; } } else { - XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; + XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; UINT NumAttrs; WCHAR *pEntityRefVal = m_pWritePtr; UINT EntityRefLen; NumAttrs = 0; - + SkipNextAdvance(); // Entity tag - if( FAILED( hr = AdvanceName() ) ) + if( FAILED( hr = AdvanceName() ) ) return hr; EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); - if( FAILED( hr = ConsumeSpace() ) ) + if( FAILED( hr = ConsumeSpace() ) ) return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // read attributes while( ( m_Ch != '>' ) && ( m_Ch != '/' ) ) { @@ -556,31 +556,31 @@ HRESULT XMLParser::AdvanceElement() if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT ) { - Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); + return E_INVALID_XML_SYNTAX; } Attributes[ NumAttrs ].strName = m_pWritePtr; - + // Attribute name if( FAILED( hr = AdvanceName() ) ) return hr; - + Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; - if( m_Ch != '=' ) + if( m_Ch != '=' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" ); return E_INVALID_XML_SYNTAX; } - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; Attributes[ NumAttrs ].strValue = m_pWritePtr; @@ -588,29 +588,29 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; - + if( FAILED( hr = ConsumeSpace() ) ) - return hr; + return hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } if( m_Ch == '/' ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch != '>' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" ); return E_INVALID_XML_SYNTAX; } - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; @@ -619,7 +619,7 @@ HRESULT XMLParser::AdvanceElement() } else { - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; } @@ -637,7 +637,7 @@ HRESULT XMLParser::AdvanceCDATA() { HRESULT hr; WORD wStage = 0; - + if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -645,10 +645,10 @@ HRESULT XMLParser::AdvanceCDATA() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( ( m_Ch == ']' ) && ( wStage == 0 ) ) wStage = 1; else if( ( m_Ch == ']' ) && ( wStage == 1 ) ) @@ -666,9 +666,9 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; - } + } } - + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) return E_ABORT; @@ -676,7 +676,7 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAEnd() ) ) return E_ABORT; - + return S_OK; } @@ -694,24 +694,24 @@ HRESULT XMLParser::AdvanceComment() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if (( m_Ch == '-' ) && ( wStage == 0 )) wStage = 1; else if (( m_Ch == '-' ) && ( wStage == 1 )) wStage = 2; - else if (( m_Ch == '>' ) && ( wStage == 2 )) - break; + else if (( m_Ch == '>' ) && ( wStage == 2 )) + break; else - wStage = 0; + wStage = 0; } - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::RegisterSAXCallbackInterface -// Desc: Registers callback interface +// Desc: Registers callback interface //------------------------------------------------------------------------------------- VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { @@ -721,7 +721,7 @@ VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) //------------------------------------------------------------------------------------- // Name: XMLParser::GetSAXCallbackInterface -// Desc: Returns current callback interface +// Desc: Returns current callback interface //------------------------------------------------------------------------------------- ISAXCallback* XMLParser::GetSAXCallbackInterface() { @@ -740,7 +740,7 @@ HRESULT XMLParser::MainParseLoop() if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; - + m_pWritePtr = m_pWriteBuf; FillBuffer(); @@ -751,57 +751,57 @@ HRESULT XMLParser::MainParseLoop() m_bReverseBytes = FALSE; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = TRUE; m_bReverseBytes = TRUE; - m_pReadPtr += 2; + m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) - { - m_bUnicode = TRUE; - m_bReverseBytes = FALSE; - } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) { m_bUnicode = TRUE; - m_bReverseBytes = TRUE; + m_bReverseBytes = FALSE; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; } else if ( m_pReadBuf[ 0 ] == 0x3C ) { - m_bUnicode = FALSE; - m_bReverseBytes = FALSE; + m_bUnicode = FALSE; + m_bReverseBytes = FALSE; } else - { + { Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" ); - return E_INVALID_XML_SYNTAX; + return E_INVALID_XML_SYNTAX; } - + for( ;; ) { if( FAILED( AdvanceCharacter( TRUE ) ) ) { if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } - + if( FAILED( m_pISAXCallback->EndDocument() ) ) return E_ABORT; - - return S_OK; + + return S_OK; } if( m_Ch == '<' ) { if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } @@ -810,45 +810,45 @@ HRESULT XMLParser::MainParseLoop() m_pWritePtr = m_pWriteBuf; - if( FAILED( hr = AdvanceElement() ) ) - return hr; + if( FAILED( hr = AdvanceElement() ) ) + return hr; m_pWritePtr = m_pWriteBuf; } - else + else { if( m_Ch == '&' ) { SkipNextAdvance(); - if( FAILED( hr = ConvertEscape() ) ) - return hr; + if( FAILED( hr = ConvertEscape() ) ) + return hr; } - if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && - ( m_Ch != '\t' ) ) + if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && + ( m_Ch != '\t' ) ) { bWhiteSpaceOnly = FALSE; } *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { if( !bWhiteSpaceOnly ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, + ( UINT ) ( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) { - return E_ABORT; + return E_ABORT; } } m_pWritePtr = m_pWriteBuf; bWhiteSpaceOnly = TRUE; } - } + } } } @@ -858,36 +858,36 @@ HRESULT XMLParser::MainParseLoop() // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) -{ +{ HRESULT hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; - m_pReadPtr = m_pReadBuf; - + m_pReadPtr = m_pReadBuf; + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; - + m_pReadBuf[ 1 ] = '\0'; + m_pInXMLBuffer = NULL; m_uInXMLBufferCharsLeft = 0; - + WCHAR wchFilename[ 64 ]; swprintf_s(wchFilename,64,L"%s",strFilename); - m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); + m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if( m_hFile == INVALID_HANDLE_VALUE ) - { + { Error( E_COULD_NOT_OPEN_FILE, "Error opening file" ); hr = E_COULD_NOT_OPEN_FILE; - + } else { @@ -897,14 +897,14 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) m_dwCharsConsumed = 0; hr = MainParseLoop(); } - + // Close the file if( m_hFile != INVALID_HANDLE_VALUE ) CloseHandle( m_hFile ); m_hFile = INVALID_HANDLE_VALUE; // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } @@ -914,38 +914,38 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) -{ +{ HRESULT hr; - + if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; m_pReadPtr = m_pReadBuf; - + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; m_hFile = NULL; m_pInXMLBuffer = strBuffer; m_uInXMLBufferCharsLeft = uBufferSize; m_dwCharsTotal = uBufferSize; m_dwCharsConsumed = 0; - + hr = MainParseLoop(); // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } //------------------------------------------------------------------------------------- -// XMLParser::Error() +// XMLParser::Error() // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation @@ -960,7 +960,7 @@ VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) va_start( pArglist, strFormat ); vsprintf( strBuffer, strFormat, pArglist ); - + m_pISAXCallback->Error( hErr, strBuffer ); va_end( pArglist ); } diff --git a/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck index e78564c9c..ce2af1385 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck differ diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index 4af355aad..703be8900 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -72,7 +72,7 @@ DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } void PIXAddNamedCounter(int a, const char* b, ...) {} //#define PS3_USE_PIX_EVENTS //#define PS4_USE_PIX_EVENTS -void PIXBeginNamedEvent(int a, const char *b, ...) +void PIXBeginNamedEvent(int a, const char* b, ...) { #ifdef PS4_USE_PIX_EVENTS char buf[512]; diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index 51b50ca19..ce2275f69 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -146,6 +146,44 @@ void Font::renderStyleLine(float x0, float y0, float x1, float y1) t->end(); } +void Font::addCharacterQuad(wchar_t c) +{ + float xOff = c % m_cols * m_charWidth; + float yOff = c / m_cols * m_charWidth; + float width = charWidths[c] - .01f; + float height = m_charHeight - .01f; + float fontWidth = m_cols * m_charWidth; + float fontHeight = m_rows * m_charHeight; + const float shear = m_italic ? (height * 0.25f) : 0.0f; + float x0 = xPos, x1 = xPos + width + shear; + float y0 = yPos, y1 = yPos + height; + + Tesselator *t = Tesselator::getInstance(); + t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x0, y1, 0.0f); + t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x1, y1, 0.0f); + t->tex((xOff + width) / fontWidth, yOff / fontHeight); + t->vertex(x1, y0, 0.0f); + t->tex(xOff / fontWidth, yOff / fontHeight); + t->vertex(x0, y0, 0.0f); + + if (m_bold) + { + float dx = 1.0f; + t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x0 + dx, y1, 0.0f); + t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x1 + dx, y1, 0.0f); + t->tex((xOff + width) / fontWidth, yOff / fontHeight); + t->vertex(x1 + dx, y0, 0.0f); + t->tex(xOff / fontWidth, yOff / fontHeight); + t->vertex(x0 + dx, y0, 0.0f); + } + + xPos += static_cast(charWidths[c]); +} + void Font::renderCharacter(wchar_t c) { float xOff = c % m_cols * m_charWidth; @@ -255,11 +293,13 @@ void Font::draw(const wstring &str, bool dropShadow) { // Bind the texture textures->bindTexture(m_textureLocation); - bool noise = false; m_bold = m_italic = m_underline = m_strikethrough = false; wstring cleanStr = sanitize(str); + Tesselator *t = Tesselator::getInstance(); + t->begin(); + for (int i = 0; i < static_cast(cleanStr.length()); ++i) { // Map character @@ -270,8 +310,10 @@ void Font::draw(const wstring &str, bool dropShadow) wchar_t ca = cleanStr[i+1]; if (!isSectionFormatCode(ca)) { + t->end(); renderCharacter(167); renderCharacter(ca); + t->begin(); i += 1; continue; } @@ -294,14 +336,10 @@ void Font::draw(const wstring &str, bool dropShadow) { noise = false; if (colorN < 0 || colorN > 15) colorN = 15; - if (dropShadow) colorN += 16; - int color = colors[colorN]; glColor3f((color >> 16) / 255.0F, ((color >> 8) & 255) / 255.0F, (color & 255) / 255.0F); } - - i += 1; continue; } @@ -317,8 +355,10 @@ void Font::draw(const wstring &str, bool dropShadow) c = newc; } - renderCharacter(c); + addCharacterQuad(c); } + + t->end(); } void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow) diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 3d25880de..a5d117ca0 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -47,6 +47,7 @@ public: private: void renderCharacter(wchar_t c); // 4J added + void addCharacterQuad(wchar_t c); void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough public: diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 850744f7b..58bde2925 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -74,7 +74,7 @@ ResourceLocation GameRenderer::SNOW_LOCATION = ResourceLocation(TN_ENVIRONMENT_S GameRenderer::GameRenderer(Minecraft *mc) { // 4J - added this block of initialisers - renderDistance = 0; + renderDistance = (float)(16 * 16 >> mc->options->viewDistance); _tick = 0; hovered = nullptr; thirdDistance = 4; @@ -614,7 +614,15 @@ void GameRenderer::getFovAndAspect(float& fov, float& aspect, float a, bool appl void GameRenderer::setupCamera(float a, int eye) { - renderDistance = (float)(16 * 16 >> (mc->options->viewDistance)); + if (mc->options->viewDistance >= 0) + { + renderDistance = (float)(16 * 16 >> mc->options->viewDistance); + } + else + { + renderDistance = (float)((16 * 16) << (-mc->options->viewDistance)); + } + glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -937,9 +945,9 @@ float GameRenderer::ComputeGammaFromSlider(float slider0to100) slider = min(slider, 100.0f); if (slider > 50.0f) - return 1.0f + (slider - 50.0f) / 50.0f * 3.0f; // 1.0 -> 4.0 + return 1.0f + (slider - 50.0f) / 50.0f * 0.5f; // 1.0 -> 1.5 else - return 1.0f - (50.0f - slider) / 50.0f * 0.85f; // 1.0 -> 0.15 + return 1.0f - (50.0f - slider) / 50.0f * 0.5f; // 1.0 -> 0.5 } void GameRenderer::CachePlayerGammas() @@ -1049,20 +1057,36 @@ void GameRenderer::ApplyGammaPostProcess() const D3D11_VIEWPORT vps[NUM_LIGHT_TEXTURES]; float gammas[NUM_LIGHT_TEXTURES]; const UINT n = BuildPlayerViewports(vps, gammas, NUM_LIGHT_TEXTURES); - if (n == 0) - return; - bool anyEffect = false; - for (UINT i = 0; i < n; ++i) + float gamma = 1.0f; + bool hasPlayers = n > 0; + + if (hasPlayers) { - if (gammas[i] < 0.99f || gammas[i] > 1.01f) + bool anyEffect = false; + for (UINT i = 0; i < n; ++i) { - anyEffect = true; - break; + if (gammas[i] < 0.99f || gammas[i] > 1.01f) + { + anyEffect = true; + break; + } } + if (!anyEffect) + return; } - if (!anyEffect) + else + { + const float slider = app.GetGameSettings(0, eGameSetting_Gamma); + gamma = ComputeGammaFromSlider(slider); + if (gamma < 0.99f || gamma > 1.01f) + { + PostProcesser::GetInstance().SetGamma(gamma); + PostProcesser::GetInstance().Apply(); + return; + } return; + } if (n == 1) { @@ -1167,36 +1191,33 @@ void GameRenderer::render(float a, bool bFirst) renderLevel(a, lastNsTime + 1000000000 / maxFps); } - lastNsTime = System::nanoTime(); + lastNsTime = System::nanoTime(); - ApplyGammaPostProcess(); - - if (!mc->options->hideGui || mc->screen != NULL) - { - mc->gui->render(a, mc->screen != NULL, xMouse, yMouse); + if (!mc->options->hideGui || mc->screen != NULL) + { + mc->gui->render(a, mc->screen != NULL, xMouse, yMouse); + } } - } - else - { - glViewport(0, 0, mc->width, mc->height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - setupGuiScreen(); + else + { + glViewport(0, 0, mc->width, mc->height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + setupGuiScreen(); - lastNsTime = System::nanoTime(); - } + lastNsTime = System::nanoTime(); + } - if (mc->screen != NULL) - { - glClear(GL_DEPTH_BUFFER_BIT); - mc->screen->render(xMouse, yMouse, a); - if (mc->screen != NULL && mc->screen->particles != NULL) mc->screen->particles->render(a); - } - -} + if (mc->screen != NULL) + { + glClear(GL_DEPTH_BUFFER_BIT); + mc->screen->render(xMouse, yMouse, a); + if (mc->screen != NULL && mc->screen->particles != NULL) mc->screen->particles->render(a); + } + } void GameRenderer::renderLevel(float a) { @@ -1351,7 +1372,7 @@ void GameRenderer::DisableUpdateThread() #endif } -void GameRenderer::renderLevel(float a, __int64 until) +void GameRenderer::renderLevel(float a, int64_t until) { // if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen @@ -1434,7 +1455,7 @@ void GameRenderer::renderLevel(float a, __int64 until) if (until == 0) break; - __int64 diff = until - System::nanoTime(); + int64_t diff = until - System::nanoTime(); if (diff < 0) break; if (diff > 1000000000) break; } while (true); diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index 4268cf829..333710060 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -81,7 +81,9 @@ private: float m_cachedGammaPerPlayer[NUM_LIGHT_TEXTURES]; static float ComputeGammaFromSlider(float slider0to100); void CachePlayerGammas(); +public: void ApplyGammaPostProcess() const; +private: bool ComputeViewportForPlayer(int j, D3D11_VIEWPORT& outViewport) const; uint32_t BuildPlayerViewports(D3D11_VIEWPORT* outViewports, float* outGammas, UINT maxCount) const; @@ -115,8 +117,8 @@ public: void setupCamera(float a, int eye); private: void renderItemInHand(float a, int eye); - __int64 lastActiveTime; - __int64 lastNsTime; + int64_t lastActiveTime; + int64_t lastNsTime; // 4J - changes brought forward from 1.8.2 bool _updateLightTexture; public: @@ -133,7 +135,7 @@ private: public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); - void renderLevel(float a, __int64 until); + void renderLevel(float a, int64_t until); private: Random *random; int rainSoundTime; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 365ddeac7..7353e8026 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -846,17 +846,29 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) MemSect(31); if (minecraft->options->renderDebug) { + const int debugLeft = 1; + const int debugTop = 1; + const float maxContentWidth = 1200.f; + const float maxContentHeight = 420.f; + float scale = (float)(screenWidth - debugLeft - 8) / maxContentWidth; + float scaleV = (float)(screenHeight - debugTop - 80) / maxContentHeight; + if (scaleV < scale) scale = scaleV; + if (scale > 1.f) scale = 1.f; + if (scale < 0.5f) scale = 0.5f; glPushMatrix(); + glTranslatef((float)debugLeft, (float)debugTop, 0.f); + glScalef(scale, scale, 1.f); + glTranslatef((float)-debugLeft, (float)-debugTop, 0.f); if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0); - font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", iSafezoneXHalf+2, 20, 0xffffff); - font->drawShadow(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); - font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf+2, 32 + 10, 0xffffff); - font->drawShadow(minecraft->gatherStats2(), iSafezoneXHalf+2, 32 + 20, 0xffffff); - font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff); - font->drawShadow(minecraft->gatherStats4(), iSafezoneXHalf+2, 32 + 40, 0xffffff); + font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", debugLeft, debugTop, 0xffffff); + font->drawShadow(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed() ), debugLeft, debugTop + 12, 0xffffff); + font->drawShadow(minecraft->gatherStats1(), debugLeft, debugTop + 22, 0xffffff); + font->drawShadow(minecraft->gatherStats2(), debugLeft, debugTop + 32, 0xffffff); + font->drawShadow(minecraft->gatherStats3(), debugLeft, debugTop + 42, 0xffffff); + font->drawShadow(minecraft->gatherStats4(), debugLeft, debugTop + 52, 0xffffff); // TERRAIN FEATURES - int iYPos=82; + int iYPos = debugTop + 62; if(minecraft->level->dimension->id==0) { @@ -867,18 +879,31 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) wfeature[eTerrainFeature_Village] = L"Village: "; wfeature[eTerrainFeature_Ravine] = L"Ravine: "; - for(int i=0;iwidth(L"..."); + bool truncated[eTerrainFeature_Count] = {}; + + for (int i = 0; i < (int)app.m_vTerrainFeatures.size(); i++) { FEATURE_DATA *pFeatureData=app.m_vTerrainFeatures[i]; + int type = pFeatureData->eTerrainFeature; + if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine) continue; + if (truncated[type]) continue; wstring itemInfo = L"[" + std::to_wstring( pFeatureData->x*16 ) + L", " + std::to_wstring( pFeatureData->z*16 ) + L"] "; - wfeature[pFeatureData->eTerrainFeature] += itemInfo; + if (font->width(wfeature[type] + itemInfo) <= maxWForContent) + wfeature[type] += itemInfo; + else + { + wfeature[type] += L"..."; + truncated[type] = true; + } } for( int i = eTerrainFeature_Stronghold; i < (int) eTerrainFeature_Count; i++ ) { - font->drawShadow(wfeature[i], iSafezoneXHalf + 2, iYPos, 0xffffff); iYPos+=10; + font->drawShadow(wfeature[i], debugLeft, iYPos, 0xffffff); } } @@ -899,10 +924,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) double xBlockPos = floor(minecraft->player->x); double yBlockPos = floor(minecraft->player->y); double zBlockPos = floor(minecraft->player->z); - drawString(font, L"x: " + std::to_wstring(minecraft->player->x) + L"/ Head: " + std::to_wstring(static_cast(xBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->xChunk), iSafezoneXHalf+2, iYPos + 8 * 0, 0xe0e0e0); - drawString(font, L"y: " + std::to_wstring(minecraft->player->y) + L"/ Head: " + std::to_wstring(static_cast(yBlockPos)), iSafezoneXHalf+2, iYPos + 8 * 1, 0xe0e0e0); - drawString(font, L"z: " + std::to_wstring(minecraft->player->z) + L"/ Head: " + std::to_wstring(static_cast(zBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->zChunk), iSafezoneXHalf+2, iYPos + 8 * 2, 0xe0e0e0); - drawString(font, L"f: " + std::to_wstring(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3) + L"/ yRot: " + std::to_wstring(minecraft->player->yRot), iSafezoneXHalf+2, iYPos + 8 * 3, 0xe0e0e0); + drawString(font, L"x: " + std::to_wstring(minecraft->player->x) + L"/ Head: " + std::to_wstring(static_cast(xBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->xChunk), debugLeft, iYPos + 8 * 0, 0xe0e0e0); + drawString(font, L"y: " + std::to_wstring(minecraft->player->y) + L"/ Head: " + std::to_wstring(static_cast(yBlockPos)), debugLeft, iYPos + 8 * 1, 0xe0e0e0); + drawString(font, L"z: " + std::to_wstring(minecraft->player->z) + L"/ Head: " + std::to_wstring(static_cast(zBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->zChunk), debugLeft, iYPos + 8 * 2, 0xe0e0e0); + drawString(font, L"f: " + std::to_wstring(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3) + L"/ yRot: " + std::to_wstring(minecraft->player->yRot), debugLeft, iYPos + 8 * 3, 0xe0e0e0); iYPos += 8*4; int px = Mth::floor(minecraft->player->x); @@ -914,7 +939,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) Biome *biome = chunkAt->getBiome(px & 15, pz & 15, minecraft->level->getBiomeSource()); drawString( font, - L"b: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")", iSafezoneXHalf+2, iYPos, 0xe0e0e0); + L"b: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")", debugLeft, iYPos, 0xe0e0e0); } glPopMatrix(); @@ -971,7 +996,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_ALPHA_TEST); -#if defined(_WINDOWS64) +#if 0 // defined(_WINDOWS64) // Temporarily disable this chat in favor of iggy chat until we have better visual parity glPushMatrix(); glTranslatef(0.0f, static_cast(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); @@ -1448,7 +1473,7 @@ void Gui::displayClientMessage(int messageId, int iPad) } // 4J Added -void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning) +void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning) { int height = minecraft->height; // This causes us to cover xScale*dataLength pixels in the horizontal @@ -1487,7 +1512,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff000000 + cc * 256); } - __int64 aVal = dataA[i] / dataAScale; + int64_t aVal = dataA[i] / dataAScale; t->vertex((float)(xScale*i + 0.5f), (float)( height - aVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -1504,7 +1529,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff808080 + cc/2 * 256); } - __int64 bVal = dataB[i] / dataBScale; + int64_t bVal = dataB[i] / dataBScale; t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height - bVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -1515,7 +1540,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc glEnable(GL_TEXTURE_2D); } -void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ) +void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ) { int height = minecraft->height; @@ -1532,8 +1557,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int Tesselator *t = Tesselator::getInstance(); t->begin(GL_LINES); - __int64 thisVal = 0; - __int64 topVal = 0; + int64_t thisVal = 0; + int64_t topVal = 0; for (int i = 0; i < dataLength; i++) { thisVal = 0; diff --git a/Minecraft.Client/Gui.h b/Minecraft.Client/Gui.h index 9352308f3..60ea8b7c1 100644 --- a/Minecraft.Client/Gui.h +++ b/Minecraft.Client/Gui.h @@ -67,6 +67,6 @@ public: float getJukeboxOpacity(int iPad); // 4J Added - void renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning); - void renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ); + void renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning); + void renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ); }; diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp index 051ad8921..c1b4850c9 100644 --- a/Minecraft.Client/LevelRenderer.cpp +++ b/Minecraft.Client/LevelRenderer.cpp @@ -61,6 +61,7 @@ #include "..\Minecraft.World\SoundTypes.h" #include "FrustumCuller.h" #include "..\Minecraft.World\BasicTypeContainers.h" +#include "Common/UI/UIScene_SettingsGraphicsMenu.h" //#define DISABLE_SPU_CODE @@ -426,8 +427,11 @@ void LevelRenderer::allChanged(int playerIndex) Tile::leaves->setFancy(mc->options->fancyGraphics); lastViewDistance = mc->options->viewDistance; + int realviewDistance = UIScene_SettingsGraphicsMenu::LevelToDistance(3 - mc->options->viewDistance) + 2; + int realrenderArea = (realviewDistance * realviewDistance * 4); + // Calculate size of area we can render based on number of players we need to render for - int dist = (int)sqrtf( (float)PLAYER_RENDER_AREA / (float)activePlayers() ); + int dist = (int)sqrtf( (float)realrenderArea / (float)activePlayers() ); // AP - poor little Vita just can't cope with such a big area #ifdef __PSVITA__ @@ -2076,9 +2080,9 @@ bool LevelRenderer::updateDirtyChunks() if( bAtomic || (index == 0) ) { //PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); //app.DebugPrintf("Rebuilding permaChunk %d\n", index); @@ -2087,7 +2091,7 @@ bool LevelRenderer::updateDirtyChunks() if(index !=0) s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); @@ -2126,11 +2130,11 @@ bool LevelRenderer::updateDirtyChunks() static Chunk permaChunk; permaChunk.makeCopyForRebuild(chunk); LeaveCriticalSection(&m_csDirtyChunks); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); permaChunk.rebuild(); - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index 3279b8351..16d11705e 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -27,7 +27,7 @@ using namespace std; // AP - this is a system that works out which chunks actually need to be grouped together via the deferral system when doing chunk::rebuild. Doing this will reduce the number // of chunks built in a single group and reduce the chance of seeing through the landscape when digging near the edges/corners of a chunk. -// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have +// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have // split screen reference counting. #ifdef __PSVITA__ #define _CRITICAL_CHUNKS @@ -61,7 +61,7 @@ public: #elif defined __PS3__ static const int MAX_COMMANDBUFFER_ALLOCATIONS = 110 * 1024 * 1024; // 4J - added #else - static const int MAX_COMMANDBUFFER_ALLOCATIONS = 55 * 1024 * 1024; // 4J - added + static const int MAX_COMMANDBUFFER_ALLOCATIONS = 55 * 1024 * 1024; // 4J - added #endif public: LevelRenderer(Minecraft *mc, Textures *textures); @@ -216,7 +216,7 @@ public: // 4J - added for new render list handling // This defines the maximum size of renderable level, must be big enough to cope with actual size of level + view distance at each side // so that we can render the "infinite" sea at the edges - static const int MAX_LEVEL_RENDER_SIZE[3]; + static const int MAX_LEVEL_RENDER_SIZE[3]; static const int DIMENSION_OFFSETS[3]; // This is the TOTAL area of columns of chunks to be allocated for render round the players. So for one player, it would be a region of // sqrt(PLAYER_RENDER_AREA) x sqrt(PLAYER_RENDER_AREA) @@ -271,7 +271,7 @@ public: XLockFreeStack dirtyChunksLockFreeStack; bool dirtyChunkPresent; - __int64 lastDirtyChunkFound; + int64_t lastDirtyChunkFound; static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 125; // decreased from 250 to 125 - updated by detectiveren #ifdef _LARGE_WORLDS diff --git a/Minecraft.Client/LocalPlayer.h b/Minecraft.Client/LocalPlayer.h index 0a5b14b2e..2198c489e 100644 --- a/Minecraft.Client/LocalPlayer.h +++ b/Minecraft.Client/LocalPlayer.h @@ -52,12 +52,12 @@ public: virtual ~LocalPlayer(); int m_iScreenSection; // assuming 4player splitscreen for now, or -1 for single player - __uint64 ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft + uint64_t ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft // player tick, and a button press and release combo can be missed in the minecraft::tick - __uint64 ullDpad_last; - __uint64 ullDpad_this; - __uint64 ullDpad_filtered; + uint64_t ullDpad_last; + uint64_t ullDpad_this; + uint64_t ullDpad_filtered; // 4J-PB - moved these in from the minecraft structure, since they are per player things for splitscreen //int ticks; @@ -105,7 +105,7 @@ public: virtual void readAdditionalSaveData(CompoundTag *entityTag); virtual void closeContainer(); virtual void openTextEdit(shared_ptr sign); - virtual bool openContainer(shared_ptr container); // 4J added bool return + virtual bool openContainer(shared_ptr container); // 4J added bool return virtual bool openHopper(shared_ptr container); // 4J added bool return virtual bool openHopper(shared_ptr container); // 4J added bool return virtual bool openHorseInventory(shared_ptr horse, shared_ptr container); // 4J added bool return diff --git a/Minecraft.Client/MinecartRenderer.cpp b/Minecraft.Client/MinecartRenderer.cpp index fd907019e..34205d33f 100644 --- a/Minecraft.Client/MinecartRenderer.cpp +++ b/Minecraft.Client/MinecartRenderer.cpp @@ -23,7 +23,7 @@ void MinecartRenderer::render(shared_ptr _cart, double x, double y, doub bindTexture(cart); - __int64 seed = cart->entityId * 493286711l; + int64_t seed = cart->entityId * 493286711l; seed = seed * seed * 4392167121l + seed * 98761; float xo = ((((seed >> 16) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f; diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 38fbcf0dc..969c0708d 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -1552,7 +1552,7 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata" - NotUsing + Use Level3 ProgramDatabase Disabled @@ -1562,7 +1562,7 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata" MultiThreadedDebug _LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) Disabled - Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories) + Windows64\Iggy\include;$(ProjectDir);$(ProjectDir)..\include;%(AdditionalIncludeDirectories) true true Default @@ -1789,7 +1789,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUMultiThreaded _LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) Disabled - Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories) + Windows64\Iggy\include;$(ProjectDir);$(ProjectDir)..\include\;%(AdditionalIncludeDirectories) true true Default @@ -5588,6 +5588,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU + true true @@ -5720,7 +5721,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU - @@ -28325,6 +28325,9 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU + + $(ProjectDir)../include/;%(AdditionalIncludeDirectories) + true true @@ -28476,7 +28479,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU - diff --git a/Minecraft.Client/Minecraft.Client.vcxproj.filters b/Minecraft.Client/Minecraft.Client.vcxproj.filters index 0f02a16bc..23b754fa9 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj.filters +++ b/Minecraft.Client/Minecraft.Client.vcxproj.filters @@ -729,8 +729,11 @@ {e5d7fb24-25b8-413c-84ec-974bf0d4a3d1} - - {c79fd64d-7529-4da4-b5f3-2541e084932b} + + {d8cdea16-28f5-4993-baf8-26a129e50c84} + + + {70b1f1aa-fe50-4aab-9a6c-14df8cb1f231} @@ -3781,15 +3784,15 @@ Windows64\Source Files\Network - - Common\Source Files\Filesystem - Common\Source Files\Audio Common\Source Files\Audio + + Header Files + @@ -5943,8 +5946,8 @@ Windows64\Source Files\Network - - Common\Source Files\Filesystem + + include\lce_filesystem diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 232d63d42..f268ec50c 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -85,10 +85,10 @@ #define DISABLE_LEVELTICK_THREAD Minecraft *Minecraft::m_instance = NULL; -__int64 Minecraft::frameTimes[512]; -__int64 Minecraft::tickTimes[512]; +int64_t Minecraft::frameTimes[512]; +int64_t Minecraft::tickTimes[512]; int Minecraft::frameTimePos = 0; -__int64 Minecraft::warezTime = 0; +int64_t Minecraft::warezTime = 0; File Minecraft::workDir = File(L""); #ifdef __PSVITA__ @@ -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 requirements + // 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 // to know the real physical dimensions of the frame buffer. if( RenderManager.IsWidescreen() ) { @@ -635,7 +635,7 @@ void Minecraft::run() return; } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); int frames = 0; while (running) @@ -660,7 +660,7 @@ void Minecraft::run() timer->advanceTime(); } - __int64 beforeTickTime = System::nanoTime(); + int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { ticks++; @@ -672,7 +672,7 @@ void Minecraft::run() // setScreen(new LevelConflictScreen()); // } } - __int64 tickDuraction = System::nanoTime() - beforeTickTime; + int64_t tickDuraction = System::nanoTime() - beforeTickTime; checkGlError(L"Pre render"); TileRenderer::fancy = options->fancyGraphics; @@ -1240,7 +1240,7 @@ void Minecraft::applyFrameMouseLook() void Minecraft::run_middle() { - static __int64 lastTime = 0; + static int64_t lastTime = 0; static bool bFirstTimeIntoGame = true; static bool bAutosaveTimerSet=false; static unsigned int uiAutosaveTimer=0; @@ -1480,13 +1480,31 @@ void Minecraft::run_middle() localplayers[i]->ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullDpad_last = 0; @@ -1804,7 +1822,7 @@ void Minecraft::run_middle() timer->advanceTime(); } - //__int64 beforeTickTime = System::nanoTime(); + //int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { bool bLastTimerTick = ( i == ( timer->ticks - 1 ) ); @@ -1890,7 +1908,7 @@ void Minecraft::run_middle() // CompressedTileStorage::tick(); // 4J added // SparseDataStorage::tick(); // 4J added } - //__int64 tickDuraction = System::nanoTime() - beforeTickTime; + //int64_t tickDuraction = System::nanoTime() - beforeTickTime; MemSect(31); checkGlError(L"Pre render"); MemSect(0); @@ -2095,14 +2113,14 @@ void Minecraft::emergencySave() setLevel(NULL); } -void Minecraft::renderFpsMeter(__int64 tickTime) +void Minecraft::renderFpsMeter(int64_t tickTime) { int nsPer60Fps = 1000000000l / 60; if (lastTimer == -1) { lastTimer = System::nanoTime(); } - __int64 now = System::nanoTime(); + int64_t now = System::nanoTime(); Minecraft::tickTimes[(Minecraft::frameTimePos) & (Minecraft::frameTimes_length - 1)] = tickTime; Minecraft::frameTimes[(Minecraft::frameTimePos++) & (Minecraft::frameTimes_length - 1)] = now - lastTimer; lastTimer = now; @@ -2134,7 +2152,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->vertex((float)(Minecraft::frameTimes_length), (float)( height - hh1 * 2), (float)( 0)); t->end(); - __int64 totalTime = 0; + int64_t totalTime = 0; for (int i = 0; i < Minecraft::frameTimes_length; i++) { totalTime += Minecraft::frameTimes[i]; @@ -2164,8 +2182,8 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->color(0xff000000 + cc * 256); } - __int64 time = Minecraft::frameTimes[i] / 200000; - __int64 time2 = Minecraft::tickTimes[i] / 200000; + int64_t time = Minecraft::frameTimes[i] / 200000; + int64_t time2 = Minecraft::tickTimes[i] / 200000; t->vertex((float)(i + 0.5f), (float)( height - time + 0.5f), (float)( 0)); t->vertex((float)(i + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -3651,7 +3669,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if (player->missTime > 0) player->missTime--; -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG//_MENUS_ENABLED // disable DPad cheats on release builds if(app.DebugSettingsOn()) { #ifndef __PSVITA__ @@ -3759,7 +3777,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) player->drop(); } - __uint64 ullButtonsPressed=player->ullButtonsPressed; + uint64_t ullButtonsPressed=player->ullButtonsPressed; bool selected = false; #ifdef __PSVITA__ @@ -4314,7 +4332,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt } #endif #ifdef _WINDOWS64 - // On Windows, the implementation has been changed to use a per-client pseudo XUID based on `uid.dat`. + // On Windows, the implementation has been changed to use a per-client pseudo XUID based on `uid.dat`. // To maintain player data compatibility with existing worlds, the world host (the first player) will use the previous embedded pseudo XUID. INetworkPlayer *localNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(iPrimaryPlayer); if(localNetworkPlayer != NULL && localNetworkPlayer->IsHost()) @@ -4815,7 +4833,7 @@ void Minecraft::delayTextureReload() reloadTextures = true; } -__int64 Minecraft::currentTimeMillis() +int64_t Minecraft::currentTimeMillis() { return System::currentTimeMillis();//(Sys.getTime() * 1000) / Sys.getTimerResolution(); } diff --git a/Minecraft.Client/Minecraft.h b/Minecraft.Client/Minecraft.h index cc1e5d18a..91c20c142 100644 --- a/Minecraft.Client/Minecraft.h +++ b/Minecraft.Client/Minecraft.h @@ -75,7 +75,7 @@ private: bool hasCrashed; C4JThread::EventQueue* levelTickEventQueue; - + static void levelTickUpdateFunc(void* pParam); static void levelTickThreadInitFunc(); @@ -170,11 +170,11 @@ private: LevelStorageSource *levelSource; public: static const int frameTimes_length = 512; - static __int64 frameTimes[frameTimes_length]; + static int64_t frameTimes[frameTimes_length]; static const int tickTimes_length = 512; - static __int64 tickTimes[tickTimes_length]; + static int64_t tickTimes[tickTimes_length]; static int frameTimePos; - static __int64 warezTime; + static int64_t warezTime; private: int rightClickDelay; public: @@ -230,9 +230,9 @@ private: // String grabHugeScreenshot(File workDir2, int width, int height, int ssWidth, int ssHeight); // 4J - removed // 4J - per player thing? - __int64 lastTimer; + int64_t lastTimer; - void renderFpsMeter(__int64 tickTime); + void renderFpsMeter(int64_t tickTime); public: void stop(); // 4J removed @@ -253,7 +253,7 @@ public: //bool isRaining ; // 4J - Moved to per player - //__int64 lastTickTime; + //int64_t lastTickTime; private: // 4J- per player? @@ -300,7 +300,7 @@ public: static int maxSupportedTextureSize(); void delayTextureReload(); - static __int64 currentTimeMillis(); + static int64_t currentTimeMillis(); #ifdef _DURANGO static void inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad); diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 012ae19bd..55b02cb98 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -68,15 +68,15 @@ //4J Added MinecraftServer *MinecraftServer::server = NULL; bool MinecraftServer::setTimeAtEndOfTick = false; -__int64 MinecraftServer::setTime = 0; +int64_t MinecraftServer::setTime = 0; bool MinecraftServer::setTimeOfDayAtEndOfTick = false; -__int64 MinecraftServer::setTimeOfDay = 0; +int64_t MinecraftServer::setTimeOfDay = 0; bool MinecraftServer::m_bPrimaryPlayerSignedOut=false; bool MinecraftServer::s_bServerHalted=false; bool MinecraftServer::s_bSaveOnExitAnswered=false; #ifdef _ACK_CHUNK_SEND_THROTTLING bool MinecraftServer::s_hasSentEnoughPackets = false; -__int64 MinecraftServer::s_tickStartTime = 0; +int64_t MinecraftServer::s_tickStartTime = 0; vector MinecraftServer::s_sentTo; #else int MinecraftServer::s_slowQueuePlayerIndex = 0; @@ -581,7 +581,7 @@ MinecraftServer::~MinecraftServer() DeleteCriticalSection(&m_consoleInputCS); } -bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed) +bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed) { // 4J - removed #if 0 @@ -682,6 +682,12 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW } #endif setPlayers(new PlayerList(this)); +#ifdef _WINDOWS64 + { + int maxP = getPlayerList()->getMaxPlayers(); + WinsockNetLayer::UpdateAdvertiseMaxPlayers((BYTE)(maxP > 255 ? 255 : maxP)); + } +#endif // 4J-JEV: Need to wait for levelGenerationOptions to load. while ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->hasLoadedData() ) @@ -692,7 +698,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW // TODO: Stop loading, add error message. } - __int64 levelNanoTime = System::nanoTime(); + int64_t levelNanoTime = System::nanoTime(); wstring levelName = (initData && !initData->levelName.empty()) ? initData->levelName : GetDedicatedServerString(settings, L"level-name", L"world"); wstring levelTypeString; @@ -736,10 +742,10 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW #if 0 wstring levelSeedString = settings->getString(L"level-seed", L""); - __int64 levelSeed = (new Random())->nextLong(); + int64_t levelSeed = (new Random())->nextLong(); if (levelSeedString.length() > 0) { - long newSeed = _fromString<__int64>(levelSeedString); + long newSeed = _fromString(levelSeedString); if (newSeed != 0) { levelSeed = newSeed; } @@ -866,7 +872,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress) DeleteCriticalSection(&m_postProcessCS); } -bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) +bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) { // 4J - TODO - do with new save stuff // if (storageSource->requiresConversion(name)) @@ -1016,7 +1022,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring m_postUpdateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); m_postUpdateThread->Run(); - __int64 startTime = System::currentTimeMillis(); + int64_t startTime = System::currentTimeMillis(); // 4J Stu - Added this to temporarily make starting games on vita faster #ifdef __PSVITA__ @@ -1046,7 +1052,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring csf->closeHandle(fe); } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); #ifdef _LARGE_WORLDS if(app.GetGameNewWorldSize() > levels[0]->getLevelData()->getXZSizeOld()) { @@ -1074,7 +1080,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } #if 0 - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); // Test code to enable full creation of levels at start up int halfsidelen = ( i == 0 ) ? 27 : 9; @@ -1097,7 +1103,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } } #else - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); Pos *spawnPos = level->getSharedSpawnPos(); int twoRPlusOne = r*2 + 1; @@ -1114,7 +1120,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring return false; } // printf(">>>%d %d %d\n",i,x,z); - // __int64 now = System::currentTimeMillis(); + // int64_t now = System::currentTimeMillis(); // if (now < lastTime) lastTime = now; // if (now > lastTime + 1000) { @@ -1679,7 +1685,7 @@ bool MinecraftServer::getForceGameType() return forceGameType; } -__int64 MinecraftServer::getCurrentTimeMillis() +int64_t MinecraftServer::getCurrentTimeMillis() { return System::currentTimeMillis(); } @@ -1695,7 +1701,7 @@ void MinecraftServer::setPlayerIdleTimeout(int playerIdleTimeout) } extern int c0a, c0b, c1a, c1b, c1c, c2a, c2b; -void MinecraftServer::run(__int64 seed, void *lpParameter) +void MinecraftServer::run(int64_t seed, void *lpParameter) { NetworkGameInitData *initData = NULL; DWORD initSettings = 0; @@ -1728,18 +1734,18 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } } - __int64 lastTime = getCurrentTimeMillis(); - __int64 unprocessedTime = 0; + int64_t lastTime = getCurrentTimeMillis(); + int64_t unprocessedTime = 0; while (running && !s_bServerHalted) { - __int64 now = getCurrentTimeMillis(); + int64_t now = getCurrentTimeMillis(); // 4J Stu - When we pause the server, we don't want to count that as time passed // 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused //Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost //if(m_isServerPaused) lastTime = now; - __int64 passedTime = now - lastTime; + int64_t passedTime = now - lastTime; if (passedTime > MS_PER_TICK * 40) { // logger.warning("Can't keep up! Did the system time change, or is the server overloaded?"); @@ -1765,19 +1771,19 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) else { // int tickcount = 0; - // __int64 beforeall = System::currentTimeMillis(); + // int64_t beforeall = System::currentTimeMillis(); while (unprocessedTime > MS_PER_TICK) { unprocessedTime -= MS_PER_TICK; chunkPacketManagement_PreTick(); -// __int64 before = System::currentTimeMillis(); +// int64_t before = System::currentTimeMillis(); tick(); -// __int64 after = System::currentTimeMillis(); +// int64_t after = System::currentTimeMillis(); // PIXReportCounter(L"Server time",(float)(after-before)); chunkPacketManagement_PostTick(); } -// __int64 afterall = System::currentTimeMillis(); +// int64_t afterall = System::currentTimeMillis(); // PIXReportCounter(L"Server time all",(float)(afterall-beforeall)); // PIXReportCounter(L"Server ticks",(float)tickcount); } @@ -2119,15 +2125,15 @@ void MinecraftServer::tick() players->broadcastAll( shared_ptr( new SetTimePacket(level->getGameTime(), level->getDayTime(), level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT) ) ), level->dimension->id); } // #ifndef __PS3__ - static __int64 stc = 0; - __int64 st0 = System::currentTimeMillis(); + static int64_t stc = 0; + int64_t st0 = System::currentTimeMillis(); PIXBeginNamedEvent(0,"Level tick %d",i); ((Level *)level)->tick(); - __int64 st1 = System::currentTimeMillis(); + int64_t st1 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Update lights %d",i); - __int64 st2 = System::currentTimeMillis(); + int64_t st2 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Entity tick %d",i); // 4J added to stop ticking entities in levels when players are not in those levels. @@ -2155,7 +2161,7 @@ void MinecraftServer::tick() level->getTracker()->tick(); PIXEndNamedEvent(); - __int64 st3 = System::currentTimeMillis(); + int64_t st3 = System::currentTimeMillis(); // printf(">>>>>>>>>>>>>>>>>>>>>> Tick %d %d %d : %d\n", st1 - st0, st2 - st1, st3 - st2, st0 - stc ); stc = st0; // #endif// __PS3__ @@ -2206,7 +2212,7 @@ void MinecraftServer::handleConsoleInputs() } } -void MinecraftServer::main(__int64 seed, void *lpParameter) +void MinecraftServer::main(int64_t seed, void *lpParameter) { #if __PS3__ ShutdownManager::HasStarted(ShutdownManager::eServerThread ); @@ -2286,7 +2292,7 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player) void MinecraftServer::chunkPacketManagement_DidSendTo(INetworkPlayer *player) { - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); if( ( currentTime - s_tickStartTime ) >= MAX_TICK_TIME_FOR_PACKET_SENDS ) { @@ -2347,15 +2353,19 @@ void MinecraftServer::chunkPacketManagement_PostTick() } #else -// 4J Added +// 4J Added - round-robin chunk sends by player index. Compare vs the player at the current queue index, +// not GetSessionIndex() (smallId), so reused smallIds after many connect/disconnects still get chunk sends. bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player) { if( player == NULL ) return false; int time = GetTickCount(); - if( player->GetSessionIndex() == s_slowQueuePlayerIndex && (time - s_slowQueueLastTime) > MINECRAFT_SERVER_SLOW_QUEUE_DELAY ) + DWORD currentPlayerCount = g_NetworkManager.GetPlayerCount(); + if( currentPlayerCount == 0 ) return false; + int index = s_slowQueuePlayerIndex % (int)currentPlayerCount; + INetworkPlayer *queuePlayer = g_NetworkManager.GetPlayerByIndex( index ); + if( queuePlayer != NULL && (player == queuePlayer || player->IsSameSystem(queuePlayer)) && (time - s_slowQueueLastTime) > MINECRAFT_SERVER_SLOW_QUEUE_DELAY ) { -// app.DebugPrintf("Slow queue OK for player #%d\n", player->GetSessionIndex()); return true; } diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index 7fa8c7522..289097912 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -18,7 +18,11 @@ class LevelType; class ProgressRenderer; class CommandDispatcher; +#if defined(_WINDOWS64) +#define MINECRAFT_SERVER_SLOW_QUEUE_DELAY 0 // Removed slow queue because at large player counts, chunks stopped appearing +#else #define MINECRAFT_SERVER_SLOW_QUEUE_DELAY 250 +#endif #if defined _XBOX_ONE || defined _XBOX || defined __ORBIS__ || defined __PS3__ || defined __PSVITA__ #define _ACK_CHUNK_SEND_THROTTLING @@ -27,14 +31,14 @@ class CommandDispatcher; typedef struct _LoadSaveDataThreadParam { LPVOID data; - __int64 fileSize; + int64_t fileSize; const wstring saveName; - _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} + _LoadSaveDataThreadParam(LPVOID data, int64_t filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} } LoadSaveDataThreadParam; typedef struct _NetworkGameInitData { - __int64 seed; + int64_t seed; LoadSaveDataThreadParam *saveData; DWORD settings; LevelGenerationOptions *levelGen; @@ -133,9 +137,9 @@ public: ~MinecraftServer(); private: // 4J Added - LoadSaveDataThreadParam - bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); + bool initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer *mcprogress); - bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); + bool loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); void setProgress(const wstring& status, int progress); void endProgress(); void saveAllChunks(); @@ -171,13 +175,13 @@ public: bool isUnderSpawnProtection(Level *level, int x, int y, int z, shared_ptr player); void setForceGameType(bool forceGameType); bool getForceGameType(); - static __int64 getCurrentTimeMillis(); + static int64_t getCurrentTimeMillis(); int getPlayerIdleTimeout(); void setPlayerIdleTimeout(int playerIdleTimeout); public: void halt(); - void run(__int64 seed, void *lpParameter); + void run(int64_t seed, void *lpParameter); void broadcastStartSavingPacket(); void broadcastStopSavingPacket(); @@ -188,7 +192,7 @@ public: void handleConsoleInput(const wstring& msg, ConsoleInputSource *source); void handleConsoleInputs(); // void addTickable(Tickable tickable); // 4J removed - static void main(__int64 seed, void *lpParameter); + static void main(int64_t seed, void *lpParameter); static void HaltServer(bool bPrimaryPlayerSignedOut=false); File *getFile(const wstring& name); @@ -208,9 +212,9 @@ private: static MinecraftServer *server; static bool setTimeOfDayAtEndOfTick; - static __int64 setTimeOfDay; + static int64_t setTimeOfDay; static bool setTimeAtEndOfTick; - static __int64 setTime; + static int64_t setTime; static bool m_bPrimaryPlayerSignedOut; // 4J-PB added to tell the stopserver not to save the game - another player may have signed in in their place, so ProfileManager.IsSignedIn isn't enough static bool s_bServerHalted; // 4J Stu Added so that we can halt the server even before it's been created properly @@ -234,9 +238,9 @@ public: public: static PlayerList *getPlayerList() { if( server != NULL ) return server->players; else return NULL; } - static void SetTimeOfDay(__int64 time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } - static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; } - + static void SetTimeOfDay(int64_t time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } + static void SetTime(int64_t time) { setTimeAtEndOfTick = true; setTime = time; } + C4JThread::Event* m_serverPausedEvent; private: // 4J Added @@ -245,7 +249,7 @@ private: // 4J Added - A static that stores the QNet index of the player that is next allowed to send a packet in the slow queue #ifdef _ACK_CHUNK_SEND_THROTTLING static bool s_hasSentEnoughPackets; - static __int64 s_tickStartTime; + static int64_t s_tickStartTime; static vector s_sentTo; static const int MAX_TICK_TIME_FOR_PACKET_SENDS = 35; #else @@ -267,7 +271,7 @@ public: #ifndef _ACK_CHUNK_SEND_THROTTLING static void cycleSlowQueueIndex(); #endif - + void chunkPacketManagement_PreTick(); void chunkPacketManagement_PostTick(); @@ -275,5 +279,5 @@ public: void Suspend(); bool IsSuspending(); - // 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them + // 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them }; diff --git a/Minecraft.Client/MultiPlayerLevel.cpp b/Minecraft.Client/MultiPlayerLevel.cpp index 86b2914f2..29d88b8d7 100644 --- a/Minecraft.Client/MultiPlayerLevel.cpp +++ b/Minecraft.Client/MultiPlayerLevel.cpp @@ -789,7 +789,7 @@ void MultiPlayerLevel::setScoreboard(Scoreboard *scoreboard) this->scoreboard = scoreboard; } -void MultiPlayerLevel::setDayTime(__int64 newTime) +void MultiPlayerLevel::setDayTime(int64_t newTime) { // 4J: We send daylight cycle rule with host options so don't need this /*if (newTime < 0) diff --git a/Minecraft.Client/MultiPlayerLevel.h b/Minecraft.Client/MultiPlayerLevel.h index 6e5b00865..a552fc2b1 100644 --- a/Minecraft.Client/MultiPlayerLevel.h +++ b/Minecraft.Client/MultiPlayerLevel.h @@ -94,7 +94,7 @@ public: virtual void createFireworks(double x, double y, double z, double xd, double yd, double zd, CompoundTag *infoTag); virtual void setScoreboard(Scoreboard *scoreboard); - virtual void setDayTime(__int64 newTime); + virtual void setDayTime(int64_t newTime); // 4J Stu - Added so we can have multiple local connections void addClientConnection(ClientConnection *c) { connections.push_back( c ); } diff --git a/Minecraft.Client/Options.cpp b/Minecraft.Client/Options.cpp index fac7fe13e..35857b896 100644 --- a/Minecraft.Client/Options.cpp +++ b/Minecraft.Client/Options.cpp @@ -238,6 +238,10 @@ void Options::set(const Options::Option *item, float fVal) { gamma = fVal; } + if (item == Option::RENDER_DISTANCE) + { + viewDistance = fVal; + } } void Options::toggle(const Options::Option *option, int dir) @@ -292,6 +296,7 @@ float Options::getProgressValue(const Options::Option *item) if (item == Option::MUSIC) return music; if (item == Option::SOUND) return sound; if (item == Option::SENSITIVITY) return sensitivity; + if (item == Option::RENDER_DISTANCE) return viewDistance; return 0; } diff --git a/Minecraft.Client/Orbis/Iggy/include/gdraw.h b/Minecraft.Client/Orbis/Iggy/include/gdraw.h index e959d788e..607843266 100644 --- a/Minecraft.Client/Orbis/Iggy/include/gdraw.h +++ b/Minecraft.Client/Orbis/Iggy/include/gdraw.h @@ -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 requirements. + functions Iggy requires. */ RADDEFEND diff --git a/Minecraft.Client/Orbis/Iggy/include/rrCore.h b/Minecraft.Client/Orbis/Iggy/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/Orbis/Iggy/include/rrCore.h +++ b/Minecraft.Client/Orbis/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Orbis/Miles/include/mss.h b/Minecraft.Client/Orbis/Miles/include/mss.h index 162451b2d..80be1aa3a 100644 --- a/Minecraft.Client/Orbis/Miles/include/mss.h +++ b/Minecraft.Client/Orbis/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned long long ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -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() requirements at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -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 uint8_t count the asset requirements if fully loaded. + $:DataLen The uint8_t count the asset requires 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 uint8_t 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 @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/Orbis/Miles/include/rrCore.h b/Minecraft.Client/Orbis/Miles/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/Orbis/Miles/include/rrCore.h +++ b/Minecraft.Client/Orbis/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp index 078b9d7c2..a3139adf6 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp @@ -21,8 +21,8 @@ int (* SQRNetworkManager_Orbis::s_SignInCompleteCallbackFn)(void *pParam, bool b void * SQRNetworkManager_Orbis::s_SignInCompleteParam = NULL; sce::Toolkit::NP::PresenceDetails SQRNetworkManager_Orbis::s_lastPresenceInfo; -__int64 SQRNetworkManager_Orbis::s_lastPresenceTime = 0; -__int64 SQRNetworkManager_Orbis::s_resendPresenceTime = 0; +int64_t SQRNetworkManager_Orbis::s_lastPresenceTime = 0; +int64_t SQRNetworkManager_Orbis::s_resendPresenceTime = 0; bool SQRNetworkManager_Orbis::s_presenceStatusDirty = false; bool SQRNetworkManager_Orbis::s_presenceDataDirty = false; @@ -233,7 +233,7 @@ void SQRNetworkManager_Orbis::Terminate() } while( m_basicEventThread->isRunning() ); } -// 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 +// 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 // 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 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. +// 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. 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 requirements etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires 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 requirements etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requires 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 requirements 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 requires 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 requirements 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 requires 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 requirements. 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 requires. 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 ) { diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h index 5b19f63ec..cb7cafa94 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h @@ -29,7 +29,7 @@ class SQRNetworkManager_Orbis : public SQRNetworkManager public: SQRNetworkManager_Orbis(ISQRNetworkManagerListener *listener); - // General + // General void Tick(); void Initialise(); void Terminate(); @@ -111,7 +111,7 @@ private: bool m_offlineSQR; int m_resendExternalRoomDataCountdown; bool m_matching2initialised; - PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES]; + PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES]; int m_inviteIndex; static PresenceSyncInfo *m_gameBootInvite; static PresenceSyncInfo m_gameBootInvite_data; @@ -222,9 +222,9 @@ private: std::vector m_aFriendSearchResults; // Rudp management and local players - std::unordered_map m_RudpCtxToPlayerMap; + std::unordered_map m_RudpCtxToPlayerMap; - std::unordered_map m_NetAddrToVoiceConnectionMap; + std::unordered_map m_NetAddrToVoiceConnectionMap; bool CreateRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask, SceNpMatching2RoomMemberId playersPeerMemberId); bool CreateVoiceRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask); @@ -325,8 +325,8 @@ private: static sce::Toolkit::NP::PresenceDetails s_lastPresenceInfo; static const int MIN_PRESENCE_RESEND_TIME = 30 * 1000; // Minimum presence send rate - doesn't seem possible to find out what this actually should be - static __int64 s_lastPresenceTime; - static __int64 s_resendPresenceTime; + static int64_t s_lastPresenceTime; + static int64_t s_resendPresenceTime; static bool s_presenceStatusDirty; static bool s_presenceDataDirty; @@ -337,7 +337,7 @@ private: // Debug static long long s_roomStartTime; - + // Error dialog static bool s_errorDialogRunning; diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp index d3a21ac4f..661a15284 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp @@ -24,9 +24,9 @@ int32_t hBGMAudio; //static char sc_loadPath[] = {"/app0/"}; //const char* getConsoleHomePath() { return sc_loadPath; } -char* getUsrDirPath() -{ - return usrdirPath; +char* getUsrDirPath() +{ + return usrdirPath; } @@ -34,7 +34,7 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src ) { wchar_t f,l; - // validation section + // validation section // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); @@ -61,7 +61,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) } -VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) +VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) { SceRtcDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -78,8 +78,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) } BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { ORBIS_STUBBED; return false; } BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { ORBIS_STUBBED; return false; } -VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ +VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) +{ SceRtcDateTime dateTime; int err = sceRtcGetCurrentClockLocalTime(&dateTime); assert(err == SCE_OK ); @@ -95,21 +95,21 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) } HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { ORBIS_STUBBED; return NULL; } -VOID Sleep(DWORD dwMilliseconds) -{ +VOID Sleep(DWORD dwMilliseconds) +{ C4JThread::Sleep(dwMilliseconds); } BOOL SetThreadPriority(HANDLE hThread, int nPriority) { ORBIS_STUBBED; return FALSE; } DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { ORBIS_STUBBED; return false; } -LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) -{ +LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) +{ return sceAtomicCompareAndSwap32((int32_t*)Destination, (int32_t)Comperand, (int32_t)Exchange); } -LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) -{ +LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) +{ return sceAtomicCompareAndSwap64((int64_t*)Destination, (int64_t)Comperand, (int64_t)Exchange); } @@ -135,10 +135,10 @@ VOID OrbisInit() sceSysmoduleLoadModule(SCE_SYSMODULE_RUDP); sceSysmoduleLoadModule(SCE_SYSMODULE_NP_MATCHING2); sceSysmoduleLoadModule(SCE_SYSMODULE_INVITATION_DIALOG); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY ); - sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG ); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING ); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY ); + sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH ); sceSysmoduleLoadModule(SCE_SYSMODULE_NP_COMMERCE); sceSysmoduleLoadModule(SCE_SYSMODULE_REMOTE_PLAY); sceSysmoduleLoadModule(SCE_SYSMODULE_ERROR_DIALOG); @@ -173,7 +173,7 @@ VOID OrbisInit() hBGMAudio=sceAudioOutOpen( SCE_USER_SERVICE_USER_ID_SYSTEM, SCE_AUDIO_OUT_PORT_TYPE_BGM,0, - 256, + 256, 48000, 2); @@ -195,7 +195,7 @@ int32_t GetAudioBGMHandle() return hBGMAudio; } -VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { char name[1] = {0}; @@ -209,7 +209,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) +VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) { InitializeCriticalSection(CriticalSection); } @@ -220,9 +220,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection) assert(err == SCE_OK); } -extern CRITICAL_SECTION g_singleThreadCS; +extern CRITICAL_SECTION g_singleThreadCS; -VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = scePthreadMutexLock(&CriticalSection->mutex); assert(err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK ); @@ -240,7 +240,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { if(--CriticalSection->m_cLock == 0 ) { @@ -255,7 +255,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) { - int err = scePthreadMutexTrylock(&CriticalSection->mutex); + int err = scePthreadMutexTrylock(&CriticalSection->mutex); if((err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK )) { CriticalSection->m_cLock++; @@ -266,20 +266,20 @@ ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds) { ORBIS_STUBBED; return 0; } -BOOL CloseHandle(HANDLE hObject) -{ +BOOL CloseHandle(HANDLE hObject) +{ sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)hObject)); return true; -// ORBIS_STUBBED; -// return false; +// ORBIS_STUBBED; +// return false; } BOOL SetEvent(HANDLE hEvent) { ORBIS_STUBBED; return false; } HMODULE GetModuleHandle(LPCSTR lpModuleName) { ORBIS_STUBBED; return 0; } -DWORD GetCurrentThreadId(VOID) -{ +DWORD GetCurrentThreadId(VOID) +{ return 0; // TODO } DWORD WaitForMultipleObjectsEx(DWORD nCount,CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds,BOOL bAlertable ) { ORBIS_STUBBED; return 0; } @@ -302,10 +302,10 @@ public: void* m_virtualAddr; uint64_t m_size; - PageInfo(off_t physAddr, void* virtualAddr, uint64_t size) + PageInfo(off_t physAddr, void* virtualAddr, uint64_t size) : m_physAddr(physAddr) , m_virtualAddr(virtualAddr) - , m_size(size) + , m_size(size) {} }; void* m_virtualAddr; @@ -313,7 +313,7 @@ public: std::vector m_pagesAllocated; uint64_t m_allocatedSize; - OrbisVAlloc(void* addr, uint64_t size) + OrbisVAlloc(void* addr, uint64_t size) : m_virtualAddr(addr) , m_virtualSize(size) , m_allocatedSize(0) @@ -331,7 +331,7 @@ public: { uint64_t sizeToAdd = size - m_allocatedSize; // the extra memory size that we have to add on assert(sizeToAdd >= 0); - + if(sizeToAdd == 0) return m_virtualAddr; // nothing to add @@ -393,8 +393,8 @@ public: static std::vector s_orbisVAllocs; -LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ +LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ if(lpAddress == NULL) { void *pAddr = (void*)SCE_KERNEL_APP_MAP_AREA_START_ADDR; @@ -446,14 +446,14 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) else if(dwFreeType == MEM_RELEASE) { delete s_orbisVAllocs[idx]; - s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx); + s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx); } return TRUE; } -DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) -{ +DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) +{ SceFiosSize FileSize; SceFiosFH fh = (SceFiosFH)((int64_t)hFile); //DWORD FileSizeLow; @@ -468,15 +468,15 @@ DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) return (DWORD)FileSize; } -BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize ) -{ +BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize ) +{ SceFiosSize FileSize; SceFiosFH fh = (SceFiosFH)((int64_t)hFile); FileSize=sceFiosFHGetSize(fh); lpFileSize->QuadPart=FileSize; - return true; + return true; } BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped ) @@ -496,7 +496,7 @@ BOOL WriteFile( } } -BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) +BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) { SceFiosFH fh = (SceFiosFH)((int64_t)hFile); // sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes. @@ -537,7 +537,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -549,7 +549,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, strcpy(filePath, lpFileName ); else sprintf(filePath,"%s/%s",getUsrDirPath(), lpFileName ); - + #ifndef _CONTENT_PACKAGE app.DebugPrintf("*** Opening %s\n",filePath); #endif @@ -557,9 +557,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, SceFiosFH fh; SceFiosOpenParams openParams; ZeroMemory(&openParams, sizeof(SceFiosOpenParams)); - + switch(dwDesiredAccess) - { + { case GENERIC_READ: openParams.openFlags = SCE_FIOS_O_RDONLY; break; case GENERIC_WRITE: @@ -588,21 +588,21 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return INVALID_HANDLE_VALUE; } //assert( err == SCE_FIOS_OK ); - + return (void*)fh; } BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes){ ORBIS_STUBBED; return false; } BOOL DeleteFileA(LPCSTR lpFileName) { ORBIS_STUBBED; return false; } -// BOOL XCloseHandle(HANDLE a) +// BOOL XCloseHandle(HANDLE a) // { // sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)a)); // return true; // } -DWORD GetFileAttributesA(LPCSTR lpFileName) +DWORD GetFileAttributesA(LPCSTR lpFileName) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -633,7 +633,7 @@ BOOL MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName) { ORBIS_STUBBED; DWORD GetLastError(VOID) { ORBIS_STUBBED; return 0; } -VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) +VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { SceLibcMallocManagedSize stat; int err = malloc_stats(&stat); @@ -647,20 +647,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) lpBuffer->dwAvailVirtual = stat.maxSystemSize - stat.currentInuseSize; } -DWORD GetTickCount() +DWORD GetTickCount() { - // This function returns the current system time at this function is called. + // This function returns the current system time at this function is called. // The system time is represented the time elapsed since the system starts up in microseconds. uint64_t sysTime = sceKernelGetProcessTime(); - return (DWORD)(sysTime / 1000); + return (DWORD)(sysTime / 1000); } // we should really use libperf for this kind of thing, but this will do for now. -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) -{ +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ // microseconds - lpFrequency->QuadPart = (1000 * 1000); - return false; + lpFrequency->QuadPart = (1000 * 1000); + return false; } BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { @@ -671,24 +671,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) #ifndef _FINAL_BUILD -VOID OutputDebugStringW(LPCWSTR lpOutputString) -{ - wprintf(lpOutputString); +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + wprintf(lpOutputString); } -VOID OutputDebugStringA(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + printf(lpOutputString); } -VOID OutputDebugString(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugString(LPCSTR lpOutputString) +{ + printf(lpOutputString); } #endif // _CONTENT_PACKAGE BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation) -{ +{ ORBIS_STUBBED; return false; } @@ -696,15 +696,15 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { ORB BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { ORBIS_STUBBED; return false;} errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } -DWORD XGetLanguage() -{ +DWORD XGetLanguage() +{ unsigned char ucLang = app.GetMinecraftLanguage(0); int iLang; // check if we should override the system language or not - if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) + if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) { sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang); } @@ -747,8 +747,8 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() -{ +DWORD XGetLocale() +{ int iLang; sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang); switch(iLang) @@ -784,7 +784,7 @@ DWORD XGetLocale() } } -DWORD XEnableGuestSignin(BOOL fEnable) -{ - return 0; +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; } \ No newline at end of file diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h index da9f872f9..390a08976 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h @@ -14,7 +14,7 @@ DWORD TlsAlloc(VOID); LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -37,16 +37,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -214,7 +214,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -256,17 +256,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -286,38 +286,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -356,9 +356,9 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h index a954e4a74..4c42bcb4a 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h @@ -1,6 +1,6 @@ #pragma once -//#include "winerror.h" +#include typedef unsigned int DWORD; typedef int BOOL; @@ -33,9 +33,6 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char uint8_t; -typedef long __int64; -typedef unsigned long __uint64; typedef unsigned int DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; diff --git a/Minecraft.Client/Orbis/OrbisExtras/winerror.h b/Minecraft.Client/Orbis/OrbisExtras/winerror.h index f25db115e..80c7a7e9c 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/winerror.h +++ b/Minecraft.Client/Orbis/OrbisExtras/winerror.h @@ -2704,7 +2704,7 @@ // // MessageText: // -// The specified program requirements a newer version of Windows. +// The specified program requires a newer version of Windows. // #define ERROR_OLD_WIN_VERSION 1150L @@ -2830,7 +2830,7 @@ // // MessageText: // -// The indicated device requirements reinitialization due to hardware errors. +// The indicated device requires reinitialization due to hardware errors. // #define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164L // dderror @@ -4940,7 +4940,7 @@ // // MessageText: // -// This operation requirements an interactive window station. +// This operation requires an interactive window station. // #define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 1459L @@ -9717,7 +9717,7 @@ // // MessageText: // -// This request requirements a secure connection. +// This request requires a secure connection. // #define ERROR_DS_CONFIDENTIALITY_REQUIRED 8237L @@ -11097,7 +11097,7 @@ // // MessageText: // -// A root object requirements a class of 'top'. +// A root object requires a class of 'top'. // #define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 8432L @@ -11511,7 +11511,7 @@ // // MessageText: // -// The requested operation requirements a directory service, and none was available. +// The requested operation requires a directory service, and none was available. // #define ERROR_DS_DS_REQUIRED 8478L @@ -11619,7 +11619,7 @@ // // MessageText: // -// Another operation which requirements exclusive access to the PDC FSMO is already in progress. +// Another operation which requires 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 requirements packet privacy or better. +// The connection between client and server requires packet privacy or better. // #define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 8533L @@ -12036,7 +12036,7 @@ // // MessageText: // -// The operation requirements that destination domain auditing be enabled. +// The operation requires that destination domain auditing be enabled. // #define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 8536L @@ -12182,7 +12182,7 @@ // // MessageText: // -// The operation requirements that source domain auditing be enabled. +// The operation requires that source domain auditing be enabled. // #define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 8552L @@ -12722,7 +12722,7 @@ // // MessageText: // -// Secondary DNS zone requirements master IP address. +// Secondary DNS zone requires master IP address. // #define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 9612L @@ -12799,7 +12799,7 @@ // // MessageText: // -// Primary DNS zone requirements datafile. +// Primary DNS zone requires 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 requirements that JIT be in the current context and it is not +// The requested operation requires 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 requirements that the current context have a Transaction, and it does not +// The requested operation requires 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 requirements more data to complete the decode operation. +// The streamed cryptographic message requires 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 requirements a Smart Card, but no Smart Card is currently in the device. +// The operation requires 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_App.cpp b/Minecraft.Client/Orbis/Orbis_App.cpp index cd1ee215c..fb40ff745 100644 --- a/Minecraft.Client/Orbis/Orbis_App.cpp +++ b/Minecraft.Client/Orbis/Orbis_App.cpp @@ -400,7 +400,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp index 99e1c69a2..20b9dd03f 100644 --- a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp +++ b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp @@ -32,6 +32,7 @@ //#include "NetworkManager.h" #include "..\..\Minecraft.Client\Tesselator.h" #include "..\..\Minecraft.Client\Options.h" +#include "..\GameRenderer.h" #include "Sentient\SentientManager.h" #include "..\..\Minecraft.World\IntCache.h" #include "..\Textures.h" @@ -920,7 +921,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 - requirements ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); //////////////// @@ -1302,6 +1303,9 @@ int main(int argc, const char *argv[] ) #endif ui.tick(); ui.render(); + + pMinecraft->gameRenderer->ApplyGammaPostProcess(); + #if 0 app.HandleButtonPresses(); diff --git a/Minecraft.Client/Orbis/Orbis_UIController.cpp b/Minecraft.Client/Orbis/Orbis_UIController.cpp index 4e1ffe7f3..38cc79e94 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 requirements a bit of main memory for management + vertex buffers. Each object requires 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/user_malloc.cpp b/Minecraft.Client/Orbis/user_malloc.cpp index 6a85e83b5..1628abbea 100644 --- a/Minecraft.Client/Orbis/user_malloc.cpp +++ b/Minecraft.Client/Orbis/user_malloc.cpp @@ -38,7 +38,7 @@ int user_malloc_init(void) int res; void *addr; uint64_t dmemSize = SCE_KERNEL_MAIN_DMEM_SIZE; - + s_heapLength = ((size_t)4608) * 1024 * 1024; // Initial allocation for the application s_heapLength -= ((size_t)4) * 1024 * 1024; // Allocated for TLS s_heapLength -= ((size_t)2) * 1024 * 1024; // 64K (sometimes?) allocated for razor - rounding up to 2MB here to match our alignment @@ -106,10 +106,10 @@ void *user_malloc(size_t size) { #if 0 static int throttle = 0; - static __int64 lasttime = 0; + static int64_t lasttime = 0; if( ( throttle % 100 ) == 0 ) { - __int64 nowtime = System::currentTimeMillis(); + int64_t nowtime = System::currentTimeMillis(); if( ( nowtime - lasttime ) > 20000 ) { lasttime = nowtime; diff --git a/Minecraft.Client/PS3/Iggy/include/gdraw.h b/Minecraft.Client/PS3/Iggy/include/gdraw.h index e959d788e..607843266 100644 --- a/Minecraft.Client/PS3/Iggy/include/gdraw.h +++ b/Minecraft.Client/PS3/Iggy/include/gdraw.h @@ -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 requirements. + functions Iggy requires. */ RADDEFEND diff --git a/Minecraft.Client/PS3/Iggy/include/rrCore.h b/Minecraft.Client/PS3/Iggy/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/PS3/Iggy/include/rrCore.h +++ b/Minecraft.Client/PS3/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PS3/Miles/include/mss.h b/Minecraft.Client/PS3/Miles/include/mss.h index 162451b2d..80be1aa3a 100644 --- a/Minecraft.Client/PS3/Miles/include/mss.h +++ b/Minecraft.Client/PS3/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned long long ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -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() requirements at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -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 uint8_t count the asset requirements if fully loaded. + $:DataLen The uint8_t count the asset requires 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 uint8_t 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 @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/PS3/Miles/include/rrCore.h b/Minecraft.Client/PS3/Miles/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/PS3/Miles/include/rrCore.h +++ b/Minecraft.Client/PS3/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp index 6c802180a..13fab9404 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 requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// 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 // 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 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. +// 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. 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 requirements etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires 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 requirements etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requires 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 requirements 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 requires 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 requirements 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 requires 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 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 + // 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 #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 requirements. 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 requires. 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 ) { diff --git a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp index 1a4de1d2b..d52d68a5f 100644 --- a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp @@ -27,21 +27,21 @@ void SonyRemoteStorage_PS3::npauthhandler(int event, int result, void *arg) { #ifdef __PS3__ - if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0) + if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0) { app.DebugPrintf("Could not retrieve ticket: 0x%x\n", result); - } - else + } + else { psnTicketSize = result; psnTicket = malloc(psnTicketSize); - if (psnTicket == NULL) + if (psnTicket == NULL) { app.DebugPrintf("Failed to allocate for ticket\n"); } int ret = sceNpManagerGetTicket(psnTicket, &psnTicketSize); - if (ret < 0) + if (ret < 0) { app.DebugPrintf("Could not retrieve ticket: 0x%x\n", ret); free(psnTicket); @@ -60,7 +60,7 @@ int SonyRemoteStorage_PS3::initPreconditions() SceNpId npId; ret = sceNpManagerGetNpId(&npId); - if(ret < 0) + if(ret < 0) { return ret; } @@ -68,12 +68,12 @@ int SonyRemoteStorage_PS3::initPreconditions() ticketVersion.major = 3; ticketVersion.minor = 0; ret = sceNpManagerRequestTicket2(&npId, &ticketVersion, TICKETING_SERVICE_ID, NULL, 0, NULL, 0); - if(ret < 0) + if(ret < 0) { return ret; } m_waitingForTicket = true; - while(m_waitingForTicket) + while(m_waitingForTicket) { cellSysutilCheckCallback(); sys_timer_usleep(50000); //50 milliseconds. @@ -104,12 +104,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case GET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Data success \n"); m_status = e_getDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -126,12 +126,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case GET_STATUS_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Status success \n"); app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs); app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles); - for(int i = 0; i < outputGetStatus->numFiles; i++) + for(int i = 0; i < outputGetStatus->numFiles; i++) { app.DebugPrintf("\n*** File %d information: ***\n", (i + 1)); app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName); @@ -142,8 +142,8 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write")); } m_status = e_getStatusSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -158,12 +158,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case SET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Set Data success \n"); m_status = e_setDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -230,7 +230,7 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam) params.callback = staticInternalCallback; params.userData = this; params.thread.threadAffinity = 0; //Not used in PS3 - params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest. + params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest. params.psnTicket = psnTicket; params.psnTicketSize = psnTicketSize; strcpy(params.clientId, CLIENT_ID); @@ -246,20 +246,20 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam) // SceRemoteStorageAbortReqParams abortParams; ret = sceRemoteStorageInit(params); - if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED) + if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED) { // abortParams.requestId = ret; //ret = sceRemoteStorageAbort(abortParams); app.DebugPrintf("Session will be created \n"); - //if(ret >= 0) + //if(ret >= 0) //{ // printf("Session aborted \n"); - //} else + //} else //{ // printf("Error aborting session: 0x%x \n", ret); //} - } - else + } + else { app.DebugPrintf("Error creating session: 0x%x \n", ret); return false; @@ -279,12 +279,12 @@ bool SonyRemoteStorage_PS3::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, Cal reqId = sceRemoteStorageGetStatus(params, outputGetStatus); m_status = e_getStatusInProgress; - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Status request sent \n"); return true; - } - else + } + else { app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId); return false; @@ -303,11 +303,11 @@ void SonyRemoteStorage_PS3::abort() params.requestId = reqId; int ret = sceRemoteStorageAbort(params); - if(ret >= 0) + if(ret >= 0) { app.DebugPrintf("Abort request done \n"); - } - else + } + else { app.DebugPrintf("Error in Abort request: 0x%x \n", ret); } @@ -345,7 +345,7 @@ bool SonyRemoteStorage_PS3::setDataInternal() char seed[22]; app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack); - __int64 iSeed = strtoll(seed,NULL,10); + int64_t iSeed = strtoll(seed,NULL,10); char seedHex[17]; sprintf(seedHex,"%016llx",iSeed); memcpy(descData.m_seed,seedHex,16); // Don't copy null @@ -377,14 +377,14 @@ bool SonyRemoteStorage_PS3::setDataInternal() reqId = sceRemoteStorageSetData(params); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Set Data request sent \n"); m_bTransferStarted = true; m_status = e_setDataInProgress; return true; - } - else + } + else { app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId); return false; @@ -406,12 +406,12 @@ bool SonyRemoteStorage_PS3::getData( const char* remotePath, const char* localPa reqId = sceRemoteStorageGetData(params, &outputGetData); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Data request sent \n"); m_bTransferStarted = true; m_status = e_getDataInProgress; - } else + } else { app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId); } diff --git a/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h b/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h index c79ef233c..b9a566a1e 100644 --- a/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h +++ b/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h @@ -230,7 +230,7 @@ typedef __declspec(align(16)) uint32_t __vector4i[4]; #endif //------------------------------------------------------------------------------ -// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte +// Vector intrinsic: Four 32 bit floating point components aligned on a 16 uint8_t // boundary and mapped to hardware vector registers #if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) typedef __m128 XMVECTOR; @@ -346,7 +346,7 @@ XMVECTOR operator/ (FXMVECTOR V, float S); //------------------------------------------------------------------------------ // Matrix type: Sixteen 32 bit floating point components aligned on a -// 16 byte boundary and mapped to four hardware vector registers +// 16 uint8_t boundary and mapped to four hardware vector registers struct XMMATRIX; @@ -427,7 +427,7 @@ struct XMFLOAT2 XMFLOAT2& operator= (const XMFLOAT2& Float2) { x = Float2.x; y = Float2.y; return *this; } }; -// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 2D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT2A : public XMFLOAT2 { XMFLOAT2A() : XMFLOAT2() {} @@ -479,7 +479,7 @@ struct XMFLOAT3 XMFLOAT3& operator= (const XMFLOAT3& Float3) { x = Float3.x; y = Float3.y; z = Float3.z; return *this; } }; -// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 3D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT3A : public XMFLOAT3 { XMFLOAT3A() : XMFLOAT3() {} @@ -534,7 +534,7 @@ struct XMFLOAT4 XMFLOAT4& operator= (const XMFLOAT4& Float4) { x = Float4.x; y = Float4.y; z = Float4.z; w = Float4.w; return *this; } }; -// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 4D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4A : public XMFLOAT4 { XMFLOAT4A() : XMFLOAT4() {} @@ -632,7 +632,7 @@ struct XMFLOAT4X3 }; -// 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary +// 4x3 Matrix: 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4X3A : public XMFLOAT4X3 { XMFLOAT4X3A() : XMFLOAT4X3() {} @@ -678,7 +678,7 @@ struct XMFLOAT4X4 XMFLOAT4X4& operator= (const XMFLOAT4X4& Float4x4); }; -// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary +// 4x4 Matrix: 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4 { XMFLOAT4X4A() : XMFLOAT4X4() {} diff --git a/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h b/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h index 3576d7ed0..614462c13 100644 --- a/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h +++ b/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h @@ -41,8 +41,8 @@ | Usage | Nullness | ZeroTerminated | Extent | |--------------|----------|----------------|-----------------------------| | _In_ | <> | <> | <> | - | _Out_ | opt_ | z_ | [byte]cap_[c_|x_]( size ) | - | _Inout_ | | | [byte]count_[c_|x_]( size ) | + | _Out_ | opt_ | z_ | [uint8_t]cap_[c_|x_]( size ) | + | _Inout_ | | | [uint8_t]count_[c_|x_]( size ) | | _Deref_out_ | | | ptrdiff_cap_( ptr ) | |--------------| | | ptrdiff_count_( ptr ) | | _Ret_ | | | | @@ -77,7 +77,7 @@ | Unit | Writ\Readable | Argument Type | |------|---------------|---------------| | <> | cap_ | <> | - | byte | count_ | c_ | + | uint8_t | count_ | c_ | | | | x_ | |------|---------------|---------------| @@ -1355,7 +1355,7 @@ typedef struct _$M _$M; with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one element long. Must be used with _in, _out, or _inout. _ecount : The buffer size is an explicit element count. - _bcount : The buffer size is an explicit byte count. + _bcount : The buffer size is an explicit uint8_t count. Output: Describes how much of the buffer will be initialized by the function. For _inout buffers, this also describes how much is initialized at entry. Omit this diff --git a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h index 134059dbb..4582b2067 100644 --- a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h +++ b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h @@ -16,8 +16,8 @@ typedef unsigned int uint32; typedef unsigned long long uint64; typedef long long int64; #else - typedef unsigned __int64 uint64; - typedef __int64 int64; + typedef unsigned long long uint64; + typedef long long int64; #endif typedef char int8; diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp index 2177739a6..4143c555c 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp @@ -671,7 +671,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { PS3 BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { PS3_STUBBED; return false;} errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } int _wtoi(const wchar_t *_Str) { diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h index f24a3b925..8f1b489d8 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h @@ -29,7 +29,7 @@ LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -53,16 +53,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -219,7 +219,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -261,17 +261,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -291,38 +291,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -364,11 +364,11 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix); int _wtoi(const wchar_t *_Str); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h index d24271614..261497c88 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h @@ -2,12 +2,15 @@ #pragma once +#include + #define BOOST_NO_CXX11_NULLPTR #define BOOST_ENABLE_ASSERT_HANDLER #include -#include +#include +#include #include #include #include "boost/tr1/unordered_map.hpp" @@ -109,22 +112,19 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char uint8_t; -typedef long long __int64; -typedef unsigned long long __uint64; typedef unsigned long DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef __int64 LONG64, *PLONG64; +typedef long long LONG64, *PLONG64; #define VOID void typedef char CHAR; typedef short SHORT; typedef long LONG; -typedef __int64 LONGLONG; -typedef __uint64 ULONGLONG; +typedef int64_t LONGLONG; +typedef uint64_t ULONGLONG; #define CONST const diff --git a/Minecraft.Client/PS3/PS3Extras/winerror.h b/Minecraft.Client/PS3/PS3Extras/winerror.h index f1b522aff..de7314335 100644 --- a/Minecraft.Client/PS3/PS3Extras/winerror.h +++ b/Minecraft.Client/PS3/PS3Extras/winerror.h @@ -2704,7 +2704,7 @@ // // MessageText: // -// The specified program requirements a newer version of Windows. +// The specified program requires a newer version of Windows. // #define ERROR_OLD_WIN_VERSION 1150L @@ -2830,7 +2830,7 @@ // // MessageText: // -// The indicated device requirements reinitialization due to hardware errors. +// The indicated device requires reinitialization due to hardware errors. // #define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164L // dderror @@ -4940,7 +4940,7 @@ // // MessageText: // -// This operation requirements an interactive window station. +// This operation requires an interactive window station. // #define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION 1459L @@ -9717,7 +9717,7 @@ // // MessageText: // -// This request requirements a secure connection. +// This request requires a secure connection. // #define ERROR_DS_CONFIDENTIALITY_REQUIRED 8237L @@ -11097,7 +11097,7 @@ // // MessageText: // -// A root object requirements a class of 'top'. +// A root object requires a class of 'top'. // #define ERROR_DS_ROOT_REQUIRES_CLASS_TOP 8432L @@ -11511,7 +11511,7 @@ // // MessageText: // -// The requested operation requirements a directory service, and none was available. +// The requested operation requires a directory service, and none was available. // #define ERROR_DS_DS_REQUIRED 8478L @@ -11619,7 +11619,7 @@ // // MessageText: // -// Another operation which requirements exclusive access to the PDC FSMO is already in progress. +// Another operation which requires 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 requirements packet privacy or better. +// The connection between client and server requires packet privacy or better. // #define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION 8533L @@ -12036,7 +12036,7 @@ // // MessageText: // -// The operation requirements that destination domain auditing be enabled. +// The operation requires that destination domain auditing be enabled. // #define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED 8536L @@ -12182,7 +12182,7 @@ // // MessageText: // -// The operation requirements that source domain auditing be enabled. +// The operation requires that source domain auditing be enabled. // #define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED 8552L @@ -12722,7 +12722,7 @@ // // MessageText: // -// Secondary DNS zone requirements master IP address. +// Secondary DNS zone requires master IP address. // #define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP 9612L @@ -12799,7 +12799,7 @@ // // MessageText: // -// Primary DNS zone requirements datafile. +// Primary DNS zone requires 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 requirements that JIT be in the current context and it is not +// The requested operation requires 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 requirements that the current context have a Transaction, and it does not +// The requested operation requires 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 requirements more data to complete the decode operation. +// The streamed cryptographic message requires 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 requirements a Smart Card, but no Smart Card is currently in the device. +// The operation requires 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_App.cpp b/Minecraft.Client/PS3/PS3_App.cpp index e5e239334..2c98b5786 100644 --- a/Minecraft.Client/PS3/PS3_App.cpp +++ b/Minecraft.Client/PS3/PS3_App.cpp @@ -469,7 +469,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType) LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName) { File saveFile(pathName); - __int64 fileSize = saveFile.length(); + int64_t fileSize = saveFile.length(); FileInputStream fis(saveFile); byteArray ba(fileSize); fis.read(ba); @@ -507,8 +507,8 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements -// __int64 seedValue = 0xfd97203ebdbf5c6f; + int64_t seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements +// int64_t seedValue = 0xfd97203ebdbf5c6f; unsigned int seedLow = (unsigned int )(seedValue & 0xffffffff); unsigned int seedHigh = (unsigned int )(seedValue>>32); #ifndef _CONTENT_PACKAGE @@ -1154,7 +1154,7 @@ char * CConsoleMinecraftApp::GetDiscPatchUsrDir() return m_usrdirPathBDPatch; } -char *PatchFilelist[] = +const char *PatchFilelist[] = { "PS3/PS3ProductCodes.bin", "Common/Media/MediaPS3.arc", diff --git a/Minecraft.Client/PS3/PS3_Minecraft.cpp b/Minecraft.Client/PS3/PS3_Minecraft.cpp index e8481bf2d..82dd7c508 100644 --- a/Minecraft.Client/PS3/PS3_Minecraft.cpp +++ b/Minecraft.Client/PS3/PS3_Minecraft.cpp @@ -86,6 +86,7 @@ char secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE] = #include "..\..\Minecraft.Client\Tesselator.h" #include "..\Common\Console_Awards_enum.h" #include "..\..\Minecraft.Client\Options.h" +#include "..\GameRenderer.h" #include "Sentient\SentientManager.h" #include "..\..\Minecraft.World\IntCache.h" #include "..\Textures.h" @@ -839,7 +840,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 - requirements ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); static bool bTrialTimerDisplayed=true; @@ -1245,6 +1246,8 @@ int main() ui.tick(); ui.render(); + pMinecraft->gameRenderer->ApplyGammaPostProcess(); + // Present the frame. PIXBeginNamedEvent(0,"Frame present"); RenderManager.Present(); diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h index ba359cc03..d8365b40d 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 uint8_t; +#include #include #else #include "..\..\..\stdafx.h" diff --git a/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h b/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h index 959ec09c6..31e224135 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h +++ b/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h @@ -23,8 +23,8 @@ public: static void get(void* dest, uintptr_t ea, unsigned int dmaSize) { - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(dest) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(dest) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory // start memory transfer @@ -82,8 +82,8 @@ public: { if(sc_verbose) spu_print("DMA SPU->PPU start: 0x%08x -> 0x%08x : size : %d bytes .... ", (unsigned int)src, (unsigned int)ea, dmaSize); - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory cellDmaLargePut(src, ea, dmaSize, g_pSpursJobContext->dmaTag, 0, 0); @@ -98,8 +98,8 @@ public: { if(sc_verbose) spu_print("DMA SPU->PPU : 0x%08x -> 0x%08x : size : %d bytes\n", (unsigned int)src, (unsigned int)ea, dmaSize); - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory cellDmaUnalignedPut(src, ea, dmaSize, g_pSpursJobContext->dmaTag, 0, 0); diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h index 30266d7ff..ad351948b 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h @@ -17,9 +17,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -33,7 +33,7 @@ class SparseDataStorage_SPU { private: // unsigned char planeIndices[128]; - unsigned char* m_pData; + unsigned char* m_pData; // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -57,8 +57,8 @@ public: 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; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h index 01b2aa6ec..d2a87ba02 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h @@ -20,9 +20,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -36,7 +36,7 @@ class SparseLightStorage_SPU { private: // unsigned char planeIndices[128]; - unsigned char* m_pData; + unsigned char* m_pData; // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -64,8 +64,8 @@ public: 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; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp b/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp index 7a05169a9..8dfcaf268 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp @@ -161,7 +161,7 @@ bool CCompressedTileStorage_compress::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; } } @@ -202,7 +202,7 @@ bool CCompressedTileStorage_compress::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 @@ -320,7 +320,7 @@ bool CCompressedTileStorage_compress::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 memcpy( pucData + usDataOffset, unpacked_data, 64 ); newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; usDataOffset += 64; diff --git a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp index 0912e33ae..bcde1e18e 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp @@ -132,7 +132,7 @@ bool LevelRenderer_FindNearestChunk_DataIn::MultiplayerChunkCache::getChunkEmpty } -bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) +bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 uint8_t range) { int blockIdx; unsigned short *blockIndices = (unsigned short *)indicesAndData; diff --git a/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h b/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h index b45763a55..f0e084444 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h +++ b/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h @@ -13,7 +13,7 @@ public: void set(PerlinNoise* pNoise, doubleArray& buffer, int x, int y, int z, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale) { int arraySize = xSize * ySize * zSize; - // make sure it's 16 byte aligned + // make sure it's 16 uint8_t aligned if(arraySize & 1) arraySize++; if (buffer.data == NULL) diff --git a/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp b/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp index 63259d33e..11bc8fe97 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp @@ -123,9 +123,9 @@ void RLECompress(void *pPPUSrc, int srcSize, void* pPPUDst, int* pDstSize) int endPos = srcSize-1; // 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 do { unsigned char thisOne = srcBuffer.getCurrent(); diff --git a/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h index 46876c53d..5f06f1fd1 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h @@ -34,8 +34,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 @@ -134,7 +134,7 @@ public: class OutputData { public: - unsigned char m_tileIds[16*16*256]; // byte + unsigned char m_tileIds[16*16*256]; // uint8_t }; static OutputData m_OutputData; diff --git a/Minecraft.Client/PSVita/Iggy/include/gdraw.h b/Minecraft.Client/PSVita/Iggy/include/gdraw.h index e959d788e..607843266 100644 --- a/Minecraft.Client/PSVita/Iggy/include/gdraw.h +++ b/Minecraft.Client/PSVita/Iggy/include/gdraw.h @@ -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 requirements. + functions Iggy requires. */ RADDEFEND diff --git a/Minecraft.Client/PSVita/Iggy/include/rrCore.h b/Minecraft.Client/PSVita/Iggy/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/PSVita/Iggy/include/rrCore.h +++ b/Minecraft.Client/PSVita/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PSVita/Miles/include/mss.h b/Minecraft.Client/PSVita/Miles/include/mss.h index 162451b2d..80be1aa3a 100644 --- a/Minecraft.Client/PSVita/Miles/include/mss.h +++ b/Minecraft.Client/PSVita/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned long long ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -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() requirements at least 8K +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K // of data or the entire file image, whichever is less, // to determine sample format #define DIG_F_16BITS_MASK 1 @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -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 uint8_t count the asset requirements if fully loaded. + $:DataLen The uint8_t count the asset requires 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 uint8_t 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 @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/PSVita/Miles/include/rrCore.h b/Minecraft.Client/PSVita/Miles/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/PSVita/Miles/include/rrCore.h +++ b/Minecraft.Client/PSVita/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp index 360c02e35..a677da124 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 requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// 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 // 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 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. +// 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. 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 requirements 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 requires 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 diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp index ac03f7f4a..414628d27 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 requirements NP Manager to be online & the player to be signed in. This kicks of the creation of a context +// 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 // 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 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. +// 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. 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 requirements etc. + // This will also create the required new SQRNetworkPlayer and do all the callbacks that requires 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 requirements etc. + // This will also delete the SQRNetworkPlayer and do all the callbacks that requires 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 requirements 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 requires 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 requirements 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 requires 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 requirements. 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 requires. 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 || diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h index 180ebbbc3..de405e269 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h @@ -26,7 +26,7 @@ DWORD TlsAlloc(VOID); LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -34,13 +34,13 @@ typedef struct _RECT LONG bottom; } RECT, *PRECT; -typedef struct _TOUCHSCREENRECT +typedef struct _TOUCHSCREENRECT { SceInt16 left; SceInt16 top; SceInt16 right; SceInt16 bottom; -} +} TOUCHSCREENRECT, *PTOUCHSCREENRECT; typedef void ID3D11Device; @@ -58,16 +58,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -261,7 +261,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -303,17 +303,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -333,38 +333,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -403,9 +403,9 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(long long _Val, char * _DstBuf, size_t _Size, int _Radix); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h index 96041184f..8c11d9d85 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h @@ -1,6 +1,6 @@ #pragma once -//#include "winerror.h" +#include typedef unsigned int DWORD; typedef int BOOL; @@ -33,15 +33,12 @@ typedef unsigned int UINT; typedef unsigned int *PUINT; -typedef unsigned char uint8_t; -typedef long long __int64; -typedef unsigned long long __uint64; typedef unsigned int DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef __int64 LONG64, *PLONG64; +typedef long long LONG64, *PLONG64; #define VOID void typedef char CHAR; diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp index cc5ef4a9f..d1af4b247 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp +++ b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp @@ -56,42 +56,42 @@ void PSVitaInit() int err = sceFiosInitialize(¶ms); assert(err == SCE_FIOS_OK); } -char* getConsoleHomePath() -{ - return contentInfoPath; +char* getConsoleHomePath() +{ + return contentInfoPath; } -char* getUsrDirRoot() -{ - return driveRoot; +char* getUsrDirRoot() +{ + return driveRoot; } -char* getUsrDirPath() -{ - return usrdirPath; +char* getUsrDirPath() +{ + return usrdirPath; } -char* getConsoleHomePathBDPatch() -{ - return contentInfoPathBDPatch; +char* getConsoleHomePathBDPatch() +{ + return contentInfoPathBDPatch; } -char* getUsrDirPathBDPatch() -{ - return usrdirPathBDPatch; +char* getUsrDirPathBDPatch() +{ + return usrdirPathBDPatch; } -char* getDirName() -{ - return dirName; +char* getDirName() +{ + return dirName; } int _wcsicmp( const wchar_t * dst, const wchar_t * src ) { wchar_t f,l; - // validation section + // validation section // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); @@ -117,7 +117,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) return n; } -VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) +VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) { SceDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -133,8 +133,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) lpSystemTime->wMilliseconds = sceRtcGetMicrosecond(&dateTime)/1000; } BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { PSVITA_STUBBED; return false; } -BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) -{ +BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) +{ SceUInt64 diffHundredNanos; SceDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -143,11 +143,11 @@ BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) lpFileTime->dwHighDateTime = diffHundredNanos >> 32; lpFileTime->dwLowDateTime = diffHundredNanos & 0xffffffff; - return true; + return true; } -VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ +VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) +{ SceDateTime dateTime; int err = sceRtcGetCurrentClockLocalTime(&dateTime); assert(err == SCE_OK); @@ -163,26 +163,26 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) } HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PSVITA_STUBBED; return NULL; } -VOID Sleep(DWORD dwMilliseconds) -{ +VOID Sleep(DWORD dwMilliseconds) +{ C4JThread::Sleep(dwMilliseconds); } BOOL SetThreadPriority(HANDLE hThread, int nPriority) { PSVITA_STUBBED; return FALSE; } DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { PSVITA_STUBBED; return false; } -LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) -{ +LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) +{ return sceAtomicCompareAndSwap32((int32_t*)Destination, (int32_t)Comperand, (int32_t)Exchange); } -LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) -{ +LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) +{ return sceAtomicCompareAndSwap64((int64_t*)Destination, (int64_t)Comperand, (int64_t)Exchange); } -VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { char name[1] = {0}; @@ -191,7 +191,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) +VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) { // no spin count on PSVita InitializeCriticalSection(CriticalSection); @@ -203,16 +203,16 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection) PSVITA_ASSERT_SCE_ERROR(err); } -extern CRITICAL_SECTION g_singleThreadCS; +extern CRITICAL_SECTION g_singleThreadCS; -VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = sceKernelLockLwMutex ((SceKernelLwMutexWork *)(&CriticalSection->mutex), 1, NULL); PSVITA_ASSERT_SCE_ERROR(err); } -VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = sceKernelUnlockLwMutex ((SceKernelLwMutexWork *)(&CriticalSection->mutex), 1); PSVITA_ASSERT_SCE_ERROR(err); @@ -272,8 +272,8 @@ VOID LeaveCriticalRWSection(PCRITICAL_RW_SECTION CriticalSection, bool Write) -BOOL CloseHandle(HANDLE hObject) -{ +BOOL CloseHandle(HANDLE hObject) +{ sceFiosFHCloseSync(NULL,(SceFiosFH)((int32_t)hObject)); return true; } @@ -292,8 +292,8 @@ BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return PSVitaTLSStorage: static void* VirtualAllocs[1000]; // a list of 1MB allocations static int VirtualNumAllocs = 0; // how many 1MB chunks have been allocated -LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ +LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ if( flAllocationType == MEM_COMMIT ) { // how many pages do we need @@ -319,7 +319,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO return (void*) VIRTUAL_OFFSET; } -BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) +BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) { while( VirtualNumAllocs ) { @@ -333,7 +333,7 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) // memset a section of the virtual chunks -VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) +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 @@ -371,7 +371,7 @@ VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) // copy a block of memory to the virtual chunks -VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) +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 @@ -410,7 +410,7 @@ VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) } // copy a block of memory from the virtual chunks -VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) +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 @@ -449,7 +449,7 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) } // copy a block of memory between the virtual chunks -VOID VirtualMove(LPVOID lpDestOffset, 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 uint8_t offset within the current 1MB page @@ -652,7 +652,7 @@ DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) { SceFiosFH fh = (SceFiosFH)(hFile); - // 4J Stu - sceFiosFHGetSize didn't seem to work...so doing this for now + // 4J Stu - sceFiosFHGetSize didn't seem to work...so doing this for now //SceFiosSize FileSize; //FileSize=sceFiosFHGetSize(fh); SceFiosStat statData; @@ -694,7 +694,7 @@ BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPD return FALSE; } -BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) +BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) { SceFiosFH fh = (SceFiosFH)((int64_t)hFile); // sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes. @@ -743,7 +743,7 @@ void replaceBackslashes(char* szFilename) } } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -768,7 +768,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, #ifndef _CONTENT_PACKAGE printf("*** Opening %s\n",filePath); #endif - + SceFiosFH fh; int err = sceFiosFHOpenSync(NULL, &fh, filePath, NULL); assert( err == SCE_FIOS_OK ); @@ -776,8 +776,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return (void*)fh; } -BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ +BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ #ifndef _CONTENT_PACKAGE char filePath[256]; sprintf(filePath,"%s/%s",usrdirPath, lpPathName ); @@ -794,12 +794,12 @@ BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribu BOOL DeleteFileA(LPCSTR lpFileName) { PSVITA_STUBBED; return false; } -// BOOL XCloseHandle(HANDLE a) -// { -// cellFsClose(int(a)); +// BOOL XCloseHandle(HANDLE a) +// { +// cellFsClose(int(a)); // } -DWORD GetFileAttributesA(LPCSTR lpFileName) +DWORD GetFileAttributesA(LPCSTR lpFileName) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -835,7 +835,7 @@ VOID DebugBreak(VOID) { SCE_BREAK(); } DWORD GetLastError(VOID) { PSVITA_STUBBED; return 0; } -VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) +VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { PSVITA_STUBBED; /* malloc_managed_size stat; @@ -850,9 +850,9 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) lpBuffer->dwAvailVirtual = stat.max_system_size - stat.current_inuse_size;*/ } -DWORD GetTickCount() +DWORD GetTickCount() { - // This function returns the current system time at this function is called. + // This function returns the current system time at this function is called. // The system time is represented the time elapsed since the system starts up in microseconds. uint64_t sysTime = sceKernelGetProcessTimeWide(); @@ -861,11 +861,11 @@ DWORD GetTickCount() } // we should really use libperf for this kind of thing, but this will do for now. -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) -{ +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ // microseconds - lpFrequency->QuadPart = (1000 * 1000); - return false; + lpFrequency->QuadPart = (1000 * 1000); + return false; } BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { @@ -875,24 +875,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) } #ifndef _FINAL_BUILD -VOID OutputDebugStringW(LPCWSTR lpOutputString) -{ - wprintf(lpOutputString); +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + wprintf(lpOutputString); } -VOID OutputDebugString(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugString(LPCSTR lpOutputString) +{ + printf(lpOutputString); } -VOID OutputDebugStringA(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + printf(lpOutputString); } #endif // _CONTENT_PACKAGE BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation) -{ +{ WIN32_FILE_ATTRIBUTE_DATA *fileInfoBuffer = (WIN32_FILE_ATTRIBUTE_DATA*) lpFileInformation; char filePath[256]; @@ -921,27 +921,27 @@ BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId, } HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) -{ - PSVITA_STUBBED; +{ + PSVITA_STUBBED; return 0; } -BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) -{ +BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) +{ PSVITA_STUBBED; return false; } errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(long long _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } int _wtoi(const wchar_t *_Str) { return wcstol(_Str, NULL, 10); } -DWORD XGetLanguage() -{ +DWORD XGetLanguage() +{ // check if we should override the system language or not unsigned char ucLang = app.GetMinecraftLanguage(0); if (ucLang != MINECRAFT_LANGUAGE_DEFAULT) return ucLang; @@ -979,8 +979,8 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() -{ +DWORD XGetLocale() +{ // check if we should override the system locale or not unsigned char ucLocale = app.GetMinecraftLocale(0); if (ucLocale != MINECRAFT_LANGUAGE_DEFAULT) return ucLocale; @@ -993,7 +993,7 @@ DWORD XGetLocale() case SCE_SYSTEM_PARAM_LANG_ENGLISH_US : return XC_LOCALE_UNITED_STATES; case SCE_SYSTEM_PARAM_LANG_FRENCH : return XC_LOCALE_FRANCE; - case SCE_SYSTEM_PARAM_LANG_SPANISH : + case SCE_SYSTEM_PARAM_LANG_SPANISH : if(app.IsAmericanSKU()) { return XC_LOCALE_LATIN_AMERICA; @@ -1027,7 +1027,7 @@ DWORD XGetLocale() } } -DWORD XEnableGuestSignin(BOOL fEnable) -{ - return 0; +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; } diff --git a/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h b/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h index 201030185..007a84165 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h @@ -29,8 +29,8 @@ #if ! LIBDIVIDE_HAS_STDINT_TYPES typedef __int32 int32_t; typedef unsigned __int32 uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; typedef __int8 int8_t; typedef unsigned __int8 uint8_t; #endif @@ -83,7 +83,7 @@ u32: [0-4] shift value [5] ignored [6] add indicator [7] shift path - + s32: [0-4] shift value [5] shift path [6] add indicator @@ -106,7 +106,7 @@ enum { LIBDIVIDE_U32_SHIFT_PATH = 0x80, LIBDIVIDE_U64_SHIFT_PATH = 0x80, LIBDIVIDE_S32_SHIFT_PATH = 0x20, - LIBDIVIDE_NEGATIVE_DIVISOR = 0x80 + LIBDIVIDE_NEGATIVE_DIVISOR = 0x80 }; @@ -123,7 +123,7 @@ struct libdivide_s32_t { struct libdivide_u64_t { uint64_t magic; uint8_t more; -}; +}; struct libdivide_s64_t { int64_t magic; @@ -146,7 +146,7 @@ LIBDIVIDE_API struct libdivide_s32_t libdivide_s32_gen(int32_t y); LIBDIVIDE_API struct libdivide_u32_t libdivide_u32_gen(uint32_t y); LIBDIVIDE_API struct libdivide_s64_t libdivide_s64_gen(int64_t y); LIBDIVIDE_API struct libdivide_u64_t libdivide_u64_gen(uint64_t y); - + LIBDIVIDE_API int32_t libdivide_s32_do(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do(int64_t numer, const struct libdivide_s64_t *denom); @@ -156,19 +156,19 @@ LIBDIVIDE_API int libdivide_u32_get_algorithm(const struct libdivide_u32_t *deno LIBDIVIDE_API uint32_t libdivide_u32_do_alg0(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do_alg1(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *denom); - + LIBDIVIDE_API int libdivide_u64_get_algorithm(const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg0(uint64_t numer, const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg1(uint64_t numer, const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg2(uint64_t numer, const struct libdivide_u64_t *denom); - + LIBDIVIDE_API int libdivide_s32_get_algorithm(const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg0(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg1(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg2(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg3(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom); - + LIBDIVIDE_API int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do_alg0(int64_t numer, const struct libdivide_s64_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do_alg1(int64_t numer, const struct libdivide_s64_t *denom); @@ -202,17 +202,17 @@ LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg2(__m128i numers, const struct LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg3(__m128i numers, const struct libdivide_s64_t * denom); LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_t * denom); #endif - - - + + + //////// Internal Utility Functions - + static inline uint32_t libdivide__mullhi_u32(uint32_t x, uint32_t y) { uint64_t xl = x, yl = y; uint64_t rl = xl * yl; return (uint32_t)(rl >> 32); } - + static uint64_t libdivide__mullhi_u64(uint64_t x, uint64_t y) { #if HAS_INT128_T __uint128_t xl = x, yl = y; @@ -227,18 +227,18 @@ static uint64_t libdivide__mullhi_u64(uint64_t x, uint64_t y) { const uint64_t x0y1 = x0 * (uint64_t)y1; const uint64_t x1y0 = x1 * (uint64_t)y0; const uint64_t x1y1 = x1 * (uint64_t)y1; - + uint64_t temp = x1y0 + x0y0_hi; uint64_t temp_lo = temp & mask, temp_hi = temp >> 32; return x1y1 + temp_hi + ((temp_lo + x0y1) >> 32); #endif } - + static inline int64_t libdivide__mullhi_s64(int64_t x, int64_t y) { #if HAS_INT128_T __int128_t xl = x, yl = y; __int128_t rl = xl * yl; - return (int64_t)(rl >> 64); + return (int64_t)(rl >> 64); #else //full 128 bits are x0 * y0 + (x0 * y1 << 32) + (x1 * y0 << 32) + (x1 * y1 << 64) const uint32_t mask = 0xFFFFFFFF; @@ -250,7 +250,7 @@ static inline int64_t libdivide__mullhi_s64(int64_t x, int64_t y) { return x1*(int64_t)y1 + (t >> 32) + (w1 >> 32); #endif } - + #if LIBDIVIDE_USE_SSE2 static inline __m128i libdivide__u64_to_m128(uint64_t x) { @@ -275,7 +275,7 @@ static inline __m128i libdivide_get_FFFFFFFF00000000(void) { __m128i result = _mm_set1_epi8(-1); //optimizes to pcmpeqd on OS X return _mm_slli_epi64(result, 32); } - + static inline __m128i libdivide_get_00000000FFFFFFFF(void) { //returns the same as _mm_set1_epi64(0x00000000FFFFFFFFULL) without touching memory __m128i result = _mm_set1_epi8(-1); //optimizes to pcmpeqd on OS X @@ -288,7 +288,7 @@ static inline __m128i libdivide_get_0000FFFF(void) { __m128i result; //we don't care what its contents are result = _mm_cmpeq_epi8(result, result); //all 1s result = _mm_srli_epi32(result, 16); - return result; + return result; } static inline __m128i libdivide_s64_signbits(__m128i v) { @@ -302,7 +302,7 @@ static inline __m128i libdivide_s64_signbits(__m128i v) { static inline __m128i libdivide_u32_to_m128i(uint32_t amt) { return _mm_set_epi32(0, 0, 0, amt); } - + static inline __m128i libdivide_s64_shift_right_vector(__m128i v, int amt) { //implementation of _mm_sra_epi64. Here we have two 64 bit values which are shifted right to logically become (64 - amt) values, and are then sign extended from a (64 - amt) bit number. const int b = 64 - amt; @@ -320,7 +320,7 @@ static inline __m128i libdivide__mullhi_u32_flat_vector(__m128i a, __m128i b) { return _mm_or_si128(hi_product_0Z2Z, hi_product_Z1Z3); // = hi_product_0123 } - + /* Here, y is assumed to contain one 64 bit value repeated twice. */ static inline __m128i libdivide_mullhi_u64_flat_vector(__m128i x, __m128i y) { //full 128 bits are x0 * y0 + (x0 * y1 << 32) + (x1 * y0 << 32) + (x1 * y1 << 64) @@ -331,12 +331,12 @@ static inline __m128i libdivide_mullhi_u64_flat_vector(__m128i x, __m128i y) { const __m128i x0y1 = _mm_mul_epu32(x0, y1); const __m128i x1y0 = _mm_mul_epu32(x1, y0); const __m128i x1y1 = _mm_mul_epu32(x1, y1); - + const __m128i temp = _mm_add_epi64(x1y0, x0y0_hi); __m128i temp_lo = _mm_and_si128(temp, mask), temp_hi = _mm_srli_epi64(temp, 32); temp_lo = _mm_srli_epi64(_mm_add_epi64(temp_lo, x0y1), 32); temp_hi = _mm_add_epi64(x1y1, temp_hi); - + return _mm_add_epi64(temp_lo, temp_hi); } @@ -349,9 +349,9 @@ static inline __m128i libdivide_mullhi_s64_flat_vector(__m128i x, __m128i y) { p = _mm_sub_epi64(p, t2); return p; } - + #ifdef LIBDIVIDE_USE_SSE4_1 - + /* b is one 32 bit value repeated four times. */ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { __m128i hi_product_0Z2Z = _mm_srli_epi64(_mm_mul_epi32(a, b), 32); @@ -359,7 +359,7 @@ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { __m128i hi_product_Z1Z3 = _mm_and_si128(_mm_mul_epi32(a1X3X, b), libdivide_get_FFFFFFFF00000000()); return _mm_or_si128(hi_product_0Z2Z, hi_product_Z1Z3); // = hi_product_0123 } - + #else /* SSE2 does not have a signed multiplication instruction, but we can convert unsigned to signed pretty efficiently. Again, b is just a 32 bit value repeated four times. */ @@ -373,7 +373,7 @@ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { } #endif #endif - + static inline int32_t libdivide__count_trailing_zeros32(uint32_t val) { #if __GNUC__ || __has_builtin(__builtin_ctz) /* Fast way to count trailing zeros */ @@ -389,7 +389,7 @@ static inline int32_t libdivide__count_trailing_zeros32(uint32_t val) { return result; #endif } - + static inline int32_t libdivide__count_trailing_zeros64(uint64_t val) { #if __LP64__ && (__GNUC__ || __has_builtin(__builtin_ctzll)) /* Fast way to count trailing zeros. Note that we disable this in 32 bit because gcc does something horrible - it calls through to a dynamically bound function. */ @@ -401,11 +401,11 @@ static inline int32_t libdivide__count_trailing_zeros64(uint64_t val) { return 32 + libdivide__count_trailing_zeros32((uint32_t)(val >> 32)); #endif } - + static inline int32_t libdivide__count_leading_zeros32(uint32_t val) { #if __GNUC__ || __has_builtin(__builtin_clzll) /* Fast way to count leading zeros */ - return __builtin_clz(val); + return __builtin_clz(val); #else /* Dorky way to count leading zeros. Note that this hangs for val = 0! */ int32_t result = 0; @@ -413,10 +413,10 @@ static inline int32_t libdivide__count_leading_zeros32(uint32_t val) { val <<= 1; result++; } - return result; + return result; #endif } - + static inline int32_t libdivide__count_leading_zeros64(uint64_t val) { #if __GNUC__ || __has_builtin(__builtin_clzll) /* Fast way to count leading zeros */ @@ -450,7 +450,7 @@ static uint32_t libdivide_64_div_32_to_32(uint32_t u1, uint32_t u0, uint32_t v, return result; } #endif - + #if LIBDIVIDE_IS_X86_64 && LIBDIVIDE_GCC_STYLE_ASM static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { //u0 -> rax @@ -465,10 +465,10 @@ static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, } #else - + /* Code taken from Hacker's Delight, http://www.hackersdelight.org/HDcode/divlu.c . License permits inclusion here per http://www.hackersdelight.org/permissions.htm */ -static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { +static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { const uint64_t b = (1ULL << 32); // Number base (16 bits). uint64_t un1, un0, // Norm. dividend LSD's. vn1, vn0, // Norm. divisor digits. @@ -476,25 +476,25 @@ static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, un64, un21, un10,// Dividend digit pairs. rhat; // A remainder. int s; // Shift amount for norm. - + if (u1 >= v) { // If overflow, set rem. if (r != NULL) // to an impossible value, *r = (uint64_t)(-1); // and return the largest return (uint64_t)(-1);} // possible quotient. - + /* count leading zeros */ s = libdivide__count_leading_zeros64(v); // 0 <= s <= 63. - + v = v << s; // Normalize divisor. vn1 = v >> 32; // Break divisor up into vn0 = v & 0xFFFFFFFF; // two 32-bit digits. - + un64 = (u1 << s) | ((u0 >> (64 - s)) & (-s >> 31)); un10 = u0 << s; // Shift dividend left. - + un1 = un10 >> 32; // Break right half of un0 = un10 & 0xFFFFFFFF; // dividend into two digits. - + q1 = un64/vn1; // Compute the first rhat = un64 - q1*vn1; // quotient digit, q1. again1: @@ -502,9 +502,9 @@ again1: q1 = q1 - 1; rhat = rhat + vn1; if (rhat < b) goto again1;} - + un21 = un64*b + un1 - q1*v; // Multiply and subtract. - + q0 = un21/vn1; // Compute the second rhat = un21 - q0*vn1; // quotient digit, q0. again2: @@ -512,21 +512,21 @@ again2: q0 = q0 - 1; rhat = rhat + vn1; if (rhat < b) goto again2;} - + if (r != NULL) // If remainder is wanted, *r = (un21*b + un0 - q0*v) >> s; // return it. return q1*b + q0; } #endif - + #if LIBDIVIDE_ASSERTIONS_ON #define LIBDIVIDE_ASSERT(x) do { if (! (x)) { fprintf(stderr, "Assertion failure on line %ld: %s\n", (long)__LINE__, #x); exit(-1); } } while (0) #else -#define LIBDIVIDE_ASSERT(x) +#define LIBDIVIDE_ASSERT(x) #endif - + #ifndef LIBDIVIDE_HEADER_ONLY - + ////////// UINT32 struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { @@ -537,14 +537,14 @@ struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { } else { const uint32_t floor_log_2_d = 31 - libdivide__count_leading_zeros32(d); - + uint8_t more; uint32_t rem, proposed_m; proposed_m = libdivide_64_div_32_to_32(1U << floor_log_2_d, 0, d, &rem); LIBDIVIDE_ASSERT(rem > 0 && rem < d); const uint32_t e = d - rem; - + /* This power works if e < 2**floor_log_2_d. */ if (e < (1U << floor_log_2_d)) { /* This power works */ @@ -560,7 +560,7 @@ struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { result.magic = 1 + proposed_m; result.more = more; //result.more's shift should in general be ceil_log_2_d. But if we used the smaller power, we subtract one from the shift because we're using the smaller power. If we're using the larger power, we subtract one from the shift because it's taken care of by the add indicator. So floor_log_2_d happens to be correct in both cases. - + } return result; } @@ -582,23 +582,23 @@ uint32_t libdivide_u32_do(uint32_t numer, const struct libdivide_u32_t *denom) { } } - + int libdivide_u32_get_algorithm(const struct libdivide_u32_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U32_SHIFT_PATH) return 0; else if (! (more & LIBDIVIDE_ADD_MARKER)) return 1; else return 2; } - + uint32_t libdivide_u32_do_alg0(uint32_t numer, const struct libdivide_u32_t *denom) { return numer >> (denom->more & LIBDIVIDE_32_SHIFT_MASK); } - + uint32_t libdivide_u32_do_alg1(uint32_t numer, const struct libdivide_u32_t *denom) { uint32_t q = libdivide__mullhi_u32(denom->magic, numer); return q >> denom->more; -} - +} + uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *denom) { // denom->add != 0 uint32_t q = libdivide__mullhi_u32(denom->magic, numer); @@ -608,8 +608,8 @@ uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *den - -#if LIBDIVIDE_USE_SSE2 + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_u32_do_vector(__m128i numers, const struct libdivide_u32_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U32_SHIFT_PATH) { @@ -622,7 +622,7 @@ __m128i libdivide_u32_do_vector(__m128i numers, const struct libdivide_u32_t *de //return t >> denom->shift; __m128i t = _mm_add_epi32(_mm_srli_epi32(_mm_sub_epi32(numers, q), 1), q); return _mm_srl_epi32(t, libdivide_u32_to_m128i(more & LIBDIVIDE_32_SHIFT_MASK)); - + } else { //q >> denom->shift @@ -647,7 +647,7 @@ __m128i libdivide_u32_do_vector_alg2(__m128i numers, const struct libdivide_u32_ } #endif - + /////////// UINT64 struct libdivide_u64_t libdivide_u64_gen(uint64_t d) { @@ -658,14 +658,14 @@ struct libdivide_u64_t libdivide_u64_gen(uint64_t d) { } else { const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(d); - + uint64_t proposed_m, rem; uint8_t more; proposed_m = libdivide_128_div_64_to_64(1ULL << floor_log_2_d, 0, d, &rem); //== (1 << (64 + floor_log_2_d)) / d LIBDIVIDE_ASSERT(rem > 0 && rem < d); const uint64_t e = d - rem; - + /* This power works if e < 2**floor_log_2_d. */ if (e < (1ULL << floor_log_2_d)) { /* This power works */ @@ -702,30 +702,30 @@ uint64_t libdivide_u64_do(uint64_t numer, const struct libdivide_u64_t *denom) { } } - + int libdivide_u64_get_algorithm(const struct libdivide_u64_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U64_SHIFT_PATH) return 0; else if (! (more & LIBDIVIDE_ADD_MARKER)) return 1; else return 2; } - + uint64_t libdivide_u64_do_alg0(uint64_t numer, const struct libdivide_u64_t *denom) { - return numer >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); + return numer >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); } - + uint64_t libdivide_u64_do_alg1(uint64_t numer, const struct libdivide_u64_t *denom) { uint64_t q = libdivide__mullhi_u64(denom->magic, numer); return q >> denom->more; } - + uint64_t libdivide_u64_do_alg2(uint64_t numer, const struct libdivide_u64_t *denom) { uint64_t q = libdivide__mullhi_u64(denom->magic, numer); uint64_t t = ((numer - q) >> 1) + q; return t >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); } - -#if LIBDIVIDE_USE_SSE2 + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_u64_do_vector(__m128i numers, const struct libdivide_u64_t * denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U64_SHIFT_PATH) { @@ -761,11 +761,11 @@ __m128i libdivide_u64_do_vector_alg2(__m128i numers, const struct libdivide_u64_ return _mm_srl_epi64(t, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_64_SHIFT_MASK)); } - + #endif - + /////////// SINT32 - + static inline int32_t libdivide__mullhi_s32(int32_t x, int32_t y) { int64_t xl = x, yl = y; @@ -775,7 +775,7 @@ static inline int32_t libdivide__mullhi_s32(int32_t x, int32_t y) { struct libdivide_s32_t libdivide_s32_gen(int32_t d) { struct libdivide_s32_t result; - + /* If d is a power of 2, or negative a power of 2, we have to use a shift. This is especially important because the magic algorithm fails for -1. To check if d is a power of 2 or its inverse, it suffices to check whether its absolute value has exactly one bit set. This works even for INT_MIN, because abs(INT_MIN) == INT_MIN, and INT_MIN has one bit set and is a power of 2. */ uint32_t absD = (uint32_t)(d < 0 ? -d : d); //gcc optimizes this to the fast abs trick if ((absD & (absD - 1)) == 0) { //check if exactly one bit is set, don't care if absD is 0 since that's divide by zero @@ -784,14 +784,14 @@ struct libdivide_s32_t libdivide_s32_gen(int32_t d) { } else { const uint32_t floor_log_2_d = 31 - libdivide__count_leading_zeros32(absD); - LIBDIVIDE_ASSERT(floor_log_2_d >= 1); - + LIBDIVIDE_ASSERT(floor_log_2_d >= 1); + uint8_t more; //the dividend here is 2**(floor_log_2_d + 31), so the low 32 bit word is 0 and the high word is floor_log_2_d - 1 uint32_t rem, proposed_m; proposed_m = libdivide_64_div_32_to_32(1U << (floor_log_2_d - 1), 0, absD, &rem); const uint32_t e = absD - rem; - + /* We are going to start with a power of floor_log_2_d - 1. This works if works if e < 2**floor_log_2_d. */ if (e < (1U << floor_log_2_d)) { /* This power works */ @@ -807,7 +807,7 @@ struct libdivide_s32_t libdivide_s32_gen(int32_t d) { proposed_m += 1; result.magic = (d < 0 ? -(int32_t)proposed_m : (int32_t)proposed_m); result.more = more; - + } return result; } @@ -832,57 +832,57 @@ int32_t libdivide_s32_do(int32_t numer, const struct libdivide_s32_t *denom) { q += (q < 0); return q; } -} - +} + int libdivide_s32_get_algorithm(const struct libdivide_s32_t *denom) { uint8_t more = denom->more; int positiveDivisor = ! (more & LIBDIVIDE_NEGATIVE_DIVISOR); if (more & LIBDIVIDE_S32_SHIFT_PATH) return (positiveDivisor ? 0 : 1); - else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); + else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); else return 4; } - + int32_t libdivide_s32_do_alg0(int32_t numer, const struct libdivide_s32_t *denom) { uint8_t shifter = denom->more & LIBDIVIDE_32_SHIFT_MASK; int32_t q = numer + ((numer >> 31) & ((1 << shifter) - 1)); return q >> shifter; } - + int32_t libdivide_s32_do_alg1(int32_t numer, const struct libdivide_s32_t *denom) { uint8_t shifter = denom->more & LIBDIVIDE_32_SHIFT_MASK; int32_t q = numer + ((numer >> 31) & ((1 << shifter) - 1)); return - (q >> shifter); } - + int32_t libdivide_s32_do_alg2(int32_t numer, const struct libdivide_s32_t *denom) { int32_t q = libdivide__mullhi_s32(denom->magic, numer); q += numer; q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } - + int32_t libdivide_s32_do_alg3(int32_t numer, const struct libdivide_s32_t *denom) { int32_t q = libdivide__mullhi_s32(denom->magic, numer); q -= numer; q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); - return q; -} - -int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom) { - int32_t q = libdivide__mullhi_s32(denom->magic, numer); - q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } -#if LIBDIVIDE_USE_SSE2 +int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom) { + int32_t q = libdivide__mullhi_s32(denom->magic, numer); + q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; + q += (q < 0); + return q; +} + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_s32_do_vector(__m128i numers, const struct libdivide_s32_t * denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_S32_SHIFT_PATH) { uint32_t shifter = more & LIBDIVIDE_32_SHIFT_MASK; - __m128i roundToZeroTweak = _mm_set1_epi32((1 << shifter) - 1); //could use _mm_srli_epi32 with an all -1 register + __m128i roundToZeroTweak = _mm_set1_epi32((1 << shifter) - 1); //could use _mm_srli_epi32 with an all -1 register __m128i q = _mm_add_epi32(numers, _mm_and_si128(_mm_srai_epi32(numers, 31), roundToZeroTweak)); //q = numer + ((numer >> 31) & roundToZeroTweak); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(shifter)); // q = q >> shifter __m128i shiftMask = _mm_set1_epi32((int32_t)((int8_t)more >> 7)); //set all bits of shift mask = to the sign bit of more @@ -893,7 +893,7 @@ __m128i libdivide_s32_do_vector(__m128i numers, const struct libdivide_s32_t * d __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); if (more & LIBDIVIDE_ADD_MARKER) { __m128i sign = _mm_set1_epi32((int32_t)(int8_t)more >> 7); //must be arithmetic shift - q = _mm_add_epi32(q, _mm_sub_epi32(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); + q = _mm_add_epi32(q, _mm_sub_epi32(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); } q = _mm_sra_epi32(q, libdivide_u32_to_m128i(more & LIBDIVIDE_32_SHIFT_MASK)); //q >>= shift q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); // q += (q < 0) @@ -919,7 +919,7 @@ __m128i libdivide_s32_do_vector_alg2(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_add_epi32(q, numers); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_32_SHIFT_MASK)); - q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); + q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); return q; } @@ -927,7 +927,7 @@ __m128i libdivide_s32_do_vector_alg3(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_sub_epi32(q, numers); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_32_SHIFT_MASK)); - q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); + q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); return q; } @@ -935,16 +935,16 @@ __m128i libdivide_s32_do_vector_alg4(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more)); //q >>= shift q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); // q += (q < 0) - return q; + return q; } #endif - + ///////////// SINT64 - + struct libdivide_s64_t libdivide_s64_gen(int64_t d) { struct libdivide_s64_t result; - + /* If d is a power of 2, or negative a power of 2, we have to use a shift. This is especially important because the magic algorithm fails for -1. To check if d is a power of 2 or its inverse, it suffices to check whether its absolute value has exactly one bit set. This works even for INT_MIN, because abs(INT_MIN) == INT_MIN, and INT_MIN has one bit set and is a power of 2. */ const uint64_t absD = (uint64_t)(d < 0 ? -d : d); //gcc optimizes this to the fast abs trick if ((absD & (absD - 1)) == 0) { //check if exactly one bit is set, don't care if absD is 0 since that's divide by zero @@ -952,14 +952,14 @@ struct libdivide_s64_t libdivide_s64_gen(int64_t d) { result.magic = 0; } else { - const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(absD); - + const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(absD); + //the dividend here is 2**(floor_log_2_d + 63), so the low 64 bit word is 0 and the high word is floor_log_2_d - 1 uint8_t more; uint64_t rem, proposed_m; proposed_m = libdivide_128_div_64_to_64(1ULL << (floor_log_2_d - 1), 0, absD, &rem); const uint64_t e = absD - rem; - + /* We are going to start with a power of floor_log_2_d - 1. This works if works if e < 2**floor_log_2_d. */ if (e < (1ULL << floor_log_2_d)) { /* This power works */ @@ -1000,9 +1000,9 @@ int64_t libdivide_s64_do(int64_t numer, const struct libdivide_s64_t *denom) { q += (q < 0); return q; } -} - - +} + + int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom) { uint8_t more = denom->more; int positiveDivisor = ! (more & LIBDIVIDE_NEGATIVE_DIVISOR); @@ -1010,20 +1010,20 @@ int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom) { else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); else return 4; } - + int64_t libdivide_s64_do_alg0(int64_t numer, const struct libdivide_s64_t *denom) { uint32_t shifter = denom->more & LIBDIVIDE_64_SHIFT_MASK; int64_t q = numer + ((numer >> 63) & ((1LL << shifter) - 1)); - return q >> shifter; + return q >> shifter; } - + int64_t libdivide_s64_do_alg1(int64_t numer, const struct libdivide_s64_t *denom) { //denom->shifter != -1 && demo->shiftMask != 0 uint32_t shifter = denom->more & LIBDIVIDE_64_SHIFT_MASK; int64_t q = numer + ((numer >> 63) & ((1LL << shifter) - 1)); return - (q >> shifter); } - + int64_t libdivide_s64_do_alg2(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q += numer; @@ -1031,20 +1031,20 @@ int64_t libdivide_s64_do_alg2(int64_t numer, const struct libdivide_s64_t *denom q += (q < 0); return q; } - + int64_t libdivide_s64_do_alg3(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q -= numer; q >>= denom->more & LIBDIVIDE_64_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } - + int64_t libdivide_s64_do_alg4(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q >>= denom->more; q += (q < 0); - return q; + return q; } @@ -1065,7 +1065,7 @@ __m128i libdivide_s64_do_vector(__m128i numers, const struct libdivide_s64_t * d __m128i q = libdivide_mullhi_s64_flat_vector(numers, libdivide__u64_to_m128(magic)); if (more & LIBDIVIDE_ADD_MARKER) { __m128i sign = _mm_set1_epi32((int32_t)((int8_t)more >> 7)); //must be arithmetic shift - q = _mm_add_epi64(q, _mm_sub_epi64(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); + q = _mm_add_epi64(q, _mm_sub_epi64(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); } q = libdivide_s64_shift_right_vector(q, more & LIBDIVIDE_64_SHIFT_MASK); //q >>= denom->mult_path.shift q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); // q += (q < 0) @@ -1102,20 +1102,20 @@ __m128i libdivide_s64_do_vector_alg3(__m128i numers, const struct libdivide_s64_ q = _mm_sub_epi64(q, numers); q = libdivide_s64_shift_right_vector(q, denom->more & LIBDIVIDE_64_SHIFT_MASK); q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); // q += (q < 0) - return q; + return q; } __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_t *denom) { __m128i q = libdivide_mullhi_s64_flat_vector(numers, libdivide__u64_to_m128(denom->magic)); q = libdivide_s64_shift_right_vector(q, denom->more); q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); - return q; + return q; } #endif - + /////////// C++ stuff - + #ifdef __cplusplus /* The C++ template design here is a total mess. This needs to be fixed by someone better at templates than I. The current design is: @@ -1131,7 +1131,7 @@ __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_ */ namespace libdivide_internal { - + #if LIBDIVIDE_USE_SSE2 #define MAYBE_VECTOR(x) x #define MAYBE_VECTOR_PARAM __m128i vector_func(__m128i, const DenomType *) @@ -1149,12 +1149,12 @@ namespace libdivide_internal { #endif template - class divider_base { + class divider_base { public: DenomType denom; divider_base(IntType d) : denom(gen_func(d)) { } divider_base(const DenomType & d) : denom(d) { } - + IntType perform_divide(IntType val) const { return do_func(val, &denom); } #if LIBDIVIDE_USE_SSE2 __m128i perform_divide_vector(__m128i val) const { return vector_func(val, &denom); } @@ -1162,37 +1162,37 @@ namespace libdivide_internal { int get_algorithm() const { return get_algo(&denom); } }; - - + + template struct divider_mid { }; - + template<> struct divider_mid { typedef uint32_t IntType; typedef struct libdivide_u32_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; template struct algo<1, J> { typedef denom::divider divider; }; template struct algo<2, J> { typedef denom::divider divider; }; - - /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ + + /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; }; - + template<> struct divider_mid { typedef int32_t IntType; typedef struct libdivide_s32_t DenomType; template struct denom { typedef divider_base divider; }; - - + + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; @@ -1200,36 +1200,36 @@ namespace libdivide_internal { template struct algo<2, J> { typedef denom::divider divider; }; template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; - + }; - + template<> struct divider_mid { typedef uint64_t IntType; typedef struct libdivide_u64_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; template struct algo<1, J> { typedef denom::divider divider; }; template struct algo<2, J> { typedef denom::divider divider; }; - + /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; }; - + template<> struct divider_mid { typedef int64_t IntType; typedef struct libdivide_s64_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; @@ -1248,29 +1248,29 @@ class divider typename libdivide_internal::divider_mid::template algo::divider sub; template friend divider unswitch(const divider & d); divider(const typename libdivide_internal::divider_mid::DenomType & denom) : sub(denom) { } - + public: - + /* Ordinary constructor, that takes the divisor as a parameter. */ divider(T n) : sub(n) { } - + /* Default constructor, that divides by 1 */ divider() : sub(1) { } - + /* Divides the parameter by the divisor, returning the quotient */ T perform_divide(T val) const { return sub.perform_divide(val); } - + #if LIBDIVIDE_USE_SSE2 /* Treats the vector as either two or four packed values (depending on the size), and divides each of them by the divisor, returning the packed quotients. */ - __m128i perform_divide_vector(__m128i val) const { return sub.perform_divide_vector(val); } + __m128i perform_divide_vector(__m128i val) const { return sub.perform_divide_vector(val); } #endif /* Returns the index of algorithm, for use in the unswitch function */ int get_algorithm() const { return sub.get_algorithm(); } // returns the algorithm for unswitching - + /* operator== */ bool operator==(const divider & him) const { return sub.denom.magic == him.sub.denom.magic && sub.denom.more == him.sub.denom.more; } - + bool operator!=(const divider & him) const { return ! (*this == him); } }; @@ -1291,10 +1291,10 @@ __m128i operator/(__m128i numer, const divider & denom) { return denom.perform_divide_vector(numer); } #endif - - + + #endif //__cplusplus - + #endif //LIBDIVIDE_HEADER_ONLY #ifdef __cplusplus } //close namespace libdivide diff --git a/Minecraft.Client/PSVita/PSVitaExtras/zconf.h b/Minecraft.Client/PSVita/PSVitaExtras/zconf.h index 48405ca0b..c1efa7d6f 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/zconf.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/zconf.h @@ -485,7 +485,7 @@ typedef uLong FAR uLongf; # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 +# define z_off64_t long long # else # define z_off64_t z_off_t # endif diff --git a/Minecraft.Client/PSVita/PSVita_App.cpp b/Minecraft.Client/PSVita/PSVita_App.cpp index 956e10b62..542102d2a 100644 --- a/Minecraft.Client/PSVita/PSVita_App.cpp +++ b/Minecraft.Client/PSVita/PSVita_App.cpp @@ -318,7 +318,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() wstring wWorldName = L"TestWorld"; bool isFlat = false; - __int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp index afd01352b..7544c98d8 100644 --- a/Minecraft.Client/PSVita/PSVita_Minecraft.cpp +++ b/Minecraft.Client/PSVita/PSVita_Minecraft.cpp @@ -46,6 +46,7 @@ #include "..\..\Minecraft.Client\Tesselator.h" #include "..\Common\Console_Awards_enum.h" #include "..\..\Minecraft.Client\Options.h" +#include "..\GameRenderer.h" #include "Sentient\SentientManager.h" #include "..\..\Minecraft.World\IntCache.h" #include "..\Textures.h" @@ -657,7 +658,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 - requirements ui to be initialised + // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised app.GetCommerce()->CheckForTrialUpgradeKey(); @@ -904,6 +905,9 @@ int main() #endif ui.tick(); ui.render(); + + pMinecraft->gameRenderer->ApplyGammaPostProcess(); + #if 0 app.HandleButtonPresses(); diff --git a/Minecraft.Client/PSVita/PSVita_UIController.cpp b/Minecraft.Client/PSVita/PSVita_UIController.cpp index f783e7bc9..c3a03acea 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 requirements a bit of main memory for management + vertex buffers. Each object requires 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/PendingConnection.cpp b/Minecraft.Client/PendingConnection.cpp index 72b8f3825..29ab7c281 100644 --- a/Minecraft.Client/PendingConnection.cpp +++ b/Minecraft.Client/PendingConnection.cpp @@ -136,7 +136,9 @@ void PendingConnection::sendPreLoginResponse() else #endif { - connection->send( shared_ptr( new PreLoginPacket(L"-", ugcXuids, ugcXuidCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion,szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),hostIndex, server->m_texturePackId) ) ); + DWORD cappedCount = (ugcXuidCount > 255u) ? 255u : static_cast(ugcXuidCount); + BYTE cappedHostIndex = (hostIndex >= 255u) ? 254 : static_cast(hostIndex); + connection->send( shared_ptr( new PreLoginPacket(L"-", ugcXuids, cappedCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion,szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),cappedHostIndex, server->m_texturePackId) ) ); } } diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index 57b91d154..bbf8355d3 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -12,6 +12,7 @@ #include "..\Minecraft.World\ArrayWithLength.h" #include "..\Minecraft.World\System.h" #include "PlayerList.h" +#include PlayerChunkMap::PlayerChunk::PlayerChunk(int x, int z, PlayerChunkMap *pcm) : pos(x,z) { @@ -102,7 +103,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) auto it = find(parent->knownChunks.begin(), parent->knownChunks.end(), this); if(it != parent->knownChunks.end()) parent->knownChunks.erase(it); } - __int64 id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); + int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); auto it = parent->chunks.find(id); if( it != parent->chunks.end() ) { @@ -204,106 +205,53 @@ void PlayerChunkMap::PlayerChunk::prioritiseTileChanges() prioritised = true; } +// One system id per machine so we send at most once per system. Local = 256, remote = GetSmallId(). +static int getSystemIdForSentTo(INetworkPlayer* np) +{ + if (np == NULL) return -1; + return np->IsLocal() ? 256 : (int)np->GetSmallId(); +} + void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) { - vector< shared_ptr > sentTo; - for (unsigned int i = 0; i < players.size(); i++) + std::unordered_set sentToSystemIds; // O(1) "already sent to this system" check instead of O(N) scan + for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; - - // 4J - don't send to a player we've already sent this data to that shares the same machine. TileUpdatePacket, - // ChunkTilesUpdatePacket and SignUpdatePacket all used to limit themselves to sending once to each machine - // by only sending to the primary player on each machine. This was causing trouble for split screen - // as updates were only coming in for the region round this one player. Now these packets can be sent to any - // player, but we try to restrict the network impact this has by not resending to the one machine - bool dontSend = false; - if( sentTo.size() ) - { - INetworkPlayer *thisPlayer = player->connection->getNetworkPlayer(); - if( thisPlayer == NULL ) - { - dontSend = true; - } - else - { - for(unsigned int j = 0; j < sentTo.size(); j++ ) - { - shared_ptr player2 = sentTo[j]; - INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); - if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) - { - dontSend = true; - } - } - } - } - if( dontSend ) - { + shared_ptr player = players[i]; + INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); + if (thisPlayer == NULL) continue; + int sysId = getSystemIdForSentTo(thisPlayer); + if (sysId >= 0 && sentToSystemIds.find(sysId) != sentToSystemIds.end()) continue; - } - // 4J Changed to get the flag index for the player before we send a packet. This flag is updated when we queue - // for send the first BlockRegionUpdatePacket for this chunk to that player/players system. Therefore there is no need to - // send tile updates or other updates until that has been sent int flagIndex = ServerPlayer::getFlagIndexForChunk(pos, parent->dimension); - if (player->seenChunks.find(pos) != player->seenChunks.end() && (player->connection->isLocal() || g_NetworkManager.SystemFlagGet(player->connection->getNetworkPlayer(),flagIndex) )) + if (player->seenChunks.find(pos) != player->seenChunks.end() && (player->connection->isLocal() || g_NetworkManager.SystemFlagGet(thisPlayer, flagIndex))) { - player->connection->send(packet); - sentTo.push_back(player); - } - } - // Now also check round all the players that are involved in this game. We also want to send the packet - // to them if their system hasn't received it already, but they have received the first BlockRegionUpdatePacket for this - // chunk - - // Make sure we are only doing this for BlockRegionUpdatePacket, ChunkTilesUpdatePacket and TileUpdatePacket. - // We'll be potentially sending to players who aren't on the same level as this packet is intended for, - // and only these 3 packets have so far been updated to be able to encode the level so they are robust - // enough to cope with this - if(!( ( packet->getId() == 51 ) || ( packet->getId() == 52 ) || ( packet->getId() == 53 ) ) ) - { - return; + player->connection->send(packet); + if (sysId >= 0) sentToSystemIds.insert(sysId); + } } + // Also send to other server players who have this chunk (may not be in this chunk's players list) + if (!((packet->getId() == 51) || (packet->getId() == 52) || (packet->getId() == 53))) + return; - for( int i = 0; i < parent->level->getServer()->getPlayers()->players.size(); i++ ) + const vector >& allPlayers = parent->level->getServer()->getPlayers()->players; + for (size_t i = 0; i < allPlayers.size(); i++) { - shared_ptr player = parent->level->getServer()->getPlayers()->players[i]; - // Don't worry about local players, they get all their updates through sharing level with the server anyway - if ( player->connection == NULL ) continue; - if( player->connection->isLocal() ) continue; + shared_ptr player = allPlayers[i]; + if (player->connection == NULL || player->connection->isLocal()) continue; - // Don't worry about this player if they haven't had this chunk yet (this flag will be the - // same for all players on the same system) - int flagIndex = ServerPlayer::getFlagIndexForChunk(pos,parent->dimension); - if(!g_NetworkManager.SystemFlagGet(player->connection->getNetworkPlayer(),flagIndex)) continue; + INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); + if (thisPlayer == NULL) continue; + int sysId = getSystemIdForSentTo(thisPlayer); + if (sysId >= 0 && sentToSystemIds.find(sysId) != sentToSystemIds.end()) + continue; - // From here on the same rules as in the loop above - don't send it if we've already sent to the same system - bool dontSend = false; - if( sentTo.size() ) - { - INetworkPlayer *thisPlayer = player->connection->getNetworkPlayer(); - if( thisPlayer == NULL ) - { - dontSend = true; - } - else - { - for(unsigned int j = 0; j < sentTo.size(); j++ ) - { - shared_ptr player2 = sentTo[j]; - INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); - if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) - { - dontSend = true; - } - } - } - } - if( !dontSend ) - { - player->connection->send(packet); - sentTo.push_back(player); - } + int flagIndex = ServerPlayer::getFlagIndexForChunk(pos, parent->dimension); + if (!g_NetworkManager.SystemFlagGet(thisPlayer, flagIndex)) continue; + + player->connection->send(packet); + if (sysId >= 0) sentToSystemIds.insert(sysId); } } @@ -421,7 +369,7 @@ ServerLevel *PlayerChunkMap::getLevel() void PlayerChunkMap::tick() { - __int64 time = level->getGameTime(); + int64_t time = level->getGameTime(); if (time - lastInhabitedUpdate > Level::TICKS_PER_DAY / 3) { @@ -474,13 +422,13 @@ void PlayerChunkMap::tick() bool PlayerChunkMap::hasChunk(int x, int z) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); return chunks.find(id) != chunks.end(); } PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); auto it = chunks.find(id); PlayerChunk *chunk = nullptr; @@ -502,7 +450,7 @@ PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) // queue a request for it to be created. void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, shared_ptr player) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); auto it = chunks.find(id); if( it != chunks.end() ) @@ -529,7 +477,7 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: - unordered_map<__int64,PlayerChunk *,LongKeyHash,LongKeyEq> chunks; // 4J - was LongHashMap + unordered_map chunks; // 4J - was LongHashMap vector changedChunks; vector knownChunks; vector addRequests; // 4J added @@ -82,7 +82,7 @@ private: ServerLevel *level; int radius; int dimension; - __int64 lastInhabitedUpdate; + int64_t lastInhabitedUpdate; public: PlayerChunkMap(ServerLevel *level, int dimension, int radius); diff --git a/Minecraft.Client/PlayerConnection.h b/Minecraft.Client/PlayerConnection.h index c691e6f5b..ff6093a34 100644 --- a/Minecraft.Client/PlayerConnection.h +++ b/Minecraft.Client/PlayerConnection.h @@ -30,9 +30,9 @@ private: bool didTick; int lastKeepAliveId; - __int64 lastKeepAliveTime; + int64_t lastKeepAliveTime; static Random random; - __int64 lastKeepAliveTick; + int64_t lastKeepAliveTick; int chatSpamTickCount; int dropSpamTickCount; @@ -81,7 +81,7 @@ private: public: // 4J Stu - Handlers only valid in debug mode -#ifndef _CONTENT_PACKAGE +#ifndef _CONTENT_PACKAGE virtual void handleContainerSetSlot(shared_ptr packet); #endif virtual void handleContainerClick(shared_ptr packet); @@ -89,14 +89,14 @@ public: virtual void handleSetCreativeModeSlot(shared_ptr packet); virtual void handleContainerAck(shared_ptr packet); virtual void handleSignUpdate(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); + virtual void handleKeepAlive(shared_ptr packet); virtual void handlePlayerInfo(shared_ptr packet); // 4J Added virtual bool isServerPacketListener(); virtual void handlePlayerAbilities(shared_ptr playerAbilitiesPacket); virtual void handleCustomPayload(shared_ptr customPayloadPacket); virtual bool isDisconnected(); - // 4J Added + // 4J Added virtual void handleCraftItem(shared_ptr packet); virtual void handleTradeItem(shared_ptr packet); virtual void handleDebugOptions(shared_ptr packet); diff --git a/Minecraft.Client/PlayerList.cpp b/Minecraft.Client/PlayerList.cpp index 40b26d8cd..a70efebe5 100644 --- a/Minecraft.Client/PlayerList.cpp +++ b/Minecraft.Client/PlayerList.cpp @@ -56,11 +56,8 @@ PlayerList::PlayerList(MinecraftServer *server) //int viewDistance = server->settings->getInt(L"view-distance", 10); -#ifdef _WINDOWS64 - maxPlayers = MINECRAFT_NET_MAX_PLAYERS; -#else - maxPlayers = server->settings->getInt(L"max-players", 20); -#endif + int rawMax = server->settings->getInt(L"max-players", 8); + maxPlayers = (unsigned int)Mth::clamp(rawMax, 1, MINECRAFT_NET_MAX_PLAYERS); doWhiteList = false; InitializeCriticalSection(&m_kickPlayersCS); InitializeCriticalSection(&m_closePlayersCS); @@ -79,7 +76,7 @@ PlayerList::~PlayerList() DeleteCriticalSection(&m_closePlayersCS); } -void PlayerList::placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet) +bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet) { CompoundTag *playerTag = load(player); @@ -129,13 +126,13 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr ServerLevel *level = server->getLevel(player->dimension); - DWORD playerIndex = 0; + DWORD playerIndex = (DWORD)MINECRAFT_NET_MAX_PLAYERS; { bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS]; ZeroMemory( &usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool) ); - for (auto& player : players ) + for (auto& p : players ) { - usedIndexes[player->getPlayerIndex()] = true; + usedIndexes[p->getPlayerIndex()] = true; } for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { @@ -146,6 +143,12 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr } } } + if (playerIndex >= (unsigned int)MINECRAFT_NET_MAX_PLAYERS) + { + connection->send(shared_ptr(new DisconnectPacket(DisconnectPacket::eDisconnect_ServerFull))); + connection->sendAndQuit(); + return false; + } player->setPlayerIndex( playerIndex ); player->setCustomSkin( packet->m_playerSkinId ); player->setCustomCape( packet->m_playerCapeId ); @@ -233,8 +236,9 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr addPlayerToReceiving( player ); + int maxPlayersForPacket = getMaxPlayers() > 255 ? 255 : getMaxPlayers(); playerConnection->send( shared_ptr( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), - (uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) getMaxPlayers(), + (uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) maxPlayersForPacket, 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) ) ); @@ -296,6 +300,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr } } } + return true; } void PlayerList::updateEntireScoreboard(ServerScoreboard *scoreboard, shared_ptr player) @@ -513,11 +518,7 @@ if (player->riding != NULL) shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) { -#ifdef _WINDOWS64 - if (players.size() >= (unsigned int)MINECRAFT_NET_MAX_PLAYERS) -#else if (players.size() >= (unsigned int)maxPlayers) -#endif { pendingConnection->disconnect(DisconnectPacket::eDisconnect_ServerFull); return shared_ptr(); diff --git a/Minecraft.Client/PlayerList.h b/Minecraft.Client/PlayerList.h index 6a6ee94c9..03ed2398b 100644 --- a/Minecraft.Client/PlayerList.h +++ b/Minecraft.Client/PlayerList.h @@ -64,7 +64,7 @@ public: public: PlayerList(MinecraftServer *server); ~PlayerList(); - void placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet); + bool placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet); protected: void updateEntireScoreboard(ServerScoreboard *scoreboard, shared_ptr player); diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index 71c05067b..ff930a133 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -14,19 +14,44 @@ #include "..\Minecraft.World\net.minecraft.h" #include "..\Minecraft.World\StringHelpers.h" -const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = +static unsigned int nametagColorForIndex(int index) { - 0xff000000, // WHITE (represents the "white" player, but using black as the colour) - 0xff33cc33, // GREEN - 0xffcc3333, // RED - 0xff3333cc, // BLUE -#ifndef __PSVITA__ // only 4 player on Vita - 0xffcc33cc, // PINK - 0xffcc6633, // ORANGE - 0xffcccc33, // YELLOW - 0xff33dccc, // TURQUOISE + static const unsigned int s_firstColors[] = { + 0xff000000, // WHITE (represents the "white" player, but using black as the colour) + 0xff33cc33, // GREEN + 0xffcc3333, // RED + 0xff3333cc, // BLUE + 0xffcc33cc, // PINK + 0xffcc6633, // ORANGE + 0xffcccc33, // YELLOW + 0xff33dccc // TURQUOISE + }; +#ifndef __PSVITA__ + if (index >= 0 && index < 8) // Use original colors for the first 8 players + return s_firstColors[index]; + if (index >= 8 && index < MINECRAFT_NET_MAX_PLAYERS) + { + float h = (float)((index * 137) % 360) / 60.f; + int i = (int)h; + float f = h - i; + float q = 1.f - f; + float t = 1.f - (1.f - f); + float r = 0.f, g = 0.f, b = 0.f; + switch (i % 6) + { + case 0: r = 1.f; g = t; b = 0.f; break; + case 1: r = q; g = 1.f; b = 0.f; break; + case 2: r = 0.f; g = 1.f; b = t; break; + case 3: r = 0.f; g = q; b = 1.f; break; + case 4: r = t; g = 0.f; b = 1.f; break; + default: r = 1.f; g = 0.f; b = q; break; + } + int ri = (int)(r * 255.f) & 0xff, gi = (int)(g * 255.f) & 0xff, bi = (int)(b * 255.f) & 0xff; + return 0xff000000u | (ri << 16) | (gi << 8) | bi; + } #endif -}; + return 0xFF000000; //Fallback if exceeds 256 somehow +} ResourceLocation PlayerRenderer::DEFAULT_LOCATION = ResourceLocation(TN_MOB_CHAR); @@ -41,9 +66,7 @@ PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0 unsigned int PlayerRenderer::getNametagColour(int index) { if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS) - { - return s_nametagColors[index]; - } + return nametagColorForIndex(index); return 0xFF000000; } diff --git a/Minecraft.Client/PlayerRenderer.h b/Minecraft.Client/PlayerRenderer.h index 25c32a308..494ff795f 100644 --- a/Minecraft.Client/PlayerRenderer.h +++ b/Minecraft.Client/PlayerRenderer.h @@ -13,9 +13,6 @@ public: static ResourceLocation DEFAULT_LOCATION; private: - // 4J Added - static const unsigned int s_nametagColors[MINECRAFT_NET_MAX_PLAYERS]; - HumanoidModel *humanoidModel; HumanoidModel *armorParts1; HumanoidModel *armorParts2; diff --git a/Minecraft.Client/ProgressRenderer.cpp b/Minecraft.Client/ProgressRenderer.cpp index a7c3fd301..575a4510a 100644 --- a/Minecraft.Client/ProgressRenderer.cpp +++ b/Minecraft.Client/ProgressRenderer.cpp @@ -24,7 +24,7 @@ void ProgressRenderer::progressStart(int title) void ProgressRenderer::progressStartNoAbort(int string) { - noAbort = true; + noAbort = true; _progressStart(string); } @@ -36,7 +36,7 @@ void ProgressRenderer::_progressStart(int title) if (noAbort) return; // throw new StopGameException(); // 4J - removed } - + EnterCriticalSection( &ProgressRenderer::s_progress ); lastPercent = 0; this->title = title; @@ -88,7 +88,7 @@ void ProgressRenderer::progressStagePercentage(int i) } - __int64 now = System::currentTimeMillis(); + int64_t now = System::currentTimeMillis(); if (now - lastTime < 20) return; lastTime = now; diff --git a/Minecraft.Client/ProgressRenderer.h b/Minecraft.Client/ProgressRenderer.h index 29c847d06..a66c73fbd 100644 --- a/Minecraft.Client/ProgressRenderer.h +++ b/Minecraft.Client/ProgressRenderer.h @@ -25,7 +25,7 @@ private: int status; Minecraft *minecraft; int title; - __int64 lastTime; + int64_t lastTime; bool noAbort; wstring m_wstrText; eProgressStringType m_eType; diff --git a/Minecraft.Client/ScrolledSelectionList.h b/Minecraft.Client/ScrolledSelectionList.h index 77ec1fd8b..0fc38e500 100644 --- a/Minecraft.Client/ScrolledSelectionList.h +++ b/Minecraft.Client/ScrolledSelectionList.h @@ -28,7 +28,7 @@ private: float yo; int lastSelection; - __int64 lastSelectionTime ; + int64_t lastSelectionTime ; bool renderSelection; bool _renderHeader; @@ -40,7 +40,7 @@ public: protected: void setRenderHeader(bool renderHeader, int headerHeight); - virtual int getNumberOfItems() = 0; + virtual int getNumberOfItems() = 0; virtual void selectItem(int item, bool doubleClick) = 0; virtual bool isSelectedItem(int item) = 0; virtual int getMaxPosition(); diff --git a/Minecraft.Client/SelectWorldScreen.cpp b/Minecraft.Client/SelectWorldScreen.cpp index 0481f1e53..ebae8c83d 100644 --- a/Minecraft.Client/SelectWorldScreen.cpp +++ b/Minecraft.Client/SelectWorldScreen.cpp @@ -294,7 +294,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int swprintf(buffer,20,L"%d/%d/%d %d:%02d",time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this id = id + L" (" + buffer; - __int64 size = levelSummary->getSizeOnDisk(); + int64_t size = levelSummary->getSizeOnDisk(); id = id + L", " + std::to_wstring(static_cast(size / 1024 * 100 / 1024 / 100.0f)) + L" MB)"; wstring info; diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index cacd0e011..8fae81c86 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -207,7 +207,7 @@ void ServerLevel::tick() if (getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT)) { // skip time until new day - __int64 newTime = levelData->getDayTime() + TICKS_PER_DAY; + int64_t newTime = levelData->getDayTime() + TICKS_PER_DAY; // 4J : WESTY : Changed so that time update goes through stats tracking update code. //levelData->setTime(newTime - (newTime % TICKS_PER_DAY)); @@ -248,7 +248,7 @@ void ServerLevel::tick() //4J - temporarily disabling saves as they are causing gameplay to generally stutter quite a lot - __int64 time = levelData->getGameTime() + 1; + int64_t time = levelData->getGameTime() + 1; // 4J Stu - Putting this back in, but I have reduced the number of chunks that save when not forced #ifdef _LARGE_WORLDS if (time % (saveInterval) == (dimension->id + 1)) @@ -1232,9 +1232,9 @@ EntityTracker *ServerLevel::getTracker() return tracker; } -void ServerLevel::setTimeAndAdjustTileTicks(__int64 newTime) +void ServerLevel::setTimeAndAdjustTileTicks(int64_t newTime) { - __int64 delta = newTime - levelData->getGameTime(); + int64_t delta = newTime - levelData->getGameTime(); // 4J - can't directly adjust m_delay in a set as it has a const interator, since changing values in here might change the ordering of the elements in the set. // Instead move to a vector, do the adjustment, put back in the set. vector temp; diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index dff214f5d..baf07084e 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -122,7 +122,7 @@ protected: public: MinecraftServer *getServer(); EntityTracker *getTracker(); - void setTimeAndAdjustTileTicks(__int64 newTime); + void setTimeAndAdjustTileTicks(int64_t newTime); PlayerChunkMap *getChunkMap(); PortalForcer *getPortalForcer(); void sendParticles(const wstring &name, double x, double y, double z, int count); diff --git a/Minecraft.Client/ServerPlayer.cpp b/Minecraft.Client/ServerPlayer.cpp index 76332358c..789b31766 100644 --- a/Minecraft.Client/ServerPlayer.cpp +++ b/Minecraft.Client/ServerPlayer.cpp @@ -395,9 +395,9 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) okToSend = true; MinecraftServer::chunkPacketManagement_DidSendTo(connection->getNetworkPlayer()); -// static unordered_map mapLastTime; -// __int64 thisTime = System::currentTimeMillis(); -// __int64 lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; +// static unordered_map mapLastTime; +// int64_t thisTime = System::currentTimeMillis(); +// int64_t lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; // app.DebugPrintf(" - OK to send (%d ms since last)\n", thisTime - lastTime); // mapLastTime[connection->getNetworkPlayer()->GetUID().toString()] = thisTime; } @@ -428,9 +428,9 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) { // app.DebugPrintf("Creating BRUP for %d %d\n",nearest.x, nearest.z); PIXBeginNamedEvent(0,"Creation BRUP for sending\n"); - __int64 before = System::currentTimeMillis(); + int64_t before = System::currentTimeMillis(); shared_ptr packet = shared_ptr( new BlockRegionUpdatePacket(nearest.x * 16, 0, nearest.z * 16, 16, Level::maxBuildHeight, 16, level) ); - __int64 after = System::currentTimeMillis(); + int64_t after = System::currentTimeMillis(); // app.DebugPrintf(">>><<< %d ms\n",after-before); PIXEndNamedEvent(); if( dontDelayChunks ) packet->shouldDelay = false; diff --git a/Minecraft.Client/ServerPlayer.h b/Minecraft.Client/ServerPlayer.h index 57ea89479..aefa4a42f 100644 --- a/Minecraft.Client/ServerPlayer.h +++ b/Minecraft.Client/ServerPlayer.h @@ -41,7 +41,7 @@ private: int lastSentExp; int invulnerableTime; int viewDistance; - __int64 lastActionTime; + int64_t lastActionTime; int lastBrupSendTickCount; // 4J Added public: @@ -169,5 +169,5 @@ public: protected: // 4J Added to record telemetry of player deaths, this should store the last source of damage - ETelemetryChallenges m_lastDamageSource; + ETelemetryChallenges m_lastDamageSource; }; diff --git a/Minecraft.Client/StringTable.cpp b/Minecraft.Client/StringTable.cpp index e4baecac5..234a8943b 100644 --- a/Minecraft.Client/StringTable.cpp +++ b/Minecraft.Client/StringTable.cpp @@ -44,7 +44,7 @@ void StringTable::ProcessStringTableData(void) app.getLocale(locales); bool foundLang = false; - __int64 bytesToSkip = 0; + int64_t bytesToSkip = 0; int dataSize = 0; // diff --git a/Minecraft.Client/TexturePack.cpp b/Minecraft.Client/TexturePack.cpp index 7ed208ae3..5bb32af8d 100644 --- a/Minecraft.Client/TexturePack.cpp +++ b/Minecraft.Client/TexturePack.cpp @@ -58,7 +58,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/,const char *pc } #elif __PSVITA__ - char *pchUsrDir="";//getUsrDirPath(); + const char *pchUsrDir="";//getUsrDirPath(); wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index 11676e492..f3d7719e8 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -25,7 +25,7 @@ C4JRender::eTextureFormat Textures::TEXTURE_FORMAT = C4JRender::TEXTURE_FORMAT_R int Textures::preLoadedIdx[TN_COUNT]; const wchar_t *Textures::preLoaded[TN_COUNT] = - { +{ L"%blur%misc/pumpkinblur", // L"%blur%/misc/vignette", // Not currently used L"%clamp%misc/shadow", @@ -1521,7 +1521,7 @@ TEXTURE_NAME TUImages[] = // This is for any TU textures that aren't part of our enum indexed preload set const wchar_t *TUImagePaths[] = - { +{ L"font/Default", L"font/Mojangles_7", L"font/Mojangles_11", @@ -1580,7 +1580,7 @@ TEXTURE_NAME OriginalImages[] = }; const wchar_t *OriginalImagesPaths[] = - { +{ L"misc/watercolor.png", NULL diff --git a/Minecraft.Client/Textures.h b/Minecraft.Client/Textures.h index 4ef072588..1fca56106 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -243,7 +243,7 @@ public: static C4JRender::eTextureFormat TEXTURE_FORMAT; private: - static const 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 d2abdf70c..f7c03225c 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -4167,7 +4167,7 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z ) if (tt == Tile::tallgrass) { - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; xt += ((((seed >> 16) & 0xf) / 15.0f) - 0.5f) * 0.5f; @@ -4406,7 +4406,7 @@ bool TileRenderer::tesselateLilypadInWorld(Tile *tt, int x, int y, int z) float u1 = tex->getU1(true); float v1 = tex->getV1(true); - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; int dir = (int) ((seed >> 16) & 0x3); @@ -5261,7 +5261,7 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile* { if ( getTexture(tt)->getFlags() == Icon::IS_GRASS_TOP ) tintSides = false; } - else if (hasFixedTexture()) + else if (hasFixedTexture()) { tintSides = false; } @@ -5528,7 +5528,7 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile* float ll00z = tt->getShadeBrightness(level, pX, pY, pZ - 1); { - if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 + if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 { float _ll1 = (llx0z + llxYz + ll00z + ll0Yz) / 4.0f; float _ll2 = (ll00z + ll0Yz + llX0z + llXYz) / 4.0f; @@ -5683,7 +5683,7 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile* float ll00Z = tt->getShadeBrightness(level, pX, pY, pZ + 1); { - if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 + if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 { float _ll1 = (llx0Z + llxYZ + ll00Z + ll0YZ) / 4.0f; float _ll4 = (ll00Z + ll0YZ + llX0Z + llXYZ) / 4.0f; @@ -5834,7 +5834,7 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile* float llx00 = tt->getShadeBrightness(level, pX - 1, pY, pZ); { - if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 + if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 { float _ll4 = (llxy0 + llxyZ + llx00 + llx0Z) / 4.0f; float _ll1 = (llx00 + llx0Z + llxY0 + llxYZ) / 4.0f; @@ -5985,7 +5985,7 @@ bool TileRenderer::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Tile* float llX00 = tt->getShadeBrightness(level, pX + 1, pY, pZ); { - if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 + if(smoothShapeLighting) // MGH - unifying tesselateBlockInWorldWithAmbienceOcclusionTexLighting and tesselateBlockInWorldWithAmbienceOcclusionTexLighting2 { float _ll1 = (llXy0 + llXyZ + llX00 + llX0Z) / 4.0f; float _ll2 = (llXyz + llXy0 + llX0z + llX00) / 4.0f; @@ -7959,7 +7959,7 @@ void TileRenderer::renderTile( Tile* tile, int data, float brightness, float fAl data = Facing::UP; } - tile->updateDefaultShape(); + tile->updateDefaultShape(); setShape(tile); glRotatef(90, 0, 1, 0); diff --git a/Minecraft.Client/Timer.cpp b/Minecraft.Client/Timer.cpp index 15a2c2f13..636904b7c 100644 --- a/Minecraft.Client/Timer.cpp +++ b/Minecraft.Client/Timer.cpp @@ -20,9 +20,9 @@ Timer::Timer(float ticksPerSecond) void Timer::advanceTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + // 4J - Use high-resolution timer for 'now' in seconds double now = System::nanoTime() / 1000000000.0; @@ -40,8 +40,8 @@ void Timer::advanceTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 msSysTime = (__int64)(now * 1000.0); - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t msSysTime = (int64_t)(now * 1000.0); + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; @@ -51,7 +51,7 @@ void Timer::advanceTime() } if (accumMs < 0) { - lastMsSysTime = (__int64)(now * 1000.0); + lastMsSysTime = (int64_t)(now * 1000.0); } } lastMs = nowMs; @@ -89,9 +89,9 @@ void Timer::advanceTimeQuickly() void Timer::skipTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; @@ -108,7 +108,7 @@ void Timer::skipTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; diff --git a/Minecraft.Client/Timer.h b/Minecraft.Client/Timer.h index f9737eb09..8bea39d42 100644 --- a/Minecraft.Client/Timer.h +++ b/Minecraft.Client/Timer.h @@ -17,9 +17,9 @@ public: float passedTime; private: - __int64 lastMs; - __int64 lastMsSysTime; - __int64 accumMs; + int64_t lastMs; + int64_t lastMsSysTime; + int64_t accumMs; double adjustTime; diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h index 896f730a7..45bfb31a9 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h @@ -15,7 +15,7 @@ typedef struct } CONTAINER_METADATA; -typedef struct +typedef struct { char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH]; char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH]; @@ -24,7 +24,7 @@ typedef struct } SAVE_INFO,*PSAVE_INFO; -typedef struct +typedef struct { int iSaveC; PSAVE_INFO SaveInfoA; @@ -43,7 +43,7 @@ class C4JStorage public: // Structs defined in the DLC_Creator, but added here to be used in the app - typedef struct + typedef struct { unsigned int uiFileSize; DWORD dwType; @@ -61,7 +61,7 @@ public: DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs - typedef struct + typedef struct { WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; @@ -71,7 +71,7 @@ public: CACHEINFOSTRUCT; // structure to hold DLC info in TMS - typedef struct + typedef struct { DWORD dwVersion; DWORD dwNewOffers; @@ -111,7 +111,7 @@ public: enum ESaveGameControlState { ESaveGameControl_Idle=0, - ESaveGameControl_Save, + ESaveGameControl_Save, ESaveGameControl_InternalRequestingDevice, ESaveGameControl_InternalGetSaveName, ESaveGameControl_InternalSaving, @@ -122,16 +122,16 @@ public: enum ESaveGameState { ESaveGame_Idle=0, - ESaveGame_Save, + ESaveGame_Save, ESaveGame_InternalRequestingDevice, ESaveGame_InternalGetSaveName, ESaveGame_InternalSaving, ESaveGame_CopySave, ESaveGame_CopyingSave, - ESaveGame_Load, - ESaveGame_GetSavesInfo, - ESaveGame_Rename, - ESaveGame_Delete, + ESaveGame_Load, + ESaveGame_GetSavesInfo, + ESaveGame_Rename, + ESaveGame_Delete, ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail @@ -210,7 +210,7 @@ public: }; - typedef struct + typedef struct { CHAR szFilename[256]; int iFileSize; @@ -218,14 +218,14 @@ public: } TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS; - typedef struct + typedef struct { int iCount; PTMSPP_FILE_DETAILS FileDetailsA; } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; - typedef struct + typedef struct { DWORD dwSize; PBYTE pbData; @@ -264,7 +264,7 @@ public: void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); - void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); bool EnoughSpaceForAMinSaveGame(); @@ -286,12 +286,12 @@ public: // DLC void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); DWORD CancelGetDLCOffers(); void ClearDLCOffers(); XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); @@ -335,7 +335,7 @@ public: unsigned int CRC(unsigned char *buf, int len); // #ifdef _DEBUG -// void SetSaveName(int i); +// void SetSaveName(int i); // #endif // string table for all the Storage problems. Loaded by the application C4JStringTable *m_pStringTable; diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl index 49fbc0131..812c32927 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -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-uint8_t vertex formats; this makes a worst case of 6 bytes of indices + // 16-byte 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-uint8_t vertex format and + // 2. strokes and edge antialiasing. they use a 16-byte vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every // 3 vertices, which means 24 bytes of index data for every 48 bytes // of vertex data. - // 3. textured quads. they use a 16-uint8_t vertex format, have exactly 2 + // 3. textured quads. they use a 16-byte 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. diff --git a/Minecraft.Client/Windows64/Iggy/include/gdraw.h b/Minecraft.Client/Windows64/Iggy/include/gdraw.h index e959d788e..607843266 100644 --- a/Minecraft.Client/Windows64/Iggy/include/gdraw.h +++ b/Minecraft.Client/Windows64/Iggy/include/gdraw.h @@ -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 requirements. + functions Iggy requires. */ RADDEFEND diff --git a/Minecraft.Client/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Windows64/Iggy/include/rrCore.h index e88b5f8c3..17ebee3a4 100644 --- a/Minecraft.Client/Windows64/Iggy/include/rrCore.h +++ b/Minecraft.Client/Windows64/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index d3e408065..3a98a0987 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -125,7 +125,7 @@ void KeyboardMouseInput::Tick() } } - if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd) + if ((m_mouseGrabbed || m_cursorHiddenForUI) && m_windowFocused && g_hWnd) { RECT rc; GetClientRect(g_hWnd, &rc); diff --git a/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp b/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp index ca1d62af7..0ef19438a 100644 --- a/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp +++ b/Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp @@ -8,6 +8,11 @@ #include "WinsockNetLayer.h" #include "..\..\Common\Network\PlatformNetworkManagerStub.h" #include "..\..\..\Minecraft.World\Socket.h" +#include "..\..\..\Minecraft.World\DisconnectPacket.h" +#include "..\..\Minecraft.h" +#include "..\4JLibs\inc\4J_Profile.h" + +static bool RecvExact(SOCKET sock, BYTE* buf, int len); SOCKET WinsockNetLayer::s_listenSocket = INVALID_SOCKET; SOCKET WinsockNetLayer::s_hostConnectionSocket = INVALID_SOCKET; @@ -21,7 +26,7 @@ bool WinsockNetLayer::s_initialized = false; BYTE WinsockNetLayer::s_localSmallId = 0; BYTE WinsockNetLayer::s_hostSmallId = 0; -BYTE WinsockNetLayer::s_nextSmallId = 1; +unsigned int WinsockNetLayer::s_nextSmallId = 1; CRITICAL_SECTION WinsockNetLayer::s_sendLock; CRITICAL_SECTION WinsockNetLayer::s_connectionsLock; @@ -46,6 +51,8 @@ std::vector WinsockNetLayer::s_disconnectedSmallIds; CRITICAL_SECTION WinsockNetLayer::s_freeSmallIdLock; std::vector WinsockNetLayer::s_freeSmallIds; +SOCKET WinsockNetLayer::s_smallIdToSocket[256]; +CRITICAL_SECTION WinsockNetLayer::s_smallIdToSocketLock; bool g_Win64MultiplayerHost = false; bool g_Win64MultiplayerJoin = false; @@ -73,6 +80,9 @@ bool WinsockNetLayer::Initialize() InitializeCriticalSection(&s_discoveryLock); InitializeCriticalSection(&s_disconnectLock); InitializeCriticalSection(&s_freeSmallIdLock); + InitializeCriticalSection(&s_smallIdToSocketLock); + for (int i = 0; i < 256; i++) + s_smallIdToSocket[i] = INVALID_SOCKET; s_initialized = true; @@ -137,6 +147,7 @@ void WinsockNetLayer::Shutdown() s_disconnectedSmallIds.clear(); DeleteCriticalSection(&s_freeSmallIdLock); s_freeSmallIds.clear(); + DeleteCriticalSection(&s_smallIdToSocketLock); WSACleanup(); s_initialized = false; } @@ -155,6 +166,10 @@ bool WinsockNetLayer::HostGame(int port, const char* bindIp) EnterCriticalSection(&s_freeSmallIdLock); s_freeSmallIds.clear(); LeaveCriticalSection(&s_freeSmallIdLock); + EnterCriticalSection(&s_smallIdToSocketLock); + for (int i = 0; i < 256; i++) + s_smallIdToSocket[i] = INVALID_SOCKET; + LeaveCriticalSection(&s_smallIdToSocketLock); struct addrinfo hints = {}; struct addrinfo* result = NULL; @@ -289,6 +304,27 @@ bool WinsockNetLayer::JoinGame(const char* ip, int port) continue; } + if (assignBuf[0] == WIN64_SMALLID_REJECT) + { + BYTE rejectBuf[5]; + if (!RecvExact(s_hostConnectionSocket, rejectBuf, 5)) + { + app.DebugPrintf("Failed to receive reject reason from host\n"); + closesocket(s_hostConnectionSocket); + s_hostConnectionSocket = INVALID_SOCKET; + Sleep(200); + continue; + } + // rejectBuf[0] = packet id (255), rejectBuf[1..4] = 4-uint8_t big-endian reason + int reason = ((rejectBuf[1] & 0xff) << 24) | ((rejectBuf[2] & 0xff) << 16) | + ((rejectBuf[3] & 0xff) << 8) | (rejectBuf[4] & 0xff); + Minecraft::GetInstance()->connectionDisconnected(ProfileManager.GetPrimaryPad(), (DisconnectPacket::eDisconnectReason)reason); + closesocket(s_hostConnectionSocket); + s_hostConnectionSocket = INVALID_SOCKET; + freeaddrinfo(result); + return false; + } + assignedSmallId = assignBuf[0]; connected = true; break; @@ -370,18 +406,31 @@ bool WinsockNetLayer::SendToSmallId(BYTE targetSmallId, const void* data, int da SOCKET WinsockNetLayer::GetSocketForSmallId(BYTE smallId) { - EnterCriticalSection(&s_connectionsLock); - for (size_t i = 0; i < s_connections.size(); i++) - { - if (s_connections[i].smallId == smallId && s_connections[i].active) - { - SOCKET sock = s_connections[i].tcpSocket; - LeaveCriticalSection(&s_connectionsLock); - return sock; - } - } - LeaveCriticalSection(&s_connectionsLock); - return INVALID_SOCKET; + EnterCriticalSection(&s_smallIdToSocketLock); + SOCKET sock = s_smallIdToSocket[smallId]; + LeaveCriticalSection(&s_smallIdToSocketLock); + return sock; +} + +void WinsockNetLayer::ClearSocketForSmallId(BYTE smallId) +{ + EnterCriticalSection(&s_smallIdToSocketLock); + s_smallIdToSocket[smallId] = INVALID_SOCKET; + LeaveCriticalSection(&s_smallIdToSocketLock); +} + +// Send reject handshake: sentinel 0xFF + DisconnectPacket wire format (1 uint8_t id 255 + 4 uint8_t big-endian reason). Then caller closes socket. +static void SendRejectWithReason(SOCKET clientSocket, DisconnectPacket::eDisconnectReason reason) +{ + BYTE buf[6]; + buf[0] = WIN64_SMALLID_REJECT; + buf[1] = (BYTE)255; // DisconnectPacket packet id + int r = (int)reason; + buf[2] = (BYTE)((r >> 24) & 0xff); + buf[3] = (BYTE)((r >> 16) & 0xff); + buf[4] = (BYTE)((r >> 8) & 0xff); + buf[5] = (BYTE)(r & 0xff); + send(clientSocket, (const char*)buf, sizeof(buf), 0); } static bool RecvExact(SOCKET sock, BYTE* buf, int len) @@ -440,6 +489,15 @@ DWORD WINAPI WinsockNetLayer::AcceptThreadProc(LPVOID param) continue; } + extern CPlatformNetworkManagerStub* g_pPlatformNetworkManager; + if (g_pPlatformNetworkManager != NULL && !g_pPlatformNetworkManager->CanAcceptMoreConnections()) + { + app.DebugPrintf("Win64 LAN: Rejecting connection, server at max players\n"); + SendRejectWithReason(clientSocket, DisconnectPacket::eDisconnect_ServerFull); + closesocket(clientSocket); + continue; + } + BYTE assignedSmallId; EnterCriticalSection(&s_freeSmallIdLock); if (!s_freeSmallIds.empty()) @@ -447,14 +505,15 @@ DWORD WINAPI WinsockNetLayer::AcceptThreadProc(LPVOID param) assignedSmallId = s_freeSmallIds.back(); s_freeSmallIds.pop_back(); } - else if (s_nextSmallId < MINECRAFT_NET_MAX_PLAYERS) + else if (s_nextSmallId < (unsigned int)MINECRAFT_NET_MAX_PLAYERS) { - assignedSmallId = s_nextSmallId++; + assignedSmallId = (BYTE)s_nextSmallId++; } else { LeaveCriticalSection(&s_freeSmallIdLock); app.DebugPrintf("Win64 LAN: Server full, rejecting connection\n"); + SendRejectWithReason(clientSocket, DisconnectPacket::eDisconnect_ServerFull); closesocket(clientSocket); continue; } @@ -482,6 +541,10 @@ DWORD WINAPI WinsockNetLayer::AcceptThreadProc(LPVOID param) app.DebugPrintf("Win64 LAN: Client connected, assigned smallId=%d\n", assignedSmallId); + EnterCriticalSection(&s_smallIdToSocketLock); + s_smallIdToSocket[assignedSmallId] = clientSocket; + LeaveCriticalSection(&s_smallIdToSocketLock); + IQNetPlayer* qnetPlayer = &IQNet::m_player[assignedSmallId]; extern void Win64_SetupRemoteQNetPlayer(IQNetPlayer * player, BYTE smallId, bool isHost, bool isLocal); @@ -724,6 +787,13 @@ void WinsockNetLayer::UpdateAdvertisePlayerCount(BYTE count) LeaveCriticalSection(&s_advertiseLock); } +void WinsockNetLayer::UpdateAdvertiseMaxPlayers(BYTE maxPlayers) +{ + EnterCriticalSection(&s_advertiseLock); + s_advertiseData.maxPlayers = maxPlayers; + LeaveCriticalSection(&s_advertiseLock); +} + void WinsockNetLayer::UpdateAdvertiseJoinable(bool joinable) { EnterCriticalSection(&s_advertiseLock); diff --git a/Minecraft.Client/Windows64/Network/WinsockNetLayer.h b/Minecraft.Client/Windows64/Network/WinsockNetLayer.h index fd1280f7d..f30240d32 100644 --- a/Minecraft.Client/Windows64/Network/WinsockNetLayer.h +++ b/Minecraft.Client/Windows64/Network/WinsockNetLayer.h @@ -12,7 +12,8 @@ #pragma comment(lib, "Ws2_32.lib") #define WIN64_NET_DEFAULT_PORT 25565 -#define WIN64_NET_MAX_CLIENTS 7 +#define WIN64_NET_MAX_CLIENTS 255 +#define WIN64_SMALLID_REJECT 0xFF #define WIN64_NET_RECV_BUFFER_SIZE 65536 #define WIN64_NET_MAX_PACKET_SIZE (4 * 1024 * 1024) #define WIN64_LAN_DISCOVERY_PORT 25566 @@ -89,6 +90,7 @@ public: static bool StartAdvertising(int gamePort, const wchar_t* hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer); static void StopAdvertising(); static void UpdateAdvertisePlayerCount(BYTE count); + static void UpdateAdvertiseMaxPlayers(BYTE maxPlayers); static void UpdateAdvertiseJoinable(bool joinable); static bool StartDiscovery(); @@ -116,7 +118,7 @@ private: static BYTE s_localSmallId; static BYTE s_hostSmallId; - static BYTE s_nextSmallId; + static unsigned int s_nextSmallId; static CRITICAL_SECTION s_sendLock; static CRITICAL_SECTION s_connectionsLock; @@ -141,6 +143,12 @@ private: static CRITICAL_SECTION s_freeSmallIdLock; static std::vector s_freeSmallIds; + // O(1) smallId -> socket lookup so we don't scan s_connections (which never shrinks) on every send + static SOCKET s_smallIdToSocket[256]; + static CRITICAL_SECTION s_smallIdToSocketLock; + +public: + static void ClearSocketForSmallId(BYTE smallId); }; extern bool g_Win64MultiplayerHost; diff --git a/Minecraft.Client/Windows64/PostProcesser.cpp b/Minecraft.Client/Windows64/PostProcesser.cpp index 5abd83b47..4c55d3d98 100644 --- a/Minecraft.Client/Windows64/PostProcesser.cpp +++ b/Minecraft.Client/Windows64/PostProcesser.cpp @@ -28,7 +28,11 @@ const char* PostProcesser::g_gammaPSCode = "float4 main(float4 pos : SV_Position, float2 uv : TEXCOORD0) : SV_Target\n" "{\n" " float4 color = sceneTex.Sample(sceneSampler, uv);\n" - " color.rgb = pow(max(color.rgb, 0.0), 1.0 / gamma);\n" + "\n" + " color.rgb = max(color.rgb, 0.0);\n" + "\n" + " color.rgb = pow(color.rgb, 1.0 / gamma);\n" + "\n" " return color;\n" "}\n"; @@ -75,6 +79,9 @@ void PostProcesser::Init() pBackBuffer->GetDesc(&bbDesc); pBackBuffer->Release(); + m_gammaTexWidth = bbDesc.Width; + m_gammaTexHeight = bbDesc.Height; + DXGI_FORMAT texFormat = bbDesc.Format; if (m_wineMode) { @@ -219,7 +226,9 @@ void PostProcesser::Apply() const if (FAILED(hr)) return; - ctx->CopyResource(m_pGammaOffscreenTex, pBackBuffer); + D3D11_BOX srcBox = { 0, 0, 0, m_gammaTexWidth, m_gammaTexHeight, 1 }; + ctx->CopySubresourceRegion(m_pGammaOffscreenTex, 0, 0, 0, 0, pBackBuffer, 0, &srcBox); + pBackBuffer->Release(); D3D11_MAPPED_SUBRESOURCE mapped; const D3D11_MAP mapType = m_wineMode ? D3D11_MAP_WRITE_NO_OVERWRITE : D3D11_MAP_WRITE_DISCARD; @@ -236,16 +245,12 @@ void PostProcesser::Apply() const ctx->OMGetRenderTargets(1, &oldRTV, &oldDSV); UINT numViewports = 1; - D3D11_VIEWPORT oldViewport; + D3D11_VIEWPORT oldViewport = {}; ctx->RSGetViewports(&numViewports, &oldViewport); ID3D11RenderTargetView* bbRTV = g_pRenderTargetView; ctx->OMSetRenderTargets(1, &bbRTV, nullptr); - D3D11_TEXTURE2D_DESC bbDesc; - pBackBuffer->GetDesc(&bbDesc); - pBackBuffer->Release(); - D3D11_VIEWPORT vp; if (m_useCustomViewport) { @@ -253,8 +258,8 @@ void PostProcesser::Apply() const } else { - vp.Width = static_cast(bbDesc.Width); - vp.Height = static_cast(bbDesc.Height); + vp.Width = static_cast(m_gammaTexWidth); + vp.Height = static_cast(m_gammaTexHeight); vp.MinDepth = 0.0f; vp.MaxDepth = 1.0f; vp.TopLeftX = 0; @@ -313,7 +318,8 @@ void PostProcesser::CopyBackbuffer() if (FAILED(hr)) return; - ctx->CopyResource(m_pGammaOffscreenTex, pBackBuffer); + D3D11_BOX srcBox = { 0, 0, 0, m_gammaTexWidth, m_gammaTexHeight, 1 }; + ctx->CopySubresourceRegion(m_pGammaOffscreenTex, 0, 0, 0, 0, pBackBuffer, 0, &srcBox); pBackBuffer->Release(); } @@ -342,7 +348,7 @@ void PostProcesser::ApplyFromCopied() const ctx->OMGetRenderTargets(1, &oldRTV, &oldDSV); UINT numViewports = 1; - D3D11_VIEWPORT oldViewport; + D3D11_VIEWPORT oldViewport = {}; ctx->RSGetViewports(&numViewports, &oldViewport); ID3D11RenderTargetView* bbRTV = g_pRenderTargetView; @@ -355,10 +361,8 @@ void PostProcesser::ApplyFromCopied() const } else { - D3D11_TEXTURE2D_DESC texDesc; - m_pGammaOffscreenTex->GetDesc(&texDesc); - vp.Width = static_cast(texDesc.Width); - vp.Height = static_cast(texDesc.Height); + vp.Width = static_cast(m_gammaTexWidth); + vp.Height = static_cast(m_gammaTexHeight); vp.MinDepth = 0.0f; vp.MaxDepth = 1.0f; vp.TopLeftX = 0; diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index ad9e1f24a..497808e13 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -95,7 +95,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 208fd3f7d..35afc6947 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -44,6 +44,7 @@ #include "..\..\Minecraft.World\compression.h" #include "..\..\Minecraft.World\OldChunkStorage.h" #include "Common/PostProcesser.h" +#include "..\GameRenderer.h" #include "Network\WinsockNetLayer.h" #include "Windows64_Xuid.h" @@ -595,6 +596,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { if (vk == VK_UP) chat->handleHistoryUp(); else chat->handleHistoryDown(); break; } if (vk >= '1' && vk <= '9') // Prevent hotkey conflicts break; + if (vk == VK_SHIFT) + break; } #endif if (vk == VK_SHIFT) @@ -604,7 +607,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) else if (vk == VK_MENU) vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU; g_KBMInput.OnKeyDown(vk); - break; + return DefWindowProc(hWnd, message, wParam, lParam); } case WM_KEYUP: case WM_SYSKEYUP: @@ -1515,6 +1518,9 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, #endif ui.tick(); ui.render(); + + pMinecraft->gameRenderer->ApplyGammaPostProcess(); + #if 0 app.HandleButtonPresses(); diff --git a/Minecraft.Client/Windows64/Windows64_Xuid.h b/Minecraft.Client/Windows64/Windows64_Xuid.h index 93577751a..d46e71939 100644 --- a/Minecraft.Client/Windows64/Windows64_Xuid.h +++ b/Minecraft.Client/Windows64/Windows64_Xuid.h @@ -84,10 +84,10 @@ namespace Win64Xuid if (readBytes == 0) return false; - // Compatibility: earlier experiments may have written raw 8-byte uid.dat. - if (readBytes == sizeof(unsigned __int64)) + // Compatibility: earlier experiments may have written raw 8-uint8_t uid.dat. + if (readBytes == sizeof(uint64_t)) { - unsigned __int64 raw = 0; + uint64_t raw = 0; memcpy(&raw, buffer, sizeof(raw)); PlayerUID parsed = (PlayerUID)raw; if (IsPersistedUidValid(parsed)) @@ -106,7 +106,7 @@ namespace Win64Xuid errno = 0; char* end = NULL; - unsigned __int64 raw = _strtoui64(begin, &end, 0); + uint64_t raw = _strtoui64(begin, &end, 0); if (begin == end || errno != 0) return false; @@ -140,7 +140,7 @@ namespace Win64Xuid return written > 0; } - inline unsigned __int64 Mix64(unsigned __int64 x) + inline uint64_t Mix64(uint64_t x) { x += 0x9E3779B97F4A7C15ULL; x = (x ^ (x >> 30)) * 0xBF58476D1CE4E5B9ULL; @@ -153,20 +153,20 @@ namespace Win64Xuid // Avoid rand_s dependency: mix several Win64 runtime values into a 64-bit seed. FILETIME ft = {}; GetSystemTimeAsFileTime(&ft); - unsigned __int64 t = (((unsigned __int64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + uint64_t t = (((uint64_t)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; LARGE_INTEGER qpc = {}; QueryPerformanceCounter(&qpc); - unsigned __int64 seed = t; - seed ^= (unsigned __int64)qpc.QuadPart; - seed ^= ((unsigned __int64)GetCurrentProcessId() << 32); - seed ^= (unsigned __int64)GetCurrentThreadId(); - seed ^= (unsigned __int64)GetTickCount(); - seed ^= (unsigned __int64)(size_t)&qpc; - seed ^= (unsigned __int64)(size_t)GetModuleHandleA(NULL); + uint64_t seed = t; + seed ^= (uint64_t)qpc.QuadPart; + seed ^= ((uint64_t)GetCurrentProcessId() << 32); + seed ^= (uint64_t)GetCurrentThreadId(); + seed ^= (uint64_t)GetTickCount(); + seed ^= (uint64_t)(size_t)&qpc; + seed ^= (uint64_t)(size_t)GetModuleHandleA(NULL); - unsigned __int64 raw = Mix64(seed) ^ Mix64(seed + 0xA0761D6478BD642FULL); + uint64_t raw = Mix64(seed) ^ Mix64(seed + 0xA0761D6478BD642FULL); raw ^= 0x8F4B2D6C1A93E705ULL; raw |= 0x8000000000000000ULL; diff --git a/Minecraft.Client/Windows64Media/DLC/Battle & Beasts 2/BattleAndBeasts2.pck b/Minecraft.Client/Windows64Media/DLC/Battle & Beasts 2/BattleAndBeasts2.pck new file mode 100644 index 000000000..6f042ccaa Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Battle & Beasts 2/BattleAndBeasts2.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Battle & Beasts/BattleAndBeasts.pck b/Minecraft.Client/Windows64Media/DLC/Battle & Beasts/BattleAndBeasts.pck new file mode 100644 index 000000000..f37412222 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Battle & Beasts/BattleAndBeasts.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Birthday Skin Pack/SkinsBirthday.pck b/Minecraft.Client/Windows64Media/DLC/Birthday Skin Pack/SkinsBirthday.pck new file mode 100644 index 000000000..abd8d38ce Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Birthday Skin Pack/SkinsBirthday.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Candy/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Candy/Data/media.arc new file mode 100644 index 000000000..3868c79d0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Candy/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Candy/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Candy/Data/x16Data.pck new file mode 100644 index 000000000..e563879f0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Candy/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Candy/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Candy/TexturePack.pck new file mode 100644 index 000000000..c3f3f592f Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Candy/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/media.arc new file mode 100644 index 000000000..412134598 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/x32Data.pck new file mode 100644 index 000000000..023d98736 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Cartoon/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Cartoon/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Cartoon/TexturePack.pck new file mode 100644 index 000000000..4294d0239 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Cartoon/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/City/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/City/Data/media.arc new file mode 100644 index 000000000..62dc19e7a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/City/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/City/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/City/Data/x32Data.pck new file mode 100644 index 000000000..63aba9a10 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/City/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/City/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/City/TexturePack.pck new file mode 100644 index 000000000..87725da9a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/City/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck b/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck new file mode 100644 index 000000000..7cad273bf Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume II/SkinPackDrWho.pck b/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume II/SkinPackDrWho.pck new file mode 100644 index 000000000..1bd0a8389 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Doctor Who Skins Volume II/SkinPackDrWho.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/media.arc new file mode 100644 index 000000000..2690455e9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/x32Data.pck new file mode 100644 index 000000000..707b88a50 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Fantasy/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Fantasy/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Fantasy/TexturePack.pck new file mode 100644 index 000000000..380dbb03c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Fantasy/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Festive Skin Pack/SkinsFestive.pck b/Minecraft.Client/Windows64Media/DLC/Festive Skin Pack/SkinsFestive.pck new file mode 100644 index 000000000..c2ccd75e2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Festive Skin Pack/SkinsFestive.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halloween Charity/SkinsCharity.pck b/Minecraft.Client/Windows64Media/DLC/Halloween Charity/SkinsCharity.pck new file mode 100644 index 000000000..01e575706 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halloween Charity/SkinsCharity.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halloween/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Halloween/Data/media.arc new file mode 100644 index 000000000..2bb1aaf2b Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halloween/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halloween/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Halloween/Data/x16Data.pck new file mode 100644 index 000000000..afedf110c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halloween/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halloween/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Halloween/TexturePack.pck new file mode 100644 index 000000000..5a5f91b51 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halloween/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Action Figure Hands.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Action Figure Hands.ogg new file mode 100644 index 000000000..8c7320137 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Action Figure Hands.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/An End of Dying.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/An End of Dying.ogg new file mode 100644 index 000000000..139133193 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/An End of Dying.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cairo Suite 2.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cairo Suite 2.ogg new file mode 100644 index 000000000..c210b5436 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cairo Suite 2.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cloaked in Blackness.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cloaked in Blackness.ogg new file mode 100644 index 000000000..2cc6b5a14 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Cloaked in Blackness.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Delta Halo Suite.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Delta Halo Suite.ogg new file mode 100644 index 000000000..c79dd9ca0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Delta Halo Suite.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Dewy Decimate.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Dewy Decimate.ogg new file mode 100644 index 000000000..492e5f23e Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Dewy Decimate.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Earth City.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Earth City.ogg new file mode 100644 index 000000000..b71875ac8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Earth City.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Finale 1.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Finale 1.ogg new file mode 100644 index 000000000..6460c2f42 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Finale 1.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Fingerprints Are Broken.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Fingerprints Are Broken.ogg new file mode 100644 index 000000000..188c4a08a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Fingerprints Are Broken.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/First Step.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/First Step.ogg new file mode 100644 index 000000000..9c6ad0f8f Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/First Step.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flip and Sizzle.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flip and Sizzle.ogg new file mode 100644 index 000000000..ec35e515b Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flip and Sizzle.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flollo.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flollo.ogg new file mode 100644 index 000000000..6bbad9b4c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Flollo.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/GameRules.grf b/Minecraft.Client/Windows64Media/DLC/Halo/Data/GameRules.grf new file mode 100644 index 000000000..c4d59ff17 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/GameRules.grf differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/HALO M02.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/HALO M02.ogg new file mode 100644 index 000000000..3052dac29 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/HALO M02.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/High Charity Suite 1.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/High Charity Suite 1.ogg new file mode 100644 index 000000000..92b4de0ea Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/High Charity Suite 1.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).ogg new file mode 100644 index 000000000..e10e5c062 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Intimate.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Intimate.ogg new file mode 100644 index 000000000..97f4a25b9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Intimate.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Money or Meteors.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Money or Meteors.ogg new file mode 100644 index 000000000..f71c3c28c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Money or Meteors.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Night Dreams.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Night Dreams.ogg new file mode 100644 index 000000000..289516606 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Night Dreams.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Opening Suite 2.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Opening Suite 2.ogg new file mode 100644 index 000000000..5d676f596 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Opening Suite 2.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Quiet Giant.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Quiet Giant.ogg new file mode 100644 index 000000000..5491d4b56 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Quiet Giant.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Rising Legacy.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Rising Legacy.ogg new file mode 100644 index 000000000..7fef64004 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Rising Legacy.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Sacred Icon Suite 1.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Sacred Icon Suite 1.ogg new file mode 100644 index 000000000..2db0de110 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Sacred Icon Suite 1.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Spirit of Fire.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Spirit of Fire.ogg new file mode 100644 index 000000000..eefe425e4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Spirit of Fire.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Still, Moving.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Still, Moving.ogg new file mode 100644 index 000000000..f31ffaa1f Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Still, Moving.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Suite Fall.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Suite Fall.ogg new file mode 100644 index 000000000..af7b33130 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Suite Fall.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Survive.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Survive.ogg new file mode 100644 index 000000000..9bd0d596c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Survive.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/The Big Guns.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/The Big Guns.ogg new file mode 100644 index 000000000..8aeebba63 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/The Big Guns.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Truth And Reconciliation.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Truth And Reconciliation.ogg new file mode 100644 index 000000000..306ae0130 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Truth And Reconciliation.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Wolverines Reborn.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Wolverines Reborn.ogg new file mode 100644 index 000000000..be7127128 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Wolverines Reborn.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/Work Burns and Runaway Grunts.ogg b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Work Burns and Runaway Grunts.ogg new file mode 100644 index 000000000..c363cbde6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/Work Burns and Runaway Grunts.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/halo.mcs b/Minecraft.Client/Windows64Media/DLC/Halo/Data/halo.mcs new file mode 100644 index 000000000..159aa626d Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/halo.mcs differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Halo/Data/media.arc new file mode 100644 index 000000000..27827939e Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Halo/Data/x16Data.pck new file mode 100644 index 000000000..d957bfb73 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halo/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Halo/TexturePack.pck new file mode 100644 index 000000000..423ac2d8a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Halo/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck b/Minecraft.Client/Windows64Media/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck new file mode 100644 index 000000000..5f89ecd5a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck b/Minecraft.Client/Windows64Media/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck new file mode 100644 index 000000000..f0eb1f38a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck b/Minecraft.Client/Windows64Media/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck new file mode 100644 index 000000000..584cc04d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/01-The Fate of the Galaxy.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/01-The Fate of the Galaxy.ogg new file mode 100644 index 000000000..7b78c7b27 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/01-The Fate of the Galaxy.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/02-Leaving Earth.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/02-Leaving Earth.ogg new file mode 100644 index 000000000..1d9020330 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/02-Leaving Earth.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/03-Mars.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/03-Mars.ogg new file mode 100644 index 000000000..57e73d1ed Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/03-Mars.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/04-A Cerberus Agent.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/04-A Cerberus Agent.ogg new file mode 100644 index 000000000..513ed80ab Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/04-A Cerberus Agent.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/05-The View of Palaven.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/05-The View of Palaven.ogg new file mode 100644 index 000000000..35075a421 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/05-The View of Palaven.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/06-A Future for the Krogan.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/06-A Future for the Krogan.ogg new file mode 100644 index 000000000..f19eec242 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/06-A Future for the Krogan.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/07-Surkesh.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/07-Surkesh.ogg new file mode 100644 index 000000000..d361bfd71 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/07-Surkesh.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/08-The Ardat Yakshi.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/08-The Ardat Yakshi.ogg new file mode 100644 index 000000000..268521047 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/08-The Ardat Yakshi.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/09-Rannoch.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/09-Rannoch.ogg new file mode 100644 index 000000000..6bbfc2fa4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/09-Rannoch.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/10-I'm Sorry.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/10-I'm Sorry.ogg new file mode 100644 index 000000000..84264d063 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/10-I'm Sorry.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/11-The Cerberus Plot.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/11-The Cerberus Plot.ogg new file mode 100644 index 000000000..669776b2c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/11-The Cerberus Plot.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/12-The Scientists.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/12-The Scientists.ogg new file mode 100644 index 000000000..ac230df3d Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/12-The Scientists.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/13-Aralakh Company.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/13-Aralakh Company.ogg new file mode 100644 index 000000000..b261d45cc Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/13-Aralakh Company.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/14-Prothean Beacon.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/14-Prothean Beacon.ogg new file mode 100644 index 000000000..6063d429f Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/14-Prothean Beacon.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/15-Defeat.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/15-Defeat.ogg new file mode 100644 index 000000000..73d6a7c09 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/15-Defeat.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/16-Reaper Chase.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/16-Reaper Chase.ogg new file mode 100644 index 000000000..e2b985663 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/16-Reaper Chase.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.ogg new file mode 100644 index 000000000..e653a04ac Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/18-I Was Lost Without You.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/18-I Was Lost Without You.ogg new file mode 100644 index 000000000..fb3733018 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/18-I Was Lost Without You.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/19-The Fleets Arrive.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/19-The Fleets Arrive.ogg new file mode 100644 index 000000000..67ca553b4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/19-The Fleets Arrive.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/20-We Face Our Enemy Together.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/20-We Face Our Enemy Together.ogg new file mode 100644 index 000000000..b86dff6d0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/20-We Face Our Enemy Together.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/21-I'm Proud Of You.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/21-I'm Proud Of You.ogg new file mode 100644 index 000000000..54b1eb044 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/21-I'm Proud Of You.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/22-An End, Once and For All.ogg b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/22-An End, Once and For All.ogg new file mode 100644 index 000000000..8149de71d Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/22-An End, Once and For All.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/GameRules.grf b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/GameRules.grf new file mode 100644 index 000000000..33449e042 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/GameRules.grf differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/masseffect.mcs b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/masseffect.mcs new file mode 100644 index 000000000..e2a3fb417 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/masseffect.mcs differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/media.arc new file mode 100644 index 000000000..83dd17a30 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/x16Data.pck new file mode 100644 index 000000000..08f4f3b44 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Mass Effect/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Mass Effect/TexturePack.pck new file mode 100644 index 000000000..020d763ab Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Mass Effect/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Natural/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Natural/Data/media.arc new file mode 100644 index 000000000..c39353262 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Natural/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Natural/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/Natural/Data/x32Data.pck new file mode 100644 index 000000000..c5f592c42 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Natural/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Natural/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Natural/TexturePack.pck new file mode 100644 index 000000000..54d639721 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Natural/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Plastic/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Plastic/Data/media.arc new file mode 100644 index 000000000..87dfff959 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Plastic/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Plastic/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Plastic/Data/x16Data.pck new file mode 100644 index 000000000..adf5d39ca Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Plastic/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Plastic/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Plastic/TexturePack.pck new file mode 100644 index 000000000..2f8e46f68 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Plastic/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 1/Skins1.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 1/Skins1.pck new file mode 100644 index 000000000..fca0a9a4e Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 1/Skins1.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 2/Skins2.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 2/Skins2.pck new file mode 100644 index 000000000..04cd7e6b3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 2/Skins2.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 3/Skins3.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 3/Skins3.pck new file mode 100644 index 000000000..fac17c2f2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 3/Skins3.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 4/Skins4_XB1.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 4/Skins4_XB1.pck new file mode 100644 index 000000000..435fb41da Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 4/Skins4_XB1.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 5/SkinPack5.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 5/SkinPack5.pck new file mode 100644 index 000000000..4cda4af52 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 5/SkinPack5.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skin Pack 6/SkinPack6.pck b/Minecraft.Client/Windows64Media/DLC/Skin Pack 6/SkinPack6.pck new file mode 100644 index 000000000..03351d9c5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skin Pack 6/SkinPack6.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/01 (A) Dragonborn.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/01 (A) Dragonborn.ogg new file mode 100644 index 000000000..4ea5f3fe6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/01 (A) Dragonborn.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/02 (A) Awake.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/02 (A) Awake.ogg new file mode 100644 index 000000000..d67c1d3c0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/02 (A) Awake.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/03 (A) From Past To Present.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/03 (A) From Past To Present.ogg new file mode 100644 index 000000000..c0f9da734 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/03 (A) From Past To Present.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/06 (A) The City Gates.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/06 (A) The City Gates.ogg new file mode 100644 index 000000000..d6baa937f Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/06 (A) The City Gates.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/08 (A) Dragonsreach.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/08 (A) Dragonsreach.ogg new file mode 100644 index 000000000..86678fc98 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/08 (A) Dragonsreach.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/09 (A) Tooth and Claw.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/09 (A) Tooth and Claw.ogg new file mode 100644 index 000000000..f80c85694 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/09 (A) Tooth and Claw.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/13 (A) Distant Horizons.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/13 (A) Distant Horizons.ogg new file mode 100644 index 000000000..99384df94 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/13 (A) Distant Horizons.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/14 (A) Dawn.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/14 (A) Dawn.ogg new file mode 100644 index 000000000..e36dfb200 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/14 (A) Dawn.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/15 (A) The Jerall Mountains.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/15 (A) The Jerall Mountains.ogg new file mode 100644 index 000000000..879f174a4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/15 (A) The Jerall Mountains.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/17 (A) Secunda.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/17 (A) Secunda.ogg new file mode 100644 index 000000000..f2cb86276 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/17 (A) Secunda.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/19 (B) Frostfall.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/19 (B) Frostfall.ogg new file mode 100644 index 000000000..d48cfe09e Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/19 (B) Frostfall.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/21 (B) Into Darkness.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/21 (B) Into Darkness.ogg new file mode 100644 index 000000000..ecddecb08 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/21 (B) Into Darkness.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/23 (B) Unbound.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/23 (B) Unbound.ogg new file mode 100644 index 000000000..b1ccd9082 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/23 (B) Unbound.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/24 (B) Far Horizons.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/24 (B) Far Horizons.ogg new file mode 100644 index 000000000..58e8a8541 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/24 (B) Far Horizons.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.ogg new file mode 100644 index 000000000..fc21bfd72 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/29 (B) The White River.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/29 (B) The White River.ogg new file mode 100644 index 000000000..d78b78182 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/29 (B) The White River.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/31 (B) Standing Stones.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/31 (B) Standing Stones.ogg new file mode 100644 index 000000000..79df5c175 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/31 (B) Standing Stones.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/33 (B) Tundra.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/33 (B) Tundra.ogg new file mode 100644 index 000000000..57daa99d2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/33 (B) Tundra.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/34 (B) Journey's End.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/34 (B) Journey's End.ogg new file mode 100644 index 000000000..b35268eaa Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/34 (B) Journey's End.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/39 (C) Shadows and Echoes.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/39 (C) Shadows and Echoes.ogg new file mode 100644 index 000000000..b2f200794 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/39 (C) Shadows and Echoes.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/41 (C) Aurora.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/41 (C) Aurora.ogg new file mode 100644 index 000000000..ab7f0656a Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/41 (C) Aurora.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/43 (C) Towers and Shadows.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/43 (C) Towers and Shadows.ogg new file mode 100644 index 000000000..73c9c041d Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/43 (C) Towers and Shadows.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/45 (C) Solitude.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/45 (C) Solitude.ogg new file mode 100644 index 000000000..65c3b0ed4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/45 (C) Solitude.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/46 (C) Watch the Skies.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/46 (C) Watch the Skies.ogg new file mode 100644 index 000000000..f6637bcaa Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/46 (C) Watch the Skies.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/49 (C) Death in the Darkness.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/49 (C) Death in the Darkness.ogg new file mode 100644 index 000000000..c01049ed0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/49 (C) Death in the Darkness.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/52 (C) Wind Guide You.ogg b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/52 (C) Wind Guide You.ogg new file mode 100644 index 000000000..71c837fc4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/52 (C) Wind Guide You.ogg differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/GameRules.grf b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/GameRules.grf new file mode 100644 index 000000000..e59b4efd3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/GameRules.grf differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/media.arc b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/media.arc new file mode 100644 index 000000000..09a91936c Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/media.arc differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/skyrim.mcs b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/skyrim.mcs new file mode 100644 index 000000000..1a561f71b Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/skyrim.mcs differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/x16Data.pck new file mode 100644 index 000000000..ce2af1385 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Skyrim/TexturePack.pck b/Minecraft.Client/Windows64Media/DLC/Skyrim/TexturePack.pck new file mode 100644 index 000000000..c44c03caa Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Skyrim/TexturePack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Star Wars Classic Skin Pack/StarWarsClassicPack.pck b/Minecraft.Client/Windows64Media/DLC/Star Wars Classic Skin Pack/StarWarsClassicPack.pck new file mode 100644 index 000000000..054463799 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Star Wars Classic Skin Pack/StarWarsClassicPack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Star Wars Rebels Skin Pack/StarWarsRebelsPack.pck b/Minecraft.Client/Windows64Media/DLC/Star Wars Rebels Skin Pack/StarWarsRebelsPack.pck new file mode 100644 index 000000000..5f160d1a2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/Star Wars Rebels Skin Pack/StarWarsRebelsPack.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/The Simpsons/SkinPackSimpsons.pck b/Minecraft.Client/Windows64Media/DLC/The Simpsons/SkinPackSimpsons.pck new file mode 100644 index 000000000..9f2c7f743 Binary files /dev/null and b/Minecraft.Client/Windows64Media/DLC/The Simpsons/SkinPackSimpsons.pck differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/back.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/back.ogg index 90517e4c5..ed10cb605 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/back.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/back.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craft.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craft.ogg index eb676afeb..c962c55bb 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craft.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craft.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craftfail.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craftfail.ogg index e71074141..5afc02dcb 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craftfail.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/craftfail.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/focus.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/focus.ogg index 5bcaa849b..ff9da37ae 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/focus.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/focus.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/press.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/press.ogg index 5238bc5b1..e65161f98 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/press.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/press.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scroll.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scroll.ogg new file mode 100644 index 000000000..a34cdef1a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scroll.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scrollfocus.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scrollfocus.ogg index 9359d3489..28055bfb8 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scrollfocus.ogg and b/Minecraft.Client/Windows64Media/Sound/Minecraft/UI/scrollfocus.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1.ogg new file mode 100644 index 000000000..4e4cbd6f3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave10.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave10.ogg new file mode 100644 index 000000000..6cc92960a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave10.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave11.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave11.ogg new file mode 100644 index 000000000..cfc0f3524 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave11.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave12.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave12.ogg new file mode 100644 index 000000000..ee574395f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave12.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave13.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave13.ogg new file mode 100644 index 000000000..3bc322008 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave13.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1_fixed.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1_fixed.ogg new file mode 100644 index 000000000..9f33afa20 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave1_fixed.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave2.ogg new file mode 100644 index 000000000..e3cacc03c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave3.ogg new file mode 100644 index 000000000..573369597 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave4.ogg new file mode 100644 index 000000000..187b67439 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave5.ogg new file mode 100644 index 000000000..36444521e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave6.ogg new file mode 100644 index 000000000..b3339aada Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave7.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave7.ogg new file mode 100644 index 000000000..d3082a6fe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave7.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8.ogg new file mode 100644 index 000000000..962d88851 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8_fixed.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8_fixed.ogg new file mode 100644 index 000000000..7bea57f0b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave8_fixed.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave9.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave9.ogg new file mode 100644 index 000000000..05b0356f9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/cave/cave9.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain1.ogg new file mode 100644 index 000000000..c16859a6e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain2.ogg new file mode 100644 index 000000000..e58fcc9b6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain3.ogg new file mode 100644 index 000000000..c8935e3e4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain4.ogg new file mode 100644 index 000000000..5c2879899 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/rain4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder1.ogg new file mode 100644 index 000000000..a0e561641 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder2.ogg new file mode 100644 index 000000000..43c0b0223 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder3.ogg new file mode 100644 index 000000000..aafdfa0d8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/ambient/weather/thunder3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig1.ogg new file mode 100644 index 000000000..2eb33764c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig2.ogg new file mode 100644 index 000000000..bc6b9b41c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallbig2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallsmall.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallsmall.ogg new file mode 100644 index 000000000..994fefddb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/fallsmall.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh1.ogg new file mode 100644 index 000000000..bb0cad5fe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh2.ogg new file mode 100644 index 000000000..5db1ec7c0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh3.ogg new file mode 100644 index 000000000..293241d34 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/damage/hurtflesh3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth1.ogg new file mode 100644 index 000000000..5ab440368 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth2.ogg new file mode 100644 index 000000000..8a8fe461a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth3.ogg new file mode 100644 index 000000000..4a80077a9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth4.ogg new file mode 100644 index 000000000..3918f5213 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/cloth4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass1.ogg new file mode 100644 index 000000000..aa6c0430d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass2.ogg new file mode 100644 index 000000000..23a056b9a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass3.ogg new file mode 100644 index 000000000..31cabc2c3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass4.ogg new file mode 100644 index 000000000..4a952bcf5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/grass4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel1.ogg new file mode 100644 index 000000000..b47af9ba9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel2.ogg new file mode 100644 index 000000000..b4622e91a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel3.ogg new file mode 100644 index 000000000..c3e5841b4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel4.ogg new file mode 100644 index 000000000..acf7cc77c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/gravel4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand1.ogg new file mode 100644 index 000000000..224740b81 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand2.ogg new file mode 100644 index 000000000..77fafd90b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand3.ogg new file mode 100644 index 000000000..220093995 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand4.ogg new file mode 100644 index 000000000..badd16fc2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/sand4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow1.ogg new file mode 100644 index 000000000..6110b262d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow2.ogg new file mode 100644 index 000000000..6670ebdbd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow3.ogg new file mode 100644 index 000000000..628998909 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow4.ogg new file mode 100644 index 000000000..96ce2d4b0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/snow4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone1.ogg new file mode 100644 index 000000000..ba57cbd41 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone2.ogg new file mode 100644 index 000000000..a3eced97b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone3.ogg new file mode 100644 index 000000000..8a065897a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone4.ogg new file mode 100644 index 000000000..9f3369950 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/stone4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood1.ogg new file mode 100644 index 000000000..151833481 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood2.ogg new file mode 100644 index 000000000..db7f2613f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood3.ogg new file mode 100644 index 000000000..86fcd96ef Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood4.ogg new file mode 100644 index 000000000..891dbf5f8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/dig/wood4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/fire.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/fire.ogg new file mode 100644 index 000000000..de06f4132 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/fire.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/ignite.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/ignite.ogg new file mode 100644 index 000000000..86de01b47 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fire/ignite.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast1.ogg new file mode 100644 index 000000000..f659c8eb8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast_far1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast_far1.ogg new file mode 100644 index 000000000..ddec8bbd7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/blast_far1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast1.ogg new file mode 100644 index 000000000..127661532 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast_far1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast_far1.ogg new file mode 100644 index 000000000..bed8eebaa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/largeblast_far1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/launch1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/launch1.ogg new file mode 100644 index 000000000..31130148a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/launch1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle1.ogg new file mode 100644 index 000000000..ef67c02e7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle_far1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle_far1.ogg new file mode 100644 index 000000000..8a4974b8a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/fireworks/twinkle_far1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lava.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lava.ogg new file mode 100644 index 000000000..783f8e809 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lava.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lavapop.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lavapop.ogg new file mode 100644 index 000000000..782a6e738 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/lavapop.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/splash.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/splash.ogg new file mode 100644 index 000000000..e0beb6136 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/splash.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/water.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/water.ogg new file mode 100644 index 000000000..d446f0822 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/liquid/water.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/birds_screaming_loop.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/birds_screaming_loop.ogg new file mode 100644 index 000000000..dc9e3cebb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/birds_screaming_loop.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/cave_chimes.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/cave_chimes.ogg new file mode 100644 index 000000000..f8d128342 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/cave_chimes.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/ocean.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/ocean.ogg new file mode 100644 index 000000000..8d2f59f31 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/ocean.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/waterfall.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/waterfall.ogg new file mode 100644 index 000000000..eac57799d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/loops/waterfall.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe1.ogg new file mode 100644 index 000000000..b1cc0b6a0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe2.ogg new file mode 100644 index 000000000..8361aaa81 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe3.ogg new file mode 100644 index 000000000..a7f5dfa98 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe4.ogg new file mode 100644 index 000000000..5916b3ddb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/breathe4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/death.ogg new file mode 100644 index 000000000..4c6c8e36f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit1.ogg new file mode 100644 index 000000000..2e12513fe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit2.ogg new file mode 100644 index 000000000..05fbd33ff Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit3.ogg new file mode 100644 index 000000000..c2539dc1a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit4.ogg new file mode 100644 index 000000000..01deec1e8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/blaze/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss1.ogg new file mode 100644 index 000000000..b5432f3ad Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss2.ogg new file mode 100644 index 000000000..52047eea7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss3.ogg new file mode 100644 index 000000000..dee039491 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hiss3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1.ogg new file mode 100644 index 000000000..9379e782b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1/_13646_7069696.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1/_13646_7069696.ogg new file mode 100644 index 000000000..24008f060 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit1/_13646_7069696.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2.ogg new file mode 100644 index 000000000..810c55434 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2/_17818_7086080.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2/_17818_7086080.ogg new file mode 100644 index 000000000..c2ebca01d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit2/_17818_7086080.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3.ogg new file mode 100644 index 000000000..64cfe1f6f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3/_13260_7106560.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3/_13260_7106560.ogg new file mode 100644 index 000000000..827e13f7d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/hit3/_13260_7106560.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow1.ogg new file mode 100644 index 000000000..eb5cd3aef Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow2.ogg new file mode 100644 index 000000000..6e708641c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow3.ogg new file mode 100644 index 000000000..10c3a1562 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow4.ogg new file mode 100644 index 000000000..bf719ce8a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/meow4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr1.ogg new file mode 100644 index 000000000..126b7c020 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr2.ogg new file mode 100644 index 000000000..13eccad39 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr3.ogg new file mode 100644 index 000000000..da9987650 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purr3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow1.ogg new file mode 100644 index 000000000..d5ad0e1ea Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow2.ogg new file mode 100644 index 000000000..c2fc7b995 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cat/purreow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt1.ogg new file mode 100644 index 000000000..3474305c1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt2.ogg new file mode 100644 index 000000000..d073ca5ed Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/plop.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/plop.ogg new file mode 100644 index 000000000..9d8530675 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/plop.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say1.ogg new file mode 100644 index 000000000..e766951fd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say2.ogg new file mode 100644 index 000000000..27f498bc4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say3.ogg new file mode 100644 index 000000000..05e84fa44 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step1.ogg new file mode 100644 index 000000000..9ce15a878 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step2.ogg new file mode 100644 index 000000000..b0b700398 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken1.ogg new file mode 100644 index 000000000..fc23508b2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken2.ogg new file mode 100644 index 000000000..0f0bef5d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken3.ogg new file mode 100644 index 000000000..b17d26e2c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chicken3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt1.ogg new file mode 100644 index 000000000..d07c025cd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt2.ogg new file mode 100644 index 000000000..7bd44e9fb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenhurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenplop.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenplop.ogg new file mode 100644 index 000000000..9dae37004 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/chickenplop.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg new file mode 100644 index 000000000..645bf1997 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg new file mode 100644 index 000000000..3fa9d201f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg new file mode 100644 index 000000000..89273d7af Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg new file mode 100644 index 000000000..278ff2727 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg new file mode 100644 index 000000000..86c76f8f0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg new file mode 100644 index 000000000..9feb04837 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg new file mode 100644 index 000000000..dee0784a0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/say4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step1.ogg new file mode 100644 index 000000000..a7ca69832 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step2.ogg new file mode 100644 index 000000000..d0d071b54 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step3.ogg new file mode 100644 index 000000000..0bfe244e7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step4.ogg new file mode 100644 index 000000000..004a71fa4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow1.ogg new file mode 100644 index 000000000..7f31ff084 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow2.ogg new file mode 100644 index 000000000..4f8fae5b8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow3.ogg new file mode 100644 index 000000000..6210e831d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow4.ogg new file mode 100644 index 000000000..e66a75252 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cow4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt1.ogg new file mode 100644 index 000000000..248978819 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt2.ogg new file mode 100644 index 000000000..c40c44933 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt3.ogg new file mode 100644 index 000000000..7fae84724 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/cowhurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/death.ogg new file mode 100644 index 000000000..9d7f95cb7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say1.ogg new file mode 100644 index 000000000..2d5294388 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say2.ogg new file mode 100644 index 000000000..653adf5f4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say3.ogg new file mode 100644 index 000000000..cb5b7e7f7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say4.ogg new file mode 100644 index 000000000..e683b2377 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper/say4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper1.ogg new file mode 100644 index 000000000..08dd8158c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper2.ogg new file mode 100644 index 000000000..f26238067 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper3.ogg new file mode 100644 index 000000000..80cfceb1b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper4.ogg new file mode 100644 index 000000000..5162b8bbf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeper4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeperdeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeperdeath.ogg new file mode 100644 index 000000000..1ebda4146 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/creeperdeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/end.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/end.ogg new file mode 100644 index 000000000..823b24e70 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/end.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl1.ogg new file mode 100644 index 000000000..3767ed8ae Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl2.ogg new file mode 100644 index 000000000..1bac85bf8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl3.ogg new file mode 100644 index 000000000..d0ab89d79 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl4.ogg new file mode 100644 index 000000000..08af61186 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/growl4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit1.ogg new file mode 100644 index 000000000..1ab1f38fb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit2.ogg new file mode 100644 index 000000000..ad8dca818 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit3.ogg new file mode 100644 index 000000000..256a8db47 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit4.ogg new file mode 100644 index 000000000..00a189c4b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings1.ogg new file mode 100644 index 000000000..279f6394e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings2.ogg new file mode 100644 index 000000000..2a8b9d4b9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings3.ogg new file mode 100644 index 000000000..810120e0e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings4.ogg new file mode 100644 index 000000000..80671bcd2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings5.ogg new file mode 100644 index 000000000..876df3a1a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings6.ogg new file mode 100644 index 000000000..d254ad5ca Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/enderdragon/wings6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/death.ogg new file mode 100644 index 000000000..a61851fd7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit1.ogg new file mode 100644 index 000000000..52110f003 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit2.ogg new file mode 100644 index 000000000..e5a2ec2aa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit3.ogg new file mode 100644 index 000000000..f0430c1c8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit4.ogg new file mode 100644 index 000000000..a0552800e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle1.ogg new file mode 100644 index 000000000..971a835c9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle2.ogg new file mode 100644 index 000000000..104f3f5fc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle3.ogg new file mode 100644 index 000000000..71a938430 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle4.ogg new file mode 100644 index 000000000..636faa7c5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle5.ogg new file mode 100644 index 000000000..af26bab6b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/idle5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal.ogg new file mode 100644 index 000000000..9f3fb6428 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal2.ogg new file mode 100644 index 000000000..7b565314c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/portal2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream1.ogg new file mode 100644 index 000000000..5dfd8f6f7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream2.ogg new file mode 100644 index 000000000..ccc16fbcc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream3.ogg new file mode 100644 index 000000000..39b2291b8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream4.ogg new file mode 100644 index 000000000..f2321f886 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/scream4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/stare.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/stare.ogg new file mode 100644 index 000000000..df1901da8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/endermen/stare.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/affectionate_scream.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/affectionate_scream.ogg new file mode 100644 index 000000000..048ff07ce Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/affectionate_scream.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/charge.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/charge.ogg new file mode 100644 index 000000000..e10dd8c9b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/charge.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/death.ogg new file mode 100644 index 000000000..4982e9a24 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/fireball4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/fireball4.ogg new file mode 100644 index 000000000..c8d61a09e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/fireball4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan1.ogg new file mode 100644 index 000000000..135c97946 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan2.ogg new file mode 100644 index 000000000..d3d679826 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan3.ogg new file mode 100644 index 000000000..503c29f9f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan4.ogg new file mode 100644 index 000000000..d543626e5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan5.ogg new file mode 100644 index 000000000..36a6e63f1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan6.ogg new file mode 100644 index 000000000..00e3fdd8c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan7.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan7.ogg new file mode 100644 index 000000000..a1dd1ca60 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/moan7.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream1.ogg new file mode 100644 index 000000000..36b05c86a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream2.ogg new file mode 100644 index 000000000..ab5e071bb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream3.ogg new file mode 100644 index 000000000..c1e59080b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream4.ogg new file mode 100644 index 000000000..cbdd5f9ed Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream5.ogg new file mode 100644 index 000000000..e1adfa00c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/ghast/scream5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/angry1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/angry1.ogg new file mode 100644 index 000000000..e15f05786 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/angry1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/armor.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/armor.ogg new file mode 100644 index 000000000..ef73b0706 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/armor.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe1.ogg new file mode 100644 index 000000000..9785a6a6f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe2.ogg new file mode 100644 index 000000000..21d0cd5ce Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe3.ogg new file mode 100644 index 000000000..228bfe149 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/breathe3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/death.ogg new file mode 100644 index 000000000..53c22940f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry1.ogg new file mode 100644 index 000000000..d6f922d4e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry2.ogg new file mode 100644 index 000000000..1ad2e8ca6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/angry2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/death.ogg new file mode 100644 index 000000000..1c61118e7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit1.ogg new file mode 100644 index 000000000..4587a9ab2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit2.ogg new file mode 100644 index 000000000..7ae5c684e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit3.ogg new file mode 100644 index 000000000..89aacf361 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle1.ogg new file mode 100644 index 000000000..ad5118afb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle2.ogg new file mode 100644 index 000000000..90286d1e6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle3.ogg new file mode 100644 index 000000000..b797b47c7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/donkey/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop1.ogg new file mode 100644 index 000000000..9b4d45272 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop2.ogg new file mode 100644 index 000000000..334639705 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop3.ogg new file mode 100644 index 000000000..fbf369000 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop4.ogg new file mode 100644 index 000000000..fc3759d3f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/gallop4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit1.ogg new file mode 100644 index 000000000..ccbb50bb7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit2.ogg new file mode 100644 index 000000000..258604773 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit3.ogg new file mode 100644 index 000000000..a071a3c5b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit4.ogg new file mode 100644 index 000000000..1811582b6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle1.ogg new file mode 100644 index 000000000..e632d0411 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle2.ogg new file mode 100644 index 000000000..8d90a9a09 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle3.ogg new file mode 100644 index 000000000..2a9f49616 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/jump.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/jump.ogg new file mode 100644 index 000000000..9c7331752 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/jump.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/land.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/land.ogg new file mode 100644 index 000000000..2ead60f69 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/land.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/leather.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/leather.ogg new file mode 100644 index 000000000..ce54d5782 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/leather.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/death.ogg new file mode 100644 index 000000000..b452efe0d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit1.ogg new file mode 100644 index 000000000..6f8f2f0d6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit2.ogg new file mode 100644 index 000000000..cae10be23 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit3.ogg new file mode 100644 index 000000000..3956a3406 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit4.ogg new file mode 100644 index 000000000..18daf9230 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle1.ogg new file mode 100644 index 000000000..15f0c7b45 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle2.ogg new file mode 100644 index 000000000..d4c6b9e53 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle3.ogg new file mode 100644 index 000000000..77a20a484 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/skeleton/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft1.ogg new file mode 100644 index 000000000..d0ad98211 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft2.ogg new file mode 100644 index 000000000..73cdf9748 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft3.ogg new file mode 100644 index 000000000..09fef94f7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft4.ogg new file mode 100644 index 000000000..83c0d81dd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft5.ogg new file mode 100644 index 000000000..923b097d1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft6.ogg new file mode 100644 index 000000000..aaa869137 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/soft6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood1.ogg new file mode 100644 index 000000000..ae4c4515b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood2.ogg new file mode 100644 index 000000000..f7337c927 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood3.ogg new file mode 100644 index 000000000..77cfb3da0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood4.ogg new file mode 100644 index 000000000..f1117674d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood5.ogg new file mode 100644 index 000000000..6f520caf0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood6.ogg new file mode 100644 index 000000000..15b2d49d0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/wood6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/angry.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/angry.ogg new file mode 100644 index 000000000..5c02bec9e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/angry.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/death.ogg new file mode 100644 index 000000000..71980a37b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit1.ogg new file mode 100644 index 000000000..51226ae9e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit2.ogg new file mode 100644 index 000000000..cc6513be6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit3.ogg new file mode 100644 index 000000000..c292fdc6d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit4.ogg new file mode 100644 index 000000000..4a926d6e6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle1.ogg new file mode 100644 index 000000000..7a6e5e95f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle2.ogg new file mode 100644 index 000000000..84f1fdfd2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle3.ogg new file mode 100644 index 000000000..596869402 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/horse/zombie/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/death.ogg new file mode 100644 index 000000000..23cab8a87 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit1.ogg new file mode 100644 index 000000000..2d9d5fc83 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit2.ogg new file mode 100644 index 000000000..667d35f95 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit3.ogg new file mode 100644 index 000000000..00e9de756 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit4.ogg new file mode 100644 index 000000000..ed86458a8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw.ogg new file mode 100644 index 000000000..1958991a7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw21.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw21.ogg new file mode 100644 index 000000000..614aecea4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/throw21.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk1.ogg new file mode 100644 index 000000000..b593a21bd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk2.ogg new file mode 100644 index 000000000..972ce7f19 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk3.ogg new file mode 100644 index 000000000..a7525d88a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk4.ogg new file mode 100644 index 000000000..a3976379b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/irongolem/walk4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big1.ogg new file mode 100644 index 000000000..65c114e52 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big2.ogg new file mode 100644 index 000000000..0b43fd376 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big3.ogg new file mode 100644 index 000000000..6c1f15fd1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big4.ogg new file mode 100644 index 000000000..858fd3431 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/big4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump1.ogg new file mode 100644 index 000000000..a3186e41b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump2.ogg new file mode 100644 index 000000000..8398ac117 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump3.ogg new file mode 100644 index 000000000..3dbc1d2ec Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump4.ogg new file mode 100644 index 000000000..16899f3e9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/jump4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small1.ogg new file mode 100644 index 000000000..158e2ab24 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small2.ogg new file mode 100644 index 000000000..2f8d6556d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small3.ogg new file mode 100644 index 000000000..bcb942023 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small4.ogg new file mode 100644 index 000000000..47914fc91 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small5.ogg new file mode 100644 index 000000000..8e12dd922 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/magmacube/small5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/death.ogg new file mode 100644 index 000000000..44a04fb6a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say1.ogg new file mode 100644 index 000000000..3750fb8d1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say2.ogg new file mode 100644 index 000000000..187b94939 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say3.ogg new file mode 100644 index 000000000..0076e25f2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step1.ogg new file mode 100644 index 000000000..94581c66b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step2.ogg new file mode 100644 index 000000000..5f7ef198f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step3.ogg new file mode 100644 index 000000000..ebdebd71a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step4.ogg new file mode 100644 index 000000000..00c26dd12 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step5.ogg new file mode 100644 index 000000000..18a56add4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig/step5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig1.ogg new file mode 100644 index 000000000..966466cb3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig2.ogg new file mode 100644 index 000000000..d94a6c023 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig3.ogg new file mode 100644 index 000000000..199f3c4aa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pig3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pigdeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pigdeath.ogg new file mode 100644 index 000000000..b2d216965 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/pigdeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say1.ogg new file mode 100644 index 000000000..b14b2a359 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say2.ogg new file mode 100644 index 000000000..6a7b57e6d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say3.ogg new file mode 100644 index 000000000..d4fe16802 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step1.ogg new file mode 100644 index 000000000..9cb4a54c0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step2.ogg new file mode 100644 index 000000000..8cefe0f42 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step3.ogg new file mode 100644 index 000000000..a7a75fe0f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step4.ogg new file mode 100644 index 000000000..e52380f35 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step5.ogg new file mode 100644 index 000000000..5f5eb10e2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep/step5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep1.ogg new file mode 100644 index 000000000..e21076394 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep2.ogg new file mode 100644 index 000000000..87387b9d6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep3.ogg new file mode 100644 index 000000000..d28e14673 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/sheep3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit1.ogg new file mode 100644 index 000000000..aa44a2b67 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit2.ogg new file mode 100644 index 000000000..27d14cfa0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit3.ogg new file mode 100644 index 000000000..ef4a7fb4c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/kill.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/kill.ogg new file mode 100644 index 000000000..2294940c8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/kill.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say1.ogg new file mode 100644 index 000000000..f78a5a588 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say2.ogg new file mode 100644 index 000000000..d2fcea3e2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say3.ogg new file mode 100644 index 000000000..1d92c0441 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say4.ogg new file mode 100644 index 000000000..c1defbddb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/say4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step1.ogg new file mode 100644 index 000000000..2c828961d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step2.ogg new file mode 100644 index 000000000..2a311e8a4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step3.ogg new file mode 100644 index 000000000..0c2a5e9c4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step4.ogg new file mode 100644 index 000000000..9a4b52eea Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/silverfish/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/death.ogg new file mode 100644 index 000000000..0dd9d8a2e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt1.ogg new file mode 100644 index 000000000..c69cc798f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt2.ogg new file mode 100644 index 000000000..7b848a7b7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt3.ogg new file mode 100644 index 000000000..95f2dd247 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt4.ogg new file mode 100644 index 000000000..f3c37ca0a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/hurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say1.ogg new file mode 100644 index 000000000..a401e5db2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say2.ogg new file mode 100644 index 000000000..53cb17a97 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say3.ogg new file mode 100644 index 000000000..26a75e074 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step1.ogg new file mode 100644 index 000000000..e0d02d62d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step2.ogg new file mode 100644 index 000000000..eaccabc4d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step3.ogg new file mode 100644 index 000000000..029643e47 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step4.ogg new file mode 100644 index 000000000..1982b5c8a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton1.ogg new file mode 100644 index 000000000..75cc386d2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton2.ogg new file mode 100644 index 000000000..32cceb579 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton3.ogg new file mode 100644 index 000000000..2e011ef96 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeleton3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletondeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletondeath.ogg new file mode 100644 index 000000000..dbe50e3eb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletondeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt1.ogg new file mode 100644 index 000000000..2da9ef323 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt2.ogg new file mode 100644 index 000000000..b040a6526 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt3.ogg new file mode 100644 index 000000000..631139aed Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt4.ogg new file mode 100644 index 000000000..2a4579589 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/skeletonhurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack1.ogg new file mode 100644 index 000000000..a5b2026bf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack2.ogg new file mode 100644 index 000000000..88a545a40 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/attack2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big1.ogg new file mode 100644 index 000000000..8a097d317 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big2.ogg new file mode 100644 index 000000000..692dd6880 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big3.ogg new file mode 100644 index 000000000..86ce1f060 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big4.ogg new file mode 100644 index 000000000..e6fcd80ca Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/big4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small1.ogg new file mode 100644 index 000000000..a0b5fb0e6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small2.ogg new file mode 100644 index 000000000..2ece7d496 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small3.ogg new file mode 100644 index 000000000..a16421ece Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small4.ogg new file mode 100644 index 000000000..da19c146a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small5.ogg new file mode 100644 index 000000000..56ce2b5c1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime/small5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime1.ogg new file mode 100644 index 000000000..abbb63dfc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime2.ogg new file mode 100644 index 000000000..02a2cf1eb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime3.ogg new file mode 100644 index 000000000..e83757ab2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime4.ogg new file mode 100644 index 000000000..45d96dfe8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime5.ogg new file mode 100644 index 000000000..b0b58c924 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slime5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack1.ogg new file mode 100644 index 000000000..62d0cb08d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack2.ogg new file mode 100644 index 000000000..d9ee055c8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/slimeattack2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/death.ogg new file mode 100644 index 000000000..12da050aa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say1.ogg new file mode 100644 index 000000000..bbb4c9273 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say2.ogg new file mode 100644 index 000000000..512e46855 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say3.ogg new file mode 100644 index 000000000..914beeadf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say4.ogg new file mode 100644 index 000000000..fb48e49fb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/say4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step1.ogg new file mode 100644 index 000000000..a9470d196 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step2.ogg new file mode 100644 index 000000000..48f19cfa6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step3.ogg new file mode 100644 index 000000000..99fb3bc9e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step4.ogg new file mode 100644 index 000000000..a6e1aac22 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider1.ogg new file mode 100644 index 000000000..7a59bc110 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider2.ogg new file mode 100644 index 000000000..7232b3243 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider3.ogg new file mode 100644 index 000000000..18606a87c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider4.ogg new file mode 100644 index 000000000..f0b453ebe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spider4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spiderdeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spiderdeath.ogg new file mode 100644 index 000000000..909830541 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/spiderdeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/death.ogg new file mode 100644 index 000000000..163e0bd01 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle1.ogg new file mode 100644 index 000000000..e0127331a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle2.ogg new file mode 100644 index 000000000..22d6ca4d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle3.ogg new file mode 100644 index 000000000..003cc860f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/haggle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit1.ogg new file mode 100644 index 000000000..75a9a1f42 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit2.ogg new file mode 100644 index 000000000..1c60f2f74 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit3.ogg new file mode 100644 index 000000000..bf7e9a334 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit4.ogg new file mode 100644 index 000000000..c31f4f169 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle1.ogg new file mode 100644 index 000000000..21ca1f5a9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle2.ogg new file mode 100644 index 000000000..1e92044d9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle3.ogg new file mode 100644 index 000000000..9bb879b01 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no1.ogg new file mode 100644 index 000000000..92372f64c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no2.ogg new file mode 100644 index 000000000..e80ffa764 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no3.ogg new file mode 100644 index 000000000..e9dbcd0b5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/no3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes1.ogg new file mode 100644 index 000000000..8da4067a7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes2.ogg new file mode 100644 index 000000000..4caf1669c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes3.ogg new file mode 100644 index 000000000..38d01e29c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/villager/yes3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient1.ogg new file mode 100644 index 000000000..88d0099f9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient2.ogg new file mode 100644 index 000000000..3299642c3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient3.ogg new file mode 100644 index 000000000..3bcf72da9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient4.ogg new file mode 100644 index 000000000..6e664d2e1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient5.ogg new file mode 100644 index 000000000..f7f0ca3fc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/ambient5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death1.ogg new file mode 100644 index 000000000..77254dbd0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death2.ogg new file mode 100644 index 000000000..240d9aab3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death3.ogg new file mode 100644 index 000000000..84aa97f44 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt1.ogg new file mode 100644 index 000000000..a7819711a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt2.ogg new file mode 100644 index 000000000..f2c9d9c15 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt3.ogg new file mode 100644 index 000000000..22c364aa3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/witch/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark1.ogg new file mode 100644 index 000000000..0f354f540 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark2.ogg new file mode 100644 index 000000000..5674edf7b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark3.ogg new file mode 100644 index 000000000..c8fc6eb1d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/bark3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/death.ogg new file mode 100644 index 000000000..0edb2bc1b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl1.ogg new file mode 100644 index 000000000..3a18e02e9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl2.ogg new file mode 100644 index 000000000..6fe9c7def Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl3.ogg new file mode 100644 index 000000000..60c7bbce4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/growl3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl1.ogg new file mode 100644 index 000000000..bd6bdb187 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl2.ogg new file mode 100644 index 000000000..a15fa8fd5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/howl2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt1.ogg new file mode 100644 index 000000000..75b9b16c9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt2.ogg new file mode 100644 index 000000000..acf93d209 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt3.ogg new file mode 100644 index 000000000..9daab95c7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/panting.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/panting.ogg new file mode 100644 index 000000000..2e9c8a67c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/panting.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/shake.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/shake.ogg new file mode 100644 index 000000000..2e143f813 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/shake.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step1.ogg new file mode 100644 index 000000000..254f63764 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step2.ogg new file mode 100644 index 000000000..b4546e6bd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step3.ogg new file mode 100644 index 000000000..1b4fd2427 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step4.ogg new file mode 100644 index 000000000..3e720b3ee Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step5.ogg new file mode 100644 index 000000000..a37d4bc37 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/step5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/whine.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/whine.ogg new file mode 100644 index 000000000..54703918e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/wolf/whine.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/death.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/death.ogg new file mode 100644 index 000000000..6a02e489c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/death.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt1.ogg new file mode 100644 index 000000000..5d129cf55 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt2.ogg new file mode 100644 index 000000000..1be55f384 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/infect.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/infect.ogg new file mode 100644 index 000000000..8e06d3027 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/infect.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal1.ogg new file mode 100644 index 000000000..04661aa7b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal2.ogg new file mode 100644 index 000000000..29b6b15d8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal3.ogg new file mode 100644 index 000000000..83344def3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/metal3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/remedy.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/remedy.ogg new file mode 100644 index 000000000..7ee1b8a3c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/remedy.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say1.ogg new file mode 100644 index 000000000..613456830 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say2.ogg new file mode 100644 index 000000000..e2ce9220f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say3.ogg new file mode 100644 index 000000000..c5c1f6b5c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/say3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step1.ogg new file mode 100644 index 000000000..5b2f30665 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step2.ogg new file mode 100644 index 000000000..9894ef311 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step3.ogg new file mode 100644 index 000000000..0cf2a8fa3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step4.ogg new file mode 100644 index 000000000..3b81baee1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step5.ogg new file mode 100644 index 000000000..f4ad9f702 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/step5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/unfect.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/unfect.ogg new file mode 100644 index 000000000..36e0af0a7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/unfect.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood1.ogg new file mode 100644 index 000000000..6524abe92 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood2.ogg new file mode 100644 index 000000000..08d7bfda6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood3.ogg new file mode 100644 index 000000000..7a40f622a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood4.ogg new file mode 100644 index 000000000..849923582 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/wood4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/woodbreak.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/woodbreak.ogg new file mode 100644 index 000000000..7e11b4efb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie/woodbreak.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie1.ogg new file mode 100644 index 000000000..510021f51 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie2.ogg new file mode 100644 index 000000000..1ce7feb9a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie3.ogg new file mode 100644 index 000000000..6a27f0011 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombie3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiedeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiedeath.ogg new file mode 100644 index 000000000..c2f314969 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiedeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt1.ogg new file mode 100644 index 000000000..e18c1b96d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt2.ogg new file mode 100644 index 000000000..b16b74a8c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiehurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig1.ogg new file mode 100644 index 000000000..a7d65e19e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig2.ogg new file mode 100644 index 000000000..f62f40477 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig3.ogg new file mode 100644 index 000000000..dbe0daad2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig4.ogg new file mode 100644 index 000000000..ee74d00aa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpig4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry1.ogg new file mode 100644 index 000000000..ffa329e72 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry2.ogg new file mode 100644 index 000000000..583fd8310 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry3.ogg new file mode 100644 index 000000000..4ee0c4c00 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry4.ogg new file mode 100644 index 000000000..4b3465cd2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigangry4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigdeath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigdeath.ogg new file mode 100644 index 000000000..6f7c66827 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpigdeath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt1.ogg new file mode 100644 index 000000000..202eae387 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt2.ogg new file mode 100644 index 000000000..8ef090f67 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/mob/zombiepig/zpighurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bass.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bass.ogg new file mode 100644 index 000000000..1fc4ef7e4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bass.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bassattack.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bassattack.ogg new file mode 100644 index 000000000..6a837907e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bassattack.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bd.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bd.ogg new file mode 100644 index 000000000..9cd0ca3ac Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/bd.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/btn_Back.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/btn_Back.ogg new file mode 100644 index 000000000..7451098cf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/btn_Back.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/harp.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/harp.ogg new file mode 100644 index 000000000..bd785cabd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/harp.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/hat.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/hat.ogg new file mode 100644 index 000000000..6525da1c6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/hat.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/pling.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/pling.ogg new file mode 100644 index 000000000..c7d962f3d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/pling.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/note/snare.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/snare.ogg new file mode 100644 index 000000000..aaaf202cc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/note/snare.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/portal.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/portal.ogg new file mode 100644 index 000000000..952d7f3f0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/portal.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/travel.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/travel.ogg new file mode 100644 index 000000000..340c40cb4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/travel.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/trigger.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/trigger.ogg new file mode 100644 index 000000000..fcfac629a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/portal/trigger.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_break.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_break.ogg new file mode 100644 index 000000000..e57bbbfe9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_break.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_land.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_land.ogg new file mode 100644 index 000000000..af310158e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_land.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_use.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_use.ogg new file mode 100644 index 000000000..6cefc1cc0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/anvil_use.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bow.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bow.ogg new file mode 100644 index 000000000..97a2de1b0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bow.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit1.ogg new file mode 100644 index 000000000..8a023b463 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit2.ogg new file mode 100644 index 000000000..a806b81b8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit3.ogg new file mode 100644 index 000000000..4bc3b8e27 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit4.ogg new file mode 100644 index 000000000..6701f5bbb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/bowhit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/break.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/break.ogg new file mode 100644 index 000000000..0c4975853 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/break.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/breath.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/breath.ogg new file mode 100644 index 000000000..6a18e5382 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/breath.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/burp.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/burp.ogg new file mode 100644 index 000000000..184203dca Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/burp.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestclosed.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestclosed.ogg new file mode 100644 index 000000000..65925315a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestclosed.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestopen.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestopen.ogg new file mode 100644 index 000000000..56872f348 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/chestopen.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/click.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/click.ogg new file mode 100644 index 000000000..9c129e23f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/click.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_close.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_close.ogg new file mode 100644 index 000000000..c88ebdb68 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_close.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_open.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_open.ogg new file mode 100644 index 000000000..d84ce15cc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/door_open.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drink.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drink.ogg new file mode 100644 index 000000000..050792555 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drink.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drr.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drr.ogg new file mode 100644 index 000000000..7eee07153 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/drr.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat1.ogg new file mode 100644 index 000000000..91565372e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat2.ogg new file mode 100644 index 000000000..45e3c8507 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat3.ogg new file mode 100644 index 000000000..e229435d7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/eat3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode.ogg new file mode 100644 index 000000000..c3b08886a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode1.ogg new file mode 100644 index 000000000..a2eef7fe4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode2.ogg new file mode 100644 index 000000000..be8b8cf5a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode3.ogg new file mode 100644 index 000000000..521496691 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode4.ogg new file mode 100644 index 000000000..f4c84b5db Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/explode4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fizz.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fizz.ogg new file mode 100644 index 000000000..e8e09ab2e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fizz.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fuse.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fuse.ogg new file mode 100644 index 000000000..e66d1c808 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/fuse.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass1.ogg new file mode 100644 index 000000000..749e68913 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass2.ogg new file mode 100644 index 000000000..3e361dba8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass3.ogg new file mode 100644 index 000000000..1f153c544 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/glass3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/hurt.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/hurt.ogg new file mode 100644 index 000000000..3d8bf94ec Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/hurt.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/levelup.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/levelup.ogg new file mode 100644 index 000000000..f5b8004e7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/levelup.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/old_explode.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/old_explode.ogg new file mode 100644 index 000000000..f510bf0ea Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/old_explode.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/orb.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/orb.ogg new file mode 100644 index 000000000..b5011209c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/orb.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/pop.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/pop.ogg new file mode 100644 index 000000000..74292db06 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/pop.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/splash.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/splash.ogg new file mode 100644 index 000000000..c8f09d38a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/splash.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/random/wood_click.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/wood_click.ogg new file mode 100644 index 000000000..80842d688 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/random/wood_click.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth1.ogg new file mode 100644 index 000000000..586ebb56b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth2.ogg new file mode 100644 index 000000000..160377cb5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth3.ogg new file mode 100644 index 000000000..1bb7e83ed Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth4.ogg new file mode 100644 index 000000000..bfc277cf2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/cloth4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass1.ogg new file mode 100644 index 000000000..99c811086 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass2.ogg new file mode 100644 index 000000000..18aeafb6f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass3.ogg new file mode 100644 index 000000000..bb14b4d7f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass4.ogg new file mode 100644 index 000000000..65841431c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass5.ogg new file mode 100644 index 000000000..b3a16dde9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass6.ogg new file mode 100644 index 000000000..4ce5afd5a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/grass6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel1.ogg new file mode 100644 index 000000000..c586e3298 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel2.ogg new file mode 100644 index 000000000..3c3717be4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel3.ogg new file mode 100644 index 000000000..1880d67b7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel4.ogg new file mode 100644 index 000000000..bbd05ed1d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/gravel4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder1.ogg new file mode 100644 index 000000000..5ec9e7702 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder2.ogg new file mode 100644 index 000000000..29bd2d89f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder3.ogg new file mode 100644 index 000000000..68b95cd14 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder4.ogg new file mode 100644 index 000000000..d30456dd3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder5.ogg new file mode 100644 index 000000000..da957a78c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/ladder5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand1.ogg new file mode 100644 index 000000000..c06224e7c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand2.ogg new file mode 100644 index 000000000..2abf1c9b8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand3.ogg new file mode 100644 index 000000000..61f8e0800 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand4.ogg new file mode 100644 index 000000000..3d275e8d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand5.ogg new file mode 100644 index 000000000..4c925b69a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/sand5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow1.ogg new file mode 100644 index 000000000..7b5310e6e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow2.ogg new file mode 100644 index 000000000..25ee1b609 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow3.ogg new file mode 100644 index 000000000..dfe337075 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow4.ogg new file mode 100644 index 000000000..08fc3a842 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/snow4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone1.ogg new file mode 100644 index 000000000..5e5645380 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone2.ogg new file mode 100644 index 000000000..19a55439c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone3.ogg new file mode 100644 index 000000000..b0737da10 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone4.ogg new file mode 100644 index 000000000..be78ddaaf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone5.ogg new file mode 100644 index 000000000..03e7df5b0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone6.ogg new file mode 100644 index 000000000..c88ec2a24 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/stone6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood1.ogg new file mode 100644 index 000000000..49e253abf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood2.ogg new file mode 100644 index 000000000..73e47f4c1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood3.ogg new file mode 100644 index 000000000..332a7a29f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood4.ogg new file mode 100644 index 000000000..b8799b151 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood5.ogg new file mode 100644 index 000000000..ea88fec51 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood6.ogg new file mode 100644 index 000000000..21210bbbc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/step/wood6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/in.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/in.ogg new file mode 100644 index 000000000..3316703ba Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/in.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/out.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/out.ogg new file mode 100644 index 000000000..8576ef0a4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/tile/piston/out.ogg differ diff --git a/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx b/Minecraft.Client/Xbox/4JLibs/Media/4J_strings.resx index e3bf7744e..c8243fc0a 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 requirements a gamer profile which is signed into Xbox LIVE. + This feature requires a gamer profile which is signed into Xbox LIVE. Connect to Xbox LIVE diff --git a/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h index 2988dc2c1..2ba905668 100644 --- a/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h @@ -5,7 +5,7 @@ using namespace std; class CXuiStringTable; -typedef struct +typedef struct { FILETIME fTime; XCONTENT_DATA Content; @@ -34,7 +34,7 @@ class C4JStorage public: // Structs defined in the DLC_Creator, but added here to be used in the app - typedef struct + typedef struct { unsigned int uiFileSize; DWORD dwType; @@ -52,7 +52,7 @@ public: DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs - typedef struct + typedef struct { WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; @@ -62,7 +62,7 @@ public: CACHEINFOSTRUCT; // structure to hold DLC info in TMS - typedef struct + typedef struct { DWORD dwVersion; DWORD dwNewOffers; @@ -102,7 +102,7 @@ public: enum ESaveGameControlState { ESaveGameControl_Idle=0, - ESaveGameControl_Save, + ESaveGameControl_Save, ESaveGameControl_InternalRequestingDevice, ESaveGameControl_InternalGetSaveName, ESaveGameControl_InternalSaving, @@ -189,7 +189,7 @@ public: TMS_UGCTYPE_MAX }; - typedef struct + typedef struct { CHAR szFilename[256]; int iFileSize; @@ -197,14 +197,14 @@ public: } TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS; - typedef struct + typedef struct { int iCount; PTMSPP_FILE_DETAILS FileDetailsA; } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; - typedef struct + typedef struct { DWORD dwSize; PBYTE pbData; @@ -241,7 +241,7 @@ public: PVOID AllocateSaveData(unsigned int uiBytes); void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=NULL,DWORD cbThumbnail=0,PBYTE pbTextData=NULL, DWORD dwTextLen=0); void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); - void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ELoadGameStatus DoesSaveExist(bool *pbExists); bool EnoughSpaceForAMinSaveGame(); @@ -260,13 +260,13 @@ public: // DLC void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); DWORD CancelGetDLCOffers(); void ClearDLCOffers(); //XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC,unsigned __int64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC,uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); @@ -297,7 +297,7 @@ public: HRESULT TMSPP_SetTitleGroupID(LPCSTR szGroupID); // #ifdef _DEBUG -// void SetSaveName(int i); +// void SetSaveName(int i); // #endif // string table for all the Storage problems. Loaded by the application CXuiStringTable *m_pStringTable; diff --git a/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.cpp b/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.cpp index 386a0206a..5216d9083 100644 --- a/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.cpp +++ b/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.cpp @@ -137,6 +137,6 @@ int NetworkPlayerXbox::GetTimeSinceLastChunkPacket_ms() return INT_MAX; } - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); return (int)( currentTime - m_lastChunkPacketTime ); } \ No newline at end of file diff --git a/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.h b/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.h index bec7a1255..77ef84cc0 100644 --- a/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.h +++ b/Minecraft.Client/Xbox/Network/NetworkPlayerXbox.h @@ -39,5 +39,5 @@ public: private: IQNetPlayer *m_qnetPlayer; Socket *m_pSocket; - __int64 m_lastChunkPacketTime; + int64_t m_lastChunkPacketTime; }; \ No newline at end of file diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientTypes.h index 42f41e3f8..1a1827a24 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 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_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_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 requirements a specific user. + 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_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 ba53d3238..33c24fd9b 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h @@ -1,4 +1,4 @@ -/******************************************************** +/******************************************************** * * * Copyright (C) Microsoft. All rights reserved. * * * diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h index 6d1056ff3..42b87ee65 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h @@ -43,7 +43,7 @@ namespace Sentient }; typedef unsigned int SenUGCMetaDataFlags; - enum + enum { SenUGCMetaDataFlags_NoFlags = 0x00000000, SenUGCMetaDataFlags_FriendsCanEdit = 0x00000001, @@ -66,7 +66,7 @@ namespace Sentient #pragma warning ( disable : 4996 ) // @TODO - Removed once Int16 Descriptors are deprecated memset(descriptors, 0, sizeof(SenUGCDescriptor) * NrUgcDescriptors); #pragma warning ( default : 4996 ) - memset(descriptors2, 0, sizeof(__int64) * NrUgcDescriptors); + memset(descriptors2, 0, sizeof(long long) * NrUgcDescriptors); } SenUGCID parentID; @@ -80,10 +80,10 @@ namespace Sentient wchar_t shortName[ShortNameLength]; static const int NrUgcDescriptors = 4; - + __declspec(deprecated("Descriptors have increased in size (from Int16 to Int64). Please Use descriptors2 instead")) SenUGCDescriptor descriptors[NrUgcDescriptors]; - __int64 descriptors2[NrUgcDescriptors]; + long long descriptors2[NrUgcDescriptors]; static const int BlobSizeLimit = 1024; size_t metaDataBlobSize; @@ -160,10 +160,10 @@ namespace Sentient enum SenUGCSortBy { - SenUGCSortBy_CreationDate, - SenUGCSortBy_TopFavorites, - SenUGCSortBy_TopReviewScoreAverage, - SenUGCSortBy_TopDownloadsTotal + SenUGCSortBy_CreationDate, + SenUGCSortBy_TopFavorites, + SenUGCSortBy_TopReviewScoreAverage, + SenUGCSortBy_TopDownloadsTotal }; enum SenUGCAuthorType @@ -211,7 +211,7 @@ namespace Sentient }; // ***** Leaderboard types - typedef __int64 SenLeaderboardEntryValue; + typedef long long SenLeaderboardEntryValue; typedef ULONGLONG SenLeaderboardActorId; enum SenLeaderboardSortType @@ -224,7 +224,7 @@ namespace Sentient /// @brief Leaderboard Metadata retrieval flag. /// /// @details When retrieving Leaderboard information, a client can choose - /// to bypass retrieval or retrieve specific details regarding the + /// to bypass retrieval or retrieve specific details regarding the /// Metadata stored for a given Leaderboard or Leaderboard Entry. /// enum SenLeaderboardMetadataFlag diff --git a/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp b/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp index 5366e721f..cfa92064f 100644 --- a/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp @@ -1,13 +1,13 @@ -// 4J-PB - -// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). -// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. -// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. -// You are encouraged to incorporate this code into your titles. +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. //------------------------------------------------------------------------------------- // AtgXmlParser.cpp -// +// // Simple callback non-validating XML parser implementation. // // Xbox Advanced Technology Group. @@ -35,7 +35,7 @@ XMLParser::XMLParser() // Name: XMLParser::~XMLParser //------------------------------------------------------------------------------------- XMLParser::~XMLParser() -{ +{ } @@ -51,11 +51,11 @@ VOID XMLParser::FillBuffer() if( m_hFile == NULL ) { - if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) + if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) NChars = XML_READ_BUFFER_SIZE; else NChars = m_uInXMLBufferCharsLeft; - + CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars ); m_uInXMLBufferCharsLeft -= NChars; m_pInXMLBuffer += NChars; @@ -69,7 +69,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; @@ -89,7 +89,7 @@ VOID XMLParser::SkipNextAdvance() //------------------------------------------------------------------------------------- // Name: XMLParser::ConsumeSpace -// Desc: Skips spaces in the current stream +// Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- HRESULT XMLParser::ConsumeSpace() { @@ -104,29 +104,29 @@ HRESULT XMLParser::ConsumeSpace() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - } - SkipNextAdvance(); + } + SkipNextAdvance(); return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::ConvertEscape -// Desc: Copies and converts an escape sequence into m_pWriteBuf +// Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- HRESULT XMLParser::ConvertEscape() -{ +{ HRESULT hr; WCHAR wVal = 0; - + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - // all escape sequences start with &, so ignore the first character - + // all escape sequences start with &, so ignore the first character + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if ( m_Ch == '#' ) // character as hex or decimal { if( FAILED( hr = AdvanceCharacter() ) ) @@ -135,9 +135,9 @@ HRESULT XMLParser::ConvertEscape() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + while ( m_Ch != ';' ) - { + { wVal *= 16; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -151,11 +151,11 @@ HRESULT XMLParser::ConvertEscape() else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) ) { wVal += m_Ch - 'A' + 10; - } + } else { - Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); + return E_INVALID_XML_SYNTAX; } if( FAILED( hr = AdvanceCharacter() ) ) @@ -165,7 +165,7 @@ HRESULT XMLParser::ConvertEscape() else // decimal number { while ( m_Ch != ';' ) - { + { wVal *= 10; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -174,7 +174,7 @@ HRESULT XMLParser::ConvertEscape() } else { - Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); + Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); return E_INVALID_XML_SYNTAX; } @@ -187,7 +187,7 @@ HRESULT XMLParser::ConvertEscape() m_Ch = wVal; return S_OK; - } + } // must be an entity reference @@ -197,13 +197,13 @@ HRESULT XMLParser::ConvertEscape() SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) { - Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); + Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); return E_INVALID_XML_SYNTAX; } @@ -219,7 +219,7 @@ HRESULT XMLParser::ConvertEscape() wVal = '"'; else { - Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); + Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence } @@ -228,10 +228,10 @@ HRESULT XMLParser::ConvertEscape() if( m_Ch != ';' ) { - Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); + Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ; } - + m_Ch = wVal; return S_OK; } @@ -250,41 +250,41 @@ HRESULT XMLParser::AdvanceAttrVal() return hr; if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) ) - { - Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); + { + Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); return E_INVALID_XML_SYNTAX; } wQuoteChar = m_Ch; - + for( ;; ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - else if( m_Ch == wQuoteChar ) - break; + return hr; + else if( m_Ch == wQuoteChar ) + break; else if( m_Ch == '&' ) { SkipNextAdvance(); if( FAILED( hr = ConvertEscape() ) ) - return hr; + return hr; } - else if( m_Ch == '<' ) + else if( m_Ch == '<' ) { - Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); + return E_INVALID_XML_SYNTAX; } - + // copy character into the buffer - - if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; } - + *m_pWritePtr = m_Ch; - m_pWritePtr++; + m_pWritePtr++; } return S_OK; } @@ -296,18 +296,18 @@ HRESULT XMLParser::AdvanceAttrVal() // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceName() -{ +{ HRESULT hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) && ( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) && ( m_Ch != '_' ) && ( m_Ch != ':' ) ) { - Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); + return E_INVALID_XML_SYNTAX; } while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) || @@ -319,17 +319,17 @@ HRESULT XMLParser::AdvanceName() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); return E_INVALID_XML_SYNTAX; - } + } *m_pWritePtr = m_Ch; m_pWritePtr++; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } - + SkipNextAdvance(); return S_OK; } @@ -343,7 +343,7 @@ HRESULT XMLParser::AdvanceName() // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) -{ +{ if( m_bSkipNextAdvance ) { m_bSkipNextAdvance = FALSE; @@ -351,20 +351,20 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } // If we hit EOF in the middle of a character, - // it's ok-- we'll just have a corrupt last character + // it's ok-- we'll just have a corrupt last character // (the buffer is padded with double NULLs ) if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { // Read more from the file - FillBuffer(); + FillBuffer(); // We are at EOF if it is still NULL if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { if( !bOkToFail ) { - Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); + Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); return E_INVALID_XML_SYNTAX; } else @@ -372,7 +372,7 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) return E_FAIL; } } - } + } if( m_bUnicode == FALSE ) { @@ -382,13 +382,13 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) else // if( m_bUnicode == TRUE ) { m_Ch = *((WCHAR *)m_pReadPtr); - + if( m_bReverseBytes ) { m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 ); } - - m_pReadPtr += 2; + + m_pReadPtr += 2; } if( m_Ch == '\n' ) @@ -398,114 +398,114 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } else if( m_Ch != '\r' ) m_pISAXCallback->m_LinePos++; - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::AdvanceElement -// Desc: Builds data, calls callback +// Desc: Builds data, calls callback //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceElement() -{ +{ HRESULT hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // if first character wasn't '<', we wouldn't be here - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch == '!' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if ( m_Ch == '-' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - if( m_Ch != '-' ) + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '-' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '-' after 'ElementEnd( pEntityRefVal, + if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if( m_Ch != '>' ) { @@ -513,42 +513,42 @@ HRESULT XMLParser::AdvanceElement() return E_INVALID_XML_SYNTAX; } } - else if( m_Ch == '?' ) + else if( m_Ch == '?' ) { // just skip any xml header tag since not really important after identifying character set for( ;; ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == '>' ) return S_OK; } } else { - XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; + XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; UINT NumAttrs; WCHAR *pEntityRefVal = m_pWritePtr; UINT EntityRefLen; NumAttrs = 0; - + SkipNextAdvance(); // Entity tag - if( FAILED( hr = AdvanceName() ) ) + if( FAILED( hr = AdvanceName() ) ) return hr; EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); - if( FAILED( hr = ConsumeSpace() ) ) + if( FAILED( hr = ConsumeSpace() ) ) return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // read attributes while( ( m_Ch != '>' ) && ( m_Ch != '/' ) ) { @@ -556,31 +556,31 @@ HRESULT XMLParser::AdvanceElement() if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT ) { - Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); + return E_INVALID_XML_SYNTAX; } Attributes[ NumAttrs ].strName = m_pWritePtr; - + // Attribute name if( FAILED( hr = AdvanceName() ) ) return hr; - + Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; - if( m_Ch != '=' ) + if( m_Ch != '=' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" ); return E_INVALID_XML_SYNTAX; } - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; Attributes[ NumAttrs ].strValue = m_pWritePtr; @@ -588,29 +588,29 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; - + if( FAILED( hr = ConsumeSpace() ) ) - return hr; + return hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } if( m_Ch == '/' ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch != '>' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" ); return E_INVALID_XML_SYNTAX; } - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; @@ -619,7 +619,7 @@ HRESULT XMLParser::AdvanceElement() } else { - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; } @@ -637,7 +637,7 @@ HRESULT XMLParser::AdvanceCDATA() { HRESULT hr; WORD wStage = 0; - + if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -645,10 +645,10 @@ HRESULT XMLParser::AdvanceCDATA() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( ( m_Ch == ']' ) && ( wStage == 0 ) ) wStage = 1; else if( ( m_Ch == ']' ) && ( wStage == 1 ) ) @@ -666,9 +666,9 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; - } + } } - + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) return E_ABORT; @@ -676,7 +676,7 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAEnd() ) ) return E_ABORT; - + return S_OK; } @@ -694,24 +694,24 @@ HRESULT XMLParser::AdvanceComment() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if (( m_Ch == '-' ) && ( wStage == 0 )) wStage = 1; else if (( m_Ch == '-' ) && ( wStage == 1 )) wStage = 2; - else if (( m_Ch == '>' ) && ( wStage == 2 )) - break; + else if (( m_Ch == '>' ) && ( wStage == 2 )) + break; else - wStage = 0; + wStage = 0; } - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::RegisterSAXCallbackInterface -// Desc: Registers callback interface +// Desc: Registers callback interface //------------------------------------------------------------------------------------- VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { @@ -721,7 +721,7 @@ VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) //------------------------------------------------------------------------------------- // Name: XMLParser::GetSAXCallbackInterface -// Desc: Returns current callback interface +// Desc: Returns current callback interface //------------------------------------------------------------------------------------- ISAXCallback* XMLParser::GetSAXCallbackInterface() { @@ -740,7 +740,7 @@ HRESULT XMLParser::MainParseLoop() if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; - + m_pWritePtr = m_pWriteBuf; FillBuffer(); @@ -751,57 +751,57 @@ HRESULT XMLParser::MainParseLoop() m_bReverseBytes = FALSE; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = TRUE; m_bReverseBytes = TRUE; - m_pReadPtr += 2; + m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) - { - m_bUnicode = TRUE; - m_bReverseBytes = FALSE; - } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) { m_bUnicode = TRUE; - m_bReverseBytes = TRUE; + m_bReverseBytes = FALSE; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; } else if ( m_pReadBuf[ 0 ] == 0x3C ) { - m_bUnicode = FALSE; - m_bReverseBytes = FALSE; + m_bUnicode = FALSE; + m_bReverseBytes = FALSE; } else - { + { Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" ); - return E_INVALID_XML_SYNTAX; + return E_INVALID_XML_SYNTAX; } - + for( ;; ) { if( FAILED( AdvanceCharacter( TRUE ) ) ) { if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } - + if( FAILED( m_pISAXCallback->EndDocument() ) ) return E_ABORT; - - return S_OK; + + return S_OK; } if( m_Ch == '<' ) { if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } @@ -810,45 +810,45 @@ HRESULT XMLParser::MainParseLoop() m_pWritePtr = m_pWriteBuf; - if( FAILED( hr = AdvanceElement() ) ) - return hr; + if( FAILED( hr = AdvanceElement() ) ) + return hr; m_pWritePtr = m_pWriteBuf; } - else + else { if( m_Ch == '&' ) { SkipNextAdvance(); - if( FAILED( hr = ConvertEscape() ) ) - return hr; + if( FAILED( hr = ConvertEscape() ) ) + return hr; } - if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && - ( m_Ch != '\t' ) ) + if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && + ( m_Ch != '\t' ) ) { bWhiteSpaceOnly = FALSE; } *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { if( !bWhiteSpaceOnly ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, + ( UINT ) ( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) { - return E_ABORT; + return E_ABORT; } } m_pWritePtr = m_pWriteBuf; bWhiteSpaceOnly = TRUE; } - } + } } } @@ -858,31 +858,31 @@ HRESULT XMLParser::MainParseLoop() // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) -{ +{ HRESULT hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; - m_pReadPtr = m_pReadBuf; - + m_pReadPtr = m_pReadBuf; + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; - + m_pReadBuf[ 1 ] = '\0'; + m_pInXMLBuffer = NULL; m_uInXMLBufferCharsLeft = 0; - m_hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); + m_hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if( m_hFile == INVALID_HANDLE_VALUE ) - { + { Error( E_COULD_NOT_OPEN_FILE, "Error opening file" ); hr = E_COULD_NOT_OPEN_FILE; - + } else { @@ -892,14 +892,14 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) m_dwCharsConsumed = 0; hr = MainParseLoop(); } - + // Close the file if( m_hFile != INVALID_HANDLE_VALUE ) CloseHandle( m_hFile ); m_hFile = INVALID_HANDLE_VALUE; // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } @@ -909,38 +909,38 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) -{ +{ HRESULT hr; - + if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; m_pReadPtr = m_pReadBuf; - + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; m_hFile = NULL; m_pInXMLBuffer = strBuffer; m_uInXMLBufferCharsLeft = uBufferSize; m_dwCharsTotal = uBufferSize; m_dwCharsConsumed = 0; - + hr = MainParseLoop(); // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } //------------------------------------------------------------------------------------- -// XMLParser::Error() +// XMLParser::Error() // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation @@ -955,7 +955,7 @@ VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) va_start( pArglist, strFormat ); vsprintf( strBuffer, strFormat, pArglist ); - + m_pISAXCallback->Error( hErr, strBuffer ); va_end( pArglist ); } diff --git a/Minecraft.Client/Xbox/XUI_SkinSelect.cpp b/Minecraft.Client/Xbox/XUI_SkinSelect.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Minecraft.Client/Xbox/XUI_SkinSelect.h b/Minecraft.Client/Xbox/XUI_SkinSelect.h new file mode 100644 index 000000000..e69de29bb diff --git a/Minecraft.Client/Xbox/Xbox_App.cpp b/Minecraft.Client/Xbox/Xbox_App.cpp index eebeb827f..97a127f9d 100644 --- a/Minecraft.Client/Xbox/Xbox_App.cpp +++ b/Minecraft.Client/Xbox/Xbox_App.cpp @@ -190,7 +190,7 @@ LPCWSTR apwstrLocale[10] = L"pt-PT" // Portuguese }; -WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= +const WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= { L"Mojangles", L"SDBookM", @@ -198,7 +198,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= L"DFHeiMedium-B5", }; -WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= +const WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= { L"media/font/Mojangles.ttf", L"media/font/KOR/BOKMSD.ttf", @@ -206,7 +206,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= L"media/font/CHT/DFHeiMedium-B5.ttf", }; -WCHAR *CConsoleMinecraftApp::wchSceneA[]= +const WCHAR *CConsoleMinecraftApp::wchSceneA[]= { L"xuiscene_partnernetpassword", L"xuiscene_intro", @@ -2695,7 +2695,7 @@ void CConsoleMinecraftApp::FatalLoadError(void) ExitGame(); } -WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= +const WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= { L"png", L"inf", diff --git a/Minecraft.Client/Xbox/Xbox_App.h b/Minecraft.Client/Xbox/Xbox_App.h index f64e71423..fd3b59777 100644 --- a/Minecraft.Client/Xbox/Xbox_App.h +++ b/Minecraft.Client/Xbox/Xbox_App.h @@ -29,9 +29,9 @@ private: std::list< SceneStackPair > m_sceneStack[XUSER_MAX_COUNT]; // XUI scene names - static WCHAR *wchSceneA[eUIScene_COUNT]; - static WCHAR *wchTypefaceA[4]; - static WCHAR *wchTypefaceLocatorA[4]; + static const WCHAR *wchSceneA[eUIScene_COUNT]; + static const WCHAR *wchTypefaceA[4]; + static const WCHAR *wchTypefaceLocatorA[4]; WCHAR m_SceneName[50]; public: @@ -189,7 +189,7 @@ public: private: static WCHAR m_wchTMSXZP[]; - static WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; + static const WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; }; diff --git a/Minecraft.Client/postbuild.ps1 b/Minecraft.Client/postbuild.ps1 index 1c965758a..b46df5aa9 100644 --- a/Minecraft.Client/postbuild.ps1 +++ b/Minecraft.Client/postbuild.ps1 @@ -27,7 +27,6 @@ $copies = @( @{ Source = "Common\Tutorial"; Dest = "Common\Tutorial" }, @{ Source = "Windows64\GameHDD"; Dest = "Windows64\GameHDD" }, @{ Source = "Windows64\Sound"; Dest = "Windows64\Sound" }, - @{ Source = "DurangoMedia"; Dest = "Windows64Media" }, @{ Source = "Windows64Media"; Dest = "Windows64Media" } ) diff --git a/Minecraft.Client/stdafx.h b/Minecraft.Client/stdafx.h index 1a9255010..87a42bec8 100644 --- a/Minecraft.Client/stdafx.h +++ b/Minecraft.Client/stdafx.h @@ -57,7 +57,6 @@ #include #include #include -typedef unsigned __int64 __uint64; #endif #ifdef _WINDOWS64 @@ -67,7 +66,7 @@ typedef unsigned __int64 __uint64; #include #include #include -// TODO: reference additional headers your program requirements here +// TODO: reference additional headers your program requires here #include #include using namespace DirectX; diff --git a/Minecraft.World/Achievement.h b/Minecraft.World/Achievement.h index f8222d37b..8b33815eb 100644 --- a/Minecraft.World/Achievement.h +++ b/Minecraft.World/Achievement.h @@ -13,19 +13,19 @@ public: private: const wstring desc; - DescFormatter *descFormatter; + DescFormatter *descFormatter; public: const shared_ptr icon; private: - bool isGoldenVar; + bool isGoldenVar; void _init(); public: 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(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 b8842b34d..a3d33cbd8 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 "requirements" are ignored on xbox. + // 4J : WESTY : Added new achievements. Note, params "x", "y", "icon" and "requires" 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/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp index 21e9a96de..a88429367 100644 --- a/Minecraft.World/AddIslandLayer.cpp +++ b/Minecraft.World/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +AddIslandLayer::AddIslandLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddIslandLayer.h b/Minecraft.World/AddIslandLayer.h index e7c9384b7..2446bbf81 100644 --- a/Minecraft.World/AddIslandLayer.h +++ b/Minecraft.World/AddIslandLayer.h @@ -5,7 +5,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(__int64 seedMixup, shared_ptrparent); + AddIslandLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddMushroomIslandLayer.cpp b/Minecraft.World/AddMushroomIslandLayer.cpp index 022a3b29f..324c88ee3 100644 --- a/Minecraft.World/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/AddMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddMushroomIslandLayer.h b/Minecraft.World/AddMushroomIslandLayer.h index acda9fa77..f691ebda4 100644 --- a/Minecraft.World/AddMushroomIslandLayer.h +++ b/Minecraft.World/AddMushroomIslandLayer.h @@ -4,6 +4,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddSnowLayer.cpp b/Minecraft.World/AddSnowLayer.cpp index d8a33cc92..aa4597896 100644 --- a/Minecraft.World/AddSnowLayer.cpp +++ b/Minecraft.World/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddSnowLayer::AddSnowLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddSnowLayer.h b/Minecraft.World/AddSnowLayer.h index ede7a2267..0b3702da6 100644 --- a/Minecraft.World/AddSnowLayer.h +++ b/Minecraft.World/AddSnowLayer.h @@ -4,6 +4,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(__int64 seedMixup, shared_ptr parent); + AddSnowLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BasicTree.cpp b/Minecraft.World/BasicTree.cpp index dcb2aea4c..2c06fb69c 100644 --- a/Minecraft.World/BasicTree.cpp +++ b/Minecraft.World/BasicTree.cpp @@ -524,7 +524,7 @@ bool BasicTree::place(Level *level, Random *random, int x, int y, int z) // Initialize the instance fields for the level and the seed. thisLevel = level; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); rnd->setSeed(seed); // Initialize the origin of the tree trunk origin[0] = x; diff --git a/Minecraft.World/BasicTypeContainers.h b/Minecraft.World/BasicTypeContainers.h index 5f577a975..d2936ebeb 100644 --- a/Minecraft.World/BasicTypeContainers.h +++ b/Minecraft.World/BasicTypeContainers.h @@ -58,14 +58,14 @@ public: } static bool isInfinite( double a ) { return false; /*4J TODO*/ } - static double longBitsToDouble( __int64 bits ) + static double longBitsToDouble( int64_t bits ) { return *(double *)&bits; } - static __int64 doubleToLongBits( double d ) + static int64_t doubleToLongBits( double d ) { - return *(__int64 *)&d; + return *(int64_t *)&d; } }; diff --git a/Minecraft.World/BeaconTileEntity.h b/Minecraft.World/BeaconTileEntity.h index caab25e7c..eaf3847e7 100644 --- a/Minecraft.World/BeaconTileEntity.h +++ b/Minecraft.World/BeaconTileEntity.h @@ -21,7 +21,7 @@ public: static void staticCtor(); private: - __int64 clientSideRenderTick; + int64_t clientSideRenderTick; float clientSideRenderScale; bool isActive; diff --git a/Minecraft.World/BiomeCache.cpp b/Minecraft.World/BiomeCache.cpp index b93ce32e1..54be445c0 100644 --- a/Minecraft.World/BiomeCache.cpp +++ b/Minecraft.World/BiomeCache.cpp @@ -85,7 +85,7 @@ BiomeCache::Block *BiomeCache::getBlockAt(int x, int z) EnterCriticalSection(&m_CS); x >>= ZONE_SIZE_BITS; z >>= ZONE_SIZE_BITS; - __int64 slot = (((__int64) x) & 0xffffffffl) | ((((__int64) z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) x) & 0xffffffffl) | ((((int64_t) z) & 0xffffffffl) << 32l); auto it = cached.find(slot); Block *block = NULL; if (it == cached.end()) @@ -124,8 +124,8 @@ float BiomeCache::getDownfall(int x, int z) void BiomeCache::update() { EnterCriticalSection(&m_CS); - __int64 now = app.getAppTime(); - __int64 utime = now - lastUpdateTime; + int64_t now = app.getAppTime(); + int64_t utime = now - lastUpdateTime; if (utime > DECAY_TIME / 4 || utime < 0) { lastUpdateTime = now; @@ -133,11 +133,11 @@ void BiomeCache::update() for (auto it = all.begin(); it != all.end();) { Block *block = *it; - __int64 time = now - block->lastUse; + int64_t time = now - block->lastUse; if (time > DECAY_TIME || time < 0) { it = all.erase(it); - __int64 slot = (((__int64) block->x) & 0xffffffffl) | ((((__int64) block->z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) block->x) & 0xffffffffl) | ((((int64_t) block->z) & 0xffffffffl) << 32l); cached.erase(slot); delete block; } diff --git a/Minecraft.World/BiomeCache.h b/Minecraft.World/BiomeCache.h index bf509f544..b2593ce3d 100644 --- a/Minecraft.World/BiomeCache.h +++ b/Minecraft.World/BiomeCache.h @@ -10,7 +10,7 @@ private: static const int ZONE_SIZE_MASK = ZONE_SIZE - 1; const BiomeSource *source; - __int64 lastUpdateTime; + int64_t lastUpdateTime; public: class Block @@ -22,7 +22,7 @@ public: // BiomeArray biomes; byteArray biomeIndices; int x, z; - __int64 lastUse; + int64_t lastUse; Block(int x, int z, BiomeCache *parent); ~Block(); @@ -32,7 +32,7 @@ public: }; private: - unordered_map<__int64,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap + unordered_map cached; // 4J - was LongHashMap vector all; // was ArrayList public: diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp index ead63eee0..6edd18ded 100644 --- a/Minecraft.World/BiomeInitLayer.cpp +++ b/Minecraft.World/BiomeInitLayer.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.h" #include "BiomeInitLayer.h" -BiomeInitLayer::BiomeInitLayer(__int64 seed, shared_ptrparent, LevelType *levelType) : Layer(seed) +BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptrparent, LevelType *levelType) : Layer(seed) { this->parent = parent; diff --git a/Minecraft.World/BiomeInitLayer.h b/Minecraft.World/BiomeInitLayer.h index e645a3790..00bf38124 100644 --- a/Minecraft.World/BiomeInitLayer.h +++ b/Minecraft.World/BiomeInitLayer.h @@ -10,7 +10,7 @@ private: BiomeArray startBiomes; public: - BiomeInitLayer(__int64 seed, shared_ptr parent, LevelType *levelType); + BiomeInitLayer(int64_t seed, shared_ptr parent, LevelType *levelType); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp index b39e9af8f..dd8cab7c4 100644 --- a/Minecraft.World/BiomeSource.cpp +++ b/Minecraft.World/BiomeSource.cpp @@ -10,7 +10,7 @@ // 4J - removal of separate temperature & downfall layers brought forward from 1.2.3 void BiomeSource::_init() -{ +{ layer = nullptr; zoomedLayer = nullptr; @@ -26,7 +26,7 @@ void BiomeSource::_init() playerSpawnBiomes.push_back(Biome::jungleHills); } -void BiomeSource::_init(__int64 seed, LevelType *generator) +void BiomeSource::_init(int64_t seed, LevelType *generator) { _init(); @@ -43,7 +43,7 @@ BiomeSource::BiomeSource() } // 4J added -BiomeSource::BiomeSource(__int64 seed, LevelType *generator) +BiomeSource::BiomeSource(int64_t seed, LevelType *generator) { _init(seed, generator); } @@ -271,7 +271,7 @@ void BiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int /** * Checks if an area around a block contains only the specified biomes. * Useful for placing elements like towns. -* +* * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -299,7 +299,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, vector allowed) /** * Checks if an area around a block contains only the specified biome. * Useful for placing elements like towns. -* +* * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -327,7 +327,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, Biome *allowed) /** * Finds the specified biome within the radius. This will return a random * position if several are found. This test is fairly rough. -* +* * Returns null if the biome wasn't found */ TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *random) @@ -365,7 +365,7 @@ TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *rand /** * Finds one of the specified biomes within the radius. This will return a * random position if several are found. This test is fairly rough. -* +* * Returns null if the biome wasn't found */ TilePos *BiomeSource::findBiome(int x, int z, int r, vector allowed, Random *random) @@ -411,13 +411,13 @@ void BiomeSource::update() // 4J added - find a seed for this biomesource that matches certain criteria #ifdef __PSVITA__ -__int64 BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs +int64_t BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs #else -__int64 BiomeSource::findSeed(LevelType *generator) +int64_t BiomeSource::findSeed(LevelType *generator) #endif { - __int64 bestSeed = 0; + int64_t bestSeed = 0; ProgressRenderer *mcprogress = Minecraft::GetInstance()->progressRenderer; mcprogress->progressStage(IDS_PROGRESS_NEW_WORLD_SEED); @@ -455,7 +455,7 @@ __int64 BiomeSource::findSeed(LevelType *generator) // Just keeping trying to generate seeds until we find one that matches our criteria do { - __int64 seed = pr->nextLong(); + int64_t seed = pr->nextLong(); BiomeSource *biomeSource = new BiomeSource(seed,generator); biomeSource->getRawBiomeIndices(indices, biomeOffset, biomeOffset, biomeWidth, biomeWidth); @@ -487,7 +487,7 @@ __int64 BiomeSource::findSeed(LevelType *generator) unsigned int *pixels = new unsigned int[54 * 16 * 54 * 16]; for(int i = 0; i < 54 * 16 * 54 * 16; i++ ) - { + { int id = biomes[i]->id; // Create following colours: @@ -563,7 +563,7 @@ void BiomeSource::getFracs(intArray indices, float *fracs) bool BiomeSource::getIsMatch(float *frac) { // A true for a particular biome type here marks it as one that *has* to be present - static const bool critical[Biome::BIOME_COUNT] = { + static const bool critical[Biome::BIOME_COUNT] = { true, // ocean true, // plains true, // desert diff --git a/Minecraft.World/BiomeSource.h b/Minecraft.World/BiomeSource.h index bef09db02..a1e8a50ba 100644 --- a/Minecraft.World/BiomeSource.h +++ b/Minecraft.World/BiomeSource.h @@ -25,20 +25,20 @@ private: protected: void _init(); - void _init(__int64 seed, LevelType *generator); + void _init(int64_t seed, LevelType *generator); BiomeSource(); public: - BiomeSource(__int64 seed, LevelType *generator); + BiomeSource(int64_t seed, LevelType *generator); BiomeSource(Level *level); private: static bool getIsMatch(float *frac); // 4J added static void getFracs(intArray indices, float *fracs); // 4J added public: #ifdef __PSVITA__ - static __int64 findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added + static int64_t findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added #else - static __int64 findSeed(LevelType *generator); // 4J added + static int64_t findSeed(LevelType *generator); // 4J added #endif ~BiomeSource(); @@ -71,7 +71,7 @@ public: /** * Checks if an area around a block contains only the specified biomes. * Useful for placing elements like towns. - * + * * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -80,7 +80,7 @@ public: /** * Checks if an area around a block contains only the specified biome. * Useful for placing elements like towns. - * + * * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -89,7 +89,7 @@ public: /** * Finds the specified biome within the radius. This will return a random * position if several are found. This test is fairly rough. - * + * * Returns null if the biome wasn't found */ virtual TilePos *findBiome(int x, int z, int r, Biome *toFind, Random *random); @@ -97,7 +97,7 @@ public: /** * Finds one of the specified biomes within the radius. This will return a * random position if several are found. This test is fairly rough. - * + * * Returns null if the biome wasn't found */ virtual TilePos *findBiome(int x, int z, int r, vector allowed, Random *random); diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp index 9252b80c6..e33875817 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 requirements more hits than one to be destroyed in creative mode + // 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-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/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp index 346ee335f..335664bb7 100644 --- a/Minecraft.World/ByteArrayInputStream.cpp +++ b/Minecraft.World/ByteArrayInputStream.cpp @@ -51,7 +51,7 @@ int ByteArrayInputStream::read() // //The read(b) method for class InputStream has the same effect as: // -// read(b, 0, b.length) +// read(b, 0, b.length) //Parameters: //b - the buffer into which the data is read. //Returns: @@ -100,7 +100,7 @@ void ByteArrayInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 ByteArrayInputStream::skip(__int64 n) +int64_t ByteArrayInputStream::skip(int64_t n) { int newPos = pos + n; diff --git a/Minecraft.World/ByteArrayInputStream.h b/Minecraft.World/ByteArrayInputStream.h index e74b1cf78..5b2d95cf7 100644 --- a/Minecraft.World/ByteArrayInputStream.h +++ b/Minecraft.World/ByteArrayInputStream.h @@ -19,7 +19,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); // 4J Stu Added - Sometimes we don't want to delete the data on destroying this void reset() { buf = byteArray(); count = 0; mark = 0; pos = 0; } diff --git a/Minecraft.World/ByteBuffer.cpp b/Minecraft.World/ByteBuffer.cpp index fe5ae132b..cd4a9ec10 100644 --- a/Minecraft.World/ByteBuffer.cpp +++ b/Minecraft.World/ByteBuffer.cpp @@ -176,20 +176,20 @@ int ByteBuffer::getInt(unsigned int index) // //Returns: //The long value at the buffer's current position -__int64 ByteBuffer::getLong() +int64_t ByteBuffer::getLong() { assert( m_position+8 < m_limit ); - __int64 value = 0; + int64_t value = 0; - __int64 b1 = buffer[ m_position ]; - __int64 b2 = buffer[ m_position+1 ]; - __int64 b3 = buffer[ m_position+2 ]; - __int64 b4 = buffer[ m_position+3 ]; - __int64 b5 = buffer[ m_position+4 ]; - __int64 b6 = buffer[ m_position+5 ]; - __int64 b7 = buffer[ m_position+6 ]; - __int64 b8 = buffer[ m_position+7 ]; + int64_t b1 = buffer[ m_position ]; + int64_t b2 = buffer[ m_position+1 ]; + int64_t b3 = buffer[ m_position+2 ]; + int64_t b4 = buffer[ m_position+3 ]; + int64_t b5 = buffer[ m_position+4 ]; + int64_t b6 = buffer[ m_position+5 ]; + int64_t b7 = buffer[ m_position+6 ]; + int64_t b8 = buffer[ m_position+7 ]; m_position += 8; @@ -358,7 +358,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) // TODO 4J Stu - Should this function be writing from the start of the buffer, or from position? // And should it update position? assert( s.length*2 <= m_limit); - + // 4J Stu - Assumes big endian memcpy( buffer, s.data, s.length*2 ); @@ -373,7 +373,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) //value - The long value to be written //Returns: //This buffer -ByteBuffer *ByteBuffer::putLong(__int64 value) +ByteBuffer *ByteBuffer::putLong(int64_t value) { assert( m_position+7 < m_limit ); @@ -407,7 +407,7 @@ ByteBuffer *ByteBuffer::putLong(__int64 value) //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) +// dst.put(a, 0, a.length) //Returns: //This buffer ByteBuffer *ByteBuffer::put(byteArray inputArray) @@ -436,7 +436,7 @@ byteArray ByteBuffer::array() //it will be read-only if, and only if, this buffer is read-only. // //Returns: -//A new int buffer +//A new int buffer IntBuffer *ByteBuffer::asIntBuffer() { // TODO 4J Stu - Is it safe to just cast our uint8_t array pointer to another type? @@ -463,7 +463,7 @@ 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_IO::ByteBuffer_IO( unsigned int capacity ) : ByteBuffer(capacity, (uint8_t*)RenderManager.allocIOMem(capacity, 64)) { memset( buffer,0,sizeof(uint8_t)*capacity); diff --git a/Minecraft.World/ByteBuffer.h b/Minecraft.World/ByteBuffer.h index a00b1fba1..07d35974e 100644 --- a/Minecraft.World/ByteBuffer.h +++ b/Minecraft.World/ByteBuffer.h @@ -28,7 +28,7 @@ public: int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO uint8_t get(int index); - __int64 getLong(); + int64_t getLong(); short getShort(); void getShortArray(shortArray &s); ByteBuffer *put(int index, uint8_t b); @@ -36,7 +36,7 @@ public: ByteBuffer *putInt(unsigned int index, int value); ByteBuffer *putShort(short value); ByteBuffer *putShortArray(shortArray &s); - ByteBuffer *putLong(__int64 value); + ByteBuffer *putLong(int64_t value); ByteBuffer *put(byteArray inputArray); byteArray array(); IntBuffer *asIntBuffer(); diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h index 3d5f050c5..6bf0a0a72 100644 --- a/Minecraft.World/C4JThread.h +++ b/Minecraft.World/C4JThread.h @@ -66,7 +66,7 @@ public: e_modeAutoClear, e_modeManualClear }; - Event(EMode mode = e_modeAutoClear); + Event(EMode mode = e_modeAutoClear); ~Event(); void Set(); void Clear(); @@ -75,7 +75,7 @@ public: private: EMode m_mode; #ifdef __PS3__ - sys_event_flag_t m_event; + sys_event_flag_t m_event; #elif defined __ORBIS__ SceKernelEventFlag m_event; #elif defined __PSVITA__ @@ -111,7 +111,7 @@ public: int m_size; EMode m_mode; #ifdef __PS3__ - sys_event_flag_t m_events; + sys_event_flag_t m_events; #elif defined __ORBIS__ SceKernelEventFlag m_events; #elif defined __PSVITA__ @@ -129,7 +129,7 @@ public: typedef void (ThreadInitFunc)(); C4JThread* m_thread; - std::queue m_queue; + std::queue m_queue; C4JThread::EventArray* m_startEvent; C4JThread::Event* m_finishedEvent; CRITICAL_SECTION m_critSect; @@ -187,7 +187,7 @@ private: bool m_isRunning; bool m_hasStarted; int m_exitCode; - __int64 m_lastSleepTime; + int64_t m_lastSleepTime; static std::vector ms_threadList; static CRITICAL_SECTION ms_threadListCS; diff --git a/Minecraft.World/CanyonFeature.cpp b/Minecraft.World/CanyonFeature.cpp index 8f45ab38b..b2a396e2d 100644 --- a/Minecraft.World/CanyonFeature.cpp +++ b/Minecraft.World/CanyonFeature.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.level.biome.h" -void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { MemSect(49); Random *random = new Random(seed); diff --git a/Minecraft.World/CanyonFeature.h b/Minecraft.World/CanyonFeature.h index cf3f7a61c..d3edbf1f3 100644 --- a/Minecraft.World/CanyonFeature.h +++ b/Minecraft.World/CanyonFeature.h @@ -9,6 +9,6 @@ private: float rs[1024]; protected: - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/Minecraft.World/CaveFeature.cpp b/Minecraft.World/CaveFeature.cpp index adb5d4462..8183fbdfe 100644 --- a/Minecraft.World/CaveFeature.cpp +++ b/Minecraft.World/CaveFeature.cpp @@ -20,7 +20,7 @@ bool CaveFeature::place(Level *level, Random *random, int x, int y, int z) double radius = random->nextDouble() * 4 + 2; double fuss = random->nextDouble() * 0.6; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); random->setSeed(seed); vector toRemove; diff --git a/Minecraft.World/ChunkPos.cpp b/Minecraft.World/ChunkPos.cpp index ff1c34f0a..acf885c06 100644 --- a/Minecraft.World/ChunkPos.cpp +++ b/Minecraft.World/ChunkPos.cpp @@ -6,16 +6,16 @@ ChunkPos::ChunkPos(int x, int z) : x( x ), z( z ) { } -__int64 ChunkPos::hashCode(int x, int z) +int64_t ChunkPos::hashCode(int x, int z) { - __int64 xx = x; - __int64 zz = z; + int64_t xx = x; + int64_t zz = z; return (xx & 0xffffffffl) | ((zz & 0xffffffffl) << 32l); } int ChunkPos::hashCode() { - __int64 hash = hashCode(x, z); + int64_t hash = hashCode(x, z); int h1 = (int) (hash); int h2 = (int) (hash >> 32l); return h1 ^ h2; @@ -63,7 +63,7 @@ wstring ChunkPos::toString() return L"[" + std::to_wstring(x) + L", " + std::to_wstring(z) + L"]"; } -__int64 ChunkPos::hash_fnct(const ChunkPos &k) +int64_t ChunkPos::hash_fnct(const ChunkPos &k) { return k.hashCode(k.x,k.z); } diff --git a/Minecraft.World/ChunkPos.h b/Minecraft.World/ChunkPos.h index 2a3fda02b..55bd1ebbb 100644 --- a/Minecraft.World/ChunkPos.h +++ b/Minecraft.World/ChunkPos.h @@ -10,7 +10,7 @@ public: ChunkPos(int x, int z); - static __int64 hashCode(int x, int z); + static int64_t hashCode(int x, int z); int hashCode(); double distanceToSqr(shared_ptr e); @@ -22,7 +22,7 @@ public: TilePos getMiddleBlockPosition(int y); wstring toString(); - static __int64 hash_fnct(const ChunkPos &k); + static int64_t hash_fnct(const ChunkPos &k); static bool eq_test(const ChunkPos &x, const ChunkPos &y); bool operator == (const ChunkPos &k) const { return (this->x == k.x) && ( this->z == k.z); } ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; } @@ -30,12 +30,12 @@ public: struct ChunkPosKeyHash { - inline __int64 operator()(const ChunkPos &k) const + inline int64_t operator()(const ChunkPos &k) const { return ChunkPos::hash_fnct(k); } }; struct ChunkPosKeyEq { - inline bool operator()(const ChunkPos &x, const ChunkPos &y) const + inline bool operator()(const ChunkPos &x, const ChunkPos &y) const { return ChunkPos::eq_test(x, y); } }; \ No newline at end of file diff --git a/Minecraft.World/ChunkStorageProfileDecorator.cpp b/Minecraft.World/ChunkStorageProfileDecorator.cpp index 76ffddbc1..5d757811b 100644 --- a/Minecraft.World/ChunkStorageProfileDecorator.cpp +++ b/Minecraft.World/ChunkStorageProfileDecorator.cpp @@ -10,7 +10,7 @@ ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator(ChunkStorage *capsu LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); LevelChunk *chunk = capsulated->load(level, x, z); timeSpentLoading += System::nanoTime() - nanoTime; loadCount++; @@ -20,7 +20,7 @@ LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) void ChunkStorageProfilerDecorator::save(Level *level, LevelChunk *levelChunk) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); capsulated->save(level, levelChunk); timeSpentSaving += System::nanoTime() - nanoTime; saveCount++; @@ -59,7 +59,7 @@ void ChunkStorageProfilerDecorator::tick() sprintf(buf,"Average save time: %f (%I64d)",0.000001 * (double) timeSpentSaving / (double) loadCount, loadCount); #endif app.DebugPrintf(buf); -#endif +#endif } counter = 0; } diff --git a/Minecraft.World/ChunkStorageProfileDecorator.h b/Minecraft.World/ChunkStorageProfileDecorator.h index 67c582daf..02ea4dcb7 100644 --- a/Minecraft.World/ChunkStorageProfileDecorator.h +++ b/Minecraft.World/ChunkStorageProfileDecorator.h @@ -8,10 +8,10 @@ class ChunkStorageProfilerDecorator : public ChunkStorage private: ChunkStorage *capsulated; - __int64 timeSpentLoading; - __int64 loadCount; - __int64 timeSpentSaving; - __int64 saveCount; + int64_t timeSpentLoading; + int64_t loadCount; + int64_t timeSpentSaving; + int64_t saveCount; int counter; diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h index 98d2573a9..ce1f39938 100644 --- a/Minecraft.World/CompoundTag.h +++ b/Minecraft.World/CompoundTag.h @@ -11,7 +11,7 @@ #include "ByteArrayTag.h" #include "IntArrayTag.h" -class CompoundTag : public Tag +class CompoundTag : public Tag { private: unordered_map tags; @@ -86,7 +86,7 @@ public: tags[name] = (new IntTag(name,value)); } - void putLong(const wstring &name, __int64 value) + void putLong(const wstring &name, int64_t value) { tags[name] = (new LongTag(name,value)); } @@ -156,9 +156,9 @@ public: return ((IntTag *) tags[name])->data; } - __int64 getLong(const wstring &name) + int64_t getLong(const wstring &name) { - if (tags.find(name) == tags.end()) return (__int64)0; + if (tags.find(name) == tags.end()) return (int64_t)0; return ((LongTag *) tags[name])->data; } @@ -261,7 +261,7 @@ public: CompoundTag *tag = new CompoundTag(getName()); for( auto& it : tags ) - { + { tag->put((wchar_t *)it.first.c_str(), it.second->copy()); } return tag; diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index 8bf1cee6b..38799022a 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 uint8_t 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; @@ -152,7 +152,7 @@ bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 ( for( int z = 0; z < 16; z += 4 ) { getBlock(&block, x, y, z); - __uint64 *comp = (__uint64 *)&blockIndices[block]; + uint64_t *comp = (uint64_t *)&blockIndices[block]; // Are the 4 y regions stored here all zero? (INDEX_TYPE_0_OR_8_BIT | INDEX_TYPE_0_BIT_FLAG ) if( ( *comp ) != 0x0007000700070007L ) return false; } @@ -170,18 +170,18 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) // 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; + int64_t *pOld = (int64_t *)indicesAndData; + int64_t *pNew = (int64_t *)other->indicesAndData; for( int i = 0; i < quickCount; i++ ) { - __int64 d0 = pOld[0] ^ pNew[0]; - __int64 d1 = pOld[1] ^ pNew[1]; - __int64 d2 = pOld[2] ^ pNew[2]; - __int64 d3 = pOld[3] ^ pNew[3]; - __int64 d4 = pOld[4] ^ pNew[4]; - __int64 d5 = pOld[5] ^ pNew[5]; - __int64 d6 = pOld[6] ^ pNew[6]; - __int64 d7 = pOld[7] ^ pNew[7]; + int64_t d0 = pOld[0] ^ pNew[0]; + int64_t d1 = pOld[1] ^ pNew[1]; + int64_t d2 = pOld[2] ^ pNew[2]; + int64_t d3 = pOld[3] ^ pNew[3]; + int64_t d4 = pOld[4] ^ pNew[4]; + int64_t d5 = pOld[5] ^ pNew[5]; + int64_t d6 = pOld[6] ^ pNew[6]; + int64_t d7 = pOld[7] ^ pNew[7]; d0 |= d1; d2 |= d3; d4 |= d5; @@ -195,7 +195,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) } pOld += 8; pNew += 8; - } + } // Now test anything remaining just uint8_t at a time unsigned char *pucOld = (unsigned char *)pOld; @@ -262,7 +262,7 @@ inline int CompressedTileStorage::getIndex(int block, int tile) // and z is: ___________zzzz // and maps to this bit of b ________bb_____ // and this bit of t ___________tt__ -// +// inline void CompressedTileStorage::getBlockAndTile(int *block, int *tile, int x, int y, int z) { @@ -303,7 +303,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) int offsets[512]; int memToAlloc = 0; // static int type0 = 0, type1 = 0, type2 = 0, type4 = 0, type8 = 0, chunkTotal = 0; - + // Loop round all blocks for( int i = 0; i < 512; i++ ) { @@ -333,8 +333,8 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) } } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4 x 4 tiles in the block { int tile = data[getIndex(i,j)]; @@ -890,7 +890,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) unsigned char *unpacked_data = NULL; unsigned char *packed_data; - // First task is to find out what type of storage each block needs. Need to unpack each where required. + // First task is to find out what type of storage each block needs. Need to unpack each where required. // Note that we don't need to fully unpack the data at this stage since we are only interested in working out how many unique types of tiles are in each block, not // what those actual tile ids are. if( upgradeBlock == -1 ) @@ -951,8 +951,8 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4x4x4 tiles in the block { int tiletype = unpacked_data[j]; @@ -1026,7 +1026,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } } switch(_blockIndices[i]) - { + { case INDEX_TYPE_1_BIT: memToAlloc += 10; break; @@ -1097,7 +1097,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) else { packed_data = data + ( ( blockIndices[i] >> INDEX_OFFSET_SHIFT ) & INDEX_OFFSET_MASK); - + int dataSize = 8 << indexTypeOld; // 8, 16 or 32 bytes of per-tile storage dataSize += 1 << ( 1 << indexTypeOld ); // 2, 4 or 16 bytes to store each tile type newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; @@ -1290,7 +1290,7 @@ int CompressedTileStorage::getHighestNonEmptyY() if(found) break; } - + int highestNonEmptyY = -1; if(found) { diff --git a/Minecraft.World/ConsoleSaveFileInputStream.h b/Minecraft.World/ConsoleSaveFileInputStream.h index 876a9484b..7f4a69c43 100644 --- a/Minecraft.World/ConsoleSaveFileInputStream.h +++ b/Minecraft.World/ConsoleSaveFileInputStream.h @@ -17,7 +17,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } + virtual int64_t skip(int64_t n) { return n; } private: ConsoleSaveFile *m_saveFile; diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 90bcbebdc..0e9e80777 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -35,7 +35,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID // We'll only be committing these as required to grow the storage we need, which will // the storage to grow without having to use realloc. - // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp. + // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp. // All access to the memory must be done via the access function as the pointer returned from VirtualAlloc // can't be used directly. pvHeap = VirtualAlloc(NULL, MAX_PAGE_COUNT * CSF_PAGE_SIZE, RESERVE_ALLOCATION, PAGE_READWRITE ); @@ -116,7 +116,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID #endif app.DebugPrintf("Filesize - %d, Adjusted size - %d\n",fileSize,storageLength); fileSize = storageLength; - } + } #ifdef __PSVITA__ if(plat == SAVE_FILE_PLATFORM_PSVITA) @@ -202,7 +202,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID } else - { + { // Clear the first 8 bytes that reference the header header.WriteHeader( pvSaveMem ); } @@ -213,7 +213,7 @@ ConsoleSaveFileOriginal::~ConsoleSaveFileOriginal() VirtualFree( pvHeap, MAX_PAGE_COUNT * CSF_PAGE_SIZE, MEM_DECOMMIT ); pagesCommitted = 0; // Make sure we don't have any thumbnail data still waiting round - we can't need it now we've destroyed the save file anyway -#if defined _XBOX +#if defined _XBOX app.GetSaveThumbnail(NULL,NULL); #elif defined __PS3__ app.GetSaveThumbnail(NULL,NULL, NULL,NULL); @@ -463,6 +463,23 @@ BOOL ConsoleSaveFileOriginal::closeHandle( FileEntry *file ) void ConsoleSaveFileOriginal::finalizeWrite() { LockSaveAccess(); + + // Ensure buffer is large enough for the full file including header table. + // New file entries (e.g. from RegionFile creation) increase GetFileSize() + // without triggering MoveDataBeyond, so the committed pages may be short. + DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; + DWORD desiredSize = header.GetFileSize(); + if( desiredSize > currentHeapSize ) + { + unsigned int pagesRequired = ( desiredSize + (CSF_PAGE_SIZE - 1 ) ) / CSF_PAGE_SIZE; + void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE); + if( pvRet == NULL ) + { + __debugbreak(); + } + pagesCommitted = pagesRequired; + } + header.WriteHeader( pvSaveMem ); ReleaseSaveAccess(); } @@ -548,7 +565,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt if ( uiCopyEnd > uiFromEnd ) { // Needs to be clamped to the end of our region - uiCopyEnd = uiFromEnd; + uiCopyEnd = uiFromEnd; } #ifdef __PSVITA__ // AP - use this to access the virtual memory @@ -664,7 +681,7 @@ 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 requirements 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 requires for the output buffer. Instead we'll be writing // directly from the save data. StorageManager.SetSaveData(pvSaveMem,fileSize); uint8_t *compData = (uint8_t *)pvSaveMem; @@ -758,7 +775,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) BYTE bTextMetadata[88]; ZeroMemory(bTextMetadata,88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL) { @@ -774,7 +791,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) #ifdef _XBOX StorageManager.SaveSaveData( compLength+8,pbThumbnailData,dwThumbnailDataSize,bTextMetadata,iTextMetadataBytes ); - delete [] pbThumbnailData; + delete [] pbThumbnailData; #ifndef _CONTENT_PACKAGE if( app.DebugSettingsOn()) { diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 131b32692..50e04e3be 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -13,7 +13,7 @@ const double CustomLevelSource::SNOW_SCALE = 0.3; const double CustomLevelSource::SNOW_CUTOFF = 0.5; -CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { #ifdef _OVERRIDE_HEIGHTMAP m_XZSize = level->getLevelData()->getXZSize(); @@ -328,7 +328,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi run = runDepth; if (y >= waterHeight - 1) blocks[offs] = top; else blocks[offs] = material; - } + } else if (run > 0) { run--; @@ -402,7 +402,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs) // addCaves(xOffs, zOffs, blocks); // addTowns(xOffs, zOffs, blocks); - // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method + // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method // 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also // now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore. @@ -507,8 +507,8 @@ void CustomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; diff --git a/Minecraft.World/CustomLevelSource.h b/Minecraft.World/CustomLevelSource.h index 7739fc955..9a9cb8cf9 100644 --- a/Minecraft.World/CustomLevelSource.h +++ b/Minecraft.World/CustomLevelSource.h @@ -46,7 +46,7 @@ private: const bool generateStructures; public: - CustomLevelSource(Level *level, __int64 seed, bool generateStructures); + CustomLevelSource(Level *level, int64_t seed, bool generateStructures); ~CustomLevelSource(); public: @@ -77,6 +77,6 @@ public: public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); virtual void recreateLogicStructuresForChunk(int chunkX, int chunkZ); }; diff --git a/Minecraft.World/DataInput.h b/Minecraft.World/DataInput.h index 2b2e341c0..478a5e09e 100644 --- a/Minecraft.World/DataInput.h +++ b/Minecraft.World/DataInput.h @@ -13,7 +13,7 @@ public: virtual double readDouble() = 0; virtual float readFloat() = 0; virtual int readInt() = 0; - virtual __int64 readLong() = 0; + virtual int64_t readLong() = 0; virtual short readShort() = 0; virtual wchar_t readChar() = 0; virtual wstring readUTF() = 0; diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index a7ce3d9d7..774ff105f 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -32,8 +32,8 @@ int DataInputStream::read() // //The read(b) method has the same effect as: // -// read(b, 0, b.length) -// +// read(b, 0, b.length) +// //Overrides: //read in class FilterInputStream //Parameters: @@ -102,7 +102,7 @@ unsigned char DataInputStream::readUnsignedByte() //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. //Returns: //the char value read. @@ -110,7 +110,7 @@ wchar_t DataInputStream::readChar() { int a = stream->read(); int b = stream->read(); - return (wchar_t)((a << 8) | (b & 0xff)); + return (wchar_t)((a << 8) | (b & 0xff)); } //Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b. @@ -170,7 +170,7 @@ bool DataInputStream::readFully(charArray b) //the double value read. double DataInputStream::readDouble() { - __int64 bits = readLong(); + int64_t bits = readLong(); return Double::longBitsToDouble( bits ); } @@ -188,10 +188,10 @@ float DataInputStream::readFloat() } //Reads four input bytes and returns an int value. Let a-d be the first through fourth bytes read. The value returned is: -// +// // (((a & 0xff) << 24) | ((b & 0xff) << 16) | // ((c & 0xff) << 8) | (d & 0xff)) -// +// //This method is suitable for reading bytes written by the writeInt method of interface DataOutput. //Returns: //the int value read. @@ -207,7 +207,7 @@ int DataInputStream::readInt() } //Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is: -// +// // (((long)(a & 0xff) << 56) | // ((long)(b & 0xff) << 48) | // ((long)(c & 0xff) << 40) | @@ -216,23 +216,23 @@ int DataInputStream::readInt() // ((long)(f & 0xff) << 16) | // ((long)(g & 0xff) << 8) | // ((long)(h & 0xff))) -// +// //This method is suitable for reading bytes written by the writeLong method of interface DataOutput. // //Returns: //the long value read. -__int64 DataInputStream::readLong() +int64_t DataInputStream::readLong() { - __int64 a = stream->read(); - __int64 b = stream->read(); - __int64 c = stream->read(); - __int64 d = stream->read(); - __int64 e = stream->read(); - __int64 f = stream->read(); - __int64 g = stream->read(); - __int64 h = stream->read(); + int64_t a = stream->read(); + int64_t b = stream->read(); + int64_t c = stream->read(); + int64_t d = stream->read(); + int64_t e = stream->read(); + int64_t f = stream->read(); + int64_t g = stream->read(); + int64_t h = stream->read(); - __int64 bits = (((a & 0xff) << 56) | + int64_t bits = (((a & 0xff) << 56) | ((b & 0xff) << 48) | ((c & 0xff) << 40) | ((d & 0xff) << 32) | @@ -246,7 +246,7 @@ __int64 DataInputStream::readLong() //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. //Returns: //the 16-bit value read. @@ -279,13 +279,13 @@ unsigned short DataInputStream::readUnsignedShort() //then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // //(char)(((a& 0x1F) << 6) | (b & 0x3F)) -// +// //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 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. // @@ -312,7 +312,7 @@ wstring DataInputStream::readUTF() outputString.push_back(theChar); }*/ - + unsigned short currentByteIndex = 0; while( currentByteIndex < UTFLength ) { @@ -397,7 +397,7 @@ wstring DataInputStream::readUTF() { // TODO 4J Stu - EOFException break; - } + } // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -427,7 +427,7 @@ wstring DataInputStream::readUTF() continue; } } - + return outputString; } @@ -493,7 +493,7 @@ int DataInputStream::readUTFChar() { // TODO 4J Stu - EOFException return returnValue; - } + } int thirdByte = stream->read(); @@ -542,7 +542,7 @@ void DataInputStream::deleteChildStream() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 DataInputStream::skip(__int64 n) +int64_t DataInputStream::skip(int64_t n) { return stream->skip(n); } diff --git a/Minecraft.World/DataInputStream.h b/Minecraft.World/DataInputStream.h index bf96d1026..6f4d128f1 100644 --- a/Minecraft.World/DataInputStream.h +++ b/Minecraft.World/DataInputStream.h @@ -25,12 +25,12 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/Minecraft.World/DataOutput.h b/Minecraft.World/DataOutput.h index 9df3dd957..ad31f29f8 100644 --- a/Minecraft.World/DataOutput.h +++ b/Minecraft.World/DataOutput.h @@ -10,7 +10,7 @@ public: virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; - virtual void writeLong(__int64 a) = 0; + virtual void writeLong(int64_t a) = 0; virtual void writeShort(short a) = 0; virtual void writeBoolean(bool v) = 0; virtual void writeChar(wchar_t v) = 0; diff --git a/Minecraft.World/DataOutputStream.cpp b/Minecraft.World/DataOutputStream.cpp index 363a7dba5..2ef2aad99 100644 --- a/Minecraft.World/DataOutputStream.cpp +++ b/Minecraft.World/DataOutputStream.cpp @@ -78,7 +78,7 @@ void DataOutputStream::writeByte(uint8_t a) //v - a double value to be written. void DataOutputStream::writeDouble(double a) { - __int64 bits = Double::doubleToLongBits( a ); + int64_t bits = Double::doubleToLongBits( a ); writeLong( bits ); // TODO 4J Stu - Error handling? @@ -116,7 +116,7 @@ void DataOutputStream::writeInt(int a) //In no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a long to be written. -void DataOutputStream::writeLong(__int64 a) +void DataOutputStream::writeLong(int64_t a) { stream->write( (a >> 56) & 0xff ); stream->write( (a >> 48) & 0xff ); @@ -186,7 +186,7 @@ void DataOutputStream::writeBoolean(bool b) { stream->write( b ? (uint8_t)1 : (uint8_t)0 ); // TODO 4J Stu - Error handling? - written += 1; + written += 1; } //Writes a string to the underlying output stream using modified UTF-8 encoding in a machine-independent manner. @@ -228,7 +228,7 @@ void DataOutputStream::writeUTF(const wstring& str) byteArray bytearr(utflen+2); bytearr[count++] = (uint8_t) ((utflen >> 8) & 0xFF); - bytearr[count++] = (uint8_t) ((utflen >> 0) & 0xFF); + bytearr[count++] = (uint8_t) ((utflen >> 0) & 0xFF); int i=0; for (i=0; i > *players) return wrapped->createTag(players); } -__int64 DerivedLevelData::getSeed() +int64_t DerivedLevelData::getSeed() { return wrapped->getSeed(); } @@ -43,17 +43,17 @@ int DerivedLevelData::getZSpawn() return wrapped->getZSpawn(); } -__int64 DerivedLevelData::getGameTime() +int64_t DerivedLevelData::getGameTime() { return wrapped->getGameTime(); } -__int64 DerivedLevelData::getDayTime() +int64_t DerivedLevelData::getDayTime() { return wrapped->getDayTime(); } -__int64 DerivedLevelData::getSizeOnDisk() +int64_t DerivedLevelData::getSizeOnDisk() { return wrapped->getSizeOnDisk(); } @@ -73,7 +73,7 @@ int DerivedLevelData::getVersion() return wrapped->getVersion(); } -__int64 DerivedLevelData::getLastPlayed() +int64_t DerivedLevelData::getLastPlayed() { return wrapped->getLastPlayed(); } @@ -103,7 +103,7 @@ GameType *DerivedLevelData::getGameType() return wrapped->getGameType(); } -void DerivedLevelData::setSeed(__int64 seed) +void DerivedLevelData::setSeed(int64_t seed) { } @@ -119,15 +119,15 @@ void DerivedLevelData::setZSpawn(int zSpawn) { } -void DerivedLevelData::setGameTime(__int64 time) +void DerivedLevelData::setGameTime(int64_t time) { } -void DerivedLevelData::setDayTime(__int64 time) +void DerivedLevelData::setDayTime(int64_t time) { } -void DerivedLevelData::setSizeOnDisk(__int64 sizeOnDisk) +void DerivedLevelData::setSizeOnDisk(int64_t sizeOnDisk) { } diff --git a/Minecraft.World/DerivedLevelData.h b/Minecraft.World/DerivedLevelData.h index ad612cc94..9b439053a 100644 --- a/Minecraft.World/DerivedLevelData.h +++ b/Minecraft.World/DerivedLevelData.h @@ -18,29 +18,29 @@ protected: public: CompoundTag *createTag(); CompoundTag *createTag(vector > *players); - __int64 getSeed(); + int64_t getSeed(); int getXSpawn(); int getYSpawn(); int getZSpawn(); - __int64 getGameTime(); - __int64 getDayTime(); - __int64 getSizeOnDisk(); + int64_t getGameTime(); + int64_t getDayTime(); + int64_t getSizeOnDisk(); CompoundTag *getLoadedPlayerTag(); wstring getLevelName(); int getVersion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); bool isThundering(); int getThunderTime(); bool isRaining(); int getRainTime(); GameType *getGameType(); - void setSeed(__int64 seed); + void setSeed(int64_t seed); void setXSpawn(int xSpawn); void setYSpawn(int ySpawn); void setZSpawn(int zSpawn); - void setGameTime(__int64 time); - void setDayTime(__int64 time); - void setSizeOnDisk(__int64 sizeOnDisk); + void setGameTime(int64_t time); + void setDayTime(int64_t time); + void setSizeOnDisk(int64_t sizeOnDisk); void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); void setDimension(int dimension); void setSpawn(int xSpawn, int ySpawn, int zSpawn); diff --git a/Minecraft.World/Dimension.cpp b/Minecraft.World/Dimension.cpp index 697da010b..479edae88 100644 --- a/Minecraft.World/Dimension.cpp +++ b/Minecraft.World/Dimension.cpp @@ -45,13 +45,13 @@ void Dimension::init() } else #endif - if (level->getLevelData()->getGenerator() == LevelType::lvl_flat) + if (level->getLevelData()->getGenerator() == LevelType::lvl_flat) { FlatGeneratorInfo *generator = FlatGeneratorInfo::fromValue(level->getLevelData()->getGeneratorOptions()); biomeSource = new FixedBiomeSource(Biome::biomes[generator->getBiome()], 0.5f, 0.5f); delete generator; } - else + else { biomeSource = new BiomeSource(level); } @@ -84,11 +84,11 @@ ChunkSource *Dimension::createRandomLevelSource() const } else #endif - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return new FlatLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures()); - } - else + } + else { return new RandomLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures()); } @@ -113,7 +113,7 @@ bool Dimension::isValidSpawn(int x, int z) const return true; } -float Dimension::getTimeOfDay(__int64 time, float a) const +float Dimension::getTimeOfDay(int64_t time, float a) const { int dayStep = (int) (time % Level::TICKS_PER_DAY); float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f; @@ -125,7 +125,7 @@ float Dimension::getTimeOfDay(__int64 time, float a) const return td; } -int Dimension::getMoonPhase(__int64 time) const +int Dimension::getMoonPhase(int64_t time) const { return ((int) (time / Level::TICKS_PER_DAY)) % 8; } @@ -210,16 +210,16 @@ Pos *Dimension::getSpawnPos() return NULL; } -int Dimension::getSpawnYPosition() +int Dimension::getSpawnYPosition() { - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return 4; } return Level::genDepth / 2; } -bool Dimension::hasBedrockFog() +bool Dimension::hasBedrockFog() { // 4J-PB - turn off bedrock fog if the host player doesn't want it if(app.GetGameHostOption(eGameHostOption_BedrockFog)==0) @@ -230,9 +230,9 @@ bool Dimension::hasBedrockFog() return (levelType != LevelType::lvl_flat && !hasCeiling); } -double Dimension::getClearColorScale() +double Dimension::getClearColorScale() { - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return 1.0; } diff --git a/Minecraft.World/Dimension.h b/Minecraft.World/Dimension.h index 5cccd68b6..ca040e21f 100644 --- a/Minecraft.World/Dimension.h +++ b/Minecraft.World/Dimension.h @@ -38,8 +38,8 @@ public: virtual bool isValidSpawn(int x, int z) const; - virtual float getTimeOfDay(__int64 time, float a) const; - virtual int getMoonPhase(__int64 time) const; + virtual float getTimeOfDay(int64_t time, float a) const; + virtual int getMoonPhase(int64_t time) const; virtual bool isNaturalDimension(); private: static const int fogColor = 0xc0d8ff; @@ -56,7 +56,7 @@ public: virtual Pos *getSpawnPos(); int getSpawnYPosition(); - virtual bool hasBedrockFog(); + virtual bool hasBedrockFog(); double getClearColorScale(); virtual bool isFoggyAt(int x, int z); diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index b74257693..1d37a1822 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -108,19 +108,19 @@ void _MapDataMappings_old::setMapping(int id, PlayerUID xuid, int dimension) #ifdef _LARGE_WORLDS void DirectoryLevelStorage::PlayerMappings::addMapping(int id, int centreX, int centreZ, int dimension, int scale) { - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); m_mappings[index] = id; //app.DebugPrintf("Adding mapping: %d - (%d,%d)/%d/%d [%I64d - 0x%016llx]\n", id, centreX, centreZ, dimension, scale, index, index); } bool DirectoryLevelStorage::PlayerMappings::getMapping(int &id, int centreX, int centreZ, int dimension, int scale) { - //__int64 zMasked = centreZ & 0x1FFFFFFF; - //__int64 xMasked = centreX & 0x1FFFFFFF; - //__int64 zShifted = zMasked << 34; - //__int64 xShifted = xMasked << 5; + //int64_t zMasked = centreZ & 0x1FFFFFFF; + //int64_t xMasked = centreX & 0x1FFFFFFF; + //int64_t zShifted = zMasked << 34; + //int64_t xShifted = xMasked << 5; //app.DebugPrintf("xShifted = %d (0x%016x), zShifted = %I64d (0x%016llx)\n", xShifted, xShifted, zShifted, zShifted); - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); auto it = m_mappings.find(index); if(it != m_mappings.end()) { @@ -151,7 +151,7 @@ void DirectoryLevelStorage::PlayerMappings::readMappings(DataInputStream *dis) int count = dis->readInt(); for(unsigned int i = 0; i < count; ++i) { - __int64 index = dis->readLong(); + int64_t index = dis->readLong(); int id = dis->readInt(); m_mappings[index] = id; app.DebugPrintf(" -- %lld (0x%016llx) = %d\n", index, index, id); diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index 464eb8a3b..d66c55163 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -54,7 +54,7 @@ typedef struct _MapDataMappings_old void setMapping(int id, PlayerUID xuid, int dimension); } MapDataMappings_old; -class DirectoryLevelStorage : public LevelStorage, public PlayerIO +class DirectoryLevelStorage : public LevelStorage, public PlayerIO { private: /* 4J Jev, Probably no need for this as theres no exceptions being thrown. @@ -65,7 +65,7 @@ private: const ConsoleSavePath playerDir; //const File dataDir; const ConsoleSavePath dataDir; - const __int64 sessionId; + const int64_t sessionId; const wstring levelId; static const wstring sc_szPlayerDir; @@ -75,7 +75,7 @@ private: { friend class DirectoryLevelStorage; private: - unordered_map<__int64, short> m_mappings; + unordered_map m_mappings; public: void addMapping(int id, int centreX, int centreZ, int dimension, int scale); @@ -92,7 +92,7 @@ private: #else MapDataMappings m_mapDataMappings; MapDataMappings m_saveableMapDataMappings; -#endif +#endif bool m_bHasLoadedMapDataMappings; unordered_map m_cachedSaveData; diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp index 7cc0a04cd..703ddfb71 100644 --- a/Minecraft.World/EmptyLevelChunk.cpp +++ b/Minecraft.World/EmptyLevelChunk.cpp @@ -215,7 +215,7 @@ bool EmptyLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *EmptyLevelChunk::getRandom(__int64 l) +Random *EmptyLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/Minecraft.World/EmptyLevelChunk.h b/Minecraft.World/EmptyLevelChunk.h index 06bffea9c..e22180df6 100644 --- a/Minecraft.World/EmptyLevelChunk.h +++ b/Minecraft.World/EmptyLevelChunk.h @@ -49,7 +49,7 @@ public: int getBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); bool isEmpty(); virtual void reSyncLighting() {}; // 4J added }; diff --git a/Minecraft.World/EnchantmentMenu.h b/Minecraft.World/EnchantmentMenu.h index e09b94c6a..62408f1db 100644 --- a/Minecraft.World/EnchantmentMenu.h +++ b/Minecraft.World/EnchantmentMenu.h @@ -23,7 +23,7 @@ private: bool m_costsChanged; // 4J Added public: - __int64 nameSeed; + int64_t nameSeed; public: int costs[3]; diff --git a/Minecraft.World/FileHeader.h b/Minecraft.World/FileHeader.h index 4444409f5..bfc6ff015 100644 --- a/Minecraft.World/FileHeader.h +++ b/Minecraft.World/FileHeader.h @@ -102,7 +102,7 @@ public: }; - __int64 lastModifiedTime; // 8B + int64_t lastModifiedTime; // 8B }; typedef FileEntrySaveDataV2 FileEntrySaveData; @@ -128,7 +128,7 @@ public: currentFilePointer = data.startOffset; } - unsigned int getFileSize() { return data.length; } + unsigned int getFileSize() { return data.length; } bool isRegionFile() { return data.filename[0] == 0; } // When using ConsoleSaveFileSplit only unsigned int getRegionFileIndex() { return data.regionIndex; } // When using ConsoleSaveFileSplit only @@ -191,7 +191,7 @@ protected: vector *getDatFilesWithMacAndUserID(const PlayerUID& pUID); vector *getDatFilesWithPrimaryUser(); #endif - + void setSaveVersion(int version) { m_saveVersion = version; } int getSaveVersion() { return m_saveVersion; } void setOriginalSaveVersion(int version) { m_originalSaveVersion = version; } @@ -205,5 +205,5 @@ protected: void setEndian(ByteOrder endian) { m_saveEndian = endian; } static ByteOrder getEndian(ESavePlatform plat); bool isLocalEndianDifferent(ESavePlatform plat){return m_localEndian != getEndian(plat); } - + }; diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp index 858f5d3b0..be99a546f 100644 --- a/Minecraft.World/FileInputStream.cpp +++ b/Minecraft.World/FileInputStream.cpp @@ -164,8 +164,8 @@ void FileInputStream::close() { //printf("\n\nFileInputStream::close - TRYING TO CLOSE AN INVALID FILE HANDLE\n\n"); return; - } - + } + BOOL result = CloseHandle( m_fileHandle ); if( result == 0 ) @@ -185,7 +185,7 @@ void FileInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 FileInputStream::skip(__int64 n) +int64_t FileInputStream::skip(int64_t n) { #ifdef _XBOX LARGE_INTEGER li; diff --git a/Minecraft.World/FileInputStream.h b/Minecraft.World/FileInputStream.h index e855a2d7f..99ce776f2 100644 --- a/Minecraft.World/FileInputStream.h +++ b/Minecraft.World/FileInputStream.h @@ -12,7 +12,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); private: HANDLE m_fileHandle; diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp index a85badcef..8deb07af5 100644 --- a/Minecraft.World/FlatLevelSource.cpp +++ b/Minecraft.World/FlatLevelSource.cpp @@ -11,7 +11,7 @@ //FlatLevelSource::villageFeature = new VillageFeature(1); -FlatLevelSource::FlatLevelSource(Level *level, __int64 seed, bool generateStructures) +FlatLevelSource::FlatLevelSource(Level *level, int64_t seed, bool generateStructures) { m_XZSize = level->getLevelData()->getXZSize(); @@ -32,26 +32,26 @@ FlatLevelSource::~FlatLevelSource() delete villageFeature; } -void FlatLevelSource::prepareHeights(byteArray blocks) +void FlatLevelSource::prepareHeights(byteArray blocks) { int height = blocks.length / (16 * 16); - for (int xc = 0; xc < 16; xc++) + for (int xc = 0; xc < 16; xc++) { - for (int zc = 0; zc < 16; zc++) + for (int zc = 0; zc < 16; zc++) { - for (int yc = 0; yc < height; yc++) + for (int yc = 0; yc < height; yc++) { int block = 0; - if (yc == 0) + if (yc == 0) { block = Tile::unbreakable_Id; - } - else if (yc <= 2) + } + else if (yc <= 2) { block = Tile::dirt_Id; - } - else if (yc == 3) + } + else if (yc == 3) { block = Tile::grass_Id; } @@ -61,12 +61,12 @@ void FlatLevelSource::prepareHeights(byteArray blocks) } } -LevelChunk *FlatLevelSource::create(int x, int z) +LevelChunk *FlatLevelSource::create(int x, int z) { return getChunk(x, z); } -LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) +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; @@ -80,7 +80,7 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) // double[] temperatures = level.getBiomeSource().temperatures; - if (generateStructures) + if (generateStructures) { villageFeature->apply(this, level, xOffs, zOffs, blocks); } @@ -96,43 +96,43 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) } -bool FlatLevelSource::hasChunk(int x, int y) +bool FlatLevelSource::hasChunk(int x, int y) { return true; } -void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) +void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) { // 4J - changed from random to pprandom so we can run in parallel with getChunk etc. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); - if (generateStructures) + if (generateStructures) { villageFeature->postProcess(level, pprandom, xt, zt); } - + app.processSchematics(parent->getChunk(xt,zt)); } -bool FlatLevelSource::save(bool force, ProgressListener *progressListener) +bool FlatLevelSource::save(bool force, ProgressListener *progressListener) { return true; } -bool FlatLevelSource::tick() +bool FlatLevelSource::tick() { return false; } -bool FlatLevelSource::shouldSave() +bool FlatLevelSource::shouldSave() { return true; } -wstring FlatLevelSource::gatherStats() +wstring FlatLevelSource::gatherStats() { return L"FlatLevelSource"; } @@ -140,7 +140,7 @@ wstring FlatLevelSource::gatherStats() vector *FlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { Biome *biome = level->getBiome(x, z); - if (biome == NULL) + if (biome == NULL) { return NULL; } diff --git a/Minecraft.World/FlatLevelSource.h b/Minecraft.World/FlatLevelSource.h index 8f8a506df..99338cd99 100644 --- a/Minecraft.World/FlatLevelSource.h +++ b/Minecraft.World/FlatLevelSource.h @@ -24,13 +24,13 @@ private: boolean generateStructures; VillageFeature *villageFeature;// = new VillageFeature(1); -public: - FlatLevelSource(Level *level, __int64 seed, bool generateStructures); +public: + FlatLevelSource(Level *level, int64_t seed, bool generateStructures); ~FlatLevelSource(); -private: void prepareHeights(byteArray blocks); +private: void prepareHeights(byteArray blocks); -public: +public: virtual LevelChunk *create(int x, int z); virtual LevelChunk *getChunk(int xOffs, int zOffs); virtual bool hasChunk(int x, int y); diff --git a/Minecraft.World/FuzzyZoomLayer.cpp b/Minecraft.World/FuzzyZoomLayer.cpp index 65c6709e9..54155ff59 100644 --- a/Minecraft.World/FuzzyZoomLayer.cpp +++ b/Minecraft.World/FuzzyZoomLayer.cpp @@ -2,7 +2,7 @@ #include "System.h" #include "net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -61,7 +61,7 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrFuzzyZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrFuzzyZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptr result = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/FuzzyZoomLayer.h b/Minecraft.World/FuzzyZoomLayer.h index bc8f5e489..195269317 100644 --- a/Minecraft.World/FuzzyZoomLayer.h +++ b/Minecraft.World/FuzzyZoomLayer.h @@ -5,7 +5,7 @@ class FuzzyZoomLayer : public Layer { public: - FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent); + FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -13,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/GZIPInputStream.h b/Minecraft.World/GZIPInputStream.h index f852518b8..b92425768 100644 --- a/Minecraft.World/GZIPInputStream.h +++ b/Minecraft.World/GZIPInputStream.h @@ -13,5 +13,5 @@ public: virtual int read(byteArray b) { return stream->read( b ); }; virtual int read(byteArray b, unsigned int offset, unsigned int length) { return stream->read(b, offset, length); }; virtual void close() { return stream->close(); }; - virtual __int64 skip(__int64 n) { return 0; }; + virtual int64_t skip(int64_t n) { return 0; }; }; \ No newline at end of file diff --git a/Minecraft.World/GrowMushroomIslandLayer.cpp b/Minecraft.World/GrowMushroomIslandLayer.cpp index 14857366d..d204502d5 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/GrowMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } @@ -25,10 +25,10 @@ intArray GrowMushroomIslandLayer::getArea(int xo, int yo, int w, int h) int n2 = p[(x + 2) + (y + 0) * pw]; int n3 = p[(x + 0) + (y + 2) * pw]; int n4 = p[(x + 2) + (y + 2) * pw]; - + int c = p[(x + 1) + (y + 1) * pw]; - if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) ) + if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) ) { result[x + y * w] = Biome::mushroomIsland->id; } diff --git a/Minecraft.World/GrowMushroomIslandLayer.h b/Minecraft.World/GrowMushroomIslandLayer.h index 3bca4d5c7..6b0860f70 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.h +++ b/Minecraft.World/GrowMushroomIslandLayer.h @@ -4,6 +4,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/HellDimension.cpp b/Minecraft.World/HellDimension.cpp index ebc375522..bddcdd45d 100644 --- a/Minecraft.World/HellDimension.cpp +++ b/Minecraft.World/HellDimension.cpp @@ -48,7 +48,7 @@ ChunkSource *HellDimension::createRandomLevelSource() const } else #endif - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return new HellFlatLevelSource(level, level->getSeed()); } @@ -68,7 +68,7 @@ bool HellDimension::isValidSpawn(int x, int z) const return false; } -float HellDimension::getTimeOfDay(__int64 time, float a) const +float HellDimension::getTimeOfDay(int64_t time, float a) const { return 0.5f; } diff --git a/Minecraft.World/HellDimension.h b/Minecraft.World/HellDimension.h index b37f2b53b..fa95d9b2c 100644 --- a/Minecraft.World/HellDimension.h +++ b/Minecraft.World/HellDimension.h @@ -14,7 +14,7 @@ public: virtual ChunkSource *createRandomLevelSource() const; virtual bool isNaturalDimension(); virtual bool isValidSpawn(int x, int y) const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual bool mayRespawn() const; virtual bool isFoggyAt(int x, int z); diff --git a/Minecraft.World/HellFlatLevelSource.cpp b/Minecraft.World/HellFlatLevelSource.cpp index ad21f2396..9120cec56 100644 --- a/Minecraft.World/HellFlatLevelSource.cpp +++ b/Minecraft.World/HellFlatLevelSource.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.storage.h" #include "HellFlatLevelSource.h" -HellFlatLevelSource::HellFlatLevelSource(Level *level, __int64 seed) +HellFlatLevelSource::HellFlatLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -26,17 +26,17 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) { int height = blocks.length / (16 * 16); - for (int xc = 0; xc < 16; xc++) + for (int xc = 0; xc < 16; xc++) { - for (int zc = 0; zc < 16; zc++) + for (int zc = 0; zc < 16; zc++) { - for (int yc = 0; yc < height; yc++) + for (int yc = 0; yc < height; yc++) { int block = 0; if ( (yc <= 6) || ( yc >= 121 ) ) { block = Tile::netherRack_Id; - } + } blocks[xc << 11 | zc << 7 | yc] = (uint8_t) block; } @@ -159,8 +159,8 @@ void HellFlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); int count = pprandom->nextInt(pprandom->nextInt(10) + 1) + 1; @@ -211,7 +211,7 @@ wstring HellFlatLevelSource::gatherStats() vector *HellFlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { Biome *biome = level->getBiome(x, z); - if (biome == NULL) + if (biome == NULL) { return NULL; } diff --git a/Minecraft.World/HellFlatLevelSource.h b/Minecraft.World/HellFlatLevelSource.h index 2e58f1606..4ad948910 100644 --- a/Minecraft.World/HellFlatLevelSource.h +++ b/Minecraft.World/HellFlatLevelSource.h @@ -26,7 +26,7 @@ private: Level *level; public: - HellFlatLevelSource(Level *level, __int64 seed); + HellFlatLevelSource(Level *level, int64_t seed); ~HellFlatLevelSource(); private: diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp index 47b81e9ac..7c1786a4f 100644 --- a/Minecraft.World/HellRandomLevelSource.cpp +++ b/Minecraft.World/HellRandomLevelSource.cpp @@ -7,7 +7,7 @@ #include "BiomeSource.h" #include "HellRandomLevelSource.h" -HellRandomLevelSource::HellRandomLevelSource(Level *level, __int64 seed) +HellRandomLevelSource::HellRandomLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -430,8 +430,8 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); netherBridgeFeature->postProcess(level, pprandom, xt, zt); diff --git a/Minecraft.World/HellRandomLevelSource.h b/Minecraft.World/HellRandomLevelSource.h index 2a0c3c862..5142aa289 100644 --- a/Minecraft.World/HellRandomLevelSource.h +++ b/Minecraft.World/HellRandomLevelSource.h @@ -37,7 +37,7 @@ private: Level *level; public: - HellRandomLevelSource(Level *level, __int64 seed); + HellRandomLevelSource(Level *level, int64_t seed); ~HellRandomLevelSource(); NetherBridgeFeature *netherBridgeFeature; diff --git a/Minecraft.World/InputStream.h b/Minecraft.World/InputStream.h index af0ff5934..234e85b5d 100644 --- a/Minecraft.World/InputStream.h +++ b/Minecraft.World/InputStream.h @@ -11,7 +11,7 @@ public: virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual void close() = 0; - virtual __int64 skip(__int64 n) = 0; + virtual int64_t skip(int64_t n) = 0; static InputStream *getResourceAsStream(const wstring &fileName); }; \ No newline at end of file diff --git a/Minecraft.World/IslandLayer.cpp b/Minecraft.World/IslandLayer.cpp index b502f3847..0a6cc3fa0 100644 --- a/Minecraft.World/IslandLayer.cpp +++ b/Minecraft.World/IslandLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup) +IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup) { } diff --git a/Minecraft.World/IslandLayer.h b/Minecraft.World/IslandLayer.h index 09e90eb30..909956369 100644 --- a/Minecraft.World/IslandLayer.h +++ b/Minecraft.World/IslandLayer.h @@ -5,7 +5,7 @@ class IslandLayer : public Layer { public: - IslandLayer(__int64 seedMixup); + IslandLayer(int64_t seedMixup); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/JavaMath.cpp b/Minecraft.World/JavaMath.cpp index 928436952..87778c564 100644 --- a/Minecraft.World/JavaMath.cpp +++ b/Minecraft.World/JavaMath.cpp @@ -34,9 +34,9 @@ double Math::random() //a - a floating-point value to be rounded to a long. //Returns: //the value of the argument rounded to the nearest long value. -__int64 Math::round( double d ) +int64_t Math::round( double d ) { - return (__int64)floor( d + 0.5 ); + return (int64_t)floor( d + 0.5 ); } int Math::_max(int a, int b) @@ -59,7 +59,7 @@ float Math::_min(float a, float b) return a < b ? a : b; } -float Math::wrapDegrees(float input) +float Math::wrapDegrees(float input) { while(input>=360.0f)input-=360.0f; if (input >= 180.0f) input -= 360.0f; @@ -67,7 +67,7 @@ float Math::wrapDegrees(float input) return input; } -double Math::wrapDegrees(double input) +double Math::wrapDegrees(double input) { while(input>=360.0)input-=360.0; if (input >= 180.0) input -= 360.0; diff --git a/Minecraft.World/JavaMath.h b/Minecraft.World/JavaMath.h index fcd095c8b..b64832e92 100644 --- a/Minecraft.World/JavaMath.h +++ b/Minecraft.World/JavaMath.h @@ -8,7 +8,7 @@ private: public: static double random(); - static __int64 round( double d ); + static int64_t round( double d ); static int _max(int a, int b); static float _max(float a, float b); static int _min(int a, int b); diff --git a/Minecraft.World/LargeCaveFeature.cpp b/Minecraft.World/LargeCaveFeature.cpp index 102f10adc..27f0463f1 100644 --- a/Minecraft.World/LargeCaveFeature.cpp +++ b/Minecraft.World/LargeCaveFeature.cpp @@ -4,12 +4,12 @@ #include "net.minecraft.world.level.biome.h" #include "LargeCaveFeature.h" -void LargeCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) +void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5); } -void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { double xMid = xOffs * 16 + 8; double zMid = zOffs * 16 + 8; @@ -123,7 +123,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b } if (detectedWater) continue; - for (int xx = x0; xx < x1; xx++) + for (int xx = x0; xx < x1; xx++) { double xd = ((xx + xOffs * 16 + 0.5) - xCave) / rad; for (int zz = z0; zz < z1; zz++) @@ -142,7 +142,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b if (block == Tile::grass_Id) hasGrass = true; if (block == Tile::stone_Id || block == Tile::dirt_Id || block == Tile::grass_Id) { - if (yy < 10) + if (yy < 10) { blocks[p] = (uint8_t) Tile::lava_Id; } diff --git a/Minecraft.World/LargeCaveFeature.h b/Minecraft.World/LargeCaveFeature.h index 5188aca72..66eadde9b 100644 --- a/Minecraft.World/LargeCaveFeature.h +++ b/Minecraft.World/LargeCaveFeature.h @@ -5,7 +5,7 @@ class LargeCaveFeature : public LargeFeature { protected: - void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/Minecraft.World/LargeFeature.cpp b/Minecraft.World/LargeFeature.cpp index 2e43fac72..23dc532f5 100644 --- a/Minecraft.World/LargeFeature.cpp +++ b/Minecraft.World/LargeFeature.cpp @@ -21,15 +21,15 @@ void LargeFeature::apply(ChunkSource *ChunkSource, Level *level, int xOffs, int this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); for (int x = xOffs - r; x <= xOffs + r; x++) { for (int z = zOffs - r; z <= zOffs + r; z++) { - __int64 xx = x * xScale; - __int64 zz = z * zScale; + int64_t xx = x * xScale; + int64_t zz = z * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, x, z, xOffs, zOffs, blocks); } diff --git a/Minecraft.World/LargeHellCaveFeature.cpp b/Minecraft.World/LargeHellCaveFeature.cpp index 8b726261a..e6cce4676 100644 --- a/Minecraft.World/LargeHellCaveFeature.cpp +++ b/Minecraft.World/LargeHellCaveFeature.cpp @@ -3,12 +3,12 @@ #include "LargeHellCaveFeature.h" #include "net.minecraft.world.level.tile.h" -void LargeHellCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) +void LargeHellCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5); } -void LargeHellCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void LargeHellCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { double xMid = xOffs * 16 + 8; double zMid = zOffs * 16 + 8; diff --git a/Minecraft.World/LargeHellCaveFeature.h b/Minecraft.World/LargeHellCaveFeature.h index ab6558b83..4217c8b0c 100644 --- a/Minecraft.World/LargeHellCaveFeature.h +++ b/Minecraft.World/LargeHellCaveFeature.h @@ -5,7 +5,7 @@ class LargeHellCaveFeature : public LargeFeature { protected: - void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/Minecraft.World/Layer.cpp b/Minecraft.World/Layer.cpp index 956a8917b..f90f1fa84 100644 --- a/Minecraft.World/Layer.cpp +++ b/Minecraft.World/Layer.cpp @@ -16,7 +16,7 @@ libdivide::divider fast_d7(7); libdivide::divider fast_d10(10); #endif -LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) +LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) { // 4J - Some changes moved here from 1.2.3. Temperature & downfall layers are no longer created & returned, and a debug layer is isn't. // For reference with regard to future merging, things NOT brought forward from the 1.2.3 version are new layer types that we @@ -58,7 +58,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) biomeLayer = shared_ptr(new ZoomLayer(1000 + i, biomeLayer)); if (i == 0) biomeLayer = shared_ptr(new AddIslandLayer(3, biomeLayer)); - + if (i == 0) { // 4J - moved mushroom islands to here. This skips 3 zooms that the old location of the add was, making them about 1/8 of the original size. Adding @@ -68,13 +68,13 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) } if (i == 1 ) - { + { // 4J - now expand mushroom islands up again. This does a simple region grow to add a new mushroom island element when any of the neighbours are also mushroom islands. // This helps make the islands into nice compact shapes of the type that are actually likely to be able to make an island out of the sea in a small space. Also // helps the shore layer from doing too much damage in shrinking the islands we are making - biomeLayer = shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); + biomeLayer = shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); // Note - this reduces the size of mushroom islands by turning their edges into shores. We are doing this at i == 1 rather than i == 0 as the original does - biomeLayer = shared_ptr(new ShoreLayer(1000, biomeLayer)); + biomeLayer = shared_ptr(new ShoreLayer(1000, biomeLayer)); biomeLayer = shared_ptr(new SwampRiversLayer(1000, biomeLayer)); } @@ -107,7 +107,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) return result; } -Layer::Layer(__int64 seedMixup) +Layer::Layer(int64_t seedMixup) { parent = nullptr; @@ -120,7 +120,7 @@ Layer::Layer(__int64 seedMixup) this->seedMixup += seedMixup; } -void Layer::init(__int64 seed) +void Layer::init(int64_t seed) { this->seed = seed; if (parent != NULL) parent->init(seed); @@ -132,7 +132,7 @@ void Layer::init(__int64 seed) this->seed += seedMixup; } -void Layer::initRandom(__int64 x, __int64 y) +void Layer::initRandom(int64_t x, int64_t y) { rval = seed; rval *= rval * 6364136223846793005l + 1442695040888963407l; diff --git a/Minecraft.World/Layer.h b/Minecraft.World/Layer.h index a444a6298..6f31e94ae 100644 --- a/Minecraft.World/Layer.h +++ b/Minecraft.World/Layer.h @@ -11,22 +11,22 @@ class LevelType; class Layer { private: - __int64 seed; + int64_t seed; protected: shared_ptrparent; private: - __int64 rval; - __int64 seedMixup; + int64_t rval; + int64_t seedMixup; public: - static LayerArray getDefaultLayers(__int64 seed, LevelType *levelType); + static LayerArray getDefaultLayers(int64_t seed, LevelType *levelType); - Layer(__int64 seedMixup); + Layer(int64_t seedMixup); - virtual void init(__int64 seed); - virtual void initRandom(__int64 x, __int64 y); + virtual void init(int64_t seed); + virtual void initRandom(int64_t x, int64_t y); protected: int nextRandom(int max); diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index ce2d49c58..64f21caba 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 requirements write +// W - lighting value requires write // xxxxxxxxxxxxxxxx - top 16 bits of x position // zzzzzzzzzzzzzzzz - top 16 bits of z position #else @@ -84,7 +84,7 @@ DWORD Level::tlsIdxLightCache = TlsAlloc(); // L - light value valid // B - blocking value valid // E - emission value valid -// W - lighting value requirements write +// W - lighting value requires write #endif @@ -178,7 +178,7 @@ void Level::initCacheComplete(lightCache_t *cache, int xc, int yc, int zc) } // Set a brightness value, going through the cache if enabled for this thread -void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) +void inline Level::setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) { if( cache == NULL ) { @@ -195,8 +195,8 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -229,7 +229,7 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, cacheValue = posbits; } - // Just written to it, so value is valid & requirements writing back + // Just written to it, so value is valid & requires writing back cacheValue &= ~(15 << LIGHTING_SHIFT ); cacheValue |= brightness << LIGHTING_SHIFT; cacheValue |= ( LIGHTING_WRITEBACK | LIGHTING_VALID ); @@ -254,8 +254,8 @@ inline int Level::getBrightnessCached(lightCache_t *cache, LightLayer::variety l ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -321,8 +321,8 @@ inline int Level::getEmissionCached(lightCache_t *cache, int ct, int x, int y, i ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -397,8 +397,8 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -460,7 +460,7 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay // this hasn't been updated (for client threads) for each individual lighting update as would have been the case with the non-cached lighting. There's two reasons for this // (1) it's more efficient, since we aren't doing so many individual calls to the level listener to let the renderer know what has been updated // (2) it lets the lighting actually complete before we get any visual representation of the update, otherwise we end up seeing some strange partial updates -void Level::flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer) +void Level::flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer) { // cacheUse has a single bit for each x, y and z to say whether anything with that x, y or z has been written to if( cacheUse == 0 ) return; @@ -3438,7 +3438,7 @@ int Level::getExpectedLight(lightCache_t *cache, int x, int y, int z, LightLayer void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool force, bool rootOnlyEmissive) { lightCache_t *cache = (lightCache_t *)TlsGetValue(tlsIdxLightCache); - __uint64 cacheUse = 0; + uint64_t cacheUse = 0; if( force ) { @@ -4281,13 +4281,13 @@ void Level::checkSession() } -void Level::setGameTime(__int64 time) +void Level::setGameTime(int64_t time) { // 4J : WESTY : Added to track game time played by players for other awards. if (time != 0) // Ignore setting time to 0, done at level start and during tutorial. { // Determine step in time and ensure it is reasonable ( we only have an int to store the player stat). - __int64 timeDiff = time - levelData->getGameTime(); + int64_t timeDiff = time - levelData->getGameTime(); if (timeDiff < 0) { @@ -4313,22 +4313,22 @@ void Level::setGameTime(__int64 time) levelData->setGameTime(time); } -__int64 Level::getSeed() +int64_t Level::getSeed() { return levelData->getSeed(); } -__int64 Level::getGameTime() +int64_t Level::getGameTime() { return levelData->getGameTime(); } -__int64 Level::getDayTime() +int64_t Level::getDayTime() { return levelData->getDayTime(); } -void Level::setDayTime(__int64 newTime) +void Level::setDayTime(int64_t newTime) { levelData->setDayTime(newTime); } @@ -4524,7 +4524,7 @@ Tickable *Level::makeSoundUpdater(shared_ptr minecart) Random *Level::getRandomFor(int x, int z, int blend) { - __int64 seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; + int64_t seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; random->setSeed(seed); return random; } diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h index f4678c351..ffd80cabd 100644 --- a/Minecraft.World/Level.h +++ b/Minecraft.World/Level.h @@ -245,27 +245,27 @@ public: void setBrightnessNoUpdateOnClient(LightLayer::variety layer, int x, int y, int z, int brightness); // 4J added #ifdef _LARGE_WORLDS - typedef __uint64 lightCache_t; + typedef uint64_t lightCache_t; #else typedef unsigned int lightCache_t; #endif - inline void setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); + inline void setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); inline int getBrightnessCached(lightCache_t *cache, LightLayer::variety layer, int x, int y, int z); inline int getEmissionCached(lightCache_t *cache, int ct, int x, int y, int z); inline int getBlockingCached(lightCache_t *cache, LightLayer::variety layer, int *ct, int x, int y, int z); void initCachePartial(lightCache_t *cache, int xc, int yc, int zc); void initCacheComplete(lightCache_t *cache, int xc, int yc, int zc); - void flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer); + void flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer); bool cachewritten; static const int LIGHTING_SHIFT = 24; static const int BLOCKING_SHIFT = 20; static const int EMISSION_SHIFT = 16; #ifdef _LARGE_WORLDS - static const __int64 LIGHTING_WRITEBACK = 0x80000000LL; - static const __int64 EMISSION_VALID = 0x40000000LL; - static const __int64 BLOCKING_VALID = 0x20000000LL; - static const __int64 LIGHTING_VALID = 0x10000000LL; + static const int64_t LIGHTING_WRITEBACK = 0x80000000LL; + static const int64_t EMISSION_VALID = 0x40000000LL; + static const int64_t BLOCKING_VALID = 0x20000000LL; + static const int64_t LIGHTING_VALID = 0x10000000LL; static const lightCache_t POSITION_MASK = 0xffffffff0000ffffLL; #else static const int LIGHTING_WRITEBACK = 0x80000000; @@ -465,11 +465,11 @@ public: void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true); virtual void disconnect(bool sendDisconnect = true); void checkSession(); - void setGameTime(__int64 time); - __int64 getSeed(); - __int64 getGameTime(); - __int64 getDayTime(); - void setDayTime(__int64 newTime); + void setGameTime(int64_t time); + int64_t getSeed(); + int64_t getGameTime(); + int64_t getDayTime(); + void setDayTime(int64_t newTime); Pos *getSharedSpawnPos(); void setSpawnPos(int x, int y, int z); void setSpawnPos(Pos *spawnPos); diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index ecbdbabc2..c57c18cdf 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -394,7 +394,7 @@ void LevelChunk::startSharingTilesAndData(int forceMs) else { // Only force if it has been more than forceMs milliseconds since we last wanted to unshare this chunk - __int64 timenow = System::currentTimeMillis(); + int64_t timenow = System::currentTimeMillis(); if( ( timenow - lastUnsharedTime ) < forceMs ) { LeaveCriticalSection(&m_csSharing); @@ -1940,7 +1940,7 @@ void LevelChunk::setCheckAllLight() checkLightPosition = 0; } -Random *LevelChunk::getRandom(__int64 l) +Random *LevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h index f972ba816..0e7ed8939 100644 --- a/Minecraft.World/LevelChunk.h +++ b/Minecraft.World/LevelChunk.h @@ -109,7 +109,7 @@ public: static const int sTerrainPopulatedFromS = 8; static const int sTerrainPopulatedFromSW = 16; static const int sTerrainPopulatedAllAffecting = 30; // All the post-processing that can actually place tiles in this chunk are complete - static const int sTerrainPopulatedFromNW = 32; + static const int sTerrainPopulatedFromNW = 32; static const int sTerrainPopulatedFromN = 64; static const int sTerrainPopulatedFromNE = 128; static const int sTerrainPopulatedFromE = 256; @@ -135,11 +135,11 @@ public: void stopSharingTilesAndData(); // 4J added virtual void reSyncLighting(); // 4J added void startSharingTilesAndData(int forceMs = 0); // 4J added - __int64 lastUnsharedTime; // 4J added - __int64 lastSaveTime; + int64_t lastUnsharedTime; // 4J added + int64_t lastSaveTime; bool seenByPlayer; int lowestHeightmap; - __int64 inhabitedTime; + int64_t inhabitedTime; #ifdef _LARGE_WORLDS bool m_bUnloaded; @@ -217,7 +217,7 @@ public: virtual bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added virtual void setCheckAllLight(); - virtual Random *getRandom(__int64 l); + virtual Random *getRandom(int64_t l); virtual bool isEmpty(); virtual void attemptCompression(); @@ -243,9 +243,9 @@ public: byteArray getBiomes(); void setBiomes(byteArray biomes); bool biomeHasRain(int x, int z); // 4J added - bool biomeHasSnow(int x, int z); // 4J added + bool biomeHasSnow(int x, int z); // 4J added private: - void updateBiomeFlags(int x, int z); // 4J added + void updateBiomeFlags(int x, int z); // 4J added public: void compressLighting(); // 4J added void compressBlocks(); // 4J added diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index 91b72fe8c..05bc2060e 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -14,18 +14,18 @@ LevelData::LevelData(CompoundTag *tag) { seed = tag->getLong(L"RandomSeed"); m_pGenerator = LevelType::lvl_normal; - if (tag->contains(L"generatorName")) + if (tag->contains(L"generatorName")) { wstring generatorName = tag->getString(L"generatorName"); m_pGenerator = LevelType::getLevelType(generatorName); - if (m_pGenerator == NULL) + if (m_pGenerator == NULL) { m_pGenerator = LevelType::lvl_normal; - } - else if (m_pGenerator->hasReplacement()) + } + else if (m_pGenerator->hasReplacement()) { int generatorVersion = 0; - if (tag->contains(L"generatorVersion")) + if (tag->contains(L"generatorVersion")) { generatorVersion = tag->getInt(L"generatorVersion"); } @@ -96,7 +96,7 @@ LevelData::LevelData(CompoundTag *tag) hasBeenInCreative = tag->getBoolean(L"hasBeenInCreative"); // 4J added so we can not award achievements to levels modified in creative // 4J added - for stronghold position - bStronghold = tag->getBoolean(L"hasStronghold"); + bStronghold = tag->getBoolean(L"hasStronghold"); if(bStronghold==false) { @@ -111,7 +111,7 @@ LevelData::LevelData(CompoundTag *tag) } // 4J added - for stronghold end portal position - bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal"); + bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal"); if(bStrongholdEndPortal==false) { @@ -148,7 +148,7 @@ LevelData::LevelData(CompoundTag *tag) default: assert(0); break; } assert(newWorldSize > m_xzSize); - m_xzSize = newWorldSize; + m_xzSize = newWorldSize; m_hellScale = newHellScale; } #endif @@ -182,20 +182,20 @@ LevelData::LevelData(CompoundTag *tag) #endif /* 4J - we don't store this anymore - if (tag->contains(L"Player")) + if (tag->contains(L"Player")) { loadedPlayerTag = tag->getCompound(L"Player"); dimension = loadedPlayerTag->getInt(L"Dimension"); } else - { + { this->loadedPlayerTag = NULL; } */ dimension = 0; } -LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) +LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) { seed = levelSettings->getSeed(); gameType = levelSettings->getGameType(); @@ -207,7 +207,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) generatorOptions = levelSettings->getLevelTypeOptions(); allowCommands = levelSettings->getAllowCommands(); - // 4J Stu - Default initers + // 4J Stu - Default initers xSpawn = 0; ySpawn = 0; zSpawn = 0; @@ -319,13 +319,13 @@ CompoundTag *LevelData::createTag() return tag; } -CompoundTag *LevelData::createTag(vector > *players) +CompoundTag *LevelData::createTag(vector > *players) { // 4J - removed all code for storing tags for players return createTag(); } -void LevelData::setTagData(CompoundTag *tag) +void LevelData::setTagData(CompoundTag *tag) { tag->putLong(L"RandomSeed", seed); tag->putString(L"generatorName", m_pGenerator->getGeneratorName()); @@ -373,17 +373,17 @@ void LevelData::setTagData(CompoundTag *tag) tag->putInt(L"HellScale", m_hellScale); } -__int64 LevelData::getSeed() +int64_t LevelData::getSeed() { return seed; } -int LevelData::getXSpawn() +int LevelData::getXSpawn() { return xSpawn; } -int LevelData::getYSpawn() +int LevelData::getYSpawn() { return ySpawn; } @@ -393,7 +393,7 @@ int LevelData::getZSpawn() return zSpawn; } -int LevelData::getXStronghold() +int LevelData::getXStronghold() { return xStronghold; } @@ -404,7 +404,7 @@ int LevelData::getZStronghold() return zStronghold; } -int LevelData::getXStrongholdEndPortal() +int LevelData::getXStrongholdEndPortal() { return xStrongholdEndPortal; } @@ -415,17 +415,17 @@ int LevelData::getZStrongholdEndPortal() return zStrongholdEndPortal; } -__int64 LevelData::getGameTime() +int64_t LevelData::getGameTime() { return gameTime; } -__int64 LevelData::getDayTime() +int64_t LevelData::getDayTime() { return dayTime; } -__int64 LevelData::getSizeOnDisk() +int64_t LevelData::getSizeOnDisk() { return sizeOnDisk; } @@ -441,7 +441,7 @@ CompoundTag *LevelData::getLoadedPlayerTag() // return dimension; //} -void LevelData::setSeed(__int64 seed) +void LevelData::setSeed(int64_t seed) { this->seed = seed; } @@ -451,7 +451,7 @@ void LevelData::setXSpawn(int xSpawn) this->xSpawn = xSpawn; } -void LevelData::setYSpawn(int ySpawn) +void LevelData::setYSpawn(int ySpawn) { this->ySpawn = ySpawn; } @@ -502,17 +502,17 @@ void LevelData::setZStrongholdEndPortal(int zStrongholdEndPortal) this->zStrongholdEndPortal = zStrongholdEndPortal; } -void LevelData::setGameTime(__int64 time) +void LevelData::setGameTime(int64_t time) { gameTime = time; } -void LevelData::setDayTime(__int64 time) +void LevelData::setDayTime(int64_t time) { dayTime = time; } -void LevelData::setSizeOnDisk(__int64 sizeOnDisk) +void LevelData::setSizeOnDisk(int64_t sizeOnDisk) { this->sizeOnDisk = sizeOnDisk; } @@ -524,7 +524,7 @@ void LevelData::setLoadedPlayerTag(CompoundTag *loadedPlayerTag) } // 4J Remove TU9 as it's never used -//void LevelData::setDimension(int dimension) +//void LevelData::setDimension(int dimension) //{ // this->dimension = dimension; //} @@ -536,7 +536,7 @@ void LevelData::setSpawn(int xSpawn, int ySpawn, int zSpawn) this->zSpawn = zSpawn; } -wstring LevelData::getLevelName() +wstring LevelData::getLevelName() { return levelName; } @@ -546,7 +546,7 @@ void LevelData::setLevelName(const wstring& levelName) this->levelName = levelName; } -int LevelData::getVersion() +int LevelData::getVersion() { return version; } @@ -556,7 +556,7 @@ void LevelData::setVersion(int version) this->version = version; } -__int64 LevelData::getLastPlayed() +int64_t LevelData::getLastPlayed() { return lastPlayed; } @@ -581,7 +581,7 @@ void LevelData::setThunderTime(int thunderTime) this->thunderTime = thunderTime; } -bool LevelData::isRaining() +bool LevelData::isRaining() { return raining; } @@ -621,8 +621,8 @@ void LevelData::setGameType(GameType *gameType) this->gameType = gameType; // 4J Added - hasBeenInCreative = hasBeenInCreative || - (gameType == GameType::CREATIVE) || + hasBeenInCreative = hasBeenInCreative || + (gameType == GameType::CREATIVE) || (app.GetGameHostOption(eGameHostOption_CheatsEnabled) > 0); } @@ -641,12 +641,12 @@ void LevelData::setHasBeenInCreative(bool value) hasBeenInCreative = value; } -LevelType *LevelData::getGenerator() +LevelType *LevelData::getGenerator() { return m_pGenerator; } -void LevelData::setGenerator(LevelType *generator) +void LevelData::setGenerator(LevelType *generator) { m_pGenerator = generator; } diff --git a/Minecraft.World/LevelData.h b/Minecraft.World/LevelData.h index 2ab243c3f..9c8d08ed8 100644 --- a/Minecraft.World/LevelData.h +++ b/Minecraft.World/LevelData.h @@ -13,16 +13,16 @@ class LevelData { friend class DerivedLevelData; private: - __int64 seed; + int64_t seed; LevelType *m_pGenerator;// = LevelType.normal; wstring generatorOptions; int xSpawn; int ySpawn; int zSpawn; - __int64 gameTime; - __int64 dayTime; - __int64 lastPlayed; - __int64 sizeOnDisk; + int64_t gameTime; + int64_t dayTime; + int64_t lastPlayed; + int64_t sizeOnDisk; // CompoundTag *loadedPlayerTag; // 4J removed int dimension; wstring levelName; @@ -84,7 +84,7 @@ protected: virtual void setTagData(CompoundTag *tag); // 4J - removed CompoundTag *playerTag public: - virtual __int64 getSeed(); + virtual int64_t getSeed(); virtual int getXSpawn(); virtual int getYSpawn(); virtual int getZSpawn(); @@ -92,12 +92,12 @@ public: virtual int getZStronghold(); virtual int getXStrongholdEndPortal(); virtual int getZStrongholdEndPortal(); - virtual __int64 getGameTime(); - virtual __int64 getDayTime(); - virtual __int64 getSizeOnDisk(); + virtual int64_t getGameTime(); + virtual int64_t getDayTime(); + virtual int64_t getSizeOnDisk(); virtual CompoundTag *getLoadedPlayerTag(); //int getDimension(); // 4J Removed TU 9 as it's never accurate - virtual void setSeed(__int64 seed); + virtual void setSeed(int64_t seed); virtual void setXSpawn(int xSpawn); virtual void setYSpawn(int ySpawn); virtual void setZSpawn(int zSpawn); @@ -110,9 +110,9 @@ public: virtual void setXStrongholdEndPortal(int xStrongholdEndPortal); virtual void setZStrongholdEndPortal(int zStrongholdEndPortal); - virtual void setGameTime(__int64 time); - virtual void setDayTime(__int64 time); - virtual void setSizeOnDisk(__int64 sizeOnDisk); + virtual void setGameTime(int64_t time); + virtual void setDayTime(int64_t time); + virtual void setSizeOnDisk(int64_t sizeOnDisk); virtual void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); //void setDimension(int dimension); // 4J Removed TU 9 as it's never used virtual void setSpawn(int xSpawn, int ySpawn, int zSpawn); @@ -120,7 +120,7 @@ public: virtual void setLevelName(const wstring& levelName); virtual int getVersion(); virtual void setVersion(int version); - virtual __int64 getLastPlayed(); + virtual int64_t getLastPlayed(); virtual bool isThundering(); virtual void setThundering(bool thundering); virtual int getThunderTime(); diff --git a/Minecraft.World/LevelSettings.cpp b/Minecraft.World/LevelSettings.cpp index dca8ce618..a81a40328 100644 --- a/Minecraft.World/LevelSettings.cpp +++ b/Minecraft.World/LevelSettings.cpp @@ -85,7 +85,7 @@ GameType *GameType::byName(const wstring &name) return SURVIVAL; } -void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) +void LevelSettings::_init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) { this->seed = seed; this->gameType = gameType; @@ -100,11 +100,11 @@ void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeat m_hellScale = hellScale; } -LevelSettings::LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : - seed(seed), - gameType(gameType), +LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : + seed(seed), + gameType(gameType), hardcore(hardcore), - generateMapFeatures(generateMapFeatures), + generateMapFeatures(generateMapFeatures), newSeaLevel(newSeaLevel), levelType(levelType), startingBonusItems(false) @@ -140,7 +140,7 @@ bool LevelSettings::hasStartingBonusItems() return startingBonusItems; } -__int64 LevelSettings::getSeed() +int64_t LevelSettings::getSeed() { return seed; } @@ -155,7 +155,7 @@ bool LevelSettings::isHardcore() return hardcore; } -LevelType *LevelSettings::getLevelType() +LevelType *LevelSettings::getLevelType() { return levelType; } diff --git a/Minecraft.World/LevelSettings.h b/Minecraft.World/LevelSettings.h index 906a6f705..73f588f68 100644 --- a/Minecraft.World/LevelSettings.h +++ b/Minecraft.World/LevelSettings.h @@ -37,7 +37,7 @@ public: class LevelSettings { private: - __int64 seed; + int64_t seed; GameType *gameType; bool generateMapFeatures; bool hardcore; @@ -49,16 +49,16 @@ private: int m_xzSize; // 4J Added int m_hellScale; - void _init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + void _init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param public: - LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param LevelSettings(LevelData *levelData); LevelSettings *enableStartingBonusItems(); // 4J - brought forward from 1.3.2 LevelSettings *enableSinglePlayerCommands(); LevelSettings *setLevelTypeOptions(const wstring &options); bool hasStartingBonusItems(); // 4J - brought forward from 1.3.2 - __int64 getSeed(); + int64_t getSeed(); GameType *getGameType(); bool isHardcore(); LevelType *getLevelType(); diff --git a/Minecraft.World/LevelSummary.cpp b/Minecraft.World/LevelSummary.cpp index d8e7ddee7..915abaf62 100644 --- a/Minecraft.World/LevelSummary.cpp +++ b/Minecraft.World/LevelSummary.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "LevelSummary.h" -LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : +LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : levelId( levelId ), levelName( levelName ), lastPlayed( lastPlayed ), @@ -13,7 +13,7 @@ LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __i { } -wstring LevelSummary::getLevelId() +wstring LevelSummary::getLevelId() { return levelId; } @@ -23,28 +23,28 @@ wstring LevelSummary::getLevelName() return levelName; } -__int64 LevelSummary::getSizeOnDisk() +int64_t LevelSummary::getSizeOnDisk() { return sizeOnDisk; } -bool LevelSummary::isRequiresConversion() +bool LevelSummary::isRequiresConversion() { return requiresConversion; } -__int64 LevelSummary::getLastPlayed() +int64_t LevelSummary::getLastPlayed() { return lastPlayed; } -int LevelSummary::compareTo(LevelSummary *rhs) +int LevelSummary::compareTo(LevelSummary *rhs) { if (lastPlayed < rhs->lastPlayed) { return 1; } - if (lastPlayed > rhs->lastPlayed) + if (lastPlayed > rhs->lastPlayed) { return -1; } diff --git a/Minecraft.World/LevelSummary.h b/Minecraft.World/LevelSummary.h index bbf391ff6..ce5699a25 100644 --- a/Minecraft.World/LevelSummary.h +++ b/Minecraft.World/LevelSummary.h @@ -7,20 +7,20 @@ class LevelSummary { const wstring levelId; const wstring levelName; - const __int64 lastPlayed; - const __int64 sizeOnDisk; + const int64_t lastPlayed; + const int64_t sizeOnDisk; const bool requiresConversion; GameType *gameMode; const bool hardcore; const bool _hasCheats; public: - LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); + LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); wstring getLevelId(); wstring getLevelName(); - __int64 getSizeOnDisk(); + int64_t getSizeOnDisk(); bool isRequiresConversion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); int compareTo(LevelSummary *rhs); GameType *getGameMode(); bool isHardcore(); diff --git a/Minecraft.World/LightningBolt.h b/Minecraft.World/LightningBolt.h index 28d5e0042..2a14e88a1 100644 --- a/Minecraft.World/LightningBolt.h +++ b/Minecraft.World/LightningBolt.h @@ -16,7 +16,7 @@ private: int life; public: - __int64 seed; + int64_t seed; private: int flashes; diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index bfe692264..44ed62b3a 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -66,7 +66,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) { this->userName = userName; this->clientVersion = clientVersion; @@ -94,13 +94,13 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType * m_hellScale = hellScale; } -void LoginPacket::read(DataInputStream *dis) //throws IOException +void LoginPacket::read(DataInputStream *dis) //throws IOException { clientVersion = dis->readInt(); userName = readUtf(dis, Player::MAX_NAME_LENGTH); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -131,15 +131,15 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException } -void LoginPacket::write(DataOutputStream *dos) //throws IOException +void LoginPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(clientVersion); writeUtf(userName, dos); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -171,13 +171,13 @@ void LoginPacket::handle(PacketListener *listener) listener->handleLogin(shared_from_this()); } -int LoginPacket::getEstimatedSize() +int LoginPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != NULL) { length = (int)m_pLevelType->getGeneratorName().length(); } - return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); } diff --git a/Minecraft.World/LoginPacket.h b/Minecraft.World/LoginPacket.h index 090411358..bf7164fa7 100644 --- a/Minecraft.World/LoginPacket.h +++ b/Minecraft.World/LoginPacket.h @@ -9,10 +9,10 @@ class LoginPacket : public Packet, public enable_shared_from_this public: int clientVersion; wstring userName; - __int64 seed; + int64_t seed; char dimension; PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added - char difficulty; // 4J Added + char difficulty; // 4J Added bool m_friendsOnlyUGC; // 4J Added DWORD m_ugcPlayersVersion; // 4J Added INT m_multiplayerInstanceId; //4J Added for sentient @@ -31,7 +31,7 @@ public: BYTE maxPlayers; LoginPacket(); - LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client + LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/LongTag.h b/Minecraft.World/LongTag.h index be034bb1e..23a0749d4 100644 --- a/Minecraft.World/LongTag.h +++ b/Minecraft.World/LongTag.h @@ -4,10 +4,10 @@ class LongTag : public Tag { public: - __int64 data; + int64_t data; LongTag(const wstring &name) : Tag(name) {} - LongTag(const wstring &name, __int64 data) : Tag(name) {this->data = data; } - + LongTag(const wstring &name, int64_t data) : Tag(name) {this->data = data; } + void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis, int tagDepth) { data = dis->readLong(); } diff --git a/Minecraft.World/McRegionChunkStorage.cpp b/Minecraft.World/McRegionChunkStorage.cpp index 344ff6c7c..87dabf0b3 100644 --- a/Minecraft.World/McRegionChunkStorage.cpp +++ b/Minecraft.World/McRegionChunkStorage.cpp @@ -45,7 +45,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr for(int i = 0; i < count; ++i) { - __int64 index = dis.readLong(); + int64_t index = dis.readLong(); CompoundTag *tag = NbtIo::read(&dis); ByteArrayOutputStream bos; @@ -78,7 +78,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z) // If we can't find the chunk in the save file, then we should remove any entities we might have for that chunk if(regionChunkInputStream == NULL) { - __int64 index = ((__int64)(x) << 32) | (((__int64)(z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(x) << 32) | (((int64_t)(z))&0x00000000FFFFFFFF); auto it = m_entityData.find(index); if(it != m_entityData.end()) @@ -242,7 +242,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES PIXBeginNamedEvent(0,"Saving entities"); - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); delete m_entityData[index].data; @@ -276,7 +276,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) void McRegionChunkStorage::loadEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); auto it = m_entityData.find(index); if(it != m_entityData.end()) diff --git a/Minecraft.World/McRegionChunkStorage.h b/Minecraft.World/McRegionChunkStorage.h index 50dabd52d..47ae1c999 100644 --- a/Minecraft.World/McRegionChunkStorage.h +++ b/Minecraft.World/McRegionChunkStorage.h @@ -16,7 +16,7 @@ private: ConsoleSaveFile *m_saveFile; static CRITICAL_SECTION cs_memory; - unordered_map<__int64, byteArray> m_entityData; + unordered_map m_entityData; static std::deque s_chunkDataQueue; static int s_runningThreadCount; diff --git a/Minecraft.World/Minecraft.World.vcxproj b/Minecraft.World/Minecraft.World.vcxproj index e20faab7a..5e63c78e2 100644 --- a/Minecraft.World/Minecraft.World.vcxproj +++ b/Minecraft.World/Minecraft.World.vcxproj @@ -235,7 +235,6 @@ SAK SAK title - 10.0 @@ -1280,8 +1279,6 @@ true Default /FS %(AdditionalOptions) - stdcpplatest - stdclatest true diff --git a/Minecraft.World/Mth.cpp b/Minecraft.World/Mth.cpp index ab990e6cf..779879172 100644 --- a/Minecraft.World/Mth.cpp +++ b/Minecraft.World/Mth.cpp @@ -51,9 +51,9 @@ int Mth::floor(float v) return v < i ? i - 1 : i; } -__int64 Mth::lfloor(double v) +int64_t Mth::lfloor(double v) { - __int64 i = (__int64) v; + int64_t i = (int64_t) v; return v < i ? i - 1 : i; } @@ -221,8 +221,8 @@ wstring Mth::createInsecureUUID(Random *random) { wchar_t output[33]; output[32] = 0; - __int64 high = (random->nextLong() & ~UUID_VERSION) | UUID_VERSION_TYPE_4; - __int64 low = (random->nextLong() & ~UUID_VARIANT) | UUID_VARIANT_2; + int64_t high = (random->nextLong() & ~UUID_VERSION) | UUID_VERSION_TYPE_4; + int64_t low = (random->nextLong() & ~UUID_VARIANT) | UUID_VARIANT_2; for(int i = 0; i < 16; i++ ) { wchar_t nybbleHigh = high & 0xf; diff --git a/Minecraft.World/Mth.h b/Minecraft.World/Mth.h index 4ce908930..59c9e0374 100644 --- a/Minecraft.World/Mth.h +++ b/Minecraft.World/Mth.h @@ -10,10 +10,10 @@ public: static const float RADDEG; static const float RAD_TO_GRAD; - static const __int64 UUID_VERSION = 0x000000000000f000L; - static const __int64 UUID_VERSION_TYPE_4 = 0x0000000000004000L; - static const __int64 UUID_VARIANT = 0xc000000000000000L; - static const __int64 UUID_VARIANT_2 = 0x8000000000000000L; + static const int64_t UUID_VERSION = 0x000000000000f000L; + static const int64_t UUID_VERSION_TYPE_4 = 0x0000000000004000L; + static const int64_t UUID_VARIANT = 0xc000000000000000L; + static const int64_t UUID_VARIANT_2 = 0x8000000000000000L; private: static float *_sin; private: @@ -25,7 +25,7 @@ public : static float sqrt(float x); static float sqrt(double x); static int floor(float v); - static __int64 lfloor(double v); + static int64_t lfloor(double v); static int fastFloor(double x); static int floor(double v); static int absFloor(double v); diff --git a/Minecraft.World/NbtSlotFile.cpp b/Minecraft.World/NbtSlotFile.cpp index 8bae14c64..bb820ce04 100644 --- a/Minecraft.World/NbtSlotFile.cpp +++ b/Minecraft.World/NbtSlotFile.cpp @@ -4,7 +4,7 @@ byteArray NbtSlotFile::READ_BUFFER(1024*1024); -__int64 NbtSlotFile::largest = 0; +int64_t NbtSlotFile::largest = 0; NbtSlotFile::NbtSlotFile(File file) { diff --git a/Minecraft.World/NbtSlotFile.h b/Minecraft.World/NbtSlotFile.h index 93b4fe576..c717c6572 100644 --- a/Minecraft.World/NbtSlotFile.h +++ b/Minecraft.World/NbtSlotFile.h @@ -19,7 +19,7 @@ private: int fileSlotMapLength; vector freeFileSlots; int totalFileSlots; - static __int64 largest; + static int64_t largest; public: NbtSlotFile(File file); diff --git a/Minecraft.World/NotGateTile.cpp b/Minecraft.World/NotGateTile.cpp index 3aa9aee1f..8d41c8393 100644 --- a/Minecraft.World/NotGateTile.cpp +++ b/Minecraft.World/NotGateTile.cpp @@ -229,7 +229,7 @@ int NotGateTile::cloneTileId(Level *level, int x, int y, int z) return Tile::redstoneTorch_on_Id; } -void NotGateTile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) +void NotGateTile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { deque *toggles = recentToggles[level]; diff --git a/Minecraft.World/NotGateTile.h b/Minecraft.World/NotGateTile.h index b1f3431d5..989aedc7b 100644 --- a/Minecraft.World/NotGateTile.h +++ b/Minecraft.World/NotGateTile.h @@ -19,9 +19,9 @@ public: { public: int x, y, z; - __int64 when; + int64_t when; - Toggle(int x, int y, int z, __int64 when) + Toggle(int x, int y, int z, int64_t when) { this->x = x; this->y = y; @@ -61,6 +61,6 @@ public: public: void animateTick(Level *level, int xt, int yt, int zt, Random *random); int cloneTileId(Level *level, int x, int y, int z); - void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); bool isMatching(int id); }; \ No newline at end of file diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp index 9bd4757b8..b927a5fef 100644 --- a/Minecraft.World/OldChunkStorage.cpp +++ b/Minecraft.World/OldChunkStorage.cpp @@ -279,7 +279,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getGameTime(); + int64_t levelTime = level->getGameTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) @@ -367,7 +367,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, CompoundTag *tag) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getGameTime(); + int64_t levelTime = level->getGameTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) diff --git a/Minecraft.World/Ozelot.cpp b/Minecraft.World/Ozelot.cpp index 3c05f3578..4529a8d98 100644 --- a/Minecraft.World/Ozelot.cpp +++ b/Minecraft.World/Ozelot.cpp @@ -60,7 +60,7 @@ void Ozelot::defineSynchedData() { TamableAnimal::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) TYPE_OZELOT); + entityData->define(DATA_TYPE_ID, (uint8_t) TYPE_OZELOT); } void Ozelot::serverAiMobStep() @@ -294,7 +294,7 @@ int Ozelot::getCatType() void Ozelot::setCatType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); } bool Ozelot::canSpawn() diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp index a37cb2ad6..61e3cc63c 100644 --- a/Minecraft.World/Packet.cpp +++ b/Minecraft.World/Packet.cpp @@ -252,11 +252,11 @@ void Packet::updatePacketStatsPIX() for( auto it = outgoingStatistics.begin(); it != outgoingStatistics.end(); it++ ) { Packet::PacketStatistics *stat = it->second; - __int64 count = stat->getRunningCount(); + int64_t count = stat->getRunningCount(); wchar_t pixName[256]; swprintf_s(pixName,L"Packet count %d",stat->id); // PIXReportCounter(pixName,(float)count); - __int64 total = stat->getRunningTotal(); + int64_t total = stat->getRunningTotal(); swprintf_s(pixName,L"Packet bytes %d",stat->id); PIXReportCounter(pixName,(float)total); stat->IncrementPos(); @@ -451,10 +451,10 @@ int Packet::PacketStatistics::getTotalSize() return totalSize; } -__int64 Packet::PacketStatistics::getRunningTotal() +int64_t Packet::PacketStatistics::getRunningTotal() { - __int64 total = 0; - __int64 currentTime = System::currentTimeMillis(); + int64_t total = 0; + int64_t currentTime = System::currentTimeMillis(); for( int i = 0; i < TOTAL_TICKS; i++ ) { if( currentTime - timeSamples[i] <= 1000 ) @@ -465,10 +465,10 @@ __int64 Packet::PacketStatistics::getRunningTotal() return total; } -__int64 Packet::PacketStatistics::getRunningCount() +int64_t Packet::PacketStatistics::getRunningCount() { - __int64 total = 0; - __int64 currentTime = System::currentTimeMillis(); + int64_t total = 0; + int64_t currentTime = System::currentTimeMillis(); for( int i = 0; i < TOTAL_TICKS; i++ ) { if( currentTime - timeSamples[i] <= 1000 ) diff --git a/Minecraft.World/Packet.h b/Minecraft.World/Packet.h index 7c30f6aa7..c639c8f16 100644 --- a/Minecraft.World/Packet.h +++ b/Minecraft.World/Packet.h @@ -15,7 +15,7 @@ typedef shared_ptr (*packetCreateFn)(); class Packet { public: - class PacketStatistics + class PacketStatistics { private: int count; @@ -24,9 +24,9 @@ public: static const int TOTAL_TICKS = 100; // 4J Added - __int64 countSamples[TOTAL_TICKS]; - __int64 sizeSamples[TOTAL_TICKS]; - __int64 timeSamples[TOTAL_TICKS]; + int64_t countSamples[TOTAL_TICKS]; + int64_t sizeSamples[TOTAL_TICKS]; + int64_t timeSamples[TOTAL_TICKS]; int samplesPos; public: @@ -38,8 +38,8 @@ public: int getCount(); int getTotalSize(); double getAverageSize(); - __int64 getRunningTotal(); - __int64 getRunningCount(); + int64_t getRunningTotal(); + int64_t getRunningCount(); void IncrementPos(); }; @@ -58,7 +58,7 @@ public: static void map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn ); public: - const __int64 createTime; + const int64_t createTime; Packet(); diff --git a/Minecraft.World/PerlinNoise.cpp b/Minecraft.World/PerlinNoise.cpp index b4fd8004d..b4c65e553 100644 --- a/Minecraft.World/PerlinNoise.cpp +++ b/Minecraft.World/PerlinNoise.cpp @@ -77,8 +77,8 @@ doubleArray PerlinNoise::getRegion(doubleArray buffer, int x, int y, int z, int double xx = x * pow * xScale; double yy = y * pow * yScale; double zz = z * pow * zScale; - __int64 xb = Mth::lfloor(xx); - __int64 zb = Mth::lfloor(zz); + int64_t xb = Mth::lfloor(xx); + int64_t zb = Mth::lfloor(zz); xx -= xb; zz -= zb; xb %= 16777216; diff --git a/Minecraft.World/PlayerIO.h b/Minecraft.World/PlayerIO.h index 153c55e34..2b13cab9c 100644 --- a/Minecraft.World/PlayerIO.h +++ b/Minecraft.World/PlayerIO.h @@ -3,7 +3,7 @@ using namespace std; // If we have more than MAX_PLAYER_DATA_SAVES player.dat's then we delete the oldest ones // This value can be no higher than MAXIMUM_MAP_SAVE_DATA/3 (3 being the number of dimensions in future versions) -#define MAX_PLAYER_DATA_SAVES 80 +#define MAX_PLAYER_DATA_SAVES 0x7FFFFFFF class Player; diff --git a/Minecraft.World/PortalForcer.cpp b/Minecraft.World/PortalForcer.cpp index b38508076..d0a129886 100644 --- a/Minecraft.World/PortalForcer.cpp +++ b/Minecraft.World/PortalForcer.cpp @@ -6,7 +6,7 @@ #include "..\Minecraft.Client\ServerLevel.h" #include "PortalForcer.h" -PortalForcer::PortalPosition::PortalPosition(int x, int y, int z, __int64 time) : Pos(x, y, z) +PortalForcer::PortalPosition::PortalPosition(int x, int y, int z, int64_t time) : Pos(x, y, z) { lastUsed = time; } @@ -502,15 +502,15 @@ next_second: continue; return true; } -void PortalForcer::tick(__int64 time) +void PortalForcer::tick(int64_t time) { if (time % (SharedConstants::TICKS_PER_SECOND * 5) == 0) { - __int64 cutoff = time - SharedConstants::TICKS_PER_SECOND * 30; + int64_t cutoff = time - SharedConstants::TICKS_PER_SECOND * 30; for (auto it = cachedPortalKeys.begin(); it != cachedPortalKeys.end();) { - __int64 key = *it; + int64_t key = *it; PortalPosition *pos = cachedPortals[key]; if (pos == NULL || pos->lastUsed < cutoff) diff --git a/Minecraft.World/PortalForcer.h b/Minecraft.World/PortalForcer.h index a589d9b31..d85adc17b 100644 --- a/Minecraft.World/PortalForcer.h +++ b/Minecraft.World/PortalForcer.h @@ -8,16 +8,16 @@ public: class PortalPosition : public Pos { public: - __int64 lastUsed; + int64_t lastUsed; - PortalPosition(int x, int y, int z, __int64 time); + PortalPosition(int x, int y, int z, int64_t time); }; private: ServerLevel *level; Random *random; - unordered_map<__int64, PortalPosition *> cachedPortals; - vector<__int64> cachedPortalKeys; + unordered_map cachedPortals; + vector cachedPortalKeys; public: PortalForcer(ServerLevel *level); @@ -26,5 +26,5 @@ public: void force(shared_ptr e, double xOriginal, double yOriginal, double zOriginal, float yRotOriginal); bool findPortal(shared_ptr e, double xOriginal, double yOriginal, double zOriginal, float yRotOriginal); bool createPortal(shared_ptr e); - void tick(__int64 time); + void tick(int64_t time); }; \ No newline at end of file diff --git a/Minecraft.World/PotionBrewing.cpp b/Minecraft.World/PotionBrewing.cpp index 408a577e8..8e27a6017 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 requirements that bit 13 be turned off. + * Added "&!13" which requires 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 requirements 13 and sets 14 +const wstring PotionBrewing::MOD_GUNPOWDER = L"+14";//&13-13"; // gunpowder makes them throwable! // gunpowder requires 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 requirements 13 and sets 14 +const wstring PotionBrewing::MOD_GUNPOWDER = L""; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 #endif PotionBrewing::intStringMap PotionBrewing::potionEffectDuration; diff --git a/Minecraft.World/Random.cpp b/Minecraft.World/Random.cpp index 091d0ff85..87cb873d3 100644 --- a/Minecraft.World/Random.cpp +++ b/Minecraft.World/Random.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Random.h" #include "System.h" @@ -6,19 +6,19 @@ Random::Random() { // 4J - jave now uses the system nanosecond counter added to a "seedUniquifier" to get an initial seed. Our nanosecond timer is actually only millisecond accuate, so // use QueryPerformanceCounter here instead - __int64 seed; + int64_t seed; QueryPerformanceCounter((LARGE_INTEGER *)&seed); seed += 8682522807148012LL; setSeed(seed); } -Random::Random(__int64 seed) +Random::Random(int64_t seed) { setSeed(seed); } -void Random::setSeed(__int64 s) +void Random::setSeed(int64_t s) { this->seed = (s ^ 0x5DEECE66DLL) & ((1LL << 48) - 1); haveNextNextGaussian = false; @@ -41,7 +41,7 @@ void Random::nextBytes(uint8_t *bytes, unsigned int count) double Random::nextDouble() { - return (((__int64)next(26) << 27) + next(27)) + return (((int64_t)next(26) << 27) + next(27)) / (double)(1LL << 53); } @@ -56,7 +56,7 @@ double Random::nextGaussian() { double v1, v2, s; do - { + { v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0 v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0 s = v1 * v1 + v2 * v2; @@ -79,7 +79,7 @@ int Random::nextInt(int n) if ((n & -n) == n) // i.e., n is a power of 2 - return (int)(((__int64)next(31) * n) >> 31); // 4J Stu - Made __int64 instead of long + return (int)(((int64_t)next(31) * n) >> 31); // 4J Stu - Made int64_t instead of long int bits, val; do @@ -95,9 +95,9 @@ float Random::nextFloat() return next(24) / ((float)(1 << 24)); } -__int64 Random::nextLong() +int64_t Random::nextLong() { - return ((__int64)next(32) << 32) + next(32); + return ((int64_t)next(32) << 32) + next(32); } bool Random::nextBoolean() diff --git a/Minecraft.World/Random.h b/Minecraft.World/Random.h index ae36d48f3..39b5d3c87 100644 --- a/Minecraft.World/Random.h +++ b/Minecraft.World/Random.h @@ -3,21 +3,21 @@ class Random { private: - __int64 seed; + int64_t seed; bool haveNextNextGaussian; double nextNextGaussian; protected: int next(int bits); public: Random(); - Random(__int64 seed); - void setSeed(__int64 s); + Random(int64_t seed); + void setSeed(int64_t s); void nextBytes(uint8_t *bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); int nextInt(int to); float nextFloat(); - __int64 nextLong(); + int64_t nextLong(); bool nextBoolean(); }; \ No newline at end of file diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp index 8a6dc78ba..c8b6c050c 100644 --- a/Minecraft.World/RandomLevelSource.cpp +++ b/Minecraft.World/RandomLevelSource.cpp @@ -26,7 +26,7 @@ static PerlinNoise_DataIn g_depthNoise_SPU __attribute__((__aligned__(16))); const double RandomLevelSource::SNOW_SCALE = 0.3; const double RandomLevelSource::SNOW_CUTOFF = 0.5; -RandomLevelSource::RandomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { m_XZSize = level->getLevelData()->getXZSize(); #ifdef _LARGE_WORLDS @@ -166,9 +166,9 @@ float RandomLevelSource::getHeightFalloff(int xxx, int zzz, int* pEMin) float comp = 0.0f; int emin = getMinDistanceToEdge(xxx, zzz, worldSize, falloffStart); // check if we have a larger world that should have moats - int expandedWorldSizes[3] = {LEVEL_WIDTH_CLASSIC*16, - LEVEL_WIDTH_SMALL*16, - LEVEL_WIDTH_MEDIUM*16}; + int expandedWorldSizes[3] = {LEVEL_WIDTH_CLASSIC*16, + LEVEL_WIDTH_SMALL*16, + LEVEL_WIDTH_MEDIUM*16}; bool expandedMoatValues[3] = {m_classicEdgeMoat, m_smallEdgeMoat, m_mediumEdgeMoat}; for(int i=0;i<3;i++) { @@ -435,7 +435,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi run = runDepth; if (y >= waterHeight - 1) blocks[offs] = top; else blocks[offs] = material; - } + } else if (run > 0) { run--; @@ -503,7 +503,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs) // addCaves(xOffs, zOffs, blocks); // addTowns(xOffs, zOffs, blocks); - // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method + // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method // 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also // now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore. @@ -629,7 +629,7 @@ doubleArray RandomLevelSource::getHeights(doubleArray buffer, int x, int y, int if (rdepth < -1) rdepth = -1; rdepth = rdepth / 1.4; rdepth /= 2; - } + } else { if (rdepth > 1) rdepth = 1; @@ -766,8 +766,8 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; diff --git a/Minecraft.World/RandomLevelSource.h b/Minecraft.World/RandomLevelSource.h index 740a9db21..ef145df0b 100644 --- a/Minecraft.World/RandomLevelSource.h +++ b/Minecraft.World/RandomLevelSource.h @@ -47,7 +47,7 @@ private: floatArray pows; public: - RandomLevelSource(Level *level, __int64 seed, bool generateStructures); + RandomLevelSource(Level *level, int64_t seed, bool generateStructures); ~RandomLevelSource(); public: diff --git a/Minecraft.World/RangedAttackGoal.cpp b/Minecraft.World/RangedAttackGoal.cpp index 708143053..2923e0111 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 requirements Mob implements RangedAttackMob"); + //throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); //} rangedAttackMob = rangedMob; this->mob = mob; diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp index 4f71fafda..68421c902 100644 --- a/Minecraft.World/RegionFile.cpp +++ b/Minecraft.World/RegionFile.cpp @@ -19,7 +19,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) chunkTimestamps = new int[SECTOR_INTS]; memset(chunkTimestamps,0,SECTOR_BYTES); - /* 4J Jev, using files instead of strings: + /* 4J Jev, using files instead of strings: strncpy(fileName,path,MAX_PATH_SIZE); */ fileName = path; @@ -30,7 +30,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) // 4J - removed try/catch // try { - + /* 4J - Removed as _lastModifed not used and this is always failing as checking wrong thing if( path->exists() ) { @@ -45,7 +45,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) { // 4J altered - the original code used to write out 2 empty sectors here, which we don't want to do as we might be at a point where we shouldn't be touching the save file. // This now happens in insertInitialSectors when we do a first write to the region - m_bIsEmpty = true; + m_bIsEmpty = true; sizeDelta += SECTOR_BYTES * 2; } @@ -70,7 +70,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) } /* set up the available sector map */ - + int nSectors; if( m_bIsEmpty ) // 4J - added this case for our empty files that we now don't create { @@ -133,7 +133,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) void RegionFile::writeAllOffsets() // used for the file ConsoleSaveFile conversion between platforms { - if(m_bIsEmpty == false) + if(m_bIsEmpty == false) { // save all the offsets and timestamps m_saveFile->LockSaveAccess(); @@ -158,7 +158,7 @@ RegionFile::~RegionFile() m_saveFile->closeHandle( fileEntry ); } -__int64 RegionFile::lastModified() +int64_t RegionFile::lastModified() { return _lastModified; } @@ -198,9 +198,9 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was m_saveFile->LockSaveAccess(); - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN); - + unsigned int length; unsigned int decompLength; unsigned int readDecompLength; @@ -227,7 +227,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was if (length > SECTOR_BYTES * numSectors) { // debugln("READ", x, z, "invalid length: " + length + " > 4096 * " + numSectors); - + m_saveFile->ReleaseSaveAccess(); return NULL; } @@ -257,7 +257,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was delete [] data; // 4J - was InflaterInputStream in here too, but we've already decompressed - DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) )); + DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) )); return ret; // } catch (IOException e) { @@ -269,7 +269,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z) { // 4J - was DeflatorOutputStream in here too, but we've already compressed - return new DataOutputStream( new ChunkBuffer(this, x, z)); + return new DataOutputStream( new ChunkBuffer(this, x, z)); } /* write a chunk at (x,z) with length bytes of data to disk */ @@ -372,7 +372,7 @@ void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was s * file */ // debug("SAVE", x, z, length, "grow"); - //SetFilePointer(file,0,0,FILE_END); + //SetFilePointer(file,0,0,FILE_END); m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_END ); sectorNumber = (int)sectorFree->size(); @@ -406,12 +406,12 @@ void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was s void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int compLength) { DWORD numberOfBytesWritten = 0; - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //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 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 compLength |= 0x80000000; // 4J - signify that this has been encoded with RLE method ( see code in getChunkDataInputStream() for matching detection of this) @@ -425,7 +425,7 @@ void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int void RegionFile::zero(int sectorNumber, int length) { DWORD numberOfBytesWritten = 0; - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); m_saveFile->zeroFile( fileEntry, length, &numberOfBytesWritten ); } @@ -473,7 +473,7 @@ void RegionFile::setOffset(int x, int z, int offset) DWORD numberOfBytesWritten = 0; offsets[x + z * 32] = offset; m_saveFile->setFilePointer( fileEntry, (x + z * 32) * 4, NULL, FILE_BEGIN ); - + m_saveFile->writeFile(fileEntry,&offset,4,&numberOfBytesWritten); } @@ -487,7 +487,7 @@ void RegionFile::setTimestamp(int x, int z, int value) DWORD numberOfBytesWritten = 0; chunkTimestamps[x + z * 32] = value; m_saveFile->setFilePointer( fileEntry, SECTOR_BYTES + (x + z * 32) * 4, NULL, FILE_BEGIN ); - + m_saveFile->writeFile(fileEntry,&value,4,&numberOfBytesWritten); } diff --git a/Minecraft.World/RegionFile.h b/Minecraft.World/RegionFile.h index 41a562b3f..5ea267d1c 100644 --- a/Minecraft.World/RegionFile.h +++ b/Minecraft.World/RegionFile.h @@ -16,7 +16,7 @@ private: static const int VERSION_GZIP = 1; static const int VERSION_DEFLATE = 2; static const int VERSION_XBOX = 3; - + static const int SECTOR_BYTES = 4096; static const int SECTOR_INTS = SECTOR_BYTES / 4; @@ -31,7 +31,7 @@ private: int *chunkTimestamps; vector *sectorFree; int sizeDelta; - __int64 _lastModified; + int64_t _lastModified; bool m_bIsEmpty; // 4J added public: @@ -39,7 +39,7 @@ public: ~RegionFile(); /* the modification date of the region file when it was first opened */ - __int64 lastModified(); + int64_t lastModified(); /* gets how much the region file has grown since it was last checked */ int getSizeDelta(); diff --git a/Minecraft.World/RegionHillsLayer.cpp b/Minecraft.World/RegionHillsLayer.cpp index dad114b01..a1e175247 100644 --- a/Minecraft.World/RegionHillsLayer.cpp +++ b/Minecraft.World/RegionHillsLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RegionHillsLayer.h" -RegionHillsLayer::RegionHillsLayer(__int64 seed, shared_ptr parent) : Layer(seed) +RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RegionHillsLayer.h b/Minecraft.World/RegionHillsLayer.h index 30d7eced1..5ad0bb759 100644 --- a/Minecraft.World/RegionHillsLayer.h +++ b/Minecraft.World/RegionHillsLayer.h @@ -5,7 +5,7 @@ class RegionHillsLayer : public Layer { public: - RegionHillsLayer(__int64 seed, shared_ptr parent); + RegionHillsLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp index 5c04bbebb..ecc0b7f0e 100644 --- a/Minecraft.World/RespawnPacket.cpp +++ b/Minecraft.World/RespawnPacket.cpp @@ -5,7 +5,7 @@ #include "RespawnPacket.h" #include "LevelType.h" -RespawnPacket::RespawnPacket() +RespawnPacket::RespawnPacket() { this->dimension = 0; this->difficulty = 1; @@ -19,7 +19,7 @@ RespawnPacket::RespawnPacket() m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { this->dimension = dimension; this->mapSeed = mapSeed; @@ -35,7 +35,7 @@ RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, Gam } -void RespawnPacket::handle(PacketListener *listener) +void RespawnPacket::handle(PacketListener *listener) { listener->handleRespawn(shared_from_this()); } @@ -47,7 +47,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException mapHeight = dis->readShort(); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -63,16 +63,16 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException } -void RespawnPacket::write(DataOutputStream *dos) //throws IOException +void RespawnPacket::write(DataOutputStream *dos) //throws IOException { dos->writeByte(dimension); dos->writeByte(playerGameType->getId()); dos->writeShort(mapHeight); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -86,10 +86,10 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException #endif } -int RespawnPacket::getEstimatedSize() +int RespawnPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != NULL) { length = (int)m_pLevelType->getGeneratorName().length(); } diff --git a/Minecraft.World/RespawnPacket.h b/Minecraft.World/RespawnPacket.h index dc341ea17..3caf1ee38 100644 --- a/Minecraft.World/RespawnPacket.h +++ b/Minecraft.World/RespawnPacket.h @@ -11,7 +11,7 @@ class RespawnPacket : public Packet, public enable_shared_from_thisparent) : Layer(seed) +RiverInitLayer::RiverInitLayer(int64_t seed, shared_ptrparent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RiverInitLayer.h b/Minecraft.World/RiverInitLayer.h index 6deb50e9b..bc8dca1b3 100644 --- a/Minecraft.World/RiverInitLayer.h +++ b/Minecraft.World/RiverInitLayer.h @@ -5,7 +5,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(__int64 seed, shared_ptrparent); + RiverInitLayer(int64_t seed, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverLayer.cpp b/Minecraft.World/RiverLayer.cpp index 8f805bab7..14cf31424 100644 --- a/Minecraft.World/RiverLayer.cpp +++ b/Minecraft.World/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +RiverLayer::RiverLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RiverLayer.h b/Minecraft.World/RiverLayer.h index 657ac07c3..a76d3fab9 100644 --- a/Minecraft.World/RiverLayer.h +++ b/Minecraft.World/RiverLayer.h @@ -5,6 +5,6 @@ class RiverLayer : public Layer { public: - RiverLayer(__int64 seedMixup, shared_ptrparent); + RiverLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverMixerLayer.cpp b/Minecraft.World/RiverMixerLayer.cpp index 62dfdd6c2..4de492453 100644 --- a/Minecraft.World/RiverMixerLayer.cpp +++ b/Minecraft.World/RiverMixerLayer.cpp @@ -2,13 +2,13 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) +RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) { this->biomes = biomes; this->rivers = rivers; } -void RiverMixerLayer::init(__int64 seed) +void RiverMixerLayer::init(int64_t seed) { biomes->init(seed); rivers->init(seed); diff --git a/Minecraft.World/RiverMixerLayer.h b/Minecraft.World/RiverMixerLayer.h index eec516103..3a069c41f 100644 --- a/Minecraft.World/RiverMixerLayer.h +++ b/Minecraft.World/RiverMixerLayer.h @@ -9,8 +9,8 @@ private: shared_ptrrivers; public: - RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers); + RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers); - virtual void init(__int64 seed); + virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SetTimePacket.cpp b/Minecraft.World/SetTimePacket.cpp index 5936255c0..e7ea3b42c 100644 --- a/Minecraft.World/SetTimePacket.cpp +++ b/Minecraft.World/SetTimePacket.cpp @@ -4,13 +4,13 @@ #include "PacketListener.h" #include "SetTimePacket.h" -SetTimePacket::SetTimePacket() +SetTimePacket::SetTimePacket() { gameTime = 0; dayTime = 0; } -SetTimePacket::SetTimePacket(__int64 gameTime, __int64 dayTime, bool tickDayTime) +SetTimePacket::SetTimePacket(int64_t gameTime, int64_t dayTime, bool tickDayTime) { this->gameTime = gameTime; this->dayTime = dayTime; @@ -32,7 +32,7 @@ void SetTimePacket::read(DataInputStream *dis) //throws IOException dayTime = dis->readLong(); } -void SetTimePacket::write(DataOutputStream *dos) //throws IOException +void SetTimePacket::write(DataOutputStream *dos) //throws IOException { dos->writeLong(gameTime); dos->writeLong(dayTime); diff --git a/Minecraft.World/SetTimePacket.h b/Minecraft.World/SetTimePacket.h index 7ded9ce1f..a0fa2ad94 100644 --- a/Minecraft.World/SetTimePacket.h +++ b/Minecraft.World/SetTimePacket.h @@ -6,11 +6,11 @@ using namespace std; class SetTimePacket : public Packet, public enable_shared_from_this { public: - __int64 gameTime; - __int64 dayTime; + int64_t gameTime; + int64_t dayTime; SetTimePacket(); - SetTimePacket(__int64 gameTime, __int64 dayTime, bool tickDayTime); + SetTimePacket(int64_t gameTime, int64_t dayTime, bool tickDayTime); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/ShoreLayer.cpp b/Minecraft.World/ShoreLayer.cpp index 297571f5e..7ae52557d 100644 --- a/Minecraft.World/ShoreLayer.cpp +++ b/Minecraft.World/ShoreLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -ShoreLayer::ShoreLayer(__int64 seed, shared_ptr parent) : Layer(seed) +ShoreLayer::ShoreLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/ShoreLayer.h b/Minecraft.World/ShoreLayer.h index 96aea1521..a70530041 100644 --- a/Minecraft.World/ShoreLayer.h +++ b/Minecraft.World/ShoreLayer.h @@ -4,6 +4,6 @@ class ShoreLayer : public Layer { public: - ShoreLayer(__int64 seed, shared_ptr parent); + ShoreLayer(int64_t seed, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SkyIslandDimension.cpp b/Minecraft.World/SkyIslandDimension.cpp index 0746c92ca..aa68bd5ef 100644 --- a/Minecraft.World/SkyIslandDimension.cpp +++ b/Minecraft.World/SkyIslandDimension.cpp @@ -16,7 +16,7 @@ ChunkSource *SkyIslandDimension::createRandomLevelSource() const return new SkyIslandRandomLevelSource(level, level->getSeed()); } -float SkyIslandDimension::getTimeOfDay(__int64 time, float a) const +float SkyIslandDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/Minecraft.World/Slime.cpp b/Minecraft.World/Slime.cpp index 0555afca6..7e012daa5 100644 --- a/Minecraft.World/Slime.cpp +++ b/Minecraft.World/Slime.cpp @@ -84,7 +84,7 @@ ePARTICLE_TYPE Slime::getParticleName() int Slime::getSquishSound() { - return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME; + return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME_SMALL; } void Slime::tick() @@ -236,12 +236,12 @@ int Slime::getAttackDamage() int Slime::getHurtSound() { - return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME; + return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME_SMALL; } int Slime::getDeathSound() { - return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME; + return getSize() > 1 ? eSoundType_MOB_SLIME_BIG : eSoundType_MOB_SLIME_SMALL; } int Slime::getDeathLoot() diff --git a/Minecraft.World/SmoothLayer.cpp b/Minecraft.World/SmoothLayer.cpp index a5545cc54..e94ae36dc 100644 --- a/Minecraft.World/SmoothLayer.cpp +++ b/Minecraft.World/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothLayer::SmoothLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/SmoothLayer.h b/Minecraft.World/SmoothLayer.h index eec3f19ef..14e3d1525 100644 --- a/Minecraft.World/SmoothLayer.h +++ b/Minecraft.World/SmoothLayer.h @@ -5,7 +5,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(__int64 seedMixup, shared_ptrparent); + SmoothLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.cpp b/Minecraft.World/SmoothZoomLayer.cpp index 3e1c55a18..2df34a3b7 100644 --- a/Minecraft.World/SmoothZoomLayer.cpp +++ b/Minecraft.World/SmoothZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -50,7 +50,7 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) return result; } -shared_ptrSmoothZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrSmoothZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/SmoothZoomLayer.h b/Minecraft.World/SmoothZoomLayer.h index b2ac4e785..90cc292e7 100644 --- a/Minecraft.World/SmoothZoomLayer.h +++ b/Minecraft.World/SmoothZoomLayer.h @@ -5,8 +5,8 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(__int64 seedMixup, shared_ptrparent); + SmoothZoomLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/Socket.h b/Minecraft.World/Socket.h index 471bb1cdb..c0692a92f 100644 --- a/Minecraft.World/Socket.h +++ b/Minecraft.World/Socket.h @@ -36,7 +36,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; @@ -68,7 +68,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; class SocketOutputStreamNetwork : public SocketOutputStream @@ -86,13 +86,13 @@ private: virtual void close(); virtual void flush() {} }; - + bool m_hostServerConnection; // true if this is the connection between the host player and server bool m_hostLocal; // true if this player on the same machine as the host int m_end; // 0 for client side or 1 for host side // For local connections between the host player and the server - static CRITICAL_SECTION s_hostQueueLock[2]; + static CRITICAL_SECTION s_hostQueueLock[2]; static std::queue s_hostQueue[2]; static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketInputStreamLocal *s_hostInStream[2]; @@ -108,7 +108,7 @@ private: static ServerConnection *s_serverConnection; BYTE networkPlayerSmallId; -public: +public: C4JThread::Event* m_socketClosedEvent; INetworkPlayer *getPlayer(); diff --git a/Minecraft.World/SparseDataStorage.cpp b/Minecraft.World/SparseDataStorage.cpp index cb9fb34a6..327930d5e 100644 --- a/Minecraft.World/SparseDataStorage.cpp +++ b/Minecraft.World/SparseDataStorage.cpp @@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage() // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -59,7 +59,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -70,7 +70,7 @@ SparseDataStorage::~SparseDataStorage() { unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); // Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc - + #ifdef _XBOX if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE ) { @@ -87,7 +87,7 @@ SparseDataStorage::~SparseDataStorage() SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -126,7 +126,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) for( int y = 0; y < 128; y++ ) { bool all0 = true; - + for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked { int pos = ( xz << 7 ) | y; @@ -176,9 +176,9 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -230,7 +230,7 @@ int SparseDataStorage::get(int x, int y, int z) { unsigned char *planeIndices, *data; getPlaneIndicesAndData(&planeIndices, &data); - + if( planeIndices[y] == ALL_0_INDEX ) { return 0; @@ -370,7 +370,7 @@ int SparseDataStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z0 } } ptrdiff_t count = pucOut - &dataInOut.data[offset]; - + return (int)count; } @@ -380,7 +380,7 @@ void SparseDataStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -388,9 +388,9 @@ void SparseDataStorage::addNewPlane(int y) // Find out what to prefill the newly allocated line with unsigned char planeIndex = lastDataPointer[y]; - + if( planeIndex < ALL_0_INDEX ) return; // Something has already allocated this line - we're done - + int linesUsed = lastLinesUsed + 1; // Allocate new memory storage, copy over anything from old storage, and initialise remainder @@ -401,14 +401,14 @@ void SparseDataStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -473,20 +473,20 @@ void SparseDataStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseDataStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -508,7 +508,7 @@ int SparseDataStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -558,13 +558,13 @@ int SparseDataStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -576,7 +576,7 @@ int SparseDataStorage::compress() { // Success queueForDelete( planeIndices ); -// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); +// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); #ifdef DATA_COMPRESSION_STATS count = planesToAlloc; #endif @@ -617,9 +617,9 @@ void SparseDataStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount(newDataAndCount); } diff --git a/Minecraft.World/SparseDataStorage.h b/Minecraft.World/SparseDataStorage.h index 93d5c4244..16289cdae 100644 --- a/Minecraft.World/SparseDataStorage.h +++ b/Minecraft.World/SparseDataStorage.h @@ -18,9 +18,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -36,7 +36,7 @@ class SparseDataStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -64,7 +64,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/Minecraft.World/SparseLightStorage.cpp b/Minecraft.World/SparseLightStorage.cpp index f81510e74..531448f11 100644 --- a/Minecraft.World/SparseLightStorage.cpp +++ b/Minecraft.World/SparseLightStorage.cpp @@ -40,7 +40,7 @@ SparseLightStorage::SparseLightStorage(bool sky) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 127; @@ -59,7 +59,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 0; @@ -70,7 +70,7 @@ SparseLightStorage::~SparseLightStorage() { unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); // Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc - + #ifdef _XBOX if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE ) { @@ -87,7 +87,7 @@ SparseLightStorage::~SparseLightStorage() SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -125,7 +125,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) { bool all0 = true; bool all15 = true; - + for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked { int pos = ( xz << 7 ) | y; @@ -180,9 +180,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -245,7 +245,7 @@ int SparseLightStorage::get(int x, int y, int z) { unsigned char *planeIndices, *data; getPlaneIndicesAndData(&planeIndices, &data); - + if( planeIndices[y] == ALL_0_INDEX ) { return 0; @@ -312,7 +312,7 @@ void SparseLightStorage::setAllBright() } // Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ( (int64_t) planeIndices ) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) updateDataAndCount( newDataAndCount ); @@ -375,7 +375,7 @@ int SparseLightStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z } } ptrdiff_t count = pucOut - &dataInOut.data[offset]; - + return (int)count; } @@ -385,7 +385,7 @@ void SparseLightStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -407,14 +407,14 @@ void SparseLightStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -479,20 +479,20 @@ void SparseLightStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseLightStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -514,7 +514,7 @@ int SparseLightStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -575,13 +575,13 @@ int SparseLightStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -593,7 +593,7 @@ int SparseLightStorage::compress() { // Success queueForDelete( planeIndices ); -// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); +// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); #ifdef LIGHT_COMPRESSION_STATS count = planesToAlloc; #endif @@ -634,9 +634,9 @@ void SparseLightStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount( newDataAndCount ); } diff --git a/Minecraft.World/SparseLightStorage.h b/Minecraft.World/SparseLightStorage.h index d05d76450..c4cfbd049 100644 --- a/Minecraft.World/SparseLightStorage.h +++ b/Minecraft.World/SparseLightStorage.h @@ -20,9 +20,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -38,7 +38,7 @@ class SparseLightStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -66,7 +66,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/Minecraft.World/StemTile.cpp b/Minecraft.World/StemTile.cpp index 937b6d9ca..571110af6 100644 --- a/Minecraft.World/StemTile.cpp +++ b/Minecraft.World/StemTile.cpp @@ -187,10 +187,10 @@ void StemTile::spawnResources(Level *level, int x, int y, int z, int data, float Item *seed = NULL; if (fruit == Tile::pumpkin) seed = Item::seeds_pumpkin; if (fruit == Tile::melon) seed = Item::seeds_melon; - for (int i = 0; i < 3; i++) - { - popResource(level, x, y, z, shared_ptr(new ItemInstance(seed))); - } + if (seed != NULL) + { + popResource(level, x, y, z, shared_ptr(new ItemInstance(seed))); + } } int StemTile::getResource(int data, Random *random, int playerBonusLevel) diff --git a/Minecraft.World/StructureFeature.cpp b/Minecraft.World/StructureFeature.cpp index dfb214a54..bbce7e1a6 100644 --- a/Minecraft.World/StructureFeature.cpp +++ b/Minecraft.World/StructureFeature.cpp @@ -169,10 +169,10 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i restoreSavedData(level); random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); - __int64 xx = (cellX >> 4) * xScale; - __int64 zz = (cellZ >> 4) * zScale; + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); + int64_t xx = (cellX >> 4) * xScale; + int64_t zz = (cellZ >> 4) * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, cellX >> 4, cellZ >> 4, 0, 0, byteArray()); diff --git a/Minecraft.World/StructureFeature.h b/Minecraft.World/StructureFeature.h index ace5593de..521032439 100644 --- a/Minecraft.World/StructureFeature.h +++ b/Minecraft.World/StructureFeature.h @@ -26,7 +26,7 @@ private: protected: - unordered_map<__int64, StructureStart *> cachedStructures; + unordered_map cachedStructures; public: StructureFeature(); @@ -49,7 +49,7 @@ public: TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ); protected: - vector *getGuesstimatedFeaturePositions(); + vector *getGuesstimatedFeaturePositions(); private: virtual void restoreSavedData(Level *level); @@ -58,7 +58,7 @@ private: /** * Returns true if the given chunk coordinates should hold a structure * source. - * + * * @param x * chunk x * @param z @@ -71,7 +71,7 @@ protected: /** * Creates a new instance of a structure source at the given chunk * coordinates. - * + * * @param x * chunk x * @param z diff --git a/Minecraft.World/SwampRiversLayer.cpp b/Minecraft.World/SwampRiversLayer.cpp index 68cef8a83..cd22cae8a 100644 --- a/Minecraft.World/SwampRiversLayer.cpp +++ b/Minecraft.World/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(__int64 seed, shared_ptr parent) : Layer(seed) +SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/SwampRiversLayer.h b/Minecraft.World/SwampRiversLayer.h index f724ad82b..97bab0f43 100644 --- a/Minecraft.World/SwampRiversLayer.h +++ b/Minecraft.World/SwampRiversLayer.h @@ -5,7 +5,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(__int64 seed, shared_ptr parent); + SwampRiversLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/System.h b/Minecraft.World/System.h index ae48ea68a..ec5520cb7 100644 --- a/Minecraft.World/System.h +++ b/Minecraft.World/System.h @@ -20,16 +20,16 @@ public: ArrayCopyFunctionDeclaration(Biome *) ArrayCopyFunctionDeclaration(int) - static __int64 nanoTime(); - static __int64 currentTimeMillis(); - static __int64 currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves + static int64_t nanoTime(); + static int64_t currentTimeMillis(); + static int64_t currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves static void ReverseUSHORT(unsigned short *pusVal); static void ReverseSHORT(short *psVal); static void ReverseULONG(unsigned long *pulVal); static void ReverseULONG(unsigned int *pulVal); static void ReverseINT(int *piVal); - static void ReverseULONGLONG(__int64 *pullVal); + static void ReverseULONGLONG(int64_t *pullVal); static void ReverseWCHARA(WCHAR *pwch,int iLen); }; diff --git a/Minecraft.World/Tag.cpp b/Minecraft.World/Tag.cpp index fefc469a4..ca5a1e5d7 100644 --- a/Minecraft.World/Tag.cpp +++ b/Minecraft.World/Tag.cpp @@ -153,7 +153,7 @@ Tag *Tag::newTag(uint8_t type, const wstring &name) return NULL; } -const wchar_t *Tag::getTagName(uint8_t type) +wchar_t *Tag::getTagName(uint8_t type) { switch (type) { diff --git a/Minecraft.World/Tag.h b/Minecraft.World/Tag.h index 009672654..c3412c1af 100644 --- a/Minecraft.World/Tag.h +++ b/Minecraft.World/Tag.h @@ -39,7 +39,7 @@ public: static Tag *readNamedTag(DataInput *dis, int tagDepth); static void writeNamedTag(Tag *tag, DataOutput *dos); static Tag *newTag(uint8_t type, const wstring &name); - static const wchar_t *getTagName(uint8_t type); + static 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/TheEndDimension.cpp b/Minecraft.World/TheEndDimension.cpp index ccc8641b4..031d6de4b 100644 --- a/Minecraft.World/TheEndDimension.cpp +++ b/Minecraft.World/TheEndDimension.cpp @@ -19,7 +19,7 @@ ChunkSource *TheEndDimension::createRandomLevelSource() const return new TheEndLevelRandomLevelSource(level, level->getSeed()); } -float TheEndDimension::getTimeOfDay(__int64 time, float a) const +float TheEndDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/Minecraft.World/TheEndDimension.h b/Minecraft.World/TheEndDimension.h index 95bd6980a..268be6f6c 100644 --- a/Minecraft.World/TheEndDimension.h +++ b/Minecraft.World/TheEndDimension.h @@ -6,7 +6,7 @@ class TheEndDimension : public Dimension public: virtual void init(); virtual ChunkSource *createRandomLevelSource() const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual float *getSunriseColor(float td, float a); virtual Vec3 *getFogColor(float td, float a) const; virtual bool hasGround(); diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp index 02d291de4..bdeecdb62 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp @@ -9,7 +9,7 @@ #include "net.minecraft.world.level.storage.h" #include "TheEndLevelRandomLevelSource.h" -TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, __int64 seed) +TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed) { m_XZSize = END_LEVEL_MIN_WIDTH; @@ -370,10 +370,10 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource *parent, int xt, int // 4J - added. The original java didn't do any setting of the random seed here, and passes the level random to the biome decorator. // We'll be running our postProcess in parallel with getChunk etc. so we need to use a separate random - have used the same initialisation code as - // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation. + // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); Biome *biome = level->getBiome(xo + 16, zo + 16); diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.h b/Minecraft.World/TheEndLevelRandomLevelSource.h index 4a2a4f2a6..a95a84fa1 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/TheEndLevelRandomLevelSource.h @@ -9,7 +9,7 @@ public: static const double SNOW_CUTOFF; static const double SNOW_SCALE; static const bool FLOATING_ISLANDS; - + static const int CHUNK_HEIGHT = 4; static const int CHUNK_WIDTH = 8; private: @@ -30,7 +30,7 @@ private: Level *level; public: - TheEndLevelRandomLevelSource(Level *level, __int64 seed); + TheEndLevelRandomLevelSource(Level *level, int64_t seed); ~TheEndLevelRandomLevelSource(); void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes); diff --git a/Minecraft.World/TickNextTickData.h b/Minecraft.World/TickNextTickData.h index 04d9ed5ed..60fe3be3c 100644 --- a/Minecraft.World/TickNextTickData.h +++ b/Minecraft.World/TickNextTickData.h @@ -12,7 +12,7 @@ private: public: int x, y, z, tileId; - __int64 m_delay; + int64_t m_delay; int priorityTilt; private: @@ -23,7 +23,7 @@ public: bool equals(const TickNextTickData *o) const; int hashCode() const; - TickNextTickData *delay(__int64 l); + TickNextTickData *delay(int64_t l); void setPriorityTilt(int priorityTilt); int compareTo(const TickNextTickData *tnd) const; @@ -35,19 +35,19 @@ public: struct TickNextTickDataKeyHash { - int operator() (const TickNextTickData &k) const + int operator() (const TickNextTickData &k) const { return TickNextTickData::hash_fnct (k); } }; struct TickNextTickDataKeyEq { - bool operator() (const TickNextTickData &x, const TickNextTickData &y) const + bool operator() (const TickNextTickData &x, const TickNextTickData &y) const { return TickNextTickData::eq_test (x, y); } }; struct TickNextTickDataKeyCompare { - bool operator() (const TickNextTickData &x, const TickNextTickData &y) const + bool operator() (const TickNextTickData &x, const TickNextTickData &y) const { return TickNextTickData::compare_fnct (x, y); } }; \ No newline at end of file diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index a07fdfe43..67148274e 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -1358,7 +1358,7 @@ void Tile::handleRain(Level *level, int x, int y, int z) { } -void Tile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) +void Tile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { } diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index 142b32e61..307c4106a 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -59,13 +59,13 @@ protected: ThreadStorage(); }; static DWORD tlsIdxShape; -public: +public: // Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own // local storage, or share the default storage already allocated by the main thread static void CreateNewThreadStorage(); static void ReleaseThreadStorage(); -public: +public: static const int TILE_NUM_COUNT = 4096; static const int TILE_NUM_MASK = 0xfff; // 4096 - 1 static const int TILE_NUM_SHIFT = 12; // 4096 is 12 bits @@ -118,7 +118,7 @@ public: static SoundType *SOUND_NORMAL; static SoundType *SOUND_WOOD; static SoundType *SOUND_GRAVEL; - static SoundType *SOUND_GRASS; + static SoundType *SOUND_GRASS; static SoundType *SOUND_STONE; static SoundType *SOUND_METAL; static SoundType *SOUND_GLASS; @@ -704,7 +704,7 @@ public: virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); virtual void onRemoving(Level *level, int x, int y, int z, int data); virtual void handleRain(Level *level, int x, int y, int z); - virtual void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + virtual void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); virtual bool useOwnCloneData(); virtual bool canInstantlyTick(); virtual bool dropFromExplosion(Explosion *explosion); @@ -719,7 +719,7 @@ protected: public: virtual void registerIcons(IconRegister *iconRegister); - virtual wstring getTileItemIconName(); + virtual wstring getTileItemIconName(); // AP - added this function so we can generate the faceFlags for a block in a single fast function int getFaceFlags(LevelSource *level, int x, int y, int z); diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index 58cf21075..b200e181b 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include #include "com.mojang.nbt.h" #include "net.minecraft.world.entity.ai.attributes.h" #include "net.minecraft.world.entity.ai.goal.h" @@ -18,8 +19,6 @@ #include "Villager.h" #include "AbstractContainerMenu.h" -#include - unordered_map > Villager::MIN_MAX_VALUES; unordered_map > Villager::MIN_MAX_PRICES; @@ -515,9 +514,7 @@ void Villager::addOffers(int addCount) } // shuffle the list to make it more interesting - std::random_device rd; - std::mt19937 g(rd()); - std::shuffle(newOffers->begin(), newOffers->end(), g); + std::shuffle(newOffers->begin(), newOffers->end(), std::mt19937{std::random_device{}()}); if (offers == NULL) { diff --git a/Minecraft.World/VoronoiZoom.cpp b/Minecraft.World/VoronoiZoom.cpp index 78323dfae..f62cc9b6f 100644 --- a/Minecraft.World/VoronoiZoom.cpp +++ b/Minecraft.World/VoronoiZoom.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -VoronoiZoom::VoronoiZoom(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +VoronoiZoom::VoronoiZoom(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/VoronoiZoom.h b/Minecraft.World/VoronoiZoom.h index c0738c90e..43a8de66a 100644 --- a/Minecraft.World/VoronoiZoom.h +++ b/Minecraft.World/VoronoiZoom.h @@ -5,7 +5,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(__int64 seedMixup, shared_ptrparent); + VoronoiZoom(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/WaterLevelChunk.cpp b/Minecraft.World/WaterLevelChunk.cpp index 7727898bb..3f4bd704f 100644 --- a/Minecraft.World/WaterLevelChunk.cpp +++ b/Minecraft.World/WaterLevelChunk.cpp @@ -148,7 +148,7 @@ bool WaterLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *WaterLevelChunk::getRandom(__int64 l) +Random *WaterLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/Minecraft.World/WaterLevelChunk.h b/Minecraft.World/WaterLevelChunk.h index d2753cfa5..619eb65cc 100644 --- a/Minecraft.World/WaterLevelChunk.h +++ b/Minecraft.World/WaterLevelChunk.h @@ -40,7 +40,7 @@ public: void setBlocks(byteArray newBlocks, int sub); int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter; bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); virtual Biome *getBiome(int x, int z, BiomeSource *biomeSource); virtual void reSyncLighting() {}; // 4J added }; diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index c7ee2191c..c5eb3ac7a 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -93,6 +93,7 @@ bool Zombie::isBaby() void Zombie::setBaby(bool baby) { getEntityData()->set(DATA_BABY_ID, (uint8_t) (baby ? 1 : 0)); + updateSize(baby); if (level != NULL && !level->isClientSide) { @@ -209,6 +210,11 @@ void Zombie::tick() } Monster::tick(); + + if (level->isClientSide) + { + updateSize(isBaby()); + } } bool Zombie::doHurtTarget(shared_ptr target) @@ -226,6 +232,12 @@ bool Zombie::doHurtTarget(shared_ptr target) return result; } +void Zombie::updateSize(bool isBaby) +{ + float scale = isBaby ? 0.5f : 1.0f; + setSize(0.6f, 1.8f * scale); +} + int Zombie::getAmbientSound() { return eSoundType_MOB_ZOMBIE_AMBIENT; diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index 30a289e42..b8a909e12 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -60,6 +60,7 @@ public: virtual bool hurt(DamageSource *source, float dmg); virtual void tick(); virtual bool doHurtTarget(shared_ptr target); + virtual void updateSize(bool isBaby); protected: virtual int getAmbientSound(); diff --git a/Minecraft.World/ZoneFile.cpp b/Minecraft.World/ZoneFile.cpp index fc1f36bfe..661cb7ddd 100644 --- a/Minecraft.World/ZoneFile.cpp +++ b/Minecraft.World/ZoneFile.cpp @@ -6,7 +6,7 @@ const int ZoneFile::slotsLength = ZonedChunkStorage::CHUNKS_PER_ZONE * ZonedChunkStorage::CHUNKS_PER_ZONE; -ZoneFile::ZoneFile(__int64 key, File file, File entityFile) : slots(slotsLength) +ZoneFile::ZoneFile(int64_t key, File file, File entityFile) : slots(slotsLength) { lastUse = 0; diff --git a/Minecraft.World/ZoneFile.h b/Minecraft.World/ZoneFile.h index d7b8cc821..5adb60ee6 100644 --- a/Minecraft.World/ZoneFile.h +++ b/Minecraft.World/ZoneFile.h @@ -17,18 +17,18 @@ private: short slotCount; public: - __int64 lastUse; + int64_t lastUse; private: HANDLE channel; public: - __int64 key; + int64_t key; File file; NbtSlotFile *entityFile; - ZoneFile(__int64 key, File file, File entityFile); + ZoneFile(int64_t key, File file, File entityFile); ~ZoneFile(); void readHeader(); diff --git a/Minecraft.World/ZoneIo.cpp b/Minecraft.World/ZoneIo.cpp index f1838c869..0bd2a637a 100644 --- a/Minecraft.World/ZoneIo.cpp +++ b/Minecraft.World/ZoneIo.cpp @@ -2,7 +2,7 @@ #include "ByteBuffer.h" #include "ZoneIo.h" -ZoneIo::ZoneIo(HANDLE channel, __int64 pos) +ZoneIo::ZoneIo(HANDLE channel, int64_t pos) { this->channel = channel; this->pos = pos; diff --git a/Minecraft.World/ZoneIo.h b/Minecraft.World/ZoneIo.h index 22473583a..59840564c 100644 --- a/Minecraft.World/ZoneIo.h +++ b/Minecraft.World/ZoneIo.h @@ -7,10 +7,10 @@ class ZoneIo { private: HANDLE channel; - __int64 pos; + int64_t pos; public: - ZoneIo(HANDLE channel, __int64 pos); + ZoneIo(HANDLE channel, int64_t pos); void write(byteArray bb, int size); void write(ByteBuffer *bb, int size); ByteBuffer *read(int size); diff --git a/Minecraft.World/ZonedChunkStorage.cpp b/Minecraft.World/ZonedChunkStorage.cpp index 5c6bf192c..596d7c48f 100644 --- a/Minecraft.World/ZonedChunkStorage.cpp +++ b/Minecraft.World/ZonedChunkStorage.cpp @@ -50,7 +50,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) int xZone = x >> CHUNKS_PER_ZONE_BITS; int zZone = z >> CHUNKS_PER_ZONE_BITS; - __int64 key = xZone + (zZone << 20l); + int64_t key = xZone + (zZone << 20l); // 4J - was !zoneFiles.containsKey(key) if (zoneFiles.find(key) == zoneFiles.end()) { @@ -107,8 +107,8 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) header->flip(); int xOrg = header->getInt(); int zOrg = header->getInt(); - __int64 time = header->getLong(); - __int64 flags = header->getLong(); + int64_t time = header->getLong(); + int64_t flags = header->getLong(); lc->terrainPopulated = (flags & BIT_TERRAIN_POPULATED) != 0; @@ -121,7 +121,7 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) void ZonedChunkStorage::save(Level *level, LevelChunk *lc) { - __int64 flags = 0; + int64_t flags = 0; if (lc->terrainPopulated) flags |= BIT_TERRAIN_POPULATED; ByteBuffer *header = ByteBuffer::allocate(CHUNK_HEADER_SIZE); @@ -176,7 +176,7 @@ void ZonedChunkStorage::flush() for ( auto& it : zoneFiles ) { ZoneFile *zoneFile = it.second; - if ( zoneFile ) + if ( zoneFile ) zoneFile->close(); } zoneFiles.clear(); diff --git a/Minecraft.World/ZonedChunkStorage.h b/Minecraft.World/ZonedChunkStorage.h index ed7e3b65d..c8b89db9b 100644 --- a/Minecraft.World/ZonedChunkStorage.h +++ b/Minecraft.World/ZonedChunkStorage.h @@ -14,24 +14,24 @@ class ZonedChunkStorage : public ChunkStorage { public: static const int BIT_TERRAIN_POPULATED; - + static const int CHUNKS_PER_ZONE_BITS; // = 32 static const int CHUNKS_PER_ZONE; // ^2 - + static const int CHUNK_WIDTH; - + static const int CHUNK_HEADER_SIZE; static const int CHUNK_SIZE; static const int CHUNK_LAYERS ; static const int CHUNK_SIZE_BYTES; - + static const ByteOrder BYTEORDER; File dir; private: - unordered_map<__int64, ZoneFile *> zoneFiles; - __int64 tickCount; + unordered_map zoneFiles; + int64_t tickCount; public: ZonedChunkStorage(File dir); diff --git a/Minecraft.World/ZoomLayer.cpp b/Minecraft.World/ZoomLayer.cpp index bef24709c..c21237856 100644 --- a/Minecraft.World/ZoomLayer.cpp +++ b/Minecraft.World/ZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -ZoomLayer::ZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +ZoomLayer::ZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -81,7 +81,7 @@ int ZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrZoomLayer::zoom(__int64 seed, shared_ptr sup, int count) +shared_ptrZoomLayer::zoom(int64_t seed, shared_ptr sup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/ZoomLayer.h b/Minecraft.World/ZoomLayer.h index f865f0886..8ec93c8a2 100644 --- a/Minecraft.World/ZoomLayer.h +++ b/Minecraft.World/ZoomLayer.h @@ -5,7 +5,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(__int64 seedMixup, shared_ptr parent); + ZoomLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); @@ -14,5 +14,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptr zoom(__int64 seed, shared_ptrsup, int count); + static shared_ptr zoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h index 04b0328f5..2e170ad2b 100644 --- a/Minecraft.World/stdafx.h +++ b/Minecraft.World/stdafx.h @@ -4,13 +4,7 @@ // #pragma once -#ifdef __PS3__ -#else -#endif - -#if ( defined _XBOX || defined _WINDOWS64 || defined _DURANGO ) -typedef unsigned __int64 __uint64; -#endif +#include #ifdef _WINDOWS64 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers @@ -18,7 +12,7 @@ typedef unsigned __int64 __uint64; #include #include #include -// TODO: reference additional headers your program requirements here +// TODO: reference additional headers your program requires here #include #endif diff --git a/Minecraft.World/system.cpp b/Minecraft.World/system.cpp index b6dd56d96..f9bd07a7c 100644 --- a/Minecraft.World/system.cpp +++ b/Minecraft.World/system.cpp @@ -21,7 +21,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWith assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); assert( dstPos + length <= dst->length ); - + memcpy( dst->data + dstPos, src.data + srcPos, length); } @@ -30,7 +30,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithL assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); assert( dstPos + length <= dst->length ); - + memcpy( dst->data + dstPos, src.data + srcPos, length * sizeof(int) ); } @@ -47,10 +47,10 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithL // long startTime = System.nanoTime(); // // ... the code being measured ... // long estimatedTime = System.nanoTime() - startTime; -// +// //Returns: //The current value of the system timer, in nanoseconds. -__int64 System::nanoTime() +int64_t System::nanoTime() { #if defined _WINDOWS64 || defined _XBOX || defined _WIN32 static LARGE_INTEGER s_frequency = { 0 }; @@ -64,7 +64,7 @@ __int64 System::nanoTime() // Using double to avoid 64-bit overflow during multiplication for long uptime // Precision is sufficient for ~100 days of uptime. - return (__int64)((double)counter.QuadPart * 1000000000.0 / (double)s_frequency.QuadPart); + return (int64_t)((double)counter.QuadPart * 1000000000.0 / (double)s_frequency.QuadPart); #else return GetTickCount() * 1000000LL; #endif @@ -73,21 +73,21 @@ __int64 System::nanoTime() //Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, //the granularity of the value depends on the underlying operating system and may be larger. For example, //many operating systems measure time in units of tens of milliseconds. -//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" +//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" //and coordinated universal time (UTC). // //Returns: //the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. -__int64 System::currentTimeMillis() +int64_t System::currentTimeMillis() { #ifdef __PS3__ -// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC). -// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec +// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC). +// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec // stores the value that is smaller than a second in nanoseconds. sys_time_sec_t sec; sys_time_nsec_t nsec; sys_time_get_current_time(&sec, &nsec); - __int64 msec = (sec * 1000) + (nsec / (1000*1000)); + int64_t msec = (sec * 1000) + (nsec / (1000*1000)); return msec; #elif defined __ORBIS__ @@ -100,7 +100,7 @@ __int64 System::currentTimeMillis() return sceKernelGetProcessTimeWide() / 1000; /* SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime;*/ #else @@ -121,7 +121,7 @@ __int64 System::currentTimeMillis() } // 4J Stu - Added this so that we can use real-world timestamps in PSVita saves. Particularly required for the save transfers to be smooth -__int64 System::currentRealTimeMillis() +int64_t System::currentRealTimeMillis() { #ifdef __PSVITA__ SceFiosDate fileTime = sceFiosDateGetCurrent(); @@ -189,9 +189,9 @@ void System::ReverseINT(int *piVal) pchVal1[3]=pchVal2[0]; } -void System::ReverseULONGLONG(__int64 *pullVal) +void System::ReverseULONGLONG(int64_t *pullVal) { - __int64 ullValue=*pullVal; + int64_t ullValue=*pullVal; unsigned char *pchVal1=(unsigned char *)pullVal; unsigned char *pchVal2=(unsigned char *)&ullValue; diff --git a/Minecraft.World/x64headers/extraX64.h b/Minecraft.World/x64headers/extraX64.h index cbf7dcafa..91066e54e 100644 --- a/Minecraft.World/x64headers/extraX64.h +++ b/Minecraft.World/x64headers/extraX64.h @@ -11,6 +11,8 @@ #define MULTITHREAD_ENABLE +#include + const int XUSER_INDEX_ANY = 255; const int XUSER_INDEX_FOCUS = 254; @@ -19,7 +21,7 @@ const int XUSER_MAX_COUNT = 1; const int MINECRAFT_NET_MAX_PLAYERS = 4; #else const int XUSER_MAX_COUNT = 4; -const int MINECRAFT_NET_MAX_PLAYERS = 8; +const int MINECRAFT_NET_MAX_PLAYERS = 256; #endif diff --git a/README.md b/README.md index 9fe589e0c..122157ba8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ This project contains the source code of Minecraft Legacy Console Edition v1.6.0560.0 (TU19) from https://archive.org/details/minecraft-legacy-console-edition-source-code, with some fixes and improvements applied. -[Nightly Build](https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly) +## Download +Windows users can download our [Nightly Build](https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly)! Simply download the `.zip` file and extract it to a folder where you'd like to keep the game. You can set your username in `username.txt` (you'll have to make this file) and add servers to connect to in `servers.txt` ## Platform Support @@ -34,30 +35,42 @@ Basic LAN multiplayer is available on the Windows build - Other players on the same LAN can discover the session from the in-game Join Game menu - Game connections use TCP port `25565` by default - LAN discovery uses UDP port `25566` +- Add servers to your server list with `servers.txt` (temp solution) +- Rename yourself without losing data by keeping your `uid.dat` -This feature is based on [LCEMP](https://github.com/LCEMP/LCEMP/) +Parts of this feature are based on code from [LCEMP](https://github.com/LCEMP/LCEMP) (thanks!) + +### servers.txt + +To add a server to your game, create the `servers.txt` file in the same directory as you have `Minecraft.Client.exe`. Inside, follow this format: +``` +serverip.example.com +25565 +The name of your server in UI! +``` + +For example, here's a valid servers.txt +``` +1.1.1.1 +25565 +Cloudflare's Very Own LCE Server +127.0.0.1 +25565 +Localhost Test Crap +``` ### Launch Arguments | Argument | Description | |--------------------|-----------------------------------------------------------------------------------------------------| | `-name ` | Sets your in-game username. | -| `-server` | Launches a headless server instead of the client. | -| `-ip
` | Client mode: manually connect to an IP. Server mode: override the bind IP from `server.properties`. | -| `-port ` | Client mode: override the join port. Server mode: override the listen port from `server.properties`.| +| `-fullscreen` | Launches the game in Fullscreen mode | Example: ``` -Minecraft.Client.exe -name Steve -ip 192.168.0.25 -port 25565 +Minecraft.Client.exe -name Steve -fullscreen ``` -Headless server example: -``` -Minecraft.Client.exe -server -ip 0.0.0.0 -port 25565 -``` - -The headless server also reads and writes `server.properties` in the working directory. If `-ip` / `-port` are omitted in `-server` mode, it falls back to `server-ip` / `server-port` from that file. Dedicated-server host options such as `trust-players`, `pvp`, `fire-spreads`, `tnt`, `difficulty`, `gamemode`, `spawn-animals`, and `spawn-npcs` are persisted there as well. - ## Controls (Keyboard & Mouse) - **Movement**: `W` `A` `S` `D` @@ -65,6 +78,7 @@ The headless server also reads and writes `server.properties` in the working dir - **Sneak / Fly (Down)**: `Shift` (Hold) - **Sprint**: `Ctrl` (Hold) or Double-tap `W` - **Inventory**: `E` +- **Chat**: `T` - **Drop Item**: `Q` - **Crafting**: `C` Use `Q` and `E` to move through tabs (cycles Left/Right) - **Toggle View (FPS/TPS)**: `F5` diff --git a/cmake/ClientSources.cmake b/cmake/ClientSources.cmake index bb1f331df..6467a243c 100644 --- a/cmake/ClientSources.cmake +++ b/cmake/ClientSources.cmake @@ -1,4 +1,6 @@ set(MINECRAFT_CLIENT_SOURCES + "../include/lce_filesystem/lce_filesystem.cpp" + "AbstractTexturePack.cpp" "AchievementPopup.cpp" "AchievementScreen.cpp" @@ -48,7 +50,6 @@ set(MINECRAFT_CLIENT_SOURCES "Common/DLC/DLCSkinFile.cpp" "Common/DLC/DLCTextureFile.cpp" "Common/DLC/DLCUIDataFile.cpp" - "Common/Filesystem/Filesystem.cpp" "Common/GameRules/AddEnchantmentRuleDefinition.cpp" "Common/GameRules/AddItemRuleDefinition.cpp" "Common/GameRules/ApplySchematicRuleDefinition.cpp" diff --git a/include/lce_filesystem/lce_filesystem.cpp b/include/lce_filesystem/lce_filesystem.cpp new file mode 100644 index 000000000..e4dac0a07 --- /dev/null +++ b/include/lce_filesystem/lce_filesystem.cpp @@ -0,0 +1,74 @@ +#include "stdafx.h" +#include "lce_filesystem.h" + +#ifdef _WINDOWS64 +#include +#endif // TODO: More os' filesystem handling for when the project moves away from only Windows + +#include + +bool FileOrDirectoryExists(const char* path) +{ +#ifdef _WINDOWS64 + DWORD attribs = GetFileAttributesA(path); + return (attribs != INVALID_FILE_ATTRIBUTES); +#else + #error "FileOrDirectoryExists not implemented for this platform" + return false; +#endif +} + +bool FileExists(const char* path) +{ +#ifdef _WINDOWS64 + DWORD attribs = GetFileAttributesA(path); + return (attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY)); +#else + #error "FileExists not implemented for this platform" + return false; +#endif +} + +bool DirectoryExists(const char* path) +{ +#ifdef _WINDOWS64 + DWORD attribs = GetFileAttributesA(path); + return (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)); +#else + #error "DirectoryExists not implemented for this platform" + return false; +#endif +} + +bool GetFirstFileInDirectory(const char* directory, char* outFilePath, size_t outFilePathSize) +{ +#ifdef _WINDOWS64 + char searchPath[MAX_PATH]; + snprintf(searchPath, MAX_PATH, "%s\\*", directory); + + WIN32_FIND_DATAA findData; + HANDLE hFind = FindFirstFileA(searchPath, &findData); + + if (hFind == INVALID_HANDLE_VALUE) + { + return false; + } + + do + { + if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + // Found a file, copy its path to the output buffer + snprintf(outFilePath, outFilePathSize, "%s\\%s", directory, findData.cFileName); + FindClose(hFind); + return true; + } + } while (FindNextFileA(hFind, &findData) != 0); + + FindClose(hFind); + return false; // No files found in the directory +#else + #error "GetFirstFileInDirectory not implemented for this platform" + return false; +#endif +} diff --git a/include/lce_filesystem/lce_filesystem.h b/include/lce_filesystem/lce_filesystem.h new file mode 100644 index 000000000..11d1bf5ba --- /dev/null +++ b/include/lce_filesystem/lce_filesystem.h @@ -0,0 +1,6 @@ +#pragma once + +bool FileOrDirectoryExists(const char* path); +bool FileExists(const char* path); +bool DirectoryExists(const char* path); +bool GetFirstFileInDirectory(const char* directory, char* outFilePath, size_t outFilePathSize);