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

Passing through door Styx -> [Redacted] white transition clipping #4

Closed
Tracked by #1
nbusseneau opened this issue Sep 1, 2021 · 2 comments
Closed
Tracked by #1
Labels
bug Something isn't working enhancement New feature or request

Comments

@nbusseneau
Copy link
Owner

nbusseneau commented Sep 1, 2021

LoadBackgroundColor.mp4

The initial load screen (white) scales correctly but is then clipped for a second (I've switched it from white to red for the video, so that we can see it easily) before returning to a proper state (white again).

  1. [Lua] ExitToHadesPresentation runs FadeOut({ Color = Color.White, Duration = 2 })
    • Triggered due to ObstacleData.TravelDoor01.ExitFunctionName = "ExitToHadesPresentation"
  2. [Engine] mLoadBackgroundColor displayed
    • RoomSetData.Styx.D_Boss01.LoadBackgroundColor = Color.White is loaded to world->mLoadBackgroundColor via LoadMap
  3. [Lua] RoomEntranceHades takes over with FadeOut({ Color = Color.White, Duration = 0 })
    • Triggered due to RoomSetData.Styx.D_Boss01.EntranceFunctionName = "RoomEntranceHades"

Funnily enough, the Styx -> [Redacted] transition is the only room that specifies a LoadBackgroundColor (all others default to the engine-side black default value for world->mLoadBackgroundColor), so I'm actually pondering if it's even worth investing time to look into it considering the difficulty for such a small issue.

More details

RoomManager.lua line 5102:

LoadMap({ Name = nextRoom.Name, ResetBinks = previousRoom.ResetBinksOnExit or currentRun.CurrentRoom.ResetBinksOnEnter, LoadBackgroundColor = currentRun.CurrentRoom.LoadBackgroundColor })

LoadBackgroundColor is then retrieved from ScriptAction::LoadMap:

unknown

And later passed to world:

unknown

Afterwards World::RequestBegin is called:

unknown

Color is retrieved later in World::Begin:

unknown

And passed to World::LoadNextMap:

unknown

It is passed to a struct of type GameScreen as its mFullscreenSpriteEffect field, and that's where I can't seem to progress further:

unknown

I suspect GameScreen::DrawFaded to be involved, as it re-uses mFullscreenSpriteEffect, but my testing so far is inconclusive:

unknown

I find it really strange that this specific overlay/texture does not scale to the whole viewport. It is as if it used some kind of custom calculations, e.g "get current height then multiply by 16:9 to get width", instead of getting both height/width.

@nbusseneau nbusseneau mentioned this issue Sep 1, 2021
16 tasks
@nbusseneau nbusseneau changed the title Passing through door Styx -> [Redacted] white flash clipping Passing through door Styx -> [Redacted] white transition clipping Sep 1, 2021
@nbusseneau nbusseneau added enhancement New feature or request bug Something isn't working labels Sep 1, 2021
@nbusseneau
Copy link
Owner Author

Turns out it was in LoadScreen::Draw:

DrawRectangle is called with a static rect, coming from data:

hex -> float
0x44f0 = 1920.0
0x4487 = 1080.0

After patch, the intermediate load screen is now scaled correctly 👌🏻

@nbusseneau
Copy link
Owner Author

nbusseneau commented Sep 3, 2021

Fixed by baf1e6b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant