• 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

Revision266 (tree)
Zeit2021-03-02 02:41:49
Autorxops-mikan

Log Message

デバック用コンソールのコマンド処理を改善、ファイルパスの処理を関数化、人モデルのモーフィング有無切り替えを定数化。

Ändern Zusammenfassung

Diff

--- trunk/datafile.cpp (revision 265)
+++ trunk/datafile.cpp (revision 266)
@@ -1311,3 +1311,17 @@
13111311 }
13121312 return 1;
13131313 }
1314+
1315+//! @brief ファイルパスからファイル名を取り除く
1316+//! @param path ファイルパス(ポインタ)
1317+//! @param dir ディレクトリ名を受け取るポインタ
1318+void GetFileDirectory(char *path, char *dir)
1319+{
1320+ strcpy(dir, path);
1321+
1322+ //終端から'\\'か'/'を探し、'\0'に置き換える
1323+ for(int i=strlen(dir)-1; i>0; i--){
1324+ if( dir[i] == '\\' ){ dir[i+1] = '\0'; break; }
1325+ if( dir[i] == '/' ){ dir[i+1] = '\0'; break; }
1326+ }
1327+}
\ No newline at end of file
--- trunk/datafile.h (revision 265)
+++ trunk/datafile.h (revision 266)
@@ -220,5 +220,6 @@
220220 };
221221
222222 int DeleteLinefeed(char str[]);
223+void GetFileDirectory(char *path, char *dir);
223224
224225 #endif
\ No newline at end of file
--- trunk/gamemain.cpp (revision 265)
+++ trunk/gamemain.cpp (revision 266)
@@ -1703,13 +1703,7 @@
17031703 collisionflag = MIFdata.GetCollisionFlag();
17041704 DarkScreenFlag = MIFdata.GetScreenFlag();
17051705
1706- strcpy(path, bdata);
1707- for(int i=strlen(path)-1; i>0; i--){
1708- if( path[i] == '\\' ){
1709- path[i+1] = '\0';
1710- break;
1711- }
1712- }
1706+ GetFileDirectory(bdata, path);
17131707 }
17141708
17151709 //追加小物を読み込む
@@ -1834,14 +1828,7 @@
18341828 }
18351829 else{
18361830 MIFdata.GetDatafilePath(bdata, pdata);
1837-
1838- strcpy(path, bdata);
1839- for(int i=strlen(path)-1; i>0; i--){
1840- if( path[i] == '\\' ){
1841- path[i+1] = '\0';
1842- break;
1843- }
1844- }
1831+ GetFileDirectory(bdata, path);
18451832 }
18461833
18471834 //追加小物を解放⇒読み込む
@@ -3398,12 +3385,9 @@
33983385 //! @return 取得:true 判定外:false
33993386 bool maingame::GetCommandNum(char *cmd, int *num)
34003387 {
3401- char str[MAX_CONSOLELEN];
3402-
34033388 //コマンド名を調べる
3404- strcpy(str, NewCommand);
3405- str[ strlen(cmd) ] = '\0';
3406- if( strcmp(str, cmd) != 0 ){ return false; }
3389+ if( memcmp(NewCommand, cmd, strlen(cmd)) != 0 ){ return false; }
3390+ if( NewCommand[strlen(cmd)] != ' ' ){ return false; }
34073391
34083392 //「コマンド名_X」分の文字数に達しているかどうか
34093393 if( strlen(cmd)+2 > strlen(NewCommand) ){ return false; }
@@ -4036,14 +4020,7 @@
40364020 }
40374021 else{
40384022 MIFdata.GetDatafilePath(bdata, pdata);
4039-
4040- strcpy(path, bdata);
4041- for(int i=strlen(path)-1; i>0; i--){
4042- if( path[i] == '\\' ){
4043- path[i+1] = '\0';
4044- break;
4045- }
4046- }
4023+ GetFileDirectory(bdata, path);
40474024 }
40484025
40494026 //ブロックデータ初期化
--- trunk/gamemain.h (revision 265)
+++ trunk/gamemain.h (revision 266)
@@ -237,7 +237,7 @@
237237 bool tag; //!< オブジェクトのタグを表示
238238 bool radar; //!< 簡易レーダー表示
239239 bool wireframe; //!< マップをワイヤーフレーム表示
240- bool nomodel; //!< モデル描画フラグ
240+ bool nomodel; //!< モデル描画フラグ
241241 bool CenterLine; //!< 3D空間に中心線を表示
242242 bool Camera_Blind; //!< 目隠し描画
243243 bool Camera_F1mode; //!< カメラF1モード
--- trunk/resource.cpp (revision 265)
+++ trunk/resource.cpp (revision 266)
@@ -160,32 +160,31 @@
160160 human_runmodel[8] = d3dg->LoadModel("data\\model\\run05.x");
161161 human_runmodel[10] = d3dg->LoadModel("data\\model\\run06.x");
162162
163- if( 1 ){
164- //モーフィング処理を実行する
165- human_walkmodel[1] = d3dg->MorphingModel(human_walkmodel[0], human_walkmodel[2]);
166- human_walkmodel[3] = d3dg->MorphingModel(human_walkmodel[2], human_walkmodel[4]);
167- human_walkmodel[5] = d3dg->MorphingModel(human_walkmodel[4], human_walkmodel[6]);
168- human_walkmodel[7] = d3dg->MorphingModel(human_walkmodel[6], human_walkmodel[0]);
169- human_runmodel[1] = d3dg->MorphingModel(human_runmodel[0], human_runmodel[2]);
170- human_runmodel[3] = d3dg->MorphingModel(human_runmodel[2], human_runmodel[4]);
171- human_runmodel[5] = d3dg->MorphingModel(human_runmodel[4], human_runmodel[6]);
172- human_runmodel[7] = d3dg->MorphingModel(human_runmodel[6], human_runmodel[8]);
173- human_runmodel[9] = d3dg->MorphingModel(human_runmodel[8], human_runmodel[10]);
174- human_runmodel[11] = d3dg->MorphingModel(human_runmodel[10], human_runmodel[0]);
175- }
176- else{
177- //モーフィング処理を実行しない
178- human_walkmodel[1] = human_walkmodel[0];
179- human_walkmodel[3] = human_walkmodel[2];
180- human_walkmodel[5] = human_walkmodel[4];
181- human_walkmodel[7] = human_walkmodel[6];
182- human_runmodel[1] = human_runmodel[0];
183- human_runmodel[3] = human_runmodel[2];
184- human_runmodel[5] = human_runmodel[4];
185- human_runmodel[7] = human_runmodel[6];
186- human_runmodel[9] = human_runmodel[8];
187- human_runmodel[11] = human_runmodel[10];
188- }
163+#ifdef ENABLE_HUMANMODEL_MORPHING
164+ //モーフィング処理を実行する
165+ human_walkmodel[1] = d3dg->MorphingModel(human_walkmodel[0], human_walkmodel[2]);
166+ human_walkmodel[3] = d3dg->MorphingModel(human_walkmodel[2], human_walkmodel[4]);
167+ human_walkmodel[5] = d3dg->MorphingModel(human_walkmodel[4], human_walkmodel[6]);
168+ human_walkmodel[7] = d3dg->MorphingModel(human_walkmodel[6], human_walkmodel[0]);
169+ human_runmodel[1] = d3dg->MorphingModel(human_runmodel[0], human_runmodel[2]);
170+ human_runmodel[3] = d3dg->MorphingModel(human_runmodel[2], human_runmodel[4]);
171+ human_runmodel[5] = d3dg->MorphingModel(human_runmodel[4], human_runmodel[6]);
172+ human_runmodel[7] = d3dg->MorphingModel(human_runmodel[6], human_runmodel[8]);
173+ human_runmodel[9] = d3dg->MorphingModel(human_runmodel[8], human_runmodel[10]);
174+ human_runmodel[11] = d3dg->MorphingModel(human_runmodel[10], human_runmodel[0]);
175+#else
176+ //モーフィング処理を実行しない
177+ human_walkmodel[1] = human_walkmodel[0];
178+ human_walkmodel[3] = human_walkmodel[2];
179+ human_walkmodel[5] = human_walkmodel[4];
180+ human_walkmodel[7] = human_walkmodel[6];
181+ human_runmodel[1] = human_runmodel[0];
182+ human_runmodel[3] = human_runmodel[2];
183+ human_runmodel[5] = human_runmodel[4];
184+ human_runmodel[7] = human_runmodel[6];
185+ human_runmodel[9] = human_runmodel[8];
186+ human_runmodel[11] = human_runmodel[10];
187+#endif
189188
190189 return 0;
191190 }
--- trunk/resource.h (revision 265)
+++ trunk/resource.h (revision 266)
@@ -39,6 +39,8 @@
3939
4040 #define MAX_LOADHUMANTEXTURE 10 //!< 人のテクスチャを読み込む最大枚数
4141
42+#define ENABLE_HUMANMODEL_MORPHING //!< 人モデルのモーフィング処理有効化(コメント化で機能無効)
43+
4244 #ifndef H_LAYERLEVEL
4345 #define H_LAYERLEVEL 2 //!< Select include file.
4446 #endif