projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20020510-8-src
[rocksndiamonds.git]
/
src
/
libgame
/
gadgets.c
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index 6cbf30703d6f5088643952d494452099034e7b25..7f5125d20cd885cf059dc131b0d7eb761be9ff7d 100644
(file)
--- a/
src/libgame/gadgets.c
+++ b/
src/libgame/gadgets.c
@@
-1,7
+1,7
@@
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1994-200
0
Artsoft Entertainment *
+* (c) 1994-200
1
Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
@@
-82,11
+82,6
@@
static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my)
static void default_callback_info(void *ptr)
{
static void default_callback_info(void *ptr)
{
-#if 0
- if (game_status == LEVELED)
- HandleEditorGadgetInfoText(ptr);
-#endif
-
return;
}
return;
}
@@
-309,7
+304,9
@@
static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
break;
case GDI_CHECKED:
break;
case GDI_CHECKED:
- gi->checked = va_arg(ap, boolean);
+ /* take care here: "boolean" is typedef'ed as "unsigned char",
+ which gets promoted to "int" */
+ gi->checked = (boolean)va_arg(ap, int);
break;
case GDI_RADIO_NR:
break;
case GDI_RADIO_NR:
@@
-849,15
+846,27
@@
void HandleGadgets(int mx, int my, int button)
if (last_info_gi != new_gi ||
(new_gi && new_gi->type == GD_TYPE_DRAWING_AREA && changed_position))
{
if (last_info_gi != new_gi ||
(new_gi && new_gi->type == GD_TYPE_DRAWING_AREA && changed_position))
{
- last_info_gi = new_gi;
-
if (new_gi != NULL && (button == 0 || new_gi == last_gi))
{
if (new_gi != NULL && (button == 0 || new_gi == last_gi))
{
- new_gi->event.type =
0
;
+ new_gi->event.type =
GD_EVENT_INFO_ENTERING
;
new_gi->callback_info(new_gi);
}
new_gi->callback_info(new_gi);
}
- else
+ else if (last_info_gi != NULL)
+ {
+ last_info_gi->event.type = GD_EVENT_INFO_LEAVING;
+ last_info_gi->callback_info(last_info_gi);
+
+#if 0
default_callback_info(NULL);
default_callback_info(NULL);
+
+ printf("It seems that we are leaving gadget [%s]!\n",
+ (last_info_gi != NULL &&
+ last_info_gi->info_text != NULL ?
+ last_info_gi->info_text : ""));
+#endif
+ }
+
+ last_info_gi = new_gi;
}
if (gadget_pressed)
}
if (gadget_pressed)