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

Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Shift key sprint; Cutscene window resize; Gamma slider #165

Merged
merged 25 commits into from
Sep 2, 2018

Conversation

donnierussellii
Copy link
Contributor

@donnierussellii donnierussellii commented Aug 31, 2018

Clicking captured mouse cursor on window resize border (why is this allowed by SDL?) in windowed, non-mouselook mode, then switching to mouselook mode causes mouselook to behave erratically.

When capturing mouse, now also disable window border drag resize. Also added hack to actually keep captured mouse cursor inside client area.

Edit1: Added a fix for mouselook drift when clicking. Mouselook now only checks actual mouse move events.

Edit2: Added fix for terrain elevator sound not stopping when reversing an already moving terr elevator.

Edit3: Don't play cutscene audio if sound is turned off in options. Before this fix, cutscene audio did not stop when skipping cutscene. Also set data member of snd_digi_parms to NULL; otherwise uninitialized.

Edit4: Fix for mouselook toggle making held object change to crosshair, while obj still held.

Edit5: Hack to allow pressing shift after move key. For example, while holding 'w', repeatedly press and release shift to alternately run and walk.

Edit6: Hide mouse cursor during cutscenes. The transparent area around the cursor is not drawing properly anyway.

Edit7: Don't change screen size during cutscenes or after exiting full map display, and make changing screen size smarter. Uncapture mouse during cutscenes.

Edit8: Fixed gamma slider in options and gamma update in game loop.

Edit9: Stop all sound channels when pausing.

Edit10: Compensate for difference in brightness between fullscreen and windowed mode. May be platform-specific--tested on Windows.

@donnierussellii donnierussellii changed the title Erratic mouselook bug fix Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio Aug 31, 2018
@donnierussellii donnierussellii changed the title Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj Aug 31, 2018
@donnierussellii donnierussellii changed the title Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Running with shift key; Cutscene window resize Sep 1, 2018
@donnierussellii donnierussellii changed the title Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Running with shift key; Cutscene window resize Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Shift key sprint; Cutscene window resize Sep 1, 2018
@@ -1165,7 +1165,7 @@ void pause_for_key(ulong wait_time) {
waiting_for_key = false;
}

void splash_draw() {
void splash_draw(bool show_splash) {
int pal_file;

Copy link
Owner

Choose a reason for hiding this comment

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

We could probably just return early here, would make the logic clearer to follow than all of the added if blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Changed it.

Copy link
Owner

@Interrupt Interrupt Sep 2, 2018

Choose a reason for hiding this comment

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

Might not have pushed that change, not seeing it in the commit log. Want to double check before I merge?

Edit: Nevermind, seeing it now!

@donnierussellii
Copy link
Contributor Author

donnierussellii commented Sep 1, 2018 via email

During gamma slide, screen now visibly gammas; but after closing options, visible gamma goes back to default. Slider remains where set. Gamma preference goes back to default on each program run--is it saved to disk?
@donnierussellii donnierussellii changed the title Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Shift key sprint; Cutscene window resize Bugfixes: Erratic mouselook; Terrain elevator nonstop sound; Cutscene audio; Mouselook held obj; Shift key sprint; Cutscene window resize; Gamma slider Sep 2, 2018
@Interrupt
Copy link
Owner

Interrupt commented Sep 2, 2018

This is some good work, awesome stuff! Did find a bug in this: alt+enter no longer goes fullscreen on OSX, it just maximizes the window. Mouse look in that maximized window mode also only moves the view vertically, it's not possible to move the view back toward the ground.

Also:
On Windows fullscreen brightness is higher than windowed, so we compensate; other platforms?
@donnierussellii
Copy link
Contributor Author

I changed the fullscreen code back to use SDL_SetWindowFullscreen. I also added a hack to ensure the captured mouse cursor stays inside the client area.

I need some feedback on this: On my Windows system, fullscreen mode displays brighter than windowed. This is not related to the gamma setting--that changes the palette. When the gamma is set to max, fullscreen mode is extremely bright and windowed is merely bright.

So I set the brightness to 0.5 when fullscreen, and 1.0 when windowed to compensate. Is this behavior the same on other platforms (or other Windows systems)? I can put in an ifdef for Windows only if needed.

@Interrupt
Copy link
Owner

Interrupt commented Sep 2, 2018

On OSX with this hack things are super dark in Fullscreen, so you might want to do that. Didn't notice my fullscreen being super bright on my Windows box though.

Edit: Going to merge this, but will back out that SDL_SetWindowBrightness for now.

@Interrupt Interrupt merged commit 92579d5 into Interrupt:master Sep 2, 2018
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.

None yet

2 participants