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

Buggy cursor graphic when capturing the game RuneScape #3472

Closed
windwakr opened this issue Sep 15, 2020 · 6 comments
Closed

Buggy cursor graphic when capturing the game RuneScape #3472

windwakr opened this issue Sep 15, 2020 · 6 comments
Labels
Confirmed This bug report has been confirmed by project members Windows Affects Windows

Comments

@windwakr
Copy link
Contributor

Platform

Operating system and version: Windows 7 64bit
OBS Studio version: 25.0.08

Expected Behavior

I expect the cursor to appear correctly in the recorded video.

Current Behavior

The cursor appears buggy in the recorded video.

Steps to Reproduce

  1. Download the client for RuneScape and start it up. The game dynamically downloads its cache, so the download here should be small. https://www.runescape.com/download
  2. You do not need to make an account or log in, as the issue is apparent at the log in screen.
  3. Click the gear in the top right of the login window and make sure custom cursors are enabled.
  4. Capture the game and you will see the buggy cursor in the recorded video.

Additional information

This problem has been around for a long time. You can find videos on YouTube from years ago with this buggy cursor.
Untitled

The game does have the option to disable custom cursors, but that's less than desirable.

@Fenrirthviti
Copy link
Member

Can you confirm if this happens on supported operating system, such as Windows 10?

@WizardCM
Copy link
Member

I can confirm this occurs on 25.0.8 on Windows 10 2004.

image

We don't do anything special with cursors, but we're currently tracking cursor issues in #2604

@windwakr
Copy link
Contributor Author

windwakr commented Sep 15, 2020

I believe I've found the source of this problem.
In plugins/win-capture/cursor-capture.c the functions copy_from_color, apply_mask, and bit_to_alpha do not take into account potential padding on the mask. This cursor is 13x19 pixels, but there's 16x19 pixels of data in the mask. There's padding to bmWidthBytes.

Mask data interpreted as 13x19 vs 16x19. Looks familiar?
Untitled

@windwakr
Copy link
Contributor Author

windwakr commented Sep 15, 2020

In addition to one or more of the above mentioned functions needing fixing, so does get_bitmap_data. It doesn't allocate enough memory for the whole mask.

Edit: I think for this function you could just do unsigned int size = bmp->bmHeight * bmp->bmWidthBytes; instead of all the calculation it's doing.

@windwakr
Copy link
Contributor Author

Sorry for being a bit spammy, but just wanted to confirm that the previous posts are correct about the source of the issue. I was able to do some actual testing with OBS.
I created a fork at https://github.com/windwakr/obs-studio/tree/cursorfix which shows two changes I made to make this function correctly. I'm not sure if this is the best way to go about this, though.
cursors

@WizardCM
Copy link
Member

@windwakr Awesome work! My personal suggestion would be to submit a PR (tweak the commit titles to match the guidelines & clang-format the changes), and that way the fix itself can be discussed properly in a PR.

@WizardCM WizardCM added Confirmed This bug report has been confirmed by project members Windows Affects Windows labels Sep 20, 2020
@windwakr windwakr closed this as completed Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed This bug report has been confirmed by project members Windows Affects Windows
Projects
None yet
Development

No branches or pull requests

3 participants