GrimSqueaker / remc2

Recode Binary code of game Magic Carpet2 to C/C++ language(remake MC2 for any platform)
6 stars 0 forks source link

64 bit compilation #36

Open GrimSqueaker opened 3 years ago

GrimSqueaker commented 3 years ago

I will start with trying to build the code in 64 bit. In order to get going, I will to the same thing as with the Linux build by introducing conditional compilation with "FIXME" notes and printouts. In my previous clone of the repo I got to the first level with that approach but it only could render the map and not the 3d world. I think if we consequently move forward with structures and rewrite those pointer to int assignments we can get it working at some point.

For this I have introduced the preprocessor define COMPILE_FOR_64BIT that can be set in CMake by passing -DUSE_64_BIT=True on the command line. It would be good if somebody could also introduce this into the VS solution, since I am not proficient in VS.

The benefit of this preprocessor flag is that I can leave the 32bit version unchanged and after having it compile with 64 bit can start to iteratively only fix those code locations that are triggered when starting to play the game.

GrimSqueaker commented 3 years ago

I think for portability I would go with C++11 on-board threading capabilities like https://en.cppreference.com/w/cpp/header/thread But to be honest, I did not use it yet apart of a simple hello world kind of program. So I don't know if it can handle what you have in mind.

Tim-Hobbs commented 3 years ago

I will look into it thanks