Commit Graph
35 Commits
Author SHA1 Message Date
Le Philousophe abb4c3cd6c LASTEXPRESS: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh f8881f661b LASTEXPRESS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02: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 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
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
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
Eugene Sandulenko acfcbd5919 LASTEXPRESS: Fix logic comparison 2016-05-03 17:12:36 +02: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
Johannes Schickel 3d4f409572 LASTEXPRESS: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Littleboy bc4e10dabc LASTEXPRESS: Remove some unreachable code 2012-08-27 21:49:39 -04:00
Littleboy 94e2ea10cd LASTEXPRESS: Add menu-related warnings and turn some warnings into errors 2012-07-27 13:42:06 -04:00
Littleboy 7423885f69 LASTEXPRESS: Remove entity include in savepoint.h 2012-07-27 01:14:30 -04:00
Littleboy 0635d99ec7 LASTEXPRESS: Cleanup
- Add missing initializer/destructors
 - Add some const modifiers
 - Remove some unneeded casts
 - Use enumeration values in switch constructs
2012-07-14 14:26:00 -04:00
Littleboy 732a2c80dd LASTEXPRESS: Remove duplicated include statements 2012-07-14 13:23:54 -04:00
Littleboy bc298a58f5 LASTEXPRESS: Simplify SoundQueue::updateQueue()
- Remove useless cache code
 - Use helper function to get the proper sound entry
 - Fix crash on using an invalid entry
2011-07-08 22:03:34 -04:00
Eugene Sandulenko c4b2800145 LASTEXPRESS: implement Sound::updateQueue() and all dependent functions 2011-07-06 14:40:22 +03:00
Littleboy 47e9a6ccdc LASTEXPRESS: Move sound filtering to base Sound class
- Rename kSoundStatusRemoved to kSoundStatusClosed
 - Rename kSoundStatusClear2 to kSoundStatusCached
 - Remove sound cache handling
2011-07-04 14:26:31 -04:00
Littleboy a5398bd663 LASTEXPRESS: Fix loading of subtitles from sound name 2011-07-01 01:17:08 -04:00
Littleboy 3385fd37b9 LASTEXPRESS: Hook up preliminary sound filtering
- Add debug checks in soundFilter()
 - Rename kSoundStatusClear1 to kSoundStatusFilterVariant
2011-06-29 12:06:33 -04:00
Littleboy 2788cb8bf7 LASTEXPRESS: Update sound timer and sound entry playing
- Move filtering to SoundEntry class
 - Make some methods of SoundEntry class private
 - Add methods to check if a StreamedSound/AppendableSound is done playing
2011-06-29 11:07:28 -04:00
Littleboy 9cc5d404c7 LASTEXPRESS: Replace shared sound buffer by per-entry buffer 2011-06-29 11:07:24 -04:00
Littleboy 04933a1937 LASTEXPRESS: Make SoundEntry members private 2011-06-28 23:17:13 -04:00
Littleboy b4ac4988cc LASTEXPRESS: Cleanup comments 2011-06-28 22:54:51 -04:00
Littleboy 90dc4f9a8c LASTEXPRESS: Move Sound class to the sound folder 2011-06-28 22:30:24 -04:00
Littleboy 6eace0ca75 LASTEXPRESS: Move sound queue related functions to a separate class
- Implement missing queue reset function
 - Cleanup SoundManager::playLoopingSound()
2011-06-28 22:13:40 -04:00
Littleboy d1341387e3 LASTEXPRESS: Move more entry-related functions to Entry class 2011-06-28 20:09:56 -04:00
Eugene Sandulenko 73d2d34e01 LASTEXPRESS: Give proper name to another sound struct member 2011-06-25 14:50:07 +03:00
Littleboy 3f4d2c8130 LASTEXPRESS: Move subtitle-related methods to the SubtitleEntry class 2011-06-24 11:43:10 -04:00
Littleboy 5d020fffad LASTEXPRESS: Refactor Sound class
- Move entry-related functions to separate class
 - Move enumeration to shared header and rename FlagType to SoundFlag
2011-06-24 10:56:49 -04:00