Merge branch 'v3' of git://github.com/cocos2d/cocos2d-x into 3.2-cocos-engine-PR

Conflicts:
	cocos/platform/desktop/CCGLViewImpl.h
This commit is contained in:
pandamicro 2014-08-21 16:07:19 +08:00
commit 34b93a24ff
797 changed files with 52453 additions and 46621 deletions

3
.gitignore vendored
View File

@ -136,4 +136,5 @@ project.properties
/external/version.json
/templates/lua-template-runtime/runtime
/v*-deps-*.zip
/v*-lua-runtime-*.zip
/v*-lua-runtime-*.zip
/tools/fbx-conv/

69
AUTHORS
View File

@ -25,7 +25,7 @@ Developers:
longlene
Improve android project creation script
simpliplant
reneklacan
Hardware keyboard support
liuyq
@ -108,6 +108,7 @@ Developers:
Added support for x64 target of windows.
Added Dutch Language support.
Added clang support for Windows.
Cmake update and remove old scripts from build folder
mchinen
fix emulator issue for OpenGL ES 2.0 on Android
@ -530,6 +531,7 @@ Developers:
Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash.
fix of WebSocket url parse error for 'ws://domain.com/websocket' pattern.
Fixed a bug that Websocket doesn't support send/receive data which larger than 4096 bytes.
Show detail class & function name in error message of lua-binding
musikov
Fixing a bug that missing precision when getting strokeColor and fontFillColor
@ -658,6 +660,7 @@ Developers:
Fixed a bug that Node's anchor point was changed after being added to ScrollView.
Added HttpClient::sendImmediate()
Added operator == != for Value
Replace dynamic_cast to std::is_base_of in object_to_luaval
superrad
Clear NoSuchMethodError Exception when JniHelper fails to find methodID
@ -692,6 +695,7 @@ Developers:
Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan.
Deleted several lines of useless code in ScrollView::deaccelerateScrolling.
Fixed that ScrollView should implement ActionTweenDelegate.
Fixed LabelBMFont::getBoundingBox() position error
yinkaile (2youyouo2)
Maintainer of Armature Bone Animation.
@ -741,6 +745,7 @@ Developers:
Corrected a few mistakes in the README file of project-creator.
Corrected a mistake in README.
Fixed a bug that a string which only contains CJK characters can't make a line-break when it's needed.
Fixed a bug that if the UISlider is faded, the slide ball won't fade together
hbbalfred
Fixed a bug that crash if file doesn't exist when using FileUtils::getStringFromFile.
@ -797,6 +802,11 @@ Developers:
Adds support for get response when Activity's onActivityResult is triggered
Improve Android projects
Android jni error clear & more readable log
Add support of software PVRTC v1 decompression
Fixed a bug that ttf font have not effect on Mac OS X
Fixed a bug that before touchMove Touch::_prevPoint contains junk
Added Device::setKeepScreenOn()
Fixed Label performance problem
youknowone
Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView
@ -829,6 +839,7 @@ Developers:
HttpRequest uses std::function as callback
EditBox: mac secure input
Fix a bug that can not get/set text in password mode on Mac OS X
Make sure TableView parents are visible before handling touch
iSevenDays
Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG
@ -904,12 +915,17 @@ Developers:
gin0606
Add a new line at the end of a file
Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android
Fix video scale issue in iOS
Fix iOS VideoPlayer memory leak
Added c++11 random library support
billtt
Fixed a bug that Node::setScale(float) may not work properly
Teivaz
Custom uniform search optimization
Fixed compiling error on WP8.
Added method for custom precompiled shader program loading on WP8
chareice
Make `setup.py` work on zsh
@ -919,6 +935,57 @@ Developers:
CaiCQ
Fix a but that LabelTTF may lost chinese characters on linux
chenguangqi
Fixed a compiling error on Android
Fixed an error when importing project using Eclipse on Android
uorbe001
Allow setting bundle to use in file utils on iOS and Mac OS X
yongkangchen
Fixed a bug that font size of EditBox is not scaled when glview is scaled on Mac OS X
Fixed a bug that Label::setTextColor does not have any effect on Mac OS X
wagulu
Fixed a bug that particle effect is wrong when scaled
reckhou
Optimize FPS control on Android
dzl-ian
Added getter and setter for TextColor for UIText
zii
Added utils::gettime()
takaken1994
Added function for setting min/max scale for ScrollView
maltium
Added 3D rotation support to RotateTo action
Hamken100per
Added a function getAssetManager() on CCFileUtilsAndroid
rny
Fixed LabelTTF::getBoundingBox() position error
SpriteFrameCache load from plist file content data
AppleJDay
Add Feature:EventMouse should support getDelta, getDeltaX, getDeltaY functions
GavinThornton
Fixed a bug that when a sprite added into SpriteBatchNod it will turn black if setting opacity
DavidPartouche
Fixed the bug that video player not showing on iOS if it's not in FullScreen mode
zaWasp
Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32
xiangxw
Fixed the bug that Console::sendPrompt() will send extra `\0`
Retired Core Developers:
WenSheng Yang

View File

@ -1,3 +1,61 @@
cocos2d-x-3.3 ??
[NEW] Added UIScale9Sprite
[NEW] Added Camera, AABB, OBB and Ray
[NEW] Added render primitive and render primitive command, support passing point, line and triangle data
[NEW] Added support for applicationDidEnterBackground / applicationWillEnterForeground on desktop
[NEW] Added method for custom precompiled shader program loading on WP8
[NEW] Added c++11 random support
[NEW] Device: added setKeepScreenOn() for iOS and Android
[NEW] EventMouse: support getDelta, getDeltaX, getDeltaY functions
[NEW] FileUtils: add isDirectoryExist(), createDirectory(), removeDirectory(), removeFile(), renameFile()
getFileSize()
[NEW] FileUtilsApple: allow setting bundle to use in file utils on iOS and Mac OS X
[NEW] Image: support of software PVRTC v1 decompression
[NEW] Lua-binding: added release_print that can print log even in release mode
[NEW] Physics Integration: can invoke update in demand
[NEW] RenderTexture: add a call back function for saveToFile()
[NEW] RotateTo: added 3D rotation support
[NEW] ScrollView: added `setMinScale()` and `setMaxScale()`
[NEW] Sprite3D: added setCullFace() and setCullFaceEnabled()
[NEW] Sprite3D: added getBoundingBox() and getAABB()
[NEW] SpriteFrameCache: load from plist file content data
[NEW] utils: added gettime()
[NEW] ui::Button: support customize how much zoom scale is when pressing a button
[NEW] ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event
[NEW] ui::TextField: support utf8
[NEW] ui::TextField: support set color and placehold color
[NEW] ui::Widget: support swallowing touch events
[NEW] Text: added getter and setter for TextColor
[FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X
[FIX] EditBox: began/end events not work
[FIX] Label: can not set charmap after it is created
[FIX] Label: setTextColor does not have any effect on Mac OS X
[FIX] Label: result of LabelTTF::getBoundingBox() is wrong
[FIX] Label: can not set outline color correctly if using system font on iOS
[FIX] Label: character edeg will be cut a little if character size is small
[FIX] LabelBMFont: result of LabelBMFont::getBoundingBox() is wrong
[FIX] ListView: can not insert an item in specific position, it is added at bottom
[FIX] LoadingBar: position is changed if changing direction
[FIX] ParticleSystem: effect is wrong if scene scaled
[FIX] ParticleSystemQuad: setTotalParticles() can't set a value larger than initialized value
[FIX] PhysicsBody: return wrong bitmask
[FIX] Scale9Sprite: new added sprite will be hidden
[FIX] Slider: if the UISlider is faded, the slide ball won't fade together
[FIX] Sprite: will turn black if opacity is set other than 255 and be added into SpriteBatchNode
[FIX] TabelView: can handle touch event though its parents are invisible
[FIX] TextField: can not use backspace to delete a character
[FIX] Widget: may crash if remove itself in touch call back function
[FIX] Widget: not support cascaded opacity and cascaded color by default
[FIX] VideoPlayer: memory leak on iOS
[FIX] VideoPlayer: video frame size is not calculated correctly on iOS
[FIX] VideoPlayer: video player not showing on iOS if it's not in FullScreen mode
[FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android
[FIX] Others: optimize FPS contorl algorithm on Android
[FIX] Lua-binding: replace dynamic_cast to std::is_base_of in object_to_luaval
cocos2d-x-3.2 Jul.17 2014
[NEW] Node: added getChildByName method for get a node that can be cast to Type T
[NEW] FileUtils: could add seach path and resolution order path in front

View File

@ -1,7 +1,7 @@
#/****************************************************************************
# Copyright (c) 2013 cocos2d-x.org
# Copyright (c) 2012-2013 martell malone
#
# Copyright (c) 2014 martell malone
#
# http://www.cocos2d-x.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@ -28,38 +28,23 @@ project (Cocos2dx)
# The version number
set(Cocos2dxSamples_VERSION_MAJOR 3)
set(Cocos2dxSamples_VERSION_MINOR 0)
set(Cocos2dxSamples_VERSION_MINOR 1)
include(build/BuildHelpers.CMakeLists.txt)
if(WIN32 OR APPLE)
message(${BUILDING_STRING})
option(USE_CHIPMUNK "Use chipmunk for physics library" ON)
option(USE_BOX2D "Use box2d for physics library" OFF)
option(DEBUG_MODE "Debug or release?" ON)
option(BUILD_LIBS_LUA "Build lua libraries" OFF)
option(BUILD_EXTENSIONS "Build extension library" ON)
option(BUILD_EDITOR_SPINE "Build editor support for spine" ON)
option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON)
option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON)
option(BUILD_CppTests "Only build TestCpp sample" ON)
option(BUILD_LuaTests "Only build TestLua sample" OFF)
else()#temp
option(USE_CHIPMUNK "Use chipmunk for physics library" ON)
option(USE_BOX2D "Use box2d for physics library" OFF)
option(DEBUG_MODE "Debug or release?" ON)
option(BUILD_EXTERN_LIBS "Build Box2d, Chipmunk, Tinyxml2 from source" ON)
option(BUILD_CppTests "Build TestCpp samples" ON)
option(BUILD_LIBS_LUA "Build lua libraries" ON)
option(BUILD_EXTENSIONS "Build extension library" ON)
option(BUILD_EDITOR_SPINE "Build editor support for spine" ON)
option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON)
option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON)
option(BUILD_CppTests "Only build TestCpp sample" ON)
option(BUILD_LuaTests "Only build TestLua sample" ON)
endif()#temp
option(BUILD_LuaTests "Build TestLua samples" ON)
if(DEBUG_MODE)
set(CMAKE_BUILD_TYPE DEBUG)
@ -70,31 +55,25 @@ endif(DEBUG_MODE)
set(CMAKE_C_FLAGS_DEBUG "-DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
if(WIN32)
if(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710
-wd4514 -wd4056 -wd4996 -wd4099)
else()
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -std=c++11")
endif(MSVC)
if(WINDOWS)
ADD_DEFINITIONS (-D_USRDLL -DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32)
if(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-wd4251 -wd4244 -wd4334
-wd4005 -wd4820 -wd4710
-wd4514 -wd4056 -wd4996 -wd4099)
else(MSVC)#MINGW
endif(MSVC)
elseif(APPLE)
else()#Linux
ADD_DEFINITIONS(-DLINUX)
endif()
if(NOT MSVC)# all gcc
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-std=c99")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11")
set(PLATFORM_FOLDER win32)
elseif(MACOSX)
set(PLATFORM_FOLDER mac)
else(LINUX)
ADD_DEFINITIONS(-DLINUX)
set(PLATFORM_FOLDER linux)
endif()
if(MINGW)
@ -102,8 +81,12 @@ if(MINGW)
add_definitions(-D__SSIZE_T)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lws2_32")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lws2_32")
endif()
if(CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions ")
endif()
endif()
if(USE_CHIPMUNK)
message("Using chipmunk ...")
@ -122,14 +105,6 @@ else()
set(ARCH_DIR "32-bit")
endif()
if(WIN32) # Win32
set(PLATFORM_FOLDER win32)
elseif(APPLE)# osx or ios
set(PLATFORM_FOLDER mac)
else() # Assume Linux
set(PLATFORM_FOLDER linux)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cocos
@ -156,18 +131,18 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/external/xxtea
)
if(WIN32 AND NOT MINGW)
if(MSVC)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/gles/include/OGLES
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/icon/include
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/zlib/include
external/curl/include/${PLATFORM_FOLDER}
)
elseif(APPLE)
elseif(MACOSX)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/external/curl/include/${PLATFORM_FOLDER}
${CMAKE_CURRENT_SOURCE_DIR}/external/curl/include/${PLATFORM_FOLDER}
)
else()
elseif(LINUX)
include_directories(
/usr/include
/usr/include/GLFW
@ -177,9 +152,8 @@ else()
endif()
if(WIN32)
if(MSVC)
if(NOT MINGW)
link_directories(
${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/prebuilt/${PLATFORM_FOLDER}
${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/prebuilt/${PLATFORM_FOLDER}
@ -189,11 +163,8 @@ if(WIN32)
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/icon/prebuilt
${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/zlib/prebuilt
)
endif()
elseif(APPLE)
else()
elseif(LINUX)
link_directories(
/usr/local/lib
@ -208,17 +179,21 @@ else()
endif()
if(BUILD_EXTERN_LIBS)
# chipmunk library
add_subdirectory(external/chipmunk/src)
# box2d library
add_subdirectory(external/Box2D)
endif()
# unzip library
add_subdirectory(external/unzip)
if(BUILD_EXTERN_LIBS)
# tinyxml2 library
add_subdirectory(external/tinyxml2)
endif()
# xxhash library
add_subdirectory(external/xxhash)
@ -229,6 +204,18 @@ add_subdirectory(cocos/audio)
# cocos2d library
add_subdirectory(cocos)
# cocos3d library
add_subdirectory(cocos/3d)
# network library
add_subdirectory(cocos/network)
# ui library
add_subdirectory(cocos/ui)
# sqlite3 library
add_subdirectory(cocos/storage)
if(BUILD_EXTENSIONS)
# extensions
add_subdirectory(extensions)
@ -266,11 +253,9 @@ add_subdirectory(cocos/scripting/lua-bindings)
add_subdirectory(external/xxtea)
endif(BUILD_LIBS_LUA)
# build tests
add_subdirectory(tests/cpp-empty-test)
# build tests
if(BUILD_CppTests)
add_subdirectory(tests/cpp-empty-test)
add_subdirectory(tests/cpp-tests)
endif(BUILD_CppTests)

View File

@ -21,12 +21,12 @@ cocos2d-x is:
Git user attention
-----------------------
1. After cloning the repo, please execute `download-deps.py` to download and install some dependences.
1. After cloning the repo, please execute `download-deps.py` to download and install dependencies.
$ cd cocos2d-x
$ python download-deps.py
2. Please execute `download-deps.py` once you synchronize with this repo. If there aren't any updates, it will not download dependences again.
2. Please execute `download-deps.py` once you synchronize with this repo. If there aren't any updates, it will not download dependencies again.
How to start a new game
-----------------------
@ -43,21 +43,21 @@ Example:
$ cocos new MyGame -p com.your_company.mygame -l cpp -d NEW_PROJECTS_DIR
$ cd NEW_PROJECTS_DIR/MyGame
### Build and run new project for android ###
### Build and run a new project for Android ###
$ cocos run -p android -j 4
### Build and run new project for iOS ###
### Build and run a new project for iOS ###
$ cocos run -p ios
### Build and run new project for OSX ###
### Build and run a new project for OSX ###
$ cocos run -p mac
### Build and run new project for linux ###
### Build and run a new project for Linux ###
if you never run cocos2d-x on linux, you need to install all dependences by the
if you never run cocos2d-x on Linux, you need to install all dependencies by the
script in **cocos2d/build/install-deps-linux.sh**
$ cd cocos2d-x/build
@ -104,9 +104,9 @@ Main features
* Sound Engine support (CocosDenshion library) based on OpenAL
* Integrated Slow motion/Fast forward
* Fast and compressed textures: PVR compressed and uncompressed textures, ETC1 compressed textures, and more
* Resolution Independence
* Resolution Independent
* Language: C++, with Lua and JavaScript bindings
* Open Source Commercial Friendly: Compatible with open and closed source projects
* Open Source Commercial Friendly(MIT): Compatible with open and closed source projects
* OpenGL ES 2.0 (mobile) / OpenGL 2.1 (desktop) based
Build Requirements

View File

@ -11,3 +11,59 @@ macro(pre_build TARGET_NAME)
add_custom_target( ${TARGET_NAME}_CORE_PRE_BUILD )
add_dependencies( ${TARGET_NAME}_PRE_BUILD ${TARGET_NAME}_CORE_PRE_BUILD )
endmacro()
#cmake has some strange defaults, this should help us a lot
#Please use them everywhere
#WINDOWS = Windows Desktop
#WINRT = Windows RT
#WP8 = Windows Phone 8
#ANDROID = ANDROID
#IOS = IOS
#MACOSX = MAC OSX
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(WINRT)
set(SYSTEM_STRING "Windows RT")
elseif(WP8)
set(SYSTEM_STRING "Windows Phone 8")
else()
set(WINDOWS TRUE)
set(SYSTEM_STRING "Windows Desktop")
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(ANDROID)
set(SYSTEM_STRING "Android")
else()
set(LINUX TRUE)
set(SYSTEM_STRING "Linux")
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(IOS)
set(SYSTEM_STRING "IOS")
else()
set(MACOSX TRUE)
set(SYSTEM_STRING "Mac OSX")
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(COMPILER_STRING ${CMAKE_CXX_COMPILER_ID})
set(CLANG TRUE)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(MINGW)
set(COMPILER_STRING "Mingw GCC")
else()
set(COMPILER_STRING "GCC")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set(COMPILER_STRING "${CMAKE_CXX_COMPILER_ID} C++")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(COMPILER_STRING "Visual Studio C++")
endif()
if(CMAKE_CROSSCOMPILING)
set(BUILDING_STRING "It appears you are cross compiling for ${SYSTEM_STRING} with ${COMPILER_STRING}")
else()
set(BUILDING_STRING "It appears you are builing natively for ${SYSTEM_STRING} with ${COMPILER_STRING}")
endif()

View File

@ -123,6 +123,10 @@ def copy_files(src, dst):
os.mkdir(new_dst)
copy_files(path, new_dst)
def copy_file(src_file, dst):
if not src_file.startswith('.') and not src_file.endswith('.gz') and os.path.isfile(src_file):
shutil.copy(src_file, dst)
def copy_resources(target, app_android_root):
# remove app_android_root/assets if it exists
@ -154,7 +158,21 @@ def copy_resources(target, app_android_root):
copy_files(src_dir, assets_src_dir)
common_script_dir = os.path.join(app_android_root, "../../../../cocos/scripting/lua-bindings/script")
copy_files(common_script_dir, assets_dir)
if target == "lua-tests":
copy_files(os.path.join(common_script_dir, "cocos2d"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocosbuilder"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocosdenshion"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocostudio"), assets_dir)
copy_files(os.path.join(common_script_dir, "extension"), assets_dir)
copy_files(os.path.join(common_script_dir, "network"), assets_dir)
copy_files(os.path.join(common_script_dir, "ui"), assets_dir)
elif target == "lua-empty-test":
copy_files(os.path.join(common_script_dir, "cocos2d"), assets_dir)
copy_files(os.path.join(common_script_dir, "cocosdenshion"), assets_dir)
copy_files(os.path.join(common_script_dir, "network"), assets_dir)
elif target == "lua-game-controller-test":
copy_files(os.path.join(common_script_dir, "cocos2d"), assets_dir)
copy_files(os.path.join(common_script_dir, "controller"), assets_dir)
luasocket_script_dir = os.path.join(app_android_root, "../../../../external/lua/luasocket")
for root, dirs, files in os.walk(luasocket_script_dir):

View File

@ -1,62 +0,0 @@
#!/bin/bash
# msys2 Pacman Manager for cocos2d-x
#/****************************************************************************
# Copyright (c) 2013-2014 Martell Malone
#
#
# 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.
# ****************************************************************************/
set -e
THISDIR="$(dirname $0)"
test "$THISDIR" = "." && THISDIR=${PWD}
OSTYPE=${OSTYPE//[0-9.]/}
HOST_ARCH=$(uname -m)
if [ "${HOST_ARCH}" = "i686" ]; then
BITS=32
elif [ "${HOST_ARCH}" = "x86_64" ]; then
BITS=64
fi
if [ "${OSTYPE}" = "msys" ]; then
CC=clang
CXX=clang++
PP=mingw-w64-${HOST_ARCH}
MINGW_PACKAGES=(glfw glew libwebp libjpeg-turbo libpng freetype libiconv zlib curl
make clang binutils headers cmake)
MINGW_PACKAGES=(${MINGW_PACKAGES[@]/#/${PP}-})
pacman -S --force --noconfirm --needed ${MINGW_PACKAGES[@]}
mkdir -p mingw${BITS}-clang && cd mingw${BITS}-clang
export PATH=/mingw${BITS}/bin:${PATH}
cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM="mingw32-make" \
-DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" ../..
mingw32-make
fi

View File

@ -1,62 +0,0 @@
#!/bin/bash
# msys2 Pacman Manager for cocos2d-x
#/****************************************************************************
# Copyright (c) 2012-2013 Martell Malone
#
#
# 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.
# ****************************************************************************/
set -e
THISDIR="$(dirname $0)"
test "$THISDIR" = "." && THISDIR=${PWD}
OSTYPE=${OSTYPE//[0-9.]/}
HOST_ARCH=$(uname -m)
if [ "${HOST_ARCH}" = "i686" ]; then
BITS=32
elif [ "${HOST_ARCH}" = "x86_64" ]; then
BITS=64
fi
if [ "${OSTYPE}" = "msys" ]; then
CC=${HOST_ARCH}-w64-mingw32-gcc
CXX=${HOST_ARCH}-w64-mingw32-g++
PP=mingw-w64-${HOST_ARCH}
MINGW_PACKAGES=(glfw glew libwebp libjpeg-turbo libpng freetype libiconv zlib curl
make gcc binutils headers cmake)
MINGW_PACKAGES=(${MINGW_PACKAGES[@]/#/${PP}-})
pacman -S --force --noconfirm --needed ${MINGW_PACKAGES[@]}
mkdir -p mingw${BITS} && cd mingw${BITS}
export PATH=/mingw${BITS}/bin:${PATH}
cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM="mingw32-make" \
-DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" ../..
mingw32-make
fi

View File

@ -1,100 +1,76 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
EndProject
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos\storage\local-storage\proj.win32\libLocalStorage.vcxproj", "{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scripting\lua-bindings\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\ui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj.win32\cpp-empty-test.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-empty-test", "..\tests\lua-empty-test\project\proj.win32\lua-empty-test.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosdenshion", "..\cocos\audio\proj.win32\libcocosdenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libui", "..\cocos\ui\proj.win32\libui.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libextension", "..\extensions\proj.win32\libextension.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspine", "..\cocos\editor-support\spine\proj.win32\libspine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocosbuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libcocosbuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocostudio", "..\cocos\editor-support\cocostudio\proj.win32\libcocostudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj", "{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosdenshion", "..\cocos\scripting\lua-bindings\proj.win32\libluacocosdenshion.vcxproj", "{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluanetwork", "..\cocos\scripting\lua-bindings\proj.win32\libluanetwork.vcxproj", "{65E52F4B-703F-419E-AD67-926241A10042}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocosbuilder", "..\cocos\scripting\lua-bindings\proj.win32\libluacocosbuilder.vcxproj", "{F8198014-F4F3-49F0-88AB-C1969A5829AF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocostudio", "..\cocos\scripting\lua-bindings\proj.win32\libluacocostudio.vcxproj", "{9640951E-C5D0-47B5-9C42-0BCADA261C50}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaui", "..\cocos\scripting\lua-bindings\proj.win32\libluaui.vcxproj", "{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaextension", "..\cocos\scripting\lua-bindings\proj.win32\libluaextension.vcxproj", "{7068296E-38A4-4BCA-85DB-3A09BD014847}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluaspine", "..\cocos\scripting\lua-bindings\proj.win32\libluaspine.vcxproj", "{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos3d", "..\cocos\3d\proj.win32\libcocos3d.vcxproj", "{E24950FA-5BC1-4AEE-A900-4F0259354BF0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos3d", "..\cocos\scripting\lua-bindings\proj.win32\libluacocos3d.vcxproj", "{06840490-14A4-43D6-88BC-AAFA44D043EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.Build.0 = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32
{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Debug|Win32.ActiveCfg = Debug|Win32
{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Debug|Win32.Build.0 = Debug|Win32
{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Release|Win32.ActiveCfg = Release|Win32
{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Release|Win32.Build.0 = Release|Win32
{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32
{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32
{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32
{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.Build.0 = Release|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32
{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32
{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32
{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32
@ -103,6 +79,78 @@ Global
{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32
{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32
{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32
{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32
{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.ActiveCfg = Debug|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.Build.0 = Debug|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.ActiveCfg = Release|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.Build.0 = Release|Win32
{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Debug|Win32.ActiveCfg = Debug|Win32
{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Debug|Win32.Build.0 = Debug|Win32
{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.ActiveCfg = Release|Win32
{46A7D57A-7F25-4F52-823B-FFAC4FF3A624}.Release|Win32.Build.0 = Release|Win32
{65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.ActiveCfg = Debug|Win32
{65E52F4B-703F-419E-AD67-926241A10042}.Debug|Win32.Build.0 = Debug|Win32
{65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.ActiveCfg = Release|Win32
{65E52F4B-703F-419E-AD67-926241A10042}.Release|Win32.Build.0 = Release|Win32
{F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.ActiveCfg = Debug|Win32
{F8198014-F4F3-49F0-88AB-C1969A5829AF}.Debug|Win32.Build.0 = Debug|Win32
{F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.ActiveCfg = Release|Win32
{F8198014-F4F3-49F0-88AB-C1969A5829AF}.Release|Win32.Build.0 = Release|Win32
{9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.ActiveCfg = Debug|Win32
{9640951E-C5D0-47B5-9C42-0BCADA261C50}.Debug|Win32.Build.0 = Debug|Win32
{9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.ActiveCfg = Release|Win32
{9640951E-C5D0-47B5-9C42-0BCADA261C50}.Release|Win32.Build.0 = Release|Win32
{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.ActiveCfg = Debug|Win32
{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Debug|Win32.Build.0 = Debug|Win32
{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.ActiveCfg = Release|Win32
{FE78EEBB-3DBB-4713-8CBF-63D742C5BD82}.Release|Win32.Build.0 = Release|Win32
{7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.ActiveCfg = Debug|Win32
{7068296E-38A4-4BCA-85DB-3A09BD014847}.Debug|Win32.Build.0 = Debug|Win32
{7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.ActiveCfg = Release|Win32
{7068296E-38A4-4BCA-85DB-3A09BD014847}.Release|Win32.Build.0 = Release|Win32
{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.ActiveCfg = Debug|Win32
{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Debug|Win32.Build.0 = Debug|Win32
{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.ActiveCfg = Release|Win32
{31EF6AB1-0D9A-4BC6-99B8-2C482EA373C4}.Release|Win32.Build.0 = Release|Win32
{E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.ActiveCfg = Debug|Win32
{E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Debug|Win32.Build.0 = Debug|Win32
{E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.ActiveCfg = Release|Win32
{E24950FA-5BC1-4AEE-A900-4F0259354BF0}.Release|Win32.Build.0 = Release|Win32
{06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.ActiveCfg = Debug|Win32
{06840490-14A4-43D6-88BC-AAFA44D043EB}.Debug|Win32.Build.0 = Debug|Win32
{06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.ActiveCfg = Release|Win32
{06840490-14A4-43D6-88BC-AAFA44D043EB}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

File diff suppressed because it is too large Load Diff

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A03F2E9817814268006731B9"
BuildableName = "libCocosDenshion Mac.a"
BlueprintName = "CocosDenshion Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4F9F178387730073F6A7"
BuildableName = "libCocosDenshion iOS.a"
BlueprintName = "CocosDenshion iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A03F2D5D1780BDF7006731B9"
BuildableName = "libbox2d Mac.a"
BlueprintName = "box2d Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4F3C1783876B0073F6A7"
BuildableName = "libbox2d iOS.a"
BlueprintName = "box2d iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A03F2E8E178141C1006731B9"
BuildableName = "build all libs Mac"
BlueprintName = "build all libs Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4E0B178386390073F6A7"
BuildableName = "build all libs iOS"
BlueprintName = "build all libs iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A03F2B781780BD04006731B9"
BuildableName = "libchipmunk Mac.a"
BlueprintName = "chipmunk Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4EFD178387670073F6A7"
BuildableName = "libchipmunk iOS.a"
BlueprintName = "chipmunk iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1551A33E158F2AB200E66CFE"
BuildableName = "libcocos2dx Mac.a"
BlueprintName = "cocos2dx Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4C241783777C0073F6A7"
BuildableName = "libcocos2dx iOS.a"
BlueprintName = "cocos2dx iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A03F2FC117814595006731B9"
BuildableName = "libcocos2dx-extensions Mac.a"
BlueprintName = "cocos2dx-extensions Mac"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A4E111783867C0073F6A7"
BuildableName = "libcocos2dx-extensions iOS.a"
BlueprintName = "cocos2dx-extensions iOS"
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -39,6 +39,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A035ACBB1782469700987F6C"
BuildableName = "build all tests Mac"
BlueprintName = "build all tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@ -48,6 +57,15 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A035ACBB1782469700987F6C"
BuildableName = "build all tests Mac"
BlueprintName = "build all tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -39,6 +39,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517B1783A1CC0073F6A7"
BuildableName = "build all tests iOS"
BlueprintName = "build all tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@ -48,6 +57,15 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517B1783A1CC0073F6A7"
BuildableName = "build all tests iOS"
BlueprintName = "build all tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -53,11 +53,19 @@ public:
*/
virtual std::string description() const;
/** returns a clone of action */
virtual Action* clone() const = 0;
/** returns a clone of action */
virtual Action* clone() const
{
CC_ASSERT(0);
return nullptr;
}
/** returns a new action that performs the exactly the reverse action */
virtual Action* reverse() const = 0;
virtual Action* reverse() const
{
CC_ASSERT(0);
return nullptr;
}
//! return true if the action has finished
virtual bool isDone() const;
@ -138,12 +146,20 @@ public:
//
// Overrides
//
virtual FiniteTimeAction* reverse() const override = 0;
virtual FiniteTimeAction* clone() const override = 0;
virtual FiniteTimeAction* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual FiniteTimeAction* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
CC_CONSTRUCTOR_ACCESS:
FiniteTimeAction()
: _duration(0)
: _duration(0)
{}
virtual ~FiniteTimeAction(){}
@ -182,7 +198,7 @@ public:
//
// Override
//
virtual Speed* clone() const override;
virtual Speed* clone() const override;
virtual Speed* reverse() const override;
virtual void startWithTarget(Node* target) override;
virtual void stop() override;
@ -233,8 +249,8 @@ public:
//
// Override
//
virtual Follow* clone() const override;
virtual Follow* reverse() const override;
virtual Follow* clone() const override;
virtual Follow* reverse() const override;
virtual void step(float dt) override;
virtual bool isDone() const override;
virtual void stop() override;
@ -287,7 +303,7 @@ protected:
float _rightBoundary;
float _topBoundary;
float _bottomBoundary;
Rect _worldRect;
Rect _worldRect;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Follow);

View File

@ -49,8 +49,18 @@ public:
//
// Overrides
//
virtual ActionEase* clone() const override = 0;
virtual ActionEase* reverse() const override = 0;
virtual ActionEase* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual ActionEase* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual void startWithTarget(Node *target) override;
virtual void stop() override;
virtual void update(float time) override;
@ -83,8 +93,16 @@ public:
//
// Overrides
//
virtual EaseRateAction* clone() const override = 0;
virtual EaseRateAction* reverse() const override = 0;
virtual EaseRateAction* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual EaseRateAction* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
CC_CONSTRUCTOR_ACCESS:
EaseRateAction() {}
@ -111,8 +129,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseIn* clone() const override;
virtual EaseIn* reverse() const override;
virtual EaseIn* clone() const override;
virtual EaseIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseIn() {}
@ -134,8 +152,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseOut* clone() const override;
virtual EaseOut* reverse() const override;
virtual EaseOut* clone() const override;
virtual EaseOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseOut() {}
@ -157,8 +175,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseInOut* clone() const override;
virtual EaseInOut* reverse() const override;
virtual EaseInOut* clone() const override;
virtual EaseInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseInOut() {}
@ -180,8 +198,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseExponentialIn* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseExponentialIn* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseExponentialIn() {}
@ -203,8 +221,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseExponentialOut* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseExponentialOut* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseExponentialOut() {}
@ -226,8 +244,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseExponentialInOut* clone() const override;
virtual EaseExponentialInOut* reverse() const override;
virtual EaseExponentialInOut* clone() const override;
virtual EaseExponentialInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseExponentialInOut() {}
@ -249,8 +267,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseSineIn* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseSineIn* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseSineIn() {}
@ -272,8 +290,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseSineOut* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseSineOut* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseSineOut() {}
@ -295,8 +313,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseSineInOut* clone() const override;
virtual EaseSineInOut* reverse() const override;
virtual EaseSineInOut* clone() const override;
virtual EaseSineInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseSineInOut() {}
@ -323,8 +341,17 @@ public:
//
// Overrides
//
virtual EaseElastic* clone() const override = 0;
virtual EaseElastic* reverse() const override = 0;
virtual EaseElastic* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual EaseElastic* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
CC_CONSTRUCTOR_ACCESS:
EaseElastic() {}
@ -355,8 +382,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseElasticIn* clone() const override;
virtual EaseElastic* reverse() const override;
virtual EaseElasticIn* clone() const override;
virtual EaseElastic* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseElasticIn() {}
@ -381,8 +408,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseElasticOut* clone() const override;
virtual EaseElastic* reverse() const override;
virtual EaseElasticOut* clone() const override;
virtual EaseElastic* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseElasticOut() {}
@ -407,8 +434,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseElasticInOut* clone() const override;
virtual EaseElasticInOut* reverse() const override;
virtual EaseElasticInOut* clone() const override;
virtual EaseElasticInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseElasticInOut() {}
@ -428,8 +455,17 @@ class CC_DLL EaseBounce : public ActionEase
public:
// Overrides
virtual EaseBounce* clone() const override = 0;
virtual EaseBounce* reverse() const override = 0;
virtual EaseBounce* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual EaseBounce* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
CC_CONSTRUCTOR_ACCESS:
EaseBounce() {}
@ -453,8 +489,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBounceIn* clone() const override;
virtual EaseBounce* reverse() const override;
virtual EaseBounceIn* clone() const override;
virtual EaseBounce* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBounceIn() {}
@ -478,8 +514,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBounceOut* clone() const override;
virtual EaseBounce* reverse() const override;
virtual EaseBounceOut* clone() const override;
virtual EaseBounce* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBounceOut() {}
@ -503,8 +539,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBounceInOut* clone() const override;
virtual EaseBounceInOut* reverse() const override;
virtual EaseBounceInOut* clone() const override;
virtual EaseBounceInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBounceInOut() {}
@ -528,8 +564,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBackIn* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseBackIn* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBackIn() {}
@ -553,8 +589,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBackOut* clone() const override;
virtual ActionEase* reverse() const override;
virtual EaseBackOut* clone() const override;
virtual ActionEase* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBackOut() {}
@ -578,8 +614,8 @@ public:
// Overrides
virtual void update(float time) override;
virtual EaseBackInOut* clone() const override;
virtual EaseBackInOut* reverse() const override;
virtual EaseBackInOut* clone() const override;
virtual EaseBackInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseBackInOut() {}
@ -594,52 +630,52 @@ private:
@brief Ease Bezier
@ingroup Actions
*/
class EaseBezierAction : public cocos2d::ActionEase
class CC_DLL EaseBezierAction : public ActionEase
{
public:
/** creates the action */
static EaseBezierAction* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseBezierAction* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseBezierAction* clone() const override;
virtual EaseBezierAction* reverse() const override;
virtual void update(float time) override;
virtual EaseBezierAction* clone() const override;
virtual EaseBezierAction* reverse() const override;
virtual void setBezierParamer( float p0, float p1, float p2, float p3);
virtual void setBezierParamer( float p0, float p1, float p2, float p3);
CC_CONSTRUCTOR_ACCESS:
EaseBezierAction() {}
virtual ~EaseBezierAction() {}
EaseBezierAction() {}
virtual ~EaseBezierAction() {}
protected:
float _p0;
float _p1;
float _p2;
float _p3;
float _p0;
float _p1;
float _p2;
float _p3;
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);
};
/**
@brief Ease Quadratic In
@ingroup Actions
*/
class EaseQuadraticActionIn:public cocos2d::ActionEase
class CC_DLL EaseQuadraticActionIn : public ActionEase
{
public:
/** creates the action */
static EaseQuadraticActionIn* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuadraticActionIn* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuadraticActionIn* clone() const override;
virtual EaseQuadraticActionIn* reverse() const override;
virtual void update(float time) override;
virtual EaseQuadraticActionIn* clone() const override;
virtual EaseQuadraticActionIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuadraticActionIn() {}
virtual ~EaseQuadraticActionIn() {}
EaseQuadraticActionIn() {}
virtual ~EaseQuadraticActionIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionIn);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionIn);
};
@ -647,22 +683,22 @@ private:
@brief Ease Quadratic Out
@ingroup Actions
*/
class EaseQuadraticActionOut:public cocos2d::ActionEase
class CC_DLL EaseQuadraticActionOut : public ActionEase
{
public:
/** creates the action */
static EaseQuadraticActionOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuadraticActionOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuadraticActionOut* clone() const override;
virtual EaseQuadraticActionOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuadraticActionOut* clone() const override;
virtual EaseQuadraticActionOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuadraticActionOut() {}
virtual ~EaseQuadraticActionOut() {}
EaseQuadraticActionOut() {}
virtual ~EaseQuadraticActionOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionOut);
};
@ -670,88 +706,88 @@ private:
@brief Ease Quadratic InOut
@ingroup Actions
*/
class EaseQuadraticActionInOut:public cocos2d::ActionEase
class CC_DLL EaseQuadraticActionInOut : public ActionEase
{
public:
/** creates the action */
static EaseQuadraticActionInOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuadraticActionInOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuadraticActionInOut* clone() const override;
virtual EaseQuadraticActionInOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuadraticActionInOut* clone() const override;
virtual EaseQuadraticActionInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuadraticActionInOut() {}
virtual ~EaseQuadraticActionInOut() {}
EaseQuadraticActionInOut() {}
virtual ~EaseQuadraticActionInOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionInOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionInOut);
};
/**
@brief Ease Quartic In
@ingroup Actions
*/
class EaseQuarticActionIn:public cocos2d::ActionEase
class CC_DLL EaseQuarticActionIn : public ActionEase
{
public:
/** creates the action */
static EaseQuarticActionIn* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuarticActionIn* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuarticActionIn* clone() const override;
virtual EaseQuarticActionIn* reverse() const override;
virtual void update(float time) override;
virtual EaseQuarticActionIn* clone() const override;
virtual EaseQuarticActionIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuarticActionIn() {}
virtual ~EaseQuarticActionIn() {}
EaseQuarticActionIn() {}
virtual ~EaseQuarticActionIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionIn);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionIn);
};
/**
@brief Ease Quartic Out
@ingroup Actions
*/
class EaseQuarticActionOut:public cocos2d::ActionEase
class CC_DLL EaseQuarticActionOut : public ActionEase
{
public:
/** creates the action */
static EaseQuarticActionOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuarticActionOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuarticActionOut* clone() const override;
virtual EaseQuarticActionOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuarticActionOut* clone() const override;
virtual EaseQuarticActionOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuarticActionOut() {}
virtual ~EaseQuarticActionOut() {}
EaseQuarticActionOut() {}
virtual ~EaseQuarticActionOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionOut);
};
/**
@brief Ease Quartic InOut
@ingroup Actions
*/
class EaseQuarticActionInOut:public cocos2d::ActionEase
class CC_DLL EaseQuarticActionInOut : public ActionEase
{
public:
/** creates the action */
static EaseQuarticActionInOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuarticActionInOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuarticActionInOut* clone() const override;
virtual EaseQuarticActionInOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuarticActionInOut* clone() const override;
virtual EaseQuarticActionInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuarticActionInOut() {}
virtual ~EaseQuarticActionInOut() {}
EaseQuarticActionInOut() {}
virtual ~EaseQuarticActionInOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionInOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionInOut);
};
@ -759,198 +795,198 @@ private:
@brief Ease Quintic In
@ingroup Actions
*/
class EaseQuinticActionIn:public cocos2d::ActionEase
class CC_DLL EaseQuinticActionIn : public ActionEase
{
public:
/** creates the action */
static EaseQuinticActionIn* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuinticActionIn* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuinticActionIn* clone() const override;
virtual EaseQuinticActionIn* reverse() const override;
virtual void update(float time) override;
virtual EaseQuinticActionIn* clone() const override;
virtual EaseQuinticActionIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuinticActionIn() {}
virtual ~EaseQuinticActionIn() {}
EaseQuinticActionIn() {}
virtual ~EaseQuinticActionIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionIn);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionIn);
};
/**
@brief Ease Quintic Out
@ingroup Actions
*/
class EaseQuinticActionOut:public cocos2d::ActionEase
class CC_DLL EaseQuinticActionOut : public ActionEase
{
public:
/** creates the action */
static EaseQuinticActionOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuinticActionOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuinticActionOut* clone() const override;
virtual EaseQuinticActionOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuinticActionOut* clone() const override;
virtual EaseQuinticActionOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuinticActionOut() {}
virtual ~EaseQuinticActionOut() {}
EaseQuinticActionOut() {}
virtual ~EaseQuinticActionOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionOut);
};
/**
@brief Ease Quintic InOut
@ingroup Actions
*/
class EaseQuinticActionInOut:public cocos2d::ActionEase
class CC_DLL EaseQuinticActionInOut : public ActionEase
{
public:
/** creates the action */
static EaseQuinticActionInOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseQuinticActionInOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseQuinticActionInOut* clone() const override;
virtual EaseQuinticActionInOut* reverse() const override;
virtual void update(float time) override;
virtual EaseQuinticActionInOut* clone() const override;
virtual EaseQuinticActionInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseQuinticActionInOut() {}
virtual ~EaseQuinticActionInOut() {}
EaseQuinticActionInOut() {}
virtual ~EaseQuinticActionInOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionInOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionInOut);
};
/**
@brief Ease Circle In
@ingroup Actions
*/
class EaseCircleActionIn:public cocos2d::ActionEase
class CC_DLL EaseCircleActionIn : public ActionEase
{
public:
/** creates the action */
static EaseCircleActionIn* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCircleActionIn* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCircleActionIn* clone() const override;
virtual EaseCircleActionIn* reverse() const override;
virtual void update(float time) override;
virtual EaseCircleActionIn* clone() const override;
virtual EaseCircleActionIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCircleActionIn() {}
virtual ~EaseCircleActionIn() {}
EaseCircleActionIn() {}
virtual ~EaseCircleActionIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionIn);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionIn);
};
/**
@brief Ease Circle Out
@ingroup Actions
*/
class EaseCircleActionOut:public cocos2d::ActionEase
class CC_DLL EaseCircleActionOut : public ActionEase
{
public:
/** creates the action */
static EaseCircleActionOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCircleActionOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCircleActionOut* clone() const override;
virtual EaseCircleActionOut* reverse() const override;
virtual void update(float time) override;
virtual EaseCircleActionOut* clone() const override;
virtual EaseCircleActionOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCircleActionOut() {}
virtual ~EaseCircleActionOut() {}
EaseCircleActionOut() {}
virtual ~EaseCircleActionOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionOut);
};
/**
@brief Ease Circle InOut
@ingroup Actions
*/
class EaseCircleActionInOut:public cocos2d::ActionEase
class CC_DLL EaseCircleActionInOut:public ActionEase
{
public:
/** creates the action */
static EaseCircleActionInOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCircleActionInOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCircleActionInOut* clone() const override;
virtual EaseCircleActionInOut* reverse() const override;
virtual void update(float time) override;
virtual EaseCircleActionInOut* clone() const override;
virtual EaseCircleActionInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCircleActionInOut() {}
virtual ~EaseCircleActionInOut() {}
EaseCircleActionInOut() {}
virtual ~EaseCircleActionInOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionInOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionInOut);
};
/**
@brief Ease Cubic In
@ingroup Actions
*/
class EaseCubicActionIn:public cocos2d::ActionEase
class CC_DLL EaseCubicActionIn:public ActionEase
{
public:
/** creates the action */
static EaseCubicActionIn* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCubicActionIn* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCubicActionIn* clone() const override;
virtual EaseCubicActionIn* reverse() const override;
virtual void update(float time) override;
virtual EaseCubicActionIn* clone() const override;
virtual EaseCubicActionIn* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCubicActionIn() {}
virtual ~EaseCubicActionIn() {}
EaseCubicActionIn() {}
virtual ~EaseCubicActionIn() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionIn);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionIn);
};
/**
@brief Ease Cubic Out
@ingroup Actions
*/
class EaseCubicActionOut:public cocos2d::ActionEase
class CC_DLL EaseCubicActionOut : public ActionEase
{
public:
/** creates the action */
static EaseCubicActionOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCubicActionOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCubicActionOut* clone() const override;
virtual EaseCubicActionOut* reverse() const override;
virtual void update(float time) override;
virtual EaseCubicActionOut* clone() const override;
virtual EaseCubicActionOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCubicActionOut() {}
virtual ~EaseCubicActionOut() {}
EaseCubicActionOut() {}
virtual ~EaseCubicActionOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionOut);
};
/**
@brief Ease Cubic InOut
@ingroup Actions
*/
class EaseCubicActionInOut:public cocos2d::ActionEase
class CC_DLL EaseCubicActionInOut : public ActionEase
{
public:
/** creates the action */
static EaseCubicActionInOut* create(cocos2d::ActionInterval* action);
/** creates the action */
static EaseCubicActionInOut* create(ActionInterval* action);
virtual void update(float time) override;
virtual EaseCubicActionInOut* clone() const override;
virtual EaseCubicActionInOut* reverse() const override;
virtual void update(float time) override;
virtual EaseCubicActionInOut* clone() const override;
virtual EaseCubicActionInOut* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
EaseCubicActionInOut() {}
virtual ~EaseCubicActionInOut() {}
EaseCubicActionInOut() {}
virtual ~EaseCubicActionInOut() {}
private:
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionInOut);
CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionInOut);
};
// end of actions group

View File

@ -48,7 +48,11 @@ public:
virtual GridBase* getGrid();
// overrides
virtual GridAction * clone() const override = 0;
virtual GridAction * clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual GridAction* reverse() const override;
virtual void startWithTarget(Node *target) override;
@ -110,7 +114,11 @@ public:
void setVertex(const Vec2& position, const Vec3& vertex);
// Overrides
virtual Grid3DAction * clone() const override = 0;
virtual Grid3DAction * clone() const override
{
CC_ASSERT(0);
return nullptr;
}
};
/** @brief Base class for TiledGrid3D actions */
@ -157,7 +165,11 @@ public:
virtual GridBase* getGrid();
// Override
virtual TiledGrid3DAction * clone() const override = 0;
virtual TiledGrid3DAction * clone() const override
{
CC_ASSERT(0);
return nullptr;
}
};
/** @brief AccelDeccelAmplitude action */
@ -175,8 +187,8 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
virtual AccelDeccelAmplitude* clone() const override;
virtual AccelDeccelAmplitude* reverse() const override;
virtual AccelDeccelAmplitude* clone() const override;
virtual AccelDeccelAmplitude* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
AccelDeccelAmplitude() {}
@ -208,8 +220,8 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
virtual AccelAmplitude* clone() const override;
virtual AccelAmplitude* reverse() const override;
virtual AccelAmplitude* clone() const override;
virtual AccelAmplitude* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
AccelAmplitude() {}
@ -240,8 +252,8 @@ public:
// overrides
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
virtual DeccelAmplitude* clone() const override;
virtual DeccelAmplitude* reverse() const override;
virtual DeccelAmplitude* clone() const override;
virtual DeccelAmplitude* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
DeccelAmplitude() {}
@ -271,8 +283,8 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
virtual StopGrid* clone() const override;
virtual StopGrid* reverse() const override;
virtual StopGrid* clone() const override;
virtual StopGrid* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
StopGrid() {}
@ -296,8 +308,8 @@ public:
// Override
virtual void startWithTarget(Node *target) override;
virtual ReuseGrid* clone() const override;
virtual ReuseGrid* reverse() const override;
virtual ReuseGrid* clone() const override;
virtual ReuseGrid* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
ReuseGrid() {}

View File

@ -51,8 +51,18 @@ public:
//
// Overrides
//
virtual ActionInstant* clone() const override = 0;
virtual ActionInstant * reverse() const override = 0;
virtual ActionInstant* clone() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual ActionInstant * reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual bool isDone() const override;
virtual void step(float dt) override;
virtual void update(float time) override;
@ -72,7 +82,7 @@ public:
//
virtual void update(float time) override;
virtual ActionInstant* reverse() const override;
virtual Show* clone() const override;
virtual Show* clone() const override;
CC_CONSTRUCTOR_ACCESS:
Show(){}
@ -95,8 +105,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual ActionInstant* reverse() const override;
virtual Hide* clone() const override;
virtual ActionInstant* reverse() const override;
virtual Hide* clone() const override;
CC_CONSTRUCTOR_ACCESS:
Hide(){}
@ -118,8 +128,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual ToggleVisibility* reverse() const override;
virtual ToggleVisibility* clone() const override;
virtual ToggleVisibility* reverse() const override;
virtual ToggleVisibility* clone() const override;
CC_CONSTRUCTOR_ACCESS:
ToggleVisibility(){}
@ -135,25 +145,25 @@ private:
class CC_DLL RemoveSelf : public ActionInstant
{
public:
/** create the action */
static RemoveSelf * create(bool isNeedCleanUp = true);
/** create the action */
static RemoveSelf * create(bool isNeedCleanUp = true);
//
//
// Override
//
virtual void update(float time) override;
virtual RemoveSelf* clone() const override;
virtual RemoveSelf* reverse() const override;
virtual void update(float time) override;
virtual RemoveSelf* clone() const override;
virtual RemoveSelf* reverse() const override;
CC_CONSTRUCTOR_ACCESS:
RemoveSelf() : _isNeedCleanUp(true){}
virtual ~RemoveSelf(){}
/** init the action */
bool init(bool isNeedCleanUp);
/** init the action */
bool init(bool isNeedCleanUp);
protected:
bool _isNeedCleanUp;
bool _isNeedCleanUp;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);
@ -173,8 +183,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual FlipX* reverse() const override;
virtual FlipX* clone() const override;
virtual FlipX* reverse() const override;
virtual FlipX* clone() const override;
CC_CONSTRUCTOR_ACCESS:
FlipX() :_flipX(false) {}
@ -204,8 +214,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual FlipY* reverse() const override;
virtual FlipY* clone() const override;
virtual FlipY* reverse() const override;
virtual FlipY* clone() const override;
CC_CONSTRUCTOR_ACCESS:
FlipY() :_flipY(false) {}
@ -234,8 +244,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual Place* reverse() const override;
virtual Place* clone() const override;
virtual Place* reverse() const override;
virtual Place* clone() const override;
CC_CONSTRUCTOR_ACCESS:
Place(){}
@ -257,18 +267,18 @@ private:
class CC_DLL CallFunc : public ActionInstant //<NSCopying>
{
public:
/** creates the action with the callback of type std::function<void()>.
This is the preferred way to create the callback.
/** creates the action with the callback of type std::function<void()>.
This is the preferred way to create the callback.
* When this funtion bound in js or lua ,the input param will be changed
* In js: var create(var func, var this, var [data]) or var create(var func)
* In lua:local create(local funcID)
*/
*/
static CallFunc * create(const std::function<void()>& func);
/** creates the action with the callback
typedef void (Ref::*SEL_CallFunc)();
@deprecated Use the std::function API instead.
@deprecated Use the std::function API instead.
* @js NA
* @lua NA
*/
@ -296,8 +306,8 @@ public:
// Overrides
//
virtual void update(float time) override;
virtual CallFunc* reverse() const override;
virtual CallFunc* clone() const override;
virtual CallFunc* reverse() const override;
virtual CallFunc* clone() const override;
CC_CONSTRUCTOR_ACCESS:
CallFunc()
@ -308,16 +318,16 @@ CC_CONSTRUCTOR_ACCESS:
}
virtual ~CallFunc();
/** initializes the action with the callback
/** initializes the action with the callback
typedef void (Ref::*SEL_CallFunc)();
@deprecated Use the std::function API instead.
*/
CC_DEPRECATED_ATTRIBUTE bool initWithTarget(Ref* target);
/** initializes the action with the std::function<void()>
/** initializes the action with the std::function<void()>
* @js NA
* @lua NA
*/
*/
bool initWithFunction(const std::function<void()>& func);
protected:
@ -331,7 +341,7 @@ protected:
};
/** function that will be called */
std::function<void()> _function;
std::function<void()> _function;
private:
CC_DISALLOW_COPY_AND_ASSIGN(CallFunc);
@ -345,8 +355,8 @@ class CC_DLL CallFuncN : public CallFunc
{
public:
/** creates the action with the callback of type std::function<void()>.
This is the preferred way to create the callback.
*/
This is the preferred way to create the callback.
*/
static CallFuncN * create(const std::function<void(Node*)>& func);
/** creates the action with the callback
@ -359,7 +369,7 @@ public:
//
// Overrides
//
virtual CallFuncN* clone() const override;
virtual CallFuncN* clone() const override;
virtual void execute() override;
CC_CONSTRUCTOR_ACCESS:
@ -399,7 +409,7 @@ public:
//
// Overrides
//
virtual __CCCallFuncND* clone() const override;
virtual __CCCallFuncND* clone() const override;
virtual void execute() override;
CC_CONSTRUCTOR_ACCESS:
@ -436,7 +446,7 @@ public:
//
// Overrides
//
virtual __CCCallFuncO* clone() const override;
virtual __CCCallFuncO* clone() const override;
virtual void execute() override;
Ref* getObject() const;

View File

@ -724,41 +724,57 @@ Spawn* Spawn::reverse() const
// RotateTo
//
RotateTo* RotateTo::create(float duration, float deltaAngle)
RotateTo* RotateTo::create(float duration, float dstAngle)
{
RotateTo* rotateTo = new RotateTo();
rotateTo->initWithDuration(duration, deltaAngle);
rotateTo->initWithDuration(duration, dstAngle, dstAngle);
rotateTo->autorelease();
return rotateTo;
}
bool RotateTo::initWithDuration(float duration, float deltaAngle)
{
if (ActionInterval::initWithDuration(duration))
{
_dstAngleX = _dstAngleY = deltaAngle;
return true;
}
return false;
}
RotateTo* RotateTo::create(float duration, float deltaAngleX, float deltaAngleY)
RotateTo* RotateTo::create(float duration, float dstAngleX, float dstAngleY)
{
RotateTo* rotateTo = new RotateTo();
rotateTo->initWithDuration(duration, deltaAngleX, deltaAngleY);
rotateTo->initWithDuration(duration, dstAngleX, dstAngleY);
rotateTo->autorelease();
return rotateTo;
}
bool RotateTo::initWithDuration(float duration, float deltaAngleX, float deltaAngleY)
RotateTo* RotateTo::create(float duration, const Vec3& dstAngle3D)
{
RotateTo* rotateTo = new RotateTo();
rotateTo->initWithDuration(duration, dstAngle3D);
rotateTo->autorelease();
return rotateTo;
}
RotateTo::RotateTo()
: _is3D(false)
{
}
bool RotateTo::initWithDuration(float duration, float dstAngleX, float dstAngleY)
{
if (ActionInterval::initWithDuration(duration))
{
_dstAngleX = deltaAngleX;
_dstAngleY = deltaAngleY;
_dstAngle.x = dstAngleX;
_dstAngle.y = dstAngleY;
return true;
}
return false;
}
bool RotateTo::initWithDuration(float duration, const Vec3& dstAngle3D)
{
if (ActionInterval::initWithDuration(duration))
{
_dstAngle = dstAngle3D;
_is3D = true;
return true;
}
@ -770,84 +786,90 @@ RotateTo* RotateTo::clone(void) const
{
// no copy constructor
auto a = new RotateTo();
a->initWithDuration(_duration, _dstAngleX, _dstAngleY);
if(_is3D)
a->initWithDuration(_duration, _dstAngle);
else
a->initWithDuration(_duration, _dstAngle.x, _dstAngle.y);
a->autorelease();
return a;
}
void RotateTo::calculateAngles(float &startAngle, float &diffAngle, float dstAngle)
{
if (startAngle > 0)
{
startAngle = fmodf(startAngle, 360.0f);
}
else
{
startAngle = fmodf(startAngle, -360.0f);
}
diffAngle = dstAngle - startAngle;
if (diffAngle > 180)
{
diffAngle -= 360;
}
if (diffAngle < -180)
{
diffAngle += 360;
}
}
void RotateTo::startWithTarget(Node *target)
{
ActionInterval::startWithTarget(target);
// Calculate X
_startAngleX = target->getRotationSkewX();
if (_startAngleX > 0)
if (_is3D)
{
_startAngleX = fmodf(_startAngleX, 360.0f);
_startAngle = _target->getRotation3D();
}
else
{
_startAngleX = fmodf(_startAngleX, -360.0f);
_startAngle.x = _target->getRotationSkewX();
_startAngle.y = _target->getRotationSkewY();
}
_diffAngleX = _dstAngleX - _startAngleX;
if (_diffAngleX > 180)
{
_diffAngleX -= 360;
}
if (_diffAngleX < -180)
{
_diffAngleX += 360;
}
//Calculate Y: It's duplicated from calculating X since the rotation wrap should be the same
_startAngleY = _target->getRotationSkewY();
if (_startAngleY > 0)
{
_startAngleY = fmodf(_startAngleY, 360.0f);
}
else
{
_startAngleY = fmodf(_startAngleY, -360.0f);
}
_diffAngleY = _dstAngleY - _startAngleY;
if (_diffAngleY > 180)
{
_diffAngleY -= 360;
}
if (_diffAngleY < -180)
{
_diffAngleY += 360;
}
calculateAngles(_startAngle.x, _diffAngle.x, _dstAngle.x);
calculateAngles(_startAngle.y, _diffAngle.y, _dstAngle.y);
calculateAngles(_startAngle.z, _diffAngle.z, _dstAngle.z);
}
void RotateTo::update(float time)
{
if (_target)
{
#if CC_USE_PHYSICS
if (_startAngleX == _startAngleY && _diffAngleX == _diffAngleY)
if(_is3D)
{
_target->setRotation(_startAngleX + _diffAngleX * time);
_target->setRotation3D(Vec3(
_startAngle.x + _diffAngle.x * time,
_startAngle.y + _diffAngle.y * time,
_startAngle.z + _diffAngle.z * time
));
}
else
{
// _startAngleX != _startAngleY || _diffAngleX != _diffAngleY
if (_target->getPhysicsBody() != nullptr)
#if CC_USE_PHYSICS
if (_startAngle.x == _startAngle.y && _diffAngle.x == _diffAngle.y)
{
CCLOG("RotateTo WARNING: PhysicsBody doesn't support skew rotation");
_target->setRotation(_startAngle.x + _diffAngle.x * time);
}
else
{
// _startAngle.x != _startAngle.y || _diffAngle.x != _diffAngle.y
if (_target->getPhysicsBody() != nullptr)
{
CCLOG("RotateTo WARNING: PhysicsBody doesn't support skew rotation");
}
_target->setRotationSkewX(_startAngle.x + _diffAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _diffAngle.y * time);
}
_target->setRotationSkewX(_startAngleX + _diffAngleX * time);
_target->setRotationSkewY(_startAngleY + _diffAngleY * time);
}
#else
_target->setRotationSkewX(_startAngleX + _diffAngleX * time);
_target->setRotationSkewY(_startAngleY + _diffAngleY * time);
_target->setRotationSkewX(_startAngle.x + _diffAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _diffAngle.y * time);
#endif // CC_USE_PHYSICS
}
}
}
@ -897,7 +919,7 @@ bool RotateBy::initWithDuration(float duration, float deltaAngle)
{
if (ActionInterval::initWithDuration(duration))
{
_angleZ_X = _angleZ_Y = deltaAngle;
_deltaAngle.x = _deltaAngle.y = deltaAngle;
return true;
}
@ -908,8 +930,8 @@ bool RotateBy::initWithDuration(float duration, float deltaAngleX, float deltaAn
{
if (ActionInterval::initWithDuration(duration))
{
_angleZ_X = deltaAngleX;
_angleZ_Y = deltaAngleY;
_deltaAngle.x = deltaAngleX;
_deltaAngle.y = deltaAngleY;
return true;
}
@ -920,7 +942,7 @@ bool RotateBy::initWithDuration(float duration, const Vec3& deltaAngle3D)
{
if (ActionInterval::initWithDuration(duration))
{
_angle3D = deltaAngle3D;
_deltaAngle = deltaAngle3D;
_is3D = true;
return true;
}
@ -934,9 +956,9 @@ RotateBy* RotateBy::clone() const
// no copy constructor
auto a = new RotateBy();
if(_is3D)
a->initWithDuration(_duration, _angle3D);
a->initWithDuration(_duration, _deltaAngle);
else
a->initWithDuration(_duration, _angleZ_X, _angleZ_Y);
a->initWithDuration(_duration, _deltaAngle.x, _deltaAngle.y);
a->autorelease();
return a;
}
@ -946,12 +968,12 @@ void RotateBy::startWithTarget(Node *target)
ActionInterval::startWithTarget(target);
if(_is3D)
{
_startAngle3D = target->getRotation3D();
_startAngle = target->getRotation3D();
}
else
{
_startAngleZ_X = target->getRotationSkewX();
_startAngleZ_Y = target->getRotationSkewY();
_startAngle.x = target->getRotationSkewX();
_startAngle.y = target->getRotationSkewY();
}
}
@ -963,32 +985,32 @@ void RotateBy::update(float time)
if(_is3D)
{
Vec3 v;
v.x = _startAngle3D.x + _angle3D.x * time;
v.y = _startAngle3D.y + _angle3D.y * time;
v.z = _startAngle3D.z + _angle3D.z * time;
v.x = _startAngle.x + _deltaAngle.x * time;
v.y = _startAngle.y + _deltaAngle.y * time;
v.z = _startAngle.z + _deltaAngle.z * time;
_target->setRotation3D(v);
}
else
{
#if CC_USE_PHYSICS
if (_startAngleZ_X == _startAngleZ_Y && _angleZ_X == _angleZ_Y)
if (_startAngle.x == _startAngle.y && _deltaAngle.x == _deltaAngle.y)
{
_target->setRotation(_startAngleZ_X + _angleZ_X * time);
_target->setRotation(_startAngle.x + _deltaAngle.x * time);
}
else
{
// _startAngleZ_X != _startAngleZ_Y || _angleZ_X != _angleZ_Y
// _startAngle.x != _startAngle.y || _deltaAngle.x != _deltaAngle.y
if (_target->getPhysicsBody() != nullptr)
{
CCLOG("RotateBy WARNING: PhysicsBody doesn't support skew rotation");
}
_target->setRotationSkewX(_startAngleZ_X + _angleZ_X * time);
_target->setRotationSkewY(_startAngleZ_Y + _angleZ_Y * time);
_target->setRotationSkewX(_startAngle.x + _deltaAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _deltaAngle.y * time);
}
#else
_target->setRotationSkewX(_startAngleZ_X + _angleZ_X * time);
_target->setRotationSkewY(_startAngleZ_Y + _angleZ_Y * time);
_target->setRotationSkewX(_startAngle.x + _deltaAngle.x * time);
_target->setRotationSkewY(_startAngle.y + _deltaAngle.y * time);
#endif // CC_USE_PHYSICS
}
}
@ -999,12 +1021,15 @@ RotateBy* RotateBy::reverse() const
if(_is3D)
{
Vec3 v;
v.x = - _angle3D.x;
v.y = - _angle3D.y;
v.z = - _angle3D.z;
v.x = - _deltaAngle.x;
v.y = - _deltaAngle.y;
v.z = - _deltaAngle.z;
return RotateBy::create(_duration, v);
}
return RotateBy::create(_duration, -_angleZ_X, -_angleZ_Y);
else
{
return RotateBy::create(_duration, -_deltaAngle.x, -_deltaAngle.y);
}
}
//

View File

@ -77,8 +77,17 @@ public:
virtual bool isDone(void) const override;
virtual void step(float dt) override;
virtual void startWithTarget(Node *target) override;
virtual ActionInterval* reverse() const override = 0;
virtual ActionInterval *clone() const override = 0;
virtual ActionInterval* reverse() const override
{
CC_ASSERT(0);
return nullptr;
}
virtual ActionInterval *clone() const override
{
CC_ASSERT(0);
return nullptr;
}
CC_CONSTRUCTOR_ACCESS:
/** initializes the action */
@ -132,7 +141,7 @@ public:
// Overrides
//
virtual Sequence* clone() const override;
virtual Sequence* reverse() const override;
virtual Sequence* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
virtual void update(float t) override;
@ -181,7 +190,7 @@ public:
// Overrides
//
virtual Repeat* clone() const override;
virtual Repeat* reverse() const override;
virtual Repeat* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
virtual void update(float dt) override;
@ -235,7 +244,7 @@ public:
// Overrides
//
virtual RepeatForever* clone() const override;
virtual RepeatForever* reverse(void) const override;
virtual RepeatForever* reverse(void) const override;
virtual void startWithTarget(Node* target) override;
virtual void step(float dt) override;
virtual bool isDone(void) const override;
@ -302,7 +311,7 @@ public:
// Overrides
//
virtual Spawn* clone() const override;
virtual Spawn* reverse(void) const override;
virtual Spawn* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
virtual void update(float time) override;
@ -330,10 +339,13 @@ class CC_DLL RotateTo : public ActionInterval
{
public:
/** creates the action with separate rotation angles */
static RotateTo* create(float duration, float deltaAngleX, float deltaAngleY);
static RotateTo* create(float duration, float dstAngleX, float dstAngleY);
/** creates the action */
static RotateTo* create(float duration, float deltaAngle);
static RotateTo* create(float duration, float dstAngle);
/** creates the action with 3D rotation angles */
static RotateTo* create(float duration, const Vec3& dstAngle3D);
//
// Overrides
@ -344,21 +356,21 @@ public:
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
RotateTo() {}
RotateTo();
virtual ~RotateTo() {}
/** initializes the action */
bool initWithDuration(float duration, float deltaAngle);
bool initWithDuration(float duration, float deltaAngleX, float deltaAngleY);
bool initWithDuration(float duration, float dstAngleX, float dstAngleY);
bool initWithDuration(float duration, const Vec3& dstAngle3D);
/** calculates the start and diff angles */
void calculateAngles(float &startAngle, float &diffAngle, float dstAngle);
protected:
float _dstAngleX;
float _startAngleX;
float _diffAngleX;
float _dstAngleY;
float _startAngleY;
float _diffAngleY;
bool _is3D;
Vec3 _dstAngle;
Vec3 _startAngle;
Vec3 _diffAngle;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RotateTo);
@ -379,7 +391,7 @@ public:
// Override
//
virtual RotateBy* clone() const override;
virtual RotateBy* reverse(void) const override;
virtual RotateBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -394,14 +406,9 @@ CC_CONSTRUCTOR_ACCESS:
bool initWithDuration(float duration, const Vec3& deltaAngle3D);
protected:
float _angleZ_X;
float _startAngleZ_X;
float _angleZ_Y;
float _startAngleZ_Y;
bool _is3D;
Vec3 _angle3D;
Vec3 _startAngle3D;
Vec3 _deltaAngle;
Vec3 _startAngle;
private:
CC_DISALLOW_COPY_AND_ASSIGN(RotateBy);
@ -423,7 +430,7 @@ public:
// Overrides
//
virtual MoveBy* clone() const override;
virtual MoveBy* reverse(void) const override;
virtual MoveBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -487,7 +494,7 @@ public:
// Overrides
//
virtual SkewTo* clone() const override;
virtual SkewTo* reverse(void) const override;
virtual SkewTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -525,7 +532,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual SkewBy* clone() const override;
virtual SkewBy* reverse(void) const override;
virtual SkewBy* reverse(void) const override;
CC_CONSTRUCTOR_ACCESS:
SkewBy() {}
@ -549,7 +556,7 @@ public:
// Overrides
//
virtual JumpBy* clone() const override;
virtual JumpBy* reverse(void) const override;
virtual JumpBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -584,7 +591,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual JumpTo* clone() const override;
virtual JumpTo* reverse(void) const override;
virtual JumpTo* reverse(void) const override;
CC_CONSTRUCTOR_ACCESS:
JumpTo() {}
@ -623,7 +630,7 @@ public:
// Overrides
//
virtual BezierBy* clone() const override;
virtual BezierBy* reverse(void) const override;
virtual BezierBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -663,7 +670,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual BezierTo* clone() const override;
virtual BezierTo* reverse(void) const override;
virtual BezierTo* reverse(void) const override;
CC_CONSTRUCTOR_ACCESS:
BezierTo() {}
@ -698,7 +705,7 @@ public:
// Overrides
//
virtual ScaleTo* clone() const override;
virtual ScaleTo* reverse(void) const override;
virtual ScaleTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -751,7 +758,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual ScaleBy* clone() const override;
virtual ScaleBy* reverse(void) const override;
virtual ScaleBy* reverse(void) const override;
CC_CONSTRUCTOR_ACCESS:
ScaleBy() {}
@ -773,7 +780,7 @@ public:
// Overrides
//
virtual Blink* clone() const override;
virtual Blink* reverse() const override;
virtual Blink* reverse() const override;
virtual void update(float time) override;
virtual void startWithTarget(Node *target) override;
virtual void stop() override;
@ -807,7 +814,7 @@ public:
// Overrides
//
virtual FadeTo* clone() const override;
virtual FadeTo* reverse(void) const override;
virtual FadeTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -841,7 +848,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual FadeIn* clone() const override;
virtual FadeTo* reverse(void) const override;
virtual FadeTo* reverse(void) const override;
void setReverseAction(FadeTo* ac);
@ -868,7 +875,7 @@ public:
//
virtual void startWithTarget(Node *target) override;
virtual FadeOut* clone() const override;
virtual FadeTo* reverse(void) const override;
virtual FadeTo* reverse(void) const override;
void setReverseAction(FadeTo* ac);
@ -893,7 +900,7 @@ public:
// Overrides
//
virtual TintTo* clone() const override;
virtual TintTo* reverse(void) const override;
virtual TintTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -925,7 +932,7 @@ public:
// Overrides
//
virtual TintBy* clone() const override;
virtual TintBy* reverse() const override;
virtual TintBy* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -988,7 +995,7 @@ public:
//
// Overrides
//
virtual ReverseTime* reverse() const override;
virtual ReverseTime* reverse() const override;
virtual ReverseTime* clone() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;

View File

@ -30,6 +30,7 @@ THE SOFTWARE.
#include "base/CCRef.h"
#include "base/CCMap.h"
#include "base/CCValue.h"
#include "2d/CCAnimation.h"
#include <string>

View File

@ -261,6 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
renderer->addCommand(&_afterDrawStencilCmd);
int i = 0;
bool visibleByCamera = isVisitableByVisitingCamera();
if(!_children.empty())
{
@ -276,12 +277,13 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
break;
}
// self draw
this->draw(renderer, _modelViewTransform, flags);
if (visibleByCamera)
this->draw(renderer, _modelViewTransform, flags);
for(auto it=_children.cbegin()+i; it != _children.cend(); ++it)
(*it)->visit(renderer, _modelViewTransform, flags);
}
else
else if (visibleByCamera)
{
this->draw(renderer, _modelViewTransform, flags);
}

View File

@ -89,12 +89,33 @@ bool ComponentContainer::remove(const std::string& name)
com->setOwner(nullptr);
_components->erase(iter);
ret = true;
} while(0);
return ret;
}
bool ComponentContainer::remove(Component *com)
{
bool ret = false;
do
{
CC_BREAK_IF(!_components);
for (auto iter = _components->begin(); iter != _components->end(); ++iter)
{
if (iter->second == com)
{
com->onExit();
com->setOwner(nullptr);
_components->erase(iter);
break;
}
}
ret = true;
} while(0);
return ret;
}
void ComponentContainer::removeAll()
{
if (_components != nullptr)

View File

@ -50,6 +50,7 @@ public:
virtual Component* get(const std::string& name) const;
virtual bool add(Component *com);
virtual bool remove(const std::string& name);
virtual bool remove(Component *com);
virtual void removeAll();
virtual void visit(float delta);
public:

View File

@ -39,7 +39,7 @@ NS_CC_BEGIN
/** DrawNode
Node that draws dots, segments and polygons.
Faster than the "drawing primitives" since they it draws everything in one single batch.
Faster than the "drawing primitives" since they draws everything in one single batch.
@since v2.1
*/

View File

@ -79,85 +79,85 @@ class PointArray;
namespace DrawPrimitives
{
/** Initializes the drawing primitives */
void init();
void CC_DLL init();
/** Frees allocated resources by the drawing primitives */
void free();
void CC_DLL free();
/** draws a point given x and y coordinate measured in points */
void drawPoint(const Vec2& point);
void CC_DLL drawPoint(const Vec2& point);
/** draws an array of points.
@since v0.7.2
*/
void drawPoints(const Vec2 *points, unsigned int numberOfPoints);
void CC_DLL drawPoints(const Vec2 *points, unsigned int numberOfPoints);
/** draws a line given the origin and destination point measured in points */
void drawLine(const Vec2& origin, const Vec2& destination);
void CC_DLL drawLine(const Vec2& origin, const Vec2& destination);
/** draws a rectangle given the origin and destination point measured in points. */
void drawRect(Vec2 origin, Vec2 destination);
void CC_DLL drawRect(Vec2 origin, Vec2 destination);
/** draws a solid rectangle given the origin and destination point measured in points.
@since 1.1
*/
void drawSolidRect(Vec2 origin, Vec2 destination, Color4F color);
void CC_DLL drawSolidRect(Vec2 origin, Vec2 destination, Color4F color);
/** draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
The polygon can be closed or open
*/
void drawPoly(const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon);
void CC_DLL drawPoly(const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon);
/** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
*/
void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, Color4F color);
void CC_DLL drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, Color4F color);
/** draws a circle given the center, radius and number of segments. */
void drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);
void drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);
void CC_DLL drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);
void CC_DLL drawCircle(const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);
/** draws a solid circle given the center, radius and number of segments. */
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments);
void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);
void CC_DLL drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments);
/** draws a quad bezier path
@warning This function could be pretty slow. Use it only for debugging purposes.
@since v0.8
*/
void drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments);
void CC_DLL drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments);
/** draws a cubic bezier path
@warning This function could be pretty slow. Use it only for debugging purposes.
@since v0.8
*/
void drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments);
void CC_DLL drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments);
/** draws a Catmull Rom path.
@warning This function could be pretty slow. Use it only for debugging purposes.
@since v2.0
*/
void drawCatmullRom(PointArray *arrayOfControlPoints, unsigned int segments);
void CC_DLL drawCatmullRom(PointArray *arrayOfControlPoints, unsigned int segments);
/** draws a Cardinal Spline path.
@warning This function could be pretty slow. Use it only for debugging purposes.
@since v2.0
*/
void drawCardinalSpline(PointArray *config, float tension, unsigned int segments);
void CC_DLL drawCardinalSpline(PointArray *config, float tension, unsigned int segments);
/** set the drawing color with 4 unsigned bytes
@since v2.0
*/
void setDrawColor4B(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
void CC_DLL setDrawColor4B(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
/** set the drawing color with 4 floats
@since v2.0
*/
void setDrawColor4F(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
void CC_DLL setDrawColor4F(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
/** set the point size in points. Default 1.
@since v2.0
*/
void setPointSize(GLfloat pointSize);
void CC_DLL setPointSize(GLfloat pointSize);
};

View File

@ -121,8 +121,10 @@ TMXLayer::TMXLayer()
, _useAutomaticVertexZ(false)
, _dirty(true)
, _quadsDirty(true)
, _vertexBuffer(nullptr)
, _vData(nullptr)
, _indexBuffer(nullptr)
{
_buffersVBO[0] = _buffersVBO[1] = 0;
}
TMXLayer::~TMXLayer()
@ -130,15 +132,10 @@ TMXLayer::~TMXLayer()
CC_SAFE_RELEASE(_tileSet);
CC_SAFE_RELEASE(_texture);
CC_SAFE_DELETE_ARRAY(_tiles);
if(glIsBuffer(_buffersVBO[0]))
{
glDeleteBuffers(1, &_buffersVBO[0]);
}
CC_SAFE_RELEASE(_vData);
CC_SAFE_RELEASE(_vertexBuffer);
CC_SAFE_RELEASE(_indexBuffer);
if(glIsBuffer(_buffersVBO[1]))
{
glDeleteBuffers(1, &_buffersVBO[1]);
}
}
void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
@ -156,43 +153,37 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
updateTiles(rect);
updateIndexBuffer();
updatePrimitives();
_dirty = false;
}
if(_renderCommands.size() < _indicesVertexZNumber.size())
if(_renderCommands.size() < _primitives.size())
{
_renderCommands.resize(_indicesVertexZNumber.size());
_renderCommands.resize(_primitives.size());
}
int index = 0;
for(const auto& iter : _indicesVertexZNumber)
for(const auto& iter : _primitives)
{
auto& cmd = _renderCommands[index++];
cmd.init(iter.first);
cmd.func = CC_CALLBACK_0(TMXLayer::onDraw, this, _indicesVertexZOffsets[iter.first], iter.second);
renderer->addCommand(&cmd);
if(iter.second->getCount() > 0)
{
auto& cmd = _renderCommands[index++];
cmd.init(iter.first, _texture->getName(), getGLProgramState(), BlendFunc::ALPHA_NON_PREMULTIPLIED, iter.second, _modelViewTransform);
renderer->addCommand(&cmd);
}
}
}
void TMXLayer::onDraw(int offset, int count)
void TMXLayer::onDraw(Primitive *primitive)
{
GL::bindTexture2D(_texture->getName());
getGLProgramState()->apply(_modelViewTransform);
GL::bindVAO(0);
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*)0);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_T2F, colors));
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_T2F, texCoords));
glDrawElements(GL_TRIANGLES, (GLsizei)count * 6, GL_UNSIGNED_INT, (GLvoid*)(offset * 6 * sizeof(int)));
primitive->draw();
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, count * 4);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, primitive->getCount() * 4);
}
void TMXLayer::updateTiles(const Rect& culledRect)
@ -291,25 +282,32 @@ void TMXLayer::updateTiles(const Rect& culledRect)
void TMXLayer::updateVertexBuffer()
{
GL::bindVAO(0);
if(!glIsBuffer(_buffersVBO[0]))
if(nullptr == _vData)
{
glGenBuffers(1, &_buffersVBO[0]);
_vertexBuffer = VertexBuffer::create(sizeof(V3F_C4B_T2F), (int)_totalQuads.size() * 4);
_vData = VertexData::create();
_vData->setStream(_vertexBuffer, VertexStreamAttribute(0, GLProgram::VERTEX_ATTRIB_POSITION, GL_FLOAT, 3));
_vData->setStream(_vertexBuffer, VertexStreamAttribute(offsetof(V3F_C4B_T2F, colors), GLProgram::VERTEX_ATTRIB_COLOR, GL_UNSIGNED_BYTE, 4, true));
_vData->setStream(_vertexBuffer, VertexStreamAttribute(offsetof(V3F_C4B_T2F, texCoords), GLProgram::VERTEX_ATTRIB_TEX_COORD, GL_FLOAT, 2));
CC_SAFE_RETAIN(_vData);
CC_SAFE_RETAIN(_vertexBuffer);
}
if(_vertexBuffer)
{
_vertexBuffer->updateVertices((void*)&_totalQuads[0], (int)_totalQuads.size() * 4, 0);
}
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(V3F_C4B_T2F_Quad) * _totalQuads.size(), (GLvoid*)&_totalQuads[0], GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void TMXLayer::updateIndexBuffer()
{
if(!glIsBuffer(_buffersVBO[1]))
if(nullptr == _indexBuffer)
{
glGenBuffers(1, &_buffersVBO[1]);
_indexBuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_UINT_32, (int)_indices.size());
CC_SAFE_RETAIN(_indexBuffer);
}
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int) * _indices.size(), &_indices[0], GL_DYNAMIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
_indexBuffer->updateIndices(&_indices[0], (int)_indices.size(), 0);
}
// FastTMXLayer - setup Tiles
@ -405,6 +403,29 @@ Mat4 TMXLayer::tileToNodeTransform()
}
void TMXLayer::updatePrimitives()
{
for(const auto& iter : _indicesVertexZNumber)
{
int start = _indicesVertexZOffsets.at(iter.first);
auto primitiveIter= _primitives.find(iter.first);
if(primitiveIter == _primitives.end())
{
auto primitive = Primitive::create(_vData, _indexBuffer, GL_TRIANGLES);
primitive->setCount(iter.second * 6);
primitive->setStart(start * 6);
_primitives.insert(iter.first, primitive);
}
else
{
primitiveIter->second->setCount(iter.second * 6);
primitiveIter->second->setStart(start * 6);
}
}
}
void TMXLayer::updateTotalQuads()
{
if(_quadsDirty)

View File

@ -32,6 +32,7 @@ THE SOFTWARE.
#include "CCNode.h"
#include "renderer/CCCustomCommand.h"
#include "renderer/CCQuadCommand.h"
#include "renderer/CCPrimitiveCommand.h"
#include <map>
#include <unordered_map>
@ -199,12 +200,12 @@ protected:
//
void updateTotalQuads();
void onDraw(int offset, int count);
void onDraw(Primitive* primitive);
inline int getTileIndexByPos(int x, int y) const { return x + y * (int) _layerSize.width; }
void updateVertexBuffer();
void updateIndexBuffer();
void updatePrimitives();
protected:
//! name of the layer
@ -228,7 +229,7 @@ protected:
/** container for sprite children. map<index, pair<sprite, gid> > */
std::map<int, std::pair<Sprite*, int> > _spriteContainer;
GLuint _buffersVBO[2]; //0: vertex, 1: indices
//GLuint _buffersVBO; //0: vertex, 1: indices
Size _screenGridSize;
Rect _screenGridRect;
@ -246,9 +247,17 @@ protected:
std::vector<int> _indices;
std::map<int/*vertexZ*/, int/*offset to _indices by quads*/> _indicesVertexZOffsets;
std::unordered_map<int/*vertexZ*/, int/*number to quads*/> _indicesVertexZNumber;
std::vector<CustomCommand> _renderCommands;
std::vector<PrimitiveCommand> _renderCommands;
bool _dirty;
VertexBuffer* _vertexBuffer;
VertexData* _vData;
IndexBuffer* _indexBuffer;
Map<int , Primitive*> _primitives;
public:
/** Possible orientations of the TMX map */
static const int FAST_TMX_ORIENTATION_ORTHO;

View File

@ -178,7 +178,10 @@ FontAtlas * FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidt
FontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
{
std::string atlasName = generateFontName(charMapFile, 0, GlyphCollection::CUSTOM,false);
char tmp[255];
snprintf(tmp,250,"name:%s_%d_%d_%d",charMapFile.c_str(),itemWidth,itemHeight,startCharMap);
std::string atlasName = generateFontName(tmp, 0, GlyphCollection::CUSTOM,false);
auto it = _atlasMap.find(atlasName);
if ( it == _atlasMap.end() )

View File

@ -32,7 +32,7 @@ NS_CC_BEGIN
class BMFontConfiguration;
class FontFNT : public Font
class CC_DLL FontFNT : public Font
{
public:

View File

@ -267,7 +267,7 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid
}
else
{
if (FT_Load_Glyph(_fontRef,glyphIndex,FT_LOAD_RENDER))
if (FT_Load_Glyph(_fontRef,glyphIndex,FT_LOAD_RENDER | FT_LOAD_NO_AUTOHINT))
break;
}

View File

@ -881,11 +881,12 @@ void Label::drawShadowWithoutBlur()
void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
{
// Don't do calculate the culling if the transform was not updated
_insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds;
bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY;
_insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds;
if(_insideBounds) {
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, flags);
_customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, transformUpdated);
renderer->addCommand(&_customCommand);
}
}
@ -1022,7 +1023,8 @@ void Label::updateFont()
void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags)
{
if (_fontDefinition._fontFillColor != _textColor)
if (_fontDefinition._fontFillColor.r != _textColor.r || _fontDefinition._fontFillColor.g != _textColor.g
|| _fontDefinition._fontFillColor.b != _textColor.b)
{
updateContent();
}
@ -1052,7 +1054,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags)
void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
if (! _visible || _originalUTF8String.empty())
if (! _visible || _originalUTF8String.empty() || !isVisitableByVisitingCamera())
{
return;
}

View File

@ -204,7 +204,7 @@ const Size& LabelBMFont::getContentSize() const
Rect LabelBMFont::getBoundingBox() const
{
return _label->getBoundingBox();
return Node::getBoundingBox();
}
#if CC_LABELBMFONT_DEBUG_DRAW
void LabelBMFont::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)

View File

@ -280,7 +280,8 @@ const Size& LabelTTF::getContentSize() const
Rect LabelTTF::getBoundingBox() const
{
return _renderLabel->getBoundingBox();
const_cast<LabelTTF*>(this)->setContentSize(_renderLabel->getContentSize());
return Node::getBoundingBox();
}
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))

View File

@ -173,9 +173,9 @@ CC_CONSTRUCTOR_ACCESS:
protected:
//add the api for avoid use deprecated api
void _addTouchListener();
CC_DEPRECATED_ATTRIBUTE void _addTouchListener() {}
CC_DEPRECATED_ATTRIBUTE void addTouchListener() { _addTouchListener();};
CC_DEPRECATED_ATTRIBUTE void addTouchListener() {}
CC_DEPRECATED_ATTRIBUTE int executeScriptTouchHandler(EventTouch::EventCode eventType, Touch* touch, Event* event);
CC_DEPRECATED_ATTRIBUTE int executeScriptTouchesHandler(EventTouch::EventCode eventType, const std::vector<Touch*>& touches, Event* event);

View File

@ -39,6 +39,7 @@ THE SOFTWARE.
#include "base/CCEvent.h"
#include "base/CCEventTouch.h"
#include "base/ccCArray.h"
#include "base/CCCamera.h"
#include "2d/CCGrid.h"
#include "2d/CCActionManager.h"
#include "base/CCScriptSupport.h"
@ -128,6 +129,7 @@ Node::Node(void)
, _usingNormalizedPosition(false)
, _name("")
, _hashOfName(0)
, _cameraMask(1)
{
// set default scheduler and actionManager
Director *director = Director::getInstance();
@ -1223,6 +1225,13 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl
return flags;
}
bool Node::isVisitableByVisitingCamera() const
{
auto camera = Camera::getVisitingCamera();
bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true;
return visibleByCamera;
}
void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
// quick return if not visible. children won't be drawn.
@ -1239,6 +1248,8 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren
Director* director = Director::getInstance();
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
bool visibleByCamera = isVisitableByVisitingCamera();
int i = 0;
@ -1256,12 +1267,13 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren
break;
}
// self draw
this->draw(renderer, _modelViewTransform, flags);
if (visibleByCamera)
this->draw(renderer, _modelViewTransform, flags);
for(auto it=_children.cbegin()+i; it != _children.cend(); ++it)
(*it)->visit(renderer, _modelViewTransform, flags);
}
else
else if (visibleByCamera)
{
this->draw(renderer, _modelViewTransform, flags);
}
@ -1850,6 +1862,14 @@ bool Node::removeComponent(const std::string& name)
return false;
}
bool Node::removeComponent(Component *component)
{
if (_componentContainer) {
return _componentContainer->remove(component);
}
return false;
}
void Node::removeAllComponents()
{
if( _componentContainer )
@ -2159,6 +2179,17 @@ void Node::disableCascadeColor()
}
}
void Node::setCameraMask(unsigned short mask, bool applyChildren)
{
_cameraMask = mask;
if (applyChildren)
{
for (auto child : _children) {
child->setCameraMask(mask, applyChildren);
}
}
}
__NodeRGBA::__NodeRGBA()
{
CCLOG("NodeRGBA deprecated.");

View File

@ -71,7 +71,7 @@ enum {
kNodeOnCleanup
};
bool nodeComparisonLess(Node* n1, Node* n2);
bool CC_DLL nodeComparisonLess(Node* n1, Node* n2);
class EventListener;
@ -1284,12 +1284,12 @@ public:
* Resumes all scheduled selectors, actions and event listeners.
* This method is called internally by onEnter
*/
void resume(void);
virtual void resume(void);
/**
* Pauses all scheduled selectors, actions and event listeners..
* This method is called internally by onExit
*/
void pause(void);
virtual void pause(void);
/**
* Resumes all scheduled selectors, actions and event listeners.
@ -1433,6 +1433,10 @@ public:
*/
virtual bool removeComponent(const std::string& name);
/**
* removes a component by its pointer
*/
virtual bool removeComponent(Component *component);
/**
* removes all components
*/
@ -1479,7 +1483,11 @@ public:
void setonEnterTransitionDidFinishCallback(const std::function<void()>& callback) { _onEnterTransitionDidFinishCallback = callback; }
const std::function<void()>& getonEnterTransitionDidFinishCallback() const { return _onEnterTransitionDidFinishCallback; }
void setonExitTransitionDidStartCallback(const std::function<void()>& callback) { _onExitTransitionDidStartCallback = callback; }
const std::function<void()>& getonExitTransitionDidStartCallback() const { return _onExitTransitionDidStartCallback; }
const std::function<void()>& getonExitTransitionDidStartCallback() const { return _onExitTransitionDidStartCallback; }
/** get & set camera mask, the node is visible by the camera whose camera flag & node's camera mask is true */
unsigned short getCameraMask() const { return _cameraMask; }
void setCameraMask(unsigned short mask, bool applyChildren = true);
CC_CONSTRUCTOR_ACCESS:
// Nodes should be created using create();
@ -1513,6 +1521,9 @@ protected:
bool doEnumerate(std::string name, std::function<bool (Node *)> callback) const;
bool doEnumerateRecursive(const Node* node, const std::string &name, std::function<bool (Node *)> callback) const;
//check whether this camera mask is visible by the current visiting camera
bool isVisitableByVisitingCamera() const;
#if CC_USE_PHYSICS
void updatePhysicsBodyTransform(Scene* layer);
virtual void updatePhysicsBodyPosition(Scene* layer);
@ -1619,6 +1630,9 @@ protected:
static int s_globalOrderOfArrival;
// camera mask, it is visible only when _cameraMask & current camera' camera flag is true
unsigned short _cameraMask;
std::function<void()> _onEnterCallback;
std::function<void()> _onExitCallback;
std::function<void()> _onEnterTransitionDidFinishCallback;

View File

@ -126,6 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p
}
int i = 0;
bool visibleByCamera = isVisitableByVisitingCamera();
if(!_children.empty())
{
@ -141,13 +142,14 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p
break;
}
// self draw,currently we have nothing to draw on NodeGrid, so there is no need to add render command
this->draw(renderer, _modelViewTransform, dirty);
if (visibleByCamera)
this->draw(renderer, _modelViewTransform, dirty);
for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) {
(*it)->visit(renderer, _modelViewTransform, dirty);
}
}
else
else if (visibleByCamera)
{
this->draw(renderer, _modelViewTransform, dirty);
}

View File

@ -33,7 +33,7 @@ NS_CC_BEGIN
class GridBase;
class NodeGrid : public Node
class CC_DLL NodeGrid : public Node
{
public:
static NodeGrid* create();

View File

@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u
// The alternative is to have a void Sprite#visit, but
// although this is less maintainable, is faster
//
if (!_visible)
if (!_visible || !isVisitableByVisitingCamera())
{
return;
}

View File

@ -771,7 +771,12 @@ void ParticleSystem::update(float dt)
Vec2 newPos;
if (_positionType == PositionType::FREE || _positionType == PositionType::RELATIVE)
if (_positionType == PositionType::FREE)
{
Vec2 diff = convertToNodeSpace(currentPosition) - convertToNodeSpace(p-> startPos);
newPos = p->pos - diff;
}
else if(_positionType == PositionType::RELATIVE)
{
Vec2 diff = currentPosition - p->startPos;
newPos = p->pos - diff;

View File

@ -449,6 +449,10 @@ void ParticleSystemQuad::setTotalParticles(int tp)
_totalParticles = tp;
}
// fixed issue #5762
// reset the emission rate
setEmissionRate(_totalParticles / _life);
resetSystem();
}

View File

@ -318,7 +318,8 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3
//
// draw self
//
this->draw(renderer, _modelViewTransform, flags);
if (isVisitableByVisitingCamera())
this->draw(renderer, _modelViewTransform, flags);
//
// draw children and protectedChildren zOrder >= 0
@ -381,9 +382,10 @@ void ProtectedNode::updateDisplayedOpacity(GLubyte parentOpacity)
for(auto child : _children){
child->updateDisplayedOpacity(_displayedOpacity);
}
for(auto child : _protectedChildren){
child->updateDisplayedOpacity(_displayedOpacity);
}
}
for(auto child : _protectedChildren){
child->updateDisplayedOpacity(_displayedOpacity);
}
}
@ -399,9 +401,9 @@ void ProtectedNode::updateDisplayedColor(const Color3B& parentColor)
for(const auto &child : _children){
child->updateDisplayedColor(_displayedColor);
}
for(const auto &child : _protectedChildren){
child->updateDisplayedColor(_displayedColor);
}
}
for(const auto &child : _protectedChildren){
child->updateDisplayedColor(_displayedColor);
}
}

View File

@ -33,8 +33,8 @@
#include "2d/CCNode.h"
NS_CC_BEGIN
class CC_DLL ProtectedNode : public Node
class CC_DLL ProtectedNode : public Node
{
public:
static ProtectedNode * create(void);

View File

@ -67,6 +67,7 @@ RenderTexture::RenderTexture()
, _rtTextureRect(Rect::ZERO)
, _fullRect(Rect::ZERO)
, _fullviewPort(Rect::ZERO)
, _saveFileCallback(nullptr)
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
// Listen this event to save render texture before come to background.
@ -393,7 +394,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3
{
// override visit.
// Don't call visit on its children
if (!_visible)
if (!_visible || !isVisitableByVisitingCamera())
{
return;
}
@ -415,33 +416,36 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3
_orderOfArrival = 0;
}
bool RenderTexture::saveToFile(const std::string& filename, bool isRGBA)
bool RenderTexture::saveToFile(const std::string& filename, bool isRGBA, std::function<void (RenderTexture*, const std::string&)> callback)
{
std::string basename(filename);
std::transform(basename.begin(), basename.end(), basename.begin(), ::tolower);
if (basename.find(".png") != std::string::npos)
{
return saveToFile(filename, Image::Format::PNG, isRGBA);
return saveToFile(filename, Image::Format::PNG, isRGBA, callback);
}
else if (basename.find(".jpg") != std::string::npos)
{
if (isRGBA) CCLOG("RGBA is not supported for JPG format.");
return saveToFile(filename, Image::Format::JPG, false);
return saveToFile(filename, Image::Format::JPG, false, callback);
}
else
{
CCLOG("Only PNG and JPG format are supported now!");
}
return saveToFile(filename, Image::Format::JPG, false);
return saveToFile(filename, Image::Format::JPG, false, callback);
}
bool RenderTexture::saveToFile(const std::string& fileName, Image::Format format, bool isRGBA)
bool RenderTexture::saveToFile(const std::string& fileName, Image::Format format, bool isRGBA, std::function<void (RenderTexture*, const std::string&)> callback)
{
CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG,
"the image can only be saved as JPG or PNG format");
if (isRGBA && format == Image::Format::JPG) CCLOG("RGBA is not supported for JPG format");
_saveFileCallback = callback;
std::string fullpath = FileUtils::getInstance()->getWritablePath() + fileName;
_saveToFileCommand.init(_globalZOrder);
_saveToFileCommand.func = CC_CALLBACK_0(RenderTexture::onSaveToFile, this, fullpath, isRGBA);
@ -457,7 +461,10 @@ void RenderTexture::onSaveToFile(const std::string& filename, bool isRGBA)
{
image->saveToFile(filename.c_str(), !isRGBA);
}
if(_saveFileCallback)
{
_saveFileCallback(this, filename);
}
CC_SAFE_DELETE(image);
}
@ -555,7 +562,7 @@ void RenderTexture::onBegin()
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
modifiedProjection = GLViewImpl::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION,modifiedProjection);
#endif
@ -574,7 +581,7 @@ void RenderTexture::onBegin()
{
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
modifiedProjection = GLViewImpl::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, modifiedProjection);
#endif
}

View File

@ -103,12 +103,12 @@ public:
/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
Returns true if the operation is successful.
*/
bool saveToFile(const std::string& filename, bool isRGBA = true);
bool saveToFile(const std::string& filename, bool isRGBA = true, std::function<void (RenderTexture*, const std::string&)> callback = nullptr);
/** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.
Returns true if the operation is successful.
*/
bool saveToFile(const std::string& filename, Image::Format format, bool isRGBA = true);
bool saveToFile(const std::string& filename, Image::Format format, bool isRGBA = true, std::function<void (RenderTexture*, const std::string&)> callback = nullptr);
/** Listen "come to background" message, and save render texture.
It only has effect on Android.
@ -213,7 +213,12 @@ protected:
CustomCommand _clearCommand;
CustomCommand _beginCommand;
CustomCommand _endCommand;
/*this command is used to encapsulate saveToFile,
call saveToFile twice will overwrite this command and callback
and the command and callback will be executed twice.
*/
CustomCommand _saveToFileCommand;
std::function<void (RenderTexture*, const std::string&)> _saveFileCallback;
protected:
//renderer caches and callbacks
void onBegin();

View File

@ -27,6 +27,9 @@ THE SOFTWARE.
#include "2d/CCScene.h"
#include "base/CCDirector.h"
#include "base/CCCamera.h"
#include "base/CCEventDispatcher.h"
#include "base/CCEventListenerCustom.h"
#include "2d/CCLayer.h"
#include "2d/CCSprite.h"
#include "2d/CCSpriteBatchNode.h"
@ -42,6 +45,13 @@ Scene::Scene()
{
_ignoreAnchorPointForPosition = true;
setAnchorPoint(Vec2(0.5f, 0.5f));
//create default camera
_defaultCamera = Camera::create();
addChild(_defaultCamera);
_event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_PROJECTION_CHANGED, std::bind(&Scene::onProjectionChanged, this, std::placeholders::_1));
_event->retain();
}
Scene::~Scene()
@ -49,6 +59,8 @@ Scene::~Scene()
#if CC_USE_PHYSICS
CC_SAFE_DELETE(_physicsWorld);
#endif
Director::getInstance()->getEventDispatcher()->removeEventListener(_event);
CC_SAFE_RELEASE(_event);
}
bool Scene::init()
@ -120,7 +132,7 @@ void Scene::addChild(Node* child, int zOrder, const std::string &name)
void Scene::update(float delta)
{
Node::update(delta);
if (nullptr != _physicsWorld)
if (nullptr != _physicsWorld && _physicsWorld->isAutoStep())
{
_physicsWorld->update(delta);
}
@ -148,6 +160,7 @@ bool Scene::initWithPhysics()
{
Director * director;
CC_BREAK_IF( ! (director = Director::getInstance()) );
this->setContentSize(director->getWinSize());
CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this)));
@ -179,6 +192,15 @@ void Scene::addChildToPhysicsWorld(Node* child)
addToPhysicsWorldFunc(child);
}
}
void Scene::onProjectionChanged(EventCustom* event)
{
if (_defaultCamera)
{
_defaultCamera->initDefault();
}
}
#endif
NS_CC_END

View File

@ -34,6 +34,7 @@ THE SOFTWARE.
NS_CC_BEGIN
class Camera;
/**
* @addtogroup scene
* @{
@ -64,17 +65,28 @@ public:
using Node::addChild;
virtual std::string getDescription() const override;
/** get all cameras */
const std::vector<Camera*>& getCameras() const { return _cameras; }
CC_CONSTRUCTOR_ACCESS:
Scene();
virtual ~Scene();
bool init();
bool initWithSize(const Size& size);
void onProjectionChanged(EventCustom* event);
protected:
friend class Node;
friend class ProtectedNode;
friend class SpriteBatchNode;
friend class Camera;
friend class Director;
std::vector<Camera*> _cameras; //weak ref to Camera
Camera* _defaultCamera; //weak ref, default camera created by scene, _cameras[0], Caution that the default camera can not be added to _cameras before onEnter is called
EventListenerCustom* _event;
private:
CC_DISALLOW_COPY_AND_ASSIGN(Scene);

View File

@ -85,7 +85,7 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity)
CCASSERT(capacity>=0, "Capacity must be >= 0");
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
if(tex->hasPremultipliedAlpha())
if(!tex->hasPremultipliedAlpha())
{
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
}
@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin
// The alternative is to have a void Sprite#visit, but
// although this is less maintainable, is faster
//
if (! _visible)
if (! _visible || !isVisitableByVisitingCamera())
{
return;
}

View File

@ -210,6 +210,12 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture
_loadedFileNames->insert(plist);
}
void SpriteFrameCache::addSpriteFramesWithFileContent(const std::string& plist_content, Texture2D *texture)
{
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.c_str(), plist_content.size());
addSpriteFramesWithDictionary(dict, texture);
}
void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName)
{
CCASSERT(textureFileName.size()>0, "texture name should not be null");
@ -357,6 +363,17 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const std::string& plist)
}
}
void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plist_content)
{
ValueMap dict = FileUtils::getInstance()->getValueMapFromData(plist_content.data(), plist_content.size());
if (dict.empty())
{
CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFileContent: create dict by fail.");
return;
}
removeSpriteFramesFromDictionary(dict);
}
void SpriteFrameCache::removeSpriteFramesFromDictionary(ValueMap& dictionary)
{
ValueMap framesDict = dictionary["frames"].asValueMap();

View File

@ -106,6 +106,12 @@ public:
*/
void addSpriteFramesWithFile(const std::string&plist, Texture2D *texture);
/** Adds multiple Sprite Frames from a plist file content. The texture will be associated with the created sprite frames.
* @js addSpriteFrames
* @lua addSpriteFrames
*/
void addSpriteFramesWithFileContent(const std::string& plist_content, Texture2D *texture);
/** Adds an sprite frame with a given name.
If the name already exists, then the contents of the old name will be replaced with the new one.
*/
@ -135,6 +141,12 @@ public:
*/
void removeSpriteFramesFromFile(const std::string& plist);
/** Removes multiple Sprite Frames from a plist file content.
* Sprite Frames stored in this file will be removed.
* It is convenient to call this method when a specific texture needs to be removed.
*/
void removeSpriteFramesFromFileContent(const std::string& plist_content);
/** Removes all Sprite Frames associated with the specified textures.
* It is convenient to call this method when a specific texture needs to be removed.
* @since v0.995.

View File

@ -26,7 +26,6 @@ THE SOFTWARE.
#include "CCTextFieldTTF.h"
#include "base/CCDirector.h"
#include "CCGLView.h"
NS_CC_BEGIN
@ -140,7 +139,7 @@ bool TextFieldTTF::attachWithIME()
if (ret)
{
// open keyboard
GLView * pGlView = Director::getInstance()->getOpenGLView();
auto pGlView = Director::getInstance()->getOpenGLView();
if (pGlView)
{
pGlView->setIMEKeyboardState(true);
@ -155,7 +154,7 @@ bool TextFieldTTF::detachWithIME()
if (ret)
{
// close keyboard
GLView * glView = Director::getInstance()->getOpenGLView();
auto glView = Director::getInstance()->getOpenGLView();
if (glView)
{
glView->setIMEKeyboardState(false);
@ -260,7 +259,9 @@ const std::string& TextFieldTTF::getContentText()
void TextFieldTTF::setTextColor(const Color4B &color)
{
_colorText = color;
Label::setTextColor(_colorText);
if (_inputText.length() > 0) {
Label::setTextColor(_colorText);
}
}
void TextFieldTTF::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
@ -283,11 +284,18 @@ void TextFieldTTF::setColorSpaceHolder(const Color3B& color)
_colorSpaceHolder.g = color.g;
_colorSpaceHolder.b = color.b;
_colorSpaceHolder.a = 255;
if (0 == _inputText.length())
{
Label::setTextColor(_colorSpaceHolder);
}
}
void TextFieldTTF::setColorSpaceHolder(const Color4B& color)
{
_colorSpaceHolder = color;
if (0 == _inputText.length()) {
Label::setTextColor(_colorSpaceHolder);
}
}
//////////////////////////////////////////////////////////////////////////
@ -322,7 +330,7 @@ void TextFieldTTF::setString(const std::string &text)
}
// if there is no input text, display placeholder instead
if (! _inputText.length())
if (0 == _inputText.length())
{
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
@ -344,7 +352,7 @@ const std::string& TextFieldTTF::getString() const
void TextFieldTTF::setPlaceHolder(const std::string& text)
{
_placeHolder = text;
if (! _inputText.length())
if (0 == _inputText.length())
{
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);

View File

@ -84,63 +84,63 @@ namespace tweenfunc {
//tween functions for CCActionEase
float easeIn(float time, float rate);
float easeOut(float time, float rate);
float easeInOut(float time, float rate);
float CC_DLL easeIn(float time, float rate);
float CC_DLL easeOut(float time, float rate);
float CC_DLL easeInOut(float time, float rate);
float bezieratFunction( float a, float b, float c, float d, float t );
float CC_DLL bezieratFunction( float a, float b, float c, float d, float t );
float quadraticIn(float time);
float quadraticOut(float time);
float quadraticInOut(float time);
float CC_DLL quadraticIn(float time);
float CC_DLL quadraticOut(float time);
float CC_DLL quadraticInOut(float time);
float tweenTo(float time, TweenType type, float *easingParam);
float CC_DLL tweenTo(float time, TweenType type, float *easingParam);
float linear(float time);
float CC_DLL linear(float time);
float sineEaseIn(float time);
float sineEaseOut(float time);
float sineEaseInOut(float time);
float CC_DLL sineEaseIn(float time);
float CC_DLL sineEaseOut(float time);
float CC_DLL sineEaseInOut(float time);
float quadEaseIn(float time);
float quadEaseOut(float time);
float quadEaseInOut(float time);
float CC_DLL quadEaseIn(float time);
float CC_DLL quadEaseOut(float time);
float CC_DLL quadEaseInOut(float time);
float cubicEaseIn(float time);
float cubicEaseOut(float time);
float cubicEaseInOut(float time);
float CC_DLL cubicEaseIn(float time);
float CC_DLL cubicEaseOut(float time);
float CC_DLL cubicEaseInOut(float time);
float quartEaseIn(float time);
float quartEaseOut(float time);
float quartEaseInOut(float time);
float CC_DLL quartEaseIn(float time);
float CC_DLL quartEaseOut(float time);
float CC_DLL quartEaseInOut(float time);
float quintEaseIn(float time);
float quintEaseOut(float time);
float quintEaseInOut(float time);
float CC_DLL quintEaseIn(float time);
float CC_DLL quintEaseOut(float time);
float CC_DLL quintEaseInOut(float time);
float expoEaseIn(float time);
float expoEaseOut(float time);
float expoEaseInOut(float time);
float CC_DLL expoEaseIn(float time);
float CC_DLL expoEaseOut(float time);
float CC_DLL expoEaseInOut(float time);
float circEaseIn(float time);
float circEaseOut(float time);
float circEaseInOut(float time);
float CC_DLL circEaseIn(float time);
float CC_DLL circEaseOut(float time);
float CC_DLL circEaseInOut(float time);
float elasticEaseIn(float time, float period);
float elasticEaseOut(float time, float period);
float elasticEaseInOut(float time, float period);
float CC_DLL elasticEaseIn(float time, float period);
float CC_DLL elasticEaseOut(float time, float period);
float CC_DLL elasticEaseInOut(float time, float period);
float backEaseIn(float time);
float backEaseOut(float time);
float backEaseInOut(float time);
float CC_DLL backEaseIn(float time);
float CC_DLL backEaseOut(float time);
float CC_DLL backEaseInOut(float time);
float bounceEaseIn(float time);
float bounceEaseOut(float time);
float bounceEaseInOut(float time);
float CC_DLL bounceEaseIn(float time);
float CC_DLL bounceEaseOut(float time);
float CC_DLL bounceEaseInOut(float time);
float customEase(float time, float *easingParam);
float CC_DLL customEase(float time, float *easingParam);
}
NS_CC_END

View File

@ -1,9 +1,3 @@
if(WIN32)
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
endif()
include_directories(
../external/ConvertUTF
)
@ -58,6 +52,7 @@ set(COCOS_2D_SRC
2d/CCParticleSystem.cpp
2d/CCParticleSystemQuad.cpp
2d/CCProgressTimer.cpp
2d/CCProtectedNode.cpp
2d/CCRenderTexture.cpp
2d/CCScene.cpp
2d/CCSpriteBatchNode.cpp
@ -75,4 +70,3 @@ set(COCOS_2D_SRC
2d/CCTransitionProgress.cpp
2d/CCTweenFunction.cpp
)

3
cocos/2d/cocos2d.def Normal file
View File

@ -0,0 +1,3 @@
LIBRARY
EXPORTS
XXH32

View File

@ -315,6 +315,7 @@
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\base64.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCCamera.cpp" />
<ClCompile Include="..\base\ccCArray.cpp" />
<ClCompile Include="..\base\CCConfiguration.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
@ -345,6 +346,7 @@
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCModuleManager.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\CCRef.cpp" />
@ -357,6 +359,7 @@
<ClCompile Include="..\base\ccUtils.cpp" />
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\pvr.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\base\TGAlib.cpp" />
<ClCompile Include="..\base\ZipUtils.cpp" />
@ -388,7 +391,7 @@
<ClCompile Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.cpp" />
<ClCompile Include="..\platform\CCFileUtils.cpp" />
<ClCompile Include="..\platform\CCGLViewProtocol.cpp" />
<ClCompile Include="..\platform\CCGLView.cpp" />
<ClCompile Include="..\platform\CCImage.cpp" />
<ClCompile Include="..\platform\CCSAXParser.cpp" />
<ClCompile Include="..\platform\CCThread.cpp" />
@ -397,7 +400,7 @@
<ClCompile Include="..\platform\winrt\CCDevice.cpp" />
<ClCompile Include="..\platform\winrt\CCFileUtilsWinRT.cpp" />
<ClCompile Include="..\platform\winrt\CCFreeTypeFont.cpp" />
<ClCompile Include="..\platform\winrt\CCGLView.cpp" />
<ClCompile Include="..\platform\winrt\CCGLViewImpl.cpp" />
<ClCompile Include="..\platform\winrt\CCPrecompiledShaders.cpp" />
<ClCompile Include="..\platform\winrt\CCPThreadWinRT.cpp" />
<ClCompile Include="..\platform\winrt\CCStdC.cpp" />
@ -422,6 +425,8 @@
<ClCompile Include="..\renderer\ccGLStateCache.cpp" />
<ClCompile Include="..\renderer\CCGroupCommand.cpp" />
<ClCompile Include="..\renderer\CCMeshCommand.cpp" />
<ClCompile Include="..\renderer\CCPrimitive.cpp" />
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp" />
<ClCompile Include="..\renderer\CCQuadCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderer.cpp" />
@ -429,6 +434,8 @@
<ClCompile Include="..\renderer\CCTexture2D.cpp" />
<ClCompile Include="..\renderer\CCTextureAtlas.cpp" />
<ClCompile Include="..\renderer\CCTextureCache.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexData.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
<ClCompile Include="CCActionCatmullRom.cpp" />
@ -506,6 +513,7 @@
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\base64.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCCamera.h" />
<ClInclude Include="..\base\ccCArray.h" />
<ClInclude Include="..\base\ccConfig.h" />
<ClInclude Include="..\base\CCConfiguration.h" />
@ -534,6 +542,7 @@
<ClInclude Include="..\base\CCIMEDispatcher.h" />
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCModuleManager.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
@ -552,6 +561,7 @@
<ClInclude Include="..\base\CCVector.h" />
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\firePngData.h" />
<ClInclude Include="..\base\pvr.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\base\TGAlib.h" />
<ClInclude Include="..\base\uthash.h" />
@ -595,7 +605,7 @@
<ClInclude Include="..\platform\CCCommon.h" />
<ClInclude Include="..\platform\CCDevice.h" />
<ClInclude Include="..\platform\CCFileUtils.h" />
<ClInclude Include="..\platform\CCGLViewProtocol.h" />
<ClInclude Include="..\platform\CCGLView.h" />
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />
<ClInclude Include="..\platform\CCThread.h" />
@ -603,7 +613,7 @@
<ClInclude Include="..\platform\winrt\CCFileUtilsWinRT.h" />
<ClInclude Include="..\platform\winrt\CCFreeTypeFont.h" />
<ClInclude Include="..\platform\winrt\CCGL.h" />
<ClInclude Include="..\platform\winrt\CCGLView.h" />
<ClInclude Include="..\platform\winrt\CCGLViewImpl.h" />
<ClInclude Include="..\platform\winrt\CCGL_Angle.h" />
<ClInclude Include="..\platform\winrt\CCPlatformDefine.h" />
<ClInclude Include="..\platform\winrt\CCPrecompiledShaders.h" />
@ -625,6 +635,8 @@
<ClInclude Include="..\renderer\ccGLStateCache.h" />
<ClInclude Include="..\renderer\CCGroupCommand.h" />
<ClInclude Include="..\renderer\CCMeshCommand.h" />
<ClInclude Include="..\renderer\CCPrimitive.h" />
<ClInclude Include="..\renderer\CCPrimitiveCommand.h" />
<ClInclude Include="..\renderer\CCQuadCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommandPool.h" />
@ -633,6 +645,8 @@
<ClInclude Include="..\renderer\CCTexture2D.h" />
<ClInclude Include="..\renderer\CCTextureAtlas.h" />
<ClInclude Include="..\renderer\CCTextureCache.h" />
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h" />
<ClInclude Include="..\renderer\CCVertexIndexData.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />
<ClInclude Include="CCActionCatmullRom.h" />

View File

@ -71,9 +71,6 @@
<ClCompile Include="..\platform\winrt\CCFreeTypeFont.cpp">
<Filter>platform\winrt</Filter>
</ClCompile>
<ClCompile Include="..\platform\winrt\CCGLView.cpp">
<Filter>platform\winrt</Filter>
</ClCompile>
<ClCompile Include="..\platform\winrt\CCPrecompiledShaders.cpp">
<Filter>platform\winrt</Filter>
</ClCompile>
@ -98,9 +95,6 @@
<ClCompile Include="..\platform\CCFileUtils.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLViewProtocol.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCImage.cpp">
<Filter>platform</Filter>
</ClCompile>
@ -410,9 +404,6 @@
<ClCompile Include="..\base\CCUserDefault.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCUserDefaultAndroid.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccUTF8.cpp">
<Filter>base</Filter>
</ClCompile>
@ -581,6 +572,33 @@
<ClCompile Include="..\physics\CCPhysicsWorld.cpp">
<Filter>physics</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLView.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\winrt\CCGLViewImpl.cpp">
<Filter>platform\winrt</Filter>
</ClCompile>
<ClCompile Include="..\base\pvr.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCCamera.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCModuleManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitive.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexData.cpp">
<Filter>renderer</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cocos2d.h" />
@ -600,9 +618,6 @@
<ClInclude Include="..\platform\winrt\CCGL_Angle.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="..\platform\winrt\CCGLView.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="..\platform\winrt\CCPlatformDefine.h">
<Filter>platform\winrt</Filter>
</ClInclude>
@ -645,9 +660,6 @@
<ClInclude Include="..\platform\CCFileUtils.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLViewProtocol.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCImage.h">
<Filter>platform</Filter>
</ClInclude>
@ -1185,6 +1197,33 @@
<ClInclude Include="..\physics\CCPhysicsWorld.h">
<Filter>physics</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLView.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\winrt\CCGLViewImpl.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="..\base\pvr.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCCamera.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCModuleManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitiveCommand.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitive.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexData.h">
<Filter>renderer</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\base\CCUserDefault.mm">

View File

@ -222,18 +222,26 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\3d\CCAABB.cpp" />
<ClCompile Include="..\3d\CCAnimate3D.cpp" />
<ClCompile Include="..\3d\CCAnimation3D.cpp" />
<ClCompile Include="..\3d\CCAttachNode.cpp" />
<ClCompile Include="..\3d\CCBundle3D.cpp" />
<ClCompile Include="..\3d\CCBundleReader.cpp" />
<ClCompile Include="..\3d\CCMesh.cpp" />
<ClCompile Include="..\3d\CCMeshSkin.cpp" />
<ClCompile Include="..\3d\CCOBB.cpp" />
<ClCompile Include="..\3d\CCObjLoader.cpp" />
<ClCompile Include="..\3d\CCRay.cpp" />
<ClCompile Include="..\3d\CCSkeleton3D.cpp" />
<ClCompile Include="..\3d\CCSprite3D.cpp" />
<ClCompile Include="..\3d\CCSprite3DMaterial.cpp" />
<ClCompile Include="..\3d\CCSubMesh.cpp" />
<ClCompile Include="..\3d\CCSubMeshState.cpp" />
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\base64.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCCamera.cpp" />
<ClCompile Include="..\base\ccCArray.cpp" />
<ClCompile Include="..\base\CCConfiguration.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
@ -272,8 +280,10 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCModuleManager.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\ccRandom.cpp" />
<ClCompile Include="..\base\CCRef.cpp" />
<ClCompile Include="..\base\CCScheduler.cpp" />
<ClCompile Include="..\base\CCScriptSupport.cpp" />
@ -285,6 +295,7 @@
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\ObjectFactory.cpp" />
<ClCompile Include="..\base\pvr.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\base\TGAlib.cpp" />
<ClCompile Include="..\base\ZipUtils.cpp" />
@ -316,7 +327,7 @@
<ClCompile Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.cpp" />
<ClCompile Include="..\platform\CCFileUtils.cpp" />
<ClCompile Include="..\platform\CCGLViewProtocol.cpp" />
<ClCompile Include="..\platform\CCGLView.cpp" />
<ClCompile Include="..\platform\CCImage.cpp" />
<ClCompile Include="..\platform\CCSAXParser.cpp" />
<ClCompile Include="..\platform\CCThread.cpp" />
@ -332,7 +343,7 @@
<ClCompile Include="..\platform\winrt\inet_ntop_winrt.cpp" />
<ClCompile Include="..\platform\winrt\InputEvent.cpp" />
<ClCompile Include="..\platform\winrt\sha1.cpp" />
<ClCompile Include="..\platform\wp8\CCGLView.cpp" />
<ClCompile Include="..\platform\wp8\CCGLViewImpl.cpp" />
<ClCompile Include="..\platform\wp8\Direct3DBase.cpp" />
<ClCompile Include="..\platform\wp8\DirectXBase.cpp" />
<ClCompile Include="..\platform\wp8\pch.cpp">
@ -350,6 +361,8 @@
<ClCompile Include="..\renderer\ccGLStateCache.cpp" />
<ClCompile Include="..\renderer\CCGroupCommand.cpp" />
<ClCompile Include="..\renderer\CCMeshCommand.cpp" />
<ClCompile Include="..\renderer\CCPrimitive.cpp" />
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp" />
<ClCompile Include="..\renderer\CCQuadCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderer.cpp" />
@ -357,6 +370,8 @@
<ClCompile Include="..\renderer\CCTexture2D.cpp" />
<ClCompile Include="..\renderer\CCTextureAtlas.cpp" />
<ClCompile Include="..\renderer\CCTextureCache.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexData.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
<ClCompile Include="CCActionCatmullRom.cpp" />
@ -406,6 +421,7 @@
<ClCompile Include="CCParticleSystem.cpp" />
<ClCompile Include="CCParticleSystemQuad.cpp" />
<ClCompile Include="CCProgressTimer.cpp" />
<ClCompile Include="CCProtectedNode.cpp" />
<ClCompile Include="CCRenderTexture.cpp" />
<ClCompile Include="CCScene.cpp" />
<ClCompile Include="CCSprite.cpp" />
@ -430,20 +446,28 @@
<ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\..\external\xxhash\xxhash.h" />
<ClInclude Include="..\3d\CCAABB.h" />
<ClInclude Include="..\3d\CCAnimate3D.h" />
<ClInclude Include="..\3d\CCAnimation3D.h" />
<ClInclude Include="..\3d\CCAnimationCurve.h" />
<ClInclude Include="..\3d\CCAttachNode.h" />
<ClInclude Include="..\3d\CCBundle3D.h" />
<ClInclude Include="..\3d\CCBundle3DData.h" />
<ClInclude Include="..\3d\CCBundleReader.h" />
<ClInclude Include="..\3d\CCMesh.h" />
<ClInclude Include="..\3d\CCMeshSkin.h" />
<ClInclude Include="..\3d\CCOBB.h" />
<ClInclude Include="..\3d\CCObjLoader.h" />
<ClInclude Include="..\3d\CCRay.h" />
<ClInclude Include="..\3d\CCSkeleton3D.h" />
<ClInclude Include="..\3d\CCSprite3D.h" />
<ClInclude Include="..\3d\CCSprite3DMaterial.h" />
<ClInclude Include="..\3d\CCSubMesh.h" />
<ClInclude Include="..\3d\CCSubMeshState.h" />
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\base64.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCCamera.h" />
<ClInclude Include="..\base\ccCArray.h" />
<ClInclude Include="..\base\ccConfig.h" />
<ClInclude Include="..\base\CCConfiguration.h" />
@ -472,11 +496,13 @@
<ClInclude Include="..\base\CCIMEDispatcher.h" />
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCModuleManager.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
<ClInclude Include="..\base\CCProfiling.h" />
<ClInclude Include="..\base\CCProtocols.h" />
<ClInclude Include="..\base\ccRandom.h" />
<ClInclude Include="..\base\CCRef.h" />
<ClInclude Include="..\base\CCRefPtr.h" />
<ClInclude Include="..\base\CCScheduler.h" />
@ -491,6 +517,7 @@
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\firePngData.h" />
<ClInclude Include="..\base\ObjectFactory.h" />
<ClInclude Include="..\base\pvr.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\base\TGAlib.h" />
<ClInclude Include="..\base\uthash.h" />
@ -533,7 +560,7 @@
<ClInclude Include="..\platform\CCCommon.h" />
<ClInclude Include="..\platform\CCDevice.h" />
<ClInclude Include="..\platform\CCFileUtils.h" />
<ClInclude Include="..\platform\CCGLViewProtocol.h" />
<ClInclude Include="..\platform\CCGLView.h" />
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />
<ClInclude Include="..\platform\CCThread.h" />
@ -552,7 +579,7 @@
<ClInclude Include="..\platform\winrt\InputEvent.h" />
<ClInclude Include="..\platform\winrt\InputEventTypes.h" />
<ClInclude Include="..\platform\winrt\sha1.h" />
<ClInclude Include="..\platform\wp8\CCGLView.h" />
<ClInclude Include="..\platform\wp8\CCGLViewImpl.h" />
<ClInclude Include="..\platform\wp8\Direct3DBase.h" />
<ClInclude Include="..\platform\wp8\DirectXBase.h" />
<ClInclude Include="..\platform\wp8\pch.h" />
@ -565,6 +592,8 @@
<ClInclude Include="..\renderer\ccGLStateCache.h" />
<ClInclude Include="..\renderer\CCGroupCommand.h" />
<ClInclude Include="..\renderer\CCMeshCommand.h" />
<ClInclude Include="..\renderer\CCPrimitive.h" />
<ClInclude Include="..\renderer\CCPrimitiveCommand.h" />
<ClInclude Include="..\renderer\CCQuadCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommandPool.h" />
@ -573,6 +602,8 @@
<ClInclude Include="..\renderer\CCTexture2D.h" />
<ClInclude Include="..\renderer\CCTextureAtlas.h" />
<ClInclude Include="..\renderer\CCTextureCache.h" />
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h" />
<ClInclude Include="..\renderer\CCVertexIndexData.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />
<ClInclude Include="CCActionCatmullRom.h" />
@ -622,6 +653,7 @@
<ClInclude Include="CCParticleSystem.h" />
<ClInclude Include="CCParticleSystemQuad.h" />
<ClInclude Include="CCProgressTimer.h" />
<ClInclude Include="CCProtectedNode.h" />
<ClInclude Include="CCRenderTexture.h" />
<ClInclude Include="CCScene.h" />
<ClInclude Include="CCSprite.h" />

View File

@ -490,9 +490,6 @@
<ClCompile Include="..\base\CCUserDefault.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCUserDefaultAndroid.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccUTF8.cpp">
<Filter>base</Filter>
</ClCompile>
@ -517,9 +514,6 @@
<ClCompile Include="..\platform\CCFileUtils.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLViewProtocol.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCImage.cpp">
<Filter>platform</Filter>
</ClCompile>
@ -529,9 +523,6 @@
<ClCompile Include="..\platform\CCThread.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\wp8\CCGLView.cpp">
<Filter>platform\wp8</Filter>
</ClCompile>
<ClCompile Include="..\platform\wp8\Direct3DBase.cpp">
<Filter>platform\wp8</Filter>
</ClCompile>
@ -617,6 +608,60 @@
<ClCompile Include="CCFastTMXTiledMap.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLView.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\wp8\CCGLViewImpl.cpp">
<Filter>platform\wp8</Filter>
</ClCompile>
<ClCompile Include="CCProtectedNode.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="..\base\pvr.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCSkeleton3D.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCSubMeshState.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCSubMesh.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCAttachNode.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\base\CCCamera.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitive.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexData.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\base\CCModuleManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccRandom.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCAABB.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCOBB.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCRay.cpp">
<Filter>3d</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1141,9 +1186,6 @@
<ClInclude Include="..\platform\CCFileUtils.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLViewProtocol.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCImage.h">
<Filter>platform</Filter>
</ClInclude>
@ -1156,9 +1198,6 @@
<ClInclude Include="..\platform\wp8\DirectXBase.h">
<Filter>platform\wp8</Filter>
</ClInclude>
<ClInclude Include="..\platform\wp8\CCGLView.h">
<Filter>platform\wp8</Filter>
</ClInclude>
<ClInclude Include="..\platform\wp8\Direct3DBase.h">
<Filter>platform\wp8</Filter>
</ClInclude>
@ -1259,6 +1298,60 @@
<ClInclude Include="CCFastTMXTiledMap.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLView.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\wp8\CCGLViewImpl.h">
<Filter>platform\wp8</Filter>
</ClInclude>
<ClInclude Include="CCProtectedNode.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="..\base\pvr.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCSkeleton3D.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCSubMeshState.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCSubMesh.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCAttachNode.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\base\CCCamera.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitiveCommand.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitive.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexData.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\base\CCModuleManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\ccRandom.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCAABB.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCOBB.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCRay.h">
<Filter>3d</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -7,7 +7,7 @@
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\wp8-specific\zlib\include;$(GeneratedFilesDir)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)cocos\platform;$(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\wp8-specific\zlib\include;$(GeneratedFilesDir)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsWinRT>true</CompileAsWinRT>
<MultiProcessorCompilation>true</MultiProcessorCompilation>

View File

@ -18,7 +18,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -27,7 +27,7 @@
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
@ -65,10 +65,10 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
<LibraryPath>../../external/sqlite3/libraries/win32;$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
<LibraryPath>../../external/sqlite3/libraries/win32;$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
@ -78,7 +78,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -103,6 +103,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\websockets\prebuilt\win32\*.*" "$(OutDi
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\zlib\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\icon\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)"
</Command>
</PreLinkEvent>
<Link>
@ -114,6 +115,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ModuleDefinitionFile>cocos2d.def</ModuleDefinitionFile>
<AdditionalDependencies>libchipmunk.lib;sqlite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
@ -127,7 +130,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@ -155,7 +158,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
</Command>
</PreLinkEvent>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libchipmunk.lib;sqlite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries> ;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -165,6 +168,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ModuleDefinitionFile>cocos2d.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>
@ -179,18 +183,10 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\..\external\xxhash\xxhash.c" />
<ClCompile Include="..\3d\CCAnimate3D.cpp" />
<ClCompile Include="..\3d\CCAnimation3D.cpp" />
<ClCompile Include="..\3d\CCBundle3D.cpp" />
<ClCompile Include="..\3d\CCBundleReader.cpp" />
<ClCompile Include="..\3d\CCMesh.cpp" />
<ClCompile Include="..\3d\CCMeshSkin.cpp" />
<ClCompile Include="..\3d\CCObjLoader.cpp" />
<ClCompile Include="..\3d\CCSprite3D.cpp" />
<ClCompile Include="..\3d\CCSprite3DMaterial.cpp" />
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\base64.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCCamera.cpp" />
<ClCompile Include="..\base\ccCArray.cpp" />
<ClCompile Include="..\base\CCConfiguration.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
@ -214,8 +210,10 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\base\CCEventTouch.cpp" />
<ClCompile Include="..\base\ccFPSImages.c" />
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCModuleManager.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\ccRandom.cpp" />
<ClCompile Include="..\base\CCRef.cpp" />
<ClCompile Include="..\base\CCScheduler.cpp" />
<ClCompile Include="..\base\CCScriptSupport.cpp" />
@ -226,6 +224,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\base\ccUtils.cpp" />
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\pvr.cpp" />
<ClCompile Include="..\base\ObjectFactory.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\base\TGAlib.cpp" />
@ -258,11 +257,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.cpp" />
<ClCompile Include="..\platform\CCFileUtils.cpp" />
<ClCompile Include="..\platform\CCGLViewProtocol.cpp" />
<ClCompile Include="..\platform\CCGLView.cpp" />
<ClCompile Include="..\platform\CCImage.cpp" />
<ClCompile Include="..\platform\CCSAXParser.cpp" />
<ClCompile Include="..\platform\CCThread.cpp" />
<ClCompile Include="..\platform\desktop\CCGLView.cpp" />
<ClCompile Include="..\platform\desktop\CCGLViewImpl.cpp" />
<ClCompile Include="..\platform\win32\CCApplication.cpp" />
<ClCompile Include="..\platform\win32\CCCommon.cpp" />
<ClCompile Include="..\platform\win32\CCDevice.cpp" />
@ -277,6 +276,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\renderer\ccGLStateCache.cpp" />
<ClCompile Include="..\renderer\CCGroupCommand.cpp" />
<ClCompile Include="..\renderer\CCMeshCommand.cpp" />
<ClCompile Include="..\renderer\CCPrimitive.cpp" />
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp" />
<ClCompile Include="..\renderer\CCQuadCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderCommand.cpp" />
<ClCompile Include="..\renderer\CCRenderer.cpp" />
@ -284,6 +285,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="..\renderer\CCTexture2D.cpp" />
<ClCompile Include="..\renderer\CCTextureAtlas.cpp" />
<ClCompile Include="..\renderer\CCTextureCache.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp" />
<ClCompile Include="..\renderer\CCVertexIndexData.cpp" />
<ClCompile Include="..\storage\local-storage\LocalStorage.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
<ClCompile Include="CCActionCatmullRom.cpp" />
@ -333,6 +337,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="CCParticleSystem.cpp" />
<ClCompile Include="CCParticleSystemQuad.cpp" />
<ClCompile Include="CCProgressTimer.cpp" />
<ClCompile Include="CCProtectedNode.cpp" />
<ClCompile Include="CCRenderTexture.cpp" />
<ClCompile Include="CCScene.cpp" />
<ClCompile Include="CCSprite.cpp" />
@ -357,20 +362,10 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\..\external\xxhash\xxhash.h" />
<ClInclude Include="..\3d\CCAnimate3D.h" />
<ClInclude Include="..\3d\CCAnimation3D.h" />
<ClInclude Include="..\3d\CCAnimationCurve.h" />
<ClInclude Include="..\3d\CCBundle3D.h" />
<ClInclude Include="..\3d\CCBundle3DData.h" />
<ClInclude Include="..\3d\CCBundleReader.h" />
<ClInclude Include="..\3d\CCMesh.h" />
<ClInclude Include="..\3d\CCMeshSkin.h" />
<ClInclude Include="..\3d\CCObjLoader.h" />
<ClInclude Include="..\3d\CCSprite3D.h" />
<ClInclude Include="..\3d\CCSprite3DMaterial.h" />
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\base64.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCCamera.h" />
<ClInclude Include="..\base\ccCArray.h" />
<ClInclude Include="..\base\ccConfig.h" />
<ClInclude Include="..\base\CCConfiguration.h" />
@ -399,11 +394,13 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\base\CCIMEDispatcher.h" />
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCModuleManager.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
<ClInclude Include="..\base\CCProfiling.h" />
<ClInclude Include="..\base\CCProtocols.h" />
<ClInclude Include="..\base\ccRandom.h" />
<ClInclude Include="..\base\CCRef.h" />
<ClInclude Include="..\base\CCRefPtr.h" />
<ClInclude Include="..\base\CCScheduler.h" />
@ -418,6 +415,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\firePngData.h" />
<ClInclude Include="..\base\ObjectFactory.h" />
<ClInclude Include="..\base\pvr.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\base\TGAlib.h" />
<ClInclude Include="..\base\uthash.h" />
@ -461,11 +459,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\platform\CCCommon.h" />
<ClInclude Include="..\platform\CCDevice.h" />
<ClInclude Include="..\platform\CCFileUtils.h" />
<ClInclude Include="..\platform\CCGLViewProtocol.h" />
<ClInclude Include="..\platform\CCGLView.h" />
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />
<ClInclude Include="..\platform\CCThread.h" />
<ClInclude Include="..\platform\desktop\CCGLView.h" />
<ClInclude Include="..\platform\desktop\CCGLViewImpl.h" />
<ClInclude Include="..\platform\win32\CCApplication.h" />
<ClInclude Include="..\platform\win32\CCFileUtilsWin32.h" />
<ClInclude Include="..\platform\win32\CCGL.h" />
@ -481,6 +479,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\renderer\ccGLStateCache.h" />
<ClInclude Include="..\renderer\CCGroupCommand.h" />
<ClInclude Include="..\renderer\CCMeshCommand.h" />
<ClInclude Include="..\renderer\CCPrimitive.h" />
<ClInclude Include="..\renderer\CCPrimitiveCommand.h" />
<ClInclude Include="..\renderer\CCQuadCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommand.h" />
<ClInclude Include="..\renderer\CCRenderCommandPool.h" />
@ -489,6 +489,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="..\renderer\CCTexture2D.h" />
<ClInclude Include="..\renderer\CCTextureAtlas.h" />
<ClInclude Include="..\renderer\CCTextureCache.h" />
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h" />
<ClInclude Include="..\renderer\CCVertexIndexData.h" />
<ClInclude Include="..\storage\local-storage\LocalStorage.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />
<ClInclude Include="CCActionCatmullRom.h" />
@ -538,6 +541,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="CCParticleSystem.h" />
<ClInclude Include="CCParticleSystemQuad.h" />
<ClInclude Include="CCProgressTimer.h" />
<ClInclude Include="CCProtectedNode.h" />
<ClInclude Include="CCRenderTexture.h" />
<ClInclude Include="CCScene.h" />
<ClInclude Include="CCSprite.h" />
@ -556,7 +560,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="CCTweenFunction.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\3d\CCAnimationCurve.inl" />
<None Include="..\math\Mat4.inl" />
<None Include="..\math\MathUtil.inl" />
<None Include="..\math\MathUtilNeon.inl" />
@ -564,6 +567,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<None Include="..\math\Vec2.inl" />
<None Include="..\math\Vec3.inl" />
<None Include="..\math\Vec4.inl" />
<None Include="cocos2d.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\chipmunk\proj.win32\chipmunk.vcxproj">
<Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -52,8 +52,8 @@
<Filter Include="external\xxhash">
<UniqueIdentifier>{b4e2b1e5-2d79-44a3-af45-728d47b7bdb2}</UniqueIdentifier>
</Filter>
<Filter Include="3d">
<UniqueIdentifier>{a20c4bdc-bd4c-40c1-a78a-fe31cd3ec76a}</UniqueIdentifier>
<Filter Include="storage">
<UniqueIdentifier>{44bdf58f-4af2-433c-b4af-58dc05ef96b5}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
@ -403,9 +403,6 @@
<ClCompile Include="..\base\CCUserDefault.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCUserDefaultAndroid.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccUTF8.cpp">
<Filter>base</Filter>
</ClCompile>
@ -418,6 +415,9 @@
<ClCompile Include="..\base\etc1.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\pvr.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\base\s3tc.cpp">
<Filter>base</Filter>
</ClCompile>
@ -472,9 +472,6 @@
<ClCompile Include="..\renderer\CCTextureCache.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\platform\desktop\CCGLView.cpp">
<Filter>platform\desktop</Filter>
</ClCompile>
<ClCompile Include="..\platform\win32\CCApplication.cpp">
<Filter>platform\win32</Filter>
</ClCompile>
@ -523,9 +520,6 @@
<ClCompile Include="..\platform\CCFileUtils.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLViewProtocol.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCImage.cpp">
<Filter>platform</Filter>
</ClCompile>
@ -553,42 +547,48 @@
<ClCompile Include="..\renderer\CCMeshCommand.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCMesh.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCObjLoader.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCSprite3D.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\base\ObjectFactory.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCBundle3D.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCAnimate3D.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCMeshSkin.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCAnimation3D.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCSprite3DMaterial.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\3d\CCBundleReader.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="CCFastTMXLayer.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCFastTMXTiledMap.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="..\storage\local-storage\LocalStorage.cpp">
<Filter>storage</Filter>
</ClCompile>
<ClCompile Include="..\platform\desktop\CCGLViewImpl.cpp">
<Filter>platform\desktop</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGLView.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="CCProtectedNode.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="..\base\CCCamera.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitive.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\renderer\CCVertexIndexData.cpp">
<Filter>renderer</Filter>
</ClCompile>
<ClCompile Include="..\base\CCModuleManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\ccRandom.cpp">
<Filter>base</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -988,6 +988,9 @@
<ClInclude Include="..\base\etc1.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\pvr.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\base\firePngData.h">
<Filter>base</Filter>
</ClInclude>
@ -1054,9 +1057,6 @@
<ClInclude Include="..\renderer\CCTextureCache.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\platform\desktop\CCGLView.h">
<Filter>platform\desktop</Filter>
</ClInclude>
<ClInclude Include="..\platform\win32\compat\stdint.h">
<Filter>platform\win32\compat</Filter>
</ClInclude>
@ -1123,9 +1123,6 @@
<ClInclude Include="..\platform\CCFileUtils.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLViewProtocol.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCImage.h">
<Filter>platform</Filter>
</ClInclude>
@ -1156,48 +1153,48 @@
<ClInclude Include="..\renderer\CCMeshCommand.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCMesh.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCObjLoader.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCSprite3D.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\base\ObjectFactory.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCBundle3D.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCAnimate3D.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCAnimationCurve.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCMeshSkin.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCAnimation3D.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCBundle3DData.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCSprite3DMaterial.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="..\3d\CCBundleReader.h">
<Filter>3d</Filter>
</ClInclude>
<ClInclude Include="CCFastTMXTiledMap.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCFastTMXLayer.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="..\storage\local-storage\LocalStorage.h">
<Filter>storage</Filter>
</ClInclude>
<ClInclude Include="..\platform\desktop\CCGLViewImpl.h">
<Filter>platform\desktop</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCGLView.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="CCProtectedNode.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="..\base\CCCamera.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitive.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCPrimitiveCommand.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\renderer\CCVertexIndexData.h">
<Filter>renderer</Filter>
</ClInclude>
<ClInclude Include="..\base\CCModuleManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\ccRandom.h">
<Filter>base</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">
@ -1221,8 +1218,6 @@
<None Include="..\math\Vec4.inl">
<Filter>math</Filter>
</None>
<None Include="..\3d\CCAnimationCurve.inl">
<Filter>3d</Filter>
</None>
<None Include="cocos2d.def" />
</ItemGroup>
</Project>

28
cocos/3d/3dExport.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef __COCOS_3D_3DEXPORT_H__
#define __COCOS_3D_3DEXPORT_H__
#if defined(WIN32) && defined(_WINDOWS)
#ifdef __MINGW32__
#include <string.h>
#endif
#if defined(_USE3DDLL)
#define CC_3D_DLL __declspec(dllexport)
#else /* use a DLL library */
#define CC_3D_DLL __declspec(dllimport)
#endif
/* Define NULL pointer value */
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#else
#define CC_3D_DLL
#endif
#endif // __COCOS_3D_3DEXPORT_H__

33
cocos/3d/Android.mk Normal file
View File

@ -0,0 +1,33 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos3d_static
LOCAL_MODULE_FILENAME := libcocos3d
LOCAL_SRC_FILES := \
CCRay.cpp \
CCAABB.cpp \
CCOBB.cpp \
CCAnimate3D.cpp \
CCAnimation3D.cpp \
CCAttachNode.cpp \
CCBundle3D.cpp \
CCBundleReader.cpp \
CCMesh.cpp \
CCMeshSkin.cpp \
CCSprite3DMaterial.cpp \
CCObjLoader.cpp \
CCSkeleton3D.cpp \
CCSprite3D.cpp \
CCSubMesh.cpp \
CCSubMeshState.cpp \
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../../external \
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
include $(BUILD_STATIC_LIBRARY)

184
cocos/3d/CCAABB.cpp Executable file
View File

@ -0,0 +1,184 @@
/****************************************************************************
Copyright (c) 2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "3d/CCAABB.h"
NS_CC_BEGIN
AABB::AABB()
{
reset();
}
AABB::AABB(const Vec3& min, const Vec3& max)
{
set(min, max);
}
AABB::AABB(const AABB& box)
{
set(box._min,box._max);
}
Vec3 AABB::getCenter()
{
Vec3 center;
center.x = 0.5f*(_min.x+_max.x);
center.y = 0.5f*(_min.y+_max.y);
center.z = 0.5f*(_min.z+_max.z);
return center;
}
void AABB::getCorners(Vec3 *dst) const
{
assert(dst);
// Near face, specified counter-clockwise looking towards the origin from the positive z-axis.
// Left-top-front.
dst[0].set(_min.x, _max.y, _max.z);
// Left-bottom-front.
dst[1].set(_min.x, _min.y, _max.z);
// Right-bottom-front.
dst[2].set(_max.x, _min.y, _max.z);
// Right-top-front.
dst[3].set(_max.x, _max.y, _max.z);
// Far face, specified counter-clockwise looking towards the origin from the negative z-axis.
// Right-top-back.
dst[4].set(_max.x, _max.y, _min.z);
// Right-bottom-back.
dst[5].set(_max.x, _min.y, _min.z);
// Left-bottom-back.
dst[6].set(_min.x, _min.y, _min.z);
// Left-top-back.
dst[7].set(_min.x, _max.y, _min.z);
}
bool AABB::intersects(const AABB& aabb) const
{
return ((_min.x >= aabb._min.x && _min.x <= aabb._max.x) || (aabb._min.x >= _min.x && aabb._min.x <= _max.x)) &&
((_min.y >= aabb._min.y && _min.y <= aabb._max.y) || (aabb._min.y >= _min.y && aabb._min.y <= _max.y)) &&
((_min.z >= aabb._min.z && _min.z <= aabb._max.z) || (aabb._min.z >= _min.z && aabb._min.z <= _max.z));
}
bool AABB::containPoint(const Vec3& point) const
{
if (point.x < _min.x) return false;
if (point.y < _min.y) return false;
if (point.z < _min.z) return false;
if (point.x > _max.x) return false;
if (point.y > _max.y) return false;
if (point.z > _max.z) return false;
return true;
}
void AABB::merge(const AABB& box)
{
// Calculate the new minimum point.
_min.x = std::min(_min.x, box._min.x);
_min.y = std::min(_min.y, box._min.y);
_min.z = std::min(_min.z, box._min.z);
// Calculate the new maximum point.
_max.x = std::max(_max.x, box._max.x);
_max.y = std::max(_max.y, box._max.y);
_max.z = std::max(_max.z, box._max.z);
}
void AABB::set(const Vec3& min, const Vec3& max)
{
this->_min = min;
this->_max = max;
}
void AABB::reset()
{
_min.set(99999.0f, 99999.0f, 99999.0f);
_max.set(-99999.0f, -99999.0f, -99999.0f);
}
void AABB::updateMinMax(const Vec3* point, ssize_t num)
{
for (ssize_t i = 0; i < num; i++)
{
// Leftmost point.
if (point[i].x < _min.x)
_min.x = point[i].x;
// Lowest point.
if (point[i].y < _min.y)
_min.y = point[i].y;
// Farthest point.
if (point[i].z < _min.z)
_min.z = point[i].z;
// Rightmost point.
if (point[i].x > _max.x)
_max.x = point[i].x;
// Highest point.
if (point[i].y > _max.y)
_max.y = point[i].y;
// Nearest point.
if (point[i].z > _max.z)
_max.z = point[i].z;
}
}
void AABB::transform(const Mat4& mat)
{
Vec3 corners[8];
// Near face, specified counter-clockwise
// Left-top-front.
corners[0].set(_min.x, _max.y, _max.z);
// Left-bottom-front.
corners[1].set(_min.x, _min.y, _max.z);
// Right-bottom-front.
corners[2].set(_max.x, _min.y, _max.z);
// Right-top-front.
corners[3].set(_max.x, _max.y, _max.z);
// Far face, specified clockwise
// Right-top-back.
corners[4].set(_max.x, _max.y, _min.z);
// Right-bottom-back.
corners[5].set(_max.x, _min.y, _min.z);
// Left-bottom-back.
corners[6].set(_min.x, _min.y, _min.z);
// Left-top-back.
corners[7].set(_min.x, _max.y, _min.z);
// Transform the corners, recalculate the min and max points along the way.
for (int i = 0; i < 8; i++)
mat.transformPoint(&corners[i]);
reset();
updateMinMax(corners, 8);
}
NS_CC_END

115
cocos/3d/CCAABB.h Normal file
View File

@ -0,0 +1,115 @@
/****************************************************************************
Copyright (c) 2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_AABB_H__
#define __CC_AABB_H__
#include "base/ccMacros.h"
#include "math/CCMath.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
class CC_3D_DLL AABB
{
public:
/**
* Constructor.
*/
AABB();
/**
* Constructor.
*/
AABB(const Vec3& min, const Vec3& max);
/**
* Constructor.
*/
AABB(const AABB& box);
/**
* Gets the center point of the bounding box.
*/
Vec3 getCenter();
/* Near face, specified counter-clockwise looking towards the origin from the positive z-axis.
* verts[0] : left top front
* verts[1] : left bottom front
* verts[2] : right bottom front
* verts[3] : right top front
*
* Far face, specified counter-clockwise looking towards the origin from the negative z-axis.
* verts[4] : right top back
* verts[5] : right bottom back
* verts[6] : left bottom back
* verts[7] : left top back
*/
void getCorners(Vec3 *dst) const;
/**
* Tests whether this bounding box intersects the specified bounding object.
*/
bool intersects(const AABB& aabb) const;
/**
* check whether the point is in.
*/
bool containPoint(const Vec3& point) const;
/**
* Sets this bounding box to the smallest bounding box
* that contains both this bounding object and the specified bounding box.
*/
void merge(const AABB& box);
/**
* Sets this bounding box to the specified values.
*/
void set(const Vec3& min, const Vec3& max);
/**
* reset min and max value.
*/
void reset();
/**
* update the _min and _max from the given point.
*/
void updateMinMax(const Vec3* point, ssize_t num);
/**
* Transforms the bounding box by the given transformation matrix.
*/
void transform(const Mat4& mat);
public:
Vec3 _min;
Vec3 _max;
};
NS_CC_END
#endif

View File

@ -25,6 +25,7 @@
#include "3d/CCAnimate3D.h"
#include "3d/CCAnimation3D.h"
#include "3d/CCSprite3D.h"
#include "3d/CCSkeleton3D.h"
#include "3d/CCMeshSkin.h"
#include "base/ccMacros.h"

View File

@ -34,6 +34,7 @@
#include "base/ccTypes.h"
#include "base/CCPlatformMacros.h"
#include "2d/CCActionInterval.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
@ -42,7 +43,7 @@ class Bone3D;
/**
* Animate3D, Animates a Sprite3D given with an Animation3D
*/
class Animate3D: public ActionInterval
class CC_3D_DLL Animate3D: public ActionInterval
{
public:

View File

@ -33,13 +33,14 @@
#include "base/CCRef.h"
#include "base/ccTypes.h"
#include "CCBundle3DData.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
/**
* static animation data, shared
*/
class Animation3D: public Ref
class CC_3D_DLL Animation3D: public Ref
{
friend class Bundle3D;
public:

76
cocos/3d/CCAttachNode.cpp Normal file
View File

@ -0,0 +1,76 @@
/****************************************************************************
Copyright (c) 2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "3d/CCAttachNode.h"
#include "3d/CCSkeleton3D.h"
#include "2d/CCNode.h"
#include "base/CCDirector.h"
#include "base/CCPlatformMacros.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
AttachNode* AttachNode::create(Bone3D* attachBone)
{
auto attachnode = new AttachNode();
attachnode->_attachBone = attachBone;
attachnode->autorelease();
return attachnode;
}
AttachNode::AttachNode()
: _attachBone(nullptr)
{
}
AttachNode::~AttachNode()
{
}
Mat4 AttachNode::getWorldToNodeTransform() const
{
static Mat4 mat;
mat.setIdentity();
auto parent = getParent();
if (parent)
{
mat = parent->getWorldToNodeTransform() * _attachBone->getWorldMat() * getNodeToParentTransform();
}
else
{
mat = _attachBone->getWorldMat() * getNodeToParentTransform();
}
return mat;
}
void AttachNode::visit(Renderer *renderer, const Mat4& parentTransform, uint32_t parentFlags)
{
Node::visit(renderer, parentTransform * _attachBone->getWorldMat(), Node::FLAGS_DIRTY_MASK);
}
NS_CC_END

73
cocos/3d/CCAttachNode.h Normal file
View File

@ -0,0 +1,73 @@
/****************************************************************************
Copyright (c) 2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCATTACHNODE_H__
#define __CCATTACHNODE_H__
#include <vector>
#include "base/CCVector.h"
#include "base/ccTypes.h"
#include "base/CCProtocols.h"
#include "math/CCMath.h"
#include "2d/CCNode.h"
#include "renderer/CCMeshCommand.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
class Bone3D;
/**
* attach a node to a bone
* usage: auto sprite = Sprite3D::create("girl.c3b");
* auto weapon = Sprite3D::create("weapon.c3b");
* auto attachNode = sprite->getAttachNode("left hand");
* attachNode->addChild(weapon);
*/
class CC_3D_DLL AttachNode : public Node
{
public:
/**
* creates an AttachNode
* @param attachBone The bone to which the AttachNode is going to attach, the attacheBone must be a bone of the AttachNode's parent
*/
static AttachNode* create(Bone3D* attachBone);
virtual Mat4 getWorldToNodeTransform() const override;
virtual void visit(Renderer *renderer, const Mat4& parentTransform, uint32_t parentFlags) override;
CC_CONSTRUCTOR_ACCESS:
AttachNode();
virtual ~AttachNode();
protected:
Bone3D* _attachBone;
};
NS_CC_END
#endif // __CCATTACHNODE_H__

View File

@ -31,7 +31,6 @@
#include "base/CCData.h"
#include "json/document.h"
#define BUNDLE_TYPE_SCENE 1
#define BUNDLE_TYPE_NODE 2
#define BUNDLE_TYPE_ANIMATIONS 3
@ -46,14 +45,17 @@
#define BUNDLE_TYPE_MESHPART 35
#define BUNDLE_TYPE_MESHSKIN 36
static const char* VERSION = "version";
static const char* ID = "id";
static const char* MESHDATA_MESH = "mesh";
static const char* MESHDATA_DEFAULTPART = "body";
static const char* MESHDATA_VERTEXSIZE = "vertexsize";
static const char* MESHDATA_VERTEX = "vertex";
static const char* MESHDATA_VERTICES = "vertices";
static const char* MESHDATA_INDEXNUM = "indexnum";
static const char* MESHDATA_INDICES = "indices";
static const char* MESHDATA_SUBMESH = "submesh";
static const char* MESHDATA_ATTRIBUTES = "attributes";
static const char* MESHDATA_SIZE = "size";
static const char* MESHDATA_TYPE = "type";
@ -69,6 +71,7 @@ static const char* SKINDATA_TRANSFORM = "tansform";
static const char* MATERIALDATA_MATERIAL = "material";
static const char* MATERIALDATA_BASE = "base";
static const char* MATERIALDATA_FILENAME = "filename";
static const char* MATERIALDATA_TEXTURES = "textures";
static const char* ANIMATIONDATA_ANIMATION = "animation";
static const char* ANIMATIONDATA_LENGTH = "length";
@ -140,6 +143,12 @@ void getChildMap(std::map<int, std::vector<int> >& map, SkinData* skinData, cons
Bundle3D* Bundle3D::_instance = nullptr;
void Bundle3D::setBundleInstance(Bundle3D* bundleInstance)
{
CC_SAFE_DELETE(_instance);
_instance = bundleInstance;
}
Bundle3D* Bundle3D::getInstance()
{
if (_instance == nullptr)
@ -197,6 +206,8 @@ bool Bundle3D::load(const std::string& path)
bool Bundle3D::loadMeshData(const std::string& id, MeshData* meshdata)
{
meshdata->resetData();
if (_isBinary)
{
return loadMeshDataBinary(meshdata);
@ -209,6 +220,8 @@ bool Bundle3D::loadMeshData(const std::string& id, MeshData* meshdata)
bool Bundle3D::loadSkinData(const std::string& id, SkinData* skindata)
{
skindata->resetData();
if (_isBinary)
{
return loadSkinDataBinary(skindata);
@ -221,6 +234,8 @@ bool Bundle3D::loadSkinData(const std::string& id, SkinData* skindata)
bool Bundle3D::loadMaterialData(const std::string& id, MaterialData* materialdata)
{
materialdata->resetData();
if (_isBinary)
{
return loadMaterialDataBinary(materialdata);
@ -233,6 +248,8 @@ bool Bundle3D::loadMaterialData(const std::string& id, MaterialData* materialdat
bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animationdata)
{
animationdata->resetData();
if (_isBinary)
{
return loadAnimationDataBinary(animationdata);
@ -243,6 +260,14 @@ bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animati
}
}
bool Bundle3D::loadSkeletonData(const std::string& id, Skeleton3DData* skeletondata)
{
skeletondata->resetData();
//TODO
return true;
}
bool Bundle3D::loadJson(const std::string& path)
{
clear();
@ -260,58 +285,129 @@ bool Bundle3D::loadJson(const std::string& path)
clear();
return false;
}
const rapidjson::Value& mash_data_array = _jsonReader[VERSION];
_version = mash_data_array.GetString();
return true;
}
bool Bundle3D::loadMeshDataJson(MeshData* meshdata)
{
meshdata->resetData();
assert(_jsonReader.HasMember(MESHDATA_MESH));
const rapidjson::Value& mash_data_array = _jsonReader[MESHDATA_MESH];
assert(mash_data_array.IsArray());
const rapidjson::Value& mash_data_val = mash_data_array[(rapidjson::SizeType)0];
//1.2 is a wrong version. Our first released fbx-conv write this version id, so we keep on using it.
if (_version == "1.2")
{
return loadMeshDataJson_0_1(meshdata);
}
else if(_version == "0.2")
{
return loadMeshDataJson_0_2(meshdata);
}
else
{
CCLOGINFO(false, "Unsupported version of loadMeshDataJson(): %s", _version);
return false;
}
}
assert(mash_data_val.HasMember(MESHDATA_DEFAULTPART));
const rapidjson::Value& mesh_data_body_array = mash_data_val[MESHDATA_DEFAULTPART];
bool Bundle3D::loadMeshDataJson_0_1(MeshData* meshdata)
{
const rapidjson::Value& mesh_data_array = _jsonReader[MESHDATA_MESH];
const rapidjson::Value& mesh_data_val = mesh_data_array[(rapidjson::SizeType)0];
const rapidjson::Value& mesh_data_body_array = mesh_data_val[MESHDATA_DEFAULTPART];
assert(mesh_data_body_array.IsArray());
const rapidjson::Value& mesh_data_body_array_0 = mesh_data_body_array[(rapidjson::SizeType)0];
// vertex_size
assert(mesh_data_body_array_0.HasMember(MESHDATA_VERTEXSIZE));
meshdata->vertexSizeInFloat = mesh_data_body_array_0[MESHDATA_VERTEXSIZE].GetInt();
// vertices
meshdata->vertex.resize(meshdata->vertexSizeInFloat);
const rapidjson::Value& mesh_data_body_vertices = mesh_data_body_array_0[MESHDATA_VERTICES];
for (rapidjson::SizeType i = 0; i < mesh_data_body_vertices.Size(); i++)
meshdata->vertex[i] = mesh_data_body_vertices[i].GetDouble();
// index_number
meshdata->numIndex = mesh_data_body_array_0[MESHDATA_INDEXNUM].GetUint();
// indices
meshdata->indices.resize(meshdata->numIndex);
const rapidjson::Value& mesh_data_body_indices_val = mesh_data_body_array_0[MESHDATA_INDICES];
for (rapidjson::SizeType i = 0; i < mesh_data_body_indices_val.Size(); i++)
meshdata->indices[i] = (unsigned short)mesh_data_body_indices_val[i].GetUint();
// mesh_vertex_attribute
const rapidjson::Value& mesh_vertex_attribute = mash_data_val[MESHDATA_ATTRIBUTES];
const rapidjson::Value& mesh_vertex_attribute = mesh_data_val[MESHDATA_ATTRIBUTES];
meshdata->attribCount = mesh_vertex_attribute.Size();
meshdata->attribs.resize(meshdata->attribCount);
for (rapidjson::SizeType i = 0; i < mesh_vertex_attribute.Size(); i++)
{
const rapidjson::Value& mesh_vertex_attribute_val = mesh_vertex_attribute[i];
meshdata->attribs[i].size = mesh_vertex_attribute_val[MESHDATA_SIZE].GetUint();
meshdata->attribs[i].attribSizeBytes = meshdata->attribs[i].size * 4;
meshdata->attribs[i].type = parseGLType(mesh_vertex_attribute_val[MESHDATA_TYPE].GetString());
meshdata->attribs[i].vertexAttrib = parseGLProgramAttribute(mesh_vertex_attribute_val[MESHDATA_ATTRIBUTE].GetString());
}
// vertices
meshdata->vertexSizeInFloat = mesh_data_body_array_0[MESHDATA_VERTEXSIZE].GetInt();
meshdata->vertex.resize(meshdata->vertexSizeInFloat);
const rapidjson::Value& mesh_data_body_vertices = mesh_data_body_array_0[MESHDATA_VERTICES];
for (rapidjson::SizeType i = 0; i < mesh_data_body_vertices.Size(); i++)
meshdata->vertex[i] = mesh_data_body_vertices[i].GetDouble();
// index_number
unsigned int indexnum = mesh_data_body_array_0[MESHDATA_INDEXNUM].GetUint();
// indices
std::vector<unsigned short> indices;
indices.resize(indexnum);
const rapidjson::Value& indices_val_array = mesh_data_body_array_0[MESHDATA_INDICES];
for (rapidjson::SizeType i = 0; i < indices_val_array.Size(); i++)
indices[i] = (unsigned short)indices_val_array[i].GetUint();
meshdata->subMeshIndices.push_back(indices);
return true;
}
bool Bundle3D::loadMeshDataJson_0_2(MeshData* meshdata)
{
const rapidjson::Value& mesh_array = _jsonReader[MESHDATA_MESH];
const rapidjson::Value& mesh_array_0 = mesh_array[(rapidjson::SizeType)0];
// mesh_vertex_attribute
const rapidjson::Value& mesh_vertex_attribute = mesh_array_0[MESHDATA_ATTRIBUTES];
meshdata->attribCount = mesh_vertex_attribute.Size();
meshdata->attribs.resize(meshdata->attribCount);
for (rapidjson::SizeType i = 0; i < mesh_vertex_attribute.Size(); i++)
{
const rapidjson::Value& mesh_vertex_attribute_val = mesh_vertex_attribute[i];
meshdata->attribs[i].size = mesh_vertex_attribute_val[MESHDATA_SIZE].GetUint();
meshdata->attribs[i].attribSizeBytes = meshdata->attribs[i].size * 4;
meshdata->attribs[i].type = parseGLType(mesh_vertex_attribute_val[MESHDATA_TYPE].GetString());
meshdata->attribs[i].vertexAttrib = parseGLProgramAttribute(mesh_vertex_attribute_val[MESHDATA_ATTRIBUTE].GetString());
}
// vertices
const rapidjson::Value& mesh_data_vertex = mesh_array_0[MESHDATA_VERTEX];
const rapidjson::Value& mesh_data_vertex_0 = mesh_data_vertex[(rapidjson::SizeType)0];
meshdata->vertexSizeInFloat = mesh_data_vertex_0[MESHDATA_VERTEXSIZE].GetInt();
meshdata->vertex.resize(meshdata->vertexSizeInFloat);
const rapidjson::Value& mesh_data_body_vertices = mesh_data_vertex_0[MESHDATA_VERTICES];
for (rapidjson::SizeType i = 0; i < mesh_data_body_vertices.Size(); i++)
meshdata->vertex[i] = mesh_data_body_vertices[i].GetDouble();
// submesh
const rapidjson::Value& mesh_submesh_array = mesh_array_0[MESHDATA_SUBMESH];
for (rapidjson::SizeType i = 0; i < mesh_submesh_array.Size(); i++)
{
const rapidjson::Value& mesh_submesh_val = mesh_submesh_array[i];
//std::string id = mesh_submesh_val[ID].GetString();
// index_number
unsigned int indexnum = mesh_submesh_val[MESHDATA_INDEXNUM].GetUint();
// indices
std::vector<unsigned short> indices;
indices.resize(indexnum);
const rapidjson::Value& indices_val_array = mesh_submesh_val[MESHDATA_INDICES];
for (rapidjson::SizeType j = 0; j < indices_val_array.Size(); j++)
indices[j] = (unsigned short)indices_val_array[j].GetUint();
meshdata->subMeshIndices.push_back(indices);
}
return true;
}
@ -319,8 +415,6 @@ bool Bundle3D::loadSkinDataJson(SkinData* skindata)
{
if (!_jsonReader.HasMember(SKINDATA_SKIN )) return false;
skindata->resetData();
const rapidjson::Value& skin_data_array = _jsonReader[SKINDATA_SKIN ];
assert(skin_data_array.IsArray());
@ -350,12 +444,29 @@ bool Bundle3D::loadSkinDataJson(SkinData* skindata)
// parent and child relationship map
skindata->skinBoneOriginMatrices.resize(skindata->skinBoneNames.size());
//skindata->nodeBoneOriginMatrices.resize(skindata->nodeBoneNames.size());
getChildMap(skindata->boneChild, skindata, skin_data_1);
return true;
}
bool Bundle3D::loadMaterialDataJson(MaterialData* materialdata)
{
//1.2 is a wrong version. Our first released fbx-conv write this version id, so we keep on using it.
if (_version == "1.2")
{
return loadMaterialDataJson_0_1(materialdata);
}
else if(_version == "0.2")
{
return loadMaterialDataJson_0_2(materialdata);
}
else
{
CCLOGINFO(false, "Unsupported version of loadMaterialDataJson() : %s", _version);
return false;
}
}
bool Bundle3D::loadMaterialDataJson_0_1(MaterialData* materialdata)
{
if (!_jsonReader.HasMember(MATERIALDATA_MATERIAL))
return false;
@ -368,19 +479,35 @@ bool Bundle3D::loadMaterialDataJson(MaterialData* materialdata)
const rapidjson::Value& material_data_base_array_0 = material_data_base_array[(rapidjson::SizeType)0];
materialdata->texturePath = _modelRelativePath + material_data_base_array_0[MATERIALDATA_FILENAME].GetString();
// set texture
materialdata->texturePaths[0] =_modelRelativePath + material_data_base_array_0[MATERIALDATA_FILENAME].GetString();
return true;
}
bool Bundle3D::loadMaterialDataJson_0_2(MaterialData* materialdata)
{
if (!_jsonReader.HasMember(MATERIALDATA_MATERIAL))
return false;
const rapidjson::Value& material_array = _jsonReader[MATERIALDATA_MATERIAL];
for (rapidjson::SizeType i = 0; i < material_array.Size(); i++)
{
const rapidjson::Value& material_val = material_array[i];
//std::string id = material_val[ID].GetString();
// set texture
materialdata->texturePaths[i] = _modelRelativePath + material_val[MATERIALDATA_TEXTURES].GetString();
}
return true;
}
bool Bundle3D::loadAnimationDataJson(Animation3DData* animationdata)
{
if (!_jsonReader.HasMember(ANIMATIONDATA_ANIMATION)) return false;
animationdata->_rotationKeys.clear();
animationdata->_scaleKeys.clear();
animationdata->_translationKeys.clear();
const rapidjson::Value& animation_data_array = _jsonReader[ANIMATIONDATA_ANIMATION];
if (animation_data_array.Size()==0) return false;
@ -467,18 +594,9 @@ bool Bundle3D::loadBinary(const std::string& path)
return false;
}
if (ver[0] != 0) {
clear();
CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]);
return false;
}
if (ver[1] <= 0 || ver[1] > 2) {
clear();
CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]);
return false;
}
char version[20] = {0};
sprintf(version, "%d.%d", ver[0], ver[1]);
_version = version;
// Read ref table size
if (_binaryReader.read(&_referenceCount, 4, 1) != 1)
@ -508,11 +626,26 @@ bool Bundle3D::loadBinary(const std::string& path)
}
bool Bundle3D::loadMeshDataBinary(MeshData* meshdata)
{
if (_version == "0.1")
{
return loadMeshDataBinary_0_1(meshdata);
}
else if(_version == "0.2")
{
return loadMeshDataBinary_0_2(meshdata);
}
else
{
CCLOGINFO(false, "Unsupported version of loadMeshDataBinary() : %s", _version);
return false;
}
}
bool Bundle3D::loadMeshDataBinary_0_1(MeshData* meshdata)
{
if (!seekToFirstType(BUNDLE_TYPE_MESH))
return false;
meshdata->resetData();
// read mesh data
if (_binaryReader.read(&meshdata->attribCount, 4, 1) != 1 || meshdata->attribCount < 1)
@ -563,26 +696,101 @@ bool Bundle3D::loadMeshDataBinary(MeshData* meshdata)
CCLOGINFO("Failed to read meshdata: nIndexCount '%s'.", _path.c_str());
return false;
}
meshdata->numIndex = nIndexCount;
meshdata->indices.resize(meshdata->numIndex);
if (_binaryReader.read(&meshdata->indices[0], 2, meshdata->numIndex) != nIndexCount)
std::vector<unsigned short> indices;
indices.resize(nIndexCount);
if (_binaryReader.read(&indices[0], 2, nIndexCount) != nIndexCount)
{
CCLOGINFO("Failed to read meshdata: indices '%s'.", _path.c_str());
return false;
}
meshdata->subMeshIndices.push_back(indices);
}
return true;
}
bool Bundle3D::loadMeshDataBinary_0_2(MeshData* meshdata)
{
if (!seekToFirstType(BUNDLE_TYPE_MESH))
return false;
meshdata->resetData();
// read mesh data
if (_binaryReader.read(&meshdata->attribCount, 4, 1) != 1 || meshdata->attribCount < 1)
{
CCLOGINFO("Failed to read meshdata: attribCount '%s'.", _path.c_str());
return false;
}
meshdata->attribs.resize(meshdata->attribCount);
for (ssize_t i = 0; i < meshdata->attribCount; i++)
{
unsigned int vUsage, vSize;
if (_binaryReader.read(&vUsage, 4, 1) != 1 || _binaryReader.read(&vSize, 4, 1) != 1)
{
CCLOGINFO("Failed to read meshdata: usage or size '%s'.", _path.c_str());
return false;
}
meshdata->attribs[i].size = vSize;
meshdata->attribs[i].attribSizeBytes = meshdata->attribs[i].size * 4;
meshdata->attribs[i].type = GL_FLOAT;
meshdata->attribs[i].vertexAttrib = vUsage;
}
// Read vertex data
if (_binaryReader.read(&meshdata->vertexSizeInFloat, 4, 1) != 1 || meshdata->vertexSizeInFloat == 0)
{
CCLOGINFO("Failed to read meshdata: vertexSizeInFloat '%s'.", _path.c_str());
return false;
}
meshdata->vertex.resize(meshdata->vertexSizeInFloat);
if (_binaryReader.read(&meshdata->vertex[0], 4, meshdata->vertexSizeInFloat) != meshdata->vertexSizeInFloat)
{
CCLOGINFO("Failed to read meshdata: vertex element '%s'.", _path.c_str());
return false;
}
// read submesh
unsigned int submeshCount;
if (_binaryReader.read(&submeshCount, 4, 1) != 1)
{
CCLOGINFO("Failed to read meshdata: submeshCount '%s'.", _path.c_str());
return false;
}
for (unsigned int i = 0; i < submeshCount; ++i)
{
unsigned int nIndexCount;
if (_binaryReader.read(&nIndexCount, 4, 1) != 1)
{
CCLOGINFO("Failed to read meshdata: nIndexCount '%s'.", _path.c_str());
return false;
}
std::vector<unsigned short> indices;
indices.resize(nIndexCount);
if (_binaryReader.read(&indices[0], 2, nIndexCount) != nIndexCount)
{
CCLOGINFO("Failed to read meshdata: indices '%s'.", _path.c_str());
return false;
}
meshdata->subMeshIndices.push_back(indices);
}
return true;
}
bool Bundle3D::loadSkinDataBinary(SkinData* skindata)
{
if (!seekToFirstType(BUNDLE_TYPE_MESHSKIN))
return false;
skindata->resetData();
std::string boneName = _binaryReader.readString();
// transform
@ -684,14 +892,25 @@ bool Bundle3D::loadMaterialDataBinary(MaterialData* materialdata)
if (!seekToFirstType(BUNDLE_TYPE_MATERIAL))
return false;
std::string texturePath = _binaryReader.readString();
if (texturePath.empty())
unsigned int materialnum = 1;
if (_version == "0.2")
{
CCLOGINFO("Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str());
return false;
_binaryReader.read(&materialnum, 4, 1);
}
materialdata->texturePath = _modelRelativePath + texturePath;
for (int i = 0; i < materialnum; i++)
{
std::string texturePath = _binaryReader.readString();
if (texturePath.empty())
{
CCLOGINFO("Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str());
return false;
}
std::string path = _modelRelativePath + texturePath;
materialdata->texturePaths[i] = path;
}
return true;
}
@ -700,10 +919,6 @@ bool Bundle3D::loadAnimationDataBinary(Animation3DData* animationdata)
if (!seekToFirstType(BUNDLE_TYPE_ANIMATIONS))
return false;
animationdata->_rotationKeys.clear();
animationdata->_scaleKeys.clear();
animationdata->_translationKeys.clear();
_binaryReader.readString();
if (!_binaryReader.read(&animationdata->_totalTime))
@ -877,6 +1092,7 @@ Bundle3D::Bundle3D()
:_isBinary(false),
_modelRelativePath(""),
_path(""),
_version(""),
_jsonBuffer(nullptr),
_binaryBuffer(nullptr),
_referenceCount(0),

View File

@ -35,6 +35,7 @@
#include "json/document.h"
#include "CCBundleReader.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
class Animation3D;
@ -46,56 +47,68 @@ class Data;
* c3t text file
* c3b binary file
*/
class Bundle3D
class CC_3D_DLL Bundle3D
{
public:
/**you can define yourself bundle and set it, use default bundle otherwise*/
static void setBundleInstance(Bundle3D* bundleInstance);
static Bundle3D* getInstance();
static void destroyInstance();
void clear();
virtual void clear();
/**
* load a file. You must load a file first, then call loadMeshData, loadSkinData, and so on
* @param path File to be loaded
* @return result of load
*/
bool load(const std::string& path);
virtual bool load(const std::string& path);
/**
* load mesh data from bundle
* @param id The ID of the mesh, load the first Mesh in the bundle if it is empty
*/
bool loadMeshData(const std::string& id, MeshData* meshdata);
virtual bool loadMeshData(const std::string& id, MeshData* meshdata);
/**
* load skin data from bundle
* @param id The ID of the skin, load the first Skin in the bundle if it is empty
*/
bool loadSkinData(const std::string& id, SkinData* skindata);
virtual bool loadSkinData(const std::string& id, SkinData* skindata);
/**
* load material data from bundle
* @param id The ID of the material, load the first Material in the bundle if it is empty
*/
bool loadMaterialData(const std::string& id, MaterialData* materialdata);
virtual bool loadMaterialData(const std::string& id, MaterialData* materialdata);
/**
* load material data from bundle
* @param id The ID of the animation, load the first animation in the bundle if it is empty
*/
bool loadAnimationData(const std::string& id, Animation3DData* animationdata);
virtual bool loadAnimationData(const std::string& id, Animation3DData* animationdata);
/**
* load skeleton data from bundle
*
*/
virtual bool loadSkeletonData(const std::string& id, Skeleton3DData* skeletondata);
protected:
bool loadJson(const std::string& path);
bool loadMeshDataJson(MeshData* meshdata);
bool loadMeshDataJson_0_1(MeshData* meshdata);
bool loadMeshDataJson_0_2(MeshData* meshdata);
bool loadSkinDataJson(SkinData* skindata);
bool loadMaterialDataJson(MaterialData* materialdata);
bool loadMaterialDataJson_0_1(MaterialData* materialdata);
bool loadMaterialDataJson_0_2(MaterialData* materialdata);
bool loadAnimationDataJson(Animation3DData* animationdata);
@ -110,6 +123,8 @@ protected:
* @param meshdata The mesh data pointer
*/
bool loadMeshDataBinary(MeshData* meshdata);
bool loadMeshDataBinary_0_1(MeshData* meshdata);
bool loadMeshDataBinary_0_2(MeshData* meshdata);
/**
* load skin data in binary
@ -129,7 +144,6 @@ protected:
*/
bool loadAnimationDataBinary(Animation3DData* animationdata);
protected:
/**
* get define data type
* @param str The type in string
@ -166,6 +180,8 @@ protected:
std::string _modelRelativePath;
std::string _path;
std::string _version;// the c3b or c3t version
// for json reading
char* _jsonBuffer;
rapidjson::Document _jsonReader;
@ -181,4 +197,4 @@ protected:
NS_CC_END
#endif // __CCANIMATE3D_H__
#endif // __CCBUNDLE3D_H__

View File

@ -50,9 +50,10 @@ struct MeshVertexAttrib
/**mesh data*/
struct MeshData
{
typedef std::vector<unsigned short> IndexArray;
std::vector<float> vertex;
int vertexSizeInFloat;
std::vector<unsigned short> indices;
std::vector<IndexArray> subMeshIndices;
int numIndex;
std::vector<MeshVertexAttrib> attribs;
int attribCount;
@ -61,7 +62,7 @@ public:
void resetData()
{
vertex.clear();
indices.clear();
subMeshIndices.clear();
attribs.clear();
vertexSizeInFloat = 0;
numIndex = 0;
@ -104,30 +105,22 @@ struct SkinData
void addSkinBoneNames(const std::string& name)
{
for (auto iter : skinBoneNames)
{
if ((iter) == name)
return;
}
skinBoneNames.push_back(name);
auto it = std::find(skinBoneNames.begin(), skinBoneNames.end(), name);
if (it == skinBoneNames.end())
skinBoneNames.push_back(name);
}
void addNodeBoneNames(const std::string& name)
{
for (auto iter : nodeBoneNames)
{
if ((iter) == name)
return;
}
nodeBoneNames.push_back(name);
auto it = std::find(nodeBoneNames.begin(), nodeBoneNames.end(), name);
if (it == nodeBoneNames.end())
nodeBoneNames.push_back(name);
}
int getSkinBoneNameIndex(const std::string& name)const
{
int i = 0;
for (auto iter : skinBoneNames)
for (const auto& iter : skinBoneNames)
{
if ((iter) == name)
return i;
@ -139,13 +132,13 @@ struct SkinData
int getBoneNameIndex(const std::string& name)const
{
int i = 0;
for (auto iter : skinBoneNames)
for (const auto& iter : skinBoneNames)
{
if ((iter) == name)
return i;
i++;
}
for(auto iter : nodeBoneNames)
for(const auto& iter : nodeBoneNames)
{
if (iter == name)
return i;
@ -156,10 +149,54 @@ struct SkinData
};
/**skin data*/
struct Skeleton3DData
{
std::vector<std::string> boneNames; //bone names
std::vector<Mat4> inverseBindPoseMatrices; //bind pose of skin bone
std::vector<Mat4> boneOriginMatrices; // original bone transform
//bone child info, both skinbone and node bone
std::map<int, std::vector<int> > boneChild;//key parent, value child
int rootBoneIndex;
void resetData()
{
boneNames.clear();
inverseBindPoseMatrices.clear();
boneOriginMatrices.clear();
boneChild.clear();
rootBoneIndex = -1;
}
void addBoneNames(const std::string& name)
{
auto it = std::find(boneNames.begin(), boneNames.end(), name);
if (it == boneNames.end())
boneNames.push_back(name);
}
int getBoneNameIndex(const std::string& name)const
{
int i = 0;
for (auto iter : boneNames)
{
if ((iter) == name)
return i;
i++;
}
return -1;
}
};
/**material data*/
struct MaterialData
{
std::string texturePath;
std::map<int, std::string> texturePaths; //submesh id, texture path
void resetData()
{
texturePaths.clear();
}
};
/**animation data*/
@ -223,7 +260,7 @@ public:
{
}
void clear()
void resetData()
{
_totalTime = 0;
_translationKeys.clear();

View File

@ -1,3 +1,27 @@
/****************************************************************************
Copyright (c) 2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCBundleReader.h"
#include "platform/CCFileUtils.h"

View File

@ -29,6 +29,7 @@
#include <iostream>
#include <sstream>
#include "3d/CCSubMesh.h"
#include "3d/CCObjLoader.h"
#include "3d/CCSprite3DMaterial.h"
@ -58,7 +59,7 @@ bool RenderMeshData::hasVertexAttrib(int attrib)
bool RenderMeshData::init(const std::vector<float>& positions,
const std::vector<float>& normals,
const std::vector<float>& texs,
const std::vector<unsigned short>& indices)
const std::vector<IndexArray>& indices)
{
CC_ASSERT(positions.size()<65536 * 3 && "index may out of bound");
@ -120,15 +121,15 @@ bool RenderMeshData::init(const std::vector<float>& positions,
_vertexs.push_back(texs[i * 2 + 1]);
}
}
_indices = indices;
_subMeshIndices = indices;
return true;
}
bool RenderMeshData::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs)
bool RenderMeshData::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<IndexArray>& indices, const std::vector<MeshVertexAttrib>& attribs)
{
_vertexs = vertices;
_indices = indices;
_subMeshIndices = indices;
_vertexAttribs = attribs;
_vertexsizeBytes = calVertexSizeBytes();
@ -150,19 +151,23 @@ int RenderMeshData::calVertexSizeBytes()
Mesh::Mesh()
:_vertexBuffer(0)
, _indexBuffer(0)
, _primitiveType(PrimitiveType::TRIANGLES)
, _indexFormat(IndexFormat::INDEX16)
, _indexCount(0)
{
}
Mesh::~Mesh()
{
_subMeshes.clear();
cleanAndFreeBuffers();
}
Mesh* Mesh::create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices)
Mesh* Mesh::create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const IndexArray& indices)
{
std::vector<IndexArray> submeshIndices;
submeshIndices.push_back(indices);
return create(positions, normals, texs, submeshIndices);
}
Mesh* Mesh::create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<IndexArray>& indices)
{
auto mesh = new Mesh();
if(mesh && mesh->init(positions, normals, texs, indices))
@ -174,7 +179,14 @@ Mesh* Mesh::create(const std::vector<float>& positions, const std::vector<float>
return nullptr;
}
Mesh* Mesh::create(const std::vector<float> &vertices, int vertexSizeInFloat, const std::vector<unsigned short> &indices, const std::vector<MeshVertexAttrib> &attribs)
Mesh* Mesh::create(const std::vector<float>& vertices, int vertexSizeInFloat, const IndexArray& indices, const std::vector<MeshVertexAttrib>& attribs)
{
std::vector<IndexArray> submeshIndices;
submeshIndices.push_back(indices);
return create(vertices, vertexSizeInFloat, submeshIndices, attribs);
}
Mesh* Mesh::create(const std::vector<float> &vertices, int vertexSizeInFloat, const std::vector<IndexArray> &indices, const std::vector<MeshVertexAttrib> &attribs)
{
auto mesh = new Mesh();
if (mesh && mesh->init(vertices, vertexSizeInFloat, indices, attribs))
@ -186,26 +198,47 @@ Mesh* Mesh::create(const std::vector<float> &vertices, int vertexSizeInFloat, co
return nullptr;
}
bool Mesh::init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices)
bool Mesh::init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<IndexArray>& indices)
{
bool bRet = _renderdata.init(positions, normals, texs, indices);
if (!bRet)
return false;
buildSubMeshes();
buildBuffer();
calOriginAABB(positions, 3);
return true;
}
bool Mesh::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs)
bool Mesh::init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<IndexArray>& indices, const std::vector<MeshVertexAttrib>& attribs)
{
bool bRet = _renderdata.init(vertices, vertexSizeInFloat, indices, attribs);
if (!bRet)
return false;
buildSubMeshes();
buildBuffer();
unsigned int perVertexSize = _renderdata.calVertexSizeBytes() / sizeof(float);
calOriginAABB(vertices, perVertexSize);
return true;
}
void Mesh::buildSubMeshes()
{
_subMeshes.clear();
for (auto& it : _renderdata._subMeshIndices) {
auto subMesh = SubMesh::create(PrimitiveType::TRIANGLES, IndexFormat::INDEX16, it);
_subMeshes.pushBack(subMesh);
}
}
void Mesh::cleanAndFreeBuffers()
{
if(glIsBuffer(_vertexBuffer))
@ -214,14 +247,19 @@ void Mesh::cleanAndFreeBuffers()
_vertexBuffer = 0;
}
if(glIsBuffer(_indexBuffer))
{
glDeleteBuffers(1, &_indexBuffer);
_indexBuffer = 0;
for (auto& it : _subMeshes) {
(*it).cleanAndFreeBuffers();
}
}
void Mesh::calOriginAABB(const std::vector<float>& vertices, unsigned int stride)
{
ssize_t vertexNum = vertices.size() / stride;
for(unsigned int i = 0; i < vertexNum; i++)
{
Vec3 point = Vec3(vertices[i * stride], vertices[i * stride + 1], vertices[i * stride + 2]);
_originAABB.updateMinMax(&point, 1);
}
_primitiveType = PrimitiveType::TRIANGLES;
_indexFormat = IndexFormat::INDEX16;
_indexCount = 0;
}
void Mesh::buildBuffer()
@ -237,28 +275,26 @@ void Mesh::buildBuffer()
GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &_indexBuffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
unsigned int indexSize = 2;
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexSize * _renderdata._indices.size(), &_renderdata._indices[0], GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
_primitiveType = PrimitiveType::TRIANGLES;
_indexFormat = IndexFormat::INDEX16;
_indexCount = _renderdata._indices.size();
for (size_t i = 0; i < _subMeshes.size(); i++) {
_subMeshes.at(i)->buildBuffer(_renderdata._subMeshIndices[i]);
}
}
void Mesh::restore()
{
_vertexBuffer = 0;
_indexBuffer = 0;
for (auto& it : _subMeshes) {
it->_indexBuffer = 0;
}
buildBuffer();
}
const AABB& Mesh::getOriginAABB() const
{
return _originAABB;
}
/**
* MeshCache
*/

View File

@ -29,27 +29,34 @@
#include <vector>
#include "3d/CCBundle3DData.h"
#include "3d/CCSubMesh.h"
#include "base/CCRef.h"
#include "base/ccTypes.h"
#include "base/CCVector.h"
#include "math/CCMath.h"
#include "renderer/CCGLProgram.h"
#include "CCAABB.h"
#include "3d/3dExport.h"
NS_CC_BEGIN
class EventListenerCustom;
class EventCustom;
class RenderMeshData
class CC_3D_DLL RenderMeshData
{
typedef std::vector<unsigned short> IndexArray;
friend class Mesh;
public:
RenderMeshData(): _vertexsizeBytes(0)
{
}
bool hasVertexAttrib(int attrib);
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<IndexArray>& subMeshIndices);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<IndexArray>& subMeshIndices, const std::vector<MeshVertexAttrib>& attribs);
protected:
@ -58,7 +65,7 @@ protected:
int _vertexsizeBytes;
ssize_t _vertexNum;
std::vector<float> _vertexs;
std::vector<unsigned short> _indices;
std::vector<IndexArray> _subMeshIndices;
std::vector<MeshVertexAttrib> _vertexAttribs;
};
@ -66,34 +73,36 @@ protected:
* Mesh: Geometry with a collection of vertex.
* Supporting various vertex formats.
*/
class Mesh : public Ref
class CC_3D_DLL Mesh : public Ref
{
typedef std::vector<unsigned short> IndexArray;
public:
/** Defines supported index formats. */
enum class IndexFormat
{
INDEX8 = GL_UNSIGNED_BYTE,
INDEX16 = GL_UNSIGNED_SHORT,
};
/** Defines supported primitive types. */
enum class PrimitiveType
{
TRIANGLES = GL_TRIANGLES,
TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
LINES = GL_LINES,
LINE_STRIP = GL_LINE_STRIP,
POINTS = GL_POINTS
};
/**create mesh from positions, normals, and so on*/
static Mesh* create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
/**create mesh from positions, normals, and so on, sigle SubMesh*/
static Mesh* create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const IndexArray& indices);
/**create mesh from positions, normals, and so on, multi-SubMesh*/
static Mesh* create(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<IndexArray>& subMeshIndices);
/**create mesh with vertex attributes*/
CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount) { return create(vertices, vertexSizeInFloat, indices, attribs); }
CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const IndexArray& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount) { return create(vertices, vertexSizeInFloat, indices, attribs); }
/**create mesh with vertex attributes*/
static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
/**
* create Mesh
* @param vertices vertices buffer data
* @param vertexSizeInFloat size of each vertex
* @param indices index buffer data that denotes how to connect the vertex, sigle SubMesh
* @param attribs vertex attributes
*/
static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const IndexArray& indices, const std::vector<MeshVertexAttrib>& attribs);
/**
* create Mesh
* @param vertices vertices buffer data
* @param vertexSizeInFloat size of each vertex
* @param subMeshIndices index buffer data that denotes how to connect the vertex, multi-SubMesh
* @param attribs vertex attributes
*/
static Mesh* create(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<IndexArray>& subMeshIndices, const std::vector<MeshVertexAttrib>& attribs);
/**get vertex buffer*/
inline GLuint getVertexBuffer() const { return _vertexBuffer; }
@ -107,41 +116,59 @@ public:
/**get per vertex size in bytes*/
int getVertexSizeInBytes() const { return _renderdata._vertexsizeBytes; }
/** get primitive type*/
PrimitiveType getPrimitiveType() const { return _primitiveType; }
/**get index count*/
ssize_t getIndexCount() const { return _indexCount; }
/**get index format*/
IndexFormat getIndexFormat() const { return _indexFormat; }
/**get index buffer*/
GLuint getIndexBuffer() const {return _indexBuffer; }
/**get sub mesh count*/
ssize_t getSubMeshCount() const { return _subMeshes.size(); }
/**get sub mesh by index*/
SubMesh* getSubMesh(int index) const { return _subMeshes.at(index); }
/**build vertex buffer from renderdata*/
void restore();
/** get origin aabb that calculate from vertices*/
const AABB& getOriginAABB() const;
/**to be deprecated, those functions have been moved to SubMesh*/
/** get primitive type*/
CC_DEPRECATED_ATTRIBUTE PrimitiveType getPrimitiveType() const { return _subMeshes.at(0)->getPrimitiveType(); }
/**get index count*/
CC_DEPRECATED_ATTRIBUTE ssize_t getIndexCount() const { return _subMeshes.at(0)->getIndexCount(); }
/**get index format*/
CC_DEPRECATED_ATTRIBUTE IndexFormat getIndexFormat() const { return _subMeshes.at(0)->getIndexFormat(); }
/**get index buffer*/
CC_DEPRECATED_ATTRIBUTE GLuint getIndexBuffer() const {return _subMeshes.at(0)->getIndexBuffer(); }
CC_CONSTRUCTOR_ACCESS:
Mesh();
virtual ~Mesh();
/**init mesh*/
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<unsigned short>& indices);
bool init(const std::vector<float>& positions, const std::vector<float>& normals, const std::vector<float>& texs, const std::vector<IndexArray>& indices);
/**init mesh*/
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<unsigned short>& indices, const std::vector<MeshVertexAttrib>& attribs);
bool init(const std::vector<float>& vertices, int vertexSizeInFloat, const std::vector<IndexArray>& indices, const std::vector<MeshVertexAttrib>& attribs);
/**build sub meshes*/
void buildSubMeshes();
/**build buffer*/
void buildBuffer();
/**free buffer*/
void cleanAndFreeBuffers();
/*
* calculate AABB by origin vertices
* @param the vertices list
* @param stride the stride between two vertex's position data.
*/
void calOriginAABB(const std::vector<float>& vertices, unsigned int stride);
protected:
PrimitiveType _primitiveType;
IndexFormat _indexFormat;
GLuint _vertexBuffer;
GLuint _indexBuffer;
ssize_t _indexCount;
Vector<SubMesh*> _subMeshes;
RenderMeshData _renderdata;
AABB _originAABB;
};
/**

View File

@ -23,6 +23,7 @@
****************************************************************************/
#include "3d/CCMeshSkin.h"
#include "3d/CCSkeleton3D.h"
#include "3d/CCBundle3D.h"
#include "base/ccMacros.h"
@ -31,221 +32,6 @@
NS_CC_BEGIN
/**
* Sets the inverse bind pose matrix.
*
* @param m C3DMatrix representing the inverse bind pose for this Bone.
*/
void Bone3D::setInverseBindPose(const Mat4& m)
{
_invBindPose = m;
}
const Mat4& Bone3D::getInverseBindPose()
{
return _invBindPose;
}
void Bone3D::setOriPose(const Mat4& m)
{
_oriPose = m;
}
void Bone3D::resetPose()
{
_local =_oriPose;
for (auto it : _children) {
it->resetPose();
}
}
void Bone3D::setWorldMatDirty(bool dirty)
{
_worldDirty = dirty;
for (auto it : _children) {
it->setWorldMatDirty(dirty);
}
}
//update own world matrix and children's
void Bone3D::updateWorldMat()
{
getWorldMat();
for (auto itor : _children) {
itor->updateWorldMat();
}
}
const Mat4& Bone3D::getWorldMat()
{
if (_worldDirty)
{
updateLocalMat();
if (_parent)
{
_world = _parent->getWorldMat() * _local;
}
else
_world = _local;
_worldDirty = false;
}
return _world;
}
void Bone3D::setAnimationValue(float* trans, float* rot, float* scale, void* tag, float weight)
{
for (auto& it : _blendStates) {
if (it.tag == tag)
{
if (trans)
it.localTranslate.set(trans);
if (rot)
it.localRot.set(rot);
if (scale)
it.localScale.set(scale);
it.weight = weight;
return;
}
}
BoneBlendState state;
if (trans)
state.localTranslate.set(trans);
if (rot)
state.localRot.set(rot);
if (scale)
state.localScale.set(scale);
state.weight = weight;
state.tag = tag;
_blendStates.push_back(state);
}
void Bone3D::clearBoneBlendState()
{
_blendStates.clear();
for (auto it : _children) {
it->clearBoneBlendState();
}
}
/**
* Creates C3DBone.
*/
Bone3D* Bone3D::create(const std::string& id)
{
auto bone = new Bone3D(id);
bone->autorelease();
return bone;
}
void Bone3D::updateJointMatrix(Vec4* matrixPalette)
{
{
static Mat4 t;
Mat4::multiply(_world, getInverseBindPose(), &t);
matrixPalette[0].set(t.m[0], t.m[4], t.m[8], t.m[12]);
matrixPalette[1].set(t.m[1], t.m[5], t.m[9], t.m[13]);
matrixPalette[2].set(t.m[2], t.m[6], t.m[10], t.m[14]);
}
}
Bone3D* Bone3D::getParentBone()
{
return _parent;
}
ssize_t Bone3D::getChildBoneCount() const
{
return _children.size();
}
Bone3D* Bone3D::getChildBoneByIndex(int index)
{
return _children.at(index);
}
void Bone3D::addChildBone(Bone3D* bone)
{
if (_children.find(bone) == _children.end())
_children.pushBack(bone);
}
void Bone3D::removeChildBoneByIndex(int index)
{
_children.erase(index);
}
void Bone3D::removeChildBone(Bone3D* bone)
{
_children.eraseObject(bone);
}
void Bone3D::removeAllChildBone()
{
_children.clear();
}
Bone3D::Bone3D(const std::string& id)
: _name(id)
, _parent(nullptr)
, _worldDirty(true)
{
}
Bone3D::~Bone3D()
{
removeAllChildBone();
}
void Bone3D::updateLocalMat()
{
if (_blendStates.size())
{
Vec3 translate(Vec3::ZERO), scale(Vec3::ZERO);
Quaternion quat(Quaternion::zero());
float total = 0.f;
for (auto it: _blendStates) {
total += it.weight;
}
if (total)
{
if (_blendStates.size() == 1)
{
auto& state = _blendStates[0];
translate = state.localTranslate;
scale = state.localScale;
quat = state.localRot;
}
else
{
float invTotal = 1.f / total;
for (auto it : _blendStates) {
float weight = (it.weight * invTotal);
translate += it.localTranslate * weight;
scale.x += it.localScale.x * weight;
scale.y += it.localScale.y * weight;
scale.z += it.localScale.z * weight;
if (!quat.isZero())
{
Quaternion& q = _blendStates[0].localRot;
if (q.x * quat.x + q.y * quat.y + q.z * quat.z + q.w * quat.w < 0)
weight = -weight;
}
quat = Quaternion(it.localRot.x * weight + quat.x, it.localRot.y * weight + quat.y, it.localRot.z * weight + quat.z, it.localRot.w * weight + quat.w);
}
}
}
Mat4::createTranslation(translate, &_local);
_local.rotate(quat);
_local.scale(scale);
_blendStates.clear();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static int PALETTE_ROWS = 3;
MeshSkin::MeshSkin()
@ -258,10 +44,10 @@ MeshSkin::MeshSkin()
MeshSkin::~MeshSkin()
{
removeAllBones();
CC_SAFE_RELEASE(_skeleton);
}
//create a new meshskin if do not want to share meshskin
MeshSkin* MeshSkin::create(const std::string& filename, const std::string& name)
MeshSkin* MeshSkin::create(Skeleton3D* skeleton, const std::string& filename, const std::string& name)
{
//load skin here;
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename);
@ -270,6 +56,8 @@ MeshSkin* MeshSkin::create(const std::string& filename, const std::string& name)
if (skindata)
{
auto skin = new MeshSkin();
skin->_skeleton = skeleton;
skeleton->retain();
skin->initFromSkinData(*skindata);
skin->autorelease();
return skin;
@ -284,6 +72,8 @@ MeshSkin* MeshSkin::create(const std::string& filename, const std::string& name)
if (instance->loadSkinData(name, &data))
{
auto skin = new MeshSkin();
skin->_skeleton = skeleton;
skeleton->retain();
skin->initFromSkinData(data);
skin->autorelease();
MeshSkinDataCache::getInstance()->addMeshSkinData(key, data);
@ -302,6 +92,7 @@ bool MeshSkin::initFromSkinData(const SkinData& skindata)
auto bone = Bone3D::create(skindata.skinBoneNames[i]);
bone->_invBindPose = skindata.inverseBindPoseMatrices[i];
bone->setOriPose(skindata.skinBoneOriginMatrices[i]);
_invBindPoses.push_back(skindata.inverseBindPoseMatrices[i]);
addSkinBone(bone);
}
for (i = 0; i < skindata.nodeBoneNames.size(); i++) {
@ -343,12 +134,12 @@ Bone3D* MeshSkin::getBoneByIndex(unsigned int index) const
Bone3D* MeshSkin::getBoneByName(const std::string& id) const
{
//search from skin bones
for (auto it : _skinBones) {
for (const auto& it : _skinBones) {
if (it->getName() == id)
return it;
}
//search from node bones
for (auto it : _nodeBones) {
for (const auto& it : _nodeBones) {
if (it->getName() == id )
return it;
}
@ -390,11 +181,15 @@ Vec4* MeshSkin::getMatrixPalette()
{
_matrixPalette = new Vec4[_skinBones.size() * PALETTE_ROWS];
}
int i = 0;
for (auto it : _skinBones )
{
it->updateJointMatrix(&_matrixPalette[i++ * PALETTE_ROWS]);
}
int i = 0, paletteIndex = 0;
static Mat4 t;
for (auto it : _skinBones )
{
Mat4::multiply(it->getWorldMat(), _invBindPoses[i++], &t);
_matrixPalette[paletteIndex++].set(t.m[0], t.m[4], t.m[8], t.m[12]);
_matrixPalette[paletteIndex++].set(t.m[1], t.m[5], t.m[9], t.m[13]);
_matrixPalette[paletteIndex++].set(t.m[2], t.m[6], t.m[10], t.m[14]);
}
return _matrixPalette;
}

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