projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20060112-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
gadgets.c
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index 2f980f3c1cf0065ec44b37312b6e6de90b5e0f05..1b368c569f703cb37f0245f1e09cf6d72b53bd12 100644
(file)
--- a/
src/libgame/gadgets.c
+++ b/
src/libgame/gadgets.c
@@
-163,12
+163,16
@@
static void default_callback_action(void *ptr)
static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct)
{
static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct)
{
+ struct GadgetDesign *gd;
int state = (pressed ? GD_BUTTON_PRESSED : GD_BUTTON_UNPRESSED);
int state = (pressed ? GD_BUTTON_PRESSED : GD_BUTTON_UNPRESSED);
- struct GadgetDesign *gd = (!gi->active ? &gi->alt_design[state] :
- gi->checked ? &gi->alt_design[state] :
- &gi->design[state]);
boolean redraw_selectbox = FALSE;
boolean redraw_selectbox = FALSE;
+ if (gi == NULL)
+ return;
+
+ gd = (!gi->active ? &gi->alt_design[state] :
+ gi->checked ? &gi->alt_design[state] : &gi->design[state]);
+
switch (gi->type)
{
case GD_TYPE_NORMAL_BUTTON:
switch (gi->type)
{
case GD_TYPE_NORMAL_BUTTON:
@@
-686,6
+690,9
@@
static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
{
int tag = first_tag;
{
int tag = first_tag;
+ if (gi == NULL)
+ return;
+
while (tag != GDI_END)
{
switch(tag)
while (tag != GDI_END)
{
switch(tag)
@@
-1149,6
+1156,9
@@
void ModifyGadget(struct GadgetInfo *gi, int first_tag, ...)
void RedrawGadget(struct GadgetInfo *gi)
{
void RedrawGadget(struct GadgetInfo *gi)
{
+ if (gi == NULL)
+ return;
+
if (gi->mapped)
DrawGadget(gi, gi->state, gi->direct_draw);
}
if (gi->mapped)
DrawGadget(gi, gi->state, gi->direct_draw);
}