Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
issue #387: move platform_support into cocos2dx/platform
  • Loading branch information
minggo committed Mar 9, 2011
commit d896b840e5f8bb28313f43551edb89cd368bbc29
4 changes: 2 additions & 2 deletions HelloWorld/android/jni/helloworld/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ LOCAL_SRC_FILES := main.cpp \
../../../HelloWorldScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
$(LOCAL_PATH)/../../../../cocos2dx/platform \
$(LOCAL_PATH)/../../../../cocos2dx/include \
$(LOCAL_PATH)/../../.. \
$(LOCAL_PATH)/../../../../platform_support/include
$(LOCAL_PATH)/../../..

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

Expand Down
5 changes: 3 additions & 2 deletions HelloWorld/uphone/HelloWorld.uphone.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Version="9.00"
Name="HelloWorld"
ProjectGUID="{74589012-5241-4918-997A-C0105ABD4DEC}"
RootNamespace="HelloWorld"
TargetFrameworkVersion="131072"
>
<Platforms>
Expand Down Expand Up @@ -40,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
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"
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"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand All @@ -63,7 +64,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib libcocos2d.lib libPlatformSupport.lib"
AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib libcocos2d.lib"
OutputFile="$(OutDir)/HelloWorld.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="../../../PRJ_TG3/Common/ICU/lib;../../../PRJ_TG3/Mtapi/Win32/lib;../../../PRJ_TG3/LIB/Win32Lib;../../../PRJ_TG3/Common/SoftSupport"
Expand Down
9 changes: 0 additions & 9 deletions cocos2d-uphone.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "chipmunk\proj.uphone\chipmunk.uphone.vcproj", "{BA00DDF7-0F25-4C1E-B012-FA230C1F6463}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cocos2d-uphone", "cocos2dx\proj.uphone\cocos2d-uphone.vcproj", "{6AC43F51-A036-4653-B910-BDDC346D15E7}"
ProjectSection(ProjectDependencies) = postProject
{560E20BA-9562-4AFC-A222-6B7B1956D607} = {560E20BA-9562-4AFC-A222-6B7B1956D607}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CocosDenshion", "CocosDenshion\proj.uphone\CocosDenshion.uphone.vcproj", "{AB17438B-7848-4FD6-AF6E-A6A91F82C6F0}"
EndProject
Expand All @@ -25,8 +22,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\test.uphone\
{BA00DDF7-0F25-4C1E-B012-FA230C1F6463} = {BA00DDF7-0F25-4C1E-B012-FA230C1F6463}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlatformSupport", "platform_support\proj.uphone\PlatformSupport.uphone.vcproj", "{560E20BA-9562-4AFC-A222-6B7B1956D607}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -57,10 +52,6 @@ Global
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Debug|Win32.Build.0 = Debug|Win32
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Release|Win32.ActiveCfg = Release|Win32
{33819ACD-9774-4E68-AFBE-7A88BBA7B19D}.Release|Win32.Build.0 = Release|Win32
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Debug|Win32.ActiveCfg = Debug|Win32
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Debug|Win32.Build.0 = Debug|Win32
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Release|Win32.ActiveCfg = Release|Win32
{560E20BA-9562-4AFC-A222-6B7B1956D607}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
50 changes: 24 additions & 26 deletions cocos2dx/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ platform/CCGrid_mobile.cpp \
platform/CCLayer_mobile.cpp \
platform/CCMenu_mobile.cpp \
platform/CCNode_mobile.cpp \
platform/CCGL.cpp \
platform/CCImage.cpp \
platform/CCStdC.cpp \
platform/CCThread.cpp \
platform/CCCommon.cpp \
platform/CCParticleSystemPoint_mobile.cpp \
platform/CCTransition_mobile.cpp \
platform/platform.cpp \
Expand Down Expand Up @@ -92,35 +97,28 @@ tileMap_parallax_nodes/CCTileMapAtlas.cpp \
touch_dispatcher/CCTouchDispatcher.cpp \
touch_dispatcher/CCTouchHandler.cpp

# platform_support
LOCAL_SRC_FILES += ../platform_support/src/ccxGL.cpp \
../platform_support/src/CCImage.cpp \
../platform_support/src/CCStdC.cpp \
../platform_support/src/CCThread.cpp \
../platform_support/src/CCCommon.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../platform_support/include \
$(LOCAL_PATH)/../platform_support/third_party/android/iconv \
$(LOCAL_PATH)/../platform_support/third_party/android/libpng \
$(LOCAL_PATH)/../platform_support/third_party/android/libxml2 \
$(LOCAL_PATH)/../platform_support/third_party/android/libjpeg \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/core \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/animator \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/config \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/effects \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/images \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/pdf \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/ports \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/svg \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/text \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/utils \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/views \
$(LOCAL_PATH)/../platform_support/third_party/android/skia/xml
$(LOCAL_PATH)/platform \
$(LOCAL_PATH)/platform/third_party/android/iconv \
$(LOCAL_PATH)/platform/third_party/android/libpng \
$(LOCAL_PATH)/platform/third_party/android/libxml2 \
$(LOCAL_PATH)/platform/third_party/android/libjpeg \
$(LOCAL_PATH)/platform/third_party/android/skia/core \
$(LOCAL_PATH)/platform/third_party/android/skia/animator \
$(LOCAL_PATH)/platform/third_party/android/skia/config \
$(LOCAL_PATH)/platform/third_party/android/skia/effects \
$(LOCAL_PATH)/platform/third_party/android/skia/images \
$(LOCAL_PATH)/platform/third_party/android/skia/pdf \
$(LOCAL_PATH)/platform/third_party/android/skia/ports \
$(LOCAL_PATH)/platform/third_party/android/skia/svg \
$(LOCAL_PATH)/platform/third_party/android/skia/text \
$(LOCAL_PATH)/platform/third_party/android/skia/utils \
$(LOCAL_PATH)/platform/third_party/android/skia/views \
$(LOCAL_PATH)/platform/third_party/android/skia/xml

#it is used for ndk-r4
LOCAL_LDLIBS := -L$(LOCAL_PATH)/../platform_support/third_party/android/libraries \
LOCAL_LDLIBS := -L$(LOCAL_PATH)/platform/third_party/android/libraries \
-lGLESv1_CM -llog -lz \
-lpng \
-lxml2 \
Expand All @@ -130,7 +128,7 @@ LOCAL_LDLIBS := -L$(LOCAL_PATH)/../platform_support/third_party/android/librarie
# it is used for ndk-r5
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)
#LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../platform_support/third_party/android/libraries) \
#LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/libraries) \
# -lGLESv1_CM -llog -lz \
# -lpng \
# -lxml2 \
Expand Down
6 changes: 3 additions & 3 deletions cocos2dx/include/CCTextureCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.
namespace cocos2d {
class CCTexture2D;
class CCAsyncObject;
class NSLock;
class CCLock;
class CCImage;

typedef void (*fpAsyncCallback)(CCTexture2D*, void*);
Expand All @@ -45,8 +45,8 @@ class CC_DLL CCTextureCache : public CCObject
{
protected:
CCMutableDictionary<std::string, CCTexture2D*> * m_pTextures;
NSLock *m_pDictLock;
NSLock *m_pContextLock;
CCLock *m_pDictLock;
CCLock *m_pContextLock;

private:
// @todo void addImageWithAsyncObject(CCAsyncObject* async);
Expand Down
4 changes: 2 additions & 2 deletions cocos2dx/platform/CCCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static const int kMaxLogLen = 255;
/**
@brief Output Debug message.
*/
void CC_DLL_PS CCLog(const char * pszFormat, ...);
void CC_DLL CCLog(const char * pszFormat, ...);

struct ccxNullDeleter { template< class TPTR > void operator()(TPTR ) {} };
struct ccxNewDeleter { template< class TPTR > void operator()(TPTR p) { delete p; } };
Expand Down Expand Up @@ -83,7 +83,7 @@ class ccxScopedPtr // noncopyable
@brief A simple scoped point for array.
*/
template< class T, class D = ccxNewArrayDeleter >
class CC_DLL_PS ccxScopedArray // noncopyable
class CC_DLL ccxScopedArray // noncopyable
: private D
{
public:
Expand Down
4 changes: 2 additions & 2 deletions cocos2dx/platform/CCGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ OpenGL GLU implementation
*/

/** OpenGL gluLookAt implementation */
void CC_DLL_PS gluLookAt(GLfloat fEyeX, GLfloat fEyeY, GLfloat fEyeZ,
void CC_DLL gluLookAt(GLfloat fEyeX, GLfloat fEyeY, GLfloat fEyeZ,
GLfloat fLookAtX, GLfloat fLookAtY, GLfloat fLookAtZ,
GLfloat fUpX, GLfloat fUpY, GLfloat fUpZ);

/** OpenGL gluPerspective implementation */
void CC_DLL_PS gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
void CC_DLL gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);

NS_CC_END;

Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/CCImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.

NS_CC_BEGIN;

class CC_DLL_PS CCImage
class CC_DLL CCImage
{
public:
CCImage();
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/CCPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ There are config below:
// pre configure
//////////////////////////////////////////////////////////////////////////

// define supported target platform macro which ccx uses.
// define supported target platform macro which CC uses.
#define CC_PLATFORM_UNKNOWN 0
#define CC_PLATFORM_IOS 1
#define CC_PLATFORM_MAC 2
Expand Down
3 changes: 0 additions & 3 deletions cocos2dx/platform/CCPlatformMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,4 @@ public: inline void set##funName(varType var){ varName = var; }

#endif // uphone VM

// shared library declator for platform_support project
#define CC_DLL_PS CC_DLL

#endif // __CC_PLATFORM_MACROS_H__
2 changes: 1 addition & 1 deletion cocos2dx/platform/CCStdC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)

int CC_DLL_PS gettimeofday(struct timeval * val, struct timezone *)
int CC_DLL gettimeofday(struct timeval * val, struct timezone *)
{
if (val)
{
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/CCStdC.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct timezone
int tz_dsttime;
};

int CC_DLL_PS gettimeofday(struct timeval *, struct timezone *);
int CC_DLL gettimeofday(struct timeval *, struct timezone *);

#endif // CC_PLATFORM_WIN32

Expand Down
20 changes: 10 additions & 10 deletions cocos2dx/platform/CCThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

#ifndef __CC_THREAD_H_YANGWS_20110114__
#define __CC_THREAD_H_YANGWS_20110114__
#ifndef __CC_PLATFORM_THREAD_H__
#define __CC_PLATFORM_THREAD_H__

#include "CCCommon.h"

Expand All @@ -35,26 +35,26 @@ NS_CC_BEGIN;

@warning Don't enter a CCLock twice in the same thread.
*/
class CC_DLL_PS ccxLock
class CC_DLL CCLock
{
public:
ccxLock();
~ccxLock();
CCLock();
~CCLock();

void lock();
void unlock();

private:
class Impl;
ccxScopedPtr<ccxLock::Impl> m_pImp;
ccxScopedPtr<CCLock::Impl> m_pImp;
};
#else // CC_SUPPORT_MULTITHREAD

class CC_DLL_PS ccxLock
class CC_DLL CCLock
{
public:
ccxLock() {}
~ccxLock() {}
CCLock() {}
~CCLock() {}

void lock() {}
void unlock() {}
Expand All @@ -64,4 +64,4 @@ class CC_DLL_PS ccxLock

NS_CC_END;

#endif // __CC_THREAD_H_YANGWS_20110114__
#endif // __CC_PLATFORM_THREAD_H__
2 changes: 1 addition & 1 deletion cocos2dx/platform/android/CCImage_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int sk_atomic_dec(int *value)
NS_CC_BEGIN;

// android not support
void CCMessageBox(const ccxString& msg, const ccxString& title)
void CCMessageBox(const std::string& msg, const std::string& title)
{

}
Expand Down
14 changes: 7 additions & 7 deletions cocos2dx/platform/android/CCThread_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ THE SOFTWARE.
#if CCX_SUPPORT_MULTITHREAD

#include <semaphore.h>
#include "ccxThread.h"
#include "CCThread.h"

NS_CC_BEGIN;

class CCXLock::Impl
class CCLock::Impl
{
public:
Impl()
Expand All @@ -45,28 +45,28 @@ class CCXLock::Impl
sem_t m_sMutex;
};

CCXLock::CCXLock()
: m_pImp(new CCXLock::Impl)
CCLock::CCLock()
: m_pImp(new CCLock::Impl)
{
}

CCXLock::~CCXLock()
CCLock::~CCLock()
{
if (m_pImp)
{
delete m_pImp;
}
}

void CCXLock::lock()
void CCLock::lock()
{
if (m_pImp)
{
sem_wait(&m_pImp->m_sMutex);
}
}

void CCXLock::unlock()
void CCLock::unlock()
{
if (m_pImp)
{
Expand Down
2 changes: 0 additions & 2 deletions cocos2dx/platform/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class CCTime
static void timersubCocos2d(struct cc_timeval *out, struct cc_timeval *start, struct cc_timeval *end);
};

class NSLock : public ccxLock{};

NS_CC_END;

#endif // __PLATFORM_H__
2 changes: 1 addition & 1 deletion cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void CCAccelerometer::addDelegate(CCAccelerometerDelegate* pDelegate)
}
}

void CCAccelerometer::didAccelerate(UIAcceleration* pAccelerationValue)
void CCAccelerometer::didAccelerate(CCAcceleration* pAccelerationValue)
{
CCAccelerometerHandler *pHandler;
CCAccelerometerDelegate *pDelegate;
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/uphone/CCAccelerometer_uphone.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CC_DLL CCAccelerometer
/**
@brief call delegates' didAccelerate function
*/
void didAccelerate(UIAcceleration* pAccelerationValue);
void didAccelerate(CCAcceleration* pAccelerationValue);

protected:
typedef CCMutableArray<CCAccelerometerHandler*> AccDelegateArray;
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/uphone/CCEGLView_uphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent)
TG3_SENSOR_TYPE_ACCELEROMETER == data.sensorMask)
{
// convert the data to iphone format
UIAcceleration AccValue;
CCAcceleration AccValue;
AccValue.x = -(data.acceleration.x / TG3_GRAVITY_EARTH);
AccValue.y = -(data.acceleration.y / TG3_GRAVITY_EARTH);
AccValue.z = -(data.acceleration.z / TG3_GRAVITY_EARTH);
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/platform/uphone/CCImage_uphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NS_CC_BEGIN

typedef std::basic_string<TUChar> stdTUString;

void CCMessageBox(const ccxString& msg, const ccxString& title)
void CCMessageBox(const std::string& msg, const std::string& title)
{
TUChar szText[256] = { 0 };
TUString::StrUtf8ToStrUnicode(szText,(Char*)msg.c_str());
Expand Down
Loading