Remove last bits of HOSTAGE_FACES code
As far as I can tell, this never shipped, so remove it.
This commit is contained in:
parent
6df4c2d372
commit
63c77101d3
|
@ -232,61 +232,6 @@ int CompressHostages()
|
|||
//@@ return 1;
|
||||
//@@}
|
||||
|
||||
int SelectNextFace()
|
||||
{
|
||||
int start = Hostages[CurrentHostageIndex].vclip_num;
|
||||
|
||||
if (!hostage_is_valid( CurrentHostageIndex ) )
|
||||
return 0;
|
||||
|
||||
do {
|
||||
Hostages[CurrentHostageIndex].vclip_num++;
|
||||
if ( Hostages[CurrentHostageIndex].vclip_num >= MAX_HOSTAGES)
|
||||
Hostages[CurrentHostageIndex].vclip_num = 0;
|
||||
|
||||
if (Hostages[CurrentHostageIndex].vclip_num == start)
|
||||
return 0;
|
||||
|
||||
} while (Hostage_face_clip[Hostages[CurrentHostageIndex].vclip_num].num_frames == 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SelectPrevFace()
|
||||
{
|
||||
int start = Hostages[CurrentHostageIndex].vclip_num;
|
||||
|
||||
if (!hostage_is_valid( CurrentHostageIndex ) )
|
||||
return 0;
|
||||
|
||||
do {
|
||||
Hostages[CurrentHostageIndex].vclip_num--;
|
||||
if ( Hostages[CurrentHostageIndex].vclip_num < 0)
|
||||
Hostages[CurrentHostageIndex].vclip_num = MAX_HOSTAGES-1;
|
||||
|
||||
if (Hostages[CurrentHostageIndex].vclip_num == start)
|
||||
return 0;
|
||||
|
||||
} while (Hostage_face_clip[Hostages[CurrentHostageIndex].vclip_num].num_frames == 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int PlayHostageSound() {
|
||||
int sound_num;
|
||||
|
||||
if (!hostage_is_valid( CurrentHostageIndex ) )
|
||||
return 0;
|
||||
|
||||
sound_num = Hostage_face_clip[Hostages[CurrentHostageIndex].vclip_num].sound_num;
|
||||
|
||||
if ( sound_num > -1 ) {
|
||||
digi_play_sample( sound_num, F1_0 );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//@@int find_next_hostage_sound() {
|
||||
//@@ int start=0,n;
|
||||
//@@
|
||||
|
@ -468,7 +413,6 @@ int hostage_dialog_handler(UI_DIALOG *dlg, d_event *event, hostage_dialog *h)
|
|||
gr_set_current_canvas( h->hostageViewBox->canvas );
|
||||
|
||||
if ( vclip_num > -1 ) {
|
||||
vclip_play( h, &Hostage_face_clip[vclip_num], DeltaTime );
|
||||
} else {
|
||||
gr_clear_canvas( CGREY );
|
||||
}
|
||||
|
|
|
@ -371,9 +371,6 @@ int gamedata_read_tbl(int pc_shareware)
|
|||
TmapInfo[i].flags = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<MAX_HOSTAGES; i++ )
|
||||
Hostage_face_clip[i].num_frames=0;
|
||||
|
||||
Num_effects = 0;
|
||||
for (i=0; i<MAX_EFFECTS; i++ ) {
|
||||
//Effects[i].bm_ptr = (grs_bitmap **) -1;
|
||||
|
@ -512,7 +509,6 @@ int gamedata_read_tbl(int pc_shareware)
|
|||
else IFTOK("$POWERUP") {bm_read_powerup(0); continue;}
|
||||
else IFTOK("$POWERUP_UNUSED") {bm_read_powerup(1); continue;}
|
||||
else IFTOK("$HOSTAGE") {bm_read_hostage(); continue;}
|
||||
else IFTOK("$HOSTAGE_FACE") {bm_read_hostage_face(skip, pc_shareware);continue;}
|
||||
else IFTOK("$ROBOT") {bm_read_robot(skip); continue;}
|
||||
else IFTOK("$WEAPON") {bm_read_weapon(skip, 0); continue;}
|
||||
else IFTOK("$WEAPON_UNUSED") {bm_read_weapon(skip, 1); continue;}
|
||||
|
@ -1789,14 +1785,6 @@ void bm_read_hostage_face(int skip, int pc_shareware)
|
|||
if (!pc_shareware)
|
||||
{
|
||||
Assert(clip_num>=0 && clip_num<MAX_HOSTAGES);
|
||||
|
||||
ab_load(skip, abm_name, Hostage_face_clip[clip_num].frames, &Hostage_face_clip[clip_num].num_frames );
|
||||
|
||||
Assert(Hostage_face_clip[clip_num].num_frames < MAX_BITMAPS_PER_BRUSH);
|
||||
|
||||
Hostage_face_clip[clip_num].play_time = time;
|
||||
Hostage_face_clip[clip_num].sound_num = sound_num;
|
||||
Hostage_face_clip[clip_num].frame_time = time/Hostage_face_clip[clip_num].num_frames;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
100
main/gamesave.c
100
main/gamesave.c
|
@ -1192,10 +1192,6 @@ int load_level(const char * filename_passed)
|
|||
return 3;
|
||||
}
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
PHYSFSX_fseek(LoadFile,hostagetext_offset,SEEK_SET);
|
||||
load_hostage_data(LoadFile,(version>=1));
|
||||
#endif
|
||||
(void)hostagetext_offset;
|
||||
|
||||
//======================== CLOSE FILE =============================
|
||||
|
@ -1525,9 +1521,6 @@ int save_level_sub(char * filename, int compiled_version)
|
|||
save_game_data(SaveFile);
|
||||
hostagetext_offset = PHYSFS_tell(SaveFile);
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
save_hostage_data(SaveFile);
|
||||
#endif
|
||||
|
||||
PHYSFS_seek(SaveFile, sizeof(int) + sizeof(Gamesave_current_version));
|
||||
PHYSFS_writeSLE32(SaveFile, minedata_offset);
|
||||
|
@ -1560,38 +1553,6 @@ int save_level(char * filename)
|
|||
return r1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
void save_hostage_data(PHYSFS_file * fp)
|
||||
{
|
||||
int i,num_hostages=0;
|
||||
|
||||
// Find number of hostages in mine...
|
||||
for (i=0; i<=Highest_object_index; i++ ) {
|
||||
int num;
|
||||
if ( Objects[i].type == OBJ_HOSTAGE ) {
|
||||
num = Objects[i].id;
|
||||
#ifndef SHAREWARE
|
||||
if (num<0 || num>=MAX_HOSTAGES || Hostage_face_clip[Hostages[num].vclip_num].num_frames<=0)
|
||||
num=0;
|
||||
#else
|
||||
num = 0;
|
||||
#endif
|
||||
if (num+1 > num_hostages)
|
||||
num_hostages = num+1;
|
||||
}
|
||||
}
|
||||
|
||||
cfile_write_int(HOSTAGE_DATA_VERSION,fp);
|
||||
|
||||
for (i=0; i<num_hostages; i++ ) {
|
||||
cfile_write_int(Hostages[i].vclip_num,fp);
|
||||
fputs(Hostages[i].text,fp);
|
||||
fputc('\n',fp); //fgets wants a newline
|
||||
}
|
||||
}
|
||||
#endif //HOSTAGE_FACES
|
||||
|
||||
#endif //EDITOR
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
@ -1640,64 +1601,3 @@ void dump_mine_info(void)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
void load_hostage_data(PHYSFS_file * fp,int do_read)
|
||||
{
|
||||
int version,i,num,num_hostages;
|
||||
|
||||
hostage_init_all();
|
||||
|
||||
num_hostages = 0;
|
||||
|
||||
// Find number of hostages in mine...
|
||||
for (i=0; i<=Highest_object_index; i++ ) {
|
||||
if ( Objects[i].type == OBJ_HOSTAGE ) {
|
||||
num = Objects[i].id;
|
||||
if (num+1 > num_hostages)
|
||||
num_hostages = num+1;
|
||||
|
||||
if (Hostages[num].objnum != -1) { //slot already used
|
||||
num = hostage_get_next_slot(); //..so get new slot
|
||||
if (num+1 > num_hostages)
|
||||
num_hostages = num+1;
|
||||
Objects[i].id = num;
|
||||
}
|
||||
|
||||
if ( num > -1 && num < MAX_HOSTAGES ) {
|
||||
Assert(Hostages[num].objnum == -1); //make sure not used
|
||||
// -- Matt -- commented out by MK on 11/19/94, hit often in level 3, level 4. Assert(Hostages[num].objnum == -1); //make sure not used
|
||||
Hostages[num].objnum = i;
|
||||
Hostages[num].objsig = Objects[i].signature;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (do_read) {
|
||||
version = PHYSFSX_readInt(fp);
|
||||
|
||||
for (i=0;i<num_hostages;i++) {
|
||||
|
||||
Assert(Hostages[i].objnum != -1); //make sure slot filled in
|
||||
|
||||
Hostages[i].vclip_num = PHYSFSX_readInt(fp);
|
||||
|
||||
#ifndef SHAREWARE
|
||||
if (Hostages[i].vclip_num<0 || Hostages[i].vclip_num>=MAX_HOSTAGES || Hostage_face_clip[Hostages[i].vclip_num].num_frames<=0)
|
||||
Hostages[i].vclip_num=0;
|
||||
|
||||
Assert(Hostage_face_clip[Hostages[i].vclip_num].num_frames);
|
||||
#endif
|
||||
|
||||
PHYSFSX_fgets(Hostages[i].text, HOSTAGE_MESSAGE_LEN, fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
for (i=0;i<num_hostages;i++) {
|
||||
Assert(Hostages[i].objnum != -1); //make sure slot filled in
|
||||
Hostages[i].vclip_num = 0;
|
||||
}
|
||||
|
||||
}
|
||||
#endif //HOSTAGE_FACES
|
||||
|
||||
|
|
|
@ -992,10 +992,6 @@ void DoPlayerDead()
|
|||
|
||||
dead_player_end(); //terminate death sequence (if playing)
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
stop_all_hostage_clips();
|
||||
#endif
|
||||
|
||||
#ifdef EDITOR
|
||||
if (Game_mode == GM_EDITOR) { //test mine, not real level
|
||||
object * player = &Objects[Players[Player_num].objnum];
|
||||
|
|
168
main/hostage.c
168
main/hostage.c
|
@ -45,109 +45,6 @@ hostage_data Hostages[MAX_HOSTAGES]; // Data for each hostage in mine
|
|||
//------------- Internally used hostage variables --------------------------------------------------
|
||||
static fix Hostage_animation_time=-1; // How long the rescue sequence has been playing - units are frames, not seconds - -1 means not playing
|
||||
|
||||
vclip Hostage_face_clip[MAX_HOSTAGES];
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
|
||||
static fix HostagePlaybackSpeed=0; // Calculated internally. Frames/second of vclip.
|
||||
static int Hostage_monitor_x = 204; // X location of monitor where hostage face appears
|
||||
static int Hostage_monitor_y = 152; // Y
|
||||
static int Hostage_monitor_w = 55; // Width of monitor
|
||||
static int Hostage_monitor_h = 41; // Height of monitor
|
||||
|
||||
char Hostage_global_message[HOSTAGE_MAX_GLOBALS][HOSTAGE_MESSAGE_LEN];
|
||||
int Hostage_num_globals=0;
|
||||
|
||||
#define MAX_HOSTAGE_CLIPS 5
|
||||
|
||||
static int Hostage_queue[MAX_HOSTAGE_CLIPS];
|
||||
static vclip *Hostage_vclip=NULL; // Used for the vclip on monitor
|
||||
static int N_hostage_clips=0;
|
||||
|
||||
#define RESCUED_VCLIP_NUM 8
|
||||
#define RESCUED_SOUND_NUM 91
|
||||
|
||||
//starts next clip in queue
|
||||
void start_hostage_clip()
|
||||
{
|
||||
int i,vclip_num,hostage_number;
|
||||
|
||||
Assert(Hostage_animation_time==-1); //none should be playing
|
||||
|
||||
get_hostage_window_coords(&Hostage_monitor_x,&Hostage_monitor_y,&Hostage_monitor_w,&Hostage_monitor_h);
|
||||
|
||||
hostage_number = Hostage_queue[0]; //get first in queue
|
||||
|
||||
//drop the queue
|
||||
N_hostage_clips--;
|
||||
for (i=0;i<N_hostage_clips;i++)
|
||||
Hostage_queue[i] = Hostage_queue[i+1];
|
||||
|
||||
//get vclip num - either special one, or randomly-selected generic one
|
||||
if ( Hostages[hostage_number].vclip_num > -1 )
|
||||
vclip_num = Hostages[hostage_number].vclip_num;
|
||||
else
|
||||
vclip_num = RESCUED_VCLIP_NUM;
|
||||
|
||||
Hostage_vclip = &Hostage_face_clip[vclip_num];
|
||||
|
||||
// Set the time to be zero to start hostage vclip display sequence
|
||||
Hostage_animation_time = 0;
|
||||
|
||||
// Calculate the frame/second of the playback
|
||||
HostagePlaybackSpeed = fixdiv(F1_0,Hostage_vclip->frame_time);
|
||||
|
||||
// Start the sound for this hostage
|
||||
if ( Hostage_vclip->sound_num > -1 )
|
||||
digi_play_sample( Hostage_vclip->sound_num, F1_0 );
|
||||
|
||||
}
|
||||
|
||||
//add this hostage's clip to the queue
|
||||
void queue_hostage_clip(int hostage_num)
|
||||
{
|
||||
if ((PlayerCfg.CockpitMode[1]!=CM_FULL_COCKPIT && PlayerCfg.CockpitMode[1]!=CM_STATUS_BAR) || N_hostage_clips>=MAX_HOSTAGE_CLIPS)
|
||||
return; //no cockpit, or queue is full
|
||||
|
||||
Hostage_queue[N_hostage_clips] = hostage_num;
|
||||
|
||||
N_hostage_clips++;
|
||||
|
||||
if (Hostage_animation_time<=0) //none playing?
|
||||
start_hostage_clip(); //..start this one!
|
||||
|
||||
}
|
||||
|
||||
//current clip is done, stop it
|
||||
void stop_hostage_clip()
|
||||
{
|
||||
get_hostage_window_coords(&Hostage_monitor_x,&Hostage_monitor_y,&Hostage_monitor_w,&Hostage_monitor_h);
|
||||
|
||||
nosound(); // Turn off sound
|
||||
Hostage_animation_time = -1; // Consider this vclip done
|
||||
|
||||
if (N_hostage_clips) //more in queue?
|
||||
start_hostage_clip();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void stop_all_hostage_clips()
|
||||
{
|
||||
N_hostage_clips = 0;
|
||||
Hostage_animation_time=-1;
|
||||
}
|
||||
|
||||
int hostage_is_vclip_playing()
|
||||
{
|
||||
if (Hostage_animation_time>=0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//---------------- Initializes the hostage system ----------------------------------------------------
|
||||
void hostage_init()
|
||||
{
|
||||
|
@ -179,71 +76,8 @@ void hostage_rescue( int hostage_number )
|
|||
if (Newdemo_state != ND_STATE_PLAYBACK)
|
||||
digi_play_sample(SOUND_HOSTAGE_RESCUED, F1_0);
|
||||
|
||||
#ifndef HOSTAGE_FACES
|
||||
|
||||
HUD_init_message(HM_DEFAULT, TXT_HOSTAGE_RESCUED);
|
||||
|
||||
#else
|
||||
|
||||
// Show the text message
|
||||
if ( strlen(Hostages[hostage_number].text) )
|
||||
gauge_message("%s", Hostages[hostage_number].text );
|
||||
else {
|
||||
if ( Hostage_num_globals > 0 ) {
|
||||
int mn;
|
||||
mn = (d_rand()*Hostage_num_globals)/D_RAND_MAX;
|
||||
if ( mn>=0 && mn < Hostage_num_globals )
|
||||
gauge_message("%s", &Hostage_global_message[mn][0] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( Newdemo_state == ND_STATE_RECORDING )
|
||||
newdemo_record_hostage_rescued( hostage_number );
|
||||
|
||||
queue_hostage_clip(hostage_number);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
|
||||
//------------- Called once per frame to do the hostage effects --------------------------------
|
||||
//returns true if something drew
|
||||
int do_hostage_effects()
|
||||
{
|
||||
int bitmapnum;
|
||||
|
||||
// Don't do the effect if the time is <= 0
|
||||
if ( Hostage_animation_time < 0 )
|
||||
return 0;
|
||||
|
||||
// Find next bitmap in the vclip
|
||||
bitmapnum = f2i(Hostage_animation_time);
|
||||
|
||||
// Check if vclip is done playing.
|
||||
if (bitmapnum >= Hostage_vclip->num_frames) {
|
||||
stop_hostage_clip();
|
||||
|
||||
if (Hostage_animation_time >= 0) //new clip
|
||||
bitmapnum = f2i(Hostage_animation_time);
|
||||
else
|
||||
return 0; //no new one
|
||||
}
|
||||
|
||||
get_hostage_window_coords(&Hostage_monitor_x,&Hostage_monitor_y,&Hostage_monitor_w,&Hostage_monitor_h);
|
||||
|
||||
PIGGY_PAGE_IN(Hostage_vclip->frames[bitmapnum]);
|
||||
gr_bitmap(Hostage_monitor_x,Hostage_monitor_y,Hostage_vclip->frames[bitmapnum]);
|
||||
|
||||
// Increment the hostage rescue time scaled to playback speed.
|
||||
// This means that the integer part of the fix is the frame number
|
||||
// of the animation.
|
||||
|
||||
Hostage_animation_time += fixmul(FrameTime,HostagePlaybackSpeed);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#define LINEBUF_SIZE 100
|
||||
|
||||
|
|
|
@ -115,8 +115,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
#include "vclip.h"
|
||||
|
||||
//#define HOSTAGE_FACES 1 //if defined, hostage faces are in
|
||||
|
||||
#define HOSTAGE_SIZE i2f(5) // 3d size of a hostage
|
||||
|
||||
#define MAX_HOSTAGE_TYPES 1
|
||||
|
@ -143,8 +141,6 @@ extern int Num_hostages;
|
|||
|
||||
extern int Hostage_vclip_num[MAX_HOSTAGE_TYPES]; // for each type of hostage
|
||||
|
||||
extern vclip Hostage_face_clip[MAX_HOSTAGES];
|
||||
|
||||
extern hostage_data Hostages[MAX_HOSTAGES];
|
||||
|
||||
void draw_hostage(object *obj);
|
||||
|
@ -161,12 +157,4 @@ int hostage_is_valid( int hostage_num );
|
|||
int hostage_object_is_valid( int objnum );
|
||||
void hostage_init_info( int objnum );
|
||||
|
||||
#ifdef HOSTAGE_FACES
|
||||
int hostage_is_vclip_playing();
|
||||
void stop_all_hostage_clips();
|
||||
#else
|
||||
#define hostage_is_vclip_playing() (0)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue