Picto defines

This commit is contained in:
Derek Hensley 2022-10-06 20:49:46 -07:00
parent 7ff9f511ad
commit ef4db3887f
5 changed files with 20 additions and 9 deletions

View File

@ -3479,7 +3479,7 @@ extern GfxPool gGfxPools[2];
extern u8 gAudioHeap[0x138000];
extern u8 gSystemHeap[UNK_SIZE];
extern u8 gPictoPhotoI8[0x4600];
extern u8 gPictoPhotoI8[PICTO_SIZE];
extern u8 D_80784600[0x56200];
extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH];

View File

@ -133,6 +133,15 @@ typedef enum {
/* 52 */ HUD_VISIBILITY_NONE_INSTANT = 52
} HudVisibility;
#define PICTO_RESOLUTION_WIDTH 160
#define PICTO_RESOLUTION_HEIGHT 112
#define PICTO_TOPLEFT_X ((void)0, ((SCREEN_WIDTH - PICTO_RESOLUTION_WIDTH) / 2))
#define PICTO_TOPLEFT_Y ((void)0, ((SCREEN_HEIGHT - PICTO_RESOLUTION_HEIGHT) / 2))
#define PICTO_SIZE (PICTO_RESOLUTION_WIDTH * PICTO_RESOLUTION_HEIGHT)
#define PICTO_COMPRESSED_SIZE (PICTO_SIZE * 5 / 8)
typedef struct SramContext {
/* 0x00 */ u8* readBuff;
/* 0x04 */ u8 *saveBuf;
@ -298,7 +307,7 @@ typedef struct SaveContext {
/* 0x1050 */ u64 bottleTimerTimeLimits[BOTTLE_MAX]; // The original total time given before the timer expires, in centiseconds (1/100th sec). "bottle_sub"
/* 0x1080 */ u64 bottleTimerCurTimes[BOTTLE_MAX]; // The remaining time left before the timer expires, in centiseconds (1/100th sec). "bottle_time"
/* 0x10B0 */ OSTime bottleTimerPausedOsTimes[BOTTLE_MAX]; // The cumulative osTime spent with the timer paused. "bottle_stop_time"
/* 0x10E0 */ u8 pictoPhotoI5[0x2BC0]; // buffer containing the pictograph photo, compressed to I5 from I8
/* 0x10E0 */ u8 pictoPhotoI5[PICTO_COMPRESSED_SIZE]; // buffer containing the pictograph photo, compressed to I5 from I8
/* 0x3CA0 */ s32 fileNum; // "file_no"
/* 0x3CA4 */ s16 powderKegTimer; // "big_bom_timer"
/* 0x3CA6 */ u8 unk_3CA6;

View File

@ -36,11 +36,11 @@ typedef enum {
/* 0x3F */ PICTOGRAPH_BAD_DISTANCE
} PictographFlag;
// The following macros are subject to renaming once the capture system is better understood
#define PICTO_RESOLUTION_HORIZONTAL 150
#define PICTO_RESOLUTION_VERTICAL 105
#define PICTO_CAPTURE_REGION_TOPLEFT_X ((SCREEN_WIDTH - PICTO_RESOLUTION_HORIZONTAL) / 2)
#define PICTO_CAPTURE_REGION_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_RESOLUTION_VERTICAL) / 2)
// The subregion of the picto photo that will set the flag for an actor being in the photo
#define PICTO_CAPTURE_REGION_WIDTH 150
#define PICTO_CAPTURE_REGION_HEIGHT 105
#define PICTO_CAPTURE_REGION_TOPLEFT_X ((SCREEN_WIDTH - PICTO_CAPTURE_REGION_WIDTH) / 2)
#define PICTO_CAPTURE_REGION_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_CAPTURE_REGION_HEIGHT) / 2)
s32 Snap_RecordPictographedActors(PlayState* play);
void Snap_SetFlag(s32 flag);

View File

@ -211,7 +211,9 @@ void Play_TriggerPictographPhoto(void) {
void Play_TakePictographPhoto(PreRender* prerender) {
PreRender_ApplyFilters(prerender);
Play_ConvertRgba16ToIntensityImage(gPictoPhotoI8, prerender->fbufSave, 320, 80, 64, 240 - 1, 176 - 1, 8);
Play_ConvertRgba16ToIntensityImage(gPictoPhotoI8, prerender->fbufSave, SCREEN_WIDTH, PICTO_TOPLEFT_X,
PICTO_TOPLEFT_Y, (PICTO_TOPLEFT_X + PICTO_RESOLUTION_WIDTH) - 1,
(PICTO_TOPLEFT_Y + PICTO_RESOLUTION_HEIGHT) - 1, 8);
}
s32 Play_ChooseDynamicTransition(PlayState* this, s32 transitionType) {

View File

@ -174,7 +174,7 @@ s32 Snap_ValidatePictograph(PlayState* play, Actor* actor, s32 flag, Vec3f* pos,
y = (s16)PROJECTED_TO_SCREEN_Y(projectedPos, distance) - PICTO_CAPTURE_REGION_TOPLEFT_Y;
// checks if the coordinates are within the capture region
if ((x < 0) || (x > PICTO_RESOLUTION_HORIZONTAL) || (y < 0) || (y > PICTO_RESOLUTION_VERTICAL)) {
if ((x < 0) || (x > PICTO_CAPTURE_REGION_WIDTH) || (y < 0) || (y > PICTO_CAPTURE_REGION_HEIGHT)) {
Snap_SetFlag(PICTOGRAPH_NOT_IN_VIEW);
ret |= PICTOGRAPH_NOT_IN_VIEW;
}