From f306e75eb3ae049007e8b4647e35cb22eacf9f81 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 19 Jan 2023 15:11:41 +0900 Subject: [PATCH] Minor tweaks to anims --- src/3d/anim_model_still.cc | 4 +++- src/3d_renderer.cc | 15 +++++++++------ src/constants.h | 8 +++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/3d/anim_model_still.cc b/src/3d/anim_model_still.cc index a27e1fe..5082157 100644 --- a/src/3d/anim_model_still.cc +++ b/src/3d/anim_model_still.cc @@ -14,7 +14,9 @@ AnimModelStill::~AnimModelStill() {} void AnimModelStill::do_update(float dt) { timer -= dt; } void AnimModelStill::do_draw() { - DrawModel(*model, A3FToRV3(pos), 1.0F, A4CToC(color)); + if (model) { + DrawModel(*model, A3FToRV3(pos), 1.0F, A4CToC(color)); + } } bool AnimModelStill::is_done_impl() { return timer <= 0.0F; } diff --git a/src/3d_renderer.cc b/src/3d_renderer.cc index 255613d..4af02b3 100644 --- a/src/3d_renderer.cc +++ b/src/3d_renderer.cc @@ -731,12 +731,15 @@ int Renderer3D::setup_anims(int idx, int score) { p2_model, A3F{score * 2.0F + 1.0F, 0.0F, 0.0F}, A4C{200, 200, 255, 255})); } else { - newAnim->push_anim(std::make_unique( - p1_model, A3F{score * 2.0F - 1.0F, 0.0F, 0.0F}, - A4C{255, 200, 200, 255})); - newAnim->push_anim(std::make_unique( - p2_model, A3F{score * 2.0F + 1.0F, 0.0F, 0.0F}, - A4C{200, 200, 255, 255})); + newAnim->push_anim(std::make_unique( + A3F{p1_pos.x, p1_pos.y, 0.0F}, A4C{255, 200, 200, 255}, &spriteSheet, + p1_dims, false, &deferred_2d_draw_map)); + newAnim->push_anim(std::make_unique( + A3F{p2_pos.x, p2_pos.y, 0.0F}, A4C{200, 200, 255, 255}, &spriteSheet, + p2_dims, true, &deferred_2d_draw_map)); + newAnim->push_anim(std::make_unique( + nullptr, A3F{0.0F, 0.0F, 0.0F}, A4C{255, 255, 255, 255}, + MODEL_STILL_FALLING_WAIT_TIME)); } using DataT = std::tuple; diff --git a/src/constants.h b/src/constants.h index c9a080b..48a4198 100644 --- a/src/constants.h +++ b/src/constants.h @@ -93,9 +93,11 @@ constexpr float MODEL_ATTACK_2_Y = 0.0F; constexpr float MODEL_ATTACK_ANGLE_START = 0.0F; constexpr float MODEL_ATTACK_ANGLE_END = 90.0F; -constexpr float MODEL_FALLING_2D_DX = 80.0F; -constexpr float MODEL_FALLING_2D_DY = -30.0F; -constexpr float MODEL_FALLING_2D_DDY = 150.0F; +constexpr float MODEL_FALLING_2D_DX = 90.0F; +constexpr float MODEL_FALLING_2D_DY = -40.0F; +constexpr float MODEL_FALLING_2D_DDY = 180.0F; constexpr float MODEL_FALLING_2D_DA = 270.0F; +constexpr float MODEL_STILL_FALLING_WAIT_TIME = 0.5F; + #endif -- 2.49.0