mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
Move big chunky pixel colors to separate function
Again, to make sure colors don't update more than 1000/34 frames a second, we'll need to separate this color calculation from rendeirng functions.
This commit is contained in:
parent
fce56fde09
commit
4c2d219e45
2 changed files with 15 additions and 9 deletions
|
@ -1599,15 +1599,7 @@ void Graphics::drawentities()
|
|||
case 3: // Big chunky pixels!
|
||||
prect.x = xp;
|
||||
prect.y = yp - yoff;
|
||||
//A seperate index of colours, for simplicity
|
||||
if(obj.entities[i].colour==1)
|
||||
{
|
||||
FillRect(backBuffer, prect, (fRandom() * 64), 10, 10);
|
||||
}
|
||||
else if (obj.entities[i].colour == 2)
|
||||
{
|
||||
FillRect(backBuffer,prect, int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
||||
}
|
||||
FillRect(backBuffer, prect, bigchunkygetcol(obj.entities[i].colour));
|
||||
break;
|
||||
case 4: // Small pickups
|
||||
huetilesetcol(obj.entities[i].colour);
|
||||
|
@ -2673,6 +2665,19 @@ void Graphics::huetilesetcol(int t)
|
|||
}
|
||||
}
|
||||
|
||||
Uint32 Graphics::bigchunkygetcol(int t)
|
||||
{
|
||||
//A seperate index of colours, for simplicity
|
||||
switch (t)
|
||||
{
|
||||
case 1:
|
||||
return getRGB((fRandom() * 64), 10, 10);
|
||||
case 2:
|
||||
return getRGB(int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
||||
}
|
||||
return 0x00000000;
|
||||
}
|
||||
|
||||
void Graphics::setwarprect( int a, int b, int c, int d )
|
||||
{
|
||||
warprect.x = a;
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
|
||||
void drawhuetile(int x, int y, int t);
|
||||
void huetilesetcol(int t);
|
||||
Uint32 bigchunkygetcol(int t);
|
||||
|
||||
void drawgravityline(int t);
|
||||
|
||||
|
|
Loading…
Reference in a new issue