summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-05-29 18:47:53 +0200
committer ImJezze <jezze@gmx.net>2016-05-29 18:51:09 +0200
commit0e7755c88cd36b4f2e8834e7fa1892cc3479359f (patch)
tree3cab9ca81d55e8ce76867a6f33fd812432b68d28 /src/osd
parent0c83e22fe08be6540320462c70ac2bc18c0cdeaa (diff)
Vector line width is now applied by BGFX
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/render/drawbgfx.cpp14
-rw-r--r--src/osd/modules/render/drawbgfx.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index e4119c9bacd..e0966fdbd62 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -600,6 +600,18 @@ void renderer_bgfx::put_polygon(const float* coords, UINT32 num_coords, float r,
}
}
+void renderer_bgfx::put_packed_line(render_primitive *prim, ScreenVertex* vertex)
+{
+ float width = prim->width < 0.5f ? 0.5f : prim->width;
+ float x0 = prim->bounds.x0;
+ float y0 = prim->bounds.y0;
+ float x1 = prim->bounds.x1;
+ float y1 = prim->bounds.y1;
+ UINT32 rgba = u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255);
+
+ put_line(x0, y0, x1, y1, width, rgba, vertex, 1.0f);
+}
+
void renderer_bgfx::put_line(float x0, float y0, float x1, float y1, float r, UINT32 rgba, ScreenVertex* vertex, float fth)
{
float dx = x1 - x0;
@@ -919,7 +931,7 @@ renderer_bgfx::buffer_status renderer_bgfx::buffer_primitives(bool atlas_valid,
{
case render_primitive::LINE:
init_ui_view();
- put_line((*prim)->bounds.x0, (*prim)->bounds.y0, (*prim)->bounds.x1, (*prim)->bounds.y1, 1.0f, u32Color((*prim)->color.r * 255, (*prim)->color.g * 255, (*prim)->color.b * 255, (*prim)->color.a * 255), (ScreenVertex*)buffer->data + vertices, 1.0f);
+ put_packed_line(*prim, (ScreenVertex*)buffer->data + vertices);
vertices += 30;
break;
diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h
index 95d793ba931..91dcfae03c2 100644
--- a/src/osd/modules/render/drawbgfx.h
+++ b/src/osd/modules/render/drawbgfx.h
@@ -105,6 +105,7 @@ private:
void render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen);
void put_packed_quad(render_primitive *prim, UINT32 hash, ScreenVertex* vertex);
+ void put_packed_line(render_primitive *prim, ScreenVertex* vertex);
void put_polygon(const float* coords, UINT32 num_coords, float r, UINT32 rgba, ScreenVertex* vertex);
void put_line(float x0, float y0, float x1, float y1, float r, UINT32 rgba, ScreenVertex* vertex, float fth = 1.0f);