Anyone know the steps to decompile and recompile the tiles version for Windows under Codeblocks?
Fork the official repo. Compile with TILES=1.
Doesn't work. Compiler spits out errors and freezes up.
Do you have all dependencies? SDL2, SDL2_ttf, SDL2_image? The .dll's necessary to run things? There's a thread on the forum that has all dependencies in one archive, I believe.
It's UNBELIEVABLE how much crap you have to go through to compile this. The Code Blocks project is horribly out-of-date.
First, go here
http://smf.cataclysmdda.com/index.php?topic=7646.msg182309#msg182309 and get the libraries. Extract the "include" and "lib" folders in each archive into the "3rdparty" folder (create it) in your cloned repository, i.e. "c:\Cataclysm-DDA\3rdparty\lib" and "c:\Cataclysm-DDA\3rdparty\include". Now, copy the whole "include" folder and copy it into the "src" folder and rename it "SDL2," i.e. "c:\Cataclysm-DDA\src\SDL2." Now, copy all files ending in .dll from the "3rdparty\lib\x86" folder to the root repository folder, i.e. "c:\Cataclysm-DDA".
That's all for file manipulation, but you're STILL not done. In the Code Blocks project file, go into project->build options menu. Click on "Release - Tile Support" and then on "Linker Settings." You need to change the 4 libraries to their SDL2 versions, i.e. the 4 entries should be:
3rdparty\lib\x86\SDL2.lib
3rdparty\lib\x86\SDL2main.lib
3rdparty\lib\x86\SDL2_image.lib
3rdparty\lib\x86\SDL2_ttf.lib
But GUESS WHAT. YOU ARE STILL NOT DONE. Now you need GCC 4.9.0. And GUESS WHAT. There's like 10 different versions/permutations of it. You need i686-4.9.0-win32-sjlj-rt_v3-rev2. First, go here for the installer:
http://sourceforge.net/projects/mingw-w64/Run the installer, select:
Version 4.9.0
Architecture i686
Threads win32
Exception sjlj
Build revision 2
I'm not sure if different settings will work, but I'll be damned if I'm going to test it. Go nuts if you're of a mind. Now you have GCC 4.9.0. But YOU ARE STILL NOT DONE. You have to configure Code Blocks to use it. Go to the Settings->Compiler menu. Assuming you installed it to the default path "C:\mingw-w64\i686-4.9.0-win32-sjlj-rt_v3-rev2", hit the "Copy" button to copy your GNU GCC settings. Name it whatever you like, but I would go with "GNU GCC 4.9.0". Change the settings to match where you installed MinGW64, i.e. if you used default settings:
Compiler's installation directory: C:\mingw-w64\i686-4.9.0-win32-sjlj-rt_v3-rev2\mingw32
C Compiler: i686-w64-mingw32-gcc.exe
C++ Compiler: i686-w64-mingw32-g++.exe
Linker for dynamic libs: i686-w64-mingw32-g++.exe
The rest you can leave same as the old GCC. While you're here, do yourself a HUGE favor and go to the "build options" tab. Set the "number of parallel processes" to something nice like 4 (or more) depending on your hardware. This thing takes long enough to compile in parallel, don't waste time doing it one file at a time. Now, YOU ARE STILL NOT DONE, BUT YOU ARE CLOSE. Go back to the "Project->Build options" menu. Change the "Selected Compiler" to "GNU GCC 4.9.0" or whatever you named it. Click the dropdown box below the "wxSmith" menu item and change "Release" to "Release - Tile Support". Click the "Build->Build" menu item or hit CTRL-F9. Once it's finished building, you can run the game by running your shiny new Cataclysm-Tiles.exe.
I think that's everything, since I decided to clone a new repo just to test this. But considering how long this is, I might have left something out.