Alchemy
Loading...
Searching...
No Matches

view.c File Reference

The view bounds, zoom transitions and objects linked to an actor. More...

Go to the source code of this file.

Macros

#define SPRITE_ATTR2_HIGH(sprite)
 The high byte of the first sprite part's OAM attribute 2.

Functions

void Map_SetViewBounds (s32 minX, s32 minY, s32 maxX, s32 maxY)
 The event command "set view bounds": the camera keeps the screen inside these map coordinates (Camera_MoveWithinMapBounds).
s32 FieldFx_StepRatioTransition (void)
void BattleFx_ScheduleRatioTransition (s32 zoom, s32 frames)
 Starts a zoom to zoom (16.16) over frames frames, on the world map (event mode 3) only.
void Event_WaitForZoomTransition (void)
 Waits for a zoom transition to end (on the world map only, at most 300 frames).
s32 BattleFx_CopyLinkedObjectPosition (union FieldObject *fieldObject)
void BattleFx_SpawnLinked (s32 actor, s32 emote, s32 wait)
 The event command "actor show emote": shows an emote bubble (object 21) over an actor, then waits wait frames.
void BattleFx_ConfigureLinkedObject (s32 actor, s32 flags)
 The event command "actor set attached effect": with mode (the low 2 bits) 0 removes the object attached to an actor; 1 attaches one (object 209, animation 1) that stays until removed; 2 shows a one-off one (animation 2) that ends by itself.

Detailed Description

The view bounds, zoom transitions and objects linked to an actor.

Part of psynergy_effects.c, compiled only through it.

Definition in file view.c.

Macro Definition Documentation

◆ SPRITE_ATTR2_HIGH

#define SPRITE_ATTR2_HIGH ( sprite)
Value:
(((u8 *)(sprite))[9])
unsigned char u8
Definition types.h:11

The high byte of the first sprite part's OAM attribute 2.

Bits 2 and 3 are its priority.

Definition at line 9 of file view.c.

Referenced by BattleFx_ConfigureLinkedObject(), and BattleFx_SpawnLinked().

Function Documentation

◆ Map_SetViewBounds()

void Map_SetViewBounds ( s32 minX,
s32 minY,
s32 maxX,
s32 maxY )

The event command "set view bounds": the camera keeps the screen inside these map coordinates (Camera_MoveWithinMapBounds).

Definition at line 13 of file view.c.

Referenced by FieldMap_SetViewBounds(), and Map_SetViewBounds().

◆ FieldFx_StepRatioTransition()

s32 FieldFx_StepRatioTransition ( void )

Definition at line 30 of file view.c.

Referenced by BattleFx_ScheduleRatioTransition(), and FieldFx_StepRatioTransition().

◆ BattleFx_ScheduleRatioTransition()

void BattleFx_ScheduleRatioTransition ( s32 zoom,
s32 frames )

◆ Event_WaitForZoomTransition()

void Event_WaitForZoomTransition ( void )

Waits for a zoom transition to end (on the world map only, at most 300 frames).

Definition at line 94 of file view.c.

Referenced by Event_MeetFlint(), Event_WaitForZoomTransition(), WorldMap_ShowDjinnTutorial(), and WorldMap_ShowEndingScene().

◆ BattleFx_CopyLinkedObjectPosition()

s32 BattleFx_CopyLinkedObjectPosition ( union FieldObject * fieldObject)

◆ BattleFx_SpawnLinked()

void BattleFx_SpawnLinked ( s32 actor,
s32 emote,
s32 wait )

The event command "actor show emote": shows an emote bubble (object 21) over an actor, then waits wait frames.

The low 4 bits of emote pick the bubble's animation (6 also plays sound 110); with 0x100 the bubble takes sprite priority 1, otherwise the actor's.

Definition at line 148 of file view.c.

Referenced by BattleFx_SpawnLinked().

◆ BattleFx_ConfigureLinkedObject()

void BattleFx_ConfigureLinkedObject ( s32 actor,
s32 flags )

The event command "actor set attached effect": with mode (the low 2 bits) 0 removes the object attached to an actor; 1 attaches one (object 209, animation 1) that stays until removed; 2 shows a one-off one (animation 2) that ends by itself.

With 0x100 the object takes sprite priority 1, otherwise the actor's.

Definition at line 211 of file view.c.

Referenced by BattleFx_ConfigureLinkedObject(), and Field_ProcessStep().