mirror of https://github.com/axmolengine/axmol.git
Merge branch 'upto-0.99.5' of https://github.com/minggo/cocos2d-x into minggo-upto-0.99.5
This commit is contained in:
commit
b0e5c06d37
|
@ -35,6 +35,7 @@ THE SOFTWARE.
|
||||||
#include "CCXEGLView.h"
|
#include "CCXEGLView.h"
|
||||||
#include "ccxCommon.h"
|
#include "ccxCommon.h"
|
||||||
#include "CCGL.h"
|
#include "CCGL.h"
|
||||||
|
#include "platform/CCNS.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
namespace cocos2d {
|
namespace cocos2d {
|
||||||
|
@ -181,6 +182,8 @@ class CCLabelTTF;
|
||||||
class CCScene;
|
class CCScene;
|
||||||
class cocos2d::CCXEGLView;
|
class cocos2d::CCXEGLView;
|
||||||
class NSEvent;
|
class NSEvent;
|
||||||
|
class CCNode;
|
||||||
|
class CCProjectionProtocol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Class that creates and handle the main Window and manages how
|
@brief Class that creates and handle the main Window and manages how
|
||||||
|
@ -264,7 +267,7 @@ public:
|
||||||
/** returns the display size of the OpenGL view in pixels.
|
/** returns the display size of the OpenGL view in pixels.
|
||||||
It doesn't take into account any possible rotation of the window.
|
It doesn't take into account any possible rotation of the window.
|
||||||
*/
|
*/
|
||||||
CGSize getDisplaySizeInPiXels(void);
|
CGSize getDisplaySizeInPixels(void);
|
||||||
|
|
||||||
/** changes the projection size */
|
/** changes the projection size */
|
||||||
void reshapeProjection(CGSize newWindowSize);
|
void reshapeProjection(CGSize newWindowSize);
|
||||||
|
|
|
@ -474,7 +474,7 @@ CGSize CCDirector::getWinSizeInPixels()
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the current frame size
|
// return the current frame size
|
||||||
CGSize CCDirector::getDisplaySizeInPiXels(void)
|
CGSize CCDirector::getDisplaySizeInPixels(void)
|
||||||
{
|
{
|
||||||
return m_obWinSizeInPixels;
|
return m_obWinSizeInPixels;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "CCGrabber.h"
|
#include "effects/CCGrabber.h"
|
||||||
|
#include "support/ccUtils.h"
|
||||||
|
|
||||||
#include "CCGL.h"
|
#include "CCGL.h"
|
||||||
#include "CGPointExtension.h"
|
#include "CGPointExtension.h"
|
||||||
|
@ -108,8 +109,8 @@ namespace cocos2d
|
||||||
CCDirector *pDirector = CCDirector::sharedDirector();
|
CCDirector *pDirector = CCDirector::sharedDirector();
|
||||||
CGSize s = pDirector->getWinSizeInPixels();
|
CGSize s = pDirector->getWinSizeInPixels();
|
||||||
|
|
||||||
unsigned int POTWide = ccNextPOT(s.width);
|
unsigned int POTWide = ccNextPOT((unsigned int)s.width);
|
||||||
unsigned int POTHigh = ccNextPOT(s.height);
|
unsigned int POTHigh = ccNextPOT((unsigned int)s.height);
|
||||||
|
|
||||||
CCTexture2DPixelFormat format = pDirector->getPiexFormat() == kCCPixelFormatRGB565 ? kCCTexture2DPixelFormat_RGB565 : kCCTexture2DPixelFormat_RGBA8888;
|
CCTexture2DPixelFormat format = pDirector->getPiexFormat() == kCCPixelFormatRGB565 ? kCCTexture2DPixelFormat_RGB565 : kCCTexture2DPixelFormat_RGBA8888;
|
||||||
|
|
||||||
|
@ -122,7 +123,7 @@ namespace cocos2d
|
||||||
}
|
}
|
||||||
|
|
||||||
CCTexture2D *pTexture = new CCTexture2D();
|
CCTexture2D *pTexture = new CCTexture2D();
|
||||||
pTexture->initWithData(data, format, textureSize, textureSize, s);
|
pTexture->initWithData(data, format, POTWide, POTHigh, s);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
@ -133,10 +134,7 @@ namespace cocos2d
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initWithSize(gridSize, pTexture, false))
|
initWithSize(gridSize, pTexture, false);
|
||||||
{
|
|
||||||
// do something
|
|
||||||
}
|
|
||||||
|
|
||||||
pTexture->release();
|
pTexture->release();
|
||||||
|
|
||||||
|
@ -178,7 +176,7 @@ namespace cocos2d
|
||||||
{
|
{
|
||||||
CCDirector *pDirector = CCDirector::sharedDirector();
|
CCDirector *pDirector = CCDirector::sharedDirector();
|
||||||
|
|
||||||
CGSize winSize = pDirector->getDisplaySize();
|
CGSize winSize = pDirector->getDisplaySizeInPixels();
|
||||||
float w = winSize.width / 2;
|
float w = winSize.width / 2;
|
||||||
float h = winSize.height / 2;
|
float h = winSize.height / 2;
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ CGSize CCDirector::getWinSizeInPixels()
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the current frame size
|
// return the current frame size
|
||||||
CGSize CCDirector::getDisplaySizeInPiXels(void)
|
CGSize CCDirector::getDisplaySizeInPixels(void)
|
||||||
{
|
{
|
||||||
return m_obWinSizeInPixels;
|
return m_obWinSizeInPixels;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include "CCGrid.h"
|
#include "effects/CCGrid.h"
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "CCGrabber.h"
|
#include "effects/CCGrabber.h"
|
||||||
|
#include "support/ccUtils.h"
|
||||||
|
|
||||||
#include "CCGL.h"
|
#include "CCGL.h"
|
||||||
#include "CGPointExtension.h"
|
#include "CGPointExtension.h"
|
||||||
|
@ -108,8 +109,8 @@ namespace cocos2d
|
||||||
CCDirector *pDirector = CCDirector::sharedDirector();
|
CCDirector *pDirector = CCDirector::sharedDirector();
|
||||||
CGSize s = pDirector->getWinSizeInPixels();
|
CGSize s = pDirector->getWinSizeInPixels();
|
||||||
|
|
||||||
unsigned int POTWide = ccNextPOT(s.width);
|
unsigned int POTWide = ccNextPOT((unsigned int)s.width);
|
||||||
unsigned int POTHigh = ccNextPOT(s.height);
|
unsigned int POTHigh = ccNextPOT((unsigned int)s.height);
|
||||||
|
|
||||||
// on mac, it use kCCTexture2DPixelFormat_RGBA8888
|
// on mac, it use kCCTexture2DPixelFormat_RGBA8888
|
||||||
CCTexture2DPixelFormat format = kCCTexture2DPixelFormat_RGBA8888;
|
CCTexture2DPixelFormat format = kCCTexture2DPixelFormat_RGBA8888;
|
||||||
|
@ -123,7 +124,7 @@ namespace cocos2d
|
||||||
}
|
}
|
||||||
|
|
||||||
CCTexture2D *pTexture = new CCTexture2D();
|
CCTexture2D *pTexture = new CCTexture2D();
|
||||||
pTexture->initWithData(data, format, textureSize, textureSize, s);
|
pTexture->initWithData(data, format, POTWide, POTHigh, s);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
@ -134,10 +135,7 @@ namespace cocos2d
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initWithSize(gridSize, pTexture, false))
|
initWithSize(gridSize, pTexture, false);
|
||||||
{
|
|
||||||
// do something
|
|
||||||
}
|
|
||||||
|
|
||||||
pTexture->release();
|
pTexture->release();
|
||||||
|
|
||||||
|
@ -177,6 +175,7 @@ namespace cocos2d
|
||||||
// mac can not applay land space
|
// mac can not applay land space
|
||||||
void CCGridBase::applyLandscape(void)
|
void CCGridBase::applyLandscape(void)
|
||||||
{
|
{
|
||||||
|
CCLOG("unsupported");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCGridBase::set2DProjection()
|
void CCGridBase::set2DProjection()
|
||||||
|
|
|
@ -232,6 +232,14 @@
|
||||||
RelativePath="..\actions\CCActionTiledGrid.cpp"
|
RelativePath="..\actions\CCActionTiledGrid.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\platform\mac\CCDirectorDisplayLinkMacWrapper.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\platform\mac\CCDirectorDisplayLinkMacWrapper.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="base_nodes"
|
Name="base_nodes"
|
||||||
|
@ -252,10 +260,6 @@
|
||||||
RelativePath="..\effects\CCGrabber.h"
|
RelativePath="..\effects\CCGrabber.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\effects\CCGrid.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\effects\CCGrid.h"
|
RelativePath="..\effects\CCGrid.h"
|
||||||
>
|
>
|
||||||
|
@ -336,6 +340,10 @@
|
||||||
RelativePath="..\include\CCDrawingPrimitives.h"
|
RelativePath="..\include\CCDrawingPrimitives.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\include\CCGL.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\include\CCKeypadDelegate.h"
|
RelativePath="..\include\CCKeypadDelegate.h"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue