From 50a28ff714964e5724cac8f269d3e45abfce83a6 Mon Sep 17 00:00:00 2001 From: Oen44 Date: Mon, 27 Feb 2023 02:24:25 +0100 Subject: [PATCH 1/5] Updated project to VS 2022 --- README.md | 2 +- vc16/otclient.vcxproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a58a3c3cc..2b3600e08 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can clone repoistory and use github action build-on-request workload. ### Windows -You need visual studio 2019 and vcpkg with commit `3b3bd424827a1f7f4813216f6b32b6c61e386b2e` ([download](https://github.com/microsoft/vcpkg/archive/3b3bd424827a1f7f4813216f6b32b6c61e386b2e.zip)). +You need visual studio 2022 and vcpkg with commit `3b3bd424827a1f7f4813216f6b32b6c61e386b2e` ([download](https://github.com/microsoft/vcpkg/archive/3b3bd424827a1f7f4813216f6b32b6c61e386b2e.zip)). Then you install vcpkg dependencies: ```bash diff --git a/vc16/otclient.vcxproj b/vc16/otclient.vcxproj index 270a1ad40..0cdc098e3 100644 --- a/vc16/otclient.vcxproj +++ b/vc16/otclient.vcxproj @@ -31,7 +31,7 @@ Application false - v142 + v143 false PGOptimize MultiByte @@ -39,7 +39,7 @@ Application false - v142 + v143 false PGOptimize MultiByte @@ -47,7 +47,7 @@ StaticLibrary false - v142 + v143 false false MultiByte @@ -55,7 +55,7 @@ Application false - v142 + v143 false false MultiByte From 50c71b9dd5d0cea1ada03faa669ebc612f7dba21 Mon Sep 17 00:00:00 2001 From: Oen44 Date: Mon, 27 Feb 2023 02:24:35 +0100 Subject: [PATCH 2/5] Updated boost asio to use mutable buffer --- src/framework/net/connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/framework/net/connection.cpp b/src/framework/net/connection.cpp index 7849c1a28..0d257929a 100644 --- a/src/framework/net/connection.cpp +++ b/src/framework/net/connection.cpp @@ -162,7 +162,7 @@ void Connection::read(uint32 bytes, const RecvCallback& callback) m_recvCallback = callback; asio::async_read(m_socket, - asio::buffer(m_inputStream.prepare(bytes)), + asio::mutable_buffer(m_inputStream.prepare(bytes)), std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2)); m_readTimer.cancel(); @@ -194,7 +194,7 @@ void Connection::read_some(const RecvCallback& callback) m_recvCallback = callback; - m_socket.async_read_some(asio::buffer(m_inputStream.prepare(RECV_BUFFER_SIZE)), + m_socket.async_read_some(asio::mutable_buffer(m_inputStream.prepare(RECV_BUFFER_SIZE)), std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2)); m_readTimer.cancel(); From 3ce5f9a7dbc4203367ba2759fb1e461da92940f1 Mon Sep 17 00:00:00 2001 From: Oen44 Date: Mon, 27 Feb 2023 02:24:54 +0100 Subject: [PATCH 3/5] Added missing outfit centering on Y axis --- src/framework/graphics/drawqueue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/framework/graphics/drawqueue.cpp b/src/framework/graphics/drawqueue.cpp index 0198753ae..e2a842912 100644 --- a/src/framework/graphics/drawqueue.cpp +++ b/src/framework/graphics/drawqueue.cpp @@ -253,6 +253,7 @@ void DrawQueue::correctOutfit(const Rect& dest, int fromPos, bool oldScaling) if (texture->m_doCenter) { centerX = std::max(centerX, texture->m_dest.center().x); + centerY = std::max(centerY, texture->m_dest.center().y); } } else if (DrawQueueItemTexturedRect* texture = dynamic_cast(m_queue[i])) { From 91f44e1c996ac81ef4910029ee0920f9549a02bc Mon Sep 17 00:00:00 2001 From: Oen44 Date: Mon, 27 Feb 2023 02:27:20 +0100 Subject: [PATCH 4/5] Added bones support for mounts --- src/client/outfit.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/client/outfit.cpp b/src/client/outfit.cpp index 72f63f55e..2f085e333 100644 --- a/src/client/outfit.cpp +++ b/src/client/outfit.cpp @@ -153,7 +153,21 @@ void Outfit::draw(Point dest, Otc::Direction direction, uint walkAnimationPhase, } dest -= mountType->getDisplacement() * g_sprites.getOffsetFactor(); - mountType->draw(dest, 0, direction, 0, 0, mountAnimationPhase, Color::white, lightView); + if (type->hasBones() && mountType->hasBones()) { + auto mountDest = dest; + auto outfitBones = type->getBones(direction); + auto outfitWidth = type->getWidth(); + auto mountWidth = mountType->getWidth(); + int bonusOffset = std::abs(mountWidth - outfitWidth) * 32; + auto mountBones = mountType->getBones(direction); + auto boneOffset = Point((outfitBones.x - mountBones.x) + bonusOffset, (outfitBones.y - mountBones.y) + bonusOffset); + + mountDest = dest + boneOffset * g_sprites.getOffsetFactor(); + mountType->draw(mountDest, 0, direction, 0, 0, mountAnimationPhase, Color::white, lightView); + } + else { + mountType->draw(dest, 0, direction, 0, 0, mountAnimationPhase, Color::white, lightView); + } dest += type->getDisplacement() * g_sprites.getOffsetFactor(); } }; From 38bc58f03c927702e1bebf48e8c17588cc5463c3 Mon Sep 17 00:00:00 2001 From: Oen44 Date: Mon, 27 Feb 2023 02:29:41 +0100 Subject: [PATCH 5/5] Fixed container with pagination not updating items correctly --- src/client/container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/container.cpp b/src/client/container.cpp index 69155a182..82b020381 100644 --- a/src/client/container.cpp +++ b/src/client/container.cpp @@ -68,7 +68,7 @@ void Container::onAddItem(const ItemPtr& item, int slot) if(slot == 0) m_items.push_front(item); - else + else if (slot > 0 && m_items.size() <= m_capacity - 1) m_items.push_back(item); updateItemsPositions();