Skip to content

Commit

Permalink
back to explicitly storing vertical mouse sensitivity in the config file
Browse files Browse the repository at this point in the history
We won't be able to exactly keep the file format anyway.
  • Loading branch information
fabiangreffrath committed Aug 12, 2020
1 parent 7ee9a2d commit 4e65cce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wl_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ void ReadConfig(void)
read2(file,&viewsize,sizeof(viewsize));
read2(file,&mouseadjustment,sizeof(mouseadjustment));

// [FG] sneak vertical mouse sensitivity into the mouseadjustment config value
mouseadjustment_v = ((mouseadjustment >> 8) & 0xff) - 1;
mouseadjustment = mouseadjustment & 0xff;
if (mouseadjustment_v == -1)
// [FG] vertical mouse sensitivity
if (read(file,&mouseadjustment,sizeof(mouseadjustment))<0)
{
mouseadjustment_v = mouseadjustment;
}

close(file);
#undef read2
Expand Down Expand Up @@ -280,10 +280,10 @@ void WriteConfig(void)
write2(file,buttonjoy,sizeof(buttonjoy));

write2(file,&viewsize,sizeof(viewsize));
// [FG] sneak vertical mouse sensitivity into the mouseadjustment config value
mouseadjustment = mouseadjustment | ((mouseadjustment_v + 1) << 8);
write2(file,&mouseadjustment,sizeof(mouseadjustment));
mouseadjustment = mouseadjustment & 0xff;

// [FG] vertical mouse sensitivity
write2(file,&mouseadjustment_v,sizeof(mouseadjustment_v));

close(file);
}
Expand Down

0 comments on commit 4e65cce

Please sign in to comment.