mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3
This commit is contained in:
commit
f38c8852fc
5
AUTHORS
5
AUTHORS
|
@ -1,6 +1,6 @@
|
|||
cocos2d-x authors & contributors
|
||||
|
||||
(ordered by the join in time)
|
||||
(ordered by join time)
|
||||
|
||||
Core Developers:
|
||||
Ricardo Quesada
|
||||
|
@ -69,6 +69,9 @@ Developers:
|
|||
silverscania
|
||||
Pass correct parameter to glPixelStorei when creating a texture
|
||||
|
||||
stari4ek
|
||||
Fix VideoPlayer on Android ignore search paths
|
||||
|
||||
FlagellumDei
|
||||
Center the window correctly on windows
|
||||
|
||||
|
|
13
CHANGELOG
13
CHANGELOG
|
@ -3,7 +3,6 @@ cocos2d-x-3.7 ??
|
|||
[NEW] 3rd: updated rapidjson to v1.0.2
|
||||
[NEW] 3d: added physics3d support
|
||||
[NEW] console: support build & run Android Studio project
|
||||
[NEW] Audio: added support on WP8.1, now it supports wav format
|
||||
[NEW] C++: added ActionFloat
|
||||
[NEW] C++: supported physical keyboard on WinRT
|
||||
[NEW] C++: added Android Studio support
|
||||
|
@ -16,15 +15,22 @@ cocos2d-x-3.7 ??
|
|||
[NEW] 3d: add opengl version project/unproject function in camera.
|
||||
[NEW] ui: button add BMFont title support
|
||||
[NEW] ui: TextField add `getTextColor`, `getTextHorizontalAlignment` and `getTextVerticalAlignment` API
|
||||
[NEW] audio: added support on WP8.1, now it supports wav format
|
||||
[NEW] audio: Added MP3 support to winrt audio
|
||||
[NEW] audio: Added OGG support to winrt audio
|
||||
[NEW] win10: Added Windows 10.0 Universal App(UWP) support.
|
||||
|
||||
[FIX] Label: Improve rendering of letter's inner shapes when outline is used.
|
||||
[FIX] network: Win32 CURL doesn't support zlib.
|
||||
[FIX] studio: Fix ActionNode memory leaks.
|
||||
[FIX] studio: Fix CocoLoader destructor memory release bug.
|
||||
[FIX] network: Fix memory leak of HttpClient on iOS and Mac platform.
|
||||
[FIX] android++: Improve UserDefault's robustness, now the converting behavior is the same as iOS platform.
|
||||
[FIX] android: Improve UserDefault's robustness, now the converting behavior is the same as iOS platform.
|
||||
[FIX] android: Fix VideoPlayer on Android ignore search paths.
|
||||
[FIX] audio: Fixed program may freeze if `AudioEngine::stop` or `AudioEngine::stopAll()` is invoked frequently on Android
|
||||
[FIX] audio: Fixed audio can't resume if it is interrupted by an incoming phone call.
|
||||
[FIX] audio: Fixed SimpleAudioEngine::playEffect() lagged on Android 5.0.x
|
||||
[FIX] ui: TextField scale factor is wrong with multiline text.
|
||||
[FIX] ui: Text scale factor is wrong with multiline text.
|
||||
[FIX] 3d: skybox can't move to other position except origin point in world space
|
||||
[FIX] 3d: terrain can't move to other position except origin point in world space
|
||||
[FIX] 3rd: fix PIE link error on iOS caused by libpng and libtiff
|
||||
|
@ -35,6 +41,7 @@ cocos2d-x-3.7 ??
|
|||
[FIX] Label: position is wrong if label content is changed after invoking `getLetter(letterIndex)`
|
||||
[FIX] Label: shadow effect cause OpenGL error on iOS
|
||||
[FIX] Label: outline effect doesn't match characters well
|
||||
[FIX] Label: Fixed system font label line height calculation is wrong on Android.
|
||||
[FIX] ProgressTimer: `setSprite()` doesn't take effect
|
||||
[FIX] Sprite3D: setGLProgram() does not work
|
||||
[FIX] Sprite3D: transition breaks when there is a Sprite3D in the scene
|
||||
|
|
|
@ -25,9 +25,9 @@ cocos2d-x is:
|
|||
Git user attention
|
||||
-----------------------
|
||||
|
||||
1. clone the repo from GitHub.
|
||||
1. Clone the repo from GitHub.
|
||||
|
||||
$ git clone git@github.com:cocos2d/cocos2d-x.git
|
||||
$ git clone https://github.com/cocos2d/cocos2d-x.git
|
||||
|
||||
2. After cloning the repo, please execute `download-deps.py` to download and install dependencies.
|
||||
|
||||
|
|
|
@ -2106,7 +2106,7 @@ TintBy* TintBy::clone() const
|
|||
{
|
||||
// no copy constructor
|
||||
auto a = new (std::nothrow) TintBy();
|
||||
a->initWithDuration(_duration, (GLubyte)_deltaR, (GLubyte)_deltaG, (GLubyte)_deltaB);
|
||||
a->initWithDuration(_duration, _deltaR, _deltaG, _deltaB);
|
||||
a->autorelease();
|
||||
return a;
|
||||
}
|
||||
|
|
|
@ -74,8 +74,7 @@ void Component::onEnter()
|
|||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
if (sendComponentEventToJS(this, kComponentOnEnter))
|
||||
return;
|
||||
sendComponentEventToJS(this, kComponentOnEnter);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -85,8 +84,27 @@ void Component::onExit()
|
|||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
if (sendComponentEventToJS(this, kComponentOnExit))
|
||||
return;
|
||||
sendComponentEventToJS(this, kComponentOnExit);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Component::onAdd()
|
||||
{
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
sendComponentEventToJS(this, kComponentOnAdd);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Component::onRemove()
|
||||
{
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
sendComponentEventToJS(this, kComponentOnRemove);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -96,8 +114,7 @@ void Component::update(float delta)
|
|||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
if (sendComponentEventToJS(this, kComponentOnUpdate))
|
||||
return;
|
||||
sendComponentEventToJS(this, kComponentOnUpdate);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ class Node;
|
|||
enum {
|
||||
kComponentOnEnter,
|
||||
kComponentOnExit,
|
||||
kComponentOnAdd,
|
||||
kComponentOnRemove,
|
||||
kComponentOnUpdate
|
||||
};
|
||||
|
||||
|
@ -58,6 +60,8 @@ public:
|
|||
|
||||
virtual void onEnter();
|
||||
virtual void onExit();
|
||||
virtual void onAdd();
|
||||
virtual void onRemove();
|
||||
virtual void update(float delta);
|
||||
virtual bool serialize(void* r);
|
||||
virtual bool isEnabled() const;
|
||||
|
|
|
@ -68,7 +68,7 @@ bool ComponentContainer::add(Component *com)
|
|||
CC_BREAK_IF(component);
|
||||
com->setOwner(_owner);
|
||||
_components->insert(com->getName(), com);
|
||||
com->onEnter();
|
||||
com->onAdd();
|
||||
ret = true;
|
||||
} while(0);
|
||||
return ret;
|
||||
|
@ -85,7 +85,7 @@ bool ComponentContainer::remove(const std::string& name)
|
|||
CC_BREAK_IF(iter == _components->end());
|
||||
|
||||
auto com = iter->second;
|
||||
com->onExit();
|
||||
com->onRemove();
|
||||
com->setOwner(nullptr);
|
||||
|
||||
_components->erase(iter);
|
||||
|
@ -105,7 +105,7 @@ bool ComponentContainer::remove(Component *com)
|
|||
{
|
||||
if (iter->second == com)
|
||||
{
|
||||
com->onExit();
|
||||
com->onRemove();
|
||||
com->setOwner(nullptr);
|
||||
_components->erase(iter);
|
||||
break;
|
||||
|
@ -122,7 +122,7 @@ void ComponentContainer::removeAll()
|
|||
{
|
||||
for (auto iter = _components->begin(); iter != _components->end(); ++iter)
|
||||
{
|
||||
iter->second->onExit();
|
||||
iter->second->onRemove();
|
||||
iter->second->setOwner(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -710,14 +710,6 @@ const Vec2& Node::getAnchorPoint() const
|
|||
|
||||
void Node::setAnchorPoint(const Vec2& point)
|
||||
{
|
||||
#if CC_USE_PHYSICS
|
||||
if (_physicsBody != nullptr && !point.equals(Vec2::ANCHOR_MIDDLE))
|
||||
{
|
||||
CCLOG("Node warning: This node has a physics body, the anchor must be in the middle, you cann't change this to other value.");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! point.equals(_anchorPoint))
|
||||
{
|
||||
_anchorPoint = point;
|
||||
|
@ -1419,6 +1411,11 @@ void Node::onEnter()
|
|||
if (_onEnterCallback)
|
||||
_onEnterCallback();
|
||||
|
||||
if (_componentContainer && !_componentContainer->isEmpty())
|
||||
{
|
||||
_componentContainer->onEnter();
|
||||
}
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
@ -1498,6 +1495,11 @@ void Node::onExit()
|
|||
if (_onExitCallback)
|
||||
_onExitCallback();
|
||||
|
||||
if (_componentContainer && !_componentContainer->isEmpty())
|
||||
{
|
||||
_componentContainer->onExit();
|
||||
}
|
||||
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
if (_scriptType == kScriptTypeJavascript)
|
||||
{
|
||||
|
@ -2078,14 +2080,6 @@ void Node::setPhysicsBody(PhysicsBody* body)
|
|||
body->_node = this;
|
||||
body->retain();
|
||||
|
||||
// physics rotation based on body position, but node rotation based on node anthor point
|
||||
// it cann't support both of them, so I clear the anthor point to default.
|
||||
if (!getAnchorPoint().equals(Vec2::ANCHOR_MIDDLE))
|
||||
{
|
||||
CCLOG("Node warning: setPhysicsBody sets anchor point to Vec2::ANCHOR_MIDDLE.");
|
||||
setAnchorPoint(Vec2::ANCHOR_MIDDLE);
|
||||
}
|
||||
|
||||
_physicsBody = body;
|
||||
_physicsScaleStartX = _scaleX;
|
||||
_physicsScaleStartY = _scaleY;
|
||||
|
@ -2123,10 +2117,16 @@ void Node::updatePhysicsBodyTransform(const Mat4& parentTransform, uint32_t pare
|
|||
if (_physicsBody && ((flags & FLAGS_DIRTY_MASK) || _physicsTransformDirty))
|
||||
{
|
||||
_physicsTransformDirty = false;
|
||||
Vec3 vec3(_position.x, _position.y, 0);
|
||||
|
||||
Vec3 vec3(_contentSize.width * 0.5f, _contentSize.height * 0.5f, 0);
|
||||
Vec3 ret;
|
||||
parentTransform.transformPoint(vec3, &ret);
|
||||
_modelViewTransform.transformPoint(vec3, &ret);
|
||||
_physicsBody->setPosition(Vec2(ret.x, ret.y));
|
||||
|
||||
parentTransform.getInversed().transformPoint(&ret);
|
||||
_offsetX = ret.x - _position.x;
|
||||
_offsetY = ret.y - _position.y;
|
||||
|
||||
_physicsBody->setScale(scaleX / _physicsScaleStartX, scaleY / _physicsScaleStartY);
|
||||
_physicsBody->setRotation(_physicsRotation - _physicsRotationOffset);
|
||||
}
|
||||
|
@ -2148,7 +2148,7 @@ void Node::updateTransformFromPhysics(const Mat4& parentTransform, uint32_t pare
|
|||
Vec3 vec3(newPosition.x, newPosition.y, 0);
|
||||
Vec3 ret;
|
||||
parentTransform.getInversed().transformPoint(vec3, &ret);
|
||||
setPosition(ret.x, ret.y);
|
||||
setPosition(ret.x - _offsetX, ret.y - _offsetY);
|
||||
}
|
||||
_physicsRotation = _physicsBody->getRotation();
|
||||
setRotation(_physicsRotation - _parent->_physicsRotation + _physicsRotationOffset);
|
||||
|
|
|
@ -1844,6 +1844,9 @@ protected:
|
|||
PhysicsWorld* _physicsWorld; /** The PhysicsWorld associated with the node.*/
|
||||
int _physicsBodyAssociatedWith; /** The count of PhysicsBody associated with the node and children.*/
|
||||
float _physicsRotationOffset; /** Record the rotation value when invoke Node::setPhysicsBody.*/
|
||||
|
||||
float _offsetX;
|
||||
float _offsetY;
|
||||
#endif
|
||||
|
||||
// opacity controls
|
||||
|
|
|
@ -215,13 +215,17 @@ void Scene::setPhysics3DDebugCamera(Camera* camera)
|
|||
void Scene::addChild(Node* child, int zOrder, int tag)
|
||||
{
|
||||
Node::addChild(child, zOrder, tag);
|
||||
#if CC_USE_PHYSICS
|
||||
addChildToPhysicsWorld(child);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Scene::addChild(Node* child, int zOrder, const std::string &name)
|
||||
{
|
||||
Node::addChild(child, zOrder, name);
|
||||
#if CC_USE_PHYSICS
|
||||
addChildToPhysicsWorld(child);
|
||||
#endif
|
||||
}
|
||||
|
||||
Scene* Scene::createWithPhysics()
|
||||
|
@ -254,8 +258,6 @@ bool Scene::initWithPhysics()
|
|||
|
||||
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
|
||||
Physics3DWorldDes info;
|
||||
//TODO: FIX ME
|
||||
//info.isDebugDrawEnabled = true;
|
||||
CC_BREAK_IF(! (_physics3DWorld = Physics3DWorld::create(&info)));
|
||||
_physics3DWorld->retain();
|
||||
#endif
|
||||
|
@ -290,29 +292,6 @@ void Scene::addChildToPhysicsWorld(Node* child)
|
|||
addToPhysicsWorldFunc(child);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CC_USE_3D_PHYSICS && CC_ENABLE_BULLET_INTEGRATION
|
||||
if (_physics3DWorld)
|
||||
{
|
||||
std::function<void(Node*)> addToPhysicsWorldFunc = nullptr;
|
||||
addToPhysicsWorldFunc = [this, &addToPhysicsWorldFunc](Node* node) -> void
|
||||
{
|
||||
static std::string comName = Physics3DComponent::getPhysics3DComponentName();
|
||||
auto com = static_cast<Physics3DComponent*>(node->getComponent(comName));
|
||||
if (com)
|
||||
{
|
||||
com->addToPhysicsWorld(_physics3DWorld);
|
||||
}
|
||||
|
||||
auto& children = node->getChildren();
|
||||
for( const auto &n : children) {
|
||||
addToPhysicsWorldFunc(n);
|
||||
}
|
||||
};
|
||||
|
||||
addToPhysicsWorldFunc(child);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -180,7 +180,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -221,7 +221,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\OggDecoder\include;$(EngineRoot)external\winrt_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\winrt_8.1\freetype2;$(EngineRoot)external\websockets\include\winrt_8.1;$(EngineRoot)external\curl\include\winrt_8.1;$(EngineRoot)external\tiff\include\winrt_8.1;$(EngineRoot)external\jpeg\include\winrt_8.1;$(EngineRoot)external\png\include\winrt_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\OggDecoder\include;$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\OggDecoder\include;$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -154,7 +154,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\OggDecoder\include;$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
@ -175,7 +175,7 @@
|
|||
<CompileAsWinRT>true</CompileAsWinRT>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\wp_8.1-specific\OggDecoder\include;$(EngineRoot)external\wp_8.1-specific\zlib\include;$(EngineRoot)external\freetype2\include\wp_8.1\freetype2;$(EngineRoot)external\websockets\include\wp_8.1;$(EngineRoot)external\curl\include\wp_8.1;$(EngineRoot)external\tiff\include\wp_8.1;$(EngineRoot)external\jpeg\include\wp_8.1;$(EngineRoot)external\png\include\wp_8.1;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CC_WINDOWS_PHONE_8_1;_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
|
|
@ -1506,7 +1506,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
|
@ -1524,7 +1524,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
|
@ -1543,7 +1543,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
|
@ -1561,7 +1561,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
|
@ -1581,7 +1581,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
|
@ -1599,7 +1599,7 @@
|
|||
<PreprocessorDefinitions>_USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<DisableSpecificWarnings>4458;4459;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\win10-specific\OggDecoder\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/Zm384 /bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<DisableSpecificWarnings>4056;4244;4251;4756;4453;28204;4099;</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libogg.lib;libvorbis.lib;libvorbisfile.lib;libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\OggDecoder\prebuilt\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<ZLibBinPath Condition=" '$(ZLibBinPath)' == '' ">$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform)\</ZLibBinPath>
|
||||
<WebsocketsBinPath Condition=" '$(WebsocketsBinPath)' == '' ">$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</WebsocketsBinPath>
|
||||
<SQLiteBinPath Condition=" '$(SQLiteBinPath)' == '' ">$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform)\</SQLiteBinPath>
|
||||
<OggBinPath Condition=" '$(OggBinPath)' == '' ">$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\OggDecoder\prebuilt\$(Platform)\</OggBinPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ANGLE">
|
||||
<None Include="$(AngleBinPath)libEGL.dll">
|
||||
|
@ -23,5 +24,14 @@
|
|||
<None Include="$(SQLiteBinPath)sqlite3.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libogg.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libvorbis.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libvorbisfile.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -18,8 +18,8 @@
|
|||
<DisableSpecificWarnings>4056;4244;4251;4756;4453;28204;4099;</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libogg.lib;libvorbis.lib;libvorbisfile.lib;libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\OggDecoder\prebuilt\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<CurlBinPath Condition=" '$(CurlBinPath)' == '' ">$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</CurlBinPath>
|
||||
<WebsocketsBinPath Condition=" '$(WebsocketsBinPath)' == '' ">$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</WebsocketsBinPath>
|
||||
<SQLiteBinPath Condition=" '$(SQLiteBinPath)' == '' ">$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform)\</SQLiteBinPath>
|
||||
<OggBinPath Condition=" '$(OggBinPath)' == '' ">$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\OggDecoder\prebuilt\$(Platform)\</OggBinPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ANGLE">
|
||||
<None Include="$(AngleBinPath)libEGL.dll">
|
||||
|
@ -29,5 +30,14 @@
|
|||
<None Include="$(CurlBinPath)ssleay32.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libogg.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libvorbis.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="$(OggBinPath)libvorbisfile.dll">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -283,6 +283,9 @@ void Mesh::setTexture(Texture2D* tex)
|
|||
auto technique = _material->_currentTechnique;
|
||||
for(auto& pass: technique->_passes)
|
||||
{
|
||||
// FIXME: Ideally it should use glProgramState->setUniformTexture()
|
||||
// and set CC_Texture0 that way. But trying to it, will trigger
|
||||
// another bug
|
||||
pass->setTexture(tex);
|
||||
}
|
||||
}
|
||||
|
@ -350,6 +353,7 @@ void Mesh::draw(Renderer* renderer, float globalZOrder, const Mat4& transform, u
|
|||
|
||||
|
||||
_meshCommand.setSkipBatching(isTransparent);
|
||||
_meshCommand.setTransparent(isTransparent);
|
||||
|
||||
// set default uniforms for Mesh
|
||||
// 'u_color' and others
|
||||
|
|
|
@ -606,8 +606,8 @@ void Sprite3D::setTexture(const std::string& texFile)
|
|||
|
||||
void Sprite3D::setTexture(Texture2D* texture)
|
||||
{
|
||||
for (auto& state : _meshes) {
|
||||
state->setTexture(texture);
|
||||
for (auto mesh: _meshes) {
|
||||
mesh->setTexture(texture);
|
||||
}
|
||||
}
|
||||
AttachNode* Sprite3D::getAttachNode(const std::string& boneName)
|
||||
|
|
|
@ -278,7 +278,7 @@ void Terrain::setChunksLOD(Vec3 cameraPos)
|
|||
}
|
||||
}
|
||||
|
||||
float Terrain::getHeight(float x, float z, Vec3 * normal)
|
||||
float Terrain::getHeight(float x, float z, Vec3 * normal) const
|
||||
{
|
||||
Vec2 pos(x,z);
|
||||
|
||||
|
@ -307,6 +307,10 @@ float Terrain::getHeight(float x, float z, Vec3 * normal)
|
|||
|
||||
if(image_x>=_imageWidth-1 || image_y >=_imageHeight-1 || image_x<0 || image_y<0)
|
||||
{
|
||||
if (normal)
|
||||
{
|
||||
normal->setZero();
|
||||
}
|
||||
return 0;
|
||||
}else
|
||||
{
|
||||
|
@ -327,12 +331,12 @@ float Terrain::getHeight(float x, float z, Vec3 * normal)
|
|||
}
|
||||
}
|
||||
|
||||
float Terrain::getHeight(Vec2 pos, Vec3*Normal)
|
||||
float Terrain::getHeight(Vec2 pos, Vec3*Normal) const
|
||||
{
|
||||
return getHeight(pos.x,pos.y,Normal);
|
||||
}
|
||||
|
||||
float Terrain::getImageHeight(int pixel_x,int pixel_y)
|
||||
float Terrain::getImageHeight(int pixel_x,int pixel_y) const
|
||||
{
|
||||
int byte_stride =1;
|
||||
switch (_heightMapImage->getRenderFormat())
|
||||
|
@ -472,7 +476,7 @@ Terrain::~Terrain()
|
|||
#endif
|
||||
}
|
||||
|
||||
cocos2d::Vec3 Terrain::getNormal(int pixel_x, int pixel_y)
|
||||
cocos2d::Vec3 Terrain::getNormal(int pixel_x, int pixel_y) const
|
||||
{
|
||||
float a = getImageHeight(pixel_x,pixel_y)*getScaleY();
|
||||
float b = getImageHeight(pixel_x,pixel_y+1)*getScaleY();
|
||||
|
@ -486,7 +490,7 @@ cocos2d::Vec3 Terrain::getNormal(int pixel_x, int pixel_y)
|
|||
return normal;
|
||||
}
|
||||
|
||||
cocos2d::Vec3 Terrain::getIntersectionPoint(const Ray & ray)
|
||||
cocos2d::Vec3 Terrain::getIntersectionPoint(const Ray & ray) const
|
||||
{
|
||||
Vec3 dir = ray._direction;
|
||||
dir.normalize();
|
||||
|
@ -496,12 +500,14 @@ cocos2d::Vec3 Terrain::getIntersectionPoint(const Ray & ray)
|
|||
Vec3 lastRayPosition =rayPos;
|
||||
rayPos += rayStep;
|
||||
// Linear search - Loop until find a point inside and outside the terrain Vector3
|
||||
float height = getHeight(rayPos.x,rayPos.z);
|
||||
|
||||
Vec3 normal;
|
||||
float height = getHeight(rayPos.x, rayPos.z, &normal);
|
||||
while (rayPos.y > height)
|
||||
{
|
||||
lastRayPosition = rayPos;
|
||||
rayPos += rayStep;
|
||||
if (normal.isZero())
|
||||
return Vec3(0, 0, 0);
|
||||
height = getHeight(rayPos.x,rayPos.z);
|
||||
}
|
||||
|
||||
|
@ -521,6 +527,47 @@ cocos2d::Vec3 Terrain::getIntersectionPoint(const Ray & ray)
|
|||
return collisionPoint;
|
||||
}
|
||||
|
||||
bool Terrain::getIntersectionPoint(const Ray & ray, Vec3 & intersectionPoint) const
|
||||
{
|
||||
Vec3 dir = ray._direction;
|
||||
dir.normalize();
|
||||
Vec3 rayStep = _terrainData._chunkSize.width*0.25*dir;
|
||||
Vec3 rayPos = ray._origin;
|
||||
Vec3 rayStartPosition = ray._origin;
|
||||
Vec3 lastRayPosition = rayPos;
|
||||
rayPos += rayStep;
|
||||
// Linear search - Loop until find a point inside and outside the terrain Vector3
|
||||
Vec3 normal;
|
||||
float height = getHeight(rayPos.x, rayPos.z, &normal);
|
||||
while (rayPos.y > height)
|
||||
{
|
||||
lastRayPosition = rayPos;
|
||||
rayPos += rayStep;
|
||||
if (normal.isZero())
|
||||
{
|
||||
intersectionPoint = Vec3(0, 0, 0);
|
||||
return false;
|
||||
}
|
||||
height = getHeight(rayPos.x, rayPos.z);
|
||||
}
|
||||
|
||||
Vec3 startPosition = lastRayPosition;
|
||||
Vec3 endPosition = rayPos;
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
// Binary search pass
|
||||
Vec3 middlePoint = (startPosition + endPosition) * 0.5f;
|
||||
if (middlePoint.y < height)
|
||||
endPosition = middlePoint;
|
||||
else
|
||||
startPosition = middlePoint;
|
||||
}
|
||||
Vec3 collisionPoint = (startPosition + endPosition) * 0.5f;
|
||||
intersectionPoint = collisionPoint;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Terrain::setMaxDetailMapAmount(int max_value)
|
||||
{
|
||||
_maxDetailMapValue = max_value;
|
||||
|
|
|
@ -302,22 +302,22 @@ public:
|
|||
* @param normal the specified position's normal vector in terrain . if this argument is NULL or nullptr,Normal calculation shall be skip.
|
||||
* @return the height value of the specified position of the terrain, if the (X,Z) position is out of the terrain bounds,it shall return 0;
|
||||
**/
|
||||
float getHeight(float x, float z, Vec3 * normal= nullptr);
|
||||
float getHeight(float x, float z, Vec3 * normal= nullptr) const;
|
||||
|
||||
/**get specified position's height mapping to the terrain,use bi-linear interpolation method
|
||||
* @param pos the position (X,Z)
|
||||
* @param normal the specified position's normal vector in terrain . if this argument is NULL or nullptr,Normal calculation shall be skip.
|
||||
* @return the height value of the specified position of the terrain, if the (X,Z) position is out of the terrain bounds,it shall return 0;
|
||||
**/
|
||||
float getHeight(Vec2 pos, Vec3*Normal = nullptr);
|
||||
float getHeight(Vec2 pos, Vec3*Normal = nullptr) const;
|
||||
|
||||
/**get the normal of the specified pistion in terrain
|
||||
* @return the normal vector of the specified position of the terrain.
|
||||
* @note the fast normal calculation may not get precise normal vector.
|
||||
**/
|
||||
Vec3 getNormal(int pixelX, int pixelY);
|
||||
Vec3 getNormal(int pixelX, int pixelY) const;
|
||||
/**get height from the raw height filed*/
|
||||
float getImageHeight(int pixelX, int pixelY);
|
||||
float getImageHeight(int pixelX, int pixelY) const;
|
||||
/**show the wireline instead of the surface,Debug Use only.
|
||||
* @Note only support desktop platform
|
||||
**/
|
||||
|
@ -344,7 +344,15 @@ public:
|
|||
* Ray-Terrain intersection.
|
||||
* @return the intersection point
|
||||
*/
|
||||
Vec3 getIntersectionPoint(const Ray & ray);
|
||||
Vec3 getIntersectionPoint(const Ray & ray) const;
|
||||
|
||||
/**
|
||||
* Ray-Terrain intersection.
|
||||
* @param ray to hit the terrain
|
||||
* @param intersectionPoint hit point if hitted
|
||||
* @return true if hit, false otherwise
|
||||
*/
|
||||
bool getIntersectionPoint(const Ray & ray, Vec3 & intersectionPoint) const;
|
||||
|
||||
/**
|
||||
* set the MaxDetailAmount.
|
||||
|
|
|
@ -37,6 +37,7 @@ inline void ThrowIfFailed(HRESULT hr)
|
|||
// AudioCache
|
||||
AudioCache::AudioCache()
|
||||
: _isReady(false)
|
||||
, _retry(false)
|
||||
, _fileFullPath("")
|
||||
, _srcReader(nullptr)
|
||||
, _fileFormat(FileFormat::UNKNOWN)
|
||||
|
@ -57,6 +58,10 @@ AudioCache::~AudioCache()
|
|||
|
||||
void AudioCache::readDataTask()
|
||||
{
|
||||
if (_isReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::wstring path(_fileFullPath.begin(), _fileFullPath.end());
|
||||
|
||||
if (nullptr != _srcReader) {
|
||||
|
@ -68,31 +73,34 @@ void AudioCache::readDataTask()
|
|||
{
|
||||
case FileFormat::WAV:
|
||||
_srcReader = new (std::nothrow) WAVReader();
|
||||
if (_srcReader && _srcReader->initialize(_fileFullPath)) {
|
||||
_audInfo._totalAudioBytes = _srcReader->getTotalAudioBytes();
|
||||
_audInfo._wfx = _srcReader->getWaveFormatInfo();
|
||||
_isReady = true;
|
||||
invokeCallbacks();
|
||||
}
|
||||
break;
|
||||
|
||||
case FileFormat::OGG:
|
||||
_srcReader = new (std::nothrow) OGGReader();
|
||||
break;
|
||||
|
||||
case FileFormat::MP3:
|
||||
_srcReader = new (std::nothrow) MP3Reader();
|
||||
if (_srcReader && _srcReader->initialize(_fileFullPath)) {
|
||||
_audInfo._totalAudioBytes = _srcReader->getTotalAudioBytes();
|
||||
_audInfo._wfx = _srcReader->getWaveFormatInfo();
|
||||
_isReady = true;
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case FileFormat::UNKNOWN:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (_srcReader && _srcReader->initialize(_fileFullPath)) {
|
||||
_audInfo._totalAudioBytes = _srcReader->getTotalAudioBytes();
|
||||
_audInfo._wfx = _srcReader->getWaveFormatInfo();
|
||||
_isReady = true;
|
||||
_retry = false;
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
if (!_isReady) {
|
||||
_retry = true;
|
||||
log("Failed to read input file: %s.\n", _fileFullPath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void AudioCache::addCallback(const std::function<void()> &callback)
|
||||
|
@ -105,6 +113,10 @@ void AudioCache::addCallback(const std::function<void()> &callback)
|
|||
_callbacks.push_back(callback);
|
||||
}
|
||||
_cbMutex.unlock();
|
||||
|
||||
if (_retry) {
|
||||
readDataTask();
|
||||
}
|
||||
}
|
||||
|
||||
void AudioCache::invokeCallbacks()
|
||||
|
@ -290,6 +302,9 @@ void AudioPlayer::setVolume(float volume)
|
|||
if (FAILED(_xaMasterVoice->SetVolume(volume))) {
|
||||
error();
|
||||
}
|
||||
else {
|
||||
_volume = volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,7 +386,7 @@ bool AudioPlayer::_play(bool resume)
|
|||
|
||||
if (_state == AudioPlayerState::PAUSED && !resume || nullptr == _xaSourceVoice) break;
|
||||
|
||||
if (FAILED(_xaSourceVoice->Start())) {
|
||||
if (FAILED(_xaMasterVoice->SetVolume(_volume)) || FAILED(_xaSourceVoice->Start())) {
|
||||
error();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -65,6 +65,7 @@ private:
|
|||
AudioCache& operator=(const AudioCache&);
|
||||
|
||||
private:
|
||||
bool _retry;
|
||||
bool _isReady;
|
||||
AudioInfo _audInfo;
|
||||
std::mutex _cbMutex;
|
||||
|
|
|
@ -160,7 +160,7 @@ int AudioEngineImpl::play2d(const std::string &filePath, bool loop, float volume
|
|||
}
|
||||
else if (ext.compare(".ogg") == 0){
|
||||
audioCache->_fileFormat = FileFormat::OGG;
|
||||
//eraseCache = false; //TODO add support for OGG
|
||||
eraseCache = false;
|
||||
}
|
||||
else if (ext.compare(".mp3") == 0){
|
||||
audioCache->_fileFormat = FileFormat::MP3;
|
||||
|
@ -168,7 +168,6 @@ int AudioEngineImpl::play2d(const std::string &filePath, bool loop, float volume
|
|||
}
|
||||
else{
|
||||
log("unsupported media type:%s\n", ext.c_str());
|
||||
eraseCache = false;
|
||||
}
|
||||
|
||||
if (eraseCache){
|
||||
|
|
|
@ -53,6 +53,24 @@ void AudioSourceReader::flushChunks()
|
|||
_rwMutex.unlock();
|
||||
}
|
||||
|
||||
void AudioSourceReader::seekTo(const float ratio)
|
||||
{
|
||||
if (_isStreaming) {
|
||||
auto newPos = ratio * _audioSize;
|
||||
|
||||
if (!newPos && !_isDirty && _chnkQ.size()) // already in 0.0 position
|
||||
return;
|
||||
|
||||
_bytesRead = newPos;
|
||||
flushChunks();
|
||||
auto alignment = _wfx.nChannels * _wfx.nBlockAlign;
|
||||
_bytesRead = _bytesRead >= _audioSize ? (_audioSize - alignment) : _bytesRead - (_bytesRead % alignment);
|
||||
|
||||
for (int i = 0; i < QUEUEBUFFER_NUM; i++) {
|
||||
produceChunk();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WAVFileReader
|
||||
WAVReader::WAVReader() :
|
||||
|
@ -78,10 +96,8 @@ bool WAVReader::initialize(const std::string& filePath)
|
|||
|
||||
flushChunks();
|
||||
|
||||
_rwMutex.lock();
|
||||
_streamer = ref new MediaStreamer;
|
||||
_streamer->Initialize(std::wstring(_filePath.begin(), _filePath.end()).c_str(), true);
|
||||
_rwMutex.unlock();
|
||||
_wfx = _streamer->GetOutputWaveFormatEx();
|
||||
UINT32 dataSize = _streamer->GetMaxStreamLengthInBytes();
|
||||
|
||||
|
@ -162,31 +178,7 @@ void WAVReader::produceChunk()
|
|||
|
||||
void WAVReader::seekTo(const float ratio)
|
||||
{
|
||||
if (_isStreaming) {
|
||||
auto newPos = ratio * _audioSize;
|
||||
|
||||
if (!newPos && !_isDirty && _chnkQ.size()) // already in 0.0 position
|
||||
return;
|
||||
|
||||
_bytesRead = newPos;
|
||||
flushChunks();
|
||||
|
||||
switch (_wfx.wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
case WAVE_FORMAT_ADPCM: {
|
||||
auto alignment = _wfx.nChannels * _wfx.nBlockAlign;
|
||||
_bytesRead = _bytesRead >= _audioSize ? (_audioSize - alignment) : _bytesRead - (_bytesRead % alignment);
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < QUEUEBUFFER_NUM; i++) {
|
||||
produceChunk();
|
||||
}
|
||||
}
|
||||
AudioSourceReader::seekTo(ratio);
|
||||
}
|
||||
|
||||
|
||||
|
@ -299,21 +291,7 @@ void MP3Reader::produceChunk()
|
|||
|
||||
void MP3Reader::seekTo(const float ratio)
|
||||
{
|
||||
if (_isStreaming) {
|
||||
auto newPos = ratio * _audioSize;
|
||||
|
||||
if (!newPos && !_isDirty && _chnkQ.size()) // already in 0.0 position
|
||||
return;
|
||||
|
||||
_bytesRead = newPos;
|
||||
flushChunks();
|
||||
auto alignment = _wfx.nChannels * _wfx.nBlockAlign;
|
||||
_bytesRead = _bytesRead >= _audioSize ? (_audioSize - alignment) : _bytesRead - (_bytesRead % alignment);
|
||||
|
||||
for (int i = 0; i < QUEUEBUFFER_NUM; i++) {
|
||||
produceChunk();
|
||||
}
|
||||
}
|
||||
AudioSourceReader::seekTo(ratio);
|
||||
}
|
||||
|
||||
HRESULT MP3Reader::configureSourceReader(IMFSourceReader* pReader, IMFMediaType** ppDecomprsdAudioType)
|
||||
|
@ -520,4 +498,137 @@ Wrappers::FileHandle MP3Reader::openFile(const std::string& path, bool append)
|
|||
return Microsoft::WRL::Wrappers::FileHandle(CreateFile2(std::wstring(path.begin(), path.end()).c_str(), access, FILE_SHARE_READ, creation, &extParams));
|
||||
}
|
||||
|
||||
|
||||
// OGGReader
|
||||
OGGReader::OGGReader()
|
||||
{
|
||||
}
|
||||
|
||||
OGGReader::~OGGReader()
|
||||
{
|
||||
if (_vorbisFd) {
|
||||
ov_clear(_vorbisFd.get());
|
||||
}
|
||||
}
|
||||
|
||||
bool OGGReader::initialize(const std::string& filePath)
|
||||
{
|
||||
bool ret = false;
|
||||
_filePath = filePath;
|
||||
|
||||
do {
|
||||
_vorbisFd = std::make_unique<OggVorbis_File>();
|
||||
if (ov_fopen(FileUtils::getInstance()->getSuitableFOpen(_filePath).c_str(), _vorbisFd.get())){
|
||||
break;
|
||||
}
|
||||
|
||||
auto vi = ov_info(_vorbisFd.get(), -1);
|
||||
|
||||
if (!vi) {
|
||||
break;
|
||||
}
|
||||
|
||||
auto totalFrames = ov_pcm_total(_vorbisFd.get(), -1);
|
||||
auto bytesPerFrame = vi->channels * 2;
|
||||
_audioSize = totalFrames * bytesPerFrame;
|
||||
|
||||
_wfx.wFormatTag = WAVE_FORMAT_PCM;
|
||||
_wfx.nChannels = vi->channels;
|
||||
_wfx.nSamplesPerSec = vi->rate;
|
||||
_wfx.nAvgBytesPerSec = vi->rate * bytesPerFrame;
|
||||
_wfx.nBlockAlign = bytesPerFrame;
|
||||
_wfx.wBitsPerSample = (bytesPerFrame / vi->channels) * 8;
|
||||
_wfx.cbSize = 0;
|
||||
|
||||
if (_audioSize <= PCMDATA_CACHEMAXSIZE) {
|
||||
produceChunk();
|
||||
}
|
||||
else {
|
||||
_isStreaming = true;
|
||||
for (int i = 0; i < QUEUEBUFFER_NUM; i++) {
|
||||
produceChunk();
|
||||
}
|
||||
}
|
||||
|
||||
ret = true;
|
||||
} while (false);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool OGGReader::consumeChunk(AudioDataChunk& chunk)
|
||||
{
|
||||
bool ret = false;
|
||||
_isDirty = true;
|
||||
|
||||
_rwMutex.lock();
|
||||
if (_chnkQ.size() > 0) {
|
||||
chunk = _chnkQ.front();
|
||||
if (_isStreaming) {
|
||||
_chnkQ.pop();
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
_rwMutex.unlock();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void OGGReader::produceChunk()
|
||||
{
|
||||
_rwMutex.lock();
|
||||
int chunkSize = _audioSize;
|
||||
|
||||
do {
|
||||
if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (_isStreaming) {
|
||||
chunkSize = std::min(CHUNK_SIZE_MAX, _audioSize - _bytesRead);
|
||||
}
|
||||
|
||||
if (!chunkSize && !_chnkQ.size()) {
|
||||
auto alignment = _wfx.nChannels * _wfx.nBlockAlign;
|
||||
_bytesRead -= alignment;
|
||||
chunkSize = alignment;
|
||||
}
|
||||
|
||||
if (!chunkSize) {
|
||||
break;
|
||||
}
|
||||
|
||||
int retSize = 0;
|
||||
AudioDataChunk chunk = { 0 };
|
||||
chunk._data = std::make_shared<PCMBuffer>(chunkSize);
|
||||
|
||||
auto newPos = (1.0f * _bytesRead / _audioSize) * ov_time_total(_vorbisFd.get(), -1);
|
||||
if (ov_time_seek(_vorbisFd.get(), newPos)){
|
||||
break;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
long br = 0;
|
||||
int current_section = 0;
|
||||
if ((br = ov_read(_vorbisFd.get(), (char*)chunk._data->data() + retSize, chunkSize - retSize, 0, 2, 1, ¤t_section)) == 0) {
|
||||
break;
|
||||
}
|
||||
retSize += br;
|
||||
} while (retSize < chunkSize);
|
||||
|
||||
_bytesRead += retSize;
|
||||
chunk._dataSize = retSize;
|
||||
chunk._seqNo = ((float)_bytesRead / _audioSize) * ((float)_audioSize / CHUNK_SIZE_MAX);
|
||||
chunk._endOfStream = (_bytesRead >= _audioSize);
|
||||
_chnkQ.push(chunk);
|
||||
} while (false);
|
||||
_rwMutex.unlock();
|
||||
}
|
||||
|
||||
void OGGReader::seekTo(const float ratio)
|
||||
{
|
||||
AudioSourceReader::seekTo(ratio);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include <queue>
|
||||
#include <mutex>
|
||||
#include "MediaStreamer.h"
|
||||
#include "ogg/ogg.h"
|
||||
#include "vorbis/vorbisfile.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
namespace experimental{
|
||||
|
@ -132,6 +134,22 @@ class MP3Reader : public AudioSourceReader
|
|||
std::string _mappedWavFile;
|
||||
};
|
||||
|
||||
class OGGReader : public AudioSourceReader
|
||||
{
|
||||
public:
|
||||
OGGReader();
|
||||
virtual ~OGGReader();
|
||||
|
||||
virtual bool initialize(const std::string& filePath) override;
|
||||
virtual FileFormat getFileFormat() override { return FileFormat::WAV; }
|
||||
virtual bool consumeChunk(AudioDataChunk& chunk) override;
|
||||
virtual void produceChunk() override;
|
||||
virtual void seekTo(const float ratio) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<OggVorbis_File> _vorbisFd;
|
||||
};
|
||||
|
||||
}
|
||||
NS_CC_END
|
||||
#endif // __AUDIO_SOURCE_READER_H_
|
||||
|
|
|
@ -60,6 +60,7 @@ ActionNode::~ActionNode()
|
|||
else
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(_action);
|
||||
CC_SAFE_RELEASE_NULL(_actionSpawn);
|
||||
}
|
||||
|
||||
for (auto object : _frameArray)
|
||||
|
@ -464,6 +465,7 @@ Spawn * ActionNode::refreshActionProperty()
|
|||
else
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(_action);
|
||||
CC_SAFE_RELEASE_NULL(_actionSpawn);
|
||||
}
|
||||
|
||||
_actionSpawn = Spawn::create(cSpawnArray);
|
||||
|
|
|
@ -56,6 +56,16 @@ void ComAudio::onExit()
|
|||
stopAllEffects();
|
||||
}
|
||||
|
||||
void ComAudio::onAdd()
|
||||
{
|
||||
}
|
||||
|
||||
void ComAudio::onRemove()
|
||||
{
|
||||
stopBackgroundMusic(true);
|
||||
stopAllEffects();
|
||||
}
|
||||
|
||||
bool ComAudio::isEnabled() const
|
||||
{
|
||||
return _enabled;
|
||||
|
|
|
@ -59,6 +59,16 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
virtual void onExit() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onAdd() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onRemove() override;
|
||||
virtual bool isEnabled() const override;
|
||||
virtual void setEnabled(bool b) override;
|
||||
virtual bool serialize(void* r) override;
|
||||
|
|
|
@ -54,6 +54,18 @@ void ComController::onExit()
|
|||
{
|
||||
}
|
||||
|
||||
void ComController::onAdd()
|
||||
{
|
||||
if (_owner != nullptr)
|
||||
{
|
||||
_owner->scheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ComController::onRemove()
|
||||
{
|
||||
}
|
||||
|
||||
void ComController::update(float delta)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -59,6 +59,16 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
virtual void onExit() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onAdd() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onRemove() override;
|
||||
virtual void update(float delta) override;
|
||||
virtual bool isEnabled() const override;
|
||||
virtual void setEnabled(bool b) override;
|
||||
|
|
|
@ -68,6 +68,22 @@ void ComRender::onExit()
|
|||
}
|
||||
}
|
||||
|
||||
void ComRender::onAdd()
|
||||
{
|
||||
if (_owner != nullptr)
|
||||
{
|
||||
_owner->addChild(_render);
|
||||
}
|
||||
}
|
||||
|
||||
void ComRender::onRemove()
|
||||
{
|
||||
if (_owner != nullptr)
|
||||
{
|
||||
_owner->removeChild(_render, true);
|
||||
}
|
||||
}
|
||||
|
||||
cocos2d::Node* ComRender::getNode()
|
||||
{
|
||||
return _render;
|
||||
|
|
|
@ -57,6 +57,16 @@ public:
|
|||
* @lua NA
|
||||
*/
|
||||
virtual void onExit() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onAdd() override;
|
||||
/**
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual void onRemove() override;
|
||||
virtual bool serialize(void* r) override;
|
||||
virtual cocos2d::Node* getNode();
|
||||
virtual void setNode(cocos2d::Node *node);
|
||||
|
|
|
@ -177,14 +177,18 @@ bool CocoLoader::ReadCocoBinBuff(char* pBinBuff)
|
|||
pTempBuff += sizeof(stCocoFileHeader);
|
||||
char* pStartAddr = m_pMemoryBuff = pTempBuff;
|
||||
|
||||
char* pDestBuff = new char[m_pFileHeader->m_nDataSize];
|
||||
if (m_pFileHeader->m_nCompressSize > 0)
|
||||
{
|
||||
char* pDestBuff = new char[m_pFileHeader->m_nDataSize];
|
||||
uLongf dwSrcSize = m_pFileHeader->m_nCompressSize;
|
||||
uLongf dwDestSize = m_pFileHeader->m_nDataSize;
|
||||
uncompress((Bytef*)pDestBuff,&dwDestSize,(Bytef*)m_pMemoryBuff,dwSrcSize);
|
||||
pStartAddr = m_pMemoryBuff = pDestBuff;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(pDestBuff, m_pMemoryBuff, m_pFileHeader->m_nDataSize);
|
||||
}
|
||||
pStartAddr = m_pMemoryBuff = pDestBuff;
|
||||
|
||||
m_pObjectDescArray = (stExpCocoObjectDesc*)pStartAddr;
|
||||
|
||||
|
|
|
@ -202,6 +202,8 @@ static bool configureCURL(HttpClient* client, CURL* handle, char* errorBuffer)
|
|||
// Document is here: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTNOSIGNAL
|
||||
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);
|
||||
|
||||
curl_easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ void Physics3DComponent::preSimulate()
|
|||
{
|
||||
if (((int)_syncFlag & (int)Physics3DComponent::PhysicsSyncFlag::NODE_TO_PHYSICS) && _physics3DObj && _owner)
|
||||
{
|
||||
syncToNode();
|
||||
syncNodeToPhysics();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ void Physics3DComponent::postSimulate()
|
|||
{
|
||||
if (((int)_syncFlag & (int)Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE) && _physics3DObj && _owner)
|
||||
{
|
||||
syncToPhysics();
|
||||
syncPhysicsToNode();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ void Physics3DComponent::setSyncFlag(PhysicsSyncFlag syncFlag)
|
|||
_syncFlag = syncFlag;
|
||||
}
|
||||
|
||||
void Physics3DComponent::syncToPhysics()
|
||||
void Physics3DComponent::syncPhysicsToNode()
|
||||
{
|
||||
if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::RIGID_BODY)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ void Physics3DComponent::syncToPhysics()
|
|||
}
|
||||
}
|
||||
|
||||
void Physics3DComponent::syncToNode()
|
||||
void Physics3DComponent::syncNodeToPhysics()
|
||||
{
|
||||
if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::RIGID_BODY)
|
||||
{
|
||||
|
|
|
@ -110,14 +110,14 @@ public:
|
|||
void setSyncFlag(PhysicsSyncFlag syncFlag);
|
||||
|
||||
/**
|
||||
* align node and physics according to physics object
|
||||
* synchronize node transformation to physics
|
||||
*/
|
||||
void syncToPhysics();
|
||||
void syncNodeToPhysics();
|
||||
|
||||
/**
|
||||
* align node and physics according to node
|
||||
* synchronize physics transformation to node
|
||||
*/
|
||||
void syncToNode();
|
||||
void syncPhysicsToNode();
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
Physics3DComponent();
|
||||
|
|
|
@ -67,6 +67,16 @@ Physics3DWorld* Physics3DWorld::create(Physics3DWorldDes* info)
|
|||
return world;
|
||||
}
|
||||
|
||||
void Physics3DWorld::setGravity(const Vec3& gravity)
|
||||
{
|
||||
_btPhyiscsWorld->setGravity(convertVec3TobtVector3(gravity));
|
||||
}
|
||||
|
||||
Vec3 Physics3DWorld::getGravity() const
|
||||
{
|
||||
return convertbtVector3ToVec3(_btPhyiscsWorld->getGravity());
|
||||
}
|
||||
|
||||
bool Physics3DWorld::init(Physics3DWorldDes* info)
|
||||
{
|
||||
///collision configuration contains default setup for memory, collision setup
|
||||
|
|
|
@ -90,6 +90,12 @@ public:
|
|||
*/
|
||||
static Physics3DWorld* create(Physics3DWorldDes* info);
|
||||
|
||||
/** set gravity for the physics world */
|
||||
void setGravity(const Vec3& gravity);
|
||||
|
||||
/** get current gravity */
|
||||
Vec3 getGravity() const;
|
||||
|
||||
/** Add a Physics3DObject. */
|
||||
void addPhysics3DObject(Physics3DObject* physicsObj);
|
||||
|
||||
|
|
|
@ -57,16 +57,16 @@ void PhysicsSprite3D::setSyncFlag(Physics3DComponent::PhysicsSyncFlag syncFlag)
|
|||
_physicsComponent->setSyncFlag(syncFlag);
|
||||
}
|
||||
|
||||
void PhysicsSprite3D::syncToPhysics()
|
||||
void PhysicsSprite3D::syncNodeToPhysics()
|
||||
{
|
||||
if (_physicsComponent)
|
||||
_physicsComponent->syncToPhysics();
|
||||
_physicsComponent->syncNodeToPhysics();
|
||||
}
|
||||
|
||||
void PhysicsSprite3D::syncToNode()
|
||||
void PhysicsSprite3D::syncPhysicsToNode()
|
||||
{
|
||||
if (_physicsComponent)
|
||||
_physicsComponent->syncToNode();
|
||||
_physicsComponent->syncPhysicsToNode();
|
||||
}
|
||||
|
||||
PhysicsSprite3D::PhysicsSprite3D()
|
||||
|
|
|
@ -56,11 +56,11 @@ public:
|
|||
/** Set synchronization flag, see Physics3DComponent. */
|
||||
void setSyncFlag(Physics3DComponent::PhysicsSyncFlag syncFlag);
|
||||
|
||||
/** Physics synchronize rendering. */
|
||||
void syncToPhysics();
|
||||
/** synchronize node transformation to physics. */
|
||||
void syncNodeToPhysics();
|
||||
|
||||
/** Rendering synchronize physics. */
|
||||
void syncToNode();
|
||||
/** synchronize physics transformation to node. */
|
||||
void syncPhysicsToNode();
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
PhysicsSprite3D();
|
||||
|
|
|
@ -116,7 +116,9 @@ public class Cocos2dxHelper {
|
|||
sInited = true;
|
||||
|
||||
//Enhance API modification begin
|
||||
activity.getApplicationContext().bindService(new Intent(IGameTuningService.class.getName()), connection, Context.BIND_AUTO_CREATE);
|
||||
Intent serviceIntent = new Intent(IGameTuningService.class.getName());
|
||||
serviceIntent.setPackage("com.enhance.gameservice");
|
||||
boolean suc = activity.getApplicationContext().bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
|
||||
//Enhance API modification end
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ import java.io.DataInputStream;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
|
@ -260,11 +262,20 @@ public class Cocos2dxHttpURLConnection
|
|||
}
|
||||
|
||||
static byte[] getResponseContent(HttpURLConnection http) {
|
||||
DataInputStream in;
|
||||
InputStream in;
|
||||
try {
|
||||
in = new DataInputStream(http.getInputStream());
|
||||
in = http.getInputStream();
|
||||
String contentEncoding = http.getContentEncoding();
|
||||
if (contentEncoding != null) {
|
||||
if(contentEncoding.equalsIgnoreCase("gzip")){
|
||||
in = new GZIPInputStream(http.getInputStream()); //reads 2 bytes to determine GZIP stream!
|
||||
}
|
||||
else if(contentEncoding.equalsIgnoreCase("deflate")){
|
||||
in = new InflaterInputStream(http.getInputStream());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
in = new DataInputStream(http.getErrorStream());
|
||||
in = http.getErrorStream();
|
||||
} catch (Exception e) {
|
||||
Log.e("Cocos2dxHttpURLConnection exception", e.toString());
|
||||
return null;
|
||||
|
|
|
@ -359,7 +359,7 @@ GLProgramState* GLProgramState::getOrCreateWithShaders(const std::string& vertex
|
|||
|
||||
GLProgramState::GLProgramState()
|
||||
: _uniformAttributeValueDirty(true)
|
||||
, _textureUnitIndex(1)
|
||||
, _textureUnitIndex(4) // first 4 textures unites are reserved for CC_Texture0-3
|
||||
, _vertexAttribsFlags(0)
|
||||
, _glprogram(nullptr)
|
||||
, _nodeBinding(nullptr)
|
||||
|
|
|
@ -198,9 +198,7 @@ bool Material::parsePass(Technique* technique, Properties* passProperties)
|
|||
while (space)
|
||||
{
|
||||
const char* name = space->getNamespace();
|
||||
if (strcmp(name, "sampler") == 0)
|
||||
parseSampler(pass, space);
|
||||
else if (strcmp(name, "shader") == 0)
|
||||
if (strcmp(name, "shader") == 0)
|
||||
parseShader(pass, space);
|
||||
else if (strcmp(name, "renderState") == 0)
|
||||
parseRenderState(pass, space);
|
||||
|
@ -216,10 +214,12 @@ bool Material::parsePass(Technique* technique, Properties* passProperties)
|
|||
}
|
||||
|
||||
// cocos2d-x doesn't support Samplers yet. But will be added soon
|
||||
bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
||||
bool Material::parseSampler(GLProgramState* glProgramState, Properties* samplerProperties)
|
||||
{
|
||||
CCASSERT(samplerProperties->getId(), "Sampler must have an id. The id is the uniform name");
|
||||
|
||||
// required
|
||||
auto filename = textureProperties->getString("path");
|
||||
auto filename = samplerProperties->getString("path");
|
||||
|
||||
auto texture = Director::getInstance()->getTextureCache()->addImage(filename);
|
||||
if (!texture) {
|
||||
|
@ -234,14 +234,14 @@ bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
|||
|
||||
// mipmap
|
||||
bool usemipmap = false;
|
||||
const char* mipmap = getOptionalString(textureProperties, "mipmap", "false");
|
||||
const char* mipmap = getOptionalString(samplerProperties, "mipmap", "false");
|
||||
if (mipmap && strcasecmp(mipmap, "true")==0) {
|
||||
texture->generateMipmap();
|
||||
usemipmap = true;
|
||||
}
|
||||
|
||||
// valid options: REPEAT, CLAMP
|
||||
const char* wrapS = getOptionalString(textureProperties, "wrapS", "CLAMP_TO_EDGE");
|
||||
const char* wrapS = getOptionalString(samplerProperties, "wrapS", "CLAMP_TO_EDGE");
|
||||
if (strcasecmp(wrapS, "REPEAT")==0)
|
||||
texParams.wrapS = GL_REPEAT;
|
||||
else if(strcasecmp(wrapS, "CLAMP_TO_EDGE")==0)
|
||||
|
@ -251,7 +251,7 @@ bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
|||
|
||||
|
||||
// valid options: REPEAT, CLAMP
|
||||
const char* wrapT = getOptionalString(textureProperties, "wrapT", "CLAMP_TO_EDGE");
|
||||
const char* wrapT = getOptionalString(samplerProperties, "wrapT", "CLAMP_TO_EDGE");
|
||||
if (strcasecmp(wrapT, "REPEAT")==0)
|
||||
texParams.wrapT = GL_REPEAT;
|
||||
else if(strcasecmp(wrapT, "CLAMP_TO_EDGE")==0)
|
||||
|
@ -261,7 +261,7 @@ bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
|||
|
||||
|
||||
// valid options: NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_LINEAR
|
||||
const char* minFilter = getOptionalString(textureProperties, "minFilter", usemipmap ? "LINEAR_MIPMAP_NEAREST" : "LINEAR");
|
||||
const char* minFilter = getOptionalString(samplerProperties, "minFilter", usemipmap ? "LINEAR_MIPMAP_NEAREST" : "LINEAR");
|
||||
if (strcasecmp(minFilter, "NEAREST")==0)
|
||||
texParams.minFilter = GL_NEAREST;
|
||||
else if(strcasecmp(minFilter, "LINEAR")==0)
|
||||
|
@ -278,7 +278,7 @@ bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
|||
CCLOG("Invalid minFilter: %s", minFilter);
|
||||
|
||||
// valid options: NEAREST, LINEAR
|
||||
const char* magFilter = getOptionalString(textureProperties, "magFilter", "LINEAR");
|
||||
const char* magFilter = getOptionalString(samplerProperties, "magFilter", "LINEAR");
|
||||
if (strcasecmp(magFilter, "NEAREST")==0)
|
||||
texParams.magFilter = GL_NEAREST;
|
||||
else if(strcasecmp(magFilter, "LINEAR")==0)
|
||||
|
@ -289,7 +289,7 @@ bool Material::parseSampler(Pass* pass, Properties* textureProperties)
|
|||
texture->setTexParameters(texParams);
|
||||
}
|
||||
|
||||
pass->_textures.pushBack(texture);
|
||||
glProgramState->setUniformTexture(samplerProperties->getId(), texture);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,16 @@ bool Material::parseShader(Pass* pass, Properties* shaderProperties)
|
|||
property = shaderProperties->getNextProperty();
|
||||
}
|
||||
|
||||
// glProgramState->updateUniformsAndAttributes();
|
||||
auto space = shaderProperties->getNextNamespace();
|
||||
while (space)
|
||||
{
|
||||
const char* name = space->getNamespace();
|
||||
if (strcmp(name, "sampler") == 0)
|
||||
{
|
||||
parseSampler(glProgramState, space);
|
||||
}
|
||||
space = shaderProperties->getNextNamespace();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -133,8 +133,8 @@ protected:
|
|||
bool parseProperties(Properties* properties);
|
||||
bool parseTechnique(Properties* properties);
|
||||
bool parsePass(Technique* technique, Properties* properties);
|
||||
bool parseSampler(Pass* pass, Properties* properties);
|
||||
bool parseShader(Pass* pass, Properties* properties);
|
||||
bool parseSampler(GLProgramState* glProgramState, Properties* properties);
|
||||
bool parseUniform(GLProgramState* programState, Properties* properties, const char* uniformName);
|
||||
bool parseRenderState(RenderState* renderState, Properties* properties);
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ uint32_t Pass::getHash() const
|
|||
{
|
||||
if (_hashDirty || _state->isDirty()) {
|
||||
uint32_t glProgram = (uint32_t)_glProgramState->getGLProgram()->getProgram();
|
||||
uint32_t textureid = (uint32_t)_textures.at(0)->getName();
|
||||
uint32_t textureid = _texture ? _texture->getName() : -1;
|
||||
uint32_t stateblockid = _state->getHash();
|
||||
|
||||
_hash = glProgram ^ textureid ^ stateblockid;
|
||||
|
|
|
@ -58,7 +58,7 @@ enum
|
|||
|
||||
|
||||
RenderState::RenderState()
|
||||
: _textures()
|
||||
: _texture(nullptr)
|
||||
, _hash(0)
|
||||
, _hashDirty(true)
|
||||
, _parent(nullptr)
|
||||
|
@ -102,32 +102,27 @@ std::string RenderState::getName() const
|
|||
}
|
||||
|
||||
|
||||
const Vector<Texture2D*>& RenderState::getTextures() const
|
||||
{
|
||||
return _textures;
|
||||
}
|
||||
|
||||
void RenderState::setTexture(Texture2D* texture)
|
||||
{
|
||||
if (_textures.size() > 0)
|
||||
_textures.replace(0, texture);
|
||||
else
|
||||
_textures.pushBack(texture);
|
||||
if (_texture != texture)
|
||||
{
|
||||
CC_SAFE_RELEASE(_texture);
|
||||
_texture = texture;
|
||||
CC_SAFE_RETAIN(_texture);
|
||||
}
|
||||
}
|
||||
|
||||
Texture2D* RenderState::getTexture() const
|
||||
{
|
||||
if (_textures.size() > 0)
|
||||
return _textures.at(0);
|
||||
return nullptr;
|
||||
return _texture;
|
||||
}
|
||||
|
||||
void RenderState::bind(Pass* pass)
|
||||
{
|
||||
CC_ASSERT(pass);
|
||||
|
||||
if (_textures.size() > 0)
|
||||
GL::bindTexture2D(_textures.at(0)->getName());
|
||||
if (_texture)
|
||||
GL::bindTexture2D(_texture->getName());
|
||||
|
||||
// Get the combined modified state bits for our RenderState hierarchy.
|
||||
long stateOverrideBits = _state ? _state->_bits : 0;
|
||||
|
@ -193,7 +188,8 @@ void RenderState::cloneInto(RenderState* renderState) const
|
|||
}
|
||||
|
||||
renderState->_name = _name;
|
||||
renderState->_textures = _textures;
|
||||
renderState->_texture = _texture;
|
||||
CC_SAFE_RETAIN(renderState->_texture);
|
||||
// weak ref. don't retain
|
||||
renderState->_parent = _parent;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <functional>
|
||||
#include <cstdint>
|
||||
|
||||
#include "renderer/CCTexture2D.h"
|
||||
#include "platform/CCPlatformMacros.h"
|
||||
#include "base/CCRef.h"
|
||||
#include "base/ccTypes.h"
|
||||
|
@ -65,14 +64,12 @@ public:
|
|||
std::string getName() const;
|
||||
|
||||
|
||||
const Vector<Texture2D*>& getTextures() const;
|
||||
|
||||
/** Replaces the texture that is at the front of _textures array.
|
||||
Added to be backwards compatible.
|
||||
/** Texture that will use in the CC_Texture0 uniform.
|
||||
Added to be backwards compatible. Use Samplers from .material instead.
|
||||
*/
|
||||
void setTexture(Texture2D* texture);
|
||||
|
||||
/** Returns the texture that is at the front of the _textures array.
|
||||
/** Returns the texture that is going to be used for CC_Texture0.
|
||||
Added to be backwards compatible.
|
||||
*/
|
||||
Texture2D* getTexture() const;
|
||||
|
@ -413,7 +410,7 @@ protected:
|
|||
// name, for filtering
|
||||
std::string _name;
|
||||
|
||||
Vector<Texture2D*> _textures;
|
||||
Texture2D* _texture;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -17,7 +17,7 @@ void main()
|
|||
vec4 sample = texture2D(CC_Texture0, v_texCoord);
|
||||
float fontAlpha = sample.a;
|
||||
float outlineAlpha = sample.r;
|
||||
if (outlineAlpha > 0.0){
|
||||
if ((fontAlpha + outlineAlpha) > 0.0){
|
||||
vec4 color = u_textColor * fontAlpha + u_effectColor * (1.0 - fontAlpha);
|
||||
gl_FragColor = v_fragmentColor * vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a);
|
||||
}
|
||||
|
|
|
@ -1405,14 +1405,16 @@ getTerrainSize : function (
|
|||
|
||||
/**
|
||||
* @method getIntersectionPoint
|
||||
* @param {cc.Ray} arg0
|
||||
* @return {vec3_object}
|
||||
* @param {cc.Ray|cc.Ray} ray
|
||||
* @param {vec3_object} vec3
|
||||
* @return {bool|vec3_object}
|
||||
*/
|
||||
getIntersectionPoint : function(
|
||||
ray
|
||||
ray,
|
||||
vec3
|
||||
)
|
||||
{
|
||||
return cc.Vec3;
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -19915,16 +19915,6 @@ getStateBlock : function (
|
|||
return cc.RenderState::StateBlock;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getTextures
|
||||
* @return {Array}
|
||||
*/
|
||||
getTextures : function (
|
||||
)
|
||||
{
|
||||
return new Array();
|
||||
},
|
||||
|
||||
/**
|
||||
* @method initialize
|
||||
*/
|
||||
|
@ -22213,16 +22203,6 @@ isEnabled : function (
|
|||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method update
|
||||
* @param {float} arg0
|
||||
*/
|
||||
update : function (
|
||||
float
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getOwner
|
||||
* @return {cc.Node}
|
||||
|
@ -22243,16 +22223,6 @@ init : function (
|
|||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setOwner
|
||||
* @param {cc.Node} arg0
|
||||
*/
|
||||
setOwner : function (
|
||||
node
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method getName
|
||||
* @return {String}
|
||||
|
@ -22263,6 +22233,16 @@ getName : function (
|
|||
return ;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method setOwner
|
||||
* @param {cc.Node} arg0
|
||||
*/
|
||||
setOwner : function (
|
||||
node
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method create
|
||||
* @return {cc.Component}
|
||||
|
|
|
@ -726,6 +726,14 @@ Physics3DRigidBody : function (
|
|||
*/
|
||||
cc.Physics3DComponent = {
|
||||
|
||||
/**
|
||||
* @method syncNodeToPhysics
|
||||
*/
|
||||
syncNodeToPhysics : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method addToPhysicsWorld
|
||||
* @param {cc.Physics3DWorld} arg0
|
||||
|
@ -737,17 +745,9 @@ physics3dworld
|
|||
},
|
||||
|
||||
/**
|
||||
* @method syncToPhysics
|
||||
* @method syncPhysicsToNode
|
||||
*/
|
||||
syncToPhysics : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method syncToNode
|
||||
*/
|
||||
syncToNode : function (
|
||||
syncPhysicsToNode : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
@ -837,17 +837,17 @@ Physics3DComponent : function (
|
|||
cc.PhysicsSprite3D = {
|
||||
|
||||
/**
|
||||
* @method syncToPhysics
|
||||
* @method syncNodeToPhysics
|
||||
*/
|
||||
syncToPhysics : function (
|
||||
syncNodeToPhysics : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method syncToNode
|
||||
* @method syncPhysicsToNode
|
||||
*/
|
||||
syncToNode : function (
|
||||
syncPhysicsToNode : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
@ -888,6 +888,16 @@ PhysicsSprite3D : function (
|
|||
*/
|
||||
cc.Physics3DWorld = {
|
||||
|
||||
/**
|
||||
* @method setGravity
|
||||
* @param {vec3_object} arg0
|
||||
*/
|
||||
setGravity : function (
|
||||
vec3
|
||||
)
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* @method stepSimulate
|
||||
* @param {float} arg0
|
||||
|
@ -929,11 +939,9 @@ physics3dworlddes
|
|||
},
|
||||
|
||||
/**
|
||||
* @method removePhysics3DConstraint
|
||||
* @param {cc.Physics3DConstraint} arg0
|
||||
* @method removeAllPhysics3DObjects
|
||||
*/
|
||||
removePhysics3DConstraint : function (
|
||||
physics3dconstraint
|
||||
removeAllPhysics3DObjects : function (
|
||||
)
|
||||
{
|
||||
},
|
||||
|
@ -973,9 +981,21 @@ hitresult
|
|||
},
|
||||
|
||||
/**
|
||||
* @method removeAllPhysics3DObjects
|
||||
* @method getGravity
|
||||
* @return {vec3_object}
|
||||
*/
|
||||
removeAllPhysics3DObjects : function (
|
||||
getGravity : function (
|
||||
)
|
||||
{
|
||||
return cc.Vec3;
|
||||
},
|
||||
|
||||
/**
|
||||
* @method removePhysics3DConstraint
|
||||
* @param {cc.Physics3DConstraint} arg0
|
||||
*/
|
||||
removePhysics3DConstraint : function (
|
||||
physics3dconstraint
|
||||
)
|
||||
{
|
||||
},
|
||||
|
|
|
@ -4022,22 +4022,43 @@ bool js_cocos2dx_3d_Terrain_getIntersectionPoint(JSContext *cx, uint32_t argc, j
|
|||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
bool ok = true;
|
||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||
|
||||
JS::RootedObject obj(cx);
|
||||
cocos2d::Terrain* cobj = NULL;
|
||||
obj = args.thisv().toObjectOrNull();
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
||||
cocos2d::Terrain* cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL);
|
||||
cobj = (cocos2d::Terrain *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_getIntersectionPoint : Invalid Native Object");
|
||||
do {
|
||||
if (argc == 2) {
|
||||
cocos2d::Ray arg0;
|
||||
ok &= jsval_to_ray(cx, args.get(0), &arg0);
|
||||
if (!ok) { ok = true; break; }
|
||||
cocos2d::Vec3 arg1;
|
||||
ok &= jsval_to_vector3(cx, args.get(1), &arg1);
|
||||
if (!ok) { ok = true; break; }
|
||||
bool ret = cobj->getIntersectionPoint(arg0, arg1);
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = BOOLEAN_TO_JSVAL(ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
} while(0);
|
||||
|
||||
do {
|
||||
if (argc == 1) {
|
||||
cocos2d::Ray arg0;
|
||||
ok &= jsval_to_ray(cx, args.get(0), &arg0);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_getIntersectionPoint : Error processing arguments");
|
||||
if (!ok) { ok = true; break; }
|
||||
cocos2d::Vec3 ret = cobj->getIntersectionPoint(arg0);
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = vector3_to_jsval(cx, ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
} while(0);
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_3d_Terrain_getIntersectionPoint : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
JS_ReportError(cx, "js_cocos2dx_3d_Terrain_getIntersectionPoint : wrong number of arguments");
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_3d_Terrain_getNormal(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
|
|
@ -61442,24 +61442,6 @@ bool js_cocos2dx_RenderState_getStateBlock(JSContext *cx, uint32_t argc, jsval *
|
|||
JS_ReportError(cx, "js_cocos2dx_RenderState_getStateBlock : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_RenderState_getTextures(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::RenderState* cobj = (cocos2d::RenderState *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderState_getTextures : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
const cocos2d::Vector<cocos2d::Texture2D *>& ret = cobj->getTextures();
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = ccvector_to_jsval(cx, ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_RenderState_getTextures : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_RenderState_initialize(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -61515,7 +61497,6 @@ void js_register_cocos2dx_RenderState(JSContext *cx, JS::HandleObject global) {
|
|||
JS_FN("bind", js_cocos2dx_RenderState_bind, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getName", js_cocos2dx_RenderState_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getStateBlock", js_cocos2dx_RenderState_getStateBlock, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getTextures", js_cocos2dx_RenderState_getTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
|
@ -67823,26 +67804,6 @@ bool js_cocos2dx_Component_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
JS_ReportError(cx, "js_cocos2dx_Component_isEnabled : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_update(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::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Component_update : Invalid Native Object");
|
||||
if (argc == 1) {
|
||||
double arg0;
|
||||
ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Component_update : Error processing arguments");
|
||||
cobj->update(arg0);
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_Component_update : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_getOwner(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -67886,6 +67847,24 @@ bool js_cocos2dx_Component_init(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
JS_ReportError(cx, "js_cocos2dx_Component_init : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_getName(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::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Component_getName : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
const std::string& ret = cobj->getName();
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = std_string_to_jsval(cx, ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_Component_getName : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -67914,24 +67893,6 @@ bool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
JS_ReportError(cx, "js_cocos2dx_Component_setOwner : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_getName(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::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Component_getName : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
const std::string& ret = cobj->getName();
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = std_string_to_jsval(cx, ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_Component_getName : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -68026,11 +67987,10 @@ void js_register_cocos2dx_Component(JSContext *cx, JS::HandleObject global) {
|
|||
JS_FN("setEnabled", js_cocos2dx_Component_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setName", js_cocos2dx_Component_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("isEnabled", js_cocos2dx_Component_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("update", js_cocos2dx_Component_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getOwner", js_cocos2dx_Component_getOwner, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("init", js_cocos2dx_Component_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setOwner", js_cocos2dx_Component_setOwner, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getName", js_cocos2dx_Component_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setOwner", js_cocos2dx_Component_setOwner, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("ctor", js_cocos2d_Component_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FS_END
|
||||
};
|
||||
|
|
|
@ -3567,7 +3567,6 @@ bool js_cocos2dx_RenderState_getTexture(JSContext *cx, uint32_t argc, jsval *vp)
|
|||
bool js_cocos2dx_RenderState_bind(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_RenderState_getName(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_RenderState_getStateBlock(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_RenderState_getTextures(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_RenderState_initialize(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_RenderState_finalize(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
|
@ -3922,11 +3921,10 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
|
|||
bool js_cocos2dx_Component_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_setName(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_update(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_getOwner(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_init(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_getName(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_Component_Component(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
||||
|
|
|
@ -1722,6 +1722,22 @@ void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::Handle
|
|||
JSClass *jsb_cocos2d_Physics3DComponent_class;
|
||||
JSObject *jsb_cocos2d_Physics3DComponent_prototype;
|
||||
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics(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::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->syncNodeToPhysics();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -1750,36 +1766,20 @@ bool js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(JSContext *cx, u
|
|||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode(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::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics : Invalid Native Object");
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->syncToPhysics();
|
||||
cobj->syncPhysicsToNode();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncToNode(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::Physics3DComponent* cobj = (cocos2d::Physics3DComponent *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DComponent_syncToNode : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->syncToNode();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncToNode : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
@ -2061,9 +2061,9 @@ void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::Handle
|
|||
};
|
||||
|
||||
static JSFunctionSpec funcs[] = {
|
||||
JS_FN("syncNodeToPhysics", js_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("addToPhysicsWorld", js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncToPhysics", js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncToNode", js_cocos2dx_physics3d_Physics3DComponent_syncToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncPhysicsToNode", js_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getPhysics3DObject", js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setPhysics3DObject", js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setSyncFlag", js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
|
@ -2108,36 +2108,36 @@ void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::Handle
|
|||
JSClass *jsb_cocos2d_PhysicsSprite3D_class;
|
||||
JSObject *jsb_cocos2d_PhysicsSprite3D_prototype;
|
||||
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics(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::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics : Invalid Native Object");
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->syncToPhysics();
|
||||
cobj->syncNodeToPhysics();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode(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::PhysicsSprite3D* cobj = (cocos2d::PhysicsSprite3D *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode : Invalid Native Object");
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->syncToNode();
|
||||
cobj->syncPhysicsToNode();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
@ -2240,8 +2240,8 @@ void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObj
|
|||
};
|
||||
|
||||
static JSFunctionSpec funcs[] = {
|
||||
JS_FN("syncToPhysics", js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncToNode", js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncNodeToPhysics", js_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("syncPhysicsToNode", js_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getPhysicsObj", js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setSyncFlag", js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FS_END
|
||||
|
@ -2280,6 +2280,26 @@ void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObj
|
|||
JSClass *jsb_cocos2d_Physics3DWorld_class;
|
||||
JSObject *jsb_cocos2d_Physics3DWorld_prototype;
|
||||
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_setGravity(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::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : Invalid Native Object");
|
||||
if (argc == 1) {
|
||||
cocos2d::Vec3 arg0;
|
||||
ok &= jsval_to_vector3(cx, args.get(0), &arg0);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : Error processing arguments");
|
||||
cobj->setGravity(arg0);
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_setGravity : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -2357,32 +2377,20 @@ bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsv
|
|||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_init : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(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::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Invalid Native Object");
|
||||
if (argc == 1) {
|
||||
cocos2d::Physics3DConstraint* arg0;
|
||||
do {
|
||||
if (args.get(0).isNull()) { arg0 = nullptr; break; }
|
||||
if (!args.get(0).isObject()) { ok = false; break; }
|
||||
js_proxy_t *jsProxy;
|
||||
JSObject *tmpObj = args.get(0).toObjectOrNull();
|
||||
jsProxy = jsb_get_js_proxy(tmpObj);
|
||||
arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
|
||||
} while (0);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Error processing arguments");
|
||||
cobj->removePhysics3DConstraint(arg0);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->removeAllPhysics3DObjects();
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
@ -2446,20 +2454,50 @@ bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc,
|
|||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_rayCast : wrong number of arguments: %d, was expecting %d", argc, 3);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_getGravity(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::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : Invalid Native Object");
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_getGravity : Invalid Native Object");
|
||||
if (argc == 0) {
|
||||
cobj->removeAllPhysics3DObjects();
|
||||
cocos2d::Vec3 ret = cobj->getGravity();
|
||||
jsval jsret = JSVAL_NULL;
|
||||
jsret = vector3_to_jsval(cx, ret);
|
||||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_getGravity : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(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::Physics3DWorld* cobj = (cocos2d::Physics3DWorld *)(proxy ? proxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Invalid Native Object");
|
||||
if (argc == 1) {
|
||||
cocos2d::Physics3DConstraint* arg0;
|
||||
do {
|
||||
if (args.get(0).isNull()) { arg0 = nullptr; break; }
|
||||
if (!args.get(0).isObject()) { ok = false; break; }
|
||||
js_proxy_t *jsProxy;
|
||||
JSObject *tmpObj = args.get(0).toObjectOrNull();
|
||||
jsProxy = jsb_get_js_proxy(tmpObj);
|
||||
arg0 = (cocos2d::Physics3DConstraint*)(jsProxy ? jsProxy->ptr : NULL);
|
||||
JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
|
||||
} while (0);
|
||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : Error processing arguments");
|
||||
cobj->removePhysics3DConstraint(arg0);
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||
JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||
return false;
|
||||
}
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
|
@ -2766,15 +2804,17 @@ void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObje
|
|||
};
|
||||
|
||||
static JSFunctionSpec funcs[] = {
|
||||
JS_FN("setGravity", js_cocos2dx_physics3d_Physics3DWorld_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("stepSimulate", js_cocos2dx_physics3d_Physics3DWorld_stepSimulate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("needCollisionChecking", js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("collisionChecking", js_cocos2dx_physics3d_Physics3DWorld_collisionChecking, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("init", js_cocos2dx_physics3d_Physics3DWorld_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removePhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removeAllPhysics3DObjects", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("isDebugDrawEnabled", js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removeAllPhysics3DConstraints", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("rayCast", js_cocos2dx_physics3d_Physics3DWorld_rayCast, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removeAllPhysics3DObjects", js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("getGravity", js_cocos2dx_physics3d_Physics3DWorld_getGravity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removePhysics3DConstraint", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("addPhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("setDebugDrawEnable", js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
JS_FN("removePhysics3DObject", js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||
|
|
|
@ -103,9 +103,9 @@ bool js_cocos2dx_physics3d_Physics3DComponent_constructor(JSContext *cx, uint32_
|
|||
void js_cocos2dx_physics3d_Physics3DComponent_finalize(JSContext *cx, JSObject *obj);
|
||||
void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::HandleObject global);
|
||||
void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncToNode(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DComponent_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
@ -121,8 +121,8 @@ bool js_cocos2dx_physics3d_PhysicsSprite3D_constructor(JSContext *cx, uint32_t a
|
|||
void js_cocos2dx_physics3d_PhysicsSprite3D_finalize(JSContext *cx, JSObject *obj);
|
||||
void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObject global);
|
||||
void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_PhysicsSprite3D_PhysicsSprite3D(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
@ -134,15 +134,17 @@ bool js_cocos2dx_physics3d_Physics3DWorld_constructor(JSContext *cx, uint32_t ar
|
|||
void js_cocos2dx_physics3d_Physics3DWorld_finalize(JSContext *cx, JSObject *obj);
|
||||
void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global);
|
||||
void register_all_cocos2dx_physics3d(JSContext* cx, JS::HandleObject obj);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_setGravity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_collisionChecking(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_init(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_rayCast(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_getGravity(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
bool js_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject(JSContext *cx, uint32_t argc, jsval *vp);
|
||||
|
|
|
@ -1058,28 +1058,29 @@ int ScriptingCore::handleComponentEvent(void* data)
|
|||
JS::RootedValue retval(_cx);
|
||||
jsval dataVal = INT_TO_JSVAL(1);
|
||||
|
||||
if (action == kComponentOnEnter)
|
||||
JS::RootedValue nodeValue(_cx, OBJECT_TO_JSVAL(p->obj.get()));
|
||||
|
||||
if (action == kComponentOnAdd)
|
||||
{
|
||||
if (isFunctionOverridedInJS(JS::RootedObject(_cx, p->obj.get()), "onEnter", js_cocos2dx_Component_onEnter))
|
||||
{
|
||||
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onEnter", 1, &dataVal, &retval);
|
||||
ret = executeFunctionWithOwner(nodeValue, "onAdd", 1, &dataVal, &retval);
|
||||
}
|
||||
else if (action == kComponentOnRemove)
|
||||
{
|
||||
ret = executeFunctionWithOwner(nodeValue, "onRemove", 1, &dataVal, &retval);
|
||||
}
|
||||
else if (action == kComponentOnEnter)
|
||||
{
|
||||
ret = executeFunctionWithOwner(nodeValue, "onEnter", 1, &dataVal, &retval);
|
||||
resumeSchedulesAndActions(p);
|
||||
}
|
||||
else if (action == kComponentOnExit)
|
||||
{
|
||||
if (isFunctionOverridedInJS(JS::RootedObject(_cx, p->obj.get()), "onExit", js_cocos2dx_Component_onExit))
|
||||
{
|
||||
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onExit", 1, &dataVal, &retval);
|
||||
}
|
||||
ret = executeFunctionWithOwner(nodeValue, "onExit", 1, &dataVal, &retval);
|
||||
pauseSchedulesAndActions(p);
|
||||
}
|
||||
else if (action == kComponentOnUpdate)
|
||||
{
|
||||
if (isFunctionOverridedInJS(JS::RootedObject(_cx, p->obj.get()), "update", js_cocos2dx_Component_update))
|
||||
{
|
||||
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "update", 1, &dataVal, &retval);
|
||||
}
|
||||
ret = executeFunctionWithOwner(nodeValue, "update", 1, &dataVal, &retval);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -2693,36 +2693,6 @@ bool js_cocos2dx_CCNode_convertToWorldSpaceAR(JSContext *cx, uint32_t argc, jsva
|
|||
return true;
|
||||
}
|
||||
|
||||
bool js_cocos2dx_Component_onEnter(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JSObject *thisObj = JS_THIS_OBJECT(cx, vp);
|
||||
if (thisObj) {
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(thisObj);
|
||||
if (proxy) {
|
||||
ScriptingCore::getInstance()->setCalledFromScript(true);
|
||||
static_cast<Component*>(proxy->ptr)->onEnter();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
JS_ReportError(cx, "Invalid Native Object.");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool js_cocos2dx_Component_onExit(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JSObject *thisObj = JS_THIS_OBJECT(cx, vp);
|
||||
if (thisObj) {
|
||||
js_proxy_t *proxy = jsb_get_js_proxy(thisObj);
|
||||
if (proxy) {
|
||||
ScriptingCore::getInstance()->setCalledFromScript(true);
|
||||
static_cast<Component*>(proxy->ptr)->onExit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
JS_ReportError(cx, "Invalid Native Object.");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool js_cocos2dx_CCTMXLayer_tileFlagsAt(JSContext *cx, uint32_t argc, jsval *vp)
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
|
@ -5491,10 +5461,6 @@ void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject global)
|
|||
JS_DefineFunction(cx, tmpObj, "setVertexAttribPointer", js_cocos2dx_GLProgramState_setVertexAttribPointer, 6, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, tmpObj, "setUniformVec4", js_cocos2dx_GLProgramState_setUniformVec4, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
tmpObj.set(jsb_cocos2d_Component_prototype);
|
||||
JS_DefineFunction(cx, tmpObj, "onEnter", js_cocos2dx_Component_onEnter, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, tmpObj, "onExit", js_cocos2dx_Component_onExit, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
||||
tmpObj.set(jsb_cocos2d_Scheduler_prototype);
|
||||
JS_DefineFunction(cx, tmpObj, "retain", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
JS_DefineFunction(cx, tmpObj, "release", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);
|
||||
|
|
|
@ -199,12 +199,6 @@
|
|||
-- @param #bool b
|
||||
-- @return ComAudio#ComAudio self (return value: ccs.ComAudio)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ComAudio] isEnabled
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ComAudio] serialize
|
||||
|
@ -212,10 +206,30 @@
|
|||
-- @param #void r
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ComAudio] isEnabled
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComAudio] onRemove
|
||||
-- @param self
|
||||
-- @return ComAudio#ComAudio self (return value: ccs.ComAudio)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ComAudio] init
|
||||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComAudio] onAdd
|
||||
-- @param self
|
||||
-- @return ComAudio#ComAudio self (return value: ccs.ComAudio)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComController] onRemove
|
||||
-- @param self
|
||||
-- @return ComController#ComController self (return value: ccs.ComController)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#ComController] update
|
||||
|
@ -42,6 +49,13 @@
|
|||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComController] onAdd
|
||||
-- @param self
|
||||
-- @return ComController#ComController self (return value: ccs.ComController)
|
||||
|
||||
--------------------------------
|
||||
-- js ctor
|
||||
-- @function [parent=#ComController] ComController
|
||||
|
|
|
@ -39,4 +39,18 @@
|
|||
-- @param #void r
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComRender] onRemove
|
||||
-- @param self
|
||||
-- @return ComRender#ComRender self (return value: ccs.ComRender)
|
||||
|
||||
--------------------------------
|
||||
-- js NA<br>
|
||||
-- lua NA
|
||||
-- @function [parent=#ComRender] onAdd
|
||||
-- @param self
|
||||
-- @return ComRender#ComRender self (return value: ccs.ComRender)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
-- @param self
|
||||
-- @return bool#bool ret (return value: bool)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Component] onRemove
|
||||
-- @param self
|
||||
-- @return Component#Component self (return value: cc.Component)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Component] update
|
||||
|
@ -45,9 +51,8 @@
|
|||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Component] setOwner
|
||||
-- @function [parent=#Component] onAdd
|
||||
-- @param self
|
||||
-- @param #cc.Node pOwner
|
||||
-- @return Component#Component self (return value: cc.Component)
|
||||
|
||||
--------------------------------
|
||||
|
@ -56,6 +61,13 @@
|
|||
-- @param self
|
||||
-- @return string#string ret (return value: string)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Component] setOwner
|
||||
-- @param self
|
||||
-- @param #cc.Node pOwner
|
||||
-- @return Component#Component self (return value: cc.Component)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#Component] create
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
-- @extend Component
|
||||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- synchronize node transformation to physics
|
||||
-- @function [parent=#Physics3DComponent] syncNodeToPhysics
|
||||
-- @param self
|
||||
-- @return Physics3DComponent#Physics3DComponent self (return value: cc.Physics3DComponent)
|
||||
|
||||
--------------------------------
|
||||
-- add this component to physics world, called by scene
|
||||
-- @function [parent=#Physics3DComponent] addToPhysicsWorld
|
||||
|
@ -12,14 +18,8 @@
|
|||
-- @return Physics3DComponent#Physics3DComponent self (return value: cc.Physics3DComponent)
|
||||
|
||||
--------------------------------
|
||||
-- align node and physics according to physics object
|
||||
-- @function [parent=#Physics3DComponent] syncToPhysics
|
||||
-- @param self
|
||||
-- @return Physics3DComponent#Physics3DComponent self (return value: cc.Physics3DComponent)
|
||||
|
||||
--------------------------------
|
||||
-- align node and physics according to node
|
||||
-- @function [parent=#Physics3DComponent] syncToNode
|
||||
-- synchronize physics transformation to node
|
||||
-- @function [parent=#Physics3DComponent] syncPhysicsToNode
|
||||
-- @param self
|
||||
-- @return Physics3DComponent#Physics3DComponent self (return value: cc.Physics3DComponent)
|
||||
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
-- @extend Ref
|
||||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- set gravity for the physics world
|
||||
-- @function [parent=#Physics3DWorld] setGravity
|
||||
-- @param self
|
||||
-- @param #vec3_table gravity
|
||||
-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld)
|
||||
|
||||
--------------------------------
|
||||
-- Simulate one frame.
|
||||
-- @function [parent=#Physics3DWorld] stepSimulate
|
||||
|
@ -24,10 +31,9 @@
|
|||
-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld)
|
||||
|
||||
--------------------------------
|
||||
-- Remove a Physics3DConstraint.
|
||||
-- @function [parent=#Physics3DWorld] removePhysics3DConstraint
|
||||
-- Remove all Physics3DObjects.
|
||||
-- @function [parent=#Physics3DWorld] removeAllPhysics3DObjects
|
||||
-- @param self
|
||||
-- @param #cc.Physics3DConstraint constraint
|
||||
-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld)
|
||||
|
||||
--------------------------------
|
||||
|
@ -43,9 +49,16 @@
|
|||
-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld)
|
||||
|
||||
--------------------------------
|
||||
-- Remove all Physics3DObjects.
|
||||
-- @function [parent=#Physics3DWorld] removeAllPhysics3DObjects
|
||||
-- get current gravity
|
||||
-- @function [parent=#Physics3DWorld] getGravity
|
||||
-- @param self
|
||||
-- @return vec3_table#vec3_table ret (return value: vec3_table)
|
||||
|
||||
--------------------------------
|
||||
-- Remove a Physics3DConstraint.
|
||||
-- @function [parent=#Physics3DWorld] removePhysics3DConstraint
|
||||
-- @param self
|
||||
-- @param #cc.Physics3DConstraint constraint
|
||||
-- @return Physics3DWorld#Physics3DWorld self (return value: cc.Physics3DWorld)
|
||||
|
||||
--------------------------------
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- Physics synchronize rendering.
|
||||
-- @function [parent=#PhysicsSprite3D] syncToPhysics
|
||||
-- synchronize node transformation to physics.
|
||||
-- @function [parent=#PhysicsSprite3D] syncNodeToPhysics
|
||||
-- @param self
|
||||
-- @return PhysicsSprite3D#PhysicsSprite3D self (return value: cc.PhysicsSprite3D)
|
||||
|
||||
--------------------------------
|
||||
-- Rendering synchronize physics.
|
||||
-- @function [parent=#PhysicsSprite3D] syncToNode
|
||||
-- synchronize physics transformation to node.
|
||||
-- @function [parent=#PhysicsSprite3D] syncPhysicsToNode
|
||||
-- @param self
|
||||
-- @return PhysicsSprite3D#PhysicsSprite3D self (return value: cc.PhysicsSprite3D)
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
-- @parent_module cc
|
||||
|
||||
--------------------------------
|
||||
-- Replaces the texture that is at the front of _textures array.<br>
|
||||
-- Added to be backwards compatible.
|
||||
-- Texture that will use in the CC_Texture0 uniform.<br>
|
||||
-- Added to be backwards compatible. Use Samplers from .material instead.
|
||||
-- @function [parent=#RenderState] setTexture
|
||||
-- @param self
|
||||
-- @param #cc.Texture2D texture
|
||||
|
@ -20,7 +20,7 @@
|
|||
-- @return RenderState#RenderState ret (return value: cc.RenderState)
|
||||
|
||||
--------------------------------
|
||||
-- Returns the texture that is at the front of the _textures array.<br>
|
||||
-- Returns the texture that is going to be used for CC_Texture0.<br>
|
||||
-- Added to be backwards compatible.
|
||||
-- @function [parent=#RenderState] getTexture
|
||||
-- @param self
|
||||
|
@ -46,12 +46,6 @@
|
|||
-- @param self
|
||||
-- @return RenderState::StateBlock#RenderState::StateBlock ret (return value: cc.RenderState::StateBlock)
|
||||
|
||||
--------------------------------
|
||||
--
|
||||
-- @function [parent=#RenderState] getTextures
|
||||
-- @param self
|
||||
-- @return array_table#array_table ret (return value: array_table)
|
||||
|
||||
--------------------------------
|
||||
-- Static initializer that is called during game startup.
|
||||
-- @function [parent=#RenderState] initialize
|
||||
|
|
|
@ -81971,53 +81971,6 @@ int lua_cocos2dx_RenderState_getStateBlock(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_RenderState_getTextures(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::RenderState* 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.RenderState",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::RenderState*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_RenderState_getTextures'", 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_RenderState_getTextures'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
const cocos2d::Vector<cocos2d::Texture2D *>& ret = cobj->getTextures();
|
||||
ccvector_to_luaval(tolua_S, ret);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.RenderState:getTextures",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_RenderState_getTextures'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_RenderState_initialize(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -82070,7 +82023,6 @@ int lua_register_cocos2dx_RenderState(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"bind",lua_cocos2dx_RenderState_bind);
|
||||
tolua_function(tolua_S,"getName",lua_cocos2dx_RenderState_getName);
|
||||
tolua_function(tolua_S,"getStateBlock",lua_cocos2dx_RenderState_getStateBlock);
|
||||
tolua_function(tolua_S,"getTextures",lua_cocos2dx_RenderState_getTextures);
|
||||
tolua_function(tolua_S,"initialize", lua_cocos2dx_RenderState_initialize);
|
||||
tolua_endmodule(tolua_S);
|
||||
std::string typeName = typeid(cocos2d::RenderState).name();
|
||||
|
@ -91234,6 +91186,53 @@ int lua_cocos2dx_Component_isEnabled(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Component_onRemove(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Component* 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.Component",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Component_onRemove'", 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_Component_onRemove'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->onRemove();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Component:onRemove",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Component_onRemove'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Component_update(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -91378,7 +91377,7 @@ int lua_cocos2dx_Component_init(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Component_setOwner(lua_State* tolua_S)
|
||||
int lua_cocos2dx_Component_onAdd(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Component* cobj = nullptr;
|
||||
|
@ -91398,32 +91397,29 @@ int lua_cocos2dx_Component_setOwner(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Component_setOwner'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Component_onAdd'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
if (argc == 0)
|
||||
{
|
||||
cocos2d::Node* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::Node>(tolua_S, 2, "cc.Node",&arg0, "cc.Component:setOwner");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Component_setOwner'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Component_onAdd'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->setOwner(arg0);
|
||||
cobj->onAdd();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Component:setOwner",argc, 1);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Component:onAdd",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Component_setOwner'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Component_onAdd'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -91475,6 +91471,56 @@ int lua_cocos2dx_Component_getName(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Component_setOwner(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Component* 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.Component",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Component_setOwner'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Node* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::Node>(tolua_S, 2, "cc.Node",&arg0, "cc.Component:setOwner");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Component_setOwner'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->setOwner(arg0);
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Component:setOwner",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Component_setOwner'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_Component_create(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -91524,11 +91570,13 @@ int lua_register_cocos2dx_Component(lua_State* tolua_S)
|
|||
tolua_function(tolua_S,"setEnabled",lua_cocos2dx_Component_setEnabled);
|
||||
tolua_function(tolua_S,"setName",lua_cocos2dx_Component_setName);
|
||||
tolua_function(tolua_S,"isEnabled",lua_cocos2dx_Component_isEnabled);
|
||||
tolua_function(tolua_S,"onRemove",lua_cocos2dx_Component_onRemove);
|
||||
tolua_function(tolua_S,"update",lua_cocos2dx_Component_update);
|
||||
tolua_function(tolua_S,"getOwner",lua_cocos2dx_Component_getOwner);
|
||||
tolua_function(tolua_S,"init",lua_cocos2dx_Component_init);
|
||||
tolua_function(tolua_S,"setOwner",lua_cocos2dx_Component_setOwner);
|
||||
tolua_function(tolua_S,"onAdd",lua_cocos2dx_Component_onAdd);
|
||||
tolua_function(tolua_S,"getName",lua_cocos2dx_Component_getName);
|
||||
tolua_function(tolua_S,"setOwner",lua_cocos2dx_Component_setOwner);
|
||||
tolua_function(tolua_S,"create", lua_cocos2dx_Component_create);
|
||||
tolua_endmodule(tolua_S);
|
||||
std::string typeName = typeid(cocos2d::Component).name();
|
||||
|
|
|
@ -2050,6 +2050,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __cocos2dx_h__
|
||||
|
|
|
@ -3337,6 +3337,53 @@ int lua_register_cocos2dx_physics3d_Physics3DRigidBody(lua_State* tolua_S)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int lua_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DComponent* 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.Physics3DComponent",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Physics3DComponent*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics'", 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_physics3d_Physics3DComponent_syncNodeToPhysics'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->syncNodeToPhysics();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DComponent:syncNodeToPhysics",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -3387,7 +3434,7 @@ int lua_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld(lua_State* tolua
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(lua_State* tolua_S)
|
||||
int lua_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DComponent* cobj = nullptr;
|
||||
|
@ -3407,7 +3454,7 @@ int lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -3417,66 +3464,19 @@ int lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics(lua_State* tolua_S)
|
|||
{
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->syncToPhysics();
|
||||
cobj->syncPhysicsToNode();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DComponent:syncToPhysics",argc, 0);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DComponent:syncPhysicsToNode",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DComponent_syncToNode(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DComponent* 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.Physics3DComponent",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Physics3DComponent*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncToNode'", 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_physics3d_Physics3DComponent_syncToNode'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->syncToNode();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DComponent:syncToNode",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncToNode'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -3712,9 +3712,9 @@ int lua_register_cocos2dx_physics3d_Physics3DComponent(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"Physics3DComponent");
|
||||
tolua_function(tolua_S,"new",lua_cocos2dx_physics3d_Physics3DComponent_constructor);
|
||||
tolua_function(tolua_S,"syncNodeToPhysics",lua_cocos2dx_physics3d_Physics3DComponent_syncNodeToPhysics);
|
||||
tolua_function(tolua_S,"addToPhysicsWorld",lua_cocos2dx_physics3d_Physics3DComponent_addToPhysicsWorld);
|
||||
tolua_function(tolua_S,"syncToPhysics",lua_cocos2dx_physics3d_Physics3DComponent_syncToPhysics);
|
||||
tolua_function(tolua_S,"syncToNode",lua_cocos2dx_physics3d_Physics3DComponent_syncToNode);
|
||||
tolua_function(tolua_S,"syncPhysicsToNode",lua_cocos2dx_physics3d_Physics3DComponent_syncPhysicsToNode);
|
||||
tolua_function(tolua_S,"getPhysics3DObject",lua_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject);
|
||||
tolua_function(tolua_S,"setPhysics3DObject",lua_cocos2dx_physics3d_Physics3DComponent_setPhysics3DObject);
|
||||
tolua_function(tolua_S,"setSyncFlag",lua_cocos2dx_physics3d_Physics3DComponent_setSyncFlag);
|
||||
|
@ -3726,7 +3726,7 @@ int lua_register_cocos2dx_physics3d_Physics3DComponent(lua_State* tolua_S)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(lua_State* tolua_S)
|
||||
int lua_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::PhysicsSprite3D* cobj = nullptr;
|
||||
|
@ -3746,7 +3746,7 @@ int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -3756,24 +3756,24 @@ int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics(lua_State* tolua_S)
|
|||
{
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->syncToPhysics();
|
||||
cobj->syncNodeToPhysics();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsSprite3D:syncToPhysics",argc, 0);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsSprite3D:syncNodeToPhysics",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(lua_State* tolua_S)
|
||||
int lua_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::PhysicsSprite3D* cobj = nullptr;
|
||||
|
@ -3793,7 +3793,7 @@ int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(lua_State* tolua_S)
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -3803,19 +3803,19 @@ int lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode(lua_State* tolua_S)
|
|||
{
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->syncToNode();
|
||||
cobj->syncPhysicsToNode();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsSprite3D:syncToNode",argc, 0);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PhysicsSprite3D:syncPhysicsToNode",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -3967,8 +3967,8 @@ int lua_register_cocos2dx_physics3d_PhysicsSprite3D(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"PhysicsSprite3D");
|
||||
tolua_function(tolua_S,"new",lua_cocos2dx_physics3d_PhysicsSprite3D_constructor);
|
||||
tolua_function(tolua_S,"syncToPhysics",lua_cocos2dx_physics3d_PhysicsSprite3D_syncToPhysics);
|
||||
tolua_function(tolua_S,"syncToNode",lua_cocos2dx_physics3d_PhysicsSprite3D_syncToNode);
|
||||
tolua_function(tolua_S,"syncNodeToPhysics",lua_cocos2dx_physics3d_PhysicsSprite3D_syncNodeToPhysics);
|
||||
tolua_function(tolua_S,"syncPhysicsToNode",lua_cocos2dx_physics3d_PhysicsSprite3D_syncPhysicsToNode);
|
||||
tolua_function(tolua_S,"getPhysicsObj",lua_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj);
|
||||
tolua_function(tolua_S,"setSyncFlag",lua_cocos2dx_physics3d_PhysicsSprite3D_setSyncFlag);
|
||||
tolua_endmodule(tolua_S);
|
||||
|
@ -3978,6 +3978,56 @@ int lua_register_cocos2dx_physics3d_PhysicsSprite3D(lua_State* tolua_S)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_setGravity(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DWorld* 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.Physics3DWorld",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Physics3DWorld*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Vec3 arg0;
|
||||
|
||||
ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.Physics3DWorld:setGravity");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->setGravity(arg0);
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:setGravity",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_setGravity'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_stepSimulate(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
|
@ -4122,7 +4172,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_collisionChecking(lua_State* tolua_S)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* tolua_S)
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DWorld* cobj = nullptr;
|
||||
|
@ -4142,32 +4192,29 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* t
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
if (argc == 0)
|
||||
{
|
||||
cocos2d::Physics3DConstraint* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::Physics3DConstraint>(tolua_S, 2, "cc.Physics3DConstraint",&arg0, "cc.Physics3DWorld:removePhysics3DConstraint");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->removePhysics3DConstraint(arg0);
|
||||
cobj->removeAllPhysics3DObjects();
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removePhysics3DConstraint",argc, 1);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removeAllPhysics3DObjects",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -4266,7 +4313,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints(lua_Stat
|
|||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* tolua_S)
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_getGravity(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DWorld* cobj = nullptr;
|
||||
|
@ -4286,7 +4333,7 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* t
|
|||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr);
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -4296,19 +4343,69 @@ int lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects(lua_State* t
|
|||
{
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'", nullptr);
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->removeAllPhysics3DObjects();
|
||||
lua_settop(tolua_S, 1);
|
||||
cocos2d::Vec3 ret = cobj->getGravity();
|
||||
vec3_to_luaval(tolua_S, ret);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removeAllPhysics3DObjects",argc, 0);
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:getGravity",argc, 0);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects'.",&tolua_err);
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_getGravity'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
int lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint(lua_State* tolua_S)
|
||||
{
|
||||
int argc = 0;
|
||||
cocos2d::Physics3DWorld* 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.Physics3DWorld",0,&tolua_err)) goto tolua_lerror;
|
||||
#endif
|
||||
|
||||
cobj = (cocos2d::Physics3DWorld*)tolua_tousertype(tolua_S,1,0);
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
if (!cobj)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
argc = lua_gettop(tolua_S)-1;
|
||||
if (argc == 1)
|
||||
{
|
||||
cocos2d::Physics3DConstraint* arg0;
|
||||
|
||||
ok &= luaval_to_object<cocos2d::Physics3DConstraint>(tolua_S, 2, "cc.Physics3DConstraint",&arg0, "cc.Physics3DWorld:removePhysics3DConstraint");
|
||||
if(!ok)
|
||||
{
|
||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'", nullptr);
|
||||
return 0;
|
||||
}
|
||||
cobj->removePhysics3DConstraint(arg0);
|
||||
lua_settop(tolua_S, 1);
|
||||
return 1;
|
||||
}
|
||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Physics3DWorld:removePhysics3DConstraint",argc, 1);
|
||||
return 0;
|
||||
|
||||
#if COCOS2D_DEBUG >= 1
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint'.",&tolua_err);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -4630,13 +4727,15 @@ int lua_register_cocos2dx_physics3d_Physics3DWorld(lua_State* tolua_S)
|
|||
|
||||
tolua_beginmodule(tolua_S,"Physics3DWorld");
|
||||
tolua_function(tolua_S,"new",lua_cocos2dx_physics3d_Physics3DWorld_constructor);
|
||||
tolua_function(tolua_S,"setGravity",lua_cocos2dx_physics3d_Physics3DWorld_setGravity);
|
||||
tolua_function(tolua_S,"stepSimulate",lua_cocos2dx_physics3d_Physics3DWorld_stepSimulate);
|
||||
tolua_function(tolua_S,"needCollisionChecking",lua_cocos2dx_physics3d_Physics3DWorld_needCollisionChecking);
|
||||
tolua_function(tolua_S,"collisionChecking",lua_cocos2dx_physics3d_Physics3DWorld_collisionChecking);
|
||||
tolua_function(tolua_S,"removePhysics3DConstraint",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint);
|
||||
tolua_function(tolua_S,"removeAllPhysics3DObjects",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects);
|
||||
tolua_function(tolua_S,"isDebugDrawEnabled",lua_cocos2dx_physics3d_Physics3DWorld_isDebugDrawEnabled);
|
||||
tolua_function(tolua_S,"removeAllPhysics3DConstraints",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DConstraints);
|
||||
tolua_function(tolua_S,"removeAllPhysics3DObjects",lua_cocos2dx_physics3d_Physics3DWorld_removeAllPhysics3DObjects);
|
||||
tolua_function(tolua_S,"getGravity",lua_cocos2dx_physics3d_Physics3DWorld_getGravity);
|
||||
tolua_function(tolua_S,"removePhysics3DConstraint",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DConstraint);
|
||||
tolua_function(tolua_S,"addPhysics3DObject",lua_cocos2dx_physics3d_Physics3DWorld_addPhysics3DObject);
|
||||
tolua_function(tolua_S,"setDebugDrawEnable",lua_cocos2dx_physics3d_Physics3DWorld_setDebugDrawEnable);
|
||||
tolua_function(tolua_S,"removePhysics3DObject",lua_cocos2dx_physics3d_Physics3DWorld_removePhysics3DObject);
|
||||
|
|
|
@ -253,6 +253,8 @@ int register_all_cocos2dx_physics3d(lua_State* tolua_S);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "jni/JniHelper.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "base/CCEventListenerKeyboard.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
#define CLASS_NAME "org/cocos2dx/lib/Cocos2dxVideoHelper"
|
||||
|
@ -193,7 +194,7 @@ VideoPlayer::~VideoPlayer()
|
|||
|
||||
void VideoPlayer::setFileName(const std::string& fileName)
|
||||
{
|
||||
_videoURL = fileName;
|
||||
_videoURL = FileUtils::getInstance()->fullPathForFilename(fileName);
|
||||
_videoSource = VideoPlayer::Source::FILENAME;
|
||||
setVideoURLJNI(_videoPlayerIndex, (int)Source::FILENAME,_videoURL);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ using namespace cocos2d::experimental::ui;
|
|||
-(void) videoFinished:(NSNotification*) notification;
|
||||
-(void) playStateChange;
|
||||
|
||||
+(NSString*) fullPathFromRelativePath:(NSString*) relPath;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -138,8 +137,7 @@ using namespace cocos2d::experimental::ui;
|
|||
self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
|
||||
[self.moviePlayer setContentURL:[NSURL URLWithString:@(videoUrl.c_str())]];
|
||||
} else {
|
||||
NSString *path = [UIVideoViewWrapperIos fullPathFromRelativePath:@(videoUrl.c_str())];
|
||||
self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]] autorelease];
|
||||
self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:@(videoUrl.c_str())]] autorelease];
|
||||
self.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
|
||||
}
|
||||
self.moviePlayer.allowsAirPlay = false;
|
||||
|
@ -260,10 +258,6 @@ using namespace cocos2d::experimental::ui;
|
|||
}
|
||||
}
|
||||
|
||||
+(NSString*) fullPathFromRelativePath:(NSString*) relPath
|
||||
{
|
||||
return [NSString stringWithCString: cocos2d::FileUtils::getInstance()->fullPathForFilename(std::string([relPath UTF8String])).c_str() encoding: [NSString defaultCStringEncoding]];
|
||||
}
|
||||
@end
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -293,7 +287,7 @@ VideoPlayer::~VideoPlayer()
|
|||
|
||||
void VideoPlayer::setFileName(const std::string& fileName)
|
||||
{
|
||||
_videoURL = fileName;
|
||||
_videoURL = FileUtils::getInstance()->fullPathForFilename(fileName);
|
||||
_videoSource = VideoPlayer::Source::FILENAME;
|
||||
[((UIVideoViewWrapperIos*)_videoView) setURL:(int)_videoSource :_videoURL];
|
||||
}
|
||||
|
|
|
@ -199,10 +199,10 @@ class CocosZipInstaller(object):
|
|||
print("==> Extraction done!")
|
||||
|
||||
def ask_to_delete_downloaded_zip_file(self):
|
||||
ret = self.get_input_value("==> Do you want to keep '%s'? So you don't have to download it later. (yes/no): " % self._filename)
|
||||
ret = self.get_input_value("==> Would you like to save '%s'? So you don't have to download it later. [Yes/no]: " % self._filename)
|
||||
ret = ret.strip()
|
||||
if ret != 'yes' and ret != 'y' and ret != 'no' and ret != 'n':
|
||||
print("==> Cache the dependency libraries by default")
|
||||
print("==> Saving the dependency libraries by default")
|
||||
return False
|
||||
else:
|
||||
return True if ret == 'no' or ret == 'n' else False
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version":"v3-deps-57",
|
||||
"version":"v3-deps-62",
|
||||
"zip_file_size":"138162176",
|
||||
"repo_name":"cocos2d-x-3rd-party-libs-bin",
|
||||
"repo_parent":"https://github.com/cocos2d/",
|
||||
|
|
|
@ -2999,6 +2999,12 @@
|
|||
"external/recast/fastlz/fastlz.h",
|
||||
"external/recast/proj.win32/librecast.vcxproj",
|
||||
"external/recast/proj.win32/librecast.vcxproj.filters",
|
||||
"external/recast/proj.win8.1-universal/librecast.Shared/librecast.Shared.vcxitems",
|
||||
"external/recast/proj.win8.1-universal/librecast.Shared/librecast.Shared.vcxitems.filters",
|
||||
"external/recast/proj.win8.1-universal/librecast.Windows/librecast.Windows.vcxproj",
|
||||
"external/recast/proj.win8.1-universal/librecast.Windows/librecast.Windows.vcxproj.filters",
|
||||
"external/recast/proj.win8.1-universal/librecast.WindowsPhone/librecast.WindowsPhone.vcxproj",
|
||||
"external/recast/proj.win8.1-universal/librecast.WindowsPhone/librecast.WindowsPhone.vcxproj.filters",
|
||||
"external/sqlite3/Android.mk",
|
||||
"external/sqlite3/include/sqlite3.h",
|
||||
"external/sqlite3/include/sqlite3ext.h",
|
||||
|
@ -3126,6 +3132,23 @@
|
|||
"external/websockets/prebuilt/wp_8.1/arm/libwebsockets.lib",
|
||||
"external/websockets/prebuilt/wp_8.1/win32/libwebsockets.dll",
|
||||
"external/websockets/prebuilt/wp_8.1/win32/libwebsockets.lib",
|
||||
"external/win10-specific/OggDecoder/include/ogg/ogg.h",
|
||||
"external/win10-specific/OggDecoder/include/ogg/os_types.h",
|
||||
"external/win10-specific/OggDecoder/include/vorbis/codec.h",
|
||||
"external/win10-specific/OggDecoder/include/vorbis/vorbisenc.h",
|
||||
"external/win10-specific/OggDecoder/include/vorbis/vorbisfile.h",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libogg.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libogg.lib",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libvorbis.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libvorbis.lib",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libvorbisfile.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/arm/libvorbisfile.lib",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libogg.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libogg.lib",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libvorbis.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libvorbis.lib",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libvorbisfile.dll",
|
||||
"external/win10-specific/OggDecoder/prebuilt/win32/libvorbisfile.lib",
|
||||
"external/win10-specific/angle/include/EGL/egl.h",
|
||||
"external/win10-specific/angle/include/EGL/eglext.h",
|
||||
"external/win10-specific/angle/include/EGL/eglplatform.h",
|
||||
|
@ -3218,6 +3241,23 @@
|
|||
"external/winrt-specific/zlib/include/zlib.vcxproj.filters",
|
||||
"external/winrt-specific/zlib/prebuilt/ARM/zlib.lib",
|
||||
"external/winrt-specific/zlib/prebuilt/Win32/zlib.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/include/ogg/ogg.h",
|
||||
"external/winrt_8.1-specific/OggDecoder/include/ogg/os_types.h",
|
||||
"external/winrt_8.1-specific/OggDecoder/include/vorbis/codec.h",
|
||||
"external/winrt_8.1-specific/OggDecoder/include/vorbis/vorbisenc.h",
|
||||
"external/winrt_8.1-specific/OggDecoder/include/vorbis/vorbisfile.h",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libogg.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libogg.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libvorbis.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libvorbis.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libvorbisfile.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/arm/libvorbisfile.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libogg.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libogg.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libvorbis.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libvorbis.lib",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libvorbisfile.dll",
|
||||
"external/winrt_8.1-specific/OggDecoder/prebuilt/win32/libvorbisfile.lib",
|
||||
"external/winrt_8.1-specific/angle/include/EGL/egl.h",
|
||||
"external/winrt_8.1-specific/angle/include/EGL/eglext.h",
|
||||
"external/winrt_8.1-specific/angle/include/EGL/eglplatform.h",
|
||||
|
@ -3246,6 +3286,23 @@
|
|||
"external/winrt_8.1-specific/zlib/include/zlib.h",
|
||||
"external/winrt_8.1-specific/zlib/prebuilt/arm/zlib.lib",
|
||||
"external/winrt_8.1-specific/zlib/prebuilt/win32/zlib.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/include/ogg/ogg.h",
|
||||
"external/wp_8.1-specific/OggDecoder/include/ogg/os_types.h",
|
||||
"external/wp_8.1-specific/OggDecoder/include/vorbis/codec.h",
|
||||
"external/wp_8.1-specific/OggDecoder/include/vorbis/vorbisenc.h",
|
||||
"external/wp_8.1-specific/OggDecoder/include/vorbis/vorbisfile.h",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libogg.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libogg.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libvorbis.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libvorbis.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libvorbisfile.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/arm/libvorbisfile.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libogg.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libogg.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libvorbis.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libvorbis.lib",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libvorbisfile.dll",
|
||||
"external/wp_8.1-specific/OggDecoder/prebuilt/win32/libvorbisfile.lib",
|
||||
"external/wp_8.1-specific/angle/include/EGL/egl.h",
|
||||
"external/wp_8.1-specific/angle/include/EGL/eglext.h",
|
||||
"external/wp_8.1-specific/angle/include/EGL/eglplatform.h",
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
|
||||
USING_NS_CC;
|
||||
|
||||
static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320);
|
||||
static cocos2d::Size smallResolutionSize = cocos2d::Size(480, 320);
|
||||
static cocos2d::Size mediumResolutionSize = cocos2d::Size(1024, 768);
|
||||
static cocos2d::Size largeResolutionSize = cocos2d::Size(2048, 1536);
|
||||
|
||||
AppDelegate::AppDelegate() {
|
||||
|
||||
}
|
||||
|
@ -44,6 +49,25 @@ bool AppDelegate::applicationDidFinishLaunching() {
|
|||
// set FPS. the default value is 1.0/60 if you don't call this
|
||||
director->setAnimationInterval(1.0 / 60);
|
||||
|
||||
// Set the design resolution
|
||||
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
|
||||
Size frameSize = glview->getFrameSize();
|
||||
// if the frame's height is larger than the height of medium size.
|
||||
if (frameSize.height > mediumResolutionSize.height)
|
||||
{
|
||||
director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
|
||||
}
|
||||
// if the frame's height is larger than the height of small size.
|
||||
else if (frameSize.height > smallResolutionSize.height)
|
||||
{
|
||||
director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
|
||||
}
|
||||
// if the frame's height is smaller than the height of medium size.
|
||||
else
|
||||
{
|
||||
director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
|
||||
}
|
||||
|
||||
register_all_packages();
|
||||
|
||||
// create a scene. it's an autorelease object
|
||||
|
|
|
@ -51,10 +51,11 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
|
|||
mRenderSurface(EGL_NO_SURFACE),
|
||||
mCustomRenderSurfaceSize(0,0),
|
||||
mUseCustomRenderSurfaceSize(false),
|
||||
m_coreInput(nullptr),
|
||||
m_dpi(0.0f),
|
||||
m_deviceLost(false),
|
||||
m_orientation(DisplayOrientations::Landscape)
|
||||
mCoreInput(nullptr),
|
||||
mDpi(0.0f),
|
||||
mDeviceLost(false),
|
||||
mVisible(false),
|
||||
mOrientation(DisplayOrientations::Landscape)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -77,7 +78,7 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
|
|||
currentDisplayInformation->OrientationChanged +=
|
||||
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &OpenGLESPage::OnOrientationChanged);
|
||||
|
||||
m_orientation = currentDisplayInformation->CurrentOrientation;
|
||||
mOrientation = currentDisplayInformation->CurrentOrientation;
|
||||
|
||||
this->Loaded +=
|
||||
ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);
|
||||
|
@ -111,23 +112,23 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
|
|||
auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
|
||||
{
|
||||
// The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on.
|
||||
m_coreInput = swapChainPanel->CreateCoreIndependentInputSource(
|
||||
mCoreInput = swapChainPanel->CreateCoreIndependentInputSource(
|
||||
Windows::UI::Core::CoreInputDeviceTypes::Mouse |
|
||||
Windows::UI::Core::CoreInputDeviceTypes::Touch |
|
||||
Windows::UI::Core::CoreInputDeviceTypes::Pen
|
||||
);
|
||||
|
||||
// Register for pointer events, which will be raised on the background thread.
|
||||
m_coreInput->PointerPressed += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerPressed);
|
||||
m_coreInput->PointerMoved += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerMoved);
|
||||
m_coreInput->PointerReleased += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerReleased);
|
||||
mCoreInput->PointerPressed += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerPressed);
|
||||
mCoreInput->PointerMoved += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerMoved);
|
||||
mCoreInput->PointerReleased += ref new TypedEventHandler<Object^, PointerEventArgs^>(this, &OpenGLESPage::OnPointerReleased);
|
||||
|
||||
// Begin processing input messages as they're delivered.
|
||||
m_coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
|
||||
mCoreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
|
||||
});
|
||||
|
||||
// Run task on a dedicated high priority background thread.
|
||||
m_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
|
||||
mInputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);
|
||||
}
|
||||
|
||||
OpenGLESPage::~OpenGLESPage()
|
||||
|
@ -141,29 +142,30 @@ void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::Rou
|
|||
// The SwapChainPanel has been created and arranged in the page layout, so EGL can be initialized.
|
||||
CreateRenderSurface();
|
||||
StartRenderLoop();
|
||||
mVisible = true;
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueuePointerEvent(PointerEventType::PointerPressed, e);
|
||||
mRenderer->QueuePointerEvent(PointerEventType::PointerPressed, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueuePointerEvent(PointerEventType::PointerMoved, e);
|
||||
mRenderer->QueuePointerEvent(PointerEventType::PointerMoved, e);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e)
|
||||
{
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueuePointerEvent(PointerEventType::PointerReleased, e);
|
||||
mRenderer->QueuePointerEvent(PointerEventType::PointerReleased, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,9 +174,9 @@ void OpenGLESPage::OnKeyPressed(CoreWindow^ sender, KeyEventArgs^ e)
|
|||
if (!e->KeyStatus.WasKeyDown)
|
||||
{
|
||||
//log("OpenGLESPage::OnKeyPressed %d", e->VirtualKey);
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyPressed, e);
|
||||
mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyPressed, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,9 +194,9 @@ void OpenGLESPage::OnCharacterReceived(CoreWindow^ sender, CharacterReceivedEven
|
|||
void OpenGLESPage::OnKeyReleased(CoreWindow^ sender, KeyEventArgs^ e)
|
||||
{
|
||||
//log("OpenGLESPage::OnKeyReleased %d", e->VirtualKey);
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyReleased, e);
|
||||
mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyReleased, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,18 +204,20 @@ void OpenGLESPage::OnKeyReleased(CoreWindow^ sender, KeyEventArgs^ e)
|
|||
void OpenGLESPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
|
||||
{
|
||||
critical_section::scoped_lock lock(mSwapChainPanelSizeCriticalSection);
|
||||
m_orientation = sender->CurrentOrientation;
|
||||
mOrientation = sender->CurrentOrientation;
|
||||
}
|
||||
|
||||
void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args)
|
||||
{
|
||||
if (args->Visible && mRenderSurface != EGL_NO_SURFACE)
|
||||
{
|
||||
StartRenderLoop();
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mVisible = true;
|
||||
mSleepCondition.notify_one();
|
||||
}
|
||||
else
|
||||
{
|
||||
StopRenderLoop();
|
||||
mVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,15 +234,14 @@ void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Wi
|
|||
*/
|
||||
void OpenGLESPage::OnBackButtonPressed(Object^ sender, BackPressedEventArgs^ args)
|
||||
{
|
||||
if (m_renderer)
|
||||
if (mRenderer)
|
||||
{
|
||||
m_renderer->QueueBackButtonEvent();
|
||||
mRenderer->QueueBackButtonEvent();
|
||||
args->Handled = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void OpenGLESPage::OnSwapChainPanelSizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
|
||||
{
|
||||
// Size change events occur outside of the render thread. A lock is required when updating
|
||||
|
@ -290,20 +293,14 @@ void OpenGLESPage::DestroyRenderSurface()
|
|||
}
|
||||
|
||||
void OpenGLESPage::RecoverFromLostDevice()
|
||||
{
|
||||
// Stop the render loop, reset OpenGLES, recreate the render surface
|
||||
// and start the render loop again to recover from a lost device.
|
||||
|
||||
StopRenderLoop();
|
||||
|
||||
{
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
DestroyRenderSurface();
|
||||
mOpenGLES->Reset();
|
||||
CreateRenderSurface();
|
||||
}
|
||||
|
||||
StartRenderLoop();
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mDeviceLost = false;
|
||||
mSleepCondition.notify_one();
|
||||
}
|
||||
|
||||
void OpenGLESPage::TerminateApp()
|
||||
|
@ -316,7 +313,6 @@ void OpenGLESPage::TerminateApp()
|
|||
mOpenGLES->DestroySurface(mRenderSurface);
|
||||
mOpenGLES->Cleanup();
|
||||
}
|
||||
|
||||
}
|
||||
Windows::UI::Xaml::Application::Current->Exit();
|
||||
}
|
||||
|
@ -330,45 +326,60 @@ void OpenGLESPage::StartRenderLoop()
|
|||
}
|
||||
|
||||
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
||||
m_dpi = currentDisplayInformation->LogicalDpi;
|
||||
mDpi = currentDisplayInformation->LogicalDpi;
|
||||
|
||||
auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher;
|
||||
|
||||
// Create a task for rendering that will be run on a background thread.
|
||||
auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action)
|
||||
{
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
|
||||
mOpenGLES->MakeCurrent(mRenderSurface);
|
||||
|
||||
GLsizei panelWidth = 0;
|
||||
GLsizei panelHeight = 0;
|
||||
GetSwapChainPanelSize(&panelWidth, &panelHeight);
|
||||
|
||||
if (m_renderer.get() == nullptr)
|
||||
if (mRenderer.get() == nullptr)
|
||||
{
|
||||
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, m_dpi, m_orientation, dispatcher, swapChainPanel);
|
||||
mRenderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, mDpi, mOrientation, dispatcher, swapChainPanel);
|
||||
}
|
||||
|
||||
if (m_deviceLost)
|
||||
mRenderer->Resume();
|
||||
|
||||
while (action->Status == Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
m_deviceLost = false;
|
||||
m_renderer->DeviceLost();
|
||||
}
|
||||
else
|
||||
if (!mVisible)
|
||||
{
|
||||
m_renderer->Resume();
|
||||
mRenderer->Pause();
|
||||
}
|
||||
|
||||
|
||||
while (action->Status == Windows::Foundation::AsyncStatus::Started && !m_deviceLost)
|
||||
// wait until app is visible again or thread is cancelled
|
||||
while (!mVisible)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mSleepMutex);
|
||||
mSleepCondition.wait(lock);
|
||||
|
||||
if (action->Status != Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
return; // thread was cancelled. Exit thread
|
||||
}
|
||||
|
||||
if (mVisible)
|
||||
{
|
||||
mRenderer->Resume();
|
||||
}
|
||||
else // spurious wake up
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
GetSwapChainPanelSize(&panelWidth, &panelHeight);
|
||||
m_renderer.get()->Draw(panelWidth, panelHeight, m_dpi, m_orientation);
|
||||
mRenderer.get()->Draw(panelWidth, panelHeight, mDpi, mOrientation);
|
||||
|
||||
// run on main UI thread
|
||||
if (m_renderer->AppShouldExit())
|
||||
if (mRenderer->AppShouldExit())
|
||||
{
|
||||
// run on main UI thread
|
||||
swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
|
||||
{
|
||||
TerminateApp();
|
||||
|
@ -376,31 +387,48 @@ void OpenGLESPage::StartRenderLoop()
|
|||
|
||||
return;
|
||||
}
|
||||
else if (mOpenGLES->SwapBuffers(mRenderSurface) != GL_TRUE)
|
||||
{
|
||||
// The call to eglSwapBuffers might not be successful (i.e. due to Device Lost)
|
||||
// If the call fails, then we must reinitialize EGL and the GL resources.
|
||||
|
||||
m_deviceLost = true;
|
||||
|
||||
if (m_renderer)
|
||||
EGLBoolean result = GL_FALSE;
|
||||
{
|
||||
m_renderer->Pause();
|
||||
critical_section::scoped_lock lock(mRenderSurfaceCriticalSection);
|
||||
result = mOpenGLES->SwapBuffers(mRenderSurface);
|
||||
}
|
||||
|
||||
if (result != GL_TRUE)
|
||||
{
|
||||
// The call to eglSwapBuffers was not be successful (i.e. due to Device Lost)
|
||||
// If the call fails, then we must reinitialize EGL and the GL resources.
|
||||
mRenderer->Pause();
|
||||
mDeviceLost = true;
|
||||
|
||||
// XAML objects like the SwapChainPanel must only be manipulated on the UI thread.
|
||||
swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]()
|
||||
{
|
||||
RecoverFromLostDevice();
|
||||
}, CallbackContext::Any));
|
||||
|
||||
return;
|
||||
}
|
||||
// wait until OpenGL is reset or thread is cancelled
|
||||
while (mDeviceLost)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mSleepMutex);
|
||||
mSleepCondition.wait(lock);
|
||||
|
||||
if (action->Status != Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
return; // thread was cancelled. Exit thread
|
||||
}
|
||||
|
||||
if (m_renderer)
|
||||
if (!mDeviceLost)
|
||||
{
|
||||
m_renderer->Pause();
|
||||
// restart cocos2d-x
|
||||
mRenderer->DeviceLost();
|
||||
}
|
||||
else // spurious wake up
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -413,6 +441,8 @@ void OpenGLESPage::StopRenderLoop()
|
|||
if (mRenderLoopWorker)
|
||||
{
|
||||
mRenderLoopWorker->Cancel();
|
||||
std::unique_lock<std::mutex> locker(mSleepMutex);
|
||||
mSleepCondition.notify_one();
|
||||
mRenderLoopWorker = nullptr;
|
||||
}
|
||||
}
|
|
@ -21,6 +21,8 @@
|
|||
#include "OpenGLES.h"
|
||||
#include "OpenGLESPage.g.h"
|
||||
#include <memory>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#include "Cocos2dRenderer.h"
|
||||
|
||||
|
@ -51,7 +53,7 @@ namespace cocos2d
|
|||
void StopRenderLoop();
|
||||
|
||||
OpenGLES* mOpenGLES;
|
||||
std::shared_ptr<cocos2d::Cocos2dRenderer> m_renderer;
|
||||
std::shared_ptr<cocos2d::Cocos2dRenderer> mRenderer;
|
||||
|
||||
Windows::Foundation::Size mSwapChainPanelSize;
|
||||
Concurrency::critical_section mSwapChainPanelSizeCriticalSection;
|
||||
|
@ -64,8 +66,8 @@ namespace cocos2d
|
|||
Windows::Foundation::IAsyncAction^ mRenderLoopWorker;
|
||||
|
||||
// Track user input on a background worker thread.
|
||||
Windows::Foundation::IAsyncAction^ m_inputLoopWorker;
|
||||
Windows::UI::Core::CoreIndependentInputSource^ m_coreInput;
|
||||
Windows::Foundation::IAsyncAction^ mInputLoopWorker;
|
||||
Windows::UI::Core::CoreIndependentInputSource^ mCoreInput;
|
||||
|
||||
// Independent input handling functions.
|
||||
void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
||||
|
@ -77,9 +79,12 @@ namespace cocos2d
|
|||
|
||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||
|
||||
float m_dpi;
|
||||
bool m_deviceLost;
|
||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
||||
float mDpi;
|
||||
bool mDeviceLost;
|
||||
bool mVisible;
|
||||
Windows::Graphics::Display::DisplayOrientations mOrientation;
|
||||
|
||||
std::mutex mSleepMutex;
|
||||
std::condition_variable mSleepCondition;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
<DependentUpon>$(MSBuildThisFileDirectory)OpenGLESPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\AppDelegate.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\AppMacros.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\HelloWorldScene.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)App.xaml.h">
|
||||
<DependentUpon>$(MSBuildThisFileDirectory)App.xaml</DependentUpon>
|
||||
|
@ -35,6 +34,7 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Cocos2dRenderer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)OpenGLES.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)OpenGLESPage.xaml.h">
|
||||
<DependentUpon>$(MSBuildThisFileDirectory)OpenGLESPage.xaml</DependentUpon>
|
||||
|
|
|
@ -27,14 +27,12 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\AppDelegate.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\AppMacros.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\HelloWorldScene.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)OpenGLES.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)OpenGLESPage.xaml.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Cocos2dRenderer.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="$(MSBuildThisFileDirectory)OpenGLESPage.xaml" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
|
||||
<Identity Name="C0E598E8-4FFC-4646-BCB9-2E3F383135D3" Publisher="CN=msopentech" Version="1.0.0.0" />
|
||||
<Identity Name="72E03097-0A54-455B-97D7-45DF07333C1A" Publisher="CN=msopentech" Version="1.0.0.0" />
|
||||
<Properties>
|
||||
<DisplayName>HelloCpp.Windows</DisplayName>
|
||||
<PublisherDisplayName>msopentech</PublisherDisplayName>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
|
||||
<Identity Name="33990434-935A-446E-8F50-03715968962D" Publisher="CN=dalestam" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="c0051f3e-b3cc-428c-91e3-6bd297b8a88d" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Identity Name="6136306D-4E1C-4339-85A7-964D852DB9A6" Publisher="CN=dalestam" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="24d2f8cc-f033-491e-90ce-f498d794d2be" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>HelloCpp.WindowsPhone</DisplayName>
|
||||
<PublisherDisplayName>msopentech</PublisherDisplayName>
|
||||
|
|
|
@ -154,16 +154,16 @@
|
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
|
@ -176,16 +176,16 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
|
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
@ -198,16 +198,16 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
|
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
@ -220,16 +220,16 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
|
|||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
@ -242,16 +242,16 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
|
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -263,16 +263,16 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
|
|||
<AdditionalIncludeDirectories>..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>echo "Copying Windows 8.1 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /eiycq</Command>
|
||||
<Command>echo "Copying Windows 10.0 Universal App CPP template files"
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq
|
||||
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -68,6 +68,9 @@
|
|||
<None Include="$(WebsocketsBinPath)libwebsockets.dll" />
|
||||
<None Include="$(ZLibBinPath)zlib.dll" />
|
||||
<None Include="$(SQLiteBinPath)sqlite3.dll" />
|
||||
<None Include="$(OggBinPath)libogg.dll" />
|
||||
<None Include="$(OggBinPath)libvorbis.dll" />
|
||||
<None Include="$(OggBinPath)libvorbisfile.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml" />
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<PackageCertificateKeyFile>HelloCpp.Windows_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||
<AppxBundlePlatforms>x86</AppxBundlePlatforms>
|
||||
<PackageCertificateThumbprint>F75DA75441DF3361D325C567D0B34DA34BD31EED</PackageCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
|
||||
<Identity Name="a39cf818-af13-4d5f-9d18-3dbac1159b33" Publisher="CN=msopentech" Version="1.0.0.6" />
|
||||
<Identity Name="F77B1E28-4A19-4C6F-BC04-ED4B3B899C5D" Publisher="CN=msopentech" Version="1.0.0.0" />
|
||||
<Properties>
|
||||
<DisplayName>HelloCpp.Windows</DisplayName>
|
||||
<PublisherDisplayName>msopentech</PublisherDisplayName>
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||
<AppxBundlePlatforms>arm</AppxBundlePlatforms>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
|
||||
<Identity Name="839e6be3-2571-47d8-910b-1d7386788d3b" Publisher="CN=dalestam" Version="1.0.0.5" />
|
||||
<mp:PhoneIdentity PhoneProductId="839e6be3-2571-47d8-910b-1d7386788d3b" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Identity Name="E16926F3-83FF-439F-A726-0AFE21D9D1DF" Publisher="CN=dalestam" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="b2afbf32-b144-4d43-ad66-7cdd618d17c6" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>HelloCpp.WindowsPhone</DisplayName>
|
||||
<PublisherDisplayName>msopentech</PublisherDisplayName>
|
||||
|
|
|
@ -18,9 +18,9 @@ bool EnemyController::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void EnemyController::onEnter()
|
||||
void EnemyController::onAdd()
|
||||
{
|
||||
ComController::onEnter();
|
||||
ComController::onAdd();
|
||||
// Determine where to spawn the target along the Y axis
|
||||
Size winSize = Director::getInstance()->getVisibleSize();
|
||||
float minY = getOwner()->getContentSize().height/2;
|
||||
|
@ -52,7 +52,7 @@ void EnemyController::onEnter()
|
|||
_owner->runAction( Sequence::create(actionMove, actionMoveDone, nullptr) );
|
||||
}
|
||||
|
||||
void EnemyController::onExit()
|
||||
void EnemyController::onRemove()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ protected:
|
|||
|
||||
public:
|
||||
virtual bool init() override;
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
virtual void onAdd() override;
|
||||
virtual void onRemove() override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
static EnemyController* create(void);
|
||||
|
|
|
@ -20,13 +20,13 @@ bool PlayerController::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void PlayerController::onEnter()
|
||||
void PlayerController::onAdd()
|
||||
{
|
||||
ComController::onEnter();
|
||||
ComController::onAdd();
|
||||
setTouchEnabled(true);
|
||||
}
|
||||
|
||||
void PlayerController::onExit()
|
||||
void PlayerController::onRemove()
|
||||
{
|
||||
setTouchEnabled(false);
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ public:
|
|||
|
||||
public:
|
||||
virtual bool init() override;
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
virtual void onAdd() override;
|
||||
virtual void onRemove() override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
static PlayerController* create(void);
|
||||
|
|
|
@ -19,9 +19,9 @@ bool ProjectileController::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void ProjectileController::onEnter()
|
||||
void ProjectileController::onAdd()
|
||||
{
|
||||
ComController::onEnter();
|
||||
ComController::onAdd();
|
||||
auto winSize = Director::getInstance()->getVisibleSize();
|
||||
auto origin = Director::getInstance()->getVisibleOrigin();
|
||||
_owner->setPosition( Vec2(origin.x+20, origin.y+winSize.height/2) );
|
||||
|
@ -30,7 +30,7 @@ void ProjectileController::onEnter()
|
|||
static_cast<SceneController*>(com)->getProjectiles().pushBack(_owner);
|
||||
}
|
||||
|
||||
void ProjectileController::onExit()
|
||||
void ProjectileController::onRemove()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ protected:
|
|||
|
||||
public:
|
||||
virtual bool init() override;
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
virtual void onAdd() override;
|
||||
virtual void onRemove() override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
static ProjectileController* create(void);
|
||||
|
|
|
@ -24,16 +24,16 @@ bool SceneController::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void SceneController::onEnter()
|
||||
void SceneController::onAdd()
|
||||
{
|
||||
ComController::onEnter();
|
||||
ComController::onAdd();
|
||||
_fAddTargetTime = 1.0f;
|
||||
|
||||
static_cast<ComAudio*>(_owner->getComponent("Audio"))->playBackgroundMusic("background.wav", true);
|
||||
static_cast<ComAttribute*>(_owner->getComponent("CCComAttribute"))->setInt("KillCount", 0);
|
||||
}
|
||||
|
||||
void SceneController::onExit()
|
||||
void SceneController::onRemove()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ protected:
|
|||
|
||||
public:
|
||||
virtual bool init() override;
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
virtual void onAdd() override;
|
||||
virtual void onRemove() override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
static SceneController* create();
|
||||
|
|
|
@ -210,7 +210,7 @@ void Physics3DTestDemo::shootBox( const cocos2d::Vec3 &des )
|
|||
this->addChild(sprite);
|
||||
sprite->setPosition3D(_camera->getPosition3D());
|
||||
sprite->setScale(0.5f);
|
||||
sprite->syncToNode();
|
||||
sprite->syncNodeToPhysics();
|
||||
|
||||
//optimize, only sync node to physics
|
||||
sprite->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE); //sync node to physics
|
||||
|
@ -239,7 +239,7 @@ bool BasicPhysics3DDemo::init()
|
|||
floor->setScaleZ(60);
|
||||
this->addChild(floor);
|
||||
floor->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
floor->syncToNode();
|
||||
floor->syncNodeToPhysics();
|
||||
//static object sync is not needed
|
||||
floor->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::NONE);
|
||||
|
||||
|
@ -263,7 +263,7 @@ bool BasicPhysics3DDemo::init()
|
|||
auto sprite = PhysicsSprite3D::create("Sprite3DTest/box.c3t", &rbDes);
|
||||
sprite->setTexture("Images/CyanSquare.png");
|
||||
sprite->setPosition3D(Vec3(x, y, z));
|
||||
sprite->syncToNode();
|
||||
sprite->syncNodeToPhysics();
|
||||
sprite->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
sprite->setScale(0.8f);
|
||||
|
@ -303,7 +303,7 @@ bool Physics3DKinematicDemo::init()
|
|||
floor->setPosition3D(Vec3(0.f, -1.f, 0.f));
|
||||
this->addChild(floor);
|
||||
floor->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
floor->syncToNode();
|
||||
floor->syncNodeToPhysics();
|
||||
//static object sync is not needed
|
||||
floor->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::NONE);
|
||||
|
||||
|
@ -354,7 +354,7 @@ bool Physics3DKinematicDemo::init()
|
|||
sprite->setScale(1.0f / sprite->getContentSize().width);
|
||||
this->addChild(sprite);
|
||||
sprite->setPosition3D(Vec3(x, y, z));
|
||||
sprite->syncToNode();
|
||||
sprite->syncNodeToPhysics();
|
||||
|
||||
sprite->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE);
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->setScale(0.4f);
|
||||
sprite->setPosition3D(Vec3(-20.f, 5.f, 0.f));
|
||||
//sync node position to physics
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
//physics controlled, we will not set position for it, so we can skip sync node position to physics
|
||||
component->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE);
|
||||
|
||||
|
@ -414,7 +414,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->addComponent(component);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(sprite);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
rigidBody->setAngularVelocity(Vec3(0,3,0));
|
||||
constraint = Physics3DHingeConstraint::create(rigidBody, Vec3(4.f, 4.f, 0.5f), Vec3(0.f, 1.f, 0.f));
|
||||
physicsScene->getPhysics3DWorld()->addPhysics3DConstraint(constraint);
|
||||
|
@ -433,7 +433,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->addComponent(component);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(sprite);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
rigidBody->setLinearVelocity(Vec3(0,3,0));
|
||||
|
||||
rbDes.mass = 0.0f;
|
||||
|
@ -447,7 +447,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->addComponent(component);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(sprite);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
|
||||
Mat4 frameInA, frameInB;
|
||||
Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA);
|
||||
|
@ -471,7 +471,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->addComponent(component);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(sprite);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
|
||||
Mat4::createRotationZ(CC_DEGREES_TO_RADIANS(90), &frameInA);
|
||||
frameInA.m[12] = 0.f;
|
||||
|
@ -493,7 +493,7 @@ bool Physics3DConstraintDemo::init()
|
|||
sprite->addComponent(component);
|
||||
sprite->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(sprite);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
frameInA.setIdentity();
|
||||
constraint = Physics3D6DofConstraint::create(rigidBody, frameInA, false);
|
||||
physicsScene->getPhysics3DWorld()->addPhysics3DConstraint(constraint);
|
||||
|
@ -592,7 +592,7 @@ bool Physics3DTerrainDemo::init()
|
|||
auto component = Physics3DComponent::create(rigidBody);
|
||||
terrain->addComponent(component);
|
||||
this->addChild(terrain);
|
||||
component->syncToNode();
|
||||
component->syncNodeToPhysics();
|
||||
component->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::NONE);
|
||||
|
||||
|
||||
|
@ -619,7 +619,7 @@ bool Physics3DTerrainDemo::init()
|
|||
sprite->setScale(1.0f / sprite->getContentSize().width);
|
||||
sprite->setPosition3D(Vec3(x, y, z));
|
||||
this->addChild(sprite);
|
||||
sprite->syncToNode();
|
||||
sprite->syncNodeToPhysics();
|
||||
sprite->setSyncFlag(Physics3DComponent::PhysicsSyncFlag::PHYSICS_TO_NODE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,22 +22,23 @@ material spaceship
|
|||
// renderState:
|
||||
// resposinble for depth buffer, cullface, stencil, blending, etc.
|
||||
// shader:
|
||||
// responsible for the vertex and frag shaders, and its uniforms
|
||||
// sampler:
|
||||
// responsible for setting the texture and its parameters
|
||||
// responsible for the vertex and frag shaders, and its uniforms, including the samplers
|
||||
pass 0
|
||||
{
|
||||
shader
|
||||
{
|
||||
vertexShader = Shaders3D/3d_position_tex.vert
|
||||
fragmentShader = Shaders3D/3d_color_tex.frag
|
||||
}
|
||||
sampler 0
|
||||
// sampler:
|
||||
// responsible for setting the texture and its parameters
|
||||
// the Id of the sampler is the uniform name
|
||||
sampler u_sampler0
|
||||
{
|
||||
path = Sprite3DTest/boss.png
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is another technique. It "outlines" the model
|
||||
// It has 3 passes in order to get the desired effect
|
||||
|
@ -61,10 +62,6 @@ material spaceship
|
|||
OutLineColor = 1,1,0
|
||||
OutlineWidth = 0.04
|
||||
}
|
||||
sampler 0
|
||||
{
|
||||
path = Sprite3DTest/boss.png
|
||||
}
|
||||
}
|
||||
|
||||
// 2nd pass:
|
||||
|
@ -85,10 +82,6 @@ material spaceship
|
|||
OutLineColor = 0,0,1
|
||||
OutlineWidth = 0.02
|
||||
}
|
||||
sampler 0
|
||||
{
|
||||
path = Sprite3DTest/boss.png
|
||||
}
|
||||
}
|
||||
// 3rd pass
|
||||
// Renders the model "normally"
|
||||
|
@ -99,13 +92,13 @@ material spaceship
|
|||
{
|
||||
vertexShader = Shaders3D/3d_position_tex.vert
|
||||
fragmentShader = Shaders3D/3d_color_tex.frag
|
||||
}
|
||||
sampler 0
|
||||
sampler u_sampler0
|
||||
{
|
||||
path = Sprite3DTest/boss.png
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Another technique:
|
||||
// This one renders the model using the lights avaiable from the Scene
|
||||
technique lit
|
||||
|
@ -118,11 +111,11 @@ material spaceship
|
|||
defines = MAX_POINT_LIGHT_NUM 1;MAX_SPOT_LIGHT_NUM 1;MAX_DIRECTIONAL_LIGHT_NUM 1
|
||||
vertexShader = Shaders3D/3d_position_normal_tex.vert
|
||||
fragmentShader = Shaders3D/3d_color_normal_tex.frag
|
||||
}
|
||||
sampler 0
|
||||
sampler u_sampler0
|
||||
{
|
||||
path = Sprite3DTest/boss.png
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue