diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6425315df..f294c7c81 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20080615 +-------- +main/gameseq.c, main/mission.c, main/newdemo.c, main/scores.c: Fixed scores write (wasn't PhysFS); Fixed PLAYING_BUILTING_MISSION in D1X; Better call for DoJasonInterpolate in demo code (hopefully) + 20080612 -------- README.txt, main/collide.c, main/multi.c, main/netdrv_udp.c, main/network.c, main/state.c: Improved Player relay for Endlevel status; Fixed leaving when UDP hosts leaves; Fixed multi_frame_calling while demos since demos can be Game_mode & GM_MULTI; Re-added lost collision fix between robots and reactor; Made state_defaut_item static so selected state slot stays selected diff --git a/main/gameseq.c b/main/gameseq.c index fa0a251e0..81e824cb6 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -896,7 +896,7 @@ void PlayerFinishedLevel(int secret_flag) m[0].type = NM_TYPE_TEXT; m[0].text = " "; //TXT_SECRET_EXIT; - newmenu_do2(NULL, TXT_SECRET_EXIT, 1, m, NULL, 0, "MENU.PCX"); + newmenu_do2(NULL, TXT_SECRET_EXIT, 1, m, NULL, 0, Menu_pcx_name); } #endif diff --git a/main/mission.c b/main/mission.c index 15c79b12e..cbaeecaa2 100644 --- a/main/mission.c +++ b/main/mission.c @@ -309,7 +309,7 @@ void add_d1_builtin_mission_to_list(mle *mission) } mission->anarchy_only_flag = 0; - mission->builtin_hogsize = 0; + mission->builtin_hogsize = size; mission->path = mission->filename; num_missions++; } diff --git a/main/newdemo.c b/main/newdemo.c index e885c83e2..78e6c4877 100644 --- a/main/newdemo.c +++ b/main/newdemo.c @@ -165,6 +165,7 @@ fix nd_playback_total; fix nd_recorded_total; fix nd_recorded_time; sbyte playback_style; +sbyte First_time_playback=1; fix JasonPlaybackTotal=0; extern int digi_link_sound_to_object3( int org_soundnum, short objnum, int forever, fix max_volume, fix max_distance, int loop_start, int loop_end ); @@ -2934,6 +2935,7 @@ void newdemo_start_playback(char * filename) #ifdef NETWORK change_playernum_to(0); #endif + First_time_playback=1; JasonPlaybackTotal=0; if (filename) @@ -3106,10 +3108,10 @@ void DoJasonInterpolate (fix recorded_time) JasonPlaybackTotal+=FrameTime; - if (recorded_time > 0) + if (!First_time_playback) { - // get the difference between the recorded time and the playback time the_delay=(recorded_time - FrameTime); + if (the_delay < f0_0) { while (JasonPlaybackTotal > nd_recorded_total) @@ -3120,4 +3122,5 @@ void DoJasonInterpolate (fix recorded_time) } } } + First_time_playback=0; } diff --git a/main/scores.c b/main/scores.c index 0b88b69fe..061b88a9e 100644 --- a/main/scores.c +++ b/main/scores.c @@ -142,10 +142,9 @@ void scores_read() void scores_write() { - FILE * fp; - int i; + PHYSFS_file *fp; - fp = fopen( get_scores_filename(), "wb" ); + fp = PHYSFS_openWrite(get_scores_filename()); if (fp==NULL) { nm_messagebox( TXT_WARNING, 1, TXT_OK, "%s\n'%s'", TXT_UNABLE_TO_OPEN, get_scores_filename() ); return; @@ -155,31 +154,8 @@ void scores_write() Scores.signature[1]='H'; Scores.signature[2]='S'; Scores.version = VERSION_NUMBER; - fwrite( Scores.signature, 3, 1, fp); - fwrite( &(Scores.version), 1, 1, fp); - fwrite( Scores.cool_saying, COOL_MESSAGE_LEN, 1, fp); - for (i = 0; i < MAX_HIGH_SCORES; i++) { - Scores.stats[i].score = INTEL_INT(Scores.stats[i].score); - Scores.stats[i].kill_ratio = INTEL_SHORT(Scores.stats[i].kill_ratio); - Scores.stats[i].hostage_ratio = INTEL_SHORT(Scores.stats[i].hostage_ratio); - Scores.stats[i].seconds = INTEL_INT(Scores.stats[i].seconds); - - fwrite( Scores.stats[i].name, CALLSIGN_LEN+1, 1, fp); - fwrite( &(Scores.stats[i].score), 4, 1, fp); - fwrite( &(Scores.stats[i].starting_level), 1, 1, fp); - fwrite( &(Scores.stats[i].ending_level), 1, 1, fp); - fwrite( &(Scores.stats[i].diff_level), 1, 1, fp); - fwrite( &(Scores.stats[i].kill_ratio), 2, 1, fp); - fwrite( &(Scores.stats[i].hostage_ratio), 2, 1, fp); - fwrite( &(Scores.stats[i].seconds), 4, 1, fp); - - Scores.stats[i].score = INTEL_INT(Scores.stats[i].score); - Scores.stats[i].kill_ratio = INTEL_SHORT(Scores.stats[i].kill_ratio); - Scores.stats[i].hostage_ratio = INTEL_SHORT(Scores.stats[i].hostage_ratio); - Scores.stats[i].seconds = INTEL_INT(Scores.stats[i].seconds); - - } - fclose(fp); + PHYSFS_write(fp, &Scores,sizeof(all_scores), 1); + PHYSFS_close(fp); } void int_to_string( int number, char *dest )