altimeter.c
1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**************************************************************************
* *
* 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;
}