(removed unsigned external link)
Line 36: Line 36:
-- [[User:Vasc|Vasc]] 17:51, December 31, 2009 (UTC)
-- [[User:Vasc|Vasc]] 17:51, December 31, 2009 (UTC)
[ cplusplus algorithms]

Revision as of 15:03, July 10, 2016

Forums: Index > Development > Recreate with C++


I have some questions:

1. Why Freeciv is written on C instead of C++? This is desire of developers? C ++ projects are easier for supporting. And I do not understand why you not replace programming language.

2. Whether there will come sometime time when source codes Freeciv will be compatible with Microsoft Visual Studio 20 **? Do not forget that MSVC is the basic tool of development under Windows rather than MinGW.

3. The official client under Windows (GTK) unplayable. Screen redrawing is very slow. Can be it is necessary to replace the official client for platform Windows?

--unsigned post by Heretic13

Kernigh writes: The source code is free. If you want, you can work to port Freeciv from C to C++, and to compile Freeciv with MSVC. You might have fun with your C++/MSVC variant of Freeciv.

I did read some small parts of the Freeciv source code. Over time, I might earn familiarity with parts like struct worklist and cid_decode. Other hackers already know these parts. Many hackers make patches for Freeciv, or make variants like warclient or LTeX (longturn experimental). If someone switches Freeciv from C to C++, then these hackers would lose their familiarity with Freeciv. Old patches would not work. Hackers, who know the old maze, would need to learn the new maze of overloaded operators, virtual functions, private members and template instantiations. --Kernigh 19:22, December 14, 2009 (UTC)

Switching from C to C++ wouldn't make so much troubles for hackers I guess. Most of us are probably more experienced in C++ than C. However, rewriting the whole code in C++ is a very big work, and I doubt Freeciv has enough man-power to do that currently. Moreover, I don't see a real advantage to use C++ instead of C. It would only make useless noise. Pepeto 22:05, December 14, 2009 (UTC)

If you really, really want to program in ISO C99 using the MS Visual Studio IDE, install the Intel C++ compiler. I hate how MS Visual Studio project files are so bloody incompatible between versions, and how their compiler always lags providing support for the latest C and C++ specs. It still does not support C++0x properly without using Boost. With GNU Autoconf + Automake, regardless of how ugly they are, you use the same "project files" to compile on Linux, MacOS X, Windows, in any number of GCC versions.

Personally I think porting to C++ is a waste of time. A less complex garbage collected language, with better refactoring support, would be a better fit. You would essentially be writing a new game though.

Map drawing is slow in the GTK+ client because the graphics libraries used are not very fast, and the map code is really, really complicated. How many other games do you know which support overhead, isometric; square, hexagonal; in the same engine? In isometric mode overlapping blended tiles mean you need to use many drawing operations to update just a single tile. I gave up adding 2.5D zoom and rotation support to the map engine when I looked at the code.

-- Vasc 17:51, December 31, 2009 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.