示例#1
0
static rgb_colour get_area_ui_object_highlighted_font_colour (ui_object *obj)
{

	area_ui_object
		*area;

	rgb_colour
		col;

	int
		dr,
		dg,
		db,
		da;

	float
		t;

	area = obj->data;

	t = get_ui_object_bounded_t_value (obj);

	//
	// Interpolate the colour values
	//

	dr = ( int ) area->highlighted_font_colour_end.r - ( int ) area->highlighted_font_colour_start.r;
	dg = ( int ) area->highlighted_font_colour_end.g - ( int ) area->highlighted_font_colour_start.g;
	db = ( int ) area->highlighted_font_colour_end.b - ( int ) area->highlighted_font_colour_start.b;
	da = ( int ) area->highlighted_font_colour_end.a - ( int ) area->highlighted_font_colour_start.a;

	dr *= t;
	dg *= t;
	db *= t;
	da *= t;

	col.r = ( ( int ) area->highlighted_font_colour_start.r + dr );
	col.g = ( ( int ) area->highlighted_font_colour_start.g + dg );
	col.b = ( ( int ) area->highlighted_font_colour_start.b + db );
	col.a = ( ( int ) area->highlighted_font_colour_start.a + da );

	return (col);
	/*(
	area_ui_object
		*area;

	area = obj->data;

	return (area->highlighted_font_colour_start);
	*/
}
示例#2
0
文件: ar_pos.c 项目: Comanche93/eech
static float get_area_ui_object_x (ui_object *obj)
{
	
	area_ui_object
		*area;

	float
		x,
		px = 0;

	ui_object
		*parent;

	parent = get_ui_object_parent (obj);

	if (parent)
	{

		px = get_ui_object_x (parent);
	}

	area = (area_ui_object *) obj->data;

	x = area->x_start + ( get_ui_object_bounded_t_value (obj) * ( area->x_end - area->x_start ) );

	if (area->virtual_coords)
	{

		if (parent)
		{

			x *= get_ui_object_x_size (parent);
		}
		else
		{

			x *= get_screen_width (video_screen);
		}
	}

	return x + px;
}
示例#3
0
文件: ar_pos.c 项目: Comanche93/eech
static float get_area_ui_object_y (ui_object *obj)
{
	
	area_ui_object
		*area;

	float
		y,
		py = 0;

	ui_object
		*parent;

	parent = get_ui_object_parent (obj);

	if (parent)
	{

		py = get_ui_object_y (parent);
	}

	area = (area_ui_object *) obj->data;

	y = area->y_start + (get_ui_object_bounded_t_value (obj) * (area->y_end - area->y_start));
						
	if (area->virtual_coords)
	{

		if (parent)
		{

			y *= get_ui_object_y_size (parent);
		}
		else
		{

			y *= get_screen_height (video_screen);
		}
	}

	return y + py;
}