void TBRendererBatcher::DrawRectFill(const TBRect &dst_rect, const TBColor &color) { if (dst_rect.IsEmpty()) return; uint32 a = (color.a * m_opacity) / 255; AddQuadInternal(dst_rect.Offset(m_translation_x, m_translation_y), TBRect(), VER_COL(color.r, color.g, color.b, a), nullptr, nullptr); }
void TBRendererBatcher::DrawRect(const TBRect &dst_rect, const TBColor &color) { if (dst_rect.IsEmpty()) return; // Top DrawRectFill(TBRect(dst_rect.x, dst_rect.y, dst_rect.w, 1), color); // Bottom DrawRectFill(TBRect(dst_rect.x, dst_rect.y + dst_rect.h - 1, dst_rect.w, 1), color); // Left DrawRectFill(TBRect(dst_rect.x, dst_rect.y + 1, 1, dst_rect.h - 2), color); // Right DrawRectFill(TBRect(dst_rect.x + dst_rect.w - 1, dst_rect.y + 1, 1, dst_rect.h - 2), color); }