• 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

Revision204 (tree)
Time2018-06-02 23:13:51
Authorxops-mikan

Log Message

コンソールのコマンドを1個追加(resinfo)、およびそれに伴う各所修正。

Change Summary

Incremental Difference

--- trunk/d3dgraphics-directx.cpp (revision 203)
+++ trunk/d3dgraphics-directx.cpp (revision 204)
@@ -510,6 +510,20 @@
510510 return idN;
511511 }
512512
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+
513527 //! @brief モデルファイルを解放
514528 //! @param id モデル認識番号
515529 void D3DGraphics::CleanupModel(int id)
@@ -753,6 +767,20 @@
753767 return 0;
754768 }
755769
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+
756784 //! @brief テクスチャを解放
757785 //! @param id テクスチャ認識番号
758786 void D3DGraphics::CleanupTexture(int id)
--- trunk/d3dgraphics-opengl.cpp (revision 203)
+++ trunk/d3dgraphics-opengl.cpp (revision 204)
@@ -746,6 +746,20 @@
746746 #endif
747747 }
748748
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+
749763 //! @brief テクスチャフォーマットを拡張子で判定
750764 //! @param filename ファイル名
751765 //! @param nowformat 現在の判別値
@@ -1641,6 +1655,20 @@
16411655 #endif
16421656 }
16431657
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+
16441672 //! @brief 全ての描画処理を開始
16451673 //! @return 成功:0 失敗:1
16461674 //! @attention 描画処理の最初に呼び出す必要があります。
--- trunk/d3dgraphics.h (revision 203)
+++ trunk/d3dgraphics.h (revision 204)
@@ -271,9 +271,11 @@
271271 void DestroyD3D();
272272 int LoadModel(char* filename);
273273 int MorphingModel(int idA, int idB);
274+ int GetTotalModels();
274275 void CleanupModel(int id);
275276 int LoadTexture(char* filename, bool texturefont, bool BlackTransparent);
276277 int GetTextureSize(int id, int *width, int *height);
278+ int GetTotalTextures();
277279 void CleanupTexture(int id);
278280 int StartRender();
279281 bool EndRender();
--- trunk/gamemain.cpp (revision 203)
+++ trunk/gamemain.cpp (revision 204)
@@ -2872,7 +2872,7 @@
28722872 //コマンドリスト
28732873 if( strcmp(NewCommand, "help") == 0 ){
28742874 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");
28762876 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "info view center map aiinfo <NUM>");
28772877 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM> dark");
28782878 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ff revive kill <NUM> treat <NUM> nodamage <NUM>");
@@ -2970,7 +2970,7 @@
29702970 }
29712971
29722972 //マウス感度
2973- sprintf(str3, "MouseSensitivity : %d ", GameConfig.GetMouseSensitivity());
2973+ sprintf(str3, "MouseSensitivity : %2d ", GameConfig.GetMouseSensitivity());
29742974 strcpy(str, str3);
29752975
29762976 //画面表示モード
@@ -3004,7 +3004,7 @@
30043004 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
30053005
30063006 //画面の明るさ設定
3007- sprintf(str3, "Brightness : %d ", GameConfig.GetBrightness());
3007+ sprintf(str3, "Brightness : %2d ", GameConfig.GetBrightness());
30083008 strcpy(str, str3);
30093009
30103010 //マウス反転設定
@@ -3233,6 +3233,41 @@
32333233 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str);
32343234 }
32353235
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+
32363271 //デバック用文字の表示
32373272 if( strcmp(NewCommand, "info") == 0 ){
32383273 if( ShowInfo_Debugmode == false ){
--- trunk/objectmanager.cpp (revision 203)
+++ trunk/objectmanager.cpp (revision 204)
@@ -1764,6 +1764,58 @@
17641764 return NULL;
17651765 }
17661766
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+
17671819 //! @brief 前進(走り)を実行
17681820 //! @param human_id 人の番号(0〜MAX_HUMAN-1)
17691821 void ObjectManager::MoveForward(int human_id)
--- trunk/objectmanager.h (revision 203)
+++ trunk/objectmanager.h (revision 204)
@@ -151,6 +151,7 @@
151151 grenade* GetNewGrenadeObject();
152152 human* SearchHuman(signed char p4);
153153 smallobject* SearchSmallobject(signed char p4);
154+ void GetTotalObjects(int *HumanCnt, int *WeaponCnt, int *SmallobjectCnt, int *BulletCnt, int *GrenadeCnt, int *EffectCnt);
154155 void MoveForward(int human_id);
155156 void MoveBack(int human_id);
156157 void MoveLeft(int human_id);
--- trunk/sound-directsound.cpp (revision 203)
+++ trunk/sound-directsound.cpp (revision 204)
@@ -357,6 +357,20 @@
357357 return 0;
358358 }
359359
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+
360374 //! @brief サウンドを解放
361375 //! @param id 認識番号
362376 void SoundControl::CleanupSound(int id)
--- trunk/sound-ezds.cpp (revision 203)
+++ trunk/sound-ezds.cpp (revision 204)
@@ -246,6 +246,20 @@
246246 return PlaySound(id, playvolume, pan);
247247 }
248248
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+
249263 //! @brief サウンドを解放
250264 //! @param id 認識番号
251265 void SoundControl::CleanupSound(int id)
--- trunk/sound.h (revision 203)
+++ trunk/sound.h (revision 204)
@@ -86,6 +86,7 @@
8686 int PlaySound(int id, int volume, int pan);
8787 int Play3DSound(int id, float x, float y, float z, int volume);
8888 void CleanupSound(int id);
89+ int GetTotalSounds();
8990 #else //#ifdef SOUND_DIRECTSOUND
9091 HINSTANCE lib; //!< DLLファイルのインスタンス
9192 FARPROC DSver; //!< DSver()
@@ -116,6 +117,7 @@
116117 int LoadSound(char* filename);
117118 int PlaySound(int id, int volume, int pan);
118119 int Play3DSound(int id, float x, float y, float z, int volume);
120+ int GetTotalSounds();
119121 void CleanupSound(int id);
120122 #endif //#ifdef SOUND_DIRECTSOUND
121123 };
--- trunk/soundmanager.cpp (revision 203)
+++ trunk/soundmanager.cpp (revision 204)
@@ -268,6 +268,18 @@
268268 return true;
269269 }
270270
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+
271283 //! @brief 指定した位置の周辺にある音源を取得
272284 //! @param pos_x 音源のX座標
273285 //! @param pos_y 音源のY座標
--- trunk/soundmanager.h (revision 203)
+++ trunk/soundmanager.h (revision 204)
@@ -105,6 +105,7 @@
105105 bool GrenadeExplosion(float x, float y, float z, int teamID);
106106 bool SetFootsteps(float x, float y, float z, int teamID);
107107 bool ReloadWeapon(float x, float y, float z, int teamID);
108+ int GetTotalSoundList();
108109 int GetWorldSound(float pos_x, float pos_y, float pos_z, int teamID, soundlist *psoundlist);
109110 void PlayWorldSound(float camera_x, float camera_y, float camera_z, float camera_rx, int teamID);
110111 };