Alchemy
Loading...
Searching...
No Matches

object_effect.h

Go to the documentation of this file.
1#ifndef ALCHEMY_OBJECT_EFFECT_H
2#define ALCHEMY_OBJECT_EFFECT_H
3
4/// @file
5/// The fade overlay, the weather particles and the actor effect work.
6
7#include "types.h"
8#include "edition.h"
9
10#include "animspr.h"
11
12struct FieldActor;
13
14/// The fade overlay draws one mark on each side of its tracked actor.
16 /// The left and right marks: 16-pixel-wide semi-transparent sprites drawn
17 /// where the ground beside the actor rises above its floor.
19 struct FieldActor *actor; ///< the actor tracked; null draws nothing
20};
21
22STATIC_ASSERT(sizeof(struct FadeOverlayWork) == 28);
23
25
26#define FIELD_WEATHER_PARTICLE_COUNT 32
27
28/// One weather particle: OAM attributes followed by its world position.
30 u8 unk00[4]; ///< Cleared with the attributes; never read by the effects.
31 /// The OAM entry's attributes 0 to 2: the start routines write them whole
32 /// as semi-transparent, size 1, priority 1 and palette 13.
33 ///@{
34 u16 y : 8; ///< Screen pixels.
35 u16 affine : 2; ///< Not named by the effects.
36 u16 blendMode : 2; ///< 1, semi-transparent; not named by the effects.
37 u16 mosaic : 1; ///< Not named by the effects.
38 u16 fullColor : 1; ///< Not named by the effects.
39 u16 shape : 2; ///< From the ground particle frame; motes, sparkles: 0.
40 u16 x : 9; ///< Screen pixels.
41 u16 affineIndex : 5; ///< Sparkles: 8 on alternate frames, else 0.
42 u16 size : 2; ///< From the ground particle frame; motes, sparkles: 1.
43 u16 tile : 10; ///< The work's tileBase plus the frame's tile.
44 u16 priority : 2; ///< 1.
45 u16 palette : 4; ///< 13; not named by the effects.
46 ///@}
47 u8 attr3[2]; ///< OAM attribute 3, cleared with the others.
48 s32 posX; ///< World position, in 16.16 pixels.
49 s32 posY; ///< The ground's height there.
50 s32 posZ; ///< World position, in 16.16 pixels.
51 s32 delay; ///< Motes: height risen; sparkles: phase within a burst.
52 u16 timer; ///< Frames left; zero frees the particle.
53};
54
55STATIC_ASSERT(offsetof(struct GroundParticle, posX) == 0x0c);
56STATIC_ASSERT(sizeof(struct GroundParticle) == 0x20);
57
58/// Work slot 29 while ground particles, motes or sparkles run.
60 s32 entry; ///< Resource entry holding the effect's tiles.
61 s32 tileBase; ///< Their first tile in VRAM.
63 s32 unk408; ///< Unused by the weather effects.
64 s32 stopped; ///< Prevent new sparkle bursts while set.
65};
66
67STATIC_ASSERT(sizeof(struct GroundParticleWork) == 0x410);
68
70
71#endif
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
struct FadeOverlayWork * gActorEffectWork
#define FIELD_WEATHER_PARTICLE_COUNT
struct GroundParticleWork * gParticleWork
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
The hardware sprite attributes one part of an animated sprite (its image or its shadow) is drawn with...
Definition animspr.h:84
The fade overlay draws one mark on each side of its tracked actor.
struct FieldActor * actor
the actor tracked; null draws nothing
struct AnimationSpritePart marks[2]
The left and right marks: 16-pixel-wide semi-transparent sprites drawn where the ground beside the ac...
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
Work slot 29 while ground particles, motes or sparkles run.
struct GroundParticle particles[FIELD_WEATHER_PARTICLE_COUNT]
s32 tileBase
Their first tile in VRAM.
s32 stopped
Prevent new sparkle bursts while set.
s32 unk408
Unused by the weather effects.
s32 entry
Resource entry holding the effect's tiles.
One weather particle: OAM attributes followed by its world position.
u16 fullColor
Not named by the effects.
u8 unk00[4]
Cleared with the attributes; never read by the effects.
u16 timer
Frames left; zero frees the particle.
u16 x
Screen pixels.
s32 delay
Motes: height risen; sparkles: phase within a burst.
s32 posY
The ground's height there.
u8 attr3[2]
OAM attribute 3, cleared with the others.
u16 y
The OAM entry's attributes 0 to 2: the start routines write them whole as semi-transparent,...
u16 mosaic
Not named by the effects.
u16 size
From the ground particle frame; motes, sparkles: 1.
u16 palette
13; not named by the effects.
u16 affine
Not named by the effects.
u16 blendMode
1, semi-transparent; not named by the effects.
u16 tile
The work's tileBase plus the frame's tile.
s32 posZ
World position, in 16.16 pixels.
u16 affineIndex
Sparkles: 8 on alternate frames, else 0.
u16 shape
From the ground particle frame; motes, sparkles: 0.
s32 posX
World position, in 16.16 pixels.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11