working on mouse
This commit is contained in:
parent
e8fbc401e6
commit
26f128f251
|
@ -230,8 +230,28 @@ enum {
|
||||||
el_max,
|
el_max,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *el_names[] = {
|
||||||
|
"none",
|
||||||
|
"none",
|
||||||
|
"title",
|
||||||
|
"scene",
|
||||||
|
"inv",
|
||||||
|
"scene",
|
||||||
|
"up",
|
||||||
|
"down",
|
||||||
|
"iup",
|
||||||
|
"idown",
|
||||||
|
"pic",
|
||||||
|
"menu",
|
||||||
|
};
|
||||||
|
|
||||||
struct el objs[el_max];
|
struct el objs[el_max];
|
||||||
|
|
||||||
|
const char *el_name(int i)
|
||||||
|
{
|
||||||
|
return el_names[objs[i].id];
|
||||||
|
}
|
||||||
|
|
||||||
void el_set(int i, int t, int x, int y, void *p)
|
void el_set(int i, int t, int x, int y, void *p)
|
||||||
{
|
{
|
||||||
objs[i].id = i;
|
objs[i].id = i;
|
||||||
|
@ -2250,6 +2270,9 @@ static int game_input(int down, const char *key, int x, int y, int mb)
|
||||||
else {
|
else {
|
||||||
int px = -1;
|
int px = -1;
|
||||||
int py = -1;
|
int py = -1;
|
||||||
|
// struct el *el = look_obj(x, y);
|
||||||
|
// if (el)
|
||||||
|
// fprintf(stderr,"%s\n", el_name(el->id));
|
||||||
game_pic_coord(x, y, &px, &py); /* got picture coord */
|
game_pic_coord(x, y, &px, &py); /* got picture coord */
|
||||||
if (game_bg_coord(x, y, &x, &y)) /* no click on bg */
|
if (game_bg_coord(x, y, &x, &y)) /* no click on bg */
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Reference in a new issue