Currently Online

Latest Posts

Topic: Getting into C

toptopple
Avatar
Topic Opener
Joined: 2013-10-30, 08:11
Posts: 156
Ranking
At home in WL-forums
Posted at: 2016-07-11, 07:52

My knowledge and practice of C lies way back, so I kinda need to get into it again. Many things have changed since I last used it.

There are some important question of general interest here (which could be put on a Wiki page later):

1) what C variant are you using for Widelands? 2) what would be a practical shortcut for compiling + testing source changes (minimise turn-around time)? 3) are you using or recommending any IDE to develop the project, code-wise? 4) recommendations for syntax / language definitions and tutorials?


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-07-11, 18:17

1) It is C++, I cannot say more closely...
2+3) I am linux user, so I just use text editor (geany) + commandline for compilation and running/testing.
EDIT:
4) we are using codecheck for checking the formatting

Edited: 2016-07-11, 20:06

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2434
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2016-07-11, 19:59

toptopple wrote:

2) what would be a practical shortcut for compiling + testing source changes (minimise turn-around time)? 3) are you using or recommending any IDE to develop the project, code-wise?

I am using qtcreator. Just because i have qt based KDE running and so there are less dependencies. First compiling is always slow but after that it is ok.

4) recommendations for syntax / language definitions and tutorials?

As i know widelands coding style prefers spaces over tabs for indentation.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
fk
Avatar
Joined: 2013-07-30, 22:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2016-07-12, 11:51

1. R18 uses c++11 and it depends heavily on stl. You can find lots of info about the latter at this website: http://www.cplusplus.com/reference/stl/
2. You can use the Widelands Replay option to test complete games. This catches a lot.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-07-23, 10:07

Tibor, I recommend that you try QT Creator - it can open any CMake project, and it is so much easier to navigate through the code than with a simple text editor. I love Geany as well, I am using it for the Lua bits.


Busy indexing nil values

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-07-23, 21:14

GunChleoc wrote:

Tibor, I recommend that you try QT Creator - it can open any CMake project, and it is so much easier to navigate through the code than with a simple text editor. I love Geany as well, I am using it for the Lua bits.

I must say that I like things simple, and dont like heavyweight tools. But as soon as I will be in a proper mood I will try it face-wink.png


Top Quote
Hasi50
Avatar
Joined: 2015-12-28, 16:19
Posts: 182
OS: MacOS
Version: 1.2 (selfcompiled master etc)
Ranking
Widelands-Forum-Junkie
Location: DE - near Frankfurt
Posted at: 2016-07-23, 21:35

On OSX one could use XCode. But I was unable to use this for now. An generic Alternative might me the Eclipse CDT Edition (dont know the correct name), but I used Eclipse for Java only.

Currently I use commonadline, the XCode compiler (clang) and libs from Mac Ports. Feel free to ask for details


Here are the widelands where people may dwell, walking around care that evrythings well.

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-07-24, 11:57

I like QT Creator because it is efficient enough to run on my crappy 2nd-hand laptop. Any other IDE I tried took about 5 minutes just to load itself. I would not be able to code as much as I do without it.


Busy indexing nil values

Top Quote