Curation round 20: player update, costumes and render, Missing No., the last actives and cards, familiars, Pin, the Frail, Wormwood and the Heretic, Dross to Gehenna, effects and the devil room purchase, champion colours, the quit path, save fields, shared vector helpers

This commit is contained in:
shweet committed 2026-11-22 00:33:35 -05:00
1 parent ee863e70e6
commit 8dbeb1bc4a
168 files changed
+15682 -2399

No files matched your search

+30 -2
View File
@@ -16,6 +16,16 @@
#include <filesystem>
#include <unordered_map>
// 00a15640 A value's place between inMin and inMax carried between outMin and outMax, logging an empty range.
float lerp_range(float value, const LerpRange& range)
{
if (range.inMin == range.inMax)
KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Start and End parameters cannot be the same!");
float t = (value - range.inMin) / (range.inMax - range.inMin);
if (range.isClamped) t = std::clamp(t, 0.0f, 1.0f);
return (range.outMax - range.outMin) * t + range.outMin;
}
using simdjson::dom::array;
using simdjson::dom::element;
using simdjson::dom::object;
@@ -35,6 +45,10 @@ constexpr std::string_view SHADOW_LAYER_NAME = "shadow";
constexpr std::string_view APPEAR_ANIMATION = "Appear";
constexpr std::string_view IDLE_ANIMATION = "Idle";
constexpr std::string_view CHAMPION_COLOR_UNIFORM = "ChampionColor";
constexpr std::string_view COLOR_OFFSET_SHADER = "ColorOffset";
constexpr std::string_view COLOR_OFFSET_CHAMPION_SHADER = "ColorOffsetChampion";
constexpr std::string_view COLOR_OFFSET_DOGMA_SHADER = "ColorOffsetDogma";
constexpr std::string_view COLOR_OFFSET_GOLD_SHADER = "ColorOffsetGold";
// Delirium's forms swap a boss's or monster's spritesheets for the ones under DELIRIUM_FORMS_FOLDER.
constexpr int DELIRIUM_TYPE = 412;
@@ -1208,6 +1222,21 @@ static KAGE::Graphics::BlendMode layer_blend_get(const LayerState& layer)
(Factor)mode[BLEND_RGB_DEST], (Factor)mode[BLEND_ALPHA_SOURCE], (Factor)mode[BLEND_ALPHA_DEST]};
}
// 00682260 Makes the shader a layer's render flags ask for current, when it is loaded.
// A layer keeping its shader sets none and returns false.
static bool layer_shader_select(unsigned int flags)
{
std::string_view name = COLOR_OFFSET_SHADER;
if (flags & ANIM_RENDER_COLOROFFSET_CHAMPION) name = COLOR_OFFSET_CHAMPION_SHADER;
else if (flags & ANIM_RENDER_STATIC) name = COLOR_OFFSET_DOGMA_SHADER;
else if (flags & ANIM_RENDER_GOLDEN) name = COLOR_OFFSET_GOLD_SHADER;
else if (flags & ANIM_RENDER_SHADER_KEPT) return false;
KAGE::Graphics::Shader* shader = KAGE::Graphics::manager.shader_find(name);
if (shader) KAGE::Graphics::manager.currentShader = shader;
return true;
}
// 00409120 Draws one keyframe of a layer track with the layer's spritesheet, colour, blending and shader.
// The original reads past the sprite's layers for a track keying a missing layer. Here it draws nothing.
void AnimationLayer::RenderFrame(const SpriteDraw& draw, int frameIndex, const ANM2& animation) const
@@ -1245,8 +1274,7 @@ void AnimationLayer::RenderFrame(const SpriteDraw& draw, int frameIndex, const A
tint._blue = color._tint[2];
tint._alpha = color._tint[3];
tint._unk = 0;
if (isChampion || isShimmering || !(flags & ANIM_RENDER_SHADER_KEPT))
apply_sprite_shader_params(color, SPRITE_SHADER_COLOR_APPLY, *layer.spriteSheet);
if (layer_shader_select(flags)) apply_sprite_shader_params(color, SPRITE_SHADER_COLOR_APPLY, *layer.spriteSheet);
if (isChampion)
KAGE::Graphics::manager.currentShader->set_uniform(CHAMPION_COLOR_UNIFORM, KAGE::Graphics::UNIFORM_VEC4,
&animation.championColor);