mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-07-07 19:45:00 +00:00
Remove extra unnecessary palettes
This merges the colors from other palettes into the general entity palette function.
This commit is contained in:
parent
343790f12b
commit
d419c6ed5b
4 changed files with 62 additions and 86 deletions
|
@ -613,17 +613,24 @@ void entclass::updatecolour(void)
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
case 0: // Sprites
|
case 0: // Sprites
|
||||||
|
case 3: // Big chunky pixels!
|
||||||
|
case 4: // Small pickups
|
||||||
case 7: // Teleporter
|
case 7: // Teleporter
|
||||||
case 9: // Really Big Sprite! (2x2)
|
case 9: // Really Big Sprite! (2x2)
|
||||||
case 10: // 2x1 Sprite
|
case 10: // 2x1 Sprite
|
||||||
case 13: // Special for epilogue: huge hero!
|
case 13: // Special for epilogue: huge hero!
|
||||||
realcol = graphics.getcol(colour);
|
realcol = graphics.getcol(colour);
|
||||||
break;
|
break;
|
||||||
case 3: // Big chunky pixels!
|
case 5: // Horizontal gravity line
|
||||||
realcol = graphics.bigchunkygetcol(colour);
|
case 6: // Vertical gravity line
|
||||||
break;
|
if (life == 0)
|
||||||
case 4: // Small pickups
|
{
|
||||||
realcol = graphics.huetilegetcol();
|
realcol = graphics.getcol(colour);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
realcol = graphics.getcol(24);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 11: // The fucking elephant
|
case 11: // The fucking elephant
|
||||||
if (game.noflashingmode)
|
if (game.noflashingmode)
|
||||||
|
|
|
@ -1292,7 +1292,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
//Size 1 is a tile
|
//Size 1 is a tile
|
||||||
//Beyond that are special cases (to do)
|
//Beyond that are special cases (to do)
|
||||||
//Size 2 is a moving platform of width 4 (32)
|
//Size 2 is a moving platform of width 4 (32)
|
||||||
//Size 3 is apparently a "bug chunky pixel"
|
//Size 3 is apparently a "big chunky pixel"
|
||||||
//Size 4 is a coin/small pickup
|
//Size 4 is a coin/small pickup
|
||||||
//Size 5 is a horizontal line, 6 is vertical
|
//Size 5 is a horizontal line, 6 is vertical
|
||||||
|
|
||||||
|
@ -1515,7 +1515,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
case 6: //Decorative particles
|
case 6: //Decorative particles
|
||||||
entity.rule = 2;
|
entity.rule = 2;
|
||||||
entity.type = EntityType_PARTICLE; //Particles
|
entity.type = EntityType_PARTICLE; //Particles
|
||||||
entity.colour = 1;
|
entity.colour = 27;
|
||||||
entity.size = 3;
|
entity.size = 3;
|
||||||
entity.vx = meta1;
|
entity.vx = meta1;
|
||||||
entity.vy = meta2;
|
entity.vy = meta2;
|
||||||
|
@ -1525,7 +1525,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
case 7: //Decorative particles
|
case 7: //Decorative particles
|
||||||
entity.rule = 2;
|
entity.rule = 2;
|
||||||
entity.type = EntityType_PARTICLE; //Particles
|
entity.type = EntityType_PARTICLE; //Particles
|
||||||
entity.colour = 2;
|
entity.colour = 0;
|
||||||
entity.size = 3;
|
entity.size = 3;
|
||||||
entity.vx = meta1;
|
entity.vx = meta1;
|
||||||
entity.vy = meta2;
|
entity.vy = meta2;
|
||||||
|
@ -1536,6 +1536,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
entity.rule = 3;
|
entity.rule = 3;
|
||||||
entity.type = EntityType_COIN;
|
entity.type = EntityType_COIN;
|
||||||
entity.size = 4;
|
entity.size = 4;
|
||||||
|
entity.colour = 26;
|
||||||
entity.tile = 48;
|
entity.tile = 48;
|
||||||
entity.w = 8;
|
entity.w = 8;
|
||||||
entity.h = 8;
|
entity.h = 8;
|
||||||
|
@ -1589,6 +1590,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
entity.type = EntityType_HORIZONTAL_GRAVITY_LINE;
|
entity.type = EntityType_HORIZONTAL_GRAVITY_LINE;
|
||||||
entity.size = 5;
|
entity.size = 5;
|
||||||
entity.life = 0;
|
entity.life = 0;
|
||||||
|
entity.colour = 25;
|
||||||
entity.w = meta1;
|
entity.w = meta1;
|
||||||
entity.h = 1;
|
entity.h = 1;
|
||||||
entity.onentity = 1;
|
entity.onentity = 1;
|
||||||
|
@ -1598,6 +1600,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
|
||||||
entity.type = EntityType_VERTICAL_GRAVITY_LINE;
|
entity.type = EntityType_VERTICAL_GRAVITY_LINE;
|
||||||
entity.size = 6;
|
entity.size = 6;
|
||||||
entity.life = 0;
|
entity.life = 0;
|
||||||
|
entity.colour = 25;
|
||||||
entity.w = 1;
|
entity.w = 1;
|
||||||
entity.h = meta1;
|
entity.h = meta1;
|
||||||
//entity.colour = 0;
|
//entity.colour = 0;
|
||||||
|
|
|
@ -1869,53 +1869,7 @@ void Graphics::drawgravityline(const int t, const int x, const int y, const int
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj.entities[t].life == 0)
|
set_color(obj.entities[t].realcol);
|
||||||
{
|
|
||||||
if (game.noflashingmode)
|
|
||||||
{
|
|
||||||
set_color(200 - 20, 200 - 20, 200 - 20);
|
|
||||||
draw_line(x, y, x + w, y + h);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(linestate)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
set_color(200 - 20, 200 - 20, 200 - 20);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
set_color(245 - 30, 245 - 30, 225 - 30);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
set_color(225 - 30, 245 - 30, 245 - 30);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
set_color(200 - 20, 200 - 20, 164 - 10);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
set_color(196 - 20, 255 - 30, 224 - 20);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
set_color(196 - 20, 235 - 30, 205 - 20);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
set_color(164 - 10, 164 - 10, 164 - 10);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
set_color(205 - 20, 245 - 30, 225 - 30);
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
set_color(225 - 30, 255 - 30, 205 - 20);
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
set_color(245 - 30, 245 - 30, 245 - 30);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
set_color(96, 96, 96);
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_line(x, y, x + w, y + h);
|
draw_line(x, y, x + w, y + h);
|
||||||
}
|
}
|
||||||
|
@ -3084,8 +3038,49 @@ SDL_Color Graphics::getcol( int t )
|
||||||
case 23: // Enemy : Indicator Gray
|
case 23: // Enemy : Indicator Gray
|
||||||
return getRGB(255 - help.glow / 2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40));
|
return getRGB(255 - help.glow / 2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40), 255 - help.glow/2 - (int) (GETCOL_RANDOM * 40));
|
||||||
|
|
||||||
// Trophies
|
case 24: // Gravity line (Inactive)
|
||||||
// cyan
|
return getRGB(96, 96, 96);
|
||||||
|
case 25: // Gravity line (Active)
|
||||||
|
if (game.noflashingmode)
|
||||||
|
{
|
||||||
|
return getRGB(200 - 20, 200 - 20, 200 - 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (linestate)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
return getRGB(200 - 20, 200 - 20, 200 - 20);
|
||||||
|
case 1:
|
||||||
|
return getRGB(245 - 30, 245 - 30, 225 - 30);
|
||||||
|
case 2:
|
||||||
|
return getRGB(225 - 30, 245 - 30, 245 - 30);
|
||||||
|
case 3:
|
||||||
|
return getRGB(200 - 20, 200 - 20, 164 - 10);
|
||||||
|
case 4:
|
||||||
|
return getRGB(196 - 20, 255 - 30, 224 - 20);
|
||||||
|
case 5:
|
||||||
|
return getRGB(196 - 20, 235 - 30, 205 - 20);
|
||||||
|
case 6:
|
||||||
|
return getRGB(164 - 10, 164 - 10, 164 - 10);
|
||||||
|
case 7:
|
||||||
|
return getRGB(205 - 20, 245 - 30, 225 - 30);
|
||||||
|
case 8:
|
||||||
|
return getRGB(225 - 30, 255 - 30, 205 - 20);
|
||||||
|
case 9:
|
||||||
|
return getRGB(245 - 30, 245 - 30, 245 - 30);
|
||||||
|
}
|
||||||
|
case 26: // Coin
|
||||||
|
if (game.noflashingmode)
|
||||||
|
{
|
||||||
|
return getRGB(234, 234, 10);
|
||||||
|
}
|
||||||
|
return getRGB(250 - (int) (GETCOL_RANDOM * 32), 250 - (int) (GETCOL_RANDOM * 32), 10);
|
||||||
|
case 27: // Particle flashy red
|
||||||
|
return getRGB((GETCOL_RANDOM * 64), 10, 10);
|
||||||
|
|
||||||
|
// Trophies
|
||||||
|
// cyan
|
||||||
case 30:
|
case 30:
|
||||||
return RGBf(160, 200, 220);
|
return RGBf(160, 200, 220);
|
||||||
// Purple
|
// Purple
|
||||||
|
@ -3202,32 +3197,6 @@ void Graphics::menuoffrender(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Color Graphics::huetilegetcol()
|
|
||||||
{
|
|
||||||
if (game.noflashingmode)
|
|
||||||
{
|
|
||||||
return getRGB(234, 234, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return getRGB(250 - (int) (fRandom() * 32), 250 - (int) (fRandom() * 32), 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Color Graphics::bigchunkygetcol(int t)
|
|
||||||
{
|
|
||||||
// A seperate index of colours, for simplicity
|
|
||||||
float random = game.noflashingmode ? 0.5 : fRandom();
|
|
||||||
|
|
||||||
switch (t)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return getRGB(random * 64, 10, 10);
|
|
||||||
case 2:
|
|
||||||
return getRGB(160 - help.glow / 2 - (int) (random * 20), 200 - help.glow / 2, 220 - help.glow);
|
|
||||||
}
|
|
||||||
const SDL_Color color = {0, 0, 0, 0};
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphics::textboxabsolutepos(int x, int y)
|
void Graphics::textboxabsolutepos(int x, int y)
|
||||||
{
|
{
|
||||||
if (!INBOUNDS_VEC(m, textboxes))
|
if (!INBOUNDS_VEC(m, textboxes))
|
||||||
|
|
|
@ -51,9 +51,6 @@ public:
|
||||||
|
|
||||||
GraphicsResources grphx;
|
GraphicsResources grphx;
|
||||||
|
|
||||||
SDL_Color huetilegetcol();
|
|
||||||
SDL_Color bigchunkygetcol(int t);
|
|
||||||
|
|
||||||
void drawgravityline(int t, int x, int y, int w, int h);
|
void drawgravityline(int t, int x, int y, int w, int h);
|
||||||
|
|
||||||
void drawcoloredtile(int x, int y, int t, int r, int g, int b);
|
void drawcoloredtile(int x, int y, int t, int r, int g, int b);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue