conflicts resolved

This commit is contained in:
fnz 2015-11-27 13:19:10 +03:00
commit 8c691430c1
168 changed files with 8012 additions and 4981 deletions

View File

@ -1,4 +1,27 @@
cocos2d-x-3.9 beta0 October.20 2015
cocos2d-x-3.10 December ? 2015
[NEW] Core: Added Application::getVersion() to get the app version.
[NEW] UI: Add PageView indicator.
[REFINE] UI: RichText support new line element.
[REFINE] UI: Set focus to Widget when touched.
[REFINE] UI: Change PageView to derived from ListView.
[REFINE] UI: Rewrite Scale9Sprite and improve the scale9sprite performance and reduce memory consumption.
[REFINE] 3D: Change char* to string in Terrain.
[REFINE] Editor: Merge Studio ActionTimeLine change back into engine.
[REFINe] Mac: Make engine compatible for 32bit Mac.
[FIX] Core: Fix premultiplyAlpha for mipmaps and compressed textures.
[FIX] UI: Fix Scale9sprite rendering error when content size smaller than the sum of leftInset and rightInset.
[FIX] Win32: Fix EditBox crash when removing an EditBox in a scheduler.
[FIX] Android: Fix cannot add view to mFrameLayout when extends Cocos2dxActivity.
[FIX] 2D: Fixed actionNode position error bug.
[FIX] 3D: Fix the movement of PUParticle lags one frame.
[FIX] UI: Fix the wront argument of setPlaceholderFontName in EditBox.
[FIX] UI: Fix EditBox editBoxEditingDidEnd may use the original text after change the text of EditBox in user script.
[FIX] Audio: Fix `FinishCallback` never be called in Windows.
[FIX] UI: Fix Layout stencil clipping nested with Clipping Node rendering issue.
cocos2d-x-3.9 November.09 2015
[NEW] Label: Added line spacing/leading feature to Label.
[NEW] ListView: Added APIs to scroll to specific item in list.
@ -124,6 +147,10 @@ cocos2d-x-3.9 beta0 October.20 2015
[TEST] JS: Fixed crash bug when click "remove ui" in "native test-JSBExtendTest" under project js-test.
[TEST] JS: Updated testcase in js-test to show notificationNode to runAction.
cocos2d-x-3.8.1 September.17 2015
[HIGHLIGHT] platform: Supported Xcode 7 for iOS 9 deployment
cocos2d-x-3.8 final September.6 2015
cocos2d-x-3.8 rc0 August.26 2015
cocos2d-x-3.8 beta0 August.14 2015

View File

@ -182,7 +182,7 @@ Build Requirements
Runtime Requirements
--------------------
* iOS 5.0+ for iPhone / iPad games
* iOS 6.0+ for iPhone / iPad games
* Android 2.3+ for Android games
* Windows 8.1 or Windows 10.0 for Windows Phone/Store 8.1 games
* Windows 10.0 for Windows Phone/Store 10.0 games

View File

@ -1234,6 +1234,11 @@
2980F02B1BA9A5550059E678 /* UITextView+CCUITextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 2980F0201BA9A5550059E678 /* UITextView+CCUITextInput.h */; };
2980F02C1BA9A5550059E678 /* UITextView+CCUITextInput.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2980F0211BA9A5550059E678 /* UITextView+CCUITextInput.mm */; };
2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2986667818B1B079000E39CA /* CCTweenFunction.cpp */; };
298C75D51C0465D0006BAE63 /* CCStencilStateManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 298C75D31C0465D0006BAE63 /* CCStencilStateManager.cpp */; };
298C75D61C0465D1006BAE63 /* CCStencilStateManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 298C75D31C0465D0006BAE63 /* CCStencilStateManager.cpp */; };
298C75D71C0465D1006BAE63 /* CCStencilStateManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 298C75D41C0465D0006BAE63 /* CCStencilStateManager.hpp */; };
298C75D81C0465D1006BAE63 /* CCStencilStateManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 298C75D41C0465D0006BAE63 /* CCStencilStateManager.hpp */; };
298C75D91C04681F006BAE63 /* CCStencilStateManager.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 298C75D41C0465D0006BAE63 /* CCStencilStateManager.hpp */; };
299754F4193EC95400A54AC3 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */; };
299754F5193EC95400A54AC3 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */; };
299754F6193EC95400A54AC3 /* ObjectFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 299754F3193EC95400A54AC3 /* ObjectFactory.h */; };
@ -2072,6 +2077,10 @@
B5668D7E1B3838E4003CBD5E /* UIScrollViewBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5668D7B1B3838E4003CBD5E /* UIScrollViewBar.cpp */; };
B5668D7F1B3838E4003CBD5E /* UIScrollViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = B5668D7C1B3838E4003CBD5E /* UIScrollViewBar.h */; };
B5668D801B3838E4003CBD5E /* UIScrollViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = B5668D7C1B3838E4003CBD5E /* UIScrollViewBar.h */; };
B5A738961BB0051F00BAAEF8 /* UIPageViewIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A738941BB0051F00BAAEF8 /* UIPageViewIndicator.cpp */; };
B5A738971BB0051F00BAAEF8 /* UIPageViewIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A738941BB0051F00BAAEF8 /* UIPageViewIndicator.cpp */; };
B5A738981BB0051F00BAAEF8 /* UIPageViewIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A738951BB0051F00BAAEF8 /* UIPageViewIndicator.h */; };
B5A738991BB0051F00BAAEF8 /* UIPageViewIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A738951BB0051F00BAAEF8 /* UIPageViewIndicator.h */; };
B5CE6DBE1B3BF2B1002B0419 /* UIAbstractCheckButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5CE6DBC1B3BF2B1002B0419 /* UIAbstractCheckButton.cpp */; };
B5CE6DBF1B3BF2B1002B0419 /* UIAbstractCheckButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5CE6DBC1B3BF2B1002B0419 /* UIAbstractCheckButton.cpp */; };
B5CE6DC01B3BF2B1002B0419 /* UIAbstractCheckButton.h in Headers */ = {isa = PBXBuildFile; fileRef = B5CE6DBD1B3BF2B1002B0419 /* UIAbstractCheckButton.h */; };
@ -4140,6 +4149,8 @@
2980F0211BA9A5550059E678 /* UITextView+CCUITextInput.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UITextView+CCUITextInput.mm"; sourceTree = "<group>"; };
2986667818B1B079000E39CA /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = "<group>"; };
2986667918B1B079000E39CA /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = "<group>"; };
298C75D31C0465D0006BAE63 /* CCStencilStateManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCStencilStateManager.cpp; path = ../base/CCStencilStateManager.cpp; sourceTree = "<group>"; };
298C75D41C0465D0006BAE63 /* CCStencilStateManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CCStencilStateManager.hpp; path = ../base/CCStencilStateManager.hpp; sourceTree = "<group>"; };
299754F2193EC95400A54AC3 /* ObjectFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectFactory.cpp; path = ../base/ObjectFactory.cpp; sourceTree = "<group>"; };
299754F3193EC95400A54AC3 /* ObjectFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectFactory.h; path = ../base/ObjectFactory.h; sourceTree = "<group>"; };
299CF1F919A434BC00C378C1 /* ccRandom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccRandom.cpp; path = ../base/ccRandom.cpp; sourceTree = "<group>"; };
@ -4805,6 +4816,8 @@
B3AF019F1842FBA400A98B85 /* b2MotorJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MotorJoint.h; sourceTree = "<group>"; };
B5668D7B1B3838E4003CBD5E /* UIScrollViewBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScrollViewBar.cpp; sourceTree = "<group>"; };
B5668D7C1B3838E4003CBD5E /* UIScrollViewBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollViewBar.h; sourceTree = "<group>"; };
B5A738941BB0051F00BAAEF8 /* UIPageViewIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIPageViewIndicator.cpp; sourceTree = "<group>"; };
B5A738951BB0051F00BAAEF8 /* UIPageViewIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPageViewIndicator.h; sourceTree = "<group>"; };
B5CE6DBC1B3BF2B1002B0419 /* UIAbstractCheckButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIAbstractCheckButton.cpp; sourceTree = "<group>"; };
B5CE6DBD1B3BF2B1002B0419 /* UIAbstractCheckButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAbstractCheckButton.h; sourceTree = "<group>"; };
B5CE6DC61B3C05BA002B0419 /* UIRadioButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIRadioButton.cpp; sourceTree = "<group>"; };
@ -6031,6 +6044,8 @@
50ABBE1C1925AB6F00A911A9 /* utlist.h */,
50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */,
50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */,
298C75D31C0465D0006BAE63 /* CCStencilStateManager.cpp */,
298C75D41C0465D0006BAE63 /* CCStencilStateManager.hpp */,
);
name = base;
path = ../cocos/2d;
@ -6971,6 +6986,8 @@
2905FA0118CF08D000240AA3 /* UILoadingBar.h */,
2905FA0218CF08D000240AA3 /* UIPageView.cpp */,
2905FA0318CF08D000240AA3 /* UIPageView.h */,
B5A738941BB0051F00BAAEF8 /* UIPageViewIndicator.cpp */,
B5A738951BB0051F00BAAEF8 /* UIPageViewIndicator.h */,
2905FA0418CF08D000240AA3 /* UIRichText.cpp */,
2905FA0518CF08D000240AA3 /* UIRichText.h */,
2905FA0718CF08D000240AA3 /* UIScrollView.cpp */,
@ -9221,6 +9238,7 @@
15AE182A19AAD2F700C27E9E /* CCMeshSkin.h in Headers */,
B276EF5F1988D1D500CD400F /* CCVertexIndexData.h in Headers */,
1A57007F180BC5A10088DEC7 /* CCActionInterval.h in Headers */,
298C75D71C0465D1006BAE63 /* CCStencilStateManager.hpp in Headers */,
B6DD2FDB1B04825B00E47F5F /* DetourLocalBoundary.h in Headers */,
B6CAB3491AF9AA1A00B9B856 /* gim_clip_polygon.h in Headers */,
B677B0DB1B18492D006762CB /* CCNavMeshUtils.h in Headers */,
@ -9481,6 +9499,7 @@
B665E3F41AA80A6600DDB1C5 /* CCPUSlaveEmitter.h in Headers */,
15AE1B6919AADA9900C27E9E /* UIDeprecated.h in Headers */,
1A570223180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */,
B5A738981BB0051F00BAAEF8 /* UIPageViewIndicator.h in Headers */,
B6CAB53F1AF9AA1A00B9B856 /* cl_platform.h in Headers */,
15AE1A8319AAD40300C27E9E /* b2GearJoint.h in Headers */,
15AE1BD519AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */,
@ -10660,6 +10679,7 @@
85505F051B60E3B2003F2CD4 /* CCBoneNode.h in Headers */,
B665E2491AA80A6500DDB1C5 /* CCPUCollisionAvoidanceAffectorTranslator.h in Headers */,
B6CAB4461AF9AA1A00B9B856 /* btParallelConstraintSolver.h in Headers */,
298C75D81C0465D1006BAE63 /* CCStencilStateManager.hpp in Headers */,
15AE18D119AAD33D00C27E9E /* CCNodeLoaderLibrary.h in Headers */,
15AE1AC319AAD40300C27E9E /* b2DistanceJoint.h in Headers */,
B6CAB5261AF9AA1A00B9B856 /* btQuickprof.h in Headers */,
@ -10984,6 +11004,7 @@
B665E2951AA80A6500DDB1C5 /* CCPUEmitter.h in Headers */,
B6CAB3BE1AF9AA1A00B9B856 /* btGeneric6DofSpringConstraint.h in Headers */,
B6CAB3521AF9AA1A00B9B856 /* gim_geometry.h in Headers */,
B5A738991BB0051F00BAAEF8 /* UIPageViewIndicator.h in Headers */,
15AE1BED19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */,
15AE195019AAD35100C27E9E /* CCDatas.h in Headers */,
15AE18B319AAD33D00C27E9E /* CCBReader.h in Headers */,
@ -11169,6 +11190,7 @@
ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */,
15AE1A2C19AAD3D500C27E9E /* b2DynamicTree.cpp in Sources */,
B665E36A1AA80A6500DDB1C5 /* CCPUOnVelocityObserver.cpp in Sources */,
B5A738961BB0051F00BAAEF8 /* UIPageViewIndicator.cpp in Sources */,
B665E3961AA80A6500DDB1C5 /* CCPUPointEmitter.cpp in Sources */,
15AE184019AAD2F700C27E9E /* CCSprite3D.cpp in Sources */,
B6CAB2E51AF9AA1A00B9B856 /* btSphereShape.cpp in Sources */,
@ -11819,6 +11841,7 @@
B665E2EE1AA80A6500DDB1C5 /* CCPULineEmitter.cpp in Sources */,
B6CAB2DD1AF9AA1A00B9B856 /* btScaledBvhTriangleMeshShape.cpp in Sources */,
B665E4121AA80A6600DDB1C5 /* CCPUTextureAnimator.cpp in Sources */,
298C75D51C0465D0006BAE63 /* CCStencilStateManager.cpp in Sources */,
B665E3D21AA80A6600DDB1C5 /* CCPUScriptLexer.cpp in Sources */,
B665E4021AA80A6600DDB1C5 /* CCPUSphereColliderTranslator.cpp in Sources */,
15AE1A3619AAD3D500C27E9E /* b2PolygonShape.cpp in Sources */,
@ -11953,6 +11976,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
298C75D91C04681F006BAE63 /* CCStencilStateManager.hpp in Sources */,
D0FD03541A3B51AA00825BB5 /* CCAllocatorGlobalNewDelete.cpp in Sources */,
15AE1B9819AADAA100C27E9E /* UIVideoPlayer-ios.mm in Sources */,
B665E38F1AA80A6500DDB1C5 /* CCPUPlaneCollider.cpp in Sources */,
@ -12103,6 +12127,7 @@
15AE193C19AAD35100C27E9E /* CCArmatureDefine.cpp in Sources */,
B665E35F1AA80A6500DDB1C5 /* CCPUOnRandomObserverTranslator.cpp in Sources */,
B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */,
298C75D61C0465D1006BAE63 /* CCStencilStateManager.cpp in Sources */,
15AE194B19AAD35100C27E9E /* CCComRender.cpp in Sources */,
382384451A25915C002C4610 /* SpriteReader.cpp in Sources */,
B6CAB2321AF9AA1A00B9B856 /* btCollisionWorld.cpp in Sources */,
@ -12644,6 +12669,7 @@
B665E1FB1AA80A6500DDB1C5 /* CCPUAffectorTranslator.cpp in Sources */,
B665E3931AA80A6500DDB1C5 /* CCPUPlaneColliderTranslator.cpp in Sources */,
382383F71A258FA7002C4610 /* idl_gen_fbs.cpp in Sources */,
B5A738971BB0051F00BAAEF8 /* UIPageViewIndicator.cpp in Sources */,
B665E24B1AA80A6500DDB1C5 /* CCPUColorAffector.cpp in Sources */,
B665E20F1AA80A6500DDB1C5 /* CCPUBaseForceAffector.cpp in Sources */,
15AE1B7419AADA9A00C27E9E /* UILoadingBar.cpp in Sources */,

View File

@ -87,6 +87,17 @@ void PolygonInfo::setQuad(V3F_C4B_T2F_Quad *quad)
triangles.verts = (V3F_C4B_T2F*)quad;
}
void PolygonInfo::setTriangles(TrianglesCommand::Triangles other)
{
this->releaseVertsAndIndices();
isVertsOwner = false;
this->triangles.vertCount = other.vertCount;
this->triangles.indexCount = other.indexCount;
this->triangles.verts = other.verts;
this->triangles.indices = other.indices;
}
void PolygonInfo::releaseVertsAndIndices()
{
if(isVertsOwner)

View File

@ -89,6 +89,14 @@ public:
*/
void setQuad(V3F_C4B_T2F_Quad *quad);
/**
* set the data to be a pointer to a triangles
* the member verts will not be released when this PolygonInfo destructs
* as the verts memory are managed by other objects
* @param triangles a pointer to the TrianglesCommand::Triangles object
*/
void setTriangles(TrianglesCommand::Triangles triangles);
/**
* get vertex count
* @return number of vertices
@ -110,7 +118,6 @@ public:
Rect rect;
std::string filename;
TrianglesCommand::Triangles triangles;
protected:
bool isVertsOwner;
@ -267,4 +274,4 @@ protected:
NS_CC_END
#endif // #ifndef COCOS_2D_CCAUTOPOLYGON_H__
#endif // #ifndef COCOS_2D_CCAUTOPOLYGON_H__

View File

@ -32,6 +32,7 @@
#include "renderer/CCRenderer.h"
#include "renderer/CCRenderState.h"
#include "base/CCDirector.h"
#include "base/CCStencilStateManager.hpp"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#define CC_CLIPPING_NODE_OPENGLES 0
@ -41,12 +42,6 @@
NS_CC_BEGIN
static GLint g_sStencilBits = -1;
// store the current stencil layer (position in the stencil buffer),
// this will allow nesting up to n ClippingNode,
// where n is the number of bits of the stencil buffer.
static GLint s_layer = -1;
#if CC_CLIPPING_NODE_OPENGLES
static void setProgram(Node *n, GLProgram *p)
{
@ -61,22 +56,8 @@ static void setProgram(Node *n, GLProgram *p)
ClippingNode::ClippingNode()
: _stencil(nullptr)
, _alphaThreshold(0.0f)
, _inverted(false)
, _currentStencilEnabled(GL_FALSE)
, _currentStencilWriteMask(~0)
, _currentStencilFunc(GL_ALWAYS)
, _currentStencilRef(0)
, _currentStencilValueMask(~0)
, _currentStencilFail(GL_KEEP)
, _currentStencilPassDepthFail(GL_KEEP)
, _currentStencilPassDepthPass(GL_KEEP)
, _currentDepthWriteMask(GL_TRUE)
, _currentAlphaTestEnabled(GL_FALSE)
, _currentAlphaTestFunc(GL_ALWAYS)
, _currentAlphaTestRef(1)
,_stencilStateManager(new StencilStateManager())
{
}
ClippingNode::~ClippingNode()
@ -128,21 +109,6 @@ bool ClippingNode::init(Node *stencil)
CC_SAFE_RELEASE(_stencil);
_stencil = stencil;
CC_SAFE_RETAIN(_stencil);
_alphaThreshold = 1;
_inverted = false;
// get (only once) the number of bits of the stencil buffer
static bool once = true;
if (once)
{
glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits);
if (g_sStencilBits <= 0)
{
CCLOG("Stencil buffer is not enabled.");
}
once = false;
}
return true;
}
@ -222,45 +188,6 @@ void ClippingNode::onExit()
Node::onExit();
}
void ClippingNode::drawFullScreenQuadClearStencil()
{
Director* director = Director::getInstance();
CCASSERT(nullptr != director, "Director is null when setting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
Vec2 vertices[] = {
Vec2(-1.0f, -1.0f),
Vec2(1.0f, -1.0f),
Vec2(1.0f, 1.0f),
Vec2(-1.0f, 1.0f)
};
auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);
int colorLocation = glProgram->getUniformLocation("u_color");
CHECK_GL_ERROR_DEBUG();
Color4F color(1, 1, 1, 1);
glProgram->use();
glProgram->setUniformsForBuiltins();
glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
@ -285,9 +212,11 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
renderer->pushGroup(_groupCommand.getRenderQueueID());
_beforeVisitCmd.init(_globalZOrder);
_beforeVisitCmd.func = CC_CALLBACK_0(ClippingNode::onBeforeVisit, this);
_beforeVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onBeforeVisit, _stencilStateManager);
renderer->addCommand(&_beforeVisitCmd);
if (_alphaThreshold < 1)
auto alphaThreshold = this->getAlphaThreshold();
if (alphaThreshold < 1)
{
#if CC_CLIPPING_NODE_OPENGLES
// since glAlphaTest do not exists in OES, use a shader that writes
@ -296,7 +225,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);
// set our alphaThreshold
program->use();
program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);
program->setUniformLocationWith1f(alphaValueLocation, alphaThreshold);
// we need to recursively apply this shader to all the nodes in the stencil node
// FIXME: we should have a way to apply shader to all nodes without having to do this
setProgram(_stencil, program);
@ -307,7 +236,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
_stencil->visit(renderer, _modelViewTransform, flags);
_afterDrawStencilCmd.init(_globalZOrder);
_afterDrawStencilCmd.func = CC_CALLBACK_0(ClippingNode::onAfterDrawStencil, this);
_afterDrawStencilCmd.func = CC_CALLBACK_0(StencilStateManager::onAfterDrawStencil, _stencilStateManager);
renderer->addCommand(&_afterDrawStencilCmd);
int i = 0;
@ -339,7 +268,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
}
_afterVisitCmd.init(_globalZOrder);
_afterVisitCmd.func = CC_CALLBACK_0(ClippingNode::onAfterVisit, this);
_afterVisitCmd.func = CC_CALLBACK_0(StencilStateManager::onAfterVisit, _stencilStateManager);
renderer->addCommand(&_afterVisitCmd);
renderer->popGroup();
@ -374,196 +303,23 @@ bool ClippingNode::hasContent() const
GLfloat ClippingNode::getAlphaThreshold() const
{
return _alphaThreshold;
return _stencilStateManager->getAlphaThreshold();
}
void ClippingNode::setAlphaThreshold(GLfloat alphaThreshold)
{
_alphaThreshold = alphaThreshold;
_stencilStateManager->setAlphaThreshold(alphaThreshold);
}
bool ClippingNode::isInverted() const
{
return _inverted;
return _stencilStateManager->isInverted();
}
void ClippingNode::setInverted(bool inverted)
{
_inverted = inverted;
_stencilStateManager->setInverted(inverted);
}
void ClippingNode::onBeforeVisit()
{
///////////////////////////////////
// INIT
// increment the current layer
s_layer++;
// mask of the current layer (ie: for layer 3: 00000100)
GLint mask_layer = 0x1 << s_layer;
// mask of all layers less than the current (ie: for layer 3: 00000011)
GLint mask_layer_l = mask_layer - 1;
// mask of all layers less than or equal to the current (ie: for layer 3: 00000111)
_mask_layer_le = mask_layer | mask_layer_l;
// manually save the stencil state
_currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST);
glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)&_currentStencilWriteMask);
glGetIntegerv(GL_STENCIL_FUNC, (GLint *)&_currentStencilFunc);
glGetIntegerv(GL_STENCIL_REF, &_currentStencilRef);
glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&_currentStencilValueMask);
glGetIntegerv(GL_STENCIL_FAIL, (GLint *)&_currentStencilFail);
glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)&_currentStencilPassDepthFail);
glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)&_currentStencilPassDepthPass);
// enable stencil use
glEnable(GL_STENCIL_TEST);
// RenderState::StateBlock::_defaultState->setStencilTest(true);
// check for OpenGL error while enabling stencil test
CHECK_GL_ERROR_DEBUG();
// all bits on the stencil buffer are readonly, except the current layer bit,
// this means that operation like glClear or glStencilOp will be masked with this value
glStencilMask(mask_layer);
// RenderState::StateBlock::_defaultState->setStencilWrite(mask_layer);
// manually save the depth test state
glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask);
// disable depth test while drawing the stencil
//glDisable(GL_DEPTH_TEST);
// disable update to the depth buffer while drawing the stencil,
// as the stencil is not meant to be rendered in the real scene,
// it should never prevent something else to be drawn,
// only disabling depth buffer update should do
glDepthMask(GL_FALSE);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
///////////////////////////////////
// CLEAR STENCIL BUFFER
// manually clear the stencil buffer by drawing a fullscreen rectangle on it
// setup the stencil test func like this:
// for each pixel in the fullscreen rectangle
// never draw it into the frame buffer
// if not in inverted mode: set the current layer value to 0 in the stencil buffer
// if in inverted mode: set the current layer value to 1 in the stencil buffer
glStencilFunc(GL_NEVER, mask_layer, mask_layer);
glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP);
// draw a fullscreen solid rectangle to clear the stencil buffer
//ccDrawSolidRect(Vec2::ZERO, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1));
drawFullScreenQuadClearStencil();
///////////////////////////////////
// DRAW CLIPPING STENCIL
// setup the stencil test func like this:
// for each pixel in the stencil node
// never draw it into the frame buffer
// if not in inverted mode: set the current layer value to 1 in the stencil buffer
// if in inverted mode: set the current layer value to 0 in the stencil buffer
glStencilFunc(GL_NEVER, mask_layer, mask_layer);
// RenderState::StateBlock::_defaultState->setStencilFunction(RenderState::STENCIL_NEVER, mask_layer, mask_layer);
glStencilOp(!_inverted ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP);
// RenderState::StateBlock::_defaultState->setStencilOperation(
// !_inverted ? RenderState::STENCIL_OP_REPLACE : RenderState::STENCIL_OP_ZERO,
// RenderState::STENCIL_OP_KEEP,
// RenderState::STENCIL_OP_KEEP);
// enable alpha test only if the alpha threshold < 1,
// indeed if alpha threshold == 1, every pixel will be drawn anyways
if (_alphaThreshold < 1) {
#if !CC_CLIPPING_NODE_OPENGLES
// manually save the alpha test state
_currentAlphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
glGetIntegerv(GL_ALPHA_TEST_FUNC, (GLint *)&_currentAlphaTestFunc);
glGetFloatv(GL_ALPHA_TEST_REF, &_currentAlphaTestRef);
// enable alpha testing
glEnable(GL_ALPHA_TEST);
// check for OpenGL error while enabling alpha test
CHECK_GL_ERROR_DEBUG();
// pixel will be drawn only if greater than an alpha threshold
glAlphaFunc(GL_GREATER, _alphaThreshold);
#endif
}
//Draw _stencil
}
void ClippingNode::onAfterDrawStencil()
{
// restore alpha test state
if (_alphaThreshold < 1)
{
#if CC_CLIPPING_NODE_OPENGLES
// FIXME: we need to find a way to restore the shaders of the stencil node and its children
#else
// manually restore the alpha test state
glAlphaFunc(_currentAlphaTestFunc, _currentAlphaTestRef);
if (!_currentAlphaTestEnabled)
{
glDisable(GL_ALPHA_TEST);
}
#endif
}
// restore the depth test state
glDepthMask(_currentDepthWriteMask);
RenderState::StateBlock::_defaultState->setDepthWrite(_currentDepthWriteMask != 0);
//if (currentDepthTestEnabled) {
// glEnable(GL_DEPTH_TEST);
//}
///////////////////////////////////
// DRAW CONTENT
// setup the stencil test function like this:
// for each pixel of this node and its children
// if all layers less than or equals to the current are set to 1 in the stencil buffer
// draw the pixel and keep the current layer in the stencil buffer
// else
// do not draw the pixel but keep the current layer in the stencil buffer
glStencilFunc(GL_EQUAL, _mask_layer_le, _mask_layer_le);
// RenderState::StateBlock::_defaultState->setStencilFunction(RenderState::STENCIL_EQUAL, _mask_layer_le, _mask_layer_le);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
// RenderState::StateBlock::_defaultState->setStencilOperation(RenderState::STENCIL_OP_KEEP, RenderState::STENCIL_OP_KEEP, RenderState::STENCIL_OP_KEEP);
// draw (according to the stencil test function) this node and its children
}
void ClippingNode::onAfterVisit()
{
///////////////////////////////////
// CLEANUP
// manually restore the stencil state
glStencilFunc(_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);
// RenderState::StateBlock::_defaultState->setStencilFunction((RenderState::StencilFunction)_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);
glStencilOp(_currentStencilFail, _currentStencilPassDepthFail, _currentStencilPassDepthPass);
// RenderState::StateBlock::_defaultState->setStencilOperation((RenderState::StencilOperation)_currentStencilFail,
// (RenderState::StencilOperation)_currentStencilPassDepthFail,
// (RenderState::StencilOperation)_currentStencilPassDepthPass);
glStencilMask(_currentStencilWriteMask);
if (!_currentStencilEnabled)
{
glDisable(GL_STENCIL_TEST);
// RenderState::StateBlock::_defaultState->setStencilTest(false);
}
// we are done using this layer, decrement
s_layer--;
}
NS_CC_END

View File

@ -34,6 +34,8 @@
#include "renderer/CCCustomCommand.h"
NS_CC_BEGIN
class StencilStateManager;
/**
* @addtogroup _2d
* @{
@ -153,34 +155,9 @@ CC_CONSTRUCTOR_ACCESS:
virtual bool init(Node *stencil);
protected:
/**draw fullscreen quad to clear stencil bits
*/
void drawFullScreenQuadClearStencil();
Node* _stencil;
GLfloat _alphaThreshold;
bool _inverted;
//renderData and callback
void onBeforeVisit();
void onAfterDrawStencil();
void onAfterVisit();
GLboolean _currentStencilEnabled;
GLuint _currentStencilWriteMask;
GLenum _currentStencilFunc;
GLint _currentStencilRef;
GLuint _currentStencilValueMask;
GLenum _currentStencilFail;
GLenum _currentStencilPassDepthFail;
GLenum _currentStencilPassDepthPass;
GLboolean _currentDepthWriteMask;
GLboolean _currentAlphaTestEnabled;
GLenum _currentAlphaTestFunc;
GLclampf _currentAlphaTestRef;
GLint _mask_layer_le;
StencilStateManager* _stencilStateManager;
GroupCommand _groupCommand;
CustomCommand _beforeVisitCmd;

View File

@ -1135,7 +1135,7 @@ std::string Sprite::getDescription() const
return StringUtils::format("<Sprite | Tag = %d, TextureID = %d>", _tag, texture_id );
}
PolygonInfo Sprite::getPolygonInfo() const
PolygonInfo& Sprite::getPolygonInfo()
{
return _polyInfo;
}

View File

@ -403,6 +403,19 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE void setFlipY(bool flippedY) { setFlippedY(flippedY); };
/**
* returns a reference of the polygon information associated with this sprite
*
* @return a copy of PolygonInfo
*/
PolygonInfo& getPolygonInfo();
/**
* set the sprite to use this new PolygonInfo
*
* @param PolygonInfo the polygon information object
*/
void setPolygonInfo(const PolygonInfo& info);
//
// Overrides
//
@ -564,20 +577,6 @@ CC_CONSTRUCTOR_ACCESS:
*/
virtual bool initWithFile(const std::string& filename, const Rect& rect);
/**
* returns a copy of the polygon information associated with this sprite
* because this is a copy process it is slower than getting the reference, so use wisely
*
* @return a copy of PolygonInfo
*/
PolygonInfo getPolygonInfo() const;
/**
* set the sprite to use this new PolygonInfo
*
* @param PolygonInfo the polygon information object
*/
void setPolygonInfo(const PolygonInfo& info);
protected:
void updateColor() override;

View File

@ -0,0 +1,44 @@
#ifndef __COCOSSTUDIOEXTENSION_H__
#define __COCOSSTUDIOEXTENSION_H__
#include "math/CCAffineTransform.h"
NS_CC_BEGIN
struct CC_DLL ResouceData
{
int type;
std::string file;
std::string plist;
ResouceData()
{
type = 0;
file = "";
plist = "";
}
ResouceData(int iType, std::string sFile, std::string sPlist)
{
type = iType;
file = sFile;
plist = sPlist;
}
};
class CC_DLL NodeExtension
{
public:
NodeExtension();
~NodeExtension();
private:
};
NS_CC_END
#endif

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@ -433,6 +433,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\base\ccFPSImages.c" />
<ClCompile Include="..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\base\CCNinePatchImageParser.cpp" />
<ClCompile Include="..\base\CCStencilStateManager.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCProfiling.cpp" />
<ClCompile Include="..\base\CCProperties.cpp" />
@ -652,6 +653,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\ui\UIListView.cpp" />
<ClCompile Include="..\ui\UILoadingBar.cpp" />
<ClCompile Include="..\ui\UIPageView.cpp" />
<ClCompile Include="..\ui\UIPageViewIndicator.cpp" />
<ClCompile Include="..\ui\UIRelativeBox.cpp" />
<ClCompile Include="..\ui\UIRichText.cpp" />
<ClCompile Include="..\ui\UIScale9Sprite.cpp" />
@ -1014,6 +1016,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\base\ccMacros.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNinePatchImageParser.h" />
<ClInclude Include="..\base\CCStencilStateManager.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCProfiling.h" />
<ClInclude Include="..\base\CCProperties.h" />
@ -1254,6 +1257,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\storage\local-storage\LocalStorage.h" />
<ClInclude Include="..\ui\CocosGUI.h" />
<ClInclude Include="..\ui\GUIExport.h" />
<ClInclude Include="..\ui\UIAbstractCheckButton.h" />
<ClInclude Include="..\ui\UIButton.h" />
<ClInclude Include="..\ui\UICheckBox.h" />
<ClInclude Include="..\ui\UIDeprecated.h" />
@ -1382,4 +1386,4 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="physics">
@ -934,6 +934,9 @@
<ClCompile Include="..\ui\UIPageView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIPageViewIndicator.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIScrollView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
@ -1893,6 +1896,9 @@
<ClCompile Include="..\base\CCNinePatchImageParser.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCStencilStateManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCNinePatchImageParser.cpp" />
<ClCompile Include="..\renderer\CCFrameBuffer.cpp">
<Filter>renderer</Filter>
@ -3725,6 +3731,9 @@
<ClInclude Include="..\base\CCNinePatchImageParser.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCStencilStateManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCNinePatchImageParser.h" />
<ClInclude Include="..\renderer\CCFrameBuffer.h">
<Filter>renderer</Filter>
@ -3776,6 +3785,9 @@
<Filter>network\Header Files</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\WidgetReader\Light3DReader\Light3DReader.h" />
<ClInclude Include="..\ui\UIAbstractCheckButton.h">
<Filter>ui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">
@ -3804,4 +3816,4 @@
<Filter>3d</Filter>
</None>
</ItemGroup>
</Project>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
@ -286,6 +286,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\ccMacros.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCMap.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNinePatchImageParser.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCStencilStateManager.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNS.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCProfiling.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCProperties.h" />
@ -917,6 +918,7 @@
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNinePatchImageParser.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCStencilStateManager.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNS.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCProfiling.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCProperties.cpp" />
@ -1153,6 +1155,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIListView.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UILoadingBar.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIPageView.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIPageViewIndicator.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIRelativeBox.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIRichText.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIScale9Sprite.cpp" />
@ -1285,4 +1288,4 @@
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)..\..\..\..\physics3d\CMakeLists.txt" />
</ItemGroup>
</Project>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)targetver.h" />
@ -1812,6 +1812,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNinePatchImageParser.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCStencilStateManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\physics3d\CCPhysics3DConstraint.h">
<Filter>physics3d</Filter>
</ClInclude>
@ -2325,6 +2328,9 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIPageView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIPageViewIndicator.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\ui\UIScrollView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
@ -3522,6 +3528,9 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCNinePatchImageParser.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\base\CCStencilStateManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\physics3d\CCPhysics3DDebugDrawer.cpp">
<Filter>physics3d</Filter>
</ClCompile>
@ -3976,4 +3985,4 @@
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)..\..\..\..\physics3d\CMakeLists.txt" />
</ItemGroup>
</Project>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
@ -415,6 +415,7 @@
</ClCompile>
<ClCompile Include="..\..\base\CCIMEDispatcher.cpp" />
<ClCompile Include="..\..\base\CCNinePatchImageParser.cpp" />
<ClCompile Include="..\..\base\CCStencilStateManager.cpp" />
<ClCompile Include="..\..\base\CCNS.cpp" />
<ClCompile Include="..\..\base\CCProfiling.cpp" />
<ClCompile Include="..\..\base\CCProperties.cpp" />
@ -653,6 +654,7 @@
<ClCompile Include="..\..\ui\UIListView.cpp" />
<ClCompile Include="..\..\ui\UILoadingBar.cpp" />
<ClCompile Include="..\..\ui\UIPageView.cpp" />
<ClCompile Include="..\..\ui\UIPageViewIndicator.cpp" />
<ClCompile Include="..\..\ui\UIRelativeBox.cpp" />
<ClCompile Include="..\..\ui\UIRichText.cpp" />
<ClCompile Include="..\..\ui\UIScale9Sprite.cpp" />
@ -1012,6 +1014,7 @@
<ClInclude Include="..\..\base\ccMacros.h" />
<ClInclude Include="..\..\base\CCMap.h" />
<ClInclude Include="..\..\base\CCNinePatchImageParser.h" />
<ClInclude Include="..\..\base\CCStencilStateManager.h" />
<ClInclude Include="..\..\base\CCNS.h" />
<ClInclude Include="..\..\base\CCProfiling.h" />
<ClInclude Include="..\..\base\CCProperties.h" />
@ -1672,4 +1675,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
@ -1689,6 +1689,9 @@
<ClCompile Include="..\..\ui\UIPageView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\ui\UIPageViewIndicator.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\ui\UIScrollView.cpp">
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
@ -1764,6 +1767,9 @@
<ClCompile Include="..\..\base\CCNinePatchImageParser.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\..\base\CCStencilStateManager.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\..\renderer\CCMaterial.cpp">
<Filter>renderer</Filter>
</ClCompile>
@ -3632,6 +3638,9 @@
<ClInclude Include="..\..\base\CCNinePatchImageParser.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\..\base\CCStencilStateManager.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\..\renderer\CCMaterial.h">
<Filter>renderer</Filter>
</ClInclude>
@ -4014,4 +4023,4 @@
<Filter>3d</Filter>
</None>
</ItemGroup>
</Project>
</Project>

View File

@ -223,7 +223,7 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t flags)
#endif
}
bool Terrain::initHeightMap(const char * heightMap)
bool Terrain::initHeightMap(const std::string& heightMap)
{
_heightMapImage = new Image();
_heightMapImage->initWithImageFile(heightMap);
@ -548,7 +548,7 @@ bool Terrain::getIntersectionPoint(const Ray & ray_, Vec3 & intersectionPoint) c
getWorldToNodeTransform().transformPoint(&(ray._origin));
std::set<Chunk *> closeList;
Vec2 start = Vec2(ray._origin.x,ray._origin.z);
Vec2 start = Vec2(ray_._origin.x,ray_._origin.z);
Vec2 dir = Vec2(ray._direction.x,ray._direction.z);
start = convertToTerrainSpace(start);
start.x /=(_terrainData._chunkSize.width+1);
@ -630,7 +630,7 @@ cocos2d::Vec2 Terrain::convertToTerrainSpace(Vec2 worldSpaceXZ) const
return Vec2(image_x,image_y);
}
void Terrain::resetHeightMap(const char * heightMap)
void Terrain::resetHeightMap(const std::string& heightMap)
{
_heightMapImage->release();
_vertices.clear();
@ -857,7 +857,7 @@ bool Terrain::initTextures()
Texture2D::TexParams texParam;
texParam.wrapS = GL_REPEAT;
texParam.wrapT = GL_REPEAT;
if(!_terrainData._alphaMapSrc)
if(_terrainData._alphaMapSrc.empty())
{
auto textImage = new (std::nothrow)Image();
textImage->initWithImageFile(_terrainData._detailMaps[0]._detailMapSrc);
@ -1581,21 +1581,21 @@ Terrain::QuadTree::~QuadTree()
if(_br) delete _br;
}
Terrain::TerrainData::TerrainData(const char * heightMapsrc , const char * textureSrc, const Size & chunksize, float height, float scale)
Terrain::TerrainData::TerrainData(const std::string& heightMapsrc , const std::string& textureSrc, const Size & chunksize, float height, float scale)
{
this->_heightMapSrc = heightMapsrc;
this->_detailMaps[0]._detailMapSrc = textureSrc;
this->_alphaMapSrc = nullptr;
this->_alphaMapSrc = "";
this->_chunkSize = chunksize;
this->_mapHeight = height;
this->_mapScale = scale;
_skirtHeightRatio = 1;
}
Terrain::TerrainData::TerrainData(const char * heightMapsrc, const char * alphamap, const DetailMap& detail1, const DetailMap& detail2, const DetailMap& detail3, const DetailMap& detail4, const Size & chunksize, float height, float scale)
Terrain::TerrainData::TerrainData(const std::string& heightMapsrc, const std::string& alphamap, const DetailMap& detail1, const DetailMap& detail2, const DetailMap& detail3, const DetailMap& detail4, const Size & chunksize, float height, float scale)
{
this->_heightMapSrc = heightMapsrc;
this->_alphaMapSrc = const_cast<char *>(alphamap);
this->_alphaMapSrc = alphamap;
this->_detailMaps[0] = detail1;
this->_detailMaps[1] = detail2;
this->_detailMaps[2] = detail3;
@ -1607,14 +1607,13 @@ Terrain::TerrainData::TerrainData(const char * heightMapsrc, const char * alpham
_skirtHeightRatio = 1;
}
Terrain::TerrainData::TerrainData(const char* heightMapsrc, const char * alphamap, const DetailMap& detail1, const DetailMap& detail2, const DetailMap& detail3, const Size & chunksize /*= Size(32,32)*/, float height /*= 2*/, float scale /*= 0.1*/)
Terrain::TerrainData::TerrainData(const std::string& heightMapsrc, const std::string& alphamap, const DetailMap& detail1, const DetailMap& detail2, const DetailMap& detail3, const Size & chunksize /*= Size(32,32)*/, float height /*= 2*/, float scale /*= 0.1*/)
{
this->_heightMapSrc = heightMapsrc;
this->_alphaMapSrc = const_cast<char *>(alphamap);
this->_alphaMapSrc = alphamap;
this->_detailMaps[0] = detail1;
this->_detailMaps[1] = detail2;
this->_detailMaps[2] = detail3;
this->_detailMaps[3] = nullptr;
this->_chunkSize = chunksize;
this->_mapHeight = height;
this->_mapScale = scale;
@ -1627,7 +1626,7 @@ Terrain::TerrainData::TerrainData()
}
Terrain::DetailMap::DetailMap(const char * detailMapPath, float size /*= 35*/)
Terrain::DetailMap::DetailMap(const std::string& detailMapPath, float size /*= 35*/)
{
this->_detailMapSrc = detailMapPath;
this->_detailMapSize = size;

View File

@ -102,7 +102,7 @@ public:
struct CC_DLL DetailMap{
/*Constructors*/
DetailMap();
DetailMap(const char * detailMapSrc, float size = 35);
DetailMap(const std::string& detailMapSrc, float size = 35);
/*detail Image source file path*/
std::string _detailMapSrc;
/*detailMapSize determine how many tiles that Terrain represent*/
@ -130,11 +130,11 @@ public:
/**empty constructor*/
TerrainData();
/**constructor, this constructor construct a simple terrain which only have 1 detailmap*/
TerrainData(const char* heightMapsrc, const char * textureSrc, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
TerrainData(const std::string& heightMapsrc, const std::string& textureSrc, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
/**constructor, this constructor construct a terrain which have 4 detailmaps, 1 alpha map*/
TerrainData(const char* heightMapsrc, const char * alphamap, const DetailMap& detail1,const DetailMap& detail2, const DetailMap& detail3, const DetailMap& detail4, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
TerrainData(const std::string& heightMapsrc, const std::string& alphamap, const DetailMap& detail1,const DetailMap& detail2, const DetailMap& detail3, const DetailMap& detail4, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
/**constructor, this constructor construct a terrain which have 3 detailmaps, 1 alpha map*/
TerrainData(const char* heightMapsrc, const char * alphamap, const DetailMap& detail1,const DetailMap& detail2, const DetailMap& detail3, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
TerrainData(const std::string& heightMapsrc, const std::string& alphamap, const DetailMap& detail1,const DetailMap& detail2, const DetailMap& detail3, const Size & chunksize = Size(32,32), float mapHeight = 2, float mapScale = 0.1);
/**
*determine the chunk size,chunk is the minimal subdivision of the Terrain
*/
@ -142,7 +142,7 @@ public:
/**height Map source path*/
std::string _heightMapSrc;
/**the source path of the alpha map*/
char* _alphaMapSrc;
std::string _alphaMapSrc;
/**detail maps*/
DetailMap _detailMaps[4];
/**terrain Maximum height*/
@ -316,7 +316,7 @@ public:
/**initialize all Properties which terrain need */
bool initProperties();
/**initialize heightMap data */
bool initHeightMap(const char* heightMap);
bool initHeightMap(const std::string& heightMap);
/**initialize alphaMap ,detailMaps textures*/
bool initTextures();
/**create entry*/
@ -392,7 +392,7 @@ public:
/**
* reset the heightmap data.
*/
void resetHeightMap(const char * heightMap);
void resetHeightMap(const std::string& heightMap);
/**
* get the terrain's minimal height.

View File

@ -107,6 +107,7 @@ math/Vec2.cpp \
math/Vec3.cpp \
math/Vec4.cpp \
base/CCNinePatchImageParser.cpp \
base/CCStencilStateManager.cpp \
base/CCAsyncTaskPool.cpp \
base/CCAutoreleasePool.cpp \
base/CCConfiguration.cpp \

View File

@ -322,6 +322,7 @@ bool AudioEngineImpl::stop(int audioID)
_alSourceUsed[player._alSource] = false;
if (player._streamingSource)
{
player._ready = false;
player.notifyExitThread();
}
else
@ -346,6 +347,7 @@ void AudioEngineImpl::stopAll()
auto& player = it->second;
if (player._streamingSource)
{
player._ready = false;
player.notifyExitThread();
++it;
}
@ -457,7 +459,7 @@ void AudioEngineImpl::update(float dt)
auto& player = it->second;
alGetSourcei(player._alSource, AL_SOURCE_STATE, &sourceState);
if (player._readForRemove)
if (player._readForRemove && !player._ready)
{
it = _audioPlayers.erase(it);
}
@ -472,6 +474,7 @@ void AudioEngineImpl::update(float dt)
if (player._streamingSource)
{
player._ready = false;
player.notifyExitThread();
++it;
}

View File

@ -0,0 +1,309 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCStencilStateManager.hpp"
#include "base/CCDirector.h"
#include "renderer/CCGLProgramCache.h"
#include "renderer/ccGLStateCache.h"
#include "renderer/CCRenderer.h"
#include "renderer/CCRenderState.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#define CC_CLIPPING_NODE_OPENGLES 0
#else
#define CC_CLIPPING_NODE_OPENGLES 1
#endif
NS_CC_BEGIN
GLint StencilStateManager::s_layer = -1;
static GLint g_sStencilBits = -1;
StencilStateManager::StencilStateManager()
: _alphaThreshold(1.0f)
, _inverted(false)
, _currentStencilEnabled(GL_FALSE)
, _currentStencilWriteMask(~0)
, _currentStencilFunc(GL_ALWAYS)
, _currentStencilRef(0)
, _currentStencilValueMask(~0)
, _currentStencilFail(GL_KEEP)
, _currentStencilPassDepthFail(GL_KEEP)
, _currentStencilPassDepthPass(GL_KEEP)
, _currentDepthWriteMask(GL_TRUE)
, _currentAlphaTestEnabled(GL_FALSE)
, _currentAlphaTestFunc(GL_ALWAYS)
, _currentAlphaTestRef(1)
{
// get (only once) the number of bits of the stencil buffer
static bool once = true;
if (once)
{
glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits);
if (g_sStencilBits <= 0)
{
CCLOG("Stencil buffer is not enabled.");
}
once = false;
}
}
void StencilStateManager::drawFullScreenQuadClearStencil()
{
Director* director = Director::getInstance();
CCASSERT(nullptr != director, "Director is null when setting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
Vec2 vertices[] = {
Vec2(-1.0f, -1.0f),
Vec2(1.0f, -1.0f),
Vec2(1.0f, 1.0f),
Vec2(-1.0f, 1.0f)
};
auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);
int colorLocation = glProgram->getUniformLocation("u_color");
CHECK_GL_ERROR_DEBUG();
Color4F color(1, 1, 1, 1);
glProgram->use();
glProgram->setUniformsForBuiltins();
glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 4);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
void StencilStateManager::setAlphaThreshold(GLfloat alphaThreshold)
{
_alphaThreshold = alphaThreshold;
}
GLfloat StencilStateManager::getAlphaThreshold()const
{
return _alphaThreshold;
}
void StencilStateManager::setInverted(bool inverted)
{
_inverted = inverted;
}
bool StencilStateManager::isInverted()const
{
return _inverted;
}
void StencilStateManager::onBeforeVisit()
{
///////////////////////////////////
// INIT
// increment the current layer
s_layer++;
// mask of the current layer (ie: for layer 3: 00000100)
GLint mask_layer = 0x1 << s_layer;
// mask of all layers less than the current (ie: for layer 3: 00000011)
GLint mask_layer_l = mask_layer - 1;
// mask of all layers less than or equal to the current (ie: for layer 3: 00000111)
_mask_layer_le = mask_layer | mask_layer_l;
// manually save the stencil state
_currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST);
glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)&_currentStencilWriteMask);
glGetIntegerv(GL_STENCIL_FUNC, (GLint *)&_currentStencilFunc);
glGetIntegerv(GL_STENCIL_REF, &_currentStencilRef);
glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&_currentStencilValueMask);
glGetIntegerv(GL_STENCIL_FAIL, (GLint *)&_currentStencilFail);
glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)&_currentStencilPassDepthFail);
glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)&_currentStencilPassDepthPass);
// enable stencil use
glEnable(GL_STENCIL_TEST);
// RenderState::StateBlock::_defaultState->setStencilTest(true);
// check for OpenGL error while enabling stencil test
CHECK_GL_ERROR_DEBUG();
// all bits on the stencil buffer are readonly, except the current layer bit,
// this means that operation like glClear or glStencilOp will be masked with this value
glStencilMask(mask_layer);
// RenderState::StateBlock::_defaultState->setStencilWrite(mask_layer);
// manually save the depth test state
glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask);
// disable depth test while drawing the stencil
//glDisable(GL_DEPTH_TEST);
// disable update to the depth buffer while drawing the stencil,
// as the stencil is not meant to be rendered in the real scene,
// it should never prevent something else to be drawn,
// only disabling depth buffer update should do
glDepthMask(GL_FALSE);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
///////////////////////////////////
// CLEAR STENCIL BUFFER
// manually clear the stencil buffer by drawing a fullscreen rectangle on it
// setup the stencil test func like this:
// for each pixel in the fullscreen rectangle
// never draw it into the frame buffer
// if not in inverted mode: set the current layer value to 0 in the stencil buffer
// if in inverted mode: set the current layer value to 1 in the stencil buffer
glStencilFunc(GL_NEVER, mask_layer, mask_layer);
glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP);
// draw a fullscreen solid rectangle to clear the stencil buffer
//ccDrawSolidRect(Vec2::ZERO, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1));
drawFullScreenQuadClearStencil();
///////////////////////////////////
// DRAW CLIPPING STENCIL
// setup the stencil test func like this:
// for each pixel in the stencil node
// never draw it into the frame buffer
// if not in inverted mode: set the current layer value to 1 in the stencil buffer
// if in inverted mode: set the current layer value to 0 in the stencil buffer
glStencilFunc(GL_NEVER, mask_layer, mask_layer);
// RenderState::StateBlock::_defaultState->setStencilFunction(RenderState::STENCIL_NEVER, mask_layer, mask_layer);
glStencilOp(!_inverted ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP);
// RenderState::StateBlock::_defaultState->setStencilOperation(
// !_inverted ? RenderState::STENCIL_OP_REPLACE : RenderState::STENCIL_OP_ZERO,
// RenderState::STENCIL_OP_KEEP,
// RenderState::STENCIL_OP_KEEP);
// enable alpha test only if the alpha threshold < 1,
// indeed if alpha threshold == 1, every pixel will be drawn anyways
if (_alphaThreshold < 1) {
#if !CC_CLIPPING_NODE_OPENGLES
// manually save the alpha test state
_currentAlphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
glGetIntegerv(GL_ALPHA_TEST_FUNC, (GLint *)&_currentAlphaTestFunc);
glGetFloatv(GL_ALPHA_TEST_REF, &_currentAlphaTestRef);
// enable alpha testing
glEnable(GL_ALPHA_TEST);
// check for OpenGL error while enabling alpha test
CHECK_GL_ERROR_DEBUG();
// pixel will be drawn only if greater than an alpha threshold
glAlphaFunc(GL_GREATER, _alphaThreshold);
#endif
}
//Draw _stencil
}
void StencilStateManager::onAfterDrawStencil()
{
// restore alpha test state
if (_alphaThreshold < 1)
{
#if CC_CLIPPING_NODE_OPENGLES
// FIXME: we need to find a way to restore the shaders of the stencil node and its children
#else
// manually restore the alpha test state
glAlphaFunc(_currentAlphaTestFunc, _currentAlphaTestRef);
if (!_currentAlphaTestEnabled)
{
glDisable(GL_ALPHA_TEST);
}
#endif
}
// restore the depth test state
glDepthMask(_currentDepthWriteMask);
RenderState::StateBlock::_defaultState->setDepthWrite(_currentDepthWriteMask != 0);
//if (currentDepthTestEnabled) {
// glEnable(GL_DEPTH_TEST);
//}
///////////////////////////////////
// DRAW CONTENT
// setup the stencil test function like this:
// for each pixel of this node and its children
// if all layers less than or equals to the current are set to 1 in the stencil buffer
// draw the pixel and keep the current layer in the stencil buffer
// else
// do not draw the pixel but keep the current layer in the stencil buffer
glStencilFunc(GL_EQUAL, _mask_layer_le, _mask_layer_le);
// RenderState::StateBlock::_defaultState->setStencilFunction(RenderState::STENCIL_EQUAL, _mask_layer_le, _mask_layer_le);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
// RenderState::StateBlock::_defaultState->setStencilOperation(RenderState::STENCIL_OP_KEEP, RenderState::STENCIL_OP_KEEP, RenderState::STENCIL_OP_KEEP);
// draw (according to the stencil test function) this node and its children
}
void StencilStateManager::onAfterVisit()
{
///////////////////////////////////
// CLEANUP
// manually restore the stencil state
glStencilFunc(_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);
// RenderState::StateBlock::_defaultState->setStencilFunction((RenderState::StencilFunction)_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);
glStencilOp(_currentStencilFail, _currentStencilPassDepthFail, _currentStencilPassDepthPass);
// RenderState::StateBlock::_defaultState->setStencilOperation((RenderState::StencilOperation)_currentStencilFail,
// (RenderState::StencilOperation)_currentStencilPassDepthFail,
// (RenderState::StencilOperation)_currentStencilPassDepthPass);
glStencilMask(_currentStencilWriteMask);
if (!_currentStencilEnabled)
{
glDisable(GL_STENCIL_TEST);
// RenderState::StateBlock::_defaultState->setStencilTest(false);
}
// we are done using this layer, decrement
s_layer--;
}
NS_CC_END

View File

@ -0,0 +1,79 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef StencilStateManager_hpp
#define StencilStateManager_hpp
#include "base/ccConfig.h"
#include "platform/CCPlatformMacros.h"
#include "platform/CCGL.h"
/**
* @addtogroup base
* @{
*/
NS_CC_BEGIN
class CC_DLL StencilStateManager
{
public:
StencilStateManager();
void onBeforeVisit();
void onAfterDrawStencil();
void onAfterVisit();
void setAlphaThreshold(GLfloat alphaThreshold);
void setInverted(bool inverted);
bool isInverted()const;
GLfloat getAlphaThreshold()const;
private:
CC_DISALLOW_COPY_AND_ASSIGN(StencilStateManager);
static GLint s_layer;
/**draw fullscreen quad to clear stencil bits
*/
void drawFullScreenQuadClearStencil();
GLfloat _alphaThreshold;
bool _inverted;
GLboolean _currentStencilEnabled;
GLuint _currentStencilWriteMask;
GLenum _currentStencilFunc;
GLint _currentStencilRef;
GLuint _currentStencilValueMask;
GLenum _currentStencilFail;
GLenum _currentStencilPassDepthFail;
GLenum _currentStencilPassDepthPass;
GLboolean _currentDepthWriteMask;
GLboolean _currentAlphaTestEnabled;
GLenum _currentAlphaTestFunc;
GLclampf _currentAlphaTestRef;
GLint _mask_layer_le;
};
NS_CC_END
// end of base group
/** @} */
#endif /* StencilStateManager_hpp */

View File

@ -45,6 +45,7 @@ set(COCOS_BASE_SRC
base/CCUserDefault.cpp
base/CCValue.cpp
base/ObjectFactory.cpp
base/CCStencilStateManager.cpp
base/TGAlib.cpp
base/ZipUtils.cpp
base/allocator/CCAllocatorDiagnostics.cpp

View File

@ -30,10 +30,12 @@ THE SOFTWARE.
#include "base/CCDirector.h"
#include "base/CCAsyncTaskPool.h"
#include "base/CCEventDispatcher.h"
#include "base/base64.h"
#include "renderer/CCCustomCommand.h"
#include "renderer/CCRenderer.h"
#include "platform/CCImage.h"
#include "platform/CCFileUtils.h"
#include "2d/CCSprite.h"
NS_CC_BEGIN
@ -263,7 +265,28 @@ Rect getCascadeBoundingBox(Node *node)
return cbb;
}
Sprite* createSpriteFromBase64(const char* base64String)
{
unsigned char* decoded;
int length = base64Decode((const unsigned char*) base64String, (unsigned int) strlen(base64String), &decoded);
Image *image = new Image();
bool imageResult = image->initWithImageData(decoded, length);
CCASSERT(imageResult, "Failed to create image from base64!");
free(decoded);
Texture2D *texture = new Texture2D();
texture->initWithImage(image);
texture->setAliasTexParameters();
image->release();
Sprite* sprite = Sprite::createWithTexture(texture);
texture->release();
return sprite;
}
}
NS_CC_END

View File

@ -52,6 +52,8 @@ Examples:
int ccNextPOT(int value);
class Sprite;
namespace utils
{
/** Capture the entire screen.
@ -100,6 +102,14 @@ namespace utils
* @return Returns unionof bounding box of a node and its children.
*/
Rect CC_DLL getCascadeBoundingBox(Node *node);
/**
* Create a sprite instance from base64 encoded image.
* @return Returns an instance of sprite
*/
Sprite* createSpriteFromBase64(const char* base64String);
}
NS_CC_END

View File

@ -30,7 +30,7 @@ THE SOFTWARE.
// 0x00 HI ME LO
// 00 03 08 00
#define COCOS2D_VERSION 0x00030800
#define COCOS2D_VERSION 0x00030900
//
// all cocos2d include files

View File

@ -618,20 +618,44 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void InnerActionFrame::setStartFrameIndex(int frameIndex)
{
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (_enterWithName)
{
CCLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!");
throw std::exception();
}
#else
CCASSERT(!_enterWithName, " cannot setStartFrameIndex when enterWithName is set");
#endif
_startFrameIndex = frameIndex;
}
void InnerActionFrame::setEndFrameIndex(int frameIndex)
{
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (_enterWithName)
{
CCLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!");
throw std::exception();
}
#else
CCASSERT(!_enterWithName, " cannot setEndFrameIndex when enterWithName is set");
#endif
_endFrameIndex = frameIndex;
}
void InnerActionFrame::setAnimationName(const std::string& animationName)
{
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (!_enterWithName)
{
CCLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
throw std::exception();
}
#else
CCASSERT(_enterWithName, " cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
#endif
_animationName = animationName;
}

View File

@ -26,6 +26,7 @@ THE SOFTWARE.
#include "cocostudio/CCActionFrameEasing.h"
#include "ui/UIWidget.h"
#include "ui/UIHelper.h"
#include "ui/UILayout.h"
#include "cocostudio/CocoLoader.h"
#include "base/ccUtils.h"
@ -73,7 +74,14 @@ ActionNode::~ActionNode()
void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root)
{
Widget * rw = dynamic_cast<Widget *>(root);
if (nullptr == rw)
return;
setActionTag(DICTOOL->getIntValue_json(dic, "ActionTag"));
Widget* node = Helper::seekActionWidgetByActionTag(rw, getActionTag());
bool positionOffset = node && (nullptr == (dynamic_cast<Layout *>(node)));
int actionFrameCount = DICTOOL->getArrayCount_json(dic, "actionframelist");
for (int i=0; i<actionFrameCount; i++)
{
@ -97,6 +105,12 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root)
{
float positionX = DICTOOL->getFloatValue_json(actionFrameDic, "positionx");
float positionY = DICTOOL->getFloatValue_json(actionFrameDic, "positiony");
if (positionOffset && (nullptr != node->getParent()))
{
Vec2 AnchorPointIn = node->getParent()->getAnchorPointInPoints();
positionX += AnchorPointIn.x;
positionY += AnchorPointIn.y;
}
ActionMoveFrame* actionFrame = new (std::nothrow) ActionMoveFrame();
actionFrame->setFrameIndex(frameInex);
actionFrame->setEasingType(frameTweenType);

View File

@ -250,7 +250,7 @@ const cocos2d::Map<std::string, TextureData*>& ArmatureDataManager::getTextureDa
return _textureDatas;
}
void CCArmatureDataManager::addRelativeData(const std::string& configFilePath)
void ArmatureDataManager::addRelativeData(const std::string& configFilePath)
{
if (_relativeDatas.find(configFilePath) == _relativeDatas.end())
{
@ -258,7 +258,7 @@ void CCArmatureDataManager::addRelativeData(const std::string& configFilePath)
}
}
RelativeData *CCArmatureDataManager::getRelativeData(const std::string& configFilePath)
RelativeData *ArmatureDataManager::getRelativeData(const std::string& configFilePath)
{
return &_relativeDatas[configFilePath];
}

View File

@ -165,7 +165,7 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node,
cocos2d::Node* ArmatureNodeReader::createNodeWithFlatBuffers(const flatbuffers::Table *nodeOptions)
{
auto node = CCArmature::create();
auto node = Armature::create();
// self
auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions;

View File

@ -34,6 +34,18 @@
/// @cond
@interface HttpAsynConnection : NSObject <NSURLConnectionDelegate, NSURLConnectionDataDelegate>
{
NSString *srcURL;
NSString *sslFile;
NSDictionary *responseHeader;
NSMutableData *responseData;
NSInteger getDataTime;
NSInteger responseCode;
NSString *statusString;
NSError *responseError;
NSError *connError;
NSURLConnection *conn;
bool finish;
NSRunLoop *runLoop;
}
// The original URL to download. Due to redirects the actual content may come from another URL

View File

@ -35,18 +35,18 @@
@implementation HttpAsynConnection
@synthesize srcURL;
@synthesize sslFile;
@synthesize responseHeader;
@synthesize responseData;
@synthesize getDataTime;
@synthesize responseCode;
@synthesize statusString;
@synthesize responseError;
@synthesize connError;
@synthesize conn;
@synthesize finish;
@synthesize runLoop;
@synthesize srcURL = srcURL;
@synthesize sslFile = sslFile;
@synthesize responseHeader = responseHeader;
@synthesize responseData = responseData;
@synthesize getDataTime = getDataTime;
@synthesize responseCode = responseCode;
@synthesize statusString = statusString;
@synthesize responseError = responseError;
@synthesize connError = connError;
@synthesize conn = conn;
@synthesize finish = finish;
@synthesize runLoop = runLoop;
- (void)dealloc
{

View File

@ -242,7 +242,7 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(Ref* pTarget, SEL_CallFuncND pSelector)
{
setResponseCallback(pTarget, (SEL_HttpResponse) pSelector);
doSetResponseCallback(pTarget, (SEL_HttpResponse)pSelector);
}
/**
@ -254,13 +254,7 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(Ref* pTarget, SEL_HttpResponse pSelector)
{
_pTarget = pTarget;
_pSelector = pSelector;
if (_pTarget)
{
_pTarget->retain();
}
doSetResponseCallback(pTarget, pSelector);
}
/**
* Set response callback function of HttpRequest object.
@ -342,6 +336,18 @@ public:
return _headers;
}
private:
inline void doSetResponseCallback(Ref* pTarget, SEL_HttpResponse pSelector)
{
_pTarget = pTarget;
_pSelector = pSelector;
if (_pTarget)
{
_pTarget->retain();
}
}
protected:
// properties
Type _requestType; /// kHttpRequestGet, kHttpRequestPost or other enums

View File

@ -826,10 +826,6 @@ void PhysicsWorld::update(float delta, bool userCall/* = false*/)
if (userCall)
{
cpSpaceStep(_cpSpace, delta);
for (auto& body : _bodies)
{
body->update(delta);
}
}
else
{
@ -840,10 +836,6 @@ void PhysicsWorld::update(float delta, bool userCall/* = false*/)
for (int i = 0; i < _substeps; ++i)
{
cpSpaceStep(_cpSpace, dt);
for (auto& body : _bodies)
{
body->update(dt);
}
}
_updateRateCount = 0;
_updateTime = 0.0f;

View File

@ -136,6 +136,13 @@ public:
*/
virtual Platform getTargetPlatform() = 0;
/**
@brief Get application version.
* @js NA
* @lua NA
*/
virtual std::string getVersion() = 0;
/**
@brief Open url in default browser.
@param String with url to open.

View File

@ -192,6 +192,11 @@ Application::Platform Application::getTargetPlatform()
return Platform::OS_ANDROID;
}
std::string Application::getVersion()
{
return JniHelper::callStaticStringMethod(helperClassName, "getVersion");
}
bool Application::openURL(const std::string &url)
{
return JniHelper::callStaticBooleanMethod(helperClassName, "openURL", url);

View File

@ -84,6 +84,11 @@ public:
*/
virtual Platform getTargetPlatform();
/**
@brief Get application version.
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser
@param String with url to open.

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
#include "CCGLViewImpl-android.h"
#include "base/CCDirector.h"
#include "base/ccMacros.h"
#include "jni/JniHelper.h"
#include "platform/android/jni/JniHelper.h"
#include "CCGL.h"
#include <stdlib.h>

View File

@ -50,46 +50,6 @@ import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
class ResizeLayout extends FrameLayout{
private boolean mEnableForceDoLayout = false;
public ResizeLayout(Context context){
super(context);
}
public ResizeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setEnableForceDoLayout(boolean flag){
mEnableForceDoLayout = flag;
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if(mEnableForceDoLayout){
/*This is a hot-fix for some android devices which don't do layout when the main window
* is paned. We refersh the layout in 24 frames per seconds.
* When the editBox is lose focus or when user begin to type, the do layout is disabled.
*/
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
//Do something after 100ms
requestLayout();
invalidate();
}
}, 1000 / 24);
}
}
}
public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelperListener {
// ===========================================================
// Constants

View File

@ -212,6 +212,15 @@ public class Cocos2dxHelper {
sVibrateService.vibrate((long)(duration * 1000));
}
public static String getVersion() {
try {
String version = Cocos2dxActivity.getContext().getPackageManager().getPackageInfo(Cocos2dxActivity.getContext().getPackageName(), 0).versionName;
return version;
} catch(Exception e) {
return "";
}
}
public static boolean openURL(String url) {
boolean ret = false;
try {

View File

@ -0,0 +1,68 @@
/****************************************************************************
Copyright (c) 2010-2013 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
package org.cocos2dx.lib;
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.FrameLayout;
public class ResizeLayout extends FrameLayout {
private boolean mEnableForceDoLayout = false;
public ResizeLayout(Context context){
super(context);
}
public ResizeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setEnableForceDoLayout(boolean flag){
mEnableForceDoLayout = flag;
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if(mEnableForceDoLayout){
/*This is a hot-fix for some android devices which don't do layout when the main window
* is paned. We refersh the layout in 24 frames per seconds.
* When the editBox is lose focus or when user begin to type, the do layout is disabled.
*/
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
//Do something after 100ms
requestLayout();
invalidate();
}
}, 1000 / 24);
}
}
}

View File

@ -83,6 +83,10 @@ const char * getApkPath() {
return g_apkPath.c_str();
}
std::string getPackageNameJNI() {
return JniHelper::callStaticStringMethod(className, "getCocos2dxPackageName");
}
void conversionEncodingJNI(const char* src, int byteSize, const char* fromCharset, char* dst, const char* newCharset)
{
JniMethodInfo methodInfo;

View File

@ -30,39 +30,7 @@ THE SOFTWARE.
typedef void (*EditTextCallback)(const char* text, void* ctx);
extern const char * getApkPath();
extern void showDialogJNI(const char * message, const char * title);
// extern void terminateProcessJNI();
// extern std::string getCurrentLanguageJNI();
// extern std::string getPackageNameJNI();
extern std::string getFileDirectoryJNI();
// functions for UserDefault
// extern bool getBoolForKeyJNI(const char* key, bool defaultValue);
// extern int getIntegerForKeyJNI(const char* key, int defaultValue);
// extern float getFloatForKeyJNI(const char* key, float defaultValue);
// extern double getDoubleForKeyJNI(const char* key, double defaultValue);
// extern std::string getStringForKeyJNI(const char* key, const char* defaultValue);
// extern void setBoolForKeyJNI(const char* key, bool value);
// extern void setIntegerForKeyJNI(const char* key, int value);
// extern void setFloatForKeyJNI(const char* key, float value);
// extern void setDoubleForKeyJNI(const char* key, double value);
// extern void setStringForKeyJNI(const char* key, const char* value);
// extern void deleteValueForKeyJNI(const char* key);
extern std::string getPackageNameJNI();
extern void conversionEncodingJNI(const char* src, int byteSize, const char* fromCharset, char* dst, const char* newCharset);
//Added for new Android EditBox
extern int addEditBoxJNI(int left, int top, int width, int height, float scaleX);
extern void removeEditBoxJNI(int index);
extern void setEditBoxViewRectJNI(int index, int left, int top, int width, int height);
extern void setMaxLengthJNI(int index, int maxLength);
extern void openEditBoxKeyboardJNI(int index);
extern void closeEditBoxKeyboardJNI(int index);
extern void setVisibleEditBoxJNI(int index, bool visibility);
extern void setReturnTypeEditBoxJNI(int index, int returnType);
extern void setInputFlagEditBoxJNI(int index, int inputFlag);
extern void setInputModeEditBoxJNI(int index, int inputMode);
extern void setTextEditBoxJNI(int index, const char* text);
extern void setFontEditBoxJNI(int index, const char* fontName, float fontSize);
extern void setFontColorEditBoxJNI(int index, int red, int green, int blue, int alpha);
extern void setPlaceHolderTextEditBoxJNI(int index, const char* text);
extern void setPlaceHolderTextColorEditBoxJNI(int index, int red, int green, int blue, int alpha);
#endif /* __Java_org_cocos2dx_lib_Cocos2dxHelper_H__ */

View File

@ -67,31 +67,36 @@ public:
@brief Callback by Director for limit FPS.
@param interval The time, expressed in seconds, between current frame and next.
*/
virtual void setAnimationInterval(float interval);
virtual void setAnimationInterval(float interval) override;
/**
@brief Get current language config
@return Current language config
*/
virtual LanguageType getCurrentLanguage();
virtual LanguageType getCurrentLanguage() override;
/**
@brief Get current language iso 639-1 code
@return Current language iso 639-1 code
*/
virtual const char * getCurrentLanguageCode();
virtual const char * getCurrentLanguageCode() override;
/**
@brief Get target platform
*/
virtual Platform getTargetPlatform();
virtual Platform getTargetPlatform() override;
/**
@brief Get application version.
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser
@param String with url to open.
@return true if the resource located by the URL was successfully opened; otherwise false.
*/
virtual bool openURL(const std::string &url);
virtual bool openURL(const std::string &url) override;
/**
@brief This function will be called when the application screen size is changed.

View File

@ -139,6 +139,14 @@ Application::Platform Application::getTargetPlatform()
}
}
std::string Application::getVersion() {
NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
if (version) {
return [version UTF8String];
}
return "";
}
bool Application::openURL(const std::string &url)
{
NSString* msg = [NSString stringWithCString:url.c_str() encoding:NSUTF8StringEncoding];

View File

@ -58,16 +58,16 @@ public:
static int _depthFormat;
/** sets the content scale factor */
bool setContentScaleFactor(float contentScaleFactor) override;
virtual bool setContentScaleFactor(float contentScaleFactor) override;
/** returns the content scale factor */
float getContentScaleFactor() const override;
virtual float getContentScaleFactor() const override;
/** returns whether or not the view is in Retina Display mode */
bool isRetinaDisplay() const override { return getContentScaleFactor() == 2.0; }
virtual bool isRetinaDisplay() const override { return getContentScaleFactor() == 2.0; }
/** returns the objective-c CCEAGLView instance */
void* getEAGLView() const override { return _eaglview; }
virtual void* getEAGLView() const override { return _eaglview; }
// overrides
virtual bool isOpenGLReady() override;

View File

@ -136,6 +136,11 @@ Application::Platform Application::getTargetPlatform()
return Platform::OS_LINUX;
}
std::string Application::getVersion()
{
return "";
}
bool Application::openURL(const std::string &url)
{
std::string op = std::string("open ").append(url);

View File

@ -78,6 +78,11 @@ public:
*/
virtual const char * getCurrentLanguageCode();
/**
@brief Get application version
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser
@param String with url to open.

View File

@ -52,7 +52,7 @@ public:
@brief Callback by Director for limit FPS.
@param interval The time, which expressed in second in second, between current frame and next.
*/
virtual void setAnimationInterval(float interval);
virtual void setAnimationInterval(float interval) override;
/**
@brief Get status bar rectangle in GLView window.
@ -78,25 +78,30 @@ public:
@brief Get current language config
@return Current language config
*/
virtual LanguageType getCurrentLanguage();
virtual LanguageType getCurrentLanguage() override;
/**
@brief Get current language iso 639-1 code
@return Current language iso 639-1 code
*/
virtual const char * getCurrentLanguageCode();
virtual const char * getCurrentLanguageCode() override;
/**
@brief Get target platform
*/
virtual Platform getTargetPlatform();
virtual Platform getTargetPlatform() override;
/**
@brief Get application version.
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser
@param String with url to open.
@return true if the resource located by the URL was successfully opened; otherwise false.
*/
virtual bool openURL(const std::string &url);
virtual bool openURL(const std::string &url) override;
/**
* Sets the Resource root path.

View File

@ -118,6 +118,14 @@ Application::Platform Application::getTargetPlatform()
return Platform::OS_MAC;
}
std::string Application::getVersion() {
NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
if (version) {
return [version UTF8String];
}
return "";
}
/////////////////////////////////////////////////////////////////////////////////////////////////
// static member function
//////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -217,6 +217,11 @@ Application::Platform Application::getTargetPlatform()
return Platform::OS_WINDOWS;
}
std::string Application::getVersion()
{
return "";
}
bool Application::openURL(const std::string &url)
{
WCHAR *temp = new WCHAR[url.size() + 1];

View File

@ -75,6 +75,11 @@ public:
*/
virtual Platform getTargetPlatform();
/**
@brief Get application version
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser
@param String with url to open.

View File

@ -136,8 +136,9 @@ static void _checkPath()
{
if (s_resourcePath.empty())
{
WCHAR *pUtf16ExePath = nullptr;
_get_wpgmptr(&pUtf16ExePath);
WCHAR utf16Path[CC_MAX_PATH] = { 0 };
GetModuleFileNameW(NULL, utf16Path, CC_MAX_PATH - 1);
WCHAR *pUtf16ExePath = &(utf16Path[0]);
// We need only directory part without exe
WCHAR *pUtf16DirEnd = wcsrchr(pUtf16ExePath, L'\\');

View File

@ -36,6 +36,7 @@ using namespace Windows::Foundation;
#include "platform/CCFileUtils.h"
#include "CCWinRTUtils.h"
#include "platform/CCApplication.h"
#include "tinyxml2/tinyxml2.h"
/**
@brief This function change the PVRFrame show/hide setting in register.
@ -225,6 +226,25 @@ Application::Platform Application::getTargetPlatform()
}
}
std::string Application::getVersion()
{
std::string r("");
std::string s = FileUtils::getInstance()->getStringFromFile("WMAppManifest.xml");
if (!s.empty()) {
tinyxml2::XMLDocument doc;
if (!doc.Parse(s.c_str())) {
tinyxml2::XMLElement *app = doc.RootElement()->FirstChildElement("App");
if (app) {
const char* version = app->Attribute("Version");
if (version) {
r = version;
}
}
}
}
return r;
}
bool Application::openURL(const std::string &url)
{
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT

View File

@ -63,6 +63,11 @@ public:
@brief Get target platform
*/
virtual Platform getTargetPlatform() override;
/**
@brief Get application version
*/
virtual std::string getVersion() override;
/**
@brief Open url in default browser

View File

@ -397,7 +397,6 @@ FrameBuffer::FrameBuffer()
FrameBuffer::~FrameBuffer()
{
if(!isDefaultFBO())
{
CC_SAFE_RELEASE_NULL(_rt);
CC_SAFE_RELEASE_NULL(_rtDepthStencil);
@ -407,6 +406,8 @@ FrameBuffer::~FrameBuffer()
#if CC_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_dirtyFBOListener);
#endif
if (isDefaultFBO())
_defaultFBO = nullptr;
}
}

View File

@ -557,6 +557,9 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zNegQueue.cbegin(); it != zNegQueue.cend(); ++it)
{
processRenderCommand(*it);
@ -574,9 +577,11 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glDisable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(false);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = opaqueQueue.cbegin(); it != opaqueQueue.cend(); ++it)
@ -595,10 +600,12 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
glEnable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = transQueue.cbegin(); it != transQueue.cend(); ++it)
@ -636,6 +643,9 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zZeroQueue.cbegin(); it != zZeroQueue.cend(); ++it)
{
processRenderCommand(*it);
@ -671,6 +681,8 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zPosQueue.cbegin(); it != zPosQueue.cend(); ++it)
{

View File

@ -756,6 +756,9 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format)
initWithMipmaps(image->getMipmaps(), image->getNumberOfMipmaps(), image->getRenderFormat(), imageWidth, imageHeight);
// set the premultiplied tag
_hasPremultipliedAlpha = image->hasPremultipliedAlpha();
return true;
}
else if (image->isCompressed())
@ -766,6 +769,10 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format)
}
initWithData(tempData, tempDataLen, image->getRenderFormat(), imageWidth, imageHeight, imageSize);
// set the premultiplied tag
_hasPremultipliedAlpha = image->hasPremultipliedAlpha();
return true;
}
else

View File

@ -1329,11 +1329,11 @@ jsb.Terrain = {
/**
* @method initHeightMap
* @param {char} arg0
* @param {String} arg0
* @return {bool}
*/
initHeightMap : function (
char
str
)
{
return false;
@ -1373,10 +1373,10 @@ map
/**
* @method resetHeightMap
* @param {char} arg0
* @param {String} arg0
*/
resetHeightMap : function (
char
str
)
{
},

View File

@ -474,6 +474,18 @@ removeAllListener : function (
{
},
/**
* @method initSystem
* @param {String} arg0
* @return {bool}
*/
initSystem : function (
str
)
{
return false;
},
/**
* @method setDefaultDepth
* @param {float} arg0

View File

@ -20948,18 +20948,6 @@ char
*/
cc.Application = {
/**
* @method openURL
* @param {String} arg0
* @return {bool}
*/
openURL : function (
str
)
{
return false;
},
/**
* @method getTargetPlatform
* @return {cc.ApplicationProtocol::Platform}
@ -20980,6 +20968,28 @@ getCurrentLanguage : function (
return 0;
},
/**
* @method openURL
* @param {String} arg0
* @return {bool}
*/
openURL : function (
str
)
{
return false;
},
/**
* @method getVersion
* @return {String}
*/
getVersion : function (
)
{
return ;
},
/**
* @method getInstance
* @return {cc.Application}

View File

@ -692,16 +692,6 @@ isPropagateTouchEvents : function (
return false;
},
/**
* @method getCurrentFocusedWidget
* @return {ccui.Widget}
*/
getCurrentFocusedWidget : function (
)
{
return ccui.Widget;
},
/**
* @method hitTest
* @param {vec2_object} arg0
@ -928,6 +918,16 @@ bool
{
},
/**
* @method getCurrentFocusedWidget
* @return {ccui.Widget}
*/
getCurrentFocusedWidget : function (
)
{
return ccui.Widget;
},
/**
* @method create
* @return {ccui.Widget}
@ -1024,6 +1024,16 @@ getClippingType : function (
return 0;
},
/**
* @method getRenderFile
* @return {cc.ResouceData}
*/
getRenderFile : function (
)
{
return cc.ResouceData;
},
/**
* @method isLoopFocus
* @return {bool}
@ -1348,6 +1358,14 @@ float
{
},
/**
* @method resetPressedRender
*/
resetPressedRender : function (
)
{
},
/**
* @method setScale9Enabled
* @param {bool} arg0
@ -1358,6 +1376,14 @@ bool
{
},
/**
* @method resetDisabledRender
*/
resetDisabledRender : function (
)
{
},
/**
* @method getTitleRenderer
* @return {cc.Label}
@ -1378,6 +1404,16 @@ getRendererClicked : function (
return ccui.Scale9Sprite;
},
/**
* @method getDisabledFile
* @return {cc.ResouceData}
*/
getDisabledFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getZoomScale
* @return {float}
@ -1408,6 +1444,24 @@ color3b
{
},
/**
* @method getNormalFile
* @return {cc.ResouceData}
*/
getNormalFile : function (
)
{
return cc.ResouceData;
},
/**
* @method resetNormalRender
*/
resetNormalRender : function (
)
{
},
/**
* @method getRendererDisabled
* @return {ccui.Scale9Sprite}
@ -1590,6 +1644,16 @@ rect
{
},
/**
* @method getPressedFile
* @return {cc.ResouceData}
*/
getPressedFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getTitleFontSize
* @return {float}
@ -1694,6 +1758,26 @@ Button : function (
*/
ccui.AbstractCheckButton = {
/**
* @method getBackDisabledFile
* @return {cc.ResouceData}
*/
getBackDisabledFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getCrossDisabeldFile
* @return {cc.ResouceData}
*/
getCrossDisabeldFile : function (
)
{
return cc.ResouceData;
},
/**
* @method loadTextureBackGroundSelected
* @param {String} arg0
@ -1718,6 +1802,16 @@ texturerestype
{
},
/**
* @method getCrossNormalFile
* @return {cc.ResouceData}
*/
getCrossNormalFile : function (
)
{
return cc.ResouceData;
},
/**
* @method setSelected
* @param {bool} arg0
@ -1728,6 +1822,16 @@ bool
{
},
/**
* @method getBackPressedFile
* @return {cc.ResouceData}
*/
getBackPressedFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getRendererFrontCrossDisabled
* @return {cc.Sprite}
@ -1802,6 +1906,16 @@ texturerestype
return false;
},
/**
* @method getBackNormalFile
* @return {cc.ResouceData}
*/
getBackNormalFile : function (
)
{
return cc.ResouceData;
},
/**
* @method loadTextures
* @param {String} arg0
@ -2171,6 +2285,16 @@ rect
{
},
/**
* @method getRenderFile
* @return {cc.ResouceData}
*/
getRenderFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getCapInsets
* @return {rect_object}
@ -2549,6 +2673,16 @@ str
{
},
/**
* @method getRenderFile
* @return {cc.ResouceData}
*/
getRenderFile : function (
)
{
return cc.ResouceData;
},
/**
* @method setProperty
* @param {String} arg0
@ -2653,6 +2787,16 @@ direction
{
},
/**
* @method getRenderFile
* @return {cc.ResouceData}
*/
getRenderFile : function (
)
{
return cc.ResouceData;
},
/**
* @method setScale9Enabled
* @param {bool} arg0
@ -3353,12 +3497,12 @@ getItemsMargin : function (
/**
* @method jumpToItem
* @param {int} arg0
* @param {long} arg0
* @param {vec2_object} arg1
* @param {vec2_object} arg2
*/
jumpToItem : function (
int,
long,
vec2,
vec2
)
@ -3517,13 +3661,13 @@ long
/**
* @method scrollToItem
* @param {int|int} int
* @param {long|long} long
* @param {vec2_object|vec2_object} vec2
* @param {vec2_object|vec2_object} vec2
* @param {float} float
*/
scrollToItem : function(
int,
long,
vec2,
vec2,
float
@ -3645,16 +3789,6 @@ ListView : function (
*/
ccui.Slider = {
/**
* @method setMaxPercent
* @param {int} arg0
*/
setMaxPercent : function (
int
)
{
},
/**
* @method setPercent
* @param {int} arg0
@ -3665,18 +3799,6 @@ int
{
},
/**
* @method loadSlidBallTextureDisabled
* @param {String} arg0
* @param {ccui.Widget::TextureResType} arg1
*/
loadSlidBallTextureDisabled : function (
str,
texturerestype
)
{
},
/**
* @method getMaxPercent
* @return {int}
@ -3699,18 +3821,6 @@ texturerestype
{
},
/**
* @method loadBarTexture
* @param {String} arg0
* @param {ccui.Widget::TextureResType} arg1
*/
loadBarTexture : function (
str,
texturerestype
)
{
},
/**
* @method loadProgressBarTexture
* @param {String} arg0
@ -3724,39 +3834,13 @@ texturerestype
},
/**
* @method loadSlidBallTextures
* @param {String} arg0
* @param {String} arg1
* @param {String} arg2
* @param {ccui.Widget::TextureResType} arg3
* @method getBallNormalFile
* @return {cc.ResouceData}
*/
loadSlidBallTextures : function (
str,
str,
str,
texturerestype
)
{
},
/**
* @method setCapInsetProgressBarRebderer
* @param {rect_object} arg0
*/
setCapInsetProgressBarRebderer : function (
rect
)
{
},
/**
* @method setCapInsetsBarRenderer
* @param {rect_object} arg0
*/
setCapInsetsBarRenderer : function (
rect
getBallNormalFile : function (
)
{
return cc.ResouceData;
},
/**
@ -3780,23 +3864,13 @@ bool
},
/**
* @method setZoomScale
* @param {float} arg0
* @method getBallPressedFile
* @return {cc.ResouceData}
*/
setZoomScale : function (
float
)
{
},
/**
* @method setCapInsets
* @param {rect_object} arg0
*/
setCapInsets : function (
rect
getBallPressedFile : function (
)
{
return cc.ResouceData;
},
/**
@ -3809,6 +3883,64 @@ getZoomScale : function (
return 0;
},
/**
* @method loadSlidBallTextures
* @param {String} arg0
* @param {String} arg1
* @param {String} arg2
* @param {ccui.Widget::TextureResType} arg3
*/
loadSlidBallTextures : function (
str,
str,
str,
texturerestype
)
{
},
/**
* @method setMaxPercent
* @param {int} arg0
*/
setMaxPercent : function (
int
)
{
},
/**
* @method loadBarTexture
* @param {String} arg0
* @param {ccui.Widget::TextureResType} arg1
*/
loadBarTexture : function (
str,
texturerestype
)
{
},
/**
* @method getProgressBarFile
* @return {cc.ResouceData}
*/
getProgressBarFile : function (
)
{
return cc.ResouceData;
},
/**
* @method getCapInsetsBarRenderer
* @return {rect_object}
*/
getCapInsetsBarRenderer : function (
)
{
return cc.Rect;
},
/**
* @method loadSlidBallTexturePressed
* @param {String} arg0
@ -3821,6 +3953,16 @@ texturerestype
{
},
/**
* @method getBackFile
* @return {cc.ResouceData}
*/
getBackFile : function (
)
{
return cc.ResouceData;
},
/**
* @method isScale9Enabled
* @return {bool}
@ -3832,13 +3974,33 @@ isScale9Enabled : function (
},
/**
* @method getCapInsetsBarRenderer
* @return {rect_object}
* @method setCapInsetProgressBarRebderer
* @param {rect_object} arg0
*/
getCapInsetsBarRenderer : function (
setCapInsetProgressBarRebderer : function (
rect
)
{
return cc.Rect;
},
/**
* @method setCapInsetsBarRenderer
* @param {rect_object} arg0
*/
setCapInsetsBarRenderer : function (
rect
)
{
},
/**
* @method getBallDisabeldFile
* @return {cc.ResouceData}
*/
getBallDisabeldFile : function (
)
{
return cc.ResouceData;
},
/**
@ -3851,6 +4013,38 @@ getPercent : function (
return 0;
},
/**
* @method setCapInsets
* @param {rect_object} arg0
*/
setCapInsets : function (
rect
)
{
},
/**
* @method loadSlidBallTextureDisabled
* @param {String} arg0
* @param {ccui.Widget::TextureResType} arg1
*/
loadSlidBallTextureDisabled : function (
str,
texturerestype
)
{
},
/**
* @method setZoomScale
* @param {float} arg0
*/
setZoomScale : function (
float
)
{
},
/**
* @method create
* @param {String} str
@ -4625,16 +4819,6 @@ TextField : function (
*/
ccui.TextBMFont = {
/**
* @method setFntFile
* @param {String} arg0
*/
setFntFile : function (
str
)
{
},
/**
* @method getStringLength
* @return {long}
@ -4645,6 +4829,16 @@ getStringLength : function (
return 0;
},
/**
* @method getString
* @return {String}
*/
getString : function (
)
{
return ;
},
/**
* @method setString
* @param {String} arg0
@ -4656,13 +4850,23 @@ str
},
/**
* @method getString
* @return {String}
* @method getRenderFile
* @return {cc.ResouceData}
*/
getString : function (
getRenderFile : function (
)
{
return cc.ResouceData;
},
/**
* @method setFntFile
* @param {String} arg0
*/
setFntFile : function (
str
)
{
return ;
},
/**
@ -4706,121 +4910,117 @@ TextBMFont : function (
ccui.PageView = {
/**
* @method getCustomScrollThreshold
* @return {float}
*/
getCustomScrollThreshold : function (
)
{
return 0;
},
/**
* @method getCurPageIndex
* @return {long}
*/
getCurPageIndex : function (
)
{
return 0;
},
/**
* @method setDirection
* @param {ccui.PageView::Direction} arg0
*/
setDirection : function (
direction
)
{
},
/**
* @method addWidgetToPage
* @param {ccui.Widget} arg0
* @param {long} arg1
* @param {bool} arg2
*/
addWidgetToPage : function (
widget,
long,
bool
)
{
},
/**
* @method isUsingCustomScrollThreshold
* @return {bool}
*/
isUsingCustomScrollThreshold : function (
)
{
return false;
},
/**
* @method setCurPageIndex
* @param {long} arg0
*/
setCurPageIndex : function (
long
)
{
},
/**
* @method removePage
* @param {ccui.Layout} arg0
*/
removePage : function (
layout
)
{
},
/**
* @method setUsingCustomScrollThreshold
* @param {bool} arg0
*/
setUsingCustomScrollThreshold : function (
bool
)
{
},
/**
* @method setCustomScrollThreshold
* @method setIndicatorSpaceBetweenIndexNodes
* @param {float} arg0
*/
setCustomScrollThreshold : function (
setIndicatorSpaceBetweenIndexNodes : function (
float
)
{
},
/**
* @method setIndicatorSelectedIndexColor
* @param {color3b_object} arg0
*/
setIndicatorSelectedIndexColor : function (
color3b
)
{
},
/**
* @method getIndicatorSelectedIndexColor
* @return {color3b_object}
*/
getIndicatorSelectedIndexColor : function (
)
{
return cc.Color3B;
},
/**
* @method getIndicatorPositionAsAnchorPoint
* @return {vec2_object}
*/
getIndicatorPositionAsAnchorPoint : function (
)
{
return cc.Vec2;
},
/**
* @method setIndicatorPosition
* @param {vec2_object} arg0
*/
setIndicatorPosition : function (
vec2
)
{
},
/**
* @method getIndicatorPosition
* @return {vec2_object}
*/
getIndicatorPosition : function (
)
{
return cc.Vec2;
},
/**
* @method insertPage
* @param {ccui.Layout} arg0
* @param {ccui.Widget} arg0
* @param {int} arg1
*/
insertPage : function (
layout,
widget,
int
)
{
},
/**
* @method getDirection
* @return {ccui.PageView::Direction}
* @method getCurrentPageIndex
* @return {long}
*/
getDirection : function (
getCurrentPageIndex : function (
)
{
return 0;
},
/**
* @method removePage
* @param {ccui.Widget} arg0
*/
removePage : function (
widget
)
{
},
/**
* @method setCurrentPageIndex
* @param {long} arg0
*/
setCurrentPageIndex : function (
long
)
{
},
/**
* @method getIndicatorEnabled
* @return {bool}
*/
getIndicatorEnabled : function (
)
{
return false;
},
/**
* @method scrollToPage
* @param {long} arg0
@ -4832,35 +5032,53 @@ long
},
/**
* @method getPage
* @param {long} arg0
* @return {ccui.Layout}
* @method setIndicatorPositionAsAnchorPoint
* @param {vec2_object} arg0
*/
getPage : function (
long
setIndicatorPositionAsAnchorPoint : function (
vec2
)
{
return ccui.Layout;
},
/**
* @method removePageAtIndex
* @method scrollToItem
* @param {long} arg0
*/
removePageAtIndex : function (
scrollToItem : function (
long
)
{
},
/**
* @method getPages
* @return {Array}
* @method setIndicatorEnabled
* @param {bool} arg0
*/
getPages : function (
setIndicatorEnabled : function (
bool
)
{
return new Array();
},
/**
* @method addPage
* @param {ccui.Widget} arg0
*/
addPage : function (
widget
)
{
},
/**
* @method getIndicatorSpaceBetweenIndexNodes
* @return {float}
*/
getIndicatorSpaceBetweenIndexNodes : function (
)
{
return 0;
},
/**
@ -4872,11 +5090,11 @@ removeAllPages : function (
},
/**
* @method addPage
* @param {ccui.Layout} arg0
* @method removePageAtIndex
* @param {long} arg0
*/
addPage : function (
layout
removePageAtIndex : function (
long
)
{
},
@ -5574,6 +5792,16 @@ float
{
},
/**
* @method setRenderingType
* @param {ccui.Scale9Sprite::RenderingType} arg0
*/
setRenderingType : function (
renderingtype
)
{
},
/**
* @method init
* @param {cc.Sprite|cc.Sprite|cc.Sprite} sprite
@ -5658,6 +5886,24 @@ isScale9Enabled : function (
return false;
},
/**
* @method resetRender
*/
resetRender : function (
)
{
},
/**
* @method getRenderingType
* @return {ccui.Scale9Sprite::RenderingType}
*/
getRenderingType : function (
)
{
return 0;
},
/**
* @method getInsetRight
* @return {float}

View File

@ -3823,8 +3823,8 @@ bool js_cocos2dx_3d_Terrain_initHeightMap(JSContext *cx, uint32_t argc, jsval *v
cocos2d::Terrain* cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_initHeightMap : Invalid Native Object");
if (argc == 1) {
const char* arg0 = nullptr;
std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str();
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_initHeightMap : Error processing arguments");
bool ret = cobj->initHeightMap(arg0);
jsval jsret = JSVAL_NULL;
@ -3908,8 +3908,8 @@ bool js_cocos2dx_3d_Terrain_resetHeightMap(JSContext *cx, uint32_t argc, jsval *
cocos2d::Terrain* cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_resetHeightMap : Invalid Native Object");
if (argc == 1) {
const char* arg0 = nullptr;
std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str();
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_resetHeightMap : Error processing arguments");
cobj->resetHeightMap(arg0);
args.rval().setUndefined();

View File

@ -1020,6 +1020,28 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_removeAllListener(JSContext *cx
JS_ReportError(cx, "js_cocos2dx_3d_extension_PUParticleSystem3D_removeAllListener : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::PUParticleSystem3D* cobj = (cocos2d::PUParticleSystem3D *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem : Invalid Native Object");
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem : Error processing arguments");
bool ret = cobj->initSystem(arg0);
jsval jsret = JSVAL_NULL;
jsret = BOOLEAN_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -1191,6 +1213,7 @@ void js_register_cocos2dx_3d_extension_PUParticleSystem3D(JSContext *cx, JS::Han
JS_FN("getDerivedScale", js_cocos2dx_3d_extension_PUParticleSystem3D_getDerivedScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setDefaultHeight", js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultHeight, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("removeAllListener", js_cocos2dx_3d_extension_PUParticleSystem3D_removeAllListener, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("initSystem", js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setDefaultDepth", js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FS_END
};

View File

@ -67,6 +67,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setParticleSystemScaleVelocity(
bool js_cocos2dx_3d_extension_PUParticleSystem3D_getDerivedScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultHeight(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_removeAllListener(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_initSystem(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_extension_PUParticleSystem3D_PUParticleSystem3D(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -65525,28 +65525,6 @@ void js_register_cocos2dx_SAXParser(JSContext *cx, JS::HandleObject global) {
JSClass *jsb_cocos2d_Application_class;
JSObject *jsb_cocos2d_Application_prototype;
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_openURL : Invalid Native Object");
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Application_openURL : Error processing arguments");
bool ret = cobj->openURL(arg0);
jsval jsret = JSVAL_NULL;
jsret = BOOLEAN_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_openURL : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -65583,6 +65561,46 @@ bool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, js
JS_ReportError(cx, "js_cocos2dx_Application_getCurrentLanguage : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_openURL : Invalid Native Object");
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Application_openURL : Error processing arguments");
bool ret = cobj->openURL(arg0);
jsval jsret = JSVAL_NULL;
jsret = BOOLEAN_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_openURL : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_Application_getVersion(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_getVersion : Invalid Native Object");
if (argc == 0) {
std::string ret = cobj->getVersion();
jsval jsret = JSVAL_NULL;
jsret = std_string_to_jsval(cx, ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_getVersion : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -65627,9 +65645,10 @@ void js_register_cocos2dx_Application(JSContext *cx, JS::HandleObject global) {
};
static JSFunctionSpec funcs[] = {
JS_FN("openURL", js_cocos2dx_Application_openURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTargetPlatform", js_cocos2dx_Application_getTargetPlatform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getCurrentLanguage", js_cocos2dx_Application_getCurrentLanguage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("openURL", js_cocos2dx_Application_openURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getVersion", js_cocos2dx_Application_getVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FS_END
};

View File

@ -3763,9 +3763,10 @@ bool js_cocos2dx_Application_constructor(JSContext *cx, uint32_t argc, jsval *vp
void js_cocos2dx_Application_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_Application(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getVersion(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_AnimationCache_class;

File diff suppressed because it is too large Load Diff

View File

@ -102,7 +102,6 @@ bool js_cocos2dx_ui_Widget_isBright(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_dispatchFocusEvent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_setUnifySizeEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_isPropagateTouchEvents(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_getCurrentFocusedWidget(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_hitTest(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_isLayoutComponentEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_requestFocus(JSContext *cx, uint32_t argc, jsval *vp);
@ -124,6 +123,7 @@ bool js_cocos2dx_ui_Widget_setBright(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_setCallbackType(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_isSwallowTouches(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_enableDpadNavigation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_getCurrentFocusedWidget(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Widget_Widget(JSContext *cx, uint32_t argc, jsval *vp);
@ -141,6 +141,7 @@ bool js_cocos2dx_ui_Layout_setLoopFocus(JSContext *cx, uint32_t argc, jsval *vp)
bool js_cocos2dx_ui_Layout_setBackGroundImageColor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_getBackGroundColorVector(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_getClippingType(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_isLoopFocus(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_removeBackGroundImage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Layout_getBackGroundColorOpacity(JSContext *cx, uint32_t argc, jsval *vp);
@ -181,12 +182,17 @@ void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_Button_getNormalTextureSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getTitleText(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_resetPressedRender(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_resetDisabledRender(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getTitleRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getRendererClicked(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getDisabledFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getCapInsetsDisabledRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setTitleColor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getNormalFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_resetNormalRender(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getRendererDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setCapInsetsDisabledRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
@ -203,6 +209,7 @@ bool js_cocos2dx_ui_Button_loadTextures(JSContext *cx, uint32_t argc, jsval *vp)
bool js_cocos2dx_ui_Button_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_loadTextureNormal(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_setCapInsetsPressedRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getPressedFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getRendererNormal(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Button_getTitleFontName(JSContext *cx, uint32_t argc, jsval *vp);
@ -220,15 +227,20 @@ bool js_cocos2dx_ui_AbstractCheckButton_constructor(JSContext *cx, uint32_t argc
void js_cocos2dx_ui_AbstractCheckButton_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_ui_AbstractCheckButton(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getCrossDisabeldFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_loadTextureBackGroundSelected(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_loadTextureBackGroundDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_setSelected(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getBackPressedFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getRendererFrontCrossDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getRendererBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_loadTextureFrontCross(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getRendererBackgroundDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_isSelected(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_init(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getBackNormalFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_loadTextures(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_AbstractCheckButton_getRendererFrontCross(JSContext *cx, uint32_t argc, jsval *vp);
@ -291,6 +303,7 @@ bool js_cocos2dx_ui_ImageView_init(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_setTextureRect(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_getCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp);
@ -342,6 +355,7 @@ void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_TextAtlas_getStringLength(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_getString(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_setString(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_setProperty(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_adaptRenderers(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp);
@ -358,6 +372,7 @@ void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_LoadingBar_setPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_loadTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_setDirection(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_LoadingBar_getDirection(JSContext *cx, uint32_t argc, jsval *vp);
@ -476,25 +491,30 @@ bool js_cocos2dx_ui_Slider_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_ui_Slider_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_ui_Slider(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_Slider_setMaxPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getMaxPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTextureNormal(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadBarTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadProgressBarTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTextures(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsetProgressBarRebderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getBallNormalFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getCapInsetsProgressBarRebderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getBallPressedFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTexturePressed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTextures(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setMaxPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadBarTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getProgressBarFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTexturePressed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getBackFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsetProgressBarRebderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getBallDisabeldFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_getPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_loadSlidBallTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_createInstance(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Slider_Slider(JSContext *cx, uint32_t argc, jsval *vp);
@ -592,10 +612,11 @@ bool js_cocos2dx_ui_TextBMFont_constructor(JSContext *cx, uint32_t argc, jsval *
void js_cocos2dx_ui_TextBMFont_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_ui_TextBMFont(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_TextBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_getStringLength(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_setString(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_getString(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_setString(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_createInstance(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_TextBMFont_TextBMFont(JSContext *cx, uint32_t argc, jsval *vp);
@ -607,23 +628,25 @@ bool js_cocos2dx_ui_PageView_constructor(JSContext *cx, uint32_t argc, jsval *vp
void js_cocos2dx_ui_PageView_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_ui_PageView(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_ui_PageView_getCustomScrollThreshold(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getCurPageIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setDirection(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_addWidgetToPage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_isUsingCustomScrollThreshold(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setCurPageIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setUsingCustomScrollThreshold(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setCustomScrollThreshold(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setIndicatorSelectedIndexColor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getIndicatorPositionAsAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setIndicatorPosition(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getIndicatorPosition(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_insertPage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getDirection(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getCurrentPageIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setCurrentPageIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_scrollToPage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getPage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getPages(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setIndicatorPositionAsAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_setIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_addPage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_getIndicatorSpaceBetweenIndexNodes(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_createInstance(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_PageView_PageView(JSContext *cx, uint32_t argc, jsval *vp);
@ -756,6 +779,7 @@ bool js_cocos2dx_ui_Scale9Sprite_setInsetBottom(JSContext *cx, uint32_t argc, js
bool js_cocos2dx_ui_Scale9Sprite_initWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_getSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_setInsetTop(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_setRenderingType(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_init(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);
@ -763,6 +787,8 @@ bool js_cocos2dx_ui_Scale9Sprite_getBlendFunc(JSContext *cx, uint32_t argc, jsva
bool js_cocos2dx_ui_Scale9Sprite_getInsetBottom(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_getCapInsets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_resetRender(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_getRenderingType(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_getInsetRight(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_ui_Scale9Sprite_initWithFile(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -94,7 +94,7 @@ ComponentJS::ComponentJS(const std::string& scriptFileName)
ComponentJS::~ComponentJS()
{
mozilla::Maybe<JS::PersistentRootedObject>* jsObj = static_cast<mozilla::Maybe<JS::PersistentRootedObject>*>(_jsObj);
if (jsObj == nullptr)
if (jsObj != nullptr)
{
delete jsObj;
}

View File

@ -27,6 +27,7 @@
#include "js_manual_conversions.h"
#include "cocos2d_specifics.hpp"
#include "math/TransformUtils.h"
#include "2d/CocosStudioExtension.h"
USING_NS_CC;
@ -2865,3 +2866,43 @@ jsval std_map_string_string_to_jsval(JSContext* cx, const std::map<std::string,
}
return OBJECT_TO_JSVAL(jsRet);
}
bool jsval_to_resoucedata(JSContext *cx, JS::HandleValue v, ResouceData* ret) {
JS::RootedObject tmp(cx);
JS::RootedValue jstype(cx);
JS::RootedValue jsfile(cx);
JS::RootedValue jsplist(cx);
double t = 0;
std::string file, plist;
bool ok = v.isObject() &&
JS_ValueToObject(cx, v, &tmp) &&
JS_GetProperty(cx, tmp, "type", &jstype) &&
JS_GetProperty(cx, tmp, "name", &jsfile) &&
JS_GetProperty(cx, tmp, "plist", &jsplist) &&
JS::ToNumber(cx, jstype, &t) &&
jsval_to_std_string(cx, jsfile, &file) &&
jsval_to_std_string(cx, jsplist, &plist);
JSB_PRECONDITION3(ok, cx, false, "Error processing arguments");
ret->type = (int)t;
ret->file = file;
ret->plist = plist;
return true;
}
jsval resoucedata_to_jsval(JSContext* cx, const ResouceData& v)
{
JS::RootedObject proto(cx);
JS::RootedObject parent(cx);
JS::RootedObject tmp(cx, JS_NewObject(cx, NULL, proto, parent));
if (!tmp) return JSVAL_NULL;
bool ok = JS_DefineProperty(cx, tmp, "type", v.type, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
JS_DefineProperty(cx, tmp, "file", JS::RootedValue(cx, std_string_to_jsval(cx, v.file)), JSPROP_ENUMERATE | JSPROP_PERMANENT) &&
JS_DefineProperty(cx, tmp, "plist", JS::RootedValue(cx, std_string_to_jsval(cx, v.plist)), JSPROP_ENUMERATE | JSPROP_PERMANENT);
if (ok) {
return OBJECT_TO_JSVAL(tmp);
}
return JSVAL_NULL;
}

View File

@ -34,6 +34,10 @@
#define JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
NS_CC_BEGIN
struct CC_DLL ResouceData;
NS_CC_END
// just a simple utility to avoid mem leaking when using JSString
class JSStringWrapper
{
@ -110,6 +114,7 @@ bool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, cocos2d::__
bool jsval_to_quaternion(JSContext *cx, JS::HandleValue vp, cocos2d::Quaternion* ret);
bool jsval_to_obb(JSContext *cx, JS::HandleValue vp, cocos2d::OBB* ret);
bool jsval_to_ray(JSContext *cx, JS::HandleValue vp, cocos2d::Ray* ret);
bool jsval_to_resoucedata(JSContext *cx, JS::HandleValue v, cocos2d::ResouceData* ret);
// forward declaration
js_proxy_t* jsb_get_js_proxy(JSObject* jsObj);
@ -272,6 +277,7 @@ jsval FontDefinition_to_jsval(JSContext* cx, const cocos2d::FontDefinition& t);
jsval quaternion_to_jsval(JSContext* cx, const cocos2d::Quaternion& q);
jsval meshVertexAttrib_to_jsval(JSContext* cx, const cocos2d::MeshVertexAttrib& q);
jsval uniform_to_jsval(JSContext* cx, const cocos2d::Uniform* uniform);
jsval resoucedata_to_jsval(JSContext* cx, const cocos2d::ResouceData& v);
template<class T>
js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj);

View File

@ -662,6 +662,13 @@
var va = options["vAlignment"];
if(va)
widget.setTextVerticalAlignment(va);
var r = options["colorR"];
var g = options["colorG"];
var b = options["colorB"];
if (r !== undefined && g !== undefined && b !== undefined) {
widget.setTextColor(cc.color(r, g, b));
}
};
var register = [

View File

@ -4,6 +4,18 @@
-- @extend Widget
-- @parent_module ccui
--------------------------------
--
-- @function [parent=#AbstractCheckButton] getBackDisabledFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
--
-- @function [parent=#AbstractCheckButton] getCrossDisabeldFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Load background selected state texture for check button.<br>
-- param backGroundSelected The background selected state image name.<br>
@ -24,6 +36,12 @@
-- @param #int texType
-- @return AbstractCheckButton#AbstractCheckButton self (return value: ccui.AbstractCheckButton)
--------------------------------
--
-- @function [parent=#AbstractCheckButton] getCrossNormalFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Change CheckBox state.<br>
-- Set to true will cause the CheckBox's state to "selected", false otherwise.<br>
@ -33,6 +51,12 @@
-- @param #bool selected
-- @return AbstractCheckButton#AbstractCheckButton self (return value: ccui.AbstractCheckButton)
--------------------------------
--
-- @function [parent=#AbstractCheckButton] getBackPressedFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- brief Return the sprite instance of front cross when disabled<br>
-- return the sprite instance of front cross when disabled
@ -83,6 +107,12 @@
-- @param #int texType
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#AbstractCheckButton] getBackNormalFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Load all textures for initializing a check button.<br>
-- param background The background image name.<br>

View File

@ -3,15 +3,6 @@
-- @module Application
-- @parent_module cc
--------------------------------
-- brief Open url in default browser<br>
-- param String with url to open.<br>
-- return true if the resource located by the URL was successfully opened; otherwise false.
-- @function [parent=#Application] openURL
-- @param self
-- @param #string url
-- @return bool#bool ret (return value: bool)
--------------------------------
-- brief Get target platform
-- @function [parent=#Application] getTargetPlatform
@ -32,6 +23,21 @@
-- @param self
-- @return char#char ret (return value: char)
--------------------------------
-- brief Open url in default browser<br>
-- param String with url to open.<br>
-- return true if the resource located by the URL was successfully opened; otherwise false.
-- @function [parent=#Application] openURL
-- @param self
-- @param #string url
-- @return bool#bool ret (return value: bool)
--------------------------------
-- brief Get application version.
-- @function [parent=#Application] getVersion
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- brief Callback by Director to limit FPS.<br>
-- param interval The time, expressed in seconds, between current frame and next.

View File

@ -25,6 +25,12 @@
-- @param #float size
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
--
-- @function [parent=#Button] resetPressedRender
-- @param self
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
-- Enable scale9 renderer.<br>
-- param enable Set to true will use scale9 renderer, false otherwise.
@ -33,6 +39,12 @@
-- @param #bool enable
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
--
-- @function [parent=#Button] resetDisabledRender
-- @param self
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
-- Return the inner title renderer of Button.<br>
-- return The button title.<br>
@ -49,6 +61,12 @@
-- @param self
-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite)
--------------------------------
--
-- @function [parent=#Button] getDisabledFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- brief Return a zoom scale<br>
-- return the zoom scale in float<br>
@ -72,6 +90,18 @@
-- @param #color3b_table color
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
--
-- @function [parent=#Button] getNormalFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
--
-- @function [parent=#Button] resetNormalRender
-- @param self
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
-- brief Return the nine-patch sprite of disabled state<br>
-- return the nine-patch sprite of disabled state<br>
@ -213,6 +243,12 @@
-- @param #rect_table capInsets
-- @return Button#Button self (return value: ccui.Button)
--------------------------------
--
-- @function [parent=#Button] getPressedFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Query the font size of button title<br>
-- return font size in float.

View File

@ -47,6 +47,12 @@
-- @param #rect_table capInsets
-- @return ImageView#ImageView self (return value: ccui.ImageView)
--------------------------------
--
-- @function [parent=#ImageView] getRenderFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Get ImageView's capInsets size.<br>
-- return Query capInsets size in Rect<br>

View File

@ -60,6 +60,12 @@
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
--
-- @function [parent=#Layout] getRenderFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- return If focus loop is enabled, then it will return true, otherwise it returns false. The default value is false.
-- @function [parent=#Layout] isLoopFocus

View File

@ -46,7 +46,7 @@
-- param itemAnchorPoint Specifies an anchor point of each item for position to calculate distance.
-- @function [parent=#ListView] jumpToItem
-- @param self
-- @param #int itemIndex
-- @param #long itemIndex
-- @param #vec2_table positionRatioInView
-- @param #vec2_table itemAnchorPoint
-- @return ListView#ListView self (return value: ccui.ListView)
@ -171,11 +171,11 @@
-- @return ListView#ListView self (return value: ccui.ListView)
--------------------------------
-- @overload self, int, vec2_table, vec2_table, float
-- @overload self, int, vec2_table, vec2_table
-- @overload self, long, vec2_table, vec2_table, float
-- @overload self, long, vec2_table, vec2_table
-- @function [parent=#ListView] scrollToItem
-- @param self
-- @param #int itemIndex
-- @param #long itemIndex
-- @param #vec2_table positionRatioInView
-- @param #vec2_table itemAnchorPoint
-- @param #float timeInSec

View File

@ -31,6 +31,12 @@
-- @param #int direction
-- @return LoadingBar#LoadingBar self (return value: ccui.LoadingBar)
--------------------------------
--
-- @function [parent=#LoadingBar] getRenderFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Enable scale9 renderer.<br>
-- param enabled Set to true will use scale9 renderer, false otherwise.

View File

@ -247,6 +247,13 @@
-- @param self
-- @return PUParticleSystem3D#PUParticleSystem3D self (return value: cc.PUParticleSystem3D)
--------------------------------
--
-- @function [parent=#PUParticleSystem3D] initSystem
-- @param self
-- @param #string filePath
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#PUParticleSystem3D] makeParticleLocal

View File

@ -1,67 +1,77 @@
--------------------------------
-- @module PageView
-- @extend Layout
-- @extend ListView
-- @parent_module ccui
--------------------------------
-- brief Query the custom scroll threshold of the PageView.<br>
-- return Custom scroll threshold in float.
-- @function [parent=#PageView] getCustomScrollThreshold
-- brief Set space between page indicator's index nodes.<br>
-- param spaceBetweenIndexNodes Space between nodes in pixel.
-- @function [parent=#PageView] setIndicatorSpaceBetweenIndexNodes
-- @param self
-- @return float#float ret (return value: float)
-- @param #float spaceBetweenIndexNodes
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Set color of page indicator's selected index.<br>
-- param spaceBetweenIndexNodes Space between nodes in pixel.
-- @function [parent=#PageView] setIndicatorSelectedIndexColor
-- @param self
-- @param #color3b_table color
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Get the color of page indicator's selected index.<br>
-- return color
-- @function [parent=#PageView] getIndicatorSelectedIndexColor
-- @param self
-- @return color3b_table#color3b_table ret (return value: color3b_table)
--------------------------------
-- brief Get the page indicator's position as anchor point.<br>
-- return positionAsAnchorPoint
-- @function [parent=#PageView] getIndicatorPositionAsAnchorPoint
-- @param self
-- @return vec2_table#vec2_table ret (return value: vec2_table)
--------------------------------
-- brief Set the page indicator's position in page view.<br>
-- param position The position in page view
-- @function [parent=#PageView] setIndicatorPosition
-- @param self
-- @param #vec2_table position
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Get the page indicator's position.<br>
-- return positionAsAnchorPoint
-- @function [parent=#PageView] getIndicatorPosition
-- @param self
-- @return vec2_table#vec2_table ret (return value: vec2_table)
--------------------------------
-- Insert a page into PageView at a given index.<br>
-- param page Page to be inserted.<br>
-- param idx A given index.
-- @function [parent=#PageView] insertPage
-- @param self
-- @param #ccui.Widget page
-- @param #int idx
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Gets current displayed page index.<br>
-- return current page index.
-- @function [parent=#PageView] getCurPageIndex
-- @function [parent=#PageView] getCurrentPageIndex
-- @param self
-- @return long#long ret (return value: long)
--------------------------------
-- Changes scroll direction of PageView<br>
-- see `Direction`<br>
-- param direction Scroll direction enum.<br>
-- since v3.8
-- @function [parent=#PageView] setDirection
-- @param self
-- @param #int direction
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Add a widget as a page of PageView in a given index.<br>
-- param widget Widget to be added to pageview.<br>
-- param pageIdx A given index.<br>
-- param forceCreate If `forceCreate` is true and `widget` isn't exists, pageview would create a default page and add it.
-- @function [parent=#PageView] addWidgetToPage
-- @param self
-- @param #ccui.Widget widget
-- @param #long pageIdx
-- @param #bool forceCreate
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Query whether use user defined scroll page threshold or not.<br>
-- return True if using custom scroll threshold, false otherwise.
-- @function [parent=#PageView] isUsingCustomScrollThreshold
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Jump to a page with a given index without scrolling.<br>
-- This is the different between scrollToPage.<br>
-- param index A given index in PageView. Index start from 0 to pageCount -1.
-- @function [parent=#PageView] setCurPageIndex
-- @param self
-- @param #long index
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Remove a page of PageView.<br>
-- param page Page to be removed.
-- @function [parent=#PageView] removePage
-- @param self
-- @param #ccui.Layout page
-- @param #ccui.Widget page
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
@ -73,40 +83,20 @@
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Set using user defined scroll page threshold or not.<br>
-- If you set it to false, then the default scroll threshold is pageView.width / 2<br>
-- param flag True if using custom scroll threshold, false otherwise.
-- @function [parent=#PageView] setUsingCustomScrollThreshold
-- Jump to a page with a given index without scrolling.<br>
-- This is the different between scrollToPage.<br>
-- param index A given index in PageView. Index start from 0 to pageCount -1.
-- @function [parent=#PageView] setCurrentPageIndex
-- @param self
-- @param #bool flag
-- @param #long index
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief If you don't specify the value, the pageView will turn page when scrolling at the half width of a page.<br>
-- param threshold A threshold in float.
-- @function [parent=#PageView] setCustomScrollThreshold
-- brief Query page indicator state.<br>
-- return True if page indicator is enabled, false otherwise.
-- @function [parent=#PageView] getIndicatorEnabled
-- @param self
-- @param #float threshold
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Insert a page into PageView at a given index.<br>
-- param page Page to be inserted.<br>
-- param idx A given index.
-- @function [parent=#PageView] insertPage
-- @param self
-- @param #ccui.Layout page
-- @param #int idx
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Query scroll direction of PageView.<br>
-- see `Direction`<br>
-- since v3.8<br>
-- return PageView scroll direction.
-- @function [parent=#PageView] getDirection
-- @param self
-- @return int#int ret (return value: int)
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Scroll to a page with a given index.<br>
@ -117,28 +107,43 @@
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Get a page at a given index<br>
-- param index A given index.<br>
-- return A layout pointer in PageView container.
-- @function [parent=#PageView] getPage
-- brief Set the page indicator's position using anchor point.<br>
-- param positionAsAnchorPoint The position as anchor point.
-- @function [parent=#PageView] setIndicatorPositionAsAnchorPoint
-- @param self
-- @param #long index
-- @return Layout#Layout ret (return value: ccui.Layout)
--------------------------------
-- Remove a page at a given index of PageView.<br>
-- param index A given index.
-- @function [parent=#PageView] removePageAtIndex
-- @param self
-- @param #long index
-- @param #vec2_table positionAsAnchorPoint
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Get all the pages in the PageView.<br>
-- return A vector of Layout pointers.
-- @function [parent=#PageView] getPages
-- Scroll to a page with a given index.<br>
-- param idx A given index in the PageView. Index start from 0 to pageCount -1.
-- @function [parent=#PageView] scrollToItem
-- @param self
-- @return array_table#array_table ret (return value: array_table)
-- @param #long itemIndex
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Toggle page indicator enabled.<br>
-- param enabled True if enable page indicator, false otherwise.
-- @function [parent=#PageView] setIndicatorEnabled
-- @param self
-- @param #bool enabled
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Insert a page into the end of PageView.<br>
-- param page Page to be inserted.
-- @function [parent=#PageView] addPage
-- @param self
-- @param #ccui.Widget page
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- brief Get the space between page indicator's index nodes.<br>
-- return spaceBetweenIndexNodes
-- @function [parent=#PageView] getIndicatorSpaceBetweenIndexNodes
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- brief Remove all pages of the PageView.
@ -147,11 +152,11 @@
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
-- Insert a page into the end of PageView.<br>
-- param page Page to be inserted.
-- @function [parent=#PageView] addPage
-- Remove a page at a given index of PageView.<br>
-- param index A given index.
-- @function [parent=#PageView] removePageAtIndex
-- @param self
-- @param #ccui.Layout page
-- @param #long index
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
@ -169,21 +174,8 @@
--------------------------------
--
-- @function [parent=#PageView] getLayoutType
-- @function [parent=#PageView] doLayout
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
--
-- @function [parent=#PageView] getDescription
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
--
-- @function [parent=#PageView] update
-- @param self
-- @param #float dt
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------
@ -194,9 +186,17 @@
--------------------------------
--
-- @function [parent=#PageView] setLayoutType
-- @function [parent=#PageView] getDescription
-- @param self
-- @param #int type
-- @return string#string ret (return value: string)
--------------------------------
-- Changes direction<br>
-- Direction Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll.<br>
-- param direction Set the page view's scroll direction.
-- @function [parent=#PageView] setDirection
-- @param self
-- @param #int direction
-- @return PageView#PageView self (return value: ccui.PageView)
--------------------------------

View File

@ -34,6 +34,16 @@
-- @param #cc.V3F_C4B_T2F_Quad quad
-- @return PolygonInfo#PolygonInfo self (return value: cc.PolygonInfo)
--------------------------------
-- set the data to be a pointer to a triangles<br>
-- the member verts will not be released when this PolygonInfo destructs<br>
-- as the verts memory are managed by other objects<br>
-- param triangles a pointer to the TrianglesCommand::Triangles object
-- @function [parent=#PolygonInfo] setTriangles
-- @param self
-- @param #cc.TrianglesCommand::Triangles triangles
-- @return PolygonInfo#PolygonInfo self (return value: cc.PolygonInfo)
--------------------------------
-- / @name Creators/ @{<br>
-- Creates an empty Polygon info<br>

View File

@ -0,0 +1,28 @@
--------------------------------
-- @module RichElementNewLine
-- @extend RichElement
-- @parent_module ccui
--------------------------------
-- brief Create a RichElementNewLine with various arguments.<br>
-- param tag A integer tag value.<br>
-- param color A color in Color3B.<br>
-- param opacity A opacity in GLubyte.<br>
-- return A RichElementNewLine instance.
-- @function [parent=#RichElementNewLine] create
-- @param self
-- @param #int tag
-- @param #color3b_table color
-- @param #unsigned char opacity
-- @return RichElementNewLine#RichElementNewLine ret (return value: ccui.RichElementNewLine)
--------------------------------
-- brief Default constructor.<br>
-- js ctor<br>
-- lua new
-- @function [parent=#RichElementNewLine] RichElementNewLine
-- @param self
-- @return RichElementNewLine#RichElementNewLine self (return value: ccui.RichElementNewLine)
return nil

View File

@ -128,6 +128,16 @@
-- @param #float topInset
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
-- Set the slice sprite rendering type.<br>
-- When setting to SIMPLE, only 4 vertexes is used to rendering.<br>
-- otherwise 16 vertexes will be used to rendering.<br>
-- see RenderingType
-- @function [parent=#Scale9Sprite] setRenderingType
-- @param self
-- @param #int type
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
-- @overload self, cc.Sprite, rect_table, rect_table
-- @overload self, cc.Sprite, rect_table, bool, rect_table
@ -191,6 +201,18 @@
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#Scale9Sprite] resetRender
-- @param self
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
-- Return the slice sprite rendering type.
-- @function [parent=#Scale9Sprite] getRenderingType
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- brief Query the right sprite's cap inset.<br>
-- return The right sprite's cap inset.
@ -344,6 +366,14 @@
-- @param #float scaleX
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
--
-- @function [parent=#Scale9Sprite] setCameraMask
-- @param self
-- @param #unsigned short mask
-- @param #bool applyChildren
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
--
-- @function [parent=#Scale9Sprite] getScaleY
@ -356,25 +386,6 @@
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
--
-- @function [parent=#Scale9Sprite] updateDisplayedOpacity
-- @param self
-- @param #unsigned char parentOpacity
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
--
-- @function [parent=#Scale9Sprite] init
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#Scale9Sprite] cleanup
-- @param self
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
-- @overload self, float, float
-- @overload self, float
@ -386,12 +397,17 @@
--------------------------------
--
-- @function [parent=#Scale9Sprite] setCameraMask
-- @function [parent=#Scale9Sprite] updateDisplayedOpacity
-- @param self
-- @param #unsigned short mask
-- @param #bool applyChildren
-- @param #unsigned char parentOpacity
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
--------------------------------
--
-- @function [parent=#Scale9Sprite] init
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#Scale9Sprite] updateDisplayedColor

View File

@ -4,15 +4,6 @@
-- @extend Widget
-- @parent_module ccui
--------------------------------
-- Set a large value could give more control to the precision.<br>
-- since v3.7<br>
-- param percent The max percent of Slider.
-- @function [parent=#Slider] setMaxPercent
-- @param self
-- @param #int percent
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Changes the progress direction of slider.<br>
-- param percent Percent value from 1 to 100.
@ -21,16 +12,6 @@
-- @param #int percent
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Load disabled state texture for slider ball.<br>
-- param disabled Disabled state texture.<br>
-- param resType @see TextureResType .
-- @function [parent=#Slider] loadSlidBallTextureDisabled
-- @param self
-- @param #string disabled
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Query the maximum percent of Slider. The default value is 100.<br>
-- since v3.7<br>
@ -49,16 +30,6 @@
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Load texture for slider bar.<br>
-- param fileName File name of texture.<br>
-- param resType @see TextureResType .
-- @function [parent=#Slider] loadBarTexture
-- @param self
-- @param #string fileName
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Load dark state texture for slider progress bar.<br>
-- param fileName File path of texture.<br>
@ -69,6 +40,41 @@
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
--
-- @function [parent=#Slider] getBallNormalFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Gets capinsets for progress bar slider, if slider is using scale9 renderer.<br>
-- return Capinsets for progress bar slider.<br>
-- js NA
-- @function [parent=#Slider] getCapInsetsProgressBarRebderer
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
-- Sets if slider is using scale9 renderer.<br>
-- param able True that using scale9 renderer, false otherwise.
-- @function [parent=#Slider] setScale9Enabled
-- @param self
-- @param #bool able
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
--
-- @function [parent=#Slider] getBallPressedFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- brief Return a zoom scale<br>
-- since v3.3
-- @function [parent=#Slider] getZoomScale
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Load textures for slider ball.<br>
-- param normal Normal state texture.<br>
@ -83,6 +89,69 @@
-- @param #int texType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Add call back function called when slider's percent has changed to slider.<br>
-- param callback An given call back function called when slider's percent has changed to slider.
-- @function [parent=#Slider] addEventListener
-- @param self
-- @param #function callback
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Set a large value could give more control to the precision.<br>
-- since v3.7<br>
-- param percent The max percent of Slider.
-- @function [parent=#Slider] setMaxPercent
-- @param self
-- @param #int percent
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Load texture for slider bar.<br>
-- param fileName File name of texture.<br>
-- param resType @see TextureResType .
-- @function [parent=#Slider] loadBarTexture
-- @param self
-- @param #string fileName
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
--
-- @function [parent=#Slider] getProgressBarFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Gets capinsets for bar slider, if slider is using scale9 renderer.<br>
-- return capInsets Capinsets for bar slider.
-- @function [parent=#Slider] getCapInsetsBarRenderer
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
-- Load pressed state texture for slider ball.<br>
-- param pressed Pressed state texture.<br>
-- param resType @see TextureResType .
-- @function [parent=#Slider] loadSlidBallTexturePressed
-- @param self
-- @param #string pressed
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
--
-- @function [parent=#Slider] getBackFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Gets If slider is using scale9 renderer.<br>
-- return True that using scale9 renderer, false otherwise.
-- @function [parent=#Slider] isScale9Enabled
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Sets capinsets for progress bar slider, if slider is using scale9 renderer.<br>
-- param capInsets Capinsets for progress bar slider.<br>
@ -101,29 +170,17 @@
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Gets capinsets for progress bar slider, if slider is using scale9 renderer.<br>
-- return Capinsets for progress bar slider.<br>
-- js NA
-- @function [parent=#Slider] getCapInsetsProgressBarRebderer
--
-- @function [parent=#Slider] getBallDisabeldFile
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Sets if slider is using scale9 renderer.<br>
-- param able True that using scale9 renderer, false otherwise.
-- @function [parent=#Slider] setScale9Enabled
-- Gets the progress direction of slider.<br>
-- return percent Percent value from 1 to 100.
-- @function [parent=#Slider] getPercent
-- @param self
-- @param #bool able
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- When user pressed the button, the button will zoom to a scale.<br>
-- The final scale of the button equals (button original scale + _zoomScale)<br>
-- since v3.3
-- @function [parent=#Slider] setZoomScale
-- @param self
-- @param #float scale
-- @return Slider#Slider self (return value: ccui.Slider)
-- @return int#int ret (return value: int)
--------------------------------
-- Sets capinsets for slider, if slider is using scale9 renderer.<br>
@ -134,50 +191,23 @@
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- brief Return a zoom scale<br>
-- since v3.3
-- @function [parent=#Slider] getZoomScale
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Add call back function called when slider's percent has changed to slider.<br>
-- param callback An given call back function called when slider's percent has changed to slider.
-- @function [parent=#Slider] addEventListener
-- @param self
-- @param #function callback
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Load pressed state texture for slider ball.<br>
-- param pressed Pressed state texture.<br>
-- Load disabled state texture for slider ball.<br>
-- param disabled Disabled state texture.<br>
-- param resType @see TextureResType .
-- @function [parent=#Slider] loadSlidBallTexturePressed
-- @function [parent=#Slider] loadSlidBallTextureDisabled
-- @param self
-- @param #string pressed
-- @param #string disabled
-- @param #int resType
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- Gets If slider is using scale9 renderer.<br>
-- return True that using scale9 renderer, false otherwise.
-- @function [parent=#Slider] isScale9Enabled
-- When user pressed the button, the button will zoom to a scale.<br>
-- The final scale of the button equals (button original scale + _zoomScale)<br>
-- since v3.3
-- @function [parent=#Slider] setZoomScale
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Gets capinsets for bar slider, if slider is using scale9 renderer.<br>
-- return capInsets Capinsets for bar slider.
-- @function [parent=#Slider] getCapInsetsBarRenderer
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
-- Gets the progress direction of slider.<br>
-- return percent Percent value from 1 to 100.
-- @function [parent=#Slider] getPercent
-- @param self
-- @return int#int ret (return value: int)
-- @param #float scale
-- @return Slider#Slider self (return value: ccui.Slider)
--------------------------------
-- @overload self, string, string, int

View File

@ -8,7 +8,7 @@
-- initialize heightMap data
-- @function [parent=#Terrain] initHeightMap
-- @param self
-- @param #char heightMap
-- @param #string heightMap
-- @return bool#bool ret (return value: bool)
--------------------------------
@ -44,7 +44,7 @@
-- reset the heightmap data.
-- @function [parent=#Terrain] resetHeightMap
-- @param self
-- @param #char heightMap
-- @param #string heightMap
-- @return Terrain#Terrain self (return value: cc.Terrain)
--------------------------------

View File

@ -26,6 +26,12 @@
-- @param #string value
-- @return TextAtlas#TextAtlas self (return value: ccui.TextAtlas)
--------------------------------
--
-- @function [parent=#TextAtlas] getRenderFile
-- @param self
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- Initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas.<br>
-- param stringValue A given string needs to be displayed.<br>

View File

@ -4,13 +4,6 @@
-- @extend Widget
-- @parent_module ccui
--------------------------------
-- init a bitmap font atlas with an initial string and the FNT file
-- @function [parent=#TextBMFont] setFntFile
-- @param self
-- @param #string fileName
-- @return TextBMFont#TextBMFont self (return value: ccui.TextBMFont)
--------------------------------
-- Gets the string length of the label.<br>
-- Note: This length will be larger than the raw string length,<br>
@ -20,6 +13,12 @@
-- @param self
-- @return long#long ret (return value: long)
--------------------------------
--
-- @function [parent=#TextBMFont] getString
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
--
-- @function [parent=#TextBMFont] setString
@ -29,9 +28,16 @@
--------------------------------
--
-- @function [parent=#TextBMFont] getString
-- @function [parent=#TextBMFont] getRenderFile
-- @param self
-- @return string#string ret (return value: string)
-- @return ResouceData#ResouceData ret (return value: cc.ResouceData)
--------------------------------
-- init a bitmap font atlas with an initial string and the FNT file
-- @function [parent=#TextBMFont] setFntFile
-- @param self
-- @param #string fileName
-- @return TextBMFont#TextBMFont self (return value: ccui.TextBMFont)
--------------------------------
-- @overload self, string, string

View File

@ -376,13 +376,6 @@
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- Return a current focused widget in your UI scene.<br>
-- No matter what widget object you call this method on , it will return you the exact one focused widget.
-- @function [parent=#Widget] getCurrentFocusedWidget
-- @param self
-- @return Widget#Widget ret (return value: ccui.Widget)
--------------------------------
-- Checks a point is in widget's content space.<br>
-- This function is used for determining touch area of widget.<br>
@ -551,6 +544,13 @@
-- @param #bool enable
-- @return Widget#Widget self (return value: ccui.Widget)
--------------------------------
-- Return a current focused widget in your UI scene.<br>
-- No matter what widget object you call this method on , it will return you the exact one focused widget.
-- @function [parent=#Widget] getCurrentFocusedWidget
-- @param self
-- @return Widget#Widget ret (return value: ccui.Widget)
--------------------------------
-- Create and return a empty Widget instance pointer.
-- @function [parent=#Widget] create

View File

@ -126,6 +126,11 @@
-- @field [parent=#ccui] RichElementCustomNode#RichElementCustomNode RichElementCustomNode preloaded module
--------------------------------------------------------
-- the ccui RichElementNewLine
-- @field [parent=#ccui] RichElementNewLine#RichElementNewLine RichElementNewLine preloaded module
--------------------------------------------------------
-- the ccui RichText
-- @field [parent=#ccui] RichText#RichText RichText preloaded module

View File

@ -4969,9 +4969,9 @@ int lua_cocos2dx_3d_Terrain_initHeightMap(lua_State* tolua_S)
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
const char* arg0;
std::string arg0;
std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.Terrain:initHeightMap"); arg0 = arg0_tmp.c_str();
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Terrain:initHeightMap");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Terrain_initHeightMap'", nullptr);
@ -5220,9 +5220,9 @@ int lua_cocos2dx_3d_Terrain_resetHeightMap(lua_State* tolua_S)
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
const char* arg0;
std::string arg0;
std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.Terrain:resetHeightMap"); arg0 = arg0_tmp.c_str();
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Terrain:resetHeightMap");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Terrain_resetHeightMap'", nullptr);

View File

@ -20395,6 +20395,57 @@ int lua_cocos2dx_PolygonInfo_setQuad(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_PolygonInfo_setTriangles(lua_State* tolua_S)
{
int argc = 0;
cocos2d::PolygonInfo* 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.PolygonInfo",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::PolygonInfo*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_PolygonInfo_setTriangles'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::TrianglesCommand::Triangles arg0;
#pragma warning NO CONVERSION TO NATIVE FOR Triangles
ok = false;
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_PolygonInfo_setTriangles'", nullptr);
return 0;
}
cobj->setTriangles(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:setTriangles",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_setTriangles'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_PolygonInfo_constructor(lua_State* tolua_S)
{
int argc = 0;
@ -20447,6 +20498,7 @@ int lua_register_cocos2dx_PolygonInfo(lua_State* tolua_S)
tolua_function(tolua_S,"getTriaglesCount",lua_cocos2dx_PolygonInfo_getTriaglesCount);
tolua_function(tolua_S,"getVertCount",lua_cocos2dx_PolygonInfo_getVertCount);
tolua_function(tolua_S,"setQuad",lua_cocos2dx_PolygonInfo_setQuad);
tolua_function(tolua_S,"setTriangles",lua_cocos2dx_PolygonInfo_setTriangles);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::PolygonInfo).name();
g_luaType[typeName] = "cc.PolygonInfo";
@ -87288,56 +87340,6 @@ int lua_register_cocos2dx_Device(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_Application_openURL(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Application:openURL");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
bool ret = cobj->openURL(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:openURL",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_openURL'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)
{
int argc = 0;
@ -87479,6 +87481,103 @@ int lua_cocos2dx_Application_getCurrentLanguageCode(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Application_openURL(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Application:openURL");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
bool ret = cobj->openURL(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:openURL",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_openURL'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_getVersion(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_getVersion'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_getVersion'", nullptr);
return 0;
}
std::string ret = cobj->getVersion();
tolua_pushcppstring(tolua_S,ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:getVersion",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_getVersion'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S)
{
int argc = 0;
@ -87575,10 +87674,11 @@ int lua_register_cocos2dx_Application(lua_State* tolua_S)
tolua_cclass(tolua_S,"Application","cc.Application","",nullptr);
tolua_beginmodule(tolua_S,"Application");
tolua_function(tolua_S,"openURL",lua_cocos2dx_Application_openURL);
tolua_function(tolua_S,"getTargetPlatform",lua_cocos2dx_Application_getTargetPlatform);
tolua_function(tolua_S,"getCurrentLanguage",lua_cocos2dx_Application_getCurrentLanguage);
tolua_function(tolua_S,"getCurrentLanguageCode",lua_cocos2dx_Application_getCurrentLanguageCode);
tolua_function(tolua_S,"openURL",lua_cocos2dx_Application_openURL);
tolua_function(tolua_S,"getVersion",lua_cocos2dx_Application_getVersion);
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Application_setAnimationInterval);
tolua_function(tolua_S,"getInstance", lua_cocos2dx_Application_getInstance);
tolua_endmodule(tolua_S);

View File

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

View File

@ -15800,6 +15800,56 @@ int lua_cocos2dx_extension_PUParticleSystem3D_removeAllListener(lua_State* tolua
return 0;
}
int lua_cocos2dx_extension_PUParticleSystem3D_initSystem(lua_State* tolua_S)
{
int argc = 0;
cocos2d::PUParticleSystem3D* 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.PUParticleSystem3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::PUParticleSystem3D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_PUParticleSystem3D_initSystem'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.PUParticleSystem3D:initSystem");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_PUParticleSystem3D_initSystem'", nullptr);
return 0;
}
bool ret = cobj->initSystem(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PUParticleSystem3D:initSystem",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_PUParticleSystem3D_initSystem'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_PUParticleSystem3D_makeParticleLocal(lua_State* tolua_S)
{
int argc = 0;
@ -16146,6 +16196,7 @@ int lua_register_cocos2dx_extension_PUParticleSystem3D(lua_State* tolua_S)
tolua_function(tolua_S,"getDerivedScale",lua_cocos2dx_extension_PUParticleSystem3D_getDerivedScale);
tolua_function(tolua_S,"setDefaultHeight",lua_cocos2dx_extension_PUParticleSystem3D_setDefaultHeight);
tolua_function(tolua_S,"removeAllListener",lua_cocos2dx_extension_PUParticleSystem3D_removeAllListener);
tolua_function(tolua_S,"initSystem",lua_cocos2dx_extension_PUParticleSystem3D_initSystem);
tolua_function(tolua_S,"makeParticleLocal",lua_cocos2dx_extension_PUParticleSystem3D_makeParticleLocal);
tolua_function(tolua_S,"removerAllObserver",lua_cocos2dx_extension_PUParticleSystem3D_removerAllObserver);
tolua_function(tolua_S,"setDefaultDepth",lua_cocos2dx_extension_PUParticleSystem3D_setDefaultDepth);

View File

@ -341,6 +341,7 @@ int register_all_cocos2dx_extension(lua_State* tolua_S);
#endif // __cocos2dx_extension_h__

File diff suppressed because it is too large Load Diff

View File

@ -608,6 +608,35 @@ int register_all_cocos2dx_ui(lua_State* tolua_S);

View File

@ -319,10 +319,10 @@ void terraindata_to_luaval(lua_State* L,const cocos2d::Terrain::TerrainData& inV
lua_rawset(L, -3);
}
if (nullptr != inValue._alphaMapSrc)
if (!inValue._alphaMapSrc.empty())
{
lua_pushstring(L, "_alphaMapSrc");
lua_pushstring(L, inValue._alphaMapSrc);
lua_pushstring(L, inValue._alphaMapSrc.c_str());
lua_rawset(L, -3);
}

View File

@ -18,6 +18,7 @@ CocosGUI.cpp \
UIHelper.cpp \
UIListView.cpp \
UIPageView.cpp \
UIPageViewIndicator.cpp \
UIScrollView.cpp \
UIScrollViewBar.cpp \
UIButton.cpp \

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