Support mirror calls for turn eighth

This commit is contained in:
Ted John 2016-10-08 16:33:17 +01:00
parent 47ccfdb73c
commit 313f766fad
3 changed files with 17 additions and 0 deletions

View File

@ -861,6 +861,8 @@ const sint8 defaultEighthToDiagThickness[4][4] = {
},
};
const uint8 mapLeftEighthTurnToOrthogonal[] = { 4, 2, 3, 1, 0 };
static const sint8 eighth_to_diag_sprite_map[] = {0, 1, 2, -1, 3};
void track_paint_util_eighth_to_diag_tiles_paint(const sint8 thickness[4][4], sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const rct_xy16 offsets[4][4], const rct_xy16 boundsLengths[4][4], const rct_xyz16 boundsOffsets[4][4], uint8 rotation)
{

View File

@ -218,6 +218,8 @@ extern const sint8 defaultEighthToDiagThickness[4][4];
extern const rct_xy16 defaultDiagBoundLengths[4];
extern const rct_xy16 defaultDiagTileOffsets[4];
extern const uint8 mapLeftEighthTurnToOrthogonal[5];
extern bool gUseOriginalRidePaint;
bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint8 rotation);

View File

@ -175,6 +175,11 @@ private:
{ 5, TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN, TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP },
{ 6, TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN, TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP },
{ 6, TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN, TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP },
{ 7, TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL, TRACK_ELEM_LEFT_EIGHTH_TO_DIAG },
{ 7, TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL, TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG },
{ 8, TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL, TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG },
{ 8, TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL, TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG },
};
for (int i = 0; i < (sizeof(mirrorTable) / sizeof(mirrorTable[0])); i++)
@ -208,6 +213,14 @@ private:
case 6:
WriteLine(tabs, "%s(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement);", destFuncName.c_str());
break;
case 7:
WriteLine(tabs, "trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence];");
WriteLine(tabs, "%s(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement);", destFuncName.c_str());
break;
case 8:
WriteLine(tabs, "trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence];");
WriteLine(tabs, "%s(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);", destFuncName.c_str());
break;
}
return true;
}