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

Map preview doesn't draw all tiles when using SDL2 #30

Closed
mmatyas opened this issue Jan 22, 2016 · 8 comments
Closed

Map preview doesn't draw all tiles when using SDL2 #30

mmatyas opened this issue Jan 22, 2016 · 8 comments
Labels
Milestone

Comments

@mmatyas
Copy link
Owner

mmatyas commented Jan 22, 2016

As reported here: #6 (comment)
Only happens with SDL2 build; after changing maps, only the background and the breakable blocks get drawn.

@mmatyas
Copy link
Owner Author

mmatyas commented Mar 21, 2016

Fixed!

@mmatyas mmatyas closed this as completed Mar 21, 2016
@HerbFargus
Copy link
Contributor

:D I will test this when I can.

@HerbFargus
Copy link
Contributor

Can confirm that it works. it plays in slowmotion on my raspberry pi though, sound is normal speed but the gameplay is maybe half the speed, not sure if its a memory thing or something specific to my pi, though I have no speed issues with the sdl1 builds on my pi.

@HerbFargus
Copy link
Contributor

I tested on my linux mint desktop and had no slowdown so it has something to do with the pi. I don't know why as the sdl2 builds before it was fixed didn't have any speed issues.

@mmatyas
Copy link
Owner Author

mmatyas commented Mar 23, 2016

Could you try a completely new build? The slowdown happened to me too, but a clean build fixed that. Whoops, turned out my build had some hacks too.

@mmatyas mmatyas reopened this Mar 23, 2016
@mmatyas
Copy link
Owner Author

mmatyas commented Mar 23, 2016

The following patch fixed the issue for me on an Odroid board, can you try this on RPi? If this works, I'll add a build flag to force SW rendering.

diff --git a/src/common/gfx/gfxSDL.cpp b/src/common/gfx/gfxSDL.cpp
index e55f638..81b2c85 100644
--- a/src/common/gfx/gfxSDL.cpp
+++ b/src/common/gfx/gfxSDL.cpp
@@ -114,7 +114,7 @@ void GraphicsSDL::create_game_window(bool fullscreen)
     void GraphicsSDL::create_renderer()
     {
         sdl2_renderer = SDL_CreateRenderer(sdl2_window, -1,
-            SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
+            SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE);
         if (!sdl2_renderer) {
             fprintf(stderr, "[gfx] Couldn't create renderer: %s\n", SDL_GetError());
             throw E_CREATE_RENDERER;

@HerbFargus
Copy link
Contributor

I'll give it a test right now and see if it works

@mmatyas
Copy link
Owner Author

mmatyas commented Mar 30, 2016

Fixed and running fast.

@mmatyas mmatyas closed this as completed Mar 30, 2016
@mmatyas mmatyas added this to the Beta milestone Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants