Set axis plane vertical.
@@ -550,3 +550,92 @@ HRESULT openbor_get_axis_plane_vertical_int_property()_int_property(ScriptVarian
#undef ARG_HANDLE
#undef ARG_INDEX
}
+
+// Caskey, Damon V.
+// 2018-05-14
+//
+// Mutate an axis property. Requires
+// the handle from axis property, property
+// name to modify, and the new value.
+HRESULT openbor_set_axis_plane_vertical_int_property(ScriptVariant **varlist, ScriptVariant **pretvar, int paramCount)
+{
+ #define SELF_NAME "openbor_set_axis_plane_vertical_int_property(void handle, char property, value)"
+ #define ARG_MINIMUM 3 // Minimum required arguments.
+ #define ARG_HANDLE 0 // Handle (pointer to property structure).
+ #define ARG_PROPERTY 1 // Property to access.
+ #define ARG_VALUE 2 // New value to apply.
+
+ int result = S_OK; // Success or error?
+ s_axis_plane_vertical_int *handle = NULL; // Property handle.
+ e_axis_plane_vertical_properties property = 0; // Property to access.
+
+ // Value carriers to apply on properties after
+ // taken from argument.
+ int temp_int;
+
+ // Map string property name to a
+ // matching integer constant.
+ mapstrings_axis_plane_vertical_property(varlist, paramCount);
+
+ // Verify incoming arguments. There should at least
+ // be a pointer for the property handle and an integer
+ // to determine which property is accessed.
+ if(paramCount < ARG_MINIMUM
+ || varlist[ARG_HANDLE]->vt != VT_PTR
+ || varlist[ARG_PROPERTY]->vt != VT_INTEGER)
+ {
+ *pretvar = NULL;
+ goto error_local;
+ }
+
+ // Populate local handle and property vars.
+ handle = (s_axis_plane_vertical_int *)varlist[ARG_HANDLE]->ptrVal;
+ property = (LONG)varlist[ARG_PROPERTY]->lVal;
+
+ // All values are same type for this property set,
+ // so we can copy to temp var right here.
+ if(!SUCCEEDED(ScriptVariant_IntegerValue(varlist[ARG_VALUE], &temp_int)))
+ {
+ goto error_local;
+ }
+
+ // Which property to modify?
+ switch(property)
+ {
+
+ case _AXIS_PLANE_VERTICAL_X:
+
+ handle->x = temp_int;
+
+ break;
+
+ case _AXIS_PLANE_VERTICAL_Y:
+
+ handle->y = temp_int;
+
+ break;
+
+ default:
+
+ printf("Unsupported property.\n");
+ goto error_local;
+
+ break;
+ }
+
+ return result;
+
+ // Error trapping.
+ error_local:
+
+ printf("You must provide a valid binding handle, property, and new value: " SELF_NAME "\n");
+
+ result = E_FAIL;
+ return result;
+
+ #undef SELF_NAME
+ #undef ARG_MINIMUM
+ #undef ARG_HANDLE
+ #undef ARG_PROPERTY
+ #undef ARG_VALUE
+}
