Skip to content

Commit e6169c2

Browse files
author
minggo
committed
issue cocos2d#387: move platform_support into cocos2dx/platform
1 parent 26da37f commit e6169c2

25 files changed

+121
-92
lines changed

HelloWorld/android/jni/helloworld/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ LOCAL_SRC_FILES := main.cpp \
77
../../../HelloWorldScene.cpp
88

99
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
10+
$(LOCAL_PATH)/../../../../cocos2dx/platform \
1011
$(LOCAL_PATH)/../../../../cocos2dx/include \
11-
$(LOCAL_PATH)/../../.. \
12-
$(LOCAL_PATH)/../../../../platform_support/include
12+
$(LOCAL_PATH)/../../..
1313

1414
LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog
1515

HelloWorld/uphone/HelloWorld.uphone.vcproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Version="9.00"
55
Name="HelloWorld"
66
ProjectGUID="{74589012-5241-4918-997A-C0105ABD4DEC}"
7+
RootNamespace="HelloWorld"
78
TargetFrameworkVersion="131072"
89
>
910
<Platforms>
@@ -40,7 +41,7 @@
4041
<Tool
4142
Name="VCCLCompilerTool"
4243
Optimization="0"
43-
AdditionalIncludeDirectories="..\..\..\PRJ_TG3\Include;..\..\..\PRJ_TG3\Include\MTAPI;..\..\..\PRJ_TG3\Include\ThirdParty;..\..\..\PRJ_TG3\Include\TCOM;..\..\..\PRJ_TG3\TG3\Include;..\..\..\PRJ_TG3\TG3\TG3_Implement;..\..\..\PRJ_TG3\EOS_SYS;..\..\..\PRJ_TG3\Common\SoftSupport;..\..\..\PRJ_TG3\Common\ICU\Include;..\..\cocos2dx\include;..\..\cocos2dx;..\..\..\PRJ_TG3\Include\OpenGL;..\uphone;..\;.\Res;..\..\platform_support\include"
44+
AdditionalIncludeDirectories="..\..\..\PRJ_TG3\Include;..\..\..\PRJ_TG3\Include\MTAPI;..\..\..\PRJ_TG3\Include\ThirdParty;..\..\..\PRJ_TG3\Include\TCOM;..\..\..\PRJ_TG3\TG3\Include;..\..\..\PRJ_TG3\TG3\TG3_Implement;..\..\..\PRJ_TG3\EOS_SYS;..\..\..\PRJ_TG3\Common\SoftSupport;..\..\..\PRJ_TG3\Common\ICU\Include;..\..\cocos2dx\include;..\..\cocos2dx;..\..\..\PRJ_TG3\Include\OpenGL;..\uphone;..\;.\Res;..\..\cocos2dx\platform"
4445
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL"
4546
MinimalRebuild="true"
4647
BasicRuntimeChecks="3"
@@ -63,7 +64,7 @@
6364
/>
6465
<Tool
6566
Name="VCLinkerTool"
66-
AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib libcocos2d.lib libPlatformSupport.lib"
67+
AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib libcocos2d.lib"
6768
OutputFile="$(OutDir)/HelloWorld.dll"
6869
LinkIncremental="2"
6970
AdditionalLibraryDirectories="../../../PRJ_TG3/Common/ICU/lib;../../../PRJ_TG3/Mtapi/Win32/lib;../../../PRJ_TG3/LIB/Win32Lib;../../../PRJ_TG3/Common/SoftSupport"

cocos2d-uphone.sln

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ EndProject
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "chipmunk\proj.uphone\chipmunk.uphone.vcproj", "{BA00DDF7-0F25-4C1E-B012-FA230C1F6463}"
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cocos2d-uphone", "cocos2dx\proj.uphone\cocos2d-uphone.vcproj", "{6AC43F51-A036-4653-B910-BDDC346D15E7}"
9-
ProjectSection(ProjectDependencies) = postProject
10-
{560E20BA-9562-4AFC-A222-6B7B1956D607} = {560E20BA-9562-4AFC-A222-6B7B1956D607}
11-
EndProjectSection
129
EndProject
1310
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CocosDenshion", "CocosDenshion\proj.uphone\CocosDenshion.uphone.vcproj", "{AB17438B-7848-4FD6-AF6E-A6A91F82C6F0}"
1411
EndProject
@@ -25,8 +22,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\test.uphone\
2522
{BA00DDF7-0F25-4C1E-B012-FA230C1F6463} = {BA00DDF7-0F25-4C1E-B012-FA230C1F6463}
2623
EndProjectSection
2724
EndProject
28-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlatformSupport", "platform_support\proj.uphone\PlatformSupport.uphone.vcproj", "{560E20BA-9562-4AFC-A222-6B7B1956D607}"
29-
EndProject
3025
Global
3126
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3227
Debug|Win32 = Debug|Win32
@@ -57,10 +52,6 @@ Global
5752
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Debug|Win32.Build.0 = Debug|Win32
5853
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Release|Win32.ActiveCfg = Release|Win32
5954
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Release|Win32.Build.0 = Release|Win32
60-
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Debug|Win32.ActiveCfg = Debug|Win32
61-
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Debug|Win32.Build.0 = Debug|Win32
62-
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Release|Win32.ActiveCfg = Release|Win32
63-
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Release|Win32.Build.0 = Release|Win32
6455
EndGlobalSection
6556
GlobalSection(SolutionProperties) = preSolution
6657
HideSolutionNode = FALSE

cocos2dx/Android.mk

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ platform/CCGrid_mobile.cpp \
5454
platform/CCLayer_mobile.cpp \
5555
platform/CCMenu_mobile.cpp \
5656
platform/CCNode_mobile.cpp \
57+
platform/CCGL.cpp \
58+
platform/CCImage.cpp \
59+
platform/CCStdC.cpp \
60+
platform/CCThread.cpp \
61+
platform/CCCommon.cpp \
5762
platform/CCParticleSystemPoint_mobile.cpp \
5863
platform/CCTransition_mobile.cpp \
5964
platform/platform.cpp \
@@ -92,35 +97,28 @@ tileMap_parallax_nodes/CCTileMapAtlas.cpp \
9297
touch_dispatcher/CCTouchDispatcher.cpp \
9398
touch_dispatcher/CCTouchHandler.cpp
9499

95-
# platform_support
96-
LOCAL_SRC_FILES += ../platform_support/src/ccxGL.cpp \
97-
../platform_support/src/CCImage.cpp \
98-
../platform_support/src/CCStdC.cpp \
99-
../platform_support/src/CCThread.cpp \
100-
../platform_support/src/CCCommon.cpp
101-
102100
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
103101
$(LOCAL_PATH)/include \
104-
$(LOCAL_PATH)/../platform_support/include \
105-
$(LOCAL_PATH)/../platform_support/third_party/android/iconv \
106-
$(LOCAL_PATH)/../platform_support/third_party/android/libpng \
107-
$(LOCAL_PATH)/../platform_support/third_party/android/libxml2 \
108-
$(LOCAL_PATH)/../platform_support/third_party/android/libjpeg \
109-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/core \
110-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/animator \
111-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/config \
112-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/effects \
113-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/images \
114-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/pdf \
115-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/ports \
116-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/svg \
117-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/text \
118-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/utils \
119-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/views \
120-
$(LOCAL_PATH)/../platform_support/third_party/android/skia/xml
102+
$(LOCAL_PATH)/platform \
103+
$(LOCAL_PATH)/platform/third_party/android/iconv \
104+
$(LOCAL_PATH)/platform/third_party/android/libpng \
105+
$(LOCAL_PATH)/platform/third_party/android/libxml2 \
106+
$(LOCAL_PATH)/platform/third_party/android/libjpeg \
107+
$(LOCAL_PATH)/platform/third_party/android/skia/core \
108+
$(LOCAL_PATH)/platform/third_party/android/skia/animator \
109+
$(LOCAL_PATH)/platform/third_party/android/skia/config \
110+
$(LOCAL_PATH)/platform/third_party/android/skia/effects \
111+
$(LOCAL_PATH)/platform/third_party/android/skia/images \
112+
$(LOCAL_PATH)/platform/third_party/android/skia/pdf \
113+
$(LOCAL_PATH)/platform/third_party/android/skia/ports \
114+
$(LOCAL_PATH)/platform/third_party/android/skia/svg \
115+
$(LOCAL_PATH)/platform/third_party/android/skia/text \
116+
$(LOCAL_PATH)/platform/third_party/android/skia/utils \
117+
$(LOCAL_PATH)/platform/third_party/android/skia/views \
118+
$(LOCAL_PATH)/platform/third_party/android/skia/xml
121119

122120
#it is used for ndk-r4
123-
LOCAL_LDLIBS := -L$(LOCAL_PATH)/../platform_support/third_party/android/libraries \
121+
LOCAL_LDLIBS := -L$(LOCAL_PATH)/platform/third_party/android/libraries \
124122
-lGLESv1_CM -llog -lz \
125123
-lpng \
126124
-lxml2 \
@@ -130,7 +128,7 @@ LOCAL_LDLIBS := -L$(LOCAL_PATH)/../platform_support/third_party/android/librarie
130128
# it is used for ndk-r5
131129
# because the new Windows toolchain doesn't support Cygwin's drive
132130
# mapping (i.e /cygdrive/c/ instead of C:/)
133-
#LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../platform_support/third_party/android/libraries) \
131+
#LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/libraries) \
134132
# -lGLESv1_CM -llog -lz \
135133
# -lpng \
136134
# -lxml2 \

cocos2dx/include/CCTextureCache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ THE SOFTWARE.
3232
namespace cocos2d {
3333
class CCTexture2D;
3434
class CCAsyncObject;
35-
class NSLock;
35+
class CCLock;
3636
class CCImage;
3737

3838
typedef void (*fpAsyncCallback)(CCTexture2D*, void*);
@@ -45,8 +45,8 @@ class CC_DLL CCTextureCache : public CCObject
4545
{
4646
protected:
4747
CCMutableDictionary<std::string, CCTexture2D*> * m_pTextures;
48-
NSLock *m_pDictLock;
49-
NSLock *m_pContextLock;
48+
CCLock *m_pDictLock;
49+
CCLock *m_pContextLock;
5050

5151
private:
5252
// @todo void addImageWithAsyncObject(CCAsyncObject* async);

cocos2dx/platform/CCCommon.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static const int kMaxLogLen = 255;
4545
/**
4646
@brief Output Debug message.
4747
*/
48-
void CC_DLL_PS CCLog(const char * pszFormat, ...);
48+
void CC_DLL CCLog(const char * pszFormat, ...);
4949

5050
struct ccxNullDeleter { template< class TPTR > void operator()(TPTR ) {} };
5151
struct ccxNewDeleter { template< class TPTR > void operator()(TPTR p) { delete p; } };
@@ -83,7 +83,7 @@ class ccxScopedPtr // noncopyable
8383
@brief A simple scoped point for array.
8484
*/
8585
template< class T, class D = ccxNewArrayDeleter >
86-
class CC_DLL_PS ccxScopedArray // noncopyable
86+
class CC_DLL ccxScopedArray // noncopyable
8787
: private D
8888
{
8989
public:

cocos2dx/platform/CCGL.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ OpenGL GLU implementation
105105
*/
106106

107107
/** OpenGL gluLookAt implementation */
108-
void CC_DLL_PS gluLookAt(GLfloat fEyeX, GLfloat fEyeY, GLfloat fEyeZ,
108+
void CC_DLL gluLookAt(GLfloat fEyeX, GLfloat fEyeY, GLfloat fEyeZ,
109109
GLfloat fLookAtX, GLfloat fLookAtY, GLfloat fLookAtZ,
110110
GLfloat fUpX, GLfloat fUpY, GLfloat fUpZ);
111111

112112
/** OpenGL gluPerspective implementation */
113-
void CC_DLL_PS gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
113+
void CC_DLL gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
114114

115115
NS_CC_END;
116116

cocos2dx/platform/CCImage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ THE SOFTWARE.
2929

3030
NS_CC_BEGIN;
3131

32-
class CC_DLL_PS CCImage
32+
class CC_DLL CCImage
3333
{
3434
public:
3535
CCImage();

cocos2dx/platform/CCPlatformConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ There are config below:
3737
// pre configure
3838
//////////////////////////////////////////////////////////////////////////
3939

40-
// define supported target platform macro which ccx uses.
40+
// define supported target platform macro which CC uses.
4141
#define CC_PLATFORM_UNKNOWN 0
4242
#define CC_PLATFORM_IOS 1
4343
#define CC_PLATFORM_MAC 2

cocos2dx/platform/CCPlatformMacros.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,4 @@ public: inline void set##funName(varType var){ varName = var; }
170170

171171
#endif // uphone VM
172172

173-
// shared library declator for platform_support project
174-
#define CC_DLL_PS CC_DLL
175-
176173
#endif // __CC_PLATFORM_MACROS_H__

cocos2dx/platform/CCStdC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626

2727
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
2828

29-
int CC_DLL_PS gettimeofday(struct timeval * val, struct timezone *)
29+
int CC_DLL gettimeofday(struct timeval * val, struct timezone *)
3030
{
3131
if (val)
3232
{

cocos2dx/platform/CCStdC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct timezone
7777
int tz_dsttime;
7878
};
7979

80-
int CC_DLL_PS gettimeofday(struct timeval *, struct timezone *);
80+
int CC_DLL gettimeofday(struct timeval *, struct timezone *);
8181

8282
#endif // CC_PLATFORM_WIN32
8383

cocos2dx/platform/CCThread.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
THE SOFTWARE.
2323
****************************************************************************/
2424

25-
#ifndef __CC_THREAD_H_YANGWS_20110114__
26-
#define __CC_THREAD_H_YANGWS_20110114__
25+
#ifndef __CC_PLATFORM_THREAD_H__
26+
#define __CC_PLATFORM_THREAD_H__
2727

2828
#include "CCCommon.h"
2929

@@ -35,26 +35,26 @@ NS_CC_BEGIN;
3535
3636
@warning Don't enter a CCLock twice in the same thread.
3737
*/
38-
class CC_DLL_PS ccxLock
38+
class CC_DLL CCLock
3939
{
4040
public:
41-
ccxLock();
42-
~ccxLock();
41+
CCLock();
42+
~CCLock();
4343

4444
void lock();
4545
void unlock();
4646

4747
private:
4848
class Impl;
49-
ccxScopedPtr<ccxLock::Impl> m_pImp;
49+
ccxScopedPtr<CCLock::Impl> m_pImp;
5050
};
5151
#else // CC_SUPPORT_MULTITHREAD
5252

53-
class CC_DLL_PS ccxLock
53+
class CC_DLL CCLock
5454
{
5555
public:
56-
ccxLock() {}
57-
~ccxLock() {}
56+
CCLock() {}
57+
~CCLock() {}
5858

5959
void lock() {}
6060
void unlock() {}
@@ -64,4 +64,4 @@ class CC_DLL_PS ccxLock
6464

6565
NS_CC_END;
6666

67-
#endif // __CC_THREAD_H_YANGWS_20110114__
67+
#endif // __CC_PLATFORM_THREAD_H__

cocos2dx/platform/android/CCImage_android.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int sk_atomic_dec(int *value)
4343
NS_CC_BEGIN;
4444

4545
// android not support
46-
void CCMessageBox(const ccxString& msg, const ccxString& title)
46+
void CCMessageBox(const std::string& msg, const std::string& title)
4747
{
4848

4949
}

cocos2dx/platform/android/CCThread_android.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ THE SOFTWARE.
2525
#if CCX_SUPPORT_MULTITHREAD
2626

2727
#include <semaphore.h>
28-
#include "ccxThread.h"
28+
#include "CCThread.h"
2929

3030
NS_CC_BEGIN;
3131

32-
class CCXLock::Impl
32+
class CCLock::Impl
3333
{
3434
public:
3535
Impl()
@@ -45,28 +45,28 @@ class CCXLock::Impl
4545
sem_t m_sMutex;
4646
};
4747

48-
CCXLock::CCXLock()
49-
: m_pImp(new CCXLock::Impl)
48+
CCLock::CCLock()
49+
: m_pImp(new CCLock::Impl)
5050
{
5151
}
5252

53-
CCXLock::~CCXLock()
53+
CCLock::~CCLock()
5454
{
5555
if (m_pImp)
5656
{
5757
delete m_pImp;
5858
}
5959
}
6060

61-
void CCXLock::lock()
61+
void CCLock::lock()
6262
{
6363
if (m_pImp)
6464
{
6565
sem_wait(&m_pImp->m_sMutex);
6666
}
6767
}
6868

69-
void CCXLock::unlock()
69+
void CCLock::unlock()
7070
{
7171
if (m_pImp)
7272
{

cocos2dx/platform/platform.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class CCTime
4242
static void timersubCocos2d(struct cc_timeval *out, struct cc_timeval *start, struct cc_timeval *end);
4343
};
4444

45-
class NSLock : public ccxLock{};
46-
4745
NS_CC_END;
4846

4947
#endif // __PLATFORM_H__

cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void CCAccelerometer::addDelegate(CCAccelerometerDelegate* pDelegate)
175175
}
176176
}
177177

178-
void CCAccelerometer::didAccelerate(UIAcceleration* pAccelerationValue)
178+
void CCAccelerometer::didAccelerate(CCAcceleration* pAccelerationValue)
179179
{
180180
CCAccelerometerHandler *pHandler;
181181
CCAccelerometerDelegate *pDelegate;

cocos2dx/platform/uphone/CCAccelerometer_uphone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CC_DLL CCAccelerometer
8787
/**
8888
@brief call delegates' didAccelerate function
8989
*/
90-
void didAccelerate(UIAcceleration* pAccelerationValue);
90+
void didAccelerate(CCAcceleration* pAccelerationValue);
9191

9292
protected:
9393
typedef CCMutableArray<CCAccelerometerHandler*> AccDelegateArray;

cocos2dx/platform/uphone/CCEGLView_uphone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent)
309309
TG3_SENSOR_TYPE_ACCELEROMETER == data.sensorMask)
310310
{
311311
// convert the data to iphone format
312-
UIAcceleration AccValue;
312+
CCAcceleration AccValue;
313313
AccValue.x = -(data.acceleration.x / TG3_GRAVITY_EARTH);
314314
AccValue.y = -(data.acceleration.y / TG3_GRAVITY_EARTH);
315315
AccValue.z = -(data.acceleration.z / TG3_GRAVITY_EARTH);

cocos2dx/platform/uphone/CCImage_uphone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NS_CC_BEGIN
2929

3030
typedef std::basic_string<TUChar> stdTUString;
3131

32-
void CCMessageBox(const ccxString& msg, const ccxString& title)
32+
void CCMessageBox(const std::string& msg, const std::string& title)
3333
{
3434
TUChar szText[256] = { 0 };
3535
TUString::StrUtf8ToStrUnicode(szText,(Char*)msg.c_str());

0 commit comments

Comments
 (0)