From 63c77101d3c1c5501c2cb3f0aa7fee1000ed4d83 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 23 Feb 2013 22:51:18 +0000 Subject: [PATCH] Remove last bits of HOSTAGE_FACES code As far as I can tell, this never shipped, so remove it. --- editor/ehostage.c | 56 ---------------- main/bmread.c | 12 ---- main/gamesave.c | 100 --------------------------- main/gameseq.c | 4 -- main/hostage.c | 168 +--------------------------------------------- main/hostage.h | 12 ---- 6 files changed, 1 insertion(+), 351 deletions(-) diff --git a/editor/ehostage.c b/editor/ehostage.c index ff53b4724..e711630a4 100644 --- a/editor/ehostage.c +++ b/editor/ehostage.c @@ -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 ); } diff --git a/main/bmread.c b/main/bmread.c index 07893ca70..ba3b57aa4 100644 --- a/main/bmread.c +++ b/main/bmread.c @@ -371,9 +371,6 @@ int gamedata_read_tbl(int pc_shareware) TmapInfo[i].flags = 0; } - for (i=0; i=0 && clip_num=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) - 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=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 -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 diff --git a/main/hostage.h b/main/hostage.h index bcf15627d..d2da78c03 100644 --- a/main/hostage.h +++ b/main/hostage.h @@ -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