I have found that if I use the game_save function to save the global variables only (SV_VARS) and then I restart the game and use the game_load function I start getting errors which usually do not occur. I nailed down the error causing command and it is this:
bmap_blit(changes_pcx,viewers[1][0],NULL,NULL);
now changes_pcx is a bmap defined at the start of the game with:
BMAP * changes_pcx = "blank.jpg";
while viewers[1][0] is a bmap array defined as follows:
BMAP* viewers[7][11];
and in main() function viewers[1][0] is defined as follows:
viewers[1][0]=bmap_create("carrack.jpg");
As I told you if I start a game and do not load there is no problem, but if I load a saved game there pops up the error. Also I checked saving and loading soon after without stopping the game and in this case the error does not occur. So I am concluding that the game_load function is affecting the bmap array even though it is supposed not to affect it. And by the way the definition of the viewers[1][0] is always done when the game starts and it is not changed through out the game, so the load function in theory should not affect it.
Is this a bug in the game_load function?
I also noted that string arrays are not saved well when I use SV_ALL. I think that string arrays and bmap arrays confuse game_save and game_load commands.
Last edited by Ercoles; 05/07/11 14:50.