Bunch of less urgent fixes

This commit is contained in:
Mors 2022-11-19 16:03:07 +03:00
parent 7639472079
commit de81144bf5
12 changed files with 67 additions and 22 deletions

14
.idea/deployment.xml Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData">
<serverData>
<paths name="Raspberry Pi (4ed092aa-856c-487d-b291-f2a41b318cb5)">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

View file

@ -1 +1 @@
v3.0.1
v3.0.2

View file

@ -178,6 +178,7 @@ enum DialogId {
DIALOG_172,
DIALOG_173,
DIALOG_174,
DIALOG_175,
DIALOG_COUNT
};

View file

@ -114,7 +114,7 @@ u8 sDialogSpeaker[] = {
/*14*/ _, _, _, _, _, _, _, _, _, _,
/*15*/ WIGLR, WIGLR, WIGLR, _, _, _, _, _, _, _,
/*16*/ _, YOSHI, _, _, _, _, _, _, WIGLR, _,
/*NW*/ _, _, TUXIE, TUXIE, _
/*NW*/ _, _, TUXIE, TUXIE, _, _
};
#undef _
STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT,

View file

@ -991,11 +991,11 @@ void cur_obj_update(void) {
} else if ((objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) {
if (!(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)) {
if (configDrawDistanceMultiplier <= 0.0f) {
if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE)
{
gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY;
}
if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE)
{
gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY;
}
}
else {
// If the object has a render distance, check if it should be shown.
@ -1011,4 +1011,4 @@ void cur_obj_update(void) {
}
}
}
}
}

View file

@ -28,7 +28,7 @@ void bhv_donut_platform_spawner_update(void) {
marioSqDist = dx * dx + dy * dy + dz * dz;
// dist > 1000 and dist < 2000
if (marioSqDist > 1000000.0f && marioSqDist < 4000000.0f) {
if (marioSqDist > 1000000.0f && ((marioSqDist < 4000000.0f * configDrawDistanceMultiplier) || configDrawDistanceMultiplier <= 0.0)) {
if (spawn_object_relative(i, sDonutPlatformPositions[i][0],
sDonutPlatformPositions[i][1], sDonutPlatformPositions[i][2],
o, MODEL_RR_DONUT_PLATFORM, bhvDonutPlatform)
@ -41,12 +41,14 @@ void bhv_donut_platform_spawner_update(void) {
}
void bhv_donut_platform_update(void) {
if (o->oTimer != 0 && ((o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) || o->oDistanceToMario > 2500.0f)) {
f32 dist = 2500.0f * configDrawDistanceMultiplier;
if (o->oTimer != 0 && ((o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) || (o->oDistanceToMario > dist && configDrawDistanceMultiplier > 0.0))) {
o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms =
o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms
& ((1 << o->oBehParams2ndByte) ^ 0xFFFFFFFF);
if (o->oDistanceToMario > 2500.0f) {
if (o->oDistanceToMario > dist && configDrawDistanceMultiplier > 0.0) {
obj_mark_for_deletion(o);
} else {
obj_explode_and_spawn_coins(150.0f, 1);
@ -70,4 +72,4 @@ void bhv_donut_platform_update(void) {
load_object_collision_model();
}
}
}

View file

@ -1567,7 +1567,7 @@ void update_mario_health(struct MarioState *m) {
// Play a noise to alert the player when Mario is close to drowning.
if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300) && (!(save_file_get_flags() & SAVE_FLAG_DAREDEVIL_MODE)) && (!mario_has_improved_metal_cap(m))) {
play_sound(SOUND_MOVING_ALMOST_DROWNING, gGlobalSoundSource);
#ifdef ENABLE_RUMBLE
#if ENABLE_RUMBLE
if (!gRumblePakTimer) {
gRumblePakTimer = 36;
if (is_rumble_finished_and_queue_empty()) {

View file

@ -92,7 +92,7 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
if (!configDisableFallDamage) {
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24;
}
#ifdef ENABLE_RUMBLE
#if ENABLE_RUMBLE
queue_rumble_data(5, 80);
#endif
set_camera_shake_from_hit(SHAKE_FALL_DAMAGE);
@ -2328,4 +2328,4 @@ s32 mario_execute_airborne_action(struct MarioState *m) {
}
return cancel;
}
}

View file

@ -615,8 +615,13 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
}
// We will be extending the cap timer artificially for this star.
if (configStayInCourse && gCollectedStar == 5 && gCurrLevelNum == LEVEL_DDD) {
m->flags |= MARIO_VANISH_CAP | MARIO_METAL_CAP | MARIO_CAP_ON_HEAD;
m->capTimer = 300;
if (m->flags & MARIO_CAP_ON_HEAD) {
m->flags |= MARIO_VANISH_CAP;
}
if (m->capTimer < 300) {
m->capTimer = 300;
}
}
break;
@ -635,7 +640,18 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
} else {
// Ugly code ahead!
// This is the most readable I could make the code without overcomplicating it
// This is the most readable I could make the code without overcomplicating it
// First let's get if we have all the stars
s32 i;
u8 starCount = 0;
u8 flag = 1;
u8 starFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1);
for (i = 0; i < 7; i++, flag <<= 1) {
if (!(starFlags & flag)) {
starCount++;
}
}
// If we set it to ask
if (configStayInCourse > 0 &&
@ -650,6 +666,11 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_171 : DIALOG_170);
m->actionState = 1;
}
else if (configStayInCourse == 2 && starCount >= 7) {
enable_time_stop();
create_dialog_box_with_response(gLastCompletedStarNum == 7 ? DIALOG_171 : DIALOG_175);
m->actionState = 1;
}
// If it's automatic
else if (configStayInCourse == 3) {
if ((gLastCompletedStarNum == 7) ||

View file

@ -303,7 +303,7 @@ unsigned int configButtonCLeft = 0;
unsigned int configButtonCRight = 0;
unsigned int gControllerLeftDeadzone = 512;
unsigned int gControllerRightDeadzone = 512;
float configRumbleStrength = 0.5f;
float configRumbleStrength = 0.25f;
unsigned int configKeyA = DIK_L;
unsigned int configKeyB = DIK_COMMA;

View file

@ -45,7 +45,7 @@ static SDL_Haptic *controller_sdl_init_haptics(const int joy) {
if (!haptics_enabled) return NULL;
SDL_Haptic *hap = SDL_HapticOpen(joy);
if (!hap) return NULL;
if (hap == NULL) return NULL;
if (SDL_HapticRumbleSupported(hap) != SDL_TRUE) {
SDL_HapticClose(hap);

View file

@ -2150,5 +2150,12 @@ and run circles around\n\
the fountain exactly\n\
2401 times Luigi will\n\
come to visit you!\n\
Now could please leave me\n\
alone?"))
Now could you please\n\
leave me alone?"))
DEFINE_DIALOG(DIALOG_175, 1, 5, 30, 200, _("\
Wow! That's all 7 Power\n\
Stars! Do you want to\n\
keep playing this level?\n\
\n\
//You Bet//Not Now"))