• R/O
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javaandroidc++linuxc#windowsobjective-ccocoaqtpython誰得phprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


コミットメタ情報

リビジョン353 (tree)
日時2023-02-22 01:05:31
作者xops-mikan

ログメッセージ

コンソールの"info"コマンドによる表示項目を追加、一部関連関数の仕様を変更

変更サマリ

差分

--- trunk/gamemain.cpp (revision 352)
+++ trunk/gamemain.cpp (revision 353)
@@ -3004,7 +3004,11 @@
30043004 //デバック用・ゲーム情報の表示
30053005 if( ShowInfo_Debugmode == true ){
30063006 float move_x, move_y, move_z;
3007+ int keyflag;
3008+ int block_id;
30073009 myHuman->GetMovePos(&move_x, &move_y, &move_z);
3010+ keyflag = myHuman->GetMoveFlag(false);
3011+ myHuman->GetUnderBlock(&block_id, NULL);
30083012
30093013 //テクスチャフォントによる表示(半角英数字と記号のみ)
30103014 sprintf(str, "frame:%d time %02d:%02d", framecnt, framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60);
@@ -3013,10 +3017,10 @@
30133017 sprintf(str, "camera x:%.2f y:%.2f z:%.2f rx:%.2f ry:%.2f", camera_x, camera_y, camera_z, camera_rx, camera_ry);
30143018 d3dg->Draw2DTextureDebugFontText(10+1, 30+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
30153019 d3dg->Draw2DTextureDebugFontText(10, 30, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
3016- sprintf(str, "human[%d] x:%.2f y:%.2f z:%.2f rx:%.2f HP:%d", ObjMgr.GetPlayerID(), human_x, human_y, human_z, human_rx, hp);
3020+ sprintf(str, "human[%d] x:%.2f y:%.2f z:%.2f rx:%.2f HP:%d MoveKey:0x%02X", ObjMgr.GetPlayerID(), human_x, human_y, human_z, human_rx, hp, keyflag);
30173021 d3dg->Draw2DTextureDebugFontText(10+1, 50+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
30183022 d3dg->Draw2DTextureDebugFontText(10, 50, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
3019- sprintf(str, " move_x:%.2f move_y:%.2f move_z:%.2f", move_x, move_y, move_z);
3023+ sprintf(str, " move_x:%.2f move_y:%.2f move_z:%.2f BlockID:%d", move_x, move_y, move_z, block_id);
30203024 d3dg->Draw2DTextureDebugFontText(10+1, 70+1, str, d3dg->GetColorCode(0.1f,0.1f,0.1f,1.0f));
30213025 d3dg->Draw2DTextureDebugFontText(10, 70, str, d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f));
30223026 sprintf(str, "Input:%02dms Object:%02dms AI:%02dms Event:%02dms Sound:%02dms Render:%02dms", time_input, time_process_object, time_process_ai, time_process_event, time_sound, time_render);
--- trunk/object.cpp (revision 352)
+++ trunk/object.cpp (revision 353)
@@ -171,6 +171,8 @@
171171 move_y_flag = false;
172172 move_y_upper = 0;
173173 move_y_landing = false;
174+ underblock_id = -1;
175+ underblock_face = -1;
174176 rotation_x = rx;
175177 id_parameter = id_param;
176178 upmodel_size = 9.4f;
@@ -257,6 +259,8 @@
257259 move_y_flag = false;
258260 move_y_upper = 0;
259261 move_y_landing = false;
262+ underblock_id = -1;
263+ underblock_face = -1;
260264 rotation_y = 0.0f;
261265 armrotation_y = DegreeToRadian(-30);
262266
@@ -912,6 +916,19 @@
912916 return 0;
913917 }
914918
919+//! @brief 移動方向を表すフラグを取得
920+//! @return 設定値(Human_MoveFlag列挙型)
921+//! @attention デバック用関数です。通常はGetMovemode()関数を使用してください。
922+int human::GetMoveFlag(bool nowdata)
923+{
924+ if( nowdata == false ){ //前のデータ
925+ return MoveFlag_lt;
926+ }
927+ else{ //現在のデータ
928+ return MoveFlag;
929+ }
930+}
931+
915932 //! @brief スコープを設定
916933 //! @return 成功:true 失敗:false
917934 bool human::SetEnableScope()
@@ -1007,6 +1024,16 @@
10071024 return 0;
10081025 }
10091026
1027+//! @brief 足元のブロックID・面番号を取得
1028+//! @param id 足元のブロックIDを受け取るポインタ(NULL可)
1029+//! @param face 足元のブロックの面番号を受け取るポインタ(NULL可)
1030+//! @attention 空中の場合など足元にブロックがない場合、ブロックIDと面番号は -1 を返します。
1031+void human::GetUnderBlock(int *id, int *face)
1032+{
1033+ if( id != NULL ){ *id = underblock_id; }
1034+ if( face != NULL ){ *face = underblock_face; }
1035+}
1036+
10101037 //! @brief 押しだす・力を加える
10111038 //! @param rx 横軸
10121039 //! @param ry 縦軸
@@ -1501,10 +1528,7 @@
15011528 //! @param inblockdata BlockDataInterfaceクラスのポインタ
15021529 //! @param AddCollisionFlag 追加の当たり判定フラグ
15031530 //! @param player 対象の人物がプレイヤーかどうか
1504-//! @param underblock_id 足元のブロックIDを受け取るポインタ(NULL可)
1505-//! @param underblock_face 足元のブロックの面番号を受け取るポインタ(NULL可)
1506-//! @attention 空中の場合など足元にブロックがない場合、ブロックIDと面番号は -1 を返します。
1507-void human::CollisionMap(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, int *underblock_id, int *underblock_face)
1531+void human::CollisionMap(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player)
15081532 {
15091533 if( CollD == NULL ){ return; }
15101534 if( inblockdata == NULL ){ return; }
@@ -1517,9 +1541,9 @@
15171541 float Dist;
15181542 bool FallFlag;
15191543
1520- //ブロックIDと面番号は、ひとまず -1 を用意をする。
1521- if( underblock_id != NULL ){ *underblock_id = -1; }
1522- if( underblock_face != NULL ){ *underblock_face = -1; }
1544+ //ブロックIDと面番号は、ひとまず -1 にする。
1545+ underblock_id = -1;
1546+ underblock_face = -1;
15231547
15241548 //現時点の座標をバックアップ
15251549 pos_x2 = pos_x;
@@ -1810,9 +1834,9 @@
18101834 }
18111835
18121836 if( id != -1 ){
1813- //ブロックIDと面番号を返す
1814- if( underblock_id != NULL ){ *underblock_id = id; }
1815- if( underblock_face != NULL ){ *underblock_face = face; }
1837+ //ブロックIDと面番号を記憶
1838+ underblock_id = id;
1839+ underblock_face = face;
18161840
18171841 if( flag == true ){
18181842 inblockdata->Getdata(&bdata, id);
@@ -1992,11 +2016,8 @@
19922016 //! @param AddCollisionFlag 追加の当たり判定フラグ
19932017 //! @param player 対象の人物がプレイヤーかどうか
19942018 //! @param F5mode 上昇機能(F5裏技)のフラグ (有効:true 無効:false)
1995-//! @param underblock_id 足元のブロックIDを受け取るポインタ(NULL可)
1996-//! @param underblock_face 足元のブロックの面番号を受け取るポインタ(NULL可)
1997-//! @attention 空中の場合など足元にブロックがない場合、ブロックIDと面番号は -1 を返します。
19982019 //! @return 処理なし:0 通常処理:1 死亡して倒れ終わった直後:2 静止した死体:3 地形により死亡した直後:4
1999-int human::ProcessObject(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, bool F5mode, int *underblock_id, int *underblock_face)
2020+int human::ProcessObject(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, bool F5mode)
20002021 {
20012022 if( CollD == NULL ){ return 0; }
20022023 if( inblockdata == NULL ){ return 0; }
@@ -2008,10 +2029,6 @@
20082029 pos_y += 5.0f;
20092030 }
20102031
2011- //ブロックIDと面番号は、ひとまず -1 を用意をする。
2012- if( underblock_id != NULL ){ *underblock_id = -1; }
2013- if( underblock_face != NULL ){ *underblock_face = -1; }
2014-
20152032 if( deadstate == 5 ){ return 3; }
20162033
20172034 int WeaponReloadMotionCnt;
@@ -2068,7 +2085,7 @@
20682085 ControlProcess();
20692086
20702087 //マップとの当たり判定
2071- CollisionMap(CollD, inblockdata, AddCollisionFlag, player, underblock_id, underblock_face);
2088+ CollisionMap(CollD, inblockdata, AddCollisionFlag, player);
20722089
20732090 //今回のマップとの当たり判定でHPがゼロになったなら、地形による死亡
20742091 if( (hp_old > 0)&&(hp <= 0) ){
--- trunk/object.h (revision 352)
+++ trunk/object.h (revision 353)
@@ -144,6 +144,8 @@
144144 bool move_y_flag; //!< Y軸移動フラグ
145145 int move_y_upper; //!< Y軸上昇禁止カウンター
146146 bool move_y_landing; //!< 着地フラグ
147+ int underblock_id; //!< 足元のブロックID
148+ int underblock_face; //!< 足元のブロックの面番号
147149 float rotation_y; //!< 全体の回転角度
148150 float armrotation_y; //!< 腕の回転角度
149151 float upmodel_size; //!< 上半身描画サイズ
@@ -178,7 +180,7 @@
178180 void GunsightErrorRange();
179181 int CheckAndProcessDead(class Collision *CollD);
180182 void ControlProcess();
181- void CollisionMap(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, int *underblock_id, int *underblock_face);
183+ void CollisionMap(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player);
182184 bool CollisionBlockScratch(class Collision *CollD, class BlockDataInterface *inblockdata, int blockid, float *px, float *py, float *pz, float px_old, float py_old, float pz_old, float in_vx, float in_vy, float in_vz, int mode);
183185
184186 public:
@@ -215,6 +217,7 @@
215217 virtual void SetMoveRight();
216218 virtual void SetMoveWalk();
217219 virtual int GetMovemode(bool nowdata);
220+ virtual int GetMoveFlag(bool nowdata);
218221 virtual bool SetEnableScope();
219222 virtual void SetDisableScope();
220223 virtual int GetScopeMode();
@@ -223,6 +226,7 @@
223226 virtual float GetDeadRy();
224227 virtual void Jump();
225228 virtual int GetJumpLanding(bool nowdata);
229+ virtual void GetUnderBlock(int *id, int *face);
226230 virtual void AddPosOrder(float rx, float ry, float speed);
227231 virtual void HitBulletHead(int attacks);
228232 virtual void HitBulletUp(int attacks);
@@ -233,7 +237,7 @@
233237 virtual bool CheckHit(float *rx);
234238 virtual float GetTotalMove();
235239 virtual int GetMoveMotionCount();
236- virtual int ProcessObject(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, bool F5mode, int *underblock_id, int *underblock_face);
240+ virtual int ProcessObject(class Collision *CollD, class BlockDataInterface *inblockdata, bool AddCollisionFlag, bool player, bool F5mode);
237241 virtual int GetGunsightErrorRange();
238242 virtual void Render(class D3DGraphics *d3dg, class ResourceManager *Resource, bool DrawArmOnly, bool player, bool NoModel);
239243 };
--- trunk/objectmanager.cpp (revision 352)
+++ trunk/objectmanager.cpp (revision 353)
@@ -2685,7 +2685,7 @@
26852685 cmdF5 = false;
26862686 }
26872687
2688- rtn = HumanIndex[i].ProcessObject(CollD, BlockData, AddCollisionFlag, player, cmdF5, &block_id, &block_face);
2688+ rtn = HumanIndex[i].ProcessObject(CollD, BlockData, AddCollisionFlag, player, cmdF5);
26892689 if( rtn == 2 ){
26902690 //死亡時のエフェクト
26912691 DeadEffect(&(HumanIndex[i]));
@@ -2702,6 +2702,7 @@
27022702 HumanIndex[i].SetDarkModelFlag(screen);
27032703
27042704 //足元にあるブロックのテクスチャー番号を取得する
2705+ HumanIndex[i].GetUnderBlock(&block_id, &block_face);
27052706 if( block_id != -1 ){
27062707 blockdata bdata;
27072708 BlockData->Getdata(&bdata, block_id);