• 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

Revision166 (tree)
Time2017-03-08 23:51:15
Authorxops-mikan

Log Message

サウンドリソースを明示的に解放する設計に変更。デバック用ログ出力機能におけるファイル名を変更。

Change Summary

Incremental Difference

--- trunk/debug.cpp (revision 165)
+++ trunk/debug.cpp (revision 166)
@@ -36,8 +36,12 @@
3636 //! @brief コンストラクタ
3737 DebugLog::DebugLog()
3838 {
39+ //ファイル名を生成
40+ char time[32];
41+ GetTimeName(time);
42+ sprintf(fname, GAMENAME"_log-%s.html", time);
43+
3944 OutputFlag = false;
40- strcpy(fname, GAMENAME"_log.html");
4145 error = false;
4246 }
4347
--- trunk/resource.cpp (revision 165)
+++ trunk/resource.cpp (revision 166)
@@ -122,11 +122,14 @@
122122 CleanupHumanModel();
123123 CleanupHumanTexture();
124124 CleanupWeaponModelTexture();
125+ CleanupWeaponSound();
125126 CleanupSmallObjectModelTexture();
127+ CleanupSmallObjectSound();
126128
127129 CleanupScopeTexture();
128130 CleanupSkyModelTexture();
129131 CleanupBulletModelTexture();
132+ CleanupBulletSound();
130133 CleanupEffectTexture();
131134 }
132135
@@ -468,6 +471,17 @@
468471 return weapon_sound[id];
469472 }
470473
474+//! @brief 武器のサウンドを一括解放
475+void ResourceManager::CleanupWeaponSound()
476+{
477+ for(int i=0; i<TOTAL_PARAMETERINFO_WEAPON; i++){
478+ SoundCtrl->CleanupSound(weapon_sound[i]);
479+ weapon_sound[i] = -1;
480+ }
481+ SoundCtrl->CleanupSound(weapon_reloadsound);
482+ weapon_reloadsound = -1;
483+}
484+
471485 //! @brief 小物のモデルやテクスチャを一括読み込み
472486 //! @return 成功:0 失敗:1以上
473487 int ResourceManager::LoadSmallObjectModelTexture()
@@ -560,6 +574,15 @@
560574 return smallobject_sound[id];
561575 }
562576
577+//! @brief 小物のサウンドを一括解放
578+void ResourceManager::CleanupSmallObjectSound()
579+{
580+ for(int i=0; i<TOTAL_PARAMETERINFO_SMALLOBJECT+1; i++){
581+ SoundCtrl->CleanupSound(smallobject_sound[i]);
582+ smallobject_sound[i] = -1;
583+ }
584+}
585+
563586 //! @brief 追加小物のモデル・テクスチャ・サウンドを取得
564587 //! @param modelpath モデルデータのパス
565588 //! @param texturepath テクスチャデータのパス
@@ -572,7 +595,7 @@
572595
573596 d3dg->CleanupModel(smallobject_model[dataid]);
574597 d3dg->CleanupTexture(smallobject_texture[dataid]);
575- //SoundCtrl->CleanupSound(smallobject_sound[dataid]);
598+ SoundCtrl->CleanupSound(smallobject_sound[dataid]);
576599
577600 smallobject_model[dataid] = d3dg->LoadModel(modelpath);
578601 smallobject_texture[dataid] = d3dg->LoadTexture(texturepath, false, false);
@@ -739,6 +762,24 @@
739762 if( grenadecco != NULL ){ *grenadecco = grenade_cco; }
740763 }
741764
765+//! @brief 弾・手榴弾のサウンドを一括解放
766+void ResourceManager::CleanupBulletSound()
767+{
768+ SoundCtrl->CleanupSound(bullet_hitsoundA);
769+ SoundCtrl->CleanupSound(bullet_hitsoundB);
770+ SoundCtrl->CleanupSound(bullet_humanhitsound);
771+ SoundCtrl->CleanupSound(bullet_passingsound);
772+ SoundCtrl->CleanupSound(grenade_bang);
773+ SoundCtrl->CleanupSound(grenade_cco);
774+
775+ bullet_hitsoundA = -1;
776+ bullet_hitsoundB = -1;
777+ bullet_humanhitsound = -1;
778+ bullet_passingsound = -1;
779+ grenade_bang = -1;
780+ grenade_cco = -1;
781+}
782+
742783 //! @brief エフェクトのテクスチャを読み込む
743784 //! @return 成功:0 失敗:1
744785 int ResourceManager::LoadEffectTexture()
--- trunk/resource.h (revision 165)
+++ trunk/resource.h (revision 166)
@@ -106,11 +106,13 @@
106106 void CleanupWeaponModelTexture();
107107 int LoadWeaponSound();
108108 int GetWeaponSound(int id);
109+ void CleanupWeaponSound();
109110 int LoadSmallObjectModelTexture();
110111 int GetSmallObjectModelTexture(int id, int *model, int *texture);
111112 void CleanupSmallObjectModelTexture();
112113 int LoadSmallObjectSound();
113114 int GetSmallObjectSound(int id);
115+ void CleanupSmallObjectSound();
114116 int LoadAddSmallObject(char *modelpath, char *texturepath, char *soundpath);
115117 int LoadBulletModelTexture();
116118 int GetBulletModelTexture(int id, int *model, int *texture);
@@ -124,6 +126,7 @@
124126 void CleanupSkyModelTexture();
125127 int LoadBulletSound();
126128 void GetBulletSound(int *hitsoundA, int *hitsoundB, int *humanhitsound, int *passingsound, int *grenadebang, int *grenadecco);
129+ void CleanupBulletSound();
127130 int LoadEffectTexture();
128131 int GetEffectBloodTexture();
129132 int GetEffectMflashTexture();