Commit Graph

2911 Commits

Author SHA1 Message Date
Thierry Crozat
e732186724 COMMON: Add OSDMessageQueue singleton
This class can be used to get messages to display on the OSD from
any thread. Those messages are then passed to the backend in the
graphic thread.
2016-10-29 15:13:32 +01:00
Eugene Sandulenko
3071bb40d8 COMMON: Added debug method for printing out stream contents 2016-10-26 19:00:13 +02:00
Thierry Crozat
5151bd99dd Merge pull request #847 from criezy/sdl-filtering
Add graphics linear filtering feature
2016-10-16 18:42:40 +01:00
Eugene Sandulenko
e89c76f63c Merge pull request #836 from peterkohaut/bladerunner
BLADERUNNER: added basic support for blade runner game
2016-10-13 23:48:50 +02:00
Thierry Crozat
30aae5178a OSYSTEM: Add kFeatureFilteringMode 2016-10-13 01:45:01 +01:00
Eugene Sandulenko
355c4fa646 JANITORIAL: Remove more trailing spaces 2016-10-09 15:02:02 +02:00
Eugene Sandulenko
7ab0985ca8 COMMON: Add ReadFloatLE to Common::ReadStream 2016-09-29 22:33:36 +02:00
Bastien Bouclet
0802bbd8ee OSYSTEM: Remove the API allowing to draw to the OSD surface directly 2016-09-13 20:41:26 +02:00
Bastien Bouclet
521ba2cb8a OSYSTEM: Introduce a method allowing to draw a background activity icon 2016-09-13 20:25:13 +02:00
Paul Gilbert
bd010bc79f COMMON: Converted Common::BitStream to use DisposeAfterUse 2016-09-10 11:16:07 -04:00
Thierry Crozat
1f2a50bcd3 CLOUD: Move openUrl to OSystem 2016-09-10 01:12:42 +01:00
Thierry Crozat
dff88b1058 COMMON: Fix indentation inconsistencies 2016-09-09 22:28:48 +01:00
Eugene Sandulenko
fab199d37e JANITORIAL: Make GPL headers uniform 2016-09-03 12:46:38 +02:00
Eugene Sandulenko
029e1c0d1a Merge pull request #820 from waltervn/platform-atari8bit
COMMON: Add Atari 8-bit platform
2016-09-02 23:41:29 +02:00
Willem Jan Palenstijn
9b6bbeb911 COMMON: Replace broken URL 2016-08-30 21:59:12 +02:00
Willem Jan Palenstijn
3b2bdd3a89 COMMON: Fix sign warning 2016-08-30 21:53:22 +02:00
Walter van Niftrik
51360ec6ab COMMON: Add Atari 8-bit platform 2016-08-29 17:52:36 +02:00
Alexander Tkachev
368f664c81 COMMON: Fix WriteStream::pos() once again
MemoryReadWriteStream now returns int32, not uint32. It actually doesn't
ever return -1 to indicate that an error occured, so uint32 was a better
choice, but that's what is used in WriteStream base class now.

That method is abstract, so that's also why OutSaveFile had to override
it.
2016-08-24 16:24:16 +06:00
Alexander Tkachev
b9bba9bd4b ALL: Move Clipboard support to OSystem
Commit adds kFeatureClipboardSupport. hasTextInClipboard() and
getTextFromClipboard().

OSystem_SDL has this feature if SDL2 is used.

EditableWidget and StorageWizardDialog use g_system to access clipboard
now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
627bda9d82 COMMON: Add replace(String, String, String)
Searches for a substring in the string and replaces it with the other
string.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
acce1c89ab CLOUD: Fix saves sync
Tested that on actual unix system and found out a few minor bugs related
to paths.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
fa3ea83165 CLOUD: Fix some warnings
Mostly on format string
2016-08-24 16:07:55 +06:00
Alexander Tkachev
aee713141b CLOUD: Make OutSaveFile start saves sync
It had to become a proxy class in order to do that.
finalize() starts the saves sync.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c99b24c16d COMMON: Add String::asUint64()
Instead of all these atoull() I've added everywhere.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9eb4aad7fd CLOUD: Make DefaultSaveFileManager ignore syncing files
MetaEngines don't get "locked" files in the list, so won't try to open
these.

Save/Load dialog updates save list every time SavesSyncRequest tells it
to.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1b9987ddc9 GUI: Add getOSDFormat() and make OSD 32 bpp 2016-08-24 16:07:55 +06:00
Alexander Tkachev
2a15b8b280 GUI: Add clearOSD() method
So one can erase everything from OSD and then blit something on it.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
7ff1f91808 GUI: Add copyRectToOSD()
I was lazy to implement that in OpenGLGraphicsManager and I'm not sure
it's implemented correctly in SurfaceSdlGraphicsManager, but it works
for me.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
da3b7bd8d9 CLOUD: Add GoogleDriveStorage
It has its own GoogleDriveTokenRefresher and knows how to do info().

This commit also contains JSON int -> long long int fix and
CurlJsonRequest '\n' -> ' ' fix.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b3bf532211 CLOUD: Make CloudManager singleton
It's needed to ::destroy() it in main().
2016-08-24 16:07:55 +06:00
Alexander Tkachev
4e7dec5500 CLOUD: Add DropboxCreateDirectoryRequest
Also add CloudManager::testFeature(), because syncSaves() now works fine
and I don't want to break it again and again with my testing requests.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
eb63b50b7f CLOUD: Refactor Request
Added ErrorResponse and ErrorCallback. Each Request now has an
ErrorCallback, which should be called instead of usual callback in case
of failure.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
cc4512e50b COMMON: Add SaveFileManager::openRawFile()
It's needed for the cloud saves upload/sync feature.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
701b07adfb COMMON: Fix JSON to understand integers correctly 2016-08-24 16:07:55 +06:00
Peter Bozsó
81c34adaef Fix comment formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
14d60e62f8 CLOUD: Fix format string warnings
I get 'warning: ISO C++98 does not support the '%lg' ms_printf format'
warning though.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f4547f44df CLOUD: Add RequestIdPair struct
Can be used with Callback<T> (means it's still type safe). It's used to
pass not only Request id to user's callback, but also a value user
wanted.

void *data field is removed from RequestInfo.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ae8e7f39f5 CLOUD: Make download() create necessary directories
DumpFile::open() with createPath=true create would create the missing
directories from the path before opening a file. Thus, one can easily
create a file and avoid "can't open a file" error.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d014b5bf38 CLOUD: Fix MemoryReadWriteStream
There was a problem with file downloading in MinGW. Strangely, there is
no such problem in Visual Studio, yet this fixes the problem.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5f4bbe6e9e CLOUD: Add OneDrive Storage stub
Knows how to OAuth already.

This commit also adds CloudManager::addStorage(), so OneDriveStorage can
add newly created Storage and CloudManager can save it in the
configuration file.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
41e65db7d0 CLOUD: Add Storage saving mechanism
In this commit CloudManager starts supporting multiple Storage. Now, in
its init() it loads all the Storages and determines the current one.

It now also has save() method. In that method all Storages are saved
with their new saveConfig() method.

CloudManager::save() not called from anywhere, though. The only one
Storage that could be added is DropboxStorage in case you have no
cloud-related config keys or you have no storages connected.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b570499164 CLOUD: Add Callback typedefs
And do some minor cleanup work.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9e531e3ce7 CLOUD: Polish Callbacks
Cleaned up all example code and old callbacks.

New Callback classes are introduced in "common/callback.h" and
documented.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e1109c0c32 CLOUD: Add CallbackBridge
This commit also adds GlobalFunctionCallback, because it was needed in
order to replace plain C pointers to functions (which were used in
Request) into our object-oriented BaseCallback pointers.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ca456a7241 CLOUD: Add object-oriented Callbacks
These callbacks can call object's methods, not some global C functions.

DropboxStorage::info2() and DropboxStorage::infoMethodCallback()
demonstrate the idea.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
17eb5f9143 CLOUD: Add complex callbacks
Originally, I intended to add Storage API, StorageFile and StorageInfo
stubs. When I tried to implement a simple info() call, I ended up fixing
Request to contain some pointer field and all callbacks to have Request*
parameter. And, now I have to place callback pointer into Request. which
calls another callback.

And, eventually, these "simple" callbacks would again require another
pointer (to some caller class).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e743a65636 CLOUD: Add Dropbox into CloudManager's configs
This commit adds:
* ConfMan's new "cloud" domain;
* CloudManager's init() method, where it loads keys from "cloud" configs
domain;
* CurlJsonRequest's addHeader() and addPostField() methods;
* temporary Storage's printInfo() method;
* DropboxStorage's implementation of printInfo(), which is using access
token and user id;
* DropboxStorage's loadFromConfig() static method to load access token
and user id from configs and create a Storage instance with those;
* temporary DropboxStorage's authThroughConsole() static method, which
guides user through auth process from the console.

So, in CloudManager's init() implementation ScummVM checks that there is
"current_storage_type" key in "cloud" domain of configs, and loads
corresponding storage if there is such key.

If there is no such key, ScummVM offers user to auth with Dropbox.
That's done through console, and thus it's temporary (it also requires
restarting ScummVM twice and manually editing config.ini file).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
03217cd5c3 CLOUD: Add CurlJsonRequest
Now we can do REST API request by creating CurlJsonRequest and waiting
for it to call our callback. Passed pointer is Common::JSONValue.

This commit also does some minor variable renaming fixes.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9c22b7cc64 CLOUD: Rewrite NetworkReadStream
Now it is based on MemoryReadWriteStream, which is introduced by this
commit. This stream is using ring buffer and is dynamically increasing
its size when necessary.
2016-08-24 16:07:55 +06:00