Skip to content

Instantly share code, notes, and snippets.

@sdkfz181tiger
Last active December 31, 2015 09:49
Show Gist options
  • Save sdkfz181tiger/7969607 to your computer and use it in GitHub Desktop.
Save sdkfz181tiger/7969607 to your computer and use it in GitHub Desktop.
Cocos2d-xでのコンテンツ暗号化(お手軽) ref: http://qiita.com/sdkfz181tiger@github/items/5c850c7e78c2927aae0d
/*
詳細↓
http://qiita.com/sdkfz181tiger@github/items/5c850c7e78c2927aae0d
*/
// ZipUtils.hを読み込む
#include "support/zip_support/ZipUtils.h"
// 復号キー
ZipUtils::ccSetPvrEncryptionKeyPart(0, 0xaaaaaaaa);
ZipUtils::ccSetPvrEncryptionKeyPart(1, 0xbbbbbbbb);
ZipUtils::ccSetPvrEncryptionKeyPart(2, 0xcccccccc);
ZipUtils::ccSetPvrEncryptionKeyPart(3, 0xdddddddd);
// あとは普通に使うだけ
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("hogehoge.plist", "hogehoge.pvr.ccz");
auto eSprite = Sprite::createWithSpriteFrameName("gacya.png");
this->addChild(eSprite);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment