本文整理汇总了C++中THMap::updateShadows方法的典型用法代码示例。如果您正苦于以下问题:C++ THMap::updateShadows方法的具体用法?C++ THMap::updateShadows怎么用?C++ THMap::updateShadows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THMap
的用法示例。
在下文中一共展示了THMap::updateShadows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l_map_mark_room
static int l_map_mark_room(lua_State *L)
{
THMap* pMap = luaT_testuserdata<THMap>(L);
int iX_ = static_cast<int>(luaL_checkinteger(L, 2) - 1);
int iY_ = static_cast<int>(luaL_checkinteger(L, 3) - 1);
int iW = static_cast<int>(luaL_checkinteger(L, 4));
int iH = static_cast<int>(luaL_checkinteger(L, 5));
uint16_t iTile = static_cast<uint16_t>(luaL_checkinteger(L, 6));
uint16_t iRoomId = static_cast<uint16_t>(luaL_optinteger(L, 7, 0));
if(iX_ < 0 || iY_ < 0 || (iX_ + iW) > pMap->getWidth() || (iY_ + iH) > pMap->getHeight())
luaL_argerror(L, 2, "Rectangle is out of bounds");
for(int iY = iY_; iY < iY_ + iH; ++iY)
{
for(int iX = iX_; iX < iX_ + iW; ++iX)
{
THMapNode *pNode = pMap->getNodeUnchecked(iX, iY);
pNode->iBlock[0] = iTile;
pNode->iBlock[3] = 0;
pNode->flags.room = true;
pNode->flags.passable |= pNode->flags.passable_if_not_for_blueprint;
pNode->flags.passable_if_not_for_blueprint = false;
pNode->iRoomId = iRoomId;
}
}
pMap->updatePathfinding();
pMap->updateShadows();
lua_settop(L, 1);
return 1;
}
示例2: l_map_unmark_room
static int l_map_unmark_room(lua_State *L)
{
THMap* pMap = luaT_testuserdata<THMap>(L);
int iX_ = static_cast<int>(luaL_checkinteger(L, 2) - 1);
int iY_ = static_cast<int>(luaL_checkinteger(L, 3) - 1);
int iW = static_cast<int>(luaL_checkinteger(L, 4));
int iH = static_cast<int>(luaL_checkinteger(L, 5));
if(iX_ < 0 || iY_ < 0 || (iX_ + iW) > pMap->getWidth() || (iY_ + iH) > pMap->getHeight())
luaL_argerror(L, 2, "Rectangle is out of bounds");
for(int iY = iY_; iY < iY_ + iH; ++iY)
{
for(int iX = iX_; iX < iX_ + iW; ++iX)
{
THMapNode *pNode = pMap->getNodeUnchecked(iX, iY);
pNode->iBlock[0] = pMap->getOriginalNodeUnchecked(iX, iY)->iBlock[0];
pNode->flags.room = false;
pNode->iRoomId = 0;
}
}
pMap->updatePathfinding();
pMap->updateShadows();
lua_settop(L, 1);
return 1;
}
示例3: l_map_updateshadows
static int l_map_updateshadows(lua_State *L)
{
THMap* pMap = luaT_testuserdata<THMap>(L);
pMap->updateShadows();
lua_settop(L, 1);
return 1;
}