From 8da835b51495cefeaab885411bd2617a02de9cc7 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 4 Jul 2004 11:39:06 +0000 Subject: [PATCH] fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT --- include/missionbriefcommon.h | 4 +++ src/localization/localize.cpp | 15 +++++---- src/menuui/readyroom.cpp | 50 ++++++++++++++++++++++-------- src/mission/missionbriefcommon.cpp | 32 +++++++++++++++---- src/missionui/missiondebrief.cpp | 6 ++++ src/model/modelinterp.cpp | 7 +++++ src/model/modelread.cpp | 10 +++--- src/nebula/neblightning.cpp | 7 +++-- src/network/multilag.cpp | 5 ++- src/network/multiui.cpp | 5 ++- src/network/psnet2.cpp | 9 ++++-- src/palman/palman.cpp | 5 ++- src/playerman/playercontrol.cpp | 5 ++- src/ship/ship.cpp | 7 +++-- src/ship/shipfx.cpp | 5 ++- src/sound/ds.cpp | 6 +++- src/stats/medals.cpp | 5 +++ src/ui/listbox.cpp | 5 ++- src/vcodec/codec1.cpp | 2 +- 19 files changed, 145 insertions(+), 45 deletions(-) diff --git a/include/missionbriefcommon.h b/include/missionbriefcommon.h index 67f4310..2450e99 100644 --- a/include/missionbriefcommon.h +++ b/include/missionbriefcommon.h @@ -15,6 +15,9 @@ * Header file for briefing stuff common to FreeSpace and FRED * * $Log$ + * Revision 1.4 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.3 2003/05/25 02:30:42 taylor * Freespace 1 support * @@ -325,6 +328,7 @@ void mission_brief_common_init(); // Frees all the memory allocated in the briefing and debriefing structures // and sets all pointers to NULL. void mission_brief_common_reset(); +void mission_debrief_common_reset(); // -------------------------------------------------------------------------------------- diff --git a/src/localization/localize.cpp b/src/localization/localize.cpp index 14be97b..a3bb7c8 100644 --- a/src/localization/localize.cpp +++ b/src/localization/localize.cpp @@ -14,6 +14,9 @@ * * * $Log$ + * Revision 1.7 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.6 2003/06/11 18:30:32 taylor * plug memory leaks * @@ -712,13 +715,13 @@ void lcl_add_dir(char *current_path) last_char = current_path[path_len - 1]; // if the last char is a slash, just copy in the disk extension - if (last_char == '\\') { + if (last_char == DIR_SEPARATOR_CHAR) { strcat(current_path, Lcl_languages[Lcl_current_lang].lang_ext); - strcat(current_path, "\\"); + strcat(current_path, DIR_SEPARATOR_STR); } // otherwise add a slash, then copy in the disk extension else { - strcat(current_path, "\\"); + strcat(current_path, DIR_SEPARATOR_STR); strcat(current_path, Lcl_languages[Lcl_current_lang].lang_ext); } } @@ -735,7 +738,7 @@ void lcl_add_dir_to_path_with_filename(char *current_path) // find position of last slash and copy rest of filename (not counting slash) to temp // mark end of current path with '\0', so strcat will work - char *last_slash = strrchr(current_path, '\\'); + char *last_slash = strrchr(current_path, DIR_SEPARATOR_CHAR); if (last_slash == NULL) { strcpy(temp, current_path); current_path[0] = '\0'; @@ -746,7 +749,7 @@ void lcl_add_dir_to_path_with_filename(char *current_path) // add extension strcat(current_path, Lcl_languages[Lcl_current_lang].lang_ext); - strcat(current_path, "\\"); + strcat(current_path, DIR_SEPARATOR_STR); // copy rest of filename from temp strcat(current_path, temp); @@ -1078,7 +1081,7 @@ int lcl_ext_lookup(char *out, int id) // reset parsing vars and go to town Ts_current_state = TS_SCANNING; Ts_id_text_size = 0; - Ts_text_size; + Ts_text_size = 0; memset(Ts_text, 0, PARSE_TEXT_STRING_LEN); memset(Ts_id_text, 0, PARSE_ID_STRING_LEN); while((cftell(Lcl_ext_file) < Lcl_pointers[Lcl_pointer_count - 1]) && cfgets(text, 1024, Lcl_ext_file)){ diff --git a/src/menuui/readyroom.cpp b/src/menuui/readyroom.cpp index 5219347..d8d7a95 100644 --- a/src/menuui/readyroom.cpp +++ b/src/menuui/readyroom.cpp @@ -15,6 +15,9 @@ * Ready Room code, which is the UI screen for selecting Campaign/mission to play next mainly. * * $Log$ + * Revision 1.5 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.4 2003/05/25 02:30:42 taylor * Freespace 1 support * @@ -1209,37 +1212,58 @@ void sim_room_close() { int i; - for (i=0; i= 0) bm_unload(Background_bitmap); if (Standalone_mission_names_inited){ for (i=0; itype, bi->ship_class); - closeup_icon = (brief_icon*)brief_get_closeup_icon(); + closeup_icon = brief_get_closeup_icon(); + if ( bi == closeup_icon || selected ) { icon_bitmap=ib->first_frame+1; // gr_set_bitmap(ib->first_frame+1); @@ -1896,6 +1915,7 @@ int brief_set_move_list(int new_stage, int current_stage, float time) brief_stage *newb, *cb; icon_move_info *imi; int i,j,k,num_movers,is_gone=0; + vector zero_v = ZERO_VECTOR; Assert(new_stage != current_stage); @@ -1929,7 +1949,7 @@ int brief_set_move_list(int new_stage, int current_stage, float time) imi->accel = 4*imi->total_dist/(time*time); imi->last_dist=0.0f; imi->reached_dest=0; - imi->direction; + imi->direction = zero_v; vm_vec_sub(&imi->direction, &imi->finish, &imi->start); if ( !IS_VEC_NULL(&imi->direction) ) { @@ -2466,7 +2486,6 @@ void brief_common_close() { brief_close_map(); brief_unload_anims(); - mission_brief_common_reset(); } @@ -2645,7 +2664,8 @@ int brief_time_to_advance(int stage_num, float frametime) int voice_active, advance = 0; brief_icon *closeup_icon; - closeup_icon = (brief_icon*)brief_get_closeup_icon(); + closeup_icon = brief_get_closeup_icon(); + if ( closeup_icon ) { return 0; } diff --git a/src/missionui/missiondebrief.cpp b/src/missionui/missiondebrief.cpp index 39830cd..d31eb5a 100644 --- a/src/missionui/missiondebrief.cpp +++ b/src/missionui/missiondebrief.cpp @@ -15,6 +15,9 @@ * C module for running the debriefing * * $Log$ + * Revision 1.10 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.9 2003/08/03 16:10:29 taylor * cleanup; compile warning fixes * @@ -2535,6 +2538,9 @@ void debrief_close() } } + // clear out debrief info parsed from mission file + mission_debrief_common_reset(); + // unload the overlay bitmap #ifdef MAKE_FS1 help_overlay_unload(DEBRIEFING_OVERLAY); diff --git a/src/model/modelinterp.cpp b/src/model/modelinterp.cpp index d9ff9ae..962f134 100644 --- a/src/model/modelinterp.cpp +++ b/src/model/modelinterp.cpp @@ -15,6 +15,9 @@ * Rendering models, I think. * * $Log$ + * Revision 1.7 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.6 2003/05/25 02:30:43 taylor * Freespace 1 support * @@ -2826,11 +2829,15 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags g3_rotate_vertex( &p, &bank->pnt[j] ); gr_set_bitmap( Interp_thrust_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, d ); { +#ifndef PLAT_UNIX extern int Gr_scaler_zbuffering; Gr_scaler_zbuffering = 1; g3_draw_bitmap(&p,0,w*0.5f, TMAP_FLAG_TEXTURED ); //g3_draw_rotated_bitmap(&p,0.0f,w,w, TMAP_FLAG_TEXTURED ); Gr_scaler_zbuffering = 0; +#else + g3_draw_bitmap(&p,0,w*0.5f, TMAP_FLAG_TEXTURED ); +#endif } } diff --git a/src/model/modelread.cpp b/src/model/modelread.cpp index 19d048b..021f361 100644 --- a/src/model/modelread.cpp +++ b/src/model/modelread.cpp @@ -15,6 +15,9 @@ * file which reads and deciphers POF information * * $Log$ + * Revision 1.11 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.10 2004/06/11 21:39:44 taylor * x86 compile fixes for OSX patch * @@ -716,9 +719,6 @@ #include "freespace.h" // For flFrameTime #include "fvi.h" -#ifdef __APPLE__ -#include // tigital for offsetof() -#endif #define MAX_SUBMODEL_COLLISION_ROT_ANGLE (PI / 6.0f) // max 30 degrees per frame @@ -1274,7 +1274,7 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs id = cfread_int(fp); - if (id!='OPSP') + if (id != ID_PSPO) Error( LOCATION, "Bad ID in model file <%s>",filename); // Version is major*100+minor @@ -2693,7 +2693,7 @@ void submodel_stepped_rotate(model_subsystem *psub, submodel_instance_info *sii) sii->prev_angs = sii->angs; // float pointer into struct to get angle (either p,b,h) - float *ang_prev, *ang_next; + float *ang_prev = NULL, *ang_next = NULL; switch( sm->movement_axis ) { case MOVEMENT_AXIS_X: ang_prev = &sii->prev_angs.p; diff --git a/src/nebula/neblightning.cpp b/src/nebula/neblightning.cpp index 1fde264..bc35b66 100644 --- a/src/nebula/neblightning.cpp +++ b/src/nebula/neblightning.cpp @@ -15,6 +15,9 @@ * Nebula effect * * $Log$ + * Revision 1.6 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.5 2003/05/25 02:30:43 taylor * Freespace 1 support * @@ -554,7 +557,7 @@ void nebl_render_all() b->used = 0; continue; } - bi = &Bolt_types[b->type]; + bi = &Bolt_types[(int)b->type]; // if this guy is still on a delay if(b->delay != -1){ @@ -1297,7 +1300,7 @@ void nebl_jitter(l_bolt *b) if((b->type < 0) || ((b->type >= Num_bolt_types) && (b->type != DEBUG_BOLT)) ){ return; } - bi = &Bolt_types[b->type]; + bi = &Bolt_types[(int)b->type]; // get the bolt direction vm_vec_sub(&temp, &b->strike, &b->start); diff --git a/src/network/multilag.cpp b/src/network/multilag.cpp index 798e3e1..5272fae 100644 --- a/src/network/multilag.cpp +++ b/src/network/multilag.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.6 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.5 2002/06/09 04:41:24 relnev * added copyright header * @@ -355,7 +358,7 @@ int multi_lag_recvfrom(uint s, char *buf, int len, int flags, struct sockaddr *f moveup=GET_FIRST(&Lag_used_list); while ( moveup!=END_OF_LIST(&Lag_used_list) ) { // if the timestamp has elapsed - if((s == (SOCKET)moveup->socket) && ((moveup->stamp <= 0) || timestamp_elapsed(moveup->stamp))){ + if(((int)s == (SOCKET)moveup->socket) && ((moveup->stamp <= 0) || timestamp_elapsed(moveup->stamp))){ item = moveup; break; } diff --git a/src/network/multiui.cpp b/src/network/multiui.cpp index 03df44c..ce8260c 100644 --- a/src/network/multiui.cpp +++ b/src/network/multiui.cpp @@ -15,6 +15,9 @@ * C file for all the UI controls of the mulitiplayer screens * * $Log$ + * Revision 1.9 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.8 2003/05/25 02:30:43 taylor * Freespace 1 support * @@ -8687,7 +8690,7 @@ void multi_sync_pre_close() nprintf(("Network","WARNING - killing file xfer while leaving mission sync state!!!\n")); multi_xfer_abort(Net_player->s_info.xfer_handle); - Net_player->s_info.xfer_handle; + Net_player->s_info.xfer_handle = -1; } } diff --git a/src/network/psnet2.cpp b/src/network/psnet2.cpp index 10811a0..9212784 100644 --- a/src/network/psnet2.cpp +++ b/src/network/psnet2.cpp @@ -15,6 +15,9 @@ * C file containing application level network-interface. * * $Log$ + * Revision 1.12 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.11 2004/06/11 01:52:15 tigital * byte-swapping changes for bigendian systems * @@ -761,12 +764,12 @@ void psnet_close() WSACancelBlockingCall(); #endif - if ( TCP_socket != INVALID_SOCKET ) { + if ( TCP_socket != (int)INVALID_SOCKET ) { shutdown( TCP_socket, 1 ); closesocket( TCP_socket ); } - if ( IPX_socket != INVALID_SOCKET ) { + if ( IPX_socket != (int)INVALID_SOCKET ) { shutdown( IPX_socket, 1 ); closesocket( IPX_socket ); } @@ -2728,7 +2731,7 @@ int psnet_init_tcp() TCP_socket = INVALID_SOCKET; TCP_socket = socket( AF_INET, SOCK_DGRAM, 0 ); - if ( TCP_socket == INVALID_SOCKET ) { + if ( TCP_socket == (int)INVALID_SOCKET ) { Tcp_failure_code = WSAGetLastError(); ml_printf("Error on TCP startup %d\n", Tcp_failure_code); return 0; diff --git a/src/palman/palman.cpp b/src/palman/palman.cpp index 1e86ba5..59de1d6 100644 --- a/src/palman/palman.cpp +++ b/src/palman/palman.cpp @@ -15,6 +15,9 @@ * Palette manager routines * * $Log$ + * Revision 1.4 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.3 2002/06/09 04:41:25 relnev * added copyright header * @@ -457,7 +460,7 @@ uint palette_find( int r, int g, int b ) // version 18 - fixed bug with blue nondarkening colors // version 19 - fixed bug where only colors divisible by 4 got used. // version 20 - added flag to only use lower 128 colors for palette. -#define PAL_ID 'LAPV' // VPAL (Volition Palette) +#define PAL_ID 0x4c415056 // LAPV, VPAL (Volition Palette) #define PAL_VERSION 20 #define PAL_LAST_COMPATIBLE_VERSION 20 diff --git a/src/playerman/playercontrol.cpp b/src/playerman/playercontrol.cpp index ae45b80..70032c6 100644 --- a/src/playerman/playercontrol.cpp +++ b/src/playerman/playercontrol.cpp @@ -15,6 +15,9 @@ * Routines to deal with player ship movement * * $Log$ + * Revision 1.6 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.5 2003/05/25 02:30:43 taylor * Freespace 1 support * @@ -1473,7 +1476,7 @@ void player_level_init() Player->locking_subsys_parent=-1; Player->killer_objtype=-1; // type of object that killed player - Player->killer_weapon_index; // weapon used to kill player (if applicable) + Player->killer_weapon_index=-1; // weapon used to kill player (if applicable) Player->killer_parent_name[0]=0; // name of parent object that killed the player Player_all_alone_msg_inited=0; diff --git a/src/ship/ship.cpp b/src/ship/ship.cpp index 7d42dcf..c94f3b6 100644 --- a/src/ship/ship.cpp +++ b/src/ship/ship.cpp @@ -15,6 +15,9 @@ * Ship (and other object) handling functions * * $Log$ + * Revision 1.8 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.7 2003/06/11 18:30:33 taylor * plug memory leaks * @@ -4503,7 +4506,7 @@ void show_ship_subsys_count() for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) { if (objp->type == OBJ_SHIP) { - count += Ship_info[Ships[objp->type].ship_info_index].n_subsystems; + count += Ship_info[Ships[(int)objp->type].ship_info_index].n_subsystems; } } @@ -5418,7 +5421,7 @@ void ship_process_targeting_lasers() // fire a targeting laser fire_info.accuracy = 0.0f; - fire_info.beam_info_index = shipp->weapons.primary_bank_weapons[shipp->targeting_laser_bank]; + fire_info.beam_info_index = shipp->weapons.primary_bank_weapons[(int)shipp->targeting_laser_bank]; fire_info.beam_info_override = NULL; fire_info.shooter = &Objects[shipp->objnum]; fire_info.target = NULL; diff --git a/src/ship/shipfx.cpp b/src/ship/shipfx.cpp index 9f74325..ae9e832 100644 --- a/src/ship/shipfx.cpp +++ b/src/ship/shipfx.cpp @@ -15,6 +15,9 @@ * Routines for ship effects (as in special) * * $Log$ + * Revision 1.7 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.6 2003/05/25 02:30:44 taylor * Freespace 1 support * @@ -2872,7 +2875,7 @@ void engine_wash_ship_process(ship *shipp) } } - engine_wash_info *ewp = &Engine_wash_info[bank->wash_info_index]; + engine_wash_info *ewp = &Engine_wash_info[(int)bank->wash_info_index]; half_angle = ewp->angle; radius_mult = ewp->radius_mult; diff --git a/src/sound/ds.cpp b/src/sound/ds.cpp index 4a93bf9..e7bdd96 100644 --- a/src/sound/ds.cpp +++ b/src/sound/ds.cpp @@ -15,6 +15,9 @@ * C file for interface to DirectSound * * $Log$ + * Revision 1.19 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.18 2004/06/11 02:07:01 tigital * byte-swapping changes for bigendian systems * @@ -884,6 +887,7 @@ int ds_load_buffer(int *sid, int *hid, int *final_size, void *header, sound_info ALint bits, bps; ALuint frequency; ALvoid *data = NULL; + uint i; // the below two covnert_ variables are only used when the wav format is not // PCM. DirectSound only takes PCM sound data, so we must convert to PCM if required @@ -901,7 +905,7 @@ int ds_load_buffer(int *sid, int *hid, int *final_size, void *header, sound_info if(bits == 16){ ushort *swap_tmp; - for (uint i=0; idata+i); *swap_tmp = INTEL_SHORT(*swap_tmp); diff --git a/src/stats/medals.cpp b/src/stats/medals.cpp index 0d15d49..0f22b3b 100644 --- a/src/stats/medals.cpp +++ b/src/stats/medals.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.12 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.11 2003/08/03 16:10:30 taylor * cleanup; compile warning fixes * @@ -216,7 +219,9 @@ int Badge_index[MAX_BADGES]; #define RANK_MEDAL_REGION 12 // region number of the rank medal #endif +#ifdef FS2_DEMO #warning Find real FS2_DEMO spot for medals +#endif // coords for indiv medal bitmaps int Medal_coords[GR_NUM_RESOLUTIONS][NUM_MEDALS][2] = { { // GR_640 diff --git a/src/ui/listbox.cpp b/src/ui/listbox.cpp index a1de141..232b154 100644 --- a/src/ui/listbox.cpp +++ b/src/ui/listbox.cpp @@ -15,6 +15,9 @@ * Code to implement a listbox gadget. * * $Log$ + * Revision 1.4 2004/07/04 11:39:06 taylor + * fix missing debrief text, crash on exit, path separator's, warning fixes, no GR_SOFT + * * Revision 1.3 2002/06/09 04:41:29 relnev * added copyright header * @@ -418,7 +421,7 @@ void UI_LISTBOX::process(int focus) current_text = get_string(i); for (j=0; j