Alchemy
Loading...
Searching...
No Matches

field.c

Go to the documentation of this file.
1/// @file
2/// The field object: the engine of the field and the world map. It draws and
3/// animates sprites, keeps the 64 field objects and runs their scripts, moves
4/// the player by the keys, loads, draws and scrolls the maps, and answers what
5/// the ground is like under a point. field_internal.h holds what the parts
6/// share; the parts under field/ are included here in the order their code has
7/// in the ROM. Camelot's own files are not recoverable: the ROM shows one
8/// object, and these parts are ours, cut where one family ends and the next
9/// begins.
10///
11/// README.md in this folder gives the words, prefixes and spellings the parts
12/// use. Where to start:
13///
14/// Sprites sprite_draw.c: Sprite_ComposeAnimationFrame,
15/// Render_PlaceProjectedSprite; animation.c:
16/// ResourceObject_Create, AnimationObjects_SelectAnimation
17/// Objects objects.c: FieldObject_Create, ObjectSystem_Initialize;
18/// object_motion.c: Object_UpdateAllThumb,
19/// Object_SetMoveTarget
20/// Object scripts script_commands.c (the SC_ commands of objcmd.h);
21/// player_control.c: FieldObject_UpdatePlayerControl
22/// Maps map_layers.c: Map_LoadLayeredScene,
23/// Map_UpdateLayerScroll; world_map.c:
24/// Map_InitializePerspectiveScene, WorldMap_UpdateView
25/// Ground terrain.c: Map_GetTerrainHeight, Map_CheckObjectStep,
26/// GetWorldMapCollision
27
28#include "field_internal.h"
29
30// The field object's code, in ROM order. Each part is compiled here, as part
31// of this one object, never on its own: the order of these includes is the
32// order of the code in the ROM.
33#include "field/decompress.c"
34#include "field/sprite_draw.c"
35#include "field/animation.c"
36#include "field/objects.c"
37#include "field/object_camera.c"
38#include "field/object_motion.c"
41#include "field/map_layers.c"
42#include "field/world_map.c"
43#include "field/map_animation.c"
44#include "field/terrain.c"
45#include "field/view.c"
46#include "field/sprite_viewer.c"
Sprites, their animation layers and the resource slots they draw from.
LZ decompression.
Field objects: the object pool, dissolving sprites, starting scripts.
Screen shake, the copied BG row drawer and the ground plane scanlines.
The world map: its perspective view, its tiles, and the still picture of the view BG1 shows while a m...
What every part of the field object shares: its includes and the few names more than one part uses.
Timed map effects: tile animation, the blend script, palette cycles.
Layered maps: loading, drawing and scrolling, and copying cells.
The object cameras, which place every object's sprite each frame.
Object motion, each frame, and the first object script commands.
Player control: the configured keys and moving objects by the pad.
Object script commands: waits, jumps, flags, moves and work values.
Drawing sprites: composing their layers and placing them on screen.
A debug sprite viewer.
Terrain: ground heights and the collision of cells and the world map.