altimeter.c 1.71 KB

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1995, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/

/*
 *  Get slider verts
 */
void
get_slider_verts(Dynamic * dp, float vpalt)
{
	float           altitude;
	int             newy;

	altitude = get_altitude() + vpalt;

	altitude *= 200.0 / 250.0;	/*
								 * scale to screen 
								 */
	newy = altitude > 209.0 ? 209 : (int) altitude;
	newy = newy < 0 ? 0 : newy;
	newy = newy - 110;

	dp->slider[0].v.ob[0] = -129;
	dp->slider[0].v.ob[1] = newy;
	dp->slider[0].v.ob[2] = 0;
	dp->slider[0].v.flag = 0;
	dp->slider[0].v.tc[0] = 0;
	dp->slider[0].v.tc[1] = 0;
	dp->slider[0].v.cn[0] = 255;
	dp->slider[0].v.cn[1] = 0;
	dp->slider[0].v.cn[2] = 0;
	dp->slider[0].v.cn[3] = 255;

	dp->slider[1].v.ob[0] = -122;
	dp->slider[1].v.ob[1] = newy;
	dp->slider[1].v.ob[2] = 0;
	dp->slider[1].v.flag = 0;
	dp->slider[1].v.tc[0] = 0;
	dp->slider[1].v.tc[1] = 0;
	dp->slider[1].v.cn[0] = 255;
	dp->slider[1].v.cn[1] = 0;
	dp->slider[1].v.cn[2] = 0;
	dp->slider[1].v.cn[3] = 255;
}