mirror of https://github.com/axmolengine/axmol.git
commit
0c69023abd
5
AUTHORS
5
AUTHORS
|
@ -820,6 +820,7 @@ Developers:
|
|||
|
||||
aeonmine
|
||||
Fixed ActionObject memory leak in ActionManagerEx::initWithDictionary
|
||||
Fixed memory leak in cocos studiov2.0 reader
|
||||
|
||||
LoungeKatt
|
||||
Corrected a mistake of building android project in README.md
|
||||
|
@ -921,6 +922,7 @@ Developers:
|
|||
Fix the bug that UIButton doesn't support TTF font
|
||||
Fix a bug of TextReader
|
||||
Fix a bug that UITextField doesn't support TTF font
|
||||
Setted contentSize in CSLoader
|
||||
|
||||
gin0606
|
||||
Add a new line at the end of a file
|
||||
|
@ -1048,6 +1050,9 @@ Developers:
|
|||
|
||||
liamcindy
|
||||
update ui button size changed logic
|
||||
|
||||
vovkasm
|
||||
Fix warnings for Xcode6.1
|
||||
|
||||
Retired Core Developers:
|
||||
WenSheng Yang
|
||||
|
|
15
CHANGELOG
15
CHANGELOG
|
@ -1,12 +1,21 @@
|
|||
cocos2d-x-3.3 ??
|
||||
[NEW] Vec2: added greater than operator
|
||||
|
||||
[FIX] Audio: `SimpleAudioEngine::sharedEngine()->playBackgroundMusic()` crashed freezen on Lollipop(Android5.0)
|
||||
[FIX] Button: when the dimension of button title is larger than the button, button will scale to fit the dimension of the button title
|
||||
[FIX] Button: when the dimension of button title is larger than the button, button will scale to fit the dimension of the button title
|
||||
[FIX] Camera: does not work correctly when the up is not (0, 1, 0)
|
||||
[FIX] Cocos console: compile failure on windows if using VS express version
|
||||
[FIX] GrawNode: drawPoint() may cause crash
|
||||
[FIX] DrawNode: drawPoint() may cause crash
|
||||
[FIX] GLProgramCache: doesn't release old program with the same key before adding a new one
|
||||
[FIX] GLProgramState: enabled GLProgramState restoring on render recreated on WP8
|
||||
[FIX] Label: label shifting when outline feature enabled
|
||||
[FIX] Label: when applying additionalKerning to a Label that displays a string with only 1 character, the character is shifted
|
||||
[FIX] Label: display incompletely with multiline text with outline feature enabled
|
||||
[FIX] New audio: can not loop on Android 2.3.x
|
||||
[FIX] Scale9Sprite: will be flipped if both flipX and flipY are false
|
||||
[FIX] Scale9Sprite: if scale and flip property are set at the same time, the result would be wrong
|
||||
[FIX] Scene: setScale() doesn't work as expected
|
||||
[FIX] Sprite3D: did not create attached sprite from cache
|
||||
[FIX] WP/WinRT: Windows 8.1 universal app support; `UIEditBox` support
|
||||
|
||||
|
@ -33,7 +42,7 @@ cocos2d-x-3.3-rc0 Oct.21 2014
|
|||
[FIX] C++: remove armv7s in VALID_ARCHS for Xcode projects
|
||||
[FIX] Cocos Studio reader: UI animation playing crash if GUI JSON file is loaded again
|
||||
[FIX] Cocos Studio reader: improvement ImageViewReader don't necessary loadTexture when imageFilePath is empty
|
||||
[FIX] EditBox: view rendereed in wrong position if click EditBox on iOS 8
|
||||
[FIX] EditBox: view rendered in wrong position if click EditBox on iOS 8
|
||||
[FIX] FileUtils: can not remove files/directory on iOS devices
|
||||
[FIX] GLProgram: crashed on some Android devices that do not support more than 8 attributes
|
||||
[FIX] Label: getStringNumLines() may returns wrong result if label is dirty
|
||||
|
@ -103,7 +112,7 @@ cocos2d-x-3.3alpha0 Aug.28 2014
|
|||
[NEW] Sprite3D: added getBoundingBox() and getAABB()
|
||||
[NEW] SpriteFrameCache: load from plist file content data
|
||||
[NEW] utils: added gettime()
|
||||
[NEW] UI: Added Added UIScale9Sprite
|
||||
[NEW] UI: Added UIScale9Sprite
|
||||
[NEW] UI: ui::Button: support customize how much zoom scale is when pressing a button
|
||||
[NEW] UI: ui::PageView: added `customScrollThreshold`, could determine the swipe distance to trigger a PageView scroll event
|
||||
[NEW] UI: ui::TextField: support utf8
|
||||
|
|
|
@ -29,8 +29,8 @@ project (Cocos2d-X)
|
|||
# The version number
|
||||
set(COCOS2D_X_VERSION 3.3.0-beta0)
|
||||
|
||||
include(cmake/BuildHelpers.CMakeLists.txt)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
include(CocosBuildHelpers)
|
||||
|
||||
message(${BUILDING_STRING})
|
||||
|
||||
|
@ -123,7 +123,6 @@ else()
|
|||
endif()
|
||||
|
||||
include_directories(
|
||||
${PLATFORM_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cocos
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deprecated
|
||||
|
|
|
@ -23,7 +23,7 @@ mac build Instructions
|
|||
|
||||
cd cocos2d-x
|
||||
mkdir macbuild && cd macbuild
|
||||
cmake -G "Unix Makefile" -DBUILD_CPP_TESTS=OFF -DBUILD_LUA_LIBS=OFF ..
|
||||
cmake -G "Unix Makefiles" -DBUILD_CPP_TESTS=OFF -DBUILD_LUA_LIBS=OFF ..
|
||||
|
||||
Android Build Instructions
|
||||
|
||||
|
@ -35,6 +35,6 @@ mingw64 with msys2 build Instructions
|
|||
|
||||
cd cocos2d-x
|
||||
mkdir mingwbuild && cd mingwbuild
|
||||
cmake -G "MSYS Makefile" -DBUILD_CPP_TESTS=OFF -DBUILD_LUA_LIBS=OFF ..
|
||||
cmake -G "MSYS Makefiles" -DBUILD_CPP_TESTS=OFF -DBUILD_LUA_LIBS=OFF ..
|
||||
|
||||
todo: structure this document in markdown with better examples and more details
|
||||
todo: structure this document in markdown with better examples and more details
|
||||
|
|
|
@ -119,7 +119,7 @@ Main features
|
|||
Build Requirements
|
||||
------------------
|
||||
|
||||
* Mac OS X 10.7+, Xcode 4.6+
|
||||
* Mac OS X 10.7+, Xcode 5.1+
|
||||
* or Ubuntu 12.10+, CMake 2.6+
|
||||
* or Windows 7+, VS 2012+
|
||||
* Python 2.7.5
|
||||
|
|
|
@ -15,15 +15,8 @@ def get_num_of_cpu():
|
|||
''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.
|
||||
'''
|
||||
try:
|
||||
platform = sys.platform
|
||||
if platform == 'win32':
|
||||
if 'NUMBER_OF_PROCESSORS' in os.environ:
|
||||
return int(os.environ['NUMBER_OF_PROCESSORS'])
|
||||
else:
|
||||
return 1
|
||||
else:
|
||||
from numpy.distutils import cpuinfo
|
||||
return cpuinfo.cpu._getNCPUs()
|
||||
import multiprocessing
|
||||
return multiprocessing.cpu_count()
|
||||
except Exception:
|
||||
print "Can't know cpuinfo, use default 1 cpu"
|
||||
return 1
|
||||
|
|
|
@ -7231,7 +7231,6 @@
|
|||
CC_KEYBOARD_SUPPORT,
|
||||
_USRDLL,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LD_DYLIB_INSTALL_NAME = "";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
|
@ -7266,7 +7265,6 @@
|
|||
CC_TARGET_OS_MAC,
|
||||
_USRDLL,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LD_DYLIB_INSTALL_NAME = "";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
|
@ -7296,7 +7294,6 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
|
@ -7329,7 +7326,6 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
|
|
|
@ -5706,6 +5706,7 @@
|
|||
"CC_ENABLE_CHIPMUNK_INTEGRATION=1",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
|
@ -5733,6 +5734,7 @@
|
|||
"CC_ENABLE_CHIPMUNK_INTEGRATION=1",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
|
|
|
@ -23,8 +23,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\..\..
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4
|
||||
..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9
|
||||
..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9
|
||||
..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9
|
||||
|
@ -82,6 +85,18 @@ Global
|
|||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -94,5 +109,6 @@ Global
|
|||
{3B26A12D-3A44-47EA-82D2-282660FC844D} = {7CA66464-6A5E-493B-82EF-DBD84F91766F}
|
||||
{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
||||
{9335005F-678E-4E8E-9B84-50037216AEC8} = {29321038-F308-421E-B8CA-140BB23D3C6D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,71 +1,2 @@
|
|||
macro(pre_build TARGET_NAME)
|
||||
add_custom_target( ${TARGET_NAME}_PRE_BUILD ALL )
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}_PRE_BUILD
|
||||
${ARGN}
|
||||
PRE_BUILD
|
||||
COMMENT "${TARGET_NAME}_PRE_BUILD ..."
|
||||
)
|
||||
|
||||
add_custom_target(${TARGET_NAME}_CORE_PRE_BUILD)
|
||||
add_dependencies(${TARGET_NAME}_PRE_BUILD ${TARGET_NAME}_CORE_PRE_BUILD)
|
||||
add_dependencies(${TARGET_NAME} ${TARGET_NAME}_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(APPLE 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()
|
||||
# For compatibility only, please use include(CocosBuildHelpers) in future projects
|
||||
include(CocosBuildHelpers)
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
include(CMakeParseArguments)
|
||||
|
||||
macro(pre_build TARGET_NAME)
|
||||
add_custom_target( ${TARGET_NAME}_PRE_BUILD ALL )
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}_PRE_BUILD
|
||||
${ARGN}
|
||||
PRE_BUILD
|
||||
COMMENT "${TARGET_NAME}_PRE_BUILD ..."
|
||||
)
|
||||
|
||||
add_custom_target(${TARGET_NAME}_CORE_PRE_BUILD)
|
||||
add_dependencies(${TARGET_NAME}_PRE_BUILD ${TARGET_NAME}_CORE_PRE_BUILD)
|
||||
add_dependencies(${TARGET_NAME} ${TARGET_NAME}_PRE_BUILD)
|
||||
endmacro()
|
||||
|
||||
function(cocos_mark_resources)
|
||||
set(oneValueArgs BASEDIR RESOURCEBASE)
|
||||
set(multiValueArgs FILES)
|
||||
cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT opt_RESOURCEBASE)
|
||||
set(opt_RESOURCEBASE Resources)
|
||||
endif()
|
||||
|
||||
get_filename_component(BASEDIR_ABS ${opt_BASEDIR} ABSOLUTE)
|
||||
foreach(RES_FILE ${opt_FILES} ${opt_UNPARSED_ARGUMENTS})
|
||||
get_filename_component(RES_FILE_ABS ${RES_FILE} ABSOLUTE)
|
||||
file(RELATIVE_PATH RES ${BASEDIR_ABS} ${RES_FILE_ABS})
|
||||
get_filename_component(RES_LOC ${RES} PATH)
|
||||
set_source_files_properties(${RES_FILE} PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "${opt_RESOURCEBASE}/${RES_LOC}"
|
||||
HEADER_FILE_ONLY 1
|
||||
)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
#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 = MacOS X
|
||||
#LINUX = Linux
|
||||
|
||||
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(APPLE 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()
|
|
@ -66,9 +66,9 @@ Camera* Camera::createOrthographic(float zoomX, float zoomY, float nearPlane, fl
|
|||
}
|
||||
|
||||
Camera::Camera()
|
||||
: _cameraFlag(1)
|
||||
, _scene(nullptr)
|
||||
: _scene(nullptr)
|
||||
, _viewProjectionDirty(true)
|
||||
, _cameraFlag(1)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -130,12 +130,15 @@ void Camera::lookAt(const Vec3& lookAtPos, const Vec3& up)
|
|||
rotation.m[9] = zaxis.y;
|
||||
rotation.m[10] = zaxis.z;
|
||||
rotation.m[11] = 0;
|
||||
|
||||
Quaternion quaternion;
|
||||
Quaternion::createFromRotationMatrix(rotation,&quaternion);
|
||||
float fRoll = atan2(2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y) , 1 - 2 * (quaternion.z * quaternion.z + quaternion.x * quaternion.x));
|
||||
float fPitch = asin(clampf(2 * (quaternion.w * quaternion.x - quaternion.y * quaternion.z) , -1.0f , 1.0f));
|
||||
float fYaw = atan2(2 * (quaternion.w * quaternion.y + quaternion.z * quaternion.x) , 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y));
|
||||
setRotation3D(Vec3(CC_RADIANS_TO_DEGREES(fPitch),CC_RADIANS_TO_DEGREES(fYaw),CC_RADIANS_TO_DEGREES(fRoll)));
|
||||
|
||||
float rotx = atan2f(2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z), 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y));
|
||||
float roty = asin(clampf(2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x) , -1.0f , 1.0f));
|
||||
float rotz = -atan2(2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y) , 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z));
|
||||
|
||||
setRotation3D(Vec3(CC_RADIANS_TO_DEGREES(rotx),CC_RADIANS_TO_DEGREES(roty),CC_RADIANS_TO_DEGREES(rotz)));
|
||||
}
|
||||
|
||||
const Mat4& Camera::getViewProjectionMatrix() const
|
||||
|
|
|
@ -28,9 +28,16 @@ THE SOFTWARE.
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
//class Ray;
|
||||
class Scene;
|
||||
|
||||
/**
|
||||
* Note:
|
||||
* Scene creates a default camera. And the default camera mask of Node is 1, therefore it can be seen by the default camera.
|
||||
* During rendering the scene, it draws the objects seen by each camera in the added order except default camera. The default camera is the last one being drawn with.
|
||||
* If 3D objects exist, you'd better create a seperate camera for them. And set the 3d camera flag to CameraFlag::USER1 or anything else except DEFAULT. The DEFAULT camera is for UI, because it is rendered at last.
|
||||
* You can change the camera added order to get different result when depth test is not enabled.
|
||||
* For each camera, transparent 3d sprite is rendered after opaque 3d sprite and other 2d objects.
|
||||
*/
|
||||
enum class CameraFlag
|
||||
{
|
||||
DEFAULT = 1,
|
||||
|
|
|
@ -106,23 +106,23 @@ static inline Tex2F __t(const Vec2 &v)
|
|||
DrawNode::DrawNode()
|
||||
: _vao(0)
|
||||
, _vbo(0)
|
||||
, _vaoGLPoint(0)
|
||||
, _vboGLPoint(0)
|
||||
, _vaoGLLine(0)
|
||||
, _vboGLLine(0)
|
||||
, _bufferCapacity(0)
|
||||
, _bufferCount(0)
|
||||
, _buffer(nullptr)
|
||||
, _dirty(false)
|
||||
, _vaoGLPoint(0)
|
||||
, _vboGLPoint(0)
|
||||
, _bufferCapacityGLPoint(0)
|
||||
, _bufferCountGLPoint(0)
|
||||
, _bufferGLPoint(nullptr)
|
||||
, _pointColor(1,1,1,1)
|
||||
, _pointSize(1)
|
||||
, _dirtyGLPoint(false)
|
||||
, _vaoGLLine(0)
|
||||
, _vboGLLine(0)
|
||||
, _bufferCapacityGLLine(0)
|
||||
, _bufferCountGLLine(0)
|
||||
, _bufferGLLine(nullptr)
|
||||
, _dirty(false)
|
||||
, _dirtyGLPoint(false)
|
||||
, _dirtyGLLine(false)
|
||||
{
|
||||
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||
|
@ -348,6 +348,7 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t flags)
|
|||
}
|
||||
|
||||
glDrawArrays(GL_TRIANGLES, 0, _bufferCount);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferCount);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
@ -382,6 +383,7 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags)
|
|||
}
|
||||
glLineWidth(2);
|
||||
glDrawArrays(GL_LINES, 0, _bufferCountGLLine);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
@ -418,6 +420,7 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags)
|
|||
}
|
||||
|
||||
glDrawArrays(GL_POINTS, 0, _bufferCountGLPoint);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLPoint);
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
|
|
|
@ -113,11 +113,11 @@ TMXLayer::TMXLayer()
|
|||
, _tiles(nullptr)
|
||||
, _tileSet(nullptr)
|
||||
, _layerOrientation(FAST_TMX_ORIENTATION_ORTHO)
|
||||
,_texture(nullptr)
|
||||
, _texture(nullptr)
|
||||
, _vertexZvalue(0)
|
||||
, _useAutomaticVertexZ(false)
|
||||
, _dirty(true)
|
||||
, _quadsDirty(true)
|
||||
, _dirty(true)
|
||||
, _vertexBuffer(nullptr)
|
||||
, _vData(nullptr)
|
||||
, _indexBuffer(nullptr)
|
||||
|
|
|
@ -94,9 +94,9 @@ FT_Library FontFreeType::getFTLibrary()
|
|||
|
||||
FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */,int outline /* = 0 */)
|
||||
: _fontRef(nullptr)
|
||||
,_distanceFieldEnabled(distanceFieldEnabled)
|
||||
,_outlineSize(0.0f)
|
||||
,_stroker(nullptr)
|
||||
, _stroker(nullptr)
|
||||
, _distanceFieldEnabled(distanceFieldEnabled)
|
||||
, _outlineSize(0.0f)
|
||||
{
|
||||
if (outline > 0)
|
||||
{
|
||||
|
|
|
@ -235,30 +235,30 @@ bool Label::setCharMap(const std::string& charMapFile, int itemWidth, int itemHe
|
|||
|
||||
Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */,
|
||||
TextVAlignment vAlignment /* = TextVAlignment::TOP */,bool useDistanceField /* = false */,bool useA8Shader /* = false */)
|
||||
: _reusedLetter(nullptr)
|
||||
, _commonLineHeight(0.0f)
|
||||
: _isOpacityModifyRGB(false)
|
||||
, _contentDirty(false)
|
||||
, _fontAtlas(atlas)
|
||||
, _textSprite(nullptr)
|
||||
, _compatibleMode(false)
|
||||
, _reusedLetter(nullptr)
|
||||
, _additionalKerning(0.0f)
|
||||
, _commonLineHeight(0.0f)
|
||||
, _lineBreakWithoutSpaces(false)
|
||||
, _horizontalKernings(nullptr)
|
||||
, _maxLineWidth(0)
|
||||
, _labelDimensions(Size::ZERO)
|
||||
, _labelWidth(0)
|
||||
, _labelHeight(0)
|
||||
, _labelDimensions(Size::ZERO)
|
||||
, _hAlignment(hAlignment)
|
||||
, _vAlignment(vAlignment)
|
||||
, _horizontalKernings(nullptr)
|
||||
, _fontAtlas(atlas)
|
||||
, _isOpacityModifyRGB(false)
|
||||
, _currNumLines(-1)
|
||||
, _fontScale(1.0f)
|
||||
, _useDistanceField(useDistanceField)
|
||||
, _useA8Shader(useA8Shader)
|
||||
, _fontScale(1.0f)
|
||||
, _uniformEffectColor(0)
|
||||
, _currNumLines(-1)
|
||||
, _textSprite(nullptr)
|
||||
, _contentDirty(false)
|
||||
, _shadowDirty(false)
|
||||
, _compatibleMode(false)
|
||||
, _insideBounds(true)
|
||||
, _effectColorF(Color4F::BLACK)
|
||||
, _uniformEffectColor(0)
|
||||
, _shadowDirty(false)
|
||||
, _insideBounds(true)
|
||||
{
|
||||
setAnchorPoint(Vec2::ANCHOR_MIDDLE);
|
||||
reset();
|
||||
|
@ -395,7 +395,13 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false *
|
|||
_commonLineHeight = _fontAtlas->getCommonLineHeight();
|
||||
_contentDirty = true;
|
||||
}
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
|
||||
_useDistanceField = distanceFieldEnabled;
|
||||
#else
|
||||
// some older Windows Phones cannot run the ccShader_Label_df.frag program
|
||||
// so we must disable distance field
|
||||
_useDistanceField = false;
|
||||
#endif
|
||||
_useA8Shader = useA8Shader;
|
||||
|
||||
if (_currentLabelType != LabelType::TTF)
|
||||
|
|
|
@ -273,7 +273,7 @@ public:
|
|||
CC_DEPRECATED_ATTRIBUTE virtual void setFontDefinition(const FontDefinition& textDefinition);
|
||||
CC_DEPRECATED_ATTRIBUTE const FontDefinition& getFontDefinition() const { return _fontDefinition; }
|
||||
|
||||
CC_DEPRECATED_ATTRIBUTE int getCommonLineHeight() const { return getLineHeight();}
|
||||
CC_DEPRECATED_ATTRIBUTE int getCommonLineHeight() const { return (int)getLineHeight();}
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
/**
|
||||
|
|
|
@ -269,18 +269,16 @@ bool LabelTextFormatter::alignText(Label *theLabel)
|
|||
|
||||
bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
||||
{
|
||||
// check for string
|
||||
unsigned int stringLen = theLabel->getStringLength();
|
||||
theLabel->_limitShowCount = 0;
|
||||
|
||||
// no string
|
||||
if (stringLen == 0)
|
||||
// check for string
|
||||
int stringLen = theLabel->getStringLength();
|
||||
if (stringLen <= 0)
|
||||
return false;
|
||||
|
||||
int longestLine = 0;
|
||||
unsigned int totalHeight = theLabel->_commonLineHeight * theLabel->_currNumLines;
|
||||
int nextFontPositionX = 0;
|
||||
int nextFontPositionY = totalHeight;
|
||||
auto totalHeight = theLabel->_commonLineHeight * theLabel->_currNumLines;
|
||||
auto longestLine = 0.0f;
|
||||
auto nextFontPositionX = 0.0f;
|
||||
auto nextFontPositionY = totalHeight;
|
||||
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
|
||||
|
||||
if (theLabel->_labelHeight > 0)
|
||||
|
@ -307,7 +305,6 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
|||
}
|
||||
}
|
||||
|
||||
Rect charRect;
|
||||
int charXOffset = 0;
|
||||
int charYOffset = 0;
|
||||
int charAdvance = 0;
|
||||
|
@ -322,13 +319,13 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
|||
float clipBottom = 0;
|
||||
int lineIndex = 0;
|
||||
bool lineStart = true;
|
||||
bool clip = false;
|
||||
bool clipBlank = false;
|
||||
if (theLabel->_currentLabelType == Label::LabelType::TTF && theLabel->_clipEnabled)
|
||||
{
|
||||
clip = true;
|
||||
clipBlank = true;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < stringLen; i++)
|
||||
for (int i = 0; i < stringLen; i++)
|
||||
{
|
||||
char16_t c = strWhole[i];
|
||||
if (fontAtlas->getLetterDefinitionForChar(c, tempDefinition))
|
||||
|
@ -357,7 +354,7 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
|||
lineStart = true;
|
||||
continue;
|
||||
}
|
||||
else if (clip && tempDefinition.height > 0.0f)
|
||||
else if (clipBlank && tempDefinition.height > 0.0f)
|
||||
{
|
||||
if (lineStart)
|
||||
{
|
||||
|
@ -382,7 +379,7 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
|||
letterPosition.x = (nextFontPositionX + charXOffset + kernings[i]) / contentScaleFactor;
|
||||
letterPosition.y = (nextFontPositionY - charYOffset) / contentScaleFactor;
|
||||
|
||||
if( theLabel->recordLetterInfo(letterPosition,tempDefinition,i) == false)
|
||||
if( theLabel->recordLetterInfo(letterPosition, tempDefinition, i) == false)
|
||||
{
|
||||
log("WARNING: can't find letter definition in font file for letter: %c", c);
|
||||
continue;
|
||||
|
@ -420,7 +417,7 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
|
|||
tmpSize.height = theLabel->_labelHeight * contentScaleFactor;
|
||||
}
|
||||
|
||||
if (clip)
|
||||
if (clipBlank)
|
||||
{
|
||||
int clipTotal = (clipTop + clipBottom) / contentScaleFactor;
|
||||
tmpSize.height -= clipTotal * contentScaleFactor;
|
||||
|
|
|
@ -44,8 +44,8 @@ void BaseLight::setRotationFromDirection( const Vec3 &direction )
|
|||
|
||||
BaseLight::BaseLight()
|
||||
: _intensity(1.0f)
|
||||
, _enabled(true)
|
||||
, _lightFlag(LightFlag::LIGHT0)
|
||||
, _enabled(true)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -82,16 +82,18 @@ Node::Node(void)
|
|||
, _scaleX(1.0f)
|
||||
, _scaleY(1.0f)
|
||||
, _scaleZ(1.0f)
|
||||
, _positionZ(0.0f)
|
||||
, _position(Vec2::ZERO)
|
||||
, _positionZ(0.0f)
|
||||
, _usingNormalizedPosition(false)
|
||||
, _normalizedPositionDirty(false)
|
||||
, _skewX(0.0f)
|
||||
, _skewY(0.0f)
|
||||
, _anchorPointInPoints(Vec2::ZERO)
|
||||
, _anchorPoint(Vec2::ZERO)
|
||||
, _contentSize(Size::ZERO)
|
||||
, _useAdditionalTransform(false)
|
||||
, _transformDirty(true)
|
||||
, _inverseDirty(true)
|
||||
, _useAdditionalTransform(false)
|
||||
, _transformUpdated(true)
|
||||
// children (lazy allocs)
|
||||
// lazy alloc
|
||||
|
@ -100,6 +102,8 @@ Node::Node(void)
|
|||
, _parent(nullptr)
|
||||
// "whole screen" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true
|
||||
, _tag(Node::INVALID_TAG)
|
||||
, _name("")
|
||||
, _hashOfName(0)
|
||||
// userData is always inited as nil
|
||||
, _userData(nullptr)
|
||||
, _userObject(nullptr)
|
||||
|
@ -125,10 +129,6 @@ Node::Node(void)
|
|||
, _realColor(Color3B::WHITE)
|
||||
, _cascadeColorEnabled(false)
|
||||
, _cascadeOpacityEnabled(false)
|
||||
, _usingNormalizedPosition(false)
|
||||
, _normalizedPositionDirty(false)
|
||||
, _name("")
|
||||
, _hashOfName(0)
|
||||
, _cameraMask(1)
|
||||
{
|
||||
// set default scheduler and actionManager
|
||||
|
|
|
@ -40,7 +40,11 @@ NS_CC_BEGIN
|
|||
|
||||
// implementation RenderTexture
|
||||
RenderTexture::RenderTexture()
|
||||
: _FBO(0)
|
||||
: _keepMatrix(false)
|
||||
, _rtTextureRect(Rect::ZERO)
|
||||
, _fullRect(Rect::ZERO)
|
||||
, _fullviewPort(Rect::ZERO)
|
||||
, _FBO(0)
|
||||
, _depthRenderBufffer(0)
|
||||
, _oldFBO(0)
|
||||
, _texture(0)
|
||||
|
@ -53,10 +57,6 @@ RenderTexture::RenderTexture()
|
|||
, _clearStencil(0)
|
||||
, _autoDraw(false)
|
||||
, _sprite(nullptr)
|
||||
, _keepMatrix(false)
|
||||
, _rtTextureRect(Rect::ZERO)
|
||||
, _fullRect(Rect::ZERO)
|
||||
, _fullviewPort(Rect::ZERO)
|
||||
, _saveFileCallback(nullptr)
|
||||
{
|
||||
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||
|
@ -553,7 +553,7 @@ void RenderTexture::onBegin()
|
|||
director->setProjection(director->getProjection());
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
auto modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
modifiedProjection = GLViewImpl::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
|
||||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION,modifiedProjection);
|
||||
#endif
|
||||
|
@ -572,7 +572,7 @@ void RenderTexture::onBegin()
|
|||
else
|
||||
{
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
auto modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
modifiedProjection = GLViewImpl::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
|
||||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, modifiedProjection);
|
||||
#endif
|
||||
|
|
|
@ -129,6 +129,7 @@ void Scene::render(Renderer* renderer)
|
|||
{
|
||||
auto director = Director::getInstance();
|
||||
Camera* defaultCamera = nullptr;
|
||||
const auto& transform = getNodeToParentTransform();
|
||||
for (const auto& camera : _cameras)
|
||||
{
|
||||
Camera::_visitingCamera = camera;
|
||||
|
@ -142,7 +143,7 @@ void Scene::render(Renderer* renderer)
|
|||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||
|
||||
//visit the scene
|
||||
visit(renderer, Mat4::IDENTITY, 0);
|
||||
visit(renderer, transform, 0);
|
||||
renderer->render();
|
||||
|
||||
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
@ -155,7 +156,7 @@ void Scene::render(Renderer* renderer)
|
|||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||
|
||||
//visit the scene
|
||||
visit(renderer, Mat4::IDENTITY, 0);
|
||||
visit(renderer, transform, 0);
|
||||
renderer->render();
|
||||
|
||||
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
|
|
@ -55,6 +55,8 @@ For the moment Scene has no other logic than that, but in future releases it mig
|
|||
additional logic.
|
||||
|
||||
It is a good practice to use a Scene as the parent of all your nodes.
|
||||
|
||||
Scene will create a default camera for you.
|
||||
*/
|
||||
class CC_DLL Scene : public Node
|
||||
{
|
||||
|
|
|
@ -259,10 +259,10 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated)
|
|||
}
|
||||
|
||||
Sprite::Sprite(void)
|
||||
: _shouldBeHidden(false)
|
||||
: _batchNode(nullptr)
|
||||
, _shouldBeHidden(false)
|
||||
, _texture(nullptr)
|
||||
, _insideBounds(true)
|
||||
, _batchNode(nullptr)
|
||||
{
|
||||
#if CC_SPRITE_DEBUG_DRAW
|
||||
_debugDrawNode = DrawNode::create();
|
||||
|
|
|
@ -55,8 +55,8 @@ TextFieldTTF::TextFieldTTF()
|
|||
, _charCount(0)
|
||||
, _inputText("")
|
||||
, _placeHolder("") // prevent Label initWithString assertion
|
||||
, _secureTextEntry(false)
|
||||
, _colorText(Color4B::WHITE)
|
||||
, _secureTextEntry(false)
|
||||
{
|
||||
_colorSpaceHolder.r = _colorSpaceHolder.g = _colorSpaceHolder.b = 127;
|
||||
_colorSpaceHolder.a = 255;
|
||||
|
|
|
@ -53,12 +53,6 @@
|
|||
<Filter Include="platform\winrt">
|
||||
<UniqueIdentifier>{a2fd6c36-9078-45e7-bc11-c235357f565e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="platform\renderer">
|
||||
<UniqueIdentifier>{c52c9563-bc10-4b77-8bcc-0e061628fae7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="platform\renderer\shaders">
|
||||
<UniqueIdentifier>{1be811ab-a9b0-44f7-9a37-b7ef7f1ef24a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="cocosbuilder">
|
||||
<UniqueIdentifier>{794d19d1-2992-497a-a770-081932fa9242}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
@ -236,6 +230,12 @@
|
|||
<Filter Include="cocostudio\json\protobuf-lite\src\google\protobuf\stubs">
|
||||
<UniqueIdentifier>{b7fdf4e2-b3be-4b7a-b586-ddab39fb05b7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="renderer">
|
||||
<UniqueIdentifier>{c52c9563-bc10-4b77-8bcc-0e061628fae7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="renderer\shaders">
|
||||
<UniqueIdentifier>{1be811ab-a9b0-44f7-9a37-b7ef7f1ef24a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CCAction.cpp">
|
||||
|
@ -782,67 +782,67 @@
|
|||
<Filter>platform\winrt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCBatchCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCCustomCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCGLProgram.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCGLProgramCache.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCGLProgramState.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCGLProgramStateCache.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\ccGLStateCache.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCGroupCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCMeshCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCPrimitive.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCPrimitiveCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCQuadCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCRenderCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCRenderer.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\ccShaders.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCTexture2D.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCTextureAtlas.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCTextureCache.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCTrianglesCommand.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCVertexIndexBuffer.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\renderer\CCVertexIndexData.cpp">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2d.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocosbuilder\CCBAnimationManager.cpp">
|
||||
|
@ -1932,70 +1932,70 @@
|
|||
<Filter>platform\winrt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCBatchCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCCustomCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCGLProgram.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCGLProgramCache.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCGLProgramState.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCGLProgramStateCache.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\ccGLStateCache.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCGroupCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCMeshCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCPrimitive.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCPrimitiveCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCQuadCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCRenderCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCRenderCommandPool.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCRenderer.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\ccShaders.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCTexture2D.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCTextureAtlas.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCTextureCache.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCTrianglesCommand.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCVertexIndexBuffer.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\renderer\CCVertexIndexData.h">
|
||||
<Filter>platform\renderer</Filter>
|
||||
<Filter>renderer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\editor-support\cocosbuilder\CCBAnimationManager.h">
|
||||
<Filter>cocosbuilder\Header Files</Filter>
|
||||
|
@ -2586,70 +2586,70 @@
|
|||
<Filter>math</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Label.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Label_df.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Label_df_glow.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Label_normal.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Label_outline.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionColor.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionColor.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionColorLengthTexture.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionColorLengthTexture.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTexture.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTexture.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureA8Color.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureA8Color.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureColor.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureColor.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureColorAlphaTest.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureColor_noMVP.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTextureColor_noMVP.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTexture_uColor.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_PositionTexture_uColor.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Position_uColor.frag">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\renderer\ccShader_Position_uColor.vert">
|
||||
<Filter>platform\renderer\shaders</Filter>
|
||||
<Filter>renderer\shaders</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -15,7 +15,7 @@
|
|||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4056;4996;4244;4251;</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4056;4996;4244;4251;4756;</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;libchipmunk.lib;zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype250.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
|
|
@ -247,13 +247,13 @@ void Animate3D::setWeight(float weight)
|
|||
}
|
||||
|
||||
Animate3D::Animate3D()
|
||||
: _absSpeed(1.f)
|
||||
: _state(Animate3D::Animate3DState::Running)
|
||||
, _animation(nullptr)
|
||||
, _absSpeed(1.f)
|
||||
, _weight(1.f)
|
||||
, _start(0.f)
|
||||
, _last(1.f)
|
||||
, _animation(nullptr)
|
||||
, _playReverse(false)
|
||||
, _state(Animate3D::Animate3DState::Running)
|
||||
, _accTransTime(0.0f)
|
||||
, _lastTime(0.0f)
|
||||
{
|
||||
|
|
|
@ -103,8 +103,8 @@ float AnimationCurve<componentSize>::getEndTime() const
|
|||
|
||||
template <int componentSize>
|
||||
AnimationCurve<componentSize>::AnimationCurve()
|
||||
: _keytime(nullptr)
|
||||
, _value(nullptr)
|
||||
: _value(nullptr)
|
||||
, _keytime(nullptr)
|
||||
, _count(0)
|
||||
, _componentSizeByte(0)
|
||||
, _evaluateFun(nullptr)
|
||||
|
|
|
@ -58,7 +58,7 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
|
||||
|
||||
protected:
|
||||
Bone3D* _attachBone;
|
||||
Bone3D* _attachBone;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -306,20 +306,6 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, MaterialDatas& materialdatas, NodeD
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadMeshData(const std::string& id, MeshData* meshdata)
|
||||
{
|
||||
meshdata->resetData();
|
||||
|
||||
if (_isBinary)
|
||||
{
|
||||
return loadMeshDataBinary(meshdata);
|
||||
}
|
||||
else
|
||||
{
|
||||
return loadMeshDataJson(meshdata);
|
||||
}
|
||||
}
|
||||
|
||||
bool Bundle3D::loadSkinData(const std::string& id, SkinData* skindata)
|
||||
{
|
||||
skindata->resetData();
|
||||
|
@ -334,20 +320,6 @@ 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);
|
||||
}
|
||||
else
|
||||
{
|
||||
return loadMaterialDataJson(materialdata);
|
||||
}
|
||||
}
|
||||
|
||||
bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animationdata)
|
||||
{
|
||||
animationdata->resetData();
|
||||
|
@ -368,14 +340,10 @@ bool Bundle3D::loadMeshDatas(MeshDatas& meshdatas)
|
|||
meshdatas.resetData();
|
||||
if (_isBinary)
|
||||
{
|
||||
if (_version == "0.1")
|
||||
if (_version == "0.1" || _version == "0.2")
|
||||
{
|
||||
return loadMeshDatasBinary_0_1(meshdatas);
|
||||
}
|
||||
else if(_version == "0.2")
|
||||
{
|
||||
return loadMeshDatasBinary_0_2(meshdatas);
|
||||
}
|
||||
else
|
||||
{
|
||||
return loadMeshDatasBinary(meshdatas);
|
||||
|
@ -383,14 +351,10 @@ bool Bundle3D::loadMeshDatas(MeshDatas& meshdatas)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (_version == "1.2")
|
||||
if (_version == "1.2" || _version == "0.2")
|
||||
{
|
||||
return loadMeshDataJson_0_1(meshdatas);
|
||||
}
|
||||
else if(_version == "0.2")
|
||||
{
|
||||
return loadMeshDataJson_0_2(meshdatas);
|
||||
}
|
||||
else
|
||||
{
|
||||
return loadMeshDatasJson(meshdatas);
|
||||
|
@ -937,7 +901,7 @@ bool Bundle3D::loadMaterialsBinary_0_2(MaterialDatas& materialdatas)
|
|||
if (texturePath.empty())
|
||||
{
|
||||
CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str());
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
NTextureData textureData;
|
||||
|
@ -1005,6 +969,73 @@ bool Bundle3D::loadJson(const std::string& path)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Bundle3D::loadBinary(const std::string& path)
|
||||
{
|
||||
clear();
|
||||
|
||||
// get file data
|
||||
CC_SAFE_DELETE(_binaryBuffer);
|
||||
_binaryBuffer = new (std::nothrow) Data();
|
||||
*_binaryBuffer = FileUtils::getInstance()->getDataFromFile(path);
|
||||
if (_binaryBuffer->isNull())
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read file: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialise bundle reader
|
||||
_binaryReader.init( (char*)_binaryBuffer->getBytes(), _binaryBuffer->getSize() );
|
||||
|
||||
// Read identifier info
|
||||
char identifier[] = { 'C', '3', 'B', '\0'};
|
||||
char sig[4];
|
||||
if (_binaryReader.read(sig, 1, 4) != 4 || memcmp(sig, identifier, 4) != 0)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Invalid identifier: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read version
|
||||
unsigned char ver[2];
|
||||
if (_binaryReader.read(ver, 1, 2)!= 2){
|
||||
CCLOG("warning: Failed to read version:");
|
||||
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)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read ref table size '%s'.", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read all refs
|
||||
CC_SAFE_DELETE_ARRAY(_references);
|
||||
_references = new (std::nothrow) Reference[_referenceCount];
|
||||
for (ssize_t i = 0; i < _referenceCount; ++i)
|
||||
{
|
||||
if ((_references[i].id = _binaryReader.readString()).empty() ||
|
||||
_binaryReader.read(&_references[i].type, 4, 1) != 1 ||
|
||||
_binaryReader.read(&_references[i].offset, 4, 1) != 1)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read ref number %d for bundle '%s'.", (int)i, path.c_str());
|
||||
CC_SAFE_DELETE_ARRAY(_references);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadMeshDataJson_0_1(MeshDatas& meshdatas)
|
||||
{
|
||||
const rapidjson::Value& mesh_data_array = _jsonReader[MESH];
|
||||
|
@ -1145,6 +1176,108 @@ bool Bundle3D::loadSkinDataJson(SkinData* skindata)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Bundle3D::loadSkinDataBinary(SkinData* skindata)
|
||||
{
|
||||
if (!seekToFirstType(BUNDLE_TYPE_MESHSKIN))
|
||||
return false;
|
||||
|
||||
std::string boneName = _binaryReader.readString();
|
||||
|
||||
// transform
|
||||
float bindShape[16];
|
||||
if (!_binaryReader.readMatrix(bindShape))
|
||||
{
|
||||
CCLOG("warning: Failed to read SkinData: bindShape matrix '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// bone count
|
||||
unsigned int boneNum;
|
||||
if (!_binaryReader.read(&boneNum))
|
||||
{
|
||||
CCLOG("warning: Failed to read SkinData: boneNum '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// bone names and bind pos
|
||||
float bindpos[16];
|
||||
for (unsigned int i = 0; i < boneNum; i++)
|
||||
{
|
||||
std::string skinBoneName = _binaryReader.readString();
|
||||
skindata->skinBoneNames.push_back(skinBoneName);
|
||||
if (!_binaryReader.readMatrix(bindpos))
|
||||
{
|
||||
CCLOG("warning: Failed to load SkinData: bindpos '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
skindata->inverseBindPoseMatrices.push_back(bindpos);
|
||||
}
|
||||
|
||||
skindata->skinBoneOriginMatrices.resize(boneNum);
|
||||
|
||||
boneName = _binaryReader.readString();
|
||||
|
||||
// bind shape
|
||||
_binaryReader.readMatrix(bindShape);
|
||||
int rootIndex = skindata->getSkinBoneNameIndex(boneName);
|
||||
if(rootIndex < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(boneName);
|
||||
rootIndex = skindata->getBoneNameIndex(boneName);
|
||||
skindata->nodeBoneOriginMatrices.push_back(bindShape);
|
||||
}
|
||||
else
|
||||
{
|
||||
skindata->skinBoneOriginMatrices[rootIndex] = bindShape;
|
||||
}
|
||||
|
||||
// set root bone index
|
||||
skindata->rootBoneIndex = rootIndex;
|
||||
|
||||
// read parent and child relationship map
|
||||
float transform[16];
|
||||
unsigned int linkNum;
|
||||
_binaryReader.read(&linkNum);
|
||||
for (unsigned int i = 0; i < linkNum; ++i)
|
||||
{
|
||||
std::string id = _binaryReader.readString();
|
||||
int index = skindata->getSkinBoneNameIndex(id);
|
||||
|
||||
|
||||
std::string parentid = _binaryReader.readString();
|
||||
|
||||
if (!_binaryReader.readMatrix(transform))
|
||||
{
|
||||
CCLOG("warning: Failed to load SkinData: transform '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if(index < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(id);
|
||||
index = skindata->getBoneNameIndex(id);
|
||||
skindata->nodeBoneOriginMatrices.push_back(transform);
|
||||
}
|
||||
else
|
||||
{
|
||||
skindata->skinBoneOriginMatrices[index] = transform;
|
||||
}
|
||||
|
||||
int parentIndex = skindata->getSkinBoneNameIndex(parentid);
|
||||
if(parentIndex < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(parentid);
|
||||
parentIndex = skindata->getBoneNameIndex(parentid);
|
||||
}
|
||||
|
||||
skindata->boneChild[parentIndex].push_back(index);
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadMaterialDataJson_0_1(MaterialDatas& materialdatas)
|
||||
{
|
||||
if (!_jsonReader.HasMember(MATERIAL))
|
||||
|
@ -1269,361 +1402,6 @@ bool Bundle3D::loadAnimationDataJson(const std::string& id, Animation3DData* ani
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadBinary(const std::string& path)
|
||||
{
|
||||
clear();
|
||||
|
||||
// get file data
|
||||
CC_SAFE_DELETE(_binaryBuffer);
|
||||
_binaryBuffer = new (std::nothrow) Data();
|
||||
*_binaryBuffer = FileUtils::getInstance()->getDataFromFile(path);
|
||||
if (_binaryBuffer->isNull())
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read file: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialise bundle reader
|
||||
_binaryReader.init( (char*)_binaryBuffer->getBytes(), _binaryBuffer->getSize() );
|
||||
|
||||
// Read identifier info
|
||||
char identifier[] = { 'C', '3', 'B', '\0'};
|
||||
char sig[4];
|
||||
if (_binaryReader.read(sig, 1, 4) != 4 || memcmp(sig, identifier, 4) != 0)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Invalid identifier: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read version
|
||||
unsigned char ver[2];
|
||||
if (_binaryReader.read(ver, 1, 2)!= 2){
|
||||
CCLOG("warning: Failed to read version:");
|
||||
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)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read ref table size '%s'.", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read all refs
|
||||
CC_SAFE_DELETE_ARRAY(_references);
|
||||
_references = new (std::nothrow) Reference[_referenceCount];
|
||||
for (ssize_t i = 0; i < _referenceCount; ++i)
|
||||
{
|
||||
if ((_references[i].id = _binaryReader.readString()).empty() ||
|
||||
_binaryReader.read(&_references[i].type, 4, 1) != 1 ||
|
||||
_binaryReader.read(&_references[i].offset, 4, 1) != 1)
|
||||
{
|
||||
clear();
|
||||
CCLOG("warning: Failed to read ref number %d for bundle '%s'.", (int)i, path.c_str());
|
||||
CC_SAFE_DELETE_ARRAY(_references);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
CCLOG("warning: Unsupported version of loadMeshDataBinary() : %s", _version.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Bundle3D::loadMeshDataBinary_0_1(MeshData* meshdata)
|
||||
{
|
||||
if (!seekToFirstType(BUNDLE_TYPE_MESH))
|
||||
return false;
|
||||
|
||||
// read mesh data
|
||||
if (_binaryReader.read(&meshdata->attribCount, 4, 1) != 1 || meshdata->attribCount < 1)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read index data
|
||||
unsigned int meshPartCount = 1;
|
||||
//_binaryReader.read(&meshPartCount, 4, 1);
|
||||
|
||||
for (unsigned int i = 0; i < meshPartCount; ++i)
|
||||
{
|
||||
unsigned int nIndexCount;
|
||||
if (_binaryReader.read(&nIndexCount, 4, 1) != 1)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: Failed to read meshdata: vertex element '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// read submesh
|
||||
unsigned int submeshCount;
|
||||
if (_binaryReader.read(&submeshCount, 4, 1) != 1)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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)
|
||||
{
|
||||
CCLOG("warning: 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;
|
||||
|
||||
std::string boneName = _binaryReader.readString();
|
||||
|
||||
// transform
|
||||
float bindShape[16];
|
||||
if (!_binaryReader.readMatrix(bindShape))
|
||||
{
|
||||
CCLOG("warning: Failed to read SkinData: bindShape matrix '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// bone count
|
||||
unsigned int boneNum;
|
||||
if (!_binaryReader.read(&boneNum))
|
||||
{
|
||||
CCLOG("warning: Failed to read SkinData: boneNum '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// bone names and bind pos
|
||||
float bindpos[16];
|
||||
for (unsigned int i = 0; i < boneNum; i++)
|
||||
{
|
||||
std::string skinBoneName = _binaryReader.readString();
|
||||
skindata->skinBoneNames.push_back(skinBoneName);
|
||||
if (!_binaryReader.readMatrix(bindpos))
|
||||
{
|
||||
CCLOG("warning: Failed to load SkinData: bindpos '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
skindata->inverseBindPoseMatrices.push_back(bindpos);
|
||||
}
|
||||
|
||||
skindata->skinBoneOriginMatrices.resize(boneNum);
|
||||
|
||||
boneName = _binaryReader.readString();
|
||||
|
||||
// bind shape
|
||||
_binaryReader.readMatrix(bindShape);
|
||||
int rootIndex = skindata->getSkinBoneNameIndex(boneName);
|
||||
if(rootIndex < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(boneName);
|
||||
rootIndex = skindata->getBoneNameIndex(boneName);
|
||||
skindata->nodeBoneOriginMatrices.push_back(bindShape);
|
||||
}
|
||||
else
|
||||
{
|
||||
skindata->skinBoneOriginMatrices[rootIndex] = bindShape;
|
||||
}
|
||||
|
||||
// set root bone index
|
||||
skindata->rootBoneIndex = rootIndex;
|
||||
|
||||
// read parent and child relationship map
|
||||
float transform[16];
|
||||
unsigned int linkNum;
|
||||
_binaryReader.read(&linkNum);
|
||||
for (unsigned int i = 0; i < linkNum; ++i)
|
||||
{
|
||||
std::string id = _binaryReader.readString();
|
||||
int index = skindata->getSkinBoneNameIndex(id);
|
||||
|
||||
|
||||
std::string parentid = _binaryReader.readString();
|
||||
|
||||
if (!_binaryReader.readMatrix(transform))
|
||||
{
|
||||
CCLOG("warning: Failed to load SkinData: transform '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if(index < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(id);
|
||||
index = skindata->getBoneNameIndex(id);
|
||||
skindata->nodeBoneOriginMatrices.push_back(transform);
|
||||
}
|
||||
else
|
||||
{
|
||||
skindata->skinBoneOriginMatrices[index] = transform;
|
||||
}
|
||||
|
||||
int parentIndex = skindata->getSkinBoneNameIndex(parentid);
|
||||
if(parentIndex < 0)
|
||||
{
|
||||
skindata->addNodeBoneNames(parentid);
|
||||
parentIndex = skindata->getBoneNameIndex(parentid);
|
||||
}
|
||||
|
||||
skindata->boneChild[parentIndex].push_back(index);
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadMaterialDataBinary(MaterialData* materialdata)
|
||||
{
|
||||
if (!seekToFirstType(BUNDLE_TYPE_MATERIAL))
|
||||
return false;
|
||||
|
||||
unsigned int materialnum = 1;
|
||||
if (_version == "0.2")
|
||||
{
|
||||
_binaryReader.read(&materialnum, 4, 1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < materialnum; i++)
|
||||
{
|
||||
std::string texturePath = _binaryReader.readString();
|
||||
if (texturePath.empty())
|
||||
{
|
||||
CCLOG("warning: Failed to read Materialdata: texturePath is empty '%s'.", _path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string path = _modelPath + texturePath;
|
||||
materialdata->texturePaths[i] = path;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Bundle3D::loadAnimationDataBinary(const std::string& id, Animation3DData* animationdata)
|
||||
{
|
||||
if (!seekToFirstType(BUNDLE_TYPE_ANIMATIONS))
|
||||
|
@ -2181,14 +1959,14 @@ Reference* Bundle3D::seekToFirstType(unsigned int type)
|
|||
}
|
||||
|
||||
Bundle3D::Bundle3D()
|
||||
:_isBinary(false),
|
||||
_modelPath(""),
|
||||
: _modelPath(""),
|
||||
_path(""),
|
||||
_version(""),
|
||||
_jsonBuffer(nullptr),
|
||||
_binaryBuffer(nullptr),
|
||||
_referenceCount(0),
|
||||
_references(nullptr)
|
||||
_references(nullptr),
|
||||
_isBinary(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -58,24 +58,12 @@ public:
|
|||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
|
@ -95,6 +83,7 @@ public:
|
|||
protected:
|
||||
|
||||
bool loadJson(const std::string& path);
|
||||
bool loadBinary(const std::string& path);
|
||||
bool loadMeshDatasJson(MeshDatas& meshdatas);
|
||||
bool loadMeshDataJson_0_1(MeshDatas& meshdatas);
|
||||
bool loadMeshDataJson_0_2(MeshDatas& meshdatas);
|
||||
|
@ -111,44 +100,13 @@ protected:
|
|||
bool loadMeshDataJson_0_1(MeshData* meshdata){return true;}
|
||||
bool loadMeshDataJson_0_2(MeshData* meshdata){return true;}
|
||||
bool loadSkinDataJson(SkinData* skindata);
|
||||
bool loadSkinDataBinary(SkinData* skindata);
|
||||
bool loadMaterialDataJson(MaterialData* materialdata){return true;}
|
||||
bool loadMaterialDataJson_0_1(MaterialData* materialdata){return true;}
|
||||
bool loadMaterialDataJson_0_2(MaterialData* materialdata){return true;}
|
||||
bool loadAnimationDataJson(const std::string& id,Animation3DData* animationdata);
|
||||
/**
|
||||
* load data in binary
|
||||
* @param path The c3b file path
|
||||
*/
|
||||
bool loadBinary(const std::string& path);
|
||||
|
||||
/**
|
||||
* load mesh data in binary
|
||||
* @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
|
||||
* @param skindata The skin data pointer
|
||||
*/
|
||||
bool loadSkinDataBinary(SkinData* skindata);
|
||||
|
||||
/**
|
||||
* load material data in binary
|
||||
* @param materialdata The material pointer
|
||||
*/
|
||||
bool loadMaterialDataBinary(MaterialData* materialdata);
|
||||
|
||||
/**
|
||||
* load animation data in binary
|
||||
* @param animationdata The animation data pointer
|
||||
*/
|
||||
bool loadAnimationDataBinary(const std::string& id,Animation3DData* animationdata);
|
||||
|
||||
bool checkIsBone(const std::string& name);
|
||||
|
||||
/**
|
||||
* load nodes of json
|
||||
*/
|
||||
|
@ -196,12 +154,9 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
virtual ~Bundle3D();
|
||||
|
||||
protected:
|
||||
|
||||
static Bundle3D* _instance;
|
||||
|
||||
std::string _modelPath;
|
||||
std::string _path;
|
||||
|
||||
std::string _path;
|
||||
std::string _version;// the c3b or c3t version
|
||||
|
||||
// for json reading
|
||||
|
|
|
@ -364,10 +364,10 @@ public:
|
|||
}
|
||||
|
||||
Animation3DData(const Animation3DData& other)
|
||||
: _totalTime(other._totalTime)
|
||||
, _translationKeys(other._translationKeys)
|
||||
: _translationKeys(other._translationKeys)
|
||||
, _rotationKeys(other._rotationKeys)
|
||||
, _scaleKeys(other._scaleKeys)
|
||||
, _totalTime(other._totalTime)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -49,13 +49,16 @@ void BundleReader::init(char* buffer, ssize_t length)
|
|||
ssize_t BundleReader::read(void* ptr, ssize_t size, ssize_t count)
|
||||
{
|
||||
if (!_buffer || eof())
|
||||
{
|
||||
CCLOG("warning: bundle reader out of range");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t validCount;
|
||||
ssize_t validLength = _length - _position;
|
||||
ssize_t needLength = size*count;
|
||||
char* ptr1 = (char*)ptr;
|
||||
if(validLength <= needLength)
|
||||
if(validLength < needLength)
|
||||
{
|
||||
validCount = validLength/size;
|
||||
ssize_t readLength = size*validCount;
|
||||
|
|
|
@ -36,14 +36,14 @@ using namespace std;
|
|||
NS_CC_BEGIN
|
||||
|
||||
Mesh::Mesh()
|
||||
: _visible(true)
|
||||
, _texture(nullptr)
|
||||
: _texture(nullptr)
|
||||
, _skin(nullptr)
|
||||
, _visible(true)
|
||||
, _isTransparent(false)
|
||||
, _meshIndexData(nullptr)
|
||||
, _visibleChanged(nullptr)
|
||||
, _glProgramState(nullptr)
|
||||
, _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED)
|
||||
, _isTransparent(false)
|
||||
, _visibleChanged(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ static int PALETTE_ROWS = 3;
|
|||
|
||||
MeshSkin::MeshSkin()
|
||||
: _rootBone(nullptr)
|
||||
, _matrixPalette(nullptr)
|
||||
, _skeleton(nullptr)
|
||||
, _matrixPalette(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -94,15 +94,12 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata)
|
|||
vertexdata->_vertexData->setStream(vertexdata->_vertexBuffer, VertexStreamAttribute(offset, it.vertexAttrib, it.type, it.size));
|
||||
offset += it.attribSizeBytes;
|
||||
}
|
||||
vertexdata->_vertexData->setStream(vertexdata->_vertexBuffer, VertexStreamAttribute(0, GLProgram::VERTEX_ATTRIB_POSITION, GL_FLOAT, 3));
|
||||
vertexdata->_vertexData->setStream(vertexdata->_vertexBuffer, VertexStreamAttribute(offsetof(V3F_C4B_T2F, colors), GLProgram::VERTEX_ATTRIB_COLOR, GL_UNSIGNED_BYTE, 4, true));
|
||||
vertexdata->_vertexData->setStream(vertexdata->_vertexBuffer, VertexStreamAttribute(offsetof(V3F_C4B_T2F, texCoords), GLProgram::VERTEX_ATTRIB_TEX_COORD, GL_FLOAT, 2));
|
||||
|
||||
vertexdata->_attribs = meshdata.attribs;
|
||||
|
||||
if(vertexdata->_vertexBuffer)
|
||||
{
|
||||
vertexdata->_vertexBuffer->updateVertices((void*)&meshdata.vertex[0], (int)meshdata.vertex.size() * 4, 0);
|
||||
vertexdata->_vertexBuffer->updateVertices((void*)&meshdata.vertex[0], (int)meshdata.vertex.size() * 4 / vertexdata->_vertexBuffer->getSizePerVertex(), 0);
|
||||
}
|
||||
|
||||
AABB aabb;
|
||||
|
|
|
@ -414,7 +414,7 @@ bool OBB::intersects(const OBB& box) const
|
|||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
Vec3 axis;
|
||||
Vec3::cross(getFaceDirection(i), box.getFaceDirection(j), &axis);
|
||||
Vec3::cross(getEdgeDirection(i), box.getEdgeDirection(j), &axis);
|
||||
getInterval(*this, axis, min1, max1);
|
||||
getInterval(box, axis, min2, max2);
|
||||
if (max1 < min2 || max2 < min1) return false;
|
||||
|
|
|
@ -684,7 +684,7 @@ Mesh* Sprite3D::getMeshByIndex(int index) const
|
|||
return _meshes.at(index);
|
||||
}
|
||||
|
||||
/**get SubMeshState by Name */
|
||||
/**get Mesh by Name */
|
||||
Mesh* Sprite3D::getMeshByName(const std::string& name) const
|
||||
{
|
||||
for (const auto& it : _meshes) {
|
||||
|
@ -694,6 +694,16 @@ Mesh* Sprite3D::getMeshByName(const std::string& name) const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<Mesh*> Sprite3D::getMeshArrayByName(const std::string& name) const
|
||||
{
|
||||
std::vector<Mesh*> meshes;
|
||||
for (const auto& it : _meshes) {
|
||||
if (it->getName() == name)
|
||||
meshes.push_back(it);
|
||||
}
|
||||
return meshes;
|
||||
}
|
||||
|
||||
MeshSkin* Sprite3D::getSkin() const
|
||||
{
|
||||
for (const auto& it : _meshes) {
|
||||
|
|
|
@ -60,11 +60,14 @@ public:
|
|||
void setTexture(const std::string& texFile);
|
||||
void setTexture(Texture2D* texture);
|
||||
|
||||
/**get SubMeshState by index*/
|
||||
/**get Mesh by index*/
|
||||
Mesh* getMeshByIndex(int index) const;
|
||||
|
||||
/**get SubMeshState by Name */
|
||||
/**get Mesh by Name, it returns the first one if there are more than one mesh with the same name */
|
||||
Mesh* getMeshByName(const std::string& name) const;
|
||||
|
||||
/** get mesh array by name, returns all meshes with the given name */
|
||||
std::vector<Mesh*> getMeshArrayByName(const std::string& name) const;
|
||||
|
||||
/**get mesh*/
|
||||
Mesh* getMesh() const { return _meshes.at(0); }
|
||||
|
|
|
@ -48,18 +48,23 @@ include(network/CMakeLists.txt)
|
|||
include(audio/CMakeLists.txt)
|
||||
include(storage/CMakeLists.txt)
|
||||
|
||||
if(BUILD_EDITOR_COCOSBUILDER)
|
||||
include(editor-support/cocosbuilder/CMakeLists.txt)
|
||||
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CCB_SRC})
|
||||
endif(BUILD_EDITOR_COCOSBUILDER)
|
||||
|
||||
if(BUILD_EDITOR_COCOSTUDIO)
|
||||
include(editor-support/cocostudio/CMakeLists.txt)
|
||||
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CS_SRC})
|
||||
endif(BUILD_EDITOR_COCOSTUDIO)
|
||||
|
||||
if(BUILD_EDITOR_SPINE)
|
||||
include(editor-support/spine/CMakeLists.txt)
|
||||
set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_SPINE_SRC})
|
||||
endif(BUILD_EDITOR_SPINE)
|
||||
|
||||
include(../extensions/CMakeLists.txt)
|
||||
|
||||
set(COCOS_EDITOR_SUPPORT_SRC
|
||||
${COCOS_CCB_SRC}
|
||||
${COCOS_CS_SRC}
|
||||
${COCOS_SPINE_SRC}
|
||||
)
|
||||
|
||||
set(COCOS_SRC cocos2d.cpp
|
||||
${COCOS_2D_SRC}
|
||||
${COCOS_3D_SRC}
|
||||
|
@ -98,6 +103,7 @@ endif()
|
|||
if(MINGW)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(WebP REQUIRED)
|
||||
find_package(Protobuf REQUIRED)
|
||||
#find_package(MiniZip REQUIRED)
|
||||
#${MINIZIP_INCLUDE_DIR}
|
||||
|
||||
|
@ -112,8 +118,9 @@ if(MINGW)
|
|||
message( STATUS "WEBP dirs: ${WEBP_INCLUDE_DIRS}")
|
||||
message( STATUS "FREETYPE dirs: ${FREETYPE_INCLUDE_DIRS}")
|
||||
message( STATUS "Chipmunk dirs: ${CHIPMUNK_INCLUDE_DIRS}")
|
||||
message( STATUS "Protobuf dirs: ${PROTOBUF_INCLUDE_DIRS}")
|
||||
|
||||
include_directories(${FREETYPE_INCLUDE_DIRS} ${WEBP_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${CHIPMUNK_INCLUDE_DIRS})
|
||||
include_directories(${FREETYPE_INCLUDE_DIRS} ${WEBP_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${CHIPMUNK_INCLUDE_DIRS} ${PROTOBUF_INCLUDE_DIRS})
|
||||
|
||||
else()
|
||||
|
||||
|
@ -146,7 +153,7 @@ elseif(WINDOWS)
|
|||
set(PLATFORM_SPECIFIC_LIBS libjpeg libpng libwebp libtiff libcurl_imp libwebsockets freetype250 glfw3 glew32 opengl32 libiconv libzlib)
|
||||
elseif(LINUX)
|
||||
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets ssl crypto
|
||||
fontconfig png pthread glfw GLEW GL X11 rt z protobuf ${FMOD_LIB})
|
||||
fontconfig png pthread glfw GLEW GL X11 rt z ${FMOD_LIB})
|
||||
elseif(MACOSX OR APPLE)
|
||||
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )
|
||||
|
||||
|
@ -178,7 +185,7 @@ else()
|
|||
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
|
||||
endif()
|
||||
|
||||
target_link_libraries(cocos2d chipmunk box2d tinyxml2 unzip xxhash ${PLATFORM_SPECIFIC_LIBS})
|
||||
target_link_libraries(cocos2d chipmunk box2d protobuf tinyxml2 unzip xxhash ${PLATFORM_SPECIFIC_LIBS})
|
||||
|
||||
set_target_properties(cocos2d
|
||||
PROPERTIES
|
||||
|
|
|
@ -1,46 +1,51 @@
|
|||
|
||||
if(WINDOWS AND NOT BUILD_STATIC)
|
||||
ADD_DEFINITIONS (-D_EXPORT_DLL_)
|
||||
endif()
|
||||
set(COCOS_AUDIO_SRC
|
||||
audio/AudioEngine.cpp
|
||||
)
|
||||
|
||||
if(WINDOWS)
|
||||
set(COCOS_AUDIO_SRC
|
||||
audio/win32/SimpleAudioEngine.cpp
|
||||
audio/win32/MciPlayer.cpp
|
||||
audio/win32/MciPlayer.h
|
||||
)
|
||||
set(COCOS_AUDIO_PLATFORM_SRC
|
||||
audio/win32/SimpleAudioEngine.cpp
|
||||
audio/win32/MciPlayer.cpp
|
||||
audio/win32/MciPlayer.h
|
||||
)
|
||||
|
||||
elseif(LINUX)
|
||||
set(COCOS_AUDIO_SRC
|
||||
audio/linux/SimpleAudioEngineFMOD.cpp
|
||||
audio/linux/FmodAudioPlayer.cpp
|
||||
audio/linux/FmodAudioPlayer.h
|
||||
audio/linux/AudioPlayer.h
|
||||
)
|
||||
set(COCOS_AUDIO_PLATFORM_SRC
|
||||
audio/linux/SimpleAudioEngineFMOD.cpp
|
||||
audio/linux/FmodAudioPlayer.cpp
|
||||
audio/linux/FmodAudioPlayer.h
|
||||
audio/linux/AudioPlayer.h
|
||||
)
|
||||
|
||||
include_directories( ../external/linux-specific/fmod/include/${ARCH_DIR} )
|
||||
include_directories( ../external/linux-specific/fmod/include/${ARCH_DIR} )
|
||||
|
||||
elseif(MACOSX)
|
||||
# split it in _C and non C
|
||||
# because C files needs to be compiled with C compiler and not C++
|
||||
# compiler
|
||||
set(COCOS_AUDIO_SRC_C
|
||||
set(COCOS_AUDIO_PLATFORM_SRC_C
|
||||
audio/mac/CDAudioManager.m
|
||||
audio/mac/CDOpenALSupport.m
|
||||
audio/mac/CocosDenshion.m
|
||||
audio/mac/SimpleAudioEngine_objc.m
|
||||
)
|
||||
set(COCOS_AUDIO_SRC
|
||||
${COCOS_AUDIO_SRC_C}
|
||||
)
|
||||
set(COCOS_AUDIO_PLATFORM_SRC
|
||||
${COCOS_AUDIO_PLATFORM_SRC_C}
|
||||
audio/apple/AudioCache.mm
|
||||
audio/apple/AudioEngine-inl.mm
|
||||
audio/apple/AudioPlayer.mm
|
||||
audio/mac/SimpleAudioEngine.mm
|
||||
audio/mac/CDXMacOSXSupport.mm
|
||||
)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${COCOS_AUDIO_SRC_C}
|
||||
)
|
||||
set_source_files_properties(
|
||||
${COCOS_AUDIO_PLATFORM_SRC_C}
|
||||
PROPERTIES LANGUAGE C
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND COCOS_AUDIO_SRC ${COCOS_AUDIO_PLATFORM_SRC})
|
||||
|
||||
if(LINUX)
|
||||
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
set(FMOD_LIB "fmodex64")
|
||||
|
|
|
@ -46,7 +46,15 @@ void PlayOverEvent(SLPlayItf caller, void* context, SLuint32 playEvent)
|
|||
if (context && playEvent == SL_PLAYEVENT_HEADATEND)
|
||||
{
|
||||
AudioPlayer* player = (AudioPlayer*)context;
|
||||
player->_playOver = true;
|
||||
//fix issue#8965:AudioEngine can't looping audio on Android 2.3.x
|
||||
if (player->_loop)
|
||||
{
|
||||
(*(player->_fdPlayerPlay))->SetPlayState(player->_fdPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->_playOver = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,6 +63,7 @@ AudioPlayer::AudioPlayer()
|
|||
, _finishCallback(nullptr)
|
||||
, _duration(0.0f)
|
||||
, _playOver(false)
|
||||
, _loop(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -143,6 +152,7 @@ bool AudioPlayer::init(SLEngineItf engineEngine, SLObjectItf outputMixObject,con
|
|||
result = (*_fdPlayerObject)->GetInterface(_fdPlayerObject, SL_IID_VOLUME, &_fdPlayerVolume);
|
||||
if(SL_RESULT_SUCCESS != result){ ERRORLOG("get the volume interface fail"); break; }
|
||||
|
||||
_loop = loop;
|
||||
if (loop){
|
||||
(*_fdPlayerSeek)->SetLoop(_fdPlayerSeek, SL_BOOLEAN_TRUE, 0, SL_TIME_UNKNOWN);
|
||||
}
|
||||
|
@ -286,13 +296,14 @@ void AudioEngineImpl::setVolume(int audioID,float volume)
|
|||
}
|
||||
auto result = (*player._fdPlayerVolume)->SetVolumeLevel(player._fdPlayerVolume, dbVolume);
|
||||
if(SL_RESULT_SUCCESS != result){
|
||||
log("%s error:%lu",__func__, result);
|
||||
log("%s error:%u",__func__, result);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioEngineImpl::setLoop(int audioID, bool loop)
|
||||
{
|
||||
auto& player = _audioPlayers[audioID];
|
||||
player._loop = loop;
|
||||
SLboolean loopEnabled = SL_BOOLEAN_TRUE;
|
||||
if (!loop){
|
||||
loopEnabled = SL_BOOLEAN_FALSE;
|
||||
|
@ -305,7 +316,7 @@ void AudioEngineImpl::pause(int audioID)
|
|||
auto& player = _audioPlayers[audioID];
|
||||
auto result = (*player._fdPlayerPlay)->SetPlayState(player._fdPlayerPlay, SL_PLAYSTATE_PAUSED);
|
||||
if(SL_RESULT_SUCCESS != result){
|
||||
log("%s error:%lu",__func__, result);
|
||||
log("%s error:%u",__func__, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -314,7 +325,7 @@ void AudioEngineImpl::resume(int audioID)
|
|||
auto& player = _audioPlayers[audioID];
|
||||
auto result = (*player._fdPlayerPlay)->SetPlayState(player._fdPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
if(SL_RESULT_SUCCESS != result){
|
||||
log("%s error:%lu",__func__, result);
|
||||
log("%s error:%u",__func__, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,7 +334,7 @@ void AudioEngineImpl::stop(int audioID)
|
|||
auto& player = _audioPlayers[audioID];
|
||||
auto result = (*player._fdPlayerPlay)->SetPlayState(player._fdPlayerPlay, SL_PLAYSTATE_STOPPED);
|
||||
if(SL_RESULT_SUCCESS != result){
|
||||
log("%s error:%lu",__func__, result);
|
||||
log("%s error:%u",__func__, result);
|
||||
}
|
||||
|
||||
_audioPlayers.erase(audioID);
|
||||
|
|
|
@ -50,16 +50,15 @@ public:
|
|||
bool init(SLEngineItf engineEngine, SLObjectItf outputMixObject,const std::string& fileFullPath, float volume, bool loop);
|
||||
|
||||
bool _playOver;
|
||||
private:
|
||||
|
||||
SLObjectItf _fdPlayerObject;
|
||||
bool _loop;
|
||||
SLPlayItf _fdPlayerPlay;
|
||||
private:
|
||||
SLObjectItf _fdPlayerObject;
|
||||
SLSeekItf _fdPlayerSeek;
|
||||
SLVolumeItf _fdPlayerVolume;
|
||||
|
||||
float _duration;
|
||||
int _audioID;
|
||||
|
||||
|
||||
std::function<void (int, const std::string &)> _finishCallback;
|
||||
|
||||
|
|
|
@ -540,15 +540,15 @@ void Director::multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat)
|
|||
|
||||
void Director::pushMatrix(MATRIX_STACK_TYPE type)
|
||||
{
|
||||
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)
|
||||
if(type == MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW)
|
||||
{
|
||||
_modelViewMatrixStack.push(_modelViewMatrixStack.top());
|
||||
}
|
||||
else if(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION == type)
|
||||
else if(type == MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION)
|
||||
{
|
||||
_projectionMatrixStack.push(_projectionMatrixStack.top());
|
||||
}
|
||||
else if(MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE == type)
|
||||
else if(type == MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE)
|
||||
{
|
||||
_textureMatrixStack.push(_textureMatrixStack.top());
|
||||
}
|
||||
|
@ -558,36 +558,23 @@ void Director::pushMatrix(MATRIX_STACK_TYPE type)
|
|||
}
|
||||
}
|
||||
|
||||
Mat4 Director::getMatrix(MATRIX_STACK_TYPE type)
|
||||
const Mat4& Director::getMatrix(MATRIX_STACK_TYPE type)
|
||||
{
|
||||
Mat4 result;
|
||||
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)
|
||||
if(type == MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW)
|
||||
{
|
||||
result = _modelViewMatrixStack.top();
|
||||
return _modelViewMatrixStack.top();
|
||||
}
|
||||
else if(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION == type)
|
||||
else if(type == MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION)
|
||||
{
|
||||
result = _projectionMatrixStack.top();
|
||||
return _projectionMatrixStack.top();
|
||||
}
|
||||
else if(MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE == type)
|
||||
else if(type == MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE)
|
||||
{
|
||||
result = _textureMatrixStack.top();
|
||||
return _textureMatrixStack.top();
|
||||
}
|
||||
else
|
||||
{
|
||||
CCASSERT(false, "unknow matrix stack type, will return modelview matrix instead");
|
||||
result = _modelViewMatrixStack.top();
|
||||
}
|
||||
// float diffResult(0);
|
||||
// for (int index = 0; index <16; ++index)
|
||||
// {
|
||||
// diffResult += abs(result2.mat[index] - result.mat[index]);
|
||||
// }
|
||||
// if(diffResult > 1e-30)
|
||||
// {
|
||||
// CCASSERT(false, "Error in director matrix stack");
|
||||
// }
|
||||
return result;
|
||||
|
||||
CCASSERT(false, "unknow matrix stack type, will return modelview matrix instead");
|
||||
return _modelViewMatrixStack.top();
|
||||
}
|
||||
|
||||
void Director::setProjection(Projection projection)
|
||||
|
@ -717,17 +704,15 @@ static void GLToClipTransform(Mat4 *transformOut)
|
|||
|
||||
Director* director = Director::getInstance();
|
||||
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
|
||||
|
||||
Mat4 projection;
|
||||
projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
||||
auto projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
//if needed, we need to undo the rotation for Landscape orientation in order to get the correct positions
|
||||
projection = Director::getInstance()->getOpenGLView()->getReverseOrientationMatrix() * projection;
|
||||
#endif
|
||||
|
||||
Mat4 modelview;
|
||||
modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
auto modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
*transformOut = projection * modelview;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,27 +90,12 @@ enum class MATRIX_STACK_TYPE
|
|||
|
||||
class CC_DLL Director : public Ref
|
||||
{
|
||||
private:
|
||||
std::stack<Mat4> _modelViewMatrixStack;
|
||||
std::stack<Mat4> _projectionMatrixStack;
|
||||
std::stack<Mat4> _textureMatrixStack;
|
||||
protected:
|
||||
void initMatrixStack();
|
||||
public:
|
||||
void pushMatrix(MATRIX_STACK_TYPE type);
|
||||
void popMatrix(MATRIX_STACK_TYPE type);
|
||||
void loadIdentityMatrix(MATRIX_STACK_TYPE type);
|
||||
void loadMatrix(MATRIX_STACK_TYPE type, const Mat4& mat);
|
||||
void multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat);
|
||||
Mat4 getMatrix(MATRIX_STACK_TYPE type);
|
||||
void resetMatrixStack();
|
||||
public:
|
||||
static const char *EVENT_PROJECTION_CHANGED;
|
||||
static const char* EVENT_AFTER_UPDATE;
|
||||
static const char* EVENT_AFTER_VISIT;
|
||||
static const char* EVENT_AFTER_DRAW;
|
||||
|
||||
|
||||
/** @typedef ccDirectorProjection
|
||||
Possible OpenGL projections used by director
|
||||
*/
|
||||
|
@ -399,6 +384,14 @@ public:
|
|||
*/
|
||||
float getFrameRate() const { return _frameRate; }
|
||||
|
||||
void pushMatrix(MATRIX_STACK_TYPE type);
|
||||
void popMatrix(MATRIX_STACK_TYPE type);
|
||||
void loadIdentityMatrix(MATRIX_STACK_TYPE type);
|
||||
void loadMatrix(MATRIX_STACK_TYPE type, const Mat4& mat);
|
||||
void multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat);
|
||||
const Mat4& getMatrix(MATRIX_STACK_TYPE type);
|
||||
void resetMatrixStack();
|
||||
|
||||
protected:
|
||||
void purgeDirector();
|
||||
bool _purgeDirectorInNextLoop; // this flag will be set to true in end()
|
||||
|
@ -417,6 +410,12 @@ protected:
|
|||
void initTextureCache();
|
||||
void destroyTextureCache();
|
||||
|
||||
void initMatrixStack();
|
||||
|
||||
std::stack<Mat4> _modelViewMatrixStack;
|
||||
std::stack<Mat4> _projectionMatrixStack;
|
||||
std::stack<Mat4> _textureMatrixStack;
|
||||
|
||||
/** Scheduler associated with this director
|
||||
@since v2.0
|
||||
*/
|
||||
|
|
|
@ -30,8 +30,8 @@ NS_CC_BEGIN
|
|||
EventController::EventController(ControllerEventType type, Controller* controller, int keyCode)
|
||||
: Event(Type::GAME_CONTROLLER)
|
||||
, _controllerEventType(type)
|
||||
, _keyCode(keyCode)
|
||||
, _controller(controller)
|
||||
, _keyCode(keyCode)
|
||||
, _isConnected(true)
|
||||
{
|
||||
|
||||
|
@ -41,8 +41,8 @@ EventController::EventController(ControllerEventType type, Controller* controlle
|
|||
: Event(Type::GAME_CONTROLLER)
|
||||
, _controllerEventType(type)
|
||||
, _controller(controller)
|
||||
, _isConnected(isConnected)
|
||||
, _keyCode(0)
|
||||
, _isConnected(isConnected)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ NS_CC_BEGIN
|
|||
|
||||
EventFocus::EventFocus(ui::Widget *widgetLoseFocus, ui::Widget* widgetGetFocus)
|
||||
:Event(Type::FOCUS),
|
||||
_widgetLoseFocus(widgetLoseFocus),
|
||||
_widgetGetFocus(widgetGetFocus)
|
||||
_widgetGetFocus(widgetGetFocus),
|
||||
_widgetLoseFocus(widgetLoseFocus)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -52,10 +52,14 @@ public:
|
|||
//
|
||||
|
||||
public:
|
||||
std::function<bool(Touch*, Event*)> onTouchBegan;
|
||||
std::function<void(Touch*, Event*)> onTouchMoved;
|
||||
std::function<void(Touch*, Event*)> onTouchEnded;
|
||||
std::function<void(Touch*, Event*)> onTouchCancelled;
|
||||
|
||||
typedef std::function<bool(Touch*, Event*)> ccTouchBeganCallback;
|
||||
typedef std::function<void(Touch*, Event*)> ccTouchCallback;
|
||||
|
||||
ccTouchBeganCallback onTouchBegan;
|
||||
ccTouchCallback onTouchMoved;
|
||||
ccTouchCallback onTouchEnded;
|
||||
ccTouchCallback onTouchCancelled;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
EventListenerTouchOneByOne();
|
||||
|
@ -82,10 +86,13 @@ public:
|
|||
virtual bool checkAvailable() override;
|
||||
//
|
||||
public:
|
||||
std::function<void(const std::vector<Touch*>&, Event*)> onTouchesBegan;
|
||||
std::function<void(const std::vector<Touch*>&, Event*)> onTouchesMoved;
|
||||
std::function<void(const std::vector<Touch*>&, Event*)> onTouchesEnded;
|
||||
std::function<void(const std::vector<Touch*>&, Event*)> onTouchesCancelled;
|
||||
|
||||
typedef std::function<void(const std::vector<Touch*>&, Event*)> ccTouchesCallback;
|
||||
|
||||
ccTouchesCallback onTouchesBegan;
|
||||
ccTouchesCallback onTouchesMoved;
|
||||
ccTouchesCallback onTouchesEnded;
|
||||
ccTouchesCallback onTouchesCancelled;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
EventListenerTouchAllAtOnce();
|
||||
|
|
|
@ -189,7 +189,7 @@ static void untrackRef(Ref* ref)
|
|||
__refAllocationList.erase(iter);
|
||||
}
|
||||
|
||||
#endif // #if CC_USE_MEM_LEAK_DETECTION
|
||||
#endif // #if CC_REF_LEAK_DETECTION
|
||||
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -146,8 +146,8 @@ public:
|
|||
void* _scriptObject;
|
||||
#endif
|
||||
|
||||
// Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined and its value isn't zero)
|
||||
#if CC_USE_MEM_LEAK_DETECTION
|
||||
// Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero)
|
||||
#if CC_REF_LEAK_DETECTION
|
||||
public:
|
||||
static void printLeaks();
|
||||
#endif
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#define __SCRIPT_SUPPORT_H__
|
||||
|
||||
#include "base/ccConfig.h"
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
#include "platform/CCCommon.h"
|
||||
#include "base/CCTouch.h"
|
||||
#include "base/CCEventTouch.h"
|
||||
|
@ -37,6 +35,8 @@
|
|||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
typedef struct lua_State lua_State;
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
const ValueVector ValueVectorNull;
|
||||
const ValueMap ValueMapNull;
|
||||
const ValueMapIntKey ValueMapIntKeyNull;
|
||||
CC_DLL const ValueVector ValueVectorNull;
|
||||
CC_DLL const ValueMap ValueMapNull;
|
||||
CC_DLL const ValueMapIntKey ValueMapIntKeyNull;
|
||||
|
||||
const Value Value::Null;
|
||||
|
||||
|
|
|
@ -39,9 +39,9 @@ typedef std::vector<Value> ValueVector;
|
|||
typedef std::unordered_map<std::string, Value> ValueMap;
|
||||
typedef std::unordered_map<int, Value> ValueMapIntKey;
|
||||
|
||||
extern const ValueVector ValueVectorNull;
|
||||
extern const ValueMap ValueMapNull;
|
||||
extern const ValueMapIntKey ValueMapIntKeyNull;
|
||||
CC_DLL extern const ValueVector ValueVectorNull;
|
||||
CC_DLL extern const ValueMap ValueMapNull;
|
||||
CC_DLL extern const ValueMapIntKey ValueMapIntKeyNull;
|
||||
|
||||
class CC_DLL Value
|
||||
{
|
||||
|
|
|
@ -5,10 +5,10 @@ using namespace cocos2d;
|
|||
namespace cocosbuilder {
|
||||
|
||||
CCBKeyframe::CCBKeyframe()
|
||||
: _time(0.0f)
|
||||
: _object(nullptr)
|
||||
, _time(0.0f)
|
||||
, _easingType(EasingType::INSTANT)
|
||||
, _easingOpt(0.0f)
|
||||
, _object(nullptr)
|
||||
{}
|
||||
|
||||
CCBKeyframe::~CCBKeyframe()
|
||||
|
|
|
@ -78,6 +78,7 @@ ActionTimeline::ActionTimeline()
|
|||
, _startFrame(0)
|
||||
, _endFrame(0)
|
||||
, _frameEventListener(nullptr)
|
||||
, _lastFrameListener(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -186,6 +187,9 @@ void ActionTimeline::step(float delta)
|
|||
|
||||
if(_time > _endFrame * _frameInternal)
|
||||
{
|
||||
if(_lastFrameListener != nullptr)
|
||||
_lastFrameListener();
|
||||
|
||||
_playing = _loop;
|
||||
if(!_playing)
|
||||
_time = _endFrame * _frameInternal;
|
||||
|
@ -272,6 +276,15 @@ void ActionTimeline::clearFrameEventCallFunc()
|
|||
_frameEventListener = nullptr;
|
||||
}
|
||||
|
||||
void ActionTimeline::setLastFrameCallFunc(std::function<void()> listener)
|
||||
{
|
||||
_lastFrameListener = listener;
|
||||
}
|
||||
|
||||
void ActionTimeline::clearLastFrameCallFunc()
|
||||
{
|
||||
_lastFrameListener = nullptr;
|
||||
}
|
||||
|
||||
void ActionTimeline::emitFrameEvent(Frame* frame)
|
||||
{
|
||||
|
@ -283,6 +296,9 @@ void ActionTimeline::emitFrameEvent(Frame* frame)
|
|||
|
||||
void ActionTimeline::gotoFrame(int frameIndex)
|
||||
{
|
||||
if(_target == nullptr)
|
||||
return;
|
||||
|
||||
ssize_t size = _timelineList.size();
|
||||
for(ssize_t i = 0; i < size; i++)
|
||||
{
|
||||
|
|
|
@ -129,6 +129,10 @@ public:
|
|||
void setFrameEventCallFunc(std::function<void(Frame *)> listener);
|
||||
void clearFrameEventCallFunc();
|
||||
|
||||
/** Last frame callback will call when arriving last frame */
|
||||
void setLastFrameCallFunc(std::function<void()> listener);
|
||||
void clearLastFrameCallFunc();
|
||||
|
||||
/** Inherit from Action. */
|
||||
|
||||
/** Returns a clone of ActionTimeline */
|
||||
|
@ -163,6 +167,7 @@ protected:
|
|||
bool _loop;
|
||||
|
||||
std::function<void(Frame*)> _frameEventListener;
|
||||
std::function<void()> _lastFrameListener;
|
||||
};
|
||||
|
||||
NS_TIMELINE_END
|
||||
|
|
|
@ -733,11 +733,15 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithFileFromXML(const st
|
|||
// xml read
|
||||
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(fileName).c_str();
|
||||
ssize_t size;
|
||||
std::string content =(char*)FileUtils::getInstance()->getFileData(fullpath, "r", &size);
|
||||
|
||||
//fix memory leak for v3.3
|
||||
unsigned char* pByte = FileUtils::getInstance()->getFileData(fullpath, "r", &size);
|
||||
|
||||
// xml parse
|
||||
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
|
||||
document->Parse(content.c_str());
|
||||
document->Parse((const char*)pByte);
|
||||
|
||||
free(pByte);
|
||||
|
||||
const tinyxml2::XMLElement* rootElement = document->RootElement();// Root
|
||||
CCLOG("rootElement name = %s", rootElement->Name());
|
||||
|
|
|
@ -79,7 +79,7 @@ VisibleFrame::VisibleFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void VisibleFrame::onEnter(Frame *nextFrame)
|
||||
void VisibleFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setVisible(_visible);
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ void TextureFrame::setNode(Node* node)
|
|||
_sprite = dynamic_cast<Sprite*>(node);
|
||||
}
|
||||
|
||||
void TextureFrame::onEnter(Frame *nextFrame)
|
||||
void TextureFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
if(_sprite)
|
||||
{
|
||||
|
@ -166,10 +166,10 @@ RotationFrame::RotationFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void RotationFrame::onEnter(Frame *nextFrame)
|
||||
void RotationFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setRotation(_rotation);
|
||||
|
||||
|
||||
if(_tween)
|
||||
{
|
||||
_betwennRotation = static_cast<RotationFrame*>(nextFrame)->_rotation - _rotation;
|
||||
|
@ -216,11 +216,11 @@ SkewFrame::SkewFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void SkewFrame::onEnter(Frame *nextFrame)
|
||||
void SkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setSkewX(_skewX);
|
||||
_node->setSkewY(_skewY);
|
||||
|
||||
|
||||
if(_tween)
|
||||
{
|
||||
_betweenSkewX = static_cast<SkewFrame*>(nextFrame)->_skewX - _skewX;
|
||||
|
@ -271,11 +271,11 @@ RotationSkewFrame::RotationSkewFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void RotationSkewFrame::onEnter(Frame *nextFrame)
|
||||
void RotationSkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setRotationSkewX(_skewX);
|
||||
_node->setRotationSkewY(_skewY);
|
||||
|
||||
|
||||
if (_tween)
|
||||
{
|
||||
_betweenSkewX = static_cast<RotationSkewFrame*>(nextFrame)->_skewX - _skewX;
|
||||
|
@ -325,7 +325,7 @@ PositionFrame::PositionFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void PositionFrame::onEnter(Frame *nextFrame)
|
||||
void PositionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setPosition(_position);
|
||||
|
||||
|
@ -378,11 +378,11 @@ ScaleFrame::ScaleFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void ScaleFrame::onEnter(Frame *nextFrame)
|
||||
void ScaleFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setScaleX(_scaleX);
|
||||
_node->setScaleY(_scaleY);
|
||||
|
||||
|
||||
if(_tween)
|
||||
{
|
||||
_betweenScaleX = static_cast<ScaleFrame*>(nextFrame)->_scaleX - _scaleX;
|
||||
|
@ -432,7 +432,7 @@ AnchorPointFrame::AnchorPointFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void AnchorPointFrame::onEnter(Frame *nextFrame)
|
||||
void AnchorPointFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setAnchorPoint(_anchorPoint);
|
||||
}
|
||||
|
@ -469,7 +469,7 @@ InnerActionFrame::InnerActionFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void InnerActionFrame::onEnter(Frame *nextFrame)
|
||||
void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -505,11 +505,11 @@ ColorFrame::ColorFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void ColorFrame::onEnter(Frame *nextFrame)
|
||||
void ColorFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
_node->setOpacity(_alpha);
|
||||
_node->setColor(_color);
|
||||
|
||||
|
||||
if(_tween)
|
||||
{
|
||||
_betweenAlpha = static_cast<ColorFrame*>(nextFrame)->_alpha - _alpha;
|
||||
|
@ -573,9 +573,10 @@ EventFrame::EventFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void EventFrame::onEnter(Frame *nextFrame)
|
||||
void EventFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
emitEvent();
|
||||
if(currentFrameIndex>=_frameIndex)
|
||||
emitEvent();
|
||||
}
|
||||
|
||||
|
||||
|
@ -608,7 +609,7 @@ ZOrderFrame::ZOrderFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void ZOrderFrame::onEnter(Frame *nextFrame)
|
||||
void ZOrderFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||
{
|
||||
if(_node)
|
||||
_node->setLocalZOrder(_zorder);
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
virtual bool isEnterWhenPassed() { return _enterWhenPassed; }
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) = 0;
|
||||
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) = 0;
|
||||
virtual void apply(float percent) {}
|
||||
|
||||
virtual Frame* clone() = 0;
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
VisibleFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setVisible(bool visible) { _visible = visible;}
|
||||
|
@ -104,7 +104,7 @@ public:
|
|||
|
||||
virtual void setNode(cocos2d::Node* node);
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setTextureName(std::string textureName) { _textureName = textureName;}
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
|
||||
RotationFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
|
||||
SkewFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
|
||||
RotationSkewFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
};
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
|
||||
PositionFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
|
@ -205,7 +205,7 @@ public:
|
|||
|
||||
ScaleFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
|
@ -232,7 +232,7 @@ public:
|
|||
|
||||
AnchorPointFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setAnchorPoint(const cocos2d::Point& point) { _anchorPoint = point; }
|
||||
|
@ -257,7 +257,7 @@ public:
|
|||
static InnerActionFrame* create();
|
||||
InnerActionFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setInnerActionType(InnerActionType type) { _innerActionType = type; }
|
||||
|
@ -278,7 +278,7 @@ public:
|
|||
static ColorFrame* create();
|
||||
ColorFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual void apply(float percent) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
|
@ -307,7 +307,7 @@ public:
|
|||
|
||||
EventFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setEvent(std::string event) { _event = event;}
|
||||
|
@ -324,7 +324,7 @@ public:
|
|||
|
||||
ZOrderFrame();
|
||||
|
||||
virtual void onEnter(Frame *nextFrame) override;
|
||||
virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override;
|
||||
virtual Frame* clone() override;
|
||||
|
||||
inline void setZOrder(int zorder) { _zorder = zorder;}
|
||||
|
|
|
@ -202,7 +202,7 @@ void Timeline::binarySearchKeyFrame(int frameIndex)
|
|||
if(needEnterFrame || _currentKeyFrame != from)
|
||||
{
|
||||
_currentKeyFrame = from;
|
||||
_currentKeyFrame->onEnter(to);
|
||||
_currentKeyFrame->onEnter(to, frameIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ void Timeline::updateCurrentKeyFrame(int frameIndex)
|
|||
if(frameIndex > from->getFrameIndex() && frameIndex < to->getFrameIndex())
|
||||
break;
|
||||
if(from->isEnterWhenPassed())
|
||||
from->onEnter(to);
|
||||
from->onEnter(to, from->getFrameIndex());
|
||||
}
|
||||
while (true);
|
||||
|
||||
|
@ -264,7 +264,7 @@ void Timeline::updateCurrentKeyFrame(int frameIndex)
|
|||
} while (0);
|
||||
|
||||
_currentKeyFrame = from;
|
||||
_currentKeyFrame->onEnter(to);
|
||||
_currentKeyFrame->onEnter(to, frameIndex);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -449,7 +449,8 @@ void CSLoader::initNode(Node* node, const rapidjson::Value& json)
|
|||
Node* CSLoader::loadSimpleNode(const rapidjson::Value& json)
|
||||
{
|
||||
Node* node = Node::create();
|
||||
node->retain();
|
||||
// fix memory leak for v3.3
|
||||
//node->retain();
|
||||
initNode(node, json);
|
||||
|
||||
return node;
|
||||
|
@ -468,8 +469,8 @@ Node* CSLoader::loadSubGraph(const rapidjson::Value& json)
|
|||
{
|
||||
node = Node::create();
|
||||
}
|
||||
|
||||
node->retain();
|
||||
// fix memory leak for v3.3
|
||||
//node->retain();
|
||||
|
||||
initNode(node, json);
|
||||
|
||||
|
@ -507,7 +508,8 @@ Node* CSLoader::loadSprite(const rapidjson::Value& json)
|
|||
sprite = Sprite::create();
|
||||
}
|
||||
|
||||
sprite->retain();
|
||||
// fix memory leak for v3.3
|
||||
//sprite->retain();
|
||||
|
||||
initNode(sprite, json);
|
||||
|
||||
|
@ -529,7 +531,8 @@ Node* CSLoader::loadParticle(const rapidjson::Value& json)
|
|||
|
||||
ParticleSystemQuad* particle = ParticleSystemQuad::create(filePath);
|
||||
particle->setTotalParticles(num);
|
||||
particle->retain();
|
||||
// fix memory leak for v3.3
|
||||
//particle->retain();
|
||||
|
||||
initNode(particle, json);
|
||||
|
||||
|
@ -578,7 +581,8 @@ Node* CSLoader::loadWidget(const rapidjson::Value& json)
|
|||
|
||||
std::string guiClassName = getGUIClassName(classname);
|
||||
widget = dynamic_cast<Widget*>(ObjectFactory::getInstance()->createObject(guiClassName));
|
||||
widget->retain();
|
||||
// fix memory leak for v3.3
|
||||
//widget->retain();
|
||||
|
||||
WidgetReaderProtocol* reader = dynamic_cast<WidgetReaderProtocol*>(ObjectFactory::getInstance()->createObject(readerName));
|
||||
|
||||
|
@ -587,7 +591,9 @@ Node* CSLoader::loadWidget(const rapidjson::Value& json)
|
|||
else if (isCustomWidget(classname))
|
||||
{
|
||||
widget = dynamic_cast<Widget*>(ObjectFactory::getInstance()->createObject(classname));
|
||||
widget->retain();
|
||||
|
||||
//fix memory leak for v3.3
|
||||
//widget->retain();
|
||||
|
||||
//
|
||||
// 1st., custom widget parse properties of parent widget with parent widget reader
|
||||
|
@ -826,7 +832,8 @@ Node* CSLoader::nodeFromProtocolBuffers(const protocolbuffers::NodeTree &nodetre
|
|||
readerName.append("Reader");
|
||||
|
||||
Widget* widget = dynamic_cast<Widget*>(ObjectFactory::getInstance()->createObject(guiClassName));
|
||||
widget->retain();
|
||||
//fix memory leak for v3.3
|
||||
//widget->retain();
|
||||
|
||||
WidgetReaderProtocol* reader = dynamic_cast<WidgetReaderProtocol*>(ObjectFactory::getInstance()->createObject(readerName));
|
||||
reader->setPropsFromProtocolBuffers(widget, nodetree);
|
||||
|
@ -840,7 +847,9 @@ Node* CSLoader::nodeFromProtocolBuffers(const protocolbuffers::NodeTree &nodetre
|
|||
else if (isCustomWidget(classname))
|
||||
{
|
||||
Widget* widget = dynamic_cast<Widget*>(ObjectFactory::getInstance()->createObject(classname));
|
||||
widget->retain();
|
||||
|
||||
//fix memory leak for v3.3
|
||||
//widget->retain();
|
||||
|
||||
//
|
||||
// 1st., custom widget parse properties of parent widget with parent widget reader
|
||||
|
@ -946,6 +955,8 @@ void CSLoader::setPropsForNodeFromProtocolBuffers(cocos2d::Node *node,
|
|||
int tag = options.tag();
|
||||
int actionTag = options.actiontag();
|
||||
bool visible = options.visible();
|
||||
float w = options.width();
|
||||
float h = options.height();
|
||||
|
||||
node->setName(name);
|
||||
|
||||
|
@ -967,6 +978,8 @@ void CSLoader::setPropsForNodeFromProtocolBuffers(cocos2d::Node *node,
|
|||
node->setLocalZOrder(zorder);
|
||||
if(visible != true)
|
||||
node->setVisible(visible);
|
||||
if (w != 0 || h != 0)
|
||||
node->setContentSize(Size(w, h));
|
||||
|
||||
node->setTag(tag);
|
||||
node->setUserObject(ActionTimelineData::create(actionTag));
|
||||
|
@ -1042,8 +1055,8 @@ void CSLoader::setPropsForSpriteFromProtocolBuffers(cocos2d::Node *node,
|
|||
CCLOG("filePath is empty. Create a sprite with no texture");
|
||||
}
|
||||
*/
|
||||
|
||||
sprite->retain();
|
||||
//fix memory leak for v3.3
|
||||
//sprite->retain();
|
||||
|
||||
setPropsForNodeFromProtocolBuffers(sprite, nodeOptions);
|
||||
|
||||
|
@ -1241,11 +1254,15 @@ Node* CSLoader::nodeFromXMLFile(const std::string &fileName)
|
|||
// xml read
|
||||
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(fileName).c_str();
|
||||
ssize_t size;
|
||||
std::string content =(char*)FileUtils::getInstance()->getFileData(fullpath, "r", &size);
|
||||
|
||||
//fix memory leak for v3.3
|
||||
unsigned char* pByte = FileUtils::getInstance()->getFileData(fullpath, "r", &size);
|
||||
|
||||
// xml parse
|
||||
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
|
||||
document->Parse(content.c_str());
|
||||
document->Parse((const char*)pByte);
|
||||
|
||||
free(pByte);
|
||||
|
||||
const tinyxml2::XMLElement* rootElement = document->RootElement();// Root
|
||||
CCLOG("rootElement name = %s", rootElement->Name());
|
||||
|
@ -1404,7 +1421,9 @@ Node* CSLoader::nodeFromXML(const tinyxml2::XMLElement *objectData, const std::s
|
|||
readerName.append("Reader");
|
||||
|
||||
Widget* widget = dynamic_cast<Widget*>(ObjectFactory::getInstance()->createObject(guiClassName));
|
||||
widget->retain();
|
||||
|
||||
//fix memory leak for v3.3
|
||||
//widget->retain();
|
||||
|
||||
WidgetReaderProtocol* reader = dynamic_cast<WidgetReaderProtocol*>(ObjectFactory::getInstance()->createObject(readerName));
|
||||
reader->setPropsFromXML(widget, objectData);
|
||||
|
|
|
@ -188,21 +188,20 @@ void Bone::update(float delta)
|
|||
|
||||
if (_boneTransformDirty)
|
||||
{
|
||||
_worldInfo->copy(_tweenData);
|
||||
if (_dataVersion >= VERSION_COMBINED)
|
||||
{
|
||||
TransformHelp::nodeConcat(*_tweenData, *_boneData);
|
||||
_tweenData->scaleX -= 1;
|
||||
_tweenData->scaleY -= 1;
|
||||
TransformHelp::nodeConcat(*_worldInfo, *_boneData);
|
||||
_worldInfo->scaleX -= 1;
|
||||
_worldInfo->scaleY -= 1;
|
||||
}
|
||||
|
||||
_worldInfo->copy(_tweenData);
|
||||
|
||||
_worldInfo->x = _tweenData->x + _position.x;
|
||||
_worldInfo->y = _tweenData->y + _position.y;
|
||||
_worldInfo->scaleX = _tweenData->scaleX * _scaleX;
|
||||
_worldInfo->scaleY = _tweenData->scaleY * _scaleY;
|
||||
_worldInfo->skewX = _tweenData->skewX + _skewX + CC_DEGREES_TO_RADIANS(_rotationZ_X);
|
||||
_worldInfo->skewY = _tweenData->skewY + _skewY - CC_DEGREES_TO_RADIANS(_rotationZ_Y);
|
||||
_worldInfo->x = _worldInfo->x + _position.x;
|
||||
_worldInfo->y = _worldInfo->y + _position.y;
|
||||
_worldInfo->scaleX = _worldInfo->scaleX * _scaleX;
|
||||
_worldInfo->scaleY = _worldInfo->scaleY * _scaleY;
|
||||
_worldInfo->skewX = _worldInfo->skewX + _skewX + CC_DEGREES_TO_RADIANS(_rotationZ_X);
|
||||
_worldInfo->skewY = _worldInfo->skewY + _skewY - CC_DEGREES_TO_RADIANS(_rotationZ_Y);
|
||||
|
||||
if(_parentBone)
|
||||
{
|
||||
|
|
|
@ -330,7 +330,7 @@ void DataReaderHelper::addDataFromFile(const std::string& filePath)
|
|||
DataReaderHelper::addDataFromBinaryCache(contentStr.c_str(),&dataInfo);
|
||||
}
|
||||
|
||||
CC_SAFE_DELETE_ARRAY(pBytes);
|
||||
free(pBytes);
|
||||
}
|
||||
|
||||
void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const std::string& plistPath, const std::string& filePath, Ref *target, SEL_SCHEDULE selector)
|
||||
|
@ -429,7 +429,9 @@ void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const
|
|||
Data bytecpy;
|
||||
bytecpy.copy(pBytes, size);
|
||||
data->fileContent = std::string((const char*)bytecpy.getBytes(), size);
|
||||
CC_SAFE_DELETE_ARRAY(pBytes);
|
||||
|
||||
// fix memory leak for v3.3
|
||||
free(pBytes);
|
||||
|
||||
if (str == ".xml")
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ SceneReader::SceneReader()
|
|||
ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAttribute));
|
||||
ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComRender));
|
||||
ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAudio));
|
||||
ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComController));
|
||||
ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComController));
|
||||
}
|
||||
|
||||
SceneReader::~SceneReader()
|
||||
|
@ -57,13 +57,13 @@ const char* SceneReader::sceneReaderVersion()
|
|||
cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, AttachComponentType attachComponent /*= AttachComponentType::EMPTY_NODE*/)
|
||||
{
|
||||
std::string reDir = fileName;
|
||||
std::string file_extension = "";
|
||||
size_t pos = reDir.find_last_of('.');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
file_extension = reDir.substr(pos, reDir.length());
|
||||
std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper);
|
||||
}
|
||||
std::string file_extension = "";
|
||||
size_t pos = reDir.find_last_of('.');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
file_extension = reDir.substr(pos, reDir.length());
|
||||
std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper);
|
||||
}
|
||||
if (file_extension == ".JSON")
|
||||
{
|
||||
_node = nullptr;
|
||||
|
@ -78,7 +78,7 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName,
|
|||
}
|
||||
else if(file_extension == ".CSB")
|
||||
{
|
||||
do {
|
||||
do {
|
||||
std::string binaryFilePath = CCFileUtils::getInstance()->fullPathForFilename(fileName);
|
||||
auto fileData = FileUtils::getInstance()->getDataFromFile(binaryFilePath);
|
||||
auto fileDataBytes = fileData.getBytes();
|
||||
|
@ -86,90 +86,90 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName,
|
|||
CocoLoader tCocoLoader;
|
||||
if (tCocoLoader.ReadCocoBinBuff((char*)fileDataBytes))
|
||||
{
|
||||
stExpCocoNode *tpRootCocoNode = tCocoLoader.GetRootCocoNode();
|
||||
rapidjson::Type tType = tpRootCocoNode->GetType(&tCocoLoader);
|
||||
if (rapidjson::kObjectType == tType)
|
||||
{
|
||||
stExpCocoNode *tpChildArray = tpRootCocoNode->GetChildArray(&tCocoLoader);
|
||||
CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0);
|
||||
_node = Node::create();
|
||||
int nCount = 0;
|
||||
std::vector<Component*> _vecComs;
|
||||
ComRender *pRender = nullptr;
|
||||
std::string key = tpChildArray[15].GetName(&tCocoLoader);
|
||||
if (key == "components")
|
||||
{
|
||||
nCount = tpChildArray[15].GetChildNum();
|
||||
}
|
||||
stExpCocoNode *pComponents = tpChildArray[15].GetChildArray(&tCocoLoader);
|
||||
SerData *data = new (std::nothrow) SerData();
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
stExpCocoNode *subDict = pComponents[i].GetChildArray(&tCocoLoader);
|
||||
if (subDict == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string key1 = subDict[1].GetName(&tCocoLoader);
|
||||
const char *comName = subDict[1].GetValue(&tCocoLoader);
|
||||
Component *pCom = nullptr;
|
||||
if (key1 == "classname" && comName != nullptr)
|
||||
{
|
||||
pCom = createComponent(comName);
|
||||
}
|
||||
CCLOG("classname = %s", comName);
|
||||
if (pCom != nullptr)
|
||||
{
|
||||
data->_rData = nullptr;
|
||||
data->_cocoNode = subDict;
|
||||
stExpCocoNode *tpRootCocoNode = tCocoLoader.GetRootCocoNode();
|
||||
rapidjson::Type tType = tpRootCocoNode->GetType(&tCocoLoader);
|
||||
if (rapidjson::kObjectType == tType)
|
||||
{
|
||||
stExpCocoNode *tpChildArray = tpRootCocoNode->GetChildArray(&tCocoLoader);
|
||||
CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0);
|
||||
_node = Node::create();
|
||||
int nCount = 0;
|
||||
std::vector<Component*> _vecComs;
|
||||
ComRender *pRender = nullptr;
|
||||
std::string key = tpChildArray[15].GetName(&tCocoLoader);
|
||||
if (key == "components")
|
||||
{
|
||||
nCount = tpChildArray[15].GetChildNum();
|
||||
}
|
||||
stExpCocoNode *pComponents = tpChildArray[15].GetChildArray(&tCocoLoader);
|
||||
SerData *data = new (std::nothrow) SerData();
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
stExpCocoNode *subDict = pComponents[i].GetChildArray(&tCocoLoader);
|
||||
if (subDict == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string key1 = subDict[1].GetName(&tCocoLoader);
|
||||
const char *comName = subDict[1].GetValue(&tCocoLoader);
|
||||
Component *pCom = nullptr;
|
||||
if (key1 == "classname" && comName != nullptr)
|
||||
{
|
||||
pCom = createComponent(comName);
|
||||
}
|
||||
CCLOG("classname = %s", comName);
|
||||
if (pCom != nullptr)
|
||||
{
|
||||
data->_rData = nullptr;
|
||||
data->_cocoNode = subDict;
|
||||
data->_cocoLoader = &tCocoLoader;
|
||||
if (pCom->serialize(data))
|
||||
{
|
||||
ComRender *pTRender = dynamic_cast<ComRender*>(pCom);
|
||||
if (pTRender != nullptr)
|
||||
{
|
||||
pRender = pTRender;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vecComs.push_back(pCom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(pCom);
|
||||
}
|
||||
}
|
||||
if (pCom->serialize(data))
|
||||
{
|
||||
ComRender *pTRender = dynamic_cast<ComRender*>(pCom);
|
||||
if (pTRender != nullptr)
|
||||
{
|
||||
pRender = pTRender;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vecComs.push_back(pCom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(pCom);
|
||||
}
|
||||
}
|
||||
if(_fnSelector != nullptr)
|
||||
{
|
||||
_fnSelector(pCom, (void*)(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setPropertyFromJsonDict(&tCocoLoader, tpRootCocoNode, _node);
|
||||
for (std::vector<Component*>::iterator iter = _vecComs.begin(); iter != _vecComs.end(); ++iter)
|
||||
{
|
||||
_node->addComponent(*iter);
|
||||
}
|
||||
setPropertyFromJsonDict(&tCocoLoader, tpRootCocoNode, _node);
|
||||
for (std::vector<Component*>::iterator iter = _vecComs.begin(); iter != _vecComs.end(); ++iter)
|
||||
{
|
||||
_node->addComponent(*iter);
|
||||
}
|
||||
|
||||
stExpCocoNode *pGameObjects = tpChildArray[11].GetChildArray(&tCocoLoader);
|
||||
int length = tpChildArray[11].GetChildNum();
|
||||
for (int i = 0; i < length; ++i)
|
||||
{
|
||||
createObject(&tCocoLoader, &pGameObjects[i], _node, attachComponent);
|
||||
}
|
||||
TriggerMng::getInstance()->parse(&tCocoLoader, tpChildArray);
|
||||
}
|
||||
|
||||
}
|
||||
}while (0);
|
||||
return _node;
|
||||
stExpCocoNode *pGameObjects = tpChildArray[11].GetChildArray(&tCocoLoader);
|
||||
int length = tpChildArray[11].GetChildNum();
|
||||
for (int i = 0; i < length; ++i)
|
||||
{
|
||||
createObject(&tCocoLoader, &pGameObjects[i], _node, attachComponent);
|
||||
}
|
||||
TriggerMng::getInstance()->parse(&tCocoLoader, tpChildArray);
|
||||
}
|
||||
|
||||
}
|
||||
}while (0);
|
||||
return _node;
|
||||
}
|
||||
else
|
||||
{
|
||||
log("read file [%s] error!\n", fileName.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
{
|
||||
log("read file [%s] error!\n", fileName.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc)
|
||||
|
@ -282,7 +282,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par
|
|||
if (com != nullptr)
|
||||
{
|
||||
data->_rData = &subDict;
|
||||
data->_cocoNode = nullptr;
|
||||
data->_cocoNode = nullptr;
|
||||
data->_cocoLoader = nullptr;
|
||||
if (com->serialize(data))
|
||||
{
|
||||
|
@ -531,7 +531,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
|
|||
}
|
||||
else if (key == "visible")
|
||||
{
|
||||
bVisible = (bool)atoi(value.c_str());
|
||||
bVisible = atoi(value.c_str()) != 0;
|
||||
node->setVisible(bVisible);
|
||||
}
|
||||
else if (key == "objecttag")
|
||||
|
|
|
@ -222,7 +222,7 @@ Mat4 Skin::getNodeToWorldTransformAR() const
|
|||
|
||||
void Skin::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
||||
{
|
||||
Mat4 mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
auto mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
|
||||
//TODO: implement z order
|
||||
_quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, mv);
|
||||
|
|
|
@ -163,15 +163,7 @@ namespace cocostudio
|
|||
label->setFontSize(fontSize);
|
||||
|
||||
std::string fontName = options.has_fontname() ? options.fontname() : "微软雅黑";
|
||||
|
||||
std::string fontFilePath = protocolBuffersPath.append(fontName);
|
||||
if (FileUtils::getInstance()->isFileExist(fontFilePath))
|
||||
{
|
||||
label->setFontName(fontFilePath);
|
||||
}
|
||||
else{
|
||||
label->setFontName(fontName);
|
||||
}
|
||||
label->setFontName(fontName);
|
||||
|
||||
bool aw = options.has_areawidth();
|
||||
bool ah = options.has_areaheight();
|
||||
|
|
|
@ -69,12 +69,12 @@ namespace cocostudio
|
|||
WidgetReader::WidgetReader()
|
||||
:_sizePercentX(0.0f),
|
||||
_sizePercentY(0.0f),
|
||||
_isAdaptScreen(false),
|
||||
_width(0.0f),
|
||||
_height(0.0f),
|
||||
_positionPercentX(0.0f),
|
||||
_positionPercentY(0.0f),
|
||||
_opacity(255)
|
||||
_width(0.0f),
|
||||
_height(0.0f),
|
||||
_opacity(255),
|
||||
_isAdaptScreen(false)
|
||||
{
|
||||
valueToInt = [=](const std::string& str) -> int{
|
||||
return atoi(str.c_str());
|
||||
|
|
|
@ -222,15 +222,15 @@ enum WS_MSG {
|
|||
WebSocket::WebSocket()
|
||||
: _readyState(State::CONNECTING)
|
||||
, _port(80)
|
||||
, _pendingFrameDataLen(0)
|
||||
, _currentDataLen(0)
|
||||
, _currentData(nullptr)
|
||||
, _wsHelper(nullptr)
|
||||
, _wsInstance(nullptr)
|
||||
, _wsContext(nullptr)
|
||||
, _delegate(nullptr)
|
||||
, _SSLConnection(0)
|
||||
, _wsProtocols(nullptr)
|
||||
, _pendingFrameDataLen(0)
|
||||
, _currentDataLen(0)
|
||||
, _currentData(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -543,7 +543,7 @@ static Data getData(const std::string& filename, bool forString)
|
|||
|
||||
Data ret;
|
||||
unsigned char* buffer = nullptr;
|
||||
ssize_t size = 0;
|
||||
size_t size = 0;
|
||||
size_t readsize;
|
||||
const char* mode = nullptr;
|
||||
if (forString)
|
||||
|
@ -1062,7 +1062,7 @@ bool FileUtils::createDirectory(const std::string& path)
|
|||
if (!(GetFileAttributesEx(wpath.c_str(), GetFileExInfoStandard, &wfad)))
|
||||
{
|
||||
subpath = "";
|
||||
for(int i = 0 ; i < dirs.size() ; ++i)
|
||||
for(unsigned int i = 0 ; i < dirs.size() ; ++i)
|
||||
{
|
||||
subpath += dirs[i];
|
||||
if (i > 0 && !isDirectoryExist(subpath))
|
||||
|
@ -1146,7 +1146,7 @@ bool FileUtils::removeDirectory(const std::string& path)
|
|||
bool ret=true;
|
||||
if (search!=INVALID_HANDLE_VALUE)
|
||||
{
|
||||
bool find=true;
|
||||
BOOL find=true;
|
||||
while (find)
|
||||
{
|
||||
//. ..
|
||||
|
@ -1168,8 +1168,10 @@ bool FileUtils::removeDirectory(const std::string& path)
|
|||
}
|
||||
FindClose(search);
|
||||
}
|
||||
if (ret)
|
||||
return RemoveDirectory(wpath.c_str());
|
||||
if (ret && RemoveDirectory(wpath.c_str()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||
std::string command = "cmd /c rd /s /q ";
|
||||
|
|
|
@ -112,16 +112,17 @@ public class Cocos2dxMusic {
|
|||
if (this.mBackgroundMediaPlayer == null) {
|
||||
Log.e(Cocos2dxMusic.TAG, "playBackgroundMusic: background media player is null");
|
||||
} else {
|
||||
// if the music is playing or paused, stop it
|
||||
this.mBackgroundMediaPlayer.stop();
|
||||
|
||||
this.mBackgroundMediaPlayer.setLooping(isLoop);
|
||||
|
||||
try {
|
||||
this.mBackgroundMediaPlayer.prepare();
|
||||
this.mBackgroundMediaPlayer.seekTo(0);
|
||||
this.mBackgroundMediaPlayer.start();
|
||||
|
||||
// if the music is playing or paused, stop it
|
||||
if (mPaused) {
|
||||
mBackgroundMediaPlayer.seekTo(0);
|
||||
this.mBackgroundMediaPlayer.start();
|
||||
} else if (mBackgroundMediaPlayer.isPlaying()) {
|
||||
mBackgroundMediaPlayer.seekTo(0);
|
||||
} else {
|
||||
this.mBackgroundMediaPlayer.start();
|
||||
}
|
||||
this.mBackgroundMediaPlayer.setLooping(isLoop);
|
||||
this.mPaused = false;
|
||||
} catch (final Exception e) {
|
||||
Log.e(Cocos2dxMusic.TAG, "playBackgroundMusic: error state");
|
||||
|
|
|
@ -17,9 +17,11 @@ extern "C" {
|
|||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnPause() {
|
||||
Application::getInstance()->applicationDidEnterBackground();
|
||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
||||
if (Director::getInstance()->getOpenGLView()) {
|
||||
Application::getInstance()->applicationDidEnterBackground();
|
||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() {
|
||||
|
|
|
@ -33,11 +33,13 @@ using namespace cocos2d;
|
|||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesBegin(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y);
|
||||
intptr_t idlong = id;
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &idlong, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y);
|
||||
intptr_t idlong = id;
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &idlong, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesMove(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
|
@ -50,7 +52,11 @@ extern "C" {
|
|||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(size, id, x, y);
|
||||
intptr_t idlong[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
idlong[i] = id[i];
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(size, idlong, x, y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesCancel(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
|
@ -63,7 +69,11 @@ extern "C" {
|
|||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(size, id, x, y);
|
||||
intptr_t idlong[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
idlong[i] = id[i];
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(size, idlong, x, y);
|
||||
}
|
||||
|
||||
#define KEYCODE_BACK 0x04
|
||||
|
|
|
@ -36,6 +36,10 @@ THE SOFTWARE.
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef CC_RESOURCE_FOLDER_LINUX
|
||||
#define CC_RESOURCE_FOLDER_LINUX ("/Resources/")
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
@ -71,7 +75,7 @@ bool FileUtilsLinux::init()
|
|||
fullpath[length] = '\0';
|
||||
std::string appPath = fullpath;
|
||||
_defaultResRootPath = appPath.substr(0, appPath.find_last_of("/"));
|
||||
_defaultResRootPath += "/Resources/";
|
||||
_defaultResRootPath += CC_RESOURCE_FOLDER_LINUX;
|
||||
|
||||
// Set writable path to $XDG_CONFIG_HOME or ~/.config/<app name>/ if $XDG_CONFIG_HOME not exists.
|
||||
const char* xdg_config_path = getenv("XDG_CONFIG_HOME");
|
||||
|
|
|
@ -35,39 +35,46 @@ using namespace Windows::Graphics::Display;
|
|||
USING_NS_CC;
|
||||
|
||||
|
||||
Cocos2dRenderer::Cocos2dRenderer(const int width, const int height, CoreDispatcher^ dispatcher, Panel^ panel)
|
||||
: mApp(nullptr)
|
||||
, mWidth(width)
|
||||
, mHeight(height)
|
||||
Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, CoreDispatcher^ dispatcher, Panel^ panel)
|
||||
: m_app(nullptr)
|
||||
, m_width(width)
|
||||
, m_height(height)
|
||||
, m_dpi(dpi)
|
||||
, m_dispatcher(dispatcher)
|
||||
, m_panel(panel)
|
||||
{
|
||||
mApp = new AppDelegate();
|
||||
m_app = new AppDelegate();
|
||||
auto director = cocos2d::Director::getInstance();
|
||||
|
||||
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
|
||||
glview->setDispatcher(dispatcher);
|
||||
glview->setPanel(panel);
|
||||
glview->Create(static_cast<float>(width), static_cast<float>(height), DisplayOrientations::Landscape);
|
||||
glview->Create(static_cast<float>(width), static_cast<float>(height), dpi, DisplayOrientations::Landscape);
|
||||
director->setOpenGLView(glview);
|
||||
CCApplication::getInstance()->run();
|
||||
}
|
||||
|
||||
Cocos2dRenderer::~Cocos2dRenderer()
|
||||
{
|
||||
delete mApp;
|
||||
delete m_app;
|
||||
}
|
||||
|
||||
// Draws a basic triangle
|
||||
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height)
|
||||
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi)
|
||||
{
|
||||
if (width != mWidth || height != mHeight)
|
||||
if (width != m_width || height != m_height)
|
||||
{
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(static_cast<float>(width), static_cast<float>(height));
|
||||
}
|
||||
|
||||
if (dpi != m_dpi)
|
||||
{
|
||||
m_dpi = dpi;
|
||||
GLViewImpl::sharedOpenGLView()->SetDPI(m_dpi);
|
||||
}
|
||||
|
||||
GLViewImpl::sharedOpenGLView()->ProcessEvents();
|
||||
GLViewImpl::sharedOpenGLView()->Render();
|
||||
}
|
||||
|
|
|
@ -29,18 +29,20 @@ namespace cocos2d
|
|||
class Cocos2dRenderer
|
||||
{
|
||||
public:
|
||||
Cocos2dRenderer(const int width, const int height, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
|
||||
Cocos2dRenderer( int width, int height, float dpi, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
|
||||
~Cocos2dRenderer();
|
||||
void Draw(GLsizei width, GLsizei height);
|
||||
void Draw(GLsizei width, GLsizei height, float dpi);
|
||||
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e);
|
||||
|
||||
private:
|
||||
|
||||
int mWidth;
|
||||
int mHeight;
|
||||
int m_width;
|
||||
int m_height;
|
||||
float m_dpi;
|
||||
|
||||
// The AppDelegate for the Cocos2D app
|
||||
AppDelegate* mApp;
|
||||
AppDelegate* m_app;
|
||||
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
|
||||
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
|
||||
};
|
||||
|
|
|
@ -47,7 +47,8 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
|
|||
mRenderSurface(EGL_NO_SURFACE),
|
||||
mCustomRenderSurfaceSize(0,0),
|
||||
mUseCustomRenderSurfaceSize(false),
|
||||
m_coreInput(nullptr)
|
||||
m_coreInput(nullptr),
|
||||
m_dpi(0.0f)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -225,6 +226,9 @@ void OpenGLESPage::StartRenderLoop()
|
|||
return;
|
||||
}
|
||||
|
||||
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
||||
m_dpi = currentDisplayInformation->LogicalDpi;
|
||||
|
||||
auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher;
|
||||
|
||||
// Create a task for rendering that will be run on a background thread.
|
||||
|
@ -238,16 +242,18 @@ void OpenGLESPage::StartRenderLoop()
|
|||
GLsizei panelHeight = 0;
|
||||
GetSwapChainPanelSize(&panelWidth, &panelHeight);
|
||||
|
||||
|
||||
|
||||
if (m_renderer.get() == nullptr)
|
||||
{
|
||||
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, dispatcher, swapChainPanel);
|
||||
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, m_dpi, dispatcher, swapChainPanel);
|
||||
}
|
||||
|
||||
while (action->Status == Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
|
||||
GetSwapChainPanelSize(&panelWidth, &panelHeight);
|
||||
m_renderer.get()->Draw(panelWidth, panelHeight);
|
||||
m_renderer.get()->Draw(panelWidth, panelHeight, m_dpi);
|
||||
|
||||
// The call to eglSwapBuffers might not be successful (i.e. due to Device Lost)
|
||||
// If the call fails, then we must reinitialize EGL and the GL resources.
|
||||
|
|
|
@ -67,5 +67,7 @@ namespace cocos2d
|
|||
void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
||||
void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
||||
void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
||||
|
||||
float m_dpi;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -42,8 +42,14 @@ CCFreeTypeFont sFT;
|
|||
|
||||
int Device::getDPI()
|
||||
{
|
||||
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
|
||||
static const float dipsPerInch = 96.0f;
|
||||
return floor(DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer.
|
||||
#elif defined WP8_SHADER_COMPILER
|
||||
return 0;
|
||||
#else
|
||||
return cocos2d::GLViewImpl::sharedOpenGLView()->GetDPI();
|
||||
#endif
|
||||
}
|
||||
|
||||
static Accelerometer^ sAccelerometer = nullptr;
|
||||
|
|
|
@ -33,6 +33,7 @@ THE SOFTWARE.
|
|||
#include "deprecated/CCNotificationCenter.h"
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Concurrency;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::Graphics::Display;
|
||||
|
@ -107,9 +108,10 @@ bool GLViewImpl::initWithFullScreen(const std::string& viewName)
|
|||
}
|
||||
|
||||
|
||||
bool GLViewImpl::Create(float width, float height, DisplayOrientations orientation)
|
||||
bool GLViewImpl::Create(float width, float height, float dpi, DisplayOrientations orientation)
|
||||
{
|
||||
m_orientation = orientation;
|
||||
m_dpi = dpi;
|
||||
UpdateForWindowSizeChange(width, height);
|
||||
return true;
|
||||
}
|
||||
|
@ -454,33 +456,27 @@ void GLViewImpl::setScissorInPoints(float x , float y , float w , float h)
|
|||
|
||||
void GLViewImpl::QueueBackKeyPress()
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
std::shared_ptr<BackButtonEvent> e(new BackButtonEvent());
|
||||
mInputEvents.push(e);
|
||||
}
|
||||
|
||||
void GLViewImpl::QueuePointerEvent(PointerEventType type, PointerEventArgs^ args)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
std::shared_ptr<PointerEvent> e(new PointerEvent(type, args));
|
||||
mInputEvents.push(e);
|
||||
}
|
||||
|
||||
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
mInputEvents.push(event);
|
||||
}
|
||||
|
||||
void GLViewImpl::ProcessEvents()
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
|
||||
while (!mInputEvents.empty())
|
||||
std::shared_ptr<InputEvent> e;
|
||||
while (mInputEvents.try_pop(e))
|
||||
{
|
||||
InputEvent* e = mInputEvents.front().get();
|
||||
e->execute();
|
||||
mInputEvents.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ THE SOFTWARE.
|
|||
|
||||
|
||||
#include <agile.h>
|
||||
#include <concurrent_queue.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <wrl/client.h>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <Keyboard-winrt.h>
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
virtual void setIMEKeyboardState(bool bOpen);
|
||||
virtual void setIMEKeyboardState(bool bOpen, std::string str);
|
||||
|
||||
virtual bool Create(float width, float height ,Windows::Graphics::Display::DisplayOrientations orientation);
|
||||
virtual bool Create(float width, float height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation);
|
||||
|
||||
void setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher);
|
||||
Windows::UI::Core::CoreDispatcher^ getDispatcher() {return m_dispatcher.Get();}
|
||||
|
@ -97,8 +97,11 @@ public:
|
|||
void centerWindow();
|
||||
|
||||
void UpdateOrientation(Windows::Graphics::Display::DisplayOrientations orientation);
|
||||
void UpdateForWindowSizeChange(float width, float height);
|
||||
|
||||
void UpdateForWindowSizeChange(float width, float height);
|
||||
|
||||
void SetDPI(float dpi) { m_dpi = dpi; }
|
||||
float GetDPI() { return m_dpi; }
|
||||
|
||||
// static function
|
||||
/**
|
||||
@brief get the shared main open gl window
|
||||
|
@ -141,6 +144,7 @@ private:
|
|||
|
||||
float m_width;
|
||||
float m_height;
|
||||
float m_dpi;
|
||||
|
||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
||||
Windows::Foundation::Rect m_keyboardRect;
|
||||
|
@ -156,8 +160,7 @@ private:
|
|||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
|
||||
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
std::mutex mMutex;
|
||||
Concurrency::concurrent_queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
|
||||
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
|
||||
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
|
||||
|
|
|
@ -192,7 +192,7 @@ bool CCPrecompiledShaders::addProgram(GLuint program, const std::string& id)
|
|||
return true;
|
||||
}
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) && defined(WP8_SHADER_COMPILER)
|
||||
|
||||
void CCPrecompiledShaders::savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder)
|
||||
{
|
||||
|
|
|
@ -48,14 +48,6 @@ typedef struct _CompiledProgram
|
|||
int length;
|
||||
} CompiledProgram;
|
||||
|
||||
#if 0
|
||||
|
||||
const unsigned char gKey[] = "hello";
|
||||
const unsigned char gProgram[] = "world";
|
||||
PrecompiledShader gFoo = {gKey, gProgram, 100};
|
||||
|
||||
PrecompiledShader shaders[] = {gFoo, gFoo};
|
||||
#endif
|
||||
|
||||
class CC_DLL CCPrecompiledShaders
|
||||
{
|
||||
|
@ -63,7 +55,6 @@ public:
|
|||
CCPrecompiledShaders();
|
||||
virtual ~CCPrecompiledShaders();
|
||||
|
||||
|
||||
/**
|
||||
@brief Get current precompiled shaders instance.
|
||||
@return Current precompiled shaders instance pointer.
|
||||
|
@ -77,7 +68,7 @@ public:
|
|||
bool loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray);
|
||||
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) && defined(WP8_SHADER_COMPILER)
|
||||
void savePrecompiledShaders();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -531,33 +531,27 @@ void GLViewImpl::setScissorInPoints(float x , float y , float w , float h)
|
|||
|
||||
void GLViewImpl::QueueBackKeyPress()
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
std::shared_ptr<BackButtonEvent> e(new BackButtonEvent());
|
||||
mInputEvents.push(e);
|
||||
}
|
||||
|
||||
void GLViewImpl::QueuePointerEvent(PointerEventType type, PointerEventArgs^ args)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
std::shared_ptr<PointerEvent> e(new PointerEvent(type, args));
|
||||
mInputEvents.push(e);
|
||||
}
|
||||
|
||||
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
mInputEvents.push(event);
|
||||
}
|
||||
|
||||
void GLViewImpl::ProcessEvents()
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(mMutex);
|
||||
|
||||
while (!mInputEvents.empty())
|
||||
std::shared_ptr<InputEvent> e;
|
||||
while (mInputEvents.try_pop(e))
|
||||
{
|
||||
InputEvent* e = mInputEvents.front().get();
|
||||
e->execute();
|
||||
mInputEvents.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ THE SOFTWARE.
|
|||
|
||||
#include <wrl/client.h>
|
||||
#include <d3d11_1.h>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <concurrent_queue.h>
|
||||
|
||||
#include <agile.h>
|
||||
#include <DirectXMath.h>
|
||||
|
@ -182,9 +181,7 @@ private:
|
|||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
|
||||
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
std::mutex mMutex;
|
||||
|
||||
Concurrency::concurrent_queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -86,7 +86,7 @@ const unsigned char s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873[] = {
|
|||
120, 116, 117, 114, 101, 48, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 248, 3,
|
||||
0, 0, 4, 5, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 11, 95,
|
||||
74, 206, 145, 124, 32, 219, 67, 19,
|
||||
|
@ -456,7 +456,7 @@ const unsigned char s_13E33F532157A58EC77EDE3B3112560A89D272B2[] = {
|
|||
116, 114, 105, 120, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 204, 2, 0, 0,
|
||||
164, 4, 0, 0, 0, 0, 0, 0,
|
||||
182, 139, 0, 0, 0, 0, 0, 0,
|
||||
235, 143, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 88, 66, 67, 127, 145, 81, 72,
|
||||
216, 190, 16, 61, 245, 231, 235, 249,
|
||||
|
@ -800,7 +800,7 @@ const unsigned char s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE[] = {
|
|||
116, 67, 111, 108, 111, 114, 0, 0,
|
||||
0, 0, 3, 0, 0, 0, 208, 7,
|
||||
0, 0, 4, 5, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 65, 106,
|
||||
69, 173, 111, 248, 97, 165, 186, 90,
|
||||
|
@ -1462,7 +1462,7 @@ const unsigned char s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A[] = {
|
|||
99, 111, 108, 111, 114, 0, 0, 0,
|
||||
0, 16, 0, 0, 0, 236, 16, 0,
|
||||
0, 124, 10, 0, 0, 0, 0, 0,
|
||||
0, 182, 139, 0, 0, 0, 0, 0,
|
||||
0, 235, 143, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 68, 88, 66, 67, 39, 224, 169,
|
||||
185, 116, 156, 41, 157, 187, 9, 222,
|
||||
|
@ -2430,7 +2430,7 @@ const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = {
|
|||
120, 116, 117, 114, 101, 48, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 24, 4,
|
||||
0, 0, 4, 5, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 200, 5,
|
||||
103, 205, 248, 30, 69, 65, 32, 117,
|
||||
|
@ -2804,7 +2804,7 @@ const unsigned char s_67837675F2BB48C0E926316F505FC1538228E0FA[] = {
|
|||
86, 80, 77, 97, 116, 114, 105, 120,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 4, 0, 0, 48, 5, 0, 0,
|
||||
0, 0, 0, 0, 182, 139, 0, 0,
|
||||
0, 0, 0, 0, 235, 143, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 68, 88, 66, 67,
|
||||
79, 226, 72, 124, 94, 252, 37, 157,
|
||||
|
@ -3968,7 +3968,7 @@ const unsigned char s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C[] = {
|
|||
99, 111, 108, 111, 114, 0, 0, 0,
|
||||
0, 17, 0, 0, 0, 236, 16, 0,
|
||||
0, 232, 19, 0, 0, 0, 0, 0,
|
||||
0, 182, 139, 0, 0, 0, 0, 0,
|
||||
0, 235, 143, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 68, 88, 66, 67, 39, 224, 169,
|
||||
185, 116, 156, 41, 157, 187, 9, 222,
|
||||
|
@ -5245,7 +5245,7 @@ const unsigned char s_78250E25D1929D4A842050738140787BE42541C6[] = {
|
|||
108, 112, 104, 97, 95, 118, 97, 108,
|
||||
117, 101, 0, 0, 0, 0, 2, 0,
|
||||
0, 0, 36, 5, 0, 0, 4, 5,
|
||||
0, 0, 0, 0, 0, 0, 182, 139,
|
||||
0, 0, 0, 0, 0, 0, 235, 143,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 68, 88,
|
||||
66, 67, 100, 113, 175, 29, 164, 71,
|
||||
|
@ -5660,7 +5660,7 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = {
|
|||
67, 95, 84, 101, 120, 116, 117, 114,
|
||||
101, 48, 0, 0, 0, 0, 1, 0,
|
||||
0, 0, 248, 3, 0, 0, 0, 5,
|
||||
0, 0, 0, 0, 0, 0, 182, 139,
|
||||
0, 0, 0, 0, 0, 0, 235, 143,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 68, 88,
|
||||
66, 67, 11, 95, 74, 206, 145, 124,
|
||||
|
@ -6044,7 +6044,7 @@ const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = {
|
|||
99, 111, 108, 111, 114, 0, 0, 0,
|
||||
0, 2, 0, 0, 0, 96, 4, 0,
|
||||
0, 192, 4, 0, 0, 0, 0, 0,
|
||||
0, 182, 139, 0, 0, 0, 0, 0,
|
||||
0, 235, 143, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 68, 88, 66, 67, 157, 116, 105,
|
||||
89, 118, 135, 249, 239, 42, 226, 184,
|
||||
|
@ -6425,7 +6425,7 @@ const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = {
|
|||
117, 95, 99, 111, 108, 111, 114, 0,
|
||||
0, 0, 0, 1, 0, 0, 0, 52,
|
||||
3, 0, 0, 40, 4, 0, 0, 0,
|
||||
0, 0, 0, 182, 139, 0, 0, 0,
|
||||
0, 0, 0, 235, 143, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 68, 88, 66, 67, 153,
|
||||
8, 62, 201, 202, 170, 111, 182, 149,
|
||||
|
@ -6759,7 +6759,7 @@ const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = {
|
|||
111, 108, 111, 114, 0, 0, 0, 0,
|
||||
2, 0, 0, 0, 240, 4, 0, 0,
|
||||
4, 5, 0, 0, 0, 0, 0, 0,
|
||||
182, 139, 0, 0, 0, 0, 0, 0,
|
||||
235, 143, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 88, 66, 67, 134, 66, 128, 226,
|
||||
107, 172, 247, 161, 241, 207, 89, 240,
|
||||
|
@ -7176,7 +7176,7 @@ const unsigned char s_92BE325B516F887D2C928EDE20ADF428DB01C038[] = {
|
|||
95, 118, 97, 108, 117, 101, 0, 0,
|
||||
0, 0, 2, 0, 0, 0, 36, 5,
|
||||
0, 0, 0, 5, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 100, 113,
|
||||
175, 29, 164, 71, 177, 78, 120, 99,
|
||||
|
@ -7744,7 +7744,7 @@ const unsigned char s_93D31E1668075AE4941C53441D7A9D0DE8F76331[] = {
|
|||
117, 95, 99, 111, 108, 111, 114, 0,
|
||||
0, 0, 0, 15, 0, 0, 0, 200,
|
||||
15, 0, 0, 216, 9, 0, 0, 0,
|
||||
0, 0, 0, 182, 139, 0, 0, 0,
|
||||
0, 0, 0, 235, 143, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 68, 88, 66, 67, 136,
|
||||
158, 207, 210, 174, 144, 71, 116, 248,
|
||||
|
@ -9277,7 +9277,7 @@ const unsigned char s_A130FCE93CA2E5D68468367D88D1D7BE357912E5[] = {
|
|||
99, 111, 108, 111, 114, 0, 0, 0,
|
||||
0, 3, 0, 0, 0, 96, 4, 0,
|
||||
0, 192, 13, 0, 0, 0, 0, 0,
|
||||
0, 182, 139, 0, 0, 0, 0, 0,
|
||||
0, 235, 143, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 68, 88, 66, 67, 157, 116, 105,
|
||||
89, 118, 135, 249, 239, 42, 226, 184,
|
||||
|
@ -9954,7 +9954,7 @@ const unsigned char s_A2377A827972A5466DA8637681045D32DA8A817D[] = {
|
|||
99, 111, 108, 111, 114, 0, 0, 0,
|
||||
0, 2, 0, 0, 0, 96, 4, 0,
|
||||
0, 144, 4, 0, 0, 0, 0, 0,
|
||||
0, 182, 139, 0, 0, 0, 0, 0,
|
||||
0, 235, 143, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 68, 88, 66, 67, 157, 116, 105,
|
||||
89, 118, 135, 249, 239, 42, 226, 184,
|
||||
|
@ -10339,7 +10339,7 @@ const unsigned char s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86[] = {
|
|||
111, 108, 111, 114, 0, 0, 0, 0,
|
||||
2, 0, 0, 0, 240, 5, 0, 0,
|
||||
4, 5, 0, 0, 0, 0, 0, 0,
|
||||
182, 139, 0, 0, 0, 0, 0, 0,
|
||||
235, 143, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 88, 66, 67, 223, 173, 203, 80,
|
||||
172, 13, 170, 215, 168, 128, 228, 5,
|
||||
|
@ -10771,7 +10771,7 @@ const unsigned char s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893[] = {
|
|||
77, 97, 116, 114, 105, 120, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 204, 2,
|
||||
0, 0, 144, 4, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 127, 145,
|
||||
81, 72, 216, 190, 16, 61, 245, 231,
|
||||
|
@ -11101,8 +11101,8 @@ const unsigned char s_E2D56227712263272BD5218FEA117CD06180F81B[] = {
|
|||
117, 95, 112, 111, 105, 110, 116, 83,
|
||||
105, 122, 101, 0, 0, 0, 0, 2,
|
||||
0, 0, 0, 204, 2, 0, 0, 208,
|
||||
4, 0, 0, 0, 0, 0, 0, 182,
|
||||
139, 0, 0, 0, 0, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0, 0, 235,
|
||||
143, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 68,
|
||||
88, 66, 67, 127, 145, 81, 72, 216,
|
||||
190, 16, 61, 245, 231, 235, 249, 125,
|
||||
|
@ -11452,7 +11452,7 @@ const unsigned char s_F46558C274182079784898CF4968CF431593D5E2[] = {
|
|||
116, 67, 111, 108, 111, 114, 0, 0,
|
||||
0, 0, 3, 0, 0, 0, 108, 6,
|
||||
0, 0, 4, 5, 0, 0, 0, 0,
|
||||
0, 0, 182, 139, 0, 0, 0, 0,
|
||||
0, 0, 235, 143, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 68, 88, 66, 67, 47, 220,
|
||||
115, 183, 137, 174, 141, 96, 204, 60,
|
||||
|
@ -11908,7 +11908,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = {
|
|||
101, 120, 116, 117, 114, 101, 48, 0,
|
||||
0, 0, 0, 1, 0, 0, 0, 156,
|
||||
3, 0, 0, 144, 4, 0, 0, 0,
|
||||
0, 0, 0, 182, 139, 0, 0, 0,
|
||||
0, 0, 0, 235, 143, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 68, 88, 66, 67, 203,
|
||||
117, 183, 110, 154, 52, 220, 70, 125,
|
||||
|
|
|
@ -844,15 +844,14 @@ void GLProgram::setUniformsForBuiltins()
|
|||
Director* director = Director::getInstance();
|
||||
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
|
||||
|
||||
Mat4 matrixMV;
|
||||
matrixMV = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
auto matrixMV = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
|
||||
setUniformsForBuiltins(matrixMV);
|
||||
}
|
||||
|
||||
void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV)
|
||||
{
|
||||
Mat4 matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
auto matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
||||
if(_flags.usesP)
|
||||
setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_P_MATRIX], matrixP.m, 1);
|
||||
|
|
|
@ -181,6 +181,7 @@ void GLProgramCache::loadDefaultGLPrograms()
|
|||
loadDefaultGLProgram(p, kShaderType_PositionLengthTexureColor);
|
||||
_programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR, p) );
|
||||
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
|
||||
p = new (std::nothrow) GLProgram();
|
||||
loadDefaultGLProgram(p, kShaderType_LabelDistanceFieldNormal);
|
||||
_programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL, p) );
|
||||
|
@ -188,6 +189,7 @@ void GLProgramCache::loadDefaultGLPrograms()
|
|||
p = new (std::nothrow) GLProgram();
|
||||
loadDefaultGLProgram(p, kShaderType_LabelDistanceFieldGlow);
|
||||
_programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW, p) );
|
||||
#endif
|
||||
|
||||
p = new (std::nothrow) GLProgram();
|
||||
loadDefaultGLProgram(p, kShaderType_LabelNormal);
|
||||
|
@ -293,6 +295,7 @@ void GLProgramCache::reloadDefaultGLPrograms()
|
|||
p->reset();
|
||||
loadDefaultGLProgram(p, kShaderType_PositionLengthTexureColor);
|
||||
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
|
||||
p = getGLProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL);
|
||||
p->reset();
|
||||
loadDefaultGLProgram(p, kShaderType_LabelDistanceFieldNormal);
|
||||
|
@ -300,6 +303,7 @@ void GLProgramCache::reloadDefaultGLPrograms()
|
|||
p = getGLProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW);
|
||||
p->reset();
|
||||
loadDefaultGLProgram(p, kShaderType_LabelDistanceFieldGlow);
|
||||
#endif
|
||||
|
||||
p = getGLProgram(GLProgram::SHADER_NAME_LABEL_NORMAL);
|
||||
p->reset();
|
||||
|
@ -372,12 +376,14 @@ void GLProgramCache::loadDefaultGLProgram(GLProgram *p, int type)
|
|||
case kShaderType_PositionLengthTexureColor:
|
||||
p->initWithByteArrays(ccPositionColorLengthTexture_vert, ccPositionColorLengthTexture_frag);
|
||||
break;
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_WP8
|
||||
case kShaderType_LabelDistanceFieldNormal:
|
||||
p->initWithByteArrays(ccLabel_vert, ccLabelDistanceFieldNormal_frag);
|
||||
break;
|
||||
case kShaderType_LabelDistanceFieldGlow:
|
||||
p->initWithByteArrays(ccLabel_vert, ccLabelDistanceFieldGlow_frag);
|
||||
break;
|
||||
#endif
|
||||
case kShaderType_LabelNormal:
|
||||
p->initWithByteArrays(ccLabel_vert, ccLabelNormal_frag);
|
||||
break;
|
||||
|
@ -433,7 +439,7 @@ GLProgram* GLProgramCache::getGLProgram(const std::string &key)
|
|||
void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
|
||||
{
|
||||
// release old one
|
||||
auto prev = getProgram(key);
|
||||
auto prev = getGLProgram(key);
|
||||
if( prev == program )
|
||||
return;
|
||||
|
||||
|
@ -441,17 +447,21 @@ void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
|
|||
CC_SAFE_RELEASE_NULL(prev);
|
||||
|
||||
if (program)
|
||||
program->retain();
|
||||
program->retain();
|
||||
_programs[key] = program;
|
||||
}
|
||||
|
||||
std::string GLProgramCache::getShaderMacrosForLight() const
|
||||
{
|
||||
GLchar def[256];
|
||||
sprintf(def, "\n#define MAX_DIRECTIONAL_LIGHT_NUM %d \n"
|
||||
auto conf = Configuration::getInstance();
|
||||
|
||||
snprintf(def, sizeof(def)-1, "\n#define MAX_DIRECTIONAL_LIGHT_NUM %d \n"
|
||||
"\n#define MAX_POINT_LIGHT_NUM %d \n"
|
||||
"\n#define MAX_SPOT_LIGHT_NUM %d \n"
|
||||
, Configuration::getInstance()->getMaxSupportDirLightInShader(), Configuration::getInstance()->getMaxSupportPointLightInShader(), Configuration::getInstance()->getMaxSupportSpotLightInShader());
|
||||
"\n#define MAX_SPOT_LIGHT_NUM %d \n",
|
||||
conf->getMaxSupportDirLightInShader(),
|
||||
conf->getMaxSupportPointLightInShader(),
|
||||
conf->getMaxSupportSpotLightInShader());
|
||||
return std::string(def);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,16 +48,16 @@ NS_CC_BEGIN
|
|||
//
|
||||
|
||||
UniformValue::UniformValue()
|
||||
: _useCallback(false)
|
||||
, _uniform(nullptr)
|
||||
: _uniform(nullptr)
|
||||
, _glprogram(nullptr)
|
||||
, _useCallback(false)
|
||||
{
|
||||
}
|
||||
|
||||
UniformValue::UniformValue(Uniform *uniform, GLProgram* glprogram)
|
||||
: _useCallback(false)
|
||||
, _uniform(uniform)
|
||||
: _uniform(uniform)
|
||||
, _glprogram(glprogram)
|
||||
, _useCallback(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -182,15 +182,15 @@ void UniformValue::setMat4(const Mat4& value)
|
|||
//
|
||||
|
||||
VertexAttribValue::VertexAttribValue()
|
||||
: _useCallback(false)
|
||||
, _vertexAttrib(nullptr)
|
||||
: _vertexAttrib(nullptr)
|
||||
, _useCallback(false)
|
||||
, _enabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
VertexAttribValue::VertexAttribValue(VertexAttrib *vertexAttrib)
|
||||
: _useCallback(false)
|
||||
, _vertexAttrib(vertexAttrib)
|
||||
: _vertexAttrib(vertexAttrib)
|
||||
, _useCallback(false)
|
||||
, _enabled(false)
|
||||
{
|
||||
}
|
||||
|
@ -274,10 +274,10 @@ GLProgramState* GLProgramState::getOrCreateWithGLProgram(GLProgram *glprogram)
|
|||
}
|
||||
|
||||
GLProgramState::GLProgramState()
|
||||
: _vertexAttribsFlags(0)
|
||||
, _glprogram(nullptr)
|
||||
: _uniformAttributeValueDirty(true)
|
||||
, _textureUnitIndex(1)
|
||||
, _uniformAttributeValueDirty(true)
|
||||
, _vertexAttribsFlags(0)
|
||||
, _glprogram(nullptr)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
|
||||
/** listen the event that renderer was recreated on Android/WP8 */
|
||||
|
|
|
@ -78,17 +78,17 @@ static const char *s_ambientLightUniformColorName = "u_AmbientLightSour
|
|||
|
||||
MeshCommand::MeshCommand()
|
||||
: _textureID(0)
|
||||
, _blendType(BlendFunc::DISABLE)
|
||||
, _glProgramState(nullptr)
|
||||
, _cullFaceEnabled(false)
|
||||
, _cullFace(GL_BACK)
|
||||
, _depthTestEnabled(false)
|
||||
, _depthWriteEnabled(false)
|
||||
, _blendType(BlendFunc::DISABLE)
|
||||
, _displayColor(1.0f, 1.0f, 1.0f, 1.0f)
|
||||
, _matrixPalette(nullptr)
|
||||
, _matrixPaletteSize(0)
|
||||
, _materialID(0)
|
||||
, _vao(0)
|
||||
, _cullFaceEnabled(false)
|
||||
, _cullFace(GL_BACK)
|
||||
, _depthTestEnabled(false)
|
||||
, _depthWriteEnabled(false)
|
||||
, _lightMask(-1)
|
||||
{
|
||||
_type = RenderCommand::Type::MESH_COMMAND;
|
||||
|
|
|
@ -56,10 +56,10 @@ VertexBuffer* VertexBuffer::create(int sizePerVertex, int vertexNumber)
|
|||
}
|
||||
|
||||
VertexBuffer::VertexBuffer()
|
||||
: _vbo(0)
|
||||
, _vertexNumber(0)
|
||||
: _recreateVBOEventListener(nullptr)
|
||||
, _vbo(0)
|
||||
, _sizePerVertex(0)
|
||||
, _recreateVBOEventListener(nullptr)
|
||||
, _vertexNumber(0)
|
||||
{
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
|
|
|
@ -35,17 +35,17 @@ class VertexBuffer;
|
|||
struct CC_DLL VertexStreamAttribute
|
||||
{
|
||||
VertexStreamAttribute()
|
||||
: _offset(0),_semantic(0),_type(0),_size(0), _normalize(false)
|
||||
: _normalize(false),_offset(0),_semantic(0),_type(0),_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
VertexStreamAttribute(int offset, int semantic, int type, int size)
|
||||
: _offset(offset),_semantic(semantic),_type(type),_size(size), _normalize(false)
|
||||
: _normalize(false),_offset(offset),_semantic(semantic),_type(type),_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
VertexStreamAttribute(int offset, int semantic, int type, int size, bool normalize)
|
||||
: _offset(offset),_semantic(semantic),_type(type),_size(size), _normalize(normalize)
|
||||
: _normalize(normalize),_offset(offset),_semantic(semantic),_type(type),_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,16 @@
|
|||
-- @parent_module ccs
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] getTimelines
|
||||
-- Set ActionTimeline's frame event callback function
|
||||
-- @function [parent=#ActionTimeline] setFrameEventCallFunc
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
-- @param #function listener
|
||||
|
||||
--------------------------------
|
||||
-- add Timeline to ActionTimeline
|
||||
-- @function [parent=#ActionTimeline] addTimeline
|
||||
-- @param self
|
||||
-- @param #ccs.Timeline timeline
|
||||
|
||||
--------------------------------
|
||||
-- Get current frame.
|
||||
|
@ -28,66 +34,46 @@
|
|||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- Set ActionTimeline's frame event callback function
|
||||
-- @function [parent=#ActionTimeline] setFrameEventCallFunc
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] init
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] removeTimeline
|
||||
-- @param self
|
||||
-- @param #ccs.Timeline timeline
|
||||
|
||||
--------------------------------
|
||||
-- Last frame callback will call when arriving last frame
|
||||
-- @function [parent=#ActionTimeline] setLastFrameCallFunc
|
||||
-- @param self
|
||||
-- @param #function listener
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] getTimelines
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- Resume the animation.
|
||||
-- @function [parent=#ActionTimeline] resume
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] getDuration
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- add Timeline to ActionTimeline
|
||||
-- @function [parent=#ActionTimeline] addTimeline
|
||||
-- @param self
|
||||
-- @param #ccs.Timeline timeline
|
||||
|
||||
--------------------------------
|
||||
-- End frame of this action.<br>
|
||||
-- When action play to this frame, if action is not loop, then it will stop, <br>
|
||||
-- or it will play from start frame again.
|
||||
-- @function [parent=#ActionTimeline] getEndFrame
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- Set current frame index, this will cause action plays to this frame.
|
||||
-- @function [parent=#ActionTimeline] setCurrentFrame
|
||||
-- @param self
|
||||
-- @param #int frameIndex
|
||||
|
||||
--------------------------------
|
||||
-- Set the animation speed, this will speed up or slow down the speed.
|
||||
-- @function [parent=#ActionTimeline] setTimeSpeed
|
||||
-- @param self
|
||||
-- @param #float speed
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] init
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- duration of the whole action
|
||||
-- @function [parent=#ActionTimeline] setDuration
|
||||
-- @param self
|
||||
-- @param #int duration
|
||||
|
||||
--------------------------------
|
||||
-- Get current animation speed.
|
||||
-- @function [parent=#ActionTimeline] getTimeSpeed
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] getDuration
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- Goto the specified frame index, and pause at this index.<br>
|
||||
-- param startIndex The animation will pause at this index.
|
||||
|
@ -115,15 +101,40 @@
|
|||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] removeTimeline
|
||||
-- @function [parent=#ActionTimeline] clearFrameEventCallFunc
|
||||
-- @param self
|
||||
-- @param #ccs.Timeline timeline
|
||||
|
||||
--------------------------------
|
||||
-- End frame of this action.<br>
|
||||
-- When action play to this frame, if action is not loop, then it will stop, <br>
|
||||
-- or it will play from start frame again.
|
||||
-- @function [parent=#ActionTimeline] getEndFrame
|
||||
-- @param self
|
||||
-- @return int#int ret (return value: int)
|
||||
|
||||
--------------------------------
|
||||
-- Set the animation speed, this will speed up or slow down the speed.
|
||||
-- @function [parent=#ActionTimeline] setTimeSpeed
|
||||
-- @param self
|
||||
-- @param #float speed
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] clearFrameEventCallFunc
|
||||
-- @function [parent=#ActionTimeline] clearLastFrameCallFunc
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- duration of the whole action
|
||||
-- @function [parent=#ActionTimeline] setDuration
|
||||
-- @param self
|
||||
-- @param #int duration
|
||||
|
||||
--------------------------------
|
||||
-- Set current frame index, this will cause action plays to this frame.
|
||||
-- @function [parent=#ActionTimeline] setCurrentFrame
|
||||
-- @param self
|
||||
-- @param #int frameIndex
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ActionTimeline] create
|
||||
|
|
|
@ -18,19 +18,13 @@
|
|||
-- @param #cc.EventDispatcher dispatcher
|
||||
|
||||
--------------------------------
|
||||
-- Suspends the execution of the running scene, pushing it on the stack of suspended scenes.<br>
|
||||
-- The new scene will be executed.<br>
|
||||
-- Try to avoid big stacks of pushed scenes to reduce memory allocation. <br>
|
||||
-- ONLY call it if there is a running scene.
|
||||
-- @function [parent=#Director] pushScene
|
||||
-- The size in pixels of the surface. It could be different than the screen size.<br>
|
||||
-- High-res devices might have a higher surface size than the screen size.<br>
|
||||
-- Only available when compiled using SDK >= 4.0.<br>
|
||||
-- since v0.99.4
|
||||
-- @function [parent=#Director] setContentScaleFactor
|
||||
-- @param self
|
||||
-- @param #cc.Scene scene
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] getDeltaTime
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
-- @param #float scaleFactor
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -44,18 +38,11 @@
|
|||
-- @param self
|
||||
-- @return size_table#size_table ret (return value: size_table)
|
||||
|
||||
--------------------------------
|
||||
-- Returns the Console <br>
|
||||
-- since v3.0
|
||||
-- @function [parent=#Director] getConsole
|
||||
-- @param self
|
||||
-- @return Console#Console ret (return value: cc.Console)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] pushMatrix
|
||||
-- @function [parent=#Director] getDeltaTime
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- sets the OpenGL default values
|
||||
|
@ -148,6 +135,11 @@
|
|||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] resetMatrixStack
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- converts an OpenGL coordinate to a UIKit coordinate<br>
|
||||
-- Useful to convert node points to window points for calls such as glScissor
|
||||
|
@ -156,6 +148,12 @@
|
|||
-- @param #vec2_table point
|
||||
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] pushMatrix
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
|
||||
--------------------------------
|
||||
-- sets the default values based on the Configuration info
|
||||
-- @function [parent=#Director] setDefaultValues
|
||||
|
@ -206,15 +204,6 @@
|
|||
-- @function [parent=#Director] stopAnimation
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- The size in pixels of the surface. It could be different than the screen size.<br>
|
||||
-- High-res devices might have a higher surface size than the screen size.<br>
|
||||
-- Only available when compiled using SDK >= 4.0.<br>
|
||||
-- since v0.99.4
|
||||
-- @function [parent=#Director] setContentScaleFactor
|
||||
-- @param self
|
||||
-- @param #float scaleFactor
|
||||
|
||||
--------------------------------
|
||||
-- Pops out all scenes from the stack until it reaches `level`.<br>
|
||||
-- If level is 0, it will end the director.<br>
|
||||
|
@ -292,12 +281,6 @@
|
|||
-- @function [parent=#Director] drawScene
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- / FIXME: missing description
|
||||
-- @function [parent=#Director] getZEye
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] getMatrix
|
||||
|
@ -313,6 +296,12 @@
|
|||
-- @function [parent=#Director] popScene
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] loadIdentityMatrix
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
|
||||
--------------------------------
|
||||
-- Whether or not to display the FPS on the bottom-left corner
|
||||
-- @function [parent=#Director] isDisplayStats
|
||||
|
@ -325,11 +314,25 @@
|
|||
-- @param self
|
||||
-- @param #int projection
|
||||
|
||||
--------------------------------
|
||||
-- Returns the Console <br>
|
||||
-- since v3.0
|
||||
-- @function [parent=#Director] getConsole
|
||||
-- @param self
|
||||
-- @return Console#Console ret (return value: cc.Console)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] loadIdentityMatrix
|
||||
-- @function [parent=#Director] multiplyMatrix
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
-- @param #mat4_table mat
|
||||
|
||||
--------------------------------
|
||||
-- / FIXME: missing description
|
||||
-- @function [parent=#Director] getZEye
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
|
@ -337,11 +340,6 @@
|
|||
-- @param self
|
||||
-- @param #bool nextDeltaTimeZero
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] resetMatrixStack
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] popMatrix
|
||||
|
@ -364,10 +362,13 @@
|
|||
-- @return Scheduler#Scheduler ret (return value: cc.Scheduler)
|
||||
|
||||
--------------------------------
|
||||
-- Set the FPS value.
|
||||
-- @function [parent=#Director] setAnimationInterval
|
||||
-- Suspends the execution of the running scene, pushing it on the stack of suspended scenes.<br>
|
||||
-- The new scene will be executed.<br>
|
||||
-- Try to avoid big stacks of pushed scenes to reduce memory allocation. <br>
|
||||
-- ONLY call it if there is a running scene.
|
||||
-- @function [parent=#Director] pushScene
|
||||
-- @param self
|
||||
-- @param #double interval
|
||||
-- @param #cc.Scene scene
|
||||
|
||||
--------------------------------
|
||||
-- Get the FPS value
|
||||
|
@ -402,11 +403,10 @@
|
|||
-- @param #cc.Scene scene
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Director] multiplyMatrix
|
||||
-- Set the FPS value.
|
||||
-- @function [parent=#Director] setAnimationInterval
|
||||
-- @param self
|
||||
-- @param #int type
|
||||
-- @param #mat4_table mat
|
||||
-- @param #double interval
|
||||
|
||||
--------------------------------
|
||||
-- Gets the ActionManager associated with this director<br>
|
||||
|
|
|
@ -259,6 +259,30 @@
|
|||
-- @param self
|
||||
-- @param #vec2_table anchorPoint
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] setScaleY
|
||||
-- @param self
|
||||
-- @param #float scaleY
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] setScaleX
|
||||
-- @param self
|
||||
-- @param #float scaleX
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] getScaleY
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] getScaleX
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] updateDisplayedOpacity
|
||||
|
@ -270,6 +294,14 @@
|
|||
-- @function [parent=#Scale9Sprite] cleanup
|
||||
-- @param self
|
||||
|
||||
--------------------------------
|
||||
-- @overload self, float, float
|
||||
-- @overload self, float
|
||||
-- @function [parent=#Scale9Sprite] setScale
|
||||
-- @param self
|
||||
-- @param #float scalex
|
||||
-- @param #float scaley
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] updateDisplayedColor
|
||||
|
@ -282,6 +314,12 @@
|
|||
-- @param self
|
||||
-- @param #size_table size
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Scale9Sprite] getScale
|
||||
-- @param self
|
||||
-- @return float#float ret (return value: float)
|
||||
|
||||
--------------------------------
|
||||
-- js ctor
|
||||
-- @function [parent=#Scale9Sprite] Scale9Sprite
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
-- @param self
|
||||
-- @return Mesh#Mesh ret (return value: cc.Mesh)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Sprite3D] setCullFace
|
||||
-- @param self
|
||||
-- @param #unsigned int cullFace
|
||||
|
||||
--------------------------------
|
||||
-- light mask getter & setter, light works only when _lightmask & light's flag is true, default value of _lightmask is 0xffff
|
||||
-- @function [parent=#Sprite3D] setLightMask
|
||||
|
@ -60,30 +66,24 @@
|
|||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Sprite3D] setCullFace
|
||||
-- @function [parent=#Sprite3D] getSkeleton
|
||||
-- @param self
|
||||
-- @param #unsigned int cullFace
|
||||
-- @return Skeleton3D#Skeleton3D ret (return value: cc.Skeleton3D)
|
||||
|
||||
--------------------------------
|
||||
-- get SubMeshState by index
|
||||
-- get Mesh by index
|
||||
-- @function [parent=#Sprite3D] getMeshByIndex
|
||||
-- @param self
|
||||
-- @param #int index
|
||||
-- @return Mesh#Mesh ret (return value: cc.Mesh)
|
||||
|
||||
--------------------------------
|
||||
-- get SubMeshState by Name
|
||||
-- get Mesh by Name, it returns the first one if there are more than one mesh with the same name
|
||||
-- @function [parent=#Sprite3D] getMeshByName
|
||||
-- @param self
|
||||
-- @param #string name
|
||||
-- @return Mesh#Mesh ret (return value: cc.Mesh)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Sprite3D] getSkeleton
|
||||
-- @param self
|
||||
-- @return Skeleton3D#Skeleton3D ret (return value: cc.Skeleton3D)
|
||||
|
||||
--------------------------------
|
||||
-- get AttachNode by bone name, return nullptr if not exist
|
||||
-- @function [parent=#Sprite3D] getAttachNode
|
||||
|
|
|
@ -580,6 +580,52 @@ int lua_cocos2dx_3d_Sprite3D_getMesh(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Sprite3D* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
unsigned int arg0;
|
||||
|
||||
ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setCullFace(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_3d_Sprite3D_setLightMask(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -760,7 +806,7 @@ int lua_cocos2dx_3d_Sprite3D_removeAttachNode(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S)
|
||||
int lua_cocos2dx_3d_Sprite3D_getSkeleton(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Sprite3D* cobj = nullptr;
|
||||
|
@ -780,28 +826,26 @@ int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
if (argc == 0)
|
||||
{
|
||||
unsigned int arg0;
|
||||
|
||||
ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setCullFace(arg0);
|
||||
return 0;
|
||||
cocos2d::Skeleton3D* ret = cobj->getSkeleton();
|
||||
object_to_luaval<cocos2d::Skeleton3D>(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getSkeleton",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -900,50 +944,6 @@ int lua_cocos2dx_3d_Sprite3D_getMeshByName(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_3d_Sprite3D_getSkeleton(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Sprite3D* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::Skeleton3D* ret = cobj->getSkeleton();
|
||||
object_to_luaval<cocos2d::Skeleton3D>(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getSkeleton",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_3d_Sprite3D_getAttachNode(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -1059,14 +1059,14 @@ int lua_register_cocos2dx_3d_Sprite3D(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"getLightMask",lua_cocos2dx_3d_Sprite3D_getLightMask);
|
||||
tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_3d_Sprite3D_removeAllAttachNode);
|
||||
tolua_function(tolua_S,"getMesh",lua_cocos2dx_3d_Sprite3D_getMesh);
|
||||
tolua_function(tolua_S,"setCullFace",lua_cocos2dx_3d_Sprite3D_setCullFace);
|
||||
tolua_function(tolua_S,"setLightMask",lua_cocos2dx_3d_Sprite3D_setLightMask);
|
||||
tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_3d_Sprite3D_getBlendFunc);
|
||||
tolua_function(tolua_S,"getMeshCount",lua_cocos2dx_3d_Sprite3D_getMeshCount);
|
||||
tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_3d_Sprite3D_removeAttachNode);
|
||||
tolua_function(tolua_S,"setCullFace",lua_cocos2dx_3d_Sprite3D_setCullFace);
|
||||
tolua_function(tolua_S,"getSkeleton",lua_cocos2dx_3d_Sprite3D_getSkeleton);
|
||||
tolua_function(tolua_S,"getMeshByIndex",lua_cocos2dx_3d_Sprite3D_getMeshByIndex);
|
||||
tolua_function(tolua_S,"getMeshByName",lua_cocos2dx_3d_Sprite3D_getMeshByName);
|
||||
tolua_function(tolua_S,"getSkeleton",lua_cocos2dx_3d_Sprite3D_getSkeleton);
|
||||
tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_3d_Sprite3D_getAttachNode);
|
||||
tolua_function(tolua_S,"create", lua_cocos2dx_3d_Sprite3D_create);
|
||||
tolua_endmodule(tolua_S);
|
||||
|
|
|
@ -10763,7 +10763,7 @@ int lua_cocos2dx_Director_setEventDispatcher(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_pushScene(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Director_setContentScaleFactor(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
|
@ -10783,7 +10783,7 @@ int lua_cocos2dx_Director_pushScene(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_pushScene'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_setContentScaleFactor'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -10791,64 +10791,20 @@ int lua_cocos2dx_Director_pushScene(lua_State* tolua_S)
|
|||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Scene* arg0;
|
||||
double arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::Scene>(tolua_S, 2, "cc.Scene",&arg0);
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:setContentScaleFactor");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->pushScene(arg0);
|
||||
cobj->setContentScaleFactor(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:pushScene",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:setContentScaleFactor",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_pushScene'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
double ret = cobj->getDeltaTime();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getDeltaTime",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getDeltaTime'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_setContentScaleFactor'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -10941,7 +10897,7 @@ int lua_cocos2dx_Director_getWinSizeInPixels(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_getConsole(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
|
@ -10961,7 +10917,7 @@ int lua_cocos2dx_Director_getConsole(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getConsole'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -10971,62 +10927,16 @@ int lua_cocos2dx_Director_getConsole(lua_State* tolua_S)
|
|||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::Console* ret = cobj->getConsole();
|
||||
object_to_luaval<cocos2d::Console>(tolua_S, "cc.Console",(cocos2d::Console*)ret);
|
||||
double ret = cobj->getDeltaTime();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getConsole",argc, 0);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getDeltaTime",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getConsole'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_pushMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_pushMatrix'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:pushMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->pushMatrix(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:pushMatrix",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_pushMatrix'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getDeltaTime'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -11655,6 +11565,49 @@ int lua_cocos2dx_Director_getSecondsPerFrame(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_resetMatrixStack(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_resetMatrixStack'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->resetMatrixStack();
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:resetMatrixStack",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_resetMatrixStack'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_convertToUI(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -11702,6 +11655,52 @@ int lua_cocos2dx_Director_convertToUI(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_pushMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_pushMatrix'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:pushMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->pushMatrix(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:pushMatrix",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_pushMatrix'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_setDefaultValues(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -12052,52 +12051,6 @@ int lua_cocos2dx_Director_stopAnimation(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_setContentScaleFactor(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_setContentScaleFactor'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
double arg0;
|
||||
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:setContentScaleFactor");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setContentScaleFactor(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:setContentScaleFactor",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_setContentScaleFactor'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_popToSceneStackLevel(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -12589,50 +12542,6 @@ int lua_cocos2dx_Director_drawScene(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_getZEye(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getZEye'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
double ret = cobj->getZEye();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getZEye",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getZEye'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_getMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -12666,7 +12575,7 @@ int lua_cocos2dx_Director_getMatrix(lua_State* tolua_S)
|
|||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:getMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cocos2d::Mat4 ret = cobj->getMatrix(arg0);
|
||||
const cocos2d::Mat4& ret = cobj->getMatrix(arg0);
|
||||
mat4_to_luaval(tolua_S, ret);
|
||||
return 1;
|
||||
}
|
||||
|
@ -12723,6 +12632,52 @@ int lua_cocos2dx_Director_popScene(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_loadIdentityMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_loadIdentityMatrix'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:loadIdentityMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->loadIdentityMatrix(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:loadIdentityMatrix",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_loadIdentityMatrix'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_isDisplayStats(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -12813,7 +12768,7 @@ int lua_cocos2dx_Director_setProjection(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_loadIdentityMatrix(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Director_getConsole(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
|
@ -12833,28 +12788,119 @@ int lua_cocos2dx_Director_loadIdentityMatrix(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_loadIdentityMatrix'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getConsole'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
if (argc == 0)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:loadIdentityMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->loadIdentityMatrix(arg0);
|
||||
return 0;
|
||||
cocos2d::Console* ret = cobj->getConsole();
|
||||
object_to_luaval<cocos2d::Console>(tolua_S, "cc.Console",(cocos2d::Console*)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:loadIdentityMatrix",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getConsole",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_loadIdentityMatrix'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getConsole'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_multiplyMatrix'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 2)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
cocos2d::Mat4 arg1;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:multiplyMatrix");
|
||||
|
||||
ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.Director:multiplyMatrix");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->multiplyMatrix(arg0, arg1);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:multiplyMatrix",argc, 2);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_multiplyMatrix'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_getZEye(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getZEye'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
double ret = cobj->getZEye();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getZEye",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getZEye'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -12905,49 +12951,6 @@ int lua_cocos2dx_Director_setNextDeltaTimeZero(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_resetMatrixStack(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_resetMatrixStack'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->resetMatrixStack();
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:resetMatrixStack",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_resetMatrixStack'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_popMatrix(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -13082,7 +13085,7 @@ int lua_cocos2dx_Director_getScheduler(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_setAnimationInterval(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Director_pushScene(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
|
@ -13102,7 +13105,7 @@ int lua_cocos2dx_Director_setAnimationInterval(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_setAnimationInterval'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_pushScene'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -13110,20 +13113,20 @@ int lua_cocos2dx_Director_setAnimationInterval(lua_State* tolua_S)
|
|||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
double arg0;
|
||||
cocos2d::Scene* arg0;
|
||||
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:setAnimationInterval");
|
||||
ok &= luaval_to_object<cocos2d::Scene>(tolua_S, 2, "cc.Scene",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setAnimationInterval(arg0);
|
||||
cobj->pushScene(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:setAnimationInterval",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:pushScene",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_setAnimationInterval'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_pushScene'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -13352,7 +13355,7 @@ int lua_cocos2dx_Director_replaceScene(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Director_setAnimationInterval(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Director* cobj = nullptr;
|
||||
|
@ -13372,31 +13375,28 @@ int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_multiplyMatrix'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_setAnimationInterval'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 2)
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::MATRIX_STACK_TYPE arg0;
|
||||
cocos2d::Mat4 arg1;
|
||||
double arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Director:multiplyMatrix");
|
||||
|
||||
ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.Director:multiplyMatrix");
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:setAnimationInterval");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->multiplyMatrix(arg0, arg1);
|
||||
cobj->setAnimationInterval(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:multiplyMatrix",argc, 2);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:setAnimationInterval",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_multiplyMatrix'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_setAnimationInterval'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -13490,12 +13490,10 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S)
|
|||
tolua_beginmodule(tolua_S,"Director");
|
||||
tolua_function(tolua_S,"pause",lua_cocos2dx_Director_pause);
|
||||
tolua_function(tolua_S,"setEventDispatcher",lua_cocos2dx_Director_setEventDispatcher);
|
||||
tolua_function(tolua_S,"pushScene",lua_cocos2dx_Director_pushScene);
|
||||
tolua_function(tolua_S,"getDeltaTime",lua_cocos2dx_Director_getDeltaTime);
|
||||
tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_Director_setContentScaleFactor);
|
||||
tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_Director_getContentScaleFactor);
|
||||
tolua_function(tolua_S,"getWinSizeInPixels",lua_cocos2dx_Director_getWinSizeInPixels);
|
||||
tolua_function(tolua_S,"getConsole",lua_cocos2dx_Director_getConsole);
|
||||
tolua_function(tolua_S,"pushMatrix",lua_cocos2dx_Director_pushMatrix);
|
||||
tolua_function(tolua_S,"getDeltaTime",lua_cocos2dx_Director_getDeltaTime);
|
||||
tolua_function(tolua_S,"setGLDefaultValues",lua_cocos2dx_Director_setGLDefaultValues);
|
||||
tolua_function(tolua_S,"setActionManager",lua_cocos2dx_Director_setActionManager);
|
||||
tolua_function(tolua_S,"setAlphaBlending",lua_cocos2dx_Director_setAlphaBlending);
|
||||
|
@ -13510,7 +13508,9 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"setDepthTest",lua_cocos2dx_Director_setDepthTest);
|
||||
tolua_function(tolua_S,"getFrameRate",lua_cocos2dx_Director_getFrameRate);
|
||||
tolua_function(tolua_S,"getSecondsPerFrame",lua_cocos2dx_Director_getSecondsPerFrame);
|
||||
tolua_function(tolua_S,"resetMatrixStack",lua_cocos2dx_Director_resetMatrixStack);
|
||||
tolua_function(tolua_S,"convertToUI",lua_cocos2dx_Director_convertToUI);
|
||||
tolua_function(tolua_S,"pushMatrix",lua_cocos2dx_Director_pushMatrix);
|
||||
tolua_function(tolua_S,"setDefaultValues",lua_cocos2dx_Director_setDefaultValues);
|
||||
tolua_function(tolua_S,"init",lua_cocos2dx_Director_init);
|
||||
tolua_function(tolua_S,"setScheduler",lua_cocos2dx_Director_setScheduler);
|
||||
|
@ -13519,7 +13519,6 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"getRunningScene",lua_cocos2dx_Director_getRunningScene);
|
||||
tolua_function(tolua_S,"setViewport",lua_cocos2dx_Director_setViewport);
|
||||
tolua_function(tolua_S,"stopAnimation",lua_cocos2dx_Director_stopAnimation);
|
||||
tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_Director_setContentScaleFactor);
|
||||
tolua_function(tolua_S,"popToSceneStackLevel",lua_cocos2dx_Director_popToSceneStackLevel);
|
||||
tolua_function(tolua_S,"resume",lua_cocos2dx_Director_resume);
|
||||
tolua_function(tolua_S,"isNextDeltaTimeZero",lua_cocos2dx_Director_isNextDeltaTimeZero);
|
||||
|
@ -13531,24 +13530,25 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"runWithScene",lua_cocos2dx_Director_runWithScene);
|
||||
tolua_function(tolua_S,"setNotificationNode",lua_cocos2dx_Director_setNotificationNode);
|
||||
tolua_function(tolua_S,"drawScene",lua_cocos2dx_Director_drawScene);
|
||||
tolua_function(tolua_S,"getZEye",lua_cocos2dx_Director_getZEye);
|
||||
tolua_function(tolua_S,"getMatrix",lua_cocos2dx_Director_getMatrix);
|
||||
tolua_function(tolua_S,"popScene",lua_cocos2dx_Director_popScene);
|
||||
tolua_function(tolua_S,"loadIdentityMatrix",lua_cocos2dx_Director_loadIdentityMatrix);
|
||||
tolua_function(tolua_S,"isDisplayStats",lua_cocos2dx_Director_isDisplayStats);
|
||||
tolua_function(tolua_S,"setProjection",lua_cocos2dx_Director_setProjection);
|
||||
tolua_function(tolua_S,"loadIdentityMatrix",lua_cocos2dx_Director_loadIdentityMatrix);
|
||||
tolua_function(tolua_S,"getConsole",lua_cocos2dx_Director_getConsole);
|
||||
tolua_function(tolua_S,"multiplyMatrix",lua_cocos2dx_Director_multiplyMatrix);
|
||||
tolua_function(tolua_S,"getZEye",lua_cocos2dx_Director_getZEye);
|
||||
tolua_function(tolua_S,"setNextDeltaTimeZero",lua_cocos2dx_Director_setNextDeltaTimeZero);
|
||||
tolua_function(tolua_S,"resetMatrixStack",lua_cocos2dx_Director_resetMatrixStack);
|
||||
tolua_function(tolua_S,"popMatrix",lua_cocos2dx_Director_popMatrix);
|
||||
tolua_function(tolua_S,"getVisibleSize",lua_cocos2dx_Director_getVisibleSize);
|
||||
tolua_function(tolua_S,"getScheduler",lua_cocos2dx_Director_getScheduler);
|
||||
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Director_setAnimationInterval);
|
||||
tolua_function(tolua_S,"pushScene",lua_cocos2dx_Director_pushScene);
|
||||
tolua_function(tolua_S,"getAnimationInterval",lua_cocos2dx_Director_getAnimationInterval);
|
||||
tolua_function(tolua_S,"isPaused",lua_cocos2dx_Director_isPaused);
|
||||
tolua_function(tolua_S,"setDisplayStats",lua_cocos2dx_Director_setDisplayStats);
|
||||
tolua_function(tolua_S,"getEventDispatcher",lua_cocos2dx_Director_getEventDispatcher);
|
||||
tolua_function(tolua_S,"replaceScene",lua_cocos2dx_Director_replaceScene);
|
||||
tolua_function(tolua_S,"multiplyMatrix",lua_cocos2dx_Director_multiplyMatrix);
|
||||
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Director_setAnimationInterval);
|
||||
tolua_function(tolua_S,"getActionManager",lua_cocos2dx_Director_getActionManager);
|
||||
tolua_function(tolua_S,"getInstance", lua_cocos2dx_Director_getInstance);
|
||||
tolua_endmodule(tolua_S);
|
||||
|
|
|
@ -18911,7 +18911,7 @@ int lua_register_cocos2dx_studio_ActionTimelineData(lua_State* tolua_S)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int lua_cocos2dx_studio_ActionTimeline_getTimelines(lua_State* tolua_S)
|
||||
int lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
|
@ -18931,26 +18931,78 @@ int lua_cocos2dx_studio_ActionTimeline_getTimelines(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getTimelines'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
if (argc == 1)
|
||||
{
|
||||
std::function<void (cocostudio::timeline::Frame *)> arg0;
|
||||
|
||||
do {
|
||||
// Lambda binding for lua is not supported.
|
||||
assert(false);
|
||||
} while(0)
|
||||
;
|
||||
if(!ok)
|
||||
return 0;
|
||||
const cocos2d::Vector<cocostudio::timeline::Timeline *>& ret = cobj->getTimelines();
|
||||
ccvector_to_luaval(tolua_S, ret);
|
||||
return 1;
|
||||
cobj->setFrameEventCallFunc(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getTimelines",argc, 0);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setFrameEventCallFunc",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getTimelines'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_addTimeline(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_addTimeline'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocostudio::timeline::Timeline* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocostudio::timeline::Timeline>(tolua_S, 2, "ccs.Timeline",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->addTimeline(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:addTimeline",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_addTimeline'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -19086,7 +19138,7 @@ int lua_cocos2dx_studio_ActionTimeline_pause(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(lua_State* tolua_S)
|
||||
int lua_cocos2dx_studio_ActionTimeline_init(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
|
@ -19106,7 +19158,51 @@ int lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_init'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
bool ret = cobj->init();
|
||||
tolua_pushboolean(tolua_S,(bool)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:init",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_init'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_removeTimeline(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_removeTimeline'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -19114,7 +19210,53 @@ int lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(lua_State* tolua_S)
|
|||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
std::function<void (cocostudio::timeline::Frame *)> arg0;
|
||||
cocostudio::timeline::Timeline* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocostudio::timeline::Timeline>(tolua_S, 2, "ccs.Timeline",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->removeTimeline(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:removeTimeline",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_removeTimeline'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
std::function<void ()> arg0;
|
||||
|
||||
do {
|
||||
// Lambda binding for lua is not supported.
|
||||
|
@ -19123,15 +19265,59 @@ int lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(lua_State* tolua_S)
|
|||
;
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setFrameEventCallFunc(arg0);
|
||||
cobj->setLastFrameCallFunc(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setFrameEventCallFunc",argc, 1);
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setLastFrameCallFunc",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getTimelines(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getTimelines'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
const cocos2d::Vector<cocostudio::timeline::Timeline *>& ret = cobj->getTimelines();
|
||||
ccvector_to_luaval(tolua_S, ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getTimelines",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getTimelines'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -19179,322 +19365,6 @@ int lua_cocos2dx_studio_ActionTimeline_resume(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getDuration(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getDuration'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
int ret = cobj->getDuration();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getDuration",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getDuration'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_addTimeline(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_addTimeline'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocostudio::timeline::Timeline* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocostudio::timeline::Timeline>(tolua_S, 2, "ccs.Timeline",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->addTimeline(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:addTimeline",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_addTimeline'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getEndFrame(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getEndFrame'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
int ret = cobj->getEndFrame();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getEndFrame",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getEndFrame'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setCurrentFrame(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setCurrentFrame'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
int arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:setCurrentFrame");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setCurrentFrame(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setCurrentFrame",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setCurrentFrame'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setTimeSpeed(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setTimeSpeed'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
double arg0;
|
||||
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "ccs.ActionTimeline:setTimeSpeed");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setTimeSpeed(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setTimeSpeed",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setTimeSpeed'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_init(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_init'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
bool ret = cobj->init();
|
||||
tolua_pushboolean(tolua_S,(bool)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:init",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_init'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setDuration(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setDuration'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
int arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:setDuration");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setDuration(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setDuration",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setDuration'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getTimeSpeed(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -19539,6 +19409,50 @@ int lua_cocos2dx_studio_ActionTimeline_getTimeSpeed(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getDuration(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getDuration'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
int ret = cobj->getDuration();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getDuration",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getDuration'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPause(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -19728,52 +19642,6 @@ int lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPlay(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_removeTimeline(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_removeTimeline'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocostudio::timeline::Timeline* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocostudio::timeline::Timeline>(tolua_S, 2, "ccs.Timeline",&arg0);
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->removeTimeline(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:removeTimeline",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_removeTimeline'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -19817,6 +19685,231 @@ int lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc(lua_State* tolua_
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_getEndFrame(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_getEndFrame'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
int ret = cobj->getEndFrame();
|
||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
||||
return 1;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:getEndFrame",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_getEndFrame'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setTimeSpeed(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setTimeSpeed'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
double arg0;
|
||||
|
||||
ok &= luaval_to_number(tolua_S, 2,&arg0, "ccs.ActionTimeline:setTimeSpeed");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setTimeSpeed(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setTimeSpeed",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setTimeSpeed'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 0)
|
||||
{
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->clearLastFrameCallFunc();
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:clearLastFrameCallFunc",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setDuration(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setDuration'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
int arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:setDuration");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setDuration(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setDuration",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setDuration'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_setCurrentFrame(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocostudio::timeline::ActionTimeline* cobj = nullptr;
|
||||
bool ok = true;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_Error tolua_err;
|
||||
#endif
|
||||
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setCurrentFrame'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
int arg0;
|
||||
|
||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:setCurrentFrame");
|
||||
if(!ok)
|
||||
return 0;
|
||||
cobj->setCurrentFrame(arg0);
|
||||
return 0;
|
||||
}
|
||||
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setCurrentFrame",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setCurrentFrame'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_studio_ActionTimeline_create(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -19895,25 +19988,27 @@ int lua_register_cocos2dx_studio_ActionTimeline(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"ActionTimeline");
|
||||
tolua_function(tolua_S,"new",lua_cocos2dx_studio_ActionTimeline_constructor);
|
||||
tolua_function(tolua_S,"getTimelines",lua_cocos2dx_studio_ActionTimeline_getTimelines);
|
||||
tolua_function(tolua_S,"setFrameEventCallFunc",lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc);
|
||||
tolua_function(tolua_S,"addTimeline",lua_cocos2dx_studio_ActionTimeline_addTimeline);
|
||||
tolua_function(tolua_S,"getCurrentFrame",lua_cocos2dx_studio_ActionTimeline_getCurrentFrame);
|
||||
tolua_function(tolua_S,"getStartFrame",lua_cocos2dx_studio_ActionTimeline_getStartFrame);
|
||||
tolua_function(tolua_S,"pause",lua_cocos2dx_studio_ActionTimeline_pause);
|
||||
tolua_function(tolua_S,"setFrameEventCallFunc",lua_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc);
|
||||
tolua_function(tolua_S,"resume",lua_cocos2dx_studio_ActionTimeline_resume);
|
||||
tolua_function(tolua_S,"getDuration",lua_cocos2dx_studio_ActionTimeline_getDuration);
|
||||
tolua_function(tolua_S,"addTimeline",lua_cocos2dx_studio_ActionTimeline_addTimeline);
|
||||
tolua_function(tolua_S,"getEndFrame",lua_cocos2dx_studio_ActionTimeline_getEndFrame);
|
||||
tolua_function(tolua_S,"setCurrentFrame",lua_cocos2dx_studio_ActionTimeline_setCurrentFrame);
|
||||
tolua_function(tolua_S,"setTimeSpeed",lua_cocos2dx_studio_ActionTimeline_setTimeSpeed);
|
||||
tolua_function(tolua_S,"init",lua_cocos2dx_studio_ActionTimeline_init);
|
||||
tolua_function(tolua_S,"setDuration",lua_cocos2dx_studio_ActionTimeline_setDuration);
|
||||
tolua_function(tolua_S,"removeTimeline",lua_cocos2dx_studio_ActionTimeline_removeTimeline);
|
||||
tolua_function(tolua_S,"setLastFrameCallFunc",lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc);
|
||||
tolua_function(tolua_S,"getTimelines",lua_cocos2dx_studio_ActionTimeline_getTimelines);
|
||||
tolua_function(tolua_S,"resume",lua_cocos2dx_studio_ActionTimeline_resume);
|
||||
tolua_function(tolua_S,"getTimeSpeed",lua_cocos2dx_studio_ActionTimeline_getTimeSpeed);
|
||||
tolua_function(tolua_S,"getDuration",lua_cocos2dx_studio_ActionTimeline_getDuration);
|
||||
tolua_function(tolua_S,"gotoFrameAndPause",lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPause);
|
||||
tolua_function(tolua_S,"isPlaying",lua_cocos2dx_studio_ActionTimeline_isPlaying);
|
||||
tolua_function(tolua_S,"gotoFrameAndPlay",lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPlay);
|
||||
tolua_function(tolua_S,"removeTimeline",lua_cocos2dx_studio_ActionTimeline_removeTimeline);
|
||||
tolua_function(tolua_S,"clearFrameEventCallFunc",lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc);
|
||||
tolua_function(tolua_S,"getEndFrame",lua_cocos2dx_studio_ActionTimeline_getEndFrame);
|
||||
tolua_function(tolua_S,"setTimeSpeed",lua_cocos2dx_studio_ActionTimeline_setTimeSpeed);
|
||||
tolua_function(tolua_S,"clearLastFrameCallFunc",lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc);
|
||||
tolua_function(tolua_S,"setDuration",lua_cocos2dx_studio_ActionTimeline_setDuration);
|
||||
tolua_function(tolua_S,"setCurrentFrame",lua_cocos2dx_studio_ActionTimeline_setCurrentFrame);
|
||||
tolua_function(tolua_S,"create", lua_cocos2dx_studio_ActionTimeline_create);
|
||||
tolua_endmodule(tolua_S);
|
||||
std::string typeName = typeid(cocostudio::timeline::ActionTimeline).name();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue