Skip to content

Commit a8054fe

Browse files
authored
Merge pull request #31 from bluisblu/dev
zWad general cleanup
2 parents 8ba7265 + 1971ebe commit a8054fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+379
-279
lines changed

src/SB/Core/x/xMath.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
// #define PI _771_1
2323
// #define ONEEIGHTY _778_0
2424
#define PI 3.1415927f
25+
#define PI_DOUBLE 3.141592653589793
2526
#define ONEEIGHTY 180.0f
2627

27-
#define DEG2RAD(x) ((PI) * (x) / (ONEEIGHTY))
28-
#define RAD2DEG(x) ((ONEEIGHTY) * (x) / (PI))
28+
#define DEG2RAD(x) ((PI_DOUBLE) * (x) / (ONEEIGHTY))
29+
#define RAD2DEG(x) ((ONEEIGHTY) * (x) / (PI_DOUBLE))
2930

3031
#define FLOAT_MAX 1e38f
3132
#define FLOAT_MIN -1e38f

src/SB/Core/x/xSGT.cpp

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/SB/Core/x/xWad3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ extern volatile U32 rndseed; // made this volatile so xrand() matches
16111611
F32 xDangleClamp(F32 a)
16121612
{
16131613
F32 rad360 = 2 * PI;
1614-
F32 rem = xfmod(a, rad360);
1614+
F32 rem = fmod(a, 2 * PI_DOUBLE);
16151615

16161616
if (rem >= PI)
16171617
{
@@ -1646,7 +1646,7 @@ F32 xAngleClampFast(F32 a)
16461646
F32 xAngleClamp(F32 a)
16471647
{
16481648
F32 rad360 = 2 * PI;
1649-
F32 rem = xfmod(a, rad360);
1649+
F32 rem = fmod(a, 2 * PI_DOUBLE);
16501650

16511651
if (rem < 0.0f)
16521652
{

src/SB/Core/x/xsavegame.cpp

Whitespace-only changes.

src/SB/Game/zCamera.h

Lines changed: 61 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -38,68 +38,73 @@ struct zCamTweakLook
3838
F32 pitch;
3939
};
4040

41-
extern F32 zcam_overrot_tmr;
42-
extern S32 zcam_near;
43-
extern S32 zcam_mode;
44-
extern S32 zcam_bbounce;
45-
extern S32 zcam_lbbounce;
46-
extern S32 zcam_convers;
47-
extern S32 zcam_lconvers;
48-
extern S32 zcam_longbounce;
49-
extern S32 zcam_highbounce;
50-
extern S32 zcam_cutscene;
51-
extern S32 zcam_reward;
52-
extern xVec3* zcam_playervel;
53-
extern S32 zcam_fly;
54-
extern S32 zcam_flypaused;
55-
extern void* zcam_flydata;
56-
extern U32 zcam_flysize;
57-
extern F32 zcam_flytime;
58-
extern U32 zcam_flyasset_current;
59-
extern xCamAsset* zcam_dest;
60-
extern F32 zcam_tmr;
61-
extern F32 zcam_ttm;
62-
extern F32 zcam_fovcurr;
63-
extern F32 zcam_fovdest;
64-
41+
// unknown if these are even used?
6542
extern xCamera zcam_backupcam;
6643
extern xCamera zcam_backupconvers;
6744
extern xQuat zcam_quat;
6845

69-
extern F32 zcam_pad_pyaw_scale;
70-
extern F32 zcam_pad_pitch_scale;
71-
extern F32 zcam_near_d;
72-
extern F32 zcam_near_h;
73-
extern F32 zcam_near_pitch;
74-
extern F32 zcam_far_d;
75-
extern F32 zcam_far_h;
76-
extern F32 zcam_far_pitch;
77-
extern F32 zcam_wall_d;
78-
extern F32 zcam_wall_h;
79-
extern F32 zcam_wall_pitch;
80-
extern F32 zcam_above_d;
81-
extern F32 zcam_above_h;
82-
extern F32 zcam_above_pitch;
83-
extern F32 zcam_below_d;
84-
extern F32 zcam_below_h;
85-
extern F32 zcam_below_pitch;
86-
extern F32 zcam_highbounce_d;
87-
extern F32 zcam_highbounce_h;
88-
extern F32 zcam_highbounce_pitch;
89-
extern F32 zcam_overrot_min;
90-
extern F32 zcam_overrot_mid;
91-
extern F32 zcam_overrot_max;
92-
extern F32 zcam_overrot_rate;
93-
extern F32 zcam_overrot_tstart;
94-
extern F32 zcam_overrot_tend;
95-
extern F32 zcam_overrot_velmin;
96-
extern F32 zcam_overrot_velmax;
97-
extern F32 zcam_overrot_tmanual;
98-
extern F32 zcam_mintgtheight;
99-
100-
46+
// .sbss
47+
F32 zcam_overrot_tmr;
48+
S32 zcam_near;
10149
U8 zcam_centering;
10250
U8 zcam_lastcentering;
51+
S32 zcam_mode;
52+
S32 zcam_bbounce;
53+
S32 zcam_lbbounce;
54+
S32 zcam_convers;
55+
S32 zcam_lconvers;
56+
S32 zcam_longbounce;
57+
S32 zcam_highbounce;
58+
S32 zcam_cutscene;
59+
S32 zcam_reward;
60+
xVec3* zcam_playervel;
61+
S32 zcam_fly;
62+
S32 zcam_flypaused;
63+
void* zcam_flydata;
64+
U32 zcam_flysize;
65+
F32 zcam_flytime;
66+
F32 zcam_flyrate;
67+
S32 zcam_flyJustStopped;
68+
xCamAsset* zcam_dest;
69+
F32 zcam_tmr;
70+
F32 zcam_ttm;
71+
F32 zcam_fovcurr;
72+
F32 zcam_fovdest;
73+
U32 zcam_flyasset_current;
74+
S32 sCamTweakCount;
75+
// .sdata
76+
77+
F32 zcam_pad_pyaw_scale = 0.18124573f; // unknown math
78+
F32 zcam_pad_pitch_scale = 1.0f / 52;
79+
F32 zcam_near_d = 3.0f;
80+
F32 zcam_near_h = 1.8f;
81+
F32 zcam_near_pitch = DEG2RAD(10);
82+
F32 zcam_far_d = 5.0f;
83+
F32 zcam_far_h = 3.0f;
84+
F32 zcam_far_pitch = DEG2RAD(15);
85+
F32 zcam_wall_d = 7.5f;
86+
F32 zcam_wall_h = 2.0f;
87+
F32 zcam_wall_pitch = DEG2RAD(18);
88+
F32 zcam_above_d = 0.2f;
89+
F32 zcam_above_h = 2.2f;
90+
F32 zcam_above_pitch = DEG2RAD(70);
91+
F32 zcam_below_d = 0.6f;
92+
F32 zcam_below_h = 0.2f;
93+
F32 zcam_below_pitch = DEG2RAD(-70);
94+
F32 zcam_highbounce_d = 0.2f;
95+
F32 zcam_highbounce_h = 5.0f;
96+
F32 zcam_highbounce_pitch = DEG2RAD(89);
97+
F32 zcam_overrot_min = DEG2RAD(25);
98+
F32 zcam_overrot_mid = DEG2RAD(90);
99+
F32 zcam_overrot_max = DEG2RAD(170);
100+
F32 zcam_overrot_rate = 0.1f;
101+
F32 zcam_overrot_tstart = 1.5f;
102+
F32 zcam_overrot_tend = 2.5f;
103+
F32 zcam_overrot_velmin = 3.0f;
104+
F32 zcam_overrot_velmax = 5.0f;
105+
F32 zcam_overrot_tmanual = 1.5f;
106+
F32 zcam_mintgtheight = FLOAT_MIN;
107+
103108
bool sNearToggleEnabled;
104109
F32 sCamTweakLerp;
105110
F32 sCamTweakTime;

src/SB/Game/zFX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "zFX.h"

src/SB/Game/zFX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct popper_data
7777
F32* weight;
7878
};
7979

80-
extern U32 gFXSurfaceFlags;
80+
U32 gFXSurfaceFlags;
8181

8282
void on_spawn_bubble_wall(const tweak_info& tweak);
8383
void zFX_SceneEnter(RpWorld* world);

src/SB/Game/zFXRibbonPool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "zFXRibbonPool.h"

src/SB/Game/zFXRibbonPool.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ifndef ZFXRIBBONPOOL_H
2+
#define ZFXRIBBONPOOL_H
3+
4+
#endif

src/SB/Game/zFire.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ifndef ZFIRE_H
2+
#define ZFIRE_H
3+
4+
#endif

0 commit comments

Comments
 (0)