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; decg = (sim->parts[i].dcolour>>8)&0xFF;
decb = (sim->parts[i].dcolour)&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) if (graphicscache[t].isready)
{ {
@ -1226,16 +1237,16 @@ void Renderer::render_parts()
} }
//Apply decoration colour //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; colr = (deca*decr + (255-deca)*colr) >> 8;
colg = (deca*decg + (255-deca)*colg) >> 8; colg = (deca*decg + (255-deca)*colg) >> 8;
colb = (deca*decb + (255-deca)*colb) >> 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; firer = (deca*decr + (255-deca)*firer) >> 8;
fireg = (deca*decg + (255-deca)*fireg) >> 8; fireg = (deca*decg + (255-deca)*fireg) >> 8;
@ -2299,7 +2310,8 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
display_mode(0), display_mode(0),
render_mode(0), render_mode(0),
colour_mode(0), colour_mode(0),
gridSize(0) gridSize(0),
blackDecorations(false)
{ {
this->g = g; this->g = g;
this->sim = sim; this->sim = sim;

View File

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

View File

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