Skip to content

Base CVector on RwV3d#295

Merged
gennariarmando merged 1 commit intoDK22Pac:masterfrom
MiranDMC:CVector_updates
Mar 30, 2026
Merged

Base CVector on RwV3d#295
gennariarmando merged 1 commit intoDK22Pac:masterfrom
MiranDMC:CVector_updates

Conversation

@MiranDMC
Copy link
Copy Markdown
Contributor

@MiranDMC MiranDMC commented Mar 28, 2026

Instead of having two structs with same members CVector in now based on RwV3d (reversed project does it too).
Added conversion operators, so both types can be used interchangeable.
Got rid of manual conversion methods.

@gennariarmando
Copy link
Copy Markdown
Collaborator

Not sure this is the best of the approaches, CVector is shared across other games, and it's not how any of the trilogy does it.
CVector needs to be cleaned up and restore as much as the original inlined global functions as possible, the big CVector refactor broke many plugins, and again we try to stay as close as possible to the real deal. :)

@MiranDMC
Copy link
Copy Markdown
Contributor Author

Unification was your idea to start with and it makes sense. There is no really need to hook game code just to sum 6 floats.
No need to implement same code multiple times and it is also guaranteed to have same interfaces across all platforms.
Breaking old plugins does not seems big deal. If somebody want to compile old code without any changes then he should stay with old SDK version.
Right now the problem is CVector2D implicitly intercepts some calls that previously were done by CVector. I wanted to get to it after sorting out the CVector first.

@gennariarmando
Copy link
Copy Markdown
Collaborator

gennariarmando commented Mar 30, 2026

Yes, shared is alright, I meanly meant using RwV3d as parent.
There's no need to call original function, that's correct I guess, but can indeed be reorganized to match original code.

@MiranDMC
Copy link
Copy Markdown
Contributor Author

MiranDMC commented Mar 30, 2026

https://github.com/gta-reversed/gta-reversed/blob/master/source/game_sa/Core/Vector.h#L16
It is same type.
Cleans up a lot of use cases: https://github.com/DK22Pac/plugin-sdk/pull/295/changes#diff-98bc1750191756d2b95dbe317b224947d6257a08bc1712b58170140621ed4c3dR197

Problem with original function names is they were not consistent across platforms.

@gennariarmando
Copy link
Copy Markdown
Collaborator

I guess so, then let's merge and hope for the best

@gennariarmando gennariarmando merged commit fe7e241 into DK22Pac:master Mar 30, 2026
5 checks passed
@MiranDMC MiranDMC deleted the CVector_updates branch April 18, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants