Commit Graph

3343 Commits

Author SHA1 Message Date
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
aryanrawlani28
3d97be2559 GUI: U32: Remove redundant code
Because po files now (should) use UTF-8, a bunch of code in ScummVM is redundant. This commit addresses that.

- Remove charsetMapping and related variables.
- Remove the code that used these functions.
- Remove cp_parser.cpp. This is removed because the use of codepages is no longer needed.
- Remove iso-8859-x codepages (see above message)
- Always set mapping as 0 in ThemeEngine::loadScalableFont
- Check if ascii or not by getting charset in about dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
810b7cfccc GUI: U32: Write block sizes as Uint32BE
- Changes made in create_translations tool and translations.cpp
- After converting po files to UTF-8, length of block did not fit in 16 bits. This commit addresses that.
2020-08-30 14:43:41 +02:00
aryanrawlani28
fc91436ea6 GUI: U32: Remove charsets being written to .dat 2020-08-30 14:43:41 +02:00
aryanrawlani28
6747e354b8 GUI: U32: Load translation info correctly 2020-08-30 14:43:41 +02:00
aryanrawlani28
dc1c82b74e GUI: U32: Define new translation version "4" 2020-08-30 14:43:41 +02:00
aryanrawlani28
085f375c98 GUI: U32: Store messages as U32Strings and remove codepages reading from .dat
- The previous commit removes all codepage additions to the create_translations tool.
- Following that, this commit removes all the reading from .dat file related to codepages
2020-08-30 14:43:41 +02:00
aryanrawlani28
a9a816e7fe GUI: U32: Improve U32String::format
- Keep adding chars and strings to output instead of deleting and inserting at specific pos
- Use const_iterators for input
2020-08-30 14:43:41 +02:00
aryanrawlani28
c142360bf4 GUI: U32: Add minimal implementation for itoa (base 10) 2020-08-30 14:43:41 +02:00
aryanrawlani28
a9bfe35216 GUI: U32: More issue fixes and general improvements
- Use the fake constructor for message dialog less often
- solve errors regarding comparision between string and u32string in midi
- solve errors in testbed/speech related to ttsMan->say
- fix unsigned comparision warning in tab.cpp
- fix issue with static strings and translations in sdl-graphics
2020-08-30 14:43:41 +02:00
aryanrawlani28
da380a9002 GUI: U32: Fix issues with ustr formatting
- Fix one off error with 'pos'
- Fix last line not being inserted in osdMessage when display
2020-08-30 14:43:41 +02:00
aryanrawlani28
1ca1712b4d GUI: U32: Fix problems with u32strings formatting
- Improve U32's format helper
- Add insertString helper to u32
2020-08-30 14:43:41 +02:00
aryanrawlani28
ef7ec444d3 GUI: U32: Enable u32 for tts (Windows)
They always take in U32 strings now.

- Revert tts descriptions to string, they don't use translations, so better to keep it as strings.
- Make read() take in const U32 references.
2020-08-30 14:43:41 +02:00
aryanrawlani28
d4d5b8906e GUI: U32: Begin making TTS take in U32Strings for saying
Only for strings without an explicit action. The first level takes in a u32 string, encodes it, and passes it along further with the default action

- For gui widgets, the strings are passed in as native u32 strings.
- For everything else, they are being converted to u32 by Common::convertToU32... and then being passed along
2020-08-30 14:43:41 +02:00
aryanrawlani28
fd763b61e5 GUI: U32: Add U32String conversion helpers to str.cpp
This commit adds a constructor and a "=" operator to allow conversion from u32strings->strings
2020-08-30 14:43:41 +02:00
aryanrawlani28
49c36c2b45 GUI: U32: Begin converting texts in clipboards to u32strings
With this commit the base class variables and the parts where getClipboard and setClipboard are used is changed accordingly.
2020-08-30 14:43:41 +02:00
aryanrawlani28
b9a449480b GUI: U32: Remove u32::format references
- Removed because implicit conversion can simply handle this usecase
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28
5f2af6b93e GUI: U32: Add u32 support to Editables and Dialogs
- Editable widgets
- Lists
- SaveLoad Dialogs
- Browser Dialogs
2020-08-30 14:43:41 +02:00
aryanrawlani28
4ea2b46ce8 GUI: U32: Add asuint64 helper to ustr 2020-08-30 14:43:41 +02:00
aryanrawlani28
2745d51fe7 GUI: U32: make convertBidiString take in and return u32strings 2020-08-30 14:43:41 +02:00
Eugene Sandulenko
045df72426 EVENTRECORDER: Fix crash on attempt to save. Fixed #10045
Since we have two event managers during recording, we invalidate
cache in order to avoid cache miss
2020-08-29 17:22:38 +02:00
Cameron Cawley
7745ffdac1 BACKENDS: Simplify EventsBaseBackend 2020-08-24 14:22:35 +02:00
Cameron Cawley
9a61a99590 BACKENDS: Add init() to OSystem 2020-08-24 14:22:35 +02:00
Eugene Sandulenko
bd8eb63e9a COMMON: Moved GUIO constants to hex codes for avoiding devs' confusion 2020-08-23 01:08:47 +02:00
Eugene Sandulenko
dcfcb39de9 COMMON: Removed non-octal number from GUIO 2020-08-23 01:04:02 +02:00
Eugene Sandulenko
3f6efbb84b COMMON: Attempt to solve diamong class hierarchy in MemoryReadStreamEndian. by athrxx 2020-08-22 22:58:43 +02:00
Cameron Cawley
cf068bcc08 ALL: Remove direct use of OSystem::createMutex() 2020-08-21 09:39:00 +02:00
BeWorld
ac573487de MORPHOS: use libz shared from MORPHOS
Need to use -lz_shared on linking.
2020-08-21 00:59:18 +02:00
BeWorld
775f6c4803 MORPHOS: Update scummsys.h
MorphOS support
2020-08-21 00:59:18 +02:00
BeWorld
61f86025fe MORPHOS: MorphOS Support 2020-08-21 00:59:18 +02:00
Walter van Niftrik
d4ecbbc5d3 COMMON: Fix Span::toStream() when given index
When providing an index but no numEntries, the computed numEntries is
not adjust for index and an error is thrown
2020-08-20 23:58:37 +02:00
djsrv
f3a179a873 COMMON: Add dispose arg to MemoryReadStreamEndian 2020-08-12 12:23:43 -04:00
Eugene Sandulenko
1bb73862a1 COMMON: Lightened another MacBinary check so ISOBuster files really work 2020-08-01 22:38:09 +02:00
Eugene Sandulenko
4221c38167 COMMON: Support MacBinary3 files produced by ISOBuster 2020-08-01 20:25:39 +02:00