src/scene/shared/world_map_gauge.c
The Psynergy gauge over the leader as the ship flies, which the world map and the staff credits' overlays keep a copy of: its tiles redrawn for the party's PP, the event that drains it while A or B is held aloft, and its set-up and end.
Included by staff_credit.c and world_map.c.
Macros
| Name | Description | |
|---|---|---|
#define | GAUGE_LIT_BAR 0 | The gauge's source tiles (WorldMapPackedTilesC): a bar of four tiles with its PP line lit, the same bar dark, and a chequered one for no PP. |
#define | GAUGE_DARK_BAR 4 | |
#define | GAUGE_EMPTY_BAR 8 | |
#define | GAUGE_TILE_PIXELS 8 | |
#define | GAUGE_LINE_ROWS 3 | The PP line's rows in a bar tile, from the second. |
#define | LEFT_PIXEL 0x0f | A 4bpp tile row's byte holds two pixels, the left one in its low nibble. |
#define | RIGHT_PIXEL 0xf0 | |
#define | GAUGE_DRAIN_TICKS 10 | The ticks between two PP drained while the ship is held aloft. |
Functions
| Name | Description | |
|---|---|---|
void | scGaugeDraw (Sint32 progress) | Redraws the gauge for progress, the party's PP as a 16.16 fraction of its most; at half or less it blinks, and faster at a quarter. |
void | scGaugeUpdate (void) | The Psynergy gauge over the leader as the ship flies: while A or B is held aloft it drains a PP every ten ticks, then redraws the gauge and queues its sprite. |
void | scGaugeInit (void) | Sets up the gauge. |
void | scGaugeEnd (void) | Takes the gauge down. |
Description
The Psynergy gauge over the leader as the ship flies, which the world map and the staff credits' overlays keep a copy of: its tiles redrawn for the party's PP, the event that drains it while A or B is held aloft, and its set-up and end.
Macros in detail
GAUGE_LIT_BAR
#define GAUGE_LIT_BAR 0
The gauge's source tiles (WorldMapPackedTilesC): a bar of four tiles with its
PP line lit, the same bar dark, and a chequered one for no PP. The bar is
filled a pixel a level, eight levels to a tile.
Referenced by scGaugeDraw().
Definition at line 11 of file world_map_gauge.c.
GAUGE_DARK_BAR
#define GAUGE_DARK_BAR 4
Referenced by scGaugeDraw().
Definition at line 12 of file world_map_gauge.c.
GAUGE_EMPTY_BAR
#define GAUGE_EMPTY_BAR 8
Referenced by scGaugeDraw().
Definition at line 13 of file world_map_gauge.c.
GAUGE_TILE_PIXELS
#define GAUGE_TILE_PIXELS 8
Referenced by scGaugeDraw().
Definition at line 14 of file world_map_gauge.c.
GAUGE_LINE_ROWS
#define GAUGE_LINE_ROWS 3
The PP line's rows in a bar tile, from the second.
Referenced by scGaugeDraw().
Definition at line 16 of file world_map_gauge.c.
LEFT_PIXEL
#define LEFT_PIXEL 0x0f
A 4bpp tile row's byte holds two pixels, the left one in its low nibble.
Referenced by scGaugeDraw().
Definition at line 18 of file world_map_gauge.c.
RIGHT_PIXEL
#define RIGHT_PIXEL 0xf0
Referenced by scGaugeDraw().
Definition at line 19 of file world_map_gauge.c.
GAUGE_DRAIN_TICKS
#define GAUGE_DRAIN_TICKS 10
The ticks between two PP drained while the ship is held aloft.
Referenced by scGaugeInit() and scGaugeUpdate().
Definition at line 21 of file world_map_gauge.c.
Functions in detail
scGaugeDraw
void scGaugeDraw(Sint32 progress)
Redraws the gauge for progress, the party's PP as a 16.16 fraction of its
most; at half or less it blinks, and faster at a quarter.
References GaugeShown, GaugeSourceTiles, GaugeTiles, GaugeVram, mnVRAMLoad(), Sint32, syWordsClear() and TickCount.
Referenced by scGaugeUpdate().
Definition at line 25 of file world_map_gauge.c.
scGaugeUpdate
void scGaugeUpdate(void)
The Psynergy gauge over the leader as the ship flies: while A or B is held aloft it drains a PP every ten ticks, then redraws the gauge and queues its sprite.
References Call2(), fdActorGet(), fdScriptGetFlag(), GaugeCountdown, GaugeSprite, GaugeVram, gmPartyDrainPp(), gmPartyGetPpRatio(), PerWork, scFieldPartyGetLeaderActor(), scGaugeDraw(), Sint32, syConvert3Dto2D(), syOAMAddSpriteAtDepthClamped() and VramCacheEntries.
Referenced by scGaugeEnd() and scGaugeInit().
Definition at line 129 of file world_map_gauge.c.
scGaugeInit
void scGaugeInit(void)
Sets up the gauge.
References GaugeCountdown, GaugeShown, GaugeSourceTiles, GaugeVram, mnVRAMLoad(), scGaugeUpdate(), syDecompressTaggedLZ(), sySetTickEvent(), syVRAMCacheFindFreeEntry() and WorldMapPackedTilesC.
Referenced by scWorldMapSetUpFlyingShip().
Definition at line 164 of file world_map_gauge.c.
scGaugeEnd
void scGaugeEnd(void)
Takes the gauge down.
References GaugeShown, GaugeSourceTiles, GaugeVram, scFieldCloseEvent(), scGaugeUpdate(), syDecompressTaggedLZ(), syVRAMCacheFreeEntry() and WorldMapPackedTilesC.
Referenced by scWorldMapSetUpShip().
Definition at line 175 of file world_map_gauge.c.