nipkownix / re4_tweaks

Fixes and tweaks for the "UHD" port of Resident Evil 4
zlib License
346 stars 32 forks source link

New iniReader implementation #409

Closed nipkownix closed 1 year ago

nipkownix commented 1 year ago

@emoose This should fix part of #405, as mentioned here: https://github.com/nipkownix/re4_tweaks/issues/405#issuecomment-1366625035

Figured it was time we made our own .ini reader to fit our needs instead of fighting the existing one. ~This is a bit simplified if compared to the original one, but I only focused on what we are actually using for now.~

Our extended CmdIniReader is now part of this too, so everything feels a bit cleaner.

Never tried doing this before, so I figured I should get your input before a potential merge. Everything seems to be working fine, though.

Edit: Was looking for a way to stop using WritePrivateProfileString since that is terribly slow, outdated, unsupported, and the only reason we had a separate thread to write settings. Came across simpleini, which can write back the .ini preserving comments and doesn't touch any of the outdated xxPrivateProfileString funcs. Seems pretty quick as well, so I removed the thread stuff we were using.

Should probably triple-check if everything is saving fine, though ._.

emoose commented 1 year ago

Seems to work fine for me, settings + trainer stuff seemed to save fine at least, and cmd line args all looked okay, debug tool stuff like area jump still saved fine also.

I noticed this branch mentions "New refresh rate = 70" in console (I'm still using the OC'd monitor stuff I mentioned at https://github.com/nipkownix/re4_tweaks/pull/419#issuecomment-1384705616) - not sure if that means this is actually using that mode to display though, but IIRC I didn't see that message with the other branch.

nipkownix commented 1 year ago

Ah, nice! Many thanks for taking a look. I suppose there were no hiccups when saving settings? Guess we should be good to merge it. Will most likely have to fix the other PRs though.. :p