Batch #2457 by ragnarok-clanker: 0 byte-identical, 48 confirmed by peer review. - fn_00152 TextureCache::TextureCache: logic confirmed by peer review - fn_01952 DrawAlphaRectangle: logic confirmed by peer review - fn_01953 DrawBlendedRectangle: logic confirmed by peer review - fn_01954 DrawTexturedRectangle: logic confirmed by peer review - fn_01955 DrawTextureRegion: logic confirmed by peer review - fn_02237 CRendererDX9::SaveLogo: logic confirmed by peer review - fn_02353 CRenderSystemDX9::CRenderSystemDX9: logic confirmed by peer review - fn_02447 TextureCache::~TextureCache: logic confirmed by peer review (already on main) - fn_02449 TextureCache::Upload: logic confirmed by peer review - fn_02451 TextureCache::Clear: logic confirmed by peer review (already on main) - fn_02452 TextureCache::Remove: logic confirmed by peer review (already on main) - fn_02453 TextureCache::Default: logic confirmed by peer review - fn_02454 TextureCache::Load: logic confirmed by peer review (already on main) - fn_02455 TextureCache::Create: logic confirmed by peer review - fn_02456 TextureCache::Reload: logic confirmed by peer review - fn_02457 TextureCache::ClearUnused: logic confirmed by peer review - fn_07897 EZeffectClip::Texture: logic confirmed by peer review - fn_07898 EZeffectClip::Texture: logic confirmed by peer review - fn_07958 C3dAnimModelRes::Load: logic confirmed by peer review - fn_07996 ModelNode::~ModelNode: logic confirmed by peer review - fn_08010 C3dGrannyModelRes::CreateTexture: logic confirmed by peer review - fn_08020 C3dModelResV2::ReadVersion1: logic confirmed by peer review - fn_08021 C3dModelResV2::ReadVersion2: logic confirmed by peer review - fn_08022 C3dModelResV2::ReadVersion3: logic confirmed by peer review - fn_09166 BinkMovies::Update: logic confirmed by peer review - fn_10122 UIRPData::DrawNamed: logic confirmed by peer review - fn_12091 UIWhisperWnd::Slot43: logic confirmed by peer review - fn_17556 GroundGeometry::Build: logic confirmed by peer review - fn_17565 GroundGeometry::BuildLightmaps: logic confirmed by peer review - fn_17581 GroundWaterState::Update: logic confirmed by peer review - fn_17587 GroundGeometry::DrawGrid: logic confirmed by peer review - fn_17599 GroundWaterState::Import: logic confirmed by peer review - fn_17842 ModeFade::Draw: logic confirmed by peer review - fn_17847 FadeOutMode: logic confirmed by peer review - fn_20019 CRagEffect::Blessing: logic confirmed by peer review - fn_20023 CRagEffect::Bottom: logic confirmed by peer review - fn_20024 CRagEffect::BowlingBash: logic confirmed by peer review - fn_20025 CRagEffect::CartRevolution: logic confirmed by peer review - fn_20042 CRagEffect::Entry: logic confirmed by peer review - fn_20054 CRagEffect::FrostDiver: logic confirmed by peer review - fn_20058 CRagEffect::GrimTooth: logic confirmed by peer review - fn_20066 CRagEffect::Hit4: logic confirmed by peer review - fn_20088 UpdatePartyEffect: logic confirmed by peer review - fn_20105 CRagEffect::SonicBlowHit: logic confirmed by peer review - fn_20109 CRagEffect::SprayPond: logic confirmed by peer review - fn_20124 CRagEffect::Yufitel: logic confirmed by peer review - fn_20132 CRagEffect::AirTexture: logic confirmed by peer review - fn_20133 CRagEffect::AttackEnergy2: logic confirmed by peer review Reviewed-by: ragnarok-clanker
87 lines
3.7 KiB
C++
87 lines
3.7 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDGEOMETRY_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_GROUND_GROUNDGEOMETRY_H
|
|
|
|
#include "Contents/Ground/GroundSpatial.h"
|
|
#include "Contents/Ground/GroundWaterState.h"
|
|
|
|
#include <cstddef>
|
|
#include <array>
|
|
|
|
class CGndRes;
|
|
class TextureCache;
|
|
struct GroundRenderContext;
|
|
|
|
struct GroundLightmap {
|
|
/* 0000 */ unsigned char color[4];
|
|
/* 0004 */ CTexture* texture;
|
|
/* 0008 */ float uv[4][2];
|
|
/* 0028 */ std::uint32_t unknown_0028[4];
|
|
};
|
|
|
|
class GroundGeometry {
|
|
public:
|
|
GroundGeometry();
|
|
~GroundGeometry();
|
|
GroundGeometry(const GroundGeometry&) = delete;
|
|
GroundGeometry& operator=(const GroundGeometry&) = delete;
|
|
void Build(CGndRes& resource, const float* lightDirection, const float* diffuse, const float* ambient);
|
|
void ClearGeometry();
|
|
void Reset(int columns, int rows);
|
|
GroundSpatial Spatial() const;
|
|
void Draw(const float* matrix, const int* rectangle, bool clip, GroundRenderContext& context);
|
|
void CellBounds(int column, int row, float& minimum, float& maximum) const;
|
|
bool OverlayHeights(const class C3dAttr& terrain, float* vertices, int column, int row) const;
|
|
bool CellVertices(const class C3dAttr& terrain, float* vertices, int column, int row) const;
|
|
void MarkRay(const float* ray, int column, int row, float limit);
|
|
bool CellRectangle(const class C3dAttr& terrain, int column, int row, float* vertices) const;
|
|
void DrawCellDecal(
|
|
const class C3dAttr& terrain, const float* matrix, int column, int row, std::uint32_t color, CTexture& texture, const float* uv,
|
|
GroundRenderContext& context
|
|
) const;
|
|
void DrawGridDecal(
|
|
const class C3dAttr& terrain, const float* matrix, int column, int row, std::uint32_t color, CTexture& texture, const float* uv,
|
|
GroundRenderContext& context
|
|
) const;
|
|
void DrawGrid(
|
|
const class C3dAttr& terrain, const float* matrix, int column, int row, std::uint32_t color, GroundRenderContext& context
|
|
) const;
|
|
void DrawTerrainOverlay(
|
|
const class C3dAttr& terrain, const float* matrix, int column, int row, std::uint32_t color, CTexture* texture, GroundRenderContext& context
|
|
) const;
|
|
void DrawWaterCell(int column, int row, GroundCell& cell, const float* matrix, const float* ambient, bool overrideColor, GroundRenderContext& context);
|
|
void DrawLit(const float* matrix, const int* rectangle, bool clip, struct GroundLightingContext& context);
|
|
void WorldColor(float x, float unusedY, float z, std::uint32_t* output) const;
|
|
void Lighting(int column, int row, float& red, float& green, float& blue) const;
|
|
int Slot12(int first, int second, int third, int fourth, int fifth) const;
|
|
void Slot14(int first, int second, int third, int fourth);
|
|
void Slot16(int first, int second, int third, int fourth, int fifth, int sixth);
|
|
void LightmapSample(int column, int row, unsigned char& alpha, unsigned char& red, unsigned char& green, unsigned char& blue) const;
|
|
bool TerrainCellCorners(const class C3dAttr& terrain, int column, int row, float* vertices) const;
|
|
void InitializeLighting(const class C3dAttr& terrain);
|
|
|
|
int width;
|
|
int height;
|
|
float cellSize;
|
|
int loaded;
|
|
std::vector<GroundLightmap> lightmaps;
|
|
std::vector<CTexture*> lightmapTextures;
|
|
std::vector<GroundQuad> tiles;
|
|
std::vector<std::array<float, 3>> lighting;
|
|
std::vector<GroundCell> cells;
|
|
std::uint32_t unknown_0058;
|
|
std::uint32_t unknown_005C;
|
|
GroundWaterState water;
|
|
|
|
private:
|
|
void BuildLightmaps(CGndRes& resource);
|
|
void ClearLightmaps();
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(GroundLightmap) == 56);
|
|
static_assert(offsetof(GroundLightmap, texture) == 0x04);
|
|
static_assert(offsetof(GroundLightmap, uv) == 0x08);
|
|
static_assert(offsetof(GroundLightmap, unknown_0028) == 0x28);
|
|
#endif
|
|
|
|
#endif
|