本文整理汇总了C++中Corner::isType0方法的典型用法代码示例。如果您正苦于以下问题:C++ Corner::isType0方法的具体用法?C++ Corner::isType0怎么用?C++ Corner::isType0使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Corner
的用法示例。
在下文中一共展示了Corner::isType0方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
void TilePlaneView::display() {
std::vector<Tile *> *tiles = tilePlane->collectAllTiles();
for (int i = 0; i < tiles->size(); ++i) {
Tile *tile = tiles->at(i);
int tileXStart = tile->getXStart();
int tileYStart = tile->getYStart();
int tileXEnd = tile->getXEnd();
int tileYEnd = tile->getYEnd();
if (tile->isSolid()) {
window->drawRectangle(tileXStart, tileYStart, tileXEnd, tileYEnd,
0.5, 0.5, 1, 0.8, 0.8, 0.8);
} else {
window->drawRectangle(tileXStart, tileYStart, tileXEnd, tileYEnd,
0.2, 0.2, 0.2, 0.8, 0.8, 0.8);
}
// Draw Corners
if (tile->isEmpty()) {
Corner *blCorner = tile->getBlCorner();
Corner *brCorner = tile->getBrCorner();
Corner *tlCorner = tile->getTlCorner();
Corner *trCorner = tile->getTrCorner();
if (blCorner != 0) {
if (blCorner->isType0()) {
window->drawRectangle(tileXStart + 1, tileYStart + 1, tileXStart + 2, tileYStart + 2,
0.2, 0.2, 0.2, 0.5, 0.5, 0.5, true);
} else {
window->drawRectangle(tileXStart + 1, tileYStart + 1, tileXStart + 2, tileYStart + 2,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5);
}
}
if (brCorner != 0) {
if (brCorner->isType0()) {
window->drawRectangle(tileXEnd - 2, tileYStart + 1, tileXEnd - 1, tileYStart + 2,
0.2, 0.2, 0.2, 0.5, 0.5, 0.5, true);
} else {
window->drawRectangle(tileXEnd - 2, tileYStart + 1, tileXEnd - 1, tileYStart + 2,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5);
}
}
if (tlCorner != 0) {
if (tlCorner->isType0()) {
window->drawRectangle(tileXStart + 1, tileYEnd - 2, tileXStart + 2, tileYEnd - 1,
0.2, 0.2, 0.2, 0.5, 0.5, 0.5, true);
} else {
window->drawRectangle(tileXStart + 1, tileYEnd - 2, tileXStart + 2, tileYEnd - 1,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5);
}
}
if (trCorner != 0) {
if (trCorner->isType0()) {
window->drawRectangle(tileXEnd - 2, tileYEnd - 2, tileXEnd - 1, tileYEnd - 1,
0.2, 0.2, 0.2, 0.5, 0.5, 0.5, true);
} else {
window->drawRectangle(tileXEnd - 2, tileYEnd - 2, tileXEnd - 1, tileYEnd - 1,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5);
}
}
}
}
delete tiles;
}