mirror of https://github.com/axmolengine/axmol.git
Compilation fix when CC_ENABLE_BOX2D_INTEGRATION is enabled.
This commit is contained in:
parent
551f95b83c
commit
23c963cbdc
|
@ -17,9 +17,12 @@ Box2DTestLayer::Box2DTestLayer()
|
||||||
, world(NULL)
|
, world(NULL)
|
||||||
{
|
{
|
||||||
#if CC_ENABLE_BOX2D_INTEGRATION
|
#if CC_ENABLE_BOX2D_INTEGRATION
|
||||||
setTouchEnabled( true );
|
auto dispatcher = Director::getInstance()->getEventDispatcher();
|
||||||
setAccelerometerEnabled( true );
|
|
||||||
|
auto touchListener = EventListenerTouchAllAtOnce::create();
|
||||||
|
touchListener->onTouchesEnded = CC_CALLBACK_2(Box2DTestLayer::onTouchesEnded, this);
|
||||||
|
dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);
|
||||||
|
|
||||||
// init physics
|
// init physics
|
||||||
this->initPhysics();
|
this->initPhysics();
|
||||||
// create reset button
|
// create reset button
|
||||||
|
|
|
@ -23,7 +23,6 @@ public:
|
||||||
void update(float dt);
|
void update(float dt);
|
||||||
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
||||||
|
|
||||||
//CREATE_NODE(Box2DTestLayer);
|
|
||||||
#if CC_ENABLE_BOX2D_INTEGRATION
|
#if CC_ENABLE_BOX2D_INTEGRATION
|
||||||
protected:
|
protected:
|
||||||
kmMat4 _modelViewMV;
|
kmMat4 _modelViewMV;
|
||||||
|
|
|
@ -85,15 +85,16 @@ void ChipmunkTestLayer::toggleDebugCallback(Object* sender)
|
||||||
|
|
||||||
ChipmunkTestLayer::~ChipmunkTestLayer()
|
ChipmunkTestLayer::~ChipmunkTestLayer()
|
||||||
{
|
{
|
||||||
|
#if CC_ENABLE_CHIPMUNK_INTEGRATION
|
||||||
// manually Free rogue shapes
|
// manually Free rogue shapes
|
||||||
for( int i=0;i<4;i++) {
|
for( int i=0;i<4;i++) {
|
||||||
cpShapeFree( _walls[i] );
|
cpShapeFree( _walls[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
cpSpaceFree( _space );
|
cpSpaceFree( _space );
|
||||||
|
|
||||||
Device::setAccelerometerEnabled(false);
|
|
||||||
|
|
||||||
|
Device::setAccelerometerEnabled(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChipmunkTestLayer::initPhysics()
|
void ChipmunkTestLayer::initPhysics()
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
// enable log
|
|
||||||
#define COCOS2D_DEBUG 1
|
|
||||||
|
|
||||||
#include "TextureCacheTest.h"
|
#include "TextureCacheTest.h"
|
||||||
|
|
||||||
|
// enable log
|
||||||
|
#define COCOS2D_DEBUG 1
|
||||||
|
|
||||||
USING_NS_CC;
|
USING_NS_CC;
|
||||||
|
|
||||||
TextureCacheTest::TextureCacheTest()
|
TextureCacheTest::TextureCacheTest()
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// enable log
|
|
||||||
#define COCOS2D_DEBUG 1
|
|
||||||
|
|
||||||
#include "UserDefaultTest.h"
|
#include "UserDefaultTest.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
|
// enable log
|
||||||
|
#define COCOS2D_DEBUG 1
|
||||||
|
|
||||||
UserDefaultTest::UserDefaultTest()
|
UserDefaultTest::UserDefaultTest()
|
||||||
{
|
{
|
||||||
auto s = Director::getInstance()->getWinSize();
|
auto s = Director::getInstance()->getWinSize();
|
||||||
|
|
|
@ -2,4 +2,4 @@ APP_STL := gnustl_static
|
||||||
|
|
||||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char
|
APP_CPPFLAGS := -frtti -DCC_ENABLE_BOX2D_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char
|
||||||
|
|
Loading…
Reference in New Issue