mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3-37alpha0
This commit is contained in:
commit
79aa300448
18
README.md
18
README.md
|
@ -13,7 +13,7 @@ cocos2d-x
|
|||
|
||||
[cocos2d-x][1] is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications.
|
||||
It is based on [cocos2d-iphone][2], but instead of using Objective-C, it uses C++.
|
||||
It works on iOS, Android, Windows Phone, OS X, Windows and Linux.
|
||||
It works on iOS, Android, Windows Phone and Store Apps, OS X, Windows and Linux.
|
||||
|
||||
cocos2d-x is:
|
||||
|
||||
|
@ -86,16 +86,20 @@ Run
|
|||
|
||||
$ cocos run -p win32
|
||||
|
||||
### Build and run new project for Windows 8.1 and Windows Phone 8.1 ###
|
||||
### Build and run new project for Windows 8.1/10.0 and Windows Phone 8.1/10.0 ###
|
||||
|
||||
$ cocos new MyGame -p com.your_company.mygame -l cpp -d projects
|
||||
|
||||
Visual Studio 2013 Update 4 or later is required.
|
||||
* Visual Studio 2013 Update 4 or later is required for Windows 8.1 Universal Apps
|
||||
|
||||
* Visual Studio 2015 RC and Windows 10.0 (build 10074 or higher) is required for Windows 10.0 UWP Apps
|
||||
|
||||
Starting with Cocos2d-x v3.3, you can create Windows 8.1 Universal Apps (Windows Store and Windows Phone 8.1).
|
||||
Starting with Cocos2d-x v3.6 you can create Windows 10.0 UWP Apps (Windows Store and Windows Phone 10.0).
|
||||
Starting with Cocos2d-x v3.6 there will no longer be support for Windows Phone 8.0.
|
||||
|
||||
Starting with Cocos2d-x v3.3, you can create Windows 8.1 Universal Apps (Windows Store and Windows Phone 8.1)
|
||||
See more info on How to install and Create games on Windows RT (Windows and Windows Phone 8.1) at http://msopentech.github.io/cocos2d-x/
|
||||
|
||||
Starting with Cocos2d-x v3.6 there will no longer be support for Windows Phone 8.0
|
||||
|
||||
Main features
|
||||
-------------
|
||||
|
@ -145,10 +149,10 @@ Runtime Requirements
|
|||
--------------------
|
||||
* iOS 5.0+ for iPhone / iPad games
|
||||
* Android 2.3+ for Android games
|
||||
* Windows Phone 8 and 8.1 for Windows Phone games
|
||||
* Windows 8.1 for Windows Phone/Store 8.1 games
|
||||
* Windows 10.0 for Windows Phone/Store 10.0 games
|
||||
* OS X v10.6+ for Mac games
|
||||
* Windows 7+ for Win games
|
||||
* Windows 8+ for WinRT games (Modern Apps)
|
||||
|
||||
|
||||
Running Tests
|
||||
|
|
|
@ -152,12 +152,8 @@ void Camera::lookAt(const Vec3& lookAtPos, const Vec3& up)
|
|||
|
||||
Quaternion quaternion;
|
||||
Quaternion::createFromRotationMatrix(rotation,&quaternion);
|
||||
|
||||
float rotx = atan2f(2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z), 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y));
|
||||
float roty = asin(clampf(2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x) , -1.0f , 1.0f));
|
||||
float rotz = -atan2(2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y) , 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z));
|
||||
|
||||
setRotation3D(Vec3(CC_RADIANS_TO_DEGREES(rotx),CC_RADIANS_TO_DEGREES(roty),CC_RADIANS_TO_DEGREES(rotz)));
|
||||
quaternion.normalize();
|
||||
setRotationQuat(quaternion);
|
||||
}
|
||||
|
||||
const Mat4& Camera::getViewProjectionMatrix() const
|
||||
|
|
|
@ -24,6 +24,11 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* The purpose of Enhance API is to optimize Cocos2D-X game engine special for Samsung products.
|
||||
* Note: The minimum required Android version is 5.0.
|
||||
*
|
||||
*/
|
||||
class CC_DLL EnhanceAPI
|
||||
{
|
||||
public:
|
||||
|
@ -38,42 +43,57 @@ public:
|
|||
virtual ~EnhanceAPI();
|
||||
|
||||
/**
|
||||
@brief call gameservice setResolutionSize API.
|
||||
@param the optimized percent value.
|
||||
@return success: 0, fail: -1.
|
||||
*/
|
||||
static int setResolutionPercent(int n);
|
||||
* @brief The function is used to set screen buffer size ratio.
|
||||
* The purpose of the API is to modify off screen buffer size for the game app.
|
||||
* It will reduce the off screen buffer according to the given ration.
|
||||
* The ration value varies from 50 to 100. 100 means using 100% size of the on screen buffer
|
||||
* as off screen buffer and 50 means 50% size of the on screen buffer will be used as off screen buffer.
|
||||
*
|
||||
* @param percent The optimized percent value, value varies from 50 to 100.
|
||||
* @return success: 0, fail: -1.
|
||||
*/
|
||||
static int setResolutionPercent(int percent);
|
||||
|
||||
/**
|
||||
@brief call gameservice setFPS API.
|
||||
@param the fps value.
|
||||
@return success: 0, fail: -1.
|
||||
*/
|
||||
*@brief The function is used to set FPS level.
|
||||
*@Warn The input fps level(0-99) corresponds to game fps value(0-60).
|
||||
* FPS level 99 means game FPS value 60.
|
||||
* The purpose of the API is reducing power consumption when we set dynamic fps in some situations.
|
||||
*@param fps the fps value.
|
||||
*@return success: 0, fail: -1.
|
||||
*/
|
||||
static int setFPS(int fps);
|
||||
|
||||
|
||||
/**
|
||||
@brief call gameservice fastLoading API.
|
||||
@param the fast loading seconds.
|
||||
@return success: 0, fail: -1.
|
||||
*/
|
||||
*@brief The function is used to set Boost Up seconds.
|
||||
* The input parameter means the loading seconds. The maximum settings seconds is 7.
|
||||
* The purpose of the API is reducing the application's loading time.
|
||||
*@param sec The fast loading seconds.
|
||||
*@return success: 0, fail: -1.
|
||||
*/
|
||||
static int fastLoading(int sec);
|
||||
|
||||
|
||||
/**
|
||||
@brief call gameservice getTemperature API.
|
||||
@return -1: fail to get temperature
|
||||
0: normal temperature
|
||||
1: high
|
||||
2,3: very high
|
||||
*/
|
||||
*@brief The function is used to get temperature level(0-3).
|
||||
* The purpose of the API is get temperature status of the device.
|
||||
* Temperature 0 means normal temperature and 1-3 means different temperature level.
|
||||
* 1 is the minimum high temperature level and 3 is the maximum high temperature level.
|
||||
*@return -1: fail to get temperature.
|
||||
* - 0: normal temperature
|
||||
* - 1: high
|
||||
* - 2,3: very high
|
||||
*/
|
||||
static int getTemperature();
|
||||
|
||||
/**
|
||||
@brief call gameservice setLowPowerMode API.
|
||||
@return -1: fail to get temperature
|
||||
0: normal temperature
|
||||
1: high
|
||||
2,3: very high
|
||||
*/
|
||||
|
||||
/**
|
||||
*@brief The function is used to set power saving mode for true or false.
|
||||
* The purpose of the API is reducing Power consumption when set power saving mode for true.
|
||||
*
|
||||
*@return -1: fail to get temperature
|
||||
* - 0: normal temperature
|
||||
* - 1: high
|
||||
* - 2,3: very high
|
||||
*/
|
||||
static int setLowPowerMode(bool enable);
|
||||
};
|
||||
|
||||
|
@ -81,4 +101,4 @@ NS_CC_END
|
|||
|
||||
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
|
||||
|
||||
#endif // __CC_ENHANCEAPI_ANDROID_H__
|
||||
#endif // __CC_ENHANCEAPI_ANDROID_H__
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="cocos2d_Windows.App">
|
||||
<m2:VisualElements DisplayName="HelloCpp.Windows" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png" Description="HelloCpp.Windows" ForegroundText="light" BackgroundColor="#464646">
|
||||
<m2:DefaultTile>
|
||||
<m2:ShowNameOnTiles>
|
||||
<m2:ShowOn Tile="square150x150Logo" />
|
||||
</m2:ShowNameOnTiles>
|
||||
</m2:DefaultTile>
|
||||
<m2:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<m2:InitialRotationPreference>
|
||||
<m2:Rotation Preference="landscape" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"win32_cfg": {
|
||||
"project_path": "../../build",
|
||||
"sln_file": "cocos2d-win32.vc2013.sln",
|
||||
"sln_file": "cocos2d-win32.sln",
|
||||
"project_name": "cpp-empty-test",
|
||||
"build_cfg_path": "proj.win32"
|
||||
},
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="cocos2d_Windows.App">
|
||||
<m2:VisualElements DisplayName="HelloCpp.Windows" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png" Description="HelloCpp.Windows" ForegroundText="light" BackgroundColor="#464646">
|
||||
<m2:DefaultTile>
|
||||
<m2:ShowNameOnTiles>
|
||||
<m2:ShowOn Tile="square150x150Logo" />
|
||||
</m2:ShowNameOnTiles>
|
||||
</m2:DefaultTile>
|
||||
<m2:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<m2:InitialRotationPreference>
|
||||
<m2:Rotation Preference="landscape" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"win32_cfg": {
|
||||
"project_path": "../../build",
|
||||
"sln_file": "cocos2d-win32.vc2013.sln",
|
||||
"sln_file": "cocos2d-win32.sln",
|
||||
"project_name": "cpp-tests",
|
||||
"build_cfg_path": "proj.win32"
|
||||
},
|
||||
|
|
|
@ -232,8 +232,7 @@ bool UITextTest_IgnoreConentSize::init()
|
|||
widgetSize.height / 2.0f));
|
||||
leftText->ignoreContentAdaptWithSize(false);
|
||||
leftText->setTextAreaSize(Size(60,60));
|
||||
leftText->setString("Text line with break\nText line \
|
||||
with break\nText line with break\nText line with break\n");
|
||||
leftText->setString("Text line with break\nText line with break\nText line with break\nText line with break\n");
|
||||
leftText->setTouchScaleChangeEnabled(true);
|
||||
leftText->setTouchEnabled(true);
|
||||
_uiLayer->addChild(leftText);
|
||||
|
@ -243,8 +242,7 @@ bool UITextTest_IgnoreConentSize::init()
|
|||
"fonts/Marker Felt.ttf",10);
|
||||
rightText->setPosition(Vec2(widgetSize.width / 2.0f + 50,
|
||||
widgetSize.height / 2.0f));
|
||||
rightText->setString("Text line with break\nText line \
|
||||
with break\nText line with break\nText line with break\n");
|
||||
rightText->setString("Text line with break\nText line with break\nText line with break\nText line with break\n");
|
||||
//note:setTextAreaSize must be used with ignoreContentAdaptWithSize(false)
|
||||
rightText->setTextAreaSize(Size(100,30));
|
||||
rightText->ignoreContentAdaptWithSize(false);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"has_native": true,
|
||||
"win32_cfg": {
|
||||
"project_path": "../../build",
|
||||
"sln_file": "cocos2d-js-win32.vc2013.sln",
|
||||
"sln_file": "cocos2d-js-win32.sln",
|
||||
"project_name": "js-tests",
|
||||
"build_cfg_path": "project/proj.win32"
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"win32_cfg": {
|
||||
"project_path": "../../build",
|
||||
"sln_file": "cocos2d-win32.vc2013.sln",
|
||||
"sln_file": "cocos2d-win32.sln",
|
||||
"project_name": "lua-empty-test",
|
||||
"build_cfg_path": "project/proj.win32"
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"win32_cfg": {
|
||||
"project_path": "../../build",
|
||||
"sln_file": "cocos2d-win32.vc2013.sln",
|
||||
"sln_file": "cocos2d-win32.sln",
|
||||
"project_name": "lua-tests",
|
||||
"build_cfg_path": "project/proj.win32"
|
||||
},
|
||||
|
|
|
@ -1035,8 +1035,8 @@ end
|
|||
function CameraArcBallDemo:updateCameraTransform()
|
||||
-- body
|
||||
local trans = cc.mat4.createTranslation(cc.vec3(0.0, 10.0, self._distanceZ), cc.mat4.createIdentity())
|
||||
local rot = cc.mat4.createRotation(self._rotationQuat, cc.mat4.createIdentity())
|
||||
local center = cc.mat4.createTranslation(self._center, cc.mat4.createIdentity())
|
||||
local rot = cc.mat4.new(cc.mat4.createRotation(self._rotationQuat, cc.mat4.createIdentity()))
|
||||
local center = cc.mat4.new(cc.mat4.createTranslation(self._center, cc.mat4.createIdentity()))
|
||||
local result = cc.mat4.new(center:multiply(rot)):multiply(trans)
|
||||
|
||||
self._camera:setNodeToParentTransform(result)
|
||||
|
|
|
@ -1243,7 +1243,7 @@ function LabelCharMapTest.create()
|
|||
label2:setPosition( cc.p(10,160) )
|
||||
label2:setOpacity( 32 )
|
||||
|
||||
local label3 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.png", 48, 64, 32)--32 means Space key
|
||||
local label3 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.plist")--32 means Space key
|
||||
label3:setString("123 Test")
|
||||
layer:addChild(label3, 0, kTagSprite3)
|
||||
label3:setPosition(cc.p(10,220))
|
||||
|
@ -1388,13 +1388,13 @@ function LabelCharMapColorTest.create()
|
|||
Helper.titleLabel:setString("New Label + CharMap")
|
||||
Helper.subtitleLabel:setString("Opacity + Color should work at the same time")
|
||||
|
||||
local label1 = cc.Label:createWithCharMap( "fonts/tuffy_bold_italic-charmap.png", 48, 64, 32)--32 means Space key
|
||||
local label1 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.plist")--32 means Space key
|
||||
layer:addChild(label1, 0, kTagSprite1)
|
||||
label1:setAnchorPoint(cc.p(0.0, 0.0))
|
||||
label1:setPosition( cc.p(10,100) )
|
||||
label1:setOpacity( 200 )
|
||||
|
||||
local label2 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.png", 48, 64, 32)--32 means Space key
|
||||
local label2 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.plist")--32 means Space key
|
||||
layer:addChild(label2, 0, kTagSprite2)
|
||||
label2:setAnchorPoint(cc.p(0.0, 0.0))
|
||||
label2:setPosition( cc.p(10, 200) )
|
||||
|
|
|
@ -61,9 +61,8 @@ local function baseInit(self)
|
|||
local children = ps:getChildren()
|
||||
for i= 1, #children do
|
||||
local child = children[i]
|
||||
if nil ~= child then
|
||||
--UNDO
|
||||
count = count + #(child:getParticlePool():getActiveParticleList())
|
||||
if nil ~= child and nil ~= child.getAliveParticleCount then
|
||||
count = count + child:getAliveParticleCount()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue