issue #455: add compile CCUserDefault to WoPhone, but not test, because the path will change later

This commit is contained in:
minggo 2011-05-06 16:14:07 +08:00
parent 2c0bd49513
commit 33648a9e9b
7 changed files with 41 additions and 4 deletions

View File

@ -90,7 +90,7 @@ public:
@brief Get the writeable path
@return The path that can write/read file
*/
static const std::string getWriteablePath();
static std::string getWriteablePath();
/**
@brief Set/Get whether pop-up a message box when the image load failed

View File

@ -26,6 +26,10 @@ THE SOFTWARE.
#include <TG3.h>
#include "CCApplication.h"
#include <string>
using namespace std;
NS_CC_BEGIN;
// record the resource path
@ -250,4 +254,9 @@ void CCFileUtils::setRelativePath(const char* pszRelativePath)
CCAssert(0, "Have not implement!");
}
string CCFileUtils::getWriteablePath()
{
return string(CCApplication::sharedApplication().getAppDataPath());
}
NS_CC_END;

View File

@ -120,7 +120,8 @@ OBJECTS = \
$(OBJECTS_DIR)/CCTMXTiledMap.o \
$(OBJECTS_DIR)/CCTMXXMLParser.o \
$(OBJECTS_DIR)/CCTouchDispatcher.o \
$(OBJECTS_DIR)/CCTouchHandler.o
$(OBJECTS_DIR)/CCTouchHandler.o \
$(OBJECTS_DIR)/CCUserDefault.o
ADD_OBJECTS +=
@ -406,3 +407,7 @@ $(OBJECTS_DIR)/CCTouchDispatcher.o : ../touch_dispatcher/CCTouchDispatcher.cpp
$(OBJECTS_DIR)/CCTouchHandler.o : ../touch_dispatcher/CCTouchHandler.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTouchHandler.o ../touch_dispatcher/CCTouchHandler.cpp
$(OBJECTS_DIR)/CCUserDefaultTest.o : ../support/CCUserDefaultTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCUserDefaultTest.o ../support/CCUserDefaultTest.cpp

View File

@ -576,6 +576,10 @@
RelativePath="..\include\ccTypes.h"
>
</File>
<File
RelativePath="..\include\CCUserDefault.h"
>
</File>
<File
RelativePath="..\include\CCZone.h"
>
@ -740,6 +744,10 @@
RelativePath="..\support\CCProfiling.h"
>
</File>
<File
RelativePath="..\support\CCUserDefault.cpp"
>
</File>
<File
RelativePath="..\support\ccUtils.cpp"
>

View File

@ -298,7 +298,6 @@ void CCUserDefault::initXMLFilePath()
if (! m_sbIsFilePathInitialized)
{
m_sFilePath += CCFileUtils::getWriteablePath() + XML_FILE_NAME;
CCLog(m_sFilePath.c_str());
m_sbIsFilePathInitialized = true;
}
}

View File

@ -104,7 +104,8 @@ OBJECTS = \
$(OBJECTS_DIR)/Paddle.o \
$(OBJECTS_DIR)/TouchesTest.o \
$(OBJECTS_DIR)/TransitionsTest.o \
$(OBJECTS_DIR)/ZwoptexTest.o
$(OBJECTS_DIR)/ZwoptexTest.o \
$(OBJECTS_DIR)/UserDefaultTest.o
ADD_OBJECTS +=
@ -330,3 +331,6 @@ $(OBJECTS_DIR)/ZwoptexTest.o : ../tests/ZwoptexTest/ZwoptexTest.cpp
$(OBJECTS_DIR)/CurlTest.o : ../tests/CurlTest/CurlTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CurlTest.o ../tests/CurlTest/CurlTest.cpp
$(OBJECTS_DIR)/UserDefaultTest.o : ../tests/UserDefaultTest/UserDefaultTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/UserDefaultTest.o ../tests/UserDefaultTest/UserDefaultTest.cpp

View File

@ -975,6 +975,18 @@
>
</File>
</Filter>
<Filter
Name="UserDefaultTest"
>
<File
RelativePath="..\tests\UserDefaultTest\UserDefaultTest.cpp"
>
</File>
<File
RelativePath="..\tests\UserDefaultTest\UserDefaultTest.h"
>
</File>
</Filter>
</Filter>
</Files>
<Globals>