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

Fix black backgrounds if bgs toggled after startup #116

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

drojf
Copy link
Contributor

@drojf drojf commented Dec 17, 2023

This PR fixes background only displaying for one frame, then changing to black, if graphics preset changed before reaching title screen, until game restarted.

I investigated this issue today. I think it has to do with this part of the code (which only exists in our mod I think):

public void ReloadTexture()
{
if (PrimaryName == string.Empty)
{
HideLayer();
}
else
{

On startup, there seems to exist a Layer which has PrimaryName set to String.Empty (normally PrimaryName is the texture name). However I think this layer disappears, or has its PrimaryName set, after the first time you call DrawSceneWithMask().

So if ReloadTexture() was called just after the game had started
running, and DrawSceneWithMask() had not yet been called, it would cause the above HideLayer() call to run, which I assume causes this weird behavior where the background will turn black one frame after being displayed (although I'm not sure why).

I tested removing the HideLayer() call and it seems to fix the issue. I'm pretty confident it won't break anything, since ReloadAllImages() (which calls ReloadTexture()) is only ever called when you change our graphics related mod options. So if you never change any graphics mod options, ReloadAllImages() is never called.

Worst case the user can restart their game to fix an issue (if this removal of HideLayer() causes an issue)

I have put the fix on the https://github.com/07th-mod/higurashi-assembly/compare/f-fix-corrupt-graphics branch

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.

1 participant