src/field/script_commands_view.c
The view bounds, zoom transitions and actors that ride another. More…
Included by script_commands.c.
Macros
| Name | Description | |
|---|---|---|
#define | SPRITE_ATTR2_HIGH (sprite) (((Uint8 *)(sprite))[9]) | The high byte of the first sprite part's OAM attribute 2, which holds its priority and palette. |
#define | ATTR2_HIGH_PRIORITY_MASK (OBJ_PRIORITY(3) >> 8) | The priority's bits in that byte. |
#define | EMOTE_BUBBLE_MASK (EMOTE_IN_FRONT - 1) | fdActorShowEmoteById's emote: the bubble (EMOTE) in the bits below its flags (EMOTE_IN_FRONT), of which the low four pick its animation. |
#define | EMOTE_ANIMATION_MASK 15 | |
#define | ATTACHED_EFFECT_KIND_MASK 3 | fdEffectSetAttached's flags: the ATTACHED_EFFECT_FLAG below its ATTACHED_EFFECT_IN_FRONT. |
Functions
| Name | Description | |
|---|---|---|
void | fdMapGridSetCameraBounds (Sint32 minX, Sint32 minY, Sint32 maxX, Sint32 maxY) | The script command "set view bounds": the camera keeps the screen inside these map coordinates (fdCameraMoveWithinMapBounds). |
UNREAD_RESULT | fdWorldMapStepZoom (void) | Event: moves the zoom one step from its previous value toward its target, and removes itself on the last step. |
void | fdWorldMapStartZoom (FIXED zoom, Sint32 ticks) | Starts a zoom to zoom (16.16) over ticks ticks, on the World Map only. |
void | fdScriptWaitForZoomTransition (void) | Waits for a zoom transition to end (on the World Map only, at most 300 ticks). |
UNREAD_RESULT | fdEffectCopyWatchedActorPos (ACTOR *actor) | Per-tick update of an emote bubble or attached effect: keeps it on the actor it rides (its watched actor, whose id is its hostActorId), raised by that actor's sprite height (its metadata's spriteTop) and 8 pixels. |
void | fdActorShowEmoteById (Sint32 actorId, Sint32 emote, Sint32 ticks) | The script command "actor show emote": shows an emote bubble (SPRITE_EMOTE) over an actor, then waits the given number of ticks. |
void | fdEffectSetAttached (Sint32 actorId, Sint32 flags) | The script command "actor set attached effect", by ATTACHED_EFFECT_FLAG: removes the actor attached to an actor, attaches one (SPRITE_ATTACHED_EFFECT, animation 1) or shows a one-off one (animation 2) that ends by itself (ActorWaitScript, 40 ticks). |
Description
The view bounds, zoom transitions and actors that ride another. Part of
script_commands.c.
Macros in detail
SPRITE_ATTR2_HIGH
#define SPRITE_ATTR2_HIGH(sprite) (((Uint8 *)(sprite))[9])
The high byte of the first sprite part's OAM attribute 2, which holds its priority and palette.
Referenced by fdActorShowEmoteById() and fdEffectSetAttached().
Definition at line 8 of file script_commands_view.c.
ATTR2_HIGH_PRIORITY_MASK
#define ATTR2_HIGH_PRIORITY_MASK (OBJ_PRIORITY(3) >> 8)
The priority's bits in that byte.
Referenced by fdActorShowEmoteById() and fdEffectSetAttached().
Definition at line 10 of file script_commands_view.c.
EMOTE_BUBBLE_MASK
#define EMOTE_BUBBLE_MASK (EMOTE_IN_FRONT - 1)
fdActorShowEmoteById's emote: the bubble (EMOTE) in the bits below its flags
(EMOTE_IN_FRONT), of which the low four pick its animation.
Referenced by fdActorShowEmoteById().
Definition at line 14 of file script_commands_view.c.
EMOTE_ANIMATION_MASK
#define EMOTE_ANIMATION_MASK 15
Referenced by fdActorShowEmoteById().
Definition at line 15 of file script_commands_view.c.
ATTACHED_EFFECT_KIND_MASK
#define ATTACHED_EFFECT_KIND_MASK 3
fdEffectSetAttached's flags: the ATTACHED_EFFECT_FLAG below its
ATTACHED_EFFECT_IN_FRONT.
Referenced by fdEffectSetAttached().
Definition at line 19 of file script_commands_view.c.
Functions in detail
fdMapGridSetCameraBounds
void fdMapGridSetCameraBounds(Sint32 minX, Sint32 minY, Sint32 maxX, Sint32 maxY)
The script command "set view bounds": the camera keeps the screen inside
these map coordinates (fdCameraMoveWithinMapBounds).
References Sint32.
Referenced by fdSetCameraBounds().
Definition at line 23 of file script_commands_view.c.
fdWorldMapStepZoom
UNREAD_RESULT fdWorldMapStepZoom(void)
Event: moves the zoom one step from its previous value toward its target, and removes itself on the last step.
References ScanlinePitch, Sint32, syCloseEvent(), syHeapSlotAllocateEWRAM() and syMulFX().
Referenced by fdWorldMapStartZoom().
Definition at line 38 of file script_commands_view.c.
fdWorldMapStartZoom
void fdWorldMapStartZoom(FIXED zoom, Sint32 ticks)
Starts a zoom to zoom (16.16) over ticks ticks, on the World Map only.
References fdWorldMapStepZoom(), Sint32, syDivFX(), syHeapSlotAllocateEWRAM() and sySetEvent().
Referenced by fdWorldMapZoomOutWhileLHeld(), scWorldMapExplainSettingDjinn(), scWorldMapMeetFlint(), scWorldMapRunBlackOrbScript(), scWorldMapSailTolbiShipToIsland(), scWorldMapShowEndingScript(), scWorldMapShowHammetsCaravan(), scWorldMapShowIslandDrifting() and scWorldMapUseBlackOrb().
Definition at line 68 of file script_commands_view.c.
fdScriptWaitForZoomTransition
void fdScriptWaitForZoomTransition(void)
Waits for a zoom transition to end (on the World Map only, at most 300 ticks).
References Sint32, syHeapSlotAllocateEWRAM() and sySynch().
Referenced by scWorldMapExplainSettingDjinn(), scWorldMapMeetFlint() and scWorldMapShowEndingScript().
Definition at line 90 of file script_commands_view.c.
fdEffectCopyWatchedActorPos
UNREAD_RESULT fdEffectCopyWatchedActorPos(ACTOR *actor)
Per-tick update of an emote bubble or attached effect: keeps it on the actor it rides (its watched actor, whose id is its hostActorId), raised by that actor's sprite height (its metadata's spriteTop) and 8 pixels.
References fdFindActorPlacement() and syResourceGetMetadataRecordStub().
Referenced by fdActorShowEmoteById() and fdEffectSetAttached().
Definition at line 115 of file script_commands_view.c.
fdActorShowEmoteById
void fdActorShowEmoteById(Sint32 actorId, Sint32 emote, Sint32 ticks)
The script command "actor show emote": shows an emote bubble (SPRITE_EMOTE)
over an actor, then waits the given number of ticks.
References EmoteBubbleScript, fdActorCreateStub(), fdActorLookup(), fdActorSelectAnimationStub(), fdActorStartScriptStub(), fdEffectCopyWatchedActorPos(), fdScriptWait(), Sint32 and sySoundPlayStub().
Referenced by fdActorShowEmote().
Definition at line 141 of file script_commands_view.c.
fdEffectSetAttached
void fdEffectSetAttached(Sint32 actorId, Sint32 flags)
The script command "actor set attached effect", by ATTACHED_EFFECT_FLAG:
removes the actor attached to an actor, attaches one (SPRITE_ATTACHED_EFFECT,
animation 1) or shows a one-off one (animation 2) that ends by itself
(ActorWaitScript, 40 ticks).
References ActorWaitScript, fdActorCreateStub(), fdActorLookup(), fdActorReleaseStub(), fdActorSelectAnimationStub(), fdActorStartScriptStub(), fdEffectCopyWatchedActorPos() and Sint32.
Referenced by fdActorSetAttachedEffect() and fdUpdateWalking().
Definition at line 209 of file script_commands_view.c.