XPlor/libs/xassets/xgfxdrawsurffields.cpp

52 lines
1.5 KiB
C++
Raw Normal View History

2025-09-03 13:06:58 -04:00
#include "xgfxdrawsurffields.h"
XGfxDrawSurfFields::XGfxDrawSurfFields()
: XAsset()
, mObjectId(0)
, mReflectionProbeIndex(0)
, mCustomIndex(0)
, mMaterialSortedIndex(0)
, mPrepass(0)
, mPrimaryLightIndex(0)
, mSurfType(0)
, mPrimarySortKey(0)
, mUnused(0)
{
2025-09-10 21:58:26 -04:00
SetName("GFX Draw Surface Fields");
2025-09-03 13:06:58 -04:00
}
2025-09-10 21:58:26 -04:00
void XGfxDrawSurfFields::ParseData(XDataStream *aStream)
2025-09-03 13:06:58 -04:00
{
// Read the raw 64-bit value from the stream
2025-09-10 21:58:26 -04:00
quint64 raw;
*aStream >> raw;
2025-09-10 21:58:26 -04:00
if (IsDebug())
{
qDebug() << QString("[%1] raw = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(raw);
}
// Decode bitfields from the 64-bit packed value
2025-09-10 21:58:26 -04:00
// mObjectId =- raw & 0xFFFF; // bits 0-15
// mReflectionProbeIndex = (raw >> 16) & 0xFF; // bits 16-23
// mCustomIndex = (raw >> 24) & 0x1F; // bits 24-28
// mMaterialSortedIndex = (raw >> 29) & 0x7FF; // bits 29-39
// mPrepass =- (raw >> 40) & 0x3; // bits 40-41
// mPrimaryLightIndex = (raw >> 42) & 0xFF; // bits 42-49
// mSurfType =- (raw >> 50) & 0xF; // bits 50-53
// mPrimarySortKey = (raw >> 54) & 0x3F; // bits 54-59
// mUnused =- (raw >> 60) & 0xF; // bits 60-63
2025-09-03 13:06:58 -04:00
}
void XGfxDrawSurfFields::Clear()
{
mObjectId = 0;
mReflectionProbeIndex = 0;
mCustomIndex = 0;
mMaterialSortedIndex = 0;
mPrepass = 0;
mPrimaryLightIndex = 0;
mSurfType = 0;
mPrimarySortKey = 0;
mUnused = 0;
}