gta-reversed / gta-reversed-modern

Reimplementation of GTA:SA 1.0 US

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to get texture size in bytes

plakapenka opened this issue · comments

I won't stop apologizing, but...

How to get the size of a texture that lies on an object, in bytes, by model number or entity point?

Could you elaborate please?

I have an entity, I want to make a debug render with Dff size and texture size display. There are no problems with the first one
(CStreaming::GetInfo(entity->m_nModelIndex).GetCdSize() * STREAMING_SECTOR_SIZE) / 1024
but I can’t find the texture size..

image

just get the associated rwdict (it should be in the model info), and get it's size.
edit: it's m_nTxdIndex

Like?

auto modelInfo = CModelInfo::GetModelInfo(modelId)->AsPedModelInfoPtr();
auto txd = CTxdStore::ms_pTxdPool->GetAt(modelInfo->m_nTxdIndex);

ok, I saw this, but I still don’t understand where to get the size from RwTexDictionary

you can get the CStreamingInfo of the txd.
eg CStreaming::GetInfo(TXDToModelID(modelInfo->m_nTxdIndex))...

ahhhh, got it. Thank you