Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 18, 2006, 10:02:52 PM (19 years ago)
Author:
bensch
Message:

gui: nicer looks of Material

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/graphics/importer/material.cc

    r8571 r8572  
    431431
    432432
     433/**
     434 * @param blendFunc the Enumerator to convert to a String.
     435 * @returns the matching String if found
     436 */
    433437const std::string& Material::blendFuncToString(GLenum blendFunc)
    434438{
    435439  for (unsigned int i = 0; i < 9; ++i)
    436     if (blendFunc == glBlendFuncParams[i])
    437       return blendFuncNames[i];
    438   return blendFuncNames[0];
    439 }
    440 
     440    if (blendFunc == Material::glBlendFuncParams[i])
     441      return Material::blendFuncNames[i];
     442  PRINTF(2)("Supplied an Invalid Enumerator to blendfunc %d\n", blendFunc);
     443  return Material::blendFuncNames[0];
     444}
     445
     446/**
     447 * @param blendFuncString the String to convert into a gl-enumeration
     448 * @returns the matching GL-enumeration if found.
     449 */
    441450GLenum Material::stringToBlendFunc(const std::string& blendFuncString)
    442451{
    443452  for (unsigned int i = 0; i < 9; ++i)
    444     if (blendFuncString == blendFuncNames[i])
    445       return glBlendFuncParams[i];
    446   return glBlendFuncParams[0];
    447 }
    448 
     453    if (blendFuncString == Material::blendFuncNames[i])
     454      return Material::glBlendFuncParams[i];
     455  PRINTF(2)("BlendFunction %s not recognized using %s\n", blendFuncString.c_str(), Material::blendFuncNames[0].c_str());
     456  return Material::glBlendFuncParams[0];
     457}
    449458
    450459
Note: See TracChangeset for help on using the changeset viewer.