int OnEffect::DrawEffectBackground(const Effect *e, int x1, int y1, int x2, int y2, DrawGLUtils::xlVertexColorAccumulator &bg) { if (e->HasBackgroundDisplayList()) { DrawGLUtils::DrawDisplayList(x1, y1, x2-x1, y2-y1, e->GetBackgroundDisplayList(), bg); return e->GetBackgroundDisplayList().iconSize; } xlColor start; xlColor end; GetOnEffectColors(e, start, end); bg.AddVertex(x1, y1, start); bg.AddVertex(x1, y2, start); bg.AddVertex(x2, y2, end); bg.AddVertex(x2, y2, end); bg.AddVertex(x2, y1, end); bg.AddVertex(x1, y1, start); return 2; }
int MorphEffect::DrawEffectBackground(const Effect *e, int x1, int y1, int x2, int y2, DrawGLUtils::xlVertexColorAccumulator &backgrounds) { int head_duration = e->GetSettings().GetInt("E_SLIDER_MorphDuration", 20); xlColor start_h; xlColor end_h; xlColor start_t; xlColor end_t; GetMorphEffectColors(e, start_h, end_h, start_t, end_t); int x_mid = (int)((float)(x2-x1) * (float)head_duration / 100.0) + x1; backgrounds.AddHBlendedRectangle(start_h, end_h, x1, y1+1, x_mid, y2-1); if(e->GetPaletteSize() <= 4) { backgrounds.AddHBlendedRectangle(start_t, end_t, x_mid, y1+4, x2, y2-4); } else { backgrounds.AddHBlendedRectangle(e->GetPalette(), x_mid, y1+4, x2, y2-4, 2); } return 0; }
int ShockwaveEffect::DrawEffectBackground(const Effect *e, int x1, int y1, int x2, int y2, DrawGLUtils::xlVertexColorAccumulator &backgrounds) { backgrounds.AddHBlendedRectangle(e->GetPalette(), x1, y1, x2, y2); return 2; }