Merge branch 'master' of git://github.com/cocos2d/cocos2d-x

This commit is contained in:
gzito 2012-01-02 22:32:29 +01:00
commit 083d0015a3
23 changed files with 781 additions and 112 deletions

View File

@ -111,26 +111,24 @@ int CCAudioOut::DecodeOgg(const char *infile)
int seekable = 0;
int percent = 0;
//AppLog("enter, %s", infile);
in = fopen(infile, "rb");
if(!in) {
//AppLog("ERROR: Failed to open input file:\n");
AppLog("ERROR: Failed to open input file:\n");
return 1;
}
//AppLog("enter");
if(ov_open(in, &vf, NULL, 0) < 0) {
//AppLog("ERROR: Failed to open input as vorbis\n");
AppLog("ERROR: Failed to open input as vorbis\n");
fclose(in);
// fclose(out);
return 1;
}
//AppLog("enter");
if(ov_seekable(&vf)) {
seekable = 1;
length = ov_pcm_total(&vf, 0);
size = 16/8 * ov_info(&vf, 0)->channels;
}
//AppLog("enter");
if (ov_info(&vf,0)->channels == 2)
{
__sampleChannelType = AUDIO_CHANNEL_TYPE_STEREO;
@ -139,19 +137,19 @@ int CCAudioOut::DecodeOgg(const char *infile)
{
__sampleChannelType = AUDIO_CHANNEL_TYPE_MONO;
}
//AppLog("enter");
__sampleRate = ov_info(&vf,0)->rate;
__sampleBitdepth = AUDIO_TYPE_PCM_S16_LE;
//AppLog("enter");
while((ret = ov_read(&vf, buf, buflen, 0, 16/8, 1, &bs)) != 0) {
if(bs != 0) {
//AppLog("Only one logical bitstream currently supported\n");
AppLog("Only one logical bitstream currently supported\n");
break;
}
if(ret < 0) {
//AppLog("Warning: hole in data\n");
AppLog("Warning: hole in data\n");
continue;
}
@ -178,25 +176,18 @@ int CCAudioOut::DecodeOgg(const char *infile)
__iAllPcmBufferSize = written;
// if(seekable && !quiet)
// //AppLog("\n");
// if(!raw)
// rewrite_header(out, written); /* We don't care if it fails, too late */
//AppLog("enter");
ov_clear(&vf);
fclose(in);
// fclose(out);
#endif
//AppLog("enter");
return 0;
}
CCAudioOut::CCAudioOut()
{
//AppLog("Enter");
__volumeLevel = -1;
__pAllPcmBuffer = null;
__iAllPcmBufferSize = 0;
@ -214,7 +205,7 @@ CCAudioOut::CCAudioOut()
CCAudioOut::~CCAudioOut()
{
//AppLog("Enter");
Finalize();
if(__pAudioOut)
{
@ -231,7 +222,7 @@ CCAudioOut::~CCAudioOut()
result CCAudioOut::Initialize(const char* pszFilePath)
{
//AppLog("Enter");
// This is called when AudioOut form is moving on the foreground.
result r = E_SUCCESS;
@ -255,20 +246,20 @@ result CCAudioOut::Initialize(const char* pszFilePath)
__pAudioOut = new AudioOut();
if (!__pAudioOut)
{
//AppLog("[E_OUT_OF_MEMORY] m_pAudio new failed\n");
AppLog("[E_OUT_OF_MEMORY] m_pAudio new failed\n");
return r;
}
r = __pAudioOut->Construct(*this);
if (IsFailed(r))
{
//AppLog("[Error] m_AudioOut.Construct failed");
AppLog("[Error] m_AudioOut.Construct failed");
return r;
}
}
else
{
//AppLog("[Error] __pAudioOut is already existed\n");
AppLog("[Error] __pAudioOut is already existed\n");
}
String strFile(pszFilePath);
@ -279,13 +270,13 @@ result CCAudioOut::Initialize(const char* pszFilePath)
__pFile = new File();
if(!__pFile)
{
//AppLog("[Error] __pFile new failed\n");
AppLog("[Error] __pFile new failed\n");
return E_SYSTEM;
}
r = __pFile->Construct(pszFilePath, L"rb");
if (IsFailed(r)) {
//AppLog("[Error] __pFile.Construct failed : %d \n", r);
AppLog("[Error] __pFile.Construct failed : %d \n", r);
return r;
}
@ -328,7 +319,7 @@ result CCAudioOut::Initialize(const char* pszFilePath)
}
else
{
//AppLog("not more memory...");
AppLog("not more memory...");
}
}
else if (strFile.EndsWith(".ogg"))
@ -344,7 +335,7 @@ result CCAudioOut::Initialize(const char* pszFilePath)
r = __pAudioOut->Prepare( __sampleBitdepth, __sampleChannelType, __sampleRate );
if (IsFailed(r))
{
//AppLog("[Error] m_AudioOut.Prepare failed");
AppLog("[Error] m_AudioOut.Prepare failed");
return r;
}
@ -356,7 +347,7 @@ result CCAudioOut::Initialize(const char* pszFilePath)
r = __pAudioOut->SetVolume(DEFAULT_VOLUME_LEVEL);
if (IsFailed(r))
{
//AppLog("[Error] m_AudioOut.SetVolume failed");
AppLog("[Error] m_AudioOut.SetVolume failed");
return r;
}
@ -366,25 +357,25 @@ result CCAudioOut::Initialize(const char* pszFilePath)
r = __byteBuffer[0].Construct(__bufferSize);
if (E_SUCCESS != r)
{
//AppLog( "[Error] __byteBuffer[0].Construct failed..%d ",r);
AppLog( "[Error] __byteBuffer[0].Construct failed..%d ",r);
return E_OUT_OF_MEMORY;
}
r = __byteBuffer[1].Construct(__bufferSize);
if (E_SUCCESS != r)
{
//AppLog( "[Error] __byteBuffer[1].Construct failed..%d ",r);
AppLog( "[Error] __byteBuffer[1].Construct failed..%d ",r);
return E_OUT_OF_MEMORY;
}
r = __byteBuffer[2].Construct(__bufferSize);
if (E_SUCCESS != r)
{
//AppLog( "[Error] __byteBuffer[2].Construct failed..%d ",r);
AppLog( "[Error] __byteBuffer[2].Construct failed..%d ",r);
return E_OUT_OF_MEMORY;
}
r = __byteBuffer[3].Construct(__bufferSize);
if (E_SUCCESS != r)
{
//AppLog( "[Error] __byteBuffer[3].Construct failed..%d ",r);
AppLog( "[Error] __byteBuffer[3].Construct failed..%d ",r);
return E_OUT_OF_MEMORY;
}
}
@ -491,7 +482,7 @@ result CCAudioOut::ReWriteBuffer(void)
r = __pAudioOut->WriteBuffer(__byteBuffer[i]);
if (IsFailed(r))
{
//AppLog("[Error] m_AudioOut.WriteBuffer failed : %d\n", r);
AppLog("[Error] m_AudioOut.WriteBuffer failed : %d\n", r);
return r;
}
}
@ -508,7 +499,7 @@ result CCAudioOut::ReWriteBuffer(void)
r = __pAudioOut->WriteBuffer(__byteBuffer[i]);
if (IsFailed(r))
{
//AppLog("[Error] m_AudioOut.WriteBuffer failed : %d\n", r);
AppLog("[Error] m_AudioOut.WriteBuffer failed : %d\n", r);
return r;
}
}

View File

@ -33,6 +33,7 @@ THE SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;
using namespace Osp::Media;
@ -320,7 +321,7 @@ void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
{
s_bBackgroundMusicPaused = false;
if (s_pBackPlayer && PLAYER_STATE_PLAYING == s_pBackPlayer->GetState())
if (s_pBackPlayer != NULL && PLAYER_STATE_PLAYING == s_pBackPlayer->GetState())
{
s_pBackPlayer->Stop();
}
@ -328,7 +329,7 @@ void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
void SimpleAudioEngine::pauseBackgroundMusic()
{
if (s_pBackPlayer && PLAYER_STATE_PLAYING == s_pBackPlayer->GetState())
if (s_pBackPlayer != NULL && PLAYER_STATE_PLAYING == s_pBackPlayer->GetState())
{
s_bBackgroundMusicPaused = true;
s_pBackPlayer->Pause();
@ -337,7 +338,7 @@ void SimpleAudioEngine::pauseBackgroundMusic()
void SimpleAudioEngine::resumeBackgroundMusic()
{
if (s_pBackPlayer && s_bBackgroundMusicPaused && PLAYER_STATE_PLAYING != s_pBackPlayer->GetState())
if (s_pBackPlayer != NULL && s_bBackgroundMusicPaused && PLAYER_STATE_PLAYING != s_pBackPlayer->GetState())
{
s_bBackgroundMusicPaused = false;
s_pBackPlayer->Play();
@ -347,7 +348,7 @@ void SimpleAudioEngine::resumeBackgroundMusic()
void SimpleAudioEngine::rewindBackgroundMusic()
{
stopBackgroundMusic();
if (s_pBackPlayer)
if (s_pBackPlayer != NULL)
{
if (PLAYER_STATE_PLAYING != s_pBackPlayer->GetState())
{
@ -369,13 +370,10 @@ bool SimpleAudioEngine::isBackgroundMusicPlaying()
{
bool bRet = false;
if (s_pBackPlayer)
{
if (s_pBackPlayer->GetState() == PLAYER_STATE_PLAYING)
if (s_pBackPlayer != NULL && s_pBackPlayer->GetState() == PLAYER_STATE_PLAYING)
{
bRet = true;
}
}
return bRet;
}
@ -397,13 +395,9 @@ void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
volume = 0.0f;
}
if (s_pBackPlayer)
if (s_pBackPlayer != NULL)
{
s_pBackPlayer->SetVolume((int) (volume * 99));
if (volume > 0.0f && s_pBackPlayer->GetVolume() == 0)
{
s_pBackPlayer->SetVolume(1);
}
s_pBackPlayer->SetVolume(ceil(volume));
}
s_fBackgroundMusicVolume = volume;
}
@ -424,6 +418,14 @@ void SimpleAudioEngine::setEffectsVolume(float volume)
volume = 0.0f;
}
EffectList::iterator it;
for (it = s_List.begin(); it != s_List.end(); ++it)
{
if (it->second != NULL)
{
it->second->SetVolume(ceil(volume));
}
}
s_fEffectsVolume = volume;
}
@ -439,6 +441,11 @@ unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop/*
EffectList::iterator p = s_List.find(nRet);
if (p != s_List.end())
{
if (NULL == p->second)
{
AppLog("CCAudioOut instance must not be NULL, id = %d", p->first);
return 0;
}
p->second->SetVolume((int) (s_fEffectsVolume * 99));
int volume = p->second->GetVolume();
@ -468,53 +475,71 @@ unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop/*
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
{
CCAudioOut*& pPlayer = s_List[nSoundId];
if (pPlayer != NULL)
EffectList::iterator it = s_List.find(nSoundId);
if (it != s_List.end())
{
pPlayer->Stop();
if (it->second != NULL)
{
it->second->Stop();
}
}
}
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
{
CCAudioOut*& pPlayer = s_List[nSoundId];
if (pPlayer != NULL)
EffectList::iterator it = s_List.find(nSoundId);
if (it != s_List.end())
{
pPlayer->Pause();
if (it->second != NULL)
{
it->second->Pause();
}
}
}
void SimpleAudioEngine::pauseAllEffects()
{
for (EffectList::iterator it = s_List.begin(); it != s_List.end(); ++it)
{
if (it->second != NULL)
{
it->second->Pause();
}
}
}
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
{
CCAudioOut*& pPlayer = s_List[nSoundId];
if (pPlayer != NULL)
EffectList::iterator it = s_List.find(nSoundId);
if (it != s_List.end())
{
pPlayer->Resume();
if (it->second != NULL)
{
it->second->Resume();
}
}
}
void SimpleAudioEngine::resumeAllEffects()
{
for (EffectList::iterator it = s_List.begin(); it != s_List.end(); ++it)
{
if (it->second != NULL)
{
it->second->Resume();
}
}
}
void SimpleAudioEngine::stopAllEffects()
{
for (EffectList::iterator it = s_List.begin(); it != s_List.end(); ++it)
{
if (it->second != NULL)
{
it->second->Stop();
}
}
}
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
@ -535,13 +560,17 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
if (s_List.size() >= 64)
{
// get the first effect, and remove it form list
//AppLog("effect preload more than 64, delete the first effect");
AppLog("effect preload more than 64, delete the first effect");
pEffectPlayer = s_List.begin()->second;
pEffectPlayer->Finalize();
s_List.erase(s_List.begin()->first);
s_List.erase(s_List.begin());
}
if (pEffectPlayer == NULL)
pEffectPlayer = new CCAudioOut;
if (NULL == pEffectPlayer)
{
pEffectPlayer = new CCAudioOut();
}
pEffectPlayer->Initialize(strFilePath.c_str());
s_List.insert(Effect(nRet, pEffectPlayer));
@ -552,9 +581,22 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
{
string strFilePath = fullPathFromRelativePath(pszFilePath);
unsigned int nSoundId = _Hash(strFilePath.c_str());
CCAudioOut*& pPlayer = s_List[nSoundId];
pPlayer->Stop();
unsigned int nID = _Hash(strFilePath.c_str());
EffectList::iterator p = s_List.find(nID);
if (p != s_List.end())
{
if (p->second != NULL)
{
delete p->second;
p->second = NULL;
AppLog("delete CCAudioOut, id = %d", nID);
}
else
{
AppLog("CCAudioOut instance is NULL, id = %d", nID);
}
s_List.erase(p);
}
}
} // end of namespace CocosDenshion

View File

@ -881,14 +881,14 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial,
long *serialno_list=NULL;
int serialno_list_size=0;
int ret;
//AppLog("enter");
memset(vf,0,sizeof(*vf));
vf->datasource=f;
vf->callbacks = callbacks;
//AppLog("enter");
/* init the framing state */
ogg_sync_init(&vf->oy);
//AppLog("enter");
/* perhaps some data was previously read into a buffer for testing
against other stream types. Allow initialization from this
previously read data (especially as we may be reading from a
@ -898,7 +898,7 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial,
memcpy(buffer,initial,ibytes);
ogg_sync_wrote(&vf->oy,ibytes);
}
//AppLog("enter");
/* can we seek? Stevens suggests the seek test was portable */
if(offsettest!=-1)vf->seekable=1;
@ -908,15 +908,15 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial,
vf->vi=_ogg_calloc(vf->links,sizeof(*vf->vi));
vf->vc=_ogg_calloc(vf->links,sizeof(*vf->vc));
ogg_stream_init(&vf->os,-1); /* fill in the serialno later */
//AppLog("enter");
/* Fetch all BOS pages, store the vorbis header and all seen serial
numbers, load subsequent vorbis setup headers */
if((ret=_fetch_headers(vf,vf->vi,vf->vc,&serialno_list,&serialno_list_size,NULL))<0){
//AppLog("enter");
vf->datasource=NULL;
ov_clear(vf);
}else{
//AppLog("enter");
/* serial number list for first link needs to be held somewhere
for second stage of seekable stream open; this saves having to
seek/reread first link's serialnumber data then. */
@ -933,12 +933,12 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial,
vf->ready_state=PARTOPEN;
}
if(serialno_list)_ogg_free(serialno_list);
//AppLog("enter");
return(ret);
}
static int _ov_open2(OggVorbis_File *vf){
//AppLog("enter");
if(vf->ready_state != PARTOPEN) return OV_EINVAL;
vf->ready_state=OPENED;
if(vf->seekable){
@ -950,7 +950,7 @@ static int _ov_open2(OggVorbis_File *vf){
return(ret);
}else
vf->ready_state=STREAMSET;
//AppLog("enter");
return 0;
}
@ -1008,7 +1008,7 @@ int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes){
(int (*)(void *)) fclose,
(long (*)(void *)) ftell
};
//AppLog("enter");
return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
}

View File

@ -307,6 +307,172 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.c.compiler.lib.release.383604126;cdt.managedbuild.tool.osp.gnu.c.compiler.input.1191879302">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.cpp.compiler.lib.release.636146026;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1930551176">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201;cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201.;cdt.managedbuild.tool.osp.gnu.simul.cpp.compiler.lib.simul.523736122;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1042073020">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@ -778,6 +944,172 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.c.compiler.lib.release.383604126;cdt.managedbuild.tool.osp.gnu.c.compiler.input.1191879302">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.cpp.compiler.lib.release.636146026;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1930551176">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201;cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201.;cdt.managedbuild.tool.osp.gnu.simul.cpp.compiler.lib.simul.523736122;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1042073020">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@ -1249,6 +1581,172 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.c.compiler.lib.release.383604126;cdt.managedbuild.tool.osp.gnu.c.compiler.input.1191879302">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.target.lib.release.483907886;cdt.managedbuild.config.osp.gnu.target.lib.release.483907886.;cdt.managedbuild.tool.osp.gnu.target.cpp.compiler.lib.release.636146026;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1930551176">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201;cdt.managedbuild.config.osp.gnu.arm.lib.simul.39952201.;cdt.managedbuild.tool.osp.gnu.simul.cpp.compiler.lib.simul.523736122;cdt.managedbuild.tool.osp.gnu.cpp.compiler.input.1042073020">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">

View File

@ -88,8 +88,6 @@ public:
virtual void draw();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
// CC Texture protocol
/** returns the used texture*/

View File

@ -180,8 +180,7 @@ namespace cocos2d{
virtual const char* getString(void);
virtual void setCString(const char *label);
virtual void setAnchorPoint(const CCPoint& var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual CCLabelProtocol* convertToLabelProtocol() { return (CCLabelProtocol*)this; }
#if CC_LABELBMFONT_DEBUG_DRAW
virtual void draw();
#endif // CC_LABELBMFONT_DEBUG_DRAW

View File

@ -182,7 +182,8 @@ public:
/** BlendFunction. Conforms to CCBlendProtocol protocol */
CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc)
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
LAYER_NODE_FUNC(CCLayerColor);
protected:

View File

@ -118,7 +118,8 @@ namespace cocos2d{
*/
virtual void onExit();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
protected:
CCMenuItem* itemForTouch(CCTouch * touch);

View File

@ -124,7 +124,8 @@ namespace cocos2d{
virtual void setColor(const ccColor3B& color);
virtual const ccColor3B& getColor();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
protected:
ccColor3B m_tColorBackup;
float m_fOriginalScale;
@ -236,7 +237,8 @@ namespace cocos2d{
virtual void unselected();
virtual void setIsEnabled(bool bEnabled);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
};
/** @brief CCMenuItemImage accepts images as items.
@ -308,7 +310,8 @@ namespace cocos2d{
virtual void unselected();
virtual void setIsEnabled(bool var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
};
}

View File

@ -52,13 +52,13 @@ public:
CCObject(void);
virtual ~CCObject(void);
virtual void release(void);
virtual void retain(void);
void release(void);
void retain(void);
CCObject* autorelease(void);
CCObject* copy(void);
bool isSingleRefrence(void);
unsigned int retainCount(void);
bool isEqual(const CCObject* pObject);
virtual bool isEqual(const CCObject* pObject);
friend class CCAutoreleasePool;
};

View File

@ -63,12 +63,12 @@ public:
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
@since v0.8
*/
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual void setIsOpacityModifyRGB(bool bValue) = 0;
/** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
@since v0.8
*/
virtual bool getIsOpacityModifyRGB(void) { return false;}
virtual bool getIsOpacityModifyRGB(void) = 0;
};
/**
@ -101,7 +101,7 @@ public:
virtual CCTexture2D* getTexture(void) = 0;
// sets a new texture. it will be retained
virtual void setTexture(CCTexture2D *texture) {CC_UNUSED_PARAM(texture);}
virtual void setTexture(CCTexture2D *texture) = 0;
};
//! @brief Common interface for Labels

View File

@ -246,8 +246,6 @@ public:
virtual void setIsOpacityModifyRGB(bool bValue);
virtual bool getIsOpacityModifyRGB(void);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol *)this; }
// CCTextureProtocol
virtual void setTexture(CCTexture2D *texture);
virtual CCTexture2D* getTexture(void);

View File

@ -63,6 +63,20 @@ namespace cocos2d {
{
return m_sString.empty();
}
virtual bool isEqual(const CCObject* pObject)
{
bool bRet = false;
const CCString* pStr = dynamic_cast<const CCString*>(pObject);
if (pStr != NULL)
{
if (0 == m_sString.compare(pStr->m_sString))
{
bRet = true;
}
}
return bRet;
}
};
}// namespace cocos2d
#endif //__CCSTRING_H__

View File

@ -66,6 +66,17 @@ public:
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
/*
* In TouchesTest, class Padle inherits from CCSprite and CCTargetedTouchDelegate.
* When it invoke CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, 0, true),
* it will crash in CCTouchHandler::initWithDelegate() because of dynamic_cast() on android.
* I don't know why, so add these functions for the subclass to invoke it's know retain() and
* release().
* More detain info please refer issue #926(cocos2d-x).
*/
virtual void touchDelegateRetain(){}
virtual void touchDelegateRelease(){}
// functions for script call back
inline void registerScriptTouchHandler(int eventType, const char* pszScriptFunctionName)
{

View File

@ -149,6 +149,7 @@ protected:
void forceAddHandler(CCTouchHandler *pHandler, CCMutableArray<CCTouchHandler*> *pArray);
void forceRemoveAllDelegates(void);
void rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray);
CCTouchHandler* findHandler(CCMutableArray<CCTouchHandler*> *pArray, CCTouchDelegate *pDelegate);
protected:
CCMutableArray<CCTouchHandler*> *m_pTargetedHandlers;

View File

@ -82,13 +82,13 @@ public: virtual const varType& get##funName(void);
*/
#define CC_PROPERTY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void);\
public: virtual void set##funName(varType var);
public: varType get##funName(void);\
public: void set##funName(varType var);
#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void);\
public: virtual void set##funName(const varType& var);
public: const varType& get##funName(void);\
public: void set##funName(const varType& var);
/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
We can use getter to read the variable.

View File

@ -646,6 +646,7 @@ void VolatileTexture::addImageTexture(CCTexture2D *tt, const char* imageFileName
vt->m_eCashedImageType = kImageFile;
vt->m_strFileName = imageFileName;
vt->m_FmtImage = format;
vt->m_PixelFormat = tt->getPixelFormat();
}
void VolatileTexture::addDataTexture(CCTexture2D *tt, void* data, CCTexture2DPixelFormat pixelFormat, const CCSize& contentSize)
@ -735,7 +736,10 @@ void VolatileTexture::reloadAllTextures()
if (image.initWithImageData((void*)pBuffer, nSize, vt->m_FmtImage))
{
CCTexture2DPixelFormat oldPixelFormat = CCTexture2D::defaultAlphaPixelFormat();
CCTexture2D::setDefaultAlphaPixelFormat(vt->m_PixelFormat);
vt->texture->initWithImage(&image);
CCTexture2D::setDefaultAlphaPixelFormat(oldPixelFormat);
}
}
break;

View File

@ -30,7 +30,7 @@ THE SOFTWARE.
#include "CCTouch.h"
#include "CCTexture2D.h"
#include "support/data_support/ccCArray.h"
#include "ccMacros.h"
#include <algorithm>
/**
@ -148,6 +148,15 @@ void CCTouchDispatcher::addStandardDelegate(CCTouchDelegate *pDelegate, int nPri
}
else
{
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and retrun.
* Refer issue #752(cocos2d-x)
*/
if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
{
ccCArrayRemoveValue(m_pHandlersToRemove, pDelegate);
return;
}
m_pHandlersToAdd->addObject(pHandler);
m_bToAdd = true;
}
@ -162,6 +171,15 @@ void CCTouchDispatcher::addTargetedDelegate(CCTouchDelegate *pDelegate, int nPri
}
else
{
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and retrun.
* Refer issue #752(cocos2d-x)
*/
if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
{
ccCArrayRemoveValue(m_pHandlersToRemove, pDelegate);
return;
}
m_pHandlersToAdd->addObject(pHandler);
m_bToAdd = true;
}
@ -185,7 +203,6 @@ void CCTouchDispatcher::forceRemoveDelegate(CCTouchDelegate *pDelegate)
}
}
// remove handler from m_pTargetedHandlers
for (iter = m_pTargetedHandlers->begin(); iter != m_pTargetedHandlers->end(); ++iter)
{
@ -211,6 +228,16 @@ void CCTouchDispatcher::removeDelegate(CCTouchDelegate *pDelegate)
}
else
{
/* If pHandler is contained in m_pHandlersToAdd, if so remove it from m_pHandlersToAdd and retrun.
* Refer issue #752(cocos2d-x)
*/
CCTouchHandler *pHandler = findHandler(m_pHandlersToAdd, pDelegate);
if (pHandler)
{
m_pHandlersToAdd->removeObject(pHandler);
return;
}
ccCArrayAppendValue(m_pHandlersToRemove, pDelegate);
m_bToRemove = true;
}
@ -257,6 +284,23 @@ CCTouchHandler* CCTouchDispatcher::findHandler(CCTouchDelegate *pDelegate)
return NULL;
}
CCTouchHandler* CCTouchDispatcher::findHandler(CCMutableArray<CCTouchHandler*> *pArray, CCTouchDelegate *pDelegate)
{
CCAssert(pArray != NULL && pDelegate != NULL, "");
CCMutableArray<CCTouchHandler*>::CCMutableArrayIterator iter;
for (iter = pArray->begin(); iter != pArray->end(); ++iter)
{
if ((*iter)->getDelegate() == pDelegate)
{
return *iter;
}
}
return NULL;
}
void CCTouchDispatcher::rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray)
{
std::sort(pArray->begin(), pArray->end(), less);

View File

@ -35,14 +35,34 @@ CCTouchDelegate* CCTouchHandler::getDelegate(void)
void CCTouchHandler::setDelegate(CCTouchDelegate *pDelegate)
{
/*
* RTTI may return null on android. More info please refer issue #926(cocos2d-x)
*/
if (pDelegate)
{
(dynamic_cast<CCObject*>(pDelegate))->retain();
if (dynamic_cast<CCObject*>(pDelegate))
{
dynamic_cast<CCObject*>(pDelegate)->retain();
}
else
{
pDelegate->touchDelegateRetain();
}
}
/*
* RTTI may return null on android. More info please refer issue #926(cocos2d-x)
*/
if (m_pDelegate)
{
(dynamic_cast<CCObject*>(m_pDelegate))->release();
if (dynamic_cast<CCObject*>(m_pDelegate))
{
dynamic_cast<CCObject*>(m_pDelegate)->release();
}
else
{
m_pDelegate->touchDelegateRelease();
}
}
m_pDelegate = pDelegate;
}
@ -90,7 +110,21 @@ bool CCTouchHandler::initWithDelegate(CCTouchDelegate *pDelegate, int nPriority)
{
CCAssert(pDelegate != NULL, "touch delegate should not be null");
m_pDelegate = pDelegate; (dynamic_cast<CCObject*>(pDelegate))->retain();
m_pDelegate = pDelegate;
/*
* RTTI may return null on android. More info please refer issue #926(cocos2d-x)
*/
if (dynamic_cast<CCObject*>(pDelegate))
{
dynamic_cast<CCObject*>(pDelegate)->retain();
}
else
{
pDelegate->touchDelegateRetain();
}
m_nPriority = nPriority;
m_nEnabledSelectors = 0;
@ -101,7 +135,17 @@ CCTouchHandler::~CCTouchHandler(void)
{
if (m_pDelegate)
{
(dynamic_cast<CCObject*>(m_pDelegate))->release();;
/*
* RTTI may return null on android. More info please refer issue #926(cocos2d-x)
*/
if (dynamic_cast<CCObject*>(m_pDelegate))
{
dynamic_cast<CCObject*>(m_pDelegate)->release();
}
else
{
m_pDelegate->touchDelegateRelease();
}
}
}

View File

@ -23,8 +23,9 @@ set _NDKROOT=d:\programe\android\ndk\android-ndk-r6b
if not exist "%_NDKROOT%" echo Couldn't find ndk at "%_NDKROOT%" & pause & exit 6
:: create android project
set /P _PACKAGEPATH=Please enter your package path:
set /P _PACKAGEPATH=Please enter your package path. For example: org.cocos2dx.example:
set /P _PROJECTNAME=Please enter your project name:
if exist "%CD%\%_PROJECTNAME%" echo "%_PROJECTNAME%" exists, please use another name & pause & exit 7
echo "Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0"
echo "Other versions have not tested."
call "%_ANDROIDTOOLS%\android.bat" list targets

View File

@ -60,6 +60,12 @@ create_android_project(){
read PROJECT_NAME
PROJECT_DIR=`pwd`/$PROJECT_NAME
# check if PROJECT_DIR is exist
if [ -d $PROJECT_DIR ]; then
echo "$PROJECT_DIR is exist, please use another name"
exit
fi
$ANDROID_SDK_ROOT_LOCAL/tools/android create project -n $PROJECT_NAME -t $TARGET_ID -k $PACKAGE_PATH -a $PROJECT_NAME -p $PROJECT_DIR
}

View File

@ -82,3 +82,13 @@ void Paddle::ccTouchEnded(CCTouch* touch, CCEvent* event)
m_state = kPaddleStateUngrabbed;
}
void Paddle::touchDelegateRetain()
{
this->retain();
}
void Paddle::touchDelegateRelease()
{
this->release();
}

View File

@ -28,6 +28,9 @@ public:
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
virtual void touchDelegateRetain();
virtual void touchDelegateRelease();
static Paddle* paddleWithTexture(CCTexture2D* aTexture);
};