rodecomp/Source/Client/ModeFade.cpp
ragnarok-clanker 385dbd4a7d Decompile fn_17842 (CMode::DrawFadeIn)
Batch #16103 by Yommy: 1 byte-identical, 0 confirmed by peer review.

- fn_17842 CMode::DrawFadeIn: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-11-10 14:13:07 +00:00

27 lines
717 B
C++

#include "Client/ModeFade.h"
#include "Client/Mode/CMode.h"
#include "Contents/Sound/SoundMgr.h"
#include "Render/Primitives/AlphaRectangle.h"
#include "Render/Renderer.h"
#include "Render/TextureQuad.h"
#include <timeapi.h>
// GLOBAL: gl_24680
std::uint32_t g_modeFadeTick = 0;
// OFFSET: 0x00AD6740
// FUNCTION: fn_17842
void CMode::DrawFadeIn() {
if (this->fadeInRequested != 0) {
g_modeFadeTick = timeGetTime();
g_soundMgr->FadeIn();
this->fadeInRequested = 0;
}
const std::uint32_t elapsed = timeGetTime() - g_modeFadeTick;
if (elapsed < 255) {
const int alpha = 255 - elapsed;
DrawAlphaRectangle(0, 0, g_renderer->viewport.width, g_renderer->viewport.height, alpha << 24);
}
}