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

tr2/decomp: fix windowed screenshots not working #1767

Merged
merged 6 commits into from
Oct 29, 2024
Merged

tr2/decomp: fix windowed screenshots not working #1767

merged 6 commits into from
Oct 29, 2024

Conversation

rr-
Copy link
Collaborator

@rr- rr- commented Oct 27, 2024

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change

Description

Resolves #1766.

@rr- rr- added OG bug A bug in original game TR2 labels Oct 27, 2024
@rr- rr- requested review from a team as code owners October 27, 2024 23:41
@rr- rr- requested review from lahm86, walkawayy and aredfan and removed request for a team October 27, 2024 23:41
@rr- rr- self-assigned this Oct 27, 2024
@rr-
Copy link
Collaborator Author

rr- commented Oct 27, 2024

This is mostly for testing, as screenshots in general will need a rewrite anyway.

Copy link

github-actions bot commented Oct 27, 2024

@walkawayy
Copy link
Collaborator

I get a black screen still even in fullscreen. But screenshots / screen recording has never worked for me while I'm stuck running in SW mode.

image

@aredfan
Copy link
Collaborator

aredfan commented Oct 28, 2024

  • In full screen, the s key takes several screenshots at once but these screenshots are good. It may be that the input isn't debouncing.
  • In windowed mode, the s key causes the game to crash but it does produce just one screenshot which is all pink.

My setup:
Screenshot

@rr-
Copy link
Collaborator Author

rr- commented Oct 28, 2024

@aredfan updated.

  • Fixed debouncing the "S" key
  • Fixed (hopefully) the pink tint and crash in the windowed mode
  • Changed the screenshots to be placed in /screenshots directory
  • Changed the screenshot names to include the current date, time and the level title; adding numeric suffixes in case there are conflicts (like in TR1X)
  • Changed the default screenshot format to be JPG (like in TR1X)
  • Added a configuration switch in the config tool to let the player use PNG instead

Since some parts were taken from TR1X and the code for both games was de-duplicated via libtrx, it makes sense to test TR1 as well.

@aredfan
Copy link
Collaborator

aredfan commented Oct 28, 2024

@rr- The s key debouncing and the crash issues are both fixed, thank you. The screenshot directory and names are working as expected too.

I came across these issues when testing the TR2X build.

  • The screenshots retain a pink tint when using windowed mode.
  • Switching to PNG format in config has no effect, the game continue to produce screenshots in JPEG format.
  • When I quit the game I get an error message, captured below.

Screenshot

@rr-
Copy link
Collaborator Author

rr- commented Oct 29, 2024

@aredfan the pink tint issue should be hopefully gone now. If you're still experiencing it, could you please share the relevant logs that resemble this format?

game/output.c 4527 Output_MakeScreenshot bit_count = 32
game/output.c 4528 Output_MakeScreenshot r mask = 00ff0000
game/output.c 4529 Output_MakeScreenshot g mask = 0000ff00
game/output.c 4530 Output_MakeScreenshot b mask = 000000ff

I've also fixed the stealthy bug with the settings. It was really nasty and could've unpredictably impacted wildly different parts of the game code, so I'm glad we identified it this early.

While I couldn't replicate the failed assertion, I made some tweaks that might help. Please let me know if you're still experiencing the problem. Thanks!

@rr- rr- added the Enhancement Improvement of an existing feature label Oct 29, 2024
@aredfan
Copy link
Collaborator

aredfan commented Oct 29, 2024

@rr- It's great news you were able to fix the stealthy bug early on, well done. I can also confirm that TR2X is now able to create PNG screenshots.

In windowed mode, the screenshots remain pink regardless of the selected screenshot format. Here's my log file: TR2X.log

I do still get the same failed assertion when quitting the game whether that's via the passport or /exit. I also made sure to check the latest dev snapshot and the issue is currently confined to this PR.

LMK if you need anything else.

The EnumMap module was shut down before the config could save the enum
option values.
@rr-
Copy link
Collaborator Author

rr- commented Oct 29, 2024

@rr- It's great news you were able to fix the stealthy bug early on, well done. I can also confirm that TR2X is now able to create PNG screenshots.

In windowed mode, the screenshots remain pink regardless of the selected screenshot format. Here's my log file: TR2X.log

I do still get the same failed assertion when quitting the game whether that's via the passport or /exit. I also made sure to check the latest dev snapshot and the issue is currently confined to this PR.

LMK if you need anything else.

I've identified the issue with the shutdown, and it should be now fixed.

Re: pink tint – looks like our machines report to be using identical pixel formats, but for some reason, my GPU uses RGB while yours actually uses BGR. I've changed the way we retrieve the pixel format to match what we use in FMVs. LMK if it's any better.

@aredfan
Copy link
Collaborator

aredfan commented Oct 29, 2024

@rr- The assertion failed message is gone now, thank you. 🎉

The game still produces pink tinted screenshots when in windowed mode. I made sure to have the FMV folder present in the game directory when testing the current PR build.

@rr-
Copy link
Collaborator Author

rr- commented Oct 29, 2024

@aredfan can you please try the most recent build?

Copy link
Collaborator

@aredfan aredfan left a comment

Choose a reason for hiding this comment

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

@rr- Yes of course. The TR2X screenshots are now fixed in windowed mode, thank you.

I also tested TR1X and the screenshots are working as expected. LGTM.

@aredfan aredfan linked an issue Oct 29, 2024 that may be closed by this pull request
Copy link
Collaborator

@walkawayy walkawayy left a comment

Choose a reason for hiding this comment

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

Everything works fine for me in fullscreen. I can't test windowed mode with the SW renderer.

@rr- rr- merged commit f8efbc9 into develop Oct 29, 2024
7 checks passed
@rr- rr- deleted the screenshots branch October 29, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement of an existing feature OG bug A bug in original game TR2
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TR2X: improve screenshot support OG bug: screenshots do not work in windowed mode
4 participants