Batch #2069 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_19755 EquipmentResourceMgr::GetRobeResourceName: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy Reviewed-by: ragnarok-clanker
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#include "Contents/Actors/SpriteDrawingPolicy.h"
|
|
#include "Client/Session.h"
|
|
#include "Contents/Camera/Camera.h"
|
|
#include "Render/SpriteGeometry.h"
|
|
#include "Script/LuaScript.h"
|
|
|
|
constexpr float robeTopLayerThreshold = 320.0f;
|
|
|
|
// GLOBAL: gl_24739
|
|
float g_cameraDistance = 300.0f;
|
|
|
|
struct AccessoryLayerDepth {
|
|
const int& bottomAccessory;
|
|
const int& topAccessory;
|
|
const int& middleAccessory;
|
|
|
|
void OffsetLayerDepth(int layer, SpriteCellQuad& quad, float bottomDepth, float topDepth) const;
|
|
};
|
|
|
|
// OFFSET: 0x0080DAA0
|
|
// FUNCTION: fn_10103
|
|
void SpriteDrawingPolicy::OffsetLayerDepth(int layer, SpriteCellQuad& quad, float bottomDepth, float topDepth) const {
|
|
switch (layer) {
|
|
case 2:
|
|
if (g_cameraDistance < robeTopLayerThreshold) {
|
|
quad.bottomDepth = bottomDepth + 0.000027f;
|
|
quad.topDepth = topDepth + 0.000027f;
|
|
} else {
|
|
quad.bottomDepth = bottomDepth;
|
|
quad.topDepth = topDepth;
|
|
}
|
|
break;
|
|
case 3:
|
|
if (g_cameraDistance < robeTopLayerThreshold) {
|
|
quad.bottomDepth = bottomDepth + 0.00004f;
|
|
quad.topDepth = 0.0001f + topDepth;
|
|
} else {
|
|
quad.bottomDepth = bottomDepth;
|
|
quad.topDepth = 0.000045f + topDepth;
|
|
}
|
|
break;
|
|
case 4:
|
|
if (g_cameraDistance < robeTopLayerThreshold) {
|
|
bottomDepth += 0.00003f;
|
|
topDepth += 0.00003f;
|
|
}
|
|
quad.bottomDepth = bottomDepth;
|
|
quad.topDepth = topDepth;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x0080E4D0
|