engine/source/openborscript/drawmethod.c
// Use string property argument to find an
// integer property constant and populate
// varlist->lval.
Use string property argument to find an
integer property constant and populate
varlist->lval.
Use string property argument to find an integer property constant and populate varlist - > lval .
int mapstrings_drawmethod(ScriptVariant **varlist, int paramCount)
{
#define ARG_MINIMUM     2   // Minimum number of arguments allowed in varlist.
#define ARG_PROPERTY    1   // Varlist element carrying which property is requested.
	char *propname = NULL;  
	int prop;               
	static const char *proplist[] =
	{
		"alpha",
		"background_transparency",
		"center_x",
		"center_y",
		"channel_blue",
		"channel_green",
		"channel_red",
		"clip_position_x",
		"clip_position_y",
		"clip_size_x",
		"clip_size_y",
		"colorset_index",
		"colorset_table",
		"enable",
		"fill_color",
		"flip_x",
		"flip_y",
		"repeat_x",
		"repeat_y",
		"rotate",
		"rotate_flip",
		"scale_x",
		"scale_y",
		"shift_x",
		"span_x",
		"span_y",
		"tag",
		"tint_color",
		"tint_mode",
		"water_mode",
		"water_perspective",
		"water_size_begin",
		"water_size_end",
		"water_wave_amplitude",
		"water_wave_length",
		"water_wave_speed",
		"water_wave_time"
	};
	if (paramCount < ARG_MINIMUM)
	{
		return 1;
	}
	MAPSTRINGS(varlist[ARG_PROPERTY], proplist, _DRAWMETHOD_END,
		"Property name '%s' is not supported by drawmethod.\n");
	return 1;
#undef ARG_MINIMUM
#undef ARG_PROPERTY
}
int mapstrings_drawmethod ( ScriptVariant * * varlist , int paramCount ) { #define ARG_MINIMUM      2   // Minimum number of arguments allowed in varlist. #define ARG_PROPERTY     1   // Varlist element carrying which property is requested. char * propname = NULL ; int prop ; static const char * proplist [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " } ; if ( paramCount < ARG_MINIMUM ) { return 1 ; } MAPSTRINGS ( varlist [ ARG_PROPERTY ] , proplist , _DRAWMETHOD_END , " \n " ) ; return 1 ; #undef  ARG_MINIMUM #undef  ARG_PROPERTY }
Use string property argument to find an
integer property constant and populate
varlist->lval.
Use string property argument to find an integer property constant and populate varlist - > lval .
// Placeholder for string property name from varlist. // Placeholder for integer constant located by string. // If the minimum argument count // was not passed, then there is // nothing to map. Return true - we'll // catch the mistake in property access // functions. // See macro - will return 0 on fail. // If we made it this far everything should be OK.