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

SLUDGE: Fix shadow flickering in frasse #5446

merged 1 commit into from Nov 18, 2023


Copy link

@polyesterswing polyesterswing commented Nov 18, 2023

Summary by CodeRabbit

  • New Features

    • Implemented a new stable sorting method to enhance the consistency of list ordering.
  • Bug Fixes

    • Resolved an issue where items would flicker during sorting in the user interface.

Copy link

coderabbitai bot commented Nov 18, 2023


The update introduces a new bubble_sort function to ensure stable sorting, which maintains the order of equivalent elements. This change addresses an issue where equal elements caused visual flickering due to their positions being shuffled. The shufflePeople function within the PeopleManager now leverages this stable sorting method to enhance the user interface's consistency.


File(s) Change Summary
engines/sludge/people.cpp Added a bubble_sort function template for stable sorting and updated shufflePeople to use this new method.

🐇 In the code where people dwell, 🍂
A bubble sort casts its stable spell.
No more flicker, no more flight,
In sorted order, all is right. ✨


Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b7d9e78 and 3ead540.
Files selected for processing (1)
  • engines/sludge/people.cpp (1 hunks)
Additional comments: 1
engines/sludge/people.cpp (1)
  • 498-498: Using bubble_sort instead of Common::sort is a logical change to address the issue of shadow flickering due to the instability of the previous sorting algorithm. This change should ensure that the drawing order of characters with the same y value remains consistent across frames, which is important for preventing visual artifacts like flickering shadows.

engines/sludge/people.cpp Outdated Show resolved Hide resolved
Opening the action menu would cause frasse's shadow to flicker. It would
go on top and below the sprite.
Copy link

sev- commented Nov 18, 2023

Thank you!

@sev- sev- merged commit cc714bd into scummvm:master Nov 18, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants