Commit Graph
345 Commits
Author SHA1 Message Date
Bastien Bouclet 9a4c0ae281 ENGINES: Normalize the getName() result of metaengines
Also-By: Matthew Hoops <clone2727@gmail.com>
2018-12-10 06:47:27 +01:00
Evgeny Grechnikov af580eaa85 LASTEXPRESS: save/load sound state
Warning: breaks compatibility with previous savefiles.
They were mostly broken anyway, locking any NPC who
waited for kActionEndSound when savefile was created.
2018-10-20 16:35:23 +03:00
Evgeny Grechnikov 9f7ae73a7b LASTEXPRESS: loud train noise when NPC exits car
If Cath stands near the beginning or the end of a car,
looks at a door, and a NPC opens this door,
the volume of train noise is temporarily raised.

Controlled by variables SoundManager::_data{0,1,2},
renamed to be not so mysterious.
2018-10-20 00:32:10 +03:00
Evgeny Grechnikov 06b7bb47ba LASTEXPRESS: case-insensitive lookup in sound queue 2018-10-19 23:37:35 +03:00
Evgeny Grechnikov 8a374bdf0c LASTEXPRESS: rnd() should not return a constant 2018-10-18 00:56:28 +03:00
Evgeny Grechnikov 54562554f9 LASTEXPRESS: better names in sound code
Refactoring, no changes in behaviour.
2018-10-18 00:38:01 +03:00
Evgeny Grechnikov b7b5fbbad2 LASTEXPRESS: support for looped sounds 2018-10-17 23:03:00 +03:00
Evgeny Grechnikov d561fd8a83 LASTEXPRESS: dynamic adjusting of sound volume
Now it works just like in the original game,
including fading where it is applicable
(e.g. in a passengers list if closing the list while a sound is playing).

By the way, p2s sequence is known as http://oeis.org/A000265 ,
p1s is 4 - A007814, and p2s[i]/2**p1s[i] is just i/16.
It is time to get rid of these arrays.
2018-10-16 23:57:25 +03:00
Evgeny Grechnikov 29f6ce1d9a LASTEXPRESS: support for delay-activated sounds
Not very obvious, but noticeable e.g. when knocking on harem doors.
I suppose this is the problem that wiki describes
as "improper triggering of actions on sound end".
2018-10-16 23:01:26 +03:00
D G Turner cc5d858169 LASTEXPRESS: Remove Engine Specific All Debug Level.
This is replaced by the global "all" option for debugflags and defining
this triggers a warning about the conflict at runtime.
2018-10-16 18:25:03 +01:00
D G Turner 5d340d244c LASTEXPRESS: Fix Compiler Warning in Sound Code.
The SoundFlag type is an enumeration which have a default underlying
type of unsigned int in most case.

Thus comparing this to -1 causes a compiler warning. Since the default
entity sound flag type is 0xFFFF... which is equivalent to -1, then
replacing this with the correct enum symbol fixes the issue and should
result in the correct behaviour. Examination of the resulting code line
seems to confirm that this is the correct expected logic.
2018-10-16 13:30:44 +01:00
Evgeny Grechnikov 43fb9ebb1b LASTEXPRESS: drop sound thread
The backend runs its own sound thread anyway,
with the corresponding bookkeeping that we use.
We don't need yet another sound thread,
and it is always nice to not have something
that could change our structures from underneath us.
2018-10-16 01:03:55 +03:00
Evgeny Grechnikov 8162309212 LASTEXPRESS: fix race condition in sound code
SoundEntry::play() calls StreamedSound::setFilterId(),
StreamSound::setFilterId() requires the underlying reference to be alive.
SoundQueue::handleTimer() checks that the stream is still alive
by calling SoundEntry::isFinished(). However, if the stream is finalized
just between calls to SoundEntry::isFinished() and SoundEntry::play(),
the sound mixer frees the stream leading to use-after-free in setFilterId().

Turn off the automatical disposing, delete the stream in SoundEntry::~SoundEntry().
2018-10-16 00:49:07 +03:00
Thierry Crozat 457c4ee8ac LASTEXPRESS: Fix compilation with some compilers 2018-10-14 22:00:13 +01:00
Evgeny Grechnikov 53cd6616c9 LASTEXPRESS: refactor sound flags
Merge SoundFlag and SoundStatus into a single enum;
SoundEntry::setupStatus just casts one to another.

Keep only definitions of bits in SoundFlag; drop compound flags
like kFlagSteam = kSoundTypeAmbient | kSoundFlagLooped | kVolume7,
use ORed simple flags in calls; change the signature
of SoundManager::playSoundWithSubtitles to use uint32
instead of SoundFlag to avoid excess casting.

Add meaningful names to flags; add some comments.

Get rid of endian-unsafe SoundStatusUnion.

Fixes an issue with big-endian hosts.
No changes in behaviour on little-endian hosts.
2018-10-14 20:08:32 +03:00
Evgeny Grechnikov d36aadd3a6 LASTEXPRESS: fix constants in sound serializer
Wrong enum member used: (status & 0x7000000)
should be checked against 0x3000000, not against 3
(this is a check of sound type to skip menu sounds in savefiles).

Activate delay should not be compared with sound volume;
comparison with 0x8000000 is just a sanity check against overflow.
2018-10-14 17:29:47 +03:00
D G Turner b3b4b9c8de LASTEXPRESS: Fix GCC Enum Comparison Mismatch Warning.
This was previously comparing the Object Model to the Object Enum.
This has been corrected, but should have no functional change as the
underlying enum value of 1 is identical for both symbols.
2018-09-24 19:09:14 +01:00
D G Turner f1ded1f111 LASTEXPRESS: Fix GCC Warnings
These were for missing parentheses to clarify logical expressions.
2018-09-24 18:43:35 +01:00
Evgeny Grechnikov f057ac75ce LASTEXPRESS: more fixes in NPC logic 2018-09-24 01:57:44 +03:00
D G Turner f0f02c4a3f LASTEXPRESS: Add Missing End Markers to Detection Entry File Lists.
This omission might have caused detection issues, but unlikely to cause
crashes.
2018-09-14 03:17:56 +01:00
Martin Gerhardy 3128c0be2f LASTEXPRESS: added detection entry for gog release 2018-09-14 02:38:02 +01:00
Martin Gerhardy be71f5b990 LASTEXPRESS: fixed warnings with gcc 8.2
engines/lastexpress/entities/alexei.cpp: In member function ‘void LastExpress::Alexei::standingAtWindow(const LastExpress::SavePoint&)’:
engines/lastexpress/entities/alexei.cpp:772:49: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C++      engines/lastexpress/entities/chapters.o
engines/lastexpress/entities/august.cpp: In member function ‘void LastExpress::August::function21(const LastExpress::SavePoint&)’:
engines/lastexpress/entities/august.cpp:672:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    switch(params->param5) {
    ^~~~~~
engines/lastexpress/entities/august.cpp:694:3: note: here
   case 9:
   ^~~~
2018-09-13 20:55:49 +01:00
Evgeny Grechnikov 0cb6b30f67 LASTEXPRESS: more fixes in NPC logic 2018-09-11 23:14:30 +03:00
Evgeny Grechnikov 6a1e5c1d93 LASTEXPRESS: more fixes in NPC logic 2018-09-02 21:07:00 +03:00
Evgeny Grechnikov 39ad93d738 LASTEXPRESS: fix gcc build 2018-08-26 12:09:43 +02:00
Evgeny Grechnikov f771fa40ad LASTEXPRESS: multiple fixes in NPC logic
Checked the logic against the original game
(to be precise, DOS English version from GOG, although I think
AI logic has no significant differences with other versions).
Fixed a *lot* of errors with varying visibility for the user.

Also, save+exit+load sometimes resulted in memory corruption like
((EntityParametersSSII*)(new EntityParametersIIII))->param8 = 0;
load operation did not restore the correct type of NPC logic context,
the default one was used (which also has the smallest sizeof).
Should be fixed now. Save+load is still unusable because it locks
everybody waiting for kActionEndSound (the sound state is not restored),
but, at least, it should not corrupt the memory. Hopefully.
2018-08-26 12:09:43 +02:00
Adrian Frühwirth 0524ff6e8d JANITORIAL: Silence GCC 7 fallthrough warnings 2018-03-23 18:34:17 +01: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
Torbjörn Andersson 70a2ca8b7d JANITORIAL: Silence more GCC 7 warnings
All these fall through were marked as deliberate, so again I've only
changed the comment to silence GCC.
2017-08-06 13:30:51 +02:00
Littleboy c443b84dae LASTEXPRESS: Rename Vassili functions 2016-09-23 22:19:01 -04:00
Littleboy 45025d53e0 LASTEXPRESS: Rename Vesna functions 2016-09-23 22:19:00 -04:00
Littleboy 71766fcc65 LASTEXPRESS: Rename Tatiana functions 2016-09-23 22:19:00 -04: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
Eugene Sandulenko d8caeed074 LASTEXPRESS: Fixed potential buffer overrun 2016-05-13 09:08:59 +02:00
Eugene Sandulenko acfcbd5919 LASTEXPRESS: Fix logic comparison 2016-05-03 17:12:36 +02:00
Johannes Schickel 0b6befdcc5 ENGINES: Make variable names of AdvancedMetaEngine conform to our guidelines.
_singleid   -> _singleId
_gameids    -> _gameIds
_guioptions -> _guiOptions
2016-03-08 19:01:13 +01:00
Eugene Sandulenko 23d74fddb4 CONFIGURE: Introduced new engine dependency: highres
Some backends like GCW0 do no support graphics >320x240 due to
the hardware limitation (downscaling is possible but it will ruin
the pixel hunting which is often part of the gameplay).

Instead of manually updating the list of engines, we now introduce
a new dependency.

I marked all relevant engines, but some, like tinsel, require more
work with putting their relevant high-res games under USE_HIGHRES
define.
2016-03-05 14:25:56 +01:00
Eugene Sandulenko 866baf1d9a LASTEXPRESS: Removing excess check 2015-11-27 22:34:26 +01:00
Matthew Hoops 030e4d0608 AUDIO: Make Rewindable- and SeekableAudioStream inherit virtually 2015-08-30 19:53:53 -04:00
Littleboy ae12264c5f LASTEXPRESS: Fix potential out-of-bounds read. CID 1003992 2014-06-16 18:46:32 -04:00
Littleboy 94861cd73c LASTEXPRESS: Check for resulting sequence size in August logic code. CID 1003264 2014-06-16 18:46:31 -04:00
Littleboy be563f3c19 LASTEXPRESS: Add assert check in Gendarmes logic. CID 1003263 2014-06-16 18:46:30 -04:00
Littleboy cf360e6721 LASTEXPRESS: Rename Ivo functions 2014-06-16 18:46:29 -04:00
Littleboy 0a4cf53df1 LASTEXPRESS: Fix comparison in sound entry serialization. CID 1004148 2014-06-16 18:46:28 -04:00
Littleboy 4f78d1faec LASTEXPRESS: Add asserts in sound entry serialization and update code. CID 1003259, 1003260 2014-06-16 18:46:27 -04:00
Littleboy 771cae50e4 LASTEXPRESS: Check that the archive is loaded correctly in debug code. CID 1003848, 1003849 2014-06-16 18:46:25 -04:00
Littleboy 5aad09213b LASTEXPRESS: Replace useless checks by asserts. CID 1004086, 1004090 2014-06-16 18:46:24 -04:00
Littleboy 71a703d8bb LASTEXPRESS: Update SavePoint::push/call interface and check for string size. CID 1003261, 1003262 2014-06-16 18:46:23 -04:00
Littleboy cbb7c71c89 LASTEXPRESS: Add asserts in EntityData serialization code. CID 1003265 2014-06-16 18:46:22 -04:00
Littleboy 9e1c0f14a8 LASTEXPRESS: Rename Max functions 2014-06-16 18:46:21 -04:00