• 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

Revision193 (tree)
Time2018-01-08 16:57:06
Authorxops-mikan

Log Message

ミッション終了・リスタートで追加小物の効果音を停止する仕様に変更、DirectSoundにてサウンド解放時に再生が停止しない問題の修正。

Change Summary

Incremental Difference

--- trunk/resource.cpp (revision 192)
+++ trunk/resource.cpp (revision 193)
@@ -608,10 +608,6 @@
608608 int dataid = TOTAL_PARAMETERINFO_SMALLOBJECT+1 -1;
609609 int cnt = 0;
610610
611- d3dg->CleanupModel(smallobject_model[dataid]);
612- d3dg->CleanupTexture(smallobject_texture[dataid]);
613- SoundCtrl->CleanupSound(smallobject_sound[dataid]);
614-
615611 smallobject_model[dataid] = d3dg->LoadModel(modelpath);
616612 smallobject_texture[dataid] = d3dg->LoadTexture(texturepath, false, false);
617613 if( smallobject_model[dataid] == -1 ){ cnt += 1; }
@@ -622,6 +618,19 @@
622618 return cnt;
623619 }
624620
621+//! @brief 追加小物のモデル・テクスチャ・サウンドを解放
622+void ResourceManager::CleanupAddSmallObject()
623+{
624+ if( d3dg == NULL ){ return; }
625+ if( SoundCtrl == NULL ){ return; }
626+
627+ int dataid = TOTAL_PARAMETERINFO_SMALLOBJECT+1 -1;
628+
629+ d3dg->CleanupModel(smallobject_model[dataid]);
630+ d3dg->CleanupTexture(smallobject_texture[dataid]);
631+ SoundCtrl->CleanupSound(smallobject_sound[dataid]);
632+}
633+
625634 //! @brief 弾のモデルとテクスチャを読み込む
626635 //! @return 成功:0 失敗:1以上
627636 int ResourceManager::LoadBulletModelTexture()
--- trunk/resource.h (revision 192)
+++ trunk/resource.h (revision 193)
@@ -114,6 +114,7 @@
114114 int GetSmallObjectSound(int id);
115115 void CleanupSmallObjectSound();
116116 int LoadAddSmallObject(char *modelpath, char *texturepath, char *soundpath);
117+ void CleanupAddSmallObject();
117118 int LoadBulletModelTexture();
118119 int GetBulletModelTexture(int id, int *model, int *texture);
119120 void CleanupBulletModelTexture();
--- trunk/sound-directsound.cpp (revision 192)
+++ trunk/sound-directsound.cpp (revision 193)
@@ -290,7 +290,6 @@
290290 //サウンドが停止中ならば
291291 if( (status & DSBSTATUS_PLAYING) == 0x00 ){
292292 LPDIRECTSOUND3DBUFFER pDS3DBuffer;
293- DWORD status = 0;
294293 if( FAILED(pDSBuffer[id][i]->QueryInterface(IID_IDirectSound3DBuffer8, (VOID**)&pDS3DBuffer)) ){
295294 //IDirectSound3DBuffer8を取得できない
296295 return 0;
@@ -366,8 +365,18 @@
366365 if( (id < 0)||(MAX_LOADSOUND -1 < id) ){ return; }
367366 if( pDSBuffer[id][0] == NULL ){ return; }
368367
369- //対象の全セカンダリバッファーを解放
368+ DWORD status = 0;
369+
370370 for(int i=0; i<MAX_SOUNDLISTS; i++){
371+ //再生状況を取得
372+ pDSBuffer[id][i]->GetStatus(&status);
373+
374+ //サウンドが再生中ならば停止する
375+ if( (status & DSBSTATUS_PLAYING) != 0x00 ){
376+ pDSBuffer[id][i]->Stop();
377+ }
378+
379+ //対象のセカンダリバッファーを解放
371380 if( pDSBuffer[id][i] != NULL ){ pDSBuffer[id][i]->Release(); }
372381 pDSBuffer[id][i] = NULL;
373382 }