44 TiXmlDocument m_XMLDoc;
46 TiXmlEncoding xencoding = TIXML_ENCODING_LEGACY;
48 m_XMLDoc.Parse((
const char*) p_XmlText, 0, xencoding );
50 TiXmlElement* rootKey = m_XMLDoc.FirstChildElement(
"D" );
53 TiXmlElement* keyNode = rootKey->FirstChildElement(
"moKey");
74 TiXmlDocument m_XMLDoc;
76 TiXmlEncoding xencoding = TIXML_ENCODING_LEGACY;
78 m_XMLDoc.Parse((
const char*) p_XmlText, 0, xencoding );
81 TiXmlElement* sceneStateNode = m_XMLDoc.FirstChildElement(
"moSceneState");
87 m_mode =
moText( sceneStateNode->Attribute(
"mode") );
88 m_in = atoi( sceneStateNode->Attribute(
"in") );
89 m_out = atoi( sceneStateNode->Attribute(
"out") );
91 TiXmlElement* keyNode = sceneStateNode->FirstChildElement(
"moKey");
100 keyNode = keyNode->NextSiblingElement(
"moKey");
127 if (!PreInit())
return false;
145 m_i_scene_states = -1;
146 m_EffectManager.Init();
147 m_EffectManager.m_pEffectManager = &m_EffectManager;
148 m_EffectManager.m_pResourceManager = GetResourceManager();
156 m_Config.SetCurrentParam(
"preeffect" );
157 if (m_Config.FirstValue()) {
159 moValue& mVal(m_Config.GetCurrentValue());
163 newEffect = m_EffectManager.New( MoldeoObjectDef );
165 res = newEffect->
Init();
168 if (pre>=0) newEffect->GetConfig()->SetCurrentPreConf(pre);
169 if (on>0) newEffect->Activate();
170 else newEffect->Deactivate();
172 }
while (m_Config.NextValue());
176 m_Config.SetCurrentParam(
"effect" );
177 if (m_Config.FirstValue()) {
179 moValue& mVal(m_Config.GetCurrentValue());
182 newEffect = m_EffectManager.New( MoldeoObjectDef );
184 res = newEffect->
Init();
187 if (pre>=0) newEffect->GetConfig()->SetCurrentPreConf(pre);
188 if (on>0) newEffect->Activate();
189 else newEffect->Deactivate();
192 }
while (m_Config.NextValue());
195 m_Config.SetCurrentParam(
"posteffect" );
196 if (m_Config.FirstValue()) {
198 moValue& mVal(m_Config.GetCurrentValue());
201 newEffect = m_EffectManager.New( MoldeoObjectDef );
203 res = newEffect->
Init();
206 if (pre>=0) newEffect->GetConfig()->SetCurrentPreConf(pre);
207 if (on>0) newEffect->Activate();
208 else newEffect->Deactivate();
211 }
while (m_Config.NextValue());
215 m_Config.SetCurrentParam(
"scene_states" );
216 m_n_scene_states = m_Config.GetCurrentParam().GetValuesCount();
218 int i_scene_states = 0;
219 if (m_Config.FirstValue()) {
221 moValue& mVal(m_Config.GetCurrentValue());
224 if (mVal.GetSubValueCount()>1) {
226 SceneState.Set( mVal.GetSubValue( 1 ).Text());
229 m_SceneStates[i_scene_states] = SceneState;
231 MODebug2->Message(
"scene_states: " + mVal.GetSubValue( 0 ).Text() );
233 }
while (m_Config.NextValue());
237 m_Config.SetCurrentPreConf( 0 );
245 moEffect* pEffect = m_EffectManager.GetEffectByLabel( p_label_name );
249 return pEffect->
GetId();
261 for(
int i=0; i<(int)m_EffectManager.AllEffects().Count(); i++ ) {
263 moEffect* childFx = m_EffectManager.AllEffects().Get(i);
276 if ( childFx->
GetName()==
"scene" ) {
303 if (i_state>0)
return i_state;
311 int i_next_state = i_state + 1;
313 if (0<=i_next_state && i_next_state<m_n_scene_states) {
314 MODebug2->Message(
"Next Scene State: " +
IntToStr(i_next_state));
318 MODebug2->Message(
"Looping States.");
320 i_next_state = m_n_scene_states-1;
321 MODebug2->Message(
"End of States reached.");
326 return SetSceneState( i_next_state );
334 if (i_state >= m_n_scene_states)
return -1;
343 for( key=0; key<(int)m_EffectManager.AllEffects().Count(); key++) {
345 pEffect = m_EffectManager.AllEffects().Get(key);
353 if (SceneState.
m_action==
"showall") {
360 for( key=0; key<(int)SceneState.
m_SceneKeys.Count(); key++) {
363 pEffect = m_EffectManager.GetEffectByLabel( Key.
m_label_name );
386 SetSceneState(m_i_scene_states);
389 UpdateSceneState(m_i_scene_states);
409 bool pre_effect_on =
false;
413 BeginDraw( tempogral, parentstate );
415 glMatrixMode( GL_MODELVIEW );
420 for(i=1 ; i<m_EffectManager.PreEffects().Count(); i++ ) {
421 pEffect = m_EffectManager.PreEffects().GetRef(i);
424 pre_effect_on =
true;
428 fstate.
alpha = m_EffectState.alpha;
431 pEffect->
Draw(&m_EffectState.tempo);
440 if( m_EffectManager.PreEffects().Count()>0 ) {
441 pEffect = m_EffectManager.PreEffects().GetRef(0);
448 fstate.
alpha = m_EffectState.alpha;
451 pEffect->
Draw(&m_EffectState.tempo);
467 for( i=0; i<m_EffectManager.Effects().Count(); i++ ) {
469 pEffect = m_EffectManager.Effects().GetRef(i);
475 fstate.
alpha = m_EffectState.alpha;
478 pEffect->
Draw(&m_EffectState.tempo);
488 for(i=0;i<m_EffectManager.PostEffects().Count();i++) {
490 pEffect = m_EffectManager.PostEffects().GetRef(i);
497 fstate.
alpha = m_EffectState.alpha;
500 pEffect->
Draw(&m_EffectState.tempo);
513 glMatrixMode(GL_PROJECTION);
516 glMatrixMode(GL_MODELVIEW);
525 m_EffectManager.Finish();
545 StateDefault.
AddSubValue(
"<moSceneState action=\"showall\"/>",
"XML");
553 return p_configdefinition;
virtual void Deactivate()
int Set(const moText &p_XmlText)
moDefineDynamicArray(moKeys) int moKeyEffect
#define MO_CFG_EFFECT_PRE
#define MO_MOLDEOSCENEOBJECTS_OFFSET_ID
scene objects are recursive sub-scene-fx's
#define moDefineParamIndex(X, Y)
virtual void Start()
Inicia el temporizador.
value type: NUM or FUNCTION
virtual void LoadCodes(moIODeviceManager *)
void LoadCodes(moIODeviceManager *)
int SetSceneState(int i_state)
MOboolean RenderResEqualScreenRes()
#define MO_RENDER_RESOLUTION
moConfigDefinition * GetDefinition(moConfigDefinition *p_configdefinition)
void AddSubValue(const moText &strvalue, moValueType p_valuetype)
definici�n de todos los par�metros a encontrar o a crear dentro del moConfig
void DrawTexture(MOint p_resolution, MOint p_tex_num)
MOboolean IsRenderToFBOEnabled()
clase de para manejar textos
virtual const moEffectState & GetEffectState()
Clase Base Descriptiva de un Objeto Moldeo.
virtual bool Activated() const
virtual moConfigDefinition * GetDefinition(moConfigDefinition *p_configdefinition=NULL)
void Interaction(moIODeviceManager *)
void SetMoldeoFatherId(MOint p_moldeoid)
Fija el identificador del padre de este objeto.
static void Log(moText p_text)
Escribe un mensaje en el archivo de registro (log)
virtual void Update(moEventList *p_EventList)
#define MO_CFG_EFFECT_LABEL
const moMobDefinition & GetMobDefinition() const
virtual MOboolean Init()=0
void SetMoldeoId(MOint p_moldeoid)
Fija el identificador de este objeto.
Clase Base para Objetos Moldeo ( moEffect, moIODevice, moResource, moConsole )
Objeto dibujable, pre-efecto ( primeros efectos en el orden de dibujado )
virtual void Update(moEventList *p_EventList)
Objeto dibujable, efecto ( efectos en el orden de dibujado )
virtual bool SetEffectState(const moEffectState &p_state)
void SetCurrentPreConf(MOint p_actual)
Posiciona la preconfiguraci�n actual en el �ndice indicado.
int NextSceneState(int i_state)
void SetFatherLabelName(const moText &p_labelname)
Fija la etiqueta del padre de este objeto.
void Add(const moText &p_name, moParamType p_type, int p_index=-1, const moValue &p_defaultvalue=moValue("INVALID", MO_VALUE_UNDEFINED), const moText &p_OptionsStr=moText(""))
Agrega la definici�n de un par�metro con un valor predeterminado a tomar.
int UpdateMoldeoIds(moMoldeoObjects &p_MoldeoSceneObjects)
LIBMOLDEO_API moText0 IntToStr(int a)
void SetMobDefinition(const moMobDefinition &p_MobDef)
clase base para objetos dibujables
virtual void Draw(moTempo *, moEffectState *parentstate=NULL)=0
void Draw(moTempo *, moEffectState *parentstate=NULL)
int Set(const moText &p_XmlText)
#define MO_CFG_EFFECT_CONFIG
int UpdateSceneState(int i_state)
int GetObjectId(moText p_label_name)
const moText & GetName() const