• 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

Revision113 (tree)
Time2015-09-27 02:48:27
Authorxops-mikan

Log Message

味方が発砲した弾の横切る音(hyu.wav)が再生される問題の修正

Change Summary

Incremental Difference

--- trunk/scene.cpp (revision 112)
+++ trunk/scene.cpp (revision 113)
@@ -229,15 +229,13 @@
229229
230230 //! @brief 3Dシーン主計算処理
231231 void D3Dscene::Process()
232-{
233- GameSound->PlayWorldSound(camera_x, camera_y, camera_z, camera_rx);
234-}
232+{}
235233
236234 //! @brief 3Dシーンサウンド再生処理
237235 void D3Dscene::Sound()
238236 {
239237 //サウンドを再生
240- GameSound->PlayWorldSound(camera_x, camera_y, camera_z, camera_rx);
238+ GameSound->PlayWorldSound(camera_x, camera_y, camera_z, camera_rx, 1);
241239 }
242240
243241 //! @brief 3Dシーン描画処理(3D)
--- trunk/gamemain.cpp (revision 112)
+++ trunk/gamemain.cpp (revision 113)
@@ -1894,8 +1894,13 @@
18941894 {
18951895 time = GetTimeMS();
18961896
1897+ //プレイヤーのチーム番号取得
1898+ int teamid;
1899+ human *myHuman = ObjMgr.GetPlayerHumanObject();
1900+ myHuman->GetParamData(NULL, NULL, NULL, &teamid);
1901+
18971902 //サウンドを再生
1898- GameSound->PlayWorldSound(camera_x, camera_y, camera_z, camera_rx);
1903+ GameSound->PlayWorldSound(camera_x, camera_y, camera_z, camera_rx, teamid);
18991904
19001905 time_sound = GetTimeMS() - time;
19011906 }
--- trunk/soundmanager.h (revision 112)
+++ trunk/soundmanager.h (revision 113)
@@ -89,7 +89,7 @@
8989 bool GetNewList(soundlist **plist);
9090 int GetTargetList(soundlist **plist);
9191 bool CheckApproach(soundlist *plist, float camera_x, float camera_y, float camera_z, float *min_x, float *min_y, float *min_z);
92- void PlaySound(soundlist *plist, float camera_x, float camera_y, float camera_z);
92+ void PlaySound(soundlist *plist, float camera_x, float camera_y, float camera_z, int teamID);
9393
9494 public:
9595 SoundManager(SoundControl *in_SoundCtrl = NULL, ResourceManager *in_Resource = NULL, ParameterInfo *in_Param = NULL);
@@ -100,13 +100,13 @@
100100 bool HitMap(float x, float y, float z);
101101 bool HitHuman(float x, float y, float z);
102102 bool HitSmallObject(float x, float y, float z, int id);
103- bool PassingBullet(float x, float y, float z, float move_x, float move_y, float move_z);
103+ bool PassingBullet(float x, float y, float z, float move_x, float move_y, float move_z, int teamID);
104104 bool GrenadeBound(float x, float y, float z);
105105 bool GrenadeExplosion(float x, float y, float z);
106106 bool SetFootsteps(float x, float y, float z, int teamID);
107107 bool ReloadWeapon(float x, float y, float z, int teamID);
108108 int GetWorldSound(float pos_x, float pos_y, float pos_z, int teamID, soundlist *psoundlist);
109- void PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx);
109+ void PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx, int teamID);
110110 };
111111
112112 #endif
\ No newline at end of file
--- trunk/objectmanager.cpp (revision 112)
+++ trunk/objectmanager.cpp (revision 113)
@@ -2271,7 +2271,7 @@
22712271 //弾オブジェクトの処理
22722272 for(int i=0; i<MAX_BULLET; i++){
22732273 float bx, by, bz, brx, bry;
2274- int speed;
2274+ int speed, teamid;
22752275 float mx, my, mz;
22762276
22772277 CollideBullet(&BulletIndex[i]); //当たり判定を実行
@@ -2279,12 +2279,12 @@
22792279
22802280 if( BulletIndex[i].GetEnableFlag() == true ){
22812281 //弾の座標と角度を取得
2282- BulletIndex[i].GetParamData(NULL, NULL, &speed, NULL, NULL);
2282+ BulletIndex[i].GetParamData(NULL, NULL, &speed, &teamid, NULL);
22832283 BulletIndex[i].GetPosData(&bx, &by, &bz, &brx, &bry);
22842284 mx = cos(brx)*cos(bry)*speed;
22852285 my = sin(bry)*speed;
22862286 mz = sin(brx)*cos(bry)*speed;
2287- GameSound->PassingBullet(bx, by, bz, mx, my, mz);
2287+ GameSound->PassingBullet(bx, by, bz, mx, my, mz, teamid);
22882288 }
22892289 }
22902290 }
--- trunk/soundmanager.cpp (revision 112)
+++ trunk/soundmanager.cpp (revision 113)
@@ -162,9 +162,10 @@
162162 //! @param move_x 音源のX軸移動量
163163 //! @param move_y 音源のY軸移動量
164164 //! @param move_z 音源のZ軸移動量
165+//! @param teamID チーム番号
165166 //! @return 成功:true 失敗:false
166167 //! @attention move_x・move_y・move_zの移動量は、1フレーム分を指定してください。実際に座標が移動するわけではありません。
167-bool SoundManager::PassingBullet(float x, float y, float z, float move_x, float move_y, float move_z)
168+bool SoundManager::PassingBullet(float x, float y, float z, float move_x, float move_y, float move_z, int teamID)
168169 {
169170 soundlist *plist = NULL;
170171 if( GetNewList(&plist) == false ){ return false; }
@@ -176,6 +177,7 @@
176177 plist->move_x = move_x;
177178 plist->move_y = move_y;
178179 plist->move_z = move_z;
180+ plist->teamid = teamID;
179181
180182 return true;
181183 }
@@ -342,8 +344,9 @@
342344 //! @param camera_y カメラのY座標
343345 //! @param camera_z カメラのZ座標
344346 //! @param camera_rx カメラのX軸角度 (予約)
347+//! @param teamID チーム番号
345348 //! @warning 毎フレーム呼び出してください。
346-void SoundManager::PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx)
349+void SoundManager::PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx, int teamID)
347350 {
348351 int lists;
349352 soundlist *getlist = NULL;
@@ -371,7 +374,7 @@
371374
372375 //範囲内の音源ならば再生を試みる
373376 if( x*x + y*y + z*z < MAX_SOUNDDIST*MAX_SOUNDDIST ){
374- PlaySound( &(getlist[i]), camera_x, camera_y, camera_z );
377+ PlaySound( &(getlist[i]), camera_x, camera_y, camera_z, teamID );
375378 }
376379 }
377380 }
@@ -474,7 +477,8 @@
474477 //! @param camera_x カメラのX座標
475478 //! @param camera_y カメラのY座標
476479 //! @param camera_z カメラのZ座標
477-void SoundManager::PlaySound(soundlist *plist, float camera_x, float camera_y, float camera_z)
480+//! @param teamID チーム番号
481+void SoundManager::PlaySound(soundlist *plist, float camera_x, float camera_y, float camera_z, int teamID)
478482 {
479483 WeaponParameter WParam;
480484 int hitsoundA, hitsoundB;
@@ -531,6 +535,9 @@
531535
532536 if( CheckApproach(plist, camera_x, camera_y, camera_z, &new_x, &new_y, &new_z) == false ){ return; }
533537
538+ //味方の弾なら何もせず終了
539+ if( plist->teamid == teamID ){ return; }
540+
534541 //そのまま再生して終了
535542 Resource->GetBulletSound(NULL, NULL, NULL, &passingsound, NULL, NULL);
536543 SoundCtrl->Play3DSound(passingsound, new_x, new_y, new_z, MAX_SOUNDPASSING);