- return (strcmp(value, ARG_UNDEFINED) == 0 ? ARG_UNDEFINED_VALUE :
- type == TYPE_INTEGER ? get_integer_from_string(value) :
- type == TYPE_BOOLEAN ? get_boolean_from_string(value) :
- ARG_UNDEFINED_VALUE);
+ char *value = getStringToLower(value_raw);
+ int result = 0; /* probably a save default value */
+
+ if (strcmp(token, ".direction") == 0)
+ {
+ result = (strcmp(value, "left") == 0 ? MV_LEFT :
+ strcmp(value, "right") == 0 ? MV_RIGHT :
+ strcmp(value, "up") == 0 ? MV_UP :
+ strcmp(value, "down") == 0 ? MV_DOWN : MV_NO_MOVING);
+ }
+ else if (strcmp(token, ".anim_mode") == 0)
+ {
+ result = (string_has_parameter(value, "loop") ? ANIM_LOOP :
+ string_has_parameter(value, "linear") ? ANIM_LINEAR :
+ string_has_parameter(value, "pingpong") ? ANIM_PINGPONG :
+ string_has_parameter(value, "pingpong2") ? ANIM_PINGPONG2 :
+ string_has_parameter(value, "random") ? ANIM_RANDOM :
+ ANIM_LOOP);
+
+ if (string_has_parameter(value, "reverse"))
+ result |= ANIM_REVERSE;
+ }
+ else /* generic parameter of type integer or boolean */
+ {
+ result = (strcmp(value, ARG_UNDEFINED) == 0 ? ARG_UNDEFINED_VALUE :
+ type == TYPE_INTEGER ? get_integer_from_string(value) :
+ type == TYPE_BOOLEAN ? get_boolean_from_string(value) :
+ ARG_UNDEFINED_VALUE);
+ }
+
+ free(value);
+
+ return result;