mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 06:24:32 +00:00
Simplify RenderObject::followCamera math, remove branches, cleanup followCamera related code.
It also appears that a RenderObject is always on a layer when rendered. Assert this in the code. This saves some extra branches.
This commit is contained in:
parent
81bfcb2f65
commit
0a3f57486b
5 changed files with 40 additions and 48 deletions
|
@ -228,6 +228,14 @@ void RenderObjectLayer::prepareRender()
|
|||
core->renderObjectCount += toRender.size();
|
||||
toRender.push_back(NULL); // terminate
|
||||
core->totalRenderObjectCount += n;
|
||||
|
||||
switch(followCameraLock)
|
||||
{
|
||||
default:
|
||||
case FCL_NONE: followCameraMult = Vector(1, 1); break; // both H and V affected
|
||||
case FCL_HORZ: followCameraMult = Vector(1, 0); break; // only H affected
|
||||
case FCL_VERT: followCameraMult = Vector(0, 1); break; // only V affected
|
||||
}
|
||||
}
|
||||
|
||||
void RenderObjectLayer::render() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue