Skip to content

Commit 2457120

Browse files
authored
Remove global.h from z_fishing (#1977)
1 parent a599d7d commit 2457120

File tree

8 files changed

+25
-17
lines changed

8 files changed

+25
-17
lines changed

include/z64actor.h

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef Z64ACTOR_H
22
#define Z64ACTOR_H
33

4+
#include "color.h"
45
#include "z64dma.h"
56
#include "z64animation.h"
67
#include "z64math.h"
@@ -14,19 +15,15 @@
1415
#define MASS_HEAVY 0xFE // Can only be pushed by OC colliders from actors with IMMOVABLE or HEAVY mass.
1516

1617
struct Actor;
17-
struct PlayState;
18+
struct CollisionPoly;
1819
struct Lights;
20+
struct PlayState;
1921

2022
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
2123
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
2224
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
2325
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
2426

25-
typedef struct {
26-
Vec3f pos;
27-
Vec3s rot;
28-
} PosRot; // size = 0x14
29-
3027
typedef struct {
3128
/* 0x00 */ s16 id;
3229
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
@@ -270,8 +267,8 @@ typedef struct Actor {
270267
/* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used
271268
/* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame
272269
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap for velocity along the Y axis. Only relevant when moved with gravity.
273-
/* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching
274-
/* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor
270+
/* 0x074 */ struct CollisionPoly* wallPoly; // Wall polygon the actor is touching
271+
/* 0x078 */ struct CollisionPoly* floorPoly; // Floor polygon directly below the actor
275272
/* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching
276273
/* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor
277274
/* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching

include/z64bgcheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct {
4949
// flags for flags_vIB
5050
#define COLPOLY_IS_FLOOR_CONVEYOR (1 << 0)
5151

52-
typedef struct {
52+
typedef struct CollisionPoly {
5353
/* 0x00 */ u16 type;
5454
union {
5555
u16 vtxData[3];

include/z64camera.h

+8-5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
// Use a camera pivot setting that allows camera rotation (CAM_SET_PIVOT_SHOP_BROWSING for shop specifically)
131131
#define VIEWPOINT_PIVOT (BGCAM_INDEX_TOGGLE_PIVOT + 1)
132132

133+
struct Actor;
134+
struct CollisionPoly;
135+
133136
typedef enum {
134137
/* 0x00 */ CAM_SET_NONE,
135138
/* 0x01 */ CAM_SET_NORMAL0,
@@ -336,7 +339,7 @@ typedef enum {
336339

337340
typedef struct {
338341
/* 0x00 */ Vec3f collisionClosePoint;
339-
/* 0x0C */ CollisionPoly* atEyePoly;
342+
/* 0x0C */ struct CollisionPoly* atEyePoly;
340343
/* 0x10 */ f32 swingUpdateRate;
341344
/* 0x14 */ s16 unk_14;
342345
/* 0x16 */ s16 unk_16;
@@ -676,7 +679,7 @@ typedef struct {
676679
/* 0x00 */ f32 initialEyeToAtDist;
677680
/* 0x04 */ f32 roll;
678681
/* 0x08 */ f32 yPosOffset;
679-
/* 0x0C */ Actor* target;
682+
/* 0x0C */ struct Actor* target;
680683
/* 0x10 */ f32 unk_10;
681684
/* 0x14 */ s16 unk_14; // unused
682685
/* 0x16 */ s16 initialEyeToAtYaw;
@@ -757,7 +760,7 @@ typedef struct {
757760
/* 0x00 */ f32 unk_00;
758761
/* 0x04 */ f32 unk_04;
759762
/* 0x08 */ f32 unk_08;
760-
/* 0x0C */ Actor* unk_0C;
763+
/* 0x0C */ struct Actor* unk_0C;
761764
/* 0x10 */ s16 unk_10;
762765
/* 0x12 */ s16 unk_12;
763766
/* 0x14 */ s16 unk_14;
@@ -806,7 +809,7 @@ typedef struct {
806809
/* 0x00 */ f32 eyeToAtTargetR;
807810
/* 0x08 */ f32 eyeToAtTargetYaw;
808811
/* 0x04 */ f32 eyeToAtTargetPitch;
809-
/* 0x0C */ Actor* target;
812+
/* 0x0C */ struct Actor* target;
810813
/* 0x10 */ Vec3f atTarget;
811814
/* 0x1C */ s16 animTimer;
812815
} KeepOn3ReadWriteData; // size = 0x20
@@ -1548,7 +1551,7 @@ typedef union {
15481551
typedef struct {
15491552
/* 0x00 */ Vec3f pos;
15501553
/* 0x0C */ Vec3f norm;
1551-
/* 0x18 */ CollisionPoly* poly;
1554+
/* 0x18 */ struct CollisionPoly* poly;
15521555
/* 0x1C */ VecGeo geoNorm;
15531556
/* 0x24 */ s32 bgId;
15541557
} CamColChk; // size = 0x28

include/z64cutscene.h

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define Z64CUTSCENE_H
33

44
#include "ultra64.h"
5+
#include "z64math.h"
56

67
typedef union CutsceneData {
78
s32 i;

include/z64math.h

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ typedef struct {
3737
f32 radius;
3838
} Spheref; // size = 0x10
3939

40+
typedef struct {
41+
/* 0x00 */ Vec3f pos;
42+
/* 0x0C */ Vec3s rot;
43+
} PosRot; // size = 0x14
44+
4045
typedef struct {
4146
Vec3f normal;
4247
f32 originDist;

src/code/sys_math3d.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// For retail BSS ordering, the block number of cbf in Math3D_CylVsCylOverlapCenterDist
99
// must be 0.
10-
#pragma increment_block_number 111
10+
#pragma increment_block_number 108
1111

1212
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
1313
Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);

src/overlays/actors/ovl_Fishing/z_fishing.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
#include "overlays/actors/ovl_En_Kanban/z_en_kanban.h"
1010
#include "assets/objects/object_fish/object_fish.h"
11+
#include "ichain.h"
1112
#include "terminal.h"
1213

1314
// For retail BSS ordering, the block number of sStreamSfxProjectedPos must be 0.
14-
#pragma increment_block_number 183
15+
#pragma increment_block_number 182
1516

1617
#define FLAGS ACTOR_FLAG_4
1718

src/overlays/actors/ovl_Fishing/z_fishing.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#define Z_FISHING_H
33

44
#include "ultra64.h"
5-
#include "global.h"
5+
#include "z64actor.h"
6+
#include "z64light.h"
67

78
struct Fishing;
89

0 commit comments

Comments
 (0)