~ccoal/+junk/elf

« back to all changes in this revision

Viewing changes to Source/ELMOFunction.cpp

  • Committer: Calder Coalson
  • Date: 2011-03-11 03:07:14 UTC
  • Revision ID: caldercoalson@gmail.com-20110311030714-4urkt2v8ywa54s3k
* FloatSample function works!

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    
47
47
    void Function::execute ()
48
48
    {
49
 
        for (InstructionList::iterator it = mInstructions.begin(); it != mInstructions.end(); ++it)
 
49
        mCurrentInstruction = -1;
 
50
        while (mCurrentInstruction+1 < mInstructions.size())
50
51
        {
51
 
            (*it)->execute(this);
 
52
            ++mCurrentInstruction;
 
53
            mInstructions[mCurrentInstruction]->execute(this);
52
54
        }
53
55
    }
54
56
    
56
58
    {
57
59
        TiXmlDocument doc;
58
60
        doc.Parse(value.c_str());
59
 
        TiXmlNode* root = doc.FirstChild();
60
 
        TiXmlElement* elem = root->ToElement();
61
 
        readFromXMLNode(elem,language);
 
61
        TiXmlElement* root = doc.FirstChildElement();
 
62
        readFromXMLNode(root,language);
62
63
    }
63
64
    
64
65
    void Function::readFromXMLNode (const TiXmlElement* root, Language* language)
87
88
    
88
89
    string Function::writeToString ()
89
90
    {
90
 
        TiXmlElement* elem = writeToXMLNode();
 
91
        TiXmlElement* root = writeToXMLNode();
91
92
        TiXmlPrinter printer;
92
 
        elem->Accept(&printer);
93
 
        delete elem;
 
93
        root->Accept(&printer);
 
94
        delete root;
94
95
        return printer.CStr();
95
96
    }
96
97