Commit Graph

3888 Commits

Author SHA1 Message Date
djsrv
8501ce8e26 COMMON: Convert names to printable in FSDirectory warnings
Unit separator, a control character, is used as a directory separator,
so this is needed now.
2021-08-07 10:44:37 +02:00
djsrv
17297ea7ef COMMON: Use Path type in punycode_decodepath 2021-08-07 10:44:37 +02:00
djsrv
909595176a COMMON: Use Path type in MacResManager functions 2021-08-07 10:44:37 +02:00
djsrv
0d65c2fd12 ALL: Use Path type in File functions 2021-08-07 10:44:37 +02:00
djsrv
7eb4841065 ALL: Use Path type in Archive functions 2021-08-07 10:44:37 +02:00
djsrv
0db0b2c201 COMMON: Create Path type 2021-08-07 10:44:37 +02:00
Thierry Crozat
1af6ae593a COMMON: Change OSystem::getSystemLanguage to always return a language code 2021-08-04 19:28:47 +01:00
Thierry Crozat
cbb627a40b COMMON: Change TransMan builtin language to "en" instead of "C" 2021-08-04 19:28:47 +01:00
antoniou
84323fc78e ANDROID: Remove checkbox for Android SAF from global options
Themes rebuilt, and version bumped to SCUMMVM_STX0.8.50
2021-08-02 22:57:37 +03:00
Aapo Vienamo
de1338787f COMMON: Fix divide by zero in getRandomNumber()
Calling RandomSource::getRandomNumber() results in divide by zero
exception when called with max = 4294967295 as max + 1 overflows to zero
and the subsequent modulus operation causes the exception.

Certain game saves in Bladerunner trigger this.
2021-08-02 13:40:11 +03:00
Fiodar Stryzhniou
475adcf8aa COMMON: Move text-to-speech.o MODULE_OBJS
It was bulded if USE_TTS enabled before. It builded bu defaault now.
That strange makefile structure break Symbian makefile parser.
2021-08-01 17:23:55 +02:00
antoniou
250206bd00 ANDROID: Add a checkbox for a revoke SAF permissions button
Themes were updated to version SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.48"
2021-08-01 16:10:54 +03:00
Eugene Sandulenko
e79e58e077
COMMON: Avoid unnecessary object creation 2021-08-01 14:55:39 +02:00
Eugene Sandulenko
11e486d631
COMMON: Replace rindex() with more portable code 2021-08-01 14:51:04 +02:00
Eugene Sandulenko
1f40958a65
COMMON: Punycode more invalid characters in filenames 2021-08-01 10:44:24 +02:00
Eugene Sandulenko
ad42c3fd97
COMMON: Fix compilation 2021-07-31 18:30:16 +02:00
Eugene Sandulenko
130270e9cc
COMMON: Puny-encode '*', '[', ']' in file names 2021-07-31 17:04:13 +02:00
D G Turner
3f41ffa1c6 COMMON: Further fixes for signedness mismatch warnings in punycode 2021-07-31 13:09:17 +01:00
Orgad Shaneh
36224b990e COMMON: Fix signedness mismatch warnings in punycode 2021-07-28 08:51:17 +03:00
Cameron Cawley
74e7d777a9 BACKENDS: Add OSystem::messageBox() and use it for error handling 2021-07-27 20:50:51 +02:00
Eugene Sandulenko
163d0b333a
COMMON: Make constants more portable 2021-07-27 18:44:00 +02:00
Eugene Sandulenko
83da582b4b
COMMON: Fix compilation 2021-07-27 18:42:54 +02:00
Eugene Sandulenko
530354492a
COMMON: Fix encode_punycode to match the perl code 2021-07-27 18:14:50 +02:00
Eugene Sandulenko
e6429a1213
COMMON: Fix punycode encoding 2021-07-27 18:14:50 +02:00
Eugene Sandulenko
96bb4d2d53
COMMON: Added more auxiliary method to Punycode 2021-07-27 18:14:50 +02:00
Eugene Sandulenko
f3145d0fb6
COMMON: Decode filenames from Punycode upon returning 2021-07-27 18:14:50 +02:00
Eugene Sandulenko
cd3f703988
COMMON: Fix punycode encoding 2021-07-27 18:14:49 +02:00
Eugene Sandulenko
8789bdfd67
COMMON: Reworked encode_punycode to String 2021-07-27 18:14:49 +02:00
Eugene Sandulenko
191bc979a9
COMMON: Always return the original string on failed punycode decoding 2021-07-27 18:14:49 +02:00
Eugene Sandulenko
a655cff203
COMMON: Added auxiliary methods for punycode 2021-07-27 18:14:49 +02:00
Eugene Sandulenko
56f7af8d2e
COMMON: Fix punycode decoding and implement reverse utility for escaped filenames 2021-07-27 18:14:49 +02:00
Eugene Sandulenko
91d747ac5b
COMMON: Initial code for punycode decoding 2021-07-27 18:14:48 +02:00
Le Philousophe
e83fed6c60 COMMON: Fix 34cbff9dc2
size got set in ensureCapacity which is not expected.
It must only increase when effectively writing in the buffer after
current end of file.
2021-07-25 17:48:12 +02:00
Paul Gilbert
34cbff9dc2 COMMON: Add roundUpCapacity to MemoryWriteStreamDynamic 2021-07-24 18:45:56 -07:00
Orgad Shaneh
dd792e9e87 JANITORIAL: Fix some MSVC warnings 2021-07-22 07:28:01 +03:00
Orgad Shaneh
b983c1f29f COMMON: Add conversion table for DOS862 encoding 2021-07-22 00:06:25 +03:00
Orgad Shaneh
3ce662f5d4 COMMON: Fix indentation 2021-07-16 15:23:39 +03:00
djsrv
b2988ce682 COMMON: Add constructor to make U32String from a character 2021-07-15 16:31:47 -04:00
Cameron Cawley
4736b0ed99 COMMON: Fix loading version information from 16-bit executables 2021-07-15 13:55:33 +02:00
Cameron Cawley
bf4ae50a3f COMMON: Add a helper function for loading version resources 2021-07-15 13:55:33 +02:00
Cameron Cawley
a7d61eb365 COMMON: Allow loading EXE files from an existing stream 2021-07-15 13:55:33 +02:00
Torbjörn Andersson
976d6564bc COMMON: Allow \0 to be appended to Strings
This has been discussed on the mailing list. While there wasn't much
input, the consensus was that it should be allowed for consistency with
std::string.

While most engines don't do this, it is possible that some engines will
break because of it. (A few have already been fixed.) But it will also
repear the currently broken ADL engine. For now, the warning() message
will remain so that it can be investigated on a case-by-case basis.
2021-07-13 10:35:19 +02:00
Torbjörn Andersson
5775637bb8 COMMON: Add translator's note for the Macintosh b/w render mode 2021-07-13 09:53:36 +02:00
Torbjörn Andersson
2ba156184c SCUMM: Add Macintosh b/w rendering mode
This is currently only (partially) implemented for the 16-color Mac
versions of Loom and Indiana Jones and the Last Crusade. The text is
still drawn in color, since that's rendered separately, but I'm
committing this now while it still works.
2021-07-13 09:53:36 +02:00
Martin Gerhardy
7a172206d5 EVENTRECORDER: don't execute getMillis while resolving the random seed in playback mode 2021-07-12 22:56:02 +02:00
djsrv
e6a5380989 COMMON: Add U32String version of toPrintable
This only escapes ASCII control characters, not characters wih
codepoints > 127.
2021-07-12 15:41:21 -04:00
djsrv
671fdf8cd9 COMMON: Add MacRoman codepage 2021-07-12 15:41:21 -04:00
Torbjörn Andersson
e0d1854c01 COMMON: Fix encoding of the string "Norwegian Bokmål" 2021-07-12 16:39:03 +02:00
athrxx
44bfd2a220 COMMON: remove Encoding leftovers
(class does not exist any more)
2021-07-10 01:10:04 +02:00
Martin Gerhardy
a0c237f7b9 EVENTRECORDER: added new event for OSystem::getTimeAndDate 2021-07-09 19:23:21 +02:00
Cameron Cawley
a3f9cd878f COMMON: Fix warnings with older compilers 2021-07-09 17:09:21 +01:00
Paul Gilbert
005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
Martin Gerhardy
2a658b9d65 EVENTRECORDER: quit scummvm after end of recorder file was reached.
This might also become a return to launcher, but I've somehere read the hint that
the event recorder was only meant to play back one game per session. We'll see.
2021-07-08 15:05:35 +02:00
Martin Gerhardy
70167d8423 EVENTRECORDER: debug logging 2021-07-08 15:05:35 +02:00
Martin Gerhardy
36afa639a4 EVENTRECORDER: skip some getMillis for the event recorder
they are running as event source and would bring the event recorder into an out-of-sync state
2021-07-08 15:05:35 +02:00
Martin Gerhardy
f35cc92aaf EVENTRECORDER: ignore other event sources when playing back a record 2021-07-08 15:05:35 +02:00
Martin Gerhardy
5ae72dc190 EVENTRECORDER: removed unused variable 2021-07-08 15:05:35 +02:00
Martin Gerhardy
375d8dc4a4 EVENTRECORDER: changed event recorder format and added more events
the custom engine events were missing and the default event manager transforms the backend events
. Which means that the event recorder is not persisting the low level key press/release events
but the already transformed custom engine events of the keymapper
2021-07-08 15:05:35 +02:00
Orgad Shaneh
c9a19011bf EVENTRECORDER: Use a dynamic array for buffer in PlaybackFile
It is allocated on the stack.
2021-07-08 10:59:09 +02:00
Martin Gerhardy
ef6e6b6451 GUI: doxygen 2021-07-07 19:19:43 +02:00
Paul Gilbert
0136043f09 COMMON: Revert Change Rect and Point to have int32 fields
This reverts commit 1c3e7fb4e9.
2021-07-06 20:35:42 -07:00
Paul Gilbert
1c3e7fb4e9 COMMON: Change Rect and Point to have int32 fields 2021-07-04 18:24:26 -07:00
Torbjörn Andersson
a54269a594 COMMON: Fix documentation for grabOverlay().
It takes a surface now, not a buffer.
2021-06-30 18:59:34 +02:00
Eugene Sandulenko
f6e33231bb
COMMON: Add an optional parameter to tag2str() for printing non-printables
This time without variadic macros
2021-06-29 22:15:02 +02:00
Eugene Sandulenko
76c6bcef2b
Revert "COMMON: Add an optional parameter to tag2str() for printing non-printables"
This reverts commit c11fedb47e.

It is a C++11 feature...
2021-06-29 22:12:25 +02:00
Eugene Sandulenko
c11fedb47e
COMMON: Add an optional parameter to tag2str() for printing non-printables 2021-06-29 20:42:40 +02:00
D G Turner
e83f23f264 COMMON: Fix Development Tools Build
This is not the best solution as it removes the warning when this
code is used by devtools such as create_titanic, but getting this to
link would need inclusion of textconsole.o via shim and then still
breaks on g_system, so fastest solution to restore build.
2021-06-29 15:39:27 +01:00
Torbjörn Andersson
a420aa9594 COMMON: Include textconsole.h in base-str.cpp
While it's not needed to build ScummVM, apparently some of the other
tools that use String do not include textconsole.h and complain that
warning() is undefined.
2021-06-29 15:12:20 +02:00
Torbjörn Andersson
ab06f27d43 COMMON: Add warning when adding \0 to a String
Some engines do this, and it's not really known what should happen. We
need to decide on a behavior, and stick to that. This warning is to help
find where it happens.

From my own tests, it can happen in at least ADL, Avalanche, Chewy,
Director, Blazing Dragons, MacVenture, MADS, Prince, Stark, Startrek,
and Trecision. Only ADL is known to be broken by the current behavior.

The result of my test can be found at
http://www.update.uu.se/~d91tan/tmp/string.txt
2021-06-29 13:37:05 +02:00
Donovan Watteau
183e946ec8 ACHIEVEMENTS: Fix compilation when translations are disabled 2021-06-27 17:47:17 +02:00
Fiodar Stryzhniou
58b1c0cb5e COMMON: LUA: Fix warnings for header search failure.
WARNING: Can't find following headers in User or System Include Paths "luaconf.h" "lua.h" "lua.h"
2021-06-26 08:41:47 +03:00
Orgad Shaneh
780c4568c1 GUI: Fix compiler warning
../scummvm/gui/options.cpp: In member function 'virtual void GUI::OptionsDialog::apply()':
../scummvm/gui/options.cpp:647:82: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
  647 |     else if (scalerPlugins[defaultScaler]->get<ScalerPluginObject>().getFactor() != g_system->getDefaultScaleFactor())
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-24 11:34:45 +03:00
Cameron Cawley
da5d773924 BACKENDS: Add getDefaultScaler and getDefaultScaleFactor to OSystem 2021-06-23 21:29:53 +02:00
Cameron Cawley
0e6b9c2bb6 SDL: Begin refactoring the API for selecting scalers 2021-06-23 21:29:53 +02:00
lb_ii
6f8764b14c COMMON: Rewrite BASESTRING::contains() with algorithm from BASESTRING::find() 2021-06-21 02:29:05 +03:00
lb_ii
b886c238fe COMMON: Fix BASESTRING::contains() 2021-06-21 02:29:05 +03:00
Cameron Cawley
cba6f05d71 COMMON: Fix compilation with C++98 2021-06-19 17:22:26 +01:00
Martin Gerhardy
adc2671449 COMMON: fixed endless loop in recordings with only one screenshot
the stream was read after its end and the err() state wasn't checked properly
2021-06-19 14:34:52 +02:00
Martin Gerhardy
5af1192580 BACKENDS: fixed segfault in EventRecorder with buffer out of bounds writes
==3124361== Invalid write of size 8
==3124361==    at 0x483F803: memmove (vg_replace_strmem.c:1270)
==3124361==    by 0x4DBF61: SurfaceSdlGraphicsManager::grabOverlay(void*, int) const (surfacesdl-graphics.cpp:1753)
==3124361==    by 0x482051: ModularGraphicsBackend::grabOverlay(void*, int) (modular-backend.cpp:215)
==3124361==    by 0x434EE1: GUI::ThemeEngine::clearAll() (ThemeEngine.cpp:376)
==3124361==    by 0x40128E: GUI::EventRecorder::preDrawOverlayGui() (EventRecorder.cpp:558)
==3124361==    by 0x481DB2: ModularGraphicsBackend::updateScreen() (modular-backend.cpp:173)
==3124361==    by 0x559967: Graphics::Screen::updateScreen() (screen.cpp:62)
==3124361==    by 0x55991C: Graphics::Screen::update() (screen.cpp:56)
==3124361==    by 0x38AFC7: TwinE::TwineScreen::update() (twine.cpp:126)
==3124361==    by 0x3B8759: TwinE::Screens::adjustPalette(unsigned char, unsigned char, unsigned char, unsigned int const*, int) (screens.cpp:150)
==3124361==    by 0x3B8A89: TwinE::Screens::fadeToPal(unsigned int const*) (screens.cpp:207)
==3124361==    by 0x3B8403: TwinE::Screens::loadImage(int, int, bool) (screens.cpp:80)
==3124361==  Address 0x31453050 is 16 bytes after a block of size 512,000 alloc'd
==3124361==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==3124361==    by 0x55B38C: Graphics::Surface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (surface.cpp:75)
==3124361==    by 0x551111: Graphics::ManagedSurface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (managed_surface.cpp:153)
==3124361==    by 0x4352D5: GUI::ThemeEngine::setGraphicsMode(GUI::ThemeEngine::GraphicsMode) (ThemeEngine.cpp:453)
==3124361==    by 0x434A52: GUI::ThemeEngine::init() (ThemeEngine.cpp:324)
==3124361==    by 0x43501B: GUI::ThemeEngine::refresh() (ThemeEngine.cpp:394)
==3124361==    by 0x405780: GUI::GuiManager::screenChange() (gui-manager.cpp:603)
==3124361==    by 0x405C6B: GUI::GuiManager::processEvent(Common::Event const&, GUI::Dialog*) (gui-manager.cpp:677)
==3124361==    by 0x404EBA: GUI::GuiManager::runLoop() (gui-manager.cpp:429)
==3124361==    by 0x3FD847: GUI::Dialog::runModal() (dialog.cpp:77)
==3124361==    by 0x36D747: launcherDialog() (main.cpp:106)
==3124361==    by 0x36FF92: scummvm_main (main.cpp:552)

It looks like the _videoMode.overlayHeight in SurfaceSdlGraphicsManager::grabOverlay and ThemeEngine::_backBuffer::h are somehow out of sync after
starting the game in a different resolution as the gui was started with. So the overlayHeight is updated - but the backbuffer (Surface) is not resized.

This is with event recorder being active - right after starting the game and switching the resolution.
2021-06-19 14:34:52 +02:00
lb_ii
9eef2c954d COMMON: Support Farsi at convertBiDiString(input, lang, dir) 2021-06-18 23:03:36 +03:00
lb_ii
dce92c8e41 COMMON: Introduce BiDi paragraph direction types 2021-06-18 23:03:36 +03:00
lb_ii
9cd8bbafa9 COMMON: Remove unused UnicodeBiDiText constructor 2021-06-18 23:03:36 +03:00
Martin Gerhardy
dfd6b6a9a4 COMMON: moved AchievementDescriptionList into Common namespace
getAchievementsInfo is also moved into the MetaEngine to reduce code duplication
2021-06-16 00:25:14 +03:00
sluicebox
f2f28c4549 COMMON: Rename DebugManager methods, update comments 2021-06-14 12:42:38 -05:00
sluicebox
efd4f9ff9d COMMON: Remove DebugManager::debugFlagsClear() 2021-06-14 12:42:38 -05:00
sluicebox
fa247d13de COMMON: Rename DebugManager global/member names 2021-06-14 12:42:38 -05:00
lb_ii
0975ab0eaf COMMON: Rename "Persian (Iran)" to "Persian", since there are no other regions in the list 2021-06-13 00:25:53 +03:00
Le Philousophe
3b61377f6b ACHIEVEMENTS: Remove C++11 constructs 2021-06-12 17:06:31 +02:00
lb_ii
8aa6911cca ACHIEVEMENTS: Fix codacy issues 2021-06-10 01:56:23 +03:00
lb_ii
a556ccf894 ACHIEVEMENTS: Use TransMan to decide which achievements language to use 2021-06-10 01:56:23 +03:00
lb_ii
fa018b4b84 ACHIEVEMENTS: Check VERSION at achievements.dat 2021-06-10 01:56:23 +03:00
lb_ii
dea2085eb2 ACHIEVEMENTS: Add API to get stats and achivements descriptions 2021-06-10 01:56:23 +03:00
lb_ii
629e5c2783 ACHIEVEMENTS: Load achivements descriptions from achievements.dat 2021-06-10 01:56:23 +03:00
trembyle
30dfb37623 COMMON: Add Pippin platform for Director engine
Differences with Mac platform include disc authentication and the
presence of Mac System 7 files on disc.
2021-06-09 21:49:28 +02:00
Martin Gerhardy
6772dabd9a COMMON: replaced NULL with nullptr in wrapCompressedReadStream 2021-06-07 01:36:30 +03:00
Martin Gerhardy
b259e168a4 COMMON: fixed invalid read in zlib read stream
==1313424== Conditional jump or move depends on uninitialised value(s)
==1313424==    at 0x682225: Common::wrapCompressedReadStream(Common::SeekableReadStream*, unsigned int) (zlib.cpp:498)
==1313424==    by 0x46CDB9: DefaultSaveFileManager::openForLoading(Common::String const&) (default-saves.cpp:134)
==1313424==    by 0x68334D: Common::PlaybackFile::openRead(Common::String const&) (recorderfile.cpp:74)
==1313424==    by 0x444558: GUI::RecorderDialog::updateList() (recorderdialog.cpp:206)
==1313424==    by 0x4446BD: GUI::RecorderDialog::runModal(Common::String&) (recorderdialog.cpp:218)
==1313424==    by 0x3DF0E5: GUI::LauncherDialog::recordGame(int) (launcher.cpp:461)
==1313424==    by 0x3E0397: GUI::LauncherDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (launcher.cpp:671)
==1313424==    by 0x400BF8: GUI::CommandSender::sendCommand(unsigned int, unsigned int) (object.h:55)
==1313424==    by 0x42DAB8: GUI::DropdownButtonWidget::handleMouseUp(int, int, int, int) (widget.cpp:497)
==1313424==    by 0x3D3A37: GUI::Dialog::handleMouseUp(int, int, int, int) (dialog.cpp:228)
==1313424==    by 0x3DB72C: GUI::GuiManager::processEvent(Common::Event const&, GUI::Dialog*) (gui-manager.cpp:668)
==1313424==    by 0x3DA9EA: GUI::GuiManager::runLoop() (gui-manager.cpp:429)

Happens when you start with the event recorder compiled into scummvm and open the dialog to start
a new record.
2021-06-07 01:36:30 +03:00
SupSuper
fa5149e3ac COMMON: Fix old GCC compilation 2021-06-03 03:50:51 +01:00
SupSuper
e3d082df65 MSVC: Add compiler printf validation 2021-06-02 08:35:31 +03:00
lb_ii
b9f4e1a6bd ACHIEVEMENTS: Mark const methods as const 2021-06-02 01:21:37 +03:00
lb_ii
9c699358ea ACHIEVEMENTS: Make getStatRaw() const 2021-06-01 02:20:53 +03:00