From 7e862cd63e511f2b7597506f68d88fa30937027b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 7 Feb 2020 00:10:36 +0900 Subject: [PATCH] GPU: Texture bit should be ignored when drawing lines Fixes line flickering in Vagrant Story. --- src/core/gpu.h | 5 ++++- src/core/gpu_hw.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/gpu.h b/src/core/gpu.h index 23d4d1ade..331a99b78 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -208,7 +208,10 @@ protected: BitField shading_enable; // 0 - flat, 1 = gouroud BitField primitive; - // Returns true if dithering should be enabled. Depends on the primitive type. + /// Returns true if texturing should be enabled. Depends on the primitive type. + bool IsTexturingEnabled() const { return (primitive != Primitive::Line) ? texture_enable : false; } + + /// Returns true if dithering should be enabled. Depends on the primitive type. bool IsDitheringEnabled() const { switch (primitive) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 9227b14b7..eb8ecdcde 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -274,7 +274,7 @@ void GPU_HW::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices, const u32* command_ptr) { TextureMode texture_mode; - if (rc.texture_enable) + if (rc.IsTexturingEnabled()) { // texture page changed - check that the new page doesn't intersect the drawing area if (m_draw_mode.IsTexturePageChanged())