1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

More improvements to function names and fix maze anomaly

This commit is contained in:
Ted John
2016-10-08 13:50:12 +01:00
parent a505d77a9c
commit 2249a63073
3 changed files with 46 additions and 26 deletions

View File

@@ -730,7 +730,6 @@ const utf8string TrackElemNames[] = {
"TRACK_ELEM_BRAKES",
"TRACK_ELEM_ROTATION_CONTROL_TOGGLE",
"TRACK_ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP",
"TRACK_ELEM_MAZE",
"TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP",
"TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP",
"TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN",
@@ -1082,7 +1081,7 @@ const utf8string TrackCodeNames[256] = {
"right_quarter_turn_1_60_deg_down",
"brakes",
"rotation_control_toggle",
"inverted90_deg_up_to_flat_quarter_loop_maze",
"inverted_90_deg_up_to_flat_quarter_loop_maze",
"left_quarter_banked_helix_large_up",
"right_quarter_banked_helix_large_up",
"left_quarter_banked_helix_large_down",
@@ -1123,34 +1122,34 @@ const utf8string TrackCodeNames[256] = {
"left_eighth_bank_to_orthogonal",
"right_eighth_bank_to_orthogonal",
"diag_flat",
"diag25_deg_up",
"diag60_deg_up",
"diag_25_deg_up",
"diag_60_deg_up",
"diag_flat_to_25_deg_up",
"diag25_deg_up_to_60_deg_up",
"diag60_deg_up_to_25_deg_up",
"diag25_deg_up_to_flat",
"diag25_deg_down",
"diag60_deg_down",
"diag_25_deg_up_to_60_deg_up",
"diag_60_deg_up_to_25_deg_up",
"diag_25_deg_up_to_flat",
"diag_25_deg_down",
"diag_60_deg_down",
"diag_flat_to_25_deg_down",
"diag25_deg_down_to_60_deg_down",
"diag60_deg_down_to_25_deg_down",
"diag25_deg_down_to_flat",
"diag_25_deg_down_to_60_deg_down",
"diag_60_deg_down_to_25_deg_down",
"diag_25_deg_down_to_flat",
"diag_flat_to_60_deg_up",
"diag60_deg_up_to_flat",
"diag_60_deg_up_to_flat",
"diag_flat_to_60_deg_down",
"diag60_deg_down_to_flat",
"diag_60_deg_down_to_flat",
"diag_flat_to_left_bank",
"diag_flat_to_right_bank",
"diag_left_bank_to_flat",
"diag_right_bank_to_flat",
"diag_left_bank_to_25_deg_up",
"diag_right_bank_to_25_deg_up",
"diag25_deg_up_to_left_bank",
"diag25_deg_up_to_right_bank",
"diag_25_deg_up_to_left_bank",
"diag_25_deg_up_to_right_bank",
"diag_left_bank_to_25_deg_down",
"diag_right_bank_to_25_deg_down",
"diag25_deg_down_to_left_bank",
"diag25_deg_down_to_right_bank",
"diag_25_deg_down_to_left_bank",
"diag_25_deg_down_to_right_bank",
"diag_left_bank",
"diag_right_bank",
"log_flume_reverser",

View File

@@ -60,10 +60,34 @@ private:
void Generate()
{
GenerateIncludes();
GenerateTrackFunctions();
GenerateMainFunction();
}
void GenerateIncludes()
{
const char * includes[] =
{
"../../drawing/drawing.h",
"../../paint/supports.h",
"../../interface/viewport.h",
"../../paint/map_element/map_element.h",
"../../paint/paint.h",
"../../sprites.h",
"../../world/map.h",
"../../world/sprite.h",
"../ride_data.h",
"../track_data.h",
"../track_paint.h",
};
for (auto include : includes)
{
WriteLine(0, "#include \"%s\"", include);
}
WriteLine();
}
void GenerateTrackFunctions()
{
for (int trackType = 0; trackType < 256; trackType++)
@@ -89,7 +113,7 @@ private:
{
WriteLine(1, "case %d:", trackSequence);
GenerateTrackSequence(2, trackType, trackSequence);
WriteLine(2, "break");
WriteLine(2, "break;");
}
WriteLine(1, "}");
}
@@ -332,13 +356,10 @@ private:
void GenerateGeneralSupportCall(int tabs, support_height generalSupports[4])
{
if (AllMatch(generalSupports, 4))
WriteLine(tabs, "paint_util_set_general_support_height(height + %d, 0x%02X);", generalSupports[0].height, generalSupports[0].slope);
if (!AllMatch(generalSupports, 4))
{
WriteLine(tabs, "paint_util_set_general_support_height(height + %d, 0x%02X);", generalSupports[0].height, generalSupports[0].slope);
}
else
{
WriteLine(tabs, "#error Unsupported: different directional general supports");
// WriteLine(tabs, "#error Unsupported: different directional general supports");
}
}

View File

@@ -4,7 +4,7 @@
<LocalDebuggerCommand>$(TargetDir)\openrct2.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>--ride-type 54 --generate</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>--ride-type 68 --generate</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>