Formerly the GMM, AGI and SCI duplicated the logic for USE_SAVEGAME_TIMESTAMP.
Now I added a method to SaveLoadChooser instead, which takes care of this. This
might not be the best placement of such a functionality, thus I added a TODO
which talks about moving it to a better place.
This reduces the code duplication in all client code, which formerly duplicated
the querying of the plugin, game id etc. and now simply calls the newly added
method runModalWithCurrentTarget() on a SaveLoadChooser object.
We already pass the title and process button name to the constructor of
SaveLoadChooser and then do not offer any way of changing it, thus changing
the edit mode of the chooser is kind of pointless and was never actually used.
Instead we pass the mode on SaveLoadChooser construction now.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.
Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
Because the "clear" buttons are very different between themes (in
the Modern theme they have a graphical symbol, while in the Classic
theme they have a letter), they have to be removed and re-added
when reflowing the layout. This is patterned after how the
LauncherDialog class handles the larger changes in layout.
Removing widgets from a tab turned out to be trickier than I first
thought, so I had to move the removeWidget() method from Dialog to
GuiObject.
KYRA 1 PC-98 supports both modes in the same target. The desired mode can now be selected in the rendering options. We did have good support for the 16 colors mode of KYRA 1 already. This mode could not really be selected though (except by manually modifying the config file or the code).
This fixes bleeding of colours between different regions.
It also turns 'bevel' into an option that turns the stroke into a bevel,
and implements antialiased gradient-fills.
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'
This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
This fixes bug #3482461 "GUI: X image on clear buttons might be vanishing".
I am afraid I can't really tell why this fixes the bug though.
This is a backport of a small part of MaximRussia's changes to the queueing
code. So thanks to him for this fix.
The charsets used by the translations now need to have a "$(name).cp" file,
which contains an charset index => unicode mapping. Otherwise
create_translations will fail.
This adapts the related graphics code, which is the generic Font API and the
TTF font implementation.
It furthermore adapts the GUI to properly take care of kerning in text input
widgets.
Now we set the default localized font to the "text_default" font of the
currently active theme and default to the big GUI font in case none is
specified properly.
This because theoretically the GUI could be run without a dialog.
This also fixes the situations where the GUI keymap gets popped more times than pushed.
Thanks sev
This fixes a problem where opening the keymapper dialog would cause the current game
keymap to be displayed as the active keymap but then changing the keymap selection
back to it would cause the GUI keymap to be displayed as the active one. The GUI keymap
was indeed at the top of the stack but that's not the desired effect.
Also move the pushing and popping of the keymap to Dialog::Open/Close
Also constantify the GUI keymap name
This only fixes the clear button of the launcher's search. For the other clear
buttons this is would be a bit more work since they are embedded in tabs.
This is a regression from 77c65648b1.
Formerly the code used strtok to check for any audio related GUIO flag to be
present in _guioptions. Since strtok tokenizes the string this won't really
work. I changed it to use strpbrk, which searches a string for any character
from a set of characters (in our case flags). The code should now have the
same semantics as of before the above mentioned commit.
This also gets rid of copying the gui options into a char array and a strncpy
call.
When clearing an existant object clear() should be used.
When constructing objects (or using default values for parameters) the
constructor of String without any argument should be used.
This changes only a few instances I noticed while looking over some recent
commit logs.
This eliminates nasty limitation of caping number of flags to 31.
Current code has limitation of 255 flags, though.
Only SCUMM engine is converted, rest do not even compile.
Detection of fan talkie MI is broken as it has to be implemented
differently.
GUIO_EGAUNDITHER is a positive flag unlike the rest of the GUIO
negative flags like GUIO_NOASPECT and GUIO_NOSPEECH.
This means the gui option is only enabled if the flag exists.
This caused the gui option to be disabled in the global options dialog due
to the flag not existing in the global confman domain.
It is an inconvenience and a regression IMHO to have to set this flag on
a game by game basis with no option to set it globally and have the games
override it.
Thanks Strangerke for making me clarify.
Thanks LordHoto for feedback on code style.
Now SaveStateDescriptor no longer subclasses HashMap. Instead all possible
saved meta data is included directly into SaveStateDescriptor.
This is slightly less flexible, but we never needed that flexibility so far.
On the other hand it should reduce the memory usage. At least on my system
(Linux/amd64) the old SaveStateDescriptor had a size of 928 and the new
SaveStateDescriptor has a size of 200.
Silences the clang warning:
static data member specialization of '_singleton' must
originally be declared in namespace 'Common'; accepted as a C++0x
extension [-Wc++0x-extensions]
Wrapping "namespace Common {}" around the macro assignment causes clang
to complain about a spurious semicolon, and removing the semicolon at
the end of the macro causes some editors to misbehave.
Changing the requirement of using the macro in one namespace (the
global) to another (Common) seems a small price to pay to
silence a warning.
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
I manually resolved all conflicts, and inspected every single change.
Many were due to the version string mismatch and thus easily resolved.
The MSVC project files add in the 1-3-0 branch were not merged,
neither where the changes to gui/themes/translations.dat.
Conflicts:
NEWS
backends/base-backend.cpp
backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
backends/module.mk
backends/platform/ds/arm9/makefile
backends/platform/psp/README.PSP
backends/platform/samsungtv/main.cpp
backends/platform/samsungtv/samsungtv.cpp
backends/saves/posix/posix-saves.cpp
base/commandLine.cpp
base/internal_version.h
base/main.cpp
common/array.h
configure
devtools/create_project/create_project.cpp
dists/android/AndroidManifest.xml
dists/android/plugin-manifest.xml
dists/iphone/Info.plist
dists/irix/scummvm.spec
dists/macosx/Info.plist
dists/redhat/scummvm-tools.spec
dists/redhat/scummvm.spec
dists/scummvm.rc
dists/slackware/scummvm.SlackBuild
dists/wii/meta.xml
engines/sci/parser/vocabulary.cpp
engines/tinsel/handle.cpp
gui/themes/translations.dat
"DS: Prevent the command line help string from being included in the binary."
5f3a90a5f6911188b8d1ded08dbdf6d233e9eb7b
"GUI: Allow disabling of Mass Add dialog. Saves a few Kb of binary size on the DS, and is not particularly useful on that platform."
240ff87cf4472538d25a1c5628c8d15f1791ab1c
"GUI: Don't search for theme zip files on startup when running on the DS. Themes aren't supported anyway, and the search severely delays startup."
fe3b18ce0df03117081e83d99f4a2cbd864d3286
This unifies the engine names in MetaEngine::getName() and the
credits. In particular drop "Engine" or "engine" from the names when
it was present and use expanded names in credits when the
MetaEngine uses it (e.g. "Beneath a Steel Sky" instead of "BASS").
Formerly our code used "hasSuffix" to check for a ".zip" suffix. Since
hasSuffix does a case-sensitive match that would not work, in case the file
was called "scummmodern.ZIP" instead of "scummmodern.zip" for example.
To fix that I am using a case-insensitive matchString instead now.
When loading a corrupted zip, the data returned for THEMERC will be garbage, which will cause an assert in isspace() when trying to trim the data.
This checks that the first character of the header is in the range [0;127] and bails out if not.
There was no control if theme was changed. If you click cancel, it
always changes theme to which options panel opened with. This is
unneccessery if theme is not changed so a if statement added before
applying old theme.
Fixes crash on droid:
game -> gmm -> save -> click entry (EVENT_SCREEN_CHANGED due to vkeybd
beeing shown) -> delete -> confirm
another EVENT_SCREEN_CHANGED gets in simultaneously (due vkeybd being
deactivated) and the parent dialog updated Rects out of bounds.
With 50a682e7e1 we changed the resolution string
in a way which is incompatible with old resolution strings, thus all old theme
files are not usable anymore and will cause problems. To avoid that we just
increase the version string and thus it is not possible to use them anymore.
This reverts commit c8551b80dd.
Turns out the flicking comes from an updateScreen() call in
android's clearScreen(). Besides, this broke GMM... a little
This is used when changing directories in the 'add game' dialog or when
choosing another tab in the option dialog. Only blit to the overlay on
the final pass. Gets rid of highly annoying flickers on androids
Instead of running into assert()s due to dumb parser decisions, use
'less than' and 'greater than' width/height conditions on the
'resolution' tags.
Seems better than listing >9000 different android resolutions.
r49786 introduced a regression which made the game options menu set the
game language to "zh-cn" in case "<default>" was selected. Also in case no
language key was present in the game's config domain no text was shown at all,
now it shows "<default>" in that case again.
svn-id: r55267
The reason for this was that I found issues where the wrong functions were called in EngineManager for single plugin operation. Rather than inserting more messy #defines, I preferred to change the PluginManager to use virtual functions, which also makes EngineManager simpler.
svn-id: r55024
This fixes a problem in case the high resolution theme file was picked up
before the low resolution theme file and thus it was directly chosen.
svn-id: r54746
Formerly there was much special handling for the Tooltip dialog in
GuiManager::runLoop. This was replaced by overloading the event handling
functions in Tooltip. Also the Tooltip was adapted to be run like every
other normal dialog.
svn-id: r54337
Before, it could be instantiated after an engine loaded and then was never deleted, causing memory fragmentation. Also removed inner tooltip call to the GuiManager runloop, which makes the logic simpler since the tooltip is a bit of a hack. I had to remove it because deleting _tooltip in the inner loop (called from tooltip itself) is trouble.
svn-id: r54311
RadiobuttonGroup has a destructor which must be called to avoid leaking memory.
Have also added missing NULL init() declarations on object member pointers to avoid any future issues.
svn-id: r54260
This makes it possible to write
DECLARE_SINGLETON(foo);
instead of
DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.
svn-id: r54258
Basically, it was remembering the font under its non-localized name.
This resulted in a leak, and potentially could have caused the wrong
font to be used in a localization.
svn-id: r54256
I reduced memory fragmentation using 2 principles: Plugins should be loaded for as little time as possible, and long lasting memory allocations should be allocated before plugins are loaded. There might still be a little fragmentation left.
Note that command line settings that require plugins to be loaded don't work yet, but they didn't work (properly) before either.
svn-id: r54097
- Changed the new dithering checkbox to be more generic (i.e. relevant for all engines that may support such a feature in the future)
- Changed the checkbox to be unchecked by default. As discussed on -devel, game enhancements in ScummVM should be off by default, and opt-in
- Changed the option from "sci_undither" to "disable_dithering"
- Changed theme version style to X.Y.Z and bumped it to 0.8.2
svn-id: r54090
This merge was extremely difficult to carry out. It wasn't entirely SVN's fault -- there were several merges to the branch that were done by hand. Please check for any issues and regressions. Also note that the DS makefile was not copied over since the "one at a time" plugin mode currently has too much fragmentation ie. it doesn't work.
svn-id: r54051
This is a first step towards getting rid of all uses of regular printf,
fprintf, vprintf, vfprintf, puts, fputs, etc. in our codebase.
The name format() reflects the purpose of the function, and parallels
String.format() in Java, boost::format, and others.
svn-id: r54004
A new header file common/forbidden.h is included by scummsys.h and it
re-#defines numerous symbols like fopen(), fread(), system(), etc. with
garbage, in order to provoke compile errors in any code using them.
If a .cpp file really *must* use any of these (e.g. because it is a
backend file), then these redefinitions can be disabled by #defining
FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever
this is done, an explanatory comment should be added.
Note that this system cannot catch all "bad" usages (notably the Lua
code in the sword25 engine), as it can only work if scummsys.h is
included.
svn-id: r53961
The GM and MT-32 popup widgets would be set to the first available MIDI device by default (before any selection has taken place yet). Instead, default will now be the first list entry.
svn-id: r53827
This fixes an issue with the <default> setting in the GM and MT-32 device tabs that has caused some complaints and discussions on -devel. It might also be what bug #3088438 is about.
With a <default> setting ScummVM would just use the first available MIDI device (even if this is the not really well working MT-32 emulator). This <default> setting was also indeed set by default - making it even more annoying.
Now there is a new setting for both the GM and MT-32 device tabs ("Don't use GM/MT-32 music").
This will cause MIDI device detection to be skipped and the best of the other devices (Adlib etc.) to be used. This new setting is used as default. So users who haven't specified anything will get Adlib, PC Speaker etc. (if supported by the engine) even if the engine prefers Midi.
There is a new "Use first available device" setting which will have the same effect as the "<default>" setting we had before.
svn-id: r53771
Almost all places where we used XMLParser::parseIntegerKey were using
it like this:
XMLParser::parseIntegerKey(str.c_str(), ...)
Since this makes the code harder to read, I overloaded the method to
also accept Commmon::String directly.
Also removed all .c_str() invocations where necessary.
svn-id: r53479
When switching to a theme that do not have the fonts needed to properly
display the current language, it now revert to the previously used theme
and display an error message telling the user to change the language
first if he wants to use the theme he selected.
svn-id: r52969
Add an error message when switching to a theme that does not support
the current language (i.e. it does not have fonts for the charset used by
that language).
svn-id: r52965
When the locale font are not found when loading the theme, it now
fallbacks to default language (i.e. English) and default font. For this to work
I had to move the TranslationManager initialization before the Theme is
loaded. Therefore it is now initialized when the GuiManager is constructed.
svn-id: r52896
This happened with some translations as the width of the checkbox was
fixed to 80 pixels, even though more space was available. I have increased
it to 120 pixels.
svn-id: r52849
I think I have checked everywhere and it looks good both in English and in
French. This might help for future translations. I am not committing the
change to the 1.2.0 branch though as I am not completely sure it is
harmless.
svn-id: r52830
In normal (no scaling) mode and aspect ratio correction turned off, the
height of the Audio tab of the game options was too small and the subtitle
speed option was subsequently cut.
svn-id: r52829
This code was added when tooltip support was added. Since we changed the way
how tooltips are drawn later on, this code is not required anymore. Actually
it was never used, but it could've been used to save/restore the state of the
GUI for the tooltips.
svn-id: r52717
Starting with r48551 the caret undrawing caused the text selection color in
ListWidgets to be removed. It also added a slight offset to the character
next to the undrawn caret. All this is fixed now.
svn-id: r52716
This change means there can now be different translations for the same
english string depending on the context. It is based on gettext msgctxt feature.
There is a new macro _c(msg, ctxt) that should be used instead of _(msg) in
the source code when we want to add a context to the message. For the
moment I have added contexts to only one message ("None") so that I could
test the changes. Context could be added also to get shorter translations when
GUI is in 1x mode.
I have also added back the fuzzy option to msmerge since it is useful when
adding contexts to populate the translations for the new contexts.
svn-id: r52308
The ThemeEngine had a fallback implemented to use the
non-localized font if the localized one (e.g. for Hungarian) could not
be found. However the fallback was not working. Now it is working.
svn-id: r52243
These devices are not able to create appropriate drivers.
The only purpose for now is having proper gui options and flags and music types for the device detector.
The corresponding GUIO flags for the new devices have been added, too.
svn-id: r51995
The GUI now uses the content of the Language field from the po file
header if it is present and not empty for the language selection
PopupWidget. If not present it uses the file name as before (e.g.
ru_RU).
Also update all the translation template and all the translation files.
svn-id: r51542
This makes the GMM's option dialog work again.
The fix itself is exactly the same like I made in r50468, which
also broke the GMM's option dialog.
svn-id: r51330
Bug #3027772: "Can't switch between Text and Speech". The problem was in
overcrowded Audio tab in any resolution with height < 480.
Solved by adding new MT-32 tab and grouping all relevant widgets there.
TODO:
- The problem still exists for 320x200 resolution where Subtitle speed
control is not accessible
- Apparently nobody tested tab control scrolling after switching to new
GUI, and now there are artifacts
svn-id: r51265
With help of Tanoku tooltips were switched from widgets to dialogs
which helped to fix nasty bug with background not being restored.
Although it is basically a hack around inconsistent font backbuffering
in our GUI code, for the time being it is feasible.
The patch was extended with way to specify tooltip background in the
theme file.
svn-id: r51217
Formerly in case a game only specified GUIO_MIDIMT32, only the MT-32 Emulator
was shown, since that is the only device which is of type MT_MT32. All
external MIDI devices are currently only flagged with MT_GM.
svn-id: r51107
This is based on the Android specific patch found under:
backends/platform/android/scummvm-android-themeengine.patch
After some testing we should be able to get rid of that custom patch.
svn-id: r51028
* Remove _isAttached member var and isAttached method
* Engines now always call the onFrame method; whether it does
something is decided by the debugger class resp. its subclasses
* Make detach() protected instead of private, so that subclasses
can invoke it
* Remove _detach_now member var (call detach() instead).
* Rename _frame_countdown to _frameCountdown and properly
document it.
* Add more doxygen comments
* Cleanup
svn-id: r50963