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

Fixed issue 580 #582

Closed
wants to merge 3 commits into from
Closed

Fixed issue 580 #582

wants to merge 3 commits into from

Conversation

1bsyl
Copy link

@1bsyl 1bsyl commented Apr 10, 2021

This should fixed the issue #580

  • Don't use SDL_surface 'refcount', but 'userdata'
  • Use imgref and not imgref + 1

bob-beck pushed a commit to openbsd/ports that referenced this pull request Apr 12, 2021
Upstream issue: TurningWheel/Barony#580

SDL bisect done by Nam Nguyen to find which SDL change introduced the
texture issue in Barony.

Barony fix sent upstream by Sylvain Becker
TurningWheel/Barony#582

Patches for the port done by Nam Nguyen <namn at berkeley.edu>

thanks everyone for fixing this issue

ok sthen@ brynet@ and maintainer (David Carlier)
Copy link
Collaborator

@SheridanR SheridanR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, well done.

epsilon-0 pushed a commit to epsilon-0/openbsd-ports that referenced this pull request May 10, 2021
Upstream issue: TurningWheel/Barony#580

SDL bisect done by Nam Nguyen to find which SDL change introduced the
texture issue in Barony.

Barony fix sent upstream by Sylvain Becker
TurningWheel/Barony#582

Patches for the port done by Nam Nguyen <namn at berkeley.edu>

thanks everyone for fixing this issue

ok sthen@ brynet@ and maintainer (David Carlier)
epsilon-0 pushed a commit to epsilon-0/openbsd-ports that referenced this pull request May 10, 2021
Upstream issue: TurningWheel/Barony#580

SDL bisect done by Nam Nguyen to find which SDL change introduced the
texture issue in Barony.

Barony fix sent upstream by Sylvain Becker
TurningWheel/Barony#582

Patches for the port done by Nam Nguyen <namn at berkeley.edu>

thanks everyone for fixing this issue

ok sthen@ brynet@ and maintainer (David Carlier)
@perkinslr
Copy link

Commit ce9b618 breaks the minimap (corrupted texture, eventual segfault) if I apply this patch to the 3.3.4 branch (last version available via Humble). If it doesn't break later versions, that's fine, this comment will hopefully help anyone else in my position. But it's also probably worth double-checking that it doesn't corrupt the minimap in the current master and 3.3.7 branch (just start a new game, if there's a problem, you'll get "static" on the bottom half of the minimap).

Without this commit, I haven't noticed any other issues, so I'm not sure what problem it is supposed to solve. That said, the rest of this PR works as intended (and thanks for fixing the broken textures!)

@1bsyl
Copy link
Author

1bsyl commented Jun 7, 2021

@perkinslr
about ce9b618

You can test the issue with latest (head) SDL_ttf, or simulate it by creating an intermediate surface with pitch != width

Though, the patch may be wrong because:

  • GL_UNPACK_ROW_LENGTH is by default in OpenGL whereas it's a only an extension for OpenGL ES2.
  • this was assumed that bytes per pixel is 4 ...

To solve some potential issue, you can also manually pack the surface, if needed.
like:
https://github.com/libsdl-org/SDL/blob/main/src/render/opengles2/SDL_render_gles2.c#L1503

WALLOFJUSTICE pushed a commit to WALLOFJUSTICE/Barony that referenced this pull request Nov 3, 2021
* ignore commit for unpack alignment as seems to just break things
TurningWheel@ce9b618
@1bsyl 1bsyl closed this by deleting the head repository Dec 17, 2022
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.

3 participants