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

ShowPicture: Support empty names #2523

Merged
merged 3 commits into from
Aug 8, 2021
Merged

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented May 5, 2021

Yume2kki 0.116 started to show a picture with no filename on the PC-wallpaper map.

No idea why they are doing this but when this is not filtered it unloads a black picture that is used for a background effect.

See #2519

a

@purupurupuruin

@Ghabry Ghabry added the Pictures label May 5, 2021
@Ghabry Ghabry added this to the 0.7.0 milestone May 5, 2021
@purupurupuruin
Copy link

purupurupuruin commented May 5, 2021

I tried it but something weird happens, when I select a wallaper to preview it and cancel out the background effect doesn't come back.

@Ghabry
Copy link
Member Author

Ghabry commented May 5, 2021

You are right :(
So this is not the only issue.

@fdelapena
Copy link
Contributor

Not sure if related to the bug mentioned below and RPG_RT version used:

if (Player::IsRPG2k() && started_with_no_effect) {
// Possibly a bug(?) in RM2k: if Show Picture command has no
// effect, a Move Picture command cannot add one
return;
}

This is a quirk abused by Yume2kki 0.116 which started to show a picture with no filename on the PC-wallpaper map.

No idea why they are doing this but when this is not filtered it unloads a black picture that is used for a background effect.

See EasyRPG#2519
Because "empty name" is not a criteria for not rendering anymore this is necessary.

Also reduces memory usage because unused images are not keeping there buffer active anymore.
@Ghabry Ghabry changed the title Filter pictures with no name ShowPicture: Support empty names Aug 7, 2021
@Ghabry
Copy link
Member Author

Ghabry commented Aug 7, 2021

There were multiple minor differences to RPG_RT that made this incompatible:

  1. ShowPicture in RPG_RT will apply all the parameters but won't touch the image buffer when the filename is empty (whatever was in the image buffer is used)
  • Player hid the image and then did nothing
  • I still hide the image for the "file has name case" due to Async loading (is made visible right after Async loading as before)
  1. RPG_RT will render images with empty names
  • Player aborted the rendering here
  1. ErasePicture in RPG_RT will unload the image (and allocate a new image with 0 bytes, but this doesn't matter)
  • Player only hid the sprite. This is actually bad because this means the reference is never lost until the picture is replaced -> waste of memory
  1. Because ErasePicture unloads the image the combination of ShowPicture(1, "Image"), ErasePicture(1), ShowPicture(1, "") will show nothing after the 2nd ShowPicture. (both RPG_RT and Player already did this, just discussing an edgecase here)

With all these behaviours matching now the effect in the wallpaper select works.


@purupurupuruin pls test, works for me ;)

@purupurupuruin
Copy link

Tested it, works perfectly as far as I can tell!

@carstene1ns carstene1ns merged commit 538cf74 into EasyRPG:master Aug 8, 2021
@Ghabry Ghabry deleted the issue-2519 branch February 22, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants