[Bugfix] A transition into the first scene leaves mcrfpy.current_scene as None for the whole transition #379
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#379
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
If
mcrfpy.default_transitionis configured before any scene has ever been active,activating the first scene starts a transition from nothing — and
mcrfpy.current_scenereadsNonefor the entire duration.For a scene→scene transition the current behaviour is defensible:
current_scenekeeps reporting the outgoing scene until the transition completes, so "current"
means "what is on screen". But when there is no outgoing scene, that convention
yields
None, and the engine spends a full second with no current scene at all.Cause
GameEngine::changeScene(name, type, duration)(src/GameEngine.cpp:252) only takesthe immediate path when
transitionType == None || duration <= 0. Otherwise it callstransition.start(type, scene, sceneName, duration)withscene— the outgoing scenename — which is
""at startup. It then renders the outgoing scene to a texture(
currentScene()->render()), which has nothing to render.Fix
A transition with no outgoing scene has nothing to transition from. Take the
immediate path when the outgoing scene is empty/unknown.
How it was found
By the new
tests/snippets/gate — the documentation snippets frommcrogueface.github.io, now executed as part of the suite.
062_scene_transition_fade.pyand
063_scene_transition_slide.pyboth configure a transition and then activate theirfirst scene, which is the natural way to write that sample. They are correct; the engine
is wrong. This is the first bug the snippet gate has caught, and it was reachable only
after #350 taught headless
step()to progress transitions.Acceptance
current_sceneset tothat scene immediately