From c228349098c97cddf2d46a9e14e95c150894230f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 28 May 2018 14:36:58 +0300 Subject: [PATCH 1/2] Added: Personal projects directory --HG-- branch : develop --- .hgignore | 3 +++ code/CMakeLists.txt | 4 ++++ code/personal/README.md | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 code/personal/README.md diff --git a/.hgignore b/.hgignore index 41a0e58cf..990487a2a 100644 --- a/.hgignore +++ b/.hgignore @@ -242,6 +242,9 @@ external_stlport nel_tools* ryzom_tools* +#personal projects +personal/ + #Dumps *.dmp diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 0e72cc5f9..425f296f5 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -475,6 +475,10 @@ IF(WITH_STUDIO) ADD_SUBDIRECTORY(studio) ENDIF() +IF(WITH_PERSONAL) + ADD_SUBDIRECTORY(personal) +ENDIF() + # To build the documention, you will have to enable it # and then do the equivalent of "make DoxygenDoc". IF(BUILD_DOCUMENTATION) diff --git a/code/personal/README.md b/code/personal/README.md new file mode 100644 index 000000000..cb2ebdf41 --- /dev/null +++ b/code/personal/README.md @@ -0,0 +1,9 @@ + +cmake option to include CMakeLists.txt from this directory is `-DWITH_PERSONAL=ON` + +Example: + +``` +ADD_SUBDIRECTORY(example) +``` + From e2617bfe9bd64345b56d2947a21663f31b576381 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 28 May 2018 14:46:16 +0300 Subject: [PATCH 2/2] Fixed: Decoding dds with improper width/height --HG-- branch : develop --- code/nel/src/misc/bitmap.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 47bdf3886..7a3a38e70 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -1356,10 +1356,14 @@ bool CBitmap::decompressDXT1(bool alpha) { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= c[bits&3].A; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= c[bits&3].A; bits>>=2; } } @@ -1466,10 +1470,14 @@ bool CBitmap::decompressDXT3() { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= alpha[4*j+k]; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= alpha[4*j+k]; bits>>=2; } } @@ -1602,10 +1610,14 @@ bool CBitmap::decompressDXT5() { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +0]= c[bits&3].R; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +1]= c[bits&3].G; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +2]= c[bits&3].B; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +3]= (uint8) alpha[codeAlpha[4*j+k]]; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= (uint8) alpha[codeAlpha[4*j+k]]; bits>>=2; } }