Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux compilation #31

Open
abergmeier opened this issue Jun 6, 2020 · 15 comments
Open

Linux compilation #31

abergmeier opened this issue Jun 6, 2020 · 15 comments

Comments

@abergmeier
Copy link

Will you be accepting changes to compile on Linux, too?

@alexlk42
Copy link

alexlk42 commented Jun 6, 2020

So far it seems they won't be accepting any changes as this appears to be a code drop. Although, the modding community will be interested in changes. Makes me wonder what a good way to make our changes known to each other is...

@abergmeier
Copy link
Author

That is a good point. I am currently starting to put together a linuxlib but am somewhat wondering whether I am the first one to do so...

@antdude
Copy link

antdude commented Jun 7, 2020

Please make this Linux port happen! :D

@cybik
Copy link

cybik commented Jun 7, 2020

If enough is done to get a working binary set, EA could put it as a beta-branch.

@abergmeier
Copy link
Author

Ok, I now have the first CompileUnit linking on Linux.

@horvatic
Copy link

horvatic commented Jun 8, 2020

@abergmeier how? I am using cmake to convert the sln to CMakeList, but I am having issues with this....

@abergmeier
Copy link
Author

I am using cmake to convert the sln to CMakeList, but I am having issues with this....

I can try to (quickly) describe my process.

Here a (uncomplete) list of things I encountered:

Problem Solution
DOS file encoding Reencode all files with UTF-8
Case insensitive paths Change all relevant includes to uppercase
Non-standard (VisualStudio) C++ extensions Change part of code to comply with C++17
Compile error in GCC Change part of code to comply with C++17
Monoheaders Change includes in files to be self sufficient
Referencing Windows symbols Create compat mapping to C++17 types

My process with this is to create CMake from scratch and pull one CU in after the other.
If you guys are interested, I can try to clean up the code today and publish my fork tomorrow.

@abergmeier
Copy link
Author

So my repo is here: https://github.com/abergmeier/CnC_Remastered_Multiplatform

@elcuco
Copy link

elcuco commented Jun 8, 2020

I started porting to GCC/Linux. I converted all files into lowercase, and added a CMakeLists.txt.

However, code for https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/LZWOTRAW.CPP is still not compiling. All code is VERY dependent on win32 (for example https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/BMP8.H) I also found several definitions of "true"/"false" in the code. (code seems very broken when compiling in GCC).

IMHO - this can be ported to SDL. However - this is only a DLL, I am unsure what main() loads this DLL and where is the start point of this app. Also - I am unsure how to create free assets for this "engine".

Is anyone else interested in a port for linux/mac? (modern C++ on windows as well?)

@tsilcher
Copy link

tsilcher commented Jun 8, 2020

@elcuco Yes we are interested too (#50). I was also wondering what the next steps were once we get this compiled on linux & unix.

Afaik we need a game engine to "run" this as well as the assets. For your own local testing purposes I believe you could use the official assets if you own the game (without distributing them). Am I right?

As for the entry point it's in both cases CONQUER.CPP. You can look the the commented code in there:

Main_Game -- Main game startup routine.
Main_Loop -- This is the main game loop (as a single loop). 

@antdude
Copy link

antdude commented Jun 8, 2020

EA did release the original C&C (Gold -- Windows port) game for free to the public last decade: https://www.google.com/search?safe=active&q=EA+release+C%26C+game+%22ISO%22+free. We just need Linux client to use and play them. ;)

@abergmeier
Copy link
Author

abergmeier commented Jun 8, 2020

I converted all files into lowercase

My reasoning was to have as little changes to the code as possible.
So I would rather change the includes to uppercase to not be forced to use rename detection.

However, code for https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/LZWOTRAW.CPP is still not compiling

I for now limit anything to TD. Enough work already :)

@abergmeier
Copy link
Author

abergmeier commented Jun 8, 2020

So I created now a few PRs for some basic changes: https://github.com/abergmeier/CnC_Remastered_Multiplatform/pulls

If you want to code as well just ping me.
Not sure yet, how to setup review process. Maybe create a team RemasteredPorters?

@OmniBlade
Copy link

You might want to check out https://github.com/hifi/Vanilla-Conquer which has the same goals but already has a working cmake build system and progess towards windows based standalone builds and mingw GCC builds. Linux compatibility is very much part of the purpose for this as it was for https://github.com/TheAssemblyArmada/Chronoshift before the code drop kind of made it moot. More code is required than this drop provides for working standalone and some of the changes required to revert the remaster changes for standalone are obscure.

@hifi
Copy link

hifi commented Jun 20, 2020

Indeed, it's a lot of work to get a fully functioning Linux version.

In Vanilla Conquer we are going the long route of roughly:

  1. CMake
  2. Inline MASM to external MASM files (JWASM compat)
  3. Source fixes for MinGW/gcc compatibility
  4. Standalone builds
  5. Assembly to C
  6. SDL2/Linux port
  7. 64 bit support

We are currently working points 3 and 4 where 3 is almost mergeble and 4 is drawing the menu.

Our goal is to keep "everyone" happy by keeping remaster modding, MSVC building and portability all in the same code base while also cleaning up and avoid breaking any of these simultaneously supported builds within every commit.

It's slow work compared to many other projects that can work with the VS solution directly and stick with either remaster modding or to a single game. We are combining as much of the sources together to ease maintainability and refactors.

Anyone are free to contribute and we all hang around in The Assembly Armada discord server.

Good luck to everyone else working on Linux support as well! Every solved issue in any fork will benefit everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants