diff --git a/CocosDenshion/airplay/SimpleAudioEngine.cpp b/CocosDenshion/airplay/SimpleAudioEngine.cpp index 8f35a2a729..9509163bf2 100644 --- a/CocosDenshion/airplay/SimpleAudioEngine.cpp +++ b/CocosDenshion/airplay/SimpleAudioEngine.cpp @@ -67,7 +67,7 @@ namespace CocosDenshion s3eFreeBase(g_AudioBuffer); } - void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath) + void SimpleAudioEngine::setResource(const char* pszZipFileName) { } diff --git a/CocosDenshion/android/SimpleAudioEngine.cpp b/CocosDenshion/android/SimpleAudioEngine.cpp index a4072864b5..8315197b5f 100644 --- a/CocosDenshion/android/SimpleAudioEngine.cpp +++ b/CocosDenshion/android/SimpleAudioEngine.cpp @@ -54,7 +54,7 @@ namespace CocosDenshion endJNI(); } - void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath) + void SimpleAudioEngine::setResource(const char* pszZipFileName) { } diff --git a/CocosDenshion/include/SimpleAudioEngine.h b/CocosDenshion/include/SimpleAudioEngine.h index 6d4cc46c65..54278b8592 100644 --- a/CocosDenshion/include/SimpleAudioEngine.h +++ b/CocosDenshion/include/SimpleAudioEngine.h @@ -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 diff --git a/CocosDenshion/iphone/SimpleAudioEngine.mm b/CocosDenshion/iphone/SimpleAudioEngine.mm index 77c47a2d70..c90afa8544 100644 --- a/CocosDenshion/iphone/SimpleAudioEngine.mm +++ b/CocosDenshion/iphone/SimpleAudioEngine.mm @@ -145,7 +145,7 @@ namespace CocosDenshion static_end(); } - void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath) + void SimpleAudioEngine::setResource(const char* pszZipFileName) { } diff --git a/CocosDenshion/win32/SimpleAudioEngine.cpp b/CocosDenshion/win32/SimpleAudioEngine.cpp index 54cd9bca90..fd8b9bb3e6 100644 --- a/CocosDenshion/win32/SimpleAudioEngine.cpp +++ b/CocosDenshion/win32/SimpleAudioEngine.cpp @@ -54,7 +54,7 @@ void SimpleAudioEngine::end() return; } -void SimpleAudioEngine::setResource(const char* pszZipFileName, const char* pszResPath) +void SimpleAudioEngine::setResource(const char* pszZipFileName) { } diff --git a/CocosDenshion/wophone/FileUtils.cpp b/CocosDenshion/wophone/FileUtils.cpp index e2ae3f8a95..fe1e844044 100644 --- a/CocosDenshion/wophone/FileUtils.cpp +++ b/CocosDenshion/wophone/FileUtils.cpp @@ -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; diff --git a/CocosDenshion/wophone/FileUtils.h b/CocosDenshion/wophone/FileUtils.h index 6b8fb97011..f85f2ad4d9 100644 --- a/CocosDenshion/wophone/FileUtils.h +++ b/CocosDenshion/wophone/FileUtils.h @@ -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 diff --git a/CocosDenshion/wophone/SimpleAudioEngine.cpp b/CocosDenshion/wophone/SimpleAudioEngine.cpp index 83e4ab6ada..08dabe0140 100644 --- a/CocosDenshion/wophone/SimpleAudioEngine.cpp +++ b/CocosDenshion/wophone/SimpleAudioEngine.cpp @@ -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) diff --git a/HelloWorld/wophone/HelloWorld.wophone.vcproj b/HelloWorld/wophone/HelloWorld.wophone.vcproj index a15754e082..df49101be9 100644 --- a/HelloWorld/wophone/HelloWorld.wophone.vcproj +++ b/HelloWorld/wophone/HelloWorld.wophone.vcproj @@ -97,7 +97,7 @@ /> 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 diff --git a/cocos2dx/platform/wophone/CCApplication_wophone.cpp b/cocos2dx/platform/wophone/CCApplication_wophone.cpp index cd33ff2f56..061a675cc8 100644 --- a/cocos2dx/platform/wophone/CCApplication_wophone.cpp +++ b/cocos2dx/platform/wophone/CCApplication_wophone.cpp @@ -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(); diff --git a/cocos2dx/proj.win32/cocos2d-win32.vcxproj b/cocos2dx/proj.win32/cocos2d-win32.vcxproj index 34576c20fb..5b68e64e60 100644 --- a/cocos2dx/proj.win32/cocos2d-win32.vcxproj +++ b/cocos2dx/proj.win32/cocos2d-win32.vcxproj @@ -1,347 +1,348 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - libcocos2d - {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} - cocos2d-x.win32 - Win32Proj - - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - AllRules.ruleset - - - AllRules.ruleset - - - - - - - - - - Disabled - $(SolutionDir)\cocos2dx\platform;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\include;..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4996;4267;%(DisableSpecificWarnings) - - + + + + + Debug + Win32 + + + Release + Win32 + + + + libcocos2d + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} + cocos2d-x.win32 + Win32Proj + + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + true + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + true + AllRules.ruleset + + + AllRules.ruleset + + + + + + + + + + Disabled + $(SolutionDir)\cocos2dx\platform;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\include;..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4996;4267;%(DisableSpecificWarnings) + + if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$(OutDir)" - - - libEGL.lib;libgles_cm.lib;libxml2.lib;libzlib.lib;libpng.lib;libjpeg.lib;libiconv.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - false - ;%(IgnoreSpecificDefaultLibraries) - true - Windows - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - - - - - - - - - $(SolutionDir)\cocos2dx\platform;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\include;..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - 4996;4267;%(DisableSpecificWarnings) - - +xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$(OutDir)" + + + libEGL.lib;libgles_cm.lib;libxml2.lib;libzlib.lib;libpng.lib;libjpeg.lib;libiconv.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + $(OutDir);%(AdditionalLibraryDirectories) + false + ;%(IgnoreSpecificDefaultLibraries) + true + Windows + $(TargetDir)$(TargetName).lib + MachineX86 + + + + + + + + + + + + + $(SolutionDir)\cocos2dx\platform;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;..\include;..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + 4996;4267;%(DisableSpecificWarnings) + + if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$(OutDir)" - - - libEGL.lib;libgles_cm.lib;libxml2.lib;libzlib.lib;libpng.lib;libjpeg.lib;libiconv.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).dll - $(OutDir);%(AdditionalLibraryDirectories) - ;%(IgnoreSpecificDefaultLibraries) - true - Windows - true - true - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +xcopy /Y /Q "$(SolutionDir)cocos2dx\platform\third_party\win32\libraries\*.*" "$(OutDir)" + + + libEGL.lib;libgles_cm.lib;libxml2.lib;libzlib.lib;libpng.lib;libjpeg.lib;libiconv.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + $(OutDir);%(AdditionalLibraryDirectories) + ;%(IgnoreSpecificDefaultLibraries) + true + Windows + true + true + $(TargetDir)$(TargetName).lib + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters b/cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters index 2c871b8e23..14fc7e80ad 100644 --- a/cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters +++ b/cocos2dx/proj.win32/cocos2d-win32.vcxproj.filters @@ -1,702 +1,703 @@ - - - - - {7714c41e-f26c-4eca-a28b-c2e8828399df} - - - {b8713560-2596-4f18-a53c-a1ae7304c719} - - - {87fd26d2-f23e-46f8-b369-e01c20d4f668} - - - {46467c38-3c10-4176-a8b0-e60bd32fe588} - - - {e4b0d401-1832-4fb5-ab90-a211d7ce92ca} - - - {b0e87eea-097f-486a-8d6c-a71682e1eb25} - - - {f91e3ad0-f275-4744-bdd2-79645fc82493} - - - {b1c5aeb6-8793-442d-a15d-6a094f182b4c} - - - {fa8daed2-7c4e-43b5-b635-7b226f101e8c} - - - {f26b71ad-1a9e-4d0c-97bc-7c5e95be32b4} - - - {b2c227b0-edb3-49fc-b11c-e03b3ef8d5e0} - - - {1d71811a-3685-434f-b10e-d580377f1af6} - - - {c4322f73-5058-41f6-913b-18db9aa1dfba} - - - {c2f97472-1254-4e99-9778-0e6c7674e390} - - - {7776f8b7-b04e-4bd1-b356-695134f3927f} - - - {18d327b4-acaf-4421-b683-9837d92b5488} - - - {3e1780b2-6a4d-48f0-90ca-e4e0d2613978} - - - {022561bf-a9f5-4d03-b3d3-5178fe3ed572} - - - {a7e15d3b-0c81-4444-aca0-3d0ede9e2669} - - - {0cb1e8a6-13ea-4681-a5c8-899a9efb0440} - - - {b7e6a4ee-f78a-4399-8f56-526294bf8580} - - - {1b2d8814-d294-4657-be38-4f6d904ad475} - - - - - base_nodes - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - effects - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - label_nodes - - - label_nodes - - - label_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform\win32 - - - platform\win32 - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - support - - - support - - - support - - - support - - - support - - - support\image_support - - - support\zip_support - - - support\zip_support - - - support\zip_support - - - textures - - - textures - - - textures - - - textures - - - tileMap_parallax_nodes - - - tileMap_parallax_nodes - - - tileMap_parallax_nodes - - - tileMap_parallax_nodes - - - tileMap_parallax_nodes - - - tileMap_parallax_nodes - - - touch_dispatcher - - - touch_dispatcher - - - keypad_dispatcher - - - keypad_dispatcher - - - event_dispatcher - - - event_dispatcher - - - event_dispatcher - - - - - - - - platform - - - platform - - - cocoa - - - - - effects - - - effects - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - support - - - support - - - support - - - support - - - support\data_support - - - support\data_support - - - support\data_support - - - support\image_support - - - support\zip_support - - - support\zip_support - - - support\zip_support - - - touch_dispatcher - - - - platform - - - platform - - - cocoa - - + + + + + {7714c41e-f26c-4eca-a28b-c2e8828399df} + + + {b8713560-2596-4f18-a53c-a1ae7304c719} + + + {87fd26d2-f23e-46f8-b369-e01c20d4f668} + + + {46467c38-3c10-4176-a8b0-e60bd32fe588} + + + {e4b0d401-1832-4fb5-ab90-a211d7ce92ca} + + + {b0e87eea-097f-486a-8d6c-a71682e1eb25} + + + {f91e3ad0-f275-4744-bdd2-79645fc82493} + + + {b1c5aeb6-8793-442d-a15d-6a094f182b4c} + + + {fa8daed2-7c4e-43b5-b635-7b226f101e8c} + + + {f26b71ad-1a9e-4d0c-97bc-7c5e95be32b4} + + + {b2c227b0-edb3-49fc-b11c-e03b3ef8d5e0} + + + {1d71811a-3685-434f-b10e-d580377f1af6} + + + {c4322f73-5058-41f6-913b-18db9aa1dfba} + + + {c2f97472-1254-4e99-9778-0e6c7674e390} + + + {7776f8b7-b04e-4bd1-b356-695134f3927f} + + + {18d327b4-acaf-4421-b683-9837d92b5488} + + + {3e1780b2-6a4d-48f0-90ca-e4e0d2613978} + + + {022561bf-a9f5-4d03-b3d3-5178fe3ed572} + + + {a7e15d3b-0c81-4444-aca0-3d0ede9e2669} + + + {0cb1e8a6-13ea-4681-a5c8-899a9efb0440} + + + {b7e6a4ee-f78a-4399-8f56-526294bf8580} + + + {2bb0e4ec-d798-44ec-bc81-c7f7bfc90391} + + + + + base_nodes + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + effects + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + label_nodes + + + label_nodes + + + label_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + menu_nodes + + + misc_nodes + + + misc_nodes + + + misc_nodes + + + misc_nodes + + + particle_nodes + + + particle_nodes + + + particle_nodes + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform\win32 + + + platform\win32 + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + support + + + support + + + support + + + support + + + support + + + support\image_support + + + support\zip_support + + + support\zip_support + + + support\zip_support + + + textures + + + textures + + + textures + + + textures + + + tileMap_parallax_nodes + + + tileMap_parallax_nodes + + + tileMap_parallax_nodes + + + tileMap_parallax_nodes + + + tileMap_parallax_nodes + + + tileMap_parallax_nodes + + + touch_dispatcher + + + touch_dispatcher + + + keypad_dispatcher + + + keypad_dispatcher + + + + + + + + platform + + + platform + + + cocoa + + + test_input_node + + + test_input_node + + + base_nodes + + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + particle_nodes + + + support + + + effects + + + menu_nodes + + + + + effects + + + effects + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + support + + + support + + + support + + + support + + + support\data_support + + + support\data_support + + + support\data_support + + + support\image_support + + + support\zip_support + + + support\zip_support + + + support\zip_support + + + touch_dispatcher + + + + platform + + + platform + + + cocoa + + + include + + + include + + + include + + \ No newline at end of file diff --git a/template/msvc/CCAppWiz.wophone/Scripts/1033/default.js b/template/msvc/CCAppWiz.wophone/Scripts/1033/default.js index ca2dc61bc3..4b1a2992d7 100644 --- a/template/msvc/CCAppWiz.wophone/Scripts/1033/default.js +++ b/template/msvc/CCAppWiz.wophone/Scripts/1033/default.js @@ -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; diff --git a/tests/test.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id b/tests/test.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id index ed257015c8..19bd314dea 100644 --- a/tests/test.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/tests/test.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -269f9caa1380bc1e08175decedc54e5216e425ed \ No newline at end of file +b7c09f3e759444e6da344ba829bac49f6742d22d \ No newline at end of file diff --git a/tests/test.win32/test.win32.vcproj b/tests/test.win32/test.win32.vcproj index c5198b3770..948c8dcd08 100644 --- a/tests/test.win32/test.win32.vcproj +++ b/tests/test.win32/test.win32.vcproj @@ -120,7 +120,7 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - 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=""$(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";..\;.\" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -140,7 +140,7 @@ /> - - - - Debug - Win32 - - - Release - Win32 - - - - tests - {76A39BB2-9B84-4C65-98A5-654D86B86F2A} - test_win32 - Win32Proj - - - - Application - Unicode - true - - - Application - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - $(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) - WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4244;4996;%(DisableSpecificWarnings) - - - libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - copy_res.bat "$(OutDir)" - - - - - MaxSpeed - true - $(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) - WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4244;4996;%(DisableSpecificWarnings) - - - libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - copy_res.bat "$(OutDir)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {929480e7-23c0-4df6-8456-096d71547116} - false - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - false - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - false - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + tests + {76A39BB2-9B84-4C65-98A5-654D86B86F2A} + test_win32 + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + true + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + $(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) + WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4244;4996;%(DisableSpecificWarnings) + + + libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;libCocosDenshion.lib;libcurl_imp.lib;libcurl_imp.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + copy_res.bat "$(OutDir)" + + + + + MaxSpeed + true + $(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) + WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + 4244;4996;%(DisableSpecificWarnings) + + + libcocos2d.lib;libgles_cm.lib;libBox2d.lib;libchipmunk.lib;libCocosDenshion.lib;libcurl_imp.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + true + true + MachineX86 + + + copy_res.bat "$(OutDir)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/test.win32/test.win32.vcxproj.filters b/tests/test.win32/test.win32.vcxproj.filters index c9b2884f0b..0f154d5c42 100644 --- a/tests/test.win32/test.win32.vcxproj.filters +++ b/tests/test.win32/test.win32.vcxproj.filters @@ -1,570 +1,588 @@ - - - - - {2cec4d5a-4891-4389-89d2-ba9378e256f7} - - - {faa8929c-ade9-471b-9c80-56831406176c} - - - {5ba42913-895a-4779-8213-bfc0ec797e90} - - - {64f7afe1-c2ad-4fcd-8513-198339885f03} - - - {9bd3d520-87d0-4675-9d3c-a4c7a0c06326} - - - {17ae5ce8-b14d-463d-a0b8-a3b1859e9247} - - - {d0d49daf-d65e-4fe3-a9e9-7fbe7dcc7cf6} - - - {a2aa5794-8ba0-488e-a6fa-8347b186fb9a} - - - {1ca5bba5-501c-46f5-987d-9a3533862c5a} - - - {e335751b-5dcb-4eec-99b1-d6ad22f41283} - - - {5d5f105c-4606-4ff3-8c2c-fa40c97c7455} - - - {dc9fbea5-0e82-4a63-a9ad-40b6d17d4b2e} - - - {2f2bbcff-0476-4ea7-ab87-a28db650f8a3} - - - {92d7fa0a-f213-4eb5-b151-ff5306f75f13} - - - {47db567d-8983-42a2-a1c5-2120481917ec} - - - {23eb4bf9-4c4a-4c6b-9145-48f40e70d3ea} - - - {580d9270-2425-4941-a977-19ba1bd90259} - - - {286b95b7-2676-4ad7-a087-670fc2c9eeb5} - - - {1d32d076-7281-4109-a6b5-55e4fbb35cf6} - - - {788f7771-109f-4799-8e1a-594463e2f078} - - - {573b6ad6-9507-4123-8b89-9bb3306e64b9} - - - {a8c4b0de-5f98-4e91-a90a-d073aa72cea1} - - - {d9262dd1-dbfb-44dc-96f4-caad50534493} - - - {57b8de1b-7456-42aa-84ba-2fd6968ecebf} - - - {42deb7b3-bcf7-45b5-af1d-7d8a2446d6a8} - - - {c488edbb-0efa-49bd-b11a-9fdd0e804c13} - - - {c3d97594-3aa5-4141-b15a-2bef2234715b} - - - {b409c303-1741-4b63-9de6-9b7ba0272aca} - - - {1ab75926-9b16-459f-b487-00718c5f0f1e} - - - {17cbd28c-8ddf-4115-826d-260c8061cc89} - - - {a07ca7fd-87da-4f23-b730-5f13e3bebcb7} - - - {468296d3-436a-43ee-b418-80264f03ee81} - - - {1e8965a5-84b4-4121-a9ee-35d9eeba7d55} - - - {5c7f2b12-3faa-4f4e-abef-eb69ea6ff064} - - - {631af586-68bb-471f-9a8d-d9314cf221db} - - - {d84b2f0f-e3c2-46e9-8f5a-c953ced5778a} - - - - - win32 - - - classes - - - classes\tests - - - classes\tests - - - classes\tests\ActionsTest - - - classes\tests\TransitionsTest - - - classes\tests\ProgressActionsTest - - - classes\tests\EffectsTest - - - classes\tests\ClickAndMoveTest - - - classes\tests\RotateWorldTest - - - classes\tests\ParticleTest - - - classes\tests\EaseActionsTest - - - classes\tests\MotionStreakTest - - - classes\tests\DrawPrimitivesTest - - - classes\tests\CocosNodeTest - - - classes\tests\TouchesTest - - - classes\tests\TouchesTest - - - classes\tests\TouchesTest - - - classes\tests\MenuTest - - - classes\tests\ActionManagerTest - - - classes\tests\LayerTest - - - classes\tests\SceneTest - - - classes\tests\ParallaxTest - - - classes\tests\TileMapTest - - - classes\tests\IntervalTest - - - classes\tests\LabelTest - - - classes\tests\SpriteTest - - - classes\tests\SchedulerTest - - - classes\tests\RenderTextureTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\Box2dTest - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed - - - classes\tests\EffectsAdvancedTest - - - classes\tests\HiResTest - - - classes\tests\KeypadTest - - - classes\tests\CocosDenshionTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\ZwoptexTest - - - - - win32 - - - classes - - - classes\tests - - - classes\tests - - - classes\tests - - - classes\tests - - - classes\tests\ActionsTest - - - classes\tests\TransitionsTest - - - classes\tests\ProgressActionsTest - - - classes\tests\EffectsTest - - - classes\tests\ClickAndMoveTest - - - classes\tests\RotateWorldTest - - - classes\tests\ParticleTest - - - classes\tests\EaseActionsTest - - - classes\tests\MotionStreakTest - - - classes\tests\DrawPrimitivesTest - - - classes\tests\CocosNodeTest - - - classes\tests\TouchesTest - - - classes\tests\TouchesTest - - - classes\tests\TouchesTest - - - classes\tests\MenuTest - - - classes\tests\ActionManagerTest - - - classes\tests\LayerTest - - - classes\tests\SceneTest - - - classes\tests\ParallaxTest - - - classes\tests\TileMapTest - - - classes\tests\IntervalTest - - - classes\tests\LabelTest - - - classes\tests\SpriteTest - - - classes\tests\SchedulerTest - - - classes\tests\RenderTextureTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\ChipmunkTest - - - classes\tests\Box2dTest - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\Box2DTestBed\Tests - - - classes\tests\EffectsAdvancedTest - - - classes\tests\HiResTest - - - classes\tests\KeypadTest - - - classes\tests\CocosDenshionTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\PerformanceTest - - - classes\tests\ZwoptexTest - - + + + + + {a024fc4a-f920-4162-9a80-03a48e447a41} + + + {7f2a1cbd-ab5c-465f-b9e2-65da3f0b14b1} + + + {0562cf43-75dd-48e8-8ba4-f98f90f5a19b} + + + {652f9b28-0000-4a5f-824e-6c5f432476ba} + + + {edb8b03e-23d6-43e7-9d7c-e8bf2202e6b5} + + + {d74d5794-fb61-4d73-93c5-4eec3b3af02a} + + + {194ea888-f365-466b-8b4b-cde9a6b631af} + + + {4c291544-ce87-455f-8435-6fdcbcad44db} + + + {51d48b68-cd80-4a8c-a72f-a672a5bd9dea} + + + {00aa431d-cb15-4280-807d-e3d25dcf78f8} + + + {cc0a3cab-a5bc-4a28-b6f1-b88eb9eedc10} + + + {55c800ad-1f34-4fc7-9a02-80eae274f756} + + + {2e10e902-0172-4a92-8370-861f6e92c9ae} + + + {359a2bac-0a6a-4d22-b6f4-f9a50f1255d2} + + + {87dbf085-eef3-4dd9-b748-61d0061accff} + + + {75d90a2e-0c23-4095-98cb-b83008e54fa1} + + + {3b3b82c9-1257-4558-97f2-f3399fe6a765} + + + {d6bc2dca-aca7-4c17-81c0-9833d8f3fc7e} + + + {f31da793-e5cd-4be0-8073-4bc54801ae49} + + + {eec876e8-73b5-45b5-a3fd-1c4c1b31abed} + + + {977ab3f6-6c20-42c5-bb52-232c75c6f0b1} + + + {6bf1ce70-b8b0-49de-9072-8a586f4abbf1} + + + {d2e62e4c-f96e-4e47-858f-52944ac02384} + + + {d81167f0-05a1-487e-9e05-d423c84f1820} + + + {ad2a98bd-1438-4599-9ab7-edc789967c14} + + + {07d2c6d1-000b-4058-bebf-834fbcd0b669} + + + {b65ffe13-d12e-4169-b239-678f8fe21bc0} + + + {1a93656d-5a2e-4d8e-b43b-505b274d5979} + + + {c0a0c51c-ec66-4c47-9009-7caf504319ab} + + + {9ad3df9f-fbb5-4cfa-96d3-987697e1e5cb} + + + {efce9243-e9b9-4f71-a15b-0e027c81ba6a} + + + {f9f96425-ba84-4bdb-b2ed-f26325916b2e} + + + {d195e87a-d0de-4d1f-85fd-bab27fa87055} + + + {7eec9749-c15a-4a03-9576-aab4c2635695} + + + {af3d4541-fe03-42ba-9519-6b6e3191226f} + + + {b8563bde-8490-4201-be9f-c37d4338b54e} + + + {b3b643b1-1883-4ccc-adbc-e32a4e46bebf} + + + {3cbe9845-8408-4456-8928-00452f1e7cce} + + + + + win32 + + + classes + + + classes\tests + + + classes\tests + + + classes\tests\ActionsTest + + + classes\tests\TransitionsTest + + + classes\tests\ProgressActionsTest + + + classes\tests\EffectsTest + + + classes\tests\ClickAndMoveTest + + + classes\tests\RotateWorldTest + + + classes\tests\ParticleTest + + + classes\tests\EaseActionsTest + + + classes\tests\MotionStreakTest + + + classes\tests\DrawPrimitivesTest + + + classes\tests\CocosNodeTest + + + classes\tests\TouchesTest + + + classes\tests\TouchesTest + + + classes\tests\TouchesTest + + + classes\tests\MenuTest + + + classes\tests\ActionManagerTest + + + classes\tests\LayerTest + + + classes\tests\SceneTest + + + classes\tests\ParallaxTest + + + classes\tests\TileMapTest + + + classes\tests\IntervalTest + + + classes\tests\LabelTest + + + classes\tests\SpriteTest + + + classes\tests\SchedulerTest + + + classes\tests\RenderTextureTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\Box2dTest + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed + + + classes\tests\EffectsAdvancedTest + + + classes\tests\HiResTest + + + classes\tests\KeypadTest + + + classes\tests\CocosDenshionTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\ZwoptexTest + + + classes\tests\CurlTest + + + classes\tests\TextInputTest + + + + + win32 + + + classes + + + classes\tests + + + classes\tests + + + classes\tests + + + classes\tests + + + classes\tests\ActionsTest + + + classes\tests\TransitionsTest + + + classes\tests\ProgressActionsTest + + + classes\tests\EffectsTest + + + classes\tests\ClickAndMoveTest + + + classes\tests\RotateWorldTest + + + classes\tests\ParticleTest + + + classes\tests\EaseActionsTest + + + classes\tests\MotionStreakTest + + + classes\tests\DrawPrimitivesTest + + + classes\tests\CocosNodeTest + + + classes\tests\TouchesTest + + + classes\tests\TouchesTest + + + classes\tests\TouchesTest + + + classes\tests\MenuTest + + + classes\tests\ActionManagerTest + + + classes\tests\LayerTest + + + classes\tests\SceneTest + + + classes\tests\ParallaxTest + + + classes\tests\TileMapTest + + + classes\tests\IntervalTest + + + classes\tests\LabelTest + + + classes\tests\SpriteTest + + + classes\tests\SchedulerTest + + + classes\tests\RenderTextureTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\ChipmunkTest + + + classes\tests\Box2dTest + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\Box2DTestBed\Tests + + + classes\tests\EffectsAdvancedTest + + + classes\tests\HiResTest + + + classes\tests\KeypadTest + + + classes\tests\CocosDenshionTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\PerformanceTest + + + classes\tests\ZwoptexTest + + + classes\tests\CurlTest + + + classes\tests\TextInputTest + + \ No newline at end of file diff --git a/tests/test.wophone/copy_res.bat b/tests/test.wophone/copy_res.bat index 25ef81e50e..dd26522164 100644 --- a/tests/test.wophone/copy_res.bat +++ b/tests/test.wophone/copy_res.bat @@ -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 diff --git a/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp b/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp index f3c73c8836..5538ff1469 100644 --- a/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp +++ b/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp @@ -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(); diff --git a/tests/tests/TextInputTest/TextInputTest.cpp b/tests/tests/TextInputTest/TextInputTest.cpp index 86412c0288..f3c7010381 100644 --- a/tests/tests/TextInputTest/TextInputTest.cpp +++ b/tests/tests/TextInputTest/TextInputTest.cpp @@ -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("", + 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("", + m_pTextField = CCTextFieldTTF::textFieldWithPlaceHolder("", 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("", - 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); } diff --git a/tests/tests/TextInputTest/TextInputTest.h b/tests/tests/TextInputTest/TextInputTest.h index 4e83121ee4..b2b643c426 100644 --- a/tests/tests/TextInputTest/TextInputTest.h +++ b/tests/tests/TextInputTest/TextInputTest.h @@ -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 @@ -69,4 +99,4 @@ public: virtual void runThisTest(); }; -#endif // __TEXT_INPUT_TEST_H__ \ No newline at end of file +#endif // __TEXT_INPUT_TEST_H__ diff --git a/tests/tests/controller.cpp b/tests/tests/controller.cpp index 555fe6d6e5..11c669c680 100644 --- a/tests/tests/controller.cpp +++ b/tests/tests/controller.cpp @@ -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