rfg-modding / Nanoforge

A modding tool for Red Faction Guerilla Re-Mars-Tered
MIT License
31 stars 3 forks source link

Render object texture sharing #57

Closed Moneyl closed 1 year ago

Moneyl commented 1 year ago

Update Territory.Load() to only create one Texture2D instance per texture file. Have render objects share them instead of creating their own instances of each texture. Will be important once building importing is ported.

As for texture lifetime. Its simple for now. NF only loads assets when the map is opened and destroys them when its closed. There's no dynamic loading/unloading of assets yet so we don't need to keep track of how many live objects are dependent on each texture before deleting them.

Moneyl commented 1 year ago

Resolved by 6802158f53fe5a3830119aef235e9d74c4b765c6