Merge branch 'master' of https://gitlab.com/banjo.decomp/banjo-kazooie into document/sandcastle

This commit is contained in:
Bl00D4NGEL
2024-10-10 22:18:47 +02:00
287 changed files with 4204 additions and 3793 deletions

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void spawnQueue_bundle_f32(s32, s32, s32, s32);
extern Actor *spawnQueue_bundle_f32(s32, s32, s32, s32);
extern f32 func_80257204(f32, f32, f32, f32);
extern ActorProp * func_80320EB0(ActorMarker *, f32, s32);
@@ -19,7 +19,7 @@ ActorAnimationInfo gChClamAnimations[4] = {
ActorInfo gChClam = {
MARKER_15_CLAM, ACTOR_69_CLAM, ASSET_351_MODEL_CLAM,
0x1, gChClamAnimations,
__chClam_updateFunc, func_80326224, actor_draw,
__chClam_updateFunc, actor_update_func_80326224, actor_draw,
4500, 0x366, 1.6f, 0
};
@@ -134,8 +134,8 @@ static bool __chClam_rotateTowardTarget(Actor *this, s32 arg1) {
static void __chClam_particalEmitterInit(ParticleEmitter *pCtrl, f32 position[3]){
particleEmitter_setPosition(pCtrl, position);
func_802EF9F8(pCtrl, 0.7f);
func_802EFA18(pCtrl, 3);
particleEmitter_func_802EF9F8(pCtrl, 0.7f);
particleEmitter_func_802EFA18(pCtrl, 3);
func_802EFA20(pCtrl, 0.8f, 1.0f);
particleEmitter_setSfx(pCtrl, SFX_1F_HITTING_AN_ENEMY_3, 10000);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
@@ -145,7 +145,7 @@ static void __chClam_particalEmitterInit(ParticleEmitter *pCtrl, f32 position[3]
}
static void __chClam_emitLargeShellParticles(f32 position[3], s32 count){
static struct41s D_8038C3F4 = {
static ParticleSettingsVelocityAcceleration D_8038C3F4 = {
{{-50.0f, 750.0f, -50.0f}, {120.0f, 900.0f, 120.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}}
};
@@ -161,7 +161,7 @@ static void __chClam_emitLargeShellParticles(f32 position[3], s32 count){
}
static void __chClam_emitEyeParticles(f32 position[3], s32 count){
static struct41s D_8038C424 = {
static ParticleSettingsVelocityAcceleration D_8038C424 = {
{{-80.0f, 400.0f, -80.0f}, {160.0f, 860.0f, 160.0f}},
{{ 0.0f, -1400.0f, 0.0f}, { 0.0f, -1400.0f, 0.0f}}
};
@@ -177,7 +177,7 @@ static void __chClam_emitEyeParticles(f32 position[3], s32 count){
}
static void __chClam_emitSmallShellParticles(f32 position[3], s32 count){
static struct41s D_8038C454 = {
static ParticleSettingsVelocityAcceleration D_8038C454 = {
{{-200.0f, 850.0f, -200.0f}, {400.0f, 1000.0f, 400.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}}
};
@@ -201,7 +201,7 @@ static void __chClam_emitEatencollectibleParticles(f32 position[3], enum asset_e
0.0f, 0.5f
};
static struct41s D_8038C4AC = {
static ParticleSettingsVelocityAcceleration D_8038C4AC = {
{{-340.0f, 100.0f, -340.0f}, {340.0f, 250.0f, 340.0f}},
{{ 0.0f, -1200.0f, 0.0f}, { 0.0f, -1200.0f, 0.0f}}
};
@@ -232,12 +232,12 @@ static void __chClam_takeDamage(ActorMarker *this_marker, ActorMarker *other_mar
marker_despawn(this->marker);
}
static void __chClam_playerDropsItem(s32 index, enum item_e item_id){
static void __chClam_playerDropsItem(enum bundle_e bundle_id, enum item_e item_id){
f32 position[3];
player_getPosition(position);
bundle_setYaw(randf2(0.0f, 359.0f));
__spawnQueue_add_4((GenFunction_4)spawnQueue_bundle_f32, index, reinterpret_cast(s32, position[0]), reinterpret_cast(s32, position[1]), reinterpret_cast(s32, position[2]));
__spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, bundle_id, reinterpret_cast(s32, position[0]), reinterpret_cast(s32, position[1]), reinterpret_cast(s32, position[2]));
item_dec(item_id);
}
@@ -249,11 +249,13 @@ static void __chClam_attackOther(ActorMarker *this_marker, ActorMarker *other_ma
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_5_CLAM_FIRST_MEET_TEXT_SHOWN, TRUE);
}
if(item_getCount(ITEM_D_EGGS) != 0)
__chClam_playerDropsItem(0xe, ITEM_D_EGGS);
if (item_getCount(ITEM_D_EGGS) != 0) {
__chClam_playerDropsItem(BUNDLE_E_YUMYUM_BLUE_EGG, ITEM_D_EGGS);
}
if(item_getCount(ITEM_F_RED_FEATHER) != 0)
__chClam_playerDropsItem(0xf, ITEM_F_RED_FEATHER);
if (item_getCount(ITEM_F_RED_FEATHER) != 0) {
__chClam_playerDropsItem(BUNDLE_F_YUMYUM_RED_FEATHER, ITEM_F_RED_FEATHER);
}
}
static void __chClam_updateFunc(Actor *this){

View File

@@ -18,7 +18,7 @@ ActorAnimationInfo gChLeakyAnimations[3] = {
ActorInfo gChLeaky = {
MARKER_33_LEAKY, ACTOR_1E_LEAKY, ASSET_51A_MODEL_LEAKY,
0x1, gChLeakyAnimations,
__chLeaky_updateFunc, func_80326224, actor_draw,
__chLeaky_updateFunc, actor_update_func_80326224, actor_draw,
0, 0, 0.0f, 0
};
@@ -39,11 +39,13 @@ static void __chLeaky_updateFunc(Actor *this) {
if (!this->volatile_initialized) {
this->volatile_initialized = TRUE;
this->marker->propPtr->unk8_3 = FALSE;
if (levelSpecificFlags_get(5) != 0) {
levelSpecificFlags_set(5, FALSE);
if (levelSpecificFlags_get(LEVEL_FLAG_5_TTC_UNKNOWN) != FALSE) {
levelSpecificFlags_set(LEVEL_FLAG_5_TTC_UNKNOWN, FALSE);
timedFunc_set_1(0.5f, (GenFunction_1)comusic_playTrack, COMUSIC_2D_PUZZLE_SOLVED_FANFARE);
}
if (levelSpecificFlags_get(2) != 0) {
if (levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN) != FALSE) {
temp_v0_2 = func_8034C5AC(300);
if (temp_v0_2 != 0) {
func_8034E71C(temp_v0_2, -600, 0.0f);
@@ -102,14 +104,17 @@ static void __chLeaky_showDoneText(ActorMarker *caller, enum asset_e text_id, s3
bool chLeaky_eggCollision(ActorMarker *marker){
Actor *this = marker_getActor(marker);
if(levelSpecificFlags_get(2))
if (levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN)) {
return TRUE;
}
comusic_playTrack(COMUSIC_2B_DING_B);
this->unk38_31++;
if(this->unk38_31 < 2)
if (this->unk38_31 < 2) {
return TRUE;
}
levelSpecificFlags_set(2, TRUE);
levelSpecificFlags_set(5, TRUE);

View File

@@ -33,21 +33,21 @@ ActorAnimationInfo gChLockupAnimations[6] ={
ActorInfo gChLockupSlow = {
MARKER_A4_LOCKUP_SLOW, ACTOR_151_LOCKUP_SLOW, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, func_80326224, __chLockup_drawFunc,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
2500, 0x366, 0.0f, 0
};
ActorInfo gChLockupMedium = {
MARKER_F6_LOCKUP_MEDIUM, ACTOR_152_LOCKUP_MEDIUM, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, func_80326224, __chLockup_drawFunc,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
2500, 0x366, 0.0f, 0
};
ActorInfo gChLockupFast = {
MARKER_F7_LOCKUP_FAST, ACTOR_153_LOCKUP_FAST, ASSET_3D4_MODEL_LOCKUP,
1, gChLockupAnimations,
__chLockup_updateFunc, func_80326224, __chLockup_drawFunc,
__chLockup_updateFunc, actor_update_func_80326224, __chLockup_drawFunc,
2500, 0x366, 0.0f, 0
};

View File

@@ -30,7 +30,7 @@ ActorAnimationInfo gChNipperAnimations[8] = {
ActorInfo gChNipper = {
MARKER_A5_NIPPER, ACTOR_117_NIPPER, ASSET_3D5_MODEL_NIPPER,
0x1, gChNipperAnimations,
__chNipper_updateFunc, func_80326224, __chNipper_animFunc,
__chNipper_updateFunc, actor_update_func_80326224, __chNipper_animFunc,
0, 0x299, 10.0f, 0
};
@@ -52,7 +52,7 @@ static void __chNipper_drawParticlesAtPosition(f32 *position, s32 count) {
particleEmitter_setRGB(pCtrl, D_8038C5A4);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
particleEmitter_setSpawnPositionRange(pCtrl,
-10.0f, -5.0f, -10.0f,
10.0f, 10.0f, 10.0f
);

View File

@@ -15,7 +15,7 @@ ActorAnimationInfo gChTreasureAnimations[4] = {
ActorInfo gChTreasure = {
MARKER_DB_BURIED_TREASURE, ACTOR_F4_BURIED_TREASURE, ASSET_42C_MODEL_BURIED_TREASURE,
1, gChTreasureAnimations,
__chTreasure_updateFunc, func_80326224, actor_draw,
__chTreasure_updateFunc, actor_update_func_80326224, actor_draw,
0, 0, 1.7f, 0
};

View File

@@ -38,21 +38,21 @@ static s32 sChTreasurehunt_StepActors[6] = {
ActorInfo gChTreasurehuntRedArrow = {
MARKER_62_RED_ARROW, ACTOR_53_RED_ARROW, ASSET_3E9_MODEL_RED_ARROW,
0, NULL,
__chTreasurehunt_updateFunc, func_80326224, __chTreasurehunt_animFunc,
__chTreasurehunt_updateFunc, actor_update_func_80326224, __chTreasurehunt_animFunc,
0, 0x400, 0.0f, 0
};
ActorInfo gChTreasurehuntRedQuestionMark = {
MARKER_63_RED_QUESTION_MARK, ACTOR_54_RED_QUESTION_MARK, ASSET_3EB_MODEL_RED_QUESTION_MARK,
0, NULL,
__chTreasurehunt_updateFunc, func_80326224, __chTreasurehunt_animFunc,
__chTreasurehunt_updateFunc, actor_update_func_80326224, __chTreasurehunt_animFunc,
0, 0x400, 0.0f, 0
};
ActorInfo gChTreasurehuntRedX = {
MARKER_64_RED_X, ACTOR_55_RED_X, ASSET_3EA_MODEL_RED_X,
0, NULL,
__chTreasurehunt_updateFunc, func_80326224, __chTreasurehunt_animFunc,
__chTreasurehunt_updateFunc, actor_update_func_80326224, __chTreasurehunt_animFunc,
0, 0x400, 0.0f, 0
};
@@ -66,7 +66,7 @@ ParticleScaleAndLifetimeRanges CH_TREASUREHUNT_PARTICLE_SCALE_AND_LIFETIME_RANGE
0.0f, 0.01f
};
struct42s CH_TREASUREHUNT_VELOCITY_RANGES = {
ParticleSettingsVelocityPosition CH_TREASUREHUNT_VELOCITY_RANGES = {
{{-230.0f, 30.0f, -230.0f}, {230.0f, 110.0f, 230.0f}},
{{-60.0f, 0.0f, -60.0f}, {60.0f, 30.0f, 60.0f}},
};

View File

@@ -35,56 +35,56 @@ void code26D0_sharkfoodIslandUpdateFunc(Actor *this);
ActorInfo gBlubberShipTopHatch = {
MARKER_A1_BLUBBER_SHIP_TOP_HATCH, ACTOR_10E_BLUBBER_SHIP_TOP_HATCH, ASSET_3D2_MODEL_BLUBBER_SHIP_TOP_HATCH,
0x1, NULL,
func_802D3D54, func_80326224, actor_drawFullDepth,
func_802D3D54, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gLighthouseDoor = {
MARKER_EA_LIGHTHOUSE_DOOR, ACTOR_13E_LIGHTHOUSE_DOOR, ASSET_3D6_MODEL_LIGHTHOUSE_DOOR,
0x1, NULL,
func_802D3D54, func_80326224, actor_drawFullDepth,
func_802D3D54, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gSharkfoodIsland = {
MARKER_167_SHARKFOOD_ISLAND, ACTOR_25C_SHARKFOOD_ISLAND, ASSET_50A_MODEL_SHARKFOOD_ISLAND,
0x1, NULL,
code26D0_sharkfoodIslandUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_sharkfoodIslandUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gLighthouseA = {
MARKER_267_LIGHTHOUSE_A, ACTOR_2E2_LIGHTHOUSE_A, ASSET_3BD_MODEL_LIGHTHOUSE_A,
0x1, NULL,
code26D0_lighthouseAUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_lighthouseAUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gLighthouseB = {
MARKER_26A_LIGHTHOUSE_B, ACTOR_2DF_LIGHTHOUSE_B, ASSET_3BE_MODEL_LIGHTHOUSE_B,
0x1, NULL,
code26D0_genericUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gStairs1 = {
MARKER_268_STAIRS_1, ACTOR_2E0_TTC_STAIRS_1, ASSET_3B6_MODEL_TTC_STAIRS_1,
0x1, NULL,
code26D0_genericUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gStairs2 = {
MARKER_269_STAIRS_2, ACTOR_2E1_TTC_STAIRS_2, ASSET_3B7_MODEL_TTC_STAIRS_1,
0x1, NULL,
code26D0_genericUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_genericUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};
ActorInfo gPalmTree = {
MARKER_1D5_PALM_TREE, ACTOR_31E_PALM_TREE, ASSET_3A9_MODEL_PALM_TREE,
0x1, NULL,
code26D0_palmTreeUpdateFunc, func_80326224, actor_drawFullDepth,
code26D0_palmTreeUpdateFunc, actor_update_func_80326224, actor_drawFullDepth,
0, 0, 0.0f, 0
};

View File

@@ -422,7 +422,7 @@ static void __code3E30_checkFloorTileForRegularCheatCode(LetterFloorTile *letter
sMapState.banjoKazooieCodeEnteredState = 2;
sMapState.unkC = 0.0f;
mapSpecificFlags_set(TTC_SPECIFIC_FLAG_1_UNKNOWN, TRUE);
fileProgressFlag_set(0xFA, TRUE);
fileProgressFlag_set(FILEPROG_FA_UNKNOWN, TRUE);
func_8030E2C4(sMapState.doorOpeningSfxSourceIdx);
__code3E30_setupCheatCodeTimer(2);
}
@@ -506,8 +506,9 @@ void code3E30_overlayInit(void)
void *sp2C;
void *sp28;
if (map_get() == MAP_7_TTC_TREASURE_TROVE_COVE && levelSpecificFlags_get(0x2))
{
if( map_get() == MAP_7_TTC_TREASURE_TROVE_COVE
&& levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN)
){
sp2C = func_8034C5AC(0x12C);
if (sp2C)
{
@@ -523,8 +524,7 @@ void code3E30_overlayInit(void)
{
sp2C = func_8034C5AC(0x131);
sp28 = func_8034C5AC(0x12C);
if (levelSpecificFlags_get(5))
{
if (levelSpecificFlags_get(LEVEL_FLAG_5_TTC_UNKNOWN)) {
func_8034E71C(sp2C, -500, 10.0f);
func_80324E38(0.0f, 3);
timed_setStaticCameraToNode(0.0f, 1);
@@ -533,12 +533,10 @@ void code3E30_overlayInit(void)
func_803228D8();
timedFunc_set_3(2.0f, (GenFunction_3)func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0);
}
else if (levelSpecificFlags_get(2) || volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME))
{
else if (levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN) || volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME)) {
func_8034E71C(sp2C, -500, 0.0f);
}
else
{
else {
func_8034E71C(sp28, -500, 0.0f);
} // L8038B1EC
@@ -608,7 +606,7 @@ void code3E30_overlayUpdate(void)
}
if ((sMapState.banjoKazooieCodeEnteredState == 0) || (sMapState.banjoKazooieCodeEnteredState == 3))
{
if ((levelSpecificFlags_get(2) || volatileFlag_get(VOLATILE_FLAG_3)) && (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) && func_8028F20C())
if ((levelSpecificFlags_get(LEVEL_FLAG_2_TTC_UNKNOWN) || volatileFlag_get(VOLATILE_FLAG_3)) && (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) && func_8028F20C())
{
mesh_id_closest_to_player = func_8033F3C0(sMapState.model1, player_position);
if (mesh_id_closest_to_player != 0)