Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def MatchingFor(*versions):
Object(Matching, "SB/Core/x/xRMemData.cpp", extra_cflags=["-sym on"]),
Object(Matching, "SB/Core/x/xFactory.cpp"),
Object(NonMatching, "SB/Core/x/xNPCBasic.cpp"),
Object(NonMatching, "SB/Game/zEntPlayerBungeeState.cpp"),
Object(NonMatching, "SB/Game/zEntPlayerBungeeState.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Game/zCollGeom.cpp"),
Object(NonMatching, "SB/Core/x/xParSys.cpp"),
Object(NonMatching, "SB/Core/x/xParEmitter.cpp"),
Expand Down
82 changes: 82 additions & 0 deletions src/SB/Core/x/xDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,95 @@

extern U32 gFrameCount;

struct uint_data
{
U32 value_def;
U32 value_min;
U32 value_max;
};

struct float_data
{
F32 value_def;
F32 value_min;
F32 value_max;
};

struct bool_data
{
U8 value_def;
};

struct select_data
{
U32 value_def;
U32 labels_size;
char** labels;
void* values;
};

struct flag_data
{
U32 value_def;
U32 mask;
};

struct raw_data
{
U8 pad[16];
};

struct int_data
{
S32 value_def;
S32 value_min;
S32 value_max;
};

struct tweak_callback;
struct tweak_info
{
substr name;
void* value;
tweak_callback* cb;
void* context;
U8 type;
U8 value_size;
U16 flags;
union
{
int_data int_context;
uint_data uint_context;
float_data float_context;
bool_data bool_context;
select_data select_context;
flag_data flag_context;
raw_data all_context;
};
};

struct tweak_callback
{
void (*on_change)(tweak_info&);
void (*on_select)(tweak_info&);
void (*on_unselect)(tweak_info&);
void (*on_start_edit)(tweak_info&);
void (*on_stop_edit)(tweak_info&);
void (*on_expand)(tweak_info&);
void (*on_collapse)(tweak_info&);
void (*on_update)(tweak_info&);
void (*convert_mem_to_tweak)(tweak_info&, void*);
void (*convert_tweak_to_mem)(tweak_info&, void*);
};

void xprintf(const char* msg, ...);
S32 xDebugModeAdd(char* mode, void(*debugFunc));
void xDebugInit();
void xDebugUpdate();
void xDebugExit();
void xDebugTimestampScreen();

void xDebugAddTweak(const char*, F32*, F32, F32, const tweak_callback*, void*, U32);
void xDebugRemoveTweak(const char*);
void xDebugUpdate();

Expand Down
3 changes: 3 additions & 0 deletions src/SB/Core/x/xFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <rwcore.h>
#include <rpworld.h>

class xModelInstance;

struct xFXRing
{
U32 texture;
Expand Down Expand Up @@ -120,6 +122,7 @@ void xFXRibbonRender();
void xFXAuraInit();
void xFXAuraUpdate(F32 dt);
void xFXAuraRender();
void xFXRenderProximityFade(const xModelInstance& model, F32 near_dist, F32 far_dist);
void xFXSceneInit();
void xFXSceneSetup();
void xFXSceneReset();
Expand Down
3 changes: 2 additions & 1 deletion src/SB/Core/x/xMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define SQR(x) ((x) * (x))

#define ALIGN(x, a) ((x) + ((a) - 1) & ~((a) - 1))
#define ALIGN(x, a) ((x) + ((a)-1) & ~((a)-1))

// Override these to point to their corresponding symbols in .sdata2
// For example:
Expand All @@ -28,6 +28,7 @@
#define RAD2DEG(x) ((ONEEIGHTY) * (x) / (PI))

#define FLOAT_MAX 1e38f
#define FLOAT_MIN -1e38f

struct xFuncPiece
{
Expand Down
1 change: 1 addition & 0 deletions src/SB/Core/x/xMath3.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void xMat3x3Tolocal(xVec3* o, const xMat3x3* m, const xVec3* v);
void xMat4x3MoveLocalRight(xMat4x3* m, F32 mag);
void xMat4x3MoveLocalAt(xMat4x3* m, F32 mag);
void xMat4x3MoveLocalUp(xMat4x3* m, F32 mag);
void xMat4x3OrthoInv(xMat4x3* o, const xMat4x3* m);
void xMat3x3GetEuler(const xMat3x3* m, xVec3* a);
void xMat3x3Euler(xMat3x3* m, const xVec3* ypr);
void xQuatToMat(const xQuat* q, xMat3x3* m);
Expand Down
1 change: 1 addition & 0 deletions src/SB/Core/x/xShadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ void xShadowSetLight(xVec3* param1, xVec3* param2, F32 param3);
void xShadowManager_Init(S32 numEnts);
void xShadowManager_Reset();
void xShadowManager_Render();
void xShadowRender(xEnt* ent, F32 max_dist);

#endif
2 changes: 2 additions & 0 deletions src/SB/Core/x/xVec3.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ struct xVec3
x = y = z = f;
return *this;
}
// FIXME: This should not be declared. Declaring it causes the assignment operator for the
// anonymous struct "camera" in hook_asset to call it rather than just copy the vec members.
xVec3& operator=(const xVec3&);
xVec3 operator+(const xVec3&) const;
xVec3 operator-(const xVec3&) const;
Expand Down
73 changes: 38 additions & 35 deletions src/SB/Game/zEntCruiseBubble.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#define ZENTCRUISEBUBBLE_H

#include "xDebug.h"

#include "zNPCHazard.h"
#include "zShrapnel.h"
#include <types.h>
Expand All @@ -14,6 +16,7 @@
// probably working on one of the bosses which also seem to use this.
// As of now I'm not sure if you should include this declaration,
// define your own or find a good place for shared use.
// NOTE (Square): pretty sure this is from xDebug
namespace auto_tweak
{
template <class T1, class T2>
Expand All @@ -26,29 +29,29 @@ namespace cruise_bubble
{
enum state_enum
{
BEGIN_STATE_PLAYER,
STATE_PLAYER_HALT = 0x0,
STATE_PLAYER_AIM,
STATE_PLAYER_FIRE,
STATE_PLAYER_WAIT,
END_STATE_PLAYER,
BEGIN_STATE_MISSLE = 0x4,
BACKUP_STATE_MISSLE = 0x3,
STATE_MISSLE_APPEAR,
STATE_MISSLE_FLY,
STATE_MISSLE_EXPLODE,
END_STATE_MISSLE,
BEGIN_STATE_CAMERA = 0x7,
BACKUP_STATE_CAMERA = 0x6,
STATE_CAMERA_AIM,
STATE_CAMERA_SEIZE,
STATE_CAMERA_ATTACH,
STATE_CAMERA_SURVEY,
STATE_CAMERA_RESTORE,
END_STATE_CAMERA,
MAX_STATE = 0xc,
BACKUP_STATE_PLAYER = 0xffffffff,
STATE_INVALID = 0xffffffff
BEGIN_STATE_PLAYER,
STATE_PLAYER_HALT = 0x0,
STATE_PLAYER_AIM,
STATE_PLAYER_FIRE,
STATE_PLAYER_WAIT,
END_STATE_PLAYER,
BEGIN_STATE_MISSLE = 0x4,
BACKUP_STATE_MISSLE = 0x3,
STATE_MISSLE_APPEAR,
STATE_MISSLE_FLY,
STATE_MISSLE_EXPLODE,
END_STATE_MISSLE,
BEGIN_STATE_CAMERA = 0x7,
BACKUP_STATE_CAMERA = 0x6,
STATE_CAMERA_AIM,
STATE_CAMERA_SEIZE,
STATE_CAMERA_ATTACH,
STATE_CAMERA_SURVEY,
STATE_CAMERA_RESTORE,
END_STATE_CAMERA,
MAX_STATE = 0xc,
BACKUP_STATE_PLAYER = 0xffffffff,
STATE_INVALID = 0xffffffff
};

enum thread_enum
Expand Down Expand Up @@ -307,21 +310,21 @@ namespace cruise_bubble
{
F32 life;
F32 hit_dist; // 0x18
F32 crash_angle; // 0x1c
F32 collide_twist; // 0x20
S32 hit_tests; // 0x24
F32 crash_angle; // 0x1c
F32 collide_twist; // 0x20
S32 hit_tests; // 0x24
struct _class_27
{
F32 delay_show; // 0x28
F32 delay_fly; // 0x2c
xVec3 offset; // 0x30
F32 delay_show; // 0x28
F32 delay_fly; // 0x2c
xVec3 offset; // 0x30
} appear;
struct _class_32
{
F32 accel; // 0x3c
F32 max_vel; // 0x40
F32 engine_pitch_max; // 0x44
F32 engine_pitch_sensitivity; // 0x48
F32 accel; // 0x3c
F32 max_vel; // 0x40
F32 engine_pitch_max; // 0x44
F32 engine_pitch_sensitivity; // 0x48
// Offset: 0x4c
F32 flash_interval;
struct _class_38
Expand Down Expand Up @@ -385,7 +388,7 @@ namespace cruise_bubble
struct _class_48
{
F32 env_alpha;
F32 env_coeff; // 0xd0
F32 env_coeff; // 0xd0
U32 env_texture; // 0xd4
F32 fresnel_alpha; // 0xd8
F32 fresnel_coeff; // 0xdc
Expand Down Expand Up @@ -554,7 +557,7 @@ namespace cruise_bubble

missle_record_data(const xVec3& loc, F32 roll);
};
}
} // namespace

void init_sound();
void stop_sound(S32 which, U32 handle);
Expand Down
Loading
Loading