mirror of https://github.com/OpenRCT2/OpenRCT2.git
Allow test ignoring
This commit is contained in:
parent
21bb6c507d
commit
a4b75fd84a
|
@ -168,4 +168,18 @@ void sub_685EBC(money32 amount, rct_string_id string_id, sint16 y, sint16 z, sin
|
||||||
void viewport_draw_money_effects();
|
void viewport_draw_money_effects();
|
||||||
void viewport_paint_setup();
|
void viewport_paint_setup();
|
||||||
|
|
||||||
|
// TESTING
|
||||||
|
#ifdef __TESTPAINT__
|
||||||
|
void testpaint_clear_ignore();
|
||||||
|
void testpaint_ignore(uint8 direction, uint8 trackSequence);
|
||||||
|
void testpaint_ignore_all();
|
||||||
|
bool testpaint_is_ignored(uint8 direction, uint8 trackSequence);
|
||||||
|
|
||||||
|
#define TESTPAINT_IGNORE(direction, trackSequence) testpaint_ignore(direction, trackSequence)
|
||||||
|
#define TESTPAINT_IGNORE_ALL() testpaint_ignore_all()
|
||||||
|
#else
|
||||||
|
#define TESTPAINT_IGNORE(direction, trackSequence)
|
||||||
|
#define TESTPAINT_IGNORE_ALL()
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -576,7 +576,12 @@ static bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error)
|
||||||
|
|
||||||
callCount = 0;
|
callCount = 0;
|
||||||
|
|
||||||
|
testpaint_clear_ignore();
|
||||||
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
||||||
|
if (testpaint_is_ignored(direction, trackSequence)) {
|
||||||
|
sprintf(*error, "[ IGNORED ] [direction:%d trackSequence:%d]\n", direction, trackSequence);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
uint8 newCallCount = callCount;
|
uint8 newCallCount = callCount;
|
||||||
function_call newCalls[256];
|
function_call newCalls[256];
|
||||||
|
|
|
@ -397,8 +397,12 @@ namespace Intercept2
|
||||||
gSupportSegments[s].slope = 0xFF;
|
gSupportSegments[s].slope = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testpaint_clear_ignore();
|
||||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
||||||
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
||||||
|
if (testpaint_is_ignored(direction, trackSequence)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<SegmentSupportCall> newCalls = getSegmentCalls(gSupportSegments, direction);
|
std::vector<SegmentSupportCall> newCalls = getSegmentCalls(gSupportSegments, direction);
|
||||||
|
|
||||||
|
@ -432,8 +436,12 @@ namespace Intercept2
|
||||||
gSupport.height = 0;
|
gSupport.height = 0;
|
||||||
gSupport.slope = 0xFF;
|
gSupport.slope = 0xFF;
|
||||||
|
|
||||||
|
testpaint_clear_ignore();
|
||||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
||||||
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
||||||
|
if (testpaint_is_ignored(direction, trackSequence)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (referenceGeneralSupportCall.height != -1) {
|
if (referenceGeneralSupportCall.height != -1) {
|
||||||
if (gSupport.height != referenceGeneralSupportCall.height) {
|
if (gSupport.height != referenceGeneralSupportCall.height) {
|
||||||
|
@ -583,6 +591,7 @@ namespace Intercept2
|
||||||
gLeftTunnelCount = 0;
|
gLeftTunnelCount = 0;
|
||||||
gRightTunnelCount = 0;
|
gRightTunnelCount = 0;
|
||||||
|
|
||||||
|
testpaint_clear_ignore();
|
||||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
||||||
|
|
||||||
for (int offset = -8; offset <= 8; offset += 8) {
|
for (int offset = -8; offset <= 8; offset += 8) {
|
||||||
|
@ -757,8 +766,12 @@ namespace Intercept2
|
||||||
for (int direction = 0; direction < 4; direction++) {
|
for (int direction = 0; direction < 4; direction++) {
|
||||||
gVerticalTunnelHeight = 0;
|
gVerticalTunnelHeight = 0;
|
||||||
|
|
||||||
|
testpaint_clear_ignore();
|
||||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
TRACK_PAINT_FUNCTION newPaintFunction = newPaintGetter(trackType, direction);
|
||||||
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
newPaintFunction(rideIndex, trackSequence, direction, height, &mapElement);
|
||||||
|
if (testpaint_is_ignored(direction, trackSequence)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (gVerticalTunnelHeight != referenceHeight) {
|
if (gVerticalTunnelHeight != referenceHeight) {
|
||||||
if (referenceHeight == 0) {
|
if (referenceHeight == 0) {
|
||||||
|
@ -795,6 +808,44 @@ namespace Intercept2
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct IgnoredEntry
|
||||||
|
{
|
||||||
|
uint8 Direction;
|
||||||
|
uint8 TrackSequence;
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool _ignoredAll;
|
||||||
|
static std::vector<IgnoredEntry> _ignoredEntries;
|
||||||
|
|
||||||
|
static void testClearIgnore()
|
||||||
|
{
|
||||||
|
_ignoredAll = false;
|
||||||
|
_ignoredEntries.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void testIgnore(uint8 direction, uint8 trackSequence)
|
||||||
|
{
|
||||||
|
_ignoredEntries.push_back({ direction, trackSequence });
|
||||||
|
}
|
||||||
|
|
||||||
|
static void testIgnoreAll()
|
||||||
|
{
|
||||||
|
_ignoredAll = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool testIsIgnored(uint8 direction, uint8 trackSequence)
|
||||||
|
{
|
||||||
|
if (_ignoredAll) return true;
|
||||||
|
for (const IgnoredEntry &entry : _ignoredEntries)
|
||||||
|
{
|
||||||
|
if (entry.Direction == direction &&
|
||||||
|
entry.TrackSequence == trackSequence)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
@ -814,4 +865,23 @@ extern "C"
|
||||||
return Intercept2::testVerticalTunnels(rideType, trackType);
|
return Intercept2::testVerticalTunnels(rideType, trackType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testpaint_clear_ignore()
|
||||||
|
{
|
||||||
|
Intercept2::testClearIgnore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void testpaint_ignore(uint8 direction, uint8 trackSequence)
|
||||||
|
{
|
||||||
|
Intercept2::testIgnore(direction, trackSequence);
|
||||||
|
}
|
||||||
|
|
||||||
|
void testpaint_ignore_all()
|
||||||
|
{
|
||||||
|
Intercept2::testIgnoreAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool testpaint_is_ignored(uint8 direction, uint8 trackSequence)
|
||||||
|
{
|
||||||
|
return Intercept2::testIsIgnored(direction, trackSequence);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>DEBUG;NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>__TESTPAINT__;DEBUG;NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<TreatWarningAsError>true</TreatWarningAsError>
|
<TreatWarningAsError>true</TreatWarningAsError>
|
||||||
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>__TESTPAINT__;NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<TreatWarningAsError>true</TreatWarningAsError>
|
<TreatWarningAsError>true</TreatWarningAsError>
|
||||||
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
<LocalDebuggerCommand>$(TargetDir)\openrct2.exe</LocalDebuggerCommand>
|
<LocalDebuggerCommand>$(TargetDir)\openrct2.exe</LocalDebuggerCommand>
|
||||||
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
<LocalDebuggerCommandArguments>--ride-type 4</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>--ride-type 42</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ShowAllFiles>false</ShowAllFiles>
|
<ShowAllFiles>false</ShowAllFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LocalDebuggerCommandArguments>--ride-type 4</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>--ride-type 42</LocalDebuggerCommandArguments>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue