3377 Commits

Author SHA1 Message Date
Thierry Crozat
786aac568b COMMON: Add c++11 initializer list replacement when not available in std lib
The c++11 standard includes some features that do not only depend on the
compiler supporting it, but also the c++ standard library having support
for it. This is the case for the initializer list feature. So when we
compile with a modern compiler but using an old std lib we need a
replacement for it.
2020-10-03 15:51:14 +02:00
Thierry Crozat
a275522f89 COMMON: Add list initialization and move semantics to Array 2020-10-03 15:51:14 +02:00
aryanrawlani28
9c67225293 COMMON: ERROR: Add kMetaEnginePluginNotFound 2020-10-03 14:56:36 +02:00
Paweł Kołodziejski
db4295c1a8 COMMON: Added PS2 and XBOX platform definitions. 2020-09-23 22:59:20 +02:00
Eric Fry
8e55335eb0 COMMON: Add Sega Megadrive/Genesis platform 2020-09-21 23:11:10 +02:00
Bastien Bouclet
0f2c6cd9ea ENGINES: Change mac resource fork file detection to use the file cache
Common::MacResMan is now able to open files from a specified
Common::Archive. This is a bit hacky as dynamic_cast is used to break
the Archive encapsulation to retreive the underlying FSNode. It should
however be more correct than the previous code that assumed files were
at the root of the currently running game's path.

AdvancedDetector constructs a Common::Archive from its FileMap based
filesystem cache and uses it to detect the mac resource fork files.

This cuts the time it takes to run the detection code with all the
engines enabled as dynamic plugins on the 3DS to 30 s from 280 s.
2020-09-20 16:33:45 +02:00
Bastien Bouclet
9a1e2368b2 COMMON: Avoid an unnecessary copy in the XML parser 2020-09-20 16:33:45 +02:00
Cameron Cawley
31be074893 BACKENDS: Add a function to return if the overlay is visible 2020-09-15 00:09:11 +02:00
Vladimir Menshakov
0a4154318c COMMON: implement %c formatter (used in hardware-input.cpp)
Fix invalid descriptor name for half-axis.
Add some tests for U32String::Format.
2020-09-12 11:56:17 +01:00
Cameron Cawley
6e0c93dc46 COMMON: Add helper functions for converting strings 2020-09-12 11:59:23 +02:00
SupSuper
b123a21eed BACKENDS: Add support for qualified game IDs in taskbar icons 2020-09-09 01:58:20 +01:00
Thierry Crozat
c5ede297ea JANITORIAL: Simplify some code that use U32String::format 2020-09-08 21:24:27 +01:00
Thierry Crozat
54f825359f COMMON: Allow using U32String::format with a C string format string 2020-09-08 21:22:04 +01:00
Cameron Cawley
5a6e411bfd COMMON: Fix U32String::itoa when num is 0 2020-09-06 13:20:05 +01:00
Thierry Crozat
9ab48df4b6 COMMON: Fix comparaison operators for U32String
They were supposed to compare two U32String, but due to a copy/paste
error they were comparing a U32String with a String. It compiled
because there is a String constructor that takes a U32String (and
converts it to UTF-8), but it was probably not quite working as
expected for non-ASCII characters.
2020-09-02 21:01:15 +01:00
Vladimir Menshakov
8ddcbf8120 COMMON: Fix warnings about different signedness (uint32/char comparison), remove unused var
Add tests for both str/ustr comparison operators.
2020-09-02 20:35:43 +01:00
Thierry Crozat
927127abd5 I18N: Support having unicode characters in language names 2020-09-02 12:08:49 +02:00
Thierry Crozat
9fcc83c09d COMMON: Add comparison operators to U32String
Those operators just compare the numerical value of each character
one by one. This is not idea, but this is better than nothing.
2020-09-02 12:08:49 +02:00
Vladimir Menshakov
04943476b1 COMMON: Add Rect::getBlitRect() that ensures you did not blit out of src or dst surface boundaries 2020-09-01 21:52:42 +01:00
Eugene Sandulenko
1425c39d71 Revert "COMMON: Rename ZH_ANY language code nz -> zh"
This reverts commit 6c97dcbb4a0b323aadc2d5445bd63bcbc06a1473.
2020-09-01 16:54:33 +02:00
Eugene Sandulenko
6c97dcbb4a COMMON: Rename ZH_ANY language code nz -> zh
Since it concerns only one game in Wintermute ATM, I don't
bother implementing autoupgrade
2020-09-01 16:37:36 +02:00
Thierry Crozat
1b67a0f069 COMMON: Fix assingning a String to a U32String
When assigning a String or char * to an existing U32String, the code
assumed that the current _str pointed to the internal storage. But
that is not the case if the U32String contains a string longer
than the internal storage capacity prior to the assignment, and
this led to various memory issues (and usually a crash down the
line).
2020-09-01 00:12:03 +01:00
Vladimir Menshakov
035ddef16c COMMON: Add ARRAYCLEAR to clear given array using default or provided value. 2020-08-31 21:57:07 +01:00
Vladimir Menshakov
f63f424309 COMMON: Preserve the order of insertion for equal range of the keys. 2020-08-31 18:17:29 +01:00
Vladimir Menshakov
e7d7c67c69 COMMON: Allow something else than raw pointer to be used in SortedArray 2020-08-31 18:17:29 +01:00
Vladimir Menshakov
fb05242d36 COMMON: Add a way to specify default section name for simple sectionless .ini files 2020-08-31 18:17:28 +01:00
aryanrawlani28
fe561ecdee COMMON: U32: Fix incorrect usage of %i
- %i & %d work in the same manner.
2020-08-30 20:03:26 +01:00
aryanrawlani28
ca54adca47 COMMON: U32: Fix different types of string pointers for u32
- Previous changes broke compilation for AmigaOS.
2020-08-30 18:56:12 +01:00
aryanrawlani28
e5445fb901 GUI: U32: Small improvements/fixes
- Remove = operator in String, which compared to a U32String.
- Let implicit cast take care of results from getResultString, so in-future easy to spot new changes.
- Use uint32 for each char when encodingUrlStrings, to avoid unsafe comparision.
2020-08-30 14:43:41 +02:00
aryanrawlani28
87df975686 GUI: U32: Wrap string in U32 if not using translations. 2020-08-30 14:43:41 +02:00
aryanrawlani28
d48453693c GUI: U32: Use translated strings as arguments for formatting function usage. 2020-08-30 14:43:41 +02:00
aryanrawlani28
140eddf90a GUI: U32: Allow vformat to take in a pointer to a translated string
- Fix signed/unsigned comparision in U32String::contains(U32String)
2020-08-30 14:43:41 +02:00
aryanrawlani28
1d85a3d8e1 GUI: U32: Fix incorrect type for single char in U32::vformat 2020-08-30 14:43:41 +02:00
aryanrawlani28
388473656e GUI: U32: Add contains utility for string, which takes in a uint. 2020-08-30 14:43:41 +02:00
Thierry Crozat
a54b5826ea UPDATES: Fix compilation with U32 strings 2020-08-30 14:43:41 +02:00
aryanrawlani28
35386aab4c TTS: Remove more redundant code 2020-08-30 14:43:41 +02:00
Thierry Crozat
66342fb89c TTS: Fix conversion to UTF-32 for text to speak 2020-08-30 14:43:41 +02:00
Thierry Crozat
94035cf7aa COMMON: Fix creating a String from a U32String
There were memory issues due to class member variables not initialized
by the constructor.
2020-08-30 14:43:41 +02:00
Thierry Crozat
58203e09fd COMMON: Fix encoding conversion using iconv
It was not always setting to 0 all the newly allocated bytes,
and if you were unlucky this could result in additional spurious
characters at the end of the converted string.
2020-08-30 14:43:41 +02:00
aryanrawlani28
0ca5a40d85 TTS: ALL: Improve u32-ity
- Allow the base class to take in a string with custom charset, convert to U32 and pass it along.
- Remove redudandant functions in all tts-subsystems
- Remove unnecessary "charset" argument, as U32Strings imply that we are using a UTF-32 charset
- Adjust relative code appropriately according to the above point.
2020-08-30 14:43:41 +02:00
aryanrawlani28
9bf3f73d8a GUI: U32: Use U32Strings for native dialogs
- Make DialogManager showFileBrowser take in u32
- Show filebrowser with u32 in MacOS and GTK
2020-08-30 14:43:41 +02:00
aryanrawlani28
2ca907b4a2 GUI: U32: Use game-list filters with u32
- Add a contains utility function to ustr
- setFilter uses U32String and U32Tokenizers
- Make consequent changes in launcher to allow sending u32strings
2020-08-30 14:43:41 +02:00
aryanrawlani28
56911beea2 GUI: U32: Add and use a U32Tokenizer
- Added in common/tokenizer.cpp
- Uses iterators to function
2020-08-30 14:43:41 +02:00
aryanrawlani28
12e4f871a3 GUI: U32: Improve u32 in all engine subsystems
- Common: add wordWrap function to ustr.cpp
- Bladerunner: Explicitly state we have a U32String in subs (same as Subtitles::loadOuttakeSubsText)
- Don't use translations for engine specific "put strings", because they might not support.
- SCI: Use const references for showScummVMDialog
- SCUMM:
-- Don't use translation in md5 warning. left comments with the translated version.
-- Remove some redundant headers in help.cpp
-- Don't use translation in handleSaveload when printing to console
-- Also, display success transaction correctly via u32::format
- TESTBED: Use fake constructor when setting label of button
- SKY: Correctly use translation when using SaveStateDescription
- ULTIMA: Don't use translations when display_string
- ENGINES:
-- GenerateUnknownGameReport correctly, with proper translations.
-- There was an error, where a function had been declared twice, in a header file. Correct this.
2020-08-30 14:43:41 +02:00
aryanrawlani28
68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02:00
aryanrawlani28
4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
185fb72783 GUI: U32: Improve U32 code
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
2020-08-30 14:43:41 +02:00
aryanrawlani28
22ef76638c GUI: U32: Return visual from convertBiDiU32String 2020-08-30 14:43:41 +02:00
aryanrawlani28
b6278f3400 GUI: U32: Write translation description and size for english language also as uint32BE.
All blocks of sizes are now written in uint32BE.
2020-08-30 14:43:41 +02:00
aryanrawlani28
9573f1e515 GUI: U32: Remove useless check when converting bidiString 2020-08-30 14:43:41 +02:00