This commit is contained in:
bofeng-song 2014-05-23 13:43:55 +08:00
commit b44628f335
29 changed files with 187 additions and 24 deletions

View File

@ -5,6 +5,7 @@ cocos2d-x-3.1 ???
[FIX] Physics integration: may crashes if remove bodies at physics contact callback
[FIX] WP8: orientation is not correct when it is set to portrait
[FIX] WP8: fix for precompiled shaders and precompiled headers
[FIX] WP8: template supports orientation
cocos2d-x-3.1-rc0 May.18 2014
[NEW] Cocos2dxActivity: Adds a virtual method to load native libraries.

View File

@ -4022,11 +4022,6 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
TargetAttributes = {
1ABCA2CC18CD93580087CE3A = {
DevelopmentTeam = NQ596S94Q5;
};
};
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "cocos2d_tests" */;
compatibilityVersion = "Xcode 3.2";
@ -5427,14 +5422,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
CC_TARGET_OS_IPHONE,
);
INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-tests/project/proj.ios_mac/ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";
@ -5445,14 +5438,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
CC_TARGET_OS_IPHONE,
);
INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-tests/project/proj.ios_mac/ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto";

View File

@ -296,18 +296,18 @@ unsigned char* FontFreeType::getGlyphBitmap(unsigned short theChar, long &outWid
break;
}
long outlineWidth = (bbox.xMax - bbox.xMin)>>6;
long outlineHeight = (bbox.yMax - bbox.yMin)>>6;
auto outlineWidth = (bbox.xMax - bbox.xMin)>>6;
auto outlineHeight = (bbox.yMax - bbox.yMin)>>6;
long blendWidth = outlineWidth > outWidth ? outlineWidth : outWidth;
long blendHeight = outlineHeight > outHeight ? outlineHeight : outHeight;
auto blendWidth = outlineWidth > outWidth ? outlineWidth : outWidth;
auto blendHeight = outlineHeight > outHeight ? outlineHeight : outHeight;
long index,index2;
auto blendImage = new unsigned char[blendWidth * blendHeight * 2];
memset(blendImage, 0, blendWidth * blendHeight * 2);
int px = (blendWidth - outlineWidth) / 2;
int py = (blendHeight - outlineHeight) / 2;
auto px = (blendWidth - outlineWidth) / 2;
auto py = (blendHeight - outlineHeight) / 2;
for (int x = 0; x < outlineWidth; ++x)
{
for (int y = 0; y < outlineHeight; ++y)

View File

@ -43,4 +43,11 @@
-- @param #cc.Node node
-- @return ClippingNode#ClippingNode ret (retunr value: cc.ClippingNode)
--------------------------------
-- @function [parent=#ClippingNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
return nil

View File

@ -301,6 +301,13 @@
-- @param self
-- @param #cc.BlendFunc blendfunc
--------------------------------
-- @function [parent=#Label] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#Label] getScaleX
-- @param self

View File

@ -177,6 +177,13 @@
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#LabelTTF] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#LabelTTF] LabelTTF
-- @param self

View File

@ -315,6 +315,17 @@
-- @param #cc.Component component
-- @return bool#bool ret (return value: bool)
--------------------------------
-- overload function: visit()
--
-- overload function: visit(cc.Renderer, cc.Mat4, bool)
--
-- @function [parent=#Node] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#Node] isOpacityModifyRGB
-- @param self

View File

@ -27,4 +27,11 @@
-- @param self
-- @return NodeGrid#NodeGrid ret (return value: cc.NodeGrid)
--------------------------------
-- @function [parent=#NodeGrid] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
return nil

View File

@ -33,6 +33,13 @@
-- @param #int int
-- @param #int int
--------------------------------
-- @function [parent=#ParallaxNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#ParallaxNode] removeChild
-- @param self

View File

@ -73,6 +73,13 @@
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#ParticleBatchNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#ParticleBatchNode] reorderChild
-- @param self

View File

@ -62,6 +62,13 @@
-- @param self
-- @return ProtectedNode#ProtectedNode ret (return value: cc.ProtectedNode)
--------------------------------
-- @function [parent=#ProtectedNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#ProtectedNode] updateDisplayedOpacity
-- @param self

View File

@ -172,6 +172,13 @@
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#RenderTexture] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#RenderTexture] RenderTexture
-- @param self

View File

@ -126,6 +126,13 @@
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- @function [parent=#SpriteBatchNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #cc.Mat4 mat4
-- @param #bool bool
--------------------------------
-- @function [parent=#SpriteBatchNode] sortAllChildren
-- @param self

View File

@ -6330,6 +6330,63 @@ int lua_cocos2dx_Node_addComponent(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Node_visit(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_visit'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
do{
if (argc == 0) {
cobj->visit();
return 0;
}
}while(0);
ok = true;
do{
if (argc == 3) {
cocos2d::Renderer* arg0;
ok &= luaval_to_object<cocos2d::Renderer>(tolua_S, 2, "cc.Renderer",&arg0);
if (!ok) { break; }
cocos2d::Mat4 arg1;
ok &= luaval_to_mat4(tolua_S, 3, &arg1);
if (!ok) { break; }
bool arg2;
ok &= luaval_to_boolean(tolua_S, 4,&arg2);
if (!ok) { break; }
cobj->visit(arg0, arg1, arg2);
return 0;
}
}while(0);
ok = true;
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "visit",argc, 3);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_visit'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Node_isOpacityModifyRGB(lua_State* tolua_S)
{
int argc = 0;
@ -9311,6 +9368,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S)
tolua_function(tolua_S,"getChildrenCount",lua_cocos2dx_Node_getChildrenCount);
tolua_function(tolua_S,"convertToNodeSpaceAR",lua_cocos2dx_Node_convertToNodeSpaceAR);
tolua_function(tolua_S,"addComponent",lua_cocos2dx_Node_addComponent);
tolua_function(tolua_S,"visit",lua_cocos2dx_Node_visit);
tolua_function(tolua_S,"isOpacityModifyRGB",lua_cocos2dx_Node_isOpacityModifyRGB);
tolua_function(tolua_S,"getRotation",lua_cocos2dx_Node_getRotation);
tolua_function(tolua_S,"getAnchorPointInPoints",lua_cocos2dx_Node_getAnchorPointInPoints);

View File

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

View File

@ -24,6 +24,7 @@ using Microsoft.Phone.Shell;
using Windows.UI.Input;
using System.Windows.Threading;
using Microsoft.Phone.Info;
using Windows.Graphics.Display;
namespace PhoneDirect3DXamlAppInterop
{
@ -53,7 +54,30 @@ namespace PhoneDirect3DXamlAppInterop
{
if (m_d3dInterop == null)
{
m_d3dInterop = new Direct3DInterop();
PageOrientation pageOrientation = (PageOrientation)GetValue(OrientationProperty);
DisplayOrientations displayOrientation;
switch(pageOrientation)
{
case PageOrientation.Portrait:
case PageOrientation.PortraitUp:
displayOrientation = DisplayOrientations.Portrait;
break;
case PageOrientation.PortraitDown:
displayOrientation = DisplayOrientations.PortraitFlipped;
break;
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
displayOrientation = DisplayOrientations.Landscape;
break;
case PageOrientation.LandscapeRight:
displayOrientation = DisplayOrientations.LandscapeFlipped;
break;
default:
displayOrientation = DisplayOrientations.Landscape;
break;
}
m_d3dInterop = new Direct3DInterop(displayOrientation);
// Set WindowBounds to size of DrawingSurface
m_d3dInterop.WindowBounds = new Windows.Foundation.Size(

View File

@ -106,12 +106,12 @@ public:
int designWidth = 1280;
int designHeight = 800;
Director::getInstance()->getOpenGLView()->setDesignResolutionSize(designWidth,designHeight,ResolutionPolicy::EXACT_FIT);
string playEnbleFile = "res/debug/Play1.png";
string shineFile = "res/debug/shine.png";
string backgroundFile = "res/debug/landscape.png";
string playEnbleFile = "rtres/Play1.png";
string shineFile = "rtres/shine.png";
string backgroundFile = "rtres/landscape.png";
if (!ConfigParser::getInstance()->isLanscape())
{
backgroundFile = "res/debug/portrait.png";
backgroundFile = "rtres/portrait.png";
Director::getInstance()->getOpenGLView()->setDesignResolutionSize(designHeight,designWidth,ResolutionPolicy::EXACT_FIT);
}

View File

@ -30,6 +30,10 @@
"from": "../../../config.json",
"to": ""
},
{
"from": "../../../runtime/rtres",
"to": "rtres"
},
{
"from": "../../cocos2d-x/external/lua/luasocket",
"to": "",

View File

@ -109,9 +109,11 @@ if exist "$(OutDir)\Resource" rd /s /q "$(OutDir)\Resource"
mkdir "$(OutDir)\Resource"
mkdir "$(OutDir)\Resource\src"
mkdir "$(OutDir)\Resource\res"
mkdir "$(OutDir)\Resource\rtres"
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
xcopy "$(ProjectDir)..\..\..\runtime\rtres" "$(OutDir)\Resource\rtres" /e /Y
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
<Message>copy files</Message>
@ -165,9 +167,11 @@ if exist "$(OutDir)\Resource" rd /s /q "$(OutDir)\Resource"
mkdir "$(OutDir)\Resource"
mkdir "$(OutDir)\Resource\src"
mkdir "$(OutDir)\Resource\res"
mkdir "$(OutDir)\Resource\rtres"
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
xcopy "$(ProjectDir)..\..\..\runtime\rtres" "$(OutDir)\Resource\rtres" /e /Y
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
<Message>copy files</Message>

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -373,7 +373,7 @@ void Effect3DOutline::drawWithSprite(EffectSprite3D* sprite, const Mat4 &transfo
glBindBuffer(GL_ARRAY_BUFFER, mesh->getVertexBuffer());
_glProgramState->apply(transform);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh->getIndexBuffer());
glDrawElements((GLenum)mesh->getPrimitiveType(), mesh->getIndexCount(), (GLenum)mesh->getIndexFormat(), 0);
glDrawElements((GLenum)mesh->getPrimitiveType(), (GLsizei)mesh->getIndexCount(), (GLenum)mesh->getIndexFormat(), 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glDisable(GL_DEPTH_TEST);

View File

@ -70,6 +70,8 @@
</array>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>

View File

@ -65,4 +65,8 @@ fileUtils:setSearchPaths(searchPaths)
local scene = cc.Scene:create()
scene:addChild(CreateTestMenu())
cc.Director:getInstance():runWithScene(scene)
if cc.Director:getInstance():getRunningScene() then
cc.Director:getInstance():replaceScene(scene)
else
cc.Director:getInstance():runWithScene(scene)
end

@ -1 +1 @@
Subproject commit edd24a1dcc0d8344038e4d46367c603b2a846ab5
Subproject commit 29cfa00a4b85f934eefe0b2fae460bd9a55ee345

View File

@ -101,7 +101,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS
Scheduler::[pause resume unschedule schedule update isTargetPaused isScheduled performFunctionInCocosThread],
TextureCache::[addPVRTCImage addImageAsync],
Timer::[getSelector createWithScriptHandler],
*::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate onTouch.* onAcc.* onKey.* onRegisterTouchListener],
*::[copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate onTouch.* onAcc.* onKey.* onRegisterTouchListener],
FileUtils::[getFileData getDataFromFile getFullPathCache],
Application::[^application.* ^run$],
Camera::[getEyeXYZ getCenterXYZ getUpXYZ],