mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Solve the error when compile project with NDK r10.
This commit is contained in:
@@ -412,7 +412,12 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||
if (startPos != string::npos) {
|
||||
colorStr.replace(startPos, 1, "");
|
||||
}
|
||||
int num = stoi(colorStr.c_str(), 0, 16);
|
||||
// Android NDK 10 doesn't support std::stoi a/ std::stoul
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
|
||||
int num = std::stoi(colorStr);
|
||||
#else
|
||||
int num = atoi(colorStr.c_str());
|
||||
#endif
|
||||
int r = num / 0x10000;
|
||||
int g = (num / 0x100) % 0x100;
|
||||
int b = num % 0x100;
|
||||
|
||||
Reference in New Issue
Block a user