| 8 FACE face; |
8 FACE face; |
| 9 face = (FACE)malloc(sizeof(*face)); |
9 face = (FACE)malloc(sizeof(*face)); |
| 10 |
10 |
| 11 switch(kind){ |
11 switch(kind){ |
| 12 case DOG: |
12 case DOG: |
| 13 init_dog(face); |
13 init_dog(face); |
| 14 break; |
14 break; |
| 15 case SHARK: |
15 case SHARK: |
| 16 init_shark(face); |
16 init_shark(face); |
| 17 break; |
17 break; |
| 18 default: |
18 default: |
| 19 printf("default face\n"); |
19 printf("default face\n"); |
| 20 init_dog(face); |
20 init_dog(face); |
| 21 break; |
21 break; |
| 22 } |
22 } |
| 23 return face; |
23 return face; |
| 24 } |
24 } |
| 25 |
25 |
| 26 void draw_face(FACE face, GLfloat zrot, GLfloat yrot, BOOL left_eye, BOOL right_eye, GLfloat mouth_open, DIRECTION dir, OUTPUT_MODE mode){ |
26 void draw_face(FACE face, GLfloat zrot, GLfloat yrot, BOOL left_eye, BOOL right_eye, GLfloat mouth_open, DIRECTION dir, OUTPUT_MODE mode){ |
| 27 face->draw_func(face, zrot, yrot, left_eye, right_eye, mouth_open, dir, mode); |
27 face->draw_func(face, zrot, yrot, left_eye, right_eye, mouth_open, dir, mode); |
| 28 } |
28 } |