Decompile fn_23602 (PreloadCommonSprites)

Batch #6204 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_23602 PreloadCommonSprites: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, alisonrag, gordaoprogramas
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/Resource/ResourcePreload.cpp
This commit is contained in:
ragnarok-clanker 2026-10-30 19:58:30 +00:00
commit 9ee42b5459
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,48 @@
#include "Resource/ResourcePreload.h"
#include "Resource/Resource.h"
#include "Resource/ResourceMgr.h"
// GLOBAL: gl_25068
int g_spriteHalfWidth;
// GLOBAL: gl_25069
int g_spriteHalfHeight;
// OFFSET: 0x00DFCDA0
// FUNCTION: fn_23602
void PreloadCommonSprites() {
CRes* shadowAction = ResourceMgr::Instance().Load("shadow.act");
CRes* shadowSprite = ResourceMgr::Instance().Load("shadow.spr");
if (shadowAction) {
shadowAction->Lock();
}
if (shadowSprite) {
shadowSprite->Lock();
}
const int halfWidth = g_spriteHalfWidth;
const int halfHeight = g_spriteHalfHeight;
g_spriteHalfWidth = 0;
g_spriteHalfHeight = 0;
CRes* cursorAction = ResourceMgr::Instance().Load("cursors.act");
CRes* cursorSprite = ResourceMgr::Instance().Load("cursors.spr");
if (cursorAction) {
cursorAction->Lock();
}
if (cursorSprite) {
cursorSprite->Lock();
}
CRes* numberAction = ResourceMgr::Instance().Load("이팩트\\숫자.act");
CRes* numberSprite = ResourceMgr::Instance().Load("이팩트\\숫자.spr");
if (numberAction) {
numberAction->Lock();
}
if (numberSprite) {
numberSprite->Lock();
}
g_spriteHalfWidth = halfWidth;
g_spriteHalfHeight = halfHeight;
}