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

Trophy img #19

Closed
wants to merge 2 commits into from
Closed

Trophy img #19

wants to merge 2 commits into from

Conversation

nishinji
Copy link
Owner

@nishinji nishinji commented Jul 6, 2024

No description provided.

Copy link

coderabbitai bot commented Jul 6, 2024

Walkthrough

The recent updates enhance the application by introducing a configurable screenshot format (supporting JPEG and PNG) and enabling the option to disable motion input for controllers. The GUI has been improved to display motion support status alongside a checkbox for toggling motion functionality. These enhancements collectively aim to provide a more customizable and user-friendly experience for managing screenshots and controller input.

Changes

File Path(s) Change Summary
vita3k/config/include/config/... Introduced enum ScreenshotFormat with values None, JPEG, PNG, added a configuration option screenshot-format, and changed the default value for display-info-message from true to false.
vita3k/ctrl/include/ctrl/state.h, vita3k/ctrl/src/ctrl.cpp, vita3k/modules/SceDriverUser/SceMotion.cpp Added tracking for motion support in controllers and modified functions to respect the new configuration settings for motion functionality.
vita3k/gui/src/controllers_dialog.cpp Enhanced controller dialog to display motion support and added a "Disable Motion" checkbox for user interaction.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GUI
    participant Config
    participant Screenshot

    User->>GUI: Open Settings Dialog
    GUI-->>Config: Fetch `screenshot-format`
    Config-->>GUI: Return default (JPEG)

    User->>GUI: Select `PNG`
    GUI-->>Config: Update `screenshot-format`

    User->>Screenshot: Take Screenshot
    Screenshot->>Config: Fetch `screenshot-format`
    Config-->>Screenshot: Return `PNG`
    Screenshot-->>User: Save screenshot as PNG
Loading

This diagram illustrates the interaction flow as the user selects a screenshot format and takes a screenshot, demonstrating how the configuration influences the output.


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e0b9f5f and 604f93b.

Files selected for processing (5)
  • vita3k/config/include/config/config.h (3 hunks)
  • vita3k/ctrl/include/ctrl/state.h (1 hunks)
  • vita3k/ctrl/src/ctrl.cpp (1 hunks)
  • vita3k/gui/src/controllers_dialog.cpp (3 hunks)
  • vita3k/modules/SceDriverUser/SceMotion.cpp (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • vita3k/config/include/config/config.h
  • vita3k/gui/src/controllers_dialog.cpp
Additional comments not posted (4)
vita3k/ctrl/include/ctrl/state.h (1)

61-61: LGTM!

The addition of the controllers_has_motion_support array enhances the state management of controllers by tracking motion support for each controller. The initialization to false ensures a consistent default state.

vita3k/modules/SceDriverUser/SceMotion.cpp (2)

Line range hint 85-95:
LGTM!

The updated conditional logic in sceMotionGetSensorState ensures that motion data is retrieved only when motion support is present and motion functionality is not disabled in the configuration. This improves the robustness of the code.


Line range hint 118-138:
LGTM!

The updated conditional logic in sceMotionGetState ensures that motion state is retrieved only when motion support is present and motion functionality is not disabled in the configuration. This improves the robustness of the code.

vita3k/ctrl/src/ctrl.cpp (1)

99-99: LGTM!

The update to the refresh_controllers function correctly sets the controllers_has_motion_support array based on the presence of both gyro and accelerometer sensors. This enhances the functionality of the controller state management.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 1

Outside diff range and nitpick comments (2)
vita3k/ctrl/include/ctrl/state.h (1)

61-61: Add a comment to explain the purpose of the new array.

The new array controllers_has_motion_support tracks motion support status for each controller. Adding a comment would improve code readability.

// Tracks motion support status for each controller
bool controllers_has_motion_support[SCE_CTRL_MAX_WIRELESS_NUM] = { false, false, false, false };
vita3k/gui/src/settings_dialog.cpp (1)

931-931: Add a comment to explain the new section.

Adding a comment to explain the new section for selecting the screenshot image type would improve readability and maintainability.

// Section for selecting the screenshot image type

Comment on lines +936 to +937
const char *LIST_IMG_FORMAT[] = { "NULL", "JPEG", "PNG" };
ImGui::Combo("Screenshot format", &emuenv.cfg.screenshot_format, LIST_IMG_FORMAT, IM_ARRAYSIZE(LIST_IMG_FORMAT));
Copy link

Choose a reason for hiding this comment

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

Consider refining the format selection options.

The first option "NULL" might be confusing. Consider renaming it to "None" to be consistent with the enum values.

- const char *LIST_IMG_FORMAT[] = { "NULL", "JPEG", "PNG" };
+ const char *LIST_IMG_FORMAT[] = { "None", "JPEG", "PNG" };
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const char *LIST_IMG_FORMAT[] = { "NULL", "JPEG", "PNG" };
ImGui::Combo("Screenshot format", &emuenv.cfg.screenshot_format, LIST_IMG_FORMAT, IM_ARRAYSIZE(LIST_IMG_FORMAT));
const char *LIST_IMG_FORMAT[] = { "None", "JPEG", "PNG" };
ImGui::Combo("Screenshot format", &emuenv.cfg.screenshot_format, LIST_IMG_FORMAT, IM_ARRAYSIZE(LIST_IMG_FORMAT));

@nishinji nishinji force-pushed the trophy_img branch 3 times, most recently from 11347bb to 7e4c12d Compare July 6, 2024 14:49
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.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
vita3k/gui/src/settings_dialog.cpp (1)

931-931: Add spacing for better readability.

Adding spacing before the separator improves readability and maintains consistency with other sections.

+ ImGui::Spacing();

@nishinji nishinji force-pushed the trophy_img branch 4 times, most recently from 6e4eb9f to 0bdbf7c Compare July 19, 2024 18:14
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.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
vita3k/gui/src/manual.cpp (1)

171-172: Document the change in mouse button interaction.

The mouse button used to toggle the visibility of the button has been changed from left-click to right-click. Ensure this change is documented in the user manual or release notes to inform users.

@nishinji nishinji force-pushed the trophy_img branch 4 times, most recently from 9532e11 to 108bab1 Compare July 24, 2024 01:37
@nishinji nishinji force-pushed the trophy_img branch 2 times, most recently from e59bace to e0b9f5f Compare August 6, 2024 09:44
- Add option to disable motion
- Add jpeg format support for screenshots
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