Commit graph

32 commits

Author SHA1 Message Date
Evgeny Grechnikov
54562554f9 LASTEXPRESS: better names in sound code
Refactoring, no changes in behaviour.
2018-10-18 00:38:01 +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
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
Littleboy
5aad09213b LASTEXPRESS: Replace useless checks by asserts. CID 1004086, 1004090 2014-06-16 18:46:24 -04:00
Littleboy
5310d49e53 LASTEXPRESS: Rename Server* classes to Waiter* 2014-06-16 18:46:13 -04:00
Johannes Schickel
3d4f409572 LASTEXPRESS: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Littleboy
275aded0b0 LASTEXPRESS: Remove unnecessary casts 2012-08-27 21:49:40 -04:00
Littleboy
2c0033c7ba LASTEXPRESS: Add const modifiers 2012-08-27 21:49:38 -04:00
Littleboy
839ad1303f LASTEXPRESS: Fix some formatting issues 2012-07-27 20:07:03 -04:00
Julien
7974b62b71 LASTEXPRESS: Reduce nesting in Entities::processEntity() 2012-07-27 00:15:01 -04:00
Littleboy
3cf7e8ccf3 LASTEXPRESS: Replace INCREMENT_DIRECTION_COUNTER macro 2012-07-16 23:51:30 -04:00
Littleboy
732a2c80dd LASTEXPRESS: Remove duplicated include statements 2012-07-14 13:23:54 -04:00
Tarek Soliman
a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'

This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
2012-02-15 10:07:10 -06:00
Littleboy
735fedeee9 LASTEXPRESS: Fix typos in shared game code (as reported by _sev) 2011-11-07 20:33:23 -05:00
Littleboy
ce4c98d757 LASTEXPRESS: Small cleanup in Entities::processEntity() and Entities::processFrame() 2011-09-19 09:22:59 -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
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
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Julien Templier
2687c987eb LASTEXPRESS: Add missing queue reset in Entitites::resetSequences
svn-id: r54367
2010-11-19 10:55:38 +00:00
Julien Templier
da90fa1405 LASTEXPRESS: Fix SequenceFrame leak in Entities code
- Add EntityCallData destructor to dispose of frames & Sequences
 - Properly dispose of frames in Entities::resetSequences()

svn-id: r54270
2010-11-16 14:06:59 +00:00
Julien Templier
7d9c43d22b LASTEXPRESS: Fix frame leak in Entities::processFrame()
When not keeping the previous frame, the current frame was overwritten.
We now delete it before assigning a new value.

svn-id: r54246
2010-11-15 15:48:20 +00:00
Julien Templier
521f228ced LASTEXPRESS: Use SAFE_DELETE for class variables
svn-id: r54201
2010-11-11 14:19:44 +00:00
Max Horn
e27b05ef35 COMMON: Rename String::printf() to String::format()
This is a first step towards getting rid of all uses of regular printf,
fprintf, vprintf, vfprintf, puts, fputs, etc. in our codebase.

The name format() reflects the purpose of the function, and parallels
String.format() in Java, boost::format, and others.

svn-id: r54004
2010-11-01 16:02:28 +00:00
Julien Templier
dba75791d9 LASTEXPRESS: Add some missing casts and const qualifiers
svn-id: r53880
2010-10-27 19:19:22 +00:00
Julien Templier
5323be5f84 LASTEXPRESS: Fix GCC warnings
svn-id: r53850
2010-10-26 12:49:32 +00:00
Julien Templier
dc4a22ed7d LASTEXPRESS: More savegame work
- Implement SaveLoad::writeEntry
 - Implement missing saveLoadWithSerializer functions for all serialized classes & structs
 - Add stub for SaveLoad::computePadding

svn-id: r53845
2010-10-26 06:55:34 +00:00
Julien Templier
fed894aeee LASTEXPRESS: Add missing casts, fix warnings and correct typos
svn-id: r53694
2010-10-22 01:30:18 +00:00
Jordi Vilalta Prat
59c054938a LASTEXPRESS: Fix some space formatting.
svn-id: r53629
2010-10-19 22:34:26 +00:00
Julien Templier
0c72b1800d LASTEXPRESS: Fix GCC warnings
svn-id: r53588
2010-10-18 21:03:28 +00:00
Eugene Sandulenko
86d650926f LASTEXPRESS: Merge in the engine.
svn-id: r53579
2010-10-18 19:17:38 +00:00