[cpp] Fix dark color parsing for skeleton binary files.

This commit is contained in:
Mario Zechner 2022-10-14 12:55:50 +02:00
parent 3fc55df04d
commit f8406e81c0
2 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,10 @@ else()
endif()
if((${SPINE_SFML}) OR (${CMAKE_CURRENT_BINARY_DIR} MATCHES "spine-sfml"))
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_OSX_ARCHITECTURES x86_64)
set(ONLY_ACTIVE_ARCH NO)
endif()
add_subdirectory(spine-c)
add_subdirectory(spine-sfml/c)
add_subdirectory(spine-cpp)

View File

@ -169,10 +169,10 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
SlotData *slotData = new (__FILE__, __LINE__) SlotData(i, String(slotName, true), *boneData);
readColor(input, slotData->getColor());
unsigned char a = readByte(input);
unsigned char r = readByte(input);
unsigned char g = readByte(input);
unsigned char b = readByte(input);
unsigned char a = readByte(input);
if (!(r == 0xff && g == 0xff && b == 0xff && a == 0xff)) {
slotData->getDarkColor().set(r / 255.0f, g / 255.0f, b / 255.0f, 1);
slotData->setHasDarkColor(true);