Esempio n. 1
0
 private bool parseModifier(SunflowAPI api)
 {
     p.checkNextToken("{");
     p.checkNextToken("name");
     string name = p.getNextToken();
     UI.printInfo(UI.Module.API, "Reading modifier: {0} ...", name);
     p.checkNextToken("type");
     if (p.peekNextToken("bump"))
     {
         p.checkNextToken("texture");
         api.parameter("texture", p.getNextToken());
         p.checkNextToken("scale");
         api.parameter("scale", p.getNextFloat());
         api.modifier(name, "bump_map");
     }
     else if (p.peekNextToken("normalmap"))
     {
         p.checkNextToken("texture");
         api.parameter("texture", p.getNextToken());
         api.modifier(name, "normal_map");
     }
       else if (p.peekNextToken("perlin")) {
     p.checkNextToken("function");
     api.parameter("function", p.getNextInt());
     p.checkNextToken("size");
     api.parameter("size", p.getNextFloat());
     p.checkNextToken("scale");
     api.parameter("scale", p.getNextFloat());
     api.modifier(name, "perlin");
       }
       else
     {
         UI.printWarning(UI.Module.API, "Unrecognized modifier type: {0}", p.getNextToken());
     }
     p.checkNextToken("}");
     return true;
 }