本文整理汇总了C++中Cam::GetCameraWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Cam::GetCameraWidth方法的具体用法?C++ Cam::GetCameraWidth怎么用?C++ Cam::GetCameraWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cam
的用法示例。
在下文中一共展示了Cam::GetCameraWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int Map_Drawable::RefreshToSurface(ID::Surface* s,
int x, int y)
{
Game* g;
Cam* c;
Map* m;
Light_Drawable* cases;
uint32_t i;
// uint32_t indexSaver;
uint32_t tmpSaver;
std::list<Unit*>::iterator itU;
std::list<Unit*>::iterator endU;
int xMin;
int yMin;
int xMax;
int yMax;
int offsetCamX;
int offsetCamY;
ID::Draw_Geometry_Circle* focus;
double xU;
double yU;
bool selected;
g = Game::GetInstance();
c = Cam::GetInstance();
m = Map::GetInstance();
focus = ID::Draw_Geometry_Circle::GetInstance();
if (this->__RefreshGrounds(UNDER_BACKGROUND, ON_BACKGROUND, s, x, y) == -1)
return -1;
cases = c->GetCases();
offsetCamX = c->GetOffsetX();
offsetCamY = c->GetOffsetY();
xMax = c->GetCameraWidth() / CASE_SIDE_PIXELS;
yMax = c->GetCameraHeight() / CASE_SIDE_PIXELS;
// indexSaver = ((c->GetY() / CASE_SIDE_PIXELS) -
// (c->GetCameraHeightRayon() / CASE_SIDE_PIXELS)) *
// (c->GetMapWidth() / CASE_SIDE_PIXELS) +
// (c->GetX() / CASE_SIDE_PIXELS - c->GetCameraWidthRayon() / CASE_SIDE_PIXELS);
tmpSaver = g->currentTick;
yMin = 0;
while (yMin < yMax)
{
xMin = 0;
i = ((yMin + (c->GetOffsetY() / CASE_SIDE_PIXELS)) *
(c->GetMapWidth() / CASE_SIDE_PIXELS)) +
(c->GetOffsetX() / CASE_SIDE_PIXELS);
while (xMin < xMax)
{
itU = m->cases[i].units.begin();
endU = m->cases[i].units.end();
while (itU != endU)
{
if (((*itU)->GetModel()->GetType() == TYPE_GROUND ||
(*itU)->GetModel()->GetType() == 3) &&
(*itU)->GetUpdateSaver() != tmpSaver)
{
(*itU)->SetUpdateSaver(tmpSaver);
(*itU)->GetPositionXY(&xU, &yU);
selected = (*itU)->GetTickSelection() == g->lastSelection;
focus->Draw(s,
xU * CASE_SIDE_PIXELS - offsetCamX,
yU * CASE_SIDE_PIXELS - offsetCamY,
(*itU)->GetModel()->GetSize(),
selected,
&(m->_colorsPalette[(*itU)->GetPlayer()->GetID()]));
}
++itU;
}
++xMin;
++i;
}
++yMin;
}
if (this->__RefreshGrounds(MIDDLEGROUND, MIDDLEGROUND, s, x, y) == -1)
return -1;
tmpSaver = g->currentTick + 1;
// i = indexSaver;
yMin = 0;
// std::cout << "- - - - - - - - \n";
while (yMin < yMax)
{
xMin = 0;
i = ((yMin + (c->GetOffsetY() / CASE_SIDE_PIXELS)) *
(c->GetMapWidth() / CASE_SIDE_PIXELS)) +
(c->GetOffsetX() / CASE_SIDE_PIXELS);
while (xMin < xMax)
{
itU = m->cases[i].units.begin();
endU = m->cases[i].units.end();
// std::cout << i << " ";
while (itU != endU)
{
if (((*itU)->GetModel()->GetType() == TYPE_AIR ||
(*itU)->GetModel()->GetType() == 4) &&
(*itU)->GetUpdateSaver() != tmpSaver)
{
//.........这里部分代码省略.........