Skip to content

Commit a3aea10

Browse files
committed
enable audio in movie files with this one simple trick
Turns out, audio works in scripted movies just fine. So, add a parameter to the Lua API to allow movies to play audio.
1 parent 829edaa commit a3aea10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

code/scripting/api/libs/graphics.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,20 +2176,20 @@ ADE_FUNC(resetClip, l_Graphics, NULL, "Resets the clipping region that might hav
21762176
return ADE_RETURN_TRUE;
21772177
}
21782178

2179-
ADE_FUNC(openMovie, l_Graphics, "string name, boolean looping = false",
2179+
ADE_FUNC(openMovie, l_Graphics, "string name, [boolean looping = false, boolean withAudio = false]",
21802180
"Opens the movie with the specified name. If the name has an extension it will be removed. This function will "
21812181
"try all movie formats supported by the engine and use the first that is found.",
21822182
"movie_player", "The cutscene player handle or invalid handle if cutscene could not be opened.")
21832183
{
21842184
const char* name = nullptr;
21852185
bool looping = false;
2186-
if (!ade_get_args(L, "s|b", &name, &looping)) {
2186+
bool with_audio = false;
2187+
if (!ade_get_args(L, "s|bb", &name, &looping, &with_audio)) {
21872188
return ade_set_error(L, "o", l_MoviePlayer.Set(movie_player_h()));
21882189
}
21892190

2190-
// Audio is disabled for scripted movies at the moment
21912191
cutscene::PlaybackProperties props;
2192-
props.with_audio = false;
2192+
props.with_audio = with_audio;
21932193
props.looping = looping;
21942194

21952195
auto player = cutscene::Player::newPlayer(name, props);

0 commit comments

Comments
 (0)