Commit Graph

677 Commits

Author SHA1 Message Date
Adrian Frühwirth
00e59a3122 ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:

1. Graphics::loadThumbnail()

   Now returns a boolean and takes a new argument skipThumbnail which
   defaults to false. In case of true, loadThumbnail() reads past the
   thumbnail data in the input stream instead of actually loading the
   thumbnail. This simplifies savegame handling where, up until now,
   many engines always read the whole savegame metadata (including
   the thumbnail) and then threw away the thumbnail when not needed
   (which is in almost all cases, the most common exception being
   MetaEngine::querySaveMetaInfos() which is responsible for loading
   savegame metadata for displaying it in the GUI launcher.

2. readSavegameHeader()

   Engines which already implement such a method (name varies) now take
   a new argument skipThumbnail (default: true) which is passed
   through to loadThumbnail(). This means that the default case for
   readSavegameHeader() is now _not_ loading the thumbnail from a
   savegame and just reading past it. In those cases, e.g.
   querySaveMetaInfos(), where we actually are interested in loading
   the thumbnail readSavegameHeader() needs to explicitely be called
   with skipThumbnail == false.

   Engines whose readSavegameHeader() (name varies) already takes an
   argument loadThumbnail have been adapted to have a similar
   prototype and semantics.
   I.e. readSaveHeader(in, loadThumbnail, header) now is
   readSaveHeader(in, header, skipThumbnail).

3. Error handling

   Engines which previously did not check the return value of
   readSavegameHeader() (name varies) now do so ensuring that possibly
   broken savegames (be it a broken thumbnail or something else) don't
   make it into the GUI launcher list in the first place.
2018-04-07 09:26:20 +02:00
Eugene Sandulenko
59905eee0d DRASCULA: Added support for Russian fan translation 2018-02-21 22:39:09 +01:00
Filippos Karapetis
2a8e624bfe DRASCULA: Clean up logic in enterRoom() 2017-11-19 20:50:13 +02:00
Filippos Karapetis
33cb29d558 DRASCULA: Document several updateVisible() calls 2017-11-19 20:50:12 +02:00
Eugene Sandulenko
34d19ff424 DRASCULA: Fix ego manipulation for translated versions 2017-11-18 22:42:06 +01:00
Filippos Karapetis
64b57afe2c Revert "DRASCULA: Revert range 4dbed774..1f1d8607"
This reverts commit bf69b25e33.

The original game had slight differences between the code for each
chapter. Part of these changes was to simplify the code and unify
some of these differences, particularly in the checks for clickable
areas, where the code is using Common::Rects with contains() now.

I have play tested the whole game with these changes, there are no
visible regressions, and the game is still completable. Thus, I'm
restoring the changes to the engine.
2017-11-15 01:49:50 +02:00
Willem Jan Palenstijn
bf69b25e33 DRASCULA: Revert range 4dbed774..1f1d8607
This reverts
1f1d8607 DRASCULA: Merge the floor coordinates into _walkRect
1e1b6f7c DRASCULA: Rename gotoObject() to walkToPoint() and simplify it
2bf05c2a DRASCULA: Clean up room variables, and simplify some related checks

Reverting due to unanswered questions about why the changes in behaviour
in 2bf05c2a74 are correct.
2017-11-14 19:14:00 +01:00
Eugene Sandulenko
327dcf98ec DRASCULA: Make remaining static texts translatable
drascula.dat file version bumped
2017-11-14 04:07:11 +01:00
Filippos Karapetis
1f1d860797 DRASCULA: Merge the floor coordinates into _walkRect 2017-11-11 17:14:38 +02:00
Filippos Karapetis
1e1b6f7ca4 DRASCULA: Rename gotoObject() to walkToPoint() and simplify it 2017-11-11 17:14:38 +02:00
Filippos Karapetis
2bf05c2a74 DRASCULA: Clean up room variables, and simplify some related checks 2017-11-11 17:14:38 +02:00
Filippos Karapetis
4dbed7742a DRASCULA: Reduce the scope of framesWithoutAction 2017-11-11 17:14:37 +02:00
Filippos Karapetis
fd8a86038a DRASCULA: walkToObject is a boolean variable 2017-11-11 17:14:37 +02:00
Filippos Karapetis
d81869af58 DRASCULA: Simplify the drawing code in BJ's room 2017-11-11 17:14:36 +02:00
Filippos Karapetis
51cd9b4888 DRASCULA: Remove superfluous variable 2017-11-11 17:14:36 +02:00
Filippos Karapetis
1c2a9d2e12 DRASCULA: characterMoved and characterVisible are boolean variables 2017-11-11 17:14:36 +02:00
Colin Snover
432fd522d2 ENGINES: Remove default1x scaler flag
This flag is removed for a few reasons:

* Engines universally set this flag to true for widths > 320,
  which made it redundant everywhere;
* This flag functioned primarily as a "force 1x scaler" flag,
  since its behaviour was almost completely undocumented and users
  would need to figure out that they'd need an explicit non-default
  scaler set to get a scaler to operate at widths > 320;
* (Most importantly) engines should not be in the business of
  deciding how the backend may choose to render its virtual screen.
  The choice of rendering behaviour belongs to the user, and the
  backend, in that order.

A nearby future commit restores the default1x scaler behaviour in
the SDL backend code for the moment, but in the future it is my
hope that there will be a better configuration UI to allow users
to specify how they want scaling to work for high resolutions.
2017-10-07 12:30:29 -05:00
Thierry Crozat
c095cb31d1 DRASCULA: Add possibility to load and save games using GMM 2017-04-22 23:53:10 +01:00
Willem Jan Palenstijn
2af9ab6f61 DRASCULA: Add bound check asserts to copyRect
Bug #7110 showed a crash here. Even though that was likely a compiler
error, these extra checks shouldn't hurt.
2017-02-11 16:50:28 +01:00
Thierry Crozat
b7e87d9e09 DRASCULA: Link speech and SFX volumes 2017-02-11 14:38:58 +00:00
Thierry Crozat
13dd57d34f DRASCULA: Fix sound volume synchronization
When using the original drascula dialog to change volume, this was
not saved to the ConfMan, which means the change was lost when
quitting the engine or when opening the ScummVM options dialog.

Also synchronising the _mixer volumes from ConfMan was resetting
the master volume to the maximum. Since ScummVM doesn't have a
master volume, there is no correct way to get it. But we now try to
guess one from the music and speech volumes.
2017-02-11 14:38:58 +00:00
Thierry Crozat
f7e5f01b85 DRASCULA: Add handling of the master volume 2017-02-11 14:38:34 +00:00
Eugene Sandulenko
0e5788f4e3 Merge pull request #866 from BenCastricum/editing
ALL: Unify messages concerning engine data files
2016-12-17 12:45:38 +01:00
Thierry Crozat
e5ef7a6398 DRASCULA: Fix bug when talking to drunkard in chapter 2
The bug made it possible to only talk once to the drunkard. Any
further attempt to talk to him did nothing. This led to a dead end
if we did not ask about Von Braun the first time around.

This was a bug in ScummVM. The original game did not have the bug.
2016-12-08 22:44:07 +00:00
Thierry Crozat
b0588526e8 DRASCULA: Increase debug level for copyBackground
This function is called a lot, and having a debug level of 1 made it very
difficult to find any other debug prints.
2016-12-08 22:44:07 +00:00
Ben Castricum
ebaab44cd1 ALL: Leave out instructions for engine data issues 2016-12-08 13:38:56 +01:00
Ben Castricum
55512414dd ALL: Change instructions for engine data file issues
The engine data files should be included in the package, so downloading
may not be the best suggestion. Instead refer to the README.
2016-12-06 14:16:37 +01:00
Ben Castricum
1cf3f50b74 ALL: Unify 'wrong version of engine data' message 2016-12-06 09:38:25 +01:00
Ben Castricum
eb7ffb1e2c ALL: Unify 'corrupted engine data' message 2016-12-06 09:38:19 +01:00
Ben Castricum
e1ec91b69a ALL: Unify 'missing engine data' message 2016-12-05 21:04:50 +01:00
Ben Castricum
e95c2cc3ff ALL: save file => saved game 2016-11-29 21:10:59 +01:00
Ben Castricum
b041618a42 ALL: Remove comma before the word 'instead' 2016-11-29 20:22:19 +01:00
Eugene Sandulenko
dead4aa014 JANITORIAL: Remove trailing spaces 2016-10-09 14:59:58 +02:00
Thierry Crozat
a87a702eb2 ALL: Homogeneize use of 'saved game' in messages 2016-09-18 16:40:34 +01:00
Alexander Tkachev
b665fc933d ALL: Make simpleSaveNames() a MetaEngineFeature
Added it into hasFeature() of all engines which returned `true` in
simpleSaveNames() before.

As mentioned in #788, SCI is not always using simple names, so it
doesn't have such feature now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ab1d160ec8 ALL: Add MetaEngine::simpleSaveNames()
Engines with "simple" savenames would support "Run in background" in
save/load dialog and gradual save slots unlocking. Other engines
save/load feature would be locked until save sync is over.
2016-08-24 16:07:55 +06:00
Thierry Crozat
abb33e5362 DRASCULA: Fix slight delay when interrupting intro animation
The delay occurred when trying to interrupt the animation while at
the start of the first scene with Igor. After the interruption (skipping
the intro, return to launcher or quitting ScummVM) it would continue
to play the animation for a bit longer than necessary.
2016-07-20 20:18:40 +01:00
Eugene Sandulenko
33abb6118f ALL: Change main engine header guard defines to <directory>_<engine>_H
Recently we started to use this as new semantics, although in the past
we used simly <engine>_H. Now these guard defines are consistent with
rest of the files which are used in the engines.
2016-05-17 18:21:30 +02:00
Thierry Crozat
6393315a8e DRASCULA: Remove delays when showing and hiding the inventory
I don't see any purpose to this delays and they were not present in
the original engine. It works fine without those and the interface
seems more responsive.

This fixes bug #7121 DRASCULA: Delay and freeze when pressing
right mouse click on game

Also move a delay when left clicking to after performing the action.
With the delay between the left click and the action, the mouse
position could have moved when performing the action, resulting
in the wrong action being performed (e.g. activating the wrong verb
or picking the wrong object in the inventory). But removing the
delay altogether causes flickering when picking objects from the
inventory.
2016-04-17 23:41:32 +01:00
Thierry Crozat
d05d4263e5 DRASCULA: Remove delay for select verb
The delay, since it updates the mouse position, resulted in a
different verb being selected than the one we clicked on when
moving the mouse quickly after the clic. This was quite confusing
and frustrating. I can't see any reason for this delay and it seems
to work well without it. The initial commit adding it indicates this
was "for better mouse response", but it added a lot of other delays
at the same time, and removing this one doesn't see to impact the
mouse response (on the contrary, we get the new cursor quicker).
2016-04-17 23:23:23 +01:00
Thierry Crozat
e44470ab54 DRASCULA: Fix noise when playing sound.
The original engine skipped the first 32 and last 32 bytes of the
data when playing a sound. We did not do it in ScummVM which
resulted in noise at the start and/or end of some speech. This
was most noticeable with Spanish speech but also occurred
occasionally with English speech.

This fixes bug #7120 Drascula: Audio noise before every voice in
the game
2016-04-17 22:17:01 +01:00
Thierry Crozat
e90f01bc0c DRASCULA: Fix axe visibility flag when entering room 31
The visible[1] flag in room 31 (i.e. for the axe) is now reset according
to flags[13] (which indicate if we picked up the axe already or not).

This fixes bug #7118 Drascula: Axe item can be picked up infinite
times
2016-04-17 22:14:20 +01:00
Thierry Crozat
6dcaef191c DRASCULA: Fix animations speed
To time animations the original engine uses interrupt to get the
Real Time Clock and divides the number of clock ticks by 0.182.
Since there is approximately 18.2 ticks per second, this means
it uses values in 1/100th of a second. In ScummVM we were using
getMillis() / 20, so the animations was two times slower than in
the original.

This might fix bug #7115 Drascula: FPS are incorrect or some
frames are dropped.

Note that for the walk animation we are still not exactly using the
timing of the original. The original engines keeps each walk frames
for 5.7 times 1/100th of a second (i.e. 17.54 FPS). In ScummVM
getTime returns an integer value and as a result each walk frame is
now kept for 6 times 1/100th of a second (i.e. 16.67 FPS, which i
 better than the 8.33 FPS we were getting before this commit).

 as our getTime returns integer values and thus we use
frames for 6 of 1/100th of a second while the original is slightly
faster as it kept frames for 5.7 times 1/100th of a second.
2016-04-16 18:59:27 +01:00
Thierry Crozat
eef8371432 DRASCULA: Swap extraSurface and tableSurface use in chapter 6 for Spanish version
This simplifies the code and bring it closer to the original source code.
This should help if we need to debug issues in the future.
2016-04-16 18:59:27 +01:00
Ori Avtalion
3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
Thierry Crozat
323549316d DRASCULA: Improve text centering
When splitting strings into several lines to fit on the screen the
original engine could result in lines with one character beyond
the right edge of the screen, which in practice would be drawn
on the next line on its own, aligned to the left (and not centered).
This commits adds a check to avoid this situation. So although
it now behaves slightly differently than the original engine this
is for the better.
2016-04-13 21:08:31 +01:00
Thierry Crozat
7a65c3c4b0 DRASCULA: Fix cursor visibility during animation at start of chapter 6
Here we transition from an animation at end of chapter 5 to another
animation at start of chapter 6. Usually the cursor is hidden when
performing the action that triggers the animation. But here there is
no action to trigger it and the cursor is made visible when starting
a new chapter or entering a room (so between the two animations).
So explicitly hide it at the start of this specific animation (and it gets
shown again when we enter room 102 at the end of the animation).
2016-04-12 22:19:43 +01:00
Thierry Crozat
e3cb949b95 DRASCULA: Fix wrong background for inventory in chapter 6
This was a regression from commit fa3d3e3 and this fixes part of
bug #7113 DRASCULA: Serious sprite glitches.

The original uses extraSurface to draw text in draw_abc() in the
Spanish version while other languages use tableSurface. But in
ScummVM this was changed to use tableSurface for all languages.
However this caused an issue in chapter 6 when displaying the
inventory has it is also using tableSurface, as it was for all languages
in the original. While using the same surface works for other
languages, in the Spanish version we get the wrong background in
the inventory.

Rather than revert to using extraSurface for drawing text which is
a big change and impact all the chapters, I have opted to simply
swap the usage of the tableSurface and extraSurface in chapter 6
for the Spanish version compared to the original engine. The
changes therefore only impact chapter 6 and only the Spanish
version. I played the chapter in full to check that it indeed works
without causing adverse effects.
2016-04-12 22:19:43 +01:00
Thierry Crozat
cb4c6e547d DRASCULA: Fix regression in subtitle display in Spanish version
This code was committed by mistake in the previous commit.
2016-04-11 19:58:29 +01:00
Thierry Crozat
882299a1b4 DRASCULA: Fix typo in variable name 2016-04-11 09:13:05 +01:00