fix object size error while data is error

This commit is contained in:
Liam 2015-08-20 11:27:01 +08:00
parent d2bc03f80f
commit aa6f2ec4b6
2 changed files with 5 additions and 5 deletions

View File

@ -235,7 +235,10 @@ namespace cocostudio
tmx = TMXTiledMap::create(path);
if (tmx)
{
//先保存资源的尺寸,等编辑器的数据设置完成后,再刷回资源尺寸,防止数据中尺寸和资源部匹配
Size fileSize = tmx->getContentSize();
setPropsWithFlatBuffers(tmx, (Table*)gameMapOptions);
tmx->setContentSize(fileSize);
}
}
else

View File

@ -167,6 +167,8 @@ namespace cocostudio
Sprite *sprite = static_cast<Sprite*>(node);
auto options = (SpriteOptions*)spriteOptions;
auto nodeReader = NodeReader::getInstance();
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
auto fileNameData = options->fileNameData();
@ -242,11 +244,6 @@ namespace cocostudio
sprite->setBlendFunc(blendFunc);
}
auto nodeReader = NodeReader::getInstance();
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
auto nodeOptions = options->nodeOptions();
GLubyte alpha = (GLubyte)nodeOptions->color()->a();