annotate plugins/crazychat/face.c @ 13045:704dc95d0198

[gaim-migrate @ 15404] "I'll take shit that abosofreakinglutely rocks for 400, Alex." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 26 Jan 2006 05:30:39 +0000
parents ed017b9c532d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11218
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
1 #include "face.h"
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
2 #include "sharky.h"
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
3 #include "doggy.h"
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
4 #include <assert.h>
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
5
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
6 FACE init_face(KIND kind)
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
7 {
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
8 FACE face;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
9 face = (FACE)malloc(sizeof(*face));
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
10
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
11 switch(kind){
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
12 case DOG:
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
13 init_dog(face);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
14 break;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
15 case SHARK:
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
16 init_shark(face);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
17 break;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
18 default:
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
19 printf("default face\n");
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
20 init_dog(face);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
21 break;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
22 }
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
23 return face;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
24 }
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
25
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
26 void draw_face(FACE face, GLfloat zrot, GLfloat yrot, BOOL left_eye, BOOL right_eye, GLfloat mouth_open, DIRECTION dir, OUTPUT_MODE mode){
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
27 face->draw_func(face, zrot, yrot, left_eye, right_eye, mouth_open, dir, mode);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
28 }
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
29
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
30 void change_materials(FACE f, int* mats, int num_change){
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
31 int i;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
32 assert(!(num_change<0 || num_change>NUM_PARTS));
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
33 for(i=0;i<num_change;i++){
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
34 f->mat_indeces[i]=mats[i];
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
35 }
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
36 }
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
37
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
38 void free_face(FACE f){}