feat(extra-natives-rdr3): Add CBlip in GetGamePool / Add natives GetB… #3676
+281
−6
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.
…lipSprite, GetBlipRotation, GetBlipModifiers
Goal of this PR
This PR adds new RedM (RDR3) blip-related natives to enhance script functionality for blip manipulation and inspection. The implementation provides direct access to blip data structures through the game pool system, enabling scripts to retrieve blip properties like sprite, rotation, and modifiers that were previously inaccessible.
Usage :
BLIP_POI
) or Modifiers (BLIP_STYLE_POI
)BLIP_MODIFIER_SELECTED_UP_SCALE
)How is this PR achieving the goal
Core Implementation:
Added BlipNatives.cpp with three main natives:
GET_BLIP_SPRITE: Retrieves the sprite/hash of a blip from its handle
GET_BLIP_ROTATION: Gets the rotation of a blip in degrees (0.0-360.0)
GET_BLIP_MODIFIERS: Returns an array of blip modifiers
Technical Details:
Implemented direct memory access to the fwuiBlip pool using rage::GetPoolBase()
Created a BlipData struct mapping the internal blip memory layout with proper padding
Added proper error handling for invalid blip handles
Used fx::SerializeObject() for returning modifier arrays to scripts
Added comprehensive native documentation with usage examples
This PR applies to the following area(s)
RedM: Client-side native functions
ScRT: Lua: Enhanced blip functionality for Lua scripts
ScRT: JS: Enhanced blip functionality for JavaScript scripts
Successfully tested on
Game builds: RedM (RDR3)
Platforms: Windows
Checklist