From 454db9d5d30a2688f355716507bf5bc43240b8f2 Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sat, 16 Apr 2016 15:46:04 +0200 Subject: [PATCH] Fixed texture coordinates for vector screen quad (nw) --- src/emu/render.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/emu/render.cpp b/src/emu/render.cpp index b2e4e02558a..6f42d26c3c7 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1890,8 +1890,39 @@ void render_target::add_container_primitives(render_primitive_list &list, const if (PRIMFLAG_GET_VECTORBUF(curitem.flags())) { + // flags S swap-xy, Y flip-y, X flip-x + // + // S Y X e.g. flips + // 0 0 0 asteroid !X !Y + // 0 0 1 - + // 0 1 0 speedfrk !X Y + // 0 1 1 solarq X Y + // 1 0 0 - + // 1 0 1 - + // 1 1 0 tempest !X Y + // 1 1 1 barrier !X !Y + + bool flip_x = (manager().machine().system().flags & ORIENTATION_FLIP_X) == ORIENTATION_FLIP_X; + bool flip_y = (manager().machine().system().flags & ORIENTATION_FLIP_Y) == ORIENTATION_FLIP_Y; + bool swap_xy = (manager().machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; + + int vectororient = 0; + if (flip_x) + { + vectororient |= ORIENTATION_FLIP_X; + } + if (flip_y) + { + vectororient |= ORIENTATION_FLIP_Y; + } + if (flip_x && flip_y && swap_xy) + { + vectororient ^= ORIENTATION_FLIP_Y; + vectororient ^= ORIENTATION_FLIP_X; + } + // determine the final orientation (textures are up-side down, so flip y-axis for vectors to immitate that behavior) - int finalorient = orientation_add(ORIENTATION_FLIP_Y, container_xform.orientation); + int finalorient = orientation_add(vectororient, container_xform.orientation); // determine UV coordinates prim->texcoords = oriented_texcoords[finalorient];