rodecomp/Source/Contents/Effects/NyanggrassEffect.cpp
ragnarok-clanker 23a28cce2a Decompile 2 functions in Source/Contents/Effects/NyanggrassEffect.cpp, Source/Contents/Effects/NyanggrassEffect.h
Batch #4724 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_07072 CNyanggrassEffect::Close: logic confirmed by peer review
- fn_07075 CNyanggrassEffect::Slot03: logic confirmed by peer review

Peer-reviewed-by: youko, KWDev
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-30 05:28:56 +00:00

83 lines
2.3 KiB
C++

#include "Contents/Effects/NyanggrassEffect.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/Camera/Camera.h"
#include "Contents/Effects/EffectMemoryMgr.h"
#include "Contents/Ground/GroundGeometry.h"
#include "Contents/World/World.h"
#include "Render/AuxiliarySubmission.h"
#include "Render/Projection/RendererViewport.h"
#include "Render/Renderer.h"
// OFFSET: 0x007080F0
// FUNCTION: fn_07069
void CMultiTexParticle::Render(int column, int row) {
CGameMode* gameMode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (!gameMode->scene->ground) {
return;
}
float corners[4][3];
for (int i = 0; i < 4; ++i) {
corners[i][0] = 0.0f;
corners[i][1] = 0.0f;
corners[i][2] = 0.0f;
}
if (!gameMode->scene->ground->TerrainCellCorners(*gameMode->scene->terrain, column, row, &corners[0][0])) {
return;
}
this->command.texture = this->texture1;
this->command.lightmap = this->texture2;
CGameMode* mode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
const float* cameraMatrix = mode->camera->frame.view.values;
for (int i = 0; i < 4; ++i) {
LightmappedVertex& vertex = this->command.vertices[i];
reinterpret_cast<const RenderProjection*>(g_renderer)->Project(corners[i], cameraMatrix, vertex);
vertex.z -= 0.000030517578125f;
vertex.diffuse = 0xFFFFFFFF;
vertex.u = this->uv1[i][0] + this->offsetU;
vertex.v = this->uv1[i][1] + this->offsetV;
vertex.lightU = this->uv2[i][0];
vertex.lightV = this->uv2[i][1];
}
const float depth = 0.0f;
SubmitAuxiliaryPrimitive(*g_renderer, reinterpret_cast<LightmappedPrimitive*>(&this->command), depth, depth);
}
// OFFSET: 0x00708260
// FUNCTION: fn_07070
CNyanggrassEffect::CNyanggrassEffect() : CEffect(-1), unknown_00D8(0) {
}
// OFFSET: 0x007085B0
// FUNCTION: fn_07072
void CNyanggrassEffect::Close() {
for (CParticle* particle : this->particles) {
FreeParticle(particle);
}
this->particles.clear();
}
// OFFSET: 0x00708820
// FUNCTION: fn_07074
bool CNyanggrassEffect::Slot06() {
return this->ActorExists();
}
// OFFSET: 0x00708830
// FUNCTION: fn_07075
void CNyanggrassEffect::Slot03() {
for (CParticle* particle : this->particles) {
if (particle) {
static_cast<CEZ2STRParticle*>(particle)->Process(0.0f, 0.0f, 0.0f);
}
++particle->unknown_00E8;
}
}