75301 Commits

Author SHA1 Message Date
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
f913675c43 CLOUD: Add ConnectionManager hotfix
Tried to compile these two last commits with GCC and found a few minor
problems.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0a947618fb CLOUD: Make ConnectionManager singleton
With ConnectionManager singleton one can start their Requests without
creating Storage instance. Moreover, Storage instance should contain
cloud API, not Requests-related handling and timer starting methods.
Thus, these methods were moved into ConnectionManager itself.
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
5df8c51402 CLOUD: Fix CurlJsonRequest
It's using MemoryWriteStreamDynamic instead of String and it prepares
raw byte contents of this stream for JSON::parse().
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
Alexander Tkachev
01abba4f1d CLOUD: Add ConnectionManager and NetworkReadStream
NetworkReadStream actually saves whole response in the memory now.

There is a pause mechanism in libcurl, but if libcurl is requesting
something compressed, it would have to uncompress data as it goes even
if we paused the request. Even though our own stream won't be notified
about this data when when "pause" the request, libcurl's own buffer
wound be expanding.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8b585d631b CLOUD: Add CurlRequest
CurlRequest uses own multi_handle, in which it creates an easy_handle to
make a request.

Every time `handle()` is called it checks whether request is complete
and, if it is, stops.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6ad983bb72 CLOUD: Fix GCC static cloudThread compile error
It's not static anymore.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1b89e25580 CLOUD: Add first Request
Just fooling around with the example Request, but the idea works well.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b272bba751 CLOUD: Do minor fixes 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
14785b12d3 CONFIGURE: Fix cloud support detection 2016-08-24 16:07:55 +06:00
Alexander Tkachev
fade746f37 CLOUD: Add USE_CLOUD feature
Adds USE_CLOUD in both configure and create_project.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
6c83930126 CONFIGURE: Added libcurl detection 2016-08-24 16:07:55 +06:00
Alexander Tkachev
ca2eeb2214 CLOUD: Add Cloud::Manager and Cloud::Storage
This commit introduces Common::CloudManager, which can be accessed from
OSystem.

The backend for this manager is Cloud::Manager (defined in
backends/cloud/manager.h). It should load all users storages from
configs and provide access to current Storage instance. For now it just
creates a new one.

Cloud::Storage (backends/cloud/storage.h) provides an API to interact
with cloud storage, for example, create new directory or sync files.
Right now it's not ready and has only two dummy methods: listDirectory()
and syncSaves().

There is Cloud::Dropbox::DropboxStorage backend
(backends/cloud/dropbox/dropboxstorage.h) for Cloud::Storage. Right now
it implements both listDirectory() and syncSaves() with starting timer
task and handling it by printing out some JSON examples.
2016-08-24 16:05:07 +06:00
Alexander Tkachev
7446ffd73b CLOUD: Integrate CloudThread into OSystem
Would be changed soon.
2016-08-24 16:05:07 +06:00
Eugene Sandulenko
52240c68c7 CONFIGURE: Added detection for SDL_net 2016-08-24 16:05:07 +06:00
Alexander Tkachev
e4e2ec390d CLOUD: Remove wcsncasecmp() usage from SimpleJSON
Replaced with scumm_strnicmp().
2016-08-24 16:05:07 +06:00
Alexander Tkachev
2ac2816d68 CLOUD: Refactor SimpleJSON 2016-08-24 16:05:07 +06:00
Alexander Tkachev
a7fb8c72ab CLOUD: SimpleJSON refactor
Resharper + manual methods & fields renaming.
2016-08-24 16:05:07 +06:00
Alexander Tkachev
79e6368b42 CLOUD: Add SimpleJSON library (module.mk hotfix)
Forgot to edit those.
2016-08-24 16:05:07 +06:00
Alexander Tkachev
8429c40362 CLOUD: Add SimpleJSON library as Common::JSON
This commit also adds CloudThread class, which work() method is called
every second by TimerManager.

Right now it prints JSON examples on the console, so that's why it's
introduced with SimpleJSON library.
2016-08-24 16:05:07 +06:00
Filippos Karapetis
380902eb07 SCI32: Add workarounds for a bug in Torin, in an animation of Lycentia 2016-08-24 11:57:08 +03:00
Torbjörn Andersson
796c40dc59 DIRECTOR: Add more width corrections for Apartment demo
These are the widths for the taxi. 1110 doesn't actually need a
correction to be drawn right, but 96 makes more sense than 90 if I
decode the image by hand. It may be worth noting that all three
sprite widths are multiples of 8, and that one of them was already
a multiple of 8, but I still needed to add 8 to it.

(This would suggest that w = (w & ~7) + 8 would yield the correct
width for everything, except it doesn't so scratch that idea.)
2016-08-24 07:00:39 +02:00
Paul Gilbert
3a20dca0cb TITANIC: Implemented more game classes 2016-08-23 21:46:04 -04:00
Walter van Niftrik
3d558fe6ca ADL: Make the optional scanlines less harsh 2016-08-24 01:04:37 +02:00
Eugene Sandulenko
754907f408 DIRECTOR: Gather statistic on correct bitmap sizes 2016-08-24 00:12:59 +02:00
Eugene Sandulenko
1bbbb14b30 DIRECTOR: Added test D3 target 2016-08-23 19:13:21 +02:00
Eugene Sandulenko
dbf2876b70 DIRECTOR: Further reduction of include dependency 2016-08-23 19:13:21 +02:00
Eugene Sandulenko
3d6d6fa2dd DIRECTOR: Reduce header dependency 2016-08-23 19:13:21 +02:00
Filippos Karapetis
511d9f1e40 SCI32: Fix crash in Torin, chapter 4, catapult scene (via ScreenItem)
loopNo/celNo are set to unsigned integers in ScreenItem::setFromObject
in SSCI, thus their value will be adjusted when it's negative, like in
this case
2016-08-23 15:52:54 +03:00
Paul Gilbert
a26a3d4338 TITANIC: Implemented CLift class 2016-08-23 07:40:14 -04:00
Filippos Karapetis
14f163bad1 SCI32: Allow kListAt to reference an empty list
Happens in Torin when examining Di's locket in chapter 3
2016-08-23 14:26:59 +03:00
Filippos Karapetis
d15660e70d SCI32: Add a workaround for an uninitialized variable in Torin 2016-08-23 14:06:39 +03:00
Filippos Karapetis
6929cc65f8 SCI32: Explicitly abord kEachElementDo when a game is being loaded
This is a better check than the one in commit 3d1f1a3a21
2016-08-23 13:08:37 +03:00
Filippos Karapetis
6ce472a12a SCI32: Update the SCI2/SCI2.1 games that use global 90 for speech/subs 2016-08-23 12:22:27 +03:00
Filippos Karapetis
3d1f1a3a21 SCI32: Fix restoring games from Torin's game restore dialog
The list in kListEachElementDo may be invalidated after a
selector invocation
2016-08-23 11:36:38 +03:00
Filippos Karapetis
cd00132d23 SCI32: Also handle game checks for "torinsg.cat" in Torin
This shows the "Open..." button when continuing a game
2016-08-23 11:36:37 +03:00
Eugene Sandulenko
f8483d2dab DIRECTOR: Split score.cpp file into classes 2016-08-23 09:41:00 +02:00
Eugene Sandulenko
812a43d559 DIRECTOR: Fix memory overwrite 2016-08-23 08:15:13 +02:00
Filippos Karapetis
1c19029c58 SCI32: Fix palette in SCI32 Mac games 2016-08-23 05:18:42 +03:00
Paul Gilbert
df3e545976 TITANIC: Implemented more game classes 2016-08-22 21:52:29 -04:00
Paul Gilbert
2822fb5811 TITANIC: Compilation fix 2016-08-22 20:47:14 -04:00
Paul Gilbert
8b3829549a TITANIC: Cleanup of engine references 2016-08-22 20:22:41 -04:00
Paul Gilbert
65bc8cb83c TITANIC: Implemented more game classes 2016-08-22 19:25:36 -04:00
Filippos Karapetis
f238ed18ec SCI: Fix compilation when SCI32 is not enabled 2016-08-23 01:48:06 +03:00
Walter van Niftrik
0470346ac0 ADL: Add initial support for #0: Mission Asteroid
Based on a patch by fuzzie
2016-08-23 00:36:38 +02:00
Retro-Junk
c5828a41f4 FULLPIPE: Inverse search mode behavior in MctlGraph::getHitNode 2016-08-22 22:22:00 +02:00
Retro-Junk
cb5bf0796e FULLPIPE: Fix always false condition check in MctlGraph::generateList 2016-08-22 22:21:49 +02:00