From a429182765986cb12cc4ea73e6f0779c44100d04 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 4 Jul 2014 11:22:36 +0800 Subject: [PATCH] fix windows compile and running error --- .../cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp | 2 +- .../cocostudio/WidgetReader/TextReader/TextReader.cpp | 7 ++++++- .../cocostudio/proj.wp8/libCocosStudio.vcxproj | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 1d8db7e9c3..155e41d523 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -72,7 +72,7 @@ namespace cocostudio int ecr=0, ecg=0, ecb= 0; float bgcv1 = 0.0f, bgcv2= 0.0f; float capsx = 0.0f, capsy = 0.0, capsWidth = 0.0, capsHeight = 0.0f; - Layout::Type layoutType; + Layout::Type layoutType = Layout::Type::ABSOLUTE; int bgColorOpacity = panel->getBackGroundColorOpacity(); for (int i = 0; i < cocoNode->GetChildNum(); ++i) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index d0b021582d..3f34ef020b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -69,7 +69,12 @@ namespace cocostudio }else if(key == P_FontSize){ label->setFontSize(valueToInt(value)); }else if(key == P_FontName){ - std::string fontFilePath = jsonPath.append(value); + std::string fontFilePath; + if(FileUtils::getInstance()->isFileExist(value)){ + fontFilePath = jsonPath.append(value); + }else{ + fontFilePath = value; + } label->setFontName(fontFilePath); }else if(key == P_AreaWidth){ label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height)); diff --git a/cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj index 8002859cb3..f235f18d40 100644 --- a/cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.wp8/libCocosStudio.vcxproj @@ -77,7 +77,7 @@ Use pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) - $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) + $(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) WP8;_DEBUG;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 4267;4251;4244;%(DisableSpecificWarnings) /Zm200 %(AdditionalOptions)