コード例 #1
0
MOint moTextureManager::GetTextureMOId(moText p_name, MOboolean p_create_tex)
{
	moTexture* ptex;
	if (p_name.Trim() == moText("")) return -1;
	for (MOuint i = 0; i < m_textures_array.Count(); i++)
	{
		ptex = m_textures_array[i];
		if ((ptex != NULL) && (!stricmp(ptex->GetName(), p_name))) return i;
	}
	if (p_create_tex) return AddTexture(p_name);
	else return -1;
}
コード例 #2
0
MOint moTextureManager::GetTextureBuffer( moText p_foldername, MOboolean p_create_tex, moText p_bufferformat ) {

    moTextureBuffer* ptexbuffer;
	if (p_foldername.Trim() == moText("")) return -1;
	for (MOuint i = 0; i < m_textures_buffers.Count(); i++)
	{
		ptexbuffer = m_textures_buffers[i];
		if ((ptexbuffer != NULL) && (!stricmp(ptexbuffer->GetName(), p_foldername))) return i;
	}
	if (p_create_tex) return AddTextureBuffer( p_foldername, p_bufferformat );
	else return -1;

}
コード例 #3
0
ファイル: moFontManager.cpp プロジェクト: inaes-tic/tv-moldeo
void
moFont::Draw( MOfloat x, MOfloat y, moText& text, moFontSize p_fontsize, MOint set, MOfloat sx, MOfloat sy, MOfloat rt ) {

    FTFont* FF = (FTFont*) m_pFace;
    if (FF) {
        SetSize(p_fontsize);
        FF->Render( text, text.Length(), FTPoint(x,y) );
    }

    else {
      if (m_FontGLId>=0) {
          this->glPrint( (int)x, (int)y, text, set, sx, sy, rt );
      }
    }
}
コード例 #4
0
ファイル: moMathManager.cpp プロジェクト: inaes-tic/tv-moldeo
MOint moMathManager::AddFunction(const moText& p_expr, MOboolean p_force_new, moMoldeoObject* p_pMOB )
{

	MOint idx = -1;

	if ( p_expr.Length() == 0 )
        return idx;

	if (!p_force_new)
	{
        idx = GetFunctionIdx(p_expr);
		if (-1 < idx) return idx; // La función ya existe.
	}

	moMathFunction* p_math_fun;
	moParserFunction* p_parser_fun; // Función de parseado.

    p_math_fun = BuiltInMathFunctionFactory(p_expr);
	if (p_math_fun == NULL)
	{
		p_parser_fun = new moParserFunction();

		p_math_fun = (moMathFunction*)p_parser_fun;
	}

	if (p_math_fun != NULL)
	{
	    bool res = p_math_fun->Init( p_expr, p_pMOB );
		if (res)
		{
			m_functions.Add(p_math_fun);
			//double check = p_math_fun->Eval(0);
			return m_functions.Count() - 1;
		}
		else
		{
			delete p_math_fun;
			return -1;
		}
	}
	else return -1;
}
コード例 #5
0
ファイル: moDataManager.cpp プロジェクト: moldeo/libmoldeo
int
moDataManager::ReloadPluginDefinitions( moText plugindir, moMoldeoObjectType mobjecttype ) {

  moDirectory DirEffects;
  bool bDebug = true;
  moText PluginName;
  moText pluginfullpath = m_pDataSessionConfig->GetPluginsPath();

  if (plugindir.Length()==0 && mobjecttype==MO_OBJECT_UNDEFINED) {

    ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
    ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
    ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
    ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
    ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
    ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
    return 0;
  }

  if (plugindir.Length()==0 && mobjecttype!=MO_OBJECT_UNDEFINED) {
    switch(mobjecttype) {
      case MO_OBJECT_PREEFFECT:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
        break;
      case MO_OBJECT_EFFECT:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
        break;
      case MO_OBJECT_POSTEFFECT:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
        break;
      case MO_OBJECT_MASTEREFFECT:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
        break;
      case MO_OBJECT_IODEVICE:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
        break;
      case MO_OBJECT_RESOURCE:
        ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
        break;
      default:
        break;
    }
    return 0;
  }


  /// Open DIRECTORY [plugindir] and search for module libraries (plugins)
  ///
  #ifdef MO_WIN32
  DirEffects.Open( plugindir, moText("/*.dll") );
  #else
  DirEffects.Open( plugindir, moText("/*.so") );
  #endif // MO_LINUX

  if (DirEffects.Exists()) {

      moFile* pFile = NULL;
      moText FileNameEnd;

      pFile = DirEffects.FindFirst();

      if (pFile!=NULL)
          MODebug2->Message( moText("File founded") );

      while(pFile!=NULL) {

          FileNameEnd = pFile->GetFileName();
          PluginName = pFile->GetFileName();

          FileNameEnd.Right(2);
          bDebug = ( FileNameEnd==moText("_d") );
          if (bDebug) PluginName.Left( PluginName.Length() - 3 );

          ///LINUX VERSION
          if (!bDebug) {
              if (pFile->GetExtension()==moText(".so")) {
                  #ifndef MO_WIN32
                      ///extract the "libmoldeo_" part
                      PluginName.Right( PluginName.Length() - 10 );
                      m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
                      MODebug2->Message( pFile->GetFileName() );
                  #endif
              } else if (pFile->GetExtension()==moText(".dll")) {
                  #ifdef MO_WIN32
                      m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
                      MODebug2->Message( pFile->GetFileName() );

                  #endif
              }
          }

          pFile = DirEffects.FindNext();
      }
  } else MODebug2->Error( moText("Directory doesn't exists:")+(moText)plugindir );


  return 0;
}