mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-20 10:37:37 -04:00
Merge pull request #335 from westonCoder/standing-object-grab-fix
Standing Object Grab FIx and Slider Fix
This commit is contained in:
commit
38114d3ff1
|
@ -269,7 +269,7 @@ float soundClipDuration(int soundClipId, float pitch) {
|
|||
return soundPlayerEstimateLength(alSound, pitch);
|
||||
}
|
||||
|
||||
void soundPlayerGameVolumeUpdate(enum SoundType type) {
|
||||
void soundPlayerGameVolumeUpdate() {
|
||||
int index = 0;
|
||||
while (index < gActiveSoundCount) {
|
||||
struct ActiveSound* sound = &gActiveSounds[index];
|
||||
|
@ -279,7 +279,7 @@ void soundPlayerGameVolumeUpdate(enum SoundType type) {
|
|||
}
|
||||
|
||||
float newVolume = sound->originalVolume * gSaveData.audio.soundVolume/0xFFFF;
|
||||
if (type == SoundTypeMusic){
|
||||
if (sound->soundType == SoundTypeMusic){
|
||||
newVolume = newVolume* gSaveData.audio.musicVolume/0xFFFF;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,10 @@ enum FizzleCheckResult decorObjectUpdateFizzler(struct CollisionObject* collisio
|
|||
}
|
||||
|
||||
int decorObjectUpdate(struct DecorObject* decorObject) {
|
||||
if (decorObject->collisionObject.flags & COLLISION_OBJECT_PLAYER_STANDING) {
|
||||
decorObject->collisionObject.flags &= ~COLLISION_OBJECT_PLAYER_STANDING;
|
||||
}
|
||||
|
||||
if (decorObject->playingSound != SOUND_ID_NONE) {
|
||||
soundPlayerUpdatePosition(
|
||||
decorObject->playingSound,
|
||||
|
|
|
@ -143,11 +143,11 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
|
|||
switch (audioOptions->selectedItem) {
|
||||
case AudioOptionGameVolume:
|
||||
audioOptionsHandleSlider(audioOptions->selectedItem, &gSaveData.audio.soundVolume, &audioOptions->gameVolume.value);
|
||||
soundPlayerGameVolumeUpdate(SoundTypeAll);
|
||||
soundPlayerGameVolumeUpdate();
|
||||
break;
|
||||
case AudioOptionMusicVolume:
|
||||
audioOptionsHandleSlider(audioOptions->selectedItem, &gSaveData.audio.musicVolume, &audioOptions->musicVolume.value);
|
||||
soundPlayerGameVolumeUpdate(SoundTypeMusic);
|
||||
soundPlayerGameVolumeUpdate();
|
||||
break;
|
||||
case AudioOptionSubtitlesEnabled:
|
||||
if (controllerGetButtonDown(0, A_BUTTON)) {
|
||||
|
|
|
@ -241,7 +241,10 @@ void playerApplyPortalGrab(struct Player* player, int portalIndex) {
|
|||
}
|
||||
|
||||
void playerSetGrabbing(struct Player* player, struct CollisionObject* grabbing) {
|
||||
if (grabbing && !player->grabConstraint.object) {
|
||||
if (grabbing && grabbing->flags & COLLISION_OBJECT_PLAYER_STANDING){
|
||||
player->grabConstraint.object = NULL;
|
||||
}
|
||||
else if (grabbing && !player->grabConstraint.object) {
|
||||
pointConstraintInit(&player->grabConstraint, grabbing, 8.0f, 5.0f, 1.0f);
|
||||
contactSolverAddPointConstraint(&gContactSolver, &player->grabConstraint);
|
||||
hudResolvePrompt(&gScene.hud, CutscenePromptTypePickup);
|
||||
|
|
Loading…
Reference in a new issue