From b75483e9bfccf74e6789439503f2f9de22e2c090 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Fri, 27 Apr 2012 19:17:51 -0300 Subject: [PATCH] fixes * fix filestream read * fix transparent minimap --- modules/client_locales/locales/pt.lua | 2 +- src/framework/core/filestream.cpp | 8 ++++---- src/otclient/core/mapview.cpp | 5 ++++- tools/pkgs/makeotc | 22 +++++++++------------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/modules/client_locales/locales/pt.lua b/modules/client_locales/locales/pt.lua index 1ce15bdd..9960f6e6 100644 --- a/modules/client_locales/locales/pt.lua +++ b/modules/client_locales/locales/pt.lua @@ -100,7 +100,7 @@ locale = { ["Message to %s"] = "Mandar mensagem para %s", ["Minimap"] = "Minimapa", ["Module Manager"] = "Gerenciador de Módulos", - ["Module name"] = "Nomo do módulo", + ["Module name"] = "Nome do módulo", ["Money:"] = "Dinheiro:", ["Move Stackable Item"] = "Mover item contável", ["Move up"] = "Mover para cima", diff --git a/src/framework/core/filestream.cpp b/src/framework/core/filestream.cpp index d2f04e8b..dcc70a9c 100644 --- a/src/framework/core/filestream.cpp +++ b/src/framework/core/filestream.cpp @@ -158,7 +158,7 @@ uint8 FileStream::getU8() if(PHYSFS_read(m_fileHandle, &v, 1, 1) != 1) logTraceError("operation failed on '", m_name, "': ", PHYSFS_getLastError()); } else { - if(m_cacheReadPos+1 >= m_cacheBuffer.size()) { + if(m_cacheReadPos+1 > m_cacheBuffer.size()) { logTraceError("operation failed on '", m_name, "': reached file eof"); return 0; } @@ -176,7 +176,7 @@ uint16 FileStream::getU16() if(PHYSFS_readULE16(m_fileHandle, &v) == 0) logTraceError("operation failed on '", m_name, "': ", PHYSFS_getLastError()); } else { - if(m_cacheReadPos+2 >= m_cacheBuffer.size()) { + if(m_cacheReadPos+2 > m_cacheBuffer.size()) { logTraceError("operation failed on '", m_name, "': reached file eof"); return 0; } @@ -194,7 +194,7 @@ uint32 FileStream::getU32() if(PHYSFS_readULE32(m_fileHandle, &v) == 0) logTraceError("operation failed on '", m_name, "': ", PHYSFS_getLastError()); } else { - if(m_cacheReadPos+4 >= m_cacheBuffer.size()) { + if(m_cacheReadPos+4 > m_cacheBuffer.size()) { logTraceError("operation failed on '", m_name, "': reached file eof"); return 0; } @@ -212,7 +212,7 @@ uint64 FileStream::getU64() if(PHYSFS_readULE64(m_fileHandle, (PHYSFS_uint64*)&v) == 0) logTraceError("operation failed on '", m_name, "': ", PHYSFS_getLastError()); } else { - if(m_cacheReadPos+8 >= m_cacheBuffer.size()) { + if(m_cacheReadPos+8 > m_cacheBuffer.size()) { logTraceError("operation failed on '", m_name, "': reached file eof"); return 0; } diff --git a/src/otclient/core/mapview.cpp b/src/otclient/core/mapview.cpp index 42134cd0..98d86b15 100644 --- a/src/otclient/core/mapview.cpp +++ b/src/otclient/core/mapview.cpp @@ -81,7 +81,7 @@ void MapView::draw(const Rect& rect) g_painter->drawFilledRect(clearRect); g_painter->setColor(Color::white); - // m_framebuffer->clear(Color::black); + // m_framebuffer->clear(Color::black); } auto it = m_cachedVisibleTiles.begin(); @@ -131,6 +131,8 @@ void MapView::draw(const Rect& rect) drawOffset.y += (srcVisible.height() - srcSize.height()) / 2; Rect srcRect = Rect(drawOffset, srcSize); + g_painter->setColor(Color::white); + g_painter->setCompositionMode(Painter::CompositionMode_Replace); #if 0 // debug source area g_painter->saveAndResetState(); @@ -144,6 +146,7 @@ void MapView::draw(const Rect& rect) m_framebuffer->draw(rect, srcRect); #endif + g_painter->resetCompositionMode(); g_painter->resetShaderProgram(); // this could happen if the player position is not known yet diff --git a/tools/pkgs/makeotc b/tools/pkgs/makeotc index 5c3c2e67..91419e7f 100755 --- a/tools/pkgs/makeotc +++ b/tools/pkgs/makeotc @@ -36,20 +36,16 @@ fi gitdir=`pwd` revision=`git describe --dirty --always` -#rm -rf build -if [ -d build ]; then - cd build -else - mkdir -p build - cd build +rm -rf build +mkdir build +cd build - cmake -DCMAKE_TOOLCHAIN_FILE=$gitdir/src/framework/cmake/${platform}_toolchain.cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_REVISION=$revision \ - -DBOT_PROTECTION=OFF \ - -DPROTOCOL=$protocol \ - .. || exit -fi +cmake -DCMAKE_TOOLCHAIN_FILE=$gitdir/src/framework/cmake/${platform}_toolchain.cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_REVISION=$revision \ + -DBOT_PROTECTION=OFF \ + -DPROTOCOL=$protocol \ + .. || exit make "-j${make_jobs}" || exit