neverlosecc / source2gen

Source2 games SDK generator
http://s2gen.com
Apache License 2.0
193 stars 31 forks source link

Embedding non-pointer props #28

Closed DucaRii closed 5 months ago

DucaRii commented 5 months ago

I went ahead and implemented my idea from https://github.com/neverlosecc/source2gen/issues/26

Ive opted to go with adding the offsets into the metadata of the prop for simplicity sake. Though i still had to make minor changes to the code structure in order to avoid bloat.

The conditions for whether a prop should be directly embedded are as follows

With the changes applied a dump will now embed ~50 classes across all binaries and will look like this

// MNetworkEnable
// -> m_hModel - 0x200
// -> m_ModelName - 0x208
// -> m_bClientClothCreationSuppressed - 0x248
// -> m_MeshGroupMask - 0x2e0
// -> m_nIdealMotionType - 0x382
// -> m_nForceLOD - 0x383
// -> m_nClothUpdateFlags - 0x384
CModelState m_modelState; // 0x160  
DucaRii commented 5 months ago

alright should be good 2 go, couldnt really think of a good name for the "usedby" constant but this one should be good enough

es3n1n commented 5 months ago

@cpz is a bit busy with some other stuff for now, as soon as he reviews this PR, we will merge it. sorry for the delays :)

DucaRii commented 5 months ago

all good ^.^

cpz commented 5 months ago

👍