Opened 4 weeks ago

Last modified 4 weeks ago

#10897 new defect

ZVISION: Assertion fails on locales with decimal comma

Reported by: angstsmurf Owned by:
Priority: normal Component: Engine: ZVision
Keywords: Cc:
Game: Zork Grand Inquisitor


See and

When compiled on recent macOS and Xcode 10, Zvision games will fail with "Assertion failed: (scale > 0.0f), function setPanoramaScale, file engines/zvision/graphics/render_table.cpp, line 219" when trying to display the panorama screen. This is not the case when compiling on earlier systems, perhaps because libc++ is used instead of libstdc++.

This is likely to cause issues in other engines that use atof, sscanf("%f") and similar.

Change History (4)

comment:1 Changed 4 weeks ago by angstsmurf

I forgot to mention in the ticket description that this only happens when the system is set to Swedish, German or other languages that use decimal comma.

comment:2 Changed 4 weeks ago by eriktorbjorn

I thought ScummVM was supposed to set the locale to something language neutral. The SDL backend has this in OSystem_SDL::getSystemLanguage():

// Restore default C locale to prevent issues with
// portability of sscanf(), atof(), etc.
// See bug #3615148
setlocale(LC_ALL, "C");

Though maybe that's not used in the Mac version? I don't know...

comment:3 Changed 4 weeks ago by criezy

Thank you for creating this bug report. I saw the post on the forum but I can’t currently look at this as I am travelling for my work. Hopefully this will act as a reminder for me to look at this when I get back home (if nobody else finds the root of the issue in the meantime).

This seems indeed related to bug #6434 (3615148 in the old tracker) and the fix applied then was working. I have no idea why it breaks again on Mojave/ xcode 10 so this will need to be investigated. The switch to libc++ is indeed a possible reason for the change in behaviour.

comment:4 Changed 4 weeks ago by angstsmurf

I should also mention that I haven't seen anyone else reproduce this yet, so it might very well be something that is broken just on my system.

Note: See TracTickets for help on using tickets.