Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/tests/test_Pathfinder.h
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | CFixedVector2D v(i*0, i*1); | ||||
TS_ASSERT(goal.RectContainsGoal(i*3, i*0, i*4, i*10)); // touching the edge | TS_ASSERT(goal.RectContainsGoal(i*3, i*0, i*4, i*10)); // touching the edge | ||||
} | } | ||||
} | } | ||||
void test_performance_DISABLED() | void test_performance_DISABLED() | ||||
{ | { | ||||
CTerrain terrain; | CTerrain terrain; | ||||
CSimulation2 sim2(NULL, g_ScriptRuntime, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/skirmishes/Median Oasis (2).pmp", | mapReader->LoadMap(L"maps/skirmishes/Median Oasis (2).pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | ||||
Show All 40 Lines | #endif | ||||
printf("[%f]", t); | printf("[%f]", t); | ||||
} | } | ||||
void test_performance_short_DISABLED() | void test_performance_short_DISABLED() | ||||
{ | { | ||||
CTerrain terrain; | CTerrain terrain; | ||||
terrain.Initialize(5, NULL); | terrain.Initialize(5, NULL); | ||||
CSimulation2 sim2(NULL, g_ScriptRuntime, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
const entity_pos_t range = entity_pos_t::FromInt(TERRAIN_TILE_SIZE*12); | const entity_pos_t range = entity_pos_t::FromInt(TERRAIN_TILE_SIZE*12); | ||||
CmpPtr<ICmpObstructionManager> cmpObstructionMan(sim2, SYSTEM_ENTITY); | CmpPtr<ICmpObstructionManager> cmpObstructionMan(sim2, SYSTEM_ENTITY); | ||||
CmpPtr<ICmpPathfinder> cmpPathfinder(sim2, SYSTEM_ENTITY); | CmpPtr<ICmpPathfinder> cmpPathfinder(sim2, SYSTEM_ENTITY); | ||||
Show All 37 Lines | for (u16 j = 0; j < grid.m_H; ++j) | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void test_perf2_DISABLED() | void test_perf2_DISABLED() | ||||
{ | { | ||||
CTerrain terrain; | CTerrain terrain; | ||||
CSimulation2 sim2(NULL, g_ScriptRuntime, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | ||||
Show All 40 Lines | // DumpPath(stream, 128*4, 230*4, 32*4, 230*4, cmpPathfinder); | ||||
stream << "</g>\n"; | stream << "</g>\n"; | ||||
stream << "</svg>\n"; | stream << "</svg>\n"; | ||||
} | } | ||||
void test_perf3_DISABLED() | void test_perf3_DISABLED() | ||||
{ | { | ||||
CTerrain terrain; | CTerrain terrain; | ||||
CSimulation2 sim2(NULL, g_ScriptRuntime, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator