Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use "renderer->viewport" in back-ends #5003

Merged
merged 3 commits into from Dec 2, 2021

Conversation

1bsyl
Copy link
Contributor

@1bsyl 1bsyl commented Nov 24, 2021

Before some future modification to viewport / cliprect, some "simplication".
Don't use "renderer->viewport" in back-ends but use the one that comes from SETVIEWPORT cmd

  • tested for the software renderer.
  • not tested for D3D11

@sezero
Copy link
Contributor

sezero commented Dec 7, 2021

We have -Wshadow warnings - is the following OK?

diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c
index 6ce921a..1aaffac 100644
--- a/src/render/software/SDL_render_sw.c
+++ b/src/render/software/SDL_render_sw.c
@@ -862,7 +862,6 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
 
                     /* Apply viewport */
                     if (drawstate.viewport->x || drawstate.viewport->y) {
-                        int i;
                         SDL_Point vp;
                         vp.x = drawstate.viewport->x;
                         vp.y = drawstate.viewport->y;
@@ -886,7 +885,6 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
 
                     /* Apply viewport */
                     if (drawstate.viewport->x || drawstate.viewport->y) {
-                        int i;
                         SDL_Point vp;
                         vp.x = drawstate.viewport->x;
                         vp.y = drawstate.viewport->y;

@1bsyl
Copy link
Contributor Author

1bsyl commented Dec 7, 2021

@sezero yes it's ok!

@sezero
Copy link
Contributor

sezero commented Dec 7, 2021

Applied

@1bsyl
Copy link
Contributor Author

1bsyl commented Dec 7, 2021

Thanks !

@icculus icculus modified the milestones: 2.0.22, 2.0.20 Dec 17, 2021
@1bsyl 1bsyl deleted the br_no_renderer_viewport_inbackends branch February 6, 2023 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants