QVM support collected suggestions#1
Open
mrwonko wants to merge 5 commits intoDaggolin:qvm_supportfrom
Open
Conversation
This gets rid of the confusing and brittle g2Tmp static variable, replacing it with individual local variables instead.
This expresses its dual nature a bit more clearly than a void pointer.
It seems dangerous to pretend that the pointers to pointers inside sharedEntityMapper_t are all ordinary pointers. Instead, let's use a union type to clearly distinguish between ordinary native pointers and 32-bit pointers into QVM memory that need to be translated first. I chose to only use a single union-pointer-type, instead of one per pointed-to type, for simplicity. I added some light type annotations using no-op defines, but there's no actual type checking. I did all this in the pursuit of properly marking Vehicle_t as having different memory layouts in native and QVM. It is only used for null-checks at the moment, which is safe, but if somebody were to try to access its fields, they need to be aware of the type mismatch.
We need to use the gentityMapper instead, to properly handle QVM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collected fixes and refactorings to make the QVM support a little harder to misuse. See individual commit messages for details. Of particular importance are 105647d for the correct typing of
m_pVehicleand f81e893 for fixing the use ofclient_t.gentity