From 20d395b88dabdb68bc4db6ec080c583dccdf91b9 Mon Sep 17 00:00:00 2001 From: GabsPuNs Date: Sun, 10 May 2026 20:53:21 -0400 Subject: [PATCH] Update again --- .../UI/UIScene_SettingsGraphicsMenu.cpp | 4 +- Minecraft.Client/SheepRenderer.cpp | 3 +- .../Windows64/GameConfig/Minecraft.spa.h | 59 ++++++------------- Minecraft.World/C4JThread.cpp | 23 ++++++++ Minecraft.World/C4JThread.h | 27 +++++++++ 5 files changed, 72 insertions(+), 44 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index a5820aef..5632bfbd 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -35,7 +35,7 @@ namespace int UIScene_SettingsGraphicsMenu::LevelToDistance(int level) { - static const int table[4] = {2,4,8,16,32}; + static const int table[4] = {2,4,8,16}; if(level < 0) level = 0; if(level > 4) level = 4; return table[level]; @@ -43,7 +43,7 @@ int UIScene_SettingsGraphicsMenu::LevelToDistance(int level) int UIScene_SettingsGraphicsMenu::DistanceToLevel(int dist) { - static const int table[4] = {2,4,8,16,32}; + static const int table[4] = {2,4,8,16}; for(int i = 0; i < 5; i++){ if(table[i] == dist) return i; diff --git a/Minecraft.Client/SheepRenderer.cpp b/Minecraft.Client/SheepRenderer.cpp index 43450578..5e8a9905 100644 --- a/Minecraft.Client/SheepRenderer.cpp +++ b/Minecraft.Client/SheepRenderer.cpp @@ -41,11 +41,12 @@ int SheepRenderer::prepareArmor(shared_ptr _sheep, int layer, floa glColor3f(Sheep::COLOR[color][0], Sheep::COLOR[color][1], Sheep::COLOR[color][2]); } - +/* // 4J - change brought forward from 1.8.2 float brightness = SharedConstants::TEXTURE_LIGHTING ? 1.0f : sheep->getBrightness(a); int color = sheep->getColor(); glColor3f(brightness * Sheep::COLOR[color][0], brightness * Sheep::COLOR[color][1], brightness * Sheep::COLOR[color][2]); +*/ return 1; } return -1; diff --git a/Minecraft.Client/Windows64/GameConfig/Minecraft.spa.h b/Minecraft.Client/Windows64/GameConfig/Minecraft.spa.h index a7c262c8..d9be7551 100644 --- a/Minecraft.Client/Windows64/GameConfig/Minecraft.spa.h +++ b/Minecraft.Client/Windows64/GameConfig/Minecraft.spa.h @@ -1,13 +1,3 @@ -//////////////////////////////////////////////////////////////////// -// -// C:\Work\4J\Mojang\Minecraft\Minecraft360-dev\Minecraft.Client\Xbox\GameConfig\Minecraft.spa.h -// -// Auto-generated on Thursday, 10 May 2012 at 21:23:22 -// Xbox LIVE Game Config project version 1.0.173.0 -// SPA Compiler version 1.0.0.0 -// -//////////////////////////////////////////////////////////////////// - #ifndef __MINECRAFT_SPA_H__ #define __MINECRAFT_SPA_H__ @@ -21,20 +11,10 @@ extern "C" { #define TITLEID_MINECRAFT 0x584111F7 -// // Context ids -// -// These values are passed as the dwContextId to XUserSetContext. -// #define CONTEXT_GAME_STATE 0 -// -// Context values -// -// These values are passed as the dwContextValue to XUserSetContext. -// - // Values for CONTEXT_GAME_STATE #define CONTEXT_GAME_STATE_BLANK 0 @@ -43,14 +23,23 @@ extern "C" { #define CONTEXT_GAME_STATE_BOATING 3 #define CONTEXT_GAME_STATE_FISHING 4 #define CONTEXT_GAME_STATE_CRAFTING 5 -#define CONTEXT_GAME_STATE_FORGING 6 -#define CONTEXT_GAME_STATE_NETHER 7 -#define CONTEXT_GAME_STATE_CD 8 -#define CONTEXT_GAME_STATE_MAP 9 -#define CONTEXT_GAME_STATE_ENCHANTING 5 //TODO 10 -#define CONTEXT_GAME_STATE_BREWING 5 //TODO 11 -#define CONTEXT_GAME_STATE_ANVIL 6 //TODO 12 -#define CONTEXT_GAME_STATE_TRADING 0 //TODO 13 +#define CONTEXT_GAME_STATE_NETHER 6 +#define CONTEXT_GAME_STATE_CD 7 +#define CONTEXT_GAME_STATE_MAP 8 +#define CONTEXT_GAME_STATE_ENCHANTING 9 +#define CONTEXT_GAME_STATE_BREWING 10 +#define CONTEXT_GAME_STATE_ANVIL 11 +#define CONTEXT_GAME_STATE_TRADING 12 +// New +#define CONTEXT_GAME_STATE_BEACON 13 +#define CONTEXT_GAME_STATE_END 14 +#define CONTEXT_GAME_STATE_END_POEM 15 +#define CONTEXT_GAME_STATE_FIREWORKS 16 +#define CONTEXT_GAME_STATE_FURNACE 17 +#define CONTEXT_GAME_STATE_HOPPER 18 +#define CONTEXT_GAME_STATE_HORSE 19 +#define CONTEXT_GAME_STATE_RIDING_HORSE 20 +#define CONTEXT_GAME_STATE_SIGN 21 // Values for X_CONTEXT_PRESENCE @@ -69,9 +58,6 @@ extern "C" { // // Property ids // -// These values are passed as the dwPropertyId value to XUserSetProperty -// and as the dwPropertyId value in the XUSER_PROPERTY structure. -// #define PROPERTY_LOCALE 0x10000008 #define PROPERTY_KILLS_ZOMBIE 0x1000000A @@ -117,10 +103,6 @@ extern "C" { // // Achievement ids // -// These values are used in the dwAchievementId member of the -// XUSER_ACHIEVEMENT structure that is used with -// XUserWriteAchievements and XUserCreateAchievementEnumerator. -// #define ACHIEVEMENT_01 1 #define ACHIEVEMENT_02 2 @@ -154,9 +136,6 @@ extern "C" { // // Stats view ids // -// These are used in the dwViewId member of the XUSER_STATS_SPEC structure -// passed to the XUserReadStats* and XUserCreateStatsEnumerator* functions. -// // Skill leaderboards for ranked game modes @@ -663,6 +642,4 @@ extern "C" { } #endif -#endif // __MINECRAFT_SPA_H__ - - +#endif // __MINECRAFT_SPA_H__ \ No newline at end of file diff --git a/Minecraft.World/C4JThread.cpp b/Minecraft.World/C4JThread.cpp index 7993a0f6..ec8263ca 100644 --- a/Minecraft.World/C4JThread.cpp +++ b/Minecraft.World/C4JThread.cpp @@ -194,6 +194,14 @@ C4JThread::~C4JThread() } LeaveCriticalSection(&ms_threadListCS); + +#ifdef _WINDOWS64 + if (m_threadHandle != nullptr && m_threadHandle != (HANDLE)-2) + { + CloseHandle(m_threadHandle); + m_threadHandle = nullptr; + } +#endif } #ifdef __PS3__ @@ -295,6 +303,8 @@ void C4JThread::SetProcessor( int proc ) app.DebugPrintf("***************************** set thread proc %s %d %d %d **************************\n", m_threadName, proc, Mask, Newmask); #elif defined _DURANGO SetThreadAffinityMask(m_threadHandle, 1 << proc ); +#elif defined _WINDOWS64 + SetThreadIdealProcessor(m_threadHandle, proc ); #else XSetThreadProcessor( m_threadHandle, proc); #endif @@ -636,6 +646,19 @@ C4JThread::EventArray::EventArray( int size, EMode mode/* = e_modeAutoClear*/) #endif // __PS3__ } +C4JThread::EventArray::~EventArray() +{ +#ifdef _WINDOWS64 + if (m_events) { + for (int i = 0; i < m_size; i++) { + if (m_events[i] != nullptr) { + CloseHandle(m_events[i]); + } + } + delete[] m_events; + } +#endif +} void C4JThread::EventArray::Set(int index) { diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h index 6bf0a0a7..cde74ec3 100644 --- a/Minecraft.World/C4JThread.h +++ b/Minecraft.World/C4JThread.h @@ -29,6 +29,31 @@ class Level; #define CPU_CORE_SAVE_THREAD_C 5 #define CPU_CORE_LEADERBOARDS 5 // Orbis only +#elif defined(_WINDOWS64) + +#define CPU_CORE_MAIN_THREAD 0 + +#define CPU_CORE_CHUNK_REBUILD_A 1 +#define CPU_CORE_SAVE_THREAD_A 1 + +#define CPU_CORE_TILE_UPDATE 2 + +#define CPU_CORE_CONNECTIONS 3 +#define CPU_CORE_UI_SCENE 3 + +#define CPU_CORE_CHUNK_UPDATE 4 + +#define CPU_CORE_CHUNK_REBUILD_B 5 +#define CPU_CORE_SAVE_THREAD_B 5 + +#define CPU_CORE_REMOVE_PLAYER 6 +#define CPU_CORE_POST_PROCESSING 6 + +#define CPU_CORE_SERVER 7 + +#define CPU_CORE_CHUNK_REBUILD_C 8 +#define CPU_CORE_SAVE_THREAD_C 8 + #else #define CPU_CORE_MAIN_THREAD 0 @@ -95,6 +120,8 @@ public: }; EventArray(int size, EMode mode = e_modeAutoClear); + ~EventArray(); + void Set(int index); void Clear(int index);