Guest User

Untitled

a guest
Jan 12th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. diff --git a/src/display3d.cpp b/src/display3d.cpp
  2. index ec74ea3..e2c0ac8 100644
  3. --- a/src/display3d.cpp
  4. +++ b/src/display3d.cpp
  5. @@ -2473,11 +2473,8 @@ static bool renderWallSection(STRUCTURE *psStructure)
  6. {
  7. SDWORD structX, structY, height;
  8. PIELIGHT brightness;
  9. - iIMDShape *imd;
  10. SDWORD rotation;
  11. Vector3i dv;
  12. - UDWORD i;
  13. - Vector3f *temp;
  14. int pieFlag, pieFlagData;
  15.  
  16. if(psStructure->visible[selectedPlayer] || demoGetStatus())
  17. @@ -2489,31 +2486,8 @@ static bool renderWallSection(STRUCTURE *psStructure)
  18. structY = psStructure->pos.y;
  19.  
  20. brightness = structureBrightness(psStructure);
  21. + pie_SetShaderStretchDepth(psStructure->pos.z - psStructure->foundationDepth);
  22.  
  23. - /*
  24. - Right, now the tricky bit, we need to bugger about with the coordinates of the imd to make it
  25. - fit tightly to the ground and to neighbours.
  26. - */
  27. - imd = psStructure->pStructureType->pBaseIMD;
  28. - if(imd != NULL)
  29. - {
  30. - UDWORD centreHeight;
  31. -
  32. - // Get a copy of the points
  33. - memcpy(alteredPoints,imd->points,imd->npoints*sizeof(Vector3i));
  34. - // Get the height of the centre point for reference
  35. - centreHeight = map_Height(structX,structY);
  36. - // Now we got through the shape looking for vertices on the edge
  37. - for(i=0; i<(UDWORD)imd->npoints; i++)
  38. - {
  39. - UDWORD pointHeight;
  40. - SDWORD shift;
  41. -
  42. - pointHeight = map_Height(structX+alteredPoints[i].x,structY-alteredPoints[i].z);
  43. - shift = centreHeight - pointHeight;
  44. - alteredPoints[i].y -= shift;
  45. - }
  46. - }
  47. /* Establish where it is in the world */
  48. dv.x = structX - player.p.x;
  49. dv.z = -(structY - player.p.z);
  50. @@ -2541,21 +2515,6 @@ static bool renderWallSection(STRUCTURE *psStructure)
  51. rotation = psStructure->rot.direction;
  52. pie_MatRotY(-rotation);
  53.  
  54. - if(imd != NULL)
  55. - {
  56. - // Make the imd pointer to the vertex list point to ours
  57. - temp = imd->points;
  58. - imd->points = alteredPoints;
  59. - // Actually render it
  60. - pie_Draw3DShape(imd, 0, getPlayerColour(psStructure->player), brightness, 0, 0);
  61. - imd->points = temp;
  62. - }
  63. -
  64. - imd = psStructure->sDisplay.imd;
  65. - temp = imd->points;
  66. -
  67. - flattenImd(imd, structX, structY, UNDEG(psStructure->rot.direction));
  68. -
  69. /* Actually render it */
  70. if ( (psStructure->status == SS_BEING_BUILT ) ||
  71. (psStructure->status == SS_BEING_DEMOLISHED ) ||
  72. @@ -2584,9 +2543,8 @@ static bool renderWallSection(STRUCTURE *psStructure)
  73. }
  74. pieFlagData = 0;
  75. }
  76. - pie_Draw3DShape(imd, 0, getPlayerColour(psStructure->player), brightness, pieFlag, pieFlagData);
  77. + pie_Draw3DShape(psStructure->sDisplay.imd, 0, getPlayerColour(psStructure->player), brightness, pieFlag, pieFlagData);
  78. }
  79. - imd->points = temp;
  80.  
  81. {
  82. Vector3i zero(0, 0, 0);
  83. @@ -2597,6 +2555,7 @@ static bool renderWallSection(STRUCTURE *psStructure)
  84. psStructure->sDisplay.screenY = s.y;
  85. }
  86.  
  87. + pie_SetShaderStretchDepth(0);
  88. pie_MatEnd();
  89.  
  90. return(true);
  91. diff --git a/src/structure.cpp b/src/structure.cpp
  92. index 040f88a..2c70877 100644
  93. --- a/src/structure.cpp
  94. +++ b/src/structure.cpp
  95. @@ -1339,7 +1339,7 @@ static void buildFlatten(STRUCTURE *pStructure, int h)
  96. void alignStructure(STRUCTURE *psBuilding)
  97. {
  98. /* DEFENSIVE structures are pulled to the terrain */
  99. - if (psBuilding->pStructureType->type != REF_DEFENSE)
  100. + if (psBuilding->pStructureType->type != REF_DEFENSE && psBuilding->pStructureType->type != REF_WALL && psBuilding->pStructureType->type != REF_WALLCORNER)
  101. {
  102. int mapH = foundationHeight(psBuilding);
Add Comment
Please, Sign In to add comment