Decompile 2 functions in Source/Client/ModeFadeOut.cpp, Source/Client/ModeFadeOut.h, ...
Batch #1037 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_17847 FadeOutMode: logic confirmed by peer review - fn_17148 DrawBitmapResource: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). Adds to the build: Source/Client/ModeFadeOut.cpp, Source/Render/BitmapDrawing.cpp
This commit is contained in:
parent
f3ceb09e9d
commit
c60cbe211b
5 changed files with 77 additions and 0 deletions
35
Source/Client/ModeFadeOut.cpp
Normal file
35
Source/Client/ModeFadeOut.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include "Client/ModeFadeOut.h"
|
||||
#include "Client/ModeFade.h"
|
||||
#include "Contents/Sound/SoundMgr.h"
|
||||
#include "Render/BitmapDrawing.h"
|
||||
#include "Render/Primitives/AlphaRectangle.h"
|
||||
#include "Render/Renderer.h"
|
||||
#include "Resource/Bitmap/BitmapResource.h"
|
||||
#include "Resource/ResourceMgr.h"
|
||||
#include "Resource/TextureNames.h"
|
||||
|
||||
#include <timeapi.h>
|
||||
|
||||
// OFFSET: 0x00AD6960
|
||||
// FUNCTION: fn_17847
|
||||
std::uint32_t FadeOutMode(CRenderer& renderer, CRenderSystemBase& system, TextureCache& textures, ResourceMgr& resources, TextureNames& names,
|
||||
int showLogo, bool depthAlpha, float depthStart, float depthEnd) {
|
||||
g_soundMgr->FadeOut();
|
||||
g_modeFadeTick = timeGetTime();
|
||||
renderer.CaptureBackBuffer();
|
||||
std::uint32_t elapsed = timeGetTime() - g_modeFadeTick;
|
||||
while (elapsed < 255) {
|
||||
DrawAlphaRectangle(renderer.primitives, textures, renderer.queues, 0, 0, renderer.viewport.width, renderer.viewport.height, elapsed << 24,
|
||||
depthAlpha, depthStart, depthEnd);
|
||||
if (showLogo != 0) {
|
||||
auto* logo = static_cast<CBitmapRes*>(resources.Load(names.Resolve("rag_logo.bmp")));
|
||||
DrawBitmapResource(system, renderer.viewport.width - 192, renderer.viewport.height - 122, logo);
|
||||
}
|
||||
if (renderer.Draw()) {
|
||||
renderer.Present(1);
|
||||
}
|
||||
renderer.RestoreBackBuffer();
|
||||
elapsed = timeGetTime() - g_modeFadeTick;
|
||||
}
|
||||
return elapsed;
|
||||
}
|
||||
15
Source/Client/ModeFadeOut.h
Normal file
15
Source/Client/ModeFadeOut.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef RAGNAROK_SOURCE_CLIENT_MODEFADEOUT_H
|
||||
#define RAGNAROK_SOURCE_CLIENT_MODEFADEOUT_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class CRenderer;
|
||||
class CRenderSystemBase;
|
||||
class TextureCache;
|
||||
class ResourceMgr;
|
||||
struct TextureNames;
|
||||
|
||||
std::uint32_t FadeOutMode(CRenderer& renderer, CRenderSystemBase& system, TextureCache& textures, ResourceMgr& resources, TextureNames& names,
|
||||
int showLogo, bool depthAlpha, float depthStart, float depthEnd);
|
||||
|
||||
#endif
|
||||
16
Source/Render/BitmapDrawing.cpp
Normal file
16
Source/Render/BitmapDrawing.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "Render/BitmapDrawing.h"
|
||||
#include "Render/DeviceContext/DCBitmap.h"
|
||||
#include "Resource/Bitmap/BitmapResource.h"
|
||||
|
||||
// OFFSET: 0x00A8FC30
|
||||
// FUNCTION: fn_17148
|
||||
void DrawBitmapResource(CRenderSystemBase& system, int x, int y, const CBitmapRes* bitmap) {
|
||||
if (!bitmap) {
|
||||
return;
|
||||
}
|
||||
|
||||
CDCBitmap* surface = CreateBitmapDC(bitmap->image.width, bitmap->image.height, true);
|
||||
surface->Copy(0, 0, bitmap->image.width, bitmap->image.height, bitmap->image.pixels, true);
|
||||
surface->Draw(system, x, y, bitmap->image.width, bitmap->image.height, 0xFFFFFFFF);
|
||||
delete surface;
|
||||
}
|
||||
9
Source/Render/BitmapDrawing.h
Normal file
9
Source/Render/BitmapDrawing.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef RAGNAROK_SOURCE_RENDER_BITMAPDRAWING_H
|
||||
#define RAGNAROK_SOURCE_RENDER_BITMAPDRAWING_H
|
||||
|
||||
class CRenderSystemBase;
|
||||
class CBitmapRes;
|
||||
|
||||
void DrawBitmapResource(CRenderSystemBase& system, int x, int y, const CBitmapRes* bitmap);
|
||||
|
||||
#endif
|
||||
|
|
@ -258,6 +258,7 @@
|
|||
"Source/Client/Mode/ModeDragState.cpp": 2,
|
||||
"Source/Client/Mode/ModeTooltip.cpp": 2,
|
||||
"Source/Client/ModeFade.cpp": 0,
|
||||
"Source/Client/ModeFadeOut.cpp": 0,
|
||||
"Source/Client/Registry.cpp": 0,
|
||||
"Source/Client/Replay.cpp": 0,
|
||||
"Source/Client/ReplayPacketRecorder.cpp": 2,
|
||||
|
|
@ -430,6 +431,7 @@
|
|||
"Source/Network/Packets/SkillUpdatePacket.cpp": 4,
|
||||
"Source/Network/TextEncoding.cpp": 0,
|
||||
"Source/Render/AlphaRectangle.cpp": 0,
|
||||
"Source/Render/BitmapDrawing.cpp": 0,
|
||||
"Source/Render/BlendColor.cpp": 0,
|
||||
"Source/Render/DX7/BackBufferDX7.cpp": 0,
|
||||
"Source/Render/DX7/DeviceCapabilitiesDX7.cpp": 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue