From 8d928e60c83caa362c6e7ff816d7ce960647e05a Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Wed, 1 Jul 2015 17:23:34 +0800 Subject: [PATCH 01/15] Update the version displayed in simulator about dialog. --- tools/simulator/frameworks/runtime-src/proj.win32/game.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/simulator/frameworks/runtime-src/proj.win32/game.rc b/tools/simulator/frameworks/runtime-src/proj.win32/game.rc index dada0181c8..ee1ca41456 100755 --- a/tools/simulator/frameworks/runtime-src/proj.win32/game.rc +++ b/tools/simulator/frameworks/runtime-src/proj.win32/game.rc @@ -64,7 +64,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM CAPTION "About Simulator" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CTEXT "Version 3.5beta0 (20150227)",IDC_ABOUT_VERSION,35,70,173,17 + CTEXT "Version 3.7 (20150227)",IDC_ABOUT_VERSION,35,70,173,17 CTEXT "Cocos Simulator",IDC_ABOUT_TITLE,35,49,173,17 CTEXT "Copyright (C) 2015. All rights reserved.",IDC_STATIC,35,94,173,17 ICON "GLFW_ICON",IDC_STATIC,111,15,20,20 From da5e077b55ceee07afdb92dfa8f9dedaa0ddf6d4 Mon Sep 17 00:00:00 2001 From: songchengjiang Date: Wed, 1 Jul 2015 18:06:17 +0800 Subject: [PATCH 02/15] texture set GL_CLAMP_TO_EDGE --- cocos/3d/CCTextureCube.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/3d/CCTextureCube.cpp b/cocos/3d/CCTextureCube.cpp index aadd0d7cda..a867e38266 100644 --- a/cocos/3d/CCTextureCube.cpp +++ b/cocos/3d/CCTextureCube.cpp @@ -231,6 +231,8 @@ bool TextureCube::init(const std::string& positive_x, const std::string& negativ glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); _name = handle; From 613fde65738cf9205ed6ffce11172cc24d855faf Mon Sep 17 00:00:00 2001 From: pandamicro Date: Thu, 2 Jul 2015 11:48:13 +0800 Subject: [PATCH 03/15] Fix video player and web view in js template --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 3cf4e2573f..b5cd6da582 100644 --- a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -27,7 +27,9 @@ #include "navmesh/jsb_cocos2dx_navmesh_manual.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#include "jsb_cocos2dx_experimental_video_auto.hpp" #include "experimental/jsb_cocos2dx_experimental_video_manual.h" +#include "jsb_cocos2dx_experimental_webView_auto.hpp" #include "experimental/jsb_cocos2dx_experimental_webView_manual.h" #endif @@ -129,7 +131,9 @@ bool AppDelegate::applicationDidFinishLaunching() #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + sc->addRegisterCallback(register_all_cocos2dx_experimental_video); sc->addRegisterCallback(register_all_cocos2dx_experimental_video_manual); + sc->addRegisterCallback(register_all_cocos2dx_experimental_webView); sc->addRegisterCallback(register_all_cocos2dx_experimental_webView_manual); #endif From a475caf35a920a6a33d082f51e66e4ef3f6a637e Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Thu, 2 Jul 2015 11:52:31 +0800 Subject: [PATCH 04/15] Fixed a bug that is LayoutComponent position error --- .../js-bindings/script/studio/parsers/timelineParser-2.x.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js index 3823be9903..403eb6c679 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js @@ -334,13 +334,13 @@ }; var setLayoutComponent = function(widget, json){ - + var layoutComponent = ccui.LayoutComponent.bindLayoutComponent(widget); if(!layoutComponent) return; - var positionXPercentEnabled = json["PositionPercentXEnable"] || false; - var positionYPercentEnabled = json["PositionPercentYEnable"] || false; + var positionXPercentEnabled = json["PositionPercentXEnable"] || json["PositionPercentXEnabled"] || false; + var positionYPercentEnabled = json["PositionPercentYEnable"] || json["PositionPercentYEnabled"] || false; var positionXPercent = 0, positionYPercent = 0, PrePosition = json["PrePosition"]; From e24975f0fe3df0f749022b792be7b8b4d92dd821 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 2 Jul 2015 13:43:52 +0800 Subject: [PATCH 05/15] Add python script for generate cocos simulator. --- .../bin/gen_cocos_simulator.py | 371 ++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100755 tools/framework-compile/bin/gen_cocos_simulator.py diff --git a/tools/framework-compile/bin/gen_cocos_simulator.py b/tools/framework-compile/bin/gen_cocos_simulator.py new file mode 100755 index 0000000000..d08b0cbb01 --- /dev/null +++ b/tools/framework-compile/bin/gen_cocos_simulator.py @@ -0,0 +1,371 @@ +#!/usr/bin/python +#-*- coding: UTF-8 -*- +# ---------------------------------------------------------------------------- +# Generate Cocos Simulator +# +# Copyright 2015 (C) zhangbin +# +# License: MIT +# ---------------------------------------------------------------------------- + +import os +import re +import shutil +import string + +import utils_cocos + +from custom_error import Logging, CustomError +from argparse import ArgumentParser + +class SimulatorCompiler(object): + SIMULATOR_PROJ_PATH = 'tools/simulator' + COCOS_CMD_PATH = 'tools/cocos2d-console/bin/cocos' + + DEFAULT_OUTPUT_FOLDER_NAME = 'simulator' + + SUPPORT_PLATFORMS = { + "win" : [ 'win32', 'android' ], + "mac" : [ 'ios', 'mac', 'android' ], + "other" : [ 'android' ] + } + + def __init__(self, args): + self.cur_dir = os.path.realpath(os.path.dirname(__file__)) + self.engine_root = os.path.abspath(os.path.join(self.cur_dir, os.pardir, os.pardir, os.pardir)) + self.simulator_abs_path = os.path.join(self.engine_root, SimulatorCompiler.SIMULATOR_PROJ_PATH) + self.cocos_bin = os.path.join(self.engine_root, SimulatorCompiler.COCOS_CMD_PATH) + + # get the full path of output dir. + if args.out_dir is None: + self.simulator_output_dir = os.path.join(self.engine_root, SimulatorCompiler.DEFAULT_OUTPUT_FOLDER_NAME) + else: + out_dir = os.path.expanduser(args.out_dir) + if os.path.isabs(out_dir): + self.simulator_output_dir = os.path.normpath(out_dir) + else: + self.simulator_output_dir = os.path.normpath(os.path.abspath(out_dir)) + + # get arguments + self.is_clean_before_build = args.do_clean + if args.compile_mode is None: + self.mode = 'debug' + else: + self.mode = args.compile_mode + self.platform = args.platform + self.build_log = "" + self.vs_version = args.vs_version + + def replace_keyword_with_content(self,content,old,new): + found_string = string.find(content,old) >= 0 + return found_string, string.replace(content,old,new) + + def get_content_from_file(self,file_path): + if not os.path.isfile(file_path): + raise Exception("Could not find (%s)" % (file_path)) + + with open(file_path) as f: + return f.read() + + def write_content_to_file(self,content, file_path): + if not os.path.isfile(file_path): + raise Exception("Could not find (%s)" % (file_path)) + + with open(file_path, 'w') as f: + f.write(content) + + def replace_keyword_with_file(self,file_path,keyword_map): + content = self.get_content_from_file(file_path) + + found = False + for k in keyword_map: + old, new = k, keyword_map[k] + has_found, content = self.replace_keyword_with_content(content, old, new) + if has_found : + found = has_found + + if found == True: + self.write_content_to_file(content,file_path) + + def get_keywords(self): + osx_keyword = { + "CC_TARGET_OS_IPHONE,":"CC_TARGET_OS_IPHONE,\n\"COCOS2D_DEBUG=1\",", + "CC_TARGET_OS_MAC,":"CC_TARGET_OS_MAC,\n\"COCOS2D_DEBUG=1\",", + "COCOS2D_DEBUG=0":"COCOS2D_DEBUG=1", + } + + win_keyword = { + "_WINDOWS":"_WINDOWS;COCOS2D_DEBUG=1", + } + + if utils_cocos.os_is_mac(): + return osx_keyword + if utils_cocos.os_is_win32(): + return win_keyword + + return {} + + def convert_path_to_python(self,path): + """ Convert path which include space to correct style which python can treat correctly. + + eg: on mac: convert '/usr/xxx/apache-ant\ 1.9.3' to '/usr/xxx/apache-ant 1.9.3' + eg: on windows: convert '"c:\apache-ant 1.9.3"\bin' to 'c:\apache-ant 1.9.3\bin' + """ + ret = path + if utils_cocos.os_is_mac(): + ret = path.replace("\ ", " ") + + if utils_cocos.os_is_win32(): + ret = ret.replace("\"", "") + + return ret + + def convert_path_to_win32(self,path): + return path.replace("/","\\") + + def get_depend_project_file_list(self): + file_list = [] + + if utils_cocos.os_is_mac(): + IOS_MAC_PROJECT_SUFFIX = "project.pbxproj" + IOS_MAC_PROJECT_REFERENCES_TAG = 'ProjectRef =' + IOS_MAC_PROJECT_NAME_RE = r'\w+.xcodeproj' + IOS_MAC_PROJECT_PATH_RE = r'name = %s; path = (.)*.xcodeproj' + + project_file_path = os.path.join(self.simulator_abs_path, + "frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj", + IOS_MAC_PROJECT_SUFFIX) + contents_str = self.get_content_from_file(project_file_path) + lines = re.split(r'\n', contents_str) + + simulator_mac_project_path = os.path.dirname(os.path.dirname(project_file_path)) + project_references = [] + for l in lines: + if IOS_MAC_PROJECT_REFERENCES_TAG in l: + ret = re.search(IOS_MAC_PROJECT_NAME_RE, l) + if ret: project_references.append(ret.group(0)) + + for references in project_references: + re_str = IOS_MAC_PROJECT_PATH_RE % references + ret = re.search(re_str, contents_str) + if ret: + match_str = ret.group(0) + match_str = match_str.replace("name = %s; path = " % references, "") + match_str = match_str.replace('"', "") + file_list.append(os.path.join(simulator_mac_project_path, match_str, IOS_MAC_PROJECT_SUFFIX)) + + elif utils_cocos.os_is_win32(): + WIN32_PROJECT_TAG = "Project(\"" + project_file_path = os.path.join(self.simulator_abs_path, "frameworks/runtime-src/proj.win32/simulator.sln") + simulator_win32_project_path = os.path.dirname(project_file_path) + + content_str = self.get_content_from_file(project_file_path) + lines = content_str.split('\n') + for l in lines: + if l.startswith(WIN32_PROJECT_TAG): + ret = re.compile('"(.*?)"').findall(l.split(',')[1]) + if ret: + path = self.convert_path_to_win32(os.path.join(simulator_win32_project_path, ret[0])) + file_list.append(path) + + return file_list + + def compile_for_osx(self): + if self.is_clean_before_build: + project_directory = os.path.join(self.simulator_abs_path, "frameworks/runtime-src/proj.ios_mac/") + + command = "xcodebuild -alltargets -configuration %s clean" % ("Debug" if self.mode == 'debug' else 'Release') + utils_cocos.execute_command(command, project_directory) + + command = ' '.join([ + "mkdir -p %s" % (os.path.join(self.simulator_abs_path, "src")), + " && %s compile -p mac -m %s -o \"%s\" --no-res" % (self.cocos_bin + , "debug" if self.mode == 'debug' else "release" + , os.path.join(self.simulator_output_dir,"mac")), + " && strip %s" % (os.path.join(self.simulator_output_dir,"mac","Simulator.app/Contents/MacOS/Simulator")), + ]) + + ret = utils_cocos.execute_command(command, self.simulator_abs_path) + self.build_log += "Build osx %s %s\n" % (self.mode, "success" if ret == 0 else "failed") + return ret + + def compile_for_ios(self): + if self.is_clean_before_build: + project_directory = os.path.join(self.simulator_abs_path, "frameworks/runtime-src/proj.ios_mac/") + + command = "xcodebuild -alltargets -configuration %s clean" % ("Debug" if self.mode =='debug' else 'Release') + utils_cocos.execute_command(command, project_directory) + + command = ' '.join([ + " %s compile -p ios -m %s -o \"%s\" --no-res" % (self.cocos_bin + , "debug" if self.mode == 'debug' else "release" + , os.path.join(self.simulator_output_dir,"ios")), + " && strip %s" % (os.path.join(self.simulator_output_dir,"ios","Simulator.app/Simulator")), + " && rm -fr %s" % (os.path.join(self.simulator_output_dir,"ios","Simulator.app.dSYM")), + ]) + + ret = utils_cocos.execute_command(command, self.simulator_abs_path) + self.build_log += "Build ios %s %s\n" % (self.mode, "success" if ret == 0 else "failed") + return ret + + def compile_for_win32(self): + win32_output_dir = os.path.join(self.simulator_output_dir, "win32") + win32_output_dir = self.convert_path_to_win32(win32_output_dir) + utils_cocos.mkdir(win32_output_dir) + + lang_file_path = os.path.join(self.simulator_abs_path,"frameworks/runtime-src/Classes/ide-support/lang") + lang_copy_command = "xcopy /Y %s %s" % (self.convert_path_to_win32(lang_file_path), win32_output_dir) + + # get the vs version should be used + if self.vs_version is None: + ver_param = '' + else: + ver_param = '--vs %d' % self.vs_version + + if self.mode == 'debug': + win32_src_dir = os.path.join(self.simulator_abs_path,"runtime/win32/") + win32_src_dir = self.convert_path_to_win32(win32_src_dir) + win32_dll_dir = self.convert_path_to_win32(os.path.join(os.path.dirname(self.cur_dir),"dll/")) + command = ' '.join([ + " %s compile -p win32 -m debug --no-res %s" % (self.cocos_bin, ver_param), + " && xcopy /Y %s*.dll %s" % (win32_src_dir, win32_output_dir), + " && xcopy /Y %s*.exe %s" % (win32_src_dir, win32_output_dir), + " && %s" % (lang_copy_command), + " && if exist %s*.dll xcopy /Y %s*.dll %s" % (win32_dll_dir,win32_dll_dir,win32_output_dir) + ]) + else: + command = ' '.join([ + " %s compile -p win32 -m release --no-res -o %s %s" % (self.cocos_bin,win32_output_dir,ver_param), + " && %s" % (lang_copy_command), + ]) + + ret = utils_cocos.execute_command(command, self.simulator_abs_path) + + self.build_log += "Build win32 %s %s\n" % (self.mode, "success" if ret == 0 else "failed") + return ret + + def compile_for_android(self): + rename_command = ' '.join([ + "mv %s %s" % (os.path.join(self.simulator_output_dir,"android","simulator-debug.apk"), + os.path.join(self.simulator_output_dir,"android","Simulator.apk")) + ]) + + command = ' '.join([ + " %s compile -p android --ndk-mode %s -o \"%s\" --no-res" % (self.cocos_bin + , "debug" if self.mode == 'debug' else "release" + , os.path.join(self.simulator_output_dir,"android")), + "&& %s" % (rename_command), + ]) + + ret = utils_cocos.execute_command(command, self.simulator_abs_path) + self.build_log += "Build android %s %s\n" % (self.mode, "success" if ret == 0 else "failed") + return ret + + def compile_all(self): + if utils_cocos.os_is_mac(): + self.compile_for_android() + self.compile_for_osx() + self.compile_for_ios() + elif utils_cocos.os_is_win32(): + self.compile_for_win32() + self.compile_for_android() + + def do_compile(self): + if self.platform == 'all': + self.compile_all() + return + + if utils_cocos.os_is_mac(): + support_platforms = SimulatorCompiler.SUPPORT_PLATFORMS['mac'] + elif utils_cocos.os_is_win32(): + support_platforms = SimulatorCompiler.SUPPORT_PLATFORMS['win'] + else: + support_platforms = SimulatorCompiler.SUPPORT_PLATFORMS['other'] + + if self.platform not in support_platforms: + raise CustomError('%s is not support in current system.' % self.platform, + CustomError.ERROR_WRONG_ARGS) + + if self.platform == 'win32': + self.compile_for_win32() + elif self.platform == 'android': + self.compile_for_android() + elif self.platform == 'ios': + self.compile_for_ios() + elif self.platform == 'mac': + self.compile_for_osx() + + def change_cocos2d_debug_macro_to_1(self, file_list): + keyword = self.get_keywords() + for file_path in file_list: + self.replace_keyword_with_file(file_path, keyword) + + def backup_files(self, files): + for f in files: + full_path = os.path.abspath(f) + if not os.path.isfile(full_path): + continue + + backup_file_path = '%s.bak' % full_path + shutil.copyfile(full_path, backup_file_path) + + def rollback_files(self, files): + for f in files: + full_path = os.path.abspath(f) + backup_file_path = '%s.bak' % full_path + if not os.path.isfile(backup_file_path): + continue + + try: + shutil.copyfile(backup_file_path, full_path) + os.remove(backup_file_path) + except: + print('Roll back file %s failed.' % full_path) + print('Please rename %s to %s manually.' % (backup_file_path, full_path)) + pass + + def run(self): + if self.is_clean_before_build: + utils_cocos.rmdir(self.simulator_output_dir) + + # backup some files + modify_files = self.get_depend_project_file_list() + self.backup_files(modify_files) + + try: + # modify project config files + self.change_cocos2d_debug_macro_to_1(modify_files) + + # compile simulator + self.do_compile() + except Exception as e: + raise e + finally: + # roll back modified files + self.rollback_files(modify_files) + Logging.info("") + Logging.info(self.build_log) + Logging.info("") + + return 0 + +if __name__ == '__main__': + parser = ArgumentParser(description="Generate Cocos Simulator.") + parser.add_argument('-c', '--clean', dest='do_clean', action='store_true', + help='Clean the output directory before generating. Will remove the output directory at first.') + parser.add_argument('-m', "--mode", dest='compile_mode', type=str, choices=['debug', 'release'], + help='Generate simulator for debug or release. Default is debug.') + parser.add_argument('-o', '--output', dest='out_dir', + help='Where to save Cocos Simulator. Default is the simulator folder in the root path of engine.') + parser.add_argument('-p', '--platform', dest='platform', required=True, + choices=['ios', 'mac', 'android', 'win32', 'all'], + help='Which platform will be generated for.') + parser.add_argument('--vs', dest='vs_version', type=int, + help='Specify the Visual Studio version will be used. Such as: 2013. Default find available version automatically.') + + (args, unknown) = parser.parse_known_args() + if len(unknown) > 0: + print("unknown arguments: %s" % unknown) + + compiler = SimulatorCompiler(args) + compiler.run() From 7818bfcc7a2a0c15604a5ce4ab88fb24a90a65c5 Mon Sep 17 00:00:00 2001 From: "Sijie.Wang" Date: Thu, 2 Jul 2015 14:30:44 +0800 Subject: [PATCH 06/15] Fixed a bug that is don't analytical frame --- cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js b/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js index 04823b531d..b4f4a89b32 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js @@ -204,6 +204,7 @@ if(!spriteFrame && plist){ if(cc.loader.getRes(resourcePath + plist)){ cc.spriteFrameCache.addSpriteFrames(resourcePath + plist); + spriteFrame = cc.spriteFrameCache.getSpriteFrame(path); }else{ cc.log("%s need to be preloaded", resourcePath + plist); } From 7ffb5edc2776c71f79edba195565ce5ddbad13de Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 2 Jul 2015 14:37:42 +0800 Subject: [PATCH 07/15] Update the bundle version when generating simulator. --- .../bin/gen_cocos_simulator.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tools/framework-compile/bin/gen_cocos_simulator.py b/tools/framework-compile/bin/gen_cocos_simulator.py index d08b0cbb01..08f0ce7e34 100755 --- a/tools/framework-compile/bin/gen_cocos_simulator.py +++ b/tools/framework-compile/bin/gen_cocos_simulator.py @@ -15,6 +15,7 @@ import string import utils_cocos +from datetime import date from custom_error import Logging, CustomError from argparse import ArgumentParser @@ -300,6 +301,32 @@ class SimulatorCompiler(object): for file_path in file_list: self.replace_keyword_with_file(file_path, keyword) + def update_bundle_version(self): + build_date = date.today().strftime("%Y%m%d") + + if utils_cocos.os_is_mac(): + # mac + info_plist_path = os.path.join(self.simulator_abs_path, "frameworks/runtime-src/proj.ios_mac/mac/Info.plist") + info_plist_content = self.get_content_from_file(info_plist_path) + + match = re.compile('CFBundleVersion(\s)*(.*?)').findall(info_plist_content) + if len(match): + build_date_tag = "%s" % match[0][1] + keyword_map = { build_date_tag : "%s" % build_date } + self.replace_keyword_with_file(info_plist_path, keyword_map) + + if utils_cocos.os_is_win32(): + # win32 + game_rc_path = os.path.join(self.simulator_abs_path,"frameworks/runtime-src/proj.win32/game.rc") + game_rc_content = self.get_content_from_file(game_rc_path) + match = re.compile('"Version[^\(]*\(.*\)"').findall(game_rc_content) + if len(match): + build_info_str = match[0] + m = re.match(r'"(Version[^\(]*)\(.*\)', build_info_str) + target_str = '"%s(%s)"' % (m.group(1), build_date) + keyword_map = { build_info_str : target_str} + self.replace_keyword_with_file(game_rc_path,keyword_map) + def backup_files(self, files): for f in files: full_path = os.path.abspath(f) @@ -330,9 +357,17 @@ class SimulatorCompiler(object): # backup some files modify_files = self.get_depend_project_file_list() + if utils_cocos.os_is_mac(): + modify_files.append(os.path.join(self.simulator_abs_path, 'frameworks/runtime-src/proj.ios_mac/mac/Info.plist')) + elif utils_cocos.os_is_win32(): + modify_files.append(os.path.join(self.simulator_abs_path, 'frameworks/runtime-src/proj.win32/game.rc')) + self.backup_files(modify_files) try: + # modify bundle version + self.update_bundle_version() + # modify project config files self.change_cocos2d_debug_macro_to_1(modify_files) From c713708e4d285ceb94bb559ec83b8accaa462749 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Thu, 2 Jul 2015 17:13:35 +0800 Subject: [PATCH 08/15] Not compile the scripts when generating simulator. --- tools/framework-compile/bin/gen_cocos_simulator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/framework-compile/bin/gen_cocos_simulator.py b/tools/framework-compile/bin/gen_cocos_simulator.py index 08f0ce7e34..3c7cac968b 100755 --- a/tools/framework-compile/bin/gen_cocos_simulator.py +++ b/tools/framework-compile/bin/gen_cocos_simulator.py @@ -180,7 +180,7 @@ class SimulatorCompiler(object): command = ' '.join([ "mkdir -p %s" % (os.path.join(self.simulator_abs_path, "src")), - " && %s compile -p mac -m %s -o \"%s\" --no-res" % (self.cocos_bin + " && %s compile -p mac -m %s -o \"%s\" --no-res --compile-script 0" % (self.cocos_bin , "debug" if self.mode == 'debug' else "release" , os.path.join(self.simulator_output_dir,"mac")), " && strip %s" % (os.path.join(self.simulator_output_dir,"mac","Simulator.app/Contents/MacOS/Simulator")), @@ -198,7 +198,7 @@ class SimulatorCompiler(object): utils_cocos.execute_command(command, project_directory) command = ' '.join([ - " %s compile -p ios -m %s -o \"%s\" --no-res" % (self.cocos_bin + " %s compile -p ios -m %s -o \"%s\" --no-res --compile-script 0" % (self.cocos_bin , "debug" if self.mode == 'debug' else "release" , os.path.join(self.simulator_output_dir,"ios")), " && strip %s" % (os.path.join(self.simulator_output_dir,"ios","Simulator.app/Simulator")), @@ -228,7 +228,7 @@ class SimulatorCompiler(object): win32_src_dir = self.convert_path_to_win32(win32_src_dir) win32_dll_dir = self.convert_path_to_win32(os.path.join(os.path.dirname(self.cur_dir),"dll/")) command = ' '.join([ - " %s compile -p win32 -m debug --no-res %s" % (self.cocos_bin, ver_param), + " %s compile -p win32 -m debug --no-res --compile-script 0 %s" % (self.cocos_bin, ver_param), " && xcopy /Y %s*.dll %s" % (win32_src_dir, win32_output_dir), " && xcopy /Y %s*.exe %s" % (win32_src_dir, win32_output_dir), " && %s" % (lang_copy_command), @@ -236,7 +236,7 @@ class SimulatorCompiler(object): ]) else: command = ' '.join([ - " %s compile -p win32 -m release --no-res -o %s %s" % (self.cocos_bin,win32_output_dir,ver_param), + " %s compile -p win32 -m release --no-res --compile-script 0 -o %s %s" % (self.cocos_bin,win32_output_dir,ver_param), " && %s" % (lang_copy_command), ]) @@ -252,7 +252,7 @@ class SimulatorCompiler(object): ]) command = ' '.join([ - " %s compile -p android --ndk-mode %s -o \"%s\" --no-res" % (self.cocos_bin + " %s compile -p android --ndk-mode %s -o \"%s\" --no-res --compile-script 0" % (self.cocos_bin , "debug" if self.mode == 'debug' else "release" , os.path.join(self.simulator_output_dir,"android")), "&& %s" % (rename_command), From e92896cf4c288400f52159f69b4b27f8192d54de Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 2 Jul 2015 22:09:33 +0800 Subject: [PATCH 09/15] add config.json to 69 --- external/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/config.json b/external/config.json index 8dd03ae8d7..594ffa0352 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version":"v3-deps-68", + "version":"v3-deps-69", "zip_file_size":"131253061", "repo_name":"cocos2d-x-3rd-party-libs-bin", "repo_parent":"https://github.com/cocos2d/", From 558e9c3d61db62db9cc8d33817fdfe30badfd207 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Fri, 3 Jul 2015 10:14:20 +0800 Subject: [PATCH 10/15] Solve the error when generating simulator on win32. --- tools/framework-compile/bin/gen_cocos_simulator.py | 2 +- tools/framework-compile/bin/utils_cocos.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/framework-compile/bin/gen_cocos_simulator.py b/tools/framework-compile/bin/gen_cocos_simulator.py index 3c7cac968b..974a1e9dee 100755 --- a/tools/framework-compile/bin/gen_cocos_simulator.py +++ b/tools/framework-compile/bin/gen_cocos_simulator.py @@ -240,7 +240,7 @@ class SimulatorCompiler(object): " && %s" % (lang_copy_command), ]) - ret = utils_cocos.execute_command(command, self.simulator_abs_path) + ret = utils_cocos.execute_command(command, self.simulator_abs_path, use_py_path=False) self.build_log += "Build win32 %s %s\n" % (self.mode, "success" if ret == 0 else "failed") return ret diff --git a/tools/framework-compile/bin/utils_cocos.py b/tools/framework-compile/bin/utils_cocos.py index 880b111b40..b40c8d1104 100755 --- a/tools/framework-compile/bin/utils_cocos.py +++ b/tools/framework-compile/bin/utils_cocos.py @@ -22,7 +22,7 @@ def os_is_mac(): def convert_to_python_path(path): return path.replace("\\","/") -def execute_command(cmdstring, cwd=None, timeout=None, shell=True): +def execute_command(cmdstring, cwd=None, timeout=None, shell=True, use_py_path=True): """ 执行一个SHELL命令 封装了subprocess的Popen方法, 支持超时判断,支持读取stdout和stderr 参数: @@ -38,7 +38,7 @@ def execute_command(cmdstring, cwd=None, timeout=None, shell=True): import subprocess import time - if os_is_win32(): + if os_is_win32() and use_py_path: cmdstring = convert_to_python_path(cmdstring) print("") From 155b9b918c5ff8ef7076842d240f526ab528dd8d Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 3 Jul 2015 11:01:43 +0800 Subject: [PATCH 11/15] Add retain/release for XMLHTTPReqest in JSB --- .../manual/network/XMLHTTPRequest.cpp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp index 8d215e1f2d..162ec181ef 100644 --- a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp +++ b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp @@ -943,6 +943,34 @@ void MinXmlHttpRequest::_notify(JSObject * callback) } } +bool js_MinXmlHttpRequest_retain(JSContext *cx, uint32_t argc, jsval *vp) +{ + JSObject *thisObj = JS_THIS_OBJECT(cx, vp); + if (thisObj) { + js_proxy_t *proxy = jsb_get_js_proxy(thisObj); + if (proxy) { + ((cocos2d::Ref *)proxy->ptr)->retain(); + return true; + } + } + JS_ReportError(cx, "Invalid Native Object."); + return false; +} + +bool js_MinXmlHttpRequest_release(JSContext *cx, uint32_t argc, jsval *vp) +{ + JSObject *thisObj = JS_THIS_OBJECT(cx, vp); + if (thisObj) { + js_proxy_t *proxy = jsb_get_js_proxy(thisObj); + if (proxy) { + ((cocos2d::Ref *)proxy->ptr)->release(); + return true; + } + } + JS_ReportError(cx, "Invalid Native Object."); + return false; +} + /** * @brief Register XMLHttpRequest to be usable in JS and add properties and Mehtods. * @param cx Global Spidermonkey JS Context. @@ -986,6 +1014,8 @@ void MinXmlHttpRequest::_js_register(JSContext *cx, JS::HandleObject global) JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getAllResponseHeaders), JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getResponseHeader), JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, overrideMimeType), + JS_FN("retain", js_MinXmlHttpRequest_retain, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("release", js_MinXmlHttpRequest_release, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; From f27b370b94d82bfd38873e33cbbd48f97f0aef27 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Fri, 3 Jul 2015 11:31:40 +0800 Subject: [PATCH 12/15] Add argument --ios to compile Mac & iOS platforms separately. --- tools/framework-compile/bin/gen_cocos_libs.py | 61 +++++++++++-------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/tools/framework-compile/bin/gen_cocos_libs.py b/tools/framework-compile/bin/gen_cocos_libs.py index eacb80612e..2546233117 100755 --- a/tools/framework-compile/bin/gen_cocos_libs.py +++ b/tools/framework-compile/bin/gen_cocos_libs.py @@ -45,6 +45,7 @@ class CocosLibsCompiler(object): self.clean = args.clean self.build_win = args.win self.build_mac = args.mac + self.build_ios = args.ios self.build_android = args.android self.disable_strip = args.disable_strip self.repo_x = args.repo_x @@ -53,6 +54,7 @@ class CocosLibsCompiler(object): if args.all: self.build_win = True self.build_mac = True + self.build_ios = True self.build_android = True if args.app_abi is None: @@ -87,7 +89,7 @@ class CocosLibsCompiler(object): self.clean_libs() if self.build_win: self.compile_win() - if self.build_mac: + if self.build_mac or self.build_ios: self.compile_mac_ios() if self.build_android: self.compile_android() @@ -229,36 +231,38 @@ class CocosLibsCompiler(object): xcode_proj_info = self.cfg_info[CocosLibsCompiler.KEY_XCODE_PROJS_INFO] XCODE_CMD_FMT = "xcodebuild -project \"%s\" -configuration Release -target \"%s\" %s CONFIGURATION_BUILD_DIR=%s" + ios_out_dir = os.path.join(self.lib_dir, "ios") + mac_out_dir = os.path.join(self.lib_dir, "mac") + ios_sim_libs_dir = os.path.join(ios_out_dir, "simulator") + ios_dev_libs_dir = os.path.join(ios_out_dir, "device") for key in xcode_proj_info.keys(): proj_path = os.path.join(self.repo_x, key) - ios_out_dir = os.path.join(self.lib_dir, "ios") - mac_out_dir = os.path.join(self.lib_dir, "mac") - ios_sim_libs_dir = os.path.join(ios_out_dir, "simulator") - ios_dev_libs_dir = os.path.join(ios_out_dir, "device") - target = xcode_proj_info[key][CocosLibsCompiler.KEY_XCODE_TARGETS] - # compile ios simulator - build_cmd = XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphonesimulator ARCHS=\"i386 x86_64\" VALID_ARCHS=\"i386 x86_64\"", ios_sim_libs_dir) - retVal = utils_cocos.execute_command(build_cmd) - if 0 != retVal: - print("[ERROR] compile ios simulator fail") - return retVal + if self.build_mac: + # compile mac + build_cmd = XCODE_CMD_FMT % (proj_path, "%s Mac" % target, "", mac_out_dir) + retVal = utils_cocos.execute_command(build_cmd) + if 0 != retVal: + print("[ERROR] compile mac fail") + return retVal - # compile ios device - build_cmd = XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphoneos", ios_dev_libs_dir) - retVal = utils_cocos.execute_command(build_cmd) - if 0 != retVal: - print("[ERROR] compile ios device fail") - return retVal + if self.build_ios: + # compile ios simulator + build_cmd = XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphonesimulator ARCHS=\"i386 x86_64\" VALID_ARCHS=\"i386 x86_64\"", ios_sim_libs_dir) + retVal = utils_cocos.execute_command(build_cmd) + if 0 != retVal: + print("[ERROR] compile ios simulator fail") + return retVal - # compile mac - build_cmd = XCODE_CMD_FMT % (proj_path, "%s Mac" % target, "", mac_out_dir) - retVal = utils_cocos.execute_command(build_cmd) - if 0 != retVal: - print("[ERROR] compile mac fail") - return retVal + # compile ios device + build_cmd = XCODE_CMD_FMT % (proj_path, "%s iOS" % target, "-sdk iphoneos", ios_dev_libs_dir) + retVal = utils_cocos.execute_command(build_cmd) + if 0 != retVal: + print("[ERROR] compile ios device fail") + return retVal + if self.build_ios: # generate fat libs for iOS for lib in os.listdir(ios_sim_libs_dir): sim_lib = os.path.join(ios_sim_libs_dir, lib) @@ -272,10 +276,12 @@ class CocosLibsCompiler(object): utils_cocos.rmdir(ios_sim_libs_dir) utils_cocos.rmdir(ios_dev_libs_dir) - if not self.disable_strip: - # strip the libs + if not self.disable_strip: + # strip the libs + if self.build_ios: ios_strip_cmd = "xcrun -sdk iphoneos strip -S %s/*.a" % ios_out_dir utils_cocos.execute_command(ios_strip_cmd) + if self.build_mac: mac_strip_cmd = "xcrun strip -S %s/*.a" % mac_out_dir utils_cocos.execute_command(mac_strip_cmd) @@ -378,7 +384,8 @@ if __name__ == "__main__": parser.add_argument('-c', dest='clean', action="store_true", help='clean libs folder') parser.add_argument('-all', dest='all', action="store_true", help='compile all platform') parser.add_argument('--win', dest='win', action="store_true", help='compile windows platform') - parser.add_argument('--mac', dest='mac', action="store_true", help='compile mac platform') + parser.add_argument('--mac', dest='mac', action="store_true", help='compile Mac platform') + parser.add_argument('--ios', dest='ios', action="store_true", help='compile iOS platform') parser.add_argument('--android', dest='android', action="store_true",help='complile android platform') parser.add_argument('--dis-strip', "--disable-strip", dest='disable_strip', action="store_true", help='Disable the strip of the generated libs.') parser.add_argument('--vs', dest='vs_version', type=int, help='visual studio version, such as 2013.', default=None) From 1f48beee1e4cce2ef60678a62b1126c751f9f086 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 3 Jul 2015 12:55:55 +0800 Subject: [PATCH 13/15] Reorganize code --- .../js-bindings/manual/cocos2d_specifics.hpp | 3 ++ .../jsb_cocos2dx_extension_manual.cpp | 37 ++----------------- .../manual/network/XMLHTTPRequest.cpp | 33 ++--------------- 3 files changed, 10 insertions(+), 63 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp index 2fc54b6583..fa8c6ff9e9 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp @@ -265,6 +265,9 @@ bool js_cocos2dx_Node_onExitTransitionDidStart(JSContext *cx, uint32_t argc, jsv bool js_cocos2dx_Component_onEnter(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Component_onExit(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_retain(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_release(JSContext *cx, uint32_t argc, jsval *vp); + void get_or_create_js_obj(JSContext* cx, JS::HandleObject obj, const std::string &name, JS::MutableHandleObject jsObj); #endif diff --git a/cocos/scripting/js-bindings/manual/extension/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/js-bindings/manual/extension/jsb_cocos2dx_extension_manual.cpp index 597701d0ba..4f72251f72 100644 --- a/cocos/scripting/js-bindings/manual/extension/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/js-bindings/manual/extension/jsb_cocos2dx_extension_manual.cpp @@ -879,35 +879,6 @@ bool js_cocos2dx_ext_AssetsManager_getFailedAssets(JSContext *cx, uint32_t argc, } */ -bool js_cocos2dx_ext_retain(JSContext *cx, uint32_t argc, jsval *vp) -{ - JSObject *thisObj = JS_THIS_OBJECT(cx, vp); - if (thisObj) { - js_proxy_t *proxy = jsb_get_js_proxy(thisObj); - if (proxy) { - ((Ref *)proxy->ptr)->retain(); - return true; - } - } - JS_ReportError(cx, "Invalid Native Object."); - return false; -} - -bool js_cocos2dx_ext_release(JSContext *cx, uint32_t argc, jsval *vp) -{ - JSObject *thisObj = JS_THIS_OBJECT(cx, vp); - if (thisObj) { - js_proxy_t *proxy = jsb_get_js_proxy(thisObj); - if (proxy) { - ((Ref *)proxy->ptr)->release(); - return true; - } - } - JS_ReportError(cx, "Invalid Native Object."); - return false; -} - - __JSDownloaderDelegator::__JSDownloaderDelegator(JSContext *cx, JS::HandleObject obj, const std::string &url, JS::HandleObject callback) : _cx(cx) , _url(url) @@ -1077,11 +1048,11 @@ void register_all_cocos2dx_extension_manual(JSContext* cx, JS::HandleObject glob get_or_create_js_obj(cx, global, "cc", &ccObj); JS::RootedObject am(cx, jsb_cocos2d_extension_AssetsManagerEx_prototype); - JS_DefineFunction(cx, am, "retain", js_cocos2dx_ext_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); - JS_DefineFunction(cx, am, "release", js_cocos2dx_ext_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, am, "retain", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, am, "release", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); JS::RootedObject manifest(cx, jsb_cocos2d_extension_Manifest_prototype); - JS_DefineFunction(cx, manifest, "retain", js_cocos2dx_ext_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); - JS_DefineFunction(cx, manifest, "release", js_cocos2dx_ext_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, manifest, "retain", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, manifest, "release", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); //JS_DefineFunction(cx, jsb_cocos2d_extension_AssetsManager_prototype, "updateAssets", js_cocos2dx_ext_AssetsManager_updateAssets, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT); //JS_DefineFunction(cx, jsb_cocos2d_extension_AssetsManager_prototype, "getFailedAssets", js_cocos2dx_ext_AssetsManager_getFailedAssets, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); diff --git a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp index 162ec181ef..402a318874 100644 --- a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp +++ b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp @@ -29,6 +29,7 @@ #include "XMLHTTPRequest.h" #include #include +#include "cocos2d_specifics.hpp" using namespace std; @@ -943,34 +944,6 @@ void MinXmlHttpRequest::_notify(JSObject * callback) } } -bool js_MinXmlHttpRequest_retain(JSContext *cx, uint32_t argc, jsval *vp) -{ - JSObject *thisObj = JS_THIS_OBJECT(cx, vp); - if (thisObj) { - js_proxy_t *proxy = jsb_get_js_proxy(thisObj); - if (proxy) { - ((cocos2d::Ref *)proxy->ptr)->retain(); - return true; - } - } - JS_ReportError(cx, "Invalid Native Object."); - return false; -} - -bool js_MinXmlHttpRequest_release(JSContext *cx, uint32_t argc, jsval *vp) -{ - JSObject *thisObj = JS_THIS_OBJECT(cx, vp); - if (thisObj) { - js_proxy_t *proxy = jsb_get_js_proxy(thisObj); - if (proxy) { - ((cocos2d::Ref *)proxy->ptr)->release(); - return true; - } - } - JS_ReportError(cx, "Invalid Native Object."); - return false; -} - /** * @brief Register XMLHttpRequest to be usable in JS and add properties and Mehtods. * @param cx Global Spidermonkey JS Context. @@ -1014,8 +987,8 @@ void MinXmlHttpRequest::_js_register(JSContext *cx, JS::HandleObject global) JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getAllResponseHeaders), JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getResponseHeader), JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, overrideMimeType), - JS_FN("retain", js_MinXmlHttpRequest_retain, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("release", js_MinXmlHttpRequest_release, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("retain", js_cocos2dx_retain, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("release", js_cocos2dx_release, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; From 6f3fc302e6c6e7eca8661d1a03973e1d05394319 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Sat, 4 Jul 2015 08:39:49 +0800 Subject: [PATCH 14/15] Fix web view and video player in simulator --- .../frameworks/runtime-src/Classes/js_module_register.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h b/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h index 866557a0ed..1eb7d05e35 100644 --- a/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h +++ b/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h @@ -28,7 +28,9 @@ #include "navmesh/jsb_cocos2dx_navmesh_manual.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#include "experimental/jsb_cocos2dx_experimental_video_auto.hpp" #include "experimental/jsb_cocos2dx_experimental_video_manual.h" +#include "experimental/jsb_cocos2dx_experimental_webView_auto.hpp" #include "experimental/jsb_cocos2dx_experimental_webView_manual.h" #endif @@ -97,7 +99,9 @@ int js_module_register() #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + sc->addRegisterCallback(register_all_cocos2dx_experimental_video); sc->addRegisterCallback(register_all_cocos2dx_experimental_video_manual); + sc->addRegisterCallback(register_all_cocos2dx_experimental_webView); sc->addRegisterCallback(register_all_cocos2dx_experimental_webView_manual); #endif From 0bcdf898bfb46eb46fbd5a9a2f67b4fb3ea77a56 Mon Sep 17 00:00:00 2001 From: Bin Zhang Date: Sat, 4 Jul 2015 10:17:40 +0800 Subject: [PATCH 15/15] Solve the error in simulator. --- .../runtime-src/Classes/js_module_register.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h b/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h index 1eb7d05e35..243552a155 100644 --- a/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h +++ b/tools/simulator/frameworks/runtime-src/Classes/js_module_register.h @@ -27,12 +27,12 @@ #include "jsb_cocos2dx_navmesh_auto.hpp" #include "navmesh/jsb_cocos2dx_navmesh_manual.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -#include "experimental/jsb_cocos2dx_experimental_video_auto.hpp" -#include "experimental/jsb_cocos2dx_experimental_video_manual.h" -#include "experimental/jsb_cocos2dx_experimental_webView_auto.hpp" -#include "experimental/jsb_cocos2dx_experimental_webView_manual.h" -#endif +// #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +// #include "experimental/jsb_cocos2dx_experimental_video_auto.hpp" +// #include "experimental/jsb_cocos2dx_experimental_video_manual.h" +// #include "experimental/jsb_cocos2dx_experimental_webView_auto.hpp" +// #include "experimental/jsb_cocos2dx_experimental_webView_manual.h" +// #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCJavascriptJavaBridge.h" @@ -98,12 +98,12 @@ int js_module_register() sc->addRegisterCallback(register_all_cocos2dx_navmesh_manual); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - sc->addRegisterCallback(register_all_cocos2dx_experimental_video); - sc->addRegisterCallback(register_all_cocos2dx_experimental_video_manual); - sc->addRegisterCallback(register_all_cocos2dx_experimental_webView); - sc->addRegisterCallback(register_all_cocos2dx_experimental_webView_manual); -#endif +// #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +// sc->addRegisterCallback(register_all_cocos2dx_experimental_video); +// sc->addRegisterCallback(register_all_cocos2dx_experimental_video_manual); +// sc->addRegisterCallback(register_all_cocos2dx_experimental_webView); +// sc->addRegisterCallback(register_all_cocos2dx_experimental_webView_manual); +// #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) sc->addRegisterCallback(JavascriptJavaBridge::_js_register);