From 466e9a914bc8df825ed0e7a271da7ec92440cdd3 Mon Sep 17 00:00:00 2001 From: Lionel Flandrin Date: Mon, 25 Jan 2016 00:54:07 +0100 Subject: [PATCH] Scale line width with the internal upscaling --- README.md | 3 +++ rustation | 2 +- src/retrogl/gl_state/mod.rs | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 958b39d..4167531 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ This is an implementation of the [libretro](http://www.libretro.com/) API for the [Rustation PlayStation emulator](https://github.com/simias/rustation). +If you want to submit an issue please do so in the main Rustation +repository. I'm going to try to gather everything there. + ## Build You'll need [Rust and its package manager diff --git a/rustation b/rustation index 2aa7799..1daf4fa 160000 --- a/rustation +++ b/rustation @@ -1 +1 @@ -Subproject commit 2aa7799e5bb5b486004b8b711de26cae15e8071a +Subproject commit 1daf4faaade3c0fd1e9deace8e309e91303f1b46 diff --git a/src/retrogl/gl_state/mod.rs b/src/retrogl/gl_state/mod.rs index 1679053..4601e43 100644 --- a/src/retrogl/gl_state/mod.rs +++ b/src/retrogl/gl_state/mod.rs @@ -2,7 +2,7 @@ use std::rc::Rc; use std::default::Default; use gl; -use gl::types::{GLuint, GLint, GLsizei, GLenum}; +use gl::types::{GLuint, GLint, GLsizei, GLenum, GLfloat}; use arrayvec::ArrayVec; use libc::c_uint; use rustation::gpu::renderer::{Renderer, Vertex, PrimitiveAttributes}; @@ -289,6 +289,12 @@ impl State for GlState { self.apply_scissor(); + // In case we're upscaling we need to increase the line width + // proportionally + unsafe { + gl::LineWidth(self.internal_upscaling as GLfloat); + } + // Bind `fb_texture` to texture unit 0 self.fb_texture.bind(gl::TEXTURE0); } @@ -347,6 +353,10 @@ impl State for GlState { self.command_buffer.program() .uniform1ui("dither_scaling", dither_scaling).unwrap(); + unsafe { + gl::LineWidth(upscaling as GLfloat); + } + // If the scaling factor has changed the frontend should be // reconfigured. We can't do that here because it could // destroy the OpenGL context which would destroy `self` @@ -420,6 +430,7 @@ impl State for GlState { gl::UseProgram(0); gl::BindVertexArray(0); gl::BindFramebuffer(gl::DRAW_FRAMEBUFFER, 0); + gl::LineWidth(1.); } libretro::gl_frame_done(self.frontend_resolution.0,