+ std::string modename;
+
+ reader.read_string("mode", modename);
+ if(modename == "normal") {
+ mode = NORMAL;
+
+ do_backscrolling = true;
+ reader.read_bool("backscrolling", do_backscrolling);
+ } else if(modename == "autoscroll") {
+ mode = AUTOSCROLL;
+
+ lisp_object_t* cur = 0;
+ reader.read_lisp("path", cur);
+ if(cur == 0) {
+ throw std::runtime_error("No path specified in autoscroll camera.");
+ }
+ float speed = .5;
+ while(!lisp_nil_p(cur)) {
+ if(strcmp(lisp_symbol(lisp_car(lisp_car(cur))), "point") != 0) {
+ std::cerr << "Warning: unknown token in camera path.\n";
+ continue;
+ }
+
+ LispReader reader(lisp_cdr(lisp_car(cur)));
+
+ ScrollPoint point;
+ if(!reader.read_float("x", point.position.x) ||
+ !reader.read_float("y", point.position.y)) {
+ throw std::runtime_error("x and y missing in point of camerapath");
+ }
+ reader.read_float("speed", speed);
+ point.speed = speed;
+ scrollpoints.push_back(point);
+
+ cur = lisp_cdr(cur);
+ }
+ } else if(modename == "manual") {
+ mode = MANUAL;
+ } else {
+ std::stringstream str;
+ str << "invalid camera mode '" << modename << "'found in worldfile.";
+ throw std::runtime_error(str.str());
+ }