Mercurial > mm7
comparison Outdoor.cpp @ 2207:ff8920a40c21
fixpoint_mul
author | Ritor1 |
---|---|
date | Thu, 06 Feb 2014 17:20:12 +0600 |
parents | 3445abad44c5 |
children | 0b2eea6f80c9 |
comparison
equal
deleted
inserted
replaced
2206:15a327be07e2 | 2207:ff8920a40c21 |
---|---|
31 #include "MapInfo.h" | 31 #include "MapInfo.h" |
32 #include "Outdoor_stuff.h" | 32 #include "Outdoor_stuff.h" |
33 #include "BSPModel.h" | 33 #include "BSPModel.h" |
34 #include "GUIWindow.h" | 34 #include "GUIWindow.h" |
35 #include "Level/Decoration.h" | 35 #include "Level/Decoration.h" |
36 #include "OurMath.h" | |
36 | 37 |
37 MapStartPoint uLevel_StartingPointType; // weak | 38 MapStartPoint uLevel_StartingPointType; // weak |
38 | 39 |
39 OutdoorLocation *pOutdoor = new OutdoorLocation; | 40 OutdoorLocation *pOutdoor = new OutdoorLocation; |
40 ODMRenderParams *pODMRenderParams; | 41 ODMRenderParams *pODMRenderParams; |
2969 break; | 2970 break; |
2970 if ( pFace->uPolygonType == POLYGON_Floor ) | 2971 if ( pFace->uPolygonType == POLYGON_Floor ) |
2971 v24 = pBModel->pVertices.pVertices[pFace->pVertexIDs[0]].z; | 2972 v24 = pBModel->pVertices.pVertices[pFace->pVertexIDs[0]].z; |
2972 else | 2973 else |
2973 { | 2974 { |
2974 int a = ((signed __int64)(pFace->zCalc1 * (signed __int64)X) >> 16); | 2975 int a = fixpoint_mul(pFace->zCalc1, X); |
2975 int b = ((signed __int64)(pFace->zCalc2 * (signed __int64)Y) >> 16); | 2976 int b = fixpoint_mul(pFace->zCalc2, Y); |
2976 int c = ((signed __int64)pFace->zCalc3 >> 16); | 2977 int c = ((signed __int64)pFace->zCalc3 >> 16); |
2977 v24 = a + b + c; | 2978 v24 = a + b + c; |
2978 } | 2979 } |
2979 v25 = v46++; | 2980 v25 = v46++; |
2980 odm_floor_level[v25] = v24; | 2981 odm_floor_level[v25] = v24; |
4449 if ( v39 >= 20 ) | 4450 if ( v39 >= 20 ) |
4450 break; | 4451 break; |
4451 if ( pOutdoor->pBModels[i].pFaces[j].uPolygonType == POLYGON_Ceiling ) | 4452 if ( pOutdoor->pBModels[i].pFaces[j].uPolygonType == POLYGON_Ceiling ) |
4452 v19 = pOutdoor->pBModels[i].pVertices.pVertices[pOutdoor->pBModels[i].pFaces[j].pVertexIDs[0]].z; | 4453 v19 = pOutdoor->pBModels[i].pVertices.pVertices[pOutdoor->pBModels[i].pFaces[j].pVertexIDs[0]].z; |
4453 else | 4454 else |
4454 v19 = ((unsigned __int64)(pOutdoor->pBModels[i].pFaces[j].zCalc1 * (signed __int64)Party_X) >> 16) | 4455 v19 = fixpoint_mul(pOutdoor->pBModels[i].pFaces[j].zCalc1, Party_X) + fixpoint_mul(pOutdoor->pBModels[i].pFaces[j].zCalc2, Party_Y) |
4455 + ((unsigned __int64)(pOutdoor->pBModels[i].pFaces[j].zCalc2 * (signed __int64)Party_Y) >> 16) | |
4456 + HIWORD(pOutdoor->pBModels[i].pFaces[j].zCalc3); | 4456 + HIWORD(pOutdoor->pBModels[i].pFaces[j].zCalc3); |
4457 v20 = v39++; | 4457 v20 = v39++; |
4458 ceiling_height_level[v20] = v19; | 4458 ceiling_height_level[v20] = v19; |
4459 dword_720ED0[v20] = i; | 4459 dword_720ED0[v20] = i; |
4460 dword_720E80[v20] = j; | 4460 dword_720E80[v20] = j; |