X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 138 (tree) |
|---|---|
| Time | 2016-08-02 23:37:55 |
| Author | |
範囲外の武器を用いた謎人間(テクスチャ偽装人間)の表示に対応
| @@ -133,6 +133,7 @@ | ||
| 133 | 133 | HumanParameter *Human; //!< 人の情報を格納するポインタ |
| 134 | 134 | char *HumanTexturePath[TOTAL_HUMANTEXTURE]; //!< 人のテクスチャを格納するポインタ |
| 135 | 135 | WeaponParameter *Weapon; //!< 武器の情報を格納するポインタ |
| 136 | + WeaponParameter *BugWeapon; //!< バグ武器の情報を格納するポインタ | |
| 136 | 137 | SmallObjectParameter *SmallObject; //!< 小物の情報を格納するポインタ |
| 137 | 138 | BulletParameter *Bullet; //!< 銃弾オブジェクトの情報を格納するポインタ |
| 138 | 139 | char *missionname[TOTAL_OFFICIALMISSION]; //!< 標準ミッションのミッション識別名 |
| @@ -149,6 +150,7 @@ | ||
| 149 | 150 | int GetHuman(int id, HumanParameter *out_data); |
| 150 | 151 | int GetHumanTexturePath(int id, char *out_str); |
| 151 | 152 | int GetWeapon(int id, WeaponParameter *out_data); |
| 153 | + int GetBugWeapon(int id, WeaponParameter *out_data); | |
| 152 | 154 | int GetSmallObject(int id, SmallObjectParameter *out_data); |
| 153 | 155 | int GetBullet(int id, BulletParameter *out_data); |
| 154 | 156 | int GetOfficialMission(int id, char *name, char *fullname, char* directory, char *txt); |
| @@ -330,7 +330,9 @@ | ||
| 330 | 330 | //! @return 成功:0 失敗:1 |
| 331 | 331 | int ResourceManager::GetWeaponModelTexture(int id, int *model, int *texture) |
| 332 | 332 | { |
| 333 | - if( (id < 0)||((TOTAL_PARAMETERINFO_WEAPON -1) < id ) ){ return 1; } | |
| 333 | + if( (id < 0)||((TOTAL_PARAMETERINFO_WEAPON -1) < id ) ){ | |
| 334 | + return GetBugWeaponModelTexture(id, model, texture); | |
| 335 | + } | |
| 334 | 336 | |
| 335 | 337 | *model = weapon_model[id]; |
| 336 | 338 | *texture = weapon_texture[id]; |
| @@ -337,6 +339,36 @@ | ||
| 337 | 339 | return 0; |
| 338 | 340 | } |
| 339 | 341 | |
| 342 | +//! @brief バグ武器のモデルとテクスチャを取得 | |
| 343 | +//! @return 成功:0 失敗:1 | |
| 344 | +//! @warning 先に GetWeaponModelTexture()関数 を実行して取得に失敗した時に限り、この関数を使ってください。 | |
| 345 | +//! @attention バグ武器を追加する場合は、ParameterInfoクラスの GetBugWeapon() 関数も編集してください。 | |
| 346 | +int ResourceManager::GetBugWeaponModelTexture(int id, int *model, int *texture) | |
| 347 | +{ | |
| 348 | + if( id == 23 ){ | |
| 349 | + *model = human_upmodel[0]; | |
| 350 | + *texture = d3dg->GetMapTextureID(0); | |
| 351 | + return 0; | |
| 352 | + } | |
| 353 | + if( id == 24 ){ | |
| 354 | + *model = human_upmodel[0]; | |
| 355 | + *texture = d3dg->GetMapTextureID(3); | |
| 356 | + return 0; | |
| 357 | + } | |
| 358 | + if( id == 30 ){ | |
| 359 | + *model = human_upmodel[0]; | |
| 360 | + *texture = d3dg->GetMapTextureID(2); | |
| 361 | + return 0; | |
| 362 | + } | |
| 363 | + if( id == 53 ){ | |
| 364 | + *model = human_upmodel[0]; | |
| 365 | + *texture = d3dg->GetMapTextureID(8); | |
| 366 | + return 0; | |
| 367 | + } | |
| 368 | + | |
| 369 | + return 1; | |
| 370 | +} | |
| 371 | + | |
| 340 | 372 | //! @brief 武器のモデルやテクスチャを一括解放 |
| 341 | 373 | void ResourceManager::CleanupWeaponModelTexture() |
| 342 | 374 | { |
| @@ -87,7 +87,7 @@ | ||
| 87 | 87 | |
| 88 | 88 | int Player_HumanID; //!< プレイヤーが操作する人オブジェクトのID |
| 89 | 89 | |
| 90 | - int AddHumanIndex_TextureID; //!< 前回読み込んだテクスチャID | |
| 90 | + bool *Human_FrameTextureRefresh; //!< 人のテクスチャリフレッシュフラグ(テクスチャ偽造人間(謎人間)用) | |
| 91 | 91 | |
| 92 | 92 | ParameterInfo *GameParamInfo; //!< ゲームの設定値 |
| 93 | 93 | D3DGraphics *d3dg; //!< 描画クラス |
| @@ -109,7 +109,9 @@ | ||
| 109 | 109 | virtual void SetEnableFlag(bool flag); |
| 110 | 110 | virtual bool GetEnableFlag(); |
| 111 | 111 | virtual void SetModel(int id, float size); |
| 112 | + virtual void GetModel(int *id, float *size); | |
| 112 | 113 | virtual void SetTexture(int id); |
| 114 | + virtual int GetTexture(); | |
| 113 | 115 | virtual int RunFrame(); |
| 114 | 116 | virtual void Render(class D3DGraphics *d3dg); |
| 115 | 117 | }; |
| @@ -160,7 +162,7 @@ | ||
| 160 | 162 | void GunsightErrorRange(); |
| 161 | 163 | int CheckAndProcessDead(class Collision *CollD); |
| 162 | 164 | void ControlProcess(); |
| 163 | - bool MapCollisionDetection(class Collision *CollD, class BlockDataInterface *inblockdata, float *FallDist); | |
| 165 | + bool MapCollisionDetection(class Collision *CollD, class BlockDataInterface *inblockdata, float *FallDist, float *nowmove_x, float *nowmove_z); | |
| 164 | 166 | |
| 165 | 167 | public: |
| 166 | 168 | human(class ParameterInfo *in_Param = NULL, float x = 0.0f, float y = 0.0f, float z = 0.0f, float rx = 0.0f, int id_param = -1, int dataid = 0, signed char p4 = 0, int team = 0, bool flag = false); |
| @@ -42,6 +42,7 @@ | ||
| 42 | 42 | HumanTexturePath[i] = '\0'; |
| 43 | 43 | } |
| 44 | 44 | Weapon = NULL; |
| 45 | + BugWeapon = NULL; | |
| 45 | 46 | SmallObject = NULL; |
| 46 | 47 | Bullet = NULL; |
| 47 | 48 | for(int i=0; i<TOTAL_OFFICIALMISSION; i++){ |
| @@ -70,6 +71,7 @@ | ||
| 70 | 71 | |
| 71 | 72 | Human = new HumanParameter[TOTAL_PARAMETERINFO_HUMAN]; |
| 72 | 73 | Weapon = new WeaponParameter[TOTAL_PARAMETERINFO_WEAPON]; |
| 74 | + BugWeapon = new WeaponParameter[1]; | |
| 73 | 75 | SmallObject = new SmallObjectParameter[TOTAL_PARAMETERINFO_SMALLOBJECT]; |
| 74 | 76 | Bullet = new BulletParameter[TOTAL_PARAMETERINFO_BULLET]; |
| 75 | 77 | AIlevel = new AIParameter[TOTAL_PARAMETERINFO_AILEVEL]; |
| @@ -1188,7 +1190,41 @@ | ||
| 1188 | 1190 | Weapon[22].ChangeWeapon = -1; |
| 1189 | 1191 | Weapon[22].burst = 1; |
| 1190 | 1192 | |
| 1193 | + //特殊なバグ武器用データ | |
| 1194 | + BugWeapon[0].name = "BugWeapon"; | |
| 1195 | + BugWeapon[0].model = ""; | |
| 1196 | + BugWeapon[0].texture= ""; | |
| 1197 | + BugWeapon[0].attacks = 0; | |
| 1198 | + BugWeapon[0].penetration = 0; | |
| 1199 | + BugWeapon[0].blazings = 0; | |
| 1200 | + BugWeapon[0].speed = 0; | |
| 1201 | + BugWeapon[0].nbsmax = 0; | |
| 1202 | + BugWeapon[0].reloads = 0; | |
| 1203 | + BugWeapon[0].reaction = 0; | |
| 1204 | + BugWeapon[0].ErrorRangeMIN = 0; | |
| 1205 | + BugWeapon[0].ErrorRangeMAX = 0; | |
| 1206 | + BugWeapon[0].mx = 0.0f; | |
| 1207 | + BugWeapon[0].my = 0.0f; | |
| 1208 | + BugWeapon[0].mz = 0.0f; | |
| 1209 | + BugWeapon[0].flashx = 0.0f; | |
| 1210 | + BugWeapon[0].flashy = 0.0f; | |
| 1211 | + BugWeapon[0].flashz = 0.0f; | |
| 1212 | + BugWeapon[0].yakkyou_px = 0.0f; | |
| 1213 | + BugWeapon[0].yakkyou_py = 0.0f; | |
| 1214 | + BugWeapon[0].yakkyou_pz = 0.0f; | |
| 1215 | + BugWeapon[0].yakkyou_sx = 0.0f; | |
| 1216 | + BugWeapon[0].yakkyou_sy = 0.0f; | |
| 1217 | + BugWeapon[0].blazingmode = true; | |
| 1218 | + BugWeapon[0].scopemode = 0; | |
| 1219 | + BugWeapon[0].size = 9.0f; | |
| 1220 | + BugWeapon[0].soundid = 0; | |
| 1221 | + BugWeapon[0].soundvolume = 0; | |
| 1222 | + BugWeapon[0].silencer = false; | |
| 1223 | + BugWeapon[0].WeaponP = 1; | |
| 1224 | + BugWeapon[0].ChangeWeapon = -1; | |
| 1225 | + BugWeapon[0].burst = 0; | |
| 1191 | 1226 | |
| 1227 | + | |
| 1192 | 1228 | //缶 |
| 1193 | 1229 | SmallObject[0].model = "./data/article/can.x"; |
| 1194 | 1230 | SmallObject[0].texture = "./data/article/can.bmp"; |
| @@ -1567,6 +1603,10 @@ | ||
| 1567 | 1603 | delete [] Weapon; |
| 1568 | 1604 | Weapon = NULL; |
| 1569 | 1605 | } |
| 1606 | + if( BugWeapon != NULL ){ | |
| 1607 | + delete [] BugWeapon; | |
| 1608 | + BugWeapon = NULL; | |
| 1609 | + } | |
| 1570 | 1610 | if( SmallObject != NULL ){ |
| 1571 | 1611 | delete [] SmallObject; |
| 1572 | 1612 | SmallObject = NULL; |
| @@ -1616,12 +1656,31 @@ | ||
| 1616 | 1656 | //! @return 成功:0 失敗:1 |
| 1617 | 1657 | int ParameterInfo::GetWeapon(int id, WeaponParameter *out_data) |
| 1618 | 1658 | { |
| 1619 | - if( (id < 0)||((TOTAL_PARAMETERINFO_WEAPON -1) < id ) ){ return 1; } | |
| 1659 | + if( (id < 0)||((TOTAL_PARAMETERINFO_WEAPON -1) < id ) ){ | |
| 1660 | + return GetBugWeapon(id, out_data); | |
| 1661 | + } | |
| 1620 | 1662 | |
| 1621 | 1663 | *out_data = Weapon[id]; |
| 1622 | 1664 | return 0; |
| 1623 | 1665 | } |
| 1624 | 1666 | |
| 1667 | +//! @brief 武器の設定を取得 | |
| 1668 | +//! @param id 番号 | |
| 1669 | +//! @param out_data 受け取るWeaponParameter型ポインタ | |
| 1670 | +//! @return 成功:0 失敗:1 | |
| 1671 | +//! @warning 先に GetWeapon()関数 を実行して取得に失敗した時に限り、この関数を使ってください。 | |
| 1672 | +//! @attention バグ武器を追加する場合は、ResourceManagerクラスの GetBugWeaponModelTexture() 関数も編集してください。 | |
| 1673 | +int ParameterInfo::GetBugWeapon(int id, WeaponParameter *out_data) | |
| 1674 | +{ | |
| 1675 | + if( (id == 23)||(id == 24)||(id == 30)||(id == 53) ){ | |
| 1676 | + *out_data = BugWeapon[0]; | |
| 1677 | + return 0; | |
| 1678 | + } | |
| 1679 | + | |
| 1680 | + return 1; | |
| 1681 | +} | |
| 1682 | + | |
| 1683 | + | |
| 1625 | 1684 | //! @brief 小物の設定を取得 |
| 1626 | 1685 | //! @param id 番号 |
| 1627 | 1686 | //! @param out_data 受け取るSmallObjectParameter型ポインタ |
| @@ -99,6 +99,7 @@ | ||
| 99 | 99 | void CleanupHumanTexture(); |
| 100 | 100 | int LoadWeaponModelTexture(); |
| 101 | 101 | int GetWeaponModelTexture(int id, int *model, int *texture); |
| 102 | + int GetBugWeaponModelTexture(int id, int *model, int *texture); | |
| 102 | 103 | void CleanupWeaponModelTexture(); |
| 103 | 104 | int LoadWeaponSound(); |
| 104 | 105 | int GetWeaponSound(int id); |
| @@ -49,7 +49,7 @@ | ||
| 49 | 49 | BulletObj_HumanIndex = new BulletObjectHumanIndex[MAX_BULLET]; |
| 50 | 50 | FriendlyFire = false; |
| 51 | 51 | Player_HumanID = 0; |
| 52 | - AddHumanIndex_TextureID = -1; | |
| 52 | + Human_FrameTextureRefresh = new bool[MAX_HUMAN]; | |
| 53 | 53 | |
| 54 | 54 | GameParamInfo = NULL; |
| 55 | 55 | d3dg = NULL; |
| @@ -76,6 +76,7 @@ | ||
| 76 | 76 | if( Human_headshot != NULL ){ delete [] Human_headshot; } |
| 77 | 77 | if( Human_ShotFlag != NULL ){ delete [] Human_ShotFlag; } |
| 78 | 78 | if( BulletObj_HumanIndex != NULL ){ delete [] BulletObj_HumanIndex; } |
| 79 | + if( Human_FrameTextureRefresh != NULL ){ delete [] Human_FrameTextureRefresh; } | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | //! @brief 参照するクラスを設定 |
| @@ -168,19 +169,15 @@ | ||
| 168 | 169 | if( GetHumanFlag == 0 ){ |
| 169 | 170 | int id = Resource->GetHumanTexture(infodata.p2); |
| 170 | 171 | if( id == -1 ){ |
| 171 | - id = AddHumanIndex_TextureID; | |
| 172 | + //テクスチャが取得できなければ、リフレッシュフラグを有効にして毎フレーム取得 | |
| 173 | + Human_FrameTextureRefresh[j] = true; | |
| 172 | 174 | } |
| 173 | - else{ | |
| 174 | - AddHumanIndex_TextureID = id; | |
| 175 | - } | |
| 176 | 175 | |
| 177 | 176 | HumanIndex[j].SetTexture(id); |
| 178 | 177 | HumanIndex[j].SetModel(upmodel[ HumanParam.model ], armmodel, legmodel, walkmodel, runmodel); |
| 179 | 178 | } |
| 180 | 179 | else{ |
| 181 | - AddHumanIndex_TextureID = d3dg->GetMapTextureID(0); | |
| 182 | - | |
| 183 | - HumanIndex[j].SetTexture(AddHumanIndex_TextureID); | |
| 180 | + HumanIndex[j].SetTexture(d3dg->GetMapTextureID(0)); | |
| 184 | 181 | HumanIndex[j].SetModel(upmodel[0], armmodel, legmodel, walkmodel, runmodel); |
| 185 | 182 | } |
| 186 | 183 | HumanIndex[j].SetEnableFlag(true); |
| @@ -262,24 +259,17 @@ | ||
| 262 | 259 | HumanIndex[i].SetPosData(px, py, pz, rx); |
| 263 | 260 | HumanIndex[i].SetParamData(paramID, -1, 0, TeamID, true); |
| 264 | 261 | if( GetHumanFlag == 0 ){ |
| 265 | - //読み込めなければ、前回読み込んだテクスチャ番号を利用 | |
| 266 | - //読み込めれば、今回読み込むテクスチャ番号を上書き | |
| 267 | 262 | int id = Resource->GetHumanTexture(paramID); |
| 268 | 263 | if( id == -1 ){ |
| 269 | - id = AddHumanIndex_TextureID; | |
| 264 | + //テクスチャが取得できなければ、リフレッシュフラグを有効にして毎フレーム取得 | |
| 265 | + Human_FrameTextureRefresh[i] = true; | |
| 270 | 266 | } |
| 271 | - else{ | |
| 272 | - AddHumanIndex_TextureID = id; | |
| 273 | - } | |
| 274 | 267 | |
| 275 | 268 | HumanIndex[i].SetTexture(id); |
| 276 | 269 | HumanIndex[i].SetModel(upmodel[ HumanParam.model ], armmodel, legmodel, walkmodel, runmodel); |
| 277 | 270 | } |
| 278 | 271 | else{ |
| 279 | - //今回読み込むテクスチャ番号を上書き | |
| 280 | - AddHumanIndex_TextureID = d3dg->GetMapTextureID(0); | |
| 281 | - | |
| 282 | - HumanIndex[i].SetTexture(AddHumanIndex_TextureID); | |
| 272 | + HumanIndex[i].SetTexture(d3dg->GetMapTextureID(0)); | |
| 283 | 273 | HumanIndex[i].SetModel(upmodel[0], armmodel, legmodel, walkmodel, runmodel); |
| 284 | 274 | } |
| 285 | 275 | HumanIndex[i].SetEnableFlag(true); |
| @@ -1263,6 +1253,11 @@ | ||
| 1263 | 1253 | FriendlyFire = false; |
| 1264 | 1254 | Player_HumanID = 0; |
| 1265 | 1255 | |
| 1256 | + //人のテクスチャリフレッシュフラグ初期化 | |
| 1257 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 1258 | + Human_FrameTextureRefresh[i] = false; | |
| 1259 | + } | |
| 1260 | + | |
| 1266 | 1261 | /* |
| 1267 | 1262 | //人情報ポイントを探す |
| 1268 | 1263 | for(int i=0; i<PointData->GetTotaldatas(); i++){ |
| @@ -1361,24 +1356,17 @@ | ||
| 1361 | 1356 | //人のテクスチャを登録 |
| 1362 | 1357 | Resource->AddHumanTexture(HumanID); |
| 1363 | 1358 | |
| 1364 | - //読み込めなければ、前回読み込んだテクスチャ番号を利用 | |
| 1365 | - //読み込めれば、今回読み込むテクスチャ番号を上書き | |
| 1366 | 1359 | int id = Resource->GetHumanTexture(HumanID); |
| 1367 | 1360 | if( id == -1 ){ |
| 1368 | - id = AddHumanIndex_TextureID; | |
| 1361 | + //テクスチャが取得できなければ、リフレッシュフラグを有効にして毎フレーム取得 | |
| 1362 | + Human_FrameTextureRefresh[i] = true; | |
| 1369 | 1363 | } |
| 1370 | - else{ | |
| 1371 | - AddHumanIndex_TextureID = id; | |
| 1372 | - } | |
| 1373 | 1364 | |
| 1374 | 1365 | HumanIndex[i].SetTexture(id); |
| 1375 | 1366 | HumanIndex[i].SetModel(upmodel[ HumanParam.model ], armmodel, legmodel, walkmodel, runmodel); |
| 1376 | 1367 | } |
| 1377 | 1368 | else{ |
| 1378 | - //今回読み込むテクスチャ番号を上書き | |
| 1379 | - AddHumanIndex_TextureID = d3dg->GetMapTextureID(0); | |
| 1380 | - | |
| 1381 | - HumanIndex[i].SetTexture(AddHumanIndex_TextureID); | |
| 1369 | + HumanIndex[i].SetTexture(d3dg->GetMapTextureID(0)); | |
| 1382 | 1370 | HumanIndex[i].SetModel(upmodel[0], armmodel, legmodel, walkmodel, runmodel); |
| 1383 | 1371 | } |
| 1384 | 1372 | } |
| @@ -2544,6 +2532,26 @@ | ||
| 2544 | 2532 | for(int i=0; i<MAX_HUMAN; i++){ |
| 2545 | 2533 | bool DrawArm, player; |
| 2546 | 2534 | |
| 2535 | + //人のテクスチャリフレッシュフラグが有効なら | |
| 2536 | + if( Human_FrameTextureRefresh[i] == true ){ | |
| 2537 | + if( i > 0 ){ | |
| 2538 | + //前の人が持っている武器を取得 | |
| 2539 | + int WeaponType = HumanIndex[i-1].GetMainWeaponTypeNO(); | |
| 2540 | + | |
| 2541 | + if( WeaponType != ID_WEAPON_NONE ){ | |
| 2542 | + int model, texture; | |
| 2543 | + | |
| 2544 | + //武器を持っていれば、その武器のテクスチャを適用 | |
| 2545 | + Resource->GetWeaponModelTexture(WeaponType, &model, &texture); | |
| 2546 | + HumanIndex[i].SetTexture(texture); | |
| 2547 | + } | |
| 2548 | + else{ | |
| 2549 | + //手ぶらなら、人のテクスチャをそのまま反映 | |
| 2550 | + HumanIndex[i].SetTexture( HumanIndex[i-1].GetTexture() ); | |
| 2551 | + } | |
| 2552 | + } | |
| 2553 | + } | |
| 2554 | + | |
| 2547 | 2555 | //腕の表示 |
| 2548 | 2556 | if( HidePlayer == 0 ){ |
| 2549 | 2557 | DrawArm = false; |
| @@ -107,6 +107,15 @@ | ||
| 107 | 107 | model_size = size; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | +//! @brief モデルデータを取得 | |
| 111 | +//! @param id モデル認識番号を受け取るポインタ(NULL可) | |
| 112 | +//! @param size 表示倍率を受け取るポインタ(NULL可) | |
| 113 | +void object::GetModel(int *id, float *size) | |
| 114 | +{ | |
| 115 | + if( id != NULL ){ *id = id_model; } | |
| 116 | + if( size != NULL ){ *size = model_size; } | |
| 117 | +} | |
| 118 | + | |
| 110 | 119 | //! @brief テクスチャを設定 |
| 111 | 120 | //! @param id テクスチャ認識番号 |
| 112 | 121 | void object::SetTexture(int id) |
| @@ -114,6 +123,13 @@ | ||
| 114 | 123 | id_texture = id; |
| 115 | 124 | } |
| 116 | 125 | |
| 126 | +//! @brief テクスチャを取得 | |
| 127 | +//! @return テクスチャ認識番号 | |
| 128 | +int object::GetTexture() | |
| 129 | +{ | |
| 130 | + return id_texture; | |
| 131 | +} | |
| 132 | + | |
| 117 | 133 | //! @brief 計算を実行(自由落下など) |
| 118 | 134 | int object::RunFrame() |
| 119 | 135 | { |
| @@ -1254,8 +1270,10 @@ | ||
| 1254 | 1270 | //! @param CollD Collisionクラスのポインタ |
| 1255 | 1271 | //! @param inblockdata BlockDataInterfaceクラスのポインタ |
| 1256 | 1272 | //! @param FallDist Y軸の移動量を取得するポインタ |
| 1273 | +//! @param nowmove_x X軸の移動量を取得するポインタ | |
| 1274 | +//! @param nowmove_z Z軸の移動量を取得するポインタ | |
| 1257 | 1275 | //! @return ブロックに埋まっている:true 埋まっていない:false |
| 1258 | -bool human::MapCollisionDetection(class Collision *CollD, class BlockDataInterface *inblockdata, float *FallDist) | |
| 1276 | +bool human::MapCollisionDetection(class Collision *CollD, class BlockDataInterface *inblockdata, float *FallDist, float *nowmove_x, float *nowmove_z) | |
| 1259 | 1277 | { |
| 1260 | 1278 | bool inside = false; |
| 1261 | 1279 | int id; |
| @@ -1470,6 +1488,9 @@ | ||
| 1470 | 1488 | } |
| 1471 | 1489 | } |
| 1472 | 1490 | |
| 1491 | + *nowmove_x = move_x; | |
| 1492 | + *nowmove_z = move_z; | |
| 1493 | + | |
| 1473 | 1494 | *FallDist = FallDistance; |
| 1474 | 1495 | return inside; |
| 1475 | 1496 | } |
| @@ -1495,6 +1516,7 @@ | ||
| 1495 | 1516 | #endif |
| 1496 | 1517 | |
| 1497 | 1518 | float FallDistance; |
| 1519 | + float nowmove_x, nowmove_z; | |
| 1498 | 1520 | int CheckDead; |
| 1499 | 1521 | |
| 1500 | 1522 | //武器切り替えカウント |
| @@ -1552,16 +1574,16 @@ | ||
| 1552 | 1574 | ControlProcess(); |
| 1553 | 1575 | |
| 1554 | 1576 | //マップとの当たり判定 |
| 1555 | - MapCollisionDetection(CollD, inblockdata, &FallDistance); | |
| 1577 | + MapCollisionDetection(CollD, inblockdata, &FallDistance, &nowmove_x, &nowmove_z); | |
| 1556 | 1578 | |
| 1557 | 1579 | //移動するなら |
| 1558 | - if( (move_x*move_x + move_z*move_z) > 0.0f * 0.0f ){ | |
| 1559 | - totalmove += sqrt(move_x*move_x + move_z*move_z); | |
| 1580 | + if( (nowmove_x*nowmove_x + nowmove_z*nowmove_z) > 0.0f * 0.0f ){ | |
| 1581 | + totalmove += sqrt(nowmove_x*nowmove_x + nowmove_z*nowmove_z); | |
| 1560 | 1582 | } |
| 1561 | 1583 | |
| 1562 | 1584 | //座標移動 |
| 1563 | - pos_x += move_x; | |
| 1564 | - pos_z += move_z; | |
| 1585 | + pos_x += nowmove_x; | |
| 1586 | + pos_z += nowmove_z; | |
| 1565 | 1587 | |
| 1566 | 1588 | //移動量を減衰 |
| 1567 | 1589 | move_x *= HUMAN_ATTENUATION; |