Merge pull request #1367 from dumganhar/gles20

[1] Fixed some compilation error for win32 platform.
[2] Delete 'cocos2d::' since extension is the sub-namespace of cocos2d.
[3] Added libExtensions.lib for TestJavascript vs2010 project. Removed some calling of 'USING_NS_CC;' in extensions.
This commit is contained in:
James Chen 2012-09-23 20:53:22 -07:00
commit c6c98466cb
49 changed files with 181 additions and 122 deletions

View File

@ -35,6 +35,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcproj", "{D0F06A44-A245-4D13-A498-0120C203B539}"
ProjectSection(ProjectDependencies) = postProject
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
@ -53,6 +54,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "samples\TestLua\
EndProjectSection
EndProject
Global
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
@ -106,7 +110,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
EndGlobal

View File

@ -19,6 +19,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "samples\TestCpp\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "samples\TestJavascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}"
ProjectSection(ProjectDependencies) = postProject
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
EndProjectSection
EndProject

View File

@ -15,15 +15,15 @@ public:
virtual void completedAnimationSequenceNamed(const char *name) = 0;
};
class CCBAnimationManager : public cocos2d::CCObject
class CCBAnimationManager : public CCObject
{
private:
cocos2d::CCArray *mSequences;
cocos2d::CCDictionary *mNodeSequences;
cocos2d::CCDictionary *mBaseValues;
CCArray *mSequences;
CCDictionary *mNodeSequences;
CCDictionary *mBaseValues;
int mAutoPlaySequenceId;
cocos2d::CCNode *mRootNode;
CCNode *mRootNode;
CCSize mRootContainerSize;
CCBAnimationManagerDelegate *mDelegate;
@ -35,26 +35,26 @@ public:
virtual bool init();
cocos2d::CCArray* getSequences();
CCArray* getSequences();
int getAutoPlaySequenceId();
void setAutoPlaySequenceId(int autoPlaySequenceId);
cocos2d::CCNode* getRootNode();
void setRootNode(cocos2d::CCNode* pRootNode); // retain
CCNode* getRootNode();
void setRootNode(CCNode* pRootNode); // retain
const cocos2d::CCSize& getRootContainerSize();
void setRootContainerSize(const cocos2d::CCSize &rootContainerSize);
const CCSize& getRootContainerSize();
void setRootContainerSize(const CCSize &rootContainerSize);
CCBAnimationManagerDelegate* getDelegate();
void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain
const char* getRunningSequenceName();
const CCSize& getContainerSize(cocos2d::CCNode* pNode);
const CCSize& getContainerSize(CCNode* pNode);
void addNode(cocos2d::CCNode *pNode, cocos2d::CCDictionary *pSeq);
void setBaseValue(cocos2d::CCObject *pValue, cocos2d::CCNode *pNode, const char *pPropName);
void addNode(CCNode *pNode, CCDictionary *pSeq);
void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName);
void runAnimations(const char *pName, float fTweenDuration);
void runAnimations(const char *pName);
@ -63,33 +63,33 @@ public:
void debug();
private:
cocos2d::CCObject* getBaseValue(cocos2d::CCNode *pNode, const char* pPropName);
CCObject* getBaseValue(CCNode *pNode, const char* pPropName);
int getSequenceId(const char* pSequenceName);
CCBSequence* getSequence(int nSequenceId);
cocos2d::CCActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *pPropName, cocos2d::CCNode *pNode);
void setAnimatedProperty(const char *pPropName, cocos2d::CCNode *pNode, cocos2d::CCObject *pValue, float fTweenDuraion);
void setFirstFrame(cocos2d::CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
cocos2d::CCActionInterval* getEaseAction(cocos2d::CCActionInterval *pAction, int nEasingType, float fEasingOpt);
void runAction(cocos2d::CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
CCActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *pPropName, CCNode *pNode);
void setAnimatedProperty(const char *pPropName, CCNode *pNode, CCObject *pValue, float fTweenDuraion);
void setFirstFrame(CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
CCActionInterval* getEaseAction(CCActionInterval *pAction, int nEasingType, float fEasingOpt);
void runAction(CCNode *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
void sequenceCompleted();
};
class CCBSetSpriteFrame : public cocos2d::CCActionInstant
class CCBSetSpriteFrame : public CCActionInstant
{
private:
cocos2d::CCSpriteFrame *mSpriteFrame;
CCSpriteFrame *mSpriteFrame;
public:
~CCBSetSpriteFrame();
/** creates a Place action with a position */
static CCBSetSpriteFrame* create(cocos2d::CCSpriteFrame *pSpriteFrame);
bool initWithSpriteFrame(cocos2d::CCSpriteFrame *pSpriteFrame);
static CCBSetSpriteFrame* create(CCSpriteFrame *pSpriteFrame);
bool initWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
virtual void update(float time);
virtual cocos2d::CCObject* copyWithZone(cocos2d::CCZone *pZone);
virtual CCObject* copyWithZone(CCZone *pZone);
};
class CCBRotateTo : public cocos2d::CCActionInterval
class CCBRotateTo : public CCActionInterval
{
private:
float mStartAngle;
@ -100,8 +100,8 @@ public:
static CCBRotateTo* create(float fDuration, float fAngle);
bool initWithDuration(float fDuration, float fAngle);
virtual void update(float time);
virtual cocos2d::CCObject* copyWithZone(cocos2d::CCZone *pZone);
virtual void startWithTarget(cocos2d::CCNode *pNode);
virtual CCObject* copyWithZone(CCZone *pZone);
virtual void startWithTarget(CCNode *pNode);
};
NS_CC_EXT_END

View File

@ -1,6 +1,6 @@
#include "CCBFileLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN

View File

@ -6,10 +6,10 @@
NS_CC_EXT_BEGIN
class CCBKeyframe : public cocos2d::CCObject
class CCBKeyframe : public CCObject
{
private:
cocos2d::CCObject *mValue;
CCObject *mValue;
float mTime;
int mEasingType;
float mEasingOpt;
@ -18,8 +18,8 @@ public:
CCBKeyframe();
~CCBKeyframe();
cocos2d::CCObject* getValue();
void setValue(cocos2d::CCObject *pValue); // retain
CCObject* getValue();
void setValue(CCObject *pValue); // retain
float getTime();
void setTime(float fTime);

View File

@ -21,7 +21,7 @@ class CCBMemberVariableAssigner {
public:
virtual ~CCBMemberVariableAssigner() {};
virtual bool onAssignCCBMemberVariable(CCObject * pTarget, cocos2d::CCString * pMemberVariableName, CCNode * pNode) = 0;
virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode) = 0;
};
NS_CC_EXT_END

View File

@ -20,7 +20,7 @@
#endif
using namespace std;
USING_NS_CC;
NS_CC_EXT_BEGIN;
/*************************************************************************

View File

@ -128,7 +128,7 @@ enum
kCCBScaleTypeMultiplyResolution
};
USING_NS_CC;
NS_CC_EXT_BEGIN
/**

View File

@ -5,7 +5,7 @@
#include "ExtensionMacros.h"
#include "../GUI/CCControlExtension/CCInvocation.h"
USING_NS_CC;
NS_CC_EXT_BEGIN
#define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && pSelectorName->compare(SELECTORNAME) == 0) { \
@ -19,9 +19,9 @@ NS_CC_EXT_BEGIN
class CCBSelectorResolver {
public:
virtual ~CCBSelectorResolver() {};
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
virtual extension::SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) = 0;
};

View File

@ -7,7 +7,7 @@
NS_CC_EXT_BEGIN
class CCBSequence : public cocos2d::CCObject
class CCBSequence : public CCObject
{
private:
float mDuration;

View File

@ -7,7 +7,7 @@
NS_CC_EXT_BEGIN
class CCBSequenceProperty : public cocos2d::CCObject
class CCBSequenceProperty : public CCObject
{
private:
std::string mName;

View File

@ -6,7 +6,7 @@ NS_CC_EXT_BEGIN
// Implementation of ccColor3BWapper
ccColor3BWapper* ccColor3BWapper::create(const cocos2d::ccColor3B& color)
ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color)
{
ccColor3BWapper *ret = new ccColor3BWapper();
if (ret)

View File

@ -10,15 +10,15 @@
NS_CC_EXT_BEGIN
class ccColor3BWapper : public cocos2d::CCObject
class ccColor3BWapper : public CCObject
{
private:
cocos2d::ccColor3B color;
ccColor3B color;
public:
static ccColor3BWapper* create(const cocos2d::ccColor3B& color);
static ccColor3BWapper* create(const ccColor3B& color);
const cocos2d::ccColor3B& getColor();
const ccColor3B& getColor();
};
enum
@ -30,7 +30,7 @@ enum
kUnsignedCharValue,
};
class CCBValue : public cocos2d::CCObject
class CCBValue : public CCObject
{
private:
union

View File

@ -1,6 +1,6 @@
#include "CCControlButtonLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN;
#define PROPERTY_ZOOMONTOUCHDOWN "zoomOnTouchDown"

View File

@ -1,6 +1,6 @@
#include "CCControlLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN
#define PROPERTY_ENABLED "enabled"

View File

@ -7,7 +7,7 @@
NS_CC_EXT_BEGIN
class CCData : public cocos2d::CCObject
class CCData : public CCObject
{
public:
CCData(unsigned char *pBytes, const unsigned long nSize);

View File

@ -1,6 +1,6 @@
#include "CCLabelBMFontLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN

View File

@ -1,6 +1,6 @@
#include "CCLabelTTFLoader.h"
USING_NS_CC;
#define PROPERTY_COLOR "color"
#define PROPERTY_OPACITY "opacity"

View File

@ -1,6 +1,6 @@
#include "CCLayerColorLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN

View File

@ -1,6 +1,6 @@
#include "CCLayerGradientLoader.h"
USING_NS_CC;
#define PROPERTY_STARTCOLOR "startColor"
#define PROPERTY_ENDCOLOR "endColor"

View File

@ -1,6 +1,6 @@
#include "CCLayerLoader.h"
USING_NS_CC;
#define PROPERTY_TOUCH_ENABLED "isTouchEnabled"

View File

@ -1,6 +1,6 @@
#include "CCMenuItemImageLoader.h"
USING_NS_CC;
#define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame"
#define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame"

View File

@ -1,6 +1,6 @@
#include "CCMenuItemLoader.h"
USING_NS_CC;
#define PROPERTY_BLOCK "block"
#define PROPERTY_ISENABLED "isEnabled"

View File

@ -6,9 +6,9 @@
NS_CC_EXT_BEGIN
extern cocos2d::CCPoint getAbsolutePosition(const cocos2d::CCPoint &pt, int nType, const cocos2d::CCSize &containerSize, const char *pPropName);
extern CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName);
extern void setRelativeScale(cocos2d::CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName);
extern void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName);
NS_CC_EXT_END

View File

@ -7,8 +7,6 @@
using namespace std;
USING_NS_CC;
NS_CC_EXT_BEGIN
CCNode * CCNodeLoader::loadCCNode(CCNode * pParent, CCBReader * pCCBReader) {

View File

@ -19,11 +19,11 @@ NS_CC_EXT_BEGIN
#define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) CCLog("Unexpected property: '%s'!\n", PROPERTY->getCString()); assert(false)
#define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) CCLog("Unexpected property type: '%d'!\n", PROPERTYTYPE); assert(false)
#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(cocos2d::CCNode * pParent, cocos2d::extension::CCBReader * pCCBReader) { \
#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(CCNode * pParent, extension::CCBReader * pCCBReader) { \
return T::create(); \
}
#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(cocos2d::CCNode * pParent, cocos2d::extension::CCBReader * pCCBReader) = 0
#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createCCNode(CCNode * pParent, extension::CCBReader * pCCBReader) = 0
struct BlockData {
SEL_MenuHandler mSELMenuHandler;

View File

@ -15,7 +15,7 @@
#include "CCParticleSystemQuadLoader.h"
#include "CCScrollViewLoader.h"
USING_NS_CC;
NS_CC_EXT_BEGIN

View File

@ -6,6 +6,8 @@
NS_CC_EXT_BEGIN
class CCNodeLoader;
typedef std::map<CCString *, CCNodeLoader *, CCStringCompare> CCNodeLoaderMap;
typedef std::pair<CCString *, CCNodeLoader *> CCNodeLoaderMapEntry;

View File

@ -1,6 +1,6 @@
#include "CCParticleSystemQuadLoader.h"
USING_NS_CC;
#define PROPERTY_EMITERMODE "emitterMode"
#define PROPERTY_POSVAR "posVar"

View File

@ -1,6 +1,6 @@
#include "CCScale9SpriteLoader.h"
USING_NS_CC;
#define PROPERTY_CONTENTSIZE "contentSize"
#define PROPERTY_SPRITEFRAME "spriteFrame"

View File

@ -1,6 +1,6 @@
#include "CCScrollViewLoader.h"
USING_NS_CC;
#define PROPERTY_CONTAINER "container"
#define PROPERTY_DIRECTION "direction"

View File

@ -1,7 +1,5 @@
#include "CCSpriteLoader.h"
USING_NS_CC;
#define PROPERTY_FLIP "flip"
#define PROPERTY_DISPLAYFRAME "displayFrame"
#define PROPERTY_COLOR "color"

View File

@ -19,20 +19,20 @@ NS_CC_EXT_BEGIN
typedef unsigned int CCControlEvent;
typedef void (cocos2d::CCObject::*SEL_CCControlHandler)(cocos2d::CCObject*, CCControlEvent);
typedef void (CCObject::*SEL_CCControlHandler)(CCObject*, CCControlEvent);
#define cccontrol_selector(_SELECTOR) (SEL_CCControlHandler)(&_SELECTOR)
class CCInvocation : public cocos2d::CCObject
class CCInvocation : public CCObject
{
CC_SYNTHESIZE_READONLY(SEL_CCControlHandler, m_action, Action);
CC_SYNTHESIZE_READONLY(CCObject*, m_target, Target);
CC_SYNTHESIZE_READONLY(CCControlEvent, m_controlEvent, ControlEvent);
public:
CCInvocation(cocos2d::CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent);
CCInvocation(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent);
void invoke(cocos2d::CCObject* sender);
void invoke(CCObject* sender);
};
// end of GUI group

View File

@ -43,7 +43,7 @@ NS_CC_EXT_BEGIN
/** @brief Singleton that handles asynchrounous http requests
* Once the request completed, a callback will issued in main thread when it provided during make request
*/
class CCHttpClient : public cocos2d::CCObject
class CCHttpClient : public CCObject
{
public:
/** Return the shared instance **/

View File

@ -35,7 +35,7 @@ NS_CC_EXT_BEGIN
Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample
@since v2.0.2
*/
class CCHttpRequest : public cocos2d::CCObject
class CCHttpRequest : public CCObject
{
public:
/** Use this enum type as param in setReqeustType(param) */
@ -155,7 +155,7 @@ public:
/** Required field. You should set the callback selector function at ack the http request completed
*/
inline void setResponseCallback(cocos2d::CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector)
inline void setResponseCallback(CCObject* pTarget, SEL_CallFuncND pSelector)
{
_pTarget = pTarget;
_pSelector = pSelector;
@ -171,7 +171,7 @@ public:
return _pTarget;
}
/** Get the selector function pointer, mainly used by CCHttpClient */
inline cocos2d::SEL_CallFuncND getSelector()
inline SEL_CallFuncND getSelector()
{
return _pSelector;
}
@ -182,8 +182,8 @@ protected:
std::string _url; /// target url that this request is sent to
std::vector<char> _requestData; /// used for POST
std::string _tag; /// user defined tag, to identify different requests in response callback
cocos2d::CCObject* _pTarget; /// callback target of pSelector function
cocos2d::SEL_CallFuncND _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(CCObject *sender, void *data)
CCObject* _pTarget; /// callback target of pSelector function
SEL_CallFuncND _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(CCObject *sender, void *data)
void* _pUserData; /// You can add your customed data here
};

View File

@ -36,7 +36,7 @@ NS_CC_EXT_BEGIN
Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample
@since v2.0.2
*/
class CCHttpResponse : public cocos2d::CCObject
class CCHttpResponse : public CCObject
{
public:
/** Constructor, it's used by CCHttpClient internal, users don't need to create HttpResponse manually

View File

@ -3,7 +3,7 @@
#include "cocos2d.h"
#include "SimpleAudioEngine.h"
#include "ScriptingCore.h"
#include "cocos2dx.hpp"
#include "generated/cocos2dx.hpp"
#include "cocos2d_specifics.hpp"
#include "js_bindings_chipmunk_manual.hpp"

View File

@ -429,7 +429,7 @@ function performanceActions20(sprite) {
var growDuration = 0.5 + (Math.random() * 1000) / 500.0;
var grow = cc.ScaleBy.create(growDuration, 0.5, 0.5);
var permanentScaleLoop = cc.RepeatForever.create(cc.Sequence._actionOneTwo(grow, grow.reverse()));
var permanentScaleLoop = cc.RepeatForever.create(cc.Sequence.create(grow, grow.reverse()));
sprite.runAction(permanentScaleLoop);
}

View File

@ -12,6 +12,8 @@ director = cc.Director.getInstance();
winSize = director.getWinSize();
centerPos = cc.p( winSize.width/2, winSize.height/2 );
var TAG_ACTION1_EASE_ACTIONS = 1001;
var scenes = []
var currentScene = 0;

View File

@ -49,7 +49,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;..\Classes;&quot;$(SolutionDir)scripting\javascript\spidermonkey-win32\include&quot;;&quot;$(SolutionDir)scripting\javascript\bindings&quot;;&quot;$(SolutionDir)external\chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;"
AdditionalIncludeDirectories=".;..\Classes;&quot;$(SolutionDir)scripting\javascript\spidermonkey-win32\include&quot;;&quot;$(SolutionDir)scripting\javascript\bindings&quot;;&quot;$(SolutionDir)external\chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)extensions&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;TRACING;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -74,7 +74,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libCocosDenshion.lib libchipmunk.lib mozjs.lib"
AdditionalDependencies="libcocos2d.lib libCocosDenshion.lib libchipmunk.lib mozjs.lib opengl32.lib glew32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
GenerateDebugInformation="true"
@ -136,7 +136,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;..\Classes;&quot;$(SolutionDir)scripting\javascript\spidermonkey-win32\include&quot;;&quot;$(SolutionDir)scripting\javascript\bindings&quot;;&quot;$(SolutionDir)external\chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;"
AdditionalIncludeDirectories=".;..\Classes;&quot;$(SolutionDir)scripting\javascript\spidermonkey-win32\include&quot;;&quot;$(SolutionDir)scripting\javascript\bindings&quot;;&quot;$(SolutionDir)external\chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)extensions&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;NDEBUG;COCOS2D_JAVASCRIPT;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS"
ExceptionHandling="0"
RuntimeLibrary="2"
@ -160,7 +160,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libCocosDenshion.lib libchipmunk.lib mozjs.lib"
AdditionalDependencies="libcocos2d.lib libCocosDenshion.lib libchipmunk.lib mozjs.lib opengl32.lib glew32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="$(OutDir)"
SubSystem="2"
@ -212,11 +212,19 @@
>
</File>
<File
RelativePath="..\..\..\scripting\javascript\bindings\cocos2dx.cpp"
RelativePath="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.cpp"
>
</File>
<File
RelativePath="..\..\..\scripting\javascript\bindings\cocos2dx.hpp"
RelativePath="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.h"
>
</File>
<File
RelativePath="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.cpp"
>
</File>
<File
RelativePath="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.h"
>
</File>
<File
@ -259,6 +267,18 @@
RelativePath="..\..\..\scripting\javascript\bindings\spidermonkey_specifics.h"
>
</File>
<Filter
Name="generated"
>
<File
RelativePath="..\..\..\scripting\javascript\bindings\generated\cocos2dx.cpp"
>
</File>
<File
RelativePath="..\..\..\scripting\javascript\bindings\generated\cocos2dx.hpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="resource"

View File

@ -63,7 +63,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -85,7 +85,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O
</Command>
</PreLinkEvent>
<Link>
<AdditionalDependencies>libcocos2d.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -106,7 +106,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O
<ProxyFileName>testjs_p.c</ProxyFileName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>.;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
@ -129,7 +129,7 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O
</Command>
</PreLinkEvent>
<Link>
<AdditionalDependencies>libcocos2d.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
@ -137,8 +137,10 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2dx.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.cpp" />
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_manual_conversions.cpp" />
@ -148,8 +150,10 @@ xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(O
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.h" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2dx.hpp" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.hpp" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.h" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.hpp" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.h" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.hpp" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.hpp" />
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_config.h" />

View File

@ -14,6 +14,9 @@
<Filter Include="Classes">
<UniqueIdentifier>{e93a77e1-af1e-4400-87d3-504b62ebdbb0}</UniqueIdentifier>
</Filter>
<Filter Include="bindings\generated">
<UniqueIdentifier>{146f26cf-13e1-4106-891b-4b0118ceac2b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
@ -22,15 +25,6 @@
<ClCompile Include="..\Classes\AppDelegate.cpp">
<Filter>Classes</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2dx.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.cpp">
<Filter>bindings</Filter>
</ClCompile>
@ -43,6 +37,21 @@
<ClCompile Include="..\..\..\scripting\javascript\bindings\ScriptingCore.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.cpp">
<Filter>bindings</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.cpp">
<Filter>bindings\generated</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="main.h">
@ -54,13 +63,7 @@
<ClInclude Include="..\Classes\AppDelegate.h">
<Filter>Classes</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.h">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.hpp">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2dx.hpp">
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.h">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.hpp">
@ -81,6 +84,18 @@
<ClInclude Include="..\..\..\scripting\javascript\bindings\spidermonkey_specifics.h">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\CCPhysicsSprite.h">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.hpp">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.h">
<Filter>bindings</Filter>
</ClInclude>
<ClInclude Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.hpp">
<Filter>bindings\generated</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\testjs.ico">

View File

@ -1,3 +1,6 @@
#ifndef __CCPHYSICSSPRITE_H__
#define __CCPHYSICSSPRITE_H__
#include "sprite_nodes/CCSprite.h"
#include "chipmunk.h"
@ -24,3 +27,4 @@ public:
virtual void setRotation(float rotation);
};
#endif /* __CCPHYSICSSPRITE_H__ */

View File

@ -421,7 +421,7 @@ JSBool ScriptingCore::forceGC(JSContext *cx, uint32_t argc, jsval *vp)
static void dumpNamedRoot(const char *name, void *addr, JSGCRootType type, void *data)
{
printf("Root: '%s' at %p\n", name, addr);
CCLOG("Root: '%s' at %p", name, addr);
}
JSBool ScriptingCore::dumpRoot(JSContext *cx, uint32_t argc, jsval *vp)

View File

@ -1,3 +1,6 @@
#ifndef __COCOSJS_MANUAL_CONVERSIONS_H__
#define __COCOSJS_MANUAL_CONVERSIONS_H__
#include "chipmunk.h"
#include "cocos2d.h"
#include "js_manual_conversions.h"
@ -17,3 +20,6 @@ jsval cpBB_to_jsval(JSContext *cx, cpBB bb );
#define cpVect_to_jsval CGPoint_to_jsval
#define jsval_to_cpVect jsval_to_CGPoint
#endif /* __COCOSJS_MANUAL_CONVERSIONS_H__ */

View File

@ -8,7 +8,6 @@
#include "js_bindings_ccbreader.h"
#include "ScriptingCore.h"
#include "CCNodeLoaderLibrary.h"
USING_NS_CC;
USING_NS_CC_EXT;

View File

@ -5,14 +5,11 @@
// Created by Rohan Kuruvilla on 14/08/2012.
//
//
#include "jsapi.h"
#include "CCBReader.h"
#include "CCBSelectorResolver.h"
#include "CCBMemberVariableAssigner.h"
#include "CCInvocation.h"
#include "ExtensionMacros.h"
#include "CCLayerLoader.h"
#ifndef __JS_BINDINGS_CCBREADER_H__
#define __JS_BINDINGS_CCBREADER_H__
#include "jsapi.h"
#include "cocos-ext.h"
#include "cocos2d_specifics.hpp"
@ -60,3 +57,6 @@ protected:
void register_CCBuilderReader(JSContext *cx, JSObject *global);
JSBool js_CocosBuilder_Run(JSContext *cx, uint32_t argc, jsval *vp);
#endif /* __JS_BINDINGS_CCBREADER_H__ */

View File

@ -2,7 +2,8 @@
// Created by Rohan Kuruvilla
// Copyright (c) 2012 Zynga Inc. All rights reserved.
//
#ifndef __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__
#define __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__
JSBool JSPROXY_cpArbiterGetCount(JSContext *cx, uint32_t argc, jsval *vp);
JSBool JSPROXY_cpArbiterGetDepth(JSContext *cx, uint32_t argc, jsval *vp);
@ -280,3 +281,6 @@ JSBool JSPROXY_cpvslerpconst(JSContext *cx, uint32_t argc, jsval *vp);
JSBool JSPROXY_cpvsub(JSContext *cx, uint32_t argc, jsval *vp);
JSBool JSPROXY_cpvtoangle(JSContext *cx, uint32_t argc, jsval *vp);
JSBool JSPROXY_cpvunrotate(JSContext *cx, uint32_t argc, jsval *vp);
#endif /* __JS_BINDINGS_CHIPMUNK_FUNCTIONS_HPP__ */

View File

@ -2,6 +2,8 @@
// Created by Rohan Kuruvilla
// Copyright (c) 2012 Zynga Inc. All rights reserved.
//
#ifndef __JS_MANUAL_CONVERSIONS_H__
#define __JS_MANUAL_CONVERSIONS_H__
#include "jsapi.h"
@ -21,3 +23,6 @@ jsval opaque_to_jsval( JSContext *cx, void* opaque);
#ifdef __cplusplus
}
#endif
#endif /* __JS_MANUAL_CONVERSIONS_H__ */