本文整理汇总了C++中Axis::getScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Axis::getScale方法的具体用法?C++ Axis::getScale怎么用?C++ Axis::getScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis::getScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateRegions
void RegionLoad::UpdateRegions()
{
//Define all regions actors
//Reset axis (Solve the bug "Game behavior differ based on editor grid position when uses regions", ALPHA_1_1_4.ged)
int xAxisAnt, yAxisAnt;
double scaleAnt;
Axis *pAxis = GameControl::Get()->GetAxis();
scaleAnt = pAxis->getScale();
xAxisAnt = pAxis->getImage()->X();
yAxisAnt = pAxis->getImage()->Y();
pAxis->SetScale(1.0);
pAxis->SetPos(0, 0);
pAxis->getImage()->Invalidate();
//Define actors
MapRegionsIterator it(regions);
RegionLoad *pRegion;
for( it.Begin(); !it.Done(); it.Next() )
{
pRegion = *it.Key();
pRegion->DefineActors();
}
SetDefaultRegionView();
//Restore axis (Solve the bug "Game behavior differ based on editor grid position when uses regions", ALPHA_1_1_4.ged)
pAxis->SetScale(scaleAnt);
pAxis->SetPos(xAxisAnt, yAxisAnt);
pAxis->getImage()->Invalidate();
}
示例2: UpdateView
void RegionLoad::UpdateView()
{
/*
Tests the intersection of all regions with the view (if moved)
Call CreateActors of the areas that began to intercept and
DestroyActors of the areas that are not more intercepting.
*/
//The coordinates changes solve the bug in activation-problem_view_parent.ged
//(don't load left region)
//Make sure view don't will shake
KrImage *pImageView = GameControl::Get()->GetViewActor()->getImage();
Axis *pAxis = GameControl::Get()->GetAxis();
if(pImageView->IsInvalid(true))
{
//Solve the alpha14.ged bug
pImageView->CalcCompositeTransform();
engine->Tree()->Walk(pImageView, true, true);
}
else
{
pImageView->CalcTransform();
}
//Get view bounds
KrRect rectView = pImageView->Bounds(), viewPos;
//Get view in screen and axis coordinates
KrVector2T< GlFixed > screen, axis;
pImageView->ObjectToScreen(0, 0, &screen);
pAxis->getImage()->ScreenToObject( screen.x.ToInt(), screen.y.ToInt(), &axis );
//Make sure rect is (0, 0, ...)
rectView.Translate(-rectView.xmin, -rectView.ymin);
//Translate to correct position
rectView.Translate(axis.x.ToInt(), axis.y.ToInt());
//Solve the bug: "PocketPC don't load checkers.ged"
viewPos.Set(rectView.xmin, rectView.ymin,
//zeroViewPos.x.ToInt(), zeroViewPos.y.ToInt(),
0, 0);
if(viewPos != viewPosAnt)
{
MapRegions createdRegions, destroyedRegions;
/*#ifdef DEBUG
GLOUTPUT( " View pos: (%ld, %ld)\n", rectView.xmin, rectView.ymin);
#endif*/
MapRegionsIterator it(regions);
RegionLoad *pRegion;
for( it.Begin(); !it.Done(); it.Next() )
{
pRegion = *it.Key();
pRegion->getImage()->CalcTransform();
KrRect rectRegion = pRegion->getImage()->Bounds();
rectRegion.Translate(-rectRegion.xmin, -rectRegion.ymin);
//To axis coordinate
pRegion->getImage()->ObjectToScreen(0, 0, &screen);
pAxis->getImage()->ScreenToObject( screen.x.ToInt(), screen.y.ToInt(), &axis );
rectRegion.Translate(axis.x.ToInt()*pAxis->getScale(), axis.y.ToInt()*pAxis->getScale());
//View and region in axis coordinates
if(rectView.Intersect(rectRegion))
{
if(!pRegion->bRegionInView)
{
createdRegions.Add(pRegion, 1);
}
}
else
{
if(pRegion->bRegionInView)
{
destroyedRegions.Add(pRegion, 1);
}
}
}
//Destroy actors from regions outside the view
//Solve the Move to Region.ged when add the 'sad' actor to two default regions
//(some times)
MapRegionsIterator it1(destroyedRegions);
for(it1.Begin(); !it1.Done(); it1.Next())
{
pRegion = *it1.Key();
pRegion->DestroyActors();
//.........这里部分代码省略.........