Skip to content

Commit

Permalink
Fix drawing of harbor textures
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Apr 30, 2020
1 parent 4caca96 commit ef2294a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ void CMap::modifyHeightMakeBigHouse(int VertexX, int VertexY)
|| middleVertex.rsuTexture == TRIANGLE_TEXTURE_STEPPE_MEADOW2_HARBOUR || middleVertex.rsuTexture == TRIANGLE_TEXTURE_FLOWER_HARBOUR
|| middleVertex.rsuTexture == TRIANGLE_TEXTURE_MINING_MEADOW_HARBOUR)
{
middleVertex.rsuTexture -= 0x40;
middleVertex.rsuTexture &= ~0x40;
}
}

Expand Down Expand Up @@ -1848,7 +1848,7 @@ void CMap::modifyTextureMakeHarbour(int VertexX, int VertexY)
|| vertex.rsuTexture == TRIANGLE_TEXTURE_STEPPE_MEADOW2 || vertex.rsuTexture == TRIANGLE_TEXTURE_FLOWER
|| vertex.rsuTexture == TRIANGLE_TEXTURE_MINING_MEADOW)
{
vertex.rsuTexture += 0x40;
vertex.rsuTexture |= 0x40;
}
}

Expand Down
5 changes: 5 additions & 0 deletions CSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,11 @@ enum class BorderPreference
BorderPreference CalcBorders(const bobMAP& map, Uint8 s2Id1, Uint8 s2Id2, SDL_Rect& borderRect)
{
// we have to decide which border to blit, "left or right" or "top or bottom"
s2Id1 &= ~(0x40 | 0x80);
s2Id2 &= ~(0x40 | 0x80);

assert(s2Id1 < map.s2IdToTerrain.size());
assert(s2Id2 < map.s2IdToTerrain.size());

DescIdx<TerrainDesc> idxTop = map.s2IdToTerrain[s2Id1];
DescIdx<TerrainDesc> idxBottom = map.s2IdToTerrain[s2Id2];
Expand Down

0 comments on commit ef2294a

Please sign in to comment.