bigianb / bgda-explorer

Code written to try and figure out the data files used in Baldur's Gate Dark Alliance for the PS2
11 stars 6 forks source link

Clean up code / Fix small DataReader bug #13

Closed BryceBarbara closed 3 years ago

BryceBarbara commented 3 years ago

Howdy Ian, long time no see! I'm just starting to dip my toe back into reversing vidya games and wanted to return back to this one and try to improve where we left off.

I've gotten a lot better at C# and I just wanted to do a bulk clean up of the code base that still had a lot of signs of being from the early days of C#. There's still a lot to fix, but this is a good start.

When reviewing this, I suggest turning on the option hide whitespace changes since that's a large portion of the changes.

Primary Changes

bigianb commented 3 years ago

Hi, thanks for this. The only thing I don't like is the parenthesis on their own line style. I like that for a class definition or function definition but not on an if / while. It just makes the code too long and difficult to see enough on the screen at once (i.e. Egyptian style for conditions, separate line for functions). I'll probably run a formatter to revert that back at some stage. Also think hard about using var everywhere (or auto in c++). It's usually a win as it makes the code easier to refactor ... but it can also make the code more difficult to understand.

Good to see you back. I think since you were last active I've figured out most of the script commands, the cut scene format and the 4/16 bit texture decoding. I also looked at bit at the Justice League heroes formats .. which are similar to return to arms.

BryceBarbara commented 3 years ago

Can you link me to a an example of the messed up line parenthesis? I just want to make sure I know exactly what you're referring to. We can setup the rule explicitly using the .editorconfig file and then do a solution wide clean-up.