This commit is contained in:
minggo 2011-05-06 16:29:44 +08:00
commit 7e40957e04
25 changed files with 2297 additions and 2216 deletions

View File

@ -67,7 +67,7 @@ namespace CocosDenshion
s3eFreeBase(g_AudioBuffer);
}
void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath)
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
}

View File

@ -54,7 +54,7 @@ namespace CocosDenshion
endJNI();
}
void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath)
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
}

View File

@ -53,11 +53,10 @@ public:
static void end();
/**
@brief Set the ResourcePath and(or) the zip file name
@param pszResPath The absolute resource path
@brief Set the zip file name
@param pszZipFileName The relative path of the .zip file
*/
static void setResource(const char* pszZipFileName, const char* pszResPath = NULL);
static void setResource(const char* pszZipFileName);
/**
@brief Preload background music

View File

@ -145,7 +145,7 @@ namespace CocosDenshion
static_end();
}
void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath)
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
}

View File

@ -54,7 +54,7 @@ void SimpleAudioEngine::end()
return;
}
void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath)
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
}

View File

@ -13,8 +13,6 @@ static char s_AppDataPath[EOS_FILE_MAX_PATH] = {0};
unsigned char* getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize);
void fullPathFromRelativePath(const char *pszRelativePath, char* fullPath);
void updateZipFilePath(const char* pResPath);
void setZipFilePath(const char* pZipFileName);
const char* getDataPath();
bool FileUtils::isFileExisted(const char* pFilePath)
@ -57,29 +55,39 @@ bool FileUtils::isFileExisted(const char* pFilePath)
return bRet;
}
void FileUtils::setResource(const char* pszResPath, const char* pszZipFileName)
void FileUtils::setResource(const char* pszZipFileName)
{
if (pszResPath != NULL && pszZipFileName != NULL)
// get the full path of zip file
char fullPath[EOS_FILE_MAX_PATH] = {0};
if (strlen(s_ResourcePath))
{
// record the resource path
strcpy(s_ResourcePath, pszResPath);
strcpy(fullPath, s_ResourcePath);
}
else
{
const char* pAppDataPath = getDataPath();
strcpy(fullPath, pAppDataPath);
}
strcat(fullPath, pszZipFileName);
// record the zip file path
setZipFilePath(pszZipFileName);
}
else if (pszResPath != NULL)
// if the zip file not exist,use message box to warn developer
TUChar pszTmp[EOS_FILE_MAX_PATH] = {0};
TUString::StrGBToUnicode(pszTmp, (const Char*) fullPath);
Boolean bExist = EOS_IsFileExist(pszTmp);
if (!bExist)
{
// update the zip file path
updateZipFilePath(pszResPath);
std::string strErr = "zip file ";
strErr += fullPath;
strErr += " not exist!";
TUChar szText[EOS_FILE_MAX_PATH] = { 0 };
TUString::StrUtf8ToStrUnicode(szText,(Char*)strErr.c_str());
TApplication::GetCurrentApplication()->MessageBox(szText,NULL,WMB_OK);
return;
}
// record the resource path
strcpy(s_ResourcePath, pszResPath);
}
else if (pszZipFileName != NULL)
{
// record the zip file path
setZipFilePath(pszZipFileName);
}
// clear the zip file path recorded before and record the new path
memset(s_ZipFilePath, 0, sizeof(char) * EOS_FILE_MAX_PATH);
strcpy(s_ZipFilePath, fullPath);
}
unsigned char* FileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
@ -179,110 +187,25 @@ void fullPathFromRelativePath(const char *pszRelativePath, char* fullPath)
strcpy(s_ResourcePath, pAppDataPath);
}
#ifndef _TRANZDA_VM_
char *pszDriver = "";
#else
char *pszDriver = "D:/Work7";
#endif
std::string pRet;
if ((strlen(pszRelativePath) > 1 && pszRelativePath[1] == ':'))
if ((strlen(pszRelativePath) > 1 && pszRelativePath[1] == ':') ||
(strlen(pszRelativePath) > 0 && pszRelativePath[0] == '/'))
{
pRet = pszRelativePath;
}
else if (strlen(pszRelativePath) > 0 && pszRelativePath[0] == '/')
{
pRet = pszDriver;
pRet += pszRelativePath;
}
else
{
pRet = pszDriver;
pRet += s_ResourcePath;
pRet = s_ResourcePath;
pRet += pszRelativePath;
}
if (strlen(pRet.c_str()) < EOS_FILE_MAX_PATH &&
strlen(pRet.c_str()) > 0)
if (pRet.length() < EOS_FILE_MAX_PATH && pRet.length() > 0)
{
strcpy(fullPath, pRet.c_str());
}
return;
}
void updateZipFilePath(const char* pResPath)
{
if (! strlen(s_ZipFilePath))
{
return;
}
std::string strTemp = s_ZipFilePath;
int nPos = std::string::npos;
// find the path need br replaced
std::string ResPath;
if (strlen(s_ResourcePath))
{
ResPath = s_ResourcePath;
}
else
{
ResPath = getDataPath();
}
// replace the resource path in s_ZipFilePath
nPos = strTemp.find(ResPath.c_str());
if (nPos != std::string::npos)
{
strTemp.replace(nPos, ResPath.length(), pResPath);
memset(s_ZipFilePath, 0, sizeof(char) * EOS_FILE_MAX_PATH);
strcpy(s_ZipFilePath, strTemp.c_str());
}
}
void setZipFilePath(const char* pZipFileName)
{
// get the full path of zip file
char fullPath[EOS_FILE_MAX_PATH] = {0};
if (strlen(s_ResourcePath))
{
strcpy(fullPath, s_ResourcePath);
}
else
{
const char* pAppDataPath = getDataPath();
strcpy(fullPath, pAppDataPath);
}
strcat(fullPath, pZipFileName);
// if the zip file not exist,use message box to warn developer
TUChar pszTmp[EOS_FILE_MAX_PATH] = {0};
TUString::StrGBToUnicode(pszTmp, (const Char*) fullPath);
Boolean bExist = EOS_IsFileExist(pszTmp);
if (!bExist)
{
std::string strErr = "zip file ";
strErr += fullPath;
strErr += " not exist!";
TUChar szText[EOS_FILE_MAX_PATH] = { 0 };
TUString::StrUtf8ToStrUnicode(szText,(Char*)strErr.c_str());
TApplication::GetCurrentApplication()->MessageBox(szText,NULL,WMB_OK);
return;
}
#ifndef _TRANZDA_VM_
char *pszDriver = "";
#else
char *pszDriver = "D:/Work7";
#endif
// record the zip file path
strcpy(s_ZipFilePath, pszDriver);
strcat(s_ZipFilePath, fullPath);
}
const char* getDataPath()
{
if (strlen(s_AppDataPath))
@ -298,8 +221,19 @@ const char* getDataPath()
BREAK_IF(nRet < 0);
TUChar AppPath[EOS_FILE_MAX_PATH] = {0};
SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_EXECUTABLE, AppPath);
TUString::StrUnicodeToStrUtf8((Char*) s_AppDataPath, AppPath);
char DataPath[EOS_FILE_MAX_PATH] = {0};
SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_CONST, AppPath);
TUString::StrUnicodeToStrUtf8((Char*) DataPath, AppPath);
#ifndef _TRANZDA_VM_
char *pszDriver = "";
#else
char *pszDriver = "D:/Work7";
#endif
// record the data path
strcpy(s_AppDataPath, pszDriver);
strcat(s_AppDataPath, DataPath);
} while (0);
return s_AppDataPath;

View File

@ -24,7 +24,7 @@ public:
@param pszResPath The absolute resource path
@param pszZipFileName The relative path of the .zip file
*/
static void setResource(const char* pszResPath, const char* pszZipFileName);
static void setResource(const char* pszZipFileName);
/**
@brief Get resource file data

View File

@ -80,9 +80,9 @@ void SimpleAudioEngine::end()
}
}
void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath)
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
FileUtils::setResource(pszResPath, pszZipFileName);
FileUtils::setResource(pszZipFileName);
}
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)

View File

@ -97,7 +97,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="mkdir D:\Work7\NEWPLUS\TDA_DATA\Data&#x0D;&#x0A;copy ..\Resource\*.* D:\Work7\NEWPLUS\TDA_DATA\Data&#x0D;&#x0A;"
CommandLine="mkdir D:\Work7\NEWPLUS\TG3\ConstData&#x0D;&#x0A;copy ..\Resource\*.* D:\Work7\NEWPLUS\TG3\ConstData"
/>
</Configuration>
<Configuration

View File

@ -12,6 +12,12 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\win32\HelloWorld.win32.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\test.win32\test.win32.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
ProjectSection(ProjectDependencies) = postProject
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
{929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -63,12 +63,39 @@ NS_CC_END;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE)
#include "TG3.h"
#define LOG_FILE_PATH "/NEWPLUS/TDA_DATA/UserData/Cocos2dLog.txt"
static char s_szLogFilePath[EOS_FILE_MAX_PATH] = {0};
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
if (! s_szLogFilePath[0])
{
// save the log file named "Cocos2dxLog.txt" to the directory which the app.so in.
TUChar AppID[EOS_FILE_MAX_PATH] = {0};
UInt32 nCmdType = 0;
Int32 nRet = SS_AppRequest_GetAppName(AppID, &nCmdType);
if (nRet < 0)
{
return;
}
TUChar AppPath[EOS_FILE_MAX_PATH] = {0};
if (SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_EXECUTABLE, AppPath) < 0)
{
return;
}
char szAppPath[EOS_FILE_MAX_PATH] = {0};
TUString::StrUnicodeToStrUtf8((Char*) szAppPath, AppPath);
#ifndef _TRANZDA_VM_
strcpy(s_szLogFilePath, "");
#else
strcpy(s_szLogFilePath, "D:/Work7");
#endif
strcat(s_szLogFilePath, szAppPath);
strcat(s_szLogFilePath, "Cocos2dxLog.txt");
}
SS_printf("Cocos2d: ");
char szBuf[MAX_LEN];
@ -86,7 +113,7 @@ void CCLog(const char * pszFormat, ...)
SS_printf("\n");
#else
SS_printf("\r\n");
FILE * pf = fopen(LOG_FILE_PATH, "a+");
FILE * pf = fopen(s_szLogFilePath, "a+");
if (! pf)
{
return;

View File

@ -141,7 +141,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
multiSampling_ = sampling;
requestedSamples_ = nSamples;
preserveBackbuffer_ = retained;
markedText_ = nil;
if( ! [self setupSurfaceWithSharegroup:sharegroup] ) {
[self release];
return nil;
@ -166,6 +166,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
multiSampling_= NO;
requestedSamples_ = 0;
size_ = [eaglLayer bounds].size;
markedText_ = nil;
if( ! [self setupSurfaceWithSharegroup:nil] ) {
[self release];
@ -193,7 +194,6 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onUIKeyboardNotification:)
name:UIKeyboardDidHideNotification object:nil];
}
-(int) getWidth
@ -516,6 +516,9 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
- (BOOL)canBecomeFirstResponder
{
if (nil != markedText_) {
[markedText_ release];
}
markedText_ = nil;
return YES;
}
@ -530,12 +533,20 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
- (void)insertText:(NSString *)text
{
if (nil != markedText_) {
[markedText_ release];
markedText_ = nil;
}
const char * pszText = [text cStringUsingEncoding:NSUTF8StringEncoding];
cocos2d::CCIMEDispatcher::sharedDispatcher()->dispatchInsertText(pszText, strlen(pszText));
}
- (void)deleteBackward
{
if (nil != markedText_) {
[markedText_ release];
markedText_ = nil;
}
cocos2d::CCIMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();
}
@ -576,7 +587,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
- (NSString *)textInRange:(UITextRange *)range;
{
CCLOG("textInRange");
return nil;
return @"";
}
- (void)replaceRange:(UITextRange *)range withText:(NSString *)theText;
{
@ -618,7 +629,14 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
- (void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange;
{
CCLOG("setMarkedText");
if (markedText == markedText_) {
return;
}
if (nil != markedText_) {
[markedText_ release];
}
markedText_ = markedText;
[markedText_ retain];
}
- (void)unmarkText;
{
@ -629,6 +647,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
}
const char * pszText = [markedText_ cStringUsingEncoding:NSUTF8StringEncoding];
cocos2d::CCIMEDispatcher::sharedDispatcher()->dispatchInsertText(pszText, strlen(pszText));
[markedText_ release];
markedText_ = nil;
}
@ -704,7 +723,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
/* JS - Find the closest position to a given point */
- (UITextPosition *)closestPositionToPoint:(CGPoint)point;
{
CCLOG(@"closestPositionToPoint");
CCLOG("closestPositionToPoint");
return nil;
}
- (UITextPosition *)closestPositionToPoint:(CGPoint)point withinRange:(UITextRange *)range;
@ -807,9 +826,10 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
}
else if (UIKeyboardDidShowNotification == type)
{
CGSize screenSize = self.window.screen.bounds.size;
dispatcher->dispatchKeyboardDidShow(notiInfo);
caretRect_ = end;
caretRect_.origin.y = caretRect_.origin.y + caretRect_.size.height;
caretRect_.origin.y = viewSize.height - (caretRect_.origin.y + caretRect_.size.height + [UIFont smallSystemFontSize]);
caretRect_.size.height = 0;
}
else if (UIKeyboardWillHideNotification == type)
@ -822,5 +842,4 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
dispatcher->dispatchKeyboardDidHide(notiInfo);
}
}
@end

View File

@ -1,7 +1,9 @@
// #define COCOS2D_DEBUG 1
#include "CCApplication_wophone.h"
#include "ssBackLightControl.h"
#include "ssKeyLockControl.h"
//#include "ssKeyLockControl.h"
#include "CCScheduler.h"
@ -50,7 +52,7 @@ CCApplication::CCApplication()
TUChar AppPath[EOS_FILE_MAX_PATH] = {0};
char DataPath[EOS_FILE_MAX_PATH] = {0};
SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_DATA, AppPath);
SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_CONST, AppPath);
TUString::StrUnicodeToStrUtf8((Char*) DataPath, AppPath);
#ifndef _TRANZDA_VM_
@ -113,8 +115,16 @@ Boolean CCApplication::EventHandler(EventType* pEvent)
{
StopMainLoop();
}
CfgTurnOnBackLight();
EnableKeyLock();
// restore back light open mode
if (CfgGetBackLightStatus())
{
CfgTurnOnBackLightEx(SYS_BACK_LIGHT_MODE_TIME_LONG);
CCLOG("AppActiveNotify::TurnOnBackLight:MODE_TIME_LONG");
}
// EnableKeyLock();
// CCLOG("AppActiveNotify::InBackground");
}
else if (pEvent->sParam1 > 0)
{
@ -126,12 +136,19 @@ Boolean CCApplication::EventHandler(EventType* pEvent)
StartMainLoop();
CfgTurnOnBackLightDelay(0x7fffffff);
// if KeyLock disactived, disable it.
if (! CfgKeyLock_GetActive())
// modify back light open mode
if (CfgGetBackLightStatus())
{
DisableKeyLock();
CfgTurnOnBackLightDelay(0x7fffffff);
CCLOG("AppActiveNotify::TurnOnBackLight:0x7fffffff");
}
// if KeyLock disactived, disable it.
// if (! CfgKeyLock_GetActive())
// {
// DisableKeyLock();
// CCLOG("AppActiveNotify::DisableKeyLock");
// }
}
break;
}
@ -172,6 +189,8 @@ void CCApplication::switchNotify(int nTurnOn)
{
bool bInBack = isInBackground();
// set the auto close screen and auto key lock status
do
{
// if the app have be in background,don't handle this message
@ -182,9 +201,23 @@ void CCApplication::switchNotify(int nTurnOn)
// CCDirector::sharedDirector()->pause();
applicationDidEnterBackground();
StopMainLoop();
// EnableKeyLock();
// CCLOG("BLswitchNotify::EnableKeyLock");
}
else
{
// modify back light open mode
CfgTurnOnBackLightDelay(0x7fffffff);
CCLOG("AppActiveNotify::TurnOnBackLight:0x7fffffff");
// // if KeyLock disactived, disable it.
// if (! CfgKeyLock_GetActive())
// {
// DisableKeyLock();
// CCLOG("BLswitchNotify::DisableKeyLock");
// }
//
// CCDirector::sharedDirector()->resume();
applicationWillEnterForeground();
StartMainLoop();

View File

@ -126,6 +126,8 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\base_nodes\CCAtlasNode.cpp" />
<ClCompile Include="..\base_nodes\CCNode.cpp" />
<ClCompile Include="..\CCDirector.cpp" />
<ClCompile Include="..\cocoa\CCAffineTransform.cpp" />
<ClCompile Include="..\cocoa\CCAutoreleasePool.cpp" />
<ClCompile Include="..\cocoa\CCData.cpp" />
@ -146,12 +148,16 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\actions\CCActionPageTurn3D.cpp" />
<ClCompile Include="..\actions\CCActionProgressTimer.cpp" />
<ClCompile Include="..\actions\CCActionTiledGrid.cpp" />
<ClCompile Include="..\effects\CCGrid.cpp" />
<ClCompile Include="..\label_nodes\CCLabelAtlas.cpp" />
<ClCompile Include="..\label_nodes\CCLabelBMFont.cpp" />
<ClCompile Include="..\label_nodes\CCLabelTTF.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCLayer.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCScene.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCTransition.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCTransitionPageTurn.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCTransitionRadial.cpp" />
<ClCompile Include="..\menu_nodes\CCMenu.cpp" />
<ClCompile Include="..\menu_nodes\CCMenuItem.cpp" />
<ClCompile Include="..\misc_nodes\CCMotionStreak.cpp" />
<ClCompile Include="..\misc_nodes\CCProgressTimer.cpp" />
@ -159,21 +165,15 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\misc_nodes\CCRibbon.cpp" />
<ClCompile Include="..\particle_nodes\CCParticleExamples.cpp" />
<ClCompile Include="..\particle_nodes\CCParticleSystem.cpp" />
<ClCompile Include="..\particle_nodes\CCParticleSystemPoint.cpp" />
<ClCompile Include="..\particle_nodes\CCParticleSystemQuad.cpp" />
<ClCompile Include="..\platform\CCCommon.cpp" />
<ClCompile Include="..\platform\CCDirector_mobile.cpp" />
<ClCompile Include="..\platform\CCFileUtils.cpp" />
<ClCompile Include="..\platform\CCGL.cpp" />
<ClCompile Include="..\platform\CCGrid_mobile.cpp" />
<ClCompile Include="..\platform\CCImage.cpp" />
<ClCompile Include="..\platform\CCLayer_mobile.cpp" />
<ClCompile Include="..\platform\CCMenu_mobile.cpp" />
<ClCompile Include="..\platform\CCNode_mobile.cpp" />
<ClCompile Include="..\platform\CCParticleSystemPoint_mobile.cpp" />
<ClCompile Include="..\platform\CCSAXParser.cpp" />
<ClCompile Include="..\platform\CCStdC.cpp" />
<ClCompile Include="..\platform\CCThread.cpp" />
<ClCompile Include="..\platform\CCTransition_mobile.cpp" />
<ClCompile Include="..\platform\platform.cpp" />
<ClCompile Include="..\platform\win32\CCApplication_win32.cpp" />
<ClCompile Include="..\platform\win32\CCEGLView_win32.cpp" />
@ -185,6 +185,7 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\sprite_nodes\CCSpriteFrameCache.cpp" />
<ClCompile Include="..\sprite_nodes\CCSpriteSheet.cpp" />
<ClCompile Include="..\support\base64.cpp" />
<ClCompile Include="..\support\CCArray.cpp" />
<ClCompile Include="..\support\CCPointExtension.cpp" />
<ClCompile Include="..\support\CCProfiling.cpp" />
<ClCompile Include="..\support\ccUtils.cpp" />
@ -197,6 +198,8 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\textures\CCTexture2D.cpp" />
<ClCompile Include="..\textures\CCTextureAtlas.cpp" />
<ClCompile Include="..\textures\CCTextureCache.cpp" />
<ClCompile Include="..\text_input_node\CCIMEDispatcher.cpp" />
<ClCompile Include="..\text_input_node\CCTextFieldTTF.cpp" />
<ClCompile Include="..\tileMap_parallax_nodes\CCParallaxNode.cpp" />
<ClCompile Include="..\tileMap_parallax_nodes\CCTileMapAtlas.cpp" />
<ClCompile Include="..\tileMap_parallax_nodes\CCTMXLayer.cpp" />
@ -207,9 +210,6 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClCompile Include="..\touch_dispatcher\CCTouchHandler.cpp" />
<ClCompile Include="..\keypad_dispatcher\CCKeypadDelegate.cpp" />
<ClCompile Include="..\keypad_dispatcher\CCKeypadDispatcher.cpp" />
<ClCompile Include="..\event_dispatcher\CCEventDispatcher.cpp" />
<ClCompile Include="..\event_dispatcher\CCKeyboardEventDelegate.cpp" />
<ClCompile Include="..\event_dispatcher\CCMouseEventDelegate.cpp" />
<ClCompile Include="..\CCCamera.cpp" />
<ClCompile Include="..\CCConfiguration.cpp" />
<ClCompile Include="..\CCDrawingPrimitives.cpp" />
@ -250,6 +250,8 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClInclude Include="..\include\CCFileUtils.h" />
<ClInclude Include="..\include\CCGeometry.h" />
<ClInclude Include="..\include\CCGL.h" />
<ClInclude Include="..\include\CCIMEDelegate.h" />
<ClInclude Include="..\include\CCIMEDispatcher.h" />
<ClInclude Include="..\include\CCKeyboardEventDelegate.h" />
<ClInclude Include="..\include\CCKeypadDelegate.h" />
<ClInclude Include="..\include\CCKeypadDispatcher.h" />
@ -286,6 +288,7 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClInclude Include="..\include\CCSpriteFrameCache.h" />
<ClInclude Include="..\include\CCSpriteSheet.h" />
<ClInclude Include="..\include\CCString.h" />
<ClInclude Include="..\include\CCTextFieldTTF.h" />
<ClInclude Include="..\include\CCTexture2D.h" />
<ClInclude Include="..\include\CCTextureAtlas.h" />
<ClInclude Include="..\include\CCTextureCache.h" />
@ -316,8 +319,6 @@ xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$
<ClInclude Include="..\platform\CCImage.h" />
<ClInclude Include="..\platform\CCLibxml2.h" />
<ClInclude Include="..\platform\CCNS.h" />
<ClInclude Include="..\platform\CCParticleSystemPoint_mobile.h" />
<ClInclude Include="..\platform\CCParticleSystemPoint_platform.h" />
<ClInclude Include="..\platform\CCPlatformConfig.h" />
<ClInclude Include="..\platform\CCPlatformMacros.h" />
<ClInclude Include="..\platform\CCSAXParser.h" />

View File

@ -64,8 +64,8 @@
<Filter Include="keypad_dispatcher">
<UniqueIdentifier>{b7e6a4ee-f78a-4399-8f56-526294bf8580}</UniqueIdentifier>
</Filter>
<Filter Include="event_dispatcher">
<UniqueIdentifier>{1b2d8814-d294-4657-be38-4f6d904ad475}</UniqueIdentifier>
<Filter Include="test_input_node">
<UniqueIdentifier>{2bb0e4ec-d798-44ec-bc81-c7f7bfc90391}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
@ -174,39 +174,18 @@
<ClCompile Include="..\platform\CCCommon.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCDirector_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGL.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCGrid_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCImage.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCLayer_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCMenu_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCNode_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCParticleSystemPoint_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCStdC.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCThread.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\CCTransition_mobile.cpp">
<Filter>platform</Filter>
</ClCompile>
<ClCompile Include="..\platform\platform.cpp">
<Filter>platform</Filter>
</ClCompile>
@ -306,15 +285,6 @@
<ClCompile Include="..\keypad_dispatcher\CCKeypadDispatcher.cpp">
<Filter>keypad_dispatcher</Filter>
</ClCompile>
<ClCompile Include="..\event_dispatcher\CCEventDispatcher.cpp">
<Filter>event_dispatcher</Filter>
</ClCompile>
<ClCompile Include="..\event_dispatcher\CCKeyboardEventDelegate.cpp">
<Filter>event_dispatcher</Filter>
</ClCompile>
<ClCompile Include="..\event_dispatcher\CCMouseEventDelegate.cpp">
<Filter>event_dispatcher</Filter>
</ClCompile>
<ClCompile Include="..\CCConfiguration.cpp" />
<ClCompile Include="..\CCDrawingPrimitives.cpp" />
<ClCompile Include="..\CCScheduler.cpp" />
@ -329,6 +299,34 @@
<ClCompile Include="..\cocoa\CCNS.cpp">
<Filter>cocoa</Filter>
</ClCompile>
<ClCompile Include="..\text_input_node\CCIMEDispatcher.cpp">
<Filter>test_input_node</Filter>
</ClCompile>
<ClCompile Include="..\text_input_node\CCTextFieldTTF.cpp">
<Filter>test_input_node</Filter>
</ClCompile>
<ClCompile Include="..\base_nodes\CCNode.cpp">
<Filter>base_nodes</Filter>
</ClCompile>
<ClCompile Include="..\CCDirector.cpp" />
<ClCompile Include="..\layers_scenes_transitions_nodes\CCLayer.cpp">
<Filter>layers_scenes_transitions_nodes</Filter>
</ClCompile>
<ClCompile Include="..\layers_scenes_transitions_nodes\CCTransition.cpp">
<Filter>layers_scenes_transitions_nodes</Filter>
</ClCompile>
<ClCompile Include="..\particle_nodes\CCParticleSystemPoint.cpp">
<Filter>particle_nodes</Filter>
</ClCompile>
<ClCompile Include="..\support\CCArray.cpp">
<Filter>support</Filter>
</ClCompile>
<ClCompile Include="..\effects\CCGrid.cpp">
<Filter>effects</Filter>
</ClCompile>
<ClCompile Include="..\menu_nodes\CCMenu.cpp">
<Filter>menu_nodes</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\effects\CCGrabber.h">
@ -622,12 +620,6 @@
<ClInclude Include="..\platform\CCNS.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCParticleSystemPoint_mobile.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCParticleSystemPoint_platform.h">
<Filter>platform</Filter>
</ClInclude>
<ClInclude Include="..\platform\CCPlatformConfig.h">
<Filter>platform</Filter>
</ClInclude>
@ -698,5 +690,14 @@
<ClInclude Include="..\cocoa\CCNS.h">
<Filter>cocoa</Filter>
</ClInclude>
<ClInclude Include="..\include\CCTextFieldTTF.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\include\CCIMEDelegate.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\include\CCIMEDispatcher.h">
<Filter>include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -264,7 +264,7 @@ function AddConfigurations(proj, strProjectName) {
var PostBuildTool = config.Tools("VCPostBuildEventTool");
PostBuildTool.Description = "Performing registration...";
var strResDir = "..\\..\\NEWPLUS\\TDA_DATA\\Data\\";
var strResDir = "..\\..\\NEWPLUS\\TG3\\ConstData\\";
var strPostCmd = "mkdir " + strResDir;
strPostCmd += "\r\nxcopy /E /Y .\\Resource\\*.* " + strResDir;
PostBuildTool.CommandLine = strPostCmd;

View File

@ -1 +1 @@
269f9caa1380bc1e08175decedc54e5216e425ed
b7c09f3e759444e6da344ba829bac49f6742d22d

View File

@ -120,7 +120,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;;..\tests;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\;.\"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx\platform\third_party\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)chipmunk\include\chipmunk&quot;;&quot;$(SolutionDir)CocosDenshion\include&quot;;..\tests;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\;.\"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
@ -140,7 +140,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcocos2d.lib libgles_cm.lib libBox2d.lib libchipmunk.lib"
AdditionalDependencies="libcocos2d.lib libgles_cm.lib libBox2d.lib libchipmunk.lib libcurl_imp.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"

View File

@ -54,7 +54,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)cocos2dx\platform;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir);$(SolutionDir)chipmunk\include\chipmunk;$(SolutionDir)CocosDenshion\include;..\tests;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir);$(SolutionDir)chipmunk\include\chipmunk;$(SolutionDir)CocosDenshion\include;..\tests;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -66,7 +66,7 @@
<DisableSpecificWarnings>4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;libCocosDenshion.lib;libcurl_imp.lib;libcurl_imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -81,7 +81,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(SolutionDir)cocos2dx\platform;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir);$(SolutionDir)chipmunk\include\chipmunk;$(SolutionDir)CocosDenshion\include;..\tests;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir);$(SolutionDir)chipmunk\include\chipmunk;$(SolutionDir)CocosDenshion\include;..\tests;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@ -92,7 +92,7 @@
<DisableSpecificWarnings>4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;libCocosDenshion.lib;libcurl_imp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -106,13 +106,6 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\tests\PerformanceTest\PerformanceNodeChildrenTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceParticleTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceSpriteTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTextureTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTouchesTest.cpp" />
<ClCompile Include="..\tests\ZwoptexTest\ZwoptexTest.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="..\AppDelegate.cpp" />
<ClCompile Include="..\tests\controller.cpp" />
@ -171,15 +164,17 @@
<ClCompile Include="..\tests\HiResTest\HiResTest.cpp" />
<ClCompile Include="..\tests\KeypadTest\KeypadTest.cpp" />
<ClCompile Include="..\tests\CocosDenshionTest\CocosDenshionTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceNodeChildrenTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceParticleTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceSpriteTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTextureTest.cpp" />
<ClCompile Include="..\tests\PerformanceTest\PerformanceTouchesTest.cpp" />
<ClCompile Include="..\tests\ZwoptexTest\ZwoptexTest.cpp" />
<ClCompile Include="..\tests\CurlTest\CurlTest.cpp" />
<ClCompile Include="..\tests\TextInputTest\TextInputTest.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\PerformanceTest\PerformanceNodeChildrenTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceParticleTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceSpriteTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTextureTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTouchesTest.h" />
<ClInclude Include="..\tests\ZwoptexTest\ZwoptexTest.h" />
<ClInclude Include="main.h" />
<ClInclude Include="..\AppDelegate.h" />
<ClInclude Include="..\tests\controller.h" />
@ -259,24 +254,15 @@
<ClInclude Include="..\tests\HiResTest\HiResTest.h" />
<ClInclude Include="..\tests\KeypadTest\KeypadTest.h" />
<ClInclude Include="..\tests\CocosDenshionTest\CocosDenshionTest.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Box2D\proj.win32\Box2D.win32.vcxproj">
<Project>{929480e7-23c0-4df6-8456-096d71547116}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\chipmunk\proj.win32\chipmunk.win32.vcxproj">
<Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\cocos2dx\proj.win32\cocos2d-win32.vcxproj">
<Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\CocosDenshion\proj.win32\CocosDenshion.win32.vcxproj">
<Project>{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ClInclude Include="..\tests\PerformanceTest\PerformanceNodeChildrenTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceParticleTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceSpriteTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTextureTest.h" />
<ClInclude Include="..\tests\PerformanceTest\PerformanceTouchesTest.h" />
<ClInclude Include="..\tests\ZwoptexTest\ZwoptexTest.h" />
<ClInclude Include="..\tests\CurlTest\CurlTest.h" />
<ClInclude Include="..\tests\TextInputTest\TextInputTest.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -2,112 +2,118 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="win32">
<UniqueIdentifier>{2cec4d5a-4891-4389-89d2-ba9378e256f7}</UniqueIdentifier>
<UniqueIdentifier>{a024fc4a-f920-4162-9a80-03a48e447a41}</UniqueIdentifier>
</Filter>
<Filter Include="classes">
<UniqueIdentifier>{faa8929c-ade9-471b-9c80-56831406176c}</UniqueIdentifier>
<UniqueIdentifier>{7f2a1cbd-ab5c-465f-b9e2-65da3f0b14b1}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests">
<UniqueIdentifier>{5ba42913-895a-4779-8213-bfc0ec797e90}</UniqueIdentifier>
<UniqueIdentifier>{0562cf43-75dd-48e8-8ba4-f98f90f5a19b}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ActionsTest">
<UniqueIdentifier>{64f7afe1-c2ad-4fcd-8513-198339885f03}</UniqueIdentifier>
<UniqueIdentifier>{652f9b28-0000-4a5f-824e-6c5f432476ba}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\TransitionsTest">
<UniqueIdentifier>{9bd3d520-87d0-4675-9d3c-a4c7a0c06326}</UniqueIdentifier>
<UniqueIdentifier>{edb8b03e-23d6-43e7-9d7c-e8bf2202e6b5}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ProgressActionsTest">
<UniqueIdentifier>{17ae5ce8-b14d-463d-a0b8-a3b1859e9247}</UniqueIdentifier>
<UniqueIdentifier>{d74d5794-fb61-4d73-93c5-4eec3b3af02a}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\EffectsTest">
<UniqueIdentifier>{d0d49daf-d65e-4fe3-a9e9-7fbe7dcc7cf6}</UniqueIdentifier>
<UniqueIdentifier>{194ea888-f365-466b-8b4b-cde9a6b631af}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ClickAndMoveTest">
<UniqueIdentifier>{a2aa5794-8ba0-488e-a6fa-8347b186fb9a}</UniqueIdentifier>
<UniqueIdentifier>{4c291544-ce87-455f-8435-6fdcbcad44db}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\RotateWorldTest">
<UniqueIdentifier>{1ca5bba5-501c-46f5-987d-9a3533862c5a}</UniqueIdentifier>
<UniqueIdentifier>{51d48b68-cd80-4a8c-a72f-a672a5bd9dea}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ParticleTest">
<UniqueIdentifier>{e335751b-5dcb-4eec-99b1-d6ad22f41283}</UniqueIdentifier>
<UniqueIdentifier>{00aa431d-cb15-4280-807d-e3d25dcf78f8}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\EaseActionsTest">
<UniqueIdentifier>{5d5f105c-4606-4ff3-8c2c-fa40c97c7455}</UniqueIdentifier>
<UniqueIdentifier>{cc0a3cab-a5bc-4a28-b6f1-b88eb9eedc10}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\MotionStreakTest">
<UniqueIdentifier>{dc9fbea5-0e82-4a63-a9ad-40b6d17d4b2e}</UniqueIdentifier>
<UniqueIdentifier>{55c800ad-1f34-4fc7-9a02-80eae274f756}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\DrawPrimitivesTest">
<UniqueIdentifier>{2f2bbcff-0476-4ea7-ab87-a28db650f8a3}</UniqueIdentifier>
<UniqueIdentifier>{2e10e902-0172-4a92-8370-861f6e92c9ae}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\CocosNodeTest">
<UniqueIdentifier>{92d7fa0a-f213-4eb5-b151-ff5306f75f13}</UniqueIdentifier>
<UniqueIdentifier>{359a2bac-0a6a-4d22-b6f4-f9a50f1255d2}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\TouchesTest">
<UniqueIdentifier>{47db567d-8983-42a2-a1c5-2120481917ec}</UniqueIdentifier>
<UniqueIdentifier>{87dbf085-eef3-4dd9-b748-61d0061accff}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\MenuTest">
<UniqueIdentifier>{23eb4bf9-4c4a-4c6b-9145-48f40e70d3ea}</UniqueIdentifier>
<UniqueIdentifier>{75d90a2e-0c23-4095-98cb-b83008e54fa1}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ActionManagerTest">
<UniqueIdentifier>{580d9270-2425-4941-a977-19ba1bd90259}</UniqueIdentifier>
<UniqueIdentifier>{3b3b82c9-1257-4558-97f2-f3399fe6a765}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\LayerTest">
<UniqueIdentifier>{286b95b7-2676-4ad7-a087-670fc2c9eeb5}</UniqueIdentifier>
<UniqueIdentifier>{d6bc2dca-aca7-4c17-81c0-9833d8f3fc7e}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\SceneTest">
<UniqueIdentifier>{1d32d076-7281-4109-a6b5-55e4fbb35cf6}</UniqueIdentifier>
<UniqueIdentifier>{f31da793-e5cd-4be0-8073-4bc54801ae49}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ParallaxTest">
<UniqueIdentifier>{788f7771-109f-4799-8e1a-594463e2f078}</UniqueIdentifier>
<UniqueIdentifier>{eec876e8-73b5-45b5-a3fd-1c4c1b31abed}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\TileMapTest">
<UniqueIdentifier>{573b6ad6-9507-4123-8b89-9bb3306e64b9}</UniqueIdentifier>
<UniqueIdentifier>{977ab3f6-6c20-42c5-bb52-232c75c6f0b1}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\IntervalTest">
<UniqueIdentifier>{a8c4b0de-5f98-4e91-a90a-d073aa72cea1}</UniqueIdentifier>
<UniqueIdentifier>{6bf1ce70-b8b0-49de-9072-8a586f4abbf1}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\LabelTest">
<UniqueIdentifier>{d9262dd1-dbfb-44dc-96f4-caad50534493}</UniqueIdentifier>
<UniqueIdentifier>{d2e62e4c-f96e-4e47-858f-52944ac02384}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\SpriteTest">
<UniqueIdentifier>{57b8de1b-7456-42aa-84ba-2fd6968ecebf}</UniqueIdentifier>
<UniqueIdentifier>{d81167f0-05a1-487e-9e05-d423c84f1820}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\SchedulerTest">
<UniqueIdentifier>{42deb7b3-bcf7-45b5-af1d-7d8a2446d6a8}</UniqueIdentifier>
<UniqueIdentifier>{ad2a98bd-1438-4599-9ab7-edc789967c14}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\RenderTextureTest">
<UniqueIdentifier>{c488edbb-0efa-49bd-b11a-9fdd0e804c13}</UniqueIdentifier>
<UniqueIdentifier>{07d2c6d1-000b-4058-bebf-834fbcd0b669}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ChipmunkTest">
<UniqueIdentifier>{c3d97594-3aa5-4141-b15a-2bef2234715b}</UniqueIdentifier>
<UniqueIdentifier>{b65ffe13-d12e-4169-b239-678f8fe21bc0}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\Box2dTest">
<UniqueIdentifier>{b409c303-1741-4b63-9de6-9b7ba0272aca}</UniqueIdentifier>
<UniqueIdentifier>{1a93656d-5a2e-4d8e-b43b-505b274d5979}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\Box2DTestBed">
<UniqueIdentifier>{1ab75926-9b16-459f-b487-00718c5f0f1e}</UniqueIdentifier>
<UniqueIdentifier>{c0a0c51c-ec66-4c47-9009-7caf504319ab}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\Box2DTestBed\Tests">
<UniqueIdentifier>{17cbd28c-8ddf-4115-826d-260c8061cc89}</UniqueIdentifier>
<UniqueIdentifier>{9ad3df9f-fbb5-4cfa-96d3-987697e1e5cb}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\EffectsAdvancedTest">
<UniqueIdentifier>{a07ca7fd-87da-4f23-b730-5f13e3bebcb7}</UniqueIdentifier>
<UniqueIdentifier>{efce9243-e9b9-4f71-a15b-0e027c81ba6a}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\HiResTest">
<UniqueIdentifier>{468296d3-436a-43ee-b418-80264f03ee81}</UniqueIdentifier>
<UniqueIdentifier>{f9f96425-ba84-4bdb-b2ed-f26325916b2e}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\KeypadTest">
<UniqueIdentifier>{1e8965a5-84b4-4121-a9ee-35d9eeba7d55}</UniqueIdentifier>
<UniqueIdentifier>{d195e87a-d0de-4d1f-85fd-bab27fa87055}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\CocosDenshionTest">
<UniqueIdentifier>{5c7f2b12-3faa-4f4e-abef-eb69ea6ff064}</UniqueIdentifier>
<UniqueIdentifier>{7eec9749-c15a-4a03-9576-aab4c2635695}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\PerformanceTest">
<UniqueIdentifier>{631af586-68bb-471f-9a8d-d9314cf221db}</UniqueIdentifier>
<UniqueIdentifier>{af3d4541-fe03-42ba-9519-6b6e3191226f}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\ZwoptexTest">
<UniqueIdentifier>{d84b2f0f-e3c2-46e9-8f5a-c953ced5778a}</UniqueIdentifier>
<UniqueIdentifier>{b8563bde-8490-4201-be9f-c37d4338b54e}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\CurlTest">
<UniqueIdentifier>{b3b643b1-1883-4ccc-adbc-e32a4e46bebf}</UniqueIdentifier>
</Filter>
<Filter Include="classes\tests\TextInputTest">
<UniqueIdentifier>{3cbe9845-8408-4456-8928-00452f1e7cce}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
@ -306,6 +312,12 @@
<ClCompile Include="..\tests\ZwoptexTest\ZwoptexTest.cpp">
<Filter>classes\tests\ZwoptexTest</Filter>
</ClCompile>
<ClCompile Include="..\tests\CurlTest\CurlTest.cpp">
<Filter>classes\tests\CurlTest</Filter>
</ClCompile>
<ClCompile Include="..\tests\TextInputTest\TextInputTest.cpp">
<Filter>classes\tests\TextInputTest</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="main.h">
@ -566,5 +578,11 @@
<ClInclude Include="..\tests\ZwoptexTest\ZwoptexTest.h">
<Filter>classes\tests\ZwoptexTest</Filter>
</ClInclude>
<ClInclude Include="..\tests\CurlTest\CurlTest.h">
<Filter>classes\tests\CurlTest</Filter>
</ClInclude>
<ClInclude Include="..\tests\TextInputTest\TextInputTest.h">
<Filter>classes\tests\TextInputTest</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -1,2 +1,2 @@
mkdir ..\..\..\NEWPLUS\TDA_DATA\Data
xcopy /E /Y ..\Res\*.* ..\..\..\NEWPLUS\TDA_DATA\Data
mkdir ..\..\..\NEWPLUS\TG3\ConstData
xcopy /E /Y ..\Res\*.* ..\..\..\NEWPLUS\TG3\ConstData

View File

@ -444,9 +444,9 @@ void ChipmunkTestLayer::onEnter()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// portraint
glOrthof(-320/factor, 320/factor, -480/factor, 480/factor, -1.0f, 1.0f);
// glOrthof(-320/factor, 320/factor, -480/factor, 480/factor, -1.0f, 1.0f);
// landscape
// glOrthof(-480/factor, 480/factor, -320/factor, 320/factor, 1.0f, -1.0f);
glOrthof(-480/factor, 480/factor, -320/factor, 320/factor, 1.0f, -1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

View File

@ -1,4 +1,4 @@
//#define COCOS2D_DEBUG 1
// #define COCOS2D_DEBUG 1
#include "TextInputTest.h"
@ -8,20 +8,24 @@
enum
{
kTextFieldTTFTest,
kTextFieldTTFDefaultTest = 0,
kTextFieldTTFActionTest,
kTextInputTestsCount,
};
#define FONT_NAME "Thonburi"
#define FONT_SIZE 24
static int testIdx = -1;
KeyboardNotificationLayer* createTextInputTest(int nIndex)
{
switch(nIndex)
{
case kTextFieldTTFTest: return new TextFieldTTFTest();
case kTextFieldTTFDefaultTest: return new TextFieldTTFDefaultTest();
case kTextFieldTTFActionTest: return new TextFieldTTFActionTest();
default: return 0;
}
return NULL;
}
CCLayer* restartTextInputTest()
@ -128,7 +132,7 @@ void TextInputTest::onEnter()
addChild(l, 1);
l->setPosition(ccp(s.width/2, s.height-80));
}
#if 0
CCMenuItemImage *item1 = CCMenuItemImage::itemFromNormalImage("Images/b1.png", "Images/b2.png", this, menu_selector(TextInputTest::backCallback));
CCMenuItemImage *item2 = CCMenuItemImage::itemFromNormalImage("Images/r1.png","Images/r2.png", this, menu_selector(TextInputTest::restartCallback) );
CCMenuItemImage *item3 = CCMenuItemImage::itemFromNormalImage("Images/f1.png", "Images/f2.png", this, menu_selector(TextInputTest::nextCallback) );
@ -140,15 +144,6 @@ void TextInputTest::onEnter()
item3->setPosition(ccp( s.width/2 + 100,30));
addChild(menu, 1);
#endif
}
void TextInputTest::onExit()
{
if (m_pNotificationLayer)
{
m_pNotificationLayer->release();
}
}
//////////////////////////////////////////////////////////////////////////
@ -161,11 +156,6 @@ KeyboardNotificationLayer::KeyboardNotificationLayer()
setIsTouchEnabled(true);
}
std::string KeyboardNotificationLayer::subtitle()
{
return "";
}
void KeyboardNotificationLayer::registerWithTouchDispatcher()
{
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, 0, false);
@ -209,23 +199,121 @@ void KeyboardNotificationLayer::keyboardWillShow(CCIMEKeyboardNotificationInfo&
}
}
//////////////////////////////////////////////////////////////////////////
// implement TextFieldTTFTest
//////////////////////////////////////////////////////////////////////////
// CCLayer function
#define FONT_NAME "Thonburi"
#define FONT_SIZE 24
std::string TextFieldTTFTest::subtitle()
bool KeyboardNotificationLayer::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
{
return "CCTextFieldTTF test";
CCLOG("++++++++++++++++++++++++++++++++++++++++++++");
m_beginPos = pTouch->locationInView(pTouch->view());
m_beginPos = CCDirector::sharedDirector()->convertToGL(m_beginPos);
return true;
}
void TextFieldTTFTest::onEnter()
void KeyboardNotificationLayer::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent)
{
if (! m_pTrackNode)
{
return;
}
CCPoint endPos = pTouch->locationInView(pTouch->view());
endPos = CCDirector::sharedDirector()->convertToGL(endPos);
float delta = 5.0f;
if (::abs(endPos.x - m_beginPos.x) > delta
|| ::abs(endPos.y - m_beginPos.y) > delta)
{
// not click
m_beginPos.x = m_beginPos.y = -1;
return;
}
// decide the trackNode is clicked.
CCRect rect;
CCPoint point = convertTouchToNodeSpaceAR(pTouch);
CCLOG("KeyboardNotificationLayer:clickedAt(%f,%f)", point.x, point.y);
rect = getRect(m_pTrackNode);
CCLOG("KeyboardNotificationLayer:TrackNode at(origin:%f,%f, size:%f,%f)",
rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
this->onClickTrackNode(CCRect::CCRectContainsPoint(rect, point));
CCLOG("----------------------------------");
}
//////////////////////////////////////////////////////////////////////////
// implement TextFieldTTFDefaultTest
//////////////////////////////////////////////////////////////////////////
std::string TextFieldTTFDefaultTest::subtitle()
{
return "TextFieldTTF with default behavior test";
}
void TextFieldTTFDefaultTest::onClickTrackNode(bool bClicked)
{
CCTextFieldTTF * pTextField = (CCTextFieldTTF*)m_pTrackNode;
if (bClicked)
{
// TextFieldTTFTest be clicked
CCLOG("TextFieldTTFDefaultTest:CCTextFieldTTF attachWithIME");
pTextField->attachWithIME();
}
else
{
// TextFieldTTFTest not be clicked
CCLOG("TextFieldTTFDefaultTest:CCTextFieldTTF detachWithIME");
pTextField->detachWithIME();
}
}
void TextFieldTTFDefaultTest::onEnter()
{
KeyboardNotificationLayer::onEnter();
// add CCTextFieldTTF
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCTextFieldTTF * pTextField = CCTextFieldTTF::textFieldWithPlaceHolder("<click here for input>",
FONT_NAME,
FONT_SIZE);
addChild(pTextField);
pTextField->setPosition(ccp(s.width/2, s.height/2));
m_pTrackNode = pTextField;
}
//////////////////////////////////////////////////////////////////////////
// implement TextFieldTTFActionTest
//////////////////////////////////////////////////////////////////////////
std::string TextFieldTTFActionTest::subtitle()
{
return "CCTextFieldTTF with action and char limit test";
}
void TextFieldTTFActionTest::onClickTrackNode(bool bClicked)
{
CCTextFieldTTF * pTextField = (CCTextFieldTTF*)m_pTrackNode;
if (bClicked)
{
// TextFieldTTFTest be clicked
CCLOG("TextFieldTTFActionTest:CCTextFieldTTF attachWithIME");
pTextField->attachWithIME();
}
else
{
// TextFieldTTFTest not be clicked
CCLOG("TextFieldTTFActionTest:CCTextFieldTTF detachWithIME");
pTextField->detachWithIME();
}
}
void TextFieldTTFActionTest::onEnter()
{
KeyboardNotificationLayer::onEnter();
m_nSelected = -1;
m_nCharLimit = 10;
m_pTextFieldAction = CCRepeatForever::actionWithAction(
@ -240,106 +328,45 @@ void TextFieldTTFTest::onEnter()
// add CCTextFieldTTF
CCSize s = CCDirector::sharedDirector()->getWinSize();
m_pTextField[0] = CCTextFieldTTF::textFieldWithPlaceHolder("<CCTextFieldTTF with action>",
m_pTextField = CCTextFieldTTF::textFieldWithPlaceHolder("<click here for input>",
FONT_NAME,
FONT_SIZE);
addChild(m_pTextField[0]);
addChild(m_pTextField);
m_pTextField[0]->setDelegate(this);
m_pTextField[0]->setPosition(ccp(s.width/2, s.height/2 + 20));
m_pTextField->setDelegate(this);
m_pTextField->setPosition(ccp(s.width/2, s.height/2 + 20));
m_pTextField[1] = CCTextFieldTTF::textFieldWithPlaceHolder("<CCTextFieldTTF as default>",
FONT_NAME,
FONT_SIZE);
addChild(m_pTextField[1]);
m_pTextField[1]->setPosition(ccp(s.width/2, s.height/2 - 20));
m_pTrackNode = m_pTextField;
}
void TextFieldTTFTest::onExit()
void TextFieldTTFActionTest::onExit()
{
m_pTextFieldAction->release();
}
bool TextFieldTTFTest::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
{
m_beginPos = pTouch->locationInView(pTouch->view());
m_beginPos = CCDirector::sharedDirector()->convertToGL(m_beginPos);
return true;
}
void TextFieldTTFTest::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent)
{
CCPoint endPos = pTouch->locationInView(pTouch->view());
endPos = CCDirector::sharedDirector()->convertToGL(endPos);
float delta = 5.0f;
if (::abs(endPos.x - m_beginPos.x) > delta
|| ::abs(endPos.y - m_beginPos.y) > delta)
{
// not click
m_beginPos.x = m_beginPos.y = -1;
return;
}
// decide the index of CCTextFieldTTF which is clicked.
int index = 0;
CCRect rect;
CCPoint point = convertTouchToNodeSpaceAR(pTouch);
CCLOG("TextFieldTTFTest:clickedAt(%f,%f)", point.x, point.y);
for (; index < sizeof(m_pTextField) / sizeof(CCTextFieldTTF *); ++index)
{
rect = getRect(m_pTextField[index]);
CCLOG("TextFieldTTFTest:CCTextFieldTTF[%d]at(origin:%f,%f, size:%f,%f)",
index, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
if (CCRect::CCRectContainsPoint(rect, point))
{
break;
}
}
if (m_nSelected >= 0)
{
// hide the keyboard
CCLOG("TextFieldTTFTest:CCTextFieldTTF[%d]detachWithIME", m_nSelected);
m_pTextField[m_nSelected]->detachWithIME();
m_nSelected = -1;
m_pTrackNode = 0;
}
if (index < sizeof(m_pTextField) / sizeof(CCTextFieldTTF *))
{
CCLOG("TextFieldTTFTest:CCTextFieldTTF[%d]attachWithIME", index);
m_nSelected = index;
m_pTrackNode = m_pTextField[index];
m_pTextField[index]->attachWithIME();
}
}
// CCTextFieldDelegate protocol
bool TextFieldTTFTest::onTextFieldAttachWithIME(CCTextFieldTTF * pSender)
bool TextFieldTTFActionTest::onTextFieldAttachWithIME(CCTextFieldTTF * pSender)
{
if (! m_bAction)
{
m_pTextField[0]->runAction(m_pTextFieldAction);
m_pTextField->runAction(m_pTextFieldAction);
m_bAction = true;
}
return false;
}
bool TextFieldTTFTest::onTextFieldDetachWithIME(CCTextFieldTTF * pSender)
bool TextFieldTTFActionTest::onTextFieldDetachWithIME(CCTextFieldTTF * pSender)
{
if (m_bAction)
{
m_pTextField[0]->stopAction(m_pTextFieldAction);
m_pTextField[0]->setOpacity(255);
m_pTextField->stopAction(m_pTextFieldAction);
m_pTextField->setOpacity(255);
m_bAction = false;
}
return false;
}
bool TextFieldTTFTest::onTextFieldInsertText(CCTextFieldTTF * pSender, const char * text, int nLen)
bool TextFieldTTFActionTest::onTextFieldInsertText(CCTextFieldTTF * pSender, const char * text, int nLen)
{
// if the textfield's char count more than m_nCharLimit, doesn't insert text anymore.
if (pSender->getCharCount() >= m_nCharLimit)
@ -378,13 +405,13 @@ bool TextFieldTTFTest::onTextFieldInsertText(CCTextFieldTTF * pSender, const cha
CCScaleTo::actionWithDuration(duration, 1),
CCFadeOut::actionWithDuration(duration),
0),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(TextFieldTTFTest::callbackRemoveNodeWhenDidAction)),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction)),
0);
label->runAction(seq);
return false;
}
bool TextFieldTTFTest::onTextFieldDeleteBackward(CCTextFieldTTF * pSender, const char * delText, int nLen)
bool TextFieldTTFActionTest::onTextFieldDeleteBackward(CCTextFieldTTF * pSender, const char * delText, int nLen)
{
// create a delete text sprite and do some action
CCLabelTTF * label = CCLabelTTF::labelWithString(delText, FONT_NAME, FONT_SIZE);
@ -412,18 +439,18 @@ bool TextFieldTTFTest::onTextFieldDeleteBackward(CCTextFieldTTF * pSender, const
repeatTime),
CCFadeOut::actionWithDuration(duration),
0),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(TextFieldTTFTest::callbackRemoveNodeWhenDidAction)),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction)),
0);
label->runAction(seq);
return false;
}
bool TextFieldTTFTest::onDraw(CCTextFieldTTF * pSender)
bool TextFieldTTFActionTest::onDraw(CCTextFieldTTF * pSender)
{
return false;
}
void TextFieldTTFTest::callbackRemoveNodeWhenDidAction(CCNode * pNode)
void TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction(CCNode * pNode)
{
this->removeChild(pNode, true);
}

View File

@ -5,7 +5,10 @@
class KeyboardNotificationLayer;
class TextInputTest : public CCLayer, public CCIMEDelegate
/**
@brief TextInputTest for retain prev, reset, next, main menu buttons.
*/
class TextInputTest : public CCLayer
{
KeyboardNotificationLayer * m_pNotificationLayer;
public:
@ -19,39 +22,68 @@ public:
void addKeyboardNotificationLayer(KeyboardNotificationLayer * pLayer);
virtual void onEnter();
virtual void onExit();
};
//////////////////////////////////////////////////////////////////////////
// KeyboardNotificationLayer for test IME keyboard notification.
//////////////////////////////////////////////////////////////////////////
class KeyboardNotificationLayer : public CCLayer, public CCIMEDelegate
{
public:
KeyboardNotificationLayer();
virtual std::string subtitle();
virtual std::string subtitle() = 0;
virtual void onClickTrackNode(bool bClicked) = 0;
virtual void registerWithTouchDispatcher();
virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo& info);
// CCLayer
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
protected:
CCNode * m_pTrackNode;
CCPoint m_beginPos;
};
class TextFieldTTFTest : public KeyboardNotificationLayer, public CCTextFieldDelegate
//////////////////////////////////////////////////////////////////////////
// TextFieldTTFDefaultTest for test TextFieldTTF default behavior.
//////////////////////////////////////////////////////////////////////////
class TextFieldTTFDefaultTest : public KeyboardNotificationLayer
{
CCPoint m_beginPos;
CCTextFieldTTF * m_pTextField[2];
public:
// KeyboardNotificationLayer
virtual std::string subtitle();
virtual void onClickTrackNode(bool bClicked);
// CCLayer
virtual void onEnter();
};
//////////////////////////////////////////////////////////////////////////
// TextFieldTTFActionTest
//////////////////////////////////////////////////////////////////////////
class TextFieldTTFActionTest : public KeyboardNotificationLayer, public CCTextFieldDelegate
{
CCTextFieldTTF * m_pTextField;
CCAction * m_pTextFieldAction;
bool m_bAction;
int m_nSelected;
int m_nCharLimit; // the textfield max char limit
public:
void callbackRemoveNodeWhenDidAction(CCNode * pNode);
// KeyboardNotificationLayer
virtual std::string subtitle();
virtual void onClickTrackNode(bool bClicked);
// CCLayer
virtual void onEnter();
virtual void onExit();
virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
// CCTextFieldDelegate
virtual bool onTextFieldAttachWithIME(CCTextFieldTTF * pSender);
@ -59,8 +91,6 @@ public:
virtual bool onTextFieldInsertText(CCTextFieldTTF * pSender, const char * text, int nLen);
virtual bool onTextFieldDeleteBackward(CCTextFieldTTF * pSender, const char * delText, int nLen);
virtual bool onDraw(CCTextFieldTTF * pSender);
void callbackRemoveNodeWhenDidAction(CCNode * pNode);
};
class TextInputTestScene : public TestScene

View File

@ -17,6 +17,8 @@ static void ChangeOrientation(ccDeviceOrientation eOrientation)
static TestScene* CreateTestScene(int nIdx)
{
CCDirector::sharedDirector()->purgeCachedData();
// change to default orientation
ChangeOrientation(CCDeviceOrientationPortrait);
@ -65,12 +67,10 @@ static TestScene* CreateTestScene(int nIdx)
pScene = new IntervalTestScene(); break;
case TEST_CHIPMUNK:
#if (CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY)
ChangeOrientation(CCDeviceOrientationLandscapeLeft);
pScene = new ChipmunkTestScene(); break;
#else
#ifdef AIRPLAYUSECHIPMUNK
#if (AIRPLAYUSECHIPMUNK == 1)
ChangeOrientation(CCDeviceOrientationLandscapeLeft);
pScene = new ChipmunkTestScene(); break;
#endif
#endif