Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_controller

Conflicts:
	build/cocos2d_tests.xcodeproj/project.pbxproj
	cocos/scripting/lua-bindings/Android.mk
	cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj
	tools/tolua/genbindings.py
This commit is contained in:
samuele3hu 2014-07-10 22:42:09 +08:00
commit caae8392d4
206 changed files with 1618 additions and 1664 deletions

View File

@ -1,7 +1,11 @@
cocos2d-x-3.2 ??
[FIX] Animation3D: getOrCreate is deprecated and replaced with Animation3D::create
[FIX] Animate3D: setSpeed() accept negtive value, which means play reverse, getPlayback and setPlayBack are deprecated
[FIX] GLView: cursor position is not correct if design resolution is different from device resolution
[FIX] Label: color can not be set correctly if using system font
[FIX] Lua-binding: support UIVideoPlayer
[FIX] Node: setRotation3D not work based on anchor point
[FIX] Node: modify regular of enumerateChildren, now it just searchs its children
[FIX] Setup.py: not work if using zsh
[FIX] SpriteBatchNode: opacity can not work
[FIX] Sprite3D: may crash on Android if playing animation and replace Scene after come from background

View File

@ -27,7 +27,6 @@
buildPhases = (
);
dependencies = (
15A1D3C8196BDC58009C3B59 /* PBXTargetDependency */,
1ADA8BAC18CF277C00AE24B9 /* PBXTargetDependency */,
1ADA8BAE18CF277C00AE24B9 /* PBXTargetDependency */,
1ADA8BB018CF277C00AE24B9 /* PBXTargetDependency */,
@ -59,39 +58,13 @@
1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; };
1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
15225DC1196BE61F0032C34F /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15A1D85D196BDF32009C3B59 /* AppController.mm */; };
15225DC2196BE61F0032C34F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15A1D86A196BDF32009C3B59 /* main.m */; };
15225DC3196BE61F0032C34F /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15A1D86C196BDF32009C3B59 /* RootViewController.mm */; };
15225DC4196BE64D0032C34F /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A1D3CE196BDF30009C3B59 /* AppDelegate.cpp */; };
15225DC6196BE77C0032C34F /* src in Resources */ = {isa = PBXBuildFile; fileRef = 15225DC5196BE77C0032C34F /* src */; };
15225DCD196BEEB40032C34F /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36818CD9E180087CE3A /* Cocos2d.lua */; };
15225DCE196BEEB40032C34F /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36918CD9E180087CE3A /* Cocos2dConstants.lua */; };
15225DCF196BEEB40032C34F /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA37018CD9E180087CE3A /* extern.lua */; };
15225DD2196BEF080032C34F /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36A18CD9E180087CE3A /* CocoStudio.lua */; };
15225DD4196BEFC30032C34F /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F01960FEFE00DE83F5 /* fonts */; };
15225DD5196BEFC30032C34F /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F11960FEFE00DE83F5 /* ipad */; };
15225DD6196BEFC30032C34F /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F21960FEFE00DE83F5 /* ipadhd */; };
15225DD7196BEFC30032C34F /* iphone in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F31960FEFE00DE83F5 /* iphone */; };
15225DDD196C47CB0032C34F /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E61773C1960FBD100DE83F5 /* GameController.framework */; };
15225DDE196C51A00032C34F /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36B18CD9E180087CE3A /* Deprecated.lua */; };
15225DDF196C51A00032C34F /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36C18CD9E180087CE3A /* DeprecatedClass.lua */; };
15225DE0196C51A00032C34F /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36D18CD9E180087CE3A /* DeprecatedEnum.lua */; };
15225DE1196C52180032C34F /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA37218CD9E180087CE3A /* json.lua */; };
15A1D388196BDBE9009C3B59 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3AF18CDA06D0087CE3A /* libz.dylib */; };
15A1D389196BDBE9009C3B59 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };
15A1D38A196BDBE9009C3B59 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A818CD9F130087CE3A /* AudioToolbox.framework */; };
15A1D38B196BDBE9009C3B59 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A618CD9F0D0087CE3A /* OpenAL.framework */; };
15A1D38C196BDBE9009C3B59 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A418CD9F060087CE3A /* QuartzCore.framework */; };
15A1D38D196BDBE9009C3B59 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A218CD9EFE0087CE3A /* CoreGraphics.framework */; };
15A1D38E196BDBE9009C3B59 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA3A018CD9EF60087CE3A /* OpenGLES.framework */; };
15A1D38F196BDBE9009C3B59 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39E18CD9EE50087CE3A /* UIKit.framework */; };
15A1D390196BDBE9009C3B59 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39C18CD9ED80087CE3A /* AVFoundation.framework */; };
15A1D391196BDBE9009C3B59 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };
15A1D392196BDBE9009C3B59 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };
15A1D393196BDBE9009C3B59 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };
15A1D394196BDBE9009C3B59 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };
15A1D395196BDBE9009C3B59 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };
15A1D396196BDBE9009C3B59 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28018CD90A50087CE3A /* libluabindings iOS.a */; };
15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; };
15AECE22195D122400907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; };
15AECE23195D122600907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; };
15AECE24195D122700907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; };
15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; };
15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };
15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };
@ -912,48 +885,6 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
15A1D379196BDBE9009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A07A4C241783777C0073F6A7;
remoteInfo = "cocos2dx iOS";
};
15A1D37B196BDBE9009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A07A4E111783867C0073F6A7;
remoteInfo = "cocos2dx-extensions iOS";
};
15A1D37D196BDBE9009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A07A4EFD178387670073F6A7;
remoteInfo = "chipmunk iOS";
};
15A1D37F196BDBE9009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = A07A4F9F178387730073F6A7;
remoteInfo = "CocosDenshion iOS";
};
15A1D381196BDBE9009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 1A119716178526AA00D62A44;
remoteInfo = "luabindings iOS";
};
15A1D3C7196BDC58009C3B59 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 15A1D377196BDBE9009C3B59;
remoteInfo = "lua-game-controller-test iOS";
};
1A0EE1C818CDF6DA004CD58F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;
@ -1387,30 +1318,7 @@
1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = "<group>"; };
1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = "<group>"; };
1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = "<group>"; };
15225DC5196BE77C0032C34F /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = "<group>"; };
15225DD8196BF0AF0032C34F /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = "<group>"; };
15225DF6196D3FFF0032C34F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
15225DF8196D401A0032C34F /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; };
15A1D3C3196BDBE9009C3B59 /* lua-game-controller-test iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-game-controller-test iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
15A1D3CE196BDF30009C3B59 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
15A1D3CF196BDF30009C3B59 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
15A1D85C196BDF32009C3B59 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
15A1D85D196BDF32009C3B59 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = "<group>"; };
15A1D85E196BDF32009C3B59 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
15A1D85F196BDF32009C3B59 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
15A1D860196BDF32009C3B59 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
15A1D861196BDF32009C3B59 /* HelloLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloLua_Prefix.pch; sourceTree = "<group>"; };
15A1D862196BDF32009C3B59 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = "<group>"; };
15A1D863196BDF32009C3B59 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-120.png"; sourceTree = "<group>"; };
15A1D864196BDF32009C3B59 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = "<group>"; };
15A1D865196BDF32009C3B59 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-152.png"; sourceTree = "<group>"; };
15A1D866196BDF32009C3B59 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = "<group>"; };
15A1D867196BDF32009C3B59 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
15A1D868196BDF32009C3B59 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-76.png"; sourceTree = "<group>"; };
15A1D869196BDF32009C3B59 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
15A1D86A196BDF32009C3B59 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
15A1D86B196BDF32009C3B59 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
15A1D86C196BDF32009C3B59 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = "<group>"; };
15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalConstants.lua; path = "../cocos/scripting/lua-bindings/script/experimentalConstants.lua"; sourceTree = "<group>"; };
15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
15C64824165F3934007D4F18 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; };
15C64826165F394E007D4F18 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
@ -2075,29 +1983,6 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
15A1D387196BDBE9009C3B59 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
15225DDD196C47CB0032C34F /* GameController.framework in Frameworks */,
15A1D388196BDBE9009C3B59 /* libz.dylib in Frameworks */,
15A1D389196BDBE9009C3B59 /* CoreMotion.framework in Frameworks */,
15A1D38A196BDBE9009C3B59 /* AudioToolbox.framework in Frameworks */,
15A1D38B196BDBE9009C3B59 /* OpenAL.framework in Frameworks */,
15A1D38C196BDBE9009C3B59 /* QuartzCore.framework in Frameworks */,
15A1D38D196BDBE9009C3B59 /* CoreGraphics.framework in Frameworks */,
15A1D38E196BDBE9009C3B59 /* OpenGLES.framework in Frameworks */,
15A1D38F196BDBE9009C3B59 /* UIKit.framework in Frameworks */,
15A1D390196BDBE9009C3B59 /* AVFoundation.framework in Frameworks */,
15A1D391196BDBE9009C3B59 /* Foundation.framework in Frameworks */,
15A1D392196BDBE9009C3B59 /* libchipmunk iOS.a in Frameworks */,
15A1D393196BDBE9009C3B59 /* libcocos2dx iOS.a in Frameworks */,
15A1D394196BDBE9009C3B59 /* libcocos2dx-extensions iOS.a in Frameworks */,
15A1D395196BDBE9009C3B59 /* libCocosDenshion iOS.a in Frameworks */,
15A1D396196BDBE9009C3B59 /* libluabindings iOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A0EE29F18CDF6DA004CD58F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -2164,6 +2049,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */,
1A0EE42C18CDF799004CD58F /* libz.dylib in Frameworks */,
1A0EE42D18CDF799004CD58F /* CoreMotion.framework in Frameworks */,
1A0EE42E18CDF799004CD58F /* AudioToolbox.framework in Frameworks */,
@ -2208,6 +2094,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */,
1ABCA3B018CDA06D0087CE3A /* libz.dylib in Frameworks */,
1ABCA3AA18CD9F1A0087CE3A /* CoreMotion.framework in Frameworks */,
1ABCA3A918CD9F130087CE3A /* AudioToolbox.framework in Frameworks */,
@ -2295,67 +2182,6 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
15A1D3CB196BDF30009C3B59 /* lua-game-controller-test */ = {
isa = PBXGroup;
children = (
15A1D3CC196BDF30009C3B59 /* project */,
15A1D8AB196BDF32009C3B59 /* res */,
15225DC5196BE77C0032C34F /* src */,
);
name = "lua-game-controller-test";
path = "../tests/lua-game-controller-test";
sourceTree = "<group>";
};
15A1D3CC196BDF30009C3B59 /* project */ = {
isa = PBXGroup;
children = (
15A1D3CD196BDF30009C3B59 /* Classes */,
15A1D85B196BDF32009C3B59 /* proj.ios */,
);
path = project;
sourceTree = "<group>";
};
15A1D3CD196BDF30009C3B59 /* Classes */ = {
isa = PBXGroup;
children = (
15225DD8196BF0AF0032C34F /* AppMacros.h */,
15A1D3CE196BDF30009C3B59 /* AppDelegate.cpp */,
15A1D3CF196BDF30009C3B59 /* AppDelegate.h */,
);
path = Classes;
sourceTree = "<group>";
};
15A1D85B196BDF32009C3B59 /* proj.ios */ = {
isa = PBXGroup;
children = (
15A1D85C196BDF32009C3B59 /* AppController.h */,
15A1D85D196BDF32009C3B59 /* AppController.mm */,
15A1D85E196BDF32009C3B59 /* Default-568h@2x.png */,
15A1D85F196BDF32009C3B59 /* Default.png */,
15A1D860196BDF32009C3B59 /* Default@2x.png */,
15A1D861196BDF32009C3B59 /* HelloLua_Prefix.pch */,
15A1D862196BDF32009C3B59 /* Icon-114.png */,
15A1D863196BDF32009C3B59 /* Icon-120.png */,
15A1D864196BDF32009C3B59 /* Icon-144.png */,
15A1D865196BDF32009C3B59 /* Icon-152.png */,
15A1D866196BDF32009C3B59 /* Icon-57.png */,
15A1D867196BDF32009C3B59 /* Icon-72.png */,
15A1D868196BDF32009C3B59 /* Icon-76.png */,
15A1D869196BDF32009C3B59 /* Info.plist */,
15A1D86A196BDF32009C3B59 /* main.m */,
15A1D86B196BDF32009C3B59 /* RootViewController.h */,
15A1D86C196BDF32009C3B59 /* RootViewController.mm */,
);
path = proj.ios;
sourceTree = "<group>";
};
15A1D8AB196BDF32009C3B59 /* res */ = {
isa = PBXGroup;
children = (
);
path = res;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
@ -2368,7 +2194,6 @@
1A0EE41318CDF775004CD58F /* cpp-empty-test iOS.app */,
1A0EE47E18CDF799004CD58F /* lua-empty-test iOS.app */,
3E6177311960FAED00DE83F5 /* game-controller-test IOS.app */,
15A1D3C3196BDBE9009C3B59 /* lua-game-controller-test iOS.app */,
);
name = Products;
sourceTree = "<group>";
@ -2395,6 +2220,7 @@
1ABCA36418CD9E060087CE3A /* Lua Common */ = {
isa = PBXGroup;
children = (
15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */,
1503FAA918DA8B6C00F6518C /* ftp.lua */,
1503FAAA18DA8B6C00F6518C /* headers.lua */,
1503FAAB18DA8B6C00F6518C /* http.lua */,
@ -3748,7 +3574,6 @@
1AC35E0318CEE78300F37B72 /* tests */ = {
isa = PBXGroup;
children = (
15A1D3CB196BDF30009C3B59 /* lua-game-controller-test */,
3E6176B51960FA6300DE83F5 /* game-controller-test */,
1AC358B618CEC19F00F37B72 /* cpp-empty-test */,
1AC3592118CECEFF00F37B72 /* cpp-tests */,
@ -4043,8 +3868,6 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
15225DF8196D401A0032C34F /* AudioToolbox.framework */,
15225DF6196D3FFF0032C34F /* QuartzCore.framework */,
3E61773C1960FBD100DE83F5 /* GameController.framework */,
3E61773A1960FBC300DE83F5 /* CFNetwork.framework */,
3E6177381960FBB800DE83F5 /* SystemConfiguration.framework */,
@ -4193,28 +4016,6 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
15A1D377196BDBE9009C3B59 /* lua-game-controller-test iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 15A1D3C0196BDBE9009C3B59 /* Build configuration list for PBXNativeTarget "lua-game-controller-test iOS" */;
buildPhases = (
15A1D382196BDBE9009C3B59 /* Sources */,
15A1D387196BDBE9009C3B59 /* Frameworks */,
15A1D397196BDBE9009C3B59 /* Resources */,
);
buildRules = (
);
dependencies = (
15A1D378196BDBE9009C3B59 /* PBXTargetDependency */,
15A1D37A196BDBE9009C3B59 /* PBXTargetDependency */,
15A1D37C196BDBE9009C3B59 /* PBXTargetDependency */,
15A1D37E196BDBE9009C3B59 /* PBXTargetDependency */,
15A1D380196BDBE9009C3B59 /* PBXTargetDependency */,
);
name = "lua-game-controller-test iOS";
productName = "Test lua iOS";
productReference = 15A1D3C3196BDBE9009C3B59 /* lua-game-controller-test iOS.app */;
productType = "com.apple.product-type.application";
};
1A0EE1C618CDF6DA004CD58F /* cpp-empty-test Mac */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1A0EE2AF18CDF6DA004CD58F /* Build configuration list for PBXNativeTarget "cpp-empty-test Mac" */;
@ -4453,7 +4254,6 @@
1ABCA2CC18CD93580087CE3A /* lua-tests iOS */,
1A0EE41918CDF799004CD58F /* lua-empty-test iOS */,
3E6176FF1960FAED00DE83F5 /* game-controller-test IOS */,
15A1D377196BDBE9009C3B59 /* lua-game-controller-test iOS */,
);
};
/* End PBXProject section */
@ -4546,26 +4346,6 @@
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
15A1D397196BDBE9009C3B59 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
15225DE1196C52180032C34F /* json.lua in Resources */,
15225DDE196C51A00032C34F /* Deprecated.lua in Resources */,
15225DDF196C51A00032C34F /* DeprecatedClass.lua in Resources */,
15225DE0196C51A00032C34F /* DeprecatedEnum.lua in Resources */,
15225DD4196BEFC30032C34F /* fonts in Resources */,
15225DD5196BEFC30032C34F /* ipad in Resources */,
15225DD6196BEFC30032C34F /* ipadhd in Resources */,
15225DD7196BEFC30032C34F /* iphone in Resources */,
15225DD2196BEF080032C34F /* CocoStudio.lua in Resources */,
15225DCD196BEEB40032C34F /* Cocos2d.lua in Resources */,
15225DCE196BEEB40032C34F /* Cocos2dConstants.lua in Resources */,
15225DCF196BEEB40032C34F /* extern.lua in Resources */,
15225DC6196BE77C0032C34F /* src in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A0EE1D118CDF6DA004CD58F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -4591,6 +4371,7 @@
1AC35D5D18CEDE9E00F37B72 /* MainMenu.xib in Resources */,
1503FABD18DA8B6C00F6518C /* mime.lua in Resources */,
1A0EE56F18CDFBBE004CD58F /* CCBReaderLoad.lua in Resources */,
15AECE23195D122600907DB0 /* experimentalConstants.lua in Resources */,
1A0EE57018CDFBBE004CD58F /* Cocos2d.lua in Resources */,
1A0EE57B18CDFBBE004CD58F /* luaj.lua in Resources */,
1A0EE57918CDFBBE004CD58F /* GuiConstants.lua in Resources */,
@ -4660,6 +4441,7 @@
1A0EE56018CDFBBD004CD58F /* CocoStudio.lua in Resources */,
1A0EE56318CDFBBD004CD58F /* DeprecatedEnum.lua in Resources */,
1503FAB818DA8B6C00F6518C /* http.lua in Resources */,
15AECE22195D122400907DB0 /* experimentalConstants.lua in Resources */,
1AC35D4B18CEDE9400F37B72 /* Icon-144.png in Resources */,
1503FAC618DA8B6C00F6518C /* url.lua in Resources */,
1AC35D4618CEDE9400F37B72 /* Default-568h@2x.png in Resources */,
@ -4704,6 +4486,7 @@
1AC35DBB18CEE65100F37B72 /* components in Resources */,
1AC35DE218CEE65900F37B72 /* effect2.ogg in Resources */,
1ABCA39A18CD9E180087CE3A /* StudioConstants.lua in Resources */,
15AECE24195D122700907DB0 /* experimentalConstants.lua in Resources */,
15C90B4318E66C1700D69802 /* mime.lua in Resources */,
1AC35DB118CEE5DA00F37B72 /* InfoPlist.strings in Resources */,
1AC35DDD18CEE65900F37B72 /* CocosBuilderExample.ccbproj in Resources */,
@ -4766,6 +4549,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */,
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */,
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */,
15C90B4418E66C1800D69802 /* mime.lua in Resources */,
@ -4782,6 +4566,7 @@
1AC35DD718CEE65200F37B72 /* Particles in Resources */,
1AC35D9D18CEE5D100F37B72 /* Icon-120.png in Resources */,
15C90B3E18E66BF200D69802 /* http.lua in Resources */,
15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */,
1AC35DA018CEE5D100F37B72 /* Icon-57.png in Resources */,
1ABCA37F18CD9E180087CE3A /* Cocos2dConstants.lua in Resources */,
1AC35DF118CEE65B00F37B72 /* fileLookup.plist in Resources */,
@ -4960,17 +4745,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
15A1D382196BDBE9009C3B59 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
15225DC4196BE64D0032C34F /* AppDelegate.cpp in Sources */,
15225DC1196BE61F0032C34F /* AppController.mm in Sources */,
15225DC2196BE61F0032C34F /* main.m in Sources */,
15225DC3196BE61F0032C34F /* RootViewController.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A0EE1F618CDF6DA004CD58F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -5415,36 +5189,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
15A1D378196BDBE9009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "cocos2dx iOS";
targetProxy = 15A1D379196BDBE9009C3B59 /* PBXContainerItemProxy */;
};
15A1D37A196BDBE9009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "cocos2dx-extensions iOS";
targetProxy = 15A1D37B196BDBE9009C3B59 /* PBXContainerItemProxy */;
};
15A1D37C196BDBE9009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "chipmunk iOS";
targetProxy = 15A1D37D196BDBE9009C3B59 /* PBXContainerItemProxy */;
};
15A1D37E196BDBE9009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CocosDenshion iOS";
targetProxy = 15A1D37F196BDBE9009C3B59 /* PBXContainerItemProxy */;
};
15A1D380196BDBE9009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "luabindings iOS";
targetProxy = 15A1D381196BDBE9009C3B59 /* PBXContainerItemProxy */;
};
15A1D3C8196BDC58009C3B59 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 15A1D377196BDBE9009C3B59 /* lua-game-controller-test iOS */;
targetProxy = 15A1D3C7196BDC58009C3B59 /* PBXContainerItemProxy */;
};
1A0EE1C718CDF6DA004CD58F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "cocos2dx Mac";
@ -5755,49 +5499,6 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
15A1D3C1196BDBE9009C3B59 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
CC_TARGET_OS_IPHONE,
);
INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-game-controller-test/project/proj.ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/cocos2d/MyWork/cocos2d-x-develop/tests/lua-game-controller-test/project/proj.android/obj/local/armeabi",
);
PRODUCT_NAME = "lua-game-controller-test iOS";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
};
name = Debug;
};
15A1D3C2196BDBE9009C3B59 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
CC_TARGET_OS_IPHONE,
);
INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-game-controller-test/project/proj.ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/cocos2d/MyWork/cocos2d-x-develop/tests/lua-game-controller-test/project/proj.android/obj/local/armeabi",
);
PRODUCT_NAME = "lua-game-controller-test iOS";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
1A0EE2B018CDF6DA004CD58F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -6191,15 +5892,6 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
15A1D3C0196BDBE9009C3B59 /* Build configuration list for PBXNativeTarget "lua-game-controller-test iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
15A1D3C1196BDBE9009C3B59 /* Debug */,
15A1D3C2196BDBE9009C3B59 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
1A0EE2AF18CDF6DA004CD58F /* Build configuration list for PBXNativeTarget "cpp-empty-test Mac" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -585,7 +585,7 @@ public:
virtual JumpTo* clone() const override;
virtual JumpTo* reverse(void) const override;
private:
CC_CONSTRUCTOR_ACCESS:
JumpTo() {}
virtual ~JumpTo() {}
CC_DISALLOW_COPY_AND_ASSIGN(JumpTo);
@ -750,7 +750,7 @@ public:
virtual ScaleBy* clone() const override;
virtual ScaleBy* reverse(void) const override;
protected:
CC_CONSTRUCTOR_ACCESS:
ScaleBy() {}
virtual ~ScaleBy() {}
@ -842,7 +842,7 @@ public:
void setReverseAction(FadeTo* ac);
protected:
CC_CONSTRUCTOR_ACCESS:
FadeIn():_reverseAction(nullptr) {}
virtual ~FadeIn() {}
@ -869,7 +869,7 @@ public:
void setReverseAction(FadeTo* ac);
protected:
CC_CONSTRUCTOR_ACCESS:
FadeOut():_reverseAction(nullptr) {}
virtual ~FadeOut() {}
private:
@ -961,7 +961,7 @@ public:
virtual DelayTime* reverse() const override;
virtual DelayTime* clone() const override;
protected:
CC_CONSTRUCTOR_ACCESS:
DelayTime() {}
virtual ~DelayTime() {}

View File

@ -884,7 +884,7 @@ LayerMultiplex * LayerMultiplex::create(Layer * layer, ...)
LayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer)
{
return LayerMultiplex::create(layer, NULL);
return LayerMultiplex::create(layer, nullptr);
}
LayerMultiplex* LayerMultiplex::create()

View File

@ -842,23 +842,13 @@ void Node::enumerateChildren(const std::string &name, std::function<bool (Node *
size_t subStrStartPos = 0; // sub string start index
size_t subStrlength = length; // sub string length
// Starts with '/' or '//'?
bool searchFromRoot = false;
bool searchFromRootRecursive = false;
if (name[0] == '/')
// Starts with '//'?
bool searchRecursively = false;
if (length > 2 && name[0] == '/' && name[1] == '/')
{
if (length > 2 && name[1] == '/')
{
searchFromRootRecursive = true;
subStrStartPos = 2;
subStrlength -= 2;
}
else
{
searchFromRoot = true;
subStrStartPos = 1;
subStrlength -= 1;
}
searchRecursively = true;
subStrStartPos = 2;
subStrlength -= 2;
}
// End with '/..'?
@ -872,7 +862,7 @@ void Node::enumerateChildren(const std::string &name, std::function<bool (Node *
subStrlength -= 3;
}
// Remove '/', '//', '/..' if exist
// Remove '//', '/..' if exist
std::string newName = name.substr(subStrStartPos, subStrlength);
if (searchFromParent)
@ -880,23 +870,11 @@ void Node::enumerateChildren(const std::string &name, std::function<bool (Node *
newName.insert(0, "[[:alnum:]]+/");
}
if (searchFromRoot)
{
// name is '/xxx'
auto root = getScene();
if (root)
{
root->doEnumerate(newName, callback);
}
}
else if (searchFromRootRecursive)
if (searchRecursively)
{
// name is '//xxx'
auto root = getScene();
if (root)
{
doEnumerateRecursive(root, newName, callback);
}
doEnumerateRecursive(this, newName, callback);
}
else
{

View File

@ -714,23 +714,19 @@ public:
virtual Node* getChildByName(const std::string& name) const;
/** Search the children of the receiving node to perform processing for nodes which share a name.
*
* @param name The name to search for, supports c++11 regular expression
* @param name The name to search for, supports c++11 regular expression.
* Search syntax options:
* `/` : When placed at the start of the search string, this indicates that the search should be performed on the tree's node.
* `//`: Can only be placed at the begin of the search string. This indicates that the search should be performed on the tree's node
* and be performed recursively across the entire node tree.
* `//`: Can only be placed at the begin of the search string. This indicates that it will search recursively.
* `..`: The search should move up to the node's parent. Can only be placed at the end of string
* `/` : When placed anywhere but the start of the search string, this indicates that the search should move to the node's children
* `/` : When placed anywhere but the start of the search string, this indicates that the search should move to the node's children.
*
* @code
* enumerateChildren("/MyName", ...): This searches the root's children and matches any node with the name `MyName`.
* enumerateChildren("//MyName", ...): This searches the root's children recursively and matches any node with the name `MyName`.
* enumerateChildren("//MyName", ...): This searches the children recursively and matches any node with the name `MyName`.
* enumerateChildren("[[:alnum:]]+", ...): This search string matches every node of its children.
* enumerateChildren("/MyName", ...): This searches the node tree and matches the parent node of every node named `MyName`.
* enumerateChildren("A[[:digit:]]", ...): This searches the node's children and returns any child named `A0`, `A1`, ..., `A9`
* enumerateChildren("Abby/Normal", ...): This searches the node's grandchildren and returns any node whose name is `Normal`
* and whose parent is named `Abby`.
* enumerateChildren("//Abby/Normal", ...): This searches the node tree and returns any node whose name is `Normal` and whose
* enumerateChildren("//Abby/Normal", ...): This searches recursively and returns any node whose name is `Normal` and whose
* parent is named `Abby`.
* @endcode
*

View File

@ -66,12 +66,12 @@ Animate3D* Animate3D::clone() const
auto animate = const_cast<Animate3D*>(this);
auto copy = Animate3D::create(animate->_animation);
copy->_speed = _speed;
copy->_absSpeed = _absSpeed;
copy->_weight = _weight;
copy->_elapsed = _elapsed;
copy->_start = _start;
copy->_last = _last;
copy->_playBack = _playBack;
copy->_playReverse = _playReverse;
copy->setDuration(animate->getDuration());
return copy;
@ -81,7 +81,7 @@ Animate3D* Animate3D::clone() const
Animate3D* Animate3D::reverse() const
{
auto animate = clone();
animate->_playBack = !animate->_playBack;
animate->_playReverse = !animate->_playReverse;
return animate;
}
@ -112,16 +112,16 @@ void Animate3D::startWithTarget(Node *target)
//! called every frame with it's delta time. DON'T override unless you know what you are doing.
void Animate3D::step(float dt)
{
ActionInterval::step(dt * _speed);
ActionInterval::step(dt * _absSpeed);
}
void Animate3D::update(float t)
{
if (_target)
if (_target && _weight > 0.f)
{
float transDst[3], rotDst[4], scaleDst[3];
float* trans = nullptr, *rot = nullptr, *scale = nullptr;
if (_playBack)
if (_playReverse)
t = 1 - t;
t = _start + t * _last;
@ -149,13 +149,29 @@ void Animate3D::update(float t)
}
float Animate3D::getSpeed() const
{
return _playReverse ? -_absSpeed : _absSpeed;
}
void Animate3D::setSpeed(float speed)
{
_absSpeed = fabsf(speed);
_playReverse = speed < 0;
}
void Animate3D::setWeight(float weight)
{
CCASSERT(weight >= 0.0f, "invalid weight");
_weight = fabsf(weight);
}
Animate3D::Animate3D()
: _speed(1)
: _absSpeed(1.f)
, _weight(1.f)
, _start(0.f)
, _last(1.f)
, _animation(nullptr)
, _playBack(false)
, _playReverse(false)
{
}

View File

@ -32,6 +32,7 @@
#include "base/ccMacros.h"
#include "base/CCRef.h"
#include "base/ccTypes.h"
#include "base/CCPlatformMacros.h"
#include "2d/CCActionInterval.h"
NS_CC_BEGIN
@ -66,17 +67,17 @@ public:
virtual void update(float t) override;
/**get & set speed */
float getSpeed() const { return _speed; }
void setSpeed(float speed) { _speed = speed; }
/**get & set speed, negative speed means playing reverse */
float getSpeed() const;
void setSpeed(float speed);
/**get & set blend weight*/
/**get & set blend weight, weight must positive*/
float getWeight() const { return _weight; }
void setWeight(float weight) { _weight = weight; }
void setWeight(float weight);
/**get & set play back*/
bool getPlayBack() const { return _playBack; }
void setPlayBack(bool playBack) { _playBack = playBack; }
/**get & set play reverse, these are deprecated, use set negative speed instead*/
CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; }
CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; }
CC_CONSTRUCTOR_ACCESS:
@ -86,11 +87,11 @@ CC_CONSTRUCTOR_ACCESS:
protected:
Animation3D* _animation; //animation data
float _speed; //playing speed
float _absSpeed; //playing speed
float _weight; //blend weight
float _start; //start time 0 - 1, used to generate sub Animate3D
float _last; //last time 0 - 1, used to generate sub Animate3D
bool _playBack; // is playing back
bool _playReverse; // is playing reverse
std::map<Bone*, Animation3D::Curve*> _boneCurves; //weak ref
};

View File

@ -30,7 +30,7 @@
NS_CC_BEGIN
Animation3D* Animation3D::getOrCreate(const std::string& fileName, const std::string& animationName)
Animation3D* Animation3D::create(const std::string& fileName, const std::string& animationName)
{
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName);
std::string key = fullPath + "#" + animationName;

View File

@ -59,8 +59,10 @@ public:
~Curve();
};
/**read all animation or only the animation with given animationName? animationName == "" read all.*/
static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = "");
/**read all animation or only the animation with given animationName? animationName == "" read the first.*/
static Animation3D* create(const std::string& filename, const std::string& animationName = "");
CC_DEPRECATED_ATTRIBUTE static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = ""){ return create(filename, animationName); }
/**get duration*/
float getDuration() const { return _duration; }

View File

@ -5,7 +5,7 @@ NS_CC_BEGIN
BundleReader::BundleReader()
{
m_buffer = NULL;
m_buffer = nullptr;
m_position = 0;
m_length = 0;
};
@ -123,7 +123,7 @@ bool BundleReader::seek(long int offset, int origin)
bool BundleReader::rewind()
{
if (m_buffer != NULL)
if (m_buffer != nullptr)
{
m_position = 0;
return true;

View File

@ -125,7 +125,7 @@ bool RenderMeshData::init(const std::vector<float>& positions,
return true;
}
bool RenderMeshData::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount)
bool RenderMeshData::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs)
{
_vertexs = vertices;
_indices = indices;
@ -174,10 +174,10 @@ Mesh* Mesh::create(const std::vector<float>& positions, const std::vector<float>
return nullptr;
}
Mesh* Mesh::create(const std::vector<float> &vertices, int vertexSizeInFloat, const std::vector<unsigned short> &indices, int numIndex, const std::vector<MeshVertexAttrib> &attribs, int attribCount)
Mesh* Mesh::create(const std::vector<float> &vertices, int vertexSizeInFloat, const std::vector<unsigned short> &indices, const std::vector<MeshVertexAttrib> &attribs)
{
auto mesh = new Mesh();
if (mesh && mesh->init(vertices, vertexSizeInFloat, indices, numIndex, attribs, attribCount))
if (mesh && mesh->init(vertices, vertexSizeInFloat, indices, attribs))
{
mesh->autorelease();
return mesh;
@ -196,9 +196,9 @@ bool Mesh::init(const std::vector<float>& positions, const std::vector<float>& n
return true;
}
bool Mesh::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount)
bool Mesh::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs)
{
bool bRet = _renderdata.init(vertices, vertexSizeInFloat, indices, numIndex, attribs, attribCount);
bool bRet = _renderdata.init(vertices, vertexSizeInFloat, indices, attribs);
if (!bRet)
return false;

View File

@ -49,7 +49,7 @@ public:
}
bool hasVertexAttrib(int attrib);
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
protected:
@ -90,7 +90,10 @@ public:
static Mesh* create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
/**create mesh with vertex attributes*/
static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount);
CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount) { return create(vertices, vertexSizeInFloat, indices, attribs); }
/**create mesh with vertex attributes*/
static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
/**get vertex buffer*/
inline GLuint getVertexBuffer() const { return _vertexBuffer; }
@ -124,7 +127,7 @@ CC_CONSTRUCTOR_ACCESS:
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
/**init mesh*/
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
/**build buffer*/
void buildBuffer();

View File

@ -193,7 +193,7 @@ bool Sprite3D::loadFromC3x(const std::string& path)
return false;
}
_mesh = Mesh::create(meshdata.vertex, meshdata.vertexSizeInFloat, meshdata.indices, meshdata.numIndex, meshdata.attribs, meshdata.attribCount);
_mesh = Mesh::create(meshdata.vertex, meshdata.vertexSizeInFloat, meshdata.indices, meshdata.attribs);
CC_SAFE_RETAIN(_mesh);
_skin = MeshSkin::create(fullPath, "");
@ -342,7 +342,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
_meshCommand.setDepthTestEnabled(true);
if (_skin)
{
_meshCommand.setMatrixPaletteSize(_skin->getMatrixPaletteSize());
_meshCommand.setMatrixPaletteSize((int)_skin->getMatrixPaletteSize());
_meshCommand.setMatrixPalette(_skin->getMatrixPalette());
}
//support tint and fade

View File

@ -222,7 +222,7 @@ static void _log(const char *format, va_list args)
WCHAR wszBuf[MAX_LOG_LENGTH] = {0};
MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf));
OutputDebugStringW(wszBuf);
WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, buf, sizeof(buf), NULL, FALSE);
WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, buf, sizeof(buf), nullptr, FALSE);
printf("%s", buf);
fflush(stdout);
#else
@ -337,7 +337,7 @@ bool Console::listenOnTCP(int port)
#endif
#endif
if ( (n = getaddrinfo(NULL, serv, &hints, &res)) != 0) {
if ( (n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) {
fprintf(stderr,"net_listen error for %s: %s", serv, gai_strerror(n));
return false;
}
@ -359,9 +359,9 @@ bool Console::listenOnTCP(int port)
#else
close(listenfd);
#endif
} while ( (res = res->ai_next) != NULL);
} while ( (res = res->ai_next) != nullptr);
if (res == NULL) {
if (res == nullptr) {
perror("net_listen:");
freeaddrinfo(ressave);
return false;
@ -372,14 +372,14 @@ bool Console::listenOnTCP(int port)
if (res->ai_family == AF_INET) {
char buf[INET_ADDRSTRLEN] = "";
struct sockaddr_in *sin = (struct sockaddr_in*) res->ai_addr;
if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != NULL )
if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != nullptr )
cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin_port));
else
perror("inet_ntop");
} else if (res->ai_family == AF_INET6) {
char buf[INET6_ADDRSTRLEN] = "";
struct sockaddr_in6 *sin = (struct sockaddr_in6*) res->ai_addr;
if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != NULL )
if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != nullptr )
cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin6_port));
else
perror("inet_ntop");
@ -1042,7 +1042,7 @@ void Console::loop()
copy_set = _read_set;
timeout_copy = timeout;
int nready = select(_maxfd+1, &copy_set, NULL, NULL, &timeout_copy);
int nready = select(_maxfd+1, &copy_set, nullptr, nullptr, &timeout_copy);
if( nready == -1 )
{

View File

@ -613,7 +613,7 @@ void EventDispatcher::removeEventListener(EventListener* listener)
if (l->getAssociatedNode() != nullptr)
{
dissociateNodeAndEventListener(l->getAssociatedNode(), l);
l->setAssociatedNode(nullptr); // NULL out the node pointer so we don't have any dangling pointers to destroyed nodes.
l->setAssociatedNode(nullptr); // nullptr out the node pointer so we don't have any dangling pointers to destroyed nodes.
}
if (_inDispatch == 0)
@ -1276,7 +1276,7 @@ void EventDispatcher::removeEventListenersForListenerID(const EventListener::Lis
if (l->getAssociatedNode() != nullptr)
{
dissociateNodeAndEventListener(l->getAssociatedNode(), l);
l->setAssociatedNode(nullptr); // NULL out the node pointer so we don't have any dangling pointers to destroyed nodes.
l->setAssociatedNode(nullptr); // nullptr out the node pointer so we don't have any dangling pointers to destroyed nodes.
}
if (_inDispatch == 0)

View File

@ -65,7 +65,7 @@ Ref::~Ref()
else
{
ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine();
if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript)
if (pEngine != nullptr && pEngine->getScriptType() == kScriptTypeJavascript)
{
pEngine->removeScriptObjectByObject(this);
}

View File

@ -173,7 +173,7 @@ public:
/**
* @js NA
*/
const static std::string& getXMLFilePath();
static const std::string& getXMLFilePath();
/**
* @js NA
*/

View File

@ -181,7 +181,7 @@ void tgaFlipImage( tImageTGA *info )
unsigned char *row = (unsigned char *)malloc(rowbytes);
int y;
if (row == NULL) return;
if (row == nullptr) return;
for( y = 0; y < (info->height/2); y++ )
{
@ -233,7 +233,7 @@ tImageTGA* tgaLoadBuffer(unsigned char* buffer, long size)
info->imageData = (unsigned char *)malloc(sizeof(unsigned char) * total);
// check to make sure we have the memory required
if (info->imageData == NULL)
if (info->imageData == nullptr)
{
info->status = TGA_ERROR_MEMORY;
break;

View File

@ -66,15 +66,15 @@ struct Color3B
GLubyte g;
GLubyte b;
const static Color3B WHITE;
const static Color3B YELLOW;
const static Color3B BLUE;
const static Color3B GREEN;
const static Color3B RED;
const static Color3B MAGENTA;
const static Color3B BLACK;
const static Color3B ORANGE;
const static Color3B GRAY;
static const Color3B WHITE;
static const Color3B YELLOW;
static const Color3B BLUE;
static const Color3B GREEN;
static const Color3B RED;
static const Color3B MAGENTA;
static const Color3B BLACK;
static const Color3B ORANGE;
static const Color3B GRAY;
};
/** RGBA color composed of 4 bytes
@ -99,15 +99,15 @@ struct Color4B
GLubyte b;
GLubyte a;
const static Color4B WHITE;
const static Color4B YELLOW;
const static Color4B BLUE;
const static Color4B GREEN;
const static Color4B RED;
const static Color4B MAGENTA;
const static Color4B BLACK;
const static Color4B ORANGE;
const static Color4B GRAY;
static const Color4B WHITE;
static const Color4B YELLOW;
static const Color4B BLUE;
static const Color4B GREEN;
static const Color4B RED;
static const Color4B MAGENTA;
static const Color4B BLACK;
static const Color4B ORANGE;
static const Color4B GRAY;
};
@ -138,15 +138,15 @@ struct Color4F
GLfloat b;
GLfloat a;
const static Color4F WHITE;
const static Color4F YELLOW;
const static Color4F BLUE;
const static Color4F GREEN;
const static Color4F RED;
const static Color4F MAGENTA;
const static Color4F BLACK;
const static Color4F ORANGE;
const static Color4F GRAY;
static const Color4F WHITE;
static const Color4F YELLOW;
static const Color4F BLUE;
static const Color4F GREEN;
static const Color4F RED;
static const Color4F MAGENTA;
static const Color4F BLACK;
static const Color4F ORANGE;
static const Color4F GRAY;
};
/** A vertex composed of 2 floats: x, y
@ -335,13 +335,13 @@ struct BlendFunc
GLenum dst;
//! Blending disabled. Uses {GL_ONE, GL_ZERO}
const static BlendFunc DISABLE;
static const BlendFunc DISABLE;
//! Blending enabled for textures with Alpha premultiplied. Uses {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}
const static BlendFunc ALPHA_PREMULTIPLIED;
static const BlendFunc ALPHA_PREMULTIPLIED;
//! Blending enabled for textures with Alpha NON premultiplied. Uses {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}
const static BlendFunc ALPHA_NON_PREMULTIPLIED;
static const BlendFunc ALPHA_NON_PREMULTIPLIED;
//! Enables Additive blending. Uses {GL_SRC_ALPHA, GL_ONE}
const static BlendFunc ADDITIVE;
static const BlendFunc ADDITIVE;
bool operator==(const BlendFunc &a) const
{

View File

@ -1020,7 +1020,7 @@ CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnableVertexAttribs(unsigned int
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2D(GLuint textureId) { GL::bindTexture2D(textureId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2DN(GLuint textureUnit, GLuint textureId) { GL::bindTexture2DN(textureUnit, textureId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTexture(GLuint textureId) { GL::deleteTexture(textureId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTextureN(textureUnit, textureId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTexture(textureId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindVAO(GLuint vaoId) { GL::bindVAO(vaoId); }
CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnable( int flags ) { /* ignore */ };
CC_DEPRECATED_ATTRIBUTE typedef int ccGLServerState;

View File

@ -97,7 +97,7 @@ unsigned int __Dictionary::count()
__Array* __Dictionary::allKeys()
{
int iKeyCount = this->count();
if (iKeyCount <= 0) return NULL;
if (iKeyCount <= 0) return nullptr;
__Array* array = __Array::createWithCapacity(iKeyCount);
@ -127,7 +127,7 @@ __Array* __Dictionary::allKeys()
__Array* __Dictionary::allKeysForObject(Ref* object)
{
int iKeyCount = this->count();
if (iKeyCount <= 0) return NULL;
if (iKeyCount <= 0) return nullptr;
__Array* array = __Array::create();
DictElement *pElement, *tmp;
@ -161,16 +161,16 @@ __Array* __Dictionary::allKeysForObject(Ref* object)
Ref* __Dictionary::objectForKey(const std::string& key)
{
// if dictionary wasn't initialized, return NULL directly.
if (_dictType == kDictUnknown) return NULL;
// if dictionary wasn't initialized, return nullptr directly.
if (_dictType == kDictUnknown) return nullptr;
// __Dictionary only supports one kind of key, string or integer.
// This method uses string as key, therefore we should make sure that the key type of this __Dictionary is string.
CCASSERT(_dictType == kDictStr, "this dictionary does not use string as key.");
Ref* pRetObject = NULL;
DictElement *pElement = NULL;
Ref* pRetObject = nullptr;
DictElement *pElement = nullptr;
HASH_FIND_STR(_elements, key.c_str(), pElement);
if (pElement != NULL)
if (pElement != nullptr)
{
pRetObject = pElement->_object;
}
@ -179,16 +179,16 @@ Ref* __Dictionary::objectForKey(const std::string& key)
Ref* __Dictionary::objectForKey(intptr_t key)
{
// if dictionary wasn't initialized, return NULL directly.
if (_dictType == kDictUnknown) return NULL;
// if dictionary wasn't initialized, return nullptr directly.
if (_dictType == kDictUnknown) return nullptr;
// __Dictionary only supports one kind of key, string or integer.
// This method uses integer as key, therefore we should make sure that the key type of this __Dictionary is integer.
CCASSERT(_dictType == kDictInt, "this dictionary does not use integer as key.");
Ref* pRetObject = NULL;
DictElement *pElement = NULL;
Ref* pRetObject = nullptr;
DictElement *pElement = nullptr;
HASH_FIND_PTR(_elements, &key, pElement);
if (pElement != NULL)
if (pElement != nullptr)
{
pRetObject = pElement->_object;
}
@ -198,7 +198,7 @@ Ref* __Dictionary::objectForKey(intptr_t key)
const __String* __Dictionary::valueForKey(const std::string& key)
{
__String* pStr = dynamic_cast<__String*>(objectForKey(key));
if (pStr == NULL)
if (pStr == nullptr)
{
pStr = __String::create("");
}
@ -208,7 +208,7 @@ const __String* __Dictionary::valueForKey(const std::string& key)
const __String* __Dictionary::valueForKey(intptr_t key)
{
__String* pStr = dynamic_cast<__String*>(objectForKey(key));
if (pStr == NULL)
if (pStr == nullptr)
{
pStr = __String::create("");
}
@ -217,7 +217,7 @@ const __String* __Dictionary::valueForKey(intptr_t key)
void __Dictionary::setObject(Ref* pObject, const std::string& key)
{
CCASSERT(key.length() > 0 && pObject != NULL, "Invalid Argument!");
CCASSERT(key.length() > 0 && pObject != nullptr, "Invalid Argument!");
if (_dictType == kDictUnknown)
{
_dictType = kDictStr;
@ -225,9 +225,9 @@ void __Dictionary::setObject(Ref* pObject, const std::string& key)
CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as key.");
DictElement *pElement = NULL;
DictElement *pElement = nullptr;
HASH_FIND_STR(_elements, key.c_str(), pElement);
if (pElement == NULL)
if (pElement == nullptr)
{
setObjectUnSafe(pObject, key);
}
@ -243,7 +243,7 @@ void __Dictionary::setObject(Ref* pObject, const std::string& key)
void __Dictionary::setObject(Ref* pObject, intptr_t key)
{
CCASSERT(pObject != NULL, "Invalid Argument!");
CCASSERT(pObject != nullptr, "Invalid Argument!");
if (_dictType == kDictUnknown)
{
_dictType = kDictInt;
@ -251,9 +251,9 @@ void __Dictionary::setObject(Ref* pObject, intptr_t key)
CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as key.");
DictElement *pElement = NULL;
DictElement *pElement = nullptr;
HASH_FIND_PTR(_elements, &key, pElement);
if (pElement == NULL)
if (pElement == nullptr)
{
setObjectUnSafe(pObject, key);
}
@ -277,7 +277,7 @@ void __Dictionary::removeObjectForKey(const std::string& key)
CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as its key");
CCASSERT(key.length() > 0, "Invalid Argument!");
DictElement *pElement = NULL;
DictElement *pElement = nullptr;
HASH_FIND_STR(_elements, key.c_str(), pElement);
removeObjectForElememt(pElement);
}
@ -290,7 +290,7 @@ void __Dictionary::removeObjectForKey(intptr_t key)
}
CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as its key");
DictElement *pElement = NULL;
DictElement *pElement = nullptr;
HASH_FIND_PTR(_elements, &key, pElement);
removeObjectForElememt(pElement);
}
@ -311,7 +311,7 @@ void __Dictionary::setObjectUnSafe(Ref* pObject, const intptr_t key)
void __Dictionary::removeObjectsForKeys(__Array* pKey__Array)
{
Ref* pObj = NULL;
Ref* pObj = nullptr;
CCARRAY_FOREACH(pKey__Array, pObj)
{
__String* pStr = static_cast<__String*>(pObj);
@ -321,7 +321,7 @@ void __Dictionary::removeObjectsForKeys(__Array* pKey__Array)
void __Dictionary::removeObjectForElememt(DictElement* pElement)
{
if (pElement != NULL)
if (pElement != nullptr)
{
HASH_DEL(_elements, pElement);
pElement->_object->release();
@ -345,7 +345,7 @@ Ref* __Dictionary::randomObject()
{
if (_dictType == kDictUnknown)
{
return NULL;
return nullptr;
}
Ref* key = allKeys()->getRandomObject();
@ -360,7 +360,7 @@ Ref* __Dictionary::randomObject()
}
else
{
return NULL;
return nullptr;
}
}
@ -566,9 +566,9 @@ __Dictionary* __Dictionary::clone() const
{
__Dictionary* newDict = __Dictionary::create();
DictElement* element = NULL;
Ref* tmpObj = NULL;
Clonable* obj = NULL;
DictElement* element = nullptr;
Ref* tmpObj = nullptr;
Clonable* obj = nullptr;
if (_dictType == kDictInt)
{
CCDICT_FOREACH(this, element)

View File

@ -66,7 +66,7 @@ __Set * __Set::create()
{
__Set * pRet = new __Set();
if (pRet != NULL)
if (pRet != nullptr)
{
pRet->autorelease();
}

View File

@ -69,7 +69,7 @@ bool __String::initWithFormatAndValist(const char* format, va_list ap)
{
bool bRet = false;
char* pBuf = (char*)malloc(kMaxStringLen);
if (pBuf != NULL)
if (pBuf != nullptr)
{
vsnprintf(pBuf, kMaxStringLen, format, ap);
_string = pBuf;
@ -170,7 +170,7 @@ void __String::appendWithFormat(const char* format, ...)
va_start(ap, format);
char* pBuf = (char*)malloc(kMaxStringLen);
if (pBuf != NULL)
if (pBuf != nullptr)
{
vsnprintf(pBuf, kMaxStringLen, format, ap);
_string.append(pBuf);
@ -207,7 +207,7 @@ bool __String::isEqual(const Ref* pObject)
{
bool bRet = false;
const __String* pStr = dynamic_cast<const __String*>(pObject);
if (pStr != NULL)
if (pStr != nullptr)
{
if (0 == _string.compare(pStr->_string))
{
@ -226,11 +226,11 @@ __String* __String::create(const std::string& str)
__String* __String::createWithData(const unsigned char* data, size_t nLen)
{
__String* ret = NULL;
if (data != NULL)
__String* ret = nullptr;
if (data != nullptr)
{
char* pStr = (char*)malloc(nLen+1);
if (pStr != NULL)
if (pStr != nullptr)
{
pStr[nLen] = '\0';
if (nLen > 0)

View File

@ -86,15 +86,15 @@ void ControlButtonLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, con
void ControlButtonLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_NORMAL) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::NORMAL);
}
} else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_HIGHLIGHTED) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::HIGH_LIGHTED);
}
} else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_DISABLED) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::DISABLED);
}
} else {

View File

@ -10,15 +10,15 @@ namespace cocosbuilder {
void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((MenuItemImage *)pNode)->setNormalSpriteFrame(pSpriteFrame);
}
} else if(strcmp(pPropertyName, PROPERTY_SELECTEDDISPLAYFRAME) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((MenuItemImage *)pNode)->setSelectedSpriteFrame(pSpriteFrame);
}
} else if(strcmp(pPropertyName, PROPERTY_DISABLEDDISPLAYFRAME) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((MenuItemImage *)pNode)->setDisabledSpriteFrame(pSpriteFrame);
}
} else {

View File

@ -9,7 +9,7 @@ namespace cocosbuilder {
void MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) {
if (NULL != pBlockData) // Add this condition to allow MenuItemImage without target/selector predefined
if (nullptr != pBlockData) // Add this condition to allow MenuItemImage without target/selector predefined
{
((MenuItem *)pNode)->setCallback( std::bind( pBlockData->mSELMenuHandler, pBlockData->_target, std::placeholders::_1) );
// ((MenuItem *)pNode)->setTarget(pBlockData->_target, pBlockData->mSELMenuHandler);

View File

@ -71,7 +71,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe
// #endif
// Forward properties for sub ccb files
if (dynamic_cast<CCBFile*>(pNode) != NULL)
if (dynamic_cast<CCBFile*>(pNode) != nullptr)
{
CCBFile *ccbNode = (CCBFile*)pNode;
if (ccbNode->getCCBFileNode() && isExtraProp)
@ -80,7 +80,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe
// Skip properties that doesn't have a value to override
__Array *extraPropsNames = (__Array*)pNode->getUserObject();
Ref* pObj = NULL;
Ref* pObj = nullptr;
bool bFound = false;
CCARRAY_FOREACH(extraPropsNames, pObj)
{
@ -346,7 +346,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe
case CCBReader::PropertyType::BLOCK_CONTROL:
{
BlockControlData * blockControlData = this->parsePropTypeBlockControl(pNode, pParent, ccbReader);
if(setProp && blockControlData != NULL) {
if(setProp && blockControlData != nullptr) {
this->onHandlePropTypeBlockControl(pNode, pParent, propertyName.c_str(), blockControlData, ccbReader);
}
CC_SAFE_DELETE(blockControlData);
@ -574,14 +574,14 @@ SpriteFrame * NodeLoader::parsePropTypeSpriteFrame(Node * pNode, Node * pParent,
std::string spriteSheet = ccbReader->readCachedString();
std::string spriteFile = ccbReader->readCachedString();
SpriteFrame *spriteFrame = NULL;
SpriteFrame *spriteFrame = nullptr;
if (spriteFile.length() != 0)
{
if (spriteSheet.length() == 0)
{
spriteFile = ccbReader->getCCBRootPath() + spriteFile;
Texture2D * texture = Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());
if(texture != NULL) {
if(texture != nullptr) {
Rect bounds = Rect(0, 0, texture->getContentSize().width, texture->getContentSize().height);
spriteFrame = SpriteFrame::createWithTexture(texture, bounds);
}
@ -613,7 +613,7 @@ Animation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCB
std::string animationFile = ccbReader->getCCBRootPath() + ccbReader->readCachedString();
std::string animation = ccbReader->readCachedString();
Animation * ccAnimation = NULL;
Animation * ccAnimation = nullptr;
// Support for stripping relative file paths, since ios doesn't currently
// know what to do with them, since its pulling from bundle.
@ -642,7 +642,7 @@ Texture2D * NodeLoader::parsePropTypeTexture(Node * pNode, Node * pParent, CCBRe
}
else
{
return NULL;
return nullptr;
}
}
@ -761,7 +761,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
if(selectorTarget != CCBReader::TargetType::NONE)
{
Ref* target = NULL;
Ref* target = nullptr;
if(!ccbReader->isJSControlled())
{
if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)
@ -773,7 +773,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
target = ccbReader->getOwner();
}
if(target != NULL)
if(target != nullptr)
{
if(selectorName.length() > 0)
{
@ -781,7 +781,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL)
if(targetAsCCBSelectorResolver != nullptr)
{
selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str());
}
@ -789,7 +789,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
if(selMenuHandler == 0)
{
CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL)
if(ccbSelectorResolver != nullptr)
{
selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str());
}
@ -809,7 +809,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
CCLOG("Unexpected empty selector.");
}
} else {
CCLOG("Unexpected NULL target for selector.");
CCLOG("Unexpected nullptr target for selector.");
}
}
else
@ -831,7 +831,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
}
}
return NULL;
return nullptr;
}
BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader)
@ -844,7 +844,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
{
if(!ccbReader->isJSControlled())
{
Ref* target = NULL;
Ref* target = nullptr;
if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)
{
target = ccbReader->getAnimationManager()->getRootNode();
@ -854,7 +854,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
target = ccbReader->getOwner();
}
if(target != NULL)
if(target != nullptr)
{
if(selectorName.length() > 0)
{
@ -862,7 +862,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL)
if(targetAsCCBSelectorResolver != nullptr)
{
selControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str());
}
@ -870,7 +870,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
if(selControlHandler == 0)
{
CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL)
if(ccbSelectorResolver != nullptr)
{
selControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str());
}
@ -894,7 +894,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
CCLOG("Unexpected empty selector.");
}
} else {
CCLOG("Unexpected NULL target for selector.");
CCLOG("Unexpected nullptr target for selector.");
}
}
else
@ -914,7 +914,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
}
}
return NULL;
return nullptr;
}
Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * pCCBReader) {
@ -960,7 +960,7 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader
reader->getAnimationManager()->runAnimationsForSequenceIdTweenDuration(reader->getAnimationManager()->getAutoPlaySequenceId(), 0);
}
if (reader->isJSControlled() && pCCBReader->isJSControlled() && NULL == reader->_owner)
if (reader->isJSControlled() && pCCBReader->isJSControlled() && nullptr == reader->_owner)
{
//set variables and callback to owner
//set callback

View File

@ -79,10 +79,10 @@ void NodeLoaderLibrary::purge(bool pReleaseNodeLoaders) {
static NodeLoaderLibrary * sSharedNodeLoaderLibrary = NULL;
static NodeLoaderLibrary * sSharedNodeLoaderLibrary = nullptr;
NodeLoaderLibrary * NodeLoaderLibrary::getInstance() {
if(sSharedNodeLoaderLibrary == NULL) {
if(sSharedNodeLoaderLibrary == nullptr) {
sSharedNodeLoaderLibrary = new NodeLoaderLibrary();
sSharedNodeLoaderLibrary->registerDefaultNodeLoaders();

View File

@ -12,10 +12,10 @@ namespace cocosbuilder {
void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {
if(pSpriteFrame != NULL) {
if(pSpriteFrame != nullptr) {
((Sprite *)pNode)->setSpriteFrame(pSpriteFrame);
} else {
CCLOG("ERROR: SpriteFrame NULL");
CCLOG("ERROR: SpriteFrame nullptr");
}
} else {
NodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader);

View File

@ -68,7 +68,7 @@ VisibleFrame* VisibleFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
VisibleFrame::VisibleFrame()
@ -104,7 +104,7 @@ TextureFrame* TextureFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
TextureFrame::TextureFrame()
@ -155,7 +155,7 @@ RotationFrame* RotationFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
RotationFrame::RotationFrame()
@ -204,7 +204,7 @@ SkewFrame* SkewFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
SkewFrame::SkewFrame()
@ -261,7 +261,7 @@ RotationSkewFrame* RotationSkewFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
RotationSkewFrame::RotationSkewFrame()
@ -314,7 +314,7 @@ PositionFrame* PositionFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
PositionFrame::PositionFrame()
@ -366,7 +366,7 @@ ScaleFrame* ScaleFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
ScaleFrame::ScaleFrame()
@ -421,7 +421,7 @@ AnchorPointFrame* AnchorPointFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
AnchorPointFrame::AnchorPointFrame()
@ -457,7 +457,7 @@ InnerActionFrame* InnerActionFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
InnerActionFrame::InnerActionFrame()
@ -493,7 +493,7 @@ ColorFrame* ColorFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
ColorFrame::ColorFrame()
@ -559,7 +559,7 @@ EventFrame* EventFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
EventFrame::EventFrame()
@ -594,7 +594,7 @@ ZOrderFrame* ZOrderFrame::create()
return frame;
}
CC_SAFE_DELETE(frame);
return NULL;
return nullptr;
}
ZOrderFrame::ZOrderFrame()
@ -605,7 +605,7 @@ ZOrderFrame::ZOrderFrame()
void ZOrderFrame::onEnter(Frame *nextFrame)
{
if(_node)
_node->setZOrder(_zorder);
_node->setLocalZOrder(_zorder);
}

View File

@ -284,9 +284,9 @@ void NodeReader::initNode(Node* node, const rapidjson::Value& json)
if (rotation != 0)
node->setRotation(rotation);
if(rotationSkewX != 0)
node->setRotationX(rotationSkewX);
node->setRotationSkewX(rotationSkewX);
if(rotationSkewY != 0)
node->setRotationY(rotationSkewY);
node->setRotationSkewY(rotationSkewY);
if(skewx != 0)
node->setSkewX(skewx);
if(skewy != 0)
@ -296,7 +296,7 @@ void NodeReader::initNode(Node* node, const rapidjson::Value& json)
if(width != 0 || height != 0)
node->setContentSize(Size(width, height));
if(zorder != 0)
node->setZOrder(zorder);
node->setLocalZOrder(zorder);
if(visible != true)
node->setVisible(visible);

View File

@ -104,7 +104,7 @@ void Timeline::insertFrame(Frame* frame, int index)
void Timeline::removeFrame(Frame* frame)
{
_frames.eraseObject(frame);
frame->setTimeline(NULL);
frame->setTimeline(nullptr);
}
void Timeline::setNode(Node* node)
@ -131,8 +131,8 @@ void Timeline::apply(int frameIndex)
void Timeline::binarySearchKeyFrame(int frameIndex)
{
Frame *from = NULL;
Frame *to = NULL;
Frame *from = nullptr;
Frame *to = nullptr;
long length = _frames.size();
bool needEnterFrame = false;

View File

@ -201,8 +201,8 @@ void Bone::update(float delta)
_worldInfo->y = _tweenData->y + _position.y;
_worldInfo->scaleX = _tweenData->scaleX * _scaleX;
_worldInfo->scaleY = _tweenData->scaleY * _scaleY;
_worldInfo->skewX = _tweenData->skewX + _skewX + _rotationX;
_worldInfo->skewY = _tweenData->skewY + _skewY - _rotationY;
_worldInfo->skewX = _tweenData->skewX + _skewX + _rotationZ_X;
_worldInfo->skewY = _tweenData->skewY + _skewY - _rotationZ_Y;
if(_parentBone)
{

View File

@ -1311,7 +1311,7 @@ void DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, Data
length = DICTOOL->getArrayCount_json(json, CONFIG_FILE_PATH); // json[CONFIG_FILE_PATH].IsNull() ? 0 : json[CONFIG_FILE_PATH].Size();
for (int i = 0; i < length; i++)
{
const char *path = DICTOOL->getStringValueFromArray_json(json, CONFIG_FILE_PATH, i); // json[CONFIG_FILE_PATH][i].IsNull() ? NULL : json[CONFIG_FILE_PATH][i].GetString();
const char *path = DICTOOL->getStringValueFromArray_json(json, CONFIG_FILE_PATH, i); // json[CONFIG_FILE_PATH][i].IsNull() ? nullptr : json[CONFIG_FILE_PATH][i].GetString();
if (path == nullptr)
{
CCLOG("load CONFIG_FILE_PATH error.");
@ -2426,21 +2426,21 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
}
else if (key.compare(A_HEIGHT) == 0)
{
if(str != NULL)
if(str != nullptr)
{
textureData->height = atof(str);
}
}
else if (key.compare(A_PIVOT_X) == 0)
{
if(str != NULL)
if(str != nullptr)
{
textureData->pivotX = atof(str);
}
}
else if (key.compare(A_PIVOT_Y) == 0)
{
if(str != NULL)
if(str != nullptr)
{
textureData->pivotY = atof(str);
}

View File

@ -351,7 +351,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char *fileName)
const char* fileVersion = "";
ui::Widget* widget = nullptr;
if (pBuffer != NULL && nSize > 0)
if (pBuffer != nullptr && nSize > 0)
{
CocoLoader tCocoLoader;
if(true == tCocoLoader.ReadCocoBinBuff((char*)pBuffer))
@ -494,7 +494,7 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, c
if (widget->getContentSize().equals(Size::ZERO))
{
Layout* rootWidget = dynamic_cast<Layout*>(widget);
rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight));
rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight));
}
/* ********************** */
@ -608,7 +608,7 @@ void WidgetPropertiesReader0250::setPropsForWidgetFromJsonDictionary(Widget*widg
float w = DICTOOL->getFloatValue_json(options, "width");
float h = DICTOOL->getFloatValue_json(options, "height");
widget->setSize(Size(w, h));
widget->setContentSize(Size(w, h));
widget->setTag(DICTOOL->getIntValue_json(options, "tag"));
widget->setActionTag(DICTOOL->getIntValue_json(options, "actiontag"));
@ -707,7 +707,7 @@ void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widg
{
float swf = DICTOOL->getFloatValue_json(options, "scale9Width");
float shf = DICTOOL->getFloatValue_json(options, "scale9Height");
button->setSize(Size(swf, shf));
button->setContentSize(Size(swf, shf));
}
}
else
@ -823,7 +823,7 @@ void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*w
{
float swf = DICTOOL->getFloatValue_json(options, "scale9Width");
float shf = DICTOOL->getFloatValue_json(options, "scale9Height");
imageView->setSize(Size(swf, shf));
imageView->setContentSize(Size(swf, shf));
}
float cx = DICTOOL->getFloatValue_json(options, "capInsetsX");
@ -1016,7 +1016,7 @@ void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widg
{
slider->loadBarTexture(imageFileName_tp);
}
slider->setSize(Size(barLength, slider->getContentSize().height));
slider->setContentSize(Size(barLength, slider->getContentSize().height));
}
else
{
@ -1204,7 +1204,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c
if (widget->getContentSize().equals(Size::ZERO))
{
Layout* rootWidget = dynamic_cast<Layout*>(widget);
rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight));
rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight));
}
/* ********************** */
@ -1268,7 +1268,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c
if (widget->getContentSize().equals(Size::ZERO))
{
Layout* rootWidget = dynamic_cast<Layout*>(widget);
rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight));
rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight));
}
}
}
@ -1340,7 +1340,7 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, st
setPropsForAllWidgetFromBinary(reader, widget, cocoLoader, optionsNode);
// 2nd., custom widget parse with custom reader
//2nd. parse custom property
const char* customProperty = NULL;
const char* customProperty = nullptr;
stExpCocoNode *optionChildNode = optionsNode->GetChildArray(cocoLoader);
for (int k = 0; k < optionsNode->GetChildNum(); ++k) {
std::string key = optionChildNode[k].GetName(cocoLoader);

View File

@ -531,7 +531,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
else if (key == "zorder")
{
nZorder = atoi(value.c_str());
node->setZOrder(nZorder);
node->setLocalZOrder(nZorder);
}
else if(key == "scalex")
{

View File

@ -92,7 +92,7 @@ Type stExpCocoNode::GetType(CocoLoader* pCoco)
char* stExpCocoNode::GetName(CocoLoader* pCoco)
{
char* szName = NULL ;
char* szName = nullptr ;
if(m_ObjIndex >= 0)
{
stExpCocoObjectDesc* tpCocoObjectDesc = pCoco->GetCocoObjectDescArray();
@ -130,10 +130,19 @@ char* stExpCocoNode::GetName(CocoLoader* pCoco)
}
char* stExpCocoNode::GetValue(CocoLoader* pCoco)
{
return ( pCoco->GetMemoryAddr_String() + m_szValue );
}
char* stExpCocoNode::GetValue(CocoLoader* pCoco)
{
char* szValue = ( pCoco->GetMemoryAddr_String() + m_szValue );
if(GetType(pCoco) == kStringType )
{
if(szValue && 0==strcmp(szValue,"null"))
{
strcpy(szValue,"");
}
}
return szValue;
}
int stExpCocoNode::GetChildNum()
{
@ -147,9 +156,9 @@ stExpCocoNode* stExpCocoNode::GetChildArray(CocoLoader* pCoco)
CocoLoader::CocoLoader()
{
m_pRootNode = NULL;
m_pObjectDescArray = NULL;
m_pMemoryBuff = NULL;
m_pRootNode = nullptr;
m_pObjectDescArray = nullptr;
m_pMemoryBuff = nullptr;
}
CocoLoader::~CocoLoader()
@ -157,7 +166,7 @@ CocoLoader::~CocoLoader()
if(m_pMemoryBuff)
{
delete[] m_pMemoryBuff;
m_pMemoryBuff = NULL;
m_pMemoryBuff = nullptr;
}
}
@ -198,7 +207,7 @@ stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(const char* szObjDesc)
return &m_pObjectDescArray[i];
}
}
return NULL;
return nullptr;
}
stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(int vIndex)
@ -207,7 +216,7 @@ stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(int vIndex)
{
return &m_pObjectDescArray[vIndex];
}
return NULL;
return nullptr;
}
char* CocoLoader::GetMemoryAddr_AttribDesc()

View File

@ -115,7 +115,7 @@ void TriggerMng::parse(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCoc
#if CC_ENABLE_SCRIPT_BINDING
ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine();
bool useBindings = engine != NULL;
bool useBindings = engine != nullptr;
if (useBindings)
{
@ -234,7 +234,7 @@ bool TriggerMng::isEmpty(void) const
const char *str2 = pActionArray[i3].GetValue(pCocoLoader);
if (key2.compare("classname") == 0)
{
if (str2 != NULL)
if (str2 != nullptr)
{
action.AddMember("classname", str2, allocator);
}
@ -255,7 +255,7 @@ bool TriggerMng::isEmpty(void) const
const char *str3 = pDataItemArray[i5].GetValue(pCocoLoader);
if (key3.compare("key") == 0)
{
if (str3 != NULL)
if (str3 != nullptr)
{
dataitem.AddMember("key", str3, allocator);
}
@ -310,7 +310,7 @@ bool TriggerMng::isEmpty(void) const
const char *str4 = pConditionArray[i7].GetValue(pCocoLoader);
if (key4.compare("classname") == 0)
{
if (str4 != NULL)
if (str4 != nullptr)
{
cond.AddMember("classname", str4, allocator);
}
@ -331,7 +331,7 @@ bool TriggerMng::isEmpty(void) const
const char *str5 = pDataItemArray[i9].GetValue(pCocoLoader);
if (key5.compare("key") == 0)
{
if (str5 != NULL)
if (str5 != nullptr)
{
dataitem.AddMember("key", str5, allocator);
}
@ -380,7 +380,7 @@ bool TriggerMng::isEmpty(void) const
stExpCocoNode *pEventArray = pEventsArray->GetChildArray(pCocoLoader);
std::string key6 = pEventArray[0].GetName(pCocoLoader);
const char *str6 = pEventArray[0].GetValue(pCocoLoader);
if (key6.compare("id") == 0 && str6 != NULL)
if (key6.compare("id") == 0 && str6 != nullptr)
{
event.AddMember("id", atoi(str6), allocator);
eventsItem.PushBack(event, allocator);
@ -390,7 +390,7 @@ bool TriggerMng::isEmpty(void) const
}
else if (key1.compare("id") == 0)
{
if (str1 != NULL)
if (str1 != nullptr)
{
vElemItem.AddMember("id", atoi(str1), allocator);
}

View File

@ -253,7 +253,7 @@ void TriggerObj::serialize(const rapidjson::Value &val)
const char* str0 = pTriggerObjArray[i0].GetValue(pCocoLoader);
if (key.compare("id") == 0)
{
if (str0 != NULL)
if (str0 != nullptr)
{
_id = atoi(str0); //(unsigned int)(DICTOOL->getIntValue_json(val, "id"));
}
@ -292,7 +292,7 @@ void TriggerObj::serialize(const rapidjson::Value &val)
continue;
}
BaseTriggerAction *act = dynamic_cast<BaseTriggerAction*>(ObjectFactory::getInstance()->createObject(classname));
CCAssert(act != NULL, "class named classname can not implement!");
CCAssert(act != nullptr, "class named classname can not implement!");
act->serialize(pCocoLoader, &pActionArray[1]);
act->init();
_acts.pushBack(act);

View File

@ -152,7 +152,7 @@ namespace cocostudio
if (button->isScale9Enabled()) {
button->setCapInsets(Rect(capsx, capsy, capsWidth, capsHeight));
button->setSize(Size(scale9Width, scale9Height));
button->setContentSize(Size(scale9Width, scale9Height));
}
button->setTitleColor(Color3B(cri, cgi, cbi));
@ -203,7 +203,7 @@ namespace cocostudio
{
float swf = DICTOOL->getFloatValue_json(options, P_Scale9Width);
float shf = DICTOOL->getFloatValue_json(options, P_Scale9Height);
button->setSize(Size(swf, shf));
button->setContentSize(Size(swf, shf));
}
}
bool tt = DICTOOL->checkObjectExist_json(options, P_Text);

View File

@ -15,7 +15,7 @@ namespace cocostudio
static const char* P_BackGroundBoxDisabledData = "backGroundBoxDisabledData";
static const char* P_FrontCrossDisabledData = "frontCrossDisabledData";
static CheckBoxReader* instanceCheckBoxReader = NULL;
static CheckBoxReader* instanceCheckBoxReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(CheckBoxReader)

View File

@ -19,7 +19,7 @@ namespace cocostudio
static const char* P_Scale9Height = "scale9Height";
static ImageViewReader* instanceImageViewReader = NULL;
static ImageViewReader* instanceImageViewReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(ImageViewReader)
@ -128,7 +128,7 @@ namespace cocostudio
float swf = DICTOOL->getFloatValue_json(options, P_Scale9Width,80.0f);
float shf = DICTOOL->getFloatValue_json(options, P_Scale9Height,80.0f);
imageView->setSize(Size(swf, shf));
imageView->setContentSize(Size(swf, shf));
float cx = DICTOOL->getFloatValue_json(options, P_CapInsetsX);

View File

@ -34,7 +34,7 @@ namespace cocostudio
static const char* P_BackGroundImageData = "backGroundImageData";
static const char* P_LayoutType = "layoutType";
static LayoutReader* instanceLayoutReader = NULL;
static LayoutReader* instanceLayoutReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(LayoutReader)

View File

@ -12,7 +12,7 @@ namespace cocostudio
static const char* P_Direction = "direction";
static const char* P_ItemMargin = "itemMargin";
static ListViewReader* instanceListViewReader = NULL;
static ListViewReader* instanceListViewReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(ListViewReader)

View File

@ -19,7 +19,7 @@ namespace cocostudio
static const char* P_Direction = "direction";
static const char* P_Percent = "percent";
static LoadingBarReader* instanceLoadingBar = NULL;
static LoadingBarReader* instanceLoadingBar = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(LoadingBarReader)
@ -130,7 +130,7 @@ namespace cocostudio
float width = DICTOOL->getFloatValue_json(options, P_Width);
float height = DICTOOL->getFloatValue_json(options, P_Height);
loadingBar->setSize(Size(width, height));
loadingBar->setContentSize(Size(width, height));
/**/

View File

@ -18,7 +18,7 @@ namespace cocostudio
static const char* P_BallDisabledData = "ballDisabledData";
static const char* P_ProgressBarData = "progressBarData";
static SliderReader* instanceSliderReader = NULL;
static SliderReader* instanceSliderReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(SliderReader)
@ -123,7 +123,7 @@ namespace cocostudio
} //end of for loop
if (slider->isScale9Enabled()) {
slider->setSize(Size(barLength, slider->getContentSize().height));
slider->setContentSize(Size(barLength, slider->getContentSize().height));
}
slider->setPercent(percent);

View File

@ -15,7 +15,7 @@ namespace cocostudio
static const char* P_ItemHeight = "itemHeight";
static const char* P_StartCharMap = "startCharMap";
static TextAtlasReader* instanceTextAtalsReader = NULL;
static TextAtlasReader* instanceTextAtalsReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextAtlasReader)

View File

@ -12,7 +12,7 @@ namespace cocostudio
static const char* P_FileNameData = "fileNameData";
static const char* P_Text = "text";
static TextBMFontReader* instanceTextBMFontReader = NULL;
static TextBMFontReader* instanceTextBMFontReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextBMFontReader)

View File

@ -9,7 +9,7 @@ using namespace ui;
namespace cocostudio
{
static TextFieldReader* instanceTextFieldReader = NULL;
static TextFieldReader* instanceTextFieldReader = nullptr;
static const char* P_PlaceHolder = "placeHolder";
static const char* P_Text = "text";

View File

@ -18,7 +18,7 @@ namespace cocostudio
static const char* P_HAlignment = "hAlignment";
static const char* P_VAlignment = "vAlignment";
static TextReader* instanceTextReader = NULL;
static TextReader* instanceTextReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(TextReader)

View File

@ -59,7 +59,7 @@ namespace cocostudio
const char* P_Path = "path";
static WidgetReader* instanceWidgetReader = NULL;
static WidgetReader* instanceWidgetReader = nullptr;
IMPLEMENT_CLASS_WIDGET_READER_INFO(WidgetReader)
@ -139,7 +139,7 @@ namespace cocostudio
w = DICTOOL->getFloatValue_json(options, P_Width);
h = DICTOOL->getFloatValue_json(options, P_Height);
}
widget->setSize(Size(w, h));
widget->setContentSize(Size(w, h));
widget->setTag(DICTOOL->getIntValue_json(options, P_Tag));
widget->setActionTag(DICTOOL->getIntValue_json(options, P_ActionTag));
@ -259,7 +259,7 @@ namespace cocostudio
widget->setOpacity(_opacity);
//the setSize method will be conflict with scale9Width & scale9Height
if (!widget->isIgnoreContentAdaptWithSize()) {
widget->setSize(Size(_width, _height));
widget->setContentSize(Size(_width, _height));
}
widget->setPosition(_position);
widget->setAnchorPoint(_originalAnchorPoint);

View File

@ -174,7 +174,7 @@ namespace cocostudio
}else if(key == P_Visbile){ \
widget->setVisible(valueToBool(value)); \
}else if(key == P_ZOrder){ \
widget->setZOrder(valueToInt(value)); \
widget->setLocalZOrder(valueToInt(value)); \
}else if(key == P_LayoutParameter){ \
stExpCocoNode *layoutCocosNode = stChildArray[i].GetChildArray(cocoLoader); \
ui::LinearLayoutParameter *linearParameter = ui::LinearLayoutParameter::create(); \

View File

@ -156,7 +156,7 @@ void Mat4::createOrthographicOffCenter(float left, float right, float bottom, fl
void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition,
const Vec3& cameraUpVector, Mat4* dst)
{
createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, NULL, dst);
createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, nullptr, dst);
}
void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition,
@ -441,7 +441,7 @@ bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const
}
// Nothing left to do.
if (scale == NULL && rotation == NULL)
if (scale == nullptr && rotation == nullptr)
return true;
// Extract the scale.
@ -469,7 +469,7 @@ bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const
}
// Nothing left to do.
if (rotation == NULL)
if (rotation == nullptr)
return true;
// Scale too close to zero, can't decompose rotation.
@ -559,17 +559,17 @@ float Mat4::determinant() const
void Mat4::getScale(Vec3* scale) const
{
decompose(scale, NULL, NULL);
decompose(scale, nullptr, nullptr);
}
bool Mat4::getRotation(Quaternion* rotation) const
{
return decompose(NULL, rotation, NULL);
return decompose(nullptr, rotation, nullptr);
}
void Mat4::getTranslation(Vec3* translation) const
{
decompose(NULL, NULL, translation);
decompose(nullptr, nullptr, translation);
}
void Mat4::getUpVector(Vec3* dst) const

View File

@ -401,9 +401,9 @@ void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data)
s_data = payload;
SIOClient *c = NULL;
SIOClient *c = nullptr;
c = getClient(endpoint);
if (c == NULL) log("SIOClientImpl::onMessage client lookup returned NULL");
if (c == nullptr) log("SIOClientImpl::onMessage client lookup returned nullptr");
switch(control)
{
@ -671,7 +671,7 @@ SIOClient* SocketIO::connect(const std::string& uri, SocketIO::SIODelegate& dele
//check if already connected to endpoint, handle
c = socket->getClient(path);
if(c == NULL)
if(c == nullptr)
{
c = new SIOClient(host, port, path, socket, delegate);

View File

@ -445,7 +445,7 @@ void WebSocket::onSubThreadStarted()
_path.c_str(), _host.c_str(), _host.c_str(),
name.c_str(), -1);
if(NULL == _wsInstance) {
if(nullptr == _wsInstance) {
WsMessage* msg = new WsMessage();
msg->what = WS_MSG_TO_UITHREAD_ERROR;
_readyState = State::CLOSING;

View File

@ -703,9 +703,9 @@ static bool glew_dynamic_binding()
const char *gl_extensions = (const char*)glGetString(GL_EXTENSIONS);
// If the current opengl driver doesn't have framebuffers methods, check if an extension exists
if (glGenFramebuffers == NULL)
if (glGenFramebuffers == nullptr)
{
log("OpenGL: glGenFramebuffers is NULL, try to detect an extension");
log("OpenGL: glGenFramebuffers is nullptr, try to detect an extension");
if (strstr(gl_extensions, "ARB_framebuffer_object"))
{
log("OpenGL: ARB_framebuffer_object is supported");

View File

@ -55,7 +55,7 @@ Application::Application()
Application::~Application()
{
CC_ASSERT(this == sm_pSharedApplication);
sm_pSharedApplication = NULL;
sm_pSharedApplication = nullptr;
}
int Application::run()
@ -248,7 +248,7 @@ static void PVRFrameEnableControlWindow(bool bEnable)
KEY_ALL_ACCESS,
0,
&hKey,
NULL))
nullptr))
{
return;
}
@ -257,7 +257,7 @@ static void PVRFrameEnableControlWindow(bool bEnable)
const WCHAR* wszNewData = (bEnable) ? L"NO" : L"YES";
WCHAR wszOldData[256] = {0};
DWORD dwSize = sizeof(wszOldData);
LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, NULL, (LPBYTE)wszOldData, &dwSize);
LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, nullptr, (LPBYTE)wszOldData, &dwSize);
if (ERROR_FILE_NOT_FOUND == status // the key not exist
|| (ERROR_SUCCESS == status // or the hide_gui value is exist
&& 0 != wcscmp(wszNewData, wszOldData))) // but new data and old data not equal

View File

@ -35,12 +35,12 @@ NS_CC_BEGIN
void MessageBox(const char * pszMsg, const char * pszTitle)
{
MessageBoxA(NULL, pszMsg, pszTitle, MB_OK);
MessageBoxA(nullptr, pszMsg, pszTitle, MB_OK);
}
void LuaLog(const char *pszMsg)
{
int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0);
int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, nullptr, 0);
WCHAR* widebuff = new WCHAR[bufflen + 1];
memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1));
MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen);
@ -48,10 +48,10 @@ void LuaLog(const char *pszMsg)
OutputDebugStringW(widebuff);
OutputDebugStringA("\n");
bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL);
bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, nullptr, 0, nullptr, nullptr);
char* buff = new char[bufflen + 1];
memset(buff, 0, sizeof(char) * (bufflen + 1));
WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, nullptr, nullptr);
puts(buff);
delete[] widebuff;

View File

@ -37,10 +37,10 @@ int Device::getDPI()
static int dpi = -1;
if (dpi == -1)
{
HDC hScreenDC = GetDC( NULL );
HDC hScreenDC = GetDC( nullptr );
int PixelsX = GetDeviceCaps( hScreenDC, HORZRES );
int MMX = GetDeviceCaps( hScreenDC, HORZSIZE );
ReleaseDC( NULL, hScreenDC );
ReleaseDC( nullptr, hScreenDC );
dpi = 254.0f*PixelsX/MMX/10;
}
return dpi;
@ -55,7 +55,7 @@ void Device::setAccelerometerInterval(float interval)
class BitmapDC
{
public:
BitmapDC(HWND hWnd = NULL)
BitmapDC(HWND hWnd = nullptr)
: _DC(nullptr)
, _bmp(nullptr)
, _font((HFONT)GetStockObject(DEFAULT_GUI_FONT))
@ -79,7 +79,7 @@ public:
wchar_t * utf8ToUtf16(const std::string& str)
{
wchar_t * pwszBuffer = NULL;
wchar_t * pwszBuffer = nullptr;
do
{
if (str.empty())
@ -99,7 +99,7 @@ public:
}
bool setFont(const char * pFontName = NULL, int nSize = 0)
bool setFont(const char * pFontName = nullptr, int nSize = 0)
{
bool bRet = false;
do
@ -154,7 +154,7 @@ public:
SendMessage( _wnd, WM_FONTCHANGE, 0, 0);
}
delete [] pwszBuffer;
pwszBuffer = NULL;
pwszBuffer = nullptr;
}
}
@ -214,11 +214,11 @@ public:
if (_bmp)
{
DeleteObject(_bmp);
_bmp = NULL;
_bmp = nullptr;
}
if (nWidth > 0 && nHeight > 0)
{
_bmp = CreateBitmap(nWidth, nHeight, 1, 32, NULL);
_bmp = CreateBitmap(nWidth, nHeight, 1, 32, nullptr);
if (! _bmp)
{
return false;
@ -364,7 +364,7 @@ private:
RemoveFontResource(pwszBuffer);
SendMessage( _wnd, WM_FONTCHANGE, 0, 0);
delete [] pwszBuffer;
pwszBuffer = NULL;
pwszBuffer = nullptr;
}
_curFontPath.clear();
}
@ -404,7 +404,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
} bi = {0};
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
CC_BREAK_IF(! GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0,
NULL, (LPBITMAPINFO)&bi, DIB_RGB_COLORS));
nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS));
width = (short)size.cx;
height = (short)size.cy;
@ -416,7 +416,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
(LPBITMAPINFO)&bi, DIB_RGB_COLORS);
// change pixel's alpha value to 255, when it's RGB != 0
COLORREF * pPixel = NULL;
COLORREF * pPixel = nullptr;
for (int y = 0; y < height; ++y)
{
pPixel = (COLORREF *)dataBuf + y * width;

View File

@ -63,7 +63,7 @@ static void _checkPath()
GetCurrentDirectoryW(sizeof(utf16Path)-1, utf16Path);
char utf8Path[CC_MAX_PATH] = {0};
int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), NULL, NULL);
int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), nullptr, nullptr);
s_resourcePath = convertPathFormatToUnixStyle(utf8Path);
s_resourcePath.append("/");
@ -72,13 +72,13 @@ static void _checkPath()
FileUtils* FileUtils::getInstance()
{
if (s_sharedFileUtils == NULL)
if (s_sharedFileUtils == nullptr)
{
s_sharedFileUtils = new FileUtilsWin32();
if(!s_sharedFileUtils->init())
{
delete s_sharedFileUtils;
s_sharedFileUtils = NULL;
s_sharedFileUtils = nullptr;
CCLOG("ERROR: Could not init CCFileUtilsWin32");
}
}
@ -147,10 +147,10 @@ static Data getData(const std::string& filename, bool forString)
WCHAR wszBuf[CC_MAX_PATH] = {0};
MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0]));
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL);
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr);
CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);
size = ::GetFileSize(fileHandle, NULL);
size = ::GetFileSize(fileHandle, nullptr);
if (forString)
{
@ -163,7 +163,7 @@ static Data getData(const std::string& filename, bool forString)
}
DWORD sizeRead = 0;
BOOL successed = FALSE;
successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, NULL);
successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, nullptr);
::CloseHandle(fileHandle);
if (!successed)
@ -212,7 +212,7 @@ Data FileUtilsWin32::getDataFromFile(const std::string& filename)
unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const char* mode, ssize_t* size)
{
unsigned char * pBuffer = NULL;
unsigned char * pBuffer = nullptr;
*size = 0;
do
{
@ -222,15 +222,15 @@ unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const ch
WCHAR wszBuf[CC_MAX_PATH] = {0};
MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0]));
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL);
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr);
CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);
*size = ::GetFileSize(fileHandle, NULL);
*size = ::GetFileSize(fileHandle, nullptr);
pBuffer = (unsigned char*) malloc(*size);
DWORD sizeRead = 0;
BOOL successed = FALSE;
successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, NULL);
successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, nullptr);
::CloseHandle(fileHandle);
if (!successed)
@ -275,7 +275,7 @@ string FileUtilsWin32::getWritablePath() const
{
// Get full path of executable, e.g. c:\Program Files (x86)\My Game Folder\MyGame.exe
char full_path[CC_MAX_PATH + 1];
::GetModuleFileNameA(NULL, full_path, CC_MAX_PATH + 1);
::GetModuleFileNameA(nullptr, full_path, CC_MAX_PATH + 1);
// Debug app uses executable directory; Non-debug app uses local app data directory
#ifndef _DEBUG
@ -287,7 +287,7 @@ string FileUtilsWin32::getWritablePath() const
char app_data_path[CC_MAX_PATH + 1];
// Get local app data directory, e.g. C:\Documents and Settings\username\Local Settings\Application Data
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, app_data_path)))
if (SUCCEEDED(SHGetFolderPathA(nullptr, CSIDL_LOCAL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, app_data_path)))
{
string ret((char*)app_data_path);
@ -300,7 +300,7 @@ string FileUtilsWin32::getWritablePath() const
ret += "\\";
// Create directory
if (SUCCEEDED(SHCreateDirectoryExA(NULL, ret.c_str(), NULL)))
if (SUCCEEDED(SHCreateDirectoryExA(nullptr, ret.c_str(), nullptr)))
{
return convertPathFormatToUnixStyle(ret);
}

View File

@ -254,7 +254,7 @@ bool GLProgram::initWithPrecompiledProgramByteArray(const GLchar* vShaderByteArr
haveProgram = CCPrecompiledShaders::getInstance()->loadProgram(_program, vShaderByteArray, fShaderByteArray);
CHECK_GL_ERROR_DEBUG();
_hashForUniforms = NULL;
_hashForUniforms = nullptr;
CHECK_GL_ERROR_DEBUG();
@ -311,7 +311,7 @@ void GLProgram::parseVertexAttribs()
for(int i = 0; i < activeAttributes; ++i)
{
// Query attribute info.
glGetActiveAttrib(_program, i, length, NULL, &attribute.size, &attribute.type, attribName);
glGetActiveAttrib(_program, i, length, nullptr, &attribute.size, &attribute.type, attribName);
attribName[length] = '\0';
attribute.name = std::string(attribName);
@ -343,7 +343,7 @@ void GLProgram::parseUniforms()
for(int i = 0; i < activeUniforms; ++i)
{
// Query uniform info.
glGetActiveUniform(_program, i, length, NULL, &uniform.size, &uniform.type, uniformName);
glGetActiveUniform(_program, i, length, nullptr, &uniform.size, &uniform.type, uniformName);
uniformName[length] = '\0';
// Only add uniforms that are not built-in.

View File

@ -23,7 +23,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
manual/lua_cocos2dx_ui_manual.cpp \
manual/lua_cocos2dx_spine_manual.cpp \
manual/lua_cocos2dx_physics_manual.cpp \
manual/lua_cocos2dx_controller_manual.cpp \
manual/lua_cocos2dx_experimental_video_manual.cpp \
manual/lua_cocos2dx_deprecated.cpp \
manual/lua_xml_http_request.cpp \
manual/platform/android/CCLuaJavaBridge.cpp \
@ -36,7 +36,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
auto/lua_cocos2dx_ui_auto.cpp \
auto/lua_cocos2dx_spine_auto.cpp \
auto/lua_cocos2dx_physics_auto.cpp \
auto/lua_cocos2dx_controller_auto.cpp \
auto/lua_cocos2dx_experimental_video_auto.cpp \
../../../external/lua/tolua/tolua_event.c \
../../../external/lua/tolua/tolua_is.c \
../../../external/lua/tolua/tolua_map.c \
@ -70,7 +70,6 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../external/lua/tolua \
$(LOCAL_PATH)/../../ui \
$(LOCAL_PATH)/../../2d \
$(LOCAL_PATH)/../../3d \
$(LOCAL_PATH)/../../base \
$(LOCAL_PATH)/auto \
$(LOCAL_PATH)/manual \
$(LOCAL_PATH)/manual/platform/android \

View File

@ -5,9 +5,9 @@
-- @parent_module cc
--------------------------------
-- @function [parent=#Animate3D] getSpeed
-- @function [parent=#Animate3D] setSpeed
-- @param self
-- @return float#float ret (return value: float)
-- @param #float float
--------------------------------
-- @function [parent=#Animate3D] setWeight
@ -15,19 +15,9 @@
-- @param #float float
--------------------------------
-- @function [parent=#Animate3D] getPlayBack
-- @function [parent=#Animate3D] getSpeed
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#Animate3D] setPlayBack
-- @param self
-- @param #bool bool
--------------------------------
-- @function [parent=#Animate3D] setSpeed
-- @param self
-- @param #float float
-- @return float#float ret (return value: float)
--------------------------------
-- @function [parent=#Animate3D] getWeight

View File

@ -10,7 +10,7 @@
-- @return float#float ret (return value: float)
--------------------------------
-- @function [parent=#Animation3D] getOrCreate
-- @function [parent=#Animation3D] create
-- @param self
-- @param #string str
-- @param #string str

View File

@ -63125,7 +63125,7 @@ int lua_cocos2dx_Animation3D_getDuration(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Animation3D_getOrCreate(lua_State* tolua_S)
int lua_cocos2dx_Animation3D_create(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
@ -63146,7 +63146,7 @@ int lua_cocos2dx_Animation3D_getOrCreate(lua_State* tolua_S)
ok &= luaval_to_std_string(tolua_S, 2,&arg0);
if(!ok)
return 0;
cocos2d::Animation3D* ret = cocos2d::Animation3D::getOrCreate(arg0);
cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0);
object_to_luaval<cocos2d::Animation3D>(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret);
return 1;
}
@ -63158,15 +63158,15 @@ int lua_cocos2dx_Animation3D_getOrCreate(lua_State* tolua_S)
ok &= luaval_to_std_string(tolua_S, 3,&arg1);
if(!ok)
return 0;
cocos2d::Animation3D* ret = cocos2d::Animation3D::getOrCreate(arg0, arg1);
cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1);
object_to_luaval<cocos2d::Animation3D>(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getOrCreate",argc, 1);
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_getOrCreate'.",&tolua_err);
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_create'.",&tolua_err);
#endif
return 0;
}
@ -63183,7 +63183,7 @@ int lua_register_cocos2dx_Animation3D(lua_State* tolua_S)
tolua_beginmodule(tolua_S,"Animation3D");
tolua_function(tolua_S,"getDuration",lua_cocos2dx_Animation3D_getDuration);
tolua_function(tolua_S,"getOrCreate", lua_cocos2dx_Animation3D_getOrCreate);
tolua_function(tolua_S,"create", lua_cocos2dx_Animation3D_create);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::Animation3D).name();
g_luaType[typeName] = "cc.Animation3D";
@ -63191,7 +63191,7 @@ int lua_register_cocos2dx_Animation3D(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S)
int lua_cocos2dx_Animate3D_setSpeed(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Animate3D* cobj = nullptr;
@ -63211,26 +63211,28 @@ int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getSpeed'", nullptr);
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setSpeed'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
if (argc == 1)
{
double arg0;
ok &= luaval_to_number(tolua_S, 2,&arg0);
if(!ok)
return 0;
double ret = cobj->getSpeed();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
cobj->setSpeed(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSpeed",argc, 0);
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSpeed",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getSpeed'.",&tolua_err);
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setSpeed'.",&tolua_err);
#endif
return 0;
@ -63281,7 +63283,7 @@ int lua_cocos2dx_Animate3D_setWeight(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Animate3D_getPlayBack(lua_State* tolua_S)
int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Animate3D* cobj = nullptr;
@ -63301,7 +63303,7 @@ int lua_cocos2dx_Animate3D_getPlayBack(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getPlayBack'", nullptr);
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getSpeed'", nullptr);
return 0;
}
#endif
@ -63311,108 +63313,16 @@ int lua_cocos2dx_Animate3D_getPlayBack(lua_State* tolua_S)
{
if(!ok)
return 0;
bool ret = cobj->getPlayBack();
tolua_pushboolean(tolua_S,(bool)ret);
double ret = cobj->getSpeed();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPlayBack",argc, 0);
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSpeed",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getPlayBack'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Animate3D_setPlayBack(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Animate3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setPlayBack'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
bool arg0;
ok &= luaval_to_boolean(tolua_S, 2,&arg0);
if(!ok)
return 0;
cobj->setPlayBack(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setPlayBack",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setPlayBack'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Animate3D_setSpeed(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Animate3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setSpeed'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
double arg0;
ok &= luaval_to_number(tolua_S, 2,&arg0);
if(!ok)
return 0;
cobj->setSpeed(arg0);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSpeed",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setSpeed'.",&tolua_err);
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getSpeed'.",&tolua_err);
#endif
return 0;
@ -63527,11 +63437,9 @@ int lua_register_cocos2dx_Animate3D(lua_State* tolua_S)
tolua_cclass(tolua_S,"Animate3D","cc.Animate3D","cc.ActionInterval",nullptr);
tolua_beginmodule(tolua_S,"Animate3D");
tolua_function(tolua_S,"getSpeed",lua_cocos2dx_Animate3D_getSpeed);
tolua_function(tolua_S,"setWeight",lua_cocos2dx_Animate3D_setWeight);
tolua_function(tolua_S,"getPlayBack",lua_cocos2dx_Animate3D_getPlayBack);
tolua_function(tolua_S,"setPlayBack",lua_cocos2dx_Animate3D_setPlayBack);
tolua_function(tolua_S,"setSpeed",lua_cocos2dx_Animate3D_setSpeed);
tolua_function(tolua_S,"setWeight",lua_cocos2dx_Animate3D_setWeight);
tolua_function(tolua_S,"getSpeed",lua_cocos2dx_Animate3D_getSpeed);
tolua_function(tolua_S,"getWeight",lua_cocos2dx_Animate3D_getWeight);
tolua_function(tolua_S,"create", lua_cocos2dx_Animate3D_create);
tolua_endmodule(tolua_S);

View File

@ -1571,8 +1571,6 @@ int register_all_cocos2dx(lua_State* tolua_S);

View File

@ -76,6 +76,8 @@ extern "C" {
#include "lua_cocos2dx_physics_manual.hpp"
#include "lua_cocos2dx_ui_auto.hpp"
#include "lua_cocos2dx_ui_manual.hpp"
#include "lua_cocos2dx_experimental_video_auto.hpp"
#include "lua_cocos2dx_experimental_video_manual.hpp"
namespace {
int lua_print(lua_State * luastate)
@ -190,6 +192,11 @@ bool LuaStack::init(void)
LuaObjcBridge::luaopen_luaoc(_state);
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
register_all_cocos2dx_experimental_video(_state);
register_all_cocos2dx_experimental_video_manual(_state);
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
LuaJavaBridge::luaopen_luaj(_state);
#endif

View File

@ -0,0 +1,87 @@
#include "lua_cocos2dx_experimental_video_manual.hpp"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "UIVideoPlayer.h"
#include "tolua_fix.h"
#include "LuaBasicConversions.h"
#include "CCLuaValue.h"
#include "CCLuaEngine.h"
static int lua_cocos2dx_experimental_video_VideoPlayer_addEventListener(lua_State* L)
{
int argc = 0;
cocos2d::experimental::ui::VideoPlayer* self = nullptr;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_isusertype(L,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror;
#endif
self = static_cast<cocos2d::experimental::ui::VideoPlayer*>(tolua_tousertype(L,1,0));
#if COCOS2D_DEBUG >= 1
if (nullptr == self) {
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", nullptr);
return 0;
}
#endif
argc = lua_gettop(L) - 1;
if (argc == 1)
{
#if COCOS2D_DEBUG >= 1
if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err))
{
goto tolua_lerror;
}
#endif
LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0));
self->addEventListener([=](cocos2d::Ref* ref, cocos2d::experimental::ui::VideoPlayer::EventType eventType){
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
stack->pushObject(ref, "cc.Ref");
stack->pushInt((int)eventType);
stack->executeFunctionByHandler(handler, 2);
});
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "addEventListener",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L, "#ferror in function 'lua_cocos2dx_experimental_VideoPlayer_addEventListener'.", &tolua_err);
#endif
return 0;
}
static void extendVideoPlayer(lua_State* L)
{
lua_pushstring(L, "ccexp.VideoPlayer");
lua_rawget(L, LUA_REGISTRYINDEX);
if (lua_istable(L,-1))
{
tolua_function(L, "addEventListener", lua_cocos2dx_experimental_video_VideoPlayer_addEventListener);
}
lua_pop(L, 1);
}
int register_all_cocos2dx_experimental_video_manual(lua_State* L)
{
if (nullptr == L)
return 0;
extendVideoPlayer(L);
return 0;
}
#endif

View File

@ -0,0 +1,41 @@
/****************************************************************************
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.
****************************************************************************/
#include "base/ccConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H
#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "tolua++.h"
#ifdef __cplusplus
}
#endif
TOLUA_API int register_all_cocos2dx_experimental_video_manual(lua_State* L);
#endif // COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H
#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

View File

@ -15,14 +15,14 @@
1503FAA618DA8A1C00F6518C /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 1503FA9F18DA8A1C00F6518C /* io.c */; };
1503FAA718DA8A1C00F6518C /* io.h in Headers */ = {isa = PBXBuildFile; fileRef = 1503FAA018DA8A1C00F6518C /* io.h */; };
1503FAA818DA8A1C00F6518C /* io.h in Headers */ = {isa = PBXBuildFile; fileRef = 1503FAA018DA8A1C00F6518C /* io.h */; };
15225DDB196C27440032C34F /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15225DD9196C27440032C34F /* lua_cocos2dx_controller_manual.cpp */; };
15225DDC196C27440032C34F /* lua_cocos2dx_controller_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15225DDA196C27440032C34F /* lua_cocos2dx_controller_manual.hpp */; };
1540AF57193EC30500717D8E /* xxtea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1540AF55193EC30500717D8E /* xxtea.cpp */; };
1540AF58193EC30500717D8E /* xxtea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1540AF55193EC30500717D8E /* xxtea.cpp */; };
1540AF59193EC30500717D8E /* xxtea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1540AF56193EC30500717D8E /* xxtea.h */; };
1540AF5A193EC30500717D8E /* xxtea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1540AF56193EC30500717D8E /* xxtea.h */; };
15A1D372196BD878009C3B59 /* lua_cocos2dx_controller_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15A1D370196BD878009C3B59 /* lua_cocos2dx_controller_auto.cpp */; };
15A1D373196BD878009C3B59 /* lua_cocos2dx_controller_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15A1D371196BD878009C3B59 /* lua_cocos2dx_controller_auto.hpp */; };
15AECE12195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */; };
15AECE13195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */; };
15AECE16195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */; };
15AECE17195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */; };
1A262AB818BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; };
1A262AB918BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; };
1AACE7B518BC45C200215002 /* lua_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */; };
@ -222,12 +222,12 @@
1503FA9E18DA8A1C00F6518C /* buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buffer.h; sourceTree = "<group>"; };
1503FA9F18DA8A1C00F6518C /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = "<group>"; };
1503FAA018DA8A1C00F6518C /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = "<group>"; };
15225DD9196C27440032C34F /* lua_cocos2dx_controller_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_controller_manual.cpp; sourceTree = "<group>"; };
15225DDA196C27440032C34F /* lua_cocos2dx_controller_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_controller_manual.hpp; sourceTree = "<group>"; };
1540AF55193EC30500717D8E /* xxtea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xxtea.cpp; sourceTree = "<group>"; };
1540AF56193EC30500717D8E /* xxtea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxtea.h; sourceTree = "<group>"; };
15A1D370196BD878009C3B59 /* lua_cocos2dx_controller_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_controller_auto.cpp; sourceTree = "<group>"; };
15A1D371196BD878009C3B59 /* lua_cocos2dx_controller_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_controller_auto.hpp; sourceTree = "<group>"; };
15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_auto.cpp; sourceTree = "<group>"; };
15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_auto.hpp; sourceTree = "<group>"; };
15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_manual.cpp; sourceTree = "<group>"; };
15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_manual.hpp; sourceTree = "<group>"; };
1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tolua_fix.cpp; sourceTree = "<group>"; };
1AACE74618BC45A000215002 /* libluabindings Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; };
1AACE74718BC45A000215002 /* libluabindings iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -373,8 +373,8 @@
1AACE74818BC45C200215002 /* auto */ = {
isa = PBXGroup;
children = (
15A1D370196BD878009C3B59 /* lua_cocos2dx_controller_auto.cpp */,
15A1D371196BD878009C3B59 /* lua_cocos2dx_controller_auto.hpp */,
15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */,
15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */,
2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */,
2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */,
1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */,
@ -395,8 +395,8 @@
1AACE75B18BC45C200215002 /* manual */ = {
isa = PBXGroup;
children = (
15225DD9196C27440032C34F /* lua_cocos2dx_controller_manual.cpp */,
15225DDA196C27440032C34F /* lua_cocos2dx_controller_manual.hpp */,
15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */,
15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */,
2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */,
2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */,
1AACE75E18BC45C200215002 /* CCBProxy.cpp */,
@ -616,17 +616,17 @@
1ABCA23818CD8F7D0087CE3A /* except.h in Headers */,
1ABCA26418CD8F7D0087CE3A /* timeout.h in Headers */,
1AACE81418BC45C200215002 /* Lua_web_socket.h in Headers */,
15A1D373196BD878009C3B59 /* lua_cocos2dx_controller_auto.hpp in Headers */,
1AACE81C18BC45C200215002 /* LuaBasicConversions.h in Headers */,
1AACE7CA18BC45C200215002 /* lua_cocos2dx_physics_auto.hpp in Headers */,
1AACE7F818BC45C200215002 /* lua_cocos2dx_deprecated.h in Headers */,
1ABCA24C18CD8F7D0087CE3A /* mime.h in Headers */,
1ABCA1ED18CD8F470087CE3A /* lua.h in Headers */,
15225DDC196C27440032C34F /* lua_cocos2dx_controller_manual.hpp in Headers */,
1AACE7F418BC45C200215002 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */,
1ABCA26818CD8F7D0087CE3A /* udp.h in Headers */,
15AECE17195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */,
1ABCA25418CD8F7D0087CE3A /* select.h in Headers */,
1AACE7D618BC45C200215002 /* lua_cocos2dx_studio_auto.hpp in Headers */,
15AECE13195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -766,9 +766,11 @@
1AACE81E18BC45C200215002 /* LuaOpengl.cpp in Sources */,
1AACE7CE18BC45C200215002 /* lua_cocos2dx_spine_auto.cpp in Sources */,
1AACE80218BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */,
15AECE16195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */,
1ABCA23E18CD8F7D0087CE3A /* luasocket.c in Sources */,
1ABCA25218CD8F7D0087CE3A /* select.c in Sources */,
1ABCA24A18CD8F7D0087CE3A /* mime.c in Sources */,
15AECE12195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */,
1540AF58193EC30500717D8E /* xxtea.cpp in Sources */,
1ABCA26218CD8F7D0087CE3A /* timeout.c in Sources */,
1503FAA618DA8A1C00F6518C /* io.c in Sources */,
@ -777,7 +779,6 @@
1ABCA23618CD8F7D0087CE3A /* except.c in Sources */,
2905FAD718CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp in Sources */,
1ABCA26A18CD8F7D0087CE3A /* unix.c in Sources */,
15A1D372196BD878009C3B59 /* lua_cocos2dx_controller_auto.cpp in Sources */,
1AACE7F218BC45C200215002 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */,
1503FAA218DA8A1C00F6518C /* buffer.c in Sources */,
1AACE80E18BC45C200215002 /* lua_extensions.c in Sources */,
@ -786,7 +787,6 @@
1AACE7BC18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp in Sources */,
1ABCA20918CD8F6E0087CE3A /* tolua_push.c in Sources */,
1AACE82618BC45C200215002 /* LuaSkeletonAnimation.cpp in Sources */,
15225DDB196C27440032C34F /* lua_cocos2dx_controller_manual.cpp in Sources */,
1ABCA25E18CD8F7D0087CE3A /* tcp.c in Sources */,
1AACE80A18BC45C200215002 /* lua_cocos2dx_spine_manual.cpp in Sources */,
1AACE81A18BC45C200215002 /* LuaBasicConversions.cpp in Sources */,

View File

@ -0,0 +1,9 @@
ccexprimental = ccexprimental or {}
ccexprimental.VideoPlayerEvent = {
PLAYING = 0,
PAUSED = 1,
STOPPED= 2,
COMPLETED =3,
}

View File

@ -48,7 +48,7 @@ static void localStorageCreateTable()
{
const char *sql_createtable = "CREATE TABLE IF NOT EXISTS data(key TEXT PRIMARY KEY,value TEXT);";
sqlite3_stmt *stmt;
int ok=sqlite3_prepare_v2(_db, sql_createtable, -1, &stmt, NULL);
int ok=sqlite3_prepare_v2(_db, sql_createtable, -1, &stmt, nullptr);
ok |= sqlite3_step(stmt);
ok |= sqlite3_finalize(stmt);
@ -71,15 +71,15 @@ void localStorageInit( const std::string& fullpath/* = "" */)
// SELECT
const char *sql_select = "SELECT value FROM data WHERE key=?;";
ret |= sqlite3_prepare_v2(_db, sql_select, -1, &_stmt_select, NULL);
ret |= sqlite3_prepare_v2(_db, sql_select, -1, &_stmt_select, nullptr);
// REPLACE
const char *sql_update = "REPLACE INTO data (key, value) VALUES (?,?);";
ret |= sqlite3_prepare_v2(_db, sql_update, -1, &_stmt_update, NULL);
ret |= sqlite3_prepare_v2(_db, sql_update, -1, &_stmt_update, nullptr);
// DELETE
const char *sql_remove = "DELETE FROM data WHERE key=?;";
ret |= sqlite3_prepare_v2(_db, sql_remove, -1, &_stmt_remove, NULL);
ret |= sqlite3_prepare_v2(_db, sql_remove, -1, &_stmt_remove, nullptr);
if( ret != SQLITE_OK ) {
printf("Error initializing DB\n");

View File

@ -33,13 +33,13 @@ class Sprite;
namespace ui {
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
CHECKBOX_STATE_EVENT_SELECTED,
CHECKBOX_STATE_EVENT_UNSELECTED
}CheckBoxEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType);
typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType);
#define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR)
/**

View File

@ -1648,7 +1648,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c
if (direction == FocusDirection::LEFT) {
if (index == 0)
{
return true * isLastWidgetInContainer(parent, direction);
return isLastWidgetInContainer(parent, direction);
}
else
{
@ -1658,7 +1658,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c
if (direction == FocusDirection::RIGHT) {
if (index == container.size()-1)
{
return true * isLastWidgetInContainer(parent, direction);
return isLastWidgetInContainer(parent, direction);
}
else
{
@ -1681,7 +1681,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c
{
if (index == 0)
{
return true * isLastWidgetInContainer(parent, direction);
return isLastWidgetInContainer(parent, direction);
}
else
@ -1693,7 +1693,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c
{
if (index == container.size() - 1)
{
return true * isLastWidgetInContainer(parent, direction);
return isLastWidgetInContainer(parent, direction);
}
else
{

View File

@ -32,13 +32,13 @@ NS_CC_BEGIN
namespace ui{
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
LISTVIEW_ONSELECTEDITEM_START,
LISTVIEW_ONSELECTEDITEM_END
}ListViewEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_ListViewEvent)(Ref*,ListViewEventType);
typedef void (Ref::*SEL_ListViewEvent)(Ref*,ListViewEventType);
#define listvieweventselector(_SELECTOR) (SEL_ListViewEvent)(&_SELECTOR)
class ListView : public ScrollView

View File

@ -31,12 +31,12 @@ NS_CC_BEGIN
namespace ui {
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
PAGEVIEW_EVENT_TURNING,
}PageViewEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_PageViewEvent)(Ref*, PageViewEventType);
typedef void (Ref::*SEL_PageViewEvent)(Ref*, PageViewEventType);
#define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR)
class PageView : public Layout

View File

@ -66,7 +66,7 @@ RichElementText* RichElementText::create(int tag, const Color3B &color, GLubyte
return element;
}
CC_SAFE_DELETE(element);
return NULL;
return nullptr;
}
bool RichElementText::init(int tag, const Color3B &color, GLubyte opacity, const std::string& text, const std::string& fontName, float fontSize)
@ -90,7 +90,7 @@ RichElementImage* RichElementImage::create(int tag, const Color3B &color, GLubyt
return element;
}
CC_SAFE_DELETE(element);
return NULL;
return nullptr;
}
bool RichElementImage::init(int tag, const Color3B &color, GLubyte opacity, const std::string& filePath)
@ -112,7 +112,7 @@ RichElementCustomNode* RichElementCustomNode::create(int tag, const Color3B &col
return element;
}
CC_SAFE_DELETE(element);
return NULL;
return nullptr;
}
bool RichElementCustomNode::init(int tag, const Color3B &color, GLubyte opacity, cocos2d::Node *customNode)
@ -149,7 +149,7 @@ RichText* RichText::create()
return widget;
}
CC_SAFE_DELETE(widget);
return NULL;
return nullptr;
}
bool RichText::init()
@ -204,7 +204,7 @@ void RichText::formatText()
for (ssize_t i=0; i<_richElements.size(); i++)
{
RichElement* element = _richElements.at(i);
Node* elementRenderer = NULL;
Node* elementRenderer = nullptr;
switch (element->_type)
{
case RichElement::Type::TEXT:

View File

@ -33,7 +33,7 @@ class EventFocusListener;
namespace ui {
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
SCROLLVIEW_EVENT_SCROLL_TO_TOP,
SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM,
@ -46,7 +46,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum
SCROLLVIEW_EVENT_BOUNCE_RIGHT
}ScrollviewEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType);
typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType);
#define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR)

View File

@ -33,12 +33,12 @@ class Sprite;
namespace ui {
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
SLIDER_PERCENTCHANGED
}SliderEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType);
typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType);
#define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR)
/**

View File

@ -91,7 +91,7 @@ protected:
bool _deleteBackward;
};
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
TEXTFIELD_EVENT_ATTACH_WITH_IME,
TEXTFIELD_EVENT_DETACH_WITH_IME,
@ -99,7 +99,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum
TEXTFIELD_EVENT_DELETE_BACKWARD,
}TextFiledEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_TextFieldEvent)(Ref*, TextFiledEventType);
typedef void (Ref::*SEL_TextFieldEvent)(Ref*, TextFiledEventType);
#define textfieldeventselector(_SELECTOR) (SEL_TextFieldEvent)(&_SELECTOR)
/** class UITextField : public Widget

View File

@ -37,7 +37,7 @@ class EventListenerTouchOneByOne;
namespace ui {
CC_DEPRECATED_ATTRIBUTE typedef enum
typedef enum
{
TOUCH_EVENT_BEGAN,
TOUCH_EVENT_MOVED,
@ -45,7 +45,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum
TOUCH_EVENT_CANCELED
}TouchEventType;
CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_TouchEvent)(Ref*,TouchEventType);
typedef void (Ref::*SEL_TouchEvent)(Ref*,TouchEventType);
#define toucheventselector(_SELECTOR) (SEL_TouchEvent)(&_SELECTOR)

View File

@ -59,7 +59,7 @@ Control* Control::create()
else
{
CC_SAFE_DELETE(pRet);
return NULL;
return nullptr;
}
}
@ -154,7 +154,7 @@ void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, E
*
* @param target The target object that is, the object to which the action
* message is sent. It cannot be nil. The target is not retained.
* @param action A selector identifying an action message. It cannot be NULL.
* @param action A selector identifying an action message. It cannot be nullptr.
* @param controlEvent A control event for which the action message is sent.
* See "CCControlEvent" for constants.
*/
@ -320,7 +320,7 @@ bool Control::isHighlighted() const
bool Control::hasVisibleParents() const
{
auto parent = this->getParent();
for( auto c = parent; c != NULL; c = c->getParent() )
for( auto c = parent; c != nullptr; c = c->getParent() )
{
if( !c->isVisible() )
{

View File

@ -135,7 +135,7 @@ void ControlColourPicker::setColor(const Color3B& color)
void ControlColourPicker::setEnabled(bool enabled)
{
Control::setEnabled(enabled);
if (_huePicker != NULL)
if (_huePicker != nullptr)
{
_huePicker->setEnabled(enabled);
}

View File

@ -118,7 +118,7 @@ void ControlHuePicker::setHuePercentage(float hueValueInPercent)
void ControlHuePicker::setEnabled(bool enabled)
{
Control::setEnabled(enabled);
if (_slider != NULL)
if (_slider != nullptr)
{
_slider->setOpacity(enabled ? 255 : 128);
}

View File

@ -48,7 +48,7 @@ ControlPotentiometer::~ControlPotentiometer()
ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, const char* progressFile, const char* thumbFile)
{
ControlPotentiometer* pRet = new ControlPotentiometer();
if (pRet != NULL)
if (pRet != nullptr)
{
// Prepare track for potentiometer
Sprite *backgroundSprite = Sprite::create(backgroundFile);
@ -97,7 +97,7 @@ bool ControlPotentiometer::initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite*
void ControlPotentiometer::setEnabled(bool enabled)
{
Control::setEnabled(enabled);
if (_thumbSprite != NULL)
if (_thumbSprite != nullptr)
{
_thumbSprite->setOpacity((enabled) ? 255 : 128);
}

View File

@ -50,10 +50,10 @@ ControlSaturationBrightnessPicker::~ControlSaturationBrightnessPicker()
{
removeAllChildrenWithCleanup(true);
_background = NULL;
_overlay = NULL;
_shadow = NULL;
_slider = NULL;
_background = nullptr;
_overlay = nullptr;
_shadow = nullptr;
_slider = nullptr;
}
bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Vec2 pos)
@ -88,7 +88,7 @@ ControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Nod
void ControlSaturationBrightnessPicker::setEnabled(bool enabled)
{
Control::setEnabled(enabled);
if (_slider != NULL)
if (_slider != nullptr)
{
_slider->setOpacity(enabled ? 255 : 128);
}

View File

@ -169,7 +169,7 @@ bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressS
void ControlSlider::setEnabled(bool enabled)
{
Control::setEnabled(enabled);
if (_thumbSprite != NULL)
if (_thumbSprite != nullptr)
{
_thumbSprite->setOpacity((enabled) ? 255 : 128);
}
@ -271,8 +271,8 @@ void ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent)
void ControlSlider::needsLayout()
{
if (NULL == _thumbSprite || NULL == _selectedThumbSprite || NULL == _backgroundSprite
|| NULL == _progressSprite)
if (nullptr == _thumbSprite || nullptr == _selectedThumbSprite || nullptr == _backgroundSprite
|| nullptr == _progressSprite)
{
return;
}

View File

@ -118,7 +118,7 @@ bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprit
ControlStepper* ControlStepper::create(Sprite *minusSprite, Sprite *plusSprite)
{
ControlStepper* pRet = new ControlStepper();
if (pRet != NULL && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite))
if (pRet != nullptr && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite))
{
pRet->autorelease();
}

View File

@ -291,13 +291,13 @@ ControlSwitch::~ControlSwitch()
bool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite)
{
return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL);
return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr);
}
ControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite)
{
ControlSwitch* pRet = new ControlSwitch();
if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL))
if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr))
{
pRet->autorelease();
}
@ -382,7 +382,7 @@ void ControlSwitch::setOn(bool isOn, bool animated)
void ControlSwitch::setEnabled(bool enabled)
{
_enabled = enabled;
if (_switchSprite != NULL)
if (_switchSprite != nullptr)
{
_switchSprite->setOpacity((enabled) ? 255 : 128);
}

View File

@ -31,7 +31,7 @@ Sprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName,
Sprite *sprite =Sprite::createWithSpriteFrameName(spriteName);
if (!sprite)
return NULL;
return nullptr;
sprite->setPosition(pos);
sprite->setAnchorPoint(anchor);

View File

@ -31,7 +31,7 @@ NS_CC_EXT_BEGIN
Invocation* Invocation::create(Ref* target, Control::Handler action, Control::EventType controlEvent)
{
Invocation* pRet = new Invocation(target, action, controlEvent);
if (pRet != NULL)
if (pRet != nullptr)
{
pRet->autorelease();
}

View File

@ -71,7 +71,7 @@ Scale9Sprite::~Scale9Sprite()
bool Scale9Sprite::init()
{
return this->initWithBatchNode(NULL, Rect::ZERO, Rect::ZERO);
return this->initWithBatchNode(nullptr, Rect::ZERO, Rect::ZERO);
}
bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets)
@ -389,13 +389,13 @@ void Scale9Sprite::setContentSize(const Size &size)
void Scale9Sprite::updatePositions()
{
// Check that instances are non-NULL
// Check that instances are non-nullptr
if(!((_topLeft) &&
(_topRight) &&
(_bottomRight) &&
(_bottomLeft) &&
(_centre))) {
// if any of the above sprites are NULL, return
// if any of the above sprites are nullptr, return
return;
}
@ -462,7 +462,7 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect, c
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect)
@ -480,7 +480,7 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect)
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
@ -499,7 +499,7 @@ Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& fil
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithFile(const std::string& file)
@ -518,16 +518,16 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file)
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets)
{
Texture2D* texture = spriteFrame->getTexture();
CCASSERT(texture != NULL, "CCTexture must be not nil");
CCASSERT(texture != nullptr, "CCTexture must be not nil");
SpriteBatchNode *batchnode = SpriteBatchNode::createWithTexture(texture, 9);
CCASSERT(batchnode != NULL, "CCSpriteBatchNode must be not nil");
CCASSERT(batchnode != nullptr, "CCSpriteBatchNode must be not nil");
bool pReturn = this->initWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), capInsets);
return pReturn;
@ -542,11 +542,11 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, cons
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame)
{
CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite");
CCASSERT(spriteFrame != nullptr, "Invalid spriteFrame for sprite");
bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO);
return pReturn;
}
@ -560,17 +560,17 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame)
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets)
{
CCASSERT((SpriteFrameCache::getInstance()) != NULL, "SpriteFrameCache::getInstance() must be non-NULL");
CCASSERT((SpriteFrameCache::getInstance()) != nullptr, "SpriteFrameCache::getInstance() must be non-nullptr");
SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);
CCASSERT(frame != NULL, "CCSpriteFrame must be non-NULL");
CCASSERT(frame != nullptr, "CCSpriteFrame must be non-nullptr");
if (NULL == frame) return false;
if (nullptr == frame) return false;
bool pReturn = this->initWithSpriteFrame(frame, capInsets);
return pReturn;
@ -585,7 +585,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteF
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName)
@ -605,7 +605,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteF
CC_SAFE_DELETE(pReturn);
log("Could not allocate Scale9Sprite()");
return NULL;
return nullptr;
}
@ -618,7 +618,7 @@ Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets)
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
Scale9Sprite* Scale9Sprite::create()
@ -630,7 +630,7 @@ Scale9Sprite* Scale9Sprite::create()
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
return nullptr;
}
/** sets the opacity.

View File

@ -62,18 +62,18 @@ void EditBox::touchDownAction(Ref *sender, Control::EventType controlEvent)
_editBoxImpl->openKeyboard();
}
EditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = NULL*/, Scale9Sprite* pDisabled9SpriteBg/* = NULL*/)
EditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = nullptr*/, Scale9Sprite* pDisabled9SpriteBg/* = nullptr*/)
{
EditBox* pRet = new EditBox();
if (pRet != NULL && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg))
if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg))
{
if (pPressed9SpriteBg != NULL)
if (pPressed9SpriteBg != nullptr)
{
pRet->setBackgroundSpriteForState(pPressed9SpriteBg, Control::State::HIGH_LIGHTED);
}
if (pDisabled9SpriteBg != NULL)
if (pDisabled9SpriteBg != nullptr)
{
pRet->setBackgroundSpriteForState(pDisabled9SpriteBg, Control::State::DISABLED);
}
@ -108,7 +108,7 @@ bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pP
void EditBox::setDelegate(EditBoxDelegate* pDelegate)
{
_delegate = pDelegate;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setDelegate(pDelegate);
}
@ -121,10 +121,10 @@ EditBoxDelegate* EditBox::getDelegate()
void EditBox::setText(const char* pText)
{
if (pText != NULL)
if (pText != nullptr)
{
_text = pText;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setText(pText);
}
@ -133,10 +133,10 @@ void EditBox::setText(const char* pText)
const char* EditBox::getText(void)
{
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
const char* pText = _editBoxImpl->getText();
if(pText != NULL)
if(pText != nullptr)
return pText;
}
@ -147,9 +147,9 @@ void EditBox::setFont(const char* pFontName, int fontSize)
{
_fontName = pFontName;
_fontSize = fontSize;
if (pFontName != NULL)
if (pFontName != nullptr)
{
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setFont(pFontName, fontSize);
}
@ -159,7 +159,7 @@ void EditBox::setFont(const char* pFontName, int fontSize)
void EditBox::setFontName(const char* pFontName)
{
_fontName = pFontName;
if (_editBoxImpl != NULL && _fontSize != -1)
if (_editBoxImpl != nullptr && _fontSize != -1)
{
_editBoxImpl->setFont(pFontName, _fontSize);
}
@ -168,7 +168,7 @@ void EditBox::setFontName(const char* pFontName)
void EditBox::setFontSize(int fontSize)
{
_fontSize = fontSize;
if (_editBoxImpl != NULL && _fontName.length() > 0)
if (_editBoxImpl != nullptr && _fontName.length() > 0)
{
_editBoxImpl->setFont(_fontName.c_str(), _fontSize);
}
@ -177,7 +177,7 @@ void EditBox::setFontSize(int fontSize)
void EditBox::setFontColor(const Color3B& color)
{
_colText = color;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setFontColor(color);
}
@ -187,9 +187,9 @@ void EditBox::setPlaceholderFont(const char* pFontName, int fontSize)
{
_placeholderFontName = pFontName;
_placeholderFontSize = fontSize;
if (pFontName != NULL)
if (pFontName != nullptr)
{
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setPlaceholderFont(pFontName, fontSize);
}
@ -199,7 +199,7 @@ void EditBox::setPlaceholderFont(const char* pFontName, int fontSize)
void EditBox::setPlaceholderFontName(const char* pFontName)
{
_placeholderFontName = pFontName;
if (_editBoxImpl != NULL && _placeholderFontSize != -1)
if (_editBoxImpl != nullptr && _placeholderFontSize != -1)
{
_editBoxImpl->setPlaceholderFont(pFontName, _fontSize);
}
@ -208,7 +208,7 @@ void EditBox::setPlaceholderFontName(const char* pFontName)
void EditBox::setPlaceholderFontSize(int fontSize)
{
_placeholderFontSize = fontSize;
if (_editBoxImpl != NULL && _placeholderFontName.length() > 0)
if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0)
{
_editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize);
}
@ -217,7 +217,7 @@ void EditBox::setPlaceholderFontSize(int fontSize)
void EditBox::setPlaceholderFontColor(const Color3B& color)
{
_colText = color;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setPlaceholderFontColor(color);
}
@ -225,10 +225,10 @@ void EditBox::setPlaceholderFontColor(const Color3B& color)
void EditBox::setPlaceHolder(const char* pText)
{
if (pText != NULL)
if (pText != nullptr)
{
_placeHolder = pText;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setPlaceHolder(pText);
}
@ -243,7 +243,7 @@ const char* EditBox::getPlaceHolder(void)
void EditBox::setInputMode(EditBox::InputMode inputMode)
{
_editBoxInputMode = inputMode;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setInputMode(inputMode);
}
@ -252,7 +252,7 @@ void EditBox::setInputMode(EditBox::InputMode inputMode)
void EditBox::setMaxLength(int maxLength)
{
_maxLength = maxLength;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setMaxLength(maxLength);
}
@ -267,7 +267,7 @@ int EditBox::getMaxLength()
void EditBox::setInputFlag(EditBox::InputFlag inputFlag)
{
_editBoxInputFlag = inputFlag;
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setInputFlag(inputFlag);
}
@ -275,7 +275,7 @@ void EditBox::setInputFlag(EditBox::InputFlag inputFlag)
void EditBox::setReturnType(EditBox::KeyboardReturnType returnType)
{
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setReturnType(returnType);
}
@ -285,7 +285,7 @@ void EditBox::setReturnType(EditBox::KeyboardReturnType returnType)
void EditBox::setPosition(const Vec2& pos)
{
ControlButton::setPosition(pos);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setPosition(pos);
}
@ -294,7 +294,7 @@ void EditBox::setPosition(const Vec2& pos)
void EditBox::setVisible(bool visible)
{
ControlButton::setVisible(visible);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setVisible(visible);
}
@ -303,7 +303,7 @@ void EditBox::setVisible(bool visible)
void EditBox::setContentSize(const Size& size)
{
ControlButton::setContentSize(size);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setContentSize(size);
}
@ -312,7 +312,7 @@ void EditBox::setContentSize(const Size& size)
void EditBox::setAnchorPoint(const Vec2& anchorPoint)
{
ControlButton::setAnchorPoint(anchorPoint);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->setAnchorPoint(anchorPoint);
}
@ -321,7 +321,7 @@ void EditBox::setAnchorPoint(const Vec2& anchorPoint)
void EditBox::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
ControlButton::visit(renderer, parentTransform, parentFlags);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->visit();
}
@ -338,7 +338,7 @@ void EditBox::onEnter(void)
#endif
ControlButton::onEnter();
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->onEnter();
}
@ -358,7 +358,7 @@ void EditBox::updatePosition(float dt)
void EditBox::onExit(void)
{
ControlButton::onExit();
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
// remove system edit control
_editBoxImpl->closeKeyboard();
@ -390,7 +390,7 @@ void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info)
_adjustHeight = info.end.getMaxY() - rectTracked.getMinY();
// CCLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight);
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->doAnimationWhenKeyboardMove(info.duration, _adjustHeight);
}
@ -404,7 +404,7 @@ void EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& info)
void EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info)
{
// CCLOG("CCEditBox::keyboardWillHide");
if (_editBoxImpl != NULL)
if (_editBoxImpl != nullptr)
{
_editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight);
}

View File

@ -93,12 +93,12 @@ bool EditBoxImplWin::initWithSize(const Size& size)
void EditBoxImplWin::setFont(const char* pFontName, int fontSize)
{
if(_label != NULL) {
if(_label != nullptr) {
_label->setSystemFontName(pFontName);
_label->setSystemFontSize(fontSize);
}
if(_labelPlaceHolder != NULL) {
if(_labelPlaceHolder != nullptr) {
_labelPlaceHolder->setSystemFontName(pFontName);
_labelPlaceHolder->setSystemFontSize(fontSize);
}
@ -112,7 +112,7 @@ void EditBoxImplWin::setFontColor(const Color3B& color)
void EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize)
{
if(_labelPlaceHolder != NULL) {
if(_labelPlaceHolder != nullptr) {
_labelPlaceHolder->setSystemFontName(pFontName);
_labelPlaceHolder->setSystemFontSize(fontSize);
}
@ -156,7 +156,7 @@ bool EditBoxImplWin::isEditing()
void EditBoxImplWin::setText(const char* pText)
{
if (pText != NULL)
if (pText != nullptr)
{
_text = pText;
@ -199,7 +199,7 @@ const char* EditBoxImplWin::getText(void)
void EditBoxImplWin::setPlaceHolder(const char* pText)
{
if (pText != NULL)
if (pText != nullptr)
{
_placeHolder = pText;
if (_placeHolder.length() > 0 && _text.length() == 0)
@ -236,13 +236,13 @@ void EditBoxImplWin::visit(void)
void EditBoxImplWin::openKeyboard()
{
if (_delegate != NULL)
if (_delegate != nullptr)
{
_delegate->editBoxEditingDidBegin(_editBox);
}
EditBox* pEditBox = this->getEditBox();
if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())
{
CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox);
ScriptEvent event(kCommonEvent,(void*)&data);
@ -265,7 +265,7 @@ void EditBoxImplWin::openKeyboard()
if (didChange)
setText(pText);
if (_delegate != NULL) {
if (_delegate != nullptr) {
if (didChange)
_delegate->editBoxTextChanged(_editBox, getText());
_delegate->editBoxEditingDidEnd(_editBox);

View File

@ -75,7 +75,7 @@ ScrollView::~ScrollView()
}
ScrollView* ScrollView::create(Size size, Node* container/* = NULL*/)
ScrollView* ScrollView::create(Size size, Node* container/* = nullptr*/)
{
ScrollView* pRet = new ScrollView();
if (pRet && pRet->initWithViewSize(size, container))
@ -104,7 +104,7 @@ ScrollView* ScrollView::create()
}
bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/)
bool ScrollView::initWithViewSize(Size size, Node *container/* = nullptr*/)
{
if (Layer::init())
{
@ -123,7 +123,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/)
_touches.reserve(EventTouch::MAX_TOUCHES);
_delegate = NULL;
_delegate = nullptr;
_bounceable = true;
_clippingToBounds = true;
//_container->setContentSize(Size::ZERO);
@ -142,7 +142,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/)
bool ScrollView::init()
{
return this->initWithViewSize(Size(200, 200), NULL);
return this->initWithViewSize(Size(200, 200), nullptr);
}
bool ScrollView::isNodeVisible(Node* node)
@ -225,7 +225,7 @@ void ScrollView::setContentOffset(Vec2 offset, bool animated/* = false*/)
_container->setPosition(offset);
if (_delegate != NULL)
if (_delegate != nullptr)
{
_delegate->scrollViewDidScroll(this);
}
@ -269,7 +269,7 @@ void ScrollView::setZoomScale(float s)
newCenter = _container->convertToWorldSpace(oldCenter);
const Vec2 offset = center - newCenter;
if (_delegate != NULL)
if (_delegate != nullptr)
{
_delegate->scrollViewDidZoom(this);
}
@ -329,9 +329,9 @@ Node * ScrollView::getContainer()
void ScrollView::setContainer(Node * pContainer)
{
// Make sure that '_container' has a non-NULL value since there are
// Make sure that '_container' has a non-nullptr value since there are
// lots of logic that use '_container'.
if (NULL == pContainer)
if (nullptr == pContainer)
return;
this->removeAllChildrenWithCleanup(true);
@ -430,7 +430,7 @@ void ScrollView::stoppedAnimatedScroll(Node * node)
{
this->unschedule(schedule_selector(ScrollView::performedAnimatedScroll));
// After the animation stopped, "scrollViewDidScroll" should be invoked, this could fix the bug of lack of tableview cells.
if (_delegate != NULL)
if (_delegate != nullptr)
{
_delegate->scrollViewDidScroll(this);
}
@ -444,7 +444,7 @@ void ScrollView::performedAnimatedScroll(float dt)
return;
}
if (_delegate != NULL)
if (_delegate != nullptr)
{
_delegate->scrollViewDidScroll(this);
}
@ -458,7 +458,7 @@ const Size& ScrollView::getContentSize() const
void ScrollView::setContentSize(const Size & size)
{
if (this->getContainer() != NULL)
if (this->getContainer() != nullptr)
{
this->getContainer()->setContentSize(size);
this->updateInset();
@ -467,7 +467,7 @@ void ScrollView::setContentSize(const Size & size)
void ScrollView::updateInset()
{
if (this->getContainer() != NULL)
if (this->getContainer() != nullptr)
{
_maxInset = this->maxContainerOffset();
_maxInset = Vec2(_maxInset.x + _viewSize.width * INSET_RATIO,
@ -812,7 +812,7 @@ Rect ScrollView::getViewRect()
float scaleX = this->getScaleX();
float scaleY = this->getScaleY();
for (Node *p = _parent; p != NULL; p = p->getParent()) {
for (Node *p = _parent; p != nullptr; p = p->getParent()) {
scaleX *= p->getScaleX();
scaleY *= p->getScaleY();
}

View File

@ -35,7 +35,7 @@ TableView* TableView::create()
TableView* TableView::create(TableViewDataSource* dataSource, Size size)
{
return TableView::create(dataSource, size, NULL);
return TableView::create(dataSource, size, nullptr);
}
TableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *container)
@ -50,7 +50,7 @@ TableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *c
return table;
}
bool TableView::initWithViewSize(Size size, Node* container/* = NULL*/)
bool TableView::initWithViewSize(Size size, Node* container/* = nullptr*/)
{
if (ScrollView::initWithViewSize(size,container))
{
@ -103,7 +103,7 @@ void TableView::reloadData()
_oldDirection = Direction::NONE;
for(const auto &cell : _cellsUsed) {
if(_tableViewDelegate != NULL) {
if(_tableViewDelegate != nullptr) {
_tableViewDelegate->tableCellWillRecycle(this, cell);
}
@ -242,7 +242,7 @@ TableViewCell *TableView::dequeueCell()
TableViewCell *cell;
if (_cellsFreed.empty()) {
cell = NULL;
cell = nullptr;
} else {
cell = _cellsFreed.at(0);
cell->retain();
@ -396,7 +396,7 @@ long TableView::__indexFromOffset(Vec2 offset)
void TableView::_moveCellOutOfSight(TableViewCell *cell)
{
if(_tableViewDelegate != NULL) {
if(_tableViewDelegate != nullptr) {
_tableViewDelegate->tableCellWillRecycle(this, cell);
}
@ -464,7 +464,7 @@ void TableView::scrollViewDidScroll(ScrollView* view)
});
}
if(_tableViewDelegate != NULL) {
if(_tableViewDelegate != nullptr) {
_tableViewDelegate->scrollViewDidScroll(this);
}
@ -577,13 +577,13 @@ void TableView::onTouchEnded(Touch *pTouch, Event *pEvent)
Rect bb = this->getBoundingBox();
bb.origin = _parent->convertToWorldSpace(bb.origin);
if (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != NULL)
if (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != nullptr)
{
_tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
_tableViewDelegate->tableCellTouched(this, _touchedCell);
}
_touchedCell = NULL;
_touchedCell = nullptr;
}
ScrollView::onTouchEnded(pTouch, pEvent);
@ -608,26 +608,26 @@ bool TableView::onTouchBegan(Touch *pTouch, Event *pEvent)
index = this->_indexFromOffset(point);
if (index == CC_INVALID_INDEX)
{
_touchedCell = NULL;
_touchedCell = nullptr;
}
else
{
_touchedCell = this->cellAtIndex(index);
}
if (_touchedCell && _tableViewDelegate != NULL)
if (_touchedCell && _tableViewDelegate != nullptr)
{
_tableViewDelegate->tableCellHighlight(this, _touchedCell);
}
}
else if (_touchedCell)
{
if(_tableViewDelegate != NULL)
if(_tableViewDelegate != nullptr)
{
_tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
}
_touchedCell = NULL;
_touchedCell = nullptr;
}
return touchResult;
@ -639,12 +639,12 @@ void TableView::onTouchMoved(Touch *pTouch, Event *pEvent)
if (_touchedCell && isTouchMoved())
{
if(_tableViewDelegate != NULL)
if(_tableViewDelegate != nullptr)
{
_tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
}
_touchedCell = NULL;
_touchedCell = nullptr;
}
}
@ -654,12 +654,12 @@ void TableView::onTouchCancelled(Touch *pTouch, Event *pEvent)
if (_touchedCell)
{
if(_tableViewDelegate != NULL)
if(_tableViewDelegate != nullptr)
{
_tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
}
_touchedCell = NULL;
_touchedCell = nullptr;
}
}

View File

@ -77,7 +77,7 @@ struct ProgressMessage
// Implementation of AssetsManager
AssetsManager::AssetsManager(const char* packageUrl/* =NULL */, const char* versionFileUrl/* =NULL */, const char* storagePath/* =NULL */)
AssetsManager::AssetsManager(const char* packageUrl/* =nullptr */, const char* versionFileUrl/* =nullptr */, const char* storagePath/* =nullptr */)
: _storagePath(storagePath)
, _version("")
, _packageUrl(packageUrl)
@ -309,9 +309,9 @@ bool AssetsManager::uncompress()
&fileInfo,
fileName,
MAX_FILENAME,
NULL,
nullptr,
0,
NULL,
nullptr,
0) != UNZ_OK)
{
CCLOG("can not read file info");
@ -455,7 +455,7 @@ bool AssetsManager::createDirectory(const char *path)
return true;
#else
BOOL ret = CreateDirectoryA(path, NULL);
BOOL ret = CreateDirectoryA(path, nullptr);
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
{
return false;
@ -632,7 +632,7 @@ void AssetsManager::createStoragePath()
{
// Remove downloaded files
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)
DIR *dir = NULL;
DIR *dir = nullptr;
dir = opendir (_storagePath.c_str());
if (!dir)

View File

@ -70,7 +70,7 @@ static Vec2 cpVert2Point(const cpVect &vert)
static Vec2* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count)
{
if (count == 0) return NULL;
if (count == 0) return nullptr;
Vec2* pPoints = new Vec2[count];
for (unsigned int i = 0; i < count; ++i)

View File

@ -172,7 +172,7 @@ const Vec2& PhysicsSprite::getPosition() const
void PhysicsSprite::getPosition(float* x, float* y) const
{
if (x == NULL || y == NULL) {
if (x == nullptr || y == nullptr) {
return;
}
const Vec2& pos = getPosFromPhysics();

Some files were not shown because too many files have changed in this diff Show More