MantisBT - VCMI
View Issue Details
0001064VCMIGUI - Otherpublic2012-08-31 22:582014-05-30 17:41
Zamolxis 
Tow 
normalminoralways
closedfixed 
0.89 
0.9 
0001064: Audio-video settings don't take effect anymore while the client is open
Probably not all, but certain audio-video settings don't take effect anymore (since 0.88) while the client is open, but only after I restart the application. Some examples:

- changing the music / effects volume (not only don't they change instantly, but if you close System Options and open it again, you see the previous selection)

- F4 for full screen enable / disable

- new resolutions from System Options

All these only take effect after I close and reopen the application (e.g.: next time starts in full screen if I used F4 in the previous session, apparently with no effect at the time).
No tags attached.
Issue History
2012-08-31 22:58ZamolxisNew Issue
2012-08-31 23:00ZamolxisDescription Updatedbug_revision_view_page.php?rev_id=1875#r1875
2012-08-31 23:28IvanNote Added: 0002970
2012-09-01 00:04ZamolxisNote Added: 0002971
2012-09-01 06:32IvanNote Added: 0002972
2012-09-06 00:48TowNote Added: 0002976
2012-09-06 08:20IvanNote Added: 0002977
2012-09-06 08:20IvanNote Edited: 0002977bug_revision_view_page.php?bugnote_id=2977#r1886
2012-09-06 10:12TowNote Added: 0002978
2012-09-06 10:27TowNote Added: 0002979
2012-09-06 10:36TowStatusnew => resolved
2012-09-06 10:36TowFixed in Version => 0.9
2012-09-06 10:36TowResolutionopen => fixed
2012-09-06 10:36TowAssigned To => Tow
2012-09-06 11:16IvanNote Added: 0002981
2012-09-06 11:16IvanNote Edited: 0002981bug_revision_view_page.php?bugnote_id=2981#r1888
2012-09-07 23:19TowNote Added: 0002983
2012-09-09 07:54ZamolxisNote Added: 0002999
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0002970)
Ivan   
2012-08-31 23:28   
Resolution takes effect only after restart. But everything else including fullscreen should work immediately. And it does at least for me.

Not sure what's wrong here. Saving is a result of some change in settings - no changes in settings means that game won't save config structure.

Check if "new creature window" switch works without restarting. It uses a bit different code so it may behave differently.
(0002971)
Zamolxis   
2012-09-01 00:04   
Honestly, I found it suspicious myself that nobody would report this for so long. I re-booted the PC just in case, but no change.

To go back to your note:
- new creature window changes immediately between old and new
- also other changes take effect immediately, like the hex grid, etc
- about resolution, I knew it didn't take place immediately, but I thought that going through the Main Menu was enough, not go as far a restart. At least it worked from console so far, because - btw - now typing "resolution" in console does nothing (since 0.89 only)
- F4 and sound changes however really take no effect while the client is open
- I went back to previous releases, and I found it in 0.88 as well, but not before that

I thought for a moment it could be the extended graphics package which overwrites 1 json file, but that wouldn't explain why it occurs in 0.88 already. Could still be something related to my computer, but I can't figure out yet what else could it be.
(0002972)
Ivan   
2012-09-01 06:32   
"resolution" console command is disabled - with high-res menu changing resolution in runtime became a bit more complex. It is possible that someone will update code to allow this (or even make window resizeable) but not me or at least not now.

In 0.88 settings were moved from config.bin + settings.txt to settings.json with defaults in defaultSettings.json. Config system had no changes at all since 0.88 release - everything worked as it should.

Try deleting config/setting.json and config/settings.txt (if present). Don't see how this can affect anything though...
(0002976)
Tow   
2012-09-06 00:48   
I do also see the problem.
I looked into the code and I don't see any path leading from system options setting music volume into CMusicHandler::setVolume.
(0002977)
Ivan   
2012-09-06 08:20   
Look on CMusicHandler::listener member
It should call CMusicHandler::onVolumeChange() when configuration node changes. Change detection done via JsonNode comparison in Settings::~Settings()

Stacktrace on my side (calls from boost omitted, everything works)

0 CMusicHandler::setVolume
1 CMusicHandler::onVolumeChange
7 SettingsListener::nodeInvalidated
8 SettingsStorage::invalidateNode
9 Settings::~Settings
10 CSystemOptionsWindow::setMusicVolume
17 CHighlightableButtonsGroup::selectionChanged

(0002978)
Tow   
2012-09-06 10:12   
Right, missed ~Settings destructor path. Tricky! But for me when it gets into SettingsStorage::invalidateNode, the listeners set is empty. I'll debug it more later today.
(0002979)
Tow   
2012-09-06 10:27   
Or... I guess I know.

CMusicHandler constructor has initializer list entry for listerner:
    listener(settings.listen["general"]["music"])

But the settings.listen["general"]["music"] creates temporary, that creates by conversion SettingsListener temporary. When temporary gets created, it registers in the listeners set, when it gets destructed it removes itself.
But the actual CMusicHandler::listener member was created by copy constructor from that temporary and is not registered.

[I'm curious how it worked on GCC. Possibly because of default-generated move constructor?]

Should be fixed in r2873.
(0002981)
Ivan   
2012-09-06 11:16   
It is more like some kind of in-place construction:
http://pastebin.com/UpQnmSbh [^]

Copy constructor is unused, compiled in C++03 mode so move constructor is not an option.

No difference between clang\gcc or c++03\c++11

(0002983)
Tow   
2012-09-07 23:19   
I see, thanks for explanation. :)
(0002999)
Zamolxis   
2012-09-09 07:54   
Confirmed as fixed in 0.89b, but I'll check again in 0.9 before closing.