mm/include/z64snap.h
Anghelo Carvajal cd087d8511
Introduce a bunch of small new headers (#1649)
* regs.h

* gfxalloc.h

* z64inventory.h

* gfx.h

* graph.h

* z64olib.h

* z64elf_message.h

* fix missing include

* Include z64inventory.h on z64save.h

* fix bss

* Move PosRot to z64math.h

* So dumb

* Update src/overlays/actors/ovl_En_Kusa/z_en_kusa.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* review

* Remove graph.h

* bss

---------

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2024-07-28 13:53:28 -07:00

55 lines
1.8 KiB
C

#ifndef Z64SNAP_H
#define Z64SNAP_H
#include "PR/ultratypes.h"
#include "z64actor.h"
struct PlayState;
typedef s32 (*PictoValidationFunc)(struct PlayState*, Actor*);
typedef struct {
/* 0x000 */ Actor actor;
/* 0x144 */ PictoValidationFunc validationFunc;
} PictoActor;
// Picto validation flags
typedef enum {
// Used externally, set and read by actors
/* 0x00 */ PICTO_VALID_0,
/* 0x01 */ PICTO_VALID_IN_SWAMP,
/* 0x02 */ PICTO_VALID_MONKEY,
/* 0x03 */ PICTO_VALID_BIG_OCTO,
/* 0x04 */ PICTO_VALID_LULU_HEAD,
/* 0x05 */ PICTO_VALID_LULU_RIGHT_ARM,
/* 0x06 */ PICTO_VALID_LULU_LEFT_ARM, // Need all three of these to qualify as a good picture
/* 0x07 */ PICTO_VALID_SCARECROW,
/* 0x08 */ PICTO_VALID_TINGLE,
/* 0x09 */ PICTO_VALID_PIRATE_GOOD,
/* 0x0A */ PICTO_VALID_DEKU_KING,
/* 0x0B */ PICTO_VALID_PIRATE_TOO_FAR, // overlaps with PICTO_VALID_PIRATE_GOOD, but that is checked first
// Used internally, test for failures of position, angle etc.
/* 0x3B */ PICTO_VALID_BEHIND_COLLISION = 0x3B,
/* 0x3C */ PICTO_VALID_BEHIND_BG,
/* 0x3D */ PICTO_VALID_NOT_IN_VIEW,
/* 0x3E */ PICTO_VALID_BAD_ANGLE,
/* 0x3F */ PICTO_VALID_BAD_DISTANCE
} PictoValidFlag;
// The subregion of the picto photo that will set the flag for an actor being in the photo
#define PICTO_VALID_WIDTH 150
#define PICTO_VALID_HEIGHT 105
#define PICTO_VALID_TOPLEFT_X ((SCREEN_WIDTH - PICTO_VALID_WIDTH) / 2)
#define PICTO_VALID_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_VALID_HEIGHT) / 2)
s32 Snap_RecordPictographedActors(struct PlayState* play);
void Snap_SetFlag(s32 flag);
void Snap_UnsetFlag(s32 flag);
u32 Snap_CheckFlag(s32 flag);
s16 Snap_AbsS(s16 val);
s32 Snap_ValidatePictograph(struct PlayState* play, Actor* actor, s32 flag, Vec3f* pos, Vec3s* rot, f32 distanceMin, f32 distanceMax, s16 angleRange);
#endif