Commit Graph
137148 Commits
Author SHA1 Message Date
Roland van Laar 274be05986 DIRECTOR: LINGO: use lctxIndex in lscr dumps
Dumpfiles for Lingoscripts (lscr) were named based on the castId.
The castId read from the script is not always unique causing
name clashes for the dumps.
The lctxIndex for scripts is unique, resolving the name clash.
2020-07-26 16:44:42 +02:00
Scott Percival 4bfffc43a7 DIRECTOR: Move widgets from cast members to channels (#2372)
This change is required to support copies of the same cast member running in different channels.

* DIRECTOR: Move widget ownership from cast member to channel

* DIRECTOR: Cache cast dimensions from createWidget

* DIRECTOR: Add null checks for createWidget

* GRAPHICS: MACGUI: Clear active/hover WM references if the widget is destroyed

* DIRECTOR: LINGO: Re-add null check for kTheEditableText

* DIRECTOR: Avoid destroying widgets if the channel isn't dirty

* DIRECTOR: Fix dirty test

* DIRECTOR: Fix text field writeback

* DIRECTOR: Fix null cast check

* DIRECTOR: Add bbox as argument to createWidget

* DIRECTOR: Add setCast method to Channel

* DIRECTOR: Fix use-after-free in Channel::getMask

* DIRECTOR: Fix bounding box for Button sprites

* DIRECTOR: Cache widget dimensions in cast member

* DIRECTOR: Remove widget from channel if nextSprite is empty

* GRAPHICS: MACGUI: Fix MacText::splitString for empty string case

* DIRECTOR: Add null checks for movie and score in processEvents
2020-07-26 04:32:29 +00:00
Eugene Sandulenko 9c22d5bc8f DIRECTOR: Sort module.mk 2020-07-25 22:35:18 +02:00
Gunnar Birke 9ef28a9295 WINTERMUTE: Load in light color values as argb (like wme scripts) 2020-07-25 22:19:54 +02:00
Gunnar Birke 7d5304df4b WINTERMUTE: Use either scene or custom ambient light depending on flag 2020-07-25 22:19:54 +02:00
Gunnar Birke a520a824a4 WINTERMUTE: Use incoming script value to get the new state in setter 2020-07-25 22:19:54 +02:00
Gunnar Birke 7b9174934a WINTERMUTE: Do not use GL_REPLACE for texture environment mode 2020-07-25 22:19:53 +02:00
Gunnar Birke 3346fc3595 WINTERMUTE: Enable lighting in 3d render mode 2020-07-25 22:19:53 +02:00
Gunnar Birke cc381158ef WINTERMUTE: Set ambient color of mesh material to diffuse value 2020-07-25 22:19:53 +02:00
Gunnar Birke 53d1276c72 WINTERMUTE: Implement AdSceneGeometry::createLights 2020-07-25 22:19:53 +02:00
Gunnar Birke eda47e878a WINTERMUTE: Pass game object ref to lights and cameras during load 2020-07-25 22:19:53 +02:00
Gunnar Birke eebef4b9c3 WINTERMUTE: Fix formatting 2020-07-25 22:19:52 +02:00
Gunnar Birke 2a840e6443 WINTERMUTE: Implement AdSceneGeometry::enableLights function 2020-07-25 22:19:52 +02:00
Gunnar Birke c2aba90498 WINTERMUTE: Add functions for controlling active lights to renderer 2020-07-25 22:19:52 +02:00
Gunnar Birke f8c9588691 WINTERMUTE: Compute normal vectors for scene geometry 2020-07-25 22:19:46 +02:00
Gunnar Birke 6205f40a8e WINTERMUTE: Use ccw order for geometry faces 2020-07-25 21:47:30 +02:00
Gunnar Birke 436e1154fc WINTERMUTE: Use system pointers for geometry instead of VBOs 2020-07-25 21:47:30 +02:00
Gunnar Birke cddce77163 WINTERMUTE: Render scene geometry into depth buffer 2020-07-25 21:47:20 +02:00
antoniou 4685d7d2e6 ANDROID: Don't reset the autosave period to 0 upon launch 2020-07-25 22:42:43 +03:00
antoniou79 18ba1461e0 SKY: Fix loading the wrong saved file from ScummVM menu 2020-07-25 16:53:41 +03:00
Cameron Cawley 453cc63c02 BACKENDS: Remove unneeded use of Graphics::createPixelFormat 2020-07-25 13:32:45 +02:00
Cameron Cawley 0a29fced6e WII: Replace use of Graphics::ColorMasks 2020-07-25 13:32:45 +02:00
Cameron Cawley ceed6b2c8c NULL: Allow using Ctrl+C to open the debugger 2020-07-25 13:31:33 +02:00
Cameron Cawley 80430b4756 GRAPHICS: Ensure that creating a ManagedSurface from another preserves the palette 2020-07-25 13:29:09 +02:00
Cameron Cawley 731596b5f7 GRAPHICS: Support converting between different palettes using ManagedSurface 2020-07-25 13:29:09 +02:00
Cameron Cawley 44e948a283 GRAPHICS: Support full alpha when blitting using masks in ManagedSurface 2020-07-25 13:29:09 +02:00
Eugene Sandulenko c5e532f1ad AUDIO: Fix warning 2020-07-25 13:20:15 +02:00
Zvika Haramaty 61cd56009d AGI: Apple2GS: Make Speed menu configurable 2020-07-25 00:36:43 +02:00
Zvika Haramaty 1c36be4d8a AGI: Apple2GS: Add Speed menu and commands 2020-07-25 00:36:43 +02:00
NMIError 11c74aaef8 MIDI: Updated MidiParser documentation 2020-07-25 00:35:47 +02:00
NMIError dcdcca3d31 GROOVIE: Initialize MIDI on direct game load
The 7th Guest has MIDI initialization files for GM and the MT-32 that need to
run for these devices to sound correctly. When loading a game from the ScummVM
main menu, MIDI initialization was not performed.

This change adds this. It runs a slightly changed copy of the game's MIDI init
script when loading a game using the ScummVM menus. It also tracks if MIDI init
has been performed, so it doesn't run a second time when loading a game.

I don't know if the script works properly for the Mac and iOS versions of the
game (or if it is even needed), so I've only enabled it for the DOS versions of
the game for now.
2020-07-25 00:35:47 +02:00
NMIError da64fdc3d1 MIDI: Fix MIDI parser tracker overflow
The MIDI parser tracks the number of ticks and microseconds since the start of
playback of the current track. If a track loops infinitely, the tracker
eventually overflows (after about 71 minutes). The parser would then go haywire,
sending out the MIDI events at full speed and not terminating hanging notes,
resulting in loads of polyphony overrun errors. This does not affect looping
using jumpToTick or autoLoop, because that resets the tracker.

This change fixes this for the XMIDI parser. processEvent implementations can
now set a bool flag on the event, indicating that the event has caused a loop.
The MIDI parser will then reset the ticks and microseconds on the tracker to 0,
maintaining the deltas between the previous event values and current values.
The absolute number of ticks and microseconds since track start do not seem to
be needed anywhere; only the difference with the previous event is relevant.

This should fix bugs #6275 and #4354.
2020-07-25 00:35:47 +02:00
NMIError 5da83d8ea0 GROOVIE: Pause music when ScummVM menu is open
The MIDI music would keep playing while the ScummVM menu was open. This would
cause the music for cutscenes to go out of sync. I've added pausing to the
MusicPlayerMidi to fix this.
2020-07-25 00:35:47 +02:00
NMIError 3ad8c85af2 MIDI: Prevent duplicate MIDI messages
The MIDI parser would send All Notes Off events on all MIDI channels as a
safety measure when stopping playback in various situations without first
checking if a track was actually playing. Depending on the specifics of the
code driving the MIDI parser, this could generate many duplicate All Notes Off,
Sustain off and/or Pitch Bend center messages. This is a problem for slow MIDI
hardware like the MT-32, which needs some time to process all these messages.
As a result, the timing at the beginning of the next track could be wrong.

I've introduced checks in stopPlaying, setTrack, unloadMusic and the MIDI
parser destructor so that allNotesOff is called once when a track is playing,
and not a second time when playback has already stopped. Similarly, unloadMusic
does not execute when no music is loaded to prevent duplicate Pitch Bend
messages.
2020-07-25 00:35:47 +02:00
NMIError 315bbc7b5b MIDI: Use driver-specific impl. for stopping all notes
When the MIDI parser wanted to stop all notes on a MIDI device, it would send
an All Notes Off message and, optionally, a Sustain off message on all 16 MIDI
channels. This is inefficient for devices like the MT-32, which uses only 9
channels. The MT-32 hardware is also quite slow, so it is more responsive if it
has to process less messages.

I've added a generic stopAllNotes message to the MIDI driver using the old
method, which can be overriden by more specific implementations in subclasses.
The Miles MIDI driver implementation sends All Notes Off only on the channels
used by the MT-32. There are probably also more efficient implementations
possible for f.e. AdLib.
2020-07-25 00:35:47 +02:00
NMIError 0856c04bfa GROOVIE: Remove dead music code
The Groovie engine implemented some functionality which was later reimplemented
in the generic Miles drivers. These are now used by the engine, but the old
code is still present. I've removed this to clean up the audio code.
2020-07-25 00:35:47 +02:00
NMIError 848d8315a6 MIDI/GROOVIE: Refactor XMIDI timbre chunk loading
XMIDI timbre chunk processing was implemented using a callback. This
reimplements this using an interface for the necessary driver method, which is
a somewhat cleaner solution.
2020-07-25 00:35:47 +02:00
NMIError b38f1f00ac MIDI/GROOVIE: Fix MT-32 XMIDI timbre init delays
XMIDI data for the MT-32 can contain a timbre chunk which contains the custom
timbre numbers used for a track. Before starting playback of the track, the
timbres must be loaded into the MT-32 using SysEx messages. Each SysEx message
needs a delay before sending the next message to give the MT-32 enough time to
process it.

The delays between the messages were generated using the OSystem::delayMillis
function. This throws off the timing of the MidiParser, which causes MIDI
messages to "pile up", in this case at the start of the track. This change adds
a queue to the Miles MIDI driver, which can store the SysEx messages that must
be executed. The MidiParser suspends playback until the driver has sent all
messages in the queue.

This fixes the start of tracks in The 7th Guest, which had incorrect timing.

Because of the new SysEx queue, MT-32 initialization of The 7th Guest takes a
bit longer than it did before. The game plays an animation of a fixed length
and aborts the initialization if it is not done by the end of the animation.
This problem was already fixed for the GM initialization, so I've applied the
same fix for the MT-32.
2020-07-25 00:35:47 +02:00
NMIError 50772c1fbc MIDI: Fix XMIDI custom timbre loading
XMIDI files have an optional header defining custom timbres used for each
track. Before playback these timbres have to be sent to the MIDI device. The
old implementation of this functionality had two problems:

- The custom timbres were only sent during loading of the XMIDI data, for the
first track. If another track was played, the custom timbres for that track
would not be loaded.
- The custom timbres were sent after starting playback of the track. This
caused the sending of the timbres to sometimes overlap with the start of the
playback of the track, causing wrong instruments and bad timing.

If fixed these issues by moving the loading of the timbres to a new event
handler which is triggered during the setTrack function, before playback is
started.

This fixes problems with some MT-32 tracks in The 7th Guest, f.e. the second
track that plays on the main menu after starting the game.
2020-07-25 00:35:47 +02:00
NMIError 2f4937bd6d MIDI: Fix XMIDI SysEx Final Data controller
XMIDI defines controllers which allow the MIDI data to send controller changes
that build up SysEx messages. The last SysEx data byte is specified using the
Final Data controller, which should append the final byte to the SysEx message
and send it to the MIDI device. The old implementation did not append the last
byte. Additionally, when increasing the memory address for the SysEx, it did
not take into account that the MIDI bytes are 7 bit.

This commit fixes these issues. This restores a missing data byte in a SySex in
the MIDI initialization of The 7th Guest.
2020-07-25 00:35:47 +02:00
NMIError dd0090dc7a GROOVIE: Use new Miles MIDI driver functionality
This adds using the updated Miles MIDI driver for GM music and using the driver
for source volume scaling.

This reduces the amount of MIDI volume messages when fading, because they are
now only sent on active MIDI channels and if they are different from the
current channel volume. This fixes problems with hardware MIDI devices like the
MT-32 and SC-55, which have trouble dealing with the high number of messages.
2020-07-25 00:35:47 +02:00
Kari Salminen 580a7e6568 CINE: Fix formatting, string copy and signedness.
Fix code formatting, string copying (strncpy -> strlcpy) and signedness (int -> uint).
2020-07-25 00:33:42 +02:00
Kari Salminen 9c68b62eb9 CINE: Fix clang compilation and DeepCode warning.
Change structure initialization from C++11 style to older style to fix
clang compilation. Add null check to fix DeepCode warning about
possible undefined behaviour.
2020-07-25 00:33:42 +02:00
Kari Salminen 2ca52fc007 CINE: Add support for Operation Stealth.
Add support for Operation Stealth PC 16 and 256 color versions with
AdLib and Roland MT-32 sound. Add support for 20 extended savegames
(Thumbnails, playtime etc) for both Future Wars and Operation Stealth
(20 because it fits on screen using the original save/load interface).

Details:
 - Add versioning to Future Wars and Operation Stealth savegames.
 - Add fade in effect to both Future Wars and Operation Stealth.
 - Add mouse wheel support and keyboard support to moving in menus.
 - Map middle mouse button to pressing both left and right buttons.
 - Make interface more responsive (See manageEvents() and drawFrame()).
 - Amiga versions should be completable but sound may or may not work.
 - Atari ST versions completely untested.

Game options currently supported:
 - Using original save/load interface
 - Using transparent dialog boxes in 16 color scenes (Also for PC)

Console commands currently supported:
 - labyrinthCheat (For cheating in Operation Stealth's labyrinths)
 - disableLabyrinthCheat (Disabling labyrinth cheat)
 - disableHacks (Disabling hacks, useful for testing)
 - enableHacks (Enabling hacks, useful for testing. On by default)
2020-07-25 00:33:42 +02:00
aryanrawlani28 22842d1a88 GUI: RTL: Do not repeatedly print warnings if fribidi is not available
- Previously, if using an RTL-based language and disabled fribidi, console would repeatedly have the same messages spamming.
- Reduce this to only print warning one time.
2020-07-25 00:32:34 +02:00
aryanrawlani28 2a239efa80 GUI: Always mark editable as dirty when press home or end
- Before, the implementation used to fetch this value based on setCaretPos.
- That would return true only if string needed scrolling.
- Thus, the small issue arised that 2 chars would be wobbled together. This commit fixes that.
2020-07-25 00:32:34 +02:00
aryanrawlani28 ed71d58b55 GUI: THEMES: Rebuild default-inbuilt theme for new changes in the rtl widgets. 2020-07-25 00:24:42 +02:00
aryanrawlani28 227a2b5413 GUI: THEMES: Rebuild theme packages to update rtl-widget spacings 2020-07-25 00:24:42 +02:00
aryanrawlani28 56bd98da26 GUI: THEMES: Update graphics files to correctly space rtl-widgets 2020-07-25 00:24:42 +02:00
Thierry Crozat 11015a917b GUI: Add missing space in tooltip 2020-07-24 22:36:27 +01:00