# HG changeset patch # User Ritor1 # Date 1388663815 -21600 # Node ID 4c0c475917dd42986fbf48f958727f40a9502a35 # Parent f9b55be70c1b2cb46bf3827448941936e8a7930f drawing items in the dragon's cave and GetFloorLevel for BModels diff -r f9b55be70c1b -r 4c0c475917dd AudioPlayer.cpp --- a/AudioPlayer.cpp Thu Jan 02 09:11:28 2014 +0600 +++ b/AudioPlayer.cpp Thu Jan 02 17:56:55 2014 +0600 @@ -1952,7 +1952,7 @@ case OBJECT_Item: { - assert(source_id < uNumSpriteObjects); + //assert(source_id < uNumSpriteObjects); // Ritor1:в ида до и после перехода одинаково //source_x = pSpriteObjects[source_id].vPosition.x; //source_y = pSpriteObjects[source_id].vPosition.y; diff -r f9b55be70c1b -r 4c0c475917dd Indoor.cpp --- a/Indoor.cpp Thu Jan 02 09:11:28 2014 +0600 +++ b/Indoor.cpp Thu Jan 02 17:56:55 2014 +0600 @@ -2204,7 +2204,7 @@ if (pItem->stru_24.uItemID && !(pItem->uAttributes & 0x0100)) { - pItem->uType = pItemsTable->pItems[pItem->stru_24.uItemID - 1].uSpriteID; + pItem->uType = pItemsTable->pItems[pItem->stru_24.uItemID].uSpriteID; uint uObjectID = 0; for (uint j = 0; j < pObjectList->uNumObjects; ++j) diff -r f9b55be70c1b -r 4c0c475917dd Outdoor.cpp --- a/Outdoor.cpp Thu Jan 02 09:11:28 2014 +0600 +++ b/Outdoor.cpp Thu Jan 02 17:56:55 2014 +0600 @@ -3150,8 +3150,8 @@ signed int next_floor_level; // [sp+58h] [bp+18h]@43 v46 = 1; - dword_721160[0] = -1; - dword_721110[0] = -1; + current_BModel_id[0] = -1; + current_Face_id[0] = -1; odm_floor_level[0] = GetTerrainHeightsAroundParty2(X, Y, pIsOnWater, bWaterWalk); for ( pBModelNum = 0; pBModelNum < pOutdoor->uNumBModels; ++pBModelNum ) @@ -3176,9 +3176,9 @@ for ( uint i = 0; i < pFace->uNumVertices; ++i) { odm_floor_face_vert_coord_X[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].x; - odm_floor_face_vert_coord_Y[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].y; - odm_floor_face_vert_coord_X[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x; - odm_floor_face_vert_coord_Y[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y; + odm_floor_face_vert_coord_Y[2 * i] = pFace->pYInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].y; + odm_floor_face_vert_coord_X[2 * i + 1] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x; + odm_floor_face_vert_coord_Y[2 * i + 1] = pFace->pYInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y; } odm_floor_face_vert_coord_X[2 * pFace->uNumVertices] = odm_floor_face_vert_coord_X[0]; odm_floor_face_vert_coord_Y[2 * pFace->uNumVertices] = odm_floor_face_vert_coord_Y[0]; @@ -3221,12 +3221,16 @@ if ( pFace->uPolygonType == POLYGON_Floor ) v24 = pBModel->pVertices.pVertices[pFace->pVertexIDs[0]].z; else - v24 = ((unsigned __int64)(pFace->zCalc1 * (signed __int64)X) >> 16) + ((unsigned __int64)(pFace->zCalc2 * (signed __int64)Y) >> 16) - + HIWORD(pFace->zCalc3); + { + int a = ((unsigned __int64)(pFace->zCalc1 * (signed __int64)X) >> 16); + int b = ((unsigned __int64)(pFace->zCalc2 * (signed __int64)Y) >> 16); + int c = ((unsigned __int64)pFace->zCalc3 >> 16); + v24 = a + b + c; + } v25 = v46++; odm_floor_level[v25] = v24; - dword_721160[v25] = pBModelNum; - dword_721110[v25] = pFaceNum; + current_BModel_id[v25] = pBModelNum; + current_Face_id[v25] = pFaceNum; } } } @@ -3267,12 +3271,12 @@ if ( !v29 ) *bmodel_pid = 0; else - *bmodel_pid = dword_721110[v29] | (dword_721160[v29] << 6); + *bmodel_pid = current_Face_id[v29] | (current_BModel_id[v29] << 6); } if ( v29 ) { *pIsOnWater = false; - if ( pOutdoor->pBModels[dword_721160[v29]].pFaces[dword_721110[v29]].Fluid()) + if ( pOutdoor->pBModels[current_BModel_id[v29]].pFaces[current_Face_id[v29]].Fluid()) *pIsOnWater = true; } if ( odm_floor_level[v29] >= odm_floor_level[0] ) diff -r f9b55be70c1b -r 4c0c475917dd mm7_data.cpp --- a/mm7_data.cpp Thu Jan 02 09:11:28 2014 +0600 +++ b/mm7_data.cpp Thu Jan 02 17:56:55 2014 +0600 @@ -1259,8 +1259,8 @@ std::array ceiling_height_level; std::array<__int16, 104> odm_floor_face_vert_coord_Y; // word_720F70 std::array<__int16, 104> odm_floor_face_vert_coord_X; // word_721040 -std::array dword_721110; // idb -std::array dword_721160; // idb +std::array current_Face_id; // dword_721110 +std::array current_BModel_id; // dword_721160 std::array odm_floor_level; // idb int blv_prev_party_x; // weak int blv_prev_party_z; // weak diff -r f9b55be70c1b -r 4c0c475917dd mm7_data.h --- a/mm7_data.h Thu Jan 02 09:11:28 2014 +0600 +++ b/mm7_data.h Thu Jan 02 17:56:55 2014 +0600 @@ -909,8 +909,8 @@ extern std::array ceiling_height_level; extern std::array<__int16, 104> odm_floor_face_vert_coord_Y; // word_720F70 extern std::array<__int16, 104> odm_floor_face_vert_coord_X; // word_721040 -extern std::array dword_721110; // idb -extern std::array dword_721160; // idb +extern std::array current_Face_id; // dword_721110 +extern std::array current_BModel_id; // dword_721160 extern std::array odm_floor_level; // idb dword_7211B0 extern int blv_prev_party_x; // weak extern int blv_prev_party_z; // weak