diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8977123c0..f9ba01472 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20080510 +-------- +main/playsave.c: use atoi instead of sscanf for plx reading, so the setting for showing the reticle is read properly on big endian computers + 20080508 -------- main/newmenu.c, main/render.c, arch/sdl/key.c, arch/include/key.h: Some code improvements and small fixes diff --git a/main/playsave.c b/main/playsave.c index e51e926eb..ee113d1ea 100644 --- a/main/playsave.c +++ b/main/playsave.c @@ -213,7 +213,7 @@ int read_player_d1x(char *filename) while(!strstr(word,"END") && !PHYSFS_eof(f)) { if(!strcmp(word,"DEADZONE")) - sscanf(line,"%i",&PlayerCfg.JoystickDeadzone); + PlayerCfg.JoystickDeadzone = atoi(line); d_free(word); cfgets(line,50,f); word=splitword(line,'='); @@ -230,11 +230,7 @@ int read_player_d1x(char *filename) while(!strstr(word,"END") && !PHYSFS_eof(f)) { if(!strcmp(word,"SENSITIVITY")) - { - int tmp; - sscanf(line,"%i",&tmp); - PlayerCfg.MouseSensitivity = (ubyte) tmp; - } + PlayerCfg.MouseSensitivity = atoi(line); d_free(word); cfgets(line,50,f); word=splitword(line,'='); @@ -251,9 +247,9 @@ int read_player_d1x(char *filename) while(!strstr(word,"END") && !PHYSFS_eof(f)) { if(!strcmp(word,"MODE")) - sscanf(line,"%i",&PlayerCfg.CockpitMode); + PlayerCfg.CockpitMode = atoi(line); else if(!strcmp(word,"HUD")) - sscanf(line,"%i",&PlayerCfg.HudMode); + PlayerCfg.HudMode = atoi(line); d_free(word); cfgets(line,50,f); word=splitword(line,'='); @@ -270,9 +266,9 @@ int read_player_d1x(char *filename) while(!strstr(word,"END") && !PHYSFS_eof(f)) { if(!strcmp(word,"RETICLE")) - sscanf(line,"%i",(int*)&PlayerCfg.ReticleOn); + PlayerCfg.ReticleOn = atoi(line); else if(!strcmp(word,"PERSISTENTDEBRIS")) - sscanf(line,"%i",&PlayerCfg.PersistentDebris); + PlayerCfg.PersistentDebris = atoi(line); d_free(word); cfgets(line,50,f); word=splitword(line,'='); @@ -289,11 +285,11 @@ int read_player_d1x(char *filename) while(!strstr(word,"END") && !PHYSFS_eof(f)) { if(!strcmp(word,"OGLALPHAEFFECTS")) - sscanf(line,"%i",&PlayerCfg.OglAlphaEffects); + PlayerCfg.OglAlphaEffects = atoi(line); else if(!strcmp(word,"OGLRETICLE")) - sscanf(line,"%i",&PlayerCfg.OglReticle); + PlayerCfg.OglReticle = atoi(line); else if(!strcmp(word,"OGLPRSHOT")) - sscanf(line,"%i",&PlayerCfg.OglPRShot); + PlayerCfg.OglPRShot = atoi(line); d_free(word); cfgets(line,50,f); word=splitword(line,'=');