sync with upstream

Conflicts:
	CMakeLists.txt
This commit is contained in:
Vladimir Timofeev 2014-11-20 12:19:00 +03:00
commit a689fc4c7e
67 changed files with 829 additions and 439 deletions

View File

@ -1,5 +1,6 @@
cocos2d-x-3.3 ??
cocos2d-x-3.3-rc1 ??
[NEW] Vec2: added greater than operator
[NEW] WP8: Win8.1 universal app support
[FIX] Audio: `SimpleAudioEngine::sharedEngine()->playBackgroundMusic()` crashed freezen on Lollipop(Android5.0)
[FIX] Button: when the dimension of button title is larger than the button, button will scale to fit the dimension of the button title
@ -17,7 +18,7 @@ cocos2d-x-3.3 ??
[FIX] Scale9Sprite: if scale and flip property are set at the same time, the result would be wrong
[FIX] Scene: setScale() doesn't work as expected
[FIX] Sprite3D: did not create attached sprite from cache
[FIX] WP/WinRT: Windows 8.1 universal app support; `UIEditBox` support
[FIX] WP: back key behaviour and Director::getInstance()->end() works not correctly
cocos2d-x-3.3-rc0 Oct.21 2014
[NEW] 3d: added light support: direction light, point light, spot light and ambient light

View File

@ -6,7 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "..\external\Box2D\proj.wp8\Box2D.vcxproj", "{C55734A3-702C-4FA1-B950-32C8E169302F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests", "cpp-tests", "{671E147E-1DBD-41FC-99B3-2119CA828C8A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests-wp8-xaml", "cpp-tests-wp8-xaml", "{671E147E-1DBD-41FC-99B3-2119CA828C8A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-tests", "..\tests\cpp-tests\proj.wp8-xaml\cpp-tests\cpp-tests.csproj", "{60D53713-1675-4466-81DC-D67A031C3D21}"
ProjectSection(ProjectDependencies) = postProject
@ -15,7 +15,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-tests", "..\tests\cpp-t
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-testsComponent", "..\tests\cpp-tests\proj.wp8-xaml\cpp-testsComponent\cpp-testsComponent.vcxproj", "{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test", "cpp-empty-test", "{2C306303-EB4F-4058-8CA0-1F28A4FECE39}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test-wp8-xaml", "cpp-empty-test-wp8-xaml", "{2C306303-EB4F-4058-8CA0-1F28A4FECE39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj-wp8-xaml\cpp-empty-test\cpp-empty-test.csproj", "{5921FE12-7EF3-4847-8453-42EF286DDBE7}"
ProjectSection(ProjectDependencies) = postProject

View File

@ -56,12 +56,12 @@ class Node;
class CC_DLL PointArray : public Ref, public Clonable
{
public:
/** creates and initializes a Points array with capacity
/** creates and initializes a Points array with capacity
* @js NA
*/
static PointArray* create(ssize_t capacity);
/**
* @js NA
* @lua NA
@ -72,48 +72,48 @@ public:
* @lua NA
*/
PointArray();
/** initializes a Catmull Rom config with a capacity hint
/** initializes a Catmull Rom config with a capacity hint
* @js NA
*/
bool initWithCapacity(ssize_t capacity);
/** appends a control point
/** appends a control point
* @js NA
*/
void addControlPoint(Vec2 controlPoint);
/** inserts a controlPoint at index
/** inserts a controlPoint at index
* @js NA
*/
void insertControlPoint(Vec2 &controlPoint, ssize_t index);
/** replaces an existing controlPoint at index
/** replaces an existing controlPoint at index
* @js NA
*/
void replaceControlPoint(Vec2 &controlPoint, ssize_t index);
/** get the value of a controlPoint at a given index
/** get the value of a controlPoint at a given index
* @js NA
*/
Vec2 getControlPointAtIndex(ssize_t index);
/** deletes a control point at a given index
/** deletes a control point at a given index
* @js NA
*/
void removeControlPointAtIndex(ssize_t index);
/** returns the number of objects of the control point array
/** returns the number of objects of the control point array
* @js NA
*/
ssize_t count() const;
/** returns a new copy of the array reversed. User is responsible for releasing this copy
/** returns a new copy of the array reversed. User is responsible for releasing this copy
* @js NA
*/
PointArray* reverse() const;
/** reverse the current control point array inline, without generating a new one
/** reverse the current control point array inline, without generating a new one
* @js NA
*/
void reverseInline();
@ -143,7 +143,7 @@ class CC_DLL CardinalSplineTo : public ActionInterval
{
public:
/** creates an action with a Cardinal Spline array of points and tension
/** creates an action with a Cardinal Spline array of points and tension
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var t,var table)
@ -161,7 +161,7 @@ public:
* @lua NA
*/
CardinalSplineTo();
/** initializes the action with a duration and an array of points */
bool initWithDuration(float duration, PointArray* points, float tension);
@ -180,7 +180,7 @@ public:
}
// Overrides
virtual CardinalSplineTo *clone() const override;
virtual CardinalSplineTo *clone() const override;
virtual CardinalSplineTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void update(float time) override;
@ -198,11 +198,11 @@ protected:
http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
@ingroup Actions
*/
class CC_DLL CardinalSplineBy : public CardinalSplineTo
class CC_DLL CardinalSplineBy : public CardinalSplineTo
{
public:
/** creates an action with a Cardinal Spline array of points and tension
/** creates an action with a Cardinal Spline array of points and tension
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var t,var table)
@ -212,11 +212,11 @@ public:
static CardinalSplineBy* create(float duration, PointArray* points, float tension);
CardinalSplineBy();
// Overrides
virtual void startWithTarget(Node *target) override;
virtual void updatePosition(Vec2 &newPos) override;
virtual CardinalSplineBy *clone() const override;
virtual CardinalSplineBy *clone() const override;
virtual CardinalSplineBy* reverse() const override;
protected:
@ -231,8 +231,8 @@ protected:
class CC_DLL CatmullRomTo : public CardinalSplineTo
{
public:
/** creates an action with a Cardinal Spline array of points and tension
/** creates an action with a Cardinal Spline array of points and tension
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var dt,var table)
@ -245,8 +245,8 @@ public:
bool initWithDuration(float dt, PointArray* points);
// Override
virtual CatmullRomTo *clone() const override;
virtual CatmullRomTo *reverse() const override;
virtual CatmullRomTo *clone() const override;
virtual CatmullRomTo *reverse() const override;
};
/** An action that moves the target with a CatmullRom curve by a certain distance.
@ -257,7 +257,7 @@ public:
class CC_DLL CatmullRomBy : public CardinalSplineBy
{
public:
/** creates an action with a Cardinal Spline array of points and tension
/** creates an action with a Cardinal Spline array of points and tension
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var dt,var table)
@ -270,8 +270,8 @@ public:
bool initWithDuration(float dt, PointArray* points);
// Override
virtual CatmullRomBy *clone() const override;
virtual CatmullRomBy *reverse() const override;
virtual CatmullRomBy *clone() const override;
virtual CatmullRomBy *reverse() const override;
};

View File

@ -231,7 +231,7 @@ void ClippingNode::drawFullScreenQuadClearStencil()
void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
if(!_visible)
if (!_visible || !hasContent())
return;
uint32_t flags = processParentFlags(parentTransform, parentFlags);
@ -327,6 +327,11 @@ void ClippingNode::setStencil(Node *stencil)
_stencil = stencil;
}
bool ClippingNode::hasContent() const
{
return _children.size() > 0;
}
GLfloat ClippingNode::getAlphaThreshold() const
{
return _alphaThreshold;

View File

@ -58,7 +58,14 @@ public:
*/
Node* getStencil() const;
void setStencil(Node *stencil);
/** If stencil has no childre it will not be drawn.
If you have custom stencil-based node with stencil drawing mechanics other then children-based,
then this method should return true every time you wish stencil to be visited.
By default returns true if has any children attached.
*/
virtual bool hasContent() const;
/** The alpha threshold.
The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
Should be a float between 0 and 1.

View File

@ -28,6 +28,9 @@ THE SOFTWARE.
#include "2d/CCParticleSystemQuad.h"
#include <algorithm>
#include "2d/CCSpriteFrame.h"
#include "2d/CCParticleBatchNode.h"
#include "renderer/CCTextureAtlas.h"
@ -172,7 +175,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)
#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
// Important. Texture in cocos2d are inverted, so the Y component should be inverted
CC_SWAP( top, bottom, float);
std::swap(top, bottom);
V3F_C4B_T2F_Quad *quads = nullptr;
unsigned int start = 0, end = 0;

View File

@ -25,6 +25,8 @@ THE SOFTWARE.
****************************************************************************/
#include "2d/CCProgressTimer.h"
#include <algorithm>
#include "base/ccMacros.h"
#include "base/CCDirector.h"
#include "2d/CCSprite.h"
@ -159,7 +161,7 @@ Tex2F ProgressTimer::textureCoordFromAlphaPoint(Vec2 alpha)
Vec2 max = Vec2(quad.tr.texCoords.u,quad.tr.texCoords.v);
// Fix bug #1303 so that progress timer handles sprite frame texture rotation
if (_sprite->isTextureRectRotated()) {
CC_SWAP(alpha.x, alpha.y, float);
std::swap(alpha.x, alpha.y);
}
return Tex2F(min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y);
}

View File

@ -27,6 +27,8 @@ THE SOFTWARE.
#include "2d/CCSprite.h"
#include <algorithm>
#include "2d/CCSpriteBatchNode.h"
#include "2d/CCAnimationCache.h"
#include "2d/CCSpriteFrame.h"
@ -438,12 +440,12 @@ void Sprite::setTextureCoords(Rect rect)
if (_flippedX)
{
CC_SWAP(top, bottom, float);
std::swap(top, bottom);
}
if (_flippedY)
{
CC_SWAP(left, right, float);
std::swap(left, right);
}
_quad.bl.texCoords.u = left;
@ -471,12 +473,12 @@ void Sprite::setTextureCoords(Rect rect)
if(_flippedX)
{
CC_SWAP(left,right,float);
std::swap(left, right);
}
if(_flippedY)
{
CC_SWAP(top,bottom,float);
std::swap(top, bottom);
}
_quad.bl.texCoords.u = left;

View File

@ -447,6 +447,7 @@ void Scheduler::appendIn(_listEntry **list, const ccSchedulerFunc& callback, voi
listElement->callback = callback;
listElement->target = target;
listElement->paused = paused;
listElement->priority = 0;
listElement->markedForDeletion = false;
DL_APPEND(*list, listElement);

View File

@ -63,6 +63,7 @@ THE SOFTWARE.
/** @def CC_SWAP
simple macro that swaps 2 variables
@deprecated use std::swap() instead
*/
#define CC_SWAP(x, y, type) \
{ type temp = (x); \

View File

@ -111,7 +111,7 @@ void ArmatureDataManager::removeArmatureFileInfo(const std::string& configFilePa
for (std::string str : data->plistFiles)
{
SpriteFrameCache::getInstance()->removeSpriteFramesFromFile(str.c_str());
SpriteFrameCacheHelper::getInstance()->removeSpriteFrameFromFile(str);
}
_relativeDatas.erase(configFilePath);
@ -210,7 +210,7 @@ void ArmatureDataManager::addArmatureFileInfo(const std::string& imagePath, cons
_autoLoadSpriteFile = false;
DataReaderHelper::getInstance()->addDataFromFile(configFilePath);
addSpriteFrameFromFile(plistPath, imagePath);
addSpriteFrameFromFile(plistPath, imagePath, configFilePath);
}
void ArmatureDataManager::addArmatureFileInfoAsync(const std::string& imagePath, const std::string& plistPath, const std::string& configFilePath, Ref *target, SEL_SCHEDULE selector)
@ -219,7 +219,7 @@ void ArmatureDataManager::addArmatureFileInfoAsync(const std::string& imagePath,
_autoLoadSpriteFile = false;
DataReaderHelper::getInstance()->addDataFromFileAsync(imagePath, plistPath, configFilePath, target, selector);
addSpriteFrameFromFile(plistPath, imagePath);
addSpriteFrameFromFile(plistPath, imagePath, configFilePath);
}
void ArmatureDataManager::addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath, const std::string& configFilePath)

View File

@ -26,7 +26,6 @@ THE SOFTWARE.
#include "cocostudio/CCBone.h"
#include "cocostudio/CCArmature.h"
#include "cocostudio/CCSkin.h"
#include "cocostudio/CCSpriteFrameCacheHelper.h"
#include "cocostudio/CCArmatureDataManager.h"
#include "cocostudio/CCTransformHelp.h"

View File

@ -29,7 +29,6 @@ THE SOFTWARE.
#include "cocostudio/CCSkin.h"
#include "cocostudio/CCTransformHelp.h"
#include "cocostudio/CCSpriteFrameCacheHelper.h"
#include "cocostudio/CCArmature.h"

View File

@ -23,7 +23,8 @@ THE SOFTWARE.
****************************************************************************/
#include "cocostudio/CCSpriteFrameCacheHelper.h"
#include "platform/CCFileUtils.h"
#include "2d/CCSpriteFrame.h"
#include "2d/CCSpriteFrameCache.h"
using namespace cocos2d;
@ -49,9 +50,53 @@ void SpriteFrameCacheHelper::purge()
_spriteFrameCacheHelper = nullptr;
}
void SpriteFrameCacheHelper::retainSpriteFrames(const std::string &plistPath)
{
auto it = _usingSpriteFrames.find(plistPath);
if(it != _usingSpriteFrames.end()) return;
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plistPath);
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
auto spriteFramesCache = SpriteFrameCache::getInstance();
ValueMap& framesDict = dict["frames"].asValueMap();
std::vector<SpriteFrame*> vec;
for (auto iter = framesDict.begin(); iter != framesDict.end(); ++iter)
{
auto& spriteFrameName = iter->first;
SpriteFrame* spriteFrame = spriteFramesCache->getSpriteFrameByName(spriteFrameName);
vec.push_back(spriteFrame);
CC_SAFE_RETAIN(spriteFrame);
}
_usingSpriteFrames[plistPath] = vec;
}
void SpriteFrameCacheHelper::releaseSpriteFrames(const std::string &plistPath)
{
auto it = _usingSpriteFrames.find(plistPath);
if(it == _usingSpriteFrames.end()) return;
auto& vec = it->second;
auto itFrame = vec.begin();
while (itFrame != vec.end())
{
CC_SAFE_RELEASE(*itFrame);
++itFrame;
}
vec.clear();
_usingSpriteFrames.erase(it);
}
void SpriteFrameCacheHelper::removeSpriteFrameFromFile(const std::string &plistPath)
{
SpriteFrameCache::getInstance()->removeSpriteFramesFromFile(plistPath);
releaseSpriteFrames(plistPath);
}
void SpriteFrameCacheHelper::addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath, imagePath);
retainSpriteFrames(plistPath);
}
SpriteFrameCacheHelper::SpriteFrameCacheHelper()

View File

@ -28,6 +28,12 @@ THE SOFTWARE.
#include "cocostudio/CCArmatureDefine.h"
#include "cocostudio/CocosStudioExport.h"
#include <string>
#include <map>
#include <vector>
namespace cocos2d {
class SpriteFrame;
}
namespace cocostudio {
@ -50,11 +56,16 @@ public:
* @brief Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name
*/
void addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath);
void removeSpriteFrameFromFile(const std::string& plistPath);
private:
void retainSpriteFrames(const std::string& plistPath);
void releaseSpriteFrames(const std::string& plistPath);
SpriteFrameCacheHelper();
~SpriteFrameCacheHelper();
std::map<std::string, std::vector<cocos2d::SpriteFrame*> > _usingSpriteFrames;
static SpriteFrameCacheHelper *_spriteFrameCacheHelper;
};

View File

@ -45,7 +45,6 @@ THE SOFTWARE.
#include "cocostudio/CCArmatureDataManager.h"
#include "cocostudio/CCArmatureDefine.h"
#include "cocostudio/CCDataReaderHelper.h"
#include "cocostudio/CCSpriteFrameCacheHelper.h"
#include "cocostudio/CCTransformHelp.h"
#include "cocostudio/CCUtilMath.h"
#include "cocostudio/CCComBase.h"

View File

@ -48,51 +48,107 @@ void OpenGLES::Initialize()
EGL_NONE
};
const EGLint displayAttributes[] =
{
// This can be used to configure D3D11. For example, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE could be used.
// This would ask the graphics card to use D3D11 Feature Level 9_3 instead of Feature Level 11_0+.
// On Windows Phone, this would allow the Phone Emulator to act more like the GPUs that are available on real Phone devices.
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE,
EGL_NONE,
#else
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_NONE,
#endif
};
const EGLint contextAttributes[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in 'displayAttributes' to configure D3D11.
const EGLint defaultDisplayAttributes[] =
{
// These are the default display attributes, used to request ANGLE's D3D11 renderer.
// eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
const EGLint fl9_3DisplayAttributes[] =
{
// These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3.
// These attributes are used if the call to eglInitialize fails with the default display attributes.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
const EGLint warpDisplayAttributes[] =
{
// These attributes can be used to request D3D11 WARP.
// They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_USE_WARP_ANGLE, EGL_TRUE,
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
EGLConfig config = NULL;
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11.
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
if (!eglGetPlatformDisplayEXT)
{
throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
}
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes);
//
// To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying
// parameters passed to eglGetPlatformDisplayEXT:
// 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+.
// 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again
// using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3.
// 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again
// using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer.
//
// Note: On Windows Phone, we #ifdef out the first set of calls to eglPlatformDisplayEXT and eglInitialize.
// Windows Phones devices only support D3D11 Feature Level 9_3, but the Windows Phone emulator supports 11_0+.
// We use this #ifdef to limit the Phone emulator to Feature Level 9_3, making it behave more like
// real Windows Phone devices.
// If you wish to test Feature Level 10_0+ in the Windows Phone emulator then you should remove this #ifdef.
//
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
// This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details.
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get default EGL display");
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
#endif
{
throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
// This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on Windows Phone, or certain Windows tablets).
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
// This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU (e.g. on Surface RT).
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
}
}
}
EGLint numConfigs = 0;
if (eglGetConfigs(mEglDisplay, NULL, 0, &numConfigs) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGLConfig count");
}
if (eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE)
if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0))
{
throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig");
}
@ -134,6 +190,14 @@ EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurf
EGLSurface surface = EGL_NO_SURFACE;
const EGLint surfaceAttributes[] =
{
// EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
// If you have compilation issues with it then please update your Visual Studio templates.
EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE
};
// Create a PropertySet and initialize with the EGLNativeWindowType.
PropertySet^ surfaceCreationProperties = ref new PropertySet();
surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel);
@ -144,7 +208,7 @@ EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurf
surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize));
}
surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast<IInspectable*>(surfaceCreationProperties), NULL);
surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast<IInspectable*>(surfaceCreationProperties), surfaceAttributes);
if (surface == EGL_NO_SURFACE)
{
throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface");

View File

@ -28,7 +28,6 @@
#include <EGL/eglplatform.h>
#include <angle_windowsstore.h>
class OpenGLES
{
public:

View File

@ -179,6 +179,11 @@ bool GLViewImpl::isOpenGLReady()
void GLViewImpl::end()
{
m_windowClosed = true;
std::string str;
if (m_delegate) {
// Terminate app on Director::getInstance()->end();
m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str));
}
}
@ -193,11 +198,8 @@ void GLViewImpl::OnResuming(Platform::Object^ sender, Platform::Object^ args)
// user pressed the Back Key on the phone
void GLViewImpl::OnBackKeyPress()
{
std::string str;
if(m_delegate)
{
m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str));
}
EventKeyboard event(EventKeyboard::KeyCode::KEY_ESCAPE, false);
Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
}
void GLViewImpl::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)

View File

@ -5,10 +5,11 @@
-- @parent_module cc
--------------------------------
-- Inverted. If this is set to true,<br>
-- the stencil is inverted, so the content is drawn where the stencil is NOT drawn.<br>
-- This default to false.
-- @function [parent=#ClippingNode] isInverted
-- If stencil has no childre it will not be drawn.<br>
-- If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
-- then this method should return true every time you wish stencil to be visited.<br>
-- By default returns true if has any children attached.
-- @function [parent=#ClippingNode] hasContent
-- @param self
-- @return bool#bool ret (return value: bool)
@ -47,6 +48,14 @@
-- @param self
-- @param #float alphaThreshold
--------------------------------
-- Inverted. If this is set to true,<br>
-- the stencil is inverted, so the content is drawn where the stencil is NOT drawn.<br>
-- This default to false.
-- @function [parent=#ClippingNode] isInverted
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @overload self, cc.Node
-- @overload self

View File

@ -44340,7 +44340,7 @@ int lua_register_cocos2dx_Menu(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_ClippingNode_isInverted(lua_State* tolua_S)
int lua_cocos2dx_ClippingNode_hasContent(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ClippingNode* cobj = nullptr;
@ -44360,7 +44360,7 @@ int lua_cocos2dx_ClippingNode_isInverted(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_isInverted'", nullptr);
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_hasContent'", nullptr);
return 0;
}
#endif
@ -44370,16 +44370,16 @@ int lua_cocos2dx_ClippingNode_isInverted(lua_State* tolua_S)
{
if(!ok)
return 0;
bool ret = cobj->isInverted();
bool ret = cobj->hasContent();
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ClippingNode:isInverted",argc, 0);
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ClippingNode:hasContent",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ClippingNode_isInverted'.",&tolua_err);
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ClippingNode_hasContent'.",&tolua_err);
#endif
return 0;
@ -44610,6 +44610,50 @@ int lua_cocos2dx_ClippingNode_setAlphaThreshold(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_ClippingNode_isInverted(lua_State* tolua_S)
{
int argc = 0;
cocos2d::ClippingNode* 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.ClippingNode",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_isInverted'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
return 0;
bool ret = cobj->isInverted();
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ClippingNode:isInverted",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ClippingNode_isInverted'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_ClippingNode_create(lua_State* tolua_S)
{
int argc = 0;
@ -44667,12 +44711,13 @@ int lua_register_cocos2dx_ClippingNode(lua_State* tolua_S)
tolua_cclass(tolua_S,"ClippingNode","cc.ClippingNode","cc.Node",nullptr);
tolua_beginmodule(tolua_S,"ClippingNode");
tolua_function(tolua_S,"isInverted",lua_cocos2dx_ClippingNode_isInverted);
tolua_function(tolua_S,"hasContent",lua_cocos2dx_ClippingNode_hasContent);
tolua_function(tolua_S,"setInverted",lua_cocos2dx_ClippingNode_setInverted);
tolua_function(tolua_S,"setStencil",lua_cocos2dx_ClippingNode_setStencil);
tolua_function(tolua_S,"getAlphaThreshold",lua_cocos2dx_ClippingNode_getAlphaThreshold);
tolua_function(tolua_S,"getStencil",lua_cocos2dx_ClippingNode_getStencil);
tolua_function(tolua_S,"setAlphaThreshold",lua_cocos2dx_ClippingNode_setAlphaThreshold);
tolua_function(tolua_S,"isInverted",lua_cocos2dx_ClippingNode_isInverted);
tolua_function(tolua_S,"create", lua_cocos2dx_ClippingNode_create);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::ClippingNode).name();

View File

@ -1643,6 +1643,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
#endif // __cocos2dx_h__

View File

@ -48,9 +48,10 @@ $ git submodule update --init
The patch must be _complete_. And by that, we mean:
- Follow the [Cocos2d C++ Coding Style][1]
- For C++ code follow the [Cocos2d C++ Coding Style][1]
- For Python code follow the [PEP8 guidelines][3]
- Describe what the patch does
- Include test cases
- Include test cases if applicable
- Include unit tests if applicable
- Must be tested in all supported platforms [*]
- Must NOT degrade the performance
@ -59,8 +60,8 @@ The patch must be _complete_. And by that, we mean:
- Must NOT break backward compatibility
- Must compile WITHOUT warnings
- New APIs MUST be **easy to use**, **familiar** to cocos2d-x users
- New APIs MUST be documented using Doxgen strings
- Code MUST be **easy to extend**
- Code MUST be **easy to extend** and **maintain**
- Must have documentation: C++ APIs must use Doxygen strings, tools must have a README.md file that describe how to use the tool
- Must be efficient (fast / low memory needs)
- It must not duplicate existing code, unless the new code deprecates the old one
- Patches that refactor key components will only be merged in the next major versions.
@ -77,3 +78,4 @@ Help us promote cocos2d-x by using the cocos2d logo in your game, or by mentioni
[1]: https://github.com/cocos2d/cocos2d-x/blob/v3/docs/CODING_STYLE.md
[2]: http://www.cocos2d-x.org/wiki/Logo_Resources_of_Cocos2d-x
[3]: https://www.python.org/dev/peps/pep-0008

View File

@ -3,10 +3,12 @@
#
# ./download-deps.py
#
# Download Cocos2D-X resources from github (https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin) and extract from ZIP
# Downloads Cocos2D-x 3rd party dependencies from github:
# https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin) and extracts the zip
# file
#
# Helps prevent repo bloat due to large binary files since they can
# be hosted separately.
# Having the dependencies outside the official cocos2d-x repo helps prevent
# bloating the repo.
#
"""****************************************************************************
@ -183,7 +185,7 @@ class CocosZipInstaller(object):
else:
# file
data = z.read(info.filename)
f = open(target,'wb')
f = open(target, 'wb')
try:
f.write(data)
finally:

175
setup.py
View File

@ -1,5 +1,5 @@
#!/usr/bin/python
#coding=utf-8
# coding=utf-8
"""****************************************************************************
Copyright (c) 2014 cocos2d-x.org
@ -26,11 +26,13 @@ THE SOFTWARE.
'''
This script will install environment variables needed to by cocos2d-x. It will set these envrironment variables:
* COCOS_CONSOLE_ROOT: used to run cocos console tools, more information about cocos console tools please refer to
* COCOS_CONSOLE_ROOT: used to run cocos console tools, more information about cocos console tools please refer to
https://github.com/cocos2d/cocos2d-console
* NDK_ROOT: used to build android native codes
* ANDROID_SDK_ROOT: used to generate applicatoin on Android through commands
* ANT_ROOT: used to generate applicatoin on Android through commands
* COCOS_X_ROOT: path where cocos2d-x is installed
* COCOS_TEMPLATES_ROOT: path where cocos2d-x's templates are installed
On Max OS X, when start a shell, it will read these files and execute commands in sequence:
@ -45,7 +47,6 @@ Which means that
* otherwise it will the add environment variables into ~/.profile if it exists
Will create ~/.bash_profile when none of them exist, and add environment variables into it.
'''
import os
@ -56,10 +57,13 @@ import subprocess
from optparse import OptionParser
COCOS_CONSOLE_ROOT = 'COCOS_CONSOLE_ROOT'
COCOS_X_ROOT = 'COCOS_X_ROOT'
COCOS_TEMPLATES_ROOT = 'COCOS_TEMPLATES_ROOT'
NDK_ROOT = 'NDK_ROOT'
ANDROID_SDK_ROOT = 'ANDROID_SDK_ROOT'
ANT_ROOT = 'ANT_ROOT'
def _check_python_version():
major_ver = sys.version_info[0]
if major_ver > 2:
@ -69,6 +73,7 @@ def _check_python_version():
return True
class SetEnvVar(object):
RESULT_UPDATE_FAILED = -2
@ -77,15 +82,16 @@ class SetEnvVar(object):
RESULT_UPDATED = 1
RESULT_ADDED = 2
MAC_CHECK_FILES = [ '.bash_profile', '.bash_login', '.profile' ]
LINUX_CHECK_FILES = [ '.bashrc' ]
ZSH_CHECK_FILES = ['.zshrc' ]
MAC_CHECK_FILES = ['.bash_profile', '.bash_login', '.profile']
LINUX_CHECK_FILES = ['.bashrc']
ZSH_CHECK_FILES = ['.zshrc']
RE_FORMAT = r'^export[ \t]+%s=(.+)'
def __init__(self):
self.need_backup = True
self.backup_file = None
self.current_absolute_path = os.path.dirname(os.path.realpath(__file__))
self.current_absolute_path = os.path.dirname(
os.path.realpath(__file__))
self.file_used_for_setup = ''
def _isWindows(self):
@ -113,11 +119,11 @@ class SetEnvVar(object):
file_list = SetEnvVar.LINUX_CHECK_FILES
elif self._is_mac():
file_list = SetEnvVar.MAC_CHECK_FILES
return file_list
def _get_filepath_for_setup(self):
file_list = self._get_unix_file_list();
file_list = self._get_unix_file_list()
file_to_write = None
if file_list is None:
@ -145,9 +151,9 @@ class SetEnvVar(object):
try:
env = None
env = _winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER,
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
_winreg.SetValueEx(env, key, 0, _winreg.REG_SZ, value)
_winreg.FlushKey(env)
_winreg.CloseKey(env)
@ -185,7 +191,8 @@ class SetEnvVar(object):
file.write('export %s=%s\n' % (key, value))
file.write('export PATH=$%s:$PATH\n' % key)
if key == ANDROID_SDK_ROOT:
file.write('export PATH=$%s/tools:$%s/platform-tools:$PATH\n' % (key, key))
file.write(
'export PATH=$%s/tools:$%s/platform-tools:$PATH\n' % (key, key))
file.close()
return True
@ -242,9 +249,9 @@ class SetEnvVar(object):
try:
env = None
env = _winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER,
'Environment',
0,
_winreg.KEY_READ)
'Environment',
0,
_winreg.KEY_READ)
ret = _winreg.QueryValueEx(env, var)[0]
_winreg.CloseKey(env)
@ -261,16 +268,17 @@ class SetEnvVar(object):
return ret
def _get_input_value(self, var_name):
ret = raw_input(' ->Please enter the path of %s (or press Enter to skip):' % var_name)
ret = raw_input(
' ->Please enter the path of %s (or press Enter to skip):' % var_name)
ret.rstrip(" \t")
return ret
# # python on linux doesn't include Tkinter model, so let user input in terminal
# python on linux doesn't include Tkinter model, so let user input in terminal
# if self._isLinux():
# input_value = raw_input('Couldn\'t find the "%s" envrironment variable. Please enter it: ' % sys_var)
# input_value = raw_input('Couldn\'t find the "%s" envrironment variable. Please enter it: ' % sys_var)
# else:
# # pop up a window to let user select path for ndk root
# pop up a window to let user select path for ndk root
# import Tkinter
# import tkFileDialog
@ -290,7 +298,7 @@ class SetEnvVar(object):
# if sys_var == NDK_ROOT:
# label_content = 'Select path for Android NDK:'
# label_help = """
# The Android NDK is needed to develop games for Android.
# The Android NDK is needed to develop games for Android.
# For further information, go to:
# http://developer.android.com/tools/sdk/ndk/index.html.
@ -300,9 +308,9 @@ class SetEnvVar(object):
# if sys_var == ANDROID_SDK_ROOT:
# label_content = 'Select path for Android SDK'
# label_help = """
# The Android SDK is needed to develop games for Android.
# The Android SDK is needed to develop games for Android.
# For further information, go to:
# https://developer.android.com/tools/sdk/ndk/index.html.
# https://developer.android.com/tools/sdk/ndk/index.html.
# You can safely skip this step now. You can set the ANDROID_SDK_ROOT later.
# """
@ -314,10 +322,10 @@ class SetEnvVar(object):
# input_value = self.tmp_input_value
# self.tmp_input_value = None
# return input_value
# # display a window in center and put it on top
# display a window in center and put it on top
# def _center(self, win):
# win.update_idletasks()
# width = win.winfo_width()
@ -339,7 +347,8 @@ class SetEnvVar(object):
ret = False
if not ret:
print(' ->Error: "%s" is not a valid path of %s. Ignoring it.' % (value, var_name))
print(
' ->Error: "%s" is not a valid path of %s. Ignoring it.' % (value, var_name))
return ret
@ -358,7 +367,8 @@ class SetEnvVar(object):
return False
if self._isWindows():
android_path = os.path.join(android_sdk_root, 'tools', 'android.bat')
android_path = os.path.join(
android_sdk_root, 'tools', 'android.bat')
else:
android_path = os.path.join(android_sdk_root, 'tools', 'android')
if os.path.isfile(android_path):
@ -385,9 +395,9 @@ class SetEnvVar(object):
env = None
path = None
env = _winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER,
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
path = _winreg.QueryValueEx(env, 'Path')[0]
path_lower = path.lower()
@ -405,7 +415,8 @@ class SetEnvVar(object):
print(' ->Remove directory \"%s\" from PATH!\n' % remove_dir)
except Exception:
print(' ->Remove directory \"%s\" from PATH failed!\n' % remove_dir)
print(' ->Remove directory \"%s\" from PATH failed!\n' %
remove_dir)
def set_windows_path(self, add_dir):
ret = False
@ -414,9 +425,9 @@ class SetEnvVar(object):
env = None
path = None
env = _winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER,
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
'Environment',
0,
_winreg.KEY_SET_VALUE | _winreg.KEY_READ)
path = _winreg.QueryValueEx(env, 'Path')[0]
# add variable if can't find it in PATH
@ -448,29 +459,74 @@ class SetEnvVar(object):
else:
print(" ->Add directory \"%s\" into PATH failed!\n" % add_dir)
def set_console_root(self):
print("->Check environment variable %s" % COCOS_CONSOLE_ROOT)
cocos_consle_root = os.path.join(self.current_absolute_path, 'tools', 'cocos2d-console', 'bin')
cocos_consle_root = os.path.join(
self.current_absolute_path, 'tools', 'cocos2d-console', 'bin')
old_dir = self._find_environment_variable(COCOS_CONSOLE_ROOT)
if old_dir is None:
# add environment variable
if self._isWindows():
self.set_windows_path(cocos_consle_root)
self._set_environment_variable(COCOS_CONSOLE_ROOT, cocos_consle_root)
self._set_environment_variable(
COCOS_CONSOLE_ROOT, cocos_consle_root)
else:
if old_dir == cocos_consle_root:
# is same with before, nothing to do
return
# update the environment variable
if self._isWindows():
if self._isWindows():
self.remove_dir_from_win_path(old_dir)
self.set_windows_path(cocos_consle_root)
self._force_update_env(COCOS_CONSOLE_ROOT, cocos_consle_root)
def set_cocos_x_root(self):
print("->Check environment variable %s" % COCOS_X_ROOT)
cocos_x_root = self.current_absolute_path
old_dir = self._find_environment_variable(COCOS_X_ROOT)
if old_dir is None:
# add environment variable
if self._isWindows():
self.set_windows_path(cocos_x_root)
self._set_environment_variable(COCOS_X_ROOT, cocos_x_root)
else:
if old_dir == cocos_x_root:
# is same with before, nothing to do
return
# update the environment variable
if self._isWindows():
self.remove_dir_from_win_path(old_dir)
self.set_windows_path(cocos_x_root)
self._force_update_env(COCOS_X_ROOT, cocos_x_root)
def set_templates_root(self):
print("->Check environment variable %s" % COCOS_TEMPLATES_ROOT)
cocos_templates_root = os.path.join(self.current_absolute_path, 'templates')
old_dir = self._find_environment_variable(COCOS_TEMPLATES_ROOT)
if old_dir is None:
# add environment variable
if self._isWindows():
self.set_windows_path(cocos_templates_root)
self._set_environment_variable(COCOS_TEMPLATES_ROOT, cocos_templates_root)
else:
if old_dir == cocos_templates_root:
# is same with before, nothing to do
return
# update the environment variable
if self._isWindows():
self.remove_dir_from_win_path(old_dir)
self.set_windows_path(cocos_templates_root)
self._force_update_env(COCOS_TEMPLATES_ROOT, cocos_templates_root)
def _force_update_unix_env(self, var_name, value):
import re
home = os.path.expanduser('~')
@ -482,13 +538,14 @@ class SetEnvVar(object):
if self._isLinux():
file_list = SetEnvVar.LINUX_CHECK_FILES
print(" ->Update variable %s in files %s" % (var_name, str(file_list)))
print(" ->Update variable %s in files %s" %
(var_name, str(file_list)))
variable_updated = False
for file_name in file_list:
path = os.path.join(home, file_name)
if os.path.isfile(path):
lines = []
# read files
# read files
need_over_write = False
file_obj = open(path, 'r')
for line in file_obj:
@ -511,14 +568,14 @@ class SetEnvVar(object):
# nothing updated, should add variable
if not variable_updated:
print("\n ->No files updated, add variable %s instead!" % var_name)
print("\n ->No files updated, add variable %s instead!" %
var_name)
ret = self._set_environment_variable(var_name, value)
else:
ret = True
return ret
def _force_update_env(self, var_name, value):
ret = False
if self._isWindows():
@ -626,13 +683,17 @@ class SetEnvVar(object):
print('\nSetting up cocos2d-x...')
self.file_used_for_setup = self._get_filepath_for_setup()
self.set_console_root()
self.set_cocos_x_root()
self.set_templates_root()
if self._isWindows():
print('->Configuration for Android platform only, you can also skip and manually edit your environment variables\n')
print(
'->Configuration for Android platform only, you can also skip and manually edit your environment variables\n')
else:
print('->Configuration for Android platform only, you can also skip and manually edit "%s"\n' % self.file_used_for_setup)
print('->Configuration for Android platform only, you can also skip and manually edit "%s"\n' %
self.file_used_for_setup)
ndk_ret = self.set_variable(NDK_ROOT, ndk_root)
sdk_ret = self.set_variable(ANDROID_SDK_ROOT, android_sdk_root)
@ -640,26 +701,33 @@ class SetEnvVar(object):
# tip the backup file
if (self.backup_file is not None) and (os.path.exists(self.backup_file)):
print('\nA backup file \"%s\" is created for \"%s\".' % (self.backup_file, self.file_used_for_setup))
print('\nA backup file \"%s\" is created for \"%s\".' %
(self.backup_file, self.file_used_for_setup))
if self._isWindows():
print('\nPlease restart the terminal or restart computer to make added system variables take effect\n')
print(
'\nPlease restart the terminal or restart computer to make added system variables take effect\n')
else:
print('\nPlease execute command: "source %s" to make added system variables take effect\n' % self.file_used_for_setup)
print('\nPlease execute command: "source %s" to make added system variables take effect\n' %
self.file_used_for_setup)
if __name__ == '__main__':
if not _check_python_version():
exit()
parser = OptionParser()
parser.add_option('-n', '--ndkroot', dest='ndk_root', help='directory of ndk root')
parser.add_option('-a', '--androidsdkroot', dest='android_sdk_root', help='directory of android sdk root')
parser.add_option('-t', '--antroot', dest='ant_root', help='directory that contains ant/ant.bat')
parser.add_option(
'-n', '--ndkroot', dest='ndk_root', help='directory of ndk root')
parser.add_option('-a', '--androidsdkroot',
dest='android_sdk_root', help='directory of android sdk root')
parser.add_option(
'-t', '--antroot', dest='ant_root', help='directory that contains ant/ant.bat')
opts, args = parser.parse_args()
# set environment variables
env = SetEnvVar()
env.set_environment_variables(opts.ndk_root, opts.android_sdk_root, opts.ant_root)
env.set_environment_variables(
opts.ndk_root, opts.android_sdk_root, opts.ant_root)
if env._isWindows():
import ctypes
@ -668,4 +736,5 @@ if __name__ == '__main__':
SMTO_ABORTIFHUNG = 0x0002
result = ctypes.c_long()
SendMessageTimeoutW = ctypes.windll.user32.SendMessageTimeoutW
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, u'Environment', SMTO_ABORTIFHUNG, 5000, ctypes.byref(result))
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
u'Environment', SMTO_ABORTIFHUNG, 5000, ctypes.byref(result))

View File

@ -1421,9 +1421,15 @@
"external/curl/include/wp_8.1/curl/stdcheaders.h",
"external/curl/include/wp_8.1/curl/typecheck-gcc.h",
"external/curl/prebuilt/android/Android.mk",
"external/curl/prebuilt/android/armeabi-v7a/libcrypto.a",
"external/curl/prebuilt/android/armeabi-v7a/libcurl.a",
"external/curl/prebuilt/android/armeabi-v7a/libssl.a",
"external/curl/prebuilt/android/armeabi/libcrypto.a",
"external/curl/prebuilt/android/armeabi/libcurl.a",
"external/curl/prebuilt/android/armeabi/libssl.a",
"external/curl/prebuilt/android/x86/libcrypto.a",
"external/curl/prebuilt/android/x86/libcurl.a",
"external/curl/prebuilt/android/x86/libssl.a",
"external/curl/prebuilt/ios/libcurl.a",
"external/curl/prebuilt/win32/libcurl.dll",
"external/curl/prebuilt/win32/libcurl_imp.lib",

View File

@ -15,7 +15,15 @@
"proj.wp8-xaml/PROJECT_NAME.sln",
"proj.wp8-xaml/App/PROJECT_NAME.csproj",
"proj.wp8-xaml/AppComponent/PROJECT_NAMEComponent.vcxproj",
"proj.wp8-xaml/AppComponent/PROJECT_NAMEComponent.vcxproj.filters"
"proj.wp8-xaml/AppComponent/PROJECT_NAMEComponent.vcxproj.filters",
"proj.win8.1-universal/PROJECT_NAME.sln",
"proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems",
"proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems.filters",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows_TemporaryKey.pfx",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj.filters",
"proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj",
"proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj.filters"
]
},
"project_replace_project_name":{
@ -29,6 +37,13 @@
"proj.wp8-xaml/App/PROJECT_NAME.csproj",
"proj.wp8-xaml/App/Properties/WMAppManifest.xml",
"proj.wp8-xaml/PROJECT_NAME.sln",
"proj.win8.1-universal/PROJECT_NAME.sln",
"proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj.filters",
"proj.win8.1-universal/App.Windows/Package.appxmanifest",
"proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj",
"proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest",
"proj.android/.project",
"proj.android/.cproject",
"proj.android/AndroidManifest.xml",

View File

@ -0,0 +1,239 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#include "OpenGLES.h"
using namespace Platform;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
OpenGLES::OpenGLES() :
mEglConfig(nullptr),
mEglDisplay(EGL_NO_DISPLAY),
mEglContext(EGL_NO_CONTEXT)
{
Initialize();
}
OpenGLES::~OpenGLES()
{
Cleanup();
}
void OpenGLES::Initialize()
{
const EGLint configAttributes[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 8,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};
const EGLint contextAttributes[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
const EGLint defaultDisplayAttributes[] =
{
// These are the default display attributes, used to request ANGLE's D3D11 renderer.
// eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
const EGLint fl9_3DisplayAttributes[] =
{
// These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3.
// These attributes are used if the call to eglInitialize fails with the default display attributes.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
const EGLint warpDisplayAttributes[] =
{
// These attributes can be used to request D3D11 WARP.
// They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_USE_WARP_ANGLE, EGL_TRUE,
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE,
};
EGLConfig config = NULL;
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11.
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
if (!eglGetPlatformDisplayEXT)
{
throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
}
//
// To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying
// parameters passed to eglGetPlatformDisplayEXT:
// 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+.
// 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again
// using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3.
// 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again
// using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer.
//
// Note: On Windows Phone, we #ifdef out the first set of calls to eglPlatformDisplayEXT and eglInitialize.
// Windows Phones devices only support D3D11 Feature Level 9_3, but the Windows Phone emulator supports 11_0+.
// We use this #ifdef to limit the Phone emulator to Feature Level 9_3, making it behave more like
// real Windows Phone devices.
// If you wish to test Feature Level 10_0+ in the Windows Phone emulator then you should remove this #ifdef.
//
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
// This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details.
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
#endif
{
// This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on Windows Phone, or certain Windows tablets).
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
// This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU (e.g. on Surface RT).
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
}
}
}
EGLint numConfigs = 0;
if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0))
{
throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig");
}
mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes);
if (mEglContext == EGL_NO_CONTEXT)
{
throw Exception::CreateException(E_FAIL, L"Failed to create EGL context");
}
}
void OpenGLES::Cleanup()
{
if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT)
{
eglDestroyContext(mEglDisplay, mEglContext);
mEglContext = EGL_NO_CONTEXT;
}
if (mEglDisplay != EGL_NO_DISPLAY)
{
eglTerminate(mEglDisplay);
mEglDisplay = EGL_NO_DISPLAY;
}
}
void OpenGLES::Reset()
{
Cleanup();
Initialize();
}
EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize)
{
if (!panel)
{
throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid");
}
EGLSurface surface = EGL_NO_SURFACE;
const EGLint surfaceAttributes[] =
{
// EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
// If you have compilation issues with it then please update your Visual Studio templates.
EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE,
EGL_NONE
};
// Create a PropertySet and initialize with the EGLNativeWindowType.
PropertySet^ surfaceCreationProperties = ref new PropertySet();
surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel);
// If a render surface size is specified, add it to the surface creation properties
if (renderSurfaceSize != nullptr)
{
surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize));
}
surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast<IInspectable*>(surfaceCreationProperties), surfaceAttributes);
if (surface == EGL_NO_SURFACE)
{
throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface");
}
return surface;
}
void OpenGLES::DestroySurface(const EGLSurface surface)
{
if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE)
{
eglDestroySurface(mEglDisplay, surface);
}
}
void OpenGLES::MakeCurrent(const EGLSurface surface)
{
if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to make EGLSurface current");
}
}
EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface)
{
return (eglSwapBuffers(mEglDisplay, surface));
}

View File

@ -28,7 +28,6 @@
#include <EGL/eglplatform.h>
#include <angle_windowsstore.h>
class OpenGLES
{
public:

View File

@ -70,44 +70,44 @@
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="..\HelloCpp.Shared\HelloCpp.Shared.vcxitems" Label="Shared" />
<Import Project="..\App.Shared\HelloCpp.Shared.vcxitems" Label="Shared" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@ -176,17 +176,17 @@
<Image Include="Assets\SplashScreen.scale-100.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj">
<ProjectReference Include="..\..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj">
<Project>{9335005f-678e-4e8e-9b84-50037216aec8}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj">
<ProjectReference Include="..\..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj">
<Project>{f3550fe0-c795-44f6-8feb-093eb68143ae}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj">
<ProjectReference Include="..\..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj">
<Project>{3b26a12d-3a44-47ea-82d2-282660fc844d}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -51,32 +51,32 @@
<PlatformToolset>v120_wp81</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="..\HelloCpp.Shared\HelloCpp.Shared.vcxitems" Label="Shared" />
<Import Project="..\App.Shared\HelloCpp.Shared.vcxitems" Label="Shared" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\..\..\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
<Import Project="..\..\cocos2d\cocos\2d\wp_8.1_props\cocos2d_wp_8.1_platform.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1.props" />
<Import Project="..\..\cocos2d\cocos\2d\winrt_8.1_props\cocos2d_winrt_8.1_app.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
@ -128,17 +128,17 @@
<Image Include="Assets\WideLogo.scale-240.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj">
<ProjectReference Include="..\..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj">
<Project>{22f3b9df-1209-4574-8331-003966f562bf}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj">
<ProjectReference Include="..\..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj">
<Project>{cc1da216-a80d-4be4-b309-acb6af313aff}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj">
<ProjectReference Include="..\..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj">
<Project>{22f798d8-bfff-4754-996f-a5395343d5ec}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -1,175 +0,0 @@
/*
* cocos2d-x http://www.cocos2d-x.org
*
* Copyright (c) 2010-2014 - cocos2d-x community
*
* Portions Copyright (c) Microsoft Open Technologies, Inc.
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
#include "OpenGLES.h"
using namespace Platform;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
OpenGLES::OpenGLES() :
mEglConfig(nullptr),
mEglDisplay(EGL_NO_DISPLAY),
mEglContext(EGL_NO_CONTEXT)
{
Initialize();
}
OpenGLES::~OpenGLES()
{
Cleanup();
}
void OpenGLES::Initialize()
{
const EGLint configAttributes[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 8,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};
const EGLint displayAttributes[] =
{
// This can be used to configure D3D11. For example, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE could be used.
// This would ask the graphics card to use D3D11 Feature Level 9_3 instead of Feature Level 11_0+.
// On Windows Phone, this would allow the Phone Emulator to act more like the GPUs that are available on real Phone devices.
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_FL9_3_ANGLE,
EGL_NONE,
#else
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_NONE,
#endif
};
const EGLint contextAttributes[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in 'displayAttributes' to configure D3D11.
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
if (!eglGetPlatformDisplayEXT)
{
throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
}
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get default EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
}
EGLint numConfigs = 0;
if (eglGetConfigs(mEglDisplay, NULL, 0, &numConfigs) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to get EGLConfig count");
}
if (eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig");
}
mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes);
if (mEglContext == EGL_NO_CONTEXT)
{
throw Exception::CreateException(E_FAIL, L"Failed to create EGL context");
}
}
void OpenGLES::Cleanup()
{
if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT)
{
eglDestroyContext(mEglDisplay, mEglContext);
mEglContext = EGL_NO_CONTEXT;
}
if (mEglDisplay != EGL_NO_DISPLAY)
{
eglTerminate(mEglDisplay);
mEglDisplay = EGL_NO_DISPLAY;
}
}
void OpenGLES::Reset()
{
Cleanup();
Initialize();
}
EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize)
{
if (!panel)
{
throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid");
}
EGLSurface surface = EGL_NO_SURFACE;
// Create a PropertySet and initialize with the EGLNativeWindowType.
PropertySet^ surfaceCreationProperties = ref new PropertySet();
surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel);
// If a render surface size is specified, add it to the surface creation properties
if (renderSurfaceSize != nullptr)
{
surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize));
}
surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast<IInspectable*>(surfaceCreationProperties), NULL);
if (surface == EGL_NO_SURFACE)
{
throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface");
}
return surface;
}
void OpenGLES::DestroySurface(const EGLSurface surface)
{
if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE)
{
eglDestroySurface(mEglDisplay, surface);
}
}
void OpenGLES::MakeCurrent(const EGLSurface surface)
{
if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE)
{
throw Exception::CreateException(E_FAIL, L"Failed to make EGLSurface current");
}
}
EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface)
{
return (eglSwapBuffers(mEglDisplay, surface));
}

View File

@ -4,11 +4,11 @@ VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HelloCpp", "HelloCpp", "{36AFDE04-D127-4D84-9730-D84E3E51EAA7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Shared", "HelloCpp.Shared\HelloCpp.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "App.Shared", "App.Shared\HelloCpp.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.Windows", "HelloCpp.Windows\HelloCpp.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "App.Windows", "App.Windows\HelloCpp.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp.WindowsPhone", "HelloCpp.WindowsPhone\HelloCpp.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "App.WindowsPhone", "App.WindowsPhone\HelloCpp.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{80DA05C1-6532-4D2A-8606-EF02079B1373}"
EndProject
@ -39,17 +39,17 @@ EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4
HelloCpp.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9
App.Shared\HelloCpp.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9
..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4
..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9
HelloCpp.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4
App.Shared\HelloCpp.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4
..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9
..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9
..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4
..\cocos2d\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4
..\cocos2d\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{22f798d8-bfff-4754-996f-a5395343d5ec}*SharedItemsImports = 4
..\cocos2d\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4
HelloCpp.Shared\HelloCpp.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4
App.Shared\HelloCpp.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM

View File

@ -25,5 +25,22 @@
},
"android_cfg": {
"project_path": "proj.android"
}
},
"wp8_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-wp8.sln",
"project_name": "cpp-empty-test",
"build_folder_path": "cpp-empty-test/Properties/WMAppManifest.xml"
},
"wp8_1_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-win8.1-universal.sln",
"project_name": "HelloCpp.WindowsPhone"
},
"metro_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-win8.1-universal.sln",
"project_name": "HelloCpp.Windows"
},
"engine_dir": "../../"
}

View File

@ -124,15 +124,15 @@
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
@ -144,15 +144,15 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -164,15 +164,15 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -184,15 +184,15 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -204,15 +204,15 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -224,15 +224,15 @@ xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templat
</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.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\HelloCpp.Shared\*" /eiycq</Command>
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq
xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win8.1-universal\App.Shared\*" /eiycq</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>

View File

@ -25,5 +25,22 @@
},
"android_cfg": {
"project_path": "proj.android"
}
},
"wp8_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-wp8.sln",
"project_name": "cpp-tests",
"build_folder_path": "cpp-tests/Properties/WMAppManifest.xml"
},
"wp8_1_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-win8.1-universal.sln",
"project_name": "cpp-tests.WindowsPhone"
},
"metro_cfg" : {
"project_path": "../../build",
"sln_file": "cocos2d-win8.1-universal.sln",
"project_name": "cpp-tests.Windows"
},
"engine_dir": "../../"
}

View File

@ -2403,7 +2403,7 @@ void SpriteHybrid::reparentSprite(float dt)
Vector<Node*> retArray(250);
if( _usingSpriteBatchNode )
CC_SWAP(p1,p2, Node*);
std::swap(p1, p2);
////----CCLOG("New parent is: %x", p2);

View File

@ -26,5 +26,6 @@
},
"android_cfg": {
"project_path": "project/proj.android"
}
},
"engine_dir": "../../"
}

View File

@ -26,5 +26,6 @@
},
"android_cfg": {
"project_path": "project/proj.android"
}
},
"engine_dir": "../../"
}

View File

@ -113,6 +113,8 @@ tags
!/tools/cocos2d-console/console/bin/
!/plugin-x/plugin-x_ios.xcworkspace/
!/cocos/2d/platform/android/java/res/
# Permit plugins to ship third-party libraries.
!/plugin/plugins/*/proj.android/libs/*.jar
v*-deps-*.zip
v*-lua-runtime-*.zip