|
coastline 0.0.4
|
The models of the menus and splash screens: loading, animating and drawing them. More...
#include <PR/gbi.h>#include <PR/ultratypes.h>#include "common/ptr32.h"#include "common/vecmath.h"

Go to the source code of this file.
Classes | |
| struct | ModelPart |
| A part of a model: its display list, how it is drawn, and where. More... | |
| struct | ModelKeyframe |
| A key of an animation: its time, then the position of each vertex, then its normal. More... | |
| struct | ModelAnimation |
| An animation of vertices of a model, blended between its keys. More... | |
| struct | ModelAnimationList |
| The animations of a model. More... | |
| struct | Model |
| A model loaded from the cartridge, with its display lists and the animations of its parts. More... | |
Macros | |
| #define | MODEL_PART_LIGHT_RAMP 0x0003 |
| The bits of the flags of a part that pick its light from g_adwModelShadeColors. | |
| #define | MODEL_PART_TWO_SIDED 0x0004 |
| The flag of a part drawn from both sides. | |
| #define | MODEL_PART_TRANSLUCENT 0x0008 |
| The flag of a part drawn after the opaque ones. | |
| #define | MODEL_PART_FLAT 0x0080 |
| The flag of a part drawn with flat shading. | |
| #define | MODEL_PART_RAMPED 0x0400 |
| The flag of a part lit by its light ramp. | |
| #define | MODEL_ANIMATION_REPEAT 0x1 |
| #define | MODEL_ANIMATION_BOUNCE 0x2 |
| #define | MODEL_ANIMATION_REVERSING 0x4 |
Typedefs | |
| typedef struct Model | Model |
| A model loaded from the cartridge, with its display lists and the animations of its parts. | |
Functions | |
| void | DrawModelList (Model *model, f32 m[4][4]) |
| Draw the parts of a model, the opaque ones first, under a matrix. | |
| void | DrawRotatedModel (Model *model, f32 x, f32 y, f32 z, f32 angle) |
| Draw a model turned about its own axis by an angle in radians, at a 32nd of its size, stood up and placed at a position. | |
| void | DrawModelAt (Model *model, f32 x, f32 y, f32 z, f32 angle, f32 scale) |
| Draw a model turned about its own axis by an angle in radians, scaled, stood up and placed at a position. | |
| Model * | DecompressModel (void *dst, u32 source) |
| Load a model into a buffer and turn its offsets into pointers. | |
| void | RemapPointer (u32 *pointer, const void *lo, const void *hi, const void *base) |
| Move a pointer that falls in a range of offsets to the same place from a base. | |
| void | FixupDisplayListPointers (Gfx *displayList, const void *lo, const void *hi, const void *base) |
| Remap the addresses of the vertices and textures of a display list, up to its end. | |
| void | BounceModelAnimations (Model *model) |
| Make every animation of a model repeat by turning back at its end. | |
| void | RelocateModelPointers (Model *model) |
| Turn the offsets a model is loaded with into pointers: its animations, their vertices and keys, and the display lists of its parts. | |
| void | SetModelAnimationFlags (Model *model, s32 set, s32 clear) |
| Set flags on every animation of a model, then clear others. | |
| void | LoopModelAnimations (Model *model) |
| Make every animation of a model wrap to its start at its end, instead of turning back. | |
| void | AdvanceModelAnimations (Model *model) |
| Advance every animation of a model by the time of the frame, blending its vertices between keyframes. | |
| void | PlayModelAnimationsOnce (Model *model) |
| Make the animations of a model stop at their ends rather than repeat. | |
| Model * | DmaReadAndFixupTrackModel (void *dst, u32 romStart, u32 romEnd) |
| Read a model from the cartridge and turn its offsets into pointers. | |
Variables | |
| Ambient | g_MenuAmbientLight |
| The ambient light of the menus that draw models. | |
| Light | g_MenuDirectionalLight |
| The directional light of the menus that draw models. | |
| s32 | g_dwDrawModelListNoZBuffer |
| Whether DrawModelList() draws without the depth buffer. | |
| u32 | g_adwModelShadeColors [4] |
| The light of the parts of a model lit by their light ramp, by its index. | |
The models of the menus and splash screens: loading, animating and drawing them.
| #define MODEL_PART_LIGHT_RAMP 0x0003 |
The bits of the flags of a part that pick its light from g_adwModelShadeColors.
| #define MODEL_PART_TWO_SIDED 0x0004 |
The flag of a part drawn from both sides.
| #define MODEL_PART_TRANSLUCENT 0x0008 |
The flag of a part drawn after the opaque ones.
| #define MODEL_PART_FLAT 0x0080 |
The flag of a part drawn with flat shading.
| #define MODEL_PART_RAMPED 0x0400 |
The flag of a part lit by its light ramp.
| #define MODEL_ANIMATION_REPEAT 0x1 |
The animation starts again at its end.
| #define MODEL_ANIMATION_BOUNCE 0x2 |
The animation turns back at its end.
| #define MODEL_ANIMATION_REVERSING 0x4 |
The animation runs backwards.
| typedef struct Model Model |
A model loaded from the cartridge, with its display lists and the animations of its parts.
Its fields join this structure as they are reconstructed.
Draw the parts of a model, the opaque ones first, under a matrix.
| model | The model. |
| m | The matrix of the model. |
Draw a model turned about its own axis by an angle in radians, at a 32nd of its size, stood up and placed at a position.
A mirrored track mirrors the turn and the scale.
| model | The model to draw. |
| x | The X coordinate of the position. |
| y | The Y coordinate of the position. |
| z | The Z coordinate of the position. |
| angle | The turn in radians. |
Draw a model turned about its own axis by an angle in radians, scaled, stood up and placed at a position.
A mirrored track mirrors the turn and the scale.
| model | The model to draw. |
| x | The X coordinate of the position. |
| y | The Y coordinate of the position. |
| z | The Z coordinate of the position. |
| angle | The turn in radians. |
| scale | The scale. |
Load a model into a buffer and turn its offsets into pointers.
| dst | The destination buffer. |
| source | The archive path on Windows, or the cartridge offset on the console. |
| void RemapPointer | ( | u32 * | pointer, |
| const void * | lo, | ||
| const void * | hi, | ||
| const void * | base ) |
Move a pointer that falls in a range of offsets to the same place from a base.
| pointer | The pointer, as the word it is stored in. |
| lo | The start of the range. |
| hi | The end of the range. |
| base | Where the start of the range moves to. |
| void FixupDisplayListPointers | ( | Gfx * | displayList, |
| const void * | lo, | ||
| const void * | hi, | ||
| const void * | base ) |
Remap the addresses of the vertices and textures of a display list, up to its end.
The display lists it calls are not followed.
| displayList | The display list, or NULL. |
| lo | The start of the range of the addresses. |
| hi | The end of the range. |
| base | Where the start of the range moves to. |
| void BounceModelAnimations | ( | Model * | model | ) |
Make every animation of a model repeat by turning back at its end.
| model | The model. |
| void RelocateModelPointers | ( | Model * | model | ) |
Turn the offsets a model is loaded with into pointers: its animations, their vertices and keys, and the display lists of its parts.
| model | The model. |
Set flags on every animation of a model, then clear others.
| model | The model. |
| set | The flags to set. |
| clear | The flags to clear. |
| void LoopModelAnimations | ( | Model * | model | ) |
Make every animation of a model wrap to its start at its end, instead of turning back.
| model | The model. |
| void AdvanceModelAnimations | ( | Model * | model | ) |
Advance every animation of a model by the time of the frame, blending its vertices between keyframes.
| model | The model. |
| void PlayModelAnimationsOnce | ( | Model * | model | ) |
Make the animations of a model stop at their ends rather than repeat.
| model | The model. |
Read a model from the cartridge and turn its offsets into pointers.
| dst | The memory to read it into. |
| romStart | The cartridge offset of the model. |
| romEnd | The cartridge offset of its end. |
|
extern |
The ambient light of the menus that draw models.
|
extern |
The directional light of the menus that draw models.
|
extern |
Whether DrawModelList() draws without the depth buffer.
|
extern |
The light of the parts of a model lit by their light ramp, by its index.