rodecomp/Source/Contents/Effects/EffectPrimitiveSprites.cpp
ragnarok-clanker dc3d5ce1a5 Maintenance: Resubmission of 14942 (gate: three existing in-class helpers whose lines changed lacked an annotation; marked // INLINED
Batch #14943 by ragnarok-clanker: no function's compiled code changes; checked with 741 compiled unit(s), including every includer of Source/ActorPickNode.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeDragState.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Contents/AchievementMgr.h, Source/Contents/ActorNameCard.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObjectState.h, Source/Contents/Actors/Skill.h, Source/Contents/AdventureGuideMgr.h, Source/Contents/Camera/Camera.h, Source/Contents/Camera/CameraState.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AMachineEffect.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CaneOfEvilEyeEffect.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/CloudKillEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectMaker.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/FuumaShouakuEffect.h, Source/Contents/Effects/GravityControlEffect.h, Source/Contents/Effects/HealSpEffect.h, Source/Contents/Effects/Level99Effect.h, Source/Contents/Effects/MapChainEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/NyanggrassEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/PowderingEffect.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Effects/ShadowExceedEffect.h, Source/Contents/Effects/SkillEffects.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StormCannonEffect.h, Source/Contents/Effects/ThrowEffects.h, Source/Contents/EntryQueueMgr.h, Source/Contents/EquipmentResourceMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/GuildInfo.h, Source/Contents/Items/ItemDescription.h, Source/Contents/Items/ItemInfo.h, Source/Contents/MapSkyMgr.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Models/ModelNode.h, Source/Contents/NavigationManager.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/RDamageVar.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/RouletteMgr.h, Source/Contents/Schedule/Schedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/ClientSkills.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Skills/SkillInfo.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TipBoxTitles.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/World/World.h, Source/Contents/WorldView/WorldViewData.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/Textures/SpritePixels.h, Source/Render/Textures/Texture.h, Source/Resource/EZeffectResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Resource/XmlNode.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UISpriteButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/CashEmotion/UICashEmotionPack.h, Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UIChatRoomMakeWnd.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Chat/UISubChatMiniWnd.h, Source/UI/Chat/UIWhisperWnd.h, Source/UI/Clan/UIClanWnd.h, Source/UI/Dialogs/UIBookWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIMenuWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIMinimapZoomWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Dialogs/UISelectCartWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/Exchange/UIExchangeUI.h, Source/UI/FrameSkin.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Gauges/UIPcGage.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Guild/UIGuild_Storage_Log.h, Source/UI/Item/UIEquipmentPropertiesWnd.h, Source/UI/Item/UIItemBaseWnd.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemShopWnd.h, Source/UI/Item/UIItemShopWnd2.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIMerchantItemLogWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UICardItemIllustWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIGameItem.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemIdentifyWnd.h, Source/UI/Items/UIItemParamChangeDisplayWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Layout/WindowGeometry.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBoxV2Wnd.h, Source/UI/Lists/UIImgMenu.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITagListBox.h, Source/UI/Lists/UITreeView.h, Source/UI/Menu/UIMenuIconWnd.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIQuestDisplay.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h, Source/UI/Shop/UIMerchantItemPurchaseWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/Skill/UISkillDescribeWnd.h, Source/UI/Skill/UISkillListWnd.h, Source/UI/SkillDelayInfo/SkillDelayInfo.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/UIAchWnd.h, Source/UI/Text/UIBalloonText.h, Source/UI/Text/UINameBalloonText.h, Source/UI/Text/UIStaticTextControl.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBarGraph.h, Source/UI/UIBartermarketWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/UIMacroBlackListCheckWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroReport.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/UIPreviewEquipWnd.h, Source/UI/UIRefiningWnd.h, Source/UI/UIScrollWnd.h, Source/UI/UISlotBitmap.h, Source/UI/Window/FuncDrawWNDChar.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UIMonsterInfoWnd.h, Source/UI/Window/UINavigationHelpWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UIRodexContentsWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITransMenuWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Utility/Lexicon/LexiconSerializer.h.
2026-11-08 16:44:36 +00:00

296 lines
13 KiB
C++

#include "Contents/Actors/ActorEnums.h"
#include "Contents/Effects/EffectPrim.h"
#include "Contents/Effects/EffectPrimitiveState.h"
#include "Contents/Effects/RagEffect.h"
#include "Contents/Actors/GameActor.h"
#include "Contents/Actors/Pc.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/World/World.h"
#include "Render/Projection/RendererViewport.h"
#include "Render/Renderer.h"
#include "Render/SpriteGeometry.h"
#include "Render/SpriteQuad.h"
#include "Render/Textures/SpritePixels.h"
#include "Resource/Sprites/ActionResource.h"
#include "Resource/Sprites/SpriteResource.h"
#include "Resource/World/TerrainResource.h"
#include "Utility/Math/AffineMatrix.h"
#include <cstdint>
// OFFSET: 0x00BF58F0
// FUNCTION: fn_19997
__declspec(safebuffers) void CEffectPrim::RenderLaunchEffects(matrix&) {
vector3d vec1;
vector3d vec2;
vector3d vec3;
vector3d vec4;
vec1.x = 0.0f;
vec1.y = 0.0f;
vec1.z = 0.0f;
vec2.x = 0.0f;
vec2.y = 0.0f;
vec2.z = 0.0f;
vec3.x = 0.0f;
vec3.y = 0.0f;
vec3.z = 0.0f;
vec4.x = 0.0f;
vec4.y = 0.0f;
vec4.z = 0.0f;
for (int ec = 0; ec < 4; ++ec) {
const EffectPrimitiveSlot& slot = this->state.slots[ec];
if (slot.life != 1) {
continue;
}
const float rx = slot.distance;
vec1.x = rx * g_cosTable[45];
vec1.y = 0.0f;
vec1.z = rx * g_sinTable[45];
vec2.x = rx * g_cosTable[135];
vec2.y = 0.0f;
vec2.z = rx * g_sinTable[135];
vec3.x = rx * g_cosTable[225];
vec3.y = 0.0f;
vec3.z = rx * g_sinTable[225];
vec4.x = rx * g_cosTable[315];
vec4.y = 0.0f;
vec4.z = rx * g_sinTable[315];
this->Tei_TowardScreen(vec1, vec2, vec3, vec4, this->state.slots[0].alphaT, this->state.slots[1].alphaT);
const float baseX = slot.vecBPre.x;
const float baseY = slot.vecBPre.y;
const float baseZ = slot.vecBPre.z;
vec1.x = baseX + vec1.x;
vec1.y = baseY + vec1.y;
vec1.z = baseZ + vec1.z;
vec2.x = baseX + vec2.x;
vec2.y = baseY + vec2.y;
vec2.z = baseZ + vec2.z;
vec3.x = baseX + vec3.x;
vec3.y = baseY + vec3.y;
vec3.z = baseZ + vec3.z;
vec4.x = baseX + vec4.x;
vec4.y = baseY + vec4.y;
vec4.z = baseZ + vec4.z;
if (vec1.y > 0.0f || slot.process >= 300 || static_cast<int>(slot.height[13]) <= 0) {
continue;
}
if (slot.flag1[0] == 0) {
if (static_cast<float>(g_session.m_aid) == slot.height[10]) {
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
CRagEffect* effect = gameMode->scene->player->LaunchEffect(850, vector3d{0.0f, 0.0f, 0.0f}, 0.0f);
if (effect) {
vector3d position{baseX, baseY, baseZ};
effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast<int>(&position), 0, 0, 0, 0);
}
} else {
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (auto* actor = static_cast<CGameActor*>(gameMode->scene->GetGameActorByAID(static_cast<std::uint32_t>(slot.height[10])))) {
CRagEffect* effect = actor->LaunchEffect(850, vector3d{0.0f, 0.0f, 0.0f}, 0.0f);
if (effect) {
vector3d position{baseX, baseY, baseZ};
effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast<int>(&position), 0, 0, 0, 0);
}
}
}
} else {
if (static_cast<float>(g_session.m_aid) == slot.height[10]) {
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
CRagEffect* effect = gameMode->scene->player->LaunchEffect(932, vector3d{0.0f, 0.0f, 0.0f}, 0.0f);
if (effect) {
vector3d position{baseX, baseY, baseZ};
effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast<int>(&position), 0, 0, 0, 0);
}
} else {
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (auto* actor = static_cast<CGameActor*>(gameMode->scene->GetGameActorByAID(static_cast<std::uint32_t>(slot.height[10])))) {
CRagEffect* effect = actor->LaunchEffect(932, vector3d{0.0f, 0.0f, 0.0f}, 0.0f);
if (effect) {
vector3d position{baseX, baseY, baseZ};
effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast<int>(&position), 0, 0, 0, 0);
}
}
}
}
}
}
// OFFSET: 0x00BF5D80
// FUNCTION: fn_19998
__declspec(safebuffers) void CEffectPrim::RenderGroundSprite(matrix& wtm) {
if (this->state.master) {
this->render.position = this->state.master->render.position;
}
const float z = this->render.position.z;
CGameMode* mode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
float position[3];
position[0] = this->render.position.x;
position[1] = mode->scene->terrain->Height(this->render.position.x, this->render.position.z);
position[2] = z;
const float depth = position[0] * wtm.values[2] + position[1] * wtm.values[5] + z * wtm.values[8] + wtm.values[11];
float screenX;
float screenY;
float reciprocalDepth;
g_renderer->ProjectViewport(position, wtm.values, &screenX, &screenY, &reciprocalDepth);
float distanceScale = g_renderer->ScaleDistance(reciprocalDepth);
CRagEffect* master = this->state.master;
if (master->state.type == 1240 && master && master->state.parent) {
master->state.parent->ScaleByFadePulse(distanceScale);
}
CSprRes* sprite = static_cast<CGameActor*>(static_cast<CRenderObject*>(this))->GetSprite();
CActRes* action = this->GetActRes();
const ActionFrame& frame = action->Frame(this->render.previousAnimation, this->render.curMotion);
for (int index = 0; index < frame.cellCount; ++index) {
const SpriteFrameCell& cell = action->Frame(this->render.previousAnimation, this->render.curMotion).Cell(index);
if (cell.image == -1) {
return;
}
const SpriteRleImage* image = sprite->images[cell.imageType][cell.image];
const double factor = distanceScale;
const float left = static_cast<float>(cell.x * factor * cell.scaleX + screenX);
const float right = static_cast<float>(((static_cast<short>(image->doubleWidth) + 1) * image->width + cell.x) * factor * cell.scaleX + screenX + 1.0);
const float lift = static_cast<float>(static_cast<double>(*reinterpret_cast<const std::int64_t*>(&this->state.spriteLiftLow)));
const float top = static_cast<float>(cell.y * factor * cell.scaleY + screenY) - lift;
const float bottom = static_cast<float>(((static_cast<short>(image->doubleHeight) + 1) * image->height + cell.y) * factor * cell.scaleY + screenY + 1.0) - lift;
if (top >= static_cast<float>(g_renderer->viewport.height) || bottom <= 0.0f || left >= static_cast<float>(g_renderer->viewport.width) ||
right <= 0.0f) {
return;
}
SpriteQuad quad;
quad.top = top;
quad.left = static_cast<float>(static_cast<int>(this->render.spriteOffsetX)) + left;
quad.bottom = bottom;
quad.right = static_cast<float>(static_cast<int>(this->render.spriteOffsetX)) + right;
const std::uint32_t color = static_cast<std::uint32_t>(((static_cast<std::uint32_t>(cell.color >> 24) << 8 | (cell.color & 0xFF)) << 8 | (cell.color >> 8 & 0xFF)) << 8) |
(cell.color >> 16 & 0xFF);
quad.bottomRhw = 1.0f / (depth - (bottom - screenY) * g_cotangent) + 0.00001f;
quad.topRhw = 1.0f / (depth - (top - screenY) * g_cotangent) + 0.00001f;
quad.angle = static_cast<float>(cell.rotation);
const float alphaScale = static_cast<unsigned char>(static_cast<int>(this->state.alpha)) / 255.0f;
quad.color = static_cast<std::uint32_t>(static_cast<unsigned char>(static_cast<int>(alphaScale * static_cast<float>(color >> 24)))) << 24 | (color & 0xFFFFFF);
quad.image = image;
this->DrawQuad(quad, sprite->palette, this->state.renderFlag, 0.0f, 0.0f, 0);
}
}
// INLINED
static __declspec(safebuffers) __forceinline void DrawTrailSpriteQuad(
CEffectPrim& prim, const vector3d& base, float top, float left, float bottom, float right, float screenY, float depth, float depthBias,
float angle, std::uint32_t color, const SpriteRleImage* image, const std::uint32_t* palette, int blend
) {
SpriteQuad quad;
quad.image = image;
quad.top = base.y + top;
quad.bottom = base.y + bottom;
quad.left = base.x + left;
quad.right = base.x + right;
quad.color = color;
quad.bottomRhw = 1.0f / ((bottom - screenY) * g_tangent + depth) + depthBias;
quad.topRhw = 1.0f / ((top - screenY) * g_tangent + depth) + depthBias;
quad.angle = angle;
prim.DrawQuad(quad, palette, blend, 0.0f, 0.0f, 0);
}
// OFFSET: 0x00BF6170
// FUNCTION: fn_19999
void CEffectPrim::RenderSegmentSpriteTrail(matrix& wtm) {
CSprRes* sprite = static_cast<CGameActor*>(static_cast<CRenderObject*>(this))->GetSprite();
CActRes* action = this->GetActRes();
const short alpha = static_cast<short>(this->state.alpha);
for (int ec = 0; ec < 4; ++ec) {
const EffectPrimitiveSlot& slot = this->state.slots[ec];
if (slot.life <= 0 || !(this->state.alpha > 0.0f)) {
continue;
}
for (int seg = 0; seg < this->state.numSegment; ++seg) {
EffectPrimitiveRecord& record = this->state.records[seg];
const float depth = record.position.y * wtm.values[5] + record.position.x * wtm.values[2] + record.position.z * wtm.values[8] + wtm.values[11];
float screenX;
float screenY;
float reciprocalDepth;
g_renderer->ProjectViewport(&record.position.x, wtm.values, &screenX, &screenY, &reciprocalDepth);
const float distanceScale = g_renderer->ScaleDistance(reciprocalDepth);
const ActionFrame& frame = action->Frame(this->render.previousAnimation, this->render.curMotion);
for (int index = 0; index < frame.cellCount; ++index) {
const SpriteFrameCell& cell = frame.Cell(index);
if (cell.image == -1) {
continue;
}
const SpriteRleImage* image = sprite->images[cell.imageType][cell.image];
const double scale = record.scale;
const float top = static_cast<float>(cell.y * scale * cell.scaleY * distanceScale + screenY);
const float bottom = static_cast<float>(((static_cast<short>(image->doubleHeight) + 1) * image->height + cell.y) * scale * cell.scaleY * distanceScale + screenY);
if (top >= static_cast<float>(g_renderer->viewport.height) || bottom <= 0.0f) {
continue;
}
float left;
float right;
if ((cell.mirrored & 1) != 0) {
left = static_cast<float>(((static_cast<short>(image->doubleWidth) + 1) * image->width + cell.x) * scale * cell.scaleX * distanceScale + screenX);
right = static_cast<float>(cell.x * scale * cell.scaleX * distanceScale + screenX);
if (right >= static_cast<float>(g_renderer->viewport.width) || left <= 0.0f) {
continue;
}
} else {
left = static_cast<float>(cell.x * scale * cell.scaleX * distanceScale + screenX);
right = static_cast<float>(((static_cast<short>(image->doubleWidth) + 1) * image->width + cell.x) * scale * cell.scaleX * distanceScale + screenX);
if (left >= static_cast<float>(g_renderer->viewport.width) || right <= 0.0f) {
continue;
}
}
const unsigned char red = static_cast<unsigned char>(cell.color);
const unsigned char green = static_cast<unsigned char>(cell.color >> 8);
const unsigned char blue = static_cast<unsigned char>(cell.color >> 16);
const std::uint32_t color = (((((alpha << 8) + red) << 8) + green) << 8) + blue;
const float angle = static_cast<float>(cell.rotation) + this->state.roll;
DrawTrailSpriteQuad(*this, slot.vecBPre, top, left, bottom, right, screenY, depth, 0.0001f, angle, color, image, sprite->palette, 0x101);
const float glowTop = top - 2.0f;
const float glowBottom = bottom + 2.0f;
const float glowLeft = left - 2.0f;
const float glowRight = right + 2.0f;
const std::uint32_t paleGlow = (alpha << 24) + 0x64FF64;
const std::uint32_t brightGlow = (alpha << 24) + 0x0AFF0A;
DrawTrailSpriteQuad(
*this, slot.vecBPre, glowTop, glowLeft, glowBottom, glowRight, screenY, depth, 0.0002f, angle, slot.flag1[0] == 2 ? brightGlow : paleGlow, image,
sprite->palette, 5
);
const std::uint32_t halfColor = (((((alpha / 2 << 8) + red) << 8) + green) << 8) + blue;
DrawTrailSpriteQuad(*this, slot.vecBNow, top, left, bottom, right, screenY, depth, 0.0001f, angle, halfColor, image, sprite->palette, 0x101);
DrawTrailSpriteQuad(
*this, slot.vecBNow, glowTop, glowLeft, glowBottom, glowRight, screenY, depth, 0.0002f, angle, slot.flag1[0] == 2 ? brightGlow : paleGlow, image,
sprite->palette, 5
);
DrawTrailSpriteQuad(*this, slot.vecTPre, top, left, bottom, right, screenY, depth, 0.0001f, angle, color, image, sprite->palette, 0x101);
DrawTrailSpriteQuad(
*this, slot.vecTPre, glowTop, glowLeft, glowBottom, glowRight, screenY, depth, 0.0002f, angle, slot.flag1[0] == 2 ? brightGlow : paleGlow, image,
sprite->palette, 5
);
}
}
}
}