diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index 7910a372..edd4b2fb 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -307,6 +307,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame #endif //__PS3__ thread->SetProcessor(CPU_CORE_SERVER); + thread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); thread->Run(); ServerReadyWait(); diff --git a/Minecraft.Client/Common/UI/UIControl.h b/Minecraft.Client/Common/UI/UIControl.h index 8445af0f..47324c53 100644 --- a/Minecraft.Client/Common/UI/UIControl.h +++ b/Minecraft.Client/Common/UI/UIControl.h @@ -8,28 +8,34 @@ public: enum eUIControlType { eNoControl, + eBitmapIcon, eButton, - eButtonList, + eButtonList, //Removed in TU25 eCheckBox, + eCheckboxButtonList, //New TU25 eCursor, - eDLCList, + eDLCButtonList, //eDLCList eDynamicLabel, eEnchantmentBook, eEnchantmentButton, eHTMLLabel, eLabel, + eLayerIconButtonList, //New TU25 eLeaderboardList, - eMinecraftPlayer, + eLeftIconButtonList, //New TU25 + eLobbyButtonList, //New TU25 eMinecraftHorse, - ePlayerList, + eMinecraftPlayer, + eMultiList, //New TU25 + ePlayerButtonList, //ePlayerList ePlayerSkinPreview, eProgress, eSaveList, + eScoreboardButtonList, //New TU25 eSlider, eSlotList, eTextInput, eTexturePackList, - eBitmapIcon, eTouchControl, }; protected: diff --git a/Minecraft.Client/Common/UI/UIControl_DLCList.cpp b/Minecraft.Client/Common/UI/UIControl_DLCList.cpp index 39f8ff39..a5db189b 100644 --- a/Minecraft.Client/Common/UI/UIControl_DLCList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_DLCList.cpp @@ -4,7 +4,7 @@ bool UIControl_DLCList::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) { - UIControl::setControlType(UIControl::eDLCList); + UIControl::setControlType(UIControl::eDLCButtonList); bool success = UIControl_ButtonList::setupControl(scene,parent,controlName); //SlotList specific initialisers diff --git a/Minecraft.Client/Common/UI/UIControl_PlayerList.cpp b/Minecraft.Client/Common/UI/UIControl_PlayerList.cpp index 0703919f..6d16b660 100644 --- a/Minecraft.Client/Common/UI/UIControl_PlayerList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_PlayerList.cpp @@ -4,7 +4,7 @@ bool UIControl_PlayerList::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) { - UIControl::setControlType(UIControl::ePlayerList); + UIControl::setControlType(UIControl::ePlayerButtonList); bool success = UIControl_ButtonList::setupControl(scene,parent,controlName); //SlotList specific initialisers diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 1cfcb1ee..a633883e 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -667,6 +667,7 @@ void UIController::ReloadSkin() m_reloadSkinThread = new C4JThread(reloadSkinThreadProc, (void*)this, "Reload skin thread"); m_reloadSkinThread->SetProcessor(CPU_CORE_UI_SCENE); + m_updateThread->SetPriority(THREAD_PRIORITY_LOWEST); // Navigate to the timer scene so that we can display something while the loading is happening ui.NavigateToScene(0,eUIScene_Timer,(void *)1,eUILayer_Tooltips,eUIGroup_Fullscreen); diff --git a/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp b/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp index 6a4ea096..e39869a1 100644 --- a/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp +++ b/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp @@ -61,6 +61,7 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData, thread = new C4JThread(params->func, params->lpParam, "FullscreenProgress"); thread->SetProcessor(CPU_CORE_UI_SCENE); // TODO 4J Stu - Make sure this is a good thread/core to use + thread->SetPriority(THREAD_PRIORITY_LOWEST); m_threadCompleted = false; thread->Run(); diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 9ae99d57..1abc7941 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -174,6 +174,7 @@ GameRenderer::GameRenderer(Minecraft *mc) m_updateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); #endif// __PS3__ m_updateThread->SetProcessor(CPU_CORE_CHUNK_UPDATE); + m_updateThread->SetPriority(THREAD_PRIORITY_HIGHEST); m_updateThread->Run(); #endif } diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index a9959448..a11a9834 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1055,12 +1055,20 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // Font was designed for guiScale px/unit; scale up so characters appear // at the same physical size as the rest of the HUD at 0.5x. const float fontScale = static_cast(guiScale) * 1.0f; + const float scaleWidth = (g_rScreenWidth / 1920.0f); + const float scaleHeight = (g_rScreenHeight / 1080.0f); const int debugLeft = 1; const int debugTop = 1; + float scale = min(scaleWidth, scaleHeight); //stop stretching + + if (scale < 0.5f) + scale = 0.5f; //force minimum scale + glTranslatef(static_cast(debugLeft), static_cast(debugTop), 0.f); glScalef(fontScale, fontScale, 1.f); glTranslatef(static_cast(-debugLeft), static_cast(-debugTop), 0.f); + glScalef(scale, scale, 1.f); vector lines; diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index b69628d4..937151fa 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -65,6 +65,7 @@ void ServerLevel::staticCtor() m_updateThread = new C4JThread(runUpdate, nullptr, "Tile update"); m_updateThread->SetProcessor(CPU_CORE_TILE_UPDATE); + m_updateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); // #ifdef __ORBIS__ m_updateThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); // On Orbis, this core is also used for Matching 2, and that priority of that seems to be always at default no matter what we set it to. Prioritise this below Matching 2. #endif diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index 77a5cb78..1ca6808d 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -11,7 +11,7 @@ using namespace std; class ServerLevel : public Level { private: - static const int EMPTY_TIME_NO_TICK = SharedConstants::TICKS_PER_SECOND * 60; + static constexpr int EMPTY_TIME_NO_TICK = SharedConstants::TICKS_PER_SECOND * 60; MinecraftServer *server; EntityTracker *tracker; diff --git a/Minecraft.Client/SheepRenderer.cpp b/Minecraft.Client/SheepRenderer.cpp index 43450578..31bd7de9 100644 --- a/Minecraft.Client/SheepRenderer.cpp +++ b/Minecraft.Client/SheepRenderer.cpp @@ -41,12 +41,14 @@ 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/StatsCounter.h b/Minecraft.Client/StatsCounter.h index e292ccf2..62da1f74 100644 --- a/Minecraft.Client/StatsCounter.h +++ b/Minecraft.Client/StatsCounter.h @@ -33,8 +33,8 @@ private: //static const int STAT_DATA_OFFSET = 32; static const int LARGE_STATS_COUNT = 8; static Stat** LARGE_STATS[LARGE_STATS_COUNT]; - static const int SAVE_DELAY = 30*60; - static const int FLUSH_DELAY = 30*60*5; + static constexpr int SAVE_DELAY = 30*60; + static constexpr int FLUSH_DELAY = 30*60*5; typedef enum { LEADERBOARD_KILLS_PEACEFUL = 0x00000001, diff --git a/Minecraft.World/C4JThread.cpp b/Minecraft.World/C4JThread.cpp index 7993a0f6..322bdaf3 100644 --- a/Minecraft.World/C4JThread.cpp +++ b/Minecraft.World/C4JThread.cpp @@ -295,6 +295,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 diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h index 6bf0a0a7..b05660c0 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 diff --git a/Minecraft.World/Connection.cpp b/Minecraft.World/Connection.cpp index d4450266..1fd2235f 100644 --- a/Minecraft.World/Connection.cpp +++ b/Minecraft.World/Connection.cpp @@ -115,6 +115,8 @@ Connection::Connection(Socket *socket, const wstring& id, PacketListener *packet writeThread = new C4JThread(runWrite, this, writeThreadName, WRITE_STACK_SIZE); readThread->SetProcessor(CPU_CORE_CONNECTIONS); writeThread->SetProcessor(CPU_CORE_CONNECTIONS ); + writeThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); // + readThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); // #ifdef __ORBIS__ readThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); // On Orbis, this core is also used for Matching 2, and that priority of that seems to be always at default no matter what we set it to. Prioritise this below Matching 2. writeThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); // On Orbis, this core is also used for Matching 2, and that priority of that seems to be always at default no matter what we set it to. Prioritise this below Matching 2. diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index d73d556d..05fedf9e 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -36,7 +36,7 @@ class Scoreboard; class Player : public LivingEntity, public CommandSender, public ScoreHolder { public: - static const int MAX_NAME_LENGTH = 16 + 4; + static constexpr int MAX_NAME_LENGTH = 16 + 4; static const int MAX_HEALTH = 20; static const int SLEEP_DURATION = 100; static const int WAKE_UP_DURATION = 10; diff --git a/Minecraft.World/PotionItem.h b/Minecraft.World/PotionItem.h index 4a43505f..08eaca4f 100644 --- a/Minecraft.World/PotionItem.h +++ b/Minecraft.World/PotionItem.h @@ -7,7 +7,7 @@ class MobEffectInstance; class PotionItem : public Item { private: - static const int DRINK_DURATION = static_cast(20 * 1.6); + static constexpr int DRINK_DURATION = static_cast(20 * 1.6); public: static const wstring DEFAULT_ICON; diff --git a/Minecraft.World/Sheep.h b/Minecraft.World/Sheep.h index 30459dd8..411fe453 100644 --- a/Minecraft.World/Sheep.h +++ b/Minecraft.World/Sheep.h @@ -24,7 +24,7 @@ public: static Entity *create(Level *level) { return new Sheep(level); } private: - static const int EAT_ANIMATION_TICKS = SharedConstants::TICKS_PER_SECOND * 2; + static constexpr int EAT_ANIMATION_TICKS = SharedConstants::TICKS_PER_SECOND * 2; static const int DATA_WOOL_ID = 16; int eatAnimationTick; diff --git a/Minecraft.World/TrapMenu.h b/Minecraft.World/TrapMenu.h index e3fb4965..f8bceeca 100644 --- a/Minecraft.World/TrapMenu.h +++ b/Minecraft.World/TrapMenu.h @@ -7,10 +7,10 @@ class DispenserTileEntity; class TrapMenu : public AbstractContainerMenu { private: - static const int INV_SLOT_START = 9; - static const int INV_SLOT_END = INV_SLOT_START + 9 * 3; - static const int USE_ROW_SLOT_START = INV_SLOT_END; - static const int USE_ROW_SLOT_END = USE_ROW_SLOT_START + 9; + static constexpr int INV_SLOT_START = 9; + static constexpr int INV_SLOT_END = INV_SLOT_START + (9*3); + static constexpr int USE_ROW_SLOT_START = INV_SLOT_END; + static constexpr int USE_ROW_SLOT_END = USE_ROW_SLOT_START + 9; private: shared_ptr trap; diff --git a/Minecraft.World/TripWireSourceTile.h b/Minecraft.World/TripWireSourceTile.h index 83adb9ab..033dd0f2 100644 --- a/Minecraft.World/TripWireSourceTile.h +++ b/Minecraft.World/TripWireSourceTile.h @@ -11,7 +11,7 @@ public: static const int MASK_ATTACHED = 0x4; static const int MASK_POWERED = 0x8; static const int WIRE_DIST_MIN = 1; - static const int WIRE_DIST_MAX = 2 + 40; // 2 hooks + x string + static constexpr int WIRE_DIST_MAX = 2 + 40; // 2 hooks + x string TripWireSourceTile(int id); diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index 9b79ef55..677996e1 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -8,8 +8,8 @@ using namespace std; class Zombie : public Monster { private: - static const int VILLAGER_CONVERSION_WAIT_MIN = SharedConstants::TICKS_PER_SECOND * 60 * 3; - static const int VILLAGER_CONVERSION_WAIT_MAX = SharedConstants::TICKS_PER_SECOND * 60 * 5; + static constexpr int VILLAGER_CONVERSION_WAIT_MIN = SharedConstants::TICKS_PER_SECOND * 60 * 3; + static constexpr int VILLAGER_CONVERSION_WAIT_MAX = SharedConstants::TICKS_PER_SECOND * 60 * 5; protected: static Attribute *SPAWN_REINFORCEMENTS_CHANCE;