inline js_type_class_t *js_get_type_from_native(T* native_obj) { js_type_class_t *typeProxy; long typeId = getHashCodeByString(typeid(*native_obj).name()); HASH_FIND_INT(_js_global_type_ht, &typeId, typeProxy); if (!typeProxy) { CrossApp::TypeInfo *typeInfo = dynamic_cast<CrossApp::TypeInfo *>(native_obj); if (typeInfo) { typeId = typeInfo->getClassTypeInfo(); } else { typeId = getHashCodeByString(typeid(T).name()); } HASH_FIND_INT(_js_global_type_ht, &typeId, typeProxy); } return typeProxy; }
KDuint CCSound::Open ( const KDchar* szFilePath, KDuint nMode ) { std::string sFilePath = CCFileUtils::sharedFileUtils ( )->fullPathForFilename ( szFilePath ); KDint uRet = 0; XMSound* pSound = KD_NULL; do { CC_BREAK_IF ( !sFilePath.c_str ( ) ); uRet = getHashCodeByString ( sFilePath.c_str ( ) ); CC_BREAK_IF ( l_aSounds.end ( ) != l_aSounds.find ( uRet ) ); if ( ( pSound = xmSoundOpen ( sFilePath.c_str ( ), nMode ) ) ) { STSound tSound; tSound.m_pSound = pSound; l_aSounds.insert ( std::pair<KDuint, STSound> ( uRet, tSound ) ); } else { uRet = 0; } } while ( 0 ); return uRet; }
KDint32 CCCallFuncO::getClassTypeInfo ( KDvoid ) { static const KDint32 nID = getHashCodeByString ( typeid ( CCCallFunc ).name ( ) ); return nID; }