version 1.8 | | version 1.9 |
---|
| | |
* Functions to save/restore game state. | | * Functions to save/restore game state. |
* | | * |
* $Log$ | | * $Log$ |
| | * Revision 1.9 2003/03/09 06:41:01 donut |
| | * change byte typedef to sbyte to avoid conflict with win32 byte which is unsigned |
| | * |
* Revision 1.8 2002/03/27 00:39:57 donut | | * Revision 1.8 2002/03/27 00:39:57 donut |
* missed little bit of last patch | | * missed little bit of last patch |
* | | * |
| | |
| | |
// Save the current weapon info | | // Save the current weapon info |
temp_byte = sg_primary_weapon; | | temp_byte = sg_primary_weapon; |
fwrite( &temp_byte, sizeof(byte), 1, fp ); | | fwrite( &temp_byte, sizeof(sbyte), 1, fp ); |
temp_byte = sg_secondary_weapon; | | temp_byte = sg_secondary_weapon; |
fwrite( &temp_byte, sizeof(byte), 1, fp ); | | fwrite( &temp_byte, sizeof(sbyte), 1, fp ); |
| | |
// Save the difficulty level | | // Save the difficulty level |
temp_int = sg_difficulty_level; | | temp_int = sg_difficulty_level; |
| | |
fwrite( &Players[Player_num], sizeof(player), 1, fp ); | | fwrite( &Players[Player_num], sizeof(player), 1, fp ); |
| | |
// Save the current weapon info | | // Save the current weapon info |
fwrite( &Primary_weapon, sizeof(byte), 1, fp ); | | fwrite( &Primary_weapon, sizeof(sbyte), 1, fp ); |
fwrite( &Secondary_weapon, sizeof(byte), 1, fp ); | | fwrite( &Secondary_weapon, sizeof(sbyte), 1, fp ); |
| | |
// Save the difficulty level | | // Save the difficulty level |
fwrite( &Difficulty_level, sizeof(int), 1, fp ); | | fwrite( &Difficulty_level, sizeof(int), 1, fp ); |
| | |
Players[Player_num].level = next_level; | | Players[Player_num].level = next_level; |
| | |
// Restore the weapon states | | // Restore the weapon states |
fread( &Primary_weapon, sizeof(byte), 1, fp ); | | fread( &Primary_weapon, sizeof(sbyte), 1, fp ); |
fread( &Secondary_weapon, sizeof(byte), 1, fp ); | | fread( &Secondary_weapon, sizeof(sbyte), 1, fp ); |
| | |
select_weapon(Primary_weapon, 0, 0, 0); | | select_weapon(Primary_weapon, 0, 0, 0); |
select_weapon(Secondary_weapon, 1, 0, 0); | | select_weapon(Secondary_weapon, 1, 0, 0); |