From d76dc8fe561568118e6ed311276fc583d637e97b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 19 Mar 2016 22:13:38 +0100 Subject: [PATCH 1/2] Compile fix --- code/nel/include/nel/pipeline/tool_logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/pipeline/tool_logger.h b/code/nel/include/nel/pipeline/tool_logger.h index 714f46d2d..3abd72f47 100644 --- a/code/nel/include/nel/pipeline/tool_logger.h +++ b/code/nel/include/nel/pipeline/tool_logger.h @@ -103,7 +103,7 @@ public: { releaseError(); - m_ErrorLog = nlfopen(errorLog, "wt"); + m_ErrorLog = NLMISC::nlfopen(errorLog, "wt"); fwrite(s_ErrorHeader.c_str(), 1, s_ErrorHeader.length(), m_ErrorLog); fwrite("\n", 1, 1, m_ErrorLog); fflush(m_ErrorLog); @@ -114,7 +114,7 @@ public: { releaseDepend(); - m_DependLog = nlfopen(dependLog, "wt"); + m_DependLog = NLMISC::nlfopen(dependLog, "wt"); fwrite(s_DependHeader.c_str(), 1, s_DependHeader.length(), m_DependLog); fwrite("\n", 1, 1, m_DependLog); // fflush(m_DependLog); From c83f467be17f93c9a27480f4b396c903256b4031 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 19 Mar 2016 22:13:38 +0100 Subject: [PATCH 2/2] Fix random thunder activation caused by rounding error in setup interpolation --- code/nel/src/misc/bitmap.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 11a27e67e..5574a8597 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -3106,11 +3106,17 @@ bool CBitmap::blit(const CBitmap *src, sint32 x, sint32 y) // Private : float CBitmap::getColorInterp (float x, float y, float colorInXY00, float colorInXY10, float colorInXY01, float colorInXY11) const { + if (colorInXY00 == colorInXY10 + && colorInXY00 == colorInXY01 + && colorInXY00 == colorInXY11) + return colorInXY00; // Fix rounding error for alpha 255... + float res = colorInXY00*(1.0f-x)*(1.0f-y) + colorInXY10*( x)*(1.0f-y) + colorInXY01*(1.0f-x)*( y) + colorInXY11*( x)*( y); - clamp (res, 0.0f, 255.0f); + clamp(res, 0.0f, 255.0f); + return res; }