int lua_MyCastSpellByName( void* p ){ int ret; ret = ScriptEntry( p ); if( ret != -1 ){ return ret; } ret = CastSpellByName( p ); CastSpellByNameReturn(); return ret; }
void DialogScript::load(Common::SeekableReadStream &s, uint startingOffset) { clear(); Common::HashMap<uint, uint> instructionOffsets; // Iterate getting each instruction in turn while (s.pos() < s.size()) { // Create a new entry for the next script command instructionOffsets[startingOffset + s.pos()] = size(); push_back(ScriptEntry()); ScriptEntry &se = (*this)[size() - 1]; // Load the instruction se.load(s); } // Do a final iteration over the loaded instructions to convert // any GOTO instructions from original offsets to instruction indexes for (uint idx = 0; idx < size(); ++idx) { ScriptEntry &se = (*this)[idx]; if (se._command == CMD_GOTO) se._index = instructionOffsets[se._index]; } }
void ScriptLog::append( const std::string& str ) { append( ScriptEntry(str) ); }
void ScriptLog::append( int tick, ScriptEntry::Op op, int stroke, int arg1, int arg2, const Vec2& pt ) { append( ScriptEntry( tick, op, stroke, arg1, arg2, pt ) ); }