From: Holger Schemel Date: Fri, 27 Dec 2002 16:48:03 +0000 (+0100) Subject: rnd-20021227-2-src X-Git-Tag: 3.0.0^2~197 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3fd727f8ab7628eaab0be7de31658d7d468d6c8d;p=rocksndiamonds.git rnd-20021227-2-src --- diff --git a/src/cartoons.c b/src/cartoons.c index 5db44a29..0278ed6d 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -325,12 +325,11 @@ void InitToons() toons[i].anim_delay = 1; /* no delay between frames */ toons[i].start_frame = 0; /* always start with first */ } - - toons[i].move_delay *= GAME_FRAME_DELAY; } InitToonScreen(bitmap_db_door, BackToFront, PrepareBackbuffer, ToonNeedsRedraw, toons, NUM_TOONS, - REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); + REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, + GAME_FRAME_DELAY); } diff --git a/src/conftime.h b/src/conftime.h index 919b39ce..77d9bbf6 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-12-27 15:33]" +#define COMPILE_DATE_STRING "[2002-12-27 17:46]" diff --git a/src/editor.c b/src/editor.c index 952dbc68..7850a4f5 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2025,6 +2025,14 @@ void CreateLevelEditorGadgets() CreateCheckbuttonGadgets(); } +void FreeLevelEditorGadgets() +{ + int i; + + for (i=0; iid = getNewGadgetID(); new_gadget->callback_info = default_callback_info; new_gadget->callback_action = default_callback_action; + new_gadget->next = NULL; va_start(ap, first_tag); HandleGadgetTags(new_gadget, first_tag, ap); @@ -614,7 +614,9 @@ void FreeGadget(struct GadgetInfo *gi) if (gi == gadget_list_last_entry) gadget_list_last_entry = gi_previous; - gi_previous->next = gi->next; + if (gi_previous) + gi_previous->next = gi->next; + free(gi); } diff --git a/src/libgame/toons.c b/src/libgame/toons.c index 84a21c25..c067d2d4 100644 --- a/src/libgame/toons.c +++ b/src/libgame/toons.c @@ -78,7 +78,8 @@ void InitToonScreen(Bitmap *save_buffer, boolean (*redraw_needed_function)(void), struct ToonInfo *toons, int num_toons, int startx, int starty, - int width, int height) + int width, int height, + int frame_delay_value) { screen_info.save_buffer = save_buffer; screen_info.update_function = update_function; @@ -90,6 +91,7 @@ void InitToonScreen(Bitmap *save_buffer, screen_info.starty = starty; screen_info.width = width; screen_info.height = height; + screen_info.frame_delay_value = frame_delay_value; } void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc, @@ -148,7 +150,7 @@ boolean AnimateToon(int toon_nr, boolean restart) { horiz_move = (anim->direction & (ANIMDIR_LEFT | ANIMDIR_RIGHT)); vert_move = (anim->direction & (ANIMDIR_UP | ANIMDIR_DOWN)); - anim_delay_value = anim->move_delay; + anim_delay_value = anim->move_delay * screen_info.frame_delay_value; frame = getAnimationFrame(anim->anim_frames, anim->anim_delay, anim->anim_mode, anim->start_frame, diff --git a/src/libgame/toons.h b/src/libgame/toons.h index 75f76864..3588d7da 100644 --- a/src/libgame/toons.h +++ b/src/libgame/toons.h @@ -51,6 +51,8 @@ struct ToonScreenInfo int startx, starty; int width, height; + + int frame_delay_value; }; struct ToonInfo @@ -73,7 +75,10 @@ struct ToonInfo int getAnimationFrame(int, int, int, int, int); -void InitToonScreen(); +void InitToonScreen(Bitmap *, void (*update_function)(void), + void (*prepare_backbuffer_function)(void), + boolean (*redraw_needed_function)(void), + struct ToonInfo *, int, int, int, int, int, int); void InitAnimation(void); void StopAnimation(void); void DoAnimation(void); diff --git a/src/screens.c b/src/screens.c index 0532cdd1..ad93781b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2897,6 +2897,14 @@ void CreateScreenGadgets() CreateScreenScrollbars(); } +void FreeScreenGadgets() +{ + int i; + + for (i=0; i