• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision220 (tree)
Time2019-05-06 17:55:08
Authorxops-mikan

Log Message

サウンドの再生ボリュームの対応範囲を変更。ezds版のマスターボリューム機能を無効化。

Change Summary

Incremental Difference

--- trunk/sound-directsound.cpp (revision 219)
+++ trunk/sound-directsound.cpp (revision 220)
@@ -474,16 +474,14 @@
474474 }
475475
476476 //! @brief SetVolume()用 1/100 dB (デシベル) を計算
477-//! @param volume 音量(-50〜100)
477+//! @param volume 音量(-100〜100)
478478 //! @return 1/100 dB (デシベル).
479-//! @attention 引数に 156 以上が渡された場合は無音になります。
480479 int SoundControl::GetDSVolume(int volume)
481480 {
482- if( volume >= 156 ){ return DSBVOLUME_MIN; }
483- if( volume <= -50 ){ return DSBVOLUME_MIN; }
484- if( volume >= 100 ){ return DSBVOLUME_MAX; }
481+ if( volume <= -100 ){ return DSBVOLUME_MIN; }
482+ if( volume >= 100 ){ return DSBVOLUME_MAX; }
485483
486- float volume2 = 1.0f/150 * (volume + 50);
484+ float volume2 = 1.0f/200 * (volume + 100);
487485 int retn = (int)((DSBVOLUME_MIN-DSBVOLUME_MAX) * (1.0f - volume2));
488486 return retn;
489487 }
--- trunk/sound-ezds.cpp (revision 219)
+++ trunk/sound-ezds.cpp (revision 220)
@@ -132,7 +132,7 @@
132132 //! @param volume 再生音量 (0.0=無音 1.0=100%)
133133 void SoundControl::SetVolume(float volume)
134134 {
135- mastervolume = volume;
135+ //mastervolume = volume;
136136 }
137137
138138 //! @brief カメラの座標と角度を設定
@@ -176,7 +176,7 @@
176176
177177 //小さい音量で一度再生しておく
178178 if( DSplay == NULL ){ return -1; }
179- DSplay(i, -99, 0);
179+ DSplay(i, -100, 0);
180180
181181 //使用中を表すフラグをセット
182182 useflag[i] = true;
@@ -204,9 +204,15 @@
204204 if( (id < 0)||(MAX_LOADSOUND -1 < id) ){ return 0; }
205205 if( useflag[id] == false ){ return 0; }
206206
207+ if( volume < -100 ){ volume = -100; }
208+ if( volume > 100 ){ volume = 100; }
209+ if( pan < -100 ){ pan = -100; }
210+ if( pan > 100 ){ pan = 100; }
211+
207212 //サウンドを再生
208213 if( DSplay == NULL ){ return 0; }
209- return DSplay(id, (int)(mastervolume * volume), pan);
214+ //return DSplay(id, (int)(mastervolume * volume), pan);
215+ return DSplay(id, volume, pan);
210216 }
211217
212218 //! @brief サウンドを再生(3D再生)
@@ -222,6 +228,9 @@
222228 if( (id < 0)||(MAX_LOADSOUND -1 < id) ){ return 0; }
223229 if( useflag[id] == false ){ return 0; }
224230
231+ if( volume < -100 ){ volume = -100; }
232+ if( volume > 100 ){ volume = 100; }
233+
225234 float dist;
226235 int playvolume;
227236 int pan = 0;
--- trunk/sound.h (revision 219)
+++ trunk/sound.h (revision 220)
@@ -101,7 +101,7 @@
101101 float camera_y; //!< カメラ座標
102102 float camera_z; //!< カメラ座標
103103 float camera_rx; //!< カメラX軸角度
104- float mastervolume; //!< 音量
104+ //float mastervolume; //!< 音量
105105
106106
107107 bool CheckSourceDist(float x, float y, float z, bool near, float *out_dist);