debug issue #852

This commit is contained in:
dumganhar 2011-11-10 16:44:58 +08:00
parent 33db1c7951
commit ca3b91855a
7 changed files with 56 additions and 1375 deletions

View File

@ -24,7 +24,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="exe" artifactName="HelloWorld" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.osp.gnu.target.exe.debug.2113673682" name="Target-Debug" parent="cdt.managedbuild.config.osp.gnu.target.exe.debug" prebuildStep="cd .. &amp; (if not exist lib mkdir lib) &amp; (copy /y ..\..\..\cocos2dx\proj.bada\sdk2.0\.Target-Debug\libcocos2dx.so lib) &amp; (copy /y ..\..\..\CocosDenshion\proj.bada\sdk2.0\.Target-Debug\libCocosDenshion.so lib) &amp; (if not exist Res mkdir Res) &amp; (copy /y ..\..\Resource\*.* Res)">
<configuration artifactExtension="exe" artifactName="HelloWorld" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.osp.gnu.target.exe.debug.2113673682" name="Target-Debug" parent="cdt.managedbuild.config.osp.gnu.target.exe.debug" prebuildStep="cd.. &amp; (if not exist Res mkdir Res) &amp; (copy /y ..\..\Resource\*.* Res)">
<folderInfo id="cdt.managedbuild.config.osp.gnu.target.exe.debug.2113673682." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.osp.gnu.target.exe.debug.2127488964" name="bada GCC ToolChain" superClass="cdt.managedbuild.toolchain.osp.gnu.target.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.Cygwin_PE;org.eclipse.cdt.core.GNU_ELF;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.osp.gnu.target.platform.exe.debug.1117105675" name="Debug Platform" osList="osp" superClass="cdt.managedbuild.target.osp.gnu.target.platform.exe.debug"/>
@ -53,10 +53,7 @@
</tool>
<tool id="cdt.managedbuild.tool.osp.gnu.target.c.linker.exe.debug.1406585521" name="bada C Linker" superClass="cdt.managedbuild.tool.osp.gnu.target.c.linker.exe.debug"/>
<tool id="cdt.managedbuild.tool.osp.gnu.target.cpp.linker.exe.debug.1747969474" name="bada C++ Linker" superClass="cdt.managedbuild.tool.osp.gnu.target.cpp.linker.exe.debug">
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.2056672880" name="Libraries (-l)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="CocosDenshion"/>
</option>
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.2056672880" name="Libraries (-l)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs" valueType="libs"/>
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.paths.1078498225" name="Library search path (-L)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${SDKROOT}/Tools/Toolchains/ARM/arm-samsung-nucleuseabi/lib&quot;"/>
@ -65,8 +62,13 @@
</option>
<option id="osp.gnu.target.cpp.link.debug.exe.option.userobjs.807623096" name="Other objects" superClass="osp.gnu.target.cpp.link.debug.exe.option.userobjs" valueType="userObjs">
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/osp_rt0.a&quot;"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/proj.bada/sdk2.0_StaticLib/.Target-Debug/libcocos2dx.a"/>
<listOptionValue builtIn="false" value="../../../../CocosDenshion/proj.bada/sdk2.0_StaticLib/.Target-Debug/libCocosDenshion.a"/>
<listOptionValue builtIn="false" value="../../../../Box2D/proj.bada/sdk2.0/.Target-Debug/libBox2D.a"/>
<listOptionValue builtIn="false" value="../../../../chipmunk/proj.bada/sdk2.0/.Target-Debug/libchipmunk.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/libjpeg/sdk2.0/.Target-Debug/libjpeg.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/png/sdk2.0/.Target-Debug/libpng.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/zlib/sdk2.0/.Target-Debug/libzlib.a"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FOsp.so&quot;"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FGraphicsOpengl.so&quot;"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FGraphicsEgl.so&quot;"/>

View File

@ -281,7 +281,7 @@ Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW
#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0
#define CC_SPRITEBATCHNODE_DEBUG_DRAW 1
#endif
/** @def CC_LABELBMFONT_DEBUG_DRAW
@ -291,7 +291,7 @@ Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
#ifndef CC_LABELBMFONT_DEBUG_DRAW
#define CC_LABELBMFONT_DEBUG_DRAW 0
#define CC_LABELBMFONT_DEBUG_DRAW 1
#endif
/** @def CC_LABELATLAS_DEBUG_DRAW

View File

@ -161,8 +161,22 @@ public: inline void set##funName(const varType& var){ varName = var; }
#include <assert.h>
#define CC_ASSERT(cond) assert(cond)
#else
#define CC_ASSERT(cond)
// bada platform
#include <FBaseConfig.h>
#include <FBaseSys.h>
#undef CC_DLL
#define CC_DLL _EXPORT_
#include "CCPlatformFunc_bada.h"
#ifdef _DEBUG
#define CC_ASSERT(cond) if (!(cond)) badaAssert(__PRETTY_FUNCTION__ , __LINE__ , #cond)
#else
#define CC_ASSERT(cond)
#endif /* _DEBUG */
#endif
#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
@ -195,14 +209,4 @@ public: inline void set##funName(const varType& var){ varName = var; }
#endif // wophone VM
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include <FBaseConfig.h>
#undef CC_DLL
#define CC_DLL _EXPORT_
#ifndef CC_BADA_2_0
#include "CCPlatformFunc_bada.h"
#endif
#endif
#endif // __CC_PLATFORM_MACROS_H__

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,17 @@
extern "C" {
#endif
#ifndef CC_BADA_2_0
#define printf(...) AppLog(__VA_ARGS__)
int sprintf(char* buf, const char *format, ...);
int sscanf (const char *s,const char *format, ...);
#endif
void badaAssert(const char* pFunction, int lineNumber, const char* pszContent);
#ifdef __cplusplus
}
#endif

View File

@ -187,6 +187,9 @@ char * CCTextureAtlas::description()
void CCTextureAtlas::initIndices()
{
if (m_uCapacity <= 0)
return;
for( unsigned int i=0; i < m_uCapacity; i++)
{
#if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP
@ -322,8 +325,20 @@ bool CCTextureAtlas::resizeCapacity(unsigned int newCapacity)
m_uTotalQuads = min(m_uTotalQuads, newCapacity);
m_uCapacity = newCapacity;
void * tmpQuads = realloc( m_pQuads, sizeof(m_pQuads[0]) * m_uCapacity );
void * tmpIndices = realloc( m_pIndices, sizeof(m_pIndices[0]) * m_uCapacity * 6 );
void * tmpQuads = NULL;
void * tmpIndices = NULL;
// when calling initWithTexture(fileName, 0) on bada device, calloc(0, 1) will fail and return NULL,
// so here must judge whether m_pQuads and m_pIndices is NULL.
if (m_pQuads == NULL)
tmpQuads = calloc(sizeof(m_pQuads[0]) * m_uCapacity, 1);
else
tmpQuads = realloc( m_pQuads, sizeof(m_pQuads[0]) * m_uCapacity );
if (m_pIndices == NULL)
tmpIndices = calloc(sizeof(m_pIndices[0]) * m_uCapacity * 6, 1);
else
tmpIndices = realloc( m_pIndices, sizeof(m_pIndices[0]) * m_uCapacity * 6 );
if( ! ( tmpQuads && tmpIndices) ) {
//CCLOG("cocos2d: CCTextureAtlas: not enough memory");
@ -372,6 +387,8 @@ void CCTextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start)
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Unneeded states: -
if (0 == n)
return;
glBindTexture(GL_TEXTURE_2D, m_pTexture->getName());

View File

@ -24,7 +24,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="exe" artifactName="TestCocos2dx" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.osp.gnu.target.exe.debug.1659310185" name="Target-Debug" parent="cdt.managedbuild.config.osp.gnu.target.exe.debug" prebuildStep="cd .. &amp; (if not exist lib mkdir lib) &amp; (copy /y ..\..\..\cocos2dx\proj.bada\sdk2.0\.Target-Debug\libcocos2dx.so lib) &amp; (copy /y ..\..\..\CocosDenshion\proj.bada\sdk2.0\.Target-Debug\libCocosDenshion.so lib) &amp; (if not exist Res mkdir Res) &amp; (xcopy /s /y ..\..\Res\*.* Res)">
<configuration artifactExtension="exe" artifactName="TestCocos2dx" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.osp.gnu.target.exe.debug.1659310185" name="Target-Debug" parent="cdt.managedbuild.config.osp.gnu.target.exe.debug" prebuildStep="cd .. &amp; (if not exist Res mkdir Res) &amp; (xcopy /s /y ..\..\Res\*.* Res)">
<folderInfo id="cdt.managedbuild.config.osp.gnu.target.exe.debug.1659310185." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.osp.gnu.target.exe.debug.209599858" name="bada GCC ToolChain" superClass="cdt.managedbuild.toolchain.osp.gnu.target.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.Cygwin_PE;org.eclipse.cdt.core.GNU_ELF;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.osp.gnu.target.platform.exe.debug.1675194339" name="Debug Platform" osList="osp" superClass="cdt.managedbuild.target.osp.gnu.target.platform.exe.debug"/>
@ -57,16 +57,18 @@
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/osp_rt0.a&quot;"/>
<listOptionValue builtIn="false" value="../../../../Box2D/proj.bada/sdk2.0/.Target-Debug/libBox2D.a"/>
<listOptionValue builtIn="false" value="../../../../chipmunk/proj.bada/sdk2.0/.Target-Debug/libchipmunk.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/proj.bada/sdk2.0_StaticLib/.Target-Debug/libcocos2dx.a"/>
<listOptionValue builtIn="false" value="../../../../CocosDenshion/proj.bada/sdk2.0_StaticLib/.Target-Debug/libCocosDenshion.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/libjpeg/sdk2.0/.Target-Debug/libjpeg.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/png/sdk2.0/.Target-Debug/libpng.a"/>
<listOptionValue builtIn="false" value="../../../../cocos2dx/platform/third_party/bada/src/zlib/sdk2.0/.Target-Debug/libzlib.a"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FOsp.so&quot;"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FGraphicsOpengl.so&quot;"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/FGraphicsEgl.so&quot;"/>
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}/StubDynCast.so&quot;"/>
</option>
<option id="osp.gnu.cpp.link.option.other.689865278" name="Other options (-Xlinker [option])" superClass="osp.gnu.cpp.link.option.other"/>
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.851145674" name="Libraries (-l)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="CocosDenshion"/>
</option>
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.851145674" name="Libraries (-l)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs" valueType="libs"/>
<option id="osp.gnu.target.cpp.link.debug.exe.option.libs.paths.1425715273" name="Library search path (-L)" superClass="osp.gnu.target.cpp.link.debug.exe.option.libs.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${TARGET_LIB_PATH}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/lib&quot;"/>