speed up and extend scroll length of startanim

This commit is contained in:
2024-11-10 15:37:22 -06:00
parent 06989d61c3
commit 05f5520cfb
2 changed files with 5 additions and 4 deletions

View File

@@ -266,10 +266,11 @@ void draw_startup_anim(bool advance) {
anim_from = anim_to; anim_from = anim_to;
anim_from.offset(-1,-4 + startup_anim_pos); anim_from.offset(-1,-4 + startup_anim_pos);
if(advance) startup_anim_pos = (startup_anim_pos + 1) % 542; auto scroll_sprite = *ResMgr::graphics.get("startanim",true);
if(advance) startup_anim_pos = (startup_anim_pos + 1) % scroll_sprite.getSize().y;
rect_draw_some_item(*ResMgr::graphics.get("startbut",true),anim_size,mainPtr,startup_button[STARTBTN_SCROLL]); rect_draw_some_item(*ResMgr::graphics.get("startbut",true),anim_size,mainPtr,startup_button[STARTBTN_SCROLL]);
anim_to.offset(startup_button[STARTBTN_SCROLL].left, startup_button[STARTBTN_SCROLL].top); anim_to.offset(startup_button[STARTBTN_SCROLL].left, startup_button[STARTBTN_SCROLL].top);
rect_draw_some_item(*ResMgr::graphics.get("startanim",true),anim_from,mainPtr,anim_to,sf::BlendAlpha); rect_draw_some_item(scroll_sprite,anim_from,mainPtr,anim_to,sf::BlendAlpha);
} }
void draw_startup_stats() { void draw_startup_stats() {

View File

@@ -978,10 +978,10 @@ void update_terrain_animation() {
} }
void update_startup_animation() { void update_startup_animation() {
static const long twentyTicks = time_in_ticks(20).asMilliseconds(); static const long interval = time_in_ticks(10).asMilliseconds();
if(overall_mode != MODE_STARTUP) return; if(overall_mode != MODE_STARTUP) return;
if(animTimer.getElapsedTime().asMilliseconds() < twentyTicks) return; if(animTimer.getElapsedTime().asMilliseconds() < interval) return;
draw_startup_anim(true); draw_startup_anim(true);
animTimer.restart(); animTimer.restart();