Skip to content

Commit 0a45734

Browse files
authored
Merge pull request #295 from SlawekNowy/master
More fixes
2 parents 9da0bc2 + 9ea3960 commit 0a45734

File tree

3 files changed

+4
-53
lines changed

3 files changed

+4
-53
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,12 @@ else()
299299

300300
# filesystem support for c++14
301301
if (COMPILER_SUPPORTS_CXX14)
302-
add_definitions(-std=c++14)
302+
set(CMAKE_CXX_STANDARD 14)
303+
#add_definitions(-std=c++14)
303304
link_libraries(stdc++fs)
304305
else()
305306
if (CMP_HOST_LINUX)
306-
add_definitions(-std=c++11)
307+
set(CMAKE_CXX_STANDARD 11)
307308
endif()
308309
endif()
309310

cmp_compressonatorlib/dxtc/codec_dxtc_alpha.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -547,57 +547,6 @@ static CGU_Vec2i CMP_FindEndpointsAlphaBlockSnorm(CGU_FLOAT alphaBlockSnorm[])
547547
return endpoints;
548548
}
549549

550-
static uint64_t cmp_getBlockPackedIndicesSNorm(CGU_Vec2f alphaMinMax, const float alphaBlockSnorm[], uint64_t data)
551-
{
552-
CGU_FLOAT alpha[8];
553-
alpha[0] = alphaMinMax.x;
554-
alpha[1] = alphaMinMax.y;
555-
556-
if (alphaMinMax.x > alphaMinMax.y)
557-
{
558-
// 8-alpha block: derive the other six alphas.
559-
// Bit code 000 = alpha_0, 001 = alpha_1, others are interpolated.
560-
alpha[2] = (alpha[0] * 6.0f + alpha[1]) / 7.0f;
561-
alpha[3] = (alpha[0] * 5.0f + alpha[1] * 2.0f) / 7.0f;
562-
alpha[4] = (alpha[0] * 4.0f + alpha[1] * 3.0f) / 7.0f;
563-
alpha[5] = (alpha[0] * 3.0f + alpha[1] * 4.0f) / 7.0f;
564-
alpha[6] = (alpha[0] * 2.0f + alpha[1] * 5.0f) / 7.0f;
565-
alpha[7] = (alpha[0] + alpha[1] * 6.0f) / 7.0f;
566-
}
567-
else
568-
{
569-
// 6-alpha block.
570-
// Bit code 000 = alpha_0, 001 = alpha_1, others are interpolated.
571-
alpha[2] = (alpha[0] * 4.0f + alpha[1]) / 5.0f;
572-
alpha[3] = (alpha[0] * 3.0f + alpha[1] * 2.0f) / 5.0f;
573-
alpha[4] = (alpha[0] * 2.0f + alpha[1] * 3.0f) / 5.0f;
574-
alpha[5] = (alpha[0] + alpha[1] * 4.0f) / 5.0f;
575-
alpha[6] = -1.0f;
576-
alpha[7] = 1.0f;
577-
}
578-
579-
// Index all colors using best alpha value
580-
for (CGU_UINT8 i = 0; i < BLOCK_SIZE_4X4; ++i)
581-
{
582-
CGU_UINT8 uBestIndex = 0;
583-
CGU_FLOAT fBestDelta = CMP_FLOAT_MAX;
584-
for (CGU_INT32 uIndex = 0; uIndex < 8; uIndex++)
585-
{
586-
CGU_FLOAT fCurrentDelta = fabsf(alpha[uIndex] - alphaBlockSnorm[i]);
587-
if (fCurrentDelta < fBestDelta)
588-
{
589-
uBestIndex = (CGU_UINT8)(uIndex);
590-
fBestDelta = fCurrentDelta;
591-
}
592-
}
593-
594-
data &= ~(uint64_t(0x07) << (3 * i + 16));
595-
data |= (uint64_t(uBestIndex) << (3 * i + 16));
596-
}
597-
598-
return data;
599-
}
600-
601550
//=============================================================================
602551

603552
CodecError CCodec_DXTC::CompressAlphaBlockSNorm(CMP_FLOAT alphaBlockSnorm[BLOCK_SIZE_4X4], CMP_DWORD compressedBlock[2])

external/openexr/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if (CMP_HOST_WINDOWS)
1717
)
1818
else()
1919
set(OpenEXR_INCLUDE_DIRS
20+
/usr/include/Imath
2021
/usr/include/OpenEXR
2122
)
2223
target_include_directories(ExtOpenEXR INTERFACE ${OpenEXR_INCLUDE_DIRS})

0 commit comments

Comments
 (0)