add hd resource

This commit is contained in:
2youyou2 2014-06-12 17:38:26 +08:00
parent 7eda0ae999
commit e4f1ac6126
7 changed files with 95 additions and 136 deletions

View File

@ -204,12 +204,14 @@ cocos2d::Node* NodeCache::loadNodeWithContent(const std::string& content)
// decode plist
int length = DICTOOL->getArrayCount_json(doc, TEXTURES);
for(int i=0; i<length; i++)
{
std::string plist = DICTOOL->getStringValueFromArray_json(doc, TEXTURES, i);
//std::string png = DICTOOL->getStringValueFromArray_json(doc, TEXTURES_PNG, i);
std::string png = DICTOOL->getStringValueFromArray_json(doc, TEXTURES_PNG, i);
plist = _jsonPath + plist;
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plist);
png = _jsonPath + png;
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plist, png);
}
// decode node tree

View File

@ -68,26 +68,26 @@ bool AppDelegate::applicationDidFinishLaunching()
auto fileUtils = FileUtils::getInstance();
std::vector<std::string> searchPaths;
// if (screenSize.height > 320)
// {
// auto resourceSize = Size(960, 640);
// searchPaths.push_back("hd");
// searchPaths.push_back("ccs-res/hd");
// searchPaths.push_back("ccs-res/hd/scenetest");
// searchPaths.push_back("ccs-res/hd/scenetest/ArmatureComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/AttributeComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/BackgroundComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/EffectComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/LoadSceneEdtiorFileTest");
// searchPaths.push_back("ccs-res/hd/scenetest/ParticleComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/SpriteComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/TmxMapComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/UIComponentTest");
// searchPaths.push_back("ccs-res/hd/scenetest/TriggerTest");
// searchPaths.push_back("ccs-res");
// director->setContentScaleFactor(resourceSize.height/designSize.height);
// }
// else
if (screenSize.height > 320)
{
auto resourceSize = Size(960, 640);
searchPaths.push_back("hd");
searchPaths.push_back("ccs-res/hd");
searchPaths.push_back("ccs-res/hd/scenetest");
searchPaths.push_back("ccs-res/hd/scenetest/ArmatureComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/AttributeComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/BackgroundComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/EffectComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/LoadSceneEdtiorFileTest");
searchPaths.push_back("ccs-res/hd/scenetest/ParticleComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/SpriteComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/TmxMapComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/UIComponentTest");
searchPaths.push_back("ccs-res/hd/scenetest/TriggerTest");
searchPaths.push_back("ccs-res");
director->setContentScaleFactor(resourceSize.height/designSize.height);
}
else
{
searchPaths.push_back("ccs-res");
searchPaths.push_back("ccs-res/scenetest/ArmatureComponentTest");

View File

@ -72,9 +72,9 @@
<key>originalHeight</key>
<integer>236</integer>
<key>x</key>
<integer>0</integer>
<integer>862</integer>
<key>y</key>
<integer>481</integer>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
@ -91,9 +91,9 @@
<key>originalHeight</key>
<integer>110</integer>
<key>x</key>
<integer>192</integer>
<integer>1054</integer>
<key>y</key>
<integer>481</integer>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
@ -110,9 +110,9 @@
<key>originalHeight</key>
<integer>252</integer>
<key>x</key>
<integer>335</integer>
<integer>1197</integer>
<key>y</key>
<integer>481</integer>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
@ -129,7 +129,45 @@
<key>originalHeight</key>
<integer>112</integer>
<key>x</key>
<integer>523</integer>
<integer>1385</integer>
<key>y</key>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
<real>0</real>
</dict>
<key>testAnimationResource/hat.png</key>
<dict>
<key>width</key>
<integer>452</integer>
<key>height</key>
<integer>458</integer>
<key>originalWidth</key>
<integer>452</integer>
<key>originalHeight</key>
<integer>458</integer>
<key>x</key>
<integer>1533</integer>
<key>y</key>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
<real>0</real>
</dict>
<key>testAnimationResource/1.png</key>
<dict>
<key>width</key>
<integer>201</integer>
<key>height</key>
<integer>320</integer>
<key>originalWidth</key>
<integer>201</integer>
<key>originalHeight</key>
<integer>320</integer>
<key>x</key>
<integer>0</integer>
<key>y</key>
<integer>481</integer>
<key>offsetX</key>
@ -147,14 +185,14 @@
<key>realTextureFileName</key>
<string>boy0.png</string>
<key>size</key>
<string>{1024,1024}</string>
<string>{2048,2048}</string>
</dict>
<key>texture</key>
<dict>
<key>width</key>
<integer>1024</integer>
<integer>2048</integer>
<key>height</key>
<integer>1024</integer>
<integer>2048</integer>
</dict>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 481 KiB

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>frames</key>
<dict>
<key>testAnimationResource/hat.png</key>
<dict>
<key>width</key>
<integer>452</integer>
<key>height</key>
<integer>458</integer>
<key>originalWidth</key>
<integer>452</integer>
<key>originalHeight</key>
<integer>458</integer>
<key>x</key>
<integer>0</integer>
<key>y</key>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
<real>0</real>
</dict>
<key>testAnimationResource/1.png</key>
<dict>
<key>width</key>
<integer>201</integer>
<key>height</key>
<integer>320</integer>
<key>originalWidth</key>
<integer>201</integer>
<key>originalHeight</key>
<integer>320</integer>
<key>x</key>
<integer>454</integer>
<key>y</key>
<integer>0</integer>
<key>offsetX</key>
<real>0</real>
<key>offsetY</key>
<real>0</real>
</dict>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>0</integer>
<key>textureFileName</key>
<string>boy1.png</string>
<key>realTextureFileName</key>
<string>boy1.png</string>
<key>size</key>
<string>{1024,1024}</string>
</dict>
<key>texture</key>
<dict>
<key>width</key>
<integer>1024</integer>
<key>height</key>
<integer>1024</integer>
</dict>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

View File

@ -4,12 +4,10 @@
"designHeight": 1024,
"dataScale": 1.0,
"textures": [
"boy0.plist",
"boy1.plist"
"boy0.plist"
],
"texturesPng": [
"boy0.png",
"boy1.png"
"boy0.png"
],
"nodeTree": {
"options": {
@ -65,11 +63,11 @@
"path": "testAnimationResource/8.png",
"plistFile": ""
},
"x": 72.0,
"y": 143.0,
"x": 73.0,
"y": 148.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
"rotation": -5.71439838,
"flipX": false,
"flipY": false,
"colorR": 255,
@ -98,11 +96,11 @@
"path": "testAnimationResource/3.png",
"plistFile": ""
},
"x": 38.0,
"y": 20.0,
"x": 31.0,
"y": 26.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
"rotation": -4.085081,
"flipX": false,
"flipY": false,
"colorR": 255,
@ -138,8 +136,8 @@
"path": "testAnimationResource/5.png",
"plistFile": ""
},
"x": 144.0,
"y": 50.0,
"x": 142.0,
"y": 56.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
@ -171,11 +169,11 @@
"path": "testAnimationResource/4.png",
"plistFile": ""
},
"x": 60.0,
"y": -5.0,
"x": 58.0,
"y": 4.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
"rotation": -1.14092076,
"flipX": false,
"flipY": false,
"colorR": 255,
@ -211,8 +209,8 @@
"path": "testAnimationResource/2.png",
"plistFile": ""
},
"x": 196.0,
"y": 44.0,
"x": 194.0,
"y": 50.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
@ -244,11 +242,11 @@
"path": "testAnimationResource/7.png",
"plistFile": ""
},
"x": 164.0,
"y": 9.0,
"x": 165.0,
"y": 12.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
"rotation": 2.00441027,
"flipX": false,
"flipY": false,
"colorR": 255,
@ -284,11 +282,11 @@
"path": "testAnimationResource/hat.png",
"plistFile": ""
},
"x": 137.0,
"y": 301.0,
"x": 141.0,
"y": 297.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
"rotation": 4.71490049,
"flipX": false,
"flipY": false,
"colorR": 255,
@ -320,8 +318,8 @@
"path": "testAnimationResource/1.png",
"plistFile": ""
},
"x": 282.0,
"y": 152.0,
"x": 280.0,
"y": 148.0,
"scaleX": 1.0,
"scaleY": 1.0,
"rotation": 0.0,
@ -370,13 +368,6 @@
"frameIndex": 0,
"tween": true
},
{
"$type": "EditorCommon.JsonModel.Animation.TimeLinePointFrameSurrogate, EditorCommon",
"x": 601.0,
"y": 243.0,
"frameIndex": 30,
"tween": true
},
{
"$type": "EditorCommon.JsonModel.Animation.TimeLinePointFrameSurrogate, EditorCommon",
"x": 601.0,
@ -459,13 +450,6 @@
"frameIndex": 0,
"tween": true
},
{
"$type": "EditorCommon.JsonModel.Animation.TimeLinePointFrameSurrogate, EditorCommon",
"x": -0.9363089,
"y": -0.9363089,
"frameIndex": 30,
"tween": true
},
{
"$type": "EditorCommon.JsonModel.Animation.TimeLinePointFrameSurrogate, EditorCommon",
"x": 0.0,