Decompile 4 functions in Source/Contents/SpriteFrameSynchronization.cpp, Source/Contents/NpcLocationRadius.cpp, ...
Batch #1694 by eAthena: 0 byte-identical, 4 confirmed by peer review. - fn_23819 CSession::GetSyncedFrame: logic confirmed by peer review - fn_23467 CSession::GetNpcLocationRadius: logic confirmed by peer review - fn_23823 CSession::GetRidingJob: logic confirmed by peer review - fn_24152 CSession::GetSpriteJob: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Contents/SpriteFrameSynchronization.cpp, Source/Contents/NpcLocationRadius.cpp, Source/Contents/SpriteJob.cpp
This commit is contained in:
parent
7a88edb84c
commit
0bc20896db
5 changed files with 657 additions and 1 deletions
29
Source/Contents/SpriteFrameSynchronization.cpp
Normal file
29
Source/Contents/SpriteFrameSynchronization.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Resource/Sprites/ActionResource.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <timeapi.h>
|
||||
|
||||
// OFFSET: 0x00E12D70
|
||||
// FUNCTION: fn_23819
|
||||
const ActionFrame* CSession::GetSyncedFrame(CActRes* baseAct, CActRes* act, unsigned action, int baseFrame, std::uint32_t startTime, int* frame) {
|
||||
if (!baseAct || !act) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int baseCount = baseAct->FrameCount(action);
|
||||
int count = act->FrameCount(action);
|
||||
if (baseCount <= 0 || count <= 0 || baseCount >= count || count % baseCount != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int ratio = count / baseCount;
|
||||
int speed = static_cast<int>(act->Speed(action));
|
||||
float elapsed = (timeGetTime() - startTime) / 24.0;
|
||||
if (speed == 0) {
|
||||
speed = 4;
|
||||
}
|
||||
|
||||
*frame = static_cast<int>(elapsed / speed) % ratio + ratio * baseFrame;
|
||||
return &act->Frame(action, *frame);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue