Improvements for Cockpit mode save; Fixed -pilot switch
This commit is contained in:
parent
3ef8539d83
commit
13631bd2c6
|
@ -1,5 +1,9 @@
|
|||
D2X-Rebirth Changelog
|
||||
|
||||
20071008
|
||||
--------
|
||||
main/game.c, main/gamerend.c, main/inferno.c, main/object.c, main/playsave.c: Improvements for Cockpit mode save; Fixed -pilot switch
|
||||
|
||||
20071007
|
||||
--------
|
||||
main/collide.c, main/laser.c: Changed collision handling between robots and controlcen; Aligned constant sounds to GameTime; Using turn radius of 0x0024*F1_0 for all homing objects while not aligning smart blobs to movement vector
|
||||
|
|
23
main/game.c
23
main/game.c
|
@ -176,8 +176,8 @@ grs_canvas VR_editor_canvas; // The canvas that the editor writes to.
|
|||
int Debug_pause=0; //John's debugging pause system
|
||||
|
||||
int Cockpit_mode=CM_FULL_COCKPIT; //set game.h for values
|
||||
static int old_cockpit_mode=-1;
|
||||
|
||||
int Cockpit_mode_save=-1; //set while in letterbox or rear view, or -1
|
||||
int force_cockpit_redraw=0;
|
||||
|
||||
int PaletteRedAdd, PaletteGreenAdd, PaletteBlueAdd;
|
||||
|
@ -1355,8 +1355,7 @@ void check_rear_view()
|
|||
if (Rear_view) {
|
||||
Rear_view = 0;
|
||||
if (Cockpit_mode==CM_REAR_VIEW) {
|
||||
select_cockpit(Cockpit_mode_save);
|
||||
Cockpit_mode_save = -1;
|
||||
select_cockpit(old_cockpit_mode);
|
||||
}
|
||||
if (Newdemo_state == ND_STATE_RECORDING)
|
||||
newdemo_record_restore_rearview();
|
||||
|
@ -1373,7 +1372,7 @@ void check_rear_view()
|
|||
entry_time = timer_get_fixed_seconds();
|
||||
}
|
||||
if (Cockpit_mode == CM_FULL_COCKPIT) {
|
||||
Cockpit_mode_save = Cockpit_mode;
|
||||
old_cockpit_mode = Cockpit_mode;
|
||||
select_cockpit(CM_REAR_VIEW);
|
||||
}
|
||||
if (Newdemo_state == ND_STATE_RECORDING)
|
||||
|
@ -1393,8 +1392,7 @@ void check_rear_view()
|
|||
if (leave_mode==1 && Rear_view) {
|
||||
Rear_view = 0;
|
||||
if (Cockpit_mode==CM_REAR_VIEW) {
|
||||
select_cockpit(Cockpit_mode_save);
|
||||
Cockpit_mode_save = -1;
|
||||
select_cockpit(old_cockpit_mode);
|
||||
}
|
||||
if (Newdemo_state == ND_STATE_RECORDING)
|
||||
newdemo_record_restore_rearview();
|
||||
|
@ -1412,10 +1410,9 @@ void reset_rear_view(void)
|
|||
Rear_view = 0;
|
||||
|
||||
if (!(Cockpit_mode == CM_FULL_COCKPIT || Cockpit_mode == CM_STATUS_BAR || Cockpit_mode == CM_FULL_SCREEN)) {
|
||||
if (!(Cockpit_mode_save == CM_FULL_COCKPIT || Cockpit_mode_save == CM_STATUS_BAR || Cockpit_mode_save == CM_FULL_SCREEN))
|
||||
Cockpit_mode_save = CM_FULL_COCKPIT;
|
||||
select_cockpit(Cockpit_mode_save);
|
||||
Cockpit_mode_save = -1;
|
||||
if (!(old_cockpit_mode == CM_FULL_COCKPIT || old_cockpit_mode == CM_STATUS_BAR || old_cockpit_mode == CM_FULL_SCREEN))
|
||||
old_cockpit_mode = CM_FULL_COCKPIT;
|
||||
select_cockpit(old_cockpit_mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1656,12 +1653,6 @@ void game()
|
|||
if ( Newdemo_state == ND_STATE_PLAYBACK )
|
||||
newdemo_stop_playback();
|
||||
|
||||
if (Cockpit_mode_save!=-1)
|
||||
{
|
||||
Cockpit_mode=Cockpit_mode_save;
|
||||
Cockpit_mode_save=-1;
|
||||
}
|
||||
|
||||
if (Function_mode != FMODE_EDITOR)
|
||||
gr_palette_fade_out(gr_palette,32,0); // Fade out before going to menu
|
||||
|
||||
|
|
|
@ -873,13 +873,14 @@ void toggle_cockpit()
|
|||
switch (Cockpit_mode)
|
||||
{
|
||||
case CM_FULL_COCKPIT:
|
||||
case CM_REAR_VIEW:
|
||||
new_mode = CM_STATUS_BAR;
|
||||
break;
|
||||
case CM_STATUS_BAR:
|
||||
new_mode = CM_FULL_SCREEN;
|
||||
break;
|
||||
case CM_FULL_SCREEN:
|
||||
new_mode = CM_FULL_COCKPIT;
|
||||
new_mode = (Rear_view?CM_REAR_VIEW:CM_FULL_COCKPIT);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -450,8 +450,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (GameArg.SysUsePlayersDir)
|
||||
strcpy(filename, "Players/");
|
||||
strncat(filename, GameArg.SysPilot, 12);
|
||||
filename[8 + 12] = '\0'; // unfortunately strncat doesn't put the terminating 0 on the end if it reaches 'n'
|
||||
strlwr(GameArg.SysPilot);
|
||||
sprintf(filename,"%s", GameArg.SysPilot);
|
||||
for (j = GameArg.SysUsePlayersDir? 8 : 0; filename[j] != '\0'; j++) {
|
||||
switch (filename[j]) {
|
||||
case ' ':
|
||||
|
|
|
@ -1480,7 +1480,7 @@ int Player_eggs_dropped=0;
|
|||
fix Camera_to_player_dist_goal=F1_0*4;
|
||||
|
||||
ubyte Control_type_save, Render_type_save;
|
||||
extern int Cockpit_mode_save; //set while in letterbox or rear view, or -1
|
||||
static int cockpit_mode_save; //set while in letterbox
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------
|
||||
void dead_player_end(void)
|
||||
|
@ -1495,8 +1495,8 @@ void dead_player_end(void)
|
|||
Player_exploded = 0;
|
||||
obj_delete(Dead_player_camera-Objects);
|
||||
Dead_player_camera = NULL;
|
||||
select_cockpit(Cockpit_mode_save);
|
||||
Cockpit_mode_save = -1;
|
||||
select_cockpit(cockpit_mode_save);
|
||||
cockpit_mode_save = -1;
|
||||
Viewer = Viewer_save;
|
||||
ConsoleObject->type = OBJ_PLAYER;
|
||||
ConsoleObject->flags = Player_flags_save;
|
||||
|
@ -1779,8 +1779,8 @@ void start_player_death_sequence(object *player)
|
|||
Dead_player_camera = Viewer;
|
||||
}
|
||||
|
||||
if (Cockpit_mode_save == -1) //if not already saved
|
||||
Cockpit_mode_save = Cockpit_mode;
|
||||
if (cockpit_mode_save == -1) //if not already saved
|
||||
cockpit_mode_save = Cockpit_mode;
|
||||
select_cockpit(CM_LETTERBOX);
|
||||
if (Newdemo_state == ND_STATE_RECORDING)
|
||||
newdemo_record_letterbox();
|
||||
|
|
|
@ -570,9 +570,6 @@ int get_highest_level(void)
|
|||
return i;
|
||||
}
|
||||
|
||||
extern int Cockpit_mode_save;
|
||||
|
||||
|
||||
//write out player's saved games. returns errno (0 == no error)
|
||||
int write_player_file()
|
||||
{
|
||||
|
@ -599,7 +596,7 @@ int write_player_file()
|
|||
PHYSFSX_writeU8(file, Player_default_difficulty);
|
||||
PHYSFSX_writeU8(file, Auto_leveling_on);
|
||||
PHYSFSX_writeU8(file, Reticle_on);
|
||||
PHYSFSX_writeU8(file, (Cockpit_mode_save!=-1)?Cockpit_mode_save:Cockpit_mode); //if have saved mode, write it instead of letterbox/rear view
|
||||
PHYSFSX_writeU8(file, (Cockpit_mode==1?0:Cockpit_mode));
|
||||
PHYSFS_seek(file,PHYSFS_tell(file)+sizeof(PHYSFS_uint8)); // skip Default_display_mode
|
||||
PHYSFSX_writeU8(file, Missile_view_enabled);
|
||||
PHYSFSX_writeU8(file, Headlight_active_default);
|
||||
|
|
Loading…
Reference in a new issue