Skip to content

Commit

Permalink
RTS movie test
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Nov 12, 2023
1 parent 0374da2 commit f22f5e0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source_files/edge/rad_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "hu_style.h"
#include "hu_stuff.h"
#include "g_game.h"
#include "i_movie.h"
#include "m_argv.h"
#include "m_menu.h"
#include "m_random.h"
Expand Down Expand Up @@ -685,6 +686,13 @@ void RAD_ActChangeMusic(rad_trigger_t *R, void *param)
S_ChangeMusic(music->playnum, music->looping);
}

void RAD_ActPlayMovie(rad_trigger_t *R, void *param)
{
s_movie_t *mov = (s_movie_t *)param;

E_PlayMovie(mov->movie);
}

void RAD_ActChangeTex(rad_trigger_t *R, void *param)
{
s_changetex_t *ctex = (s_changetex_t *)param;
Expand Down
1 change: 1 addition & 0 deletions source_files/edge/rad_act.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void RAD_ActSpawnThing(rad_trigger_t *R, void *param);
void RAD_ActPlaySound(rad_trigger_t *R, void *param);
void RAD_ActKillSound(rad_trigger_t *R, void *param);
void RAD_ActChangeMusic(rad_trigger_t *R, void *param);
void RAD_ActPlayMovie(rad_trigger_t *R, void *param);
void RAD_ActChangeTex(rad_trigger_t *R, void *param);

void RAD_ActMoveSector(rad_trigger_t *R, void *param);
Expand Down
7 changes: 7 additions & 0 deletions source_files/edge/rad_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ typedef struct s_music_s
bool looping = false;
} s_music_t;

// Play Movie function
typedef struct s_movie_s
{
// lump or packfile name
std::string movie;
} s_movie_t;

// Sector Vertical movement
typedef struct s_movesector_s
{
Expand Down
14 changes: 14 additions & 0 deletions source_files/edge/rad_pars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,19 @@ static void RAD_ParseChangeMusic(param_set_t &pars)
AddStateToScript(this_rad, 0, RAD_ActChangeMusic, music);
}

static void RAD_ParsePlayMovie(param_set_t &pars)
{
// PlayMovie <lump or packfile name>

SYS_ASSERT(pars[1]);

s_movie_t *mov = new s_movie_t;

mov->movie = pars[1];

AddStateToScript(this_rad, 0, RAD_ActPlayMovie, mov);
}

static void RAD_ParseDamagePlayer(param_set_t &pars)
{
// DamagePlayer <amount>
Expand Down Expand Up @@ -2289,6 +2302,7 @@ static const rts_parser_t radtrig_parsers[] = {
{2, "RETRIGGER", 1, 1, RAD_ParseRetrigger},
{2, "CHANGE_TEX", 3, 5, RAD_ParseChangeTex},
{2, "CHANGE_MUSIC", 2, 2, RAD_ParseChangeMusic},
{2, "PLAY_MOVIE", 2, 2, RAD_ParsePlayMovie},
{2, "SHOW_MENU", 2, 99, RAD_ParseShowMenu},
{2, "SHOW_MENU_LDF", 2, 99, RAD_ParseShowMenu},
{2, "MENU_STYLE", 2, 2, RAD_ParseMenuStyle},
Expand Down

0 comments on commit f22f5e0

Please sign in to comment.