477
|
1 #include <stdio.h>
|
|
2
|
|
3 struct enemy{
|
|
4 int charno; // image number
|
|
5 float x; // x location
|
|
6 float y; // y location
|
|
7 int ap; // armor point
|
|
8 };
|
|
9 void
|
|
10 print_param(struct enemy *e)
|
|
11 {
|
|
12 printf("charno:%d x,y:%f,%f hp:%d\n",
|
|
13 e->charno,e->x,e->y,e->ap);
|
|
14 }
|
|
15
|
|
16 typedef struct{
|
|
17 char dest;
|
|
18 int VF01[4];
|
|
19 code (*ret)();
|
|
20 void *env;
|
|
21 } interface;
|
|
22
|
|
23 code a0(interface a) {
|
|
24 printf("%d\n",a.dest);
|
|
25 goto a.ret(0),a.env;
|
|
26 }
|
|
27
|
|
28
|
|
29 int main(int argc,char *argv[])
|
|
30 {
|
|
31 struct enemy e;
|
|
32 #if 0
|
|
33 interface args = {15,{0,0,0,0},return,environment};
|
|
34 #else
|
|
35 interface args = {15,{0,0,0,0},0,0};
|
|
36 args.ret = return;
|
|
37 args.env = environment;
|
|
38 #endif
|
|
39
|
|
40 e.charno=5; e.x=50.0; e.y=30.0; e.ap=100;
|
|
41 print_param(&e);
|
|
42
|
|
43 printf("%d %d\n",args.VF01[2],args.VF01[1]);
|
|
44 goto a0(args);
|
|
45 }
|
|
46
|