X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=7d0c731ba252e532f0df5cf6ca38a648c8818fb0;hb=234748b5eb0bc4fe29a36fd25a1d25658f53858a;hp=bd79cc787135c9e05e7e9692620ffc1fd31a8822;hpb=7cd6d9ecca4ccd4927eddc994b616569ef23b231;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index bd79cc78..7d0c731b 100644 --- a/src/init.c +++ b/src/init.c @@ -1137,6 +1137,28 @@ static void InitGraphicInfo() if (parameter[GFX_ARG_MODE_REVERSE]) new_graphic_info[i].anim_mode |= ANIM_REVERSE; +#if 1 + /* set first frame of animation after determining animation mode */ + new_graphic_info[i].anim_start_frame = parameter[GFX_ARG_START_FRAME]; + if (new_graphic_info[i].anim_start_frame == -1) + new_graphic_info[i].anim_start_frame = 0; + else if (new_graphic_info[i].anim_mode & ANIM_REVERSE) + new_graphic_info[i].anim_start_frame = + new_graphic_info[i].anim_frames + - new_graphic_info[i].anim_start_frame - 1; +#else + /* set first frame of animation after determining animation mode */ + new_graphic_info[i].anim_start_frame = parameter[GFX_ARG_START_FRAME]; + if (parameter[GFX_ARG_START_FRAME] == -1) /* default: start with ... */ + { + if (parameter[GFX_ARG_MODE_REVERSE]) + new_graphic_info[i].anim_start_frame = + new_graphic_info[i].anim_frames - 1; /* ... last frame */ + else + new_graphic_info[i].anim_start_frame = 0; /* ... first frame */ + } +#endif + /* animation synchronized with global frame counter, not move position */ new_graphic_info[i].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC]; }