- action = new Action;
-
- init_defaults(action);
-
- if(!lispreader.read_string("name", action->name))
- if(!actions.empty())
- Termination::abort("Error: If there are more than one action, they need names!", "");
- lispreader.read_int("x-hotspot", action->x_hotspot);
- lispreader.read_int("y-hotspot", action->y_hotspot);
- lispreader.read_float("fps", action->fps);
-
- std::vector<std::string> images;
- if(!lispreader.read_string_vector("images", images))
- Termination::abort("Sprite contains no images: ", action->name.c_str());
-
- for(std::vector<std::string>::size_type i = 0; i < images.size(); ++i)
- {
- action->surfaces.push_back(
- new Surface(datadir + "/images/" + images[i], true));
- }
-
- actions[action->name] = action;