Mindwerks / XLEngine

XLEngine allows you to play Dark Forces, Daggerfall and soon Outlaws and Blood with modern technology.
MIT License
185 stars 19 forks source link

Code Formatting #1

Closed drummyfish closed 6 years ago

drummyfish commented 6 years ago

Before further development I think code conventions should be set and the current code accordingly reformatted. Personally I think tab indents are bad and would suggest OpenMW conventions instead, because we can suppose a lot of OpenMW devs to start contributing here and this would help to keep things going smoothly (no double editor settings, no mental switches between the projects etc.). Any other opinions on this?

afritz1 commented 6 years ago

Sounds good. In addition to this, we should also set minimum compiler requirements (i.e., GCC 5.4, same as OpenMW) and general guidelines for contributing (see OpenMW's CONTRIBUTING.md). I believe it was Lucius' intent to match the original engines' behaviors as close as possible, so also take this section as a guide on "bugs as features".

I'm assuming the codebase uses C++03 (judging by its age), and could be upgraded once things have settled down a bit, so that any new code that's written will have access to C++11/14/... features (this might sound familiar -- it already happened with OpenMW).

psi29a commented 6 years ago

Current plan is to get it running as-is and leave formatting for later. This needs a MVP (minimal viable product) first.

Yes, all tabs will go.

I'm aware of OpenMW moving to C++11, I was there doing some of the heavy lifting to get us there. ;) (Corristo and Ace had to handle the osx and windows stuff)

If anyone would like to start a PR around a CONTRIBUTING.md so we can codify this.

There are many C-ish things here than can/should be replaced with their std:: C++ equivalents. I'm currently busy trying to get the MSVC only crap out of the way.

drummyfish commented 6 years ago

Also can this be relicensed to GPL, in order to be able to use other GPL stuff? Just planning ahead a bit.

psi29a commented 6 years ago

Expat (MIT) License is compatible with GPL, why should we move (relicense) to a less free license?

drummyfish commented 6 years ago

IANAL, but so that it's possible to use other GPLed components I guess. As I understand from Wiki, linking of GPL code is only allowed to another GPL code, so MIT license would limit what we can use. AFAIK MIT is usually used for libraries that have no or only minimal dependencies. Am I telling the truth? Anyone feel free to correct me.

psi29a commented 6 years ago

Linking to GPL binary statically will make your binary also GPL, not your code. Since the code is already available under the Expat license, then the GPL is satisfied. The license of the code itself doesn't change but your binary will be GPL because it contains GPL code.

Linking to a GPL binary dynamically does not make your binary GPL because no GPL code is in your binary, it just makes calls to that GPL binary while your binary is purely yours and still under the Expat license.

https://en.wikipedia.org/wiki/MIT_License

As a permissive license, it puts only very limited restriction on reuse and has, therefore, an excellent license compatibility.

IANAL, however I have been dealing with copyright and licenses for awhile now.

drummyfish commented 6 years ago

GPL binary

That alone sounds very weird to me, but yeah, I haven't studied this in depth. According to this it is questionable (RMS says static vs dynamic doesn't matter, but the only court case that every happened ruled otherwise). Guys on GNU IRC tell me it has to be GPLed. Also in some cases we may want to link statically.

So I guess, for now, let's leave this for a separate issue later.

psi29a commented 6 years ago

Doesn't matter, the code remains MIT/Expat regardless... it's the resulting binary that is covered under the GPL when linking statically and it requires that the source be provided. The source is available, so there is no problem.

I see no compelling reason why the source has to be GPL or why we would want to do that.

drummyfish commented 6 years ago

and it requires that the source be provided

Yes, but since GPL is copyleft, it infects the code it gets used in and further requires the source be distributed under GPL too.

psi29a commented 6 years ago

It does, you ship the code under the GPL as a result if you statically link. The upstream code however remains MIT. You are making a copy of the code, setting it to GPL as required by statically linking in the binary. But the GPL only applies to the copy of that code for the binary. Not upstream code.

GPL just asks for a copy of the code under the GPL, not that the original (upstream) code become GPL.

psi29a commented 6 years ago

tabs have been converted to spaces.

We'll change formatting on a file by file basis as we work on it.