More specific prompt for ETC1 test. (#18212)

This commit is contained in:
James Chen 2017-09-06 02:03:59 -05:00 committed by minggo
parent 7a65363208
commit c6b87f2b09
1 changed files with 40 additions and 13 deletions

View File

@ -2012,18 +2012,6 @@ void TexturePVRv3Premult::transformSprite(cocos2d::Sprite *sprite)
}
// Implementation of ETC1
/*
class TextureETC1 : public TextureDemo
{
public:
TextureETC1();
virtual std::string title() const override;
virtual std::string subtitle() const override;
};
*/
TextureETC1::TextureETC1()
{
auto sprite = Sprite::create("Images/ETC1.pkm");
@ -2041,7 +2029,46 @@ std::string TextureETC1::title() const
std::string TextureETC1::subtitle() const
{
return "only supported on android";
bool isSupportETCHardwareDecode = Configuration::getInstance()->supportsETC();
Application::Platform platform = Application::getInstance()->getTargetPlatform();
std::string ret;
static std::unordered_map<int, const char*> platformMap = {
{(int)Application::Platform::OS_WINDOWS, "Windows"},
{(int)Application::Platform::OS_LINUX, "Linux"},
{(int)Application::Platform::OS_MAC, "macOS"},
{(int)Application::Platform::OS_ANDROID, "Android"},
{(int)Application::Platform::OS_IPHONE, "iPhone"},
{(int)Application::Platform::OS_IPAD, "iPad"},
{(int)Application::Platform::OS_BLACKBERRY, "BlackBerry"},
{(int)Application::Platform::OS_NACL, "NativeClient"},
{(int)Application::Platform::OS_EMSCRIPTEN, "Emscripten"},
{(int)Application::Platform::OS_TIZEN, "Tizen"},
{(int)Application::Platform::OS_WINRT, "WinRT"},
{(int)Application::Platform::OS_WP8, "Windows Phone 8"}
};
if (isSupportETCHardwareDecode)
{
ret += "Hardware decode ETC1 on ";
}
else
{
ret += "Software decode ETC1 on ";
}
auto iter = platformMap.find((int)platform);
if (iter != platformMap.end())
{
ret += iter->second;
}
else
{
ret += "Unknown Platform";
}
return ret;
}
//Implement of S3TC Dxt1