Fix missing particles in true color mode

This commit is contained in:
Magnus Norddahl 2016-06-12 00:50:43 +02:00
parent 351874be30
commit 42efc7334e
3 changed files with 12 additions and 2 deletions

View file

@ -570,12 +570,15 @@ public:
}
}
// Redirects all drawing commands to worker threads until Finish is called
// Redirects all drawing commands to worker threads until End is called
// Begin/End blocks can be nested.
static void Begin();
// Wait until all worker threads finished executing commands
// End redirection and wait until all worker threads finished executing
static void End();
// Waits until all worker threads finished executing
static void WaitForWorkers();
};
#endif

View file

@ -97,6 +97,11 @@ void DrawerCommandQueue::End()
queue->threaded_render--;
}
void DrawerCommandQueue::WaitForWorkers()
{
Instance()->Finish();
}
void DrawerCommandQueue::Finish()
{
auto queue = Instance();

View file

@ -2687,6 +2687,8 @@ void R_DrawParticle_RGBA(vissprite_t *vis)
R_DrawMaskedSegsBehindParticle(vis);
DrawerCommandQueue::WaitForWorkers();
uint32_t fg = shade_pal_index_simple(color, calc_light_multiplier(LIGHTSCALE(0, vis->Style.ColormapNum << FRACBITS)));
uint32_t fg_red = (fg >> 16) & 0xff;
uint32_t fg_green = (fg >> 8) & 0xff;