X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 204 (tree) |
|---|---|
| Time | 2018-06-02 23:13:51 |
| Author | |
コンソールのコマンドを1個追加(resinfo)、およびそれに伴う各所修正。
| @@ -510,6 +510,20 @@ | ||
| 510 | 510 | return idN; |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | +//! @brief 読み込み済みのモデル数を取得 | |
| 514 | +//! @return モデル数 | |
| 515 | +int D3DGraphics::GetTotalModels() | |
| 516 | +{ | |
| 517 | + int cnt = 0; | |
| 518 | + | |
| 519 | + //使用中の要素を数える | |
| 520 | + for(int i=0; i<MAX_MODEL; i++){ | |
| 521 | + if( pmesh[i] != NULL ){ cnt += 1; } | |
| 522 | + } | |
| 523 | + | |
| 524 | + return cnt; | |
| 525 | +} | |
| 526 | + | |
| 513 | 527 | //! @brief モデルファイルを解放 |
| 514 | 528 | //! @param id モデル認識番号 |
| 515 | 529 | void D3DGraphics::CleanupModel(int id) |
| @@ -753,6 +767,20 @@ | ||
| 753 | 767 | return 0; |
| 754 | 768 | } |
| 755 | 769 | |
| 770 | +//! @brief 読み込み済みのテクスチャ数を取得 | |
| 771 | +//! @return テクスチャ数 | |
| 772 | +int D3DGraphics::GetTotalTextures() | |
| 773 | +{ | |
| 774 | + int cnt = 0; | |
| 775 | + | |
| 776 | + //使用中の要素を数える | |
| 777 | + for(int i=0; i<MAX_TEXTURE; i++){ | |
| 778 | + if( ptextures[i] != NULL ){ cnt += 1; } | |
| 779 | + } | |
| 780 | + | |
| 781 | + return cnt; | |
| 782 | +} | |
| 783 | + | |
| 756 | 784 | //! @brief テクスチャを解放 |
| 757 | 785 | //! @param id テクスチャ認識番号 |
| 758 | 786 | void D3DGraphics::CleanupTexture(int id) |
| @@ -746,6 +746,20 @@ | ||
| 746 | 746 | #endif |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | +//! @brief 読み込み済みのモデル数を取得 | |
| 750 | +//! @return モデル数 | |
| 751 | +int D3DGraphics::GetTotalModels() | |
| 752 | +{ | |
| 753 | + int cnt = 0; | |
| 754 | + | |
| 755 | + //使用中の要素を数える | |
| 756 | + for(int i=0; i<MAX_MODEL; i++){ | |
| 757 | + if( pmodel[i].useflag == true ){ cnt += 1; } | |
| 758 | + } | |
| 759 | + | |
| 760 | + return cnt; | |
| 761 | +} | |
| 762 | + | |
| 749 | 763 | //! @brief テクスチャフォーマットを拡張子で判定 |
| 750 | 764 | //! @param filename ファイル名 |
| 751 | 765 | //! @param nowformat 現在の判別値 |
| @@ -1641,6 +1655,20 @@ | ||
| 1641 | 1655 | #endif |
| 1642 | 1656 | } |
| 1643 | 1657 | |
| 1658 | +//! @brief 読み込み済みのテクスチャ数を取得 | |
| 1659 | +//! @return テクスチャ数 | |
| 1660 | +int D3DGraphics::GetTotalTextures() | |
| 1661 | +{ | |
| 1662 | + int cnt = 0; | |
| 1663 | + | |
| 1664 | + //使用中の要素を数える | |
| 1665 | + for(int i=0; i<MAX_TEXTURE; i++){ | |
| 1666 | + if( ptextures[i].useflag == true ){ cnt += 1; } | |
| 1667 | + } | |
| 1668 | + | |
| 1669 | + return cnt; | |
| 1670 | +} | |
| 1671 | + | |
| 1644 | 1672 | //! @brief 全ての描画処理を開始 |
| 1645 | 1673 | //! @return 成功:0 失敗:1 |
| 1646 | 1674 | //! @attention 描画処理の最初に呼び出す必要があります。 |
| @@ -271,9 +271,11 @@ | ||
| 271 | 271 | void DestroyD3D(); |
| 272 | 272 | int LoadModel(char* filename); |
| 273 | 273 | int MorphingModel(int idA, int idB); |
| 274 | + int GetTotalModels(); | |
| 274 | 275 | void CleanupModel(int id); |
| 275 | 276 | int LoadTexture(char* filename, bool texturefont, bool BlackTransparent); |
| 276 | 277 | int GetTextureSize(int id, int *width, int *height); |
| 278 | + int GetTotalTextures(); | |
| 277 | 279 | void CleanupTexture(int id); |
| 278 | 280 | int StartRender(); |
| 279 | 281 | bool EndRender(); |
| @@ -2872,7 +2872,7 @@ | ||
| 2872 | 2872 | //コマンドリスト |
| 2873 | 2873 | if( strcmp(NewCommand, "help") == 0 ){ |
| 2874 | 2874 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "help human result event ver"); |
| 2875 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "config mif bd1 pd1"); | |
| 2875 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "config mif bd1 pd1 resinfo"); | |
| 2876 | 2876 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "info view center map aiinfo <NUM>"); |
| 2877 | 2877 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM> dark"); |
| 2878 | 2878 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ff revive kill <NUM> treat <NUM> nodamage <NUM>"); |
| @@ -2970,7 +2970,7 @@ | ||
| 2970 | 2970 | } |
| 2971 | 2971 | |
| 2972 | 2972 | //マウス感度 |
| 2973 | - sprintf(str3, "MouseSensitivity : %d ", GameConfig.GetMouseSensitivity()); | |
| 2973 | + sprintf(str3, "MouseSensitivity : %2d ", GameConfig.GetMouseSensitivity()); | |
| 2974 | 2974 | strcpy(str, str3); |
| 2975 | 2975 | |
| 2976 | 2976 | //画面表示モード |
| @@ -3004,7 +3004,7 @@ | ||
| 3004 | 3004 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); |
| 3005 | 3005 | |
| 3006 | 3006 | //画面の明るさ設定 |
| 3007 | - sprintf(str3, "Brightness : %d ", GameConfig.GetBrightness()); | |
| 3007 | + sprintf(str3, "Brightness : %2d ", GameConfig.GetBrightness()); | |
| 3008 | 3008 | strcpy(str, str3); |
| 3009 | 3009 | |
| 3010 | 3010 | //マウス反転設定 |
| @@ -3233,6 +3233,41 @@ | ||
| 3233 | 3233 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); |
| 3234 | 3234 | } |
| 3235 | 3235 | |
| 3236 | + //リソース情報表示 | |
| 3237 | + if( strcmp(NewCommand, "resinfo") == 0 ){ | |
| 3238 | + int human = 0; | |
| 3239 | + int weapon = 0; | |
| 3240 | + int smallobject = 0; | |
| 3241 | + int bullet = 0; | |
| 3242 | + int grenade = 0; | |
| 3243 | + int effect = 0; | |
| 3244 | + | |
| 3245 | + //グラフィック | |
| 3246 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "[Graphics]"); | |
| 3247 | + sprintf(str, " model : %2d/%2d texture : %2d/%2d", d3dg->GetTotalModels(), MAX_MODEL, d3dg->GetTotalTextures(), MAX_TEXTURE); | |
| 3248 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3249 | + | |
| 3250 | + //サウンド | |
| 3251 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "[Sound]"); | |
| 3252 | + sprintf(str, " sound : %2d/%2d", SoundCtrl.GetTotalSounds(), MAX_LOADSOUND); | |
| 3253 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3254 | + | |
| 3255 | + //データファイル | |
| 3256 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "[Datafile]"); | |
| 3257 | + sprintf(str, " blocks : %3d/%3d points : %3d/%3d", BlockData.GetTotaldatas(), MAX_BLOCKS, PointData.GetTotaldatas(), MAX_POINTS); | |
| 3258 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3259 | + | |
| 3260 | + //オブジェクト数 | |
| 3261 | + ObjMgr.GetTotalObjects(&human, &weapon, &smallobject, &bullet, &grenade, &effect); | |
| 3262 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "[Object]"); | |
| 3263 | + sprintf(str, " human : %3d/%3d weapon : %3d/%3d smallobject : %2d/%2d", human, MAX_HUMAN, weapon, MAX_WEAPON, smallobject, MAX_SMALLOBJECT); | |
| 3264 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3265 | + sprintf(str, " bullet : %3d/%3d grenade : %3d/%3d effect : %3d/%3d", bullet, MAX_BULLET, grenade, MAX_GRENADE, effect, MAX_EFFECT); | |
| 3266 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3267 | + sprintf(str, " sound : %3d/%3d", GameSound->GetTotalSoundList(), MAX_SOUNDMGR_LIST); | |
| 3268 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3269 | + } | |
| 3270 | + | |
| 3236 | 3271 | //デバック用文字の表示 |
| 3237 | 3272 | if( strcmp(NewCommand, "info") == 0 ){ |
| 3238 | 3273 | if( ShowInfo_Debugmode == false ){ |
| @@ -1764,6 +1764,58 @@ | ||
| 1764 | 1764 | return NULL; |
| 1765 | 1765 | } |
| 1766 | 1766 | |
| 1767 | +//! @brief 有効なオブジェクト数を取得 | |
| 1768 | +//! @param HumanCnt 人オブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1769 | +//! @param WeaponCnt 武器オブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1770 | +//! @param SmallobjectCnt 小物オブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1771 | +//! @param BulletCnt 弾オブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1772 | +//! @param GrenadeCnt 手榴弾オブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1773 | +//! @param EffectCnt エフェクトオブジェクトの有効数を受け取るポインタ (NULL可) | |
| 1774 | +void ObjectManager::GetTotalObjects(int *HumanCnt, int *WeaponCnt, int *SmallobjectCnt, int *BulletCnt, int *GrenadeCnt, int *EffectCnt) | |
| 1775 | +{ | |
| 1776 | + if( HumanCnt != NULL ){ | |
| 1777 | + *HumanCnt = 0; | |
| 1778 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 1779 | + if( HumanIndex[i].GetEnableFlag() == true ){ *HumanCnt += 1; } | |
| 1780 | + } | |
| 1781 | + } | |
| 1782 | + | |
| 1783 | + if( WeaponCnt != NULL ){ | |
| 1784 | + *WeaponCnt = 0; | |
| 1785 | + for(int i=0; i<MAX_WEAPON; i++){ | |
| 1786 | + if( WeaponIndex[i].GetEnableFlag() == true ){ *WeaponCnt += 1; } | |
| 1787 | + } | |
| 1788 | + } | |
| 1789 | + | |
| 1790 | + if( SmallobjectCnt != NULL ){ | |
| 1791 | + *SmallobjectCnt = 0; | |
| 1792 | + for(int i=0; i<MAX_SMALLOBJECT; i++){ | |
| 1793 | + if( SmallObjectIndex[i].GetEnableFlag() == true ){ *SmallobjectCnt += 1; } | |
| 1794 | + } | |
| 1795 | + } | |
| 1796 | + | |
| 1797 | + if( BulletCnt != NULL ){ | |
| 1798 | + *BulletCnt = 0; | |
| 1799 | + for(int i=0; i<MAX_BULLET; i++){ | |
| 1800 | + if( BulletIndex[i].GetEnableFlag() == true ){ *BulletCnt += 1; } | |
| 1801 | + } | |
| 1802 | + } | |
| 1803 | + | |
| 1804 | + if( GrenadeCnt != NULL ){ | |
| 1805 | + *GrenadeCnt = 0; | |
| 1806 | + for(int i=0; i<MAX_GRENADE; i++){ | |
| 1807 | + if( GrenadeIndex[i].GetEnableFlag() == true ){ *GrenadeCnt += 1; } | |
| 1808 | + } | |
| 1809 | + } | |
| 1810 | + | |
| 1811 | + if( EffectCnt != NULL ){ | |
| 1812 | + *EffectCnt = 0; | |
| 1813 | + for(int i=0; i<MAX_EFFECT; i++){ | |
| 1814 | + if( EffectIndex[i].GetEnableFlag() == true ){ *EffectCnt += 1; } | |
| 1815 | + } | |
| 1816 | + } | |
| 1817 | +} | |
| 1818 | + | |
| 1767 | 1819 | //! @brief 前進(走り)を実行 |
| 1768 | 1820 | //! @param human_id 人の番号(0〜MAX_HUMAN-1) |
| 1769 | 1821 | void ObjectManager::MoveForward(int human_id) |
| @@ -151,6 +151,7 @@ | ||
| 151 | 151 | grenade* GetNewGrenadeObject(); |
| 152 | 152 | human* SearchHuman(signed char p4); |
| 153 | 153 | smallobject* SearchSmallobject(signed char p4); |
| 154 | + void GetTotalObjects(int *HumanCnt, int *WeaponCnt, int *SmallobjectCnt, int *BulletCnt, int *GrenadeCnt, int *EffectCnt); | |
| 154 | 155 | void MoveForward(int human_id); |
| 155 | 156 | void MoveBack(int human_id); |
| 156 | 157 | void MoveLeft(int human_id); |
| @@ -357,6 +357,20 @@ | ||
| 357 | 357 | return 0; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | +//! @brief 読み込み済みのサウンド数を取得 | |
| 361 | +//! @return サウンド数 | |
| 362 | +int SoundControl::GetTotalSounds() | |
| 363 | +{ | |
| 364 | + int cnt = 0; | |
| 365 | + | |
| 366 | + //使用中の要素を数える | |
| 367 | + for(int i=0; i<MAX_LOADSOUND; i++){ | |
| 368 | + if( pDSBuffer[i][0] != NULL ){ cnt += 1; } | |
| 369 | + } | |
| 370 | + | |
| 371 | + return cnt; | |
| 372 | +} | |
| 373 | + | |
| 360 | 374 | //! @brief サウンドを解放 |
| 361 | 375 | //! @param id 認識番号 |
| 362 | 376 | void SoundControl::CleanupSound(int id) |
| @@ -246,6 +246,20 @@ | ||
| 246 | 246 | return PlaySound(id, playvolume, pan); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | +//! @brief 読み込み済みのサウンド数を取得 | |
| 250 | +//! @return サウンド数 | |
| 251 | +int SoundControl::GetTotalSounds() | |
| 252 | +{ | |
| 253 | + int cnt = 0; | |
| 254 | + | |
| 255 | + //使用中の要素を数える | |
| 256 | + for(int i=0; i<MAX_LOADSOUND; i++){ | |
| 257 | + if( useflag[i] == true ){ cnt += 1; } | |
| 258 | + } | |
| 259 | + | |
| 260 | + return cnt; | |
| 261 | +} | |
| 262 | + | |
| 249 | 263 | //! @brief サウンドを解放 |
| 250 | 264 | //! @param id 認識番号 |
| 251 | 265 | void SoundControl::CleanupSound(int id) |
| @@ -86,6 +86,7 @@ | ||
| 86 | 86 | int PlaySound(int id, int volume, int pan); |
| 87 | 87 | int Play3DSound(int id, float x, float y, float z, int volume); |
| 88 | 88 | void CleanupSound(int id); |
| 89 | + int GetTotalSounds(); | |
| 89 | 90 | #else //#ifdef SOUND_DIRECTSOUND |
| 90 | 91 | HINSTANCE lib; //!< DLLファイルのインスタンス |
| 91 | 92 | FARPROC DSver; //!< DSver() |
| @@ -116,6 +117,7 @@ | ||
| 116 | 117 | int LoadSound(char* filename); |
| 117 | 118 | int PlaySound(int id, int volume, int pan); |
| 118 | 119 | int Play3DSound(int id, float x, float y, float z, int volume); |
| 120 | + int GetTotalSounds(); | |
| 119 | 121 | void CleanupSound(int id); |
| 120 | 122 | #endif //#ifdef SOUND_DIRECTSOUND |
| 121 | 123 | }; |
| @@ -268,6 +268,18 @@ | ||
| 268 | 268 | return true; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | +//! @brief 空間(サウンドリスト)上で有効な音源数を取得 | |
| 272 | +//! @return 有効な音源数 | |
| 273 | +int SoundManager::GetTotalSoundList() | |
| 274 | +{ | |
| 275 | + if( changeAB == false ){ | |
| 276 | + return listBdatas; | |
| 277 | + } | |
| 278 | + //else{ | |
| 279 | + return listAdatas; | |
| 280 | + //} | |
| 281 | +} | |
| 282 | + | |
| 271 | 283 | //! @brief 指定した位置の周辺にある音源を取得 |
| 272 | 284 | //! @param pos_x 音源のX座標 |
| 273 | 285 | //! @param pos_y 音源のY座標 |
| @@ -105,6 +105,7 @@ | ||
| 105 | 105 | bool GrenadeExplosion(float x, float y, float z, int teamID); |
| 106 | 106 | bool SetFootsteps(float x, float y, float z, int teamID); |
| 107 | 107 | bool ReloadWeapon(float x, float y, float z, int teamID); |
| 108 | + int GetTotalSoundList(); | |
| 108 | 109 | int GetWorldSound(float pos_x, float pos_y, float pos_z, int teamID, soundlist *psoundlist); |
| 109 | 110 | void PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx, int teamID); |
| 110 | 111 | }; |