Decompile 2 functions in Source/Render/AlphaRectangle.cpp, Source/Client/ModeFade.cpp, ...
Batch #1027 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_01952 DrawAlphaRectangle: logic confirmed by peer review - fn_17842 ModeFade::Draw: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Render/AlphaRectangle.cpp, Source/Client/ModeFade.cpp
This commit is contained in:
parent
51e57d4b27
commit
2035aa96de
4 changed files with 92 additions and 0 deletions
26
Source/Client/ModeFade.cpp
Normal file
26
Source/Client/ModeFade.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "Client/ModeFade.h"
|
||||
#include "Contents/Sound/SoundMgr.h"
|
||||
#include "Render/Primitives/AlphaRectangle.h"
|
||||
|
||||
#include <timeapi.h>
|
||||
|
||||
// GLOBAL: gl_24680
|
||||
std::uint32_t g_modeFadeTick = 0;
|
||||
|
||||
// OFFSET: 0x00AD6740
|
||||
// FUNCTION: fn_17842
|
||||
void ModeFade::Draw() {
|
||||
if (this->requested != 0) {
|
||||
g_modeFadeTick = timeGetTime();
|
||||
g_soundMgr->FadeIn();
|
||||
this->requested = 0;
|
||||
}
|
||||
|
||||
const std::uint32_t elapsed = timeGetTime() - g_modeFadeTick;
|
||||
if (elapsed < 255) {
|
||||
DrawAlphaRectangle(
|
||||
this->primitives, this->textures, this->queues, 0, 0, this->screenWidth, this->screenHeight, (255 - elapsed) << 24, this->depthAlpha, this->depthStart,
|
||||
this->depthEnd
|
||||
);
|
||||
}
|
||||
}
|
||||
26
Source/Client/ModeFade.h
Normal file
26
Source/Client/ModeFade.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef RAGNAROK_SOURCE_CLIENT_MODEFADE_H
|
||||
#define RAGNAROK_SOURCE_CLIENT_MODEFADE_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class RenderPrimitivePool;
|
||||
class TextureCache;
|
||||
struct RenderQueues;
|
||||
|
||||
extern std::uint32_t g_modeFadeTick;
|
||||
|
||||
struct ModeFade {
|
||||
int& requested;
|
||||
RenderPrimitivePool& primitives;
|
||||
TextureCache& textures;
|
||||
RenderQueues& queues;
|
||||
const int& screenWidth;
|
||||
const int& screenHeight;
|
||||
const bool& depthAlpha;
|
||||
const float& depthStart;
|
||||
const float& depthEnd;
|
||||
|
||||
void Draw();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue