X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 166 (tree) |
|---|---|
| Time | 2017-03-08 23:51:15 |
| Author | |
サウンドリソースを明示的に解放する設計に変更。デバック用ログ出力機能におけるファイル名を変更。
| @@ -36,8 +36,12 @@ | ||
| 36 | 36 | //! @brief コンストラクタ |
| 37 | 37 | DebugLog::DebugLog() |
| 38 | 38 | { |
| 39 | + //ファイル名を生成 | |
| 40 | + char time[32]; | |
| 41 | + GetTimeName(time); | |
| 42 | + sprintf(fname, GAMENAME"_log-%s.html", time); | |
| 43 | + | |
| 39 | 44 | OutputFlag = false; |
| 40 | - strcpy(fname, GAMENAME"_log.html"); | |
| 41 | 45 | error = false; |
| 42 | 46 | } |
| 43 | 47 |
| @@ -122,11 +122,14 @@ | ||
| 122 | 122 | CleanupHumanModel(); |
| 123 | 123 | CleanupHumanTexture(); |
| 124 | 124 | CleanupWeaponModelTexture(); |
| 125 | + CleanupWeaponSound(); | |
| 125 | 126 | CleanupSmallObjectModelTexture(); |
| 127 | + CleanupSmallObjectSound(); | |
| 126 | 128 | |
| 127 | 129 | CleanupScopeTexture(); |
| 128 | 130 | CleanupSkyModelTexture(); |
| 129 | 131 | CleanupBulletModelTexture(); |
| 132 | + CleanupBulletSound(); | |
| 130 | 133 | CleanupEffectTexture(); |
| 131 | 134 | } |
| 132 | 135 |
| @@ -468,6 +471,17 @@ | ||
| 468 | 471 | return weapon_sound[id]; |
| 469 | 472 | } |
| 470 | 473 | |
| 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 | + | |
| 471 | 485 | //! @brief 小物のモデルやテクスチャを一括読み込み |
| 472 | 486 | //! @return 成功:0 失敗:1以上 |
| 473 | 487 | int ResourceManager::LoadSmallObjectModelTexture() |
| @@ -560,6 +574,15 @@ | ||
| 560 | 574 | return smallobject_sound[id]; |
| 561 | 575 | } |
| 562 | 576 | |
| 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 | + | |
| 563 | 586 | //! @brief 追加小物のモデル・テクスチャ・サウンドを取得 |
| 564 | 587 | //! @param modelpath モデルデータのパス |
| 565 | 588 | //! @param texturepath テクスチャデータのパス |
| @@ -572,7 +595,7 @@ | ||
| 572 | 595 | |
| 573 | 596 | d3dg->CleanupModel(smallobject_model[dataid]); |
| 574 | 597 | d3dg->CleanupTexture(smallobject_texture[dataid]); |
| 575 | - //SoundCtrl->CleanupSound(smallobject_sound[dataid]); | |
| 598 | + SoundCtrl->CleanupSound(smallobject_sound[dataid]); | |
| 576 | 599 | |
| 577 | 600 | smallobject_model[dataid] = d3dg->LoadModel(modelpath); |
| 578 | 601 | smallobject_texture[dataid] = d3dg->LoadTexture(texturepath, false, false); |
| @@ -739,6 +762,24 @@ | ||
| 739 | 762 | if( grenadecco != NULL ){ *grenadecco = grenade_cco; } |
| 740 | 763 | } |
| 741 | 764 | |
| 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 | + | |
| 742 | 783 | //! @brief エフェクトのテクスチャを読み込む |
| 743 | 784 | //! @return 成功:0 失敗:1 |
| 744 | 785 | int ResourceManager::LoadEffectTexture() |
| @@ -106,11 +106,13 @@ | ||
| 106 | 106 | void CleanupWeaponModelTexture(); |
| 107 | 107 | int LoadWeaponSound(); |
| 108 | 108 | int GetWeaponSound(int id); |
| 109 | + void CleanupWeaponSound(); | |
| 109 | 110 | int LoadSmallObjectModelTexture(); |
| 110 | 111 | int GetSmallObjectModelTexture(int id, int *model, int *texture); |
| 111 | 112 | void CleanupSmallObjectModelTexture(); |
| 112 | 113 | int LoadSmallObjectSound(); |
| 113 | 114 | int GetSmallObjectSound(int id); |
| 115 | + void CleanupSmallObjectSound(); | |
| 114 | 116 | int LoadAddSmallObject(char *modelpath, char *texturepath, char *soundpath); |
| 115 | 117 | int LoadBulletModelTexture(); |
| 116 | 118 | int GetBulletModelTexture(int id, int *model, int *texture); |
| @@ -124,6 +126,7 @@ | ||
| 124 | 126 | void CleanupSkyModelTexture(); |
| 125 | 127 | int LoadBulletSound(); |
| 126 | 128 | void GetBulletSound(int *hitsoundA, int *hitsoundB, int *humanhitsound, int *passingsound, int *grenadebang, int *grenadecco); |
| 129 | + void CleanupBulletSound(); | |
| 127 | 130 | int LoadEffectTexture(); |
| 128 | 131 | int GetEffectBloodTexture(); |
| 129 | 132 | int GetEffectMflashTexture(); |