26#include "../testResource.h"
30TextureAtlasEncryptionTests::TextureAtlasEncryptionTests()
37 return "Texture Atlas Encryption";
44 auto s = Director::getInstance()->getWinSize();
47 SpriteFrameCache::getInstance()->addSpriteFramesWithFile(
"Images/nonencryptedAtlas.plist",
"Images/nonencryptedAtlas.pvr.ccz");
50 auto nonencryptedSprite = Sprite::createWithSpriteFrameName(
"Icon.png");
51 nonencryptedSprite->setPosition(Vec2(s.width * 0.25f, s.height * 0.5f));
52 this->addChild(nonencryptedSprite);
54 auto nonencryptedSpriteLabel = Label::createWithTTF(
"non-encrypted",
"fonts/arial.ttf", 28);
55 nonencryptedSpriteLabel->setPosition(Vec2(s.width * 0.25f, nonencryptedSprite->getBoundingBox().getMinY() - nonencryptedSprite->getContentSize().height/2));
56 this->addChild(nonencryptedSpriteLabel, 1);
62 ZipUtils::setPvrEncryptionKeyPart(0, 0xaaaaaaaa);
63 ZipUtils::setPvrEncryptionKeyPart(1, 0xbbbbbbbb);
64 ZipUtils::setPvrEncryptionKeyPart(2, 0xcccccccc);
65 ZipUtils::setPvrEncryptionKeyPart(3, 0xdddddddd);
74 SpriteFrameCache::getInstance()->addSpriteFramesWithFile(
"Images/encryptedAtlas.plist",
"Images/encryptedAtlas.pvr.ccz");
77 auto encryptedSprite = Sprite::createWithSpriteFrameName(
"powered.png");
78 encryptedSprite->setPosition(Vec2(s.width * 0.75f, s.height * 0.5f));
79 this->addChild(encryptedSprite);
81 auto encryptedSpriteLabel = Label::createWithTTF(
"encrypted",
"fonts/arial.ttf", 28);
82 encryptedSpriteLabel->setPosition(Vec2(s.width * 0.75f, encryptedSprite->getBoundingBox().getMinY() - encryptedSpriteLabel->getContentSize().height/2));
83 this->addChild(encryptedSpriteLabel, 1);
#define ADD_TEST_CASE(__className__)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override