GearLoader 1.1.0
Mod loader for GGXXACPR
Loading...
Searching...
No Matches
BaseMod_NativeFunctionsApi Struct Reference

Data Fields

uint32_t size
 The size of the struct in bytes.
uint32_t version
 The API version.
void BASEMOD_CALL(* RenderCockpitFontText )(const char *text, int32_t x, int32_t y, float z, uint8_t alpha, float size)
 Draws cockpit font text to the screen.
void BASEMOD_CALL(* RenderMenuText )(const char *text, int32_t x, int32_t y, float z, float alpha, int32_t *animCounter, int32_t animSpeed, int32_t ignoreSpriteMask, uint32_t color)
 Draws text to the screen such as the text seen in pause menus.
void BASEMOD_CALL(* RenderMenuTextCenterAligned )(const char *text, int32_t x, int32_t y, float z, float alpha, uint32_t color, int32_t ignoreSpriteMask)
 Draws centered aligned text to the screen.
void BASEMOD_CALL(* RenderPopUpText )(int32_t playerIndex, const char *text)
 A higher level text rendering function that triggers a text popup animation in-game (e.g. COUNTER HIT / RECOVERY).
uint32_t BASEMOD_CALL(* PlayCommonSoundEffect )(uint32_t id)
 Plays a sound effect.
void BASEMOD_CALL(* DrawSprite )(GGXXACPR_DrawSpriteParams *params, int32_t ignoreSpriteMask)
 Draws a sprite to the screen.
void BASEMOD_CALL(* DrawArrowSprite )(uint32_t directionFlag, int32_t x, int32_t y, int32_t z, uint32_t alpha)
 DrawSprite wrapper function that draws an arrow sprite.
void BASEMOD_CALL(* DrawTriStrip )(GGXXACPR_ColorVertex *vertices, uint32_t numVertices)
 Draws a triangle strip primitive.
void BASEMOD_CALL(* DrawQuad )(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color)
 Draws a rectangle to the screen.
uint32_t BASEMOD_CALL(* RegisterSprites )(uint32_t spriteId, void *textureDataArray, uint32_t count)
 Registers sprite data to a spriteId to later be rendered with BaseMod_NativeFunctionsApi::DrawSprite.
uint32_t BASEMOD_CALL(* GetActiveCommandGrabId )(GGXXACPR_Entity *player)
 If the given player currently has an active command grab, returns its command grab id, else return 0.

Field Documentation

◆ DrawArrowSprite

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::DrawArrowSprite) (uint32_t directionFlag, int32_t x, int32_t y, int32_t z, uint32_t alpha)

DrawSprite wrapper function that draws an arrow sprite.

Parameters
directionFlagsee enum BM_DrawArrowSpriteDirection
xInternal resolution screen-space coordinate (640x480). Left edge is 0, right is 640.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
zThe draw order/depth buffer value. Lower values draw later / appear in front of other text and sprites.
alphaTransparency value from 1 to 255, 1 being fully opaque.

◆ DrawQuad

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::DrawQuad) (int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color)

Draws a rectangle to the screen.

A simple helper function that calls constructs four vertices from the given parameters and passes them to DrawTriStrip. The edges of the quad are given in internal resolution screen space coordinates. The top left pixel is (0, 0) and the bottom right pixel is (640, 480).

This function should only be invoked in the context of the game's main scene, such as during a hook registered with BaseMod_Api::BeforeEndScene.

Parameters
leftedge position
topedge position
rightedge position
bottomedge position
zThe Z coordinate for each vertex
colorARGB color value (i.e. D3DCOLOR from D3D9Types.h)

◆ DrawSprite

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::DrawSprite) (GGXXACPR_DrawSpriteParams *params, int32_t ignoreSpriteMask)

Draws a sprite to the screen.

See GGXXACPR_DrawSpriteParams

Parameters
paramsCombined parameter struct
ignoreSpriteMaskA 4-byte boolean value. If a non-zero value is passed, ignores color and alpha params.

◆ DrawTriStrip

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::DrawTriStrip) (GGXXACPR_ColorVertex *vertices, uint32_t numVertices)

Draws a triangle strip primitive.

The coordinates of the vertices are given in internal resolution screen space coordinates. The top left pixel is (0, 0) and the bottom right pixel is (640, 480).

Parameters
verticesThe vertices making up the triangle strip.
numVerticesThe number of vertices.

◆ PlayCommonSoundEffect

uint32_t BASEMOD_CALL(* BaseMod_NativeFunctionsApi::PlayCommonSoundEffect) (uint32_t id)

Plays a sound effect.

An internal array is indexed with the id parameter without validity checks. Invalid values can cause invalid memory access.

Parameters
idThe given id maps to the "COMMON SE" sound effect in the Sound menu. See github.com/youknow232/gearloader/tree/main/docs/SoundEffectIdMap.txt for the id mappings.
Returns
This function will return 1 if the id parameter is 0, otherwise it returns 0.

◆ RegisterSprites

uint32_t BASEMOD_CALL(* BaseMod_NativeFunctionsApi::RegisterSprites) (uint32_t spriteId, void *textureDataArray, uint32_t count)

Registers sprite data to a spriteId to later be rendered with BaseMod_NativeFunctionsApi::DrawSprite.

When registering multiple sprites, each sprite will be sequentially registered with spriteIds starting with the given spriteId parameter. Example: Registering 4 sprites at spriteId 100 registers ids 100,101,102,103.

See tutorial on registering and using custom sprites for more information.

Parameters
spriteIdThe initial slot sprite data will be loaded into.
textureDataArrayThe raw sprite data.
countThe number of sprites to register. If 0, sprites will be registered until a null pointer is found in the given array.
Returns
The number of sprites registered

◆ RenderCockpitFontText

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::RenderCockpitFontText) (const char *text, int32_t x, int32_t y, float z, uint8_t alpha, float size)

Draws cockpit font text to the screen.

The font drawn depends on the "Main Menu > Help & Options > Display & Audio Settings > Cockpit Font" setting. This function must be called before the game begins its drawing process. It is recommend to call this function in the AfterGameUpdate hook.

Example input/output. Font type depends on game setting.
Parameters
textA pointer to the text string to be displayed. The string format is a subset of ASCII. The character set is limited to upper case letters, numbers, and the following special symbols: "-+.!?/():&" The following characters map to additional special characters: ",~acegiwxyz" maps to "•±on•utabyx". '>' = END character from the highscore initials screen. "bdfh" = down/left/right/up arrows
xInternal resolution screen-space coordinate (640x480). Left edge is 0, right is 640.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
zThe draw order/depth buffer value. Lower values draw later / appear in front of other text and sprites.
alphaTransparency value [0-255].
sizeScaling value, standard size is 1.0f which results in a text glyph of size 12x15px (internal resolution).

◆ RenderMenuText

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::RenderMenuText) (const char *text, int32_t x, int32_t y, float z, float alpha, int32_t *animCounter, int32_t animSpeed, int32_t ignoreSpriteMask, uint32_t color)

Draws text to the screen such as the text seen in pause menus.

This function must be called before the game begins its drawing process. It is recommend to call this function in the AfterGameUpdate hook. Max string size is 512 characters. This function can handle '
' characters.

Parameters
textA pointer to the text string to be displayed.
xInternal resolution screen-space coordinate (640x480). Left edge is 0, right is 640.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
zThe draw order/depth buffer value. Lower values draw later / appear in front of other text and sprites.
alphaTransparency value from 0 to 1, 1 being fully opaque.
animCounterOptional pointer to an animation counter. If defined, the text will perform a 'typewriter' animation drawing an additional letter at a time until fully rendered. One letter will be rendered per 128 units on this counter. When the animation is complete, this value will be set to -1 and will no longer increment.
animSpeedThe amount to increment the animCounter if it is defined. Set to 128 for 1 letter per frame.
ignoreSpriteMaskA 4-byte boolean value. If a non-zero value is passed, ignores color and alpha params and draws as fully opaque white text.
colorThe color of the text string (0xRRGGBB)

◆ RenderMenuTextCenterAligned

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::RenderMenuTextCenterAligned) (const char *text, int32_t x, int32_t y, float z, float alpha, uint32_t color, int32_t ignoreSpriteMask)

Draws centered aligned text to the screen.

A wrapper of RenderMenuText that draws the text centered around the x parameter. y position is unchanged. This function handles multi-line strings but centers based on the longest line only (i.e. each line is NOT individually centered).

Parameters
textA pointer to the text string to be displayed.
xInternal resolution screen-space coordinate (640x480). Left edge is 0, right is 640.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
zThe draw order/depth buffer value. Lower values draw later / appear in front of other text and sprites.
alphaTransparency value from 0 to 1, 1 being fully opaque.
colorThe color of the text string (0xRRGGBB)
ignoreSpriteMaskA 4-byte boolean value. If a non-zero value is passed, ignores color and alpha params and draws as fully opaque white text.

◆ RenderPopUpText

void BASEMOD_CALL(* BaseMod_NativeFunctionsApi::RenderPopUpText) (int32_t playerIndex, const char *text)

A higher level text rendering function that triggers a text popup animation in-game (e.g. COUNTER HIT / RECOVERY).

Parameters
playerIndexWhich side of the screen to display the pop up.
textThe text to be displayed. See RenderCockpitFontText for format and available characters.

The documentation for this struct was generated from the following file: