Gain a few cycles by not converting colors to LLColor4U over and over again per frame.

meow-7.2.2
Nicky 2013-04-24 00:01:33 +02:00
parent 485f5a87eb
commit 2ada1c80a3
1 changed files with 19 additions and 6 deletions

View File

@ -830,12 +830,25 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
*(texcoordsp++) = LLVector2(1,1);
*(texcoordsp++) = LLVector2(1,0);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
// <FS:ND> Only convert to LLColour4U once
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
// *(colorsp++) = LLColor4U(mStarColors[vtx]);
LLColor4U color4u(mStarColors[vtx]);
*(colorsp++) = color4u;
*(colorsp++) = color4u;
*(colorsp++) = color4u;
*(colorsp++) = color4u;
*(colorsp++) = color4u;
*(colorsp++) = color4u;
// </FS:ND>
}
mStarsVerts->flush();