From f76f71eb5d9c3f3a6caebdfae85675897e29cd7d Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 9 Jul 2014 16:38:26 +0800 Subject: [PATCH] fix win32 & win8 compile error --- .../WidgetReader/TextReader/TextReader.cpp | 9 ++++++++- tests/cpp-tests/Classes/AppDelegate.cpp | 2 +- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 4 ++++ tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters | 12 ++++++++++++ .../cpp-testsComponent/cpp-testsComponent.vcxproj | 4 ++++ .../cpp-testsComponent.vcxproj.filters | 12 ++++++++++++ 6 files changed, 41 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index 786856e408..15a93188e2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -103,7 +103,14 @@ namespace cocostudio std::string fontName = DICTOOL->getStringValue_json(options, P_FontName, "微软雅黑"); std::string fontFilePath = jsonPath.append(fontName); - label->setFontName(fontFilePath); + if (FileUtils::getInstance()->isFileExist(fontFilePath)) + { + label->setFontName(fontFilePath); + } + else{ + label->setFontName(fontName); + } + bool aw = DICTOOL->checkObjectExist_json(options, P_AreaWidth); bool ah = DICTOOL->checkObjectExist_json(options, P_AreaHeight); diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index b3fb8031b3..1ca5f4ba2d 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -54,7 +54,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if(!glview) { - glview = GLView::createWithRect("Cpp Tests",Rect(100,100,960,640)); + glview = GLView::create("Cpp Tests"); director->setOpenGLView(glview); } diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 6e59447926..b842c9b028 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -187,6 +187,8 @@ + + @@ -370,6 +372,8 @@ + + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 399fe8f162..3404238b21 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -849,6 +849,12 @@ Classes\TileMapTest + + Classes\UITest\CocostudioGUISceneTest + + + Classes\UITest\CocostudioGUISceneTest + @@ -1568,5 +1574,11 @@ Classes\TileMapTest + + Classes\UITest\CocostudioGUISceneTest + + + Classes\UITest\CocostudioGUISceneTest + \ No newline at end of file diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index f81bb0d720..f360d9d55e 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -233,6 +233,8 @@ + + @@ -431,6 +433,8 @@ + + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index 7f73aa616c..7cc4e29a0a 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -849,6 +849,12 @@ Classes\TileMapTest + + Classes\UITest\CocosStudioGUITest + + + Classes\UITest\CocosStudioGUITest + @@ -1572,6 +1578,12 @@ Classes\TileMapTest + + Classes\UITest\CocosStudioGUITest + + + Classes\UITest\CocosStudioGUITest +