src/field/field_internal.h
What every part of the field object shares: its includes and the few names more than one part uses. More…
#include "flags.h"#include "macros.h"#include "resource_ids.h"#include "battle/battle.h"#include "battle/battle_camera.h"#include "field/actor_script.h"#include "field/actor_update_arm.h"#include "field/curve.h"#include "field/script.h"#include "field/script_operands.h"#include "field/facing.h"#include "field/map_grid.h"#include "field/engine_stubs.h"#include "field/world_map_affine.h"#include "game/stubs.h"#include "graphics/graphics.h"#include "graphics/palette_cycles.h"
Included by field.c, field_actor_camera.c, field_actor_motion.c, field_actors.c, field_decompress.c, field_map_grid.c, field_player_control.c, field_script_commands.c, field_sprite_animation.c, field_sprite_draw.c, field_sprite_viewer.c, field_terrain.c, field_tile_animation.c, field_view.c and field_world_map.c.
Structures
| Name | Description | |
|---|---|---|
struct | SPR_PICTURE_CACHE_SOURCE | A row of SpritePictureCacheSources: the packed resource that holds an animation number's pictures, ending at number 0. |
Macros
| Name | Description | |
|---|---|---|
#define | MAPGRID_ANIMATION_SCRIPT (RamMapGridShapes + 4096) | Where a layout's tileset animation and blend scripts are decoded, in the space after the shapes; the world map decodes its tileset animation there too. |
#define | MAPGRID_BLEND_SCRIPT (RamMapGridShapes + 7680) | |
#define | WORLD_MAP_TILE_SET_BYTES 8192 | One of the world map area's four tile sets, half a character block; they are decoded one after another into BgTileBuffer. |
Enumerations
| Name | Description | |
|---|---|---|
enum | ANIMATION_COMMAND { ANIMCMD_END, ANIMCMD_SET_KIND, ANIMCMD_HOLD, ANIMCMD_WAIT, A … } | Animation script commands. |
enum | anonymous enum { RESOURCE_SLOT_COUNT, ANIM_OBJECT_COUNT, ANIM_LAYER_COUNT, SP … } | The field's pool sizes, and a sprite animation's timer step at normal speed. |
enum | anonymous enum { FIELD_VIEW_FOCUS_X, FIELD_VIEW_FOCUS_Y, FIELD_VIEW_WIDTH, FI … } | Layered-map viewport distances in 16.16 pixels. |
enum | anonymous enum { FIELD_SPRITE_RIPPLE, FIELD_SPRITE_FOOTPRINT } | Sprite ids the field engine's own code creates actors of. |
enum | METATILE_TILES_PACKING { METATILE_TILES_PACKING_RAW, METATILE_TILES_PACKING_SPLIT_DEL … } | How a layout's metatile tiles are packed: the method byte fdTileMapDecodeStagedBuffer reads before the halfwords. |
Variables
| Name | Description | |
|---|---|---|
extern SPR_PICTURE_CACHE_SOURCE | SpritePictureCacheSources [] |
Description
What every part of the field object shares: its includes and the few names
more than one part uses. field.c includes it before the parts, and each part
includes it too, so that a part read on its own still resolves. It places no
bytes.
Macros in detail
MAPGRID_ANIMATION_SCRIPT
#define MAPGRID_ANIMATION_SCRIPT (RamMapGridShapes + 4096)
Where a layout's tileset animation and blend scripts are decoded, in the space after the shapes; the world map decodes its tileset animation there too.
Referenced by fdMapGridLoadMap() and fdWorldMapInitPerspective().
Definition at line 82 of file field_internal.h.
MAPGRID_BLEND_SCRIPT
#define MAPGRID_BLEND_SCRIPT (RamMapGridShapes + 7680)
Referenced by fdMapGridLoadMap().
Definition at line 83 of file field_internal.h.
WORLD_MAP_TILE_SET_BYTES
#define WORLD_MAP_TILE_SET_BYTES 8192
One of the world map area's four tile sets, half a character block; they are
decoded one after another into BgTileBuffer.
Referenced by fdTileMapDrawRowsFromRam(), fdWorldMapEndStillImage(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics() and fdWorldMapStartStillImage().
Definition at line 87 of file field_internal.h.
Enumerations in detail
ANIMATION_COMMAND
enum ANIMATION_COMMAND
Animation script commands.
| Enumerator | Value | Description |
|---|---|---|
ANIMCMD_END | 239 | blank the layer and stop its script |
ANIMCMD_SET_KIND | 240 | use facing table arg |
ANIMCMD_HOLD | 241 | stay on this command and tick for good |
ANIMCMD_WAIT | 245 | keep the current tick arg ticks longer |
ANIMCMD_JUMP | 253 | continue at script position arg |
ANIMCMD_PLAY | 254 | switch to animation arg |
ANIMCMD_BLANK | 255 | show nothing for arg |
Definition at line 28 of file field_internal.h.
anonymous enum
enum { RESOURCE_SLOT_COUNT, ANIM_OBJECT_COUNT, ANIM_LAYER_COUNT, SPRITE_ANIMATION_NORMAL_STEP }
The field's pool sizes, and a sprite animation's timer step at normal speed.
| Enumerator | Value | Description |
|---|---|---|
RESOURCE_SLOT_COUNT | 8 | ACTOR_SYSTEM_STATE.pictureCaches |
ANIM_OBJECT_COUNT | 64 | sprites and sprite animations |
ANIM_LAYER_COUNT | 4 | SPR.entries |
SPRITE_ANIMATION_NORMAL_STEP | 16 | 1/16 ticks taken off animation timer per tick (1 tick) |
Definition at line 40 of file field_internal.h.
anonymous enum
enum { FIELD_VIEW_FOCUS_X, FIELD_VIEW_FOCUS_Y, FIELD_VIEW_WIDTH, FIELD_VIEW_HEIGHT }
Layered-map viewport distances in 16.16 pixels. The followed point is below the vertical centre; scroll bounds and camera following share this origin.
| Enumerator | Value | Description |
|---|---|---|
FIELD_VIEW_FOCUS_X | toFIXED(120) | followed point from the left edge |
FIELD_VIEW_FOCUS_Y | toFIXED(96) | followed point from the top edge |
FIELD_VIEW_WIDTH | toFIXED(240) | the screen's width |
FIELD_VIEW_HEIGHT | toFIXED(160) | the screen's height |
Definition at line 51 of file field_internal.h.
anonymous enum
enum { FIELD_SPRITE_RIPPLE, FIELD_SPRITE_FOOTPRINT }
Sprite ids the field engine's own code creates actors of.
| Enumerator | Value | Description |
|---|---|---|
FIELD_SPRITE_RIPPLE | 24 | the ripple behind the leader in shallow water |
FIELD_SPRITE_FOOTPRINT | 25 | a footprint, on maps that show them |
Definition at line 60 of file field_internal.h.
METATILE_TILES_PACKING
enum METATILE_TILES_PACKING
How a layout's metatile tiles are packed: the method byte
fdTileMapDecodeStagedBuffer reads before the halfwords.
| Enumerator | Value | Description |
|---|---|---|
METATILE_TILES_PACKING_RAW | 0 | copied as it is |
METATILE_TILES_PACKING_SPLIT_DELTA | 1 | All the high bytes, then all the low bytes; each value is XORed with the one before. |
METATILE_TILES_PACKING_DELTA | 2 | each value is XORed with the one before |
Definition at line 69 of file field_internal.h.
Variables in detail
SpritePictureCacheSources
extern SPR_PICTURE_CACHE_SOURCE SpritePictureCacheSources[]
Referenced by fdSpritePictureCacheLoad().
Definition at line 97 of file field_internal.h.