mirror of https://github.com/axmolengine/axmol.git
resolve conflict
This commit is contained in:
commit
c3ac446f35
|
@ -37,4 +37,4 @@ before_install:
|
|||
# whitelist
|
||||
branches:
|
||||
only:
|
||||
- v3
|
||||
- v3.8
|
||||
|
|
33
AUTHORS
33
AUTHORS
|
@ -95,6 +95,7 @@ Developers:
|
|||
stari4ek
|
||||
Fix VideoPlayer on Android ignore search paths
|
||||
Label: Improve rendering of letter's inner shapes when outline is used
|
||||
platform: Fixed issue that depth/stencil buffers attributes are ignored on iOS
|
||||
|
||||
FlagellumDei
|
||||
Center the window correctly on windows
|
||||
|
@ -407,6 +408,10 @@ Developers:
|
|||
Add scroll bar feature into ui::ScrollView.
|
||||
Add RadioButton and RaidoButtonGroup widgets.
|
||||
Add a setter for line width in DrawNode.
|
||||
UI: Added a setter for line width in DrawNode
|
||||
UI: Added ScrollViewBar for displaying a scroll bar at the side of ScrollView
|
||||
UI: Added RadioButton widget
|
||||
UI: Refined scroll event dispatching for ScrollView
|
||||
|
||||
Sam Clegg (sbc100)
|
||||
Author of Native Client port.
|
||||
|
@ -700,6 +705,7 @@ Developers:
|
|||
Added operator == != for Value
|
||||
Replace dynamic_cast to std::is_base_of in object_to_luaval
|
||||
Added support normalize path on android
|
||||
FileUtils: Remove old path while adding existing search path
|
||||
|
||||
superrad
|
||||
Clear NoSuchMethodError Exception when JniHelper fails to find methodID
|
||||
|
@ -977,6 +983,7 @@ Developers:
|
|||
|
||||
billtt
|
||||
Fixed a bug that Node::setScale(float) may not work properly
|
||||
network: Fixed a problem where WebSocket messages may pile up
|
||||
|
||||
Teivaz
|
||||
Custom uniform search optimization
|
||||
|
@ -1019,6 +1026,7 @@ Developers:
|
|||
|
||||
takaken1994
|
||||
Added function for setting min/max scale for ScrollView
|
||||
studio: Removed "using namespace cocos2d" from CCFrame.h
|
||||
|
||||
maltium
|
||||
Added 3D rotation support to RotateTo action
|
||||
|
@ -1115,6 +1123,7 @@ Developers:
|
|||
|
||||
kompjoefriek
|
||||
Fix compiling warnings
|
||||
Device: Added vibrate support to enable vibration for a duration.
|
||||
|
||||
tmr111116
|
||||
fix random int overflow
|
||||
|
@ -1148,6 +1157,10 @@ Developers:
|
|||
perminovVS
|
||||
Optimize Vec3 and Vec2
|
||||
Added `UserDefault::setDelegate()`
|
||||
FileUtils: Added FileUtils::getSuitableFOpen() for convert utf8 to locale, for specific platform
|
||||
platform: Correct all usage of unicode version winapi in FileUtils for win32
|
||||
FileUtils: Added FileUtils::getFileExtension for getting file's extension name
|
||||
utils: Made utils::captureScreen saving file in another thread to improve the performance
|
||||
|
||||
qiutaoleo
|
||||
Added a feature to check case characters for filename on windows
|
||||
|
@ -1159,12 +1172,14 @@ Developers:
|
|||
Fixed crash on AssetsManager
|
||||
Fixed memory leak of WebView on iOS
|
||||
Fixed crahed that if url contains illegal characters on Android
|
||||
log: Fixed crash on Windows if passing string more than 16kb to cocos2d::log
|
||||
|
||||
tankorsmash
|
||||
Fixed the bug that ProgressTimer::setSprite() doesn't take effect
|
||||
|
||||
namezero111111
|
||||
ui: TextField add `getTextColor`, `getTextHorizontalAlignment` and `getTextVerticalAlignment` API
|
||||
Physics: Fixed circle shape debug draw incorrect issue
|
||||
|
||||
shinhirota
|
||||
JS: Fixed issue of iOS/JS reflection `callStaticMethod` with bool arg
|
||||
|
@ -1177,15 +1192,27 @@ Developers:
|
|||
iris-wy
|
||||
platform: Fixed warning "Service Intent must be explicit" on Android
|
||||
|
||||
alexpeak
|
||||
Label: Fixed rendering LabelTTF characters as black boxes on Android by ensuring atlases are purged before resetting
|
||||
|
||||
ywxzm
|
||||
Lua: Fixed onTouch begin don't return value
|
||||
|
||||
xpol
|
||||
Sprite: Fixed some warnings and a related bug in CCSprite
|
||||
|
||||
marzapower
|
||||
UI: Fixed inertial scrolling for CCScrollView
|
||||
|
||||
MAUSMAUSgames
|
||||
Action: Permitted setting bitwise flags to action
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
Author of windows port, CCTextField,
|
||||
Designer of CCApplication/CCEGLView/platform structure.
|
||||
He's working together with 2dx core team but leading FishingJoy game
|
||||
|
||||
Bin Zhang
|
||||
core-team member but put himself in FishingJoy game since 2012.
|
||||
|
||||
RongHong Huang (flyingpaper)
|
||||
Author of cocos2d-xna and spent all his time on wp7.
|
||||
|
||||
|
|
213
CHANGELOG
213
CHANGELOG
|
@ -1,9 +1,212 @@
|
|||
cocos2d-x-3.8 ??
|
||||
[NEW] ui: Enhance ScrollView with easing out scrolling
|
||||
[NEW] Animate: Added Animate's getCurrentFrameIndex function
|
||||
cocos2d-x-3.8 rc0 August.26 2015
|
||||
cocos2d-x-3.8 beta0 August.14 2015
|
||||
|
||||
[HIGHLIGHT] 3D: Added 3d physics collider
|
||||
[HIGHLIGHT] 3D: Supported setting camera background brushes with color/depth/skybox
|
||||
[HIGHLIGHT] 3D: Added key frame event Callback in Animate3D
|
||||
[HIGHLIGHT] FileUtils: Added a set of file writing APIs: writeStringToFile, writeDataToFile, writeValueMapToFile, writeValueVectorToFile
|
||||
[HIGHLIGHT] UI: Refined UI system
|
||||
[HIGHLIGHT] UI: Added RadioButton widget (JSB/Lua ready)
|
||||
[HIGHLIGHT] UI: Reimplemented and enhanced EditBox on Android
|
||||
[HIGHLIGHT] JS: Bound new AudioEngine in JSB
|
||||
[HIGHLIGHT] JS: Merged JSB test project into cocos2d test project
|
||||
[HIGHLIGHT] network: Upgrade SocketIO support to v1.x
|
||||
[HIGHLIGHT] tools: Optimize Bindings Generator
|
||||
[HIGHLIGHT] Label: Added HANYI FullType font support
|
||||
|
||||
[FIX] renderer: UI component can't click correctly by moving UI and camera far away of origin.
|
||||
[NEW] 3D: Added light map support in Terrain
|
||||
[NEW] UI: Added ScrollViewBar for displaying a scroll bar at the side of ScrollView (JSB/Lua ready)
|
||||
[NEW] UI: Enhanced ScrollView with easing out scrolling
|
||||
[NEW] UI: Added PageView vertical scroll support
|
||||
[NEW] UI: Added PageView::JumpToPage API
|
||||
[NEW] UI: Added a setter for line width in DrawNode
|
||||
[NEW] Action: Permitted setting bitwise flags to action
|
||||
[NEW] Animate: Added Animate's getCurrentFrameIndex function
|
||||
[NEW] FileUtils: Added FileUtils::getFileExtension for getting file's extension name
|
||||
[NEW] Device: Added vibrate support to enable vibration for a duration
|
||||
[NEW] audio: AudioEngine supported audio preloading
|
||||
[NEW] UserDefault: Supported removing key pairs from UserDefault
|
||||
[NEW] spine: Supported Spine runtime 2.3 (Both native and web engine)
|
||||
[NEW] console: Supported new portrait projects from templates
|
||||
[NEW] console: Moved the framework-compile tools into cocos2d-console
|
||||
[NEW] framework: Support generate prebuilt libs of engine with debug mode
|
||||
[NEW] Supported Xcode 7
|
||||
|
||||
[REFINE] 3D: Supported composite 2D/3D scene by moving UI and camera far away
|
||||
[REFINE] 3D: Improved Particle3D performance
|
||||
[REFINE] 3D: Made SkyBox not transparent
|
||||
[REFINE] Director: Made types to handle time consistent by modifing setAnimationInterval argument from double to float
|
||||
[REFINE] Sprite: Made Sprite::setTexture accept nullptr as parameter
|
||||
[REFINE] TextureCache: Made addImageAsync function thread safe
|
||||
[REFINE] Label: Improved code readability
|
||||
[REFINE] Label: Supported adding child nodes in Label
|
||||
[REFINE] Label: Refine the implementation about text layout and support debug draw
|
||||
[REFINE] Label: Supported auto batch with bitmap font or char map
|
||||
[REFINE] UI: Improved Slider's precision
|
||||
[REFINE] UI: Made Label and Text share the same fontSize type
|
||||
[REFINE] UI: Reduced memory usage in Text
|
||||
[REFINE] UI: Refined scroll event dispatching for ScrollView
|
||||
[REFINE] UI: Made EditBox::setFontSize not rely on font name property
|
||||
[REFINE] UI: Made viewport constructor more compile friendly
|
||||
[REFINE] UI: Improved event handling in TextField
|
||||
[REFINE] studio: Avoid CSLoader from openning csb file multiple times with fopen
|
||||
[REFINE] studio: Added BlendFrame support to Skeleton Animation
|
||||
[REFINE] studio: Enabled blendfunc cascade to the skin of BoneNode
|
||||
[REFINE] FileUtils: Remove old path while adding existing search path
|
||||
[REFINE] Device: Implemented Device::getDPI for Mac
|
||||
[REFINE] network: Refine NSLog in HttpAsynConnection in release mode
|
||||
[REFINE] network: Fixed a problem where WebSocket messages may pile up
|
||||
[REFINE] utils: Made utils::captureScreen saving file in another thread to improve the performance
|
||||
[REFINE] 3rd party: Update Nibiru SDK to 2.6
|
||||
[REFINE] platform: Correct all usage of unicode version winapi in FileUtils for win32
|
||||
[REFINE] JS: Supported new construction for 3d classes in JS
|
||||
[REFINE] JS: Automatically add extend to need to extend classes in bindings generator
|
||||
[REFINE] JS: Made UI classes safely extendable in JSB
|
||||
[REFINE] JS: Improved NodeGrid binding
|
||||
[REFINE] JS: Refine performance for Cocos Studio JSON parser for 2.x
|
||||
[REFINE] JS: Made binding functions accept null in JS and convert to nullptr
|
||||
[REFINE] web: Avoid re-bake the content when the parent node's position get changed
|
||||
[REFINE] web: Solved repeat loading same resource issue when parsing cocos studio project
|
||||
[REFINE] web: Added GameNodeObjectData and GameLayerObjectData in JSON parser
|
||||
[REFINE] web: Updated skeleton animation to the latest version
|
||||
[REFINE] web: Optimized resources automatic loading in JSON parser
|
||||
[REFINE] web: Avoid cc.loader resource loading being terminated while encounter errors
|
||||
[REFINE] web: Throw new Error object instead of error message string
|
||||
[REFINE] web: Move setDepthTest to renderer
|
||||
[REFINE] web: Added BlendFuncFrame parser
|
||||
[REFINE] web: Permitted webp image loading on Chrome
|
||||
[REFINE] web: Suspended the video player when the browser is minimized
|
||||
[REFINE] framework: Optimized the lua & js templates
|
||||
[REFINE] simulator: Made Node, Skeleton needs shown in the middle of the simulator window
|
||||
[REFINE] Removed EMSCRIPTEN support
|
||||
[REFINE] Added template project daily build in Jenkins-ci
|
||||
[REFINE] Removed unused tool gen-prebuilt
|
||||
[REFINE] Removed deprecated API in templates
|
||||
|
||||
[FIX] 3D: Fixed Effect3DOutline issue when the Sprite3D is mirrored
|
||||
[FIX] 3D: Fixed issue that Sprite3D::getAABBRecursively does not get AABB of Nodes with Sprite3d children
|
||||
[FIX] 3D: Fixed Menu unusable in 3D scene
|
||||
[FIX] renderer: UI component can't click correctly by moving UI and camera far away of origin
|
||||
[FIX] renderer: ListView in Camera with custom mask isn't visible
|
||||
[FIX] renderer: Temporary fix for Sprite/Label/FastTMX auto-culling failure
|
||||
[FIX] renderer: Fixed shader issue by reloading shader when light number changed
|
||||
[FIX] Scheduler: Fixed timer's delta time is error when interval equals to zero
|
||||
[FIX] Scheduler: Fixed Pause/Resume act incorrectly
|
||||
[FIX] Node: Fixed issue that euler angle is NaN when update Euler angle from quaternion and asin value is not between -1 and 1 by accident
|
||||
[FIX] Scene: Fixed bug that can't add custom member to Scene subclass
|
||||
[FIX] Sprite: Fixed some warnings and a related bug in CCSprite
|
||||
[FIX] AutoPolygon: Fixed copy construct & assignment operator memory leakage
|
||||
[FIX] SpriteBatchNode: Touch screen might cause rendering order disorder when the screen have numerous sprites
|
||||
[FIX] SpriteBatchNode: Fixed SpriteBatchNode doesn't support setFlipped
|
||||
[FIX] event: Fixed EventDispatcher wrong dispatch order bug
|
||||
[FIX] event: Fixed EventListenerKeyboard.onKeyPressed not firing for back button on Android
|
||||
[FIX] FileUtils: Fixed bug that FileUtils::isDirectoryExist result is not correct on Android while using relative path in 'assets'
|
||||
[FIX] Action: Fixed bug that CCTargetedAction executes callback twice
|
||||
[FIX] audio: Fixed playing new audio after stopping an incessant(loop) audio may fail on MAC/iOS
|
||||
[FIX] audio: Fixed bug that playing audio may fail(error code:-1) on iOS
|
||||
[FIX] audio: Fixed AudioEngine possible crash on iOS/Mac while playing multiply audio
|
||||
[FIX] Label: Fixed rendering LabelTTF characters as black boxes on Android by ensuring atlases are purged before resetting
|
||||
[FIX] Label: Fixed bug that characters are displayed incorrectly with "dark roast.ttf" font
|
||||
[FIX] Label: Fixed opacity setting is invalid with bitmap font
|
||||
[FIX] Label: Fixed the color of letter will be overridden by fade action
|
||||
[FIX] Label: Fixed Label with some specific font is cropped
|
||||
[FIX] Label: Fixed the content size of Label is incorrect with GLOW effect
|
||||
[FIX] Label: Fixed spaces is lost if label created with Fingerpop.ttf
|
||||
[FIX] Label: Fixed Label::getLetter(index)->setVisible(true) cause rendering duplicate letters
|
||||
[FIX] Label: Fixed Label::setGlobalZOrder invalid issue if label create with system font
|
||||
[FIX] UI: Fixed issue that Slider::addEventListener doesn't respect the button pressed and button release event
|
||||
[FIX] UI: Fixed bug that UI component can't be clicked correctly by moving UI and camera far away of origin
|
||||
[FIX] UI: Fixed inertial scrolling for CCScrollView
|
||||
[FIX] UI: Fixed bug that ListView::getCurSelectedIndex may cause out of range issue
|
||||
[FIX] UI: Fixed PageView scrollToPage bug and the curPageIndex bug
|
||||
[FIX] UI: Fixed game scene displays wrongly while clicking EditBox
|
||||
[FIX] UI: Fixed RichText layout cause infinite loop issue
|
||||
[FIX] UI: Fixed formarRenderers in RichText doesn’t update container size
|
||||
[FIX] UI: Fixed TextField hitTest not working as expected issue
|
||||
[FIX] UI: Fixed Widget::setHighlighted does not work after setBright
|
||||
[FIX] UI: Fixed Button touch doesn't work with setScale9Enabled
|
||||
[FIX] UI: Fixed calculation error of Layout viewing area's clipping position in SCISSOR mode
|
||||
[FIX] UI: Fixed logic error in isMaxLengthEnabled handling invoked by TextField::setString
|
||||
[FIX] UI: Fixed improper touch intercept event propagation in UI system
|
||||
[FIX] UI: Fixed EditBox input maxLength for Chinese character issue on iOS
|
||||
[FIX] UI: Fixed EditBox turning black when soft keyboard hiding
|
||||
[FIX] UI: Fixed scrollview innerContainer initial position error
|
||||
[FIX] studio: Removed "using namespace cocos2d" from CCFrame.h
|
||||
[FIX] studio: Fixed the SkyBox display error while parsed from editor files
|
||||
[FIX] studio: Fixed userCamera flag error while parsing old version exported files
|
||||
[FIX] studio: Fixed GameNode3DReader parse failed error
|
||||
[FIX] studio: Fixed crash when loading cocostudio json files with null or empty fontName
|
||||
[FIX] studio: Fixed bug that setColor works on a whole armature, but not on an individual bone
|
||||
[FIX] studio: Fixed object size error while data is error
|
||||
[FIX] ClippingNode: Removed CCClippingRectangleNode transform error support
|
||||
[FIX] spine: Fixed the position of debug draw of bones is incorrect
|
||||
[FIX] spine: Fixed memory leak caused by SkeletonRenderer::initialize
|
||||
[FIX] network: Fixed Downloader::getHeader failure on win32
|
||||
[FIX] AssetsManagerEx: Fix AssetsManager crash by protecting Downloader with shared_ptr
|
||||
[FIX] RenderTexture: Fixed RenderTexture switch foreground to background issue
|
||||
[FIX] Physics: Fixed circle shape debug draw incorrect issue
|
||||
[FIX] Physics: Fix transform issue of PhysicsSprite itself and its children
|
||||
[FIX] tilemap: Fixed small errors in the function TMXXMLParser::getRectForGID
|
||||
[FIX] tilemap: Fixed crash caused by creating TMX object when related image file is missing or broken
|
||||
[FIX] effect: Fixed PageTurn3D effect abnormal
|
||||
[FIX] ProgressTimer: Fixed SpriteProgressToRadialMidpointChanged bug
|
||||
[FIX] log: Fixed crash on Windows if passing string more than 16kb to cocos2d::log
|
||||
[FIX] utils: Fixed utils::captureScreen bug while using multiple camera
|
||||
[FIX] JS: Fixed issue of iOS/JS reflection `callStaticMethod` with bool arg
|
||||
[FIX] JS: Fixed Objective-C JS reflection bug while using callStaticMethod() with bool argument
|
||||
[FIX] JS: Fixed issue that subclass of ccui.Widget which overwrote onEnter will cause infinite recursion
|
||||
[FIX] JS: Fixed Node color property can not be used issue
|
||||
[FIX] JS: Fixed issue that SocketIO events don’t get fired when compile mode set to release
|
||||
[FIX] JS: Added the conversion for tmxTileFlags to fix TMXLayer::tileFlagsAt binding issue
|
||||
[FIX] JS: Fixed jsval_to_int and jsval_to_uint issue on 64 bit system
|
||||
[FIX] Lua: Fixed onTouch begin don't return value
|
||||
[FIX] Lua: Fixed memory leak in LuaMinXmlHttpRequest
|
||||
[FIX] Lua: Fixed checkbox Lua bindings issue
|
||||
[FIX] Lua: Fixed logic issue in cc.pIsSegmentIntersect
|
||||
[FIX] platform: Fixed issue that getStringUTFChars can not passing emotion from java to c++ on Android
|
||||
[FIX] platform: Fixed bug that paused game will be awaked by the Clock on Android
|
||||
[FIX] platform: Fixed bug that Cocos2dxHelper won't be initialized after activity recreate
|
||||
[FIX] platform: Fixed clipping node doesn't work on Android 5.0
|
||||
[FIX] platform: Fixed blur shader compliant on win8 universal
|
||||
[FIX] platform: Fixed the error when compiling android project with release mode on Windows
|
||||
[FIX] platform: Fixed issue that depth/stencil buffers attributes are ignored on iOS
|
||||
[FIX] platform: Fixed engine crash because of wrong initialisation on some android device
|
||||
[FIX] platform: Removed unneeded protocol for AppController on iOS
|
||||
[FIX] platform: Fixed link errors in release mode on win32
|
||||
[FIX] platform: Fixed Windows 10 UWP and WP8.1 app certification issue
|
||||
[FIX] web: Fixed a bug that VideoPlayer remove event throw error
|
||||
[FIX] web: Fixed Armature position error in studio JSON parser
|
||||
[FIX] web: Fixed default clearColor error in director
|
||||
[FIX] web: Fixed rotation value parsing error in the timeline parser
|
||||
[FIX] web: Fixed a bug that nested animation may be affected by outer animation
|
||||
[FIX] web: Made LabelAtlas ignoring invalid characters and updating correctly the content size
|
||||
[FIX] web: Fixed a bug that VideoPlayer remove event throw error
|
||||
[FIX] web: Fixed a bug that cc.director.setNotificationNode(null) doesn't take effect
|
||||
[FIX] web: Fixed texture rect update issue while changing sprite frame
|
||||
[FIX] web: Fixed effect issue in ActionGrid and NodeGrid
|
||||
[FIX] web: Fixed logic issue in Menu's _onTouchCancelled function
|
||||
[FIX] web: Fixed MenuItem crash when normal image is null
|
||||
[FIX] web: Fixed CCTouch's startPoint unset issue
|
||||
|
||||
[TEST] 3D: Avoid to trigger touch event multiple times in Physics3D Test and Physics3D Constraint Test
|
||||
[TEST] 3D: Fixed Sprite3D test background to foreground bug
|
||||
[TEST] renderer: Added auto culling test case
|
||||
[TEST] renderer: Fixed material parsing test on wp8.1
|
||||
[TEST] OpenGL: Fixed shader-basic and OpenGL testcase 'center' uniform error
|
||||
[TEST] OpenGL: Fixed ShaderRetroEffect random crash issue
|
||||
[TEST] OpenGL: Fixed offset on retina screen in shaderTest
|
||||
[TEST] OpenGL: Fixed shader test crash on android device
|
||||
[TEST] OpenGL: Fixed retro effect pos bug in ShaderTest
|
||||
[TEST] UI: Improved UIScene testcase
|
||||
[TEST] studio: Fixed cocostudio 3d test crash on mobile platform
|
||||
[TEST] studio: Added blendfunc Frame test case for skeleton animation
|
||||
[TEST] spine: Fixed bug that spine animition can't be rendered in Scene3DTest
|
||||
[TEST] tilemap: Fixed the problem that white frame didn't move as map did in JSB TMXOrthoObjectsTest
|
||||
[TEST] JS: Fixed Button position error in UIPageViewTest
|
||||
[TEST] web: Rewrote testcase for stencil depth mask in RenderTextureTest
|
||||
[TEST] web: Improved renderTexture stencilDepth test
|
||||
[TEST] web: Fixed abnormal effects in effectsTest
|
||||
[TEST] web: Fixed invisiable testcase of effects
|
||||
|
||||
cocos2d-x-3.7.1 August.12 2015
|
||||
[HIGHLIGHT] studio: Added new skeleton animation support and csb parser for cocos v2.3.2 beta
|
||||
|
@ -84,7 +287,7 @@ cocos2d-x-3.7rc0 July.1 2015
|
|||
[HIGHLIGHT] 3d: Added Physics3d support (JS/Lua ready)
|
||||
[HIGHLIGHT] 3d: Added NavMesh support (JS/Lua ready)
|
||||
[HIGHLIGHT] Scale9Sprite: Added Android 9-patch image support (JS/Lua ready)
|
||||
[HIGHLIGHT] sprite: Supportted polygon sprite with AutoPolygon generator (JS/Lua ready)
|
||||
[HIGHLIGHT] sprite: Supported polygon sprite with AutoPolygon generator (JS/Lua ready)
|
||||
[HIGHLIGHT] platform: Added Windows 10.0 Universal App(UWP) support
|
||||
[HIGHLIGHT] platform: Add Samsung Enhanced API on Android for cocos, please refer to the release note for more details
|
||||
[HIGHLIGHT] C++: Added Android Studio support
|
||||
|
|
|
@ -38,7 +38,7 @@ endif()
|
|||
project (Cocos2d-X)
|
||||
|
||||
# The version number
|
||||
set(COCOS2D_X_VERSION 3.7.1)
|
||||
set(COCOS2D_X_VERSION 3.8)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
|
||||
include(CocosBuildHelpers)
|
||||
|
|
17
README.md
17
README.md
|
@ -6,8 +6,8 @@ cocos2d-x
|
|||
|
||||
| |iOS|Mac|Linux|Win32|Android|Win8.1-Universal|
|
||||
| ----|----|----- | ---|----|------|---|
|
||||
|v3|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=ios)](http://45.56.80.45:8080/job/daily-build-v3/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=mac)](http://45.56.80.45:8080/job/daily-build-v3/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=linux)](http://45.56.80.45:8080/job/daily-build-v3/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=win32)](http://45.56.80.45:8080/job/daily-build-v3/node=win32)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=android)](http://45.56.80.45:8080/job/daily-build-v3/node=android)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=windows-universal)](http://45.56.80.45:8080/job/daily-build-v3/node=windows-universal)|
|
||||
|v4|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=ios)](http://45.56.80.45:8080/job/daily-build-v4/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=mac)](http://45.56.80.45:8080/job/daily-build-v4/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=linux)](http://45.56.80.45:8080/job/daily-build-v4/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=win32)](http://45.56.80.45:8080/job/daily-build-v4/node=win32)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=android)](http://45.56.80.45:8080/job/daily-build-v4/node=android)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=windows-universal)](http://45.56.80.45:8080/job/daily-build-v4/node=windows-universal)|
|
||||
|v3|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=ios)](http://45.56.80.45:8080/job/daily-build-v3/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=mac)](http://45.56.80.45:8080/job/daily-build-v3/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=linux)](http://45.56.80.45:8080/job/daily-build-v3/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=win32_bak)](http://45.56.80.45:8080/job/daily-build-v3/node=win32_bak)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=android)](http://45.56.80.45:8080/job/daily-build-v3/node=android)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=windows-universal_bak)](http://45.56.80.45:8080/job/daily-build-v3/node=windows-universal_bak)|
|
||||
|v4|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=ios)](http://45.56.80.45:8080/job/daily-build-v4/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=mac)](http://45.56.80.45:8080/job/daily-build-v4/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=linux)](http://45.56.80.45:8080/job/daily-build-v4/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=win32_bak)](http://45.56.80.45:8080/job/daily-build-v4/node=win32_bak)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=android)](http://45.56.80.45:8080/job/daily-build-v4/node=android)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v4/node=windows-universal_bak)](http://45.56.80.45:8080/job/daily-build-v4/node=windows-universal_bak)|
|
||||
|
||||
|
||||
|
||||
|
@ -104,10 +104,10 @@ Run
|
|||
|
||||
* Visual Studio 2013 Update 4 or later is required for Windows 8.1 Universal Apps
|
||||
|
||||
* Visual Studio 2015 RC and Windows 10.0 (build 10074 or higher) is required for Windows 10.0 UWP Apps
|
||||
* Visual Studio 2015 (Release version) and Windows 10.0 (Release version) are required for Windows 10.0 Universal Windows Platform (UWP) Apps. RC versions of Visual Studio and Window 10 are no longer supported.
|
||||
|
||||
Starting with Cocos2d-x v3.3, you can create Windows 8.1 Universal Apps (Windows Store and Windows Phone 8.1).
|
||||
Starting with Cocos2d-x v3.6 you can create Windows 10.0 UWP Apps (Windows Store and Windows Phone 10.0).
|
||||
Starting with Cocos2d-x v3.8 you can create Windows 10.0 UWP Apps (Windows Store and Windows Phone 10.0).
|
||||
Starting with Cocos2d-x v3.6 there will no longer be support for Windows Phone 8.0.
|
||||
|
||||
See more info on How to install and Create games on Windows RT (Windows and Windows Phone 8.1) at http://msopentech.github.io/cocos2d-x/
|
||||
|
@ -176,14 +176,15 @@ Build Requirements
|
|||
* or Windows 7+, VS 2013+
|
||||
* Python 2.7.5
|
||||
* NDK r10c+ is required to build Android games
|
||||
* Windows Phone/Store 8.1 VS 2013 Update 4+
|
||||
* Windows Phone/Store 8.1 VS 2013 Update 4+ or VS 2015
|
||||
* Windows Phone/Store 10.0 VS 2015
|
||||
* JRE or JDK 1.6+ is required for web publishing
|
||||
|
||||
Runtime Requirements
|
||||
--------------------
|
||||
* iOS 5.0+ for iPhone / iPad games
|
||||
* Android 2.3+ for Android games
|
||||
* Windows 8.1 for Windows Phone/Store 8.1 games
|
||||
* Windows 8.1 or Windows 10.0 for Windows Phone/Store 8.1 games
|
||||
* Windows 10.0 for Windows Phone/Store 10.0 games
|
||||
* OS X v10.6+ for Mac games
|
||||
* Windows 7+ for Win games
|
||||
|
@ -244,6 +245,10 @@ Open the `cocos2d-x/build/cocos2d-win32.sln`
|
|||
|
||||
Open the `cocos2d-x/build/cocos2d-win8.1-universal.sln`
|
||||
|
||||
* For Windows 10.0 Universal Windows Platform (UWP) Apps (Phone and Store)
|
||||
|
||||
Open the `cocos2d-x/build/cocos2d-win10.sln`
|
||||
|
||||
* For Android
|
||||
|
||||
```
|
||||
|
|
|
@ -2059,6 +2059,10 @@
|
|||
B60C5BD519AC68B10056FBDE /* CCBillBoard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B60C5BD219AC68B10056FBDE /* CCBillBoard.cpp */; };
|
||||
B60C5BD619AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; };
|
||||
B60C5BD719AC68B10056FBDE /* CCBillBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = B60C5BD319AC68B10056FBDE /* CCBillBoard.h */; };
|
||||
B62305641B8ABA6600F0745D /* CCTextureCube.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B62305621B8ABA6600F0745D /* CCTextureCube.cpp */; };
|
||||
B62305651B8ABA6600F0745D /* CCTextureCube.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B62305621B8ABA6600F0745D /* CCTextureCube.cpp */; };
|
||||
B62305661B8ABA6600F0745D /* CCTextureCube.h in Headers */ = {isa = PBXBuildFile; fileRef = B62305631B8ABA6600F0745D /* CCTextureCube.h */; };
|
||||
B62305671B8ABA6600F0745D /* CCTextureCube.h in Headers */ = {isa = PBXBuildFile; fileRef = B62305631B8ABA6600F0745D /* CCTextureCube.h */; };
|
||||
B63990CC1A490AFE00B07923 /* CCAsyncTaskPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B63990CA1A490AFE00B07923 /* CCAsyncTaskPool.cpp */; };
|
||||
B63990CD1A490AFE00B07923 /* CCAsyncTaskPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B63990CA1A490AFE00B07923 /* CCAsyncTaskPool.cpp */; };
|
||||
B63990CE1A490AFE00B07923 /* CCAsyncTaskPool.h in Headers */ = {isa = PBXBuildFile; fileRef = B63990CB1A490AFE00B07923 /* CCAsyncTaskPool.h */; };
|
||||
|
@ -3517,10 +3521,6 @@
|
|||
B6D38B8B1AC3AFAC00043997 /* CCSkybox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6D38B861AC3AFAC00043997 /* CCSkybox.cpp */; };
|
||||
B6D38B8C1AC3AFAC00043997 /* CCSkybox.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D38B871AC3AFAC00043997 /* CCSkybox.h */; };
|
||||
B6D38B8D1AC3AFAC00043997 /* CCSkybox.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D38B871AC3AFAC00043997 /* CCSkybox.h */; };
|
||||
B6D38B8E1AC3AFAC00043997 /* CCTextureCube.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6D38B881AC3AFAC00043997 /* CCTextureCube.cpp */; };
|
||||
B6D38B8F1AC3AFAC00043997 /* CCTextureCube.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6D38B881AC3AFAC00043997 /* CCTextureCube.cpp */; };
|
||||
B6D38B901AC3AFAC00043997 /* CCTextureCube.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D38B891AC3AFAC00043997 /* CCTextureCube.h */; };
|
||||
B6D38B911AC3AFAC00043997 /* CCTextureCube.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D38B891AC3AFAC00043997 /* CCTextureCube.h */; };
|
||||
B6DD2FA71B04825B00E47F5F /* DebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6DD2F7A1B04825B00E47F5F /* DebugDraw.cpp */; };
|
||||
B6DD2FA81B04825B00E47F5F /* DebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6DD2F7A1B04825B00E47F5F /* DebugDraw.cpp */; };
|
||||
B6DD2FA91B04825B00E47F5F /* DebugDraw.h in Headers */ = {isa = PBXBuildFile; fileRef = B6DD2F7B1B04825B00E47F5F /* DebugDraw.h */; };
|
||||
|
@ -3603,6 +3603,10 @@
|
|||
B6DD2FF61B04825B00E47F5F /* fastlz.c in Sources */ = {isa = PBXBuildFile; fileRef = B6DD2FA51B04825B00E47F5F /* fastlz.c */; };
|
||||
B6DD2FF71B04825B00E47F5F /* fastlz.h in Headers */ = {isa = PBXBuildFile; fileRef = B6DD2FA61B04825B00E47F5F /* fastlz.h */; };
|
||||
B6DD2FF81B04825B00E47F5F /* fastlz.h in Headers */ = {isa = PBXBuildFile; fileRef = B6DD2FA61B04825B00E47F5F /* fastlz.h */; };
|
||||
B6DD36D51B8564EC0044745A /* CCCameraBackgroundBrush.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6DD36D31B8564EC0044745A /* CCCameraBackgroundBrush.cpp */; };
|
||||
B6DD36D61B8564EC0044745A /* CCCameraBackgroundBrush.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6DD36D31B8564EC0044745A /* CCCameraBackgroundBrush.cpp */; };
|
||||
B6DD36D71B8564EC0044745A /* CCCameraBackgroundBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = B6DD36D41B8564EC0044745A /* CCCameraBackgroundBrush.h */; };
|
||||
B6DD36D81B8564EC0044745A /* CCCameraBackgroundBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = B6DD36D41B8564EC0044745A /* CCCameraBackgroundBrush.h */; };
|
||||
C50306691B60B583001E6D43 /* CCBoneNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50306631B60B583001E6D43 /* CCBoneNode.cpp */; };
|
||||
C503066A1B60B583001E6D43 /* CCBoneNode.h in Headers */ = {isa = PBXBuildFile; fileRef = C50306641B60B583001E6D43 /* CCBoneNode.h */; };
|
||||
C503066B1B60B583001E6D43 /* CCSkeletonNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50306651B60B583001E6D43 /* CCSkeletonNode.cpp */; };
|
||||
|
@ -4767,6 +4771,8 @@
|
|||
B603F1B21AC8F1FD00A9579C /* ccShader_3D_Terrain.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Terrain.vert; sourceTree = "<group>"; };
|
||||
B60C5BD219AC68B10056FBDE /* CCBillBoard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBillBoard.cpp; sourceTree = "<group>"; };
|
||||
B60C5BD319AC68B10056FBDE /* CCBillBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBillBoard.h; sourceTree = "<group>"; };
|
||||
B62305621B8ABA6600F0745D /* CCTextureCube.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureCube.cpp; sourceTree = "<group>"; };
|
||||
B62305631B8ABA6600F0745D /* CCTextureCube.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCube.h; sourceTree = "<group>"; };
|
||||
B63990CA1A490AFE00B07923 /* CCAsyncTaskPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCAsyncTaskPool.cpp; path = ../base/CCAsyncTaskPool.cpp; sourceTree = "<group>"; };
|
||||
B63990CB1A490AFE00B07923 /* CCAsyncTaskPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAsyncTaskPool.h; path = ../base/CCAsyncTaskPool.h; sourceTree = "<group>"; };
|
||||
B665E0CC1AA80A6500DDB1C5 /* CCPUAffector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCPUAffector.cpp; path = Particle3D/PU/CCPUAffector.cpp; sourceTree = "<group>"; };
|
||||
|
@ -5499,8 +5505,6 @@
|
|||
B6CAB1E01AF9AA1A00B9B856 /* MiniCLTaskScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MiniCLTaskScheduler.h; sourceTree = "<group>"; };
|
||||
B6D38B861AC3AFAC00043997 /* CCSkybox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkybox.cpp; sourceTree = "<group>"; };
|
||||
B6D38B871AC3AFAC00043997 /* CCSkybox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkybox.h; sourceTree = "<group>"; };
|
||||
B6D38B881AC3AFAC00043997 /* CCTextureCube.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureCube.cpp; sourceTree = "<group>"; };
|
||||
B6D38B891AC3AFAC00043997 /* CCTextureCube.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCube.h; sourceTree = "<group>"; };
|
||||
B6D38B941AC3B45600043997 /* ccShader_3D_Particle.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Particle.frag; sourceTree = "<group>"; };
|
||||
B6D38B951AC3B45600043997 /* ccShader_3D_Particle.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Particle.vert; sourceTree = "<group>"; };
|
||||
B6D38B961AC3B45600043997 /* ccShader_3D_Skybox.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Skybox.frag; sourceTree = "<group>"; };
|
||||
|
@ -5546,6 +5550,8 @@
|
|||
B6DD2FA31B04825B00E47F5F /* DetourTileCacheBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetourTileCacheBuilder.h; sourceTree = "<group>"; };
|
||||
B6DD2FA51B04825B00E47F5F /* fastlz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fastlz.c; sourceTree = "<group>"; };
|
||||
B6DD2FA61B04825B00E47F5F /* fastlz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fastlz.h; sourceTree = "<group>"; };
|
||||
B6DD36D31B8564EC0044745A /* CCCameraBackgroundBrush.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCCameraBackgroundBrush.cpp; sourceTree = "<group>"; };
|
||||
B6DD36D41B8564EC0044745A /* CCCameraBackgroundBrush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCameraBackgroundBrush.h; sourceTree = "<group>"; };
|
||||
C50306631B60B583001E6D43 /* CCBoneNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBoneNode.cpp; sourceTree = "<group>"; };
|
||||
C50306641B60B583001E6D43 /* CCBoneNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBoneNode.h; sourceTree = "<group>"; };
|
||||
C50306651B60B583001E6D43 /* CCSkeletonNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeletonNode.cpp; sourceTree = "<group>"; };
|
||||
|
@ -7327,6 +7333,8 @@
|
|||
46A169A11807B037005B8026 /* 2d */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B6DD36D31B8564EC0044745A /* CCCameraBackgroundBrush.cpp */,
|
||||
B6DD36D41B8564EC0044745A /* CCCameraBackgroundBrush.h */,
|
||||
3EACC99C19F5014D00EB3C5E /* CCCamera.cpp */,
|
||||
3EACC99D19F5014D00EB3C5E /* CCCamera.h */,
|
||||
3EACC99E19F5014D00EB3C5E /* CCLight.cpp */,
|
||||
|
@ -7422,6 +7430,8 @@
|
|||
500DC89819105D41007B91BF /* renderer */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B62305621B8ABA6600F0745D /* CCTextureCube.cpp */,
|
||||
B62305631B8ABA6600F0745D /* CCTextureCube.h */,
|
||||
B240C5E71B09DFB000137F50 /* CCFrameBuffer.cpp */,
|
||||
B240C5E81B09DFB000137F50 /* CCFrameBuffer.h */,
|
||||
5034CA5D191D591900CE6051 /* shaders */,
|
||||
|
@ -7865,8 +7875,6 @@
|
|||
B603F1A71AC8EA0900A9579C /* CCTerrain.h */,
|
||||
B6D38B861AC3AFAC00043997 /* CCSkybox.cpp */,
|
||||
B6D38B871AC3AFAC00043997 /* CCSkybox.h */,
|
||||
B6D38B881AC3AFAC00043997 /* CCTextureCube.cpp */,
|
||||
B6D38B891AC3AFAC00043997 /* CCTextureCube.h */,
|
||||
5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */,
|
||||
5E9F61231A3FFE3D0038DE01 /* CCFrustum.h */,
|
||||
5E9F61241A3FFE3D0038DE01 /* CCPlane.cpp */,
|
||||
|
@ -9330,6 +9338,7 @@
|
|||
15AE1BDD19AAE01E00C27E9E /* CCControlUtils.h in Headers */,
|
||||
B6CAB3271AF9AA1A00B9B856 /* btGImpactBvh.h in Headers */,
|
||||
15AE198D19AAD36E00C27E9E /* CheckBoxReader.h in Headers */,
|
||||
B6DD36D71B8564EC0044745A /* CCCameraBackgroundBrush.h in Headers */,
|
||||
B29A7E0919EE1B7700872B35 /* AttachmentLoader.h in Headers */,
|
||||
1A01C68818F57BE800EFE3A6 /* CCBool.h in Headers */,
|
||||
B29A7E3319EE1B7700872B35 /* SlotData.h in Headers */,
|
||||
|
@ -9434,6 +9443,7 @@
|
|||
B665E43C1AA80A6600DDB1C5 /* CCPUVortexAffectorTranslator.h in Headers */,
|
||||
15AE191C19AAD35000C27E9E /* CCTransformHelp.h in Headers */,
|
||||
5034CA2F191D591100CE6051 /* ccShader_PositionTexture.vert in Headers */,
|
||||
B62305661B8ABA6600F0745D /* CCTextureCube.h in Headers */,
|
||||
B665E4241AA80A6600DDB1C5 /* CCPUTranslateManager.h in Headers */,
|
||||
15AE1C1219AAE2C600C27E9E /* CCPhysicsDebugNode.h in Headers */,
|
||||
B665E3381AA80A6500DDB1C5 /* CCPUOnEmissionObserverTranslator.h in Headers */,
|
||||
|
@ -9666,7 +9676,6 @@
|
|||
B6CAB2B51AF9AA1A00B9B856 /* btConvexShape.h in Headers */,
|
||||
B60C5BD619AC68B10056FBDE /* CCBillBoard.h in Headers */,
|
||||
15AE1BA419AADFDF00C27E9E /* UILayoutManager.h in Headers */,
|
||||
B6D38B901AC3AFAC00043997 /* CCTextureCube.h in Headers */,
|
||||
1A01C69418F57BE800EFE3A6 /* CCFloat.h in Headers */,
|
||||
1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */,
|
||||
B6CAB4C31AF9AA1A00B9B856 /* Box.h in Headers */,
|
||||
|
@ -10286,6 +10295,7 @@
|
|||
1A5701A4180BCB590088DEC7 /* CCFontAtlas.h in Headers */,
|
||||
B6CAB4C41AF9AA1A00B9B856 /* Box.h in Headers */,
|
||||
15AE1C0219AAE01E00C27E9E /* CCScrollView.h in Headers */,
|
||||
B62305671B8ABA6600F0745D /* CCTextureCube.h in Headers */,
|
||||
1A5701A8180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */,
|
||||
B665E3E51AA80A6600DDB1C5 /* CCPUSineForceAffector.h in Headers */,
|
||||
182C5CE81A9D725400C30D34 /* UserCameraReader.h in Headers */,
|
||||
|
@ -10478,7 +10488,6 @@
|
|||
15AE1AC919AAD40300C27E9E /* b2Joint.h in Headers */,
|
||||
382383EF1A258FA7002C4610 /* flatbuffers.h in Headers */,
|
||||
B677B0CC1B18492D006762CB /* CCNavMesh.h in Headers */,
|
||||
B6D38B911AC3AFAC00043997 /* CCTextureCube.h in Headers */,
|
||||
B665E2811AA80A6500DDB1C5 /* CCPUDoScaleEventHandlerTranslator.h in Headers */,
|
||||
15AE196819AAD35100C27E9E /* CCUtilMath.h in Headers */,
|
||||
B29A7E2019EE1B7700872B35 /* BoneData.h in Headers */,
|
||||
|
@ -10810,6 +10819,7 @@
|
|||
B29A7DDA19EE1B7700872B35 /* SkeletonRenderer.h in Headers */,
|
||||
15AE194119AAD35100C27E9E /* CCBone.h in Headers */,
|
||||
D0FD035A1A3B51AA00825BB5 /* CCAllocatorStrategyDefault.h in Headers */,
|
||||
B6DD36D81B8564EC0044745A /* CCCameraBackgroundBrush.h in Headers */,
|
||||
50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */,
|
||||
B6CAB4D81AF9AA1A00B9B856 /* SpuLocalSupport.h in Headers */,
|
||||
B6CAB2921AF9AA1A00B9B856 /* btCollisionShape.h in Headers */,
|
||||
|
@ -11041,6 +11051,7 @@
|
|||
B6CAB2811AF9AA1A00B9B856 /* btBoxShape.cpp in Sources */,
|
||||
50ABBE311925AB6F00A911A9 /* CCConfiguration.cpp in Sources */,
|
||||
B665E3821AA80A6500DDB1C5 /* CCPUPathFollower.cpp in Sources */,
|
||||
B6DD36D51B8564EC0044745A /* CCCameraBackgroundBrush.cpp in Sources */,
|
||||
1A01C6A418F58F7500EFE3A6 /* CCNotificationCenter.cpp in Sources */,
|
||||
15AE1A5D19AAD40300C27E9E /* b2Body.cpp in Sources */,
|
||||
15AE1BDA19AAE01E00C27E9E /* CCControlSwitch.cpp in Sources */,
|
||||
|
@ -11088,7 +11099,6 @@
|
|||
B665E24E1AA80A6500DDB1C5 /* CCPUColorAffectorTranslator.cpp in Sources */,
|
||||
B6CAB1E71AF9AA1A00B9B856 /* btAxisSweep3.cpp in Sources */,
|
||||
B6CAB2D91AF9AA1A00B9B856 /* btPolyhedralConvexShape.cpp in Sources */,
|
||||
B6D38B8E1AC3AFAC00043997 /* CCTextureCube.cpp in Sources */,
|
||||
15AE1B9B19AADFDF00C27E9E /* UIRelativeBox.cpp in Sources */,
|
||||
B665E3E21AA80A6600DDB1C5 /* CCPUSineForceAffector.cpp in Sources */,
|
||||
50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */,
|
||||
|
@ -11163,6 +11173,7 @@
|
|||
1A57006D180BC5A10088DEC7 /* CCActionEase.cpp in Sources */,
|
||||
15AE1A5019AAD40300C27E9E /* b2BlockAllocator.cpp in Sources */,
|
||||
B665E20E1AA80A6500DDB1C5 /* CCPUBaseForceAffector.cpp in Sources */,
|
||||
B62305641B8ABA6600F0745D /* CCTextureCube.cpp in Sources */,
|
||||
B6CAB25D1AF9AA1A00B9B856 /* btInternalEdgeUtility.cpp in Sources */,
|
||||
15AE1A8219AAD40300C27E9E /* b2GearJoint.cpp in Sources */,
|
||||
1A570071180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */,
|
||||
|
@ -12016,6 +12027,7 @@
|
|||
15AE1A3C19AAD3D500C27E9E /* b2CollideCircle.cpp in Sources */,
|
||||
501216951AC47393009A4BEA /* CCPass.cpp in Sources */,
|
||||
50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */,
|
||||
B62305651B8ABA6600F0745D /* CCTextureCube.cpp in Sources */,
|
||||
B665E2CB1AA80A6500DDB1C5 /* CCPUGravityAffectorTranslator.cpp in Sources */,
|
||||
15AE18D719AAD33D00C27E9E /* CCScrollViewLoader.cpp in Sources */,
|
||||
50CB247C19D9C5A100687767 /* AudioEngine-inl.mm in Sources */,
|
||||
|
@ -12051,6 +12063,7 @@
|
|||
3EACC9A519F5014D00EB3C5E /* CCLight.cpp in Sources */,
|
||||
15AE1B7A19AADA9A00C27E9E /* UIScrollView.cpp in Sources */,
|
||||
1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */,
|
||||
B6DD36D61B8564EC0044745A /* CCCameraBackgroundBrush.cpp in Sources */,
|
||||
B6CAB38C1AF9AA1A00B9B856 /* btPolyhedralContactClipping.cpp in Sources */,
|
||||
B6CAB3A41AF9AA1A00B9B856 /* btConeTwistConstraint.cpp in Sources */,
|
||||
15AE19B219AAD39700C27E9E /* SliderReader.cpp in Sources */,
|
||||
|
@ -12216,7 +12229,6 @@
|
|||
B6CAB2A41AF9AA1A00B9B856 /* btConvexHullShape.cpp in Sources */,
|
||||
15AE1AA519AAD40300C27E9E /* b2Fixture.cpp in Sources */,
|
||||
B29A7DE219EE1B7700872B35 /* MeshAttachment.c in Sources */,
|
||||
B6D38B8F1AC3AFAC00043997 /* CCTextureCube.cpp in Sources */,
|
||||
B6CAB2C01AF9AA1A00B9B856 /* btEmptyShape.cpp in Sources */,
|
||||
15AE1BAD19AADFDF00C27E9E /* UILayoutParameter.cpp in Sources */,
|
||||
3823843E1A259140002C4610 /* SingleNodeReader.cpp in Sources */,
|
||||
|
|
|
@ -44,7 +44,7 @@ isVertsOwner(true),
|
|||
rect()
|
||||
{
|
||||
filename = other.filename;
|
||||
isVertsOwner = other.isVertsOwner;
|
||||
isVertsOwner = true;
|
||||
rect = other.rect;
|
||||
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
|
||||
triangles.indices = new unsigned short[other.triangles.indexCount];
|
||||
|
@ -60,7 +60,7 @@ PolygonInfo& PolygonInfo::operator= (const PolygonInfo& other)
|
|||
{
|
||||
releaseVertsAndIndices();
|
||||
filename = other.filename;
|
||||
isVertsOwner = other.isVertsOwner;
|
||||
isVertsOwner = true;
|
||||
rect = other.rect;
|
||||
triangles.verts = new V3F_C4B_T2F[other.triangles.vertCount];
|
||||
triangles.indices = new unsigned short[other.triangles.indexCount];
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
****************************************************************************/
|
||||
#include "2d/CCCamera.h"
|
||||
#include "2d/CCCameraBackgroundBrush.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "platform/CCGLView.h"
|
||||
#include "2d/CCScene.h"
|
||||
|
@ -96,11 +97,14 @@ Camera::Camera()
|
|||
, _fbo(nullptr)
|
||||
{
|
||||
_frustum.setClipZ(true);
|
||||
_clearBrush = CameraBackgroundBrush::createDepthBrush(1.f);
|
||||
_clearBrush->retain();
|
||||
}
|
||||
|
||||
Camera::~Camera()
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(_fbo);
|
||||
CC_SAFE_RELEASE(_clearBrush);
|
||||
}
|
||||
|
||||
const Mat4& Camera::getProjectionMatrix() const
|
||||
|
@ -398,86 +402,11 @@ void Camera::setScene(Scene* scene)
|
|||
}
|
||||
}
|
||||
|
||||
void Camera::clearBackground(float depth)
|
||||
void Camera::clearBackground()
|
||||
{
|
||||
GLboolean oldDepthTest;
|
||||
GLint oldDepthFunc;
|
||||
GLboolean oldDepthMask;
|
||||
if (_clearBrush)
|
||||
{
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
glStencilMask(0);
|
||||
|
||||
oldDepthTest = glIsEnabled(GL_DEPTH_TEST);
|
||||
glGetIntegerv(GL_DEPTH_FUNC, &oldDepthFunc);
|
||||
glGetBooleanv(GL_DEPTH_WRITEMASK, &oldDepthMask);
|
||||
|
||||
glDepthMask(GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
}
|
||||
|
||||
//draw
|
||||
static V3F_C4B_T2F_Quad quad;
|
||||
quad.bl.vertices = Vec3(-1,-1,0);
|
||||
quad.br.vertices = Vec3(1,-1,0);
|
||||
quad.tl.vertices = Vec3(-1,1,0);
|
||||
quad.tr.vertices = Vec3(1,1,0);
|
||||
|
||||
quad.bl.colors = quad.br.colors = quad.tl.colors = quad.tr.colors = Color4B(0,0,0,1);
|
||||
|
||||
quad.bl.texCoords = Tex2F(0,0);
|
||||
quad.br.texCoords = Tex2F(1,0);
|
||||
quad.tl.texCoords = Tex2F(0,1);
|
||||
quad.tr.texCoords = Tex2F(1,1);
|
||||
|
||||
auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_CAMERA_CLEAR);
|
||||
auto programState = GLProgramState::getOrCreateWithGLProgram(shader);
|
||||
programState->setUniformFloat("depth", 1.0);
|
||||
programState->apply(Mat4());
|
||||
GLshort indices[6] = {0, 1, 2, 3, 2, 1};
|
||||
|
||||
{
|
||||
GL::bindVAO(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
|
||||
|
||||
// vertices
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), &quad.tl.vertices);
|
||||
|
||||
// colors
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_T2F), &quad.tl.colors);
|
||||
|
||||
// tex coords
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), &quad.tl.texCoords);
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
if(GL_FALSE == oldDepthTest)
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
glDepthFunc(oldDepthFunc);
|
||||
|
||||
if(GL_FALSE == oldDepthMask)
|
||||
{
|
||||
glDepthMask(GL_FALSE);
|
||||
}
|
||||
|
||||
/* IMPORTANT: We only need to update the states that are not restored.
|
||||
Since we don't know what was the previous value of the mask, we update the RenderState
|
||||
after setting it.
|
||||
The other values don't need to be updated since they were restored to their original values
|
||||
*/
|
||||
glStencilMask(0xFFFFF);
|
||||
// RenderState::StateBlock::_defaultState->setStencilWrite(0xFFFFF);
|
||||
|
||||
/* BUG: RenderState does not support glColorMask yet. */
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
_clearBrush->drawBackground(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -545,4 +474,11 @@ void Camera::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t par
|
|||
return Node::visit(renderer, parentTransform, parentFlags);
|
||||
}
|
||||
|
||||
void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush)
|
||||
{
|
||||
CC_SAFE_RETAIN(clearBrush);
|
||||
CC_SAFE_RELEASE(_clearBrush);
|
||||
_clearBrush = clearBrush;
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -36,6 +36,7 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
class Scene;
|
||||
class CameraBackgroundBrush;
|
||||
|
||||
/**
|
||||
* Note:
|
||||
|
@ -236,9 +237,9 @@ public:
|
|||
*/
|
||||
static Camera* getDefaultCamera();
|
||||
/**
|
||||
Before rendering scene with this camera, the background need to be cleared.
|
||||
Before rendering scene with this camera, the background need to be cleared. It clears the depth buffer with max depth by default. Use setBackgroundBrush to modify the default behavior
|
||||
*/
|
||||
void clearBackground(float depth);
|
||||
void clearBackground();
|
||||
/**
|
||||
Apply the FBO, RenderTargets and viewport.
|
||||
*/
|
||||
|
@ -258,6 +259,17 @@ public:
|
|||
*/
|
||||
bool isViewProjectionUpdated() const {return _viewProjectionUpdated;}
|
||||
|
||||
/**
|
||||
* set the background brush. See CameraBackgroundBrush for more information.
|
||||
* @param clearBrush Brush used to clear the background
|
||||
*/
|
||||
void setBackgroundBrush(CameraBackgroundBrush* clearBrush);
|
||||
|
||||
/**
|
||||
* Get clear brush
|
||||
*/
|
||||
CameraBackgroundBrush* getBackgroundBrush() const { return _clearBrush; }
|
||||
|
||||
virtual void visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -300,6 +312,8 @@ protected:
|
|||
int8_t _depth; //camera depth, the depth of camera with CameraFlag::DEFAULT flag is 0 by default, a camera with larger depth is drawn on top of camera with smaller detph
|
||||
static Camera* _visitingCamera;
|
||||
|
||||
CameraBackgroundBrush* _clearBrush; //brush used to clear the back ground
|
||||
|
||||
experimental::Viewport _viewport;
|
||||
|
||||
experimental::FrameBuffer* _fbo;
|
||||
|
|
|
@ -0,0 +1,430 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2015 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 "2d/CCCameraBackgroundBrush.h"
|
||||
#include "2d/CCCamera.h"
|
||||
#include "base/ccMacros.h"
|
||||
#include "base/CCConfiguration.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "renderer/ccGLStateCache.h"
|
||||
#include "renderer/CCGLProgram.h"
|
||||
#include "renderer/CCGLProgramCache.h"
|
||||
#include "renderer/CCGLProgramState.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCRenderState.h"
|
||||
#include "renderer/CCTextureCube.h"
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
#include "base/CCEventCustom.h"
|
||||
#include "base/CCEventListenerCustom.h"
|
||||
#include "base/CCEventType.h"
|
||||
#include "base/CCEventDispatcher.h"
|
||||
#endif
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
CameraBackgroundBrush::CameraBackgroundBrush()
|
||||
: _glProgramState(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CameraBackgroundBrush::~CameraBackgroundBrush()
|
||||
{
|
||||
CC_SAFE_RELEASE(_glProgramState);
|
||||
}
|
||||
|
||||
CameraBackgroundBrush* CameraBackgroundBrush::createNoneBrush()
|
||||
{
|
||||
auto ret = new (std::nothrow) CameraBackgroundBrush();
|
||||
ret->init();
|
||||
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
CameraBackgroundColorBrush* CameraBackgroundBrush::createColorBrush(const Color4F& color, float depth)
|
||||
{
|
||||
return CameraBackgroundColorBrush::create(color, depth);
|
||||
}
|
||||
|
||||
CameraBackgroundDepthBrush* CameraBackgroundBrush::createDepthBrush(float depth)
|
||||
{
|
||||
return CameraBackgroundDepthBrush::create(depth);
|
||||
}
|
||||
|
||||
CameraBackgroundSkyBoxBrush* CameraBackgroundBrush::createSkyboxBrush(const std::string& positive_x, const std::string& negative_x, const std::string& positive_y, const std::string& negative_y, const std::string& positive_z, const std::string& negative_z)
|
||||
{
|
||||
return CameraBackgroundSkyBoxBrush::create(positive_x, negative_x, positive_y, negative_y, positive_z, negative_z);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CameraBackgroundDepthBrush::CameraBackgroundDepthBrush()
|
||||
: _depth(0.f)
|
||||
, _clearColor(GL_FALSE)
|
||||
{
|
||||
|
||||
}
|
||||
CameraBackgroundDepthBrush::~CameraBackgroundDepthBrush()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CameraBackgroundDepthBrush* CameraBackgroundDepthBrush::create(float depth)
|
||||
{
|
||||
auto ret = new (std::nothrow) CameraBackgroundDepthBrush();
|
||||
ret->_depth = depth;
|
||||
ret->init();
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool CameraBackgroundDepthBrush::init()
|
||||
{
|
||||
auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_CAMERA_CLEAR);
|
||||
_glProgramState = GLProgramState::getOrCreateWithGLProgram(shader);
|
||||
_glProgramState->retain();
|
||||
|
||||
_quad.bl.vertices = Vec3(-1,-1,0);
|
||||
_quad.br.vertices = Vec3(1,-1,0);
|
||||
_quad.tl.vertices = Vec3(-1,1,0);
|
||||
_quad.tr.vertices = Vec3(1,1,0);
|
||||
|
||||
_quad.bl.colors = _quad.br.colors = _quad.tl.colors = _quad.tr.colors = Color4B(0,0,0,1);
|
||||
|
||||
_quad.bl.texCoords = Tex2F(0,0);
|
||||
_quad.br.texCoords = Tex2F(1,0);
|
||||
_quad.tl.texCoords = Tex2F(0,1);
|
||||
_quad.tr.texCoords = Tex2F(1,1);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CameraBackgroundDepthBrush::drawBackground(Camera* camera)
|
||||
{
|
||||
GLboolean oldDepthTest;
|
||||
GLint oldDepthFunc;
|
||||
GLboolean oldDepthMask;
|
||||
{
|
||||
glColorMask(_clearColor, _clearColor, _clearColor, _clearColor);
|
||||
glStencilMask(0);
|
||||
|
||||
oldDepthTest = glIsEnabled(GL_DEPTH_TEST);
|
||||
glGetIntegerv(GL_DEPTH_FUNC, &oldDepthFunc);
|
||||
glGetBooleanv(GL_DEPTH_WRITEMASK, &oldDepthMask);
|
||||
|
||||
glDepthMask(GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
}
|
||||
|
||||
//draw
|
||||
|
||||
_glProgramState->setUniformFloat("depth", _depth);
|
||||
_glProgramState->apply(Mat4::IDENTITY);
|
||||
GLshort indices[6] = {0, 1, 2, 3, 2, 1};
|
||||
|
||||
{
|
||||
GL::bindVAO(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
|
||||
|
||||
// vertices
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), &_quad.tl.vertices);
|
||||
|
||||
// colors
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_T2F), &_quad.tl.colors);
|
||||
|
||||
// tex coords
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), &_quad.tl.texCoords);
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
if(GL_FALSE == oldDepthTest)
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
glDepthFunc(oldDepthFunc);
|
||||
|
||||
if(GL_FALSE == oldDepthMask)
|
||||
{
|
||||
glDepthMask(GL_FALSE);
|
||||
}
|
||||
|
||||
/* IMPORTANT: We only need to update the states that are not restored.
|
||||
Since we don't know what was the previous value of the mask, we update the RenderState
|
||||
after setting it.
|
||||
The other values don't need to be updated since they were restored to their original values
|
||||
*/
|
||||
glStencilMask(0xFFFFF);
|
||||
// RenderState::StateBlock::_defaultState->setStencilWrite(0xFFFFF);
|
||||
|
||||
/* BUG: RenderState does not support glColorMask yet. */
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CameraBackgroundColorBrush::CameraBackgroundColorBrush()
|
||||
: _color(0.f, 0.f, 0.f, 0.f)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CameraBackgroundColorBrush::~CameraBackgroundColorBrush()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool CameraBackgroundColorBrush::init()
|
||||
{
|
||||
CameraBackgroundDepthBrush::init();
|
||||
this->_clearColor = GL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CameraBackgroundColorBrush::setColor(const Color4F& color)
|
||||
{
|
||||
_quad.bl.colors = _quad.br.colors = _quad.tl.colors = _quad.tr.colors = Color4B(color);
|
||||
}
|
||||
|
||||
CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& color, float depth)
|
||||
{
|
||||
auto ret = new (std::nothrow) CameraBackgroundColorBrush();
|
||||
ret->init();
|
||||
ret->setColor(color);
|
||||
ret->setDepth(depth);
|
||||
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush()
|
||||
: _vao(0)
|
||||
, _vertexBuffer(0)
|
||||
, _indexBuffer(0)
|
||||
, _texture(nullptr)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
_backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED,
|
||||
[this](EventCustom*)
|
||||
{
|
||||
initBuffer();
|
||||
}
|
||||
);
|
||||
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush()
|
||||
{
|
||||
CC_SAFE_RELEASE(_texture);
|
||||
|
||||
glDeleteBuffers(1, &_vertexBuffer);
|
||||
glDeleteBuffers(1, &_indexBuffer);
|
||||
|
||||
_vertexBuffer = 0;
|
||||
_indexBuffer = 0;
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
glDeleteVertexArrays(1, &_vao);
|
||||
GL::bindVAO(0);
|
||||
_vao = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create(const std::string& positive_x, const std::string& negative_x, const std::string& positive_y, const std::string& negative_y, const std::string& positive_z, const std::string& negative_z)
|
||||
{
|
||||
auto texture = TextureCube::create(positive_x, negative_x, positive_y, negative_y, positive_z, negative_z);
|
||||
if (texture == nullptr)
|
||||
return nullptr;
|
||||
|
||||
Texture2D::TexParams tRepeatParams;
|
||||
tRepeatParams.magFilter = GL_LINEAR;
|
||||
tRepeatParams.minFilter = GL_LINEAR;
|
||||
tRepeatParams.wrapS = GL_CLAMP_TO_EDGE;
|
||||
tRepeatParams.wrapT = GL_CLAMP_TO_EDGE;
|
||||
texture->setTexParameters(tRepeatParams);
|
||||
|
||||
auto ret = new(std::nothrow)CameraBackgroundSkyBoxBrush();
|
||||
|
||||
ret->init();
|
||||
ret->setTexture(texture);
|
||||
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create()
|
||||
{
|
||||
auto ret = new(std::nothrow)CameraBackgroundSkyBoxBrush();
|
||||
|
||||
ret->init();
|
||||
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera)
|
||||
{
|
||||
Mat4 cameraModelMat = camera->getNodeToWorldTransform();
|
||||
|
||||
_glProgramState->apply(Mat4::IDENTITY);
|
||||
|
||||
Vec4 color(1.f, 1.f, 1.f, 1.f);
|
||||
_glProgramState->setUniformVec4("u_color", color);
|
||||
cameraModelMat.m[12] = cameraModelMat.m[13] = cameraModelMat.m[14] = 0;
|
||||
_glProgramState->setUniformMat4("u_cameraRot", cameraModelMat);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
|
||||
glDepthMask(GL_TRUE);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(true);
|
||||
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
RenderState::StateBlock::_defaultState->setDepthFunction(RenderState::DEPTH_ALWAYS);
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
RenderState::StateBlock::_defaultState->setCullFace(true);
|
||||
|
||||
glCullFace(GL_BACK);
|
||||
RenderState::StateBlock::_defaultState->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
RenderState::StateBlock::_defaultState->setBlend(false);
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
GL::bindVAO(_vao);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POSITION);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
|
||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vec3), nullptr);
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
|
||||
}
|
||||
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)36, GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
GL::bindVAO(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
}
|
||||
|
||||
bool CameraBackgroundSkyBoxBrush::init()
|
||||
{
|
||||
auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_3D_SKYBOX);
|
||||
_glProgramState = GLProgramState::create(shader);
|
||||
_glProgramState->setVertexAttribPointer(GLProgram::ATTRIBUTE_NAME_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vec3), nullptr);
|
||||
_glProgramState->retain();
|
||||
|
||||
initBuffer();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CameraBackgroundSkyBoxBrush::initBuffer()
|
||||
{
|
||||
if (_vertexBuffer)
|
||||
glDeleteBuffers(1, &_vertexBuffer);
|
||||
if (_indexBuffer)
|
||||
glDeleteBuffers(1, &_indexBuffer);
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO() && _vao)
|
||||
{
|
||||
glDeleteVertexArrays(1, &_vao);
|
||||
GL::bindVAO(0);
|
||||
_vao = 0;
|
||||
}
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
glGenVertexArrays(1, &_vao);
|
||||
GL::bindVAO(_vao);
|
||||
}
|
||||
|
||||
// init vertex buffer object
|
||||
Vec3 vexBuf[] =
|
||||
{
|
||||
Vec3(1, -1, 1), Vec3(1, 1, 1), Vec3(-1, 1, 1), Vec3(-1, -1, 1),
|
||||
Vec3(1, -1, -1), Vec3(1, 1, -1), Vec3(-1, 1, -1), Vec3(-1, -1, -1)
|
||||
};
|
||||
|
||||
glGenBuffers(1, &_vertexBuffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vexBuf), vexBuf, GL_STATIC_DRAW);
|
||||
|
||||
// init index buffer object
|
||||
const unsigned char idxBuf[] = { 2, 1, 0, 3, 2, 0, // font
|
||||
1, 5, 4, 1, 4, 0, // right
|
||||
4, 5, 6, 4, 6, 7, // back
|
||||
7, 6, 2, 7, 2, 3, // left
|
||||
2, 6, 5, 2, 5, 1, // up
|
||||
3, 0, 4, 3, 4, 7 // down
|
||||
};
|
||||
|
||||
glGenBuffers(1, &_indexBuffer);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(idxBuf), idxBuf, GL_STATIC_DRAW);
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
|
||||
_glProgramState->applyAttributes(false);
|
||||
|
||||
GL::bindVAO(0);
|
||||
}
|
||||
}
|
||||
|
||||
void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture)
|
||||
{
|
||||
CC_SAFE_RETAIN(texture);
|
||||
CC_SAFE_RELEASE(_texture);
|
||||
_texture = texture;
|
||||
_glProgramState->setUniformTexture("u_Env", _texture);
|
||||
}
|
||||
|
||||
NS_CC_END
|
|
@ -0,0 +1,265 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2015 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.
|
||||
|
||||
****************************************************************************/
|
||||
#ifndef _CCCAMERA_BACKGROUND_BRUSH_H__
|
||||
#define _CCCAMERA_BACKGROUND_BRUSH_H__
|
||||
|
||||
#include "base/ccTypes.h"
|
||||
#include "base/CCRef.h"
|
||||
#include "3d/CCFrustum.h"
|
||||
#include "renderer/CCQuadCommand.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
#include "renderer/CCFrameBuffer.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class CameraBackgroundColorBrush;
|
||||
class CameraBackgroundDepthBrush;
|
||||
class CameraBackgroundSkyBoxBrush;
|
||||
|
||||
class GLProgramState;
|
||||
class Camera;
|
||||
|
||||
/**
|
||||
* Defines a brush to clear the background of camera.
|
||||
* There are 4 types of brush. None brush do nothing, Depth brush clear background with given depth, Color brush clear background with given color and depth, Skybox brush clear the background with a skybox. Camera uses depth brush by default.
|
||||
*/
|
||||
class CC_DLL CameraBackgroundBrush : public Ref
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Brush types. There are 4 types of brush. See CameraBackgroundDepthBrush, CameraBackgroundColorBrush, CameraBackgroundSkyBoxBrush for more information.
|
||||
*/
|
||||
enum class BrushType
|
||||
{
|
||||
NONE, //none brush
|
||||
DEPTH, // depth brush. See CameraBackgroundDepthBrush
|
||||
COLOR, // color brush. See CameraBackgroundColorBrush
|
||||
SKYBOX, // skybox brush. See CameraBackgroundSkyBoxBrush
|
||||
};
|
||||
|
||||
/**
|
||||
* get brush type
|
||||
* @return BrushType
|
||||
*/
|
||||
virtual BrushType getBrushType() const { return BrushType::NONE; }
|
||||
|
||||
/**
|
||||
* Creates a none brush, it does nothing when clear the background
|
||||
* @return Created brush.
|
||||
*/
|
||||
static CameraBackgroundBrush* createNoneBrush();
|
||||
|
||||
/**
|
||||
* Creates a depth brush, which clears depth buffer with a given depth.
|
||||
* @param depth Depth used to clear depth buffer
|
||||
* @return Created brush
|
||||
*/
|
||||
static CameraBackgroundDepthBrush* createDepthBrush(float depth = 1.f);
|
||||
|
||||
/**
|
||||
* Creates a color brush
|
||||
* @param color Color of brush
|
||||
* @param depth Depth used to clear depth buffer
|
||||
* @return Created brush
|
||||
*/
|
||||
static CameraBackgroundColorBrush* createColorBrush(const Color4F& color, float depth);
|
||||
|
||||
|
||||
/** Creates a Skybox brush with 6 textures.
|
||||
@param positive_x texture for the right side of the texture cube face.
|
||||
@param negative_x texture for the up side of the texture cube face.
|
||||
@param positive_y texture for the top side of the texture cube face
|
||||
@param negative_y texture for the bottom side of the texture cube face
|
||||
@param positive_z texture for the forward side of the texture cube face.
|
||||
@param negative_z texture for the rear side of the texture cube face.
|
||||
@return A new brush inited with given parameters.
|
||||
*/
|
||||
static CameraBackgroundSkyBoxBrush* createSkyboxBrush(const std::string& positive_x, const std::string& negative_x,
|
||||
const std::string& positive_y, const std::string& negative_y,
|
||||
const std::string& positive_z, const std::string& negative_z);
|
||||
/**
|
||||
* draw the background
|
||||
*/
|
||||
virtual void drawBackground(Camera* camera) {}
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
CameraBackgroundBrush();
|
||||
virtual ~CameraBackgroundBrush();
|
||||
|
||||
virtual bool init() { return true; }
|
||||
|
||||
protected:
|
||||
GLProgramState* _glProgramState;
|
||||
};
|
||||
|
||||
/**
|
||||
* Depth brush clear depth buffer with given depth
|
||||
*/
|
||||
class CC_DLL CameraBackgroundDepthBrush : public CameraBackgroundBrush
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create a depth brush
|
||||
* @param depth Depth used to clear the depth buffer
|
||||
* @return Created brush
|
||||
*/
|
||||
static CameraBackgroundDepthBrush* create(float depth);
|
||||
|
||||
/**
|
||||
* Get brush type. Should be BrushType::DEPTH
|
||||
* @return brush type
|
||||
*/
|
||||
virtual BrushType getBrushType() const override { return BrushType::DEPTH; }
|
||||
|
||||
/**
|
||||
* Draw background
|
||||
*/
|
||||
virtual void drawBackground(Camera* camera) override;
|
||||
|
||||
/**
|
||||
* Set depth
|
||||
* @param depth Depth used to clear depth buffer
|
||||
*/
|
||||
void setDepth(float depth) { _depth = depth; }
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
CameraBackgroundDepthBrush();
|
||||
virtual ~CameraBackgroundDepthBrush();
|
||||
|
||||
virtual bool init() override;
|
||||
|
||||
protected:
|
||||
float _depth;
|
||||
|
||||
GLboolean _clearColor;
|
||||
|
||||
V3F_C4B_T2F_Quad _quad;
|
||||
};
|
||||
|
||||
/**
|
||||
* Color brush clear buffer with given depth and color
|
||||
*/
|
||||
class CC_DLL CameraBackgroundColorBrush : public CameraBackgroundDepthBrush
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Get brush type. Should be BrushType::COLOR
|
||||
* @return brush type
|
||||
*/
|
||||
virtual BrushType getBrushType() const override { return BrushType::COLOR; }
|
||||
|
||||
/**
|
||||
* Create a color brush
|
||||
* @param color Color used to clear the color buffer
|
||||
* @param depth Depth used to clear the depth buffer
|
||||
* @return Created brush
|
||||
*/
|
||||
static CameraBackgroundColorBrush* create(const Color4F& color, float depth);
|
||||
|
||||
/**
|
||||
* Set clear color
|
||||
* @param color Color used to clear the color buffer
|
||||
*/
|
||||
void setColor(const Color4F& color);
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
CameraBackgroundColorBrush();
|
||||
virtual ~CameraBackgroundColorBrush();
|
||||
|
||||
virtual bool init() override;
|
||||
|
||||
protected:
|
||||
Color4F _color;
|
||||
};
|
||||
|
||||
class TextureCube;
|
||||
class GLProgramState;
|
||||
class EventListenerCustom;
|
||||
|
||||
/**
|
||||
* Skybox brush clear buffer with a skybox
|
||||
*/
|
||||
class CC_DLL CameraBackgroundSkyBoxBrush : public CameraBackgroundBrush
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Get brush type. Should be BrushType::SKYBOX
|
||||
* @return brush type
|
||||
*/
|
||||
virtual BrushType getBrushType() const override { return BrushType::SKYBOX; }
|
||||
|
||||
/** Creates a Skybox brush with 6 textures.
|
||||
@param positive_x texture for the right side of the texture cube face.
|
||||
@param negative_x texture for the up side of the texture cube face.
|
||||
@param positive_y texture for the top side of the texture cube face
|
||||
@param negative_y texture for the bottom side of the texture cube face
|
||||
@param positive_z texture for the forward side of the texture cube face.
|
||||
@param negative_z texture for the rear side of the texture cube face.
|
||||
@return A new brush inited with given parameters.
|
||||
*/
|
||||
static CameraBackgroundSkyBoxBrush* create(const std::string& positive_x, const std::string& negative_x,
|
||||
const std::string& positive_y, const std::string& negative_y,
|
||||
const std::string& positive_z, const std::string& negative_z);
|
||||
|
||||
/** Creates a Skybox brush with 6 textures.
|
||||
*/
|
||||
static CameraBackgroundSkyBoxBrush* create();
|
||||
/**
|
||||
* Set skybox texutre
|
||||
* @param texture Skybox texture
|
||||
*/
|
||||
void setTexture(TextureCube* texture);
|
||||
|
||||
/**
|
||||
* Draw background
|
||||
*/
|
||||
virtual void drawBackground(Camera* camera) override;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
CameraBackgroundSkyBoxBrush();
|
||||
virtual ~CameraBackgroundSkyBoxBrush();
|
||||
|
||||
/**
|
||||
* init Skybox.
|
||||
*/
|
||||
virtual bool init() override;
|
||||
|
||||
protected:
|
||||
void initBuffer();
|
||||
|
||||
GLuint _vao;
|
||||
GLuint _vertexBuffer;
|
||||
GLuint _indexBuffer;
|
||||
|
||||
TextureCube* _texture;
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif// _CCCAMERA_BACKGROUND_BRUSH_H__
|
|
@ -144,6 +144,11 @@ public:
|
|||
|
||||
_textureAtlas->updateQuad(&_quad, _atlasIndex);
|
||||
}
|
||||
|
||||
//LabelLetter doesn't need to draw directly.
|
||||
void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Label* Label::create()
|
||||
|
@ -978,6 +983,7 @@ void Label::createSpriteForSystemFont(const FontDefinition& fontDef)
|
|||
_textSprite = Sprite::createWithTexture(texture);
|
||||
//set camera mask using label's camera mask, because _textSprite may be null when setting camera mask to label
|
||||
_textSprite->setCameraMask(getCameraMask());
|
||||
_textSprite->setGlobalZOrder(getGlobalZOrder());
|
||||
_textSprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
|
||||
this->setContentSize(_textSprite->getContentSize());
|
||||
texture->release();
|
||||
|
@ -1022,6 +1028,7 @@ void Label::createShadowSpriteForSystemFont(const FontDefinition& fontDef)
|
|||
_shadowNode->setBlendFunc(_blendFunc);
|
||||
}
|
||||
_shadowNode->setCameraMask(getCameraMask());
|
||||
_shadowNode->setGlobalZOrder(getGlobalZOrder());
|
||||
_shadowNode->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
|
||||
_shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height);
|
||||
|
||||
|
@ -1719,4 +1726,17 @@ FontDefinition Label::_getFontDefinition() const
|
|||
return systemFontDef;
|
||||
}
|
||||
|
||||
void Label::setGlobalZOrder(float globalZOrder)
|
||||
{
|
||||
Node::setGlobalZOrder(globalZOrder);
|
||||
if (_textSprite)
|
||||
{
|
||||
_textSprite->setGlobalZOrder(globalZOrder);
|
||||
if (_shadowNode)
|
||||
{
|
||||
_shadowNode->setGlobalZOrder(globalZOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -453,6 +453,7 @@ public:
|
|||
|
||||
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
|
||||
virtual void removeChild(Node* child, bool cleanup = true) override;
|
||||
virtual void setGlobalZOrder(float globalZOrder) override;
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE static Label* create(const std::string& text, const std::string& font, float fontSize,
|
||||
const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT,
|
||||
|
|
|
@ -893,7 +893,7 @@ Node* Node::getChildByTag(int tag) const
|
|||
|
||||
Node* Node::getChildByName(const std::string& name) const
|
||||
{
|
||||
CCASSERT(name.length() != 0, "Invalid name");
|
||||
CCASSERT(!name.empty(), "Invalid name");
|
||||
|
||||
std::hash<std::string> h;
|
||||
size_t hash = h(name);
|
||||
|
@ -909,7 +909,7 @@ Node* Node::getChildByName(const std::string& name) const
|
|||
|
||||
void Node::enumerateChildren(const std::string &name, std::function<bool (Node *)> callback) const
|
||||
{
|
||||
CCASSERT(name.length() != 0, "Invalid name");
|
||||
CCASSERT(!name.empty(), "Invalid name");
|
||||
CCASSERT(callback != nullptr, "Invalid callback function");
|
||||
|
||||
size_t length = name.length();
|
||||
|
@ -1158,7 +1158,7 @@ void Node::removeChildByTag(int tag, bool cleanup/* = true */)
|
|||
|
||||
void Node::removeChildByName(const std::string &name, bool cleanup)
|
||||
{
|
||||
CCASSERT(name.length() != 0, "Invalid name");
|
||||
CCASSERT(!name.empty(), "Invalid name");
|
||||
|
||||
Node *child = this->getChildByName(name);
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
|
|||
_duration = dictionary["duration"].asFloat();
|
||||
|
||||
// blend function
|
||||
if (_configName.length()>0)
|
||||
if (!_configName.empty())
|
||||
{
|
||||
_blendFunc.src = dictionary["blendFuncSource"].asFloat();
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
|
|||
// or Mode B: radius movement
|
||||
else if (_emitterMode == Mode::RADIUS)
|
||||
{
|
||||
if (_configName.length()>0)
|
||||
if (!_configName.empty())
|
||||
{
|
||||
modeB.startRadius = dictionary["maxRadius"].asInt();
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
|
|||
modeB.startRadius = dictionary["maxRadius"].asFloat();
|
||||
}
|
||||
modeB.startRadiusVar = dictionary["maxRadiusVariance"].asFloat();
|
||||
if (_configName.length()>0)
|
||||
if (!_configName.empty())
|
||||
{
|
||||
modeB.endRadius = dictionary["minRadius"].asInt();
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
|
|||
modeB.endRadiusVar = 0.0f;
|
||||
}
|
||||
|
||||
if (_configName.length()>0)
|
||||
if (!_configName.empty())
|
||||
{
|
||||
modeB.rotatePerSecond = dictionary["rotatePerSecond"].asInt();
|
||||
}
|
||||
|
|
|
@ -114,9 +114,8 @@ void ProgressTimer::setSprite(Sprite *sprite)
|
|||
{
|
||||
CC_SAFE_FREE(_vertexData);
|
||||
_vertexDataCount = 0;
|
||||
updateProgress();
|
||||
}
|
||||
|
||||
updateProgress();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,8 @@ Scene::Scene()
|
|||
|
||||
_event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1));
|
||||
_event->retain();
|
||||
|
||||
Camera::_visitingCamera = nullptr;
|
||||
}
|
||||
|
||||
Scene::~Scene()
|
||||
|
@ -194,7 +196,7 @@ void Scene::render(Renderer* renderer)
|
|||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||
camera->apply();
|
||||
//clear background with max depth
|
||||
camera->clearBackground(1.0);
|
||||
camera->clearBackground();
|
||||
//visit the scene
|
||||
visit(renderer, transform, 0);
|
||||
#if CC_USE_NAVMESH
|
||||
|
|
|
@ -188,7 +188,7 @@ Texture2D* SpriteFrame::getTexture()
|
|||
return _texture;
|
||||
}
|
||||
|
||||
if( _textureFilename.length() > 0 ) {
|
||||
if( !_textureFilename.empty()) {
|
||||
return Director::getInstance()->getTextureCache()->addImage(_textureFilename.c_str());
|
||||
}
|
||||
// no texture or texture filename
|
||||
|
|
|
@ -61,6 +61,9 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la
|
|||
texture = Director::getInstance()->getTextureCache()->addImage(tilesetInfo->_sourceImage.c_str());
|
||||
}
|
||||
|
||||
if (nullptr == texture)
|
||||
return false;
|
||||
|
||||
if (SpriteBatchNode::initWithTexture(texture, static_cast<ssize_t>(capacity)))
|
||||
{
|
||||
// layerInfo
|
||||
|
|
|
@ -107,9 +107,12 @@ TMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
|
|||
|
||||
TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo);
|
||||
|
||||
// tell the layerinfo to release the ownership of the tiles map.
|
||||
layerInfo->_ownTiles = false;
|
||||
layer->setupTiles();
|
||||
if (nullptr != layer)
|
||||
{
|
||||
// tell the layerinfo to release the ownership of the tiles map.
|
||||
layerInfo->_ownTiles = false;
|
||||
layer->setupTiles();
|
||||
}
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ const std::string& TextFieldTTF::getContentText()
|
|||
void TextFieldTTF::setTextColor(const Color4B &color)
|
||||
{
|
||||
_colorText = color;
|
||||
if (_inputText.length() > 0) {
|
||||
if (!_inputText.empty()) {
|
||||
Label::setTextColor(_colorText);
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ void TextFieldTTF::setColorSpaceHolder(const Color3B& color)
|
|||
_colorSpaceHolder.g = color.g;
|
||||
_colorSpaceHolder.b = color.b;
|
||||
_colorSpaceHolder.a = 255;
|
||||
if (0 == _inputText.length())
|
||||
if (_inputText.empty())
|
||||
{
|
||||
Label::setTextColor(_colorSpaceHolder);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ void TextFieldTTF::setColorSpaceHolder(const Color3B& color)
|
|||
void TextFieldTTF::setColorSpaceHolder(const Color4B& color)
|
||||
{
|
||||
_colorSpaceHolder = color;
|
||||
if (0 == _inputText.length()) {
|
||||
if (_inputText.empty()) {
|
||||
Label::setTextColor(_colorSpaceHolder);
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ void TextFieldTTF::setString(const std::string &text)
|
|||
std::string displayText;
|
||||
size_t length;
|
||||
|
||||
if (text.length()>0)
|
||||
if (!text.empty())
|
||||
{
|
||||
_inputText = text;
|
||||
displayText = _inputText;
|
||||
|
@ -330,7 +330,7 @@ void TextFieldTTF::setString(const std::string &text)
|
|||
}
|
||||
|
||||
// if there is no input text, display placeholder instead
|
||||
if (0 == _inputText.length())
|
||||
if (_inputText.empty())
|
||||
{
|
||||
Label::setTextColor(_colorSpaceHolder);
|
||||
Label::setString(_placeHolder);
|
||||
|
@ -352,7 +352,7 @@ const std::string& TextFieldTTF::getString() const
|
|||
void TextFieldTTF::setPlaceHolder(const std::string& text)
|
||||
{
|
||||
_placeHolder = text;
|
||||
if (0 == _inputText.length())
|
||||
if (_inputText.empty())
|
||||
{
|
||||
Label::setTextColor(_colorSpaceHolder);
|
||||
Label::setString(_placeHolder);
|
||||
|
|
|
@ -24,6 +24,7 @@ set(COCOS_2D_SRC
|
|||
2d/CCAnimation.cpp
|
||||
2d/CCAtlasNode.cpp
|
||||
2d/CCCamera.cpp
|
||||
2d/CCCameraBackgroundBrush.cpp
|
||||
2d/CCClippingNode.cpp
|
||||
2d/CCClippingRectangleNode.cpp
|
||||
2d/CCComponentContainer.cpp
|
||||
|
|
|
@ -395,7 +395,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClCompile Include="..\3d\CCSprite3D.cpp" />
|
||||
<ClCompile Include="..\3d\CCSprite3DMaterial.cpp" />
|
||||
<ClCompile Include="..\3d\CCTerrain.cpp" />
|
||||
<ClCompile Include="..\3d\CCTextureCube.cpp" />
|
||||
<ClCompile Include="..\audio\AudioEngine.cpp" />
|
||||
<ClCompile Include="..\audio\win32\AudioCache.cpp" />
|
||||
<ClCompile Include="..\audio\win32\AudioEngine-win32.cpp" />
|
||||
|
@ -627,6 +626,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClCompile Include="..\renderer\CCTexture2D.cpp" />
|
||||
<ClCompile Include="..\renderer\CCTextureAtlas.cpp" />
|
||||
<ClCompile Include="..\renderer\CCTextureCache.cpp" />
|
||||
<ClCompile Include="..\renderer\CCTextureCube.cpp" />
|
||||
<ClCompile Include="..\renderer\CCTrianglesCommand.cpp" />
|
||||
<ClCompile Include="..\renderer\CCVertexAttribBinding.cpp" />
|
||||
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp" />
|
||||
|
@ -681,6 +681,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClCompile Include="CCAtlasNode.cpp" />
|
||||
<ClCompile Include="CCAutoPolygon.cpp" />
|
||||
<ClCompile Include="CCCamera.cpp" />
|
||||
<ClCompile Include="CCCameraBackgroundBrush.cpp" />
|
||||
<ClCompile Include="CCClippingNode.cpp" />
|
||||
<ClCompile Include="CCClippingRectangleNode.cpp" />
|
||||
<ClCompile Include="CCComponent.cpp" />
|
||||
|
@ -961,7 +962,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClInclude Include="..\3d\CCSprite3D.h" />
|
||||
<ClInclude Include="..\3d\CCSprite3DMaterial.h" />
|
||||
<ClInclude Include="..\3d\CCTerrain.h" />
|
||||
<ClInclude Include="..\3d\CCTextureCube.h" />
|
||||
<ClInclude Include="..\3d\cocos3d.h" />
|
||||
<ClInclude Include="..\audio\include\AudioEngine.h" />
|
||||
<ClInclude Include="..\audio\include\Export.h" />
|
||||
|
@ -1242,6 +1242,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClInclude Include="..\renderer\CCTexture2D.h" />
|
||||
<ClInclude Include="..\renderer\CCTextureAtlas.h" />
|
||||
<ClInclude Include="..\renderer\CCTextureCache.h" />
|
||||
<ClInclude Include="..\renderer\CCTextureCube.h" />
|
||||
<ClInclude Include="..\renderer\CCTrianglesCommand.h" />
|
||||
<ClInclude Include="..\renderer\CCVertexAttribBinding.h" />
|
||||
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h" />
|
||||
|
@ -1296,6 +1297,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClInclude Include="CCAtlasNode.h" />
|
||||
<ClInclude Include="CCAutoPolygon.h" />
|
||||
<ClInclude Include="CCCamera.h" />
|
||||
<ClInclude Include="CCCameraBackgroundBrush.h" />
|
||||
<ClInclude Include="CCClippingNode.h" />
|
||||
<ClInclude Include="CCClippingRectangleNode.h" />
|
||||
<ClInclude Include="CCComponent.h" />
|
||||
|
|
|
@ -1362,9 +1362,6 @@
|
|||
<ClCompile Include="..\3d\CCSkybox.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\3d\CCTextureCube.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\extensions\Particle3D\PU\CCPUAffector.cpp">
|
||||
<Filter>extension\Particle3D\ParticleUniverse</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1931,6 +1928,12 @@
|
|||
<ClCompile Include="..\network\CCDownloaderImpl.cpp">
|
||||
<Filter>network\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CCCameraBackgroundBrush.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCTextureCube.cpp">
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\physics\CCPhysicsBody.h">
|
||||
|
@ -3181,9 +3184,6 @@
|
|||
<ClInclude Include="..\3d\CCSkybox.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\3d\CCTextureCube.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\platform\CCPlatformConfig.h">
|
||||
<Filter>platform</Filter>
|
||||
</ClInclude>
|
||||
|
@ -3765,6 +3765,12 @@
|
|||
<ClInclude Include="..\network\CCIDownloaderImpl.h">
|
||||
<Filter>network\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CCCameraBackgroundBrush.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCTextureCube.h">
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\math\Mat4.inl">
|
||||
|
|
|
@ -230,7 +230,6 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSprite3D.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSprite3DMaterial.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTerrain.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTextureCube.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\cocos3d.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\include\AudioEngine.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\include\Export.h" />
|
||||
|
@ -532,6 +531,7 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTexture2D.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureAtlas.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCache.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCube.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTrianglesCommand.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCVertexAttribBinding.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCVertexIndexBuffer.h" />
|
||||
|
@ -584,6 +584,7 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCAtlasNode.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCAutoPolygon.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCCamera.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCCameraBackgroundBrush.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingNode.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingRectangleNode.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCComponent.h" />
|
||||
|
@ -855,7 +856,6 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSprite3D.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSprite3DMaterial.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTerrain.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTextureCube.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\AudioEngine.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\audio\winrt\Audio.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
|
@ -1125,6 +1125,7 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTexture2D.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureAtlas.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCache.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCube.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTrianglesCommand.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCVertexAttribBinding.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCVertexIndexBuffer.cpp" />
|
||||
|
@ -1178,6 +1179,7 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCAtlasNode.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCAutoPolygon.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCCamera.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCCameraBackgroundBrush.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingNode.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCClippingRectangleNode.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCComponent.cpp" />
|
||||
|
|
|
@ -1728,9 +1728,6 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSkybox.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTextureCube.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTerrain.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1867,6 +1864,12 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\GameNode3DReader\GameNode3DReader.h">
|
||||
<Filter>cocostudio\reader\WidgetReader\GameNodeDReader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\CCCameraBackgroundBrush.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCube.h">
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\cocos2d.cpp">
|
||||
|
@ -3428,9 +3431,6 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCSkybox.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTextureCube.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTerrain.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
|
@ -3564,6 +3564,12 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\GameNode3DReader\GameNode3DReader.cpp">
|
||||
<Filter>cocostudio\reader\WidgetReader\GameNodeDReader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\CCCameraBackgroundBrush.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\renderer\CCTextureCube.cpp">
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="2d">
|
||||
|
|
|
@ -119,40 +119,40 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>
|
||||
</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>
|
||||
</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>
|
||||
</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_8.1</TargetName>
|
||||
<LinkIncremental>
|
||||
</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
|
@ -166,6 +166,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -187,6 +188,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -207,6 +209,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -228,6 +231,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -248,6 +252,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -269,6 +274,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -91,23 +91,23 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_WindowsPhone_8.1</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_WindowsPhone_8.1</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_WindowsPhone_8.1</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_WindowsPhone_8.1</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
@ -120,6 +120,7 @@
|
|||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -141,6 +142,7 @@
|
|||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -161,6 +163,7 @@
|
|||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -182,6 +185,7 @@
|
|||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -285,7 +285,6 @@
|
|||
<ClCompile Include="..\..\3d\CCSprite3D.cpp" />
|
||||
<ClCompile Include="..\..\3d\CCSprite3DMaterial.cpp" />
|
||||
<ClCompile Include="..\..\3d\CCTerrain.cpp" />
|
||||
<ClCompile Include="..\..\3d\CCTextureCube.cpp" />
|
||||
<ClCompile Include="..\..\audio\AudioEngine.cpp" />
|
||||
<ClCompile Include="..\..\audio\winrt\Audio.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
|
@ -621,6 +620,7 @@
|
|||
<ClCompile Include="..\..\renderer\CCTexture2D.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCTextureAtlas.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCTextureCache.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCTextureCube.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCTrianglesCommand.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCVertexAttribBinding.cpp" />
|
||||
<ClCompile Include="..\..\renderer\CCVertexIndexBuffer.cpp" />
|
||||
|
@ -674,6 +674,7 @@
|
|||
<ClCompile Include="..\CCAtlasNode.cpp" />
|
||||
<ClCompile Include="..\CCAutoPolygon.cpp" />
|
||||
<ClCompile Include="..\CCCamera.cpp" />
|
||||
<ClCompile Include="..\CCCameraBackgroundBrush.cpp" />
|
||||
<ClCompile Include="..\CCClippingNode.cpp" />
|
||||
<ClCompile Include="..\CCClippingRectangleNode.cpp" />
|
||||
<ClCompile Include="..\CCComponent.cpp" />
|
||||
|
@ -941,7 +942,6 @@
|
|||
<ClInclude Include="..\..\3d\CCSprite3D.h" />
|
||||
<ClInclude Include="..\..\3d\CCSprite3DMaterial.h" />
|
||||
<ClInclude Include="..\..\3d\CCTerrain.h" />
|
||||
<ClInclude Include="..\..\3d\CCTextureCube.h" />
|
||||
<ClInclude Include="..\..\3d\cocos3d.h" />
|
||||
<ClInclude Include="..\..\audio\include\AudioEngine.h" />
|
||||
<ClInclude Include="..\..\audio\include\Export.h" />
|
||||
|
@ -1219,7 +1219,9 @@
|
|||
<ClInclude Include="..\..\platform\winrt\WICImageLoader-winrt.h" />
|
||||
<ClInclude Include="..\..\renderer\CCBatchCommand.h" />
|
||||
<ClInclude Include="..\..\renderer\CCCustomCommand.h" />
|
||||
<ClInclude Include="..\..\renderer\CCTextureCube.h" />
|
||||
<ClInclude Include="..\CCAutoPolygon.h" />
|
||||
<ClInclude Include="..\CCCameraBackgroundBrush.h" />
|
||||
<ClInclude Include="..\renderer\CCFrameBuffer.h" />
|
||||
<ClInclude Include="..\..\renderer\CCGLProgram.h" />
|
||||
<ClInclude Include="..\..\renderer\CCGLProgramCache.h" />
|
||||
|
@ -1501,34 +1503,34 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
||||
<TargetName>libcocos2d_v3.8_Windows_10.0</TargetName>
|
||||
<TargetName>libcocos2d_v3.9_Windows_10.0</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -1560,6 +1562,7 @@
|
|||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -1637,6 +1640,7 @@
|
|||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -534,9 +534,6 @@
|
|||
<ClCompile Include="..\..\3d\CCTerrain.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\3d\CCTextureCube.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\base\atitc.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1939,6 +1936,12 @@
|
|||
<ClCompile Include="..\..\editor-support\cocostudio\WidgetReader\GameNode3DReader\GameNode3DReader.cpp">
|
||||
<Filter>cocostudio\reader\WidgetReader\GameNodeDReader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\CCCameraBackgroundBrush.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\renderer\CCTextureCube.cpp">
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\cocos2d.h" />
|
||||
|
@ -2216,9 +2219,6 @@
|
|||
<ClInclude Include="..\..\3d\CCTerrain.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\3d\CCTextureCube.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\3d\cocos3d.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
|
@ -3788,6 +3788,12 @@
|
|||
<ClInclude Include="..\..\editor-support\cocostudio\WidgetReader\GameNode3DReader\GameNode3DReader.h">
|
||||
<Filter>cocostudio\reader\WidgetReader\GameNodeDReader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\CCCameraBackgroundBrush.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\renderer\CCTextureCube.h">
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\base\CCController-iOS.mm">
|
||||
|
|
|
@ -23,8 +23,7 @@ CCObjLoader.cpp \
|
|||
CCSkeleton3D.cpp \
|
||||
CCSprite3D.cpp \
|
||||
CCTerrain.cpp \
|
||||
CCSkybox.cpp \
|
||||
CCTextureCube.cpp
|
||||
CCSkybox.cpp
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
|
||||
|
||||
|
|
|
@ -367,6 +367,7 @@ void Mesh::draw(Renderer* renderer, float globalZOrder, const Mat4& transform, u
|
|||
_meshCommand.setSkipBatching(isTransparent);
|
||||
_meshCommand.setTransparent(isTransparent);
|
||||
_meshCommand.set3D(!_force2DQueue);
|
||||
_material->getStateBlock()->setBlend(_force2DQueue || isTransparent);
|
||||
|
||||
// set default uniforms for Mesh
|
||||
// 'u_color' and others
|
||||
|
|
|
@ -31,9 +31,8 @@
|
|||
#include "renderer/CCGLProgramState.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCRenderState.h"
|
||||
#include "renderer/CCTextureCube.h"
|
||||
#include "3d/CCSkybox.h"
|
||||
#include "3d/CCTextureCube.h"
|
||||
|
||||
#include "2d/CCCamera.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
@ -148,6 +147,8 @@ void Skybox::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
|
|||
{
|
||||
_customCommand.init(_globalZOrder);
|
||||
_customCommand.func = CC_CALLBACK_0(Skybox::onDraw, this, transform, flags);
|
||||
_customCommand.setTransparent(false);
|
||||
_customCommand.set3D(true);
|
||||
renderer->addCommand(&_customCommand);
|
||||
}
|
||||
|
||||
|
@ -176,6 +177,9 @@ void Skybox::onDraw(const Mat4& transform, uint32_t flags)
|
|||
|
||||
glCullFace(GL_BACK);
|
||||
RenderState::StateBlock::_defaultState->setCullFaceSide(RenderState::CULL_FACE_SIDE_BACK);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
RenderState::StateBlock::_defaultState->setBlend(false);
|
||||
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
{
|
||||
|
|
|
@ -25,6 +25,5 @@ set(COCOS_3D_SRC
|
|||
3d/CCSprite3D.cpp
|
||||
3d/CCSprite3DMaterial.cpp
|
||||
3d/CCTerrain.cpp
|
||||
3d/CCTextureCube.cpp
|
||||
|
||||
)
|
||||
|
|
|
@ -35,6 +35,7 @@ cocos2d.cpp \
|
|||
2d/CCAnimationCache.cpp \
|
||||
2d/CCAtlasNode.cpp \
|
||||
2d/CCCamera.cpp \
|
||||
2d/CCCameraBackgroundBrush.cpp \
|
||||
2d/CCClippingNode.cpp \
|
||||
2d/CCClippingRectangleNode.cpp \
|
||||
2d/CCComponent.cpp \
|
||||
|
@ -180,6 +181,7 @@ renderer/CCTechnique.cpp \
|
|||
renderer/CCTexture2D.cpp \
|
||||
renderer/CCTextureAtlas.cpp \
|
||||
renderer/CCTextureCache.cpp \
|
||||
renderer/CCTextureCube.cpp \
|
||||
renderer/CCTrianglesCommand.cpp \
|
||||
renderer/CCVertexAttribBinding.cpp \
|
||||
renderer/CCVertexIndexBuffer.cpp \
|
||||
|
|
|
@ -90,7 +90,7 @@ typedef enum {
|
|||
@since v0.99
|
||||
*/
|
||||
@interface CDLongAudioSource : NSObject <AVAudioPlayerDelegate, CDAudioInterruptProtocol>{
|
||||
AVAudioPlayer *audioSourcePlayer;
|
||||
CCAudioPlayer *audioSourcePlayer;
|
||||
NSString *audioSourceFilePath;
|
||||
NSInteger numberOfLoops;
|
||||
float volume;
|
||||
|
@ -106,7 +106,7 @@ typedef enum {
|
|||
@protected
|
||||
tLongAudioSourceState state;
|
||||
}
|
||||
@property (readonly) AVAudioPlayer *audioSourcePlayer;
|
||||
@property (readonly) CCAudioPlayer *audioSourcePlayer;
|
||||
@property (readonly) NSString *audioSourceFilePath;
|
||||
@property (readwrite, nonatomic) NSInteger numberOfLoops;
|
||||
@property (readwrite, nonatomic) float volume;
|
||||
|
@ -196,13 +196,13 @@ typedef enum {
|
|||
/** Call if you want to use built in resign behavior but need to do some additional audio processing on become active. */
|
||||
- (void) applicationDidBecomeActive;
|
||||
|
||||
//New AVAudioPlayer API
|
||||
//New CCAudioPlayer API
|
||||
/** Loads the data from the specified file path to the channel's audio source */
|
||||
-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel;
|
||||
/** Retrieves the audio source for the specified channel */
|
||||
-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel;
|
||||
|
||||
//Legacy AVAudioPlayer API
|
||||
//Legacy CCAudioPlayer API
|
||||
/** Plays music in background. The music can be looped or not
|
||||
It is recommended to use .aac files as background music since they are decoded by the device (hardware).
|
||||
*/
|
||||
|
|
|
@ -66,12 +66,12 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
|
|||
//New file
|
||||
if (state != kLAS_Init) {
|
||||
[audioSourceFilePath release];//Release old file path
|
||||
[audioSourcePlayer release];//Release old AVAudioPlayer, they can't be reused
|
||||
[audioSourcePlayer release];//Release old CCAudioPlayer, they can't be reused
|
||||
}
|
||||
audioSourceFilePath = [filePath copy];
|
||||
NSError *error = nil;
|
||||
NSString *path = [CDUtilities fullPathFromRelativePath:audioSourceFilePath];
|
||||
audioSourcePlayer = [(AVAudioPlayer*)[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];
|
||||
audioSourcePlayer = [(CCAudioPlayer*)[CCAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];
|
||||
if (error == nil) {
|
||||
[audioSourcePlayer prepareToPlay];
|
||||
audioSourcePlayer.delegate = self;
|
||||
|
@ -190,12 +190,12 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
|
|||
numberOfLoops = loopCount;
|
||||
}
|
||||
|
||||
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {
|
||||
- (void)audioPlayerDidFinishPlaying:(CCAudioPlayer *)player successfully:(BOOL)flag {
|
||||
CDLOGINFO(@"Denshion::CDLongAudioSource - audio player finished");
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
CDLOGINFO(@"Denshion::CDLongAudioSource - workaround for OpenAL clobbered audio issue");
|
||||
//This is a workaround for an issue in all simulators (tested to 3.1.2). Problem is
|
||||
//that OpenAL audio playback is clobbered when an AVAudioPlayer stops. Workaround
|
||||
//that OpenAL audio playback is clobbered when an CCAudioPlayer stops. Workaround
|
||||
//is to keep the player playing on an endless loop with 0 volume and then when
|
||||
//it is played again reset the volume and set loop count appropriately.
|
||||
//NB: this workaround is not foolproof but it is good enough for most situations.
|
||||
|
@ -208,11 +208,11 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
|
|||
}
|
||||
}
|
||||
|
||||
-(void)audioPlayerBeginInterruption:(AVAudioPlayer *)player {
|
||||
-(void)audioPlayerBeginInterruption:(CCAudioPlayer *)player {
|
||||
CDLOGINFO(@"Denshion::CDLongAudioSource - audio player interrupted");
|
||||
}
|
||||
|
||||
-(void)audioPlayerEndInterruption:(AVAudioPlayer *)player {
|
||||
-(void)audioPlayerEndInterruption:(CCAudioPlayer *)player {
|
||||
CDLOGINFO(@"Denshion::CDLongAudioSource - audio player resumed");
|
||||
if (self.backgroundMusic) {
|
||||
//Check if background music can play as rules may have changed during
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
A set of proxy classes to allow iOS audio code to run on MacOS X. AVAudioPlayer is implemented using NSSound.
|
||||
A set of proxy classes to allow iOS audio code to run on MacOS X. CCAudioPlayer is implemented using NSSound.
|
||||
AVAudioSession is a "do nothing" class as it isn't really relevant on MacOS X.
|
||||
|
||||
Limitations:
|
||||
AVAudioPlayer numberOfLoops not correctly supported. Looping is either on or off, can not specify a specific number of loops.
|
||||
AVAudioPlayer panning not supported.
|
||||
AVAudioPlayer metering not supported.
|
||||
CCAudioPlayer numberOfLoops not correctly supported. Looping is either on or off, can not specify a specific number of loops.
|
||||
CCAudioPlayer panning not supported.
|
||||
CCAudioPlayer metering not supported.
|
||||
AVAudioSession nothing is supported, not applicable to MacOS X.
|
||||
*/
|
||||
|
||||
|
@ -60,7 +60,7 @@ extern OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *o
|
|||
@protocol AVAudioPlayerDelegate;
|
||||
|
||||
/* This class is available with iPhone 2.2 or later */
|
||||
@interface AVAudioPlayer : NSObject <NSSoundDelegate> {
|
||||
@interface CCAudioPlayer : NSObject <NSSoundDelegate> {
|
||||
|
||||
// properties
|
||||
id<AVAudioPlayerDelegate> delegate;
|
||||
|
@ -137,24 +137,24 @@ extern OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *o
|
|||
|
||||
@end
|
||||
|
||||
/* A protocol for delegates of AVAudioPlayer */
|
||||
/* A protocol for delegates of CCAudioPlayer */
|
||||
@protocol AVAudioPlayerDelegate <NSObject>
|
||||
@optional
|
||||
/* audioPlayerDidFinishPlaying:successfully: is called when a sound has finished playing. This method is NOT called if the player is stopped due to an interruption. */
|
||||
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag;
|
||||
- (void)audioPlayerDidFinishPlaying:(CCAudioPlayer *)player successfully:(BOOL)flag;
|
||||
|
||||
/* if an error occurs while decoding it will be reported to the delegate. */
|
||||
- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error;
|
||||
- (void)audioPlayerDecodeErrorDidOccur:(CCAudioPlayer *)player error:(NSError *)error;
|
||||
|
||||
/* audioPlayerBeginInterruption: is called when the audio session has been interrupted while the player was playing. The player will have been paused. */
|
||||
- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player;
|
||||
- (void)audioPlayerBeginInterruption:(CCAudioPlayer *)player;
|
||||
|
||||
/* audioPlayerEndInterruption:withFlags: is called when the audio session interruption has ended and this player had been interrupted while playing. */
|
||||
/* Currently the only flag is AVAudioSessionInterruptionFlags_ShouldResume. */
|
||||
- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withFlags:(NSUInteger)flags;
|
||||
- (void)audioPlayerEndInterruption:(CCAudioPlayer *)player withFlags:(NSUInteger)flags;
|
||||
|
||||
/* audioPlayerEndInterruption: is called when the preferred method, audioPlayerEndInterruption:withFlags:, is not implemented. */
|
||||
- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player;
|
||||
- (void)audioPlayerEndInterruption:(CCAudioPlayer *)player;
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *outData)
|
|||
return 0;
|
||||
}
|
||||
|
||||
@implementation AVAudioPlayer
|
||||
@implementation CCAudioPlayer
|
||||
|
||||
@synthesize delegate, numberOfChannels, pan, deviceCurrentTime, url, data;
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ Requirements:
|
|||
- Frameworks: OpenAL, AudioToolbox, AVFoundation
|
||||
|
||||
@par CDAudioManager
|
||||
CDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing
|
||||
CDAudioManager is basically a thin wrapper around an CCAudioPlayer object used for playing
|
||||
background music and a CDSoundEngine object used for playing sound effects. It manages the
|
||||
audio session for you deals with audio session interruption. It is fairly low level and it
|
||||
is expected you have some understanding of the underlying technologies. For example, for
|
||||
many use cases regarding background music it is expected you will work directly with the
|
||||
backgroundMusic AVAudioPlayer which is exposed as a property.
|
||||
backgroundMusic CCAudioPlayer which is exposed as a property.
|
||||
|
||||
Requirements:
|
||||
- Firmware: OS 2.2 or greater
|
||||
|
|
|
@ -242,7 +242,7 @@ void Audio::RewindBackgroundMusic()
|
|||
|
||||
bool Audio::IsBackgroundMusicPlaying()
|
||||
{
|
||||
return IsSoundEffectStarted(m_backgroundID);
|
||||
return IsSoundEffectStarted(m_backgroundID) && !IsSoundEffectPaused(m_backgroundID);
|
||||
}
|
||||
|
||||
void Audio::SetBackgroundVolume(float volume)
|
||||
|
@ -331,7 +331,8 @@ void Audio::PlaySoundEffect(unsigned int sound)
|
|||
return;
|
||||
}
|
||||
|
||||
m_soundEffects[sound].m_soundEffectStarted = true;
|
||||
m_soundEffects[sound].m_soundEffectStarted = true;
|
||||
m_soundEffects[sound].m_soundEffectPaused = false;
|
||||
}
|
||||
|
||||
void Audio::StopSoundEffect(unsigned int sound)
|
||||
|
@ -353,6 +354,7 @@ void Audio::StopSoundEffect(unsigned int sound)
|
|||
}
|
||||
|
||||
m_soundEffects[sound].m_soundEffectStarted = false;
|
||||
m_soundEffects[sound].m_soundEffectPaused = false;
|
||||
}
|
||||
|
||||
void Audio::PauseSoundEffect(unsigned int sound)
|
||||
|
@ -371,6 +373,7 @@ void Audio::PauseSoundEffect(unsigned int sound)
|
|||
m_engineExperiencedCriticalError = true;
|
||||
return;
|
||||
}
|
||||
m_soundEffects[sound].m_soundEffectPaused = true;
|
||||
}
|
||||
|
||||
void Audio::ResumeSoundEffect(unsigned int sound)
|
||||
|
@ -389,6 +392,7 @@ void Audio::ResumeSoundEffect(unsigned int sound)
|
|||
m_engineExperiencedCriticalError = true;
|
||||
return;
|
||||
}
|
||||
m_soundEffects[sound].m_soundEffectPaused = false;
|
||||
}
|
||||
|
||||
void Audio::RewindSoundEffect(unsigned int sound)
|
||||
|
@ -472,6 +476,14 @@ bool Audio::IsSoundEffectStarted(unsigned int sound)
|
|||
return m_soundEffects[sound].m_soundEffectStarted;
|
||||
}
|
||||
|
||||
bool Audio::IsSoundEffectPaused(unsigned int sound)
|
||||
{
|
||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
||||
return false;
|
||||
|
||||
return m_soundEffects[sound].m_soundEffectPaused;
|
||||
}
|
||||
|
||||
void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic)
|
||||
{
|
||||
if (m_engineExperiencedCriticalError) {
|
||||
|
@ -581,6 +593,7 @@ void Audio::UnloadSoundEffect(unsigned int sound)
|
|||
m_soundEffects[sound].m_soundEffectBufferData = nullptr;
|
||||
m_soundEffects[sound].m_soundEffectSourceVoice = nullptr;
|
||||
m_soundEffects[sound].m_soundEffectStarted = false;
|
||||
m_soundEffects[sound].m_soundEffectPaused = false;
|
||||
ZeroMemory(&m_soundEffects[sound].m_audioBuffer, sizeof(m_soundEffects[sound].m_audioBuffer));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ struct SoundEffectData
|
|||
byte* m_soundEffectBufferData;
|
||||
uint32 m_soundEffectBufferLength;
|
||||
uint32 m_soundEffectSampleRate;
|
||||
bool m_soundEffectStarted;
|
||||
bool m_soundEffectStarted;
|
||||
bool m_soundEffectPaused;
|
||||
};
|
||||
|
||||
class Audio;
|
||||
|
@ -148,8 +149,9 @@ public:
|
|||
|
||||
void PlaySoundEffect(const char* pszFilePath, bool bLoop, unsigned int& sound, bool isMusic = false);
|
||||
void PlaySoundEffect(unsigned int sound);
|
||||
bool IsSoundEffectStarted(unsigned int sound);
|
||||
void StopSoundEffect(unsigned int sound);
|
||||
bool IsSoundEffectStarted(unsigned int sound);
|
||||
bool IsSoundEffectPaused(unsigned int sound);
|
||||
void StopSoundEffect(unsigned int sound);
|
||||
void PauseSoundEffect(unsigned int sound);
|
||||
void ResumeSoundEffect(unsigned int sound);
|
||||
void RewindSoundEffect(unsigned int sound);
|
||||
|
|
|
@ -404,7 +404,7 @@ bool Console::listenOnTCP(int port)
|
|||
setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
|
||||
|
||||
// bind address
|
||||
if (_bindAddress.length() > 0)
|
||||
if (!_bindAddress.empty())
|
||||
{
|
||||
if (res->ai_family == AF_INET)
|
||||
{
|
||||
|
@ -533,7 +533,7 @@ void Console::commandFileUtils(int fd, const std::string &args)
|
|||
{
|
||||
FileUtils::getInstance()->purgeCachedEntries();
|
||||
}
|
||||
else if( args.length()==0)
|
||||
else if( args.empty())
|
||||
{
|
||||
sched->performFunctionInCocosThread( std::bind(&printFileUtils, fd) );
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ void Console::commandConfig(int fd, const std::string& args)
|
|||
|
||||
void Console::commandResolution(int fd, const std::string& args)
|
||||
{
|
||||
if(args.length()==0) {
|
||||
if(args.empty()) {
|
||||
auto director = Director::getInstance();
|
||||
Size points = director->getWinSize();
|
||||
Size pixels = director->getWinSizeInPixels();
|
||||
|
@ -598,7 +598,7 @@ void Console::commandProjection(int fd, const std::string& args)
|
|||
auto director = Director::getInstance();
|
||||
Scheduler *sched = director->getScheduler();
|
||||
|
||||
if(args.length()==0)
|
||||
if(args.empty())
|
||||
{
|
||||
char buf[20];
|
||||
auto proj = director->getProjection();
|
||||
|
@ -648,7 +648,7 @@ void Console::commandTextures(int fd, const std::string& args)
|
|||
}
|
||||
);
|
||||
}
|
||||
else if(args.length()==0)
|
||||
else if(args.empty())
|
||||
{
|
||||
sched->performFunctionInCocosThread( [=](){
|
||||
mydprintf(fd, "%s", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());
|
||||
|
|
|
@ -1252,8 +1252,18 @@ void Director::setContentScaleFactor(float scaleFactor)
|
|||
|
||||
void Director::setNotificationNode(Node *node)
|
||||
{
|
||||
CC_SAFE_RELEASE(_notificationNode);
|
||||
_notificationNode = node;
|
||||
if (_notificationNode != nullptr){
|
||||
_notificationNode->onExitTransitionDidStart();
|
||||
_notificationNode->onExit();
|
||||
_notificationNode->cleanup();
|
||||
}
|
||||
CC_SAFE_RELEASE(_notificationNode);
|
||||
|
||||
_notificationNode = node;
|
||||
if (node == nullptr)
|
||||
return;
|
||||
_notificationNode->onEnter();
|
||||
_notificationNode->onEnterTransitionDidFinish();
|
||||
CC_SAFE_RETAIN(_notificationNode);
|
||||
}
|
||||
|
||||
|
@ -1305,9 +1315,7 @@ void DisplayLinkDirector::startAnimation()
|
|||
|
||||
_cocos2d_thread_id = std::this_thread::get_id();
|
||||
|
||||
#ifndef WP8_SHADER_COMPILER
|
||||
Application::getInstance()->setAnimationInterval(_animationInterval);
|
||||
#endif
|
||||
|
||||
// fix issue #3509, skip one fps to avoid incorrect time calculation.
|
||||
setNextDeltaTimeZero(true);
|
||||
|
|
|
@ -184,10 +184,7 @@ Rect NinePatchImageParser::parseCapInset() const
|
|||
verticalLine.y - verticalLine.x);
|
||||
}
|
||||
|
||||
capInsets = Rect(capInsets.origin.x / CC_CONTENT_SCALE_FACTOR(),
|
||||
capInsets.origin.y / CC_CONTENT_SCALE_FACTOR(),
|
||||
capInsets.size.width / CC_CONTENT_SCALE_FACTOR(),
|
||||
capInsets.size.height / CC_CONTENT_SCALE_FACTOR());
|
||||
capInsets = CC_RECT_PIXELS_TO_POINTS(capInsets);
|
||||
return capInsets;
|
||||
}
|
||||
|
||||
|
|
|
@ -130,19 +130,15 @@ void Timer::update(float dt)
|
|||
trigger(interval);
|
||||
_elapsed -= interval;
|
||||
_timesExecuted += 1;
|
||||
if (_elapsed <= 0.f)
|
||||
|
||||
if (!_runForever && _timesExecuted > _repeat)
|
||||
{
|
||||
cancel();
|
||||
break;
|
||||
}
|
||||
|
||||
if (_runForever)
|
||||
if (_elapsed <= 0.f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_timesExecuted > _repeat)
|
||||
{ //unschedule timer
|
||||
cancel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_CC_BEGIN
|
|||
|
||||
CC_DLL const char* cocos2dVersion()
|
||||
{
|
||||
return "cocos2d-x-3.8-github";
|
||||
return "cocos2d-x-3.8";
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -138,6 +138,7 @@ THE SOFTWARE.
|
|||
|
||||
// 2d utils
|
||||
#include "2d/CCCamera.h"
|
||||
#include "2d/CCCameraBackgroundBrush.h"
|
||||
#include "2d/CCGrabber.h"
|
||||
#include "2d/CCGrid.h"
|
||||
#include "2d/CCLight.h"
|
||||
|
@ -162,6 +163,7 @@ THE SOFTWARE.
|
|||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCTechnique.h"
|
||||
#include "renderer/CCTexture2D.h"
|
||||
#include "renderer/CCTextureCube.h"
|
||||
#include "renderer/CCTextureCache.h"
|
||||
#include "renderer/CCTrianglesCommand.h"
|
||||
#include "renderer/CCVertexAttribBinding.h"
|
||||
|
@ -297,7 +299,7 @@ THE SOFTWARE.
|
|||
#include "3d/CCSprite3D.h"
|
||||
#include "3d/CCSprite3DMaterial.h"
|
||||
#include "3d/CCTerrain.h"
|
||||
#include "3d/CCTextureCube.h"
|
||||
|
||||
|
||||
// Deprecated include
|
||||
#include "deprecated/CCArray.h"
|
||||
|
|
|
@ -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 != nullptr, "Invalid Argument!");
|
||||
CCASSERT(!key.empty() && pObject != nullptr, "Invalid Argument!");
|
||||
if (_dictType == kDictUnknown)
|
||||
{
|
||||
_dictType = kDictStr;
|
||||
|
@ -276,7 +276,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!");
|
||||
CCASSERT(!key.empty(), "Invalid Argument!");
|
||||
DictElement *pElement = nullptr;
|
||||
HASH_FIND_STR(_elements, key.c_str(), pElement);
|
||||
removeObjectForElememt(pElement);
|
||||
|
|
|
@ -196,7 +196,7 @@ __Array* __String::componentsSeparatedByString(const char *delimiter)
|
|||
strTmp = strTmp.substr(cutAt + 1);
|
||||
}
|
||||
|
||||
if(strTmp.length() > 0)
|
||||
if(!strTmp.empty())
|
||||
{
|
||||
result->addObject(__String::create(strTmp));
|
||||
}
|
||||
|
|
|
@ -663,7 +663,7 @@ Sequence* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* ch
|
|||
|
||||
if(target != nullptr)
|
||||
{
|
||||
if(selectorName.length() > 0)
|
||||
if(!selectorName.empty())
|
||||
{
|
||||
SEL_CallFuncN selCallFunc = 0;
|
||||
|
||||
|
|
|
@ -796,7 +796,7 @@ CCBKeyframe* CCBReader::readKeyframe(PropertyType type)
|
|||
|
||||
SpriteFrame* spriteFrame;
|
||||
|
||||
if (spriteSheet.length() == 0)
|
||||
if (spriteSheet.empty())
|
||||
{
|
||||
spriteFile = _CCBRootPath + spriteFile;
|
||||
|
||||
|
|
|
@ -575,9 +575,9 @@ SpriteFrame * NodeLoader::parsePropTypeSpriteFrame(Node * pNode, Node * pParent,
|
|||
std::string spriteFile = ccbReader->readCachedString();
|
||||
|
||||
SpriteFrame *spriteFrame = nullptr;
|
||||
if (spriteFile.length() != 0)
|
||||
if (!spriteFile.empty())
|
||||
{
|
||||
if (spriteSheet.length() == 0)
|
||||
if (spriteSheet.empty())
|
||||
{
|
||||
spriteFile = ccbReader->getCCBRootPath() + spriteFile;
|
||||
Texture2D * texture = Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());
|
||||
|
@ -623,7 +623,7 @@ Animation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCB
|
|||
animation = CCBReader::lastPathComponent(animation.c_str());
|
||||
animationFile = CCBReader::lastPathComponent(animationFile.c_str());
|
||||
|
||||
if (animation.length() > 0)
|
||||
if (!animation.empty())
|
||||
{
|
||||
AnimationCache * animationCache = AnimationCache::getInstance();
|
||||
animationCache->addAnimationsWithFile(animationFile.c_str());
|
||||
|
@ -636,7 +636,7 @@ Animation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCB
|
|||
Texture2D * NodeLoader::parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * ccbReader) {
|
||||
std::string spriteFile = ccbReader->getCCBRootPath() + ccbReader->readCachedString();
|
||||
|
||||
if (spriteFile.length() > 0)
|
||||
if (!spriteFile.empty())
|
||||
{
|
||||
return Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());
|
||||
}
|
||||
|
@ -775,7 +775,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead
|
|||
|
||||
if(target != nullptr)
|
||||
{
|
||||
if(selectorName.length() > 0)
|
||||
if(!selectorName.empty())
|
||||
{
|
||||
SEL_MenuHandler selMenuHandler = 0;
|
||||
|
||||
|
@ -856,7 +856,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP
|
|||
|
||||
if(target != nullptr)
|
||||
{
|
||||
if(selectorName.length() > 0)
|
||||
if(!selectorName.empty())
|
||||
{
|
||||
Control::Handler selControlHandler = 0;
|
||||
|
||||
|
|
|
@ -74,14 +74,14 @@ BoneNode* BoneNode::create(int length)
|
|||
|
||||
void BoneNode::addChild(cocos2d::Node* child, int localZOrder, int tag)
|
||||
{
|
||||
Node::addChild(child, localZOrder, tag);
|
||||
addToChildrenListHelper(child);
|
||||
Node::addChild(child, localZOrder, tag);
|
||||
}
|
||||
|
||||
void BoneNode::addChild(Node* child, int localZOrder, const std::string &name)
|
||||
{
|
||||
Node::addChild(child, localZOrder, name);
|
||||
addToChildrenListHelper(child);
|
||||
Node::addChild(child, localZOrder, name);
|
||||
}
|
||||
|
||||
void BoneNode::addSkin(SkinNode* skin, bool isDisplay, bool hideOthers)
|
||||
|
@ -441,6 +441,44 @@ void BoneNode::updateColor()
|
|||
_transformUpdated = _transformDirty = _inverseDirty = _contentSizeDirty = true;
|
||||
}
|
||||
|
||||
void BoneNode::updateDisplayedColor(const cocos2d::Color3B& parentColor)
|
||||
{
|
||||
if (_cascadeColorEnabled)
|
||||
{
|
||||
for (const auto &child : _boneSkins)
|
||||
{
|
||||
child->updateDisplayedColor(_displayedColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BoneNode::updateDisplayedOpacity(GLubyte parentOpacity)
|
||||
{
|
||||
if (_cascadeOpacityEnabled)
|
||||
{
|
||||
for (const auto& child : _boneSkins)
|
||||
{
|
||||
child->updateDisplayedOpacity(_displayedOpacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BoneNode::disableCascadeOpacity()
|
||||
{
|
||||
for (const auto& child : _boneSkins)
|
||||
{
|
||||
child->updateDisplayedOpacity(255);
|
||||
}
|
||||
}
|
||||
|
||||
void BoneNode::disableCascadeColor()
|
||||
{
|
||||
for (const auto& child : _boneSkins)
|
||||
{
|
||||
child->updateDisplayedColor(cocos2d::Color3B::WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
void BoneNode::onDraw(const cocos2d::Mat4 &transform, uint32_t flags)
|
||||
{
|
||||
getGLProgram()->use();
|
||||
|
@ -550,6 +588,12 @@ bool BoneNode::isPointOnRack(const cocos2d::Vec2& bonePoint)
|
|||
|
||||
void BoneNode::batchBoneDrawToSkeleton(BoneNode* bone) const
|
||||
{
|
||||
bool visibleByCamera = bone->isVisitableByVisitingCamera();
|
||||
if (!visibleByCamera)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cocos2d::Vec3 vpos[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
|
|
@ -185,6 +185,12 @@ protected:
|
|||
virtual void updateVertices();
|
||||
virtual void updateColor() override;
|
||||
|
||||
// bone's color and opacity cannot cascade to bone
|
||||
virtual void updateDisplayedColor(const cocos2d::Color3B& parentColor) override;
|
||||
virtual void updateDisplayedOpacity(GLubyte parentOpacity) override;
|
||||
virtual void disableCascadeOpacity() override;
|
||||
virtual void disableCascadeColor() override;
|
||||
|
||||
virtual void onDraw(const cocos2d::Mat4 &transform, uint32_t flags);
|
||||
|
||||
// override Node::visit, just visit bones in children
|
||||
|
|
|
@ -212,7 +212,7 @@ Bone *Armature::createBone(const std::string& boneName)
|
|||
|
||||
Bone *bone = nullptr;
|
||||
|
||||
if( parentName.length() != 0 )
|
||||
if( !parentName.empty())
|
||||
{
|
||||
createBone(parentName.c_str());
|
||||
bone = Bone::create(boneName);
|
||||
|
|
|
@ -257,13 +257,17 @@ void Bone::setBlendFunc(const BlendFunc& blendFunc)
|
|||
|
||||
void Bone::updateDisplayedColor(const Color3B &parentColor)
|
||||
{
|
||||
#ifdef CC_STUDIO_ENABLED_VIEW
|
||||
_realColor = Color3B(255, 255, 255);
|
||||
#endif // CC_STUDIO_ENABLED_VIEW
|
||||
Node::updateDisplayedColor(parentColor);
|
||||
}
|
||||
|
||||
void Bone::updateDisplayedOpacity(GLubyte parentOpacity)
|
||||
{
|
||||
#ifdef CC_STUDIO_ENABLED_VIEW
|
||||
_realOpacity = 255;
|
||||
#endif // CC_STUDIO_ENABLED_VIEW
|
||||
Node::updateDisplayedOpacity(parentOpacity);
|
||||
}
|
||||
|
||||
|
|
|
@ -809,7 +809,7 @@ MovementData *DataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementXML
|
|||
|
||||
|
||||
tinyxml2::XMLElement *parentXml = nullptr;
|
||||
if (parentName.length() != 0)
|
||||
if (!parentName.empty())
|
||||
{
|
||||
parentXml = movementXML->FirstChildElement(BONE);
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ void DisplayFactory::createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisp
|
|||
}
|
||||
|
||||
//! create display
|
||||
if(textureName.length() == 0)
|
||||
if(textureName.empty())
|
||||
{
|
||||
skin = Skin::create();
|
||||
}
|
||||
|
|
|
@ -764,7 +764,11 @@ void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widg
|
|||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
button->setTitleFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
const char * szTemp = DICTOOL->getStringValue_json(options, "fontName");
|
||||
if (szTemp && *szTemp)
|
||||
button->setTitleFontName(szTemp);
|
||||
else
|
||||
button->setTitleFontName(std::string(""));
|
||||
}
|
||||
setColorPropsForWidgetFromJsonDictionary(widget,options);
|
||||
}
|
||||
|
@ -882,7 +886,11 @@ void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widge
|
|||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
label->setFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
const char * szTemp = DICTOOL->getStringValue_json(options, "fontName");
|
||||
if (szTemp && *szTemp)
|
||||
label->setFontName(szTemp);
|
||||
else
|
||||
label->setFontName(std::string(""));
|
||||
}
|
||||
bool aw = DICTOOL->checkObjectExist_json(options, "areaWidth");
|
||||
bool ah = DICTOOL->checkObjectExist_json(options, "areaHeight");
|
||||
|
@ -1105,7 +1113,11 @@ void WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*w
|
|||
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
|
||||
if (fn)
|
||||
{
|
||||
textField->setFontName(DICTOOL->getStringValue_json(options, "fontName"));
|
||||
const char * szTemp = DICTOOL->getStringValue_json(options, "fontName");
|
||||
if (szTemp && *szTemp)
|
||||
textField->setFontName(szTemp);
|
||||
else
|
||||
textField->setFontName(std::string(""));
|
||||
}
|
||||
bool tsw = DICTOOL->checkObjectExist_json(options, "touchSizeWidth");
|
||||
bool tsh = DICTOOL->checkObjectExist_json(options, "touchSizeHeight");
|
||||
|
|
|
@ -345,9 +345,9 @@ void Tween::arriveKeyFrame(FrameData *keyFrameData)
|
|||
Armature *childAramture = _bone->getChildArmature();
|
||||
if(childAramture)
|
||||
{
|
||||
if(keyFrameData->strMovement.length() != 0)
|
||||
if(!keyFrameData->strMovement.empty())
|
||||
{
|
||||
childAramture->getAnimation()->play(keyFrameData->strMovement.c_str());
|
||||
childAramture->getAnimation()->play(keyFrameData->strMovement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ float Tween::updateFrameData(float currentPercent)
|
|||
to = frames.at(_toIndex);
|
||||
|
||||
//! Guaranteed to trigger frame event
|
||||
if(from->strEvent.length() != 0 && !_animation->isIgnoreFrameEvent())
|
||||
if(!from->strEvent.empty() && !_animation->isIgnoreFrameEvent())
|
||||
{
|
||||
_animation->frameEvent(_bone, from->strEvent.c_str(), from->frameID, playedTime);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ struct EventFrame;
|
|||
struct IntFrame;
|
||||
struct BoolFrame;
|
||||
struct InnerActionFrame;
|
||||
struct EasingData;
|
||||
struct RotationSkew;
|
||||
struct Position;
|
||||
struct Scale;
|
||||
|
@ -51,7 +52,9 @@ struct Color;
|
|||
struct ColorVector;
|
||||
struct FlatSize;
|
||||
struct CapInsets;
|
||||
struct BlendFunc;
|
||||
struct ResourceData;
|
||||
struct BlendFrame;
|
||||
} // namespace flatbuffers
|
||||
|
||||
namespace flatbuffers {
|
||||
|
@ -60,6 +63,7 @@ struct Node3DOption;
|
|||
struct Sprite3DOptions;
|
||||
struct Particle3DOptions;
|
||||
struct UserCameraOptions;
|
||||
struct GameNode3DOption;
|
||||
struct Vector2;
|
||||
struct Vector3;
|
||||
|
||||
|
@ -93,92 +97,6 @@ MANUALLY_ALIGNED_STRUCT(4) Vector3 {
|
|||
};
|
||||
STRUCT_END(Vector3, 12);
|
||||
|
||||
struct GameNode3DOption : private flatbuffers::Table {
|
||||
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(4); }
|
||||
int32_t skyBoxMask() const { return GetField<int32_t>(6, 0); }
|
||||
uint8_t skyBoxEnabled() const { return GetField<uint8_t>(8, 0); }
|
||||
const ResourceData *leftFileData() const { return GetPointer<const ResourceData *>(10); }
|
||||
const ResourceData *rightFileData() const { return GetPointer<const ResourceData *>(12); }
|
||||
const ResourceData *upFileData() const { return GetPointer<const ResourceData *>(14); }
|
||||
const ResourceData *downFileData() const { return GetPointer<const ResourceData *>(16); }
|
||||
const ResourceData *forwardFileData() const { return GetPointer<const ResourceData *>(18); }
|
||||
const ResourceData *backFileData() const { return GetPointer<const ResourceData *>(20); }
|
||||
const flatbuffers::String *frameEvent() const { return GetPointer<const flatbuffers::String *>(22); }
|
||||
const flatbuffers::String *customProperty() const { return GetPointer<const flatbuffers::String *>(24); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* nodeOptions */) &&
|
||||
verifier.Verify(name()) &&
|
||||
VerifyField<int32_t>(verifier, 6 /* skyBoxMask */) &&
|
||||
VerifyField<uint8_t>(verifier, 8 /* skyBoxEnabled */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* leftFileData */) &&
|
||||
verifier.VerifyTable(leftFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 12 /* rightFileData */) &&
|
||||
verifier.VerifyTable(rightFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 14 /* upFileData */) &&
|
||||
verifier.VerifyTable(upFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 16 /* downFileData */) &&
|
||||
verifier.VerifyTable(downFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 18 /* forwardFileData */) &&
|
||||
verifier.VerifyTable(forwardFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 20 /* backFileData */) &&
|
||||
verifier.VerifyTable(backFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 22 /* frameEvent */) &&
|
||||
verifier.Verify(frameEvent()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 24 /* customProperty */) &&
|
||||
verifier.Verify(customProperty()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct GameNode3DOptionBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) { fbb_.AddOffset(4, name); }
|
||||
void add_skyBoxMask(int32_t skyBoxMask) { fbb_.AddElement<int32_t>(6, skyBoxMask, 0); }
|
||||
void add_skyboxEnabled(uint8_t skyBoxEnabled) { fbb_.AddElement<uint8_t>(8, skyBoxEnabled, 0); }
|
||||
void add_leftFileData(flatbuffers::Offset<ResourceData> leftFileData) { fbb_.AddOffset(10, leftFileData); }
|
||||
void add_rightFileData(flatbuffers::Offset<ResourceData> rightFileData) { fbb_.AddOffset(12, rightFileData); }
|
||||
void add_upFileData(flatbuffers::Offset<ResourceData> upFileData) { fbb_.AddOffset(14, upFileData); }
|
||||
void add_downFileData(flatbuffers::Offset<ResourceData> downFileData) { fbb_.AddOffset(16, downFileData); }
|
||||
void add_forwardFileData(flatbuffers::Offset<ResourceData> forwardFileData) { fbb_.AddOffset(18, forwardFileData); }
|
||||
void add_backFileData(flatbuffers::Offset<ResourceData> backFileData) { fbb_.AddOffset(20, backFileData); }
|
||||
void add_frameEvent(flatbuffers::Offset<flatbuffers::String> frameEvent) { fbb_.AddOffset(22, frameEvent); }
|
||||
void add_customProperty(flatbuffers::Offset<flatbuffers::String> customProperty) { fbb_.AddOffset(24, customProperty); }
|
||||
GameNode3DOptionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
flatbuffers::Offset<GameNode3DOption> Finish() {
|
||||
auto o = flatbuffers::Offset<GameNode3DOption>(fbb_.EndTable(start_, 11));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GameNode3DOption> CreateGameNode3DOption(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::String> name = 0,
|
||||
int32_t skyBoxMask = 0,
|
||||
uint8_t skyBoxEnabled = 0,
|
||||
flatbuffers::Offset<ResourceData> leftFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> rightFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> upFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> downFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> forwardFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> backFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> frameEvent = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> customProperty = 0) {
|
||||
GameNode3DOptionBuilder builder_(_fbb);
|
||||
builder_.add_customProperty(customProperty);
|
||||
builder_.add_frameEvent(frameEvent);
|
||||
builder_.add_backFileData(backFileData);
|
||||
builder_.add_forwardFileData(forwardFileData);
|
||||
builder_.add_downFileData(downFileData);
|
||||
builder_.add_upFileData(upFileData);
|
||||
builder_.add_rightFileData(rightFileData);
|
||||
builder_.add_leftFileData(leftFileData);
|
||||
builder_.add_skyboxEnabled(skyBoxEnabled);
|
||||
builder_.add_skyBoxMask(skyBoxMask);
|
||||
builder_.add_name(name);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct Node3DOption : private flatbuffers::Table {
|
||||
const flatbuffers::WidgetOptions *nodeOptions() const { return GetPointer<const flatbuffers::WidgetOptions *>(4); }
|
||||
const Vector3 *position3D() const { return GetStruct<const Vector3 *>(6); }
|
||||
|
@ -232,6 +150,7 @@ struct Sprite3DOptions : private flatbuffers::Table {
|
|||
const Node3DOption *node3DOption() const { return GetPointer<const Node3DOption *>(4); }
|
||||
const flatbuffers::ResourceData *fileData() const { return GetPointer<const flatbuffers::ResourceData *>(6); }
|
||||
uint8_t runAction() const { return GetField<uint8_t>(8, 0); }
|
||||
uint8_t isFlipped() const { return GetField<uint8_t>(10, 0); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* node3DOption */) &&
|
||||
|
@ -239,6 +158,7 @@ struct Sprite3DOptions : private flatbuffers::Table {
|
|||
VerifyField<flatbuffers::uoffset_t>(verifier, 6 /* fileData */) &&
|
||||
verifier.VerifyTable(fileData()) &&
|
||||
VerifyField<uint8_t>(verifier, 8 /* runAction */) &&
|
||||
VerifyField<uint8_t>(verifier, 10 /* isFlipped */) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
@ -249,10 +169,11 @@ struct Sprite3DOptionsBuilder {
|
|||
void add_node3DOption(flatbuffers::Offset<Node3DOption> node3DOption) { fbb_.AddOffset(4, node3DOption); }
|
||||
void add_fileData(flatbuffers::Offset<flatbuffers::ResourceData> fileData) { fbb_.AddOffset(6, fileData); }
|
||||
void add_runAction(uint8_t runAction) { fbb_.AddElement<uint8_t>(8, runAction, 0); }
|
||||
void add_isFlipped(uint8_t isFlipped) { fbb_.AddElement<uint8_t>(10, isFlipped, 0); }
|
||||
Sprite3DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
Sprite3DOptionsBuilder &operator=(const Sprite3DOptionsBuilder &);
|
||||
flatbuffers::Offset<Sprite3DOptions> Finish() {
|
||||
auto o = flatbuffers::Offset<Sprite3DOptions>(fbb_.EndTable(start_, 3));
|
||||
auto o = flatbuffers::Offset<Sprite3DOptions>(fbb_.EndTable(start_, 4));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
@ -260,10 +181,12 @@ struct Sprite3DOptionsBuilder {
|
|||
inline flatbuffers::Offset<Sprite3DOptions> CreateSprite3DOptions(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<Node3DOption> node3DOption = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> fileData = 0,
|
||||
uint8_t runAction = 0) {
|
||||
uint8_t runAction = 0,
|
||||
uint8_t isFlipped = 0) {
|
||||
Sprite3DOptionsBuilder builder_(_fbb);
|
||||
builder_.add_fileData(fileData);
|
||||
builder_.add_node3DOption(node3DOption);
|
||||
builder_.add_isFlipped(isFlipped);
|
||||
builder_.add_runAction(runAction);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
@ -310,12 +233,12 @@ struct UserCameraOptions : private flatbuffers::Table {
|
|||
float farClip() const { return GetField<float>(10, 1000); }
|
||||
int32_t cameraFlag() const { return GetField<int32_t>(12, 0); }
|
||||
uint8_t skyBoxEnabled() const { return GetField<uint8_t>(14, 0); }
|
||||
const ResourceData *leftFileData() const { return GetPointer<const ResourceData *>(16); }
|
||||
const ResourceData *rightFileData() const { return GetPointer<const ResourceData *>(18); }
|
||||
const ResourceData *upFileData() const { return GetPointer<const ResourceData *>(20); }
|
||||
const ResourceData *downFileData() const { return GetPointer<const ResourceData *>(22); }
|
||||
const ResourceData *forwardFileData() const { return GetPointer<const ResourceData *>(24); }
|
||||
const ResourceData *backFileData() const { return GetPointer<const ResourceData *>(26); }
|
||||
const flatbuffers::ResourceData *leftFileData() const { return GetPointer<const flatbuffers::ResourceData *>(16); }
|
||||
const flatbuffers::ResourceData *rightFileData() const { return GetPointer<const flatbuffers::ResourceData *>(18); }
|
||||
const flatbuffers::ResourceData *upFileData() const { return GetPointer<const flatbuffers::ResourceData *>(20); }
|
||||
const flatbuffers::ResourceData *downFileData() const { return GetPointer<const flatbuffers::ResourceData *>(22); }
|
||||
const flatbuffers::ResourceData *forwardFileData() const { return GetPointer<const flatbuffers::ResourceData *>(24); }
|
||||
const flatbuffers::ResourceData *backFileData() const { return GetPointer<const flatbuffers::ResourceData *>(26); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* node3DOption */) &&
|
||||
|
@ -349,13 +272,13 @@ struct UserCameraOptionsBuilder {
|
|||
void add_nearClip(float nearClip) { fbb_.AddElement<float>(8, nearClip, 1); }
|
||||
void add_farClip(float farClip) { fbb_.AddElement<float>(10, farClip, 1000); }
|
||||
void add_cameraFlag(int32_t cameraFlag) { fbb_.AddElement<int32_t>(12, cameraFlag, 0); }
|
||||
void add_skyboxEnabled(uint8_t skyBoxEnabled) { fbb_.AddElement<uint8_t>(14, skyBoxEnabled, 0); }
|
||||
void add_leftFileData(flatbuffers::Offset<ResourceData> leftFileData) { fbb_.AddOffset(16, leftFileData); }
|
||||
void add_rightFileData(flatbuffers::Offset<ResourceData> rightFileData) { fbb_.AddOffset(18, rightFileData); }
|
||||
void add_upFileData(flatbuffers::Offset<ResourceData> upFileData) { fbb_.AddOffset(20, upFileData); }
|
||||
void add_downFileData(flatbuffers::Offset<ResourceData> downFileData) { fbb_.AddOffset(22, downFileData); }
|
||||
void add_forwardFileData(flatbuffers::Offset<ResourceData> forwardFileData) { fbb_.AddOffset(24, forwardFileData); }
|
||||
void add_backFileData(flatbuffers::Offset<ResourceData> backFileData) { fbb_.AddOffset(26, backFileData); }
|
||||
void add_skyBoxEnabled(uint8_t skyBoxEnabled) { fbb_.AddElement<uint8_t>(14, skyBoxEnabled, 0); }
|
||||
void add_leftFileData(flatbuffers::Offset<flatbuffers::ResourceData> leftFileData) { fbb_.AddOffset(16, leftFileData); }
|
||||
void add_rightFileData(flatbuffers::Offset<flatbuffers::ResourceData> rightFileData) { fbb_.AddOffset(18, rightFileData); }
|
||||
void add_upFileData(flatbuffers::Offset<flatbuffers::ResourceData> upFileData) { fbb_.AddOffset(20, upFileData); }
|
||||
void add_downFileData(flatbuffers::Offset<flatbuffers::ResourceData> downFileData) { fbb_.AddOffset(22, downFileData); }
|
||||
void add_forwardFileData(flatbuffers::Offset<flatbuffers::ResourceData> forwardFileData) { fbb_.AddOffset(24, forwardFileData); }
|
||||
void add_backFileData(flatbuffers::Offset<flatbuffers::ResourceData> backFileData) { fbb_.AddOffset(26, backFileData); }
|
||||
UserCameraOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
UserCameraOptionsBuilder &operator=(const UserCameraOptionsBuilder &);
|
||||
flatbuffers::Offset<UserCameraOptions> Finish() {
|
||||
|
@ -371,12 +294,12 @@ inline flatbuffers::Offset<UserCameraOptions> CreateUserCameraOptions(flatbuffer
|
|||
float farClip = 1000,
|
||||
int32_t cameraFlag = 0,
|
||||
uint8_t skyBoxEnabled = 0,
|
||||
flatbuffers::Offset<ResourceData> leftFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> rightFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> upFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> downFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> forwardFileData = 0,
|
||||
flatbuffers::Offset<ResourceData> backFileData = 0) {
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> leftFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> rightFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> upFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> downFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> forwardFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> backFileData = 0) {
|
||||
UserCameraOptionsBuilder builder_(_fbb);
|
||||
builder_.add_backFileData(backFileData);
|
||||
builder_.add_forwardFileData(forwardFileData);
|
||||
|
@ -384,12 +307,99 @@ inline flatbuffers::Offset<UserCameraOptions> CreateUserCameraOptions(flatbuffer
|
|||
builder_.add_upFileData(upFileData);
|
||||
builder_.add_rightFileData(rightFileData);
|
||||
builder_.add_leftFileData(leftFileData);
|
||||
builder_.add_skyboxEnabled(skyBoxEnabled);
|
||||
builder_.add_cameraFlag(cameraFlag);
|
||||
builder_.add_farClip(farClip);
|
||||
builder_.add_nearClip(nearClip);
|
||||
builder_.add_fov(fov);
|
||||
builder_.add_node3DOption(node3DOption);
|
||||
builder_.add_skyBoxEnabled(skyBoxEnabled);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct GameNode3DOption : private flatbuffers::Table {
|
||||
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(4); }
|
||||
int32_t skyBoxMask() const { return GetField<int32_t>(6, 0); }
|
||||
uint8_t skyBoxEnabled() const { return GetField<uint8_t>(8, 0); }
|
||||
const flatbuffers::ResourceData *leftFileData() const { return GetPointer<const flatbuffers::ResourceData *>(10); }
|
||||
const flatbuffers::ResourceData *rightFileData() const { return GetPointer<const flatbuffers::ResourceData *>(12); }
|
||||
const flatbuffers::ResourceData *upFileData() const { return GetPointer<const flatbuffers::ResourceData *>(14); }
|
||||
const flatbuffers::ResourceData *downFileData() const { return GetPointer<const flatbuffers::ResourceData *>(16); }
|
||||
const flatbuffers::ResourceData *forwardFileData() const { return GetPointer<const flatbuffers::ResourceData *>(18); }
|
||||
const flatbuffers::ResourceData *backFileData() const { return GetPointer<const flatbuffers::ResourceData *>(20); }
|
||||
const flatbuffers::String *frameEvent() const { return GetPointer<const flatbuffers::String *>(22); }
|
||||
const flatbuffers::String *customProperty() const { return GetPointer<const flatbuffers::String *>(24); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* name */) &&
|
||||
verifier.Verify(name()) &&
|
||||
VerifyField<int32_t>(verifier, 6 /* skyBoxMask */) &&
|
||||
VerifyField<uint8_t>(verifier, 8 /* skyBoxEnabled */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* leftFileData */) &&
|
||||
verifier.VerifyTable(leftFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 12 /* rightFileData */) &&
|
||||
verifier.VerifyTable(rightFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 14 /* upFileData */) &&
|
||||
verifier.VerifyTable(upFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 16 /* downFileData */) &&
|
||||
verifier.VerifyTable(downFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 18 /* forwardFileData */) &&
|
||||
verifier.VerifyTable(forwardFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 20 /* backFileData */) &&
|
||||
verifier.VerifyTable(backFileData()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 22 /* frameEvent */) &&
|
||||
verifier.Verify(frameEvent()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 24 /* customProperty */) &&
|
||||
verifier.Verify(customProperty()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct GameNode3DOptionBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) { fbb_.AddOffset(4, name); }
|
||||
void add_skyBoxMask(int32_t skyBoxMask) { fbb_.AddElement<int32_t>(6, skyBoxMask, 0); }
|
||||
void add_skyBoxEnabled(uint8_t skyBoxEnabled) { fbb_.AddElement<uint8_t>(8, skyBoxEnabled, 0); }
|
||||
void add_leftFileData(flatbuffers::Offset<flatbuffers::ResourceData> leftFileData) { fbb_.AddOffset(10, leftFileData); }
|
||||
void add_rightFileData(flatbuffers::Offset<flatbuffers::ResourceData> rightFileData) { fbb_.AddOffset(12, rightFileData); }
|
||||
void add_upFileData(flatbuffers::Offset<flatbuffers::ResourceData> upFileData) { fbb_.AddOffset(14, upFileData); }
|
||||
void add_downFileData(flatbuffers::Offset<flatbuffers::ResourceData> downFileData) { fbb_.AddOffset(16, downFileData); }
|
||||
void add_forwardFileData(flatbuffers::Offset<flatbuffers::ResourceData> forwardFileData) { fbb_.AddOffset(18, forwardFileData); }
|
||||
void add_backFileData(flatbuffers::Offset<flatbuffers::ResourceData> backFileData) { fbb_.AddOffset(20, backFileData); }
|
||||
void add_frameEvent(flatbuffers::Offset<flatbuffers::String> frameEvent) { fbb_.AddOffset(22, frameEvent); }
|
||||
void add_customProperty(flatbuffers::Offset<flatbuffers::String> customProperty) { fbb_.AddOffset(24, customProperty); }
|
||||
GameNode3DOptionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
GameNode3DOptionBuilder &operator=(const GameNode3DOptionBuilder &);
|
||||
flatbuffers::Offset<GameNode3DOption> Finish() {
|
||||
auto o = flatbuffers::Offset<GameNode3DOption>(fbb_.EndTable(start_, 11));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GameNode3DOption> CreateGameNode3DOption(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::String> name = 0,
|
||||
int32_t skyBoxMask = 0,
|
||||
uint8_t skyBoxEnabled = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> leftFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> rightFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> upFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> downFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> forwardFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::ResourceData> backFileData = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> frameEvent = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> customProperty = 0) {
|
||||
GameNode3DOptionBuilder builder_(_fbb);
|
||||
builder_.add_customProperty(customProperty);
|
||||
builder_.add_frameEvent(frameEvent);
|
||||
builder_.add_backFileData(backFileData);
|
||||
builder_.add_forwardFileData(forwardFileData);
|
||||
builder_.add_downFileData(downFileData);
|
||||
builder_.add_upFileData(upFileData);
|
||||
builder_.add_rightFileData(rightFileData);
|
||||
builder_.add_leftFileData(leftFileData);
|
||||
builder_.add_skyBoxMask(skyBoxMask);
|
||||
builder_.add_name(name);
|
||||
builder_.add_skyBoxEnabled(skyBoxEnabled);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,10 @@ namespace cocostudio
|
|||
tmx = TMXTiledMap::create(path);
|
||||
if (tmx)
|
||||
{
|
||||
//prevent that editor's data does not match in size and resources
|
||||
Size fileSize = tmx->getContentSize();
|
||||
setPropsWithFlatBuffers(tmx, (Table*)gameMapOptions);
|
||||
tmx->setContentSize(fileSize);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -62,6 +62,11 @@ namespace cocostudio
|
|||
|
||||
return _instanceNode3DReader;
|
||||
}
|
||||
static CameraBackgroundBrush* _sceneBrushInstance = nullptr;
|
||||
CameraBackgroundBrush* GameNode3DReader::getSceneBrushInstance()
|
||||
{
|
||||
return _sceneBrushInstance;
|
||||
}
|
||||
|
||||
void GameNode3DReader::purge()
|
||||
{
|
||||
|
@ -79,6 +84,7 @@ namespace cocostudio
|
|||
std::string name = "";
|
||||
int skyBoxMask = 1;
|
||||
bool skyBoxEnabled = false;
|
||||
bool skyBoxValid = true;
|
||||
|
||||
std::string leftPath = "";
|
||||
std::string leftPlistFile = "";
|
||||
|
@ -122,6 +128,10 @@ namespace cocostudio
|
|||
{
|
||||
skyBoxEnabled = (value == "True") ? true : false;
|
||||
}
|
||||
else if (attriname == "SkyBoxValid")
|
||||
{
|
||||
skyBoxValid = (value == "True") ? true : false;
|
||||
}
|
||||
else if (attriname == "skyBoxMask")
|
||||
{
|
||||
skyBoxMask = atoi(value.c_str());
|
||||
|
@ -138,6 +148,9 @@ namespace cocostudio
|
|||
attribute = attribute->Next();
|
||||
}
|
||||
|
||||
if (!skyBoxValid)
|
||||
skyBoxEnabled = false;
|
||||
|
||||
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
|
||||
while (child)
|
||||
{
|
||||
|
@ -376,6 +389,7 @@ namespace cocostudio
|
|||
std::string name = options->name()->c_str();
|
||||
node->setName(name);
|
||||
|
||||
_sceneBrushInstance = nullptr;
|
||||
bool skyBoxEnabled = options->skyBoxEnabled() != 0;
|
||||
if (skyBoxEnabled)
|
||||
{
|
||||
|
@ -385,13 +399,17 @@ namespace cocostudio
|
|||
std::string downFileData = options->downFileData()->path()->c_str();
|
||||
std::string forwardFileData = options->forwardFileData()->path()->c_str();
|
||||
std::string backFileData = options->backFileData()->path()->c_str();
|
||||
FileUtils *fileUtils = FileUtils::getInstance();
|
||||
|
||||
if (leftFileData.empty() || rightFileData.empty() || upFileData.empty() || downFileData.empty() || forwardFileData.empty() || backFileData.empty())
|
||||
return;
|
||||
Skybox* childBox = Skybox::create(leftFileData,rightFileData,upFileData,downFileData,forwardFileData,backFileData);
|
||||
unsigned short cameraFlag = 1 << 10;
|
||||
childBox->setCameraMask(cameraFlag);
|
||||
node->addChild(childBox,0,"_innerSkyBox");
|
||||
if (fileUtils->isFileExist(leftFileData)
|
||||
&& fileUtils->isFileExist(rightFileData)
|
||||
&& fileUtils->isFileExist(upFileData)
|
||||
&& fileUtils->isFileExist(downFileData)
|
||||
&& fileUtils->isFileExist(forwardFileData)
|
||||
&& fileUtils->isFileExist(backFileData))
|
||||
{
|
||||
_sceneBrushInstance = CameraBackgroundSkyBoxBrush::create(leftFileData, rightFileData, upFileData, downFileData, forwardFileData, backFileData);
|
||||
}
|
||||
}
|
||||
|
||||
std::string customProperty = options->customProperty()->c_str();
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#define __cocos2d_libs__GameNode3DReader__
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "2d/CCCameraBackgroundBrush.h"
|
||||
#include "cocostudio/CocosStudioExport.h"
|
||||
#include "cocostudio/WidgetReader/NodeReaderProtocol.h"
|
||||
#include "cocostudio/WidgetReader/NodeReaderDefine.h"
|
||||
|
@ -46,6 +47,7 @@ namespace cocostudio
|
|||
~GameNode3DReader();
|
||||
|
||||
static GameNode3DReader* getInstance();
|
||||
static cocos2d::CameraBackgroundBrush* getSceneBrushInstance();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
|
|
@ -109,6 +109,7 @@ namespace cocostudio
|
|||
bool runAction = false;
|
||||
std::string path;
|
||||
int resourceType = 0;
|
||||
bool isFlipped = false;
|
||||
|
||||
std::string attriname;
|
||||
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
|
||||
|
@ -120,7 +121,10 @@ namespace cocostudio
|
|||
if(attriname == "RunAction3D")
|
||||
{
|
||||
runAction = value == "True" ? true : false;
|
||||
break;
|
||||
}
|
||||
else if (attriname == "IsFlipped")
|
||||
{
|
||||
isFlipped = value == "True" ? true : false;
|
||||
}
|
||||
|
||||
attribute = attribute->Next();
|
||||
|
@ -170,7 +174,8 @@ namespace cocostudio
|
|||
builder->CreateString(path),
|
||||
builder->CreateString(""),
|
||||
resourceType),
|
||||
runAction
|
||||
runAction,
|
||||
isFlipped
|
||||
);
|
||||
|
||||
return *(Offset<Table>*)(&options);
|
||||
|
@ -184,6 +189,7 @@ namespace cocostudio
|
|||
auto options = (Sprite3DOptions*)sprite3DOptions;
|
||||
|
||||
bool runAction = options->runAction() != 0;
|
||||
bool isFlipped = options->isFlipped() != 0;
|
||||
auto fileData = options->fileData();
|
||||
std::string path = fileData->path()->c_str();
|
||||
|
||||
|
@ -213,6 +219,11 @@ namespace cocostudio
|
|||
{
|
||||
sprite3D->setColor(Color3B(red, green, blue));
|
||||
}
|
||||
if (isFlipped)
|
||||
{
|
||||
sprite3D->setCullFaceEnabled(true);
|
||||
sprite3D->setCullFace(GL_FRONT);
|
||||
}
|
||||
|
||||
auto node3DReader = Node3DReader::getInstance();
|
||||
node3DReader->setPropsWithFlatBuffers(sprite3D, (Table*)(options->node3DOption()));
|
||||
|
@ -230,7 +241,7 @@ namespace cocostudio
|
|||
{
|
||||
ret->initWithFile(path);
|
||||
}
|
||||
|
||||
|
||||
setPropsWithFlatBuffers(ret, sprite3DOptions);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -167,6 +167,8 @@ namespace cocostudio
|
|||
Sprite *sprite = static_cast<Sprite*>(node);
|
||||
auto options = (SpriteOptions*)spriteOptions;
|
||||
|
||||
auto nodeReader = NodeReader::getInstance();
|
||||
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
|
||||
|
||||
auto fileNameData = options->fileNameData();
|
||||
|
||||
|
@ -242,11 +244,6 @@ namespace cocostudio
|
|||
sprite->setBlendFunc(blendFunc);
|
||||
}
|
||||
|
||||
|
||||
auto nodeReader = NodeReader::getInstance();
|
||||
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
|
||||
|
||||
|
||||
auto nodeOptions = options->nodeOptions();
|
||||
|
||||
GLubyte alpha = (GLubyte)nodeOptions->color()->a();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "cocostudio/CSParse3DBinary_generated.h"
|
||||
#include "cocostudio/FlatBuffersSerialize.h"
|
||||
#include "cocostudio/WidgetReader/Node3DReader/Node3DReader.h"
|
||||
#include "cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h"
|
||||
|
||||
#include "tinyxml2.h"
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
@ -108,6 +109,7 @@ namespace cocostudio
|
|||
float fov = 60.f;
|
||||
unsigned int cameraFlag = 0;
|
||||
bool skyBoxEnabled = false;
|
||||
bool skyBoxValid = true;
|
||||
|
||||
std::string attriname;
|
||||
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
|
||||
|
@ -141,10 +143,17 @@ namespace cocostudio
|
|||
{
|
||||
skyBoxEnabled = (value == "True") ? true : false;
|
||||
}
|
||||
else if (attriname == "SkyBoxValid")
|
||||
{
|
||||
skyBoxValid = (value == "True") ? true : false;
|
||||
}
|
||||
|
||||
attribute = attribute->Next();
|
||||
}
|
||||
|
||||
if (!skyBoxValid)
|
||||
skyBoxEnabled = false;
|
||||
|
||||
Vec2 clipPlane(1, 1000);
|
||||
|
||||
std::string leftPath = "";
|
||||
|
@ -429,12 +438,28 @@ namespace cocostudio
|
|||
std::string downFileData = options->downFileData()->path()->c_str();
|
||||
std::string forwardFileData = options->forwardFileData()->path()->c_str();
|
||||
std::string backFileData = options->backFileData()->path()->c_str();
|
||||
FileUtils *fileUtils = FileUtils::getInstance();
|
||||
|
||||
if (leftFileData.empty() || rightFileData.empty() || upFileData.empty() || downFileData.empty() || forwardFileData.empty() || backFileData.empty())
|
||||
return;
|
||||
Skybox* childBox = Skybox::create(leftFileData, rightFileData, upFileData, downFileData, forwardFileData, backFileData);
|
||||
childBox->setCameraMask(cameraFlag);
|
||||
node->addChild(childBox, 0, "_innerSkyBox");
|
||||
if (fileUtils->isFileExist(leftFileData)
|
||||
&& fileUtils->isFileExist(rightFileData)
|
||||
&& fileUtils->isFileExist(upFileData)
|
||||
&& fileUtils->isFileExist(downFileData)
|
||||
&& fileUtils->isFileExist(forwardFileData)
|
||||
&& fileUtils->isFileExist(backFileData))
|
||||
{
|
||||
CameraBackgroundSkyBoxBrush* brush = CameraBackgroundSkyBoxBrush::create(leftFileData, rightFileData, upFileData, downFileData, forwardFileData, backFileData);
|
||||
camera->setBackgroundBrush(brush);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameNode3DReader::getSceneBrushInstance() != nullptr)
|
||||
camera->setBackgroundBrush(GameNode3DReader::getSceneBrushInstance());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameNode3DReader::getSceneBrushInstance() != nullptr)
|
||||
camera->setBackgroundBrush(GameNode3DReader::getSceneBrushInstance());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -383,6 +383,7 @@
|
|||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -401,6 +402,8 @@
|
|||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -420,6 +423,7 @@
|
|||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -439,6 +443,7 @@
|
|||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -458,6 +463,7 @@
|
|||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -476,6 +482,8 @@
|
|||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<DisableSpecificWarnings>4458;4456;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -129,6 +129,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -147,6 +149,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -165,6 +169,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -183,6 +189,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -201,6 +209,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -219,6 +229,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -94,6 +94,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -112,6 +114,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -130,6 +134,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
@ -148,6 +154,8 @@
|
|||
<PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\angle\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
|
|
|
@ -197,18 +197,21 @@ void Downloader::downloadToBuffer(const std::string& srcUrl, const std::string&
|
|||
|
||||
CC_ASSERT(_downloaderImpl && "Cannot instanciate more than one instance of DownloaderImpl");
|
||||
|
||||
DownloadUnit unit;
|
||||
unit.srcUrl = srcUrl;
|
||||
unit.customId = customId;
|
||||
unit.fp = buffer;
|
||||
unit.downloaded = 0;
|
||||
unit.totalToDownload = 0;
|
||||
std::weak_ptr<Downloader> ptr = shared_from_this();
|
||||
std::shared_ptr<Downloader> shared = ptr.lock();
|
||||
|
||||
StreamData streamBuffer;
|
||||
streamBuffer.buffer = buffer;
|
||||
streamBuffer.total = size;
|
||||
streamBuffer.offset = 0;
|
||||
|
||||
DownloadUnit unit;
|
||||
unit.srcUrl = srcUrl;
|
||||
unit.customId = customId;
|
||||
unit.fp = &streamBuffer;
|
||||
unit.downloaded = 0;
|
||||
unit.totalToDownload = 0;
|
||||
|
||||
int res = _downloaderImpl->performDownload(&unit,
|
||||
std::bind(&Downloader::bufferWriteFunc, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4),
|
||||
std::bind(&Downloader::downloadProgressFunc, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)
|
||||
|
@ -256,6 +259,9 @@ void Downloader::downloadToFP(const std::string& srcUrl, const std::string& cust
|
|||
{
|
||||
CC_ASSERT(_downloaderImpl && "Cannot instanciate more than one instance of DownloaderImpl");
|
||||
|
||||
std::weak_ptr<Downloader> ptr = shared_from_this();
|
||||
std::shared_ptr<Downloader> shared = ptr.lock();
|
||||
|
||||
DownloadUnit unit;
|
||||
unit.srcUrl = srcUrl;
|
||||
unit.customId = customId;
|
||||
|
@ -366,6 +372,9 @@ void Downloader::batchDownloadSync(const DownloadUnits& units, const std::string
|
|||
|
||||
void Downloader::groupBatchDownload(const DownloadUnits& units)
|
||||
{
|
||||
std::weak_ptr<Downloader> ptr = shared_from_this();
|
||||
std::shared_ptr<Downloader> shared = ptr.lock();
|
||||
|
||||
// static_cast needed since notifyError is overloaded
|
||||
auto errorCallback = std::bind( static_cast<void(Downloader::*)(const std::string&, int, const std::string&)>
|
||||
(&Downloader::notifyError), this,
|
||||
|
|
|
@ -48,7 +48,10 @@ static size_t _fileWriteFunc(void *ptr, size_t size, size_t nmemb, void* userdat
|
|||
int ret = this_->getWriterCallback()(ptr, size, nmemb, unit);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t _fileWriteFuncForAdapter(void *ptr, size_t size, size_t nmemb, void* userdata)
|
||||
{
|
||||
return nmemb;
|
||||
}
|
||||
static int _downloadProgressFunc(void* userdata, double totalToDownload, double nowDownloaded, double totalToUpLoad, double nowUpLoaded)
|
||||
{
|
||||
DownloadUnit *downloadUnit = (DownloadUnit*)userdata;
|
||||
|
@ -284,7 +287,8 @@ int DownloaderImpl::getHeader(const std::string& url, HeaderInfo* headerInfo)
|
|||
curl_easy_setopt(curlHandle, CURLOPT_HEADER, 1);
|
||||
curl_easy_setopt(curlHandle, CURLOPT_NOBODY, 1);
|
||||
curl_easy_setopt(curlHandle, CURLOPT_NOSIGNAL, 1);
|
||||
|
||||
// in win32 platform, if not set the writeFunction, it will return CURLE_WRITE_ERROR
|
||||
curl_easy_setopt(curlHandle, CURLOPT_WRITEFUNCTION, _fileWriteFuncForAdapter);
|
||||
if ((_lastErrCode=curl_easy_perform(curlHandle)) == CURLE_OK)
|
||||
{
|
||||
char *effectiveUrl;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/****************************************************************************
|
||||
/****************************************************************************
|
||||
Copyright (c) 2015 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
@ -365,14 +365,23 @@ protected:
|
|||
*/
|
||||
struct CC_DLL Physics3DColliderDes
|
||||
{
|
||||
/**shape pointer*/
|
||||
Physics3DShape* shape;
|
||||
/**original world Transform*/
|
||||
cocos2d::Mat4 originalTransform;
|
||||
bool isTrigger; //is it a trigger?
|
||||
/**Is collider a trigger?*/
|
||||
bool isTrigger;
|
||||
/**the friction*/
|
||||
float friction;
|
||||
/**the rolling friction*/
|
||||
float rollingFriction;
|
||||
/**the restitution*/
|
||||
float restitution;
|
||||
/**the hit fraction*/
|
||||
float hitFraction;
|
||||
/**the swep sphere radius*/
|
||||
float ccdSweptSphereRadius;
|
||||
/**the motion threshold*/
|
||||
float ccdMotionThreshold;
|
||||
|
||||
Physics3DColliderDes()
|
||||
|
@ -390,62 +399,101 @@ struct CC_DLL Physics3DColliderDes
|
|||
};
|
||||
|
||||
/**
|
||||
* @brief Inherit from Physics3DObject, the main class for Colliders
|
||||
* @brief Inherit from Physics3DObject, the main class for Colliders.
|
||||
*/
|
||||
class CC_DLL Physics3DCollider : public Physics3DObject
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Creates a Physics3DCollider with Physics3DColliderDes.
|
||||
*
|
||||
* @return An autoreleased Physics3DCollider object.
|
||||
*/
|
||||
static Physics3DCollider* create(Physics3DColliderDes *info);
|
||||
|
||||
/** Get the pointer of btGhostObject.
|
||||
* @return The pointer of btGhostObject.
|
||||
*/
|
||||
btGhostObject* getGhostObject() const { return _btGhostObject; }
|
||||
|
||||
/** Set trigger. */
|
||||
/** Set trigger.
|
||||
* @param isTrigger Is a trigger.
|
||||
*/
|
||||
void setTrigger(bool isTrigger);
|
||||
|
||||
/** Check is a trigger. */
|
||||
/** Check is a trigger.
|
||||
* @return Is a trigger.
|
||||
*/
|
||||
bool isTrigger() const;
|
||||
|
||||
/** Set restitution. */
|
||||
/** Set restitution.
|
||||
* @param rest The restitution.
|
||||
*/
|
||||
void setRestitution(float rest);
|
||||
|
||||
/** Get restitution. */
|
||||
/** Get restitution.
|
||||
* @return The restitution.
|
||||
*/
|
||||
float getRestitution() const;
|
||||
|
||||
/** Set friction. */
|
||||
/** Set friction.
|
||||
* @param rest The friction.
|
||||
*/
|
||||
void setFriction(float frict);
|
||||
|
||||
/** Get friction. */
|
||||
/** Get friction.
|
||||
* @return The friction.
|
||||
*/
|
||||
float getFriction() const;
|
||||
|
||||
/** Set rolling friction. */
|
||||
/** Set rolling friction.
|
||||
* @param frict The rolling friction.
|
||||
*/
|
||||
void setRollingFriction(float frict);
|
||||
|
||||
/** Get rolling friction. */
|
||||
/** Get rolling friction.
|
||||
* @return The rolling friction.
|
||||
*/
|
||||
float getRollingFriction() const;
|
||||
|
||||
/** Set hit friction. */
|
||||
/** Set hit friction.
|
||||
* @param hitFraction The hit friction.
|
||||
*/
|
||||
void setHitFraction(float hitFraction);
|
||||
|
||||
/** Get hit friction. */
|
||||
/** Get hit friction.
|
||||
* @return The hit friction.
|
||||
*/
|
||||
float getHitFraction() const;
|
||||
|
||||
/** Set motion threshold, don't do continuous collision detection if the motion (in one step) is less then ccdMotionThreshold */
|
||||
/** Set motion threshold, don't do continuous collision detection if the motion (in one step) is less then ccdMotionThreshold.
|
||||
* @param ccdMotionThreshold The motion threshold.
|
||||
*/
|
||||
void setCcdMotionThreshold(float ccdMotionThreshold);
|
||||
|
||||
/** Get motion threshold. */
|
||||
/** Get motion threshold.
|
||||
* @return The motion threshold.
|
||||
*/
|
||||
float getCcdMotionThreshold() const;
|
||||
|
||||
/** Set swept sphere radius. */
|
||||
/** Set swept sphere radius.
|
||||
* @param radius The swept sphere radius.
|
||||
*/
|
||||
void setCcdSweptSphereRadius(float radius);
|
||||
|
||||
/** Get swept sphere radius. */
|
||||
/** Get swept sphere radius.
|
||||
* @return The swept sphere radius.
|
||||
*/
|
||||
float getCcdSweptSphereRadius() const;
|
||||
|
||||
/** Get the world matrix of Physics3DObject. */
|
||||
/** override. */
|
||||
virtual cocos2d::Mat4 getWorldTransform() const;
|
||||
|
||||
/** Set a callback when trigger enter. */
|
||||
std::function<void(Physics3DObject *otherObject)> onTriggerEnter;
|
||||
|
||||
/** Set a callback when trigger exit. */
|
||||
std::function<void(Physics3DObject *otherObject)> onTriggerExit;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS :
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
/** creates a PhysicsSprite3D*/
|
||||
static PhysicsSprite3D* create(const std::string &modelPath, Physics3DRigidBodyDes* rigidDes, const cocos2d::Vec3& translateInPhysics = cocos2d::Vec3::ZERO, const cocos2d::Quaternion& rotInPhsyics = cocos2d::Quaternion::ZERO);
|
||||
|
||||
/** creates a PhysicsSprite3D*/
|
||||
/** creates a PhysicsSprite3D as a collider*/
|
||||
static PhysicsSprite3D* createWithCollider(const std::string &modelPath, Physics3DColliderDes* colliderDes, const cocos2d::Vec3& translateInPhysics = cocos2d::Vec3::ZERO, const cocos2d::Quaternion& rotInPhsyics = cocos2d::Quaternion::ZERO);
|
||||
|
||||
/** Get the Physics3DObject. */
|
||||
|
|
|
@ -827,7 +827,7 @@ std::string FileUtils::fullPathForFilename(const std::string &filename) const
|
|||
{
|
||||
fullpath = this->getPathForFilename(newFilename, resolutionIt, searchIt);
|
||||
|
||||
if (fullpath.length() > 0)
|
||||
if (!fullpath.empty())
|
||||
{
|
||||
// Using the filename passed in as key.
|
||||
_fullPathCache.insert(std::make_pair(filename, fullpath));
|
||||
|
@ -926,7 +926,7 @@ void FileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
|
|||
prefix = _defaultResRootPath;
|
||||
}
|
||||
path = prefix + (iter);
|
||||
if (path.length() > 0 && path[path.length()-1] != '/')
|
||||
if (!path.empty() && path[path.length()-1] != '/')
|
||||
{
|
||||
path += "/";
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ void FileUtils::addSearchPath(const std::string &searchpath,const bool front)
|
|||
prefix = _defaultResRootPath;
|
||||
|
||||
std::string path = prefix + searchpath;
|
||||
if (path.length() > 0 && path[path.length()-1] != '/')
|
||||
if (!path.empty() && path[path.length()-1] != '/')
|
||||
{
|
||||
path += "/";
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ void FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict)
|
|||
void FileUtils::loadFilenameLookupDictionaryFromFile(const std::string &filename)
|
||||
{
|
||||
const std::string fullPath = fullPathForFilename(filename);
|
||||
if (fullPath.length() > 0)
|
||||
if (!fullPath.empty())
|
||||
{
|
||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
|
||||
if (!dict.empty())
|
||||
|
|
|
@ -576,7 +576,7 @@ bool Image::initWithImageData(const unsigned char * data, ssize_t dataLen)
|
|||
}
|
||||
else
|
||||
{
|
||||
CCAssert(false, "unsupport image format!");
|
||||
CCLOG("cocos2d: unsupported image format!");
|
||||
}
|
||||
|
||||
free(tgaData);
|
||||
|
|
|
@ -108,6 +108,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
private Cocos2dxVideoHelper mVideoHelper = null;
|
||||
private Cocos2dxWebViewHelper mWebViewHelper = null;
|
||||
private Cocos2dxEditBoxHelper mEditBoxHelper = null;
|
||||
private boolean hasFocus = false;
|
||||
|
||||
public Cocos2dxGLSurfaceView getGLSurfaceView(){
|
||||
return mGLSurfaceView;
|
||||
|
@ -338,21 +339,30 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
Log.d(TAG, "onResume()");
|
||||
super.onResume();
|
||||
resumeIfHasFocus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
Log.d(TAG, "onWindowFocusChanged() hasFocus=" + hasFocus);
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
|
||||
if (hasFocus) {
|
||||
Cocos2dxHelper.onResume();
|
||||
mGLSurfaceView.onResume();
|
||||
this.hasFocus = hasFocus;
|
||||
resumeIfHasFocus();
|
||||
}
|
||||
|
||||
private void resumeIfHasFocus() {
|
||||
if(hasFocus) {
|
||||
Cocos2dxHelper.onResume();
|
||||
mGLSurfaceView.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
Log.d(TAG, "onPause()");
|
||||
super.onPause();
|
||||
Cocos2dxHelper.onPause();
|
||||
mGLSurfaceView.onPause();
|
||||
|
|
|
@ -186,7 +186,7 @@ static keyCodeItem g_keyCodeStructArray[] = {
|
|||
|
||||
/* Function keys */
|
||||
{ GLFW_KEY_ESCAPE , EventKeyboard::KeyCode::KEY_ESCAPE },
|
||||
{ GLFW_KEY_ENTER , EventKeyboard::KeyCode::KEY_KP_ENTER },
|
||||
{ GLFW_KEY_ENTER , EventKeyboard::KeyCode::KEY_ENTER },
|
||||
{ GLFW_KEY_TAB , EventKeyboard::KeyCode::KEY_TAB },
|
||||
{ GLFW_KEY_BACKSPACE , EventKeyboard::KeyCode::KEY_BACKSPACE },
|
||||
{ GLFW_KEY_INSERT , EventKeyboard::KeyCode::KEY_INSERT },
|
||||
|
@ -195,9 +195,9 @@ static keyCodeItem g_keyCodeStructArray[] = {
|
|||
{ GLFW_KEY_LEFT , EventKeyboard::KeyCode::KEY_LEFT_ARROW },
|
||||
{ GLFW_KEY_DOWN , EventKeyboard::KeyCode::KEY_DOWN_ARROW },
|
||||
{ GLFW_KEY_UP , EventKeyboard::KeyCode::KEY_UP_ARROW },
|
||||
{ GLFW_KEY_PAGE_UP , EventKeyboard::KeyCode::KEY_KP_PG_UP },
|
||||
{ GLFW_KEY_PAGE_DOWN , EventKeyboard::KeyCode::KEY_KP_PG_DOWN },
|
||||
{ GLFW_KEY_HOME , EventKeyboard::KeyCode::KEY_KP_HOME },
|
||||
{ GLFW_KEY_PAGE_UP , EventKeyboard::KeyCode::KEY_PG_UP },
|
||||
{ GLFW_KEY_PAGE_DOWN , EventKeyboard::KeyCode::KEY_PG_DOWN },
|
||||
{ GLFW_KEY_HOME , EventKeyboard::KeyCode::KEY_HOME },
|
||||
{ GLFW_KEY_END , EventKeyboard::KeyCode::KEY_END },
|
||||
{ GLFW_KEY_CAPS_LOCK , EventKeyboard::KeyCode::KEY_CAPS_LOCK },
|
||||
{ GLFW_KEY_SCROLL_LOCK , EventKeyboard::KeyCode::KEY_SCROLL_LOCK },
|
||||
|
|
|
@ -134,7 +134,7 @@ static std::string UTF8StringToMultiByte(const std::string& strUtf8)
|
|||
|
||||
static void _checkPath()
|
||||
{
|
||||
if (0 == s_resourcePath.length())
|
||||
if (s_resourcePath.empty())
|
||||
{
|
||||
WCHAR *pUtf16ExePath = nullptr;
|
||||
_get_wpgmptr(&pUtf16ExePath);
|
||||
|
@ -193,7 +193,7 @@ std::string FileUtilsWin32::getSuitableFOpen(const std::string& filenameUtf8) co
|
|||
|
||||
bool FileUtilsWin32::isFileExistInternal(const std::string& strFilePath) const
|
||||
{
|
||||
if (0 == strFilePath.length())
|
||||
if (strFilePath.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -433,6 +433,7 @@ void OpenGLESPage::StartRenderLoop()
|
|||
|
||||
if (!mDeviceLost)
|
||||
{
|
||||
mOpenGLES->MakeCurrent(mRenderSurface);
|
||||
// restart cocos2d-x
|
||||
mRenderer->DeviceLost();
|
||||
}
|
||||
|
|
|
@ -214,11 +214,14 @@ LanguageType Application::getCurrentLanguage()
|
|||
|
||||
Application::Platform Application::getTargetPlatform()
|
||||
{
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
||||
return Platform::OS_WP8;
|
||||
#else
|
||||
return Platform::OS_WINRT;
|
||||
#endif
|
||||
if (isWindowsPhone())
|
||||
{
|
||||
return Platform::OS_WP8;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Platform::OS_WINRT;
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::openURL(const std::string &url)
|
||||
|
|
|
@ -35,12 +35,10 @@ NS_CC_BEGIN
|
|||
|
||||
void MessageBox(const char * pszMsg, const char * pszTitle)
|
||||
{
|
||||
#ifndef WP8_SHADER_COMPILER
|
||||
// Create the message dialog and set its content
|
||||
Platform::String^ message = PlatformStringFromString(pszMsg);
|
||||
Platform::String^ title = PlatformStringFromString(pszTitle);
|
||||
GLViewImpl::sharedOpenGLView()->ShowMessageBox(title, message);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ THE SOFTWARE.
|
|||
#include "platform/CCDevice.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "platform/winrt/CCFreeTypeFont.h"
|
||||
#include "platform/winrt/CCWinRTUtils.h"
|
||||
#include "platform/CCStdC.h"
|
||||
|
||||
using namespace Windows::Graphics::Display;
|
||||
|
@ -53,7 +54,6 @@ static Accelerometer^ sAccelerometer = nullptr;
|
|||
|
||||
void Device::setAccelerometerEnabled(bool isEnabled)
|
||||
{
|
||||
#ifndef WP8_SHADER_COMPILER
|
||||
static Windows::Foundation::EventRegistrationToken sToken;
|
||||
static bool sEnabled = false;
|
||||
|
||||
|
@ -98,69 +98,72 @@ void Device::setAccelerometerEnabled(bool isEnabled)
|
|||
|
||||
auto orientation = GLViewImpl::sharedOpenGLView()->getDeviceOrientation();
|
||||
|
||||
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
||||
switch (orientation)
|
||||
if (isWindowsPhone())
|
||||
{
|
||||
case DisplayOrientations::Portrait:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::Landscape:
|
||||
acc.x = -reading->AccelerationY;
|
||||
acc.y = reading->AccelerationX;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::PortraitFlipped:
|
||||
acc.x = -reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::LandscapeFlipped:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
switch (orientation)
|
||||
{
|
||||
case DisplayOrientations::Portrait:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
|
||||
default:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
case DisplayOrientations::Landscape:
|
||||
acc.x = -reading->AccelerationY;
|
||||
acc.y = reading->AccelerationX;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::PortraitFlipped:
|
||||
acc.x = -reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::LandscapeFlipped:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
break;
|
||||
|
||||
default:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else // Windows Store App
|
||||
// from http://msdn.microsoft.com/en-us/library/windows/apps/dn440593
|
||||
switch (orientation)
|
||||
else // Windows Store App
|
||||
{
|
||||
case DisplayOrientations::Portrait:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
break;
|
||||
// from http://msdn.microsoft.com/en-us/library/windows/apps/dn440593
|
||||
switch (orientation)
|
||||
{
|
||||
case DisplayOrientations::Portrait:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::Landscape:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
case DisplayOrientations::Landscape:
|
||||
acc.x = reading->AccelerationX;
|
||||
acc.y = reading->AccelerationY;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::PortraitFlipped:
|
||||
acc.x = -reading->AccelerationY;
|
||||
acc.y = reading->AccelerationX;
|
||||
break;
|
||||
case DisplayOrientations::PortraitFlipped:
|
||||
acc.x = -reading->AccelerationY;
|
||||
acc.y = reading->AccelerationX;
|
||||
break;
|
||||
|
||||
case DisplayOrientations::LandscapeFlipped:
|
||||
acc.x = -reading->AccelerationX;
|
||||
acc.y = -reading->AccelerationY;
|
||||
break;
|
||||
case DisplayOrientations::LandscapeFlipped:
|
||||
acc.x = -reading->AccelerationX;
|
||||
acc.y = -reading->AccelerationY;
|
||||
break;
|
||||
|
||||
default:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
break;
|
||||
default:
|
||||
acc.x = reading->AccelerationY;
|
||||
acc.y = -reading->AccelerationX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::shared_ptr<cocos2d::InputEvent> event(new AccelerometerEvent(acc));
|
||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Device::setAccelerometerInterval(float interval)
|
||||
|
|
|
@ -30,7 +30,7 @@ THE SOFTWARE.
|
|||
#define glClearDepth glClearDepthf
|
||||
#define GL_WRITE_ONLY GL_WRITE_ONLY_OES
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT && !defined(WP8_SHADER_COMPILER)
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
|
||||
#include "EGL/egl.h"
|
||||
#include "EGL/eglext.h"
|
||||
#include "EGL/eglplatform.h"
|
||||
|
|
|
@ -185,7 +185,7 @@ bool CCPrecompiledShaders::addProgram(GLuint program, const std::string& id)
|
|||
return true;
|
||||
}
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) && defined(WP8_SHADER_COMPILER)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
|
||||
void CCPrecompiledShaders::savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
bool loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray);
|
||||
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) && defined(WP8_SHADER_COMPILER)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
void savePrecompiledShaders();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -47,6 +47,19 @@ using namespace Windows::Storage::Pickers;
|
|||
using namespace Windows::Storage::Streams;
|
||||
using namespace Windows::Networking::Connectivity;
|
||||
|
||||
bool isWindowsPhone()
|
||||
{
|
||||
#if _MSC_VER >= 1900
|
||||
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len /*= -1*/)
|
||||
{
|
||||
|
@ -158,7 +171,6 @@ float getScaledDPIValue(float v) {
|
|||
|
||||
void CC_DLL CCLogIPAddresses()
|
||||
{
|
||||
#ifndef WP8_SHADER_COMPILER
|
||||
auto hostnames = NetworkInformation::GetHostNames();
|
||||
int length = hostnames->Size;
|
||||
|
||||
|
@ -171,7 +183,6 @@ void CC_DLL CCLogIPAddresses()
|
|||
log("IP Address: %s:", s.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string CC_DLL getDeviceIPAddresses()
|
||||
|
|
|
@ -36,7 +36,7 @@ THE SOFTWARE.
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
||||
bool isWindowsPhone();
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1);
|
||||
CC_DEPRECATED_ATTRIBUTE std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr);
|
||||
|
|
|
@ -117,9 +117,9 @@ static keyCodeItem g_keyCodeStructArray [] = {
|
|||
{ (int) VirtualKey::Left, EventKeyboard::KeyCode::KEY_LEFT_ARROW },
|
||||
{ (int) VirtualKey::Down, EventKeyboard::KeyCode::KEY_DOWN_ARROW },
|
||||
{ (int) VirtualKey::Up, EventKeyboard::KeyCode::KEY_UP_ARROW },
|
||||
{ VK_PRIOR, EventKeyboard::KeyCode::KEY_KP_PG_UP },
|
||||
{ VK_NEXT, EventKeyboard::KeyCode::KEY_KP_PG_DOWN },
|
||||
{ VK_HOME, EventKeyboard::KeyCode::KEY_KP_HOME },
|
||||
{ VK_PRIOR, EventKeyboard::KeyCode::KEY_PG_UP },
|
||||
{ VK_NEXT, EventKeyboard::KeyCode::KEY_PG_DOWN },
|
||||
{ VK_HOME, EventKeyboard::KeyCode::KEY_HOME },
|
||||
{ VK_END, EventKeyboard::KeyCode::KEY_END },
|
||||
{ VK_CAPITAL, EventKeyboard::KeyCode::KEY_CAPS_LOCK },
|
||||
{ VK_SCROLL, EventKeyboard::KeyCode::KEY_SCROLL_LOCK },
|
||||
|
|
|
@ -54,6 +54,8 @@ Primitive::Primitive()
|
|||
: _verts(nullptr)
|
||||
, _indices(nullptr)
|
||||
, _type(GL_POINTS)
|
||||
, _start(0)
|
||||
, _count(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -79,7 +81,7 @@ bool Primitive::init(VertexData* verts, IndexBuffer* indices, int type)
|
|||
CC_SAFE_RELEASE(_indices);
|
||||
_indices = indices;
|
||||
}
|
||||
|
||||
|
||||
_type = type;
|
||||
|
||||
return true;
|
||||
|
@ -94,8 +96,8 @@ void Primitive::draw()
|
|||
{
|
||||
GLenum type = (_indices->getType() == IndexBuffer::IndexType::INDEX_TYPE_SHORT_16) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indices->getVBO());
|
||||
size_t offet = _start * _indices->getSizePerIndex();
|
||||
glDrawElements((GLenum)_type, _count, type, (GLvoid*)offet);
|
||||
size_t offset = _start * _indices->getSizePerIndex();
|
||||
glDrawElements((GLenum)_type, _count, type, (GLvoid*)offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -107,4 +109,14 @@ void Primitive::draw()
|
|||
}
|
||||
}
|
||||
|
||||
void Primitive::setStart(int start)
|
||||
{
|
||||
_start = start;
|
||||
}
|
||||
|
||||
void Primitive::setCount(int count)
|
||||
{
|
||||
_count = count;
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -65,9 +65,9 @@ public:
|
|||
/**Get the number of vertices or indices used for drawing.*/
|
||||
int getCount() const { return _count; }
|
||||
/**Setter for the start index.*/
|
||||
void setStart(int start) { _start = start; }
|
||||
void setStart(int start);
|
||||
/**Setter for the count. */
|
||||
void setCount(int count) { _count = count; }
|
||||
void setCount(int count);
|
||||
|
||||
protected:
|
||||
Primitive();
|
||||
|
|
|
@ -543,15 +543,19 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
|
|||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(true);
|
||||
glEnable(GL_BLEND);
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(true);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
glEnable(GL_BLEND);
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(false);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(false);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
}
|
||||
for (auto it = zNegQueue.cbegin(); it != zNegQueue.cend(); ++it)
|
||||
{
|
||||
|
@ -569,8 +573,10 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
|
|||
//Clear depth to achieve layered rendering
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(true);
|
||||
glDisable(GL_BLEND);
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(true);
|
||||
RenderState::StateBlock::_defaultState->setBlend(false);
|
||||
|
||||
|
||||
for (auto it = opaqueQueue.cbegin(); it != opaqueQueue.cend(); ++it)
|
||||
|
@ -588,9 +594,11 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
|
|||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(false);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
|
||||
|
||||
for (auto it = transQueue.cbegin(); it != transQueue.cend(); ++it)
|
||||
|
@ -610,18 +618,22 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
|
|||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(true);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(true);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(false);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(false);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
|
||||
}
|
||||
for (auto it = zZeroQueue.cbegin(); it != zZeroQueue.cend(); ++it)
|
||||
|
@ -637,6 +649,29 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
|
|||
const auto& zPosQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::GLOBALZ_POS);
|
||||
if (zPosQueue.size() > 0)
|
||||
{
|
||||
if(_isDepthTestFor2D)
|
||||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(true);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(true);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(true);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
RenderState::StateBlock::_defaultState->setDepthTest(false);
|
||||
RenderState::StateBlock::_defaultState->setDepthWrite(false);
|
||||
RenderState::StateBlock::_defaultState->setBlend(true);
|
||||
|
||||
}
|
||||
|
||||
for (auto it = zPosQueue.cbegin(); it != zPosQueue.cend(); ++it)
|
||||
{
|
||||
processRenderCommand(*it);
|
||||
|
@ -1028,8 +1063,10 @@ void Renderer::flushTriangles()
|
|||
bool Renderer::checkVisibility(const Mat4 &transform, const Size &size)
|
||||
{
|
||||
auto scene = Director::getInstance()->getRunningScene();
|
||||
|
||||
//If draw to Rendertexture, return true directly.
|
||||
// only cull the default camera. The culling algorithm is valid for default camera.
|
||||
if (scene && scene->_defaultCamera != Camera::getVisitingCamera())
|
||||
if (!scene || (scene && scene->_defaultCamera != Camera::getVisitingCamera()))
|
||||
return true;
|
||||
|
||||
auto director = Director::getInstance();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "3d/CCTextureCube.h"
|
||||
#include "renderer/CCTextureCube.h"
|
||||
#include "platform/CCImage.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
|
|
@ -122,14 +122,26 @@ void VertexData::use()
|
|||
}
|
||||
|
||||
GL::enableVertexAttribs(flags);
|
||||
|
||||
|
||||
int lastVBO = -1;
|
||||
for(auto& element : _vertexStreams)
|
||||
{
|
||||
//glEnableVertexAttribArray((GLint)element.second._stream._semantic);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, element.second._buffer->getVBO());
|
||||
size_t offet = element.second._stream._offset;
|
||||
glVertexAttribPointer(GLint(element.second._stream._semantic),element.second._stream._size,
|
||||
element.second._stream._type,element.second._stream._normalize, element.second._buffer->getSizePerVertex(), (GLvoid*)offet);
|
||||
auto vertexStreamAttrib = element.second._stream;
|
||||
auto vertexBuffer = element.second._buffer;
|
||||
|
||||
// don't call glBindBuffer() if not needed. Expensive operation.
|
||||
int vbo = vertexBuffer->getVBO();
|
||||
if (vbo != lastVBO) {
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer->getVBO());
|
||||
lastVBO = vbo;
|
||||
}
|
||||
glVertexAttribPointer(GLint(vertexStreamAttrib._semantic),
|
||||
vertexStreamAttrib._size,
|
||||
vertexStreamAttrib._type,
|
||||
vertexStreamAttrib._normalize,
|
||||
vertexBuffer->getSizePerVertex(),
|
||||
(GLvoid*)((long)vertexStreamAttrib._offset));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ set(COCOS_RENDERER_SRC
|
|||
renderer/CCTexture2D.cpp
|
||||
renderer/CCTextureAtlas.cpp
|
||||
renderer/CCTextureCache.cpp
|
||||
renderer/CCTextureCube.cpp
|
||||
renderer/CCTrianglesCommand.cpp
|
||||
renderer/CCVertexAttribBinding.cpp
|
||||
renderer/CCVertexIndexBuffer.cpp
|
||||
|
|
|
@ -285,6 +285,54 @@ Animate3D : function (
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class TextureCube
|
||||
*/
|
||||
jsb.TextureCube = {
|
||||
|
||||
/**
|
||||
* @method reloadTexture
|
||||
* @return {bool}
|
||||
*/
|
||||
reloadTexture : function (
|
||||
)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @param {String} arg0
|
||||
* @param {String} arg1
|
||||
* @param {String} arg2
|
||||
* @param {String} arg3
|
||||
* @param {String} arg4
|
||||
* @param {String} arg5
|
||||
* @return {cc.TextureCube}
|
||||
*/
|
||||
create : function (
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str
|
||||
)
|
||||
{
|
||||
return cc.TextureCube;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method TextureCube
|
||||
* @constructor
|
||||
*/
|
||||
TextureCube : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class AttachNode
|
||||
*/
|
||||
|
@ -1550,54 +1598,6 @@ Terrain : function (
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class TextureCube
|
||||
*/
|
||||
jsb.TextureCube = {
|
||||
|
||||
/**
|
||||
* @method reloadTexture
|
||||
* @return {bool}
|
||||
*/
|
||||
reloadTexture : function (
|
||||
)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @param {String} arg0
|
||||
* @param {String} arg1
|
||||
* @param {String} arg2
|
||||
* @param {String} arg3
|
||||
* @param {String} arg4
|
||||
* @param {String} arg5
|
||||
* @return {cc.TextureCube}
|
||||
*/
|
||||
create : function (
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str
|
||||
)
|
||||
{
|
||||
return cc.TextureCube;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method TextureCube
|
||||
* @constructor
|
||||
*/
|
||||
TextureCube : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class Bundle3D
|
||||
*/
|
||||
|
|
|
@ -18379,6 +18379,16 @@ applyViewport : function (
|
|||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setBackgroundBrush
|
||||
* @param {cc.CameraBackgroundBrush} arg0
|
||||
*/
|
||||
setBackgroundBrush : function (
|
||||
camerabackgroundbrush
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method lookAt
|
||||
* @param {vec3_object} arg0
|
||||
|
@ -18399,6 +18409,16 @@ apply : function (
|
|||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getBackgroundBrush
|
||||
* @return {cc.CameraBackgroundBrush}
|
||||
*/
|
||||
getBackgroundBrush : function (
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getProjectionMatrix
|
||||
* @return {mat4_object}
|
||||
|
@ -18423,10 +18443,8 @@ mat4
|
|||
|
||||
/**
|
||||
* @method clearBackground
|
||||
* @param {float} arg0
|
||||
*/
|
||||
clearBackground : function (
|
||||
float
|
||||
)
|
||||
{
|
||||
},
|
||||
|
@ -18736,6 +18754,234 @@ Camera : function (
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class CameraBackgroundBrush
|
||||
*/
|
||||
cc.CameraBackgroundBrush = {
|
||||
|
||||
/**
|
||||
* @method getBrushType
|
||||
* @return {cc.CameraBackgroundBrush::BrushType}
|
||||
*/
|
||||
getBrushType : function (
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method drawBackground
|
||||
* @param {cc.Camera} arg0
|
||||
*/
|
||||
drawBackground : function (
|
||||
camera
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method init
|
||||
* @return {bool}
|
||||
*/
|
||||
init : function (
|
||||
)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method createSkyboxBrush
|
||||
* @param {String} arg0
|
||||
* @param {String} arg1
|
||||
* @param {String} arg2
|
||||
* @param {String} arg3
|
||||
* @param {String} arg4
|
||||
* @param {String} arg5
|
||||
* @return {cc.CameraBackgroundSkyBoxBrush}
|
||||
*/
|
||||
createSkyboxBrush : function (
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundSkyBoxBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method createColorBrush
|
||||
* @param {color4f_object} arg0
|
||||
* @param {float} arg1
|
||||
* @return {cc.CameraBackgroundColorBrush}
|
||||
*/
|
||||
createColorBrush : function (
|
||||
color4f,
|
||||
float
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundColorBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method createNoneBrush
|
||||
* @return {cc.CameraBackgroundBrush}
|
||||
*/
|
||||
createNoneBrush : function (
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method createDepthBrush
|
||||
* @return {cc.CameraBackgroundDepthBrush}
|
||||
*/
|
||||
createDepthBrush : function (
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundDepthBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method CameraBackgroundBrush
|
||||
* @constructor
|
||||
*/
|
||||
CameraBackgroundBrush : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class CameraBackgroundDepthBrush
|
||||
*/
|
||||
cc.CameraBackgroundDepthBrush = {
|
||||
|
||||
/**
|
||||
* @method setDepth
|
||||
* @param {float} arg0
|
||||
*/
|
||||
setDepth : function (
|
||||
float
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @param {float} arg0
|
||||
* @return {cc.CameraBackgroundDepthBrush}
|
||||
*/
|
||||
create : function (
|
||||
float
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundDepthBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method CameraBackgroundDepthBrush
|
||||
* @constructor
|
||||
*/
|
||||
CameraBackgroundDepthBrush : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class CameraBackgroundColorBrush
|
||||
*/
|
||||
cc.CameraBackgroundColorBrush = {
|
||||
|
||||
/**
|
||||
* @method setColor
|
||||
* @param {color4f_object} arg0
|
||||
*/
|
||||
setColor : function (
|
||||
color4f
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @param {color4f_object} arg0
|
||||
* @param {float} arg1
|
||||
* @return {cc.CameraBackgroundColorBrush}
|
||||
*/
|
||||
create : function (
|
||||
color4f,
|
||||
float
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundColorBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method CameraBackgroundColorBrush
|
||||
* @constructor
|
||||
*/
|
||||
CameraBackgroundColorBrush : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class CameraBackgroundSkyBoxBrush
|
||||
*/
|
||||
cc.CameraBackgroundSkyBoxBrush = {
|
||||
|
||||
/**
|
||||
* @method setTexture
|
||||
* @param {cc.TextureCube} arg0
|
||||
*/
|
||||
setTexture : function (
|
||||
texturecube
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @param {String} str
|
||||
* @param {String} str
|
||||
* @param {String} str
|
||||
* @param {String} str
|
||||
* @param {String} str
|
||||
* @param {String} str
|
||||
* @return {cc.CameraBackgroundSkyBoxBrush|cc.CameraBackgroundSkyBoxBrush}
|
||||
*/
|
||||
create : function(
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str,
|
||||
str
|
||||
)
|
||||
{
|
||||
return cc.CameraBackgroundSkyBoxBrush;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method CameraBackgroundSkyBoxBrush
|
||||
* @constructor
|
||||
*/
|
||||
CameraBackgroundSkyBoxBrush : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @class GridBase
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue