I expect that the compiler will optimise the extra copy away anyway, but note that:
Code:
BoundingBox boundingBox = BoundingBox(0, 0, spriteList[spriteId].getWidth(), spriteList[spriteId].getHeight());
// ...
vertex point = vertex(x,y);
is better written as:
Code:
BoundingBox boundingBox(0, 0, spriteList[spriteId].getWidth(), spriteList[spriteId].getHeight());
// ...
vertex point(x, y);
Also:
Code:
int newX = point.x;
int newY = point.y;
int tempX = newX;
int tempY = newY;
newX = (tempX * cosVal - tempY * sinVal);
newY = (tempY * cosVal + tempX * sinVal);
is probably better written as:
Code:
int newX = (point.x * cosVal) - (point.y * sinVal);
int newY = (point.y * cosVal) + (point.x * sinVal);
And also:
Code:
if(pixelIndex >= getSprite(spriteId).pixelList.size() - 1)
pixelIndex = getSprite(spriteId).pixelList.size() - 1;
could avoid multiple calls to size() with:
Code:
int size = getSprite(spriteId).pixelList.size();
if(pixelIndex >= size && pixelIndex > 0)
pixelIndex = size - 1;
But these are small optimisations that may not matter at all, especially since you hinted that getSprite(spriteId).pixelList is a vector and for std::vector size() runs in constant time. Oh, but if it is a vector, then size() returns a size_type, not an int, so you might want to take that into account with pixelIndex as well. But this is a pedantic issue, not an optimisation issue.
EDIT:
Oh yeah, if this code really is time critical, then perhaps your best bet is to profile it.