Black decorations only in thumbnails

This commit is contained in:
Simon Robertshaw 2012-08-28 15:53:07 +01:00
parent 1fb544815f
commit 92f3ad5814
3 changed files with 21 additions and 6 deletions

View File

@ -1128,6 +1128,17 @@ void Renderer::render_parts()
decg = (sim->parts[i].dcolour>>8)&0xFF;
decb = (sim->parts[i].dcolour)&0xFF;
if(decorations_enable && blackDecorations)
{
if(deca < 250 || decr > 5 || decg > 5 || decb > 5)
deca = 0;
else
{
deca = 255;
decr = decg = decb = 0;
}
}
{
if (graphicscache[t].isready)
{
@ -1226,16 +1237,16 @@ void Renderer::render_parts()
}
//Apply decoration colour
if(!(colour_mode & ~COLOUR_GRAD))
if(!(colour_mode & ~COLOUR_GRAD) && decorations_enable && deca)
{
if(!(pixel_mode & NO_DECO) && decorations_enable)
if(!(pixel_mode & NO_DECO))
{
colr = (deca*decr + (255-deca)*colr) >> 8;
colg = (deca*decg + (255-deca)*colg) >> 8;
colb = (deca*decb + (255-deca)*colb) >> 8;
}
if((pixel_mode & DECO_FIRE) && decorations_enable)
if(pixel_mode & DECO_FIRE)
{
firer = (deca*decr + (255-deca)*firer) >> 8;
fireg = (deca*decg + (255-deca)*fireg) >> 8;
@ -2299,7 +2310,8 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
display_mode(0),
render_mode(0),
colour_mode(0),
gridSize(0)
gridSize(0),
blackDecorations(false)
{
this->g = g;
this->sim = sim;

View File

@ -43,6 +43,7 @@ public:
bool gravityZonesEnabled;
bool gravityFieldEnabled;
int decorations_enable;
bool blackDecorations;
Simulation * sim;
Graphics * g;
gcache_item *graphicscache;

View File

@ -17,7 +17,8 @@ SaveRenderer::SaveRenderer(){
g = new Graphics();
sim = new Simulation();
ren = new Renderer(g, sim);
ren->decorations_enable = false;
ren->decorations_enable = true;
ren->blackDecorations = true;
#if defined(OGLR) || defined(OGLI)
glEnable(GL_TEXTURE_2D);
@ -52,7 +53,8 @@ Thumbnail * SaveRenderer::Render(GameSave * save, bool decorations)
if(!sim->Load(save))
{
ren->decorations_enable = decorations;
ren->decorations_enable = true;
ren->blackDecorations = !decorations;
#if defined(OGLR) || defined(OGLI)
pixel * pData = NULL;
unsigned char * texData = NULL;