Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/tests/test_LOSTexture.h
Show All 22 Lines | |||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
#include "simulation2/helpers/Los.h" | #include "simulation2/helpers/Los.h" | ||||
class TestLOSTexture : public CxxTest::TestSuite | class TestLOSTexture : public CxxTest::TestSuite | ||||
{ | { | ||||
public: | public: | ||||
void test_basic() | void test_basic() | ||||
{ | { | ||||
CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | CSimulation2 sim(NULL, g_ScriptContext, NULL); | ||||
CLOSTexture tex(sim); | CLOSTexture tex(sim); | ||||
const ssize_t size = 8; | const ssize_t size = 8; | ||||
u32 inputData[size*size] = { | u32 inputData[size*size] = { | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
0, 0, 0, 0, 0, 0, 0, 0, | 0, 0, 0, 0, 0, 0, 0, 0, | ||||
Show All 22 Lines | |||||
// for (size_t i = 0; i < losData.size(); ++i) | // for (size_t i = 0; i < losData.size(); ++i) | ||||
// printf("%s %3d", i % (size_t)sqrt(losData.size()) ? "" : "\n", losData[i]); | // printf("%s %3d", i % (size_t)sqrt(losData.size()) ? "" : "\n", losData[i]); | ||||
TS_ASSERT_EQUALS(losData[0], 104); | TS_ASSERT_EQUALS(losData[0], 104); | ||||
} | } | ||||
void test_perf_DISABLED() | void test_perf_DISABLED() | ||||
{ | { | ||||
CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | CSimulation2 sim(NULL, g_ScriptContext, NULL); | ||||
CLOSTexture tex(sim); | CLOSTexture tex(sim); | ||||
const ssize_t size = 257; | const ssize_t size = 257; | ||||
Grid<u32> inputDataVec(size, size); | Grid<u32> inputDataVec(size, size); | ||||
// LosState::MASK should be cmpRanageManager->GetSharedLosMask(1), | // LosState::MASK should be cmpRanageManager->GetSharedLosMask(1), | ||||
// but that would mean adding a huge mock component for this and it | // but that would mean adding a huge mock component for this and it | ||||
// should always be LosState::MASK for player 1 (as the other players are bit-shifted). | // should always be LosState::MASK for player 1 (as the other players are bit-shifted). | ||||
Show All 16 Lines |
Wildfire Games · Phabricator