30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
Uint8 pfwidth,pfheight;
Sint8 gameover,key_ignored;
Uint8 generation_number_inc;
Uint32 move_number;
unsigned char*quiz_text;
Inventory*inventory;
Uint32 ninventory;
typedef struct {
Uint16 msg;
Uint32 from;
Value arg1,arg2,arg3;
} MessageVars;
|
>
>
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
Uint8 pfwidth,pfheight;
Sint8 gameover,key_ignored;
Uint8 generation_number_inc;
Uint32 move_number;
unsigned char*quiz_text;
Inventory*inventory;
Uint32 ninventory;
char**levelstrings;
Uint16 nlevelstrings;
typedef struct {
Uint16 msg;
Uint32 from;
Value arg1,arg2,arg3;
} MessageVars;
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
static const Sint8 x_delta[8]={1,1,0,-1,-1,-1,0,1};
static const Sint8 y_delta[8]={0,-1,-1,-1,0,1,1,1};
const char*value_string_ptr(Value v) {
switch(v.t) {
case TY_STRING: return stringpool[v.u];
//TODO: Level strings
default: fatal("Internal confusion: Trying to get string pointer for a non-string\n");
}
}
void pfunlink(Uint32 n) {
Object*o=objects[n];
if(o->down==VOIDLINK) playfield[o->x+o->y*64-65]=o->up;
|
|
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
static const Sint8 x_delta[8]={1,1,0,-1,-1,-1,0,1};
static const Sint8 y_delta[8]={0,-1,-1,-1,0,1,1,1};
const char*value_string_ptr(Value v) {
switch(v.t) {
case TY_STRING: return stringpool[v.u];
case TY_LEVELSTRING: return v.u<nlevelstrings?levelstrings[v.u]:"<Invalid level string>";
default: fatal("Internal confusion: Trying to get string pointer for a non-string\n");
}
}
void pfunlink(Uint32 n) {
Object*o=objects[n];
if(o->down==VOIDLINK) playfield[o->x+o->y*64-65]=o->up;
|
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
|
free(objects[i]);
}
nobjects=0;
free(objects);
objects=0;
gameover=0;
clear_inventory();
}
static void execute_animation(Uint32 obj) {
Object*o=objects[obj];
Animation*a=o->anim;
if(!(a->step[a->lstep].flag&ANI_ONCE)) return;
if(a->ltime>=a->step[a->lstep].speed) {
|
>
>
|
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
|
free(objects[i]);
}
nobjects=0;
free(objects);
objects=0;
gameover=0;
clear_inventory();
for(i=0;i<nlevelstrings;i++) free(levelstrings[i]);
nlevelstrings=0;
}
static void execute_animation(Uint32 obj) {
Object*o=objects[obj];
Animation*a=o->anim;
if(!(a->step[a->lstep].flag&ANI_ONCE)) return;
if(a->ltime>=a->step[a->lstep].speed) {
|