From 445b0e49b812301e8bf4feefb7781a51b380485e Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 7 Feb 2014 11:46:59 +0800 Subject: [PATCH 1/4] fix:Compile error of the project that lua template generate on the iOS platform --- template/multi-platform-lua/proj.ios_mac/ios/AppController.mm | 2 +- .../multi-platform-lua/proj.ios_mac/ios/RootViewController.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm b/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm index ef011c8dd2..2c87c4c815 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm +++ b/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm @@ -24,7 +24,7 @@ #import #import "AppController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" #import "AppDelegate.h" #import "RootViewController.h" diff --git a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm index 093a9b4c3a..dfbe298774 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm +++ b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm @@ -25,7 +25,7 @@ #import "RootViewController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" @implementation RootViewController From 4fa29862b61ab2ab1e885b1adba24a5755d1ead5 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 7 Feb 2014 12:05:38 +0800 Subject: [PATCH 2/4] fix:Compile error of the project that js template generate on the iOS platform --- template/multi-platform-js/proj.ios_mac/ios/AppController.mm | 2 +- .../multi-platform-js/proj.ios_mac/ios/RootViewController.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template/multi-platform-js/proj.ios_mac/ios/AppController.mm b/template/multi-platform-js/proj.ios_mac/ios/AppController.mm index 748606e013..f334d9a7e0 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/AppController.mm +++ b/template/multi-platform-js/proj.ios_mac/ios/AppController.mm @@ -2,7 +2,7 @@ #import #import "AppController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" #import "AppDelegate.h" #import "RootViewController.h" diff --git a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm index 187b274b91..af421369f2 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm +++ b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm @@ -1,6 +1,6 @@ #import "RootViewController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" @implementation RootViewController From 49fbfcbbe89e838bf3bf5fc391fa14bc0fef637d Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 7 Feb 2014 18:11:26 +0800 Subject: [PATCH 3/4] issue #3907:The project that lua or js template generated crash on the iOS platform --- .../proj.ios_mac/ios/AppController.h | 24 +++++++++++++ .../proj.ios_mac/ios/AppController.mm | 34 +++++++++++++++++-- .../proj.ios_mac/ios/RootViewController.h | 4 +-- .../proj.ios_mac/ios/RootViewController.mm | 30 +++++++++++++++- .../proj.ios_mac/ios/AppController.h | 3 +- .../proj.ios_mac/ios/AppController.mm | 13 ++++--- .../proj.ios_mac/ios/RootViewController.h | 4 +-- .../proj.ios_mac/ios/RootViewController.mm | 9 +++-- 8 files changed, 105 insertions(+), 16 deletions(-) diff --git a/template/multi-platform-js/proj.ios_mac/ios/AppController.h b/template/multi-platform-js/proj.ios_mac/ios/AppController.h index bd952ec99f..09f2084880 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/AppController.h +++ b/template/multi-platform-js/proj.ios_mac/ios/AppController.h @@ -1,3 +1,27 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ @class RootViewController; diff --git a/template/multi-platform-js/proj.ios_mac/ios/AppController.mm b/template/multi-platform-js/proj.ios_mac/ios/AppController.mm index f334d9a7e0..bc1c8bc57b 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/AppController.mm +++ b/template/multi-platform-js/proj.ios_mac/ios/AppController.mm @@ -1,3 +1,27 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #import #import "AppController.h" @@ -21,7 +45,7 @@ static AppDelegate s_sharedApplication; // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] pixelFormat: kEAGLColorFormatRGBA8 depthFormat: GL_DEPTH_COMPONENT16 //_OES preserveBackbuffer: NO @@ -29,12 +53,12 @@ static AppDelegate s_sharedApplication; multiSampling: NO numberOfSamples: 0 ]; - [__glView setMultipleTouchEnabled:YES]; + [eaglView setMultipleTouchEnabled:YES]; // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -51,6 +75,10 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); cocos2d::Application::getInstance()->run(); return YES; diff --git a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.h b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.h index 11dfc4bf88..a68782316e 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.h +++ b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm index af421369f2..2374fae2d2 100644 --- a/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm +++ b/template/multi-platform-js/proj.ios_mac/ios/RootViewController.mm @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #import "RootViewController.h" #import "cocos2d.h" #import "CCEAGLView.h" @@ -46,8 +71,11 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + + cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView(); - CGSize s = CGSizeMake([[CCEAGLView sharedEGLView] getWidth], [[CCEAGLView sharedEGLView] getHeight]); + CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); } diff --git a/template/multi-platform-lua/proj.ios_mac/ios/AppController.h b/template/multi-platform-lua/proj.ios_mac/ios/AppController.h index 3d51064ca0..ee440a30a8 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/AppController.h +++ b/template/multi-platform-lua/proj.ios_mac/ios/AppController.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm b/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm index 2c87c4c815..7bc89f9022 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm +++ b/template/multi-platform-lua/proj.ios_mac/ios/AppController.mm @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -43,7 +44,7 @@ static AppDelegate s_sharedApplication; // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] pixelFormat: kEAGLColorFormatRGBA8 depthFormat: GL_DEPTH_COMPONENT16 preserveBackbuffer: NO @@ -51,11 +52,11 @@ static AppDelegate s_sharedApplication; multiSampling: NO numberOfSamples: 0 ]; - [__glView setMultipleTouchEnabled:YES]; + [eaglView setMultipleTouchEnabled:YES]; // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -72,6 +73,10 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); cocos2d::Application::getInstance()->run(); return YES; diff --git a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.h b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.h index 11dfc4bf88..a68782316e 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.h +++ b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm index dfbe298774..2374fae2d2 100644 --- a/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm +++ b/template/multi-platform-lua/proj.ios_mac/ios/RootViewController.mm @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -71,8 +71,11 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + + cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView(); - CGSize s = CGSizeMake([[CCEAGLView sharedEGLView] getWidth], [[CCEAGLView sharedEGLView] getHeight]); + CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); } From e0e37424f0769914b4bb400dfc0f08ae6262877b Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 7 Feb 2014 21:08:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[Travis-CI]=20Removes=20openmw=20ppa=20sinc?= =?UTF-8?q?e=20we=E2=80=99re=20using=20glfw3=20rather=20than=20sdl2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/travis-scripts/before-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/travis-scripts/before-install.sh b/tools/travis-scripts/before-install.sh index eb29f0fc5d..d8eeb09ebe 100755 --- a/tools/travis-scripts/before-install.sh +++ b/tools/travis-scripts/before-install.sh @@ -50,8 +50,6 @@ if [ "$GEN_JSB"x = "YES"x ]; then install_android_ndk elif [ "$PLATFORM"x = "linux"x ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - # OpenMW team provides SDL2 package. - sudo apt-add-repository -y ppa:openmw/build sudo apt-get update sudo apt-get install gcc-4.7 g++-4.7 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6