+static int c_movement(map_t*args, int type)
+{
+ char*instance = lu(args, "name");
+
+ char* xstr="";
+ char* ystr="";
+ SRECT oldbbox;
+ parameters_t p;
+ U16 set = 0x0000;
+
+ xstr = lu(args, "x");
+ ystr = lu(args, "y");
+
+ s_getParameters(instance, &p);
+
+ /* x,y position */
+ if(xstr[0])
+ {
+ if(isRelative(xstr))
+ {
+ if(type == PT_PUT || type == PT_STARTCLIP)
+ syntaxerror("relative x values not allowed for initial put or startclip");
+ p.x += parseTwip(getOffset(xstr))*getSign(xstr);
+ }
+ else
+ {
+ p.x = parseTwip(xstr);
+ }
+ set = set | SF_X;
+ }
+ if(ystr[0])
+ {
+ if(isRelative(ystr))
+ {
+ if(type == PT_PUT || type == PT_STARTCLIP)
+ syntaxerror("relative y values not allowed for initial put or startclip");
+ p.y += parseTwip(getOffset(ystr))*getSign(ystr);
+ }
+ else
+ {
+ p.y = parseTwip(ystr);
+ }
+ set = set | SF_Y;
+ }
+
+ if (change_sets_all)
+ set = SF_ALL;
+ p.set = set;
+
+ switch (type)
+ {
+ case PT_MOVE:
+ {
+ char* interstr = lu(args, "interpolation");
+ interpolation_t* inter = (interpolation_t*)dictionary_lookup(&interpolations, interstr);
+ if (!inter)
+ syntaxerror("unkown interpolation %s", interstr);
+ s_change(instance, p, inter);
+ }
+ break;
+ case PT_SMOVE:
+ {
+ char* interstr = lu(args, "interpolation");
+ interpolation_t* inter = (interpolation_t*)dictionary_lookup(&interpolations, interstr);
+ if (!inter)
+ syntaxerror("unkown interpolation %s", interstr);
+ s_schange(instance, p, inter);
+ }
+ break;
+ case PT_SWEEP:
+ {
+ char* rstr = lu(args, "r");
+ int radius = parseTwip(rstr);
+ if (radius <= 0)
+ syntaxerror("sweep not possible: radius must be greater than 0.");
+ char* dirstr = lu(args, "dir");
+ int clockwise = parseDir(dirstr);
+ char* arcstr = lu(args, "arc");
+ int short_arc = parseArc(arcstr);
+ char* interstr = lu(args, "interpolation");
+ interpolation_t* inter = (interpolation_t*)dictionary_lookup(&interpolations, interstr);
+ if (!inter)
+ syntaxerror("unkown interpolation %s", interstr);
+ s_sweep(instance, p, radius, clockwise, short_arc, inter);
+ }
+ break;
+ }
+ return 0;
+}
+