rodecomp/Source/Client/ModeFade.cpp
ragnarok-clanker 30cdd441a1 Maintenance: [forced, admin decision] Resubmission of returned batch 10026 rebased on c246e79d: also renames the CMode+0x10 write in
Batch #10033 by ragnarok-clanker: forced by an admin (0 lower score(s), 6 changed function(s)); checked with 479 compiled unit(s), including every includer of Source/Client/Application/ApplicationMessages.h, Source/Client/Application/Launcher.h, Source/Client/Mode/CMode.h, Source/Client/ModeFade.h, Source/UI/Window/UIWindowMgr.h.
2026-11-02 14:34:46 +00:00

29 lines
810 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) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, 0, 0, g_renderer->viewport.width, g_renderer->viewport.height, (255 - elapsed) << 24,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
}
}