Ejemplo n.º 1
0
 void clear()
 {
     for(unsigned int k=0; k<actions.size();k++)
     {
         ActionItem *ret=actions.at(k);
         delete ret;
      }
     actions.clear();
 }
Ejemplo n.º 2
0
    void SGModel::enumerateActionList(ActionList &actions)
    {
        const Model::AnimationData &animation = mModel->getAnimationData();
        auto itr = animation.begin();
        actions.clear();

        while (itr != animation.end())
        {
            ActionInfo action;
            ActionDataPtr actionData = smart_pointer_cast<ActionData>(itr->second);
            action.mName = actionData->mName;
            ++itr;
        }
    }
Ejemplo n.º 3
0
const CKeyBindings::ActionList& CKeyBindings::GetActionList(const CKeyChain& kc) const
{
    static ActionList out; //FIXME switch to thread_local when all buildbots are using >=gcc4.7
    out.clear();

    if (kc.empty())
        return out;

    const CKeyBindings::ActionList& al = GetActionList(kc.back());
    for (const Action& action: al) {
        if (kc.fit(action.keyChain))
            out.push_back(action);
    }
    return out;
}
Ejemplo n.º 4
0
void Resource::readAction(Common::File *file, ActionList &list) {
	list.clear();

	while (file->readByte() == 1) {
		list.push_back(Action());
		Action &action = list.back();

		action._actionType = (ActionType)file->readSint16LE();
		action._param1 = file->readSint16LE();
		action._param2 = file->readSint16LE();
		action._param3 = file->readSint16LE();

		if (action._actionType == kActionShowMessages) {
			action._messages.reserve(action._param1);
			for (int i = 0; i < action._param1; i++)
				action._messages.push_back(readString(file));
		} else {
			action._messages.push_back(readString(file));
		}
	}
}