29#pragma comment(lib,"Winmm.lib")
38 m_nWidth(w), m_nHeight(h), m_nTile(new UINT*[h])
42 for(
size_t i=0; i<h; i++){
45 for(
size_t j=0; j<w; j++)
65 std::uniform_int_distribution<UINT> d(0, 1);
66 return (y&4) ^ (y&1)<<2 | (x&2) ^ (x&1)<<1 | d(
m_stdRandom);
73 std::uniform_int_distribution<UINT> d(0, 7);
Interface for CWangTiler.
void Generate()
Generate tiling.
const size_t GetHeight() const
Get height in tiles.
const size_t GetWidth() const
Get width in tiles.
UINT ** m_nTile
Array of tile indices.
std::default_random_engine m_stdRandom
Pseudo-random number generator.
UINT Match(UINT x, UINT y)
Choose random tile.
const size_t operator()(size_t i, size_t j) const
Get tile index.
size_t m_nHeight
Array height in tiles.
size_t m_nWidth
Array width in tiles.
CWangTiler(size_t w, size_t h)
Constructor.