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
117 lines
4.4 KiB
C++
117 lines
4.4 KiB
C++
#include "Render/ScreenRectangle.h"
|
|
#include "Render/Primitives/RenderPrimitivePool.h"
|
|
#include "Render/Primitives/RenderQueues.h"
|
|
#include "Render/Textures/Texture.h"
|
|
#include "Render/Textures/TextureCache.h"
|
|
|
|
// OFFSET: 0x0054E590
|
|
// FUNCTION: fn_01953
|
|
void DrawBlendedRectangle(
|
|
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, bool depthAlpha,
|
|
float depthStart, float depthEnd
|
|
) {
|
|
if ((color & 0xFF000000u) == 0) {
|
|
return;
|
|
}
|
|
|
|
RenderPrimitive* primitive = primitives.Acquire();
|
|
primitive->texture = g_texMgr.Default();
|
|
const float left = static_cast<float>(x);
|
|
const float top = static_cast<float>(y);
|
|
const float right = static_cast<float>(x + width);
|
|
const float bottom = static_cast<float>(y + height);
|
|
primitive->quad[0].x = left;
|
|
primitive->quad[0].y = top;
|
|
primitive->quad[1].x = right;
|
|
primitive->quad[1].y = top;
|
|
primitive->quad[2].x = left;
|
|
primitive->quad[2].y = bottom;
|
|
primitive->quad[3].x = right;
|
|
primitive->quad[3].y = bottom;
|
|
for (RenderVertex& vertex : primitive->quad) {
|
|
vertex.z = 0.000001f;
|
|
vertex.rhw = 0.000001f;
|
|
vertex.diffuse = color;
|
|
vertex.u = 0.0f;
|
|
vertex.v = 0.0f;
|
|
}
|
|
primitive->unknown_0018 = 5;
|
|
primitive->unknown_001C = 6;
|
|
queues.Submit(primitive, 517, depthAlpha, depthStart, depthEnd);
|
|
}
|
|
|
|
// OFFSET: 0x0054ED40
|
|
// FUNCTION: fn_01954
|
|
void DrawTexturedRectangle(
|
|
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, CTexture* texture,
|
|
bool depthAlpha, float depthStart, float depthEnd
|
|
) {
|
|
if ((color & 0xFF000000u) == 0) {
|
|
return;
|
|
}
|
|
|
|
RenderPrimitive* primitive = primitives.Acquire();
|
|
primitive->texture = texture ? texture : g_texMgr.Default();
|
|
const float left = static_cast<float>(x);
|
|
const float top = static_cast<float>(y);
|
|
const float right = static_cast<float>(x + width);
|
|
const float bottom = static_cast<float>(y + height);
|
|
primitive->quad[0].x = left;
|
|
primitive->quad[0].y = top;
|
|
primitive->quad[0].u = 0.0f;
|
|
primitive->quad[0].v = 0.0f;
|
|
primitive->quad[1].x = right;
|
|
primitive->quad[1].y = top;
|
|
primitive->quad[1].u = 1.0f;
|
|
primitive->quad[1].v = 0.0f;
|
|
primitive->quad[2].x = left;
|
|
primitive->quad[2].y = bottom;
|
|
primitive->quad[2].u = 0.0f;
|
|
primitive->quad[2].v = 1.0f;
|
|
primitive->quad[3].x = right;
|
|
primitive->quad[3].y = bottom;
|
|
primitive->quad[3].u = 1.0f;
|
|
primitive->quad[3].v = 1.0f;
|
|
for (RenderVertex& vertex : primitive->quad) {
|
|
vertex.z = 0.000001f;
|
|
vertex.rhw = 0.999999f;
|
|
vertex.diffuse = color;
|
|
}
|
|
queues.Submit(primitive, 513, depthAlpha, depthStart, depthEnd);
|
|
}
|
|
|
|
// OFFSET: 0x0054EFD0
|
|
// FUNCTION: fn_01955
|
|
void DrawTextureRegion(
|
|
RenderPrimitivePool& primitives, RenderQueues& queues, float x, float y, float width, float height, std::uint32_t color,
|
|
CTexture* texture, bool depthAlpha, float depthStart, float depthEnd
|
|
) {
|
|
if ((color & 0xFF000000u) == 0) {
|
|
return;
|
|
}
|
|
|
|
RenderPrimitive* primitive = primitives.Acquire();
|
|
primitive->texture = texture ? texture : g_texMgr.Default();
|
|
primitive->quad[0].x = x;
|
|
primitive->quad[0].y = y;
|
|
primitive->quad[0].u = g_textureOffsetX / static_cast<float>(texture->TextureWidth());
|
|
primitive->quad[0].v = g_textureOffsetY / static_cast<float>(texture->TextureHeight());
|
|
primitive->quad[1].x = x + width;
|
|
primitive->quad[1].y = y;
|
|
primitive->quad[1].u = (static_cast<float>(texture->Width()) + g_textureOffsetX) / static_cast<float>(texture->TextureWidth());
|
|
primitive->quad[1].v = g_textureOffsetY / static_cast<float>(texture->TextureHeight());
|
|
primitive->quad[2].x = x;
|
|
primitive->quad[2].y = y + height;
|
|
primitive->quad[2].u = g_textureOffsetX / static_cast<float>(texture->TextureWidth());
|
|
primitive->quad[2].v = (static_cast<float>(texture->Height()) + g_textureOffsetY) / static_cast<float>(texture->TextureHeight());
|
|
primitive->quad[3].x = x + width;
|
|
primitive->quad[3].y = y + height;
|
|
primitive->quad[3].u = (static_cast<float>(texture->Width()) + g_textureOffsetX) / static_cast<float>(texture->TextureWidth());
|
|
primitive->quad[3].v = (static_cast<float>(texture->Height()) + g_textureOffsetY) / static_cast<float>(texture->TextureHeight());
|
|
for (RenderVertex& vertex : primitive->quad) {
|
|
vertex.z = 0.000001f;
|
|
vertex.rhw = 0.999999f;
|
|
vertex.diffuse = color;
|
|
}
|
|
queues.Submit(primitive, 513, depthAlpha, depthStart, depthEnd);
|
|
}
|