author | koda |
Fri, 20 Jul 2012 15:39:13 +0100 (2012-07-20) | |
changeset 7404 | 38a23771ee45 |
parent 7403 | e8d0b21efa82 |
child 7405 | 63f56edae4c6 |
--- a/hedgewars/uCommandHandlers.pas Fri Jul 20 12:25:53 2012 +0100 +++ b/hedgewars/uCommandHandlers.pas Fri Jul 20 15:39:13 2012 +0100 @@ -856,7 +856,7 @@ RegisterVariable('-volup' , @chVol_m , true ); RegisterVariable('+voldown', @chVol_m , true ); RegisterVariable('-voldown', @chVol_p , true ); - RegisterVariable('findhh' , @chFindhh , true ); + RegisterVariable('findhh' , @chFindhh , true ); RegisterVariable('pause' , @chPause , true ); RegisterVariable('+cur_u' , @chCurU_p , true ); RegisterVariable('-cur_u' , @chCurU_m , true );
--- a/hedgewars/uSound.pas Fri Jul 20 12:25:53 2012 +0100 +++ b/hedgewars/uSound.pas Fri Jul 20 15:39:13 2012 +0100 @@ -467,48 +467,48 @@ Mix_VolumeMusic(Volume * 4 div 8); ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME; - if (isMusicEnabled) then - if (Volume = 0) then - PauseMusic - else - ResumeMusic; + if (isMusicEnabled) then + if (Volume = 0) then + PauseMusic + else + ResumeMusic; - isAudioMuted:= (Volume = 0); + isAudioMuted:= (Volume = 0); end; procedure DampenAudio; begin - if (isAudioMuted) then - exit; + if (isAudioMuted) then + exit; previousVolume:= Volume; ChangeVolume(-Volume * 7 div 9); end; procedure UndampenAudio; begin - if (isAudioMuted) then - exit; + if (isAudioMuted) then + exit; ChangeVolume(previousVolume - Volume); end; procedure MuteAudio; begin if (not isSoundEnabled) then - exit; - - if (isAudioMuted) then - begin - ResumeMusic; - ChangeVolume(previousVolume); - end - else - begin - PauseMusic; - previousVolume:= Volume; - ChangeVolume(-Volume); - end; - - // isAudioMuted is updated in ChangeVolume + exit; + + if (isAudioMuted) then + begin + ResumeMusic; + ChangeVolume(previousVolume); + end + else + begin + PauseMusic; + previousVolume:= Volume; + ChangeVolume(-Volume); + end; + + // isAudioMuted is updated in ChangeVolume end; procedure SetMusic(enabled: boolean); @@ -575,8 +575,8 @@ procedure chMute(var s: shortstring); begin - s:= s; // avoid compiler hint - MuteAudio; + s:= s; // avoid compiler hint + MuteAudio; end; procedure initModule; @@ -584,12 +584,12 @@ i: TSound; begin RegisterVariable('voicepack', @chVoicepack, false); - RegisterVariable('mute' , @chMute , true ); + RegisterVariable('mute' , @chMute , true ); MusicFN:=''; isMusicEnabled:= true; isSoundEnabled:= true; - isAudioMuted:= false; + isAudioMuted:= false; isSEBackup:= isSoundEnabled; cInitVolume:= 100; Volume:= 0;
--- a/hedgewars/uTypes.pas Fri Jul 20 12:25:53 2012 +0100 +++ b/hedgewars/uTypes.pas Fri Jul 20 15:39:13 2012 +0100 @@ -406,26 +406,27 @@ sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane, sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack, - sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, sidSineGun, sidFlamethrower, - sidSMine, sidHammer, sidResurrector, sidDrillStrike, sidSnowball, sidNothing, sidTardis, - sidStructure, sidLandGun, sidIceGun); + sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, + sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector, + sidDrillStrike, sidSnowball, sidNothing, sidTardis, + sidStructure, sidLandGun, sidIceGun); TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused, sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync, sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce, - sidMute); + sidMute); // Events that are important for the course of the game or at least interesting for other reasons TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw, - eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf, - eidHomerun, eidGone); + eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, + eidHurtSelf, eidHomerun, eidGone); TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable, gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, - gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, gidRandomMineTimer, - gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, - gidPerHogAmmo, gidTagTeam); + gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, + gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, + gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam); TLandArray = packed array of array of LongWord; TCollisionArray = packed array of array of Word;
--- a/hedgewars/uWorld.pas Fri Jul 20 12:25:53 2012 +0100 +++ b/hedgewars/uWorld.pas Fri Jul 20 15:39:13 2012 +0100 @@ -1114,7 +1114,6 @@ highlight: Boolean; smallScreenOffset, offsetX, offsetY, screenBottom: LongInt; VertexBuffer: array [0..3] of TVertex2f; - volume: LongInt; begin if (cReducedQuality and rqNoBackground) = 0 then begin @@ -1534,10 +1533,8 @@ str(ChangeVolume(cVolumeDelta), s); AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume); end; - if isAudioMuted then - AddCaption(trmsg[sidMute], cWhiteColor, capgrpVolume) - else - FreeTexture(Captions[capgrpVolume].Tex) + if isAudioMuted then + AddCaption(trmsg[sidMute], cWhiteColor, capgrpVolume) end; if GameState = gsConfirm then