How to contribute? (also: text file docs)

Discuss the future of Warzone 2100 with us.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

How to contribute? (also: text file docs)

Post by Zarel »

Hey everyone. So I've been here a while, and I want to help with coding. I have some knowledge of C and C++, although I don't have any experience with Trac or Gna or anything like that. So I'm not sure how I can help. I was wondering if someone could "show me the ropes".

I've downloaded a recent trunk, and one of the things I've noticed is a 54-line function called structWallScan around line 1275 of structure.c

The comment above it says:

Code: Select all

/*****************************************************************************/
/*
* All this wall type code is horrible, but I really can't think of a better way to do it.
*        John.
*/
Well, I managed to optimize structWallScan to a much smaller and faster 9-line function:

Code: Select all

static SDWORD structWallScan(BOOL aWallPresent[5][5], SDWORD x,SDWORD y)
{
	if (aWallPresent[x-1][y]||aWallPresent[x+1][y])
	{
		if (aWallPresent[x][y-1]||aWallPresent[x][y+1])
			return WALL_CORNER;
		else
			return WALL_HORIZ;
	}
	else
		return WALL_VERT;
}
But I have no idea what to do to get this into the repository and stuff, since I'm new to this. I think I'm supposed to make a .diff file and submit it as a patch somewhere.

By the way, I'm also trying to generate a tech tree for 2.1, but I don't know where to find documentation on the columns of the text files in data/base/stats/ and data/mp/stats/. Edit: Nevermind, I found it.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: How to contribute? (also: text file docs)

Post by Buginator »

Zarel wrote:Hey everyone. So I've been here a while, and I want to help with coding. I have some knowledge of C and C++, although I don't have any experience with Trac or Gna or anything like that. So I'm not sure how I can help. I was wondering if someone could "show me the ropes".

I've downloaded a recent trunk, and one of the things I've noticed is a 54-line function called structWallScan around line 1275 of structure.c


But I have no idea what to do to get this into the repository and stuff, since I'm new to this. I think I'm supposed to make a .diff file and submit it as a patch somewhere.
Well, goto http://developer.wz2100.net/, and login. Then select new ticket.
Fill out the information, and attach the patch file.
That will notify the ML that you made a patch, and sooner or later, someone will take a look at it, and comment on it, and or commit it.

That is pretty much all you have to do.
To generate the patch file, if on windows, use tortoiseSVN, and select 'create patch', and if on linux do svn diff >patchname.patch (I think--not at my linux box to check, but it is pretty close to that).