How To Create Patch For Stendhal: Difference between revisions
Content deleted Content added
imported>Kymara No edit summary |
imported>Hendrik Brummermann No edit summary |
||
| (73 intermediate revisions by 3 users not shown) | |||
Line 1:
{{Navigation for Stendhal Top|Developing}}
{{Navigation for Stendhal Developers}}
<div style="border:10px solid #A00; padding: 2em">
'''Warning''': This page is outdated. We prefer Pull Requests on Codeberg or GitHub.
</div>
If you want to contribute to Stendhal with some changes to some files you can ease us integrating the changes if you create a patch file for your changes.
Line 4 ⟶ 14:
There are a few neat ways to make a patch file. We are going to describe here how to create a patch on each of this ways.
Once you have tested your patch please add it to our [http://sourceforge.net/tracker/?func=add&group_id=1111&atid=301111 sourceforge tracker].
As a prerequisite for both ways of creating a patch is a checked out version of Stendhal.
== Common best practices for
* Keep your local copy of Stendhal regularly up to date with
* Discuss your plans with the team at {{irc-arianne}}
* Update your local copy before you test your changes locally
* Test your changes locally
* Open the patch file in a text editor and review it, to check it is really adding the changes you mean to add, and nothing else
== Creating patches ==
=== Eclipse ===
After updating your Stendhal project you can start the patch creation by right clicking on the project. In the
[[File:How-to-create-patch-01.PNG]]
Line 41 ⟶ 52:
cvs add newfile
or for a binary file like an image or tmx map file
cvs add -kb newbinaryfile
{{TODO|Verify this is possible with anon access ? }}
Line 57 ⟶ 72:
== Reading patch files ==
Eek, what is all this text below?
The patch file contains a section for each file that should be changed. That section starts with lines that contain the file name and path of first the old (---) and then the new (+++) version and some additional information.
Then follow sets of changes. They start with a line that contains, enclosed in @@, the line or line range from,no-of-lines in the file before (with a -) and after (with a +) the changes. After that come the lines from the file. Lines starting with a - are deleted, lines starting with a + are added. Each line modified by the patch is surrounded with 3 lines of context before and after. A line change needs both an addition + and a deletion -.
After all the changes related to one file, comes the next file definitions (--- and +++) and the next file's changes, with the @@ and + or - as above.
<source lang="java">
Index: src/games/stendhal/client/gui/j2d/entity/RPEntity2DView.java
===================================================================
RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/client/gui/j2d/entity/RPEntity2DView.java,v
retrieving revision 1.40
diff -u -r1.40 RPEntity2DView.java
--- src/games/stendhal/client/gui/j2d/entity/RPEntity2DView.java 24 Oct 2009 22:11:04 -0000 1.40
+++ src/games/stendhal/client/gui/j2d/entity/RPEntity2DView.java 20 Nov 2009 23:50:47 -0000
@@ -19,6 +19,7 @@
import games.stendhal.client.sprite.AnimatedSprite;
import games.stendhal.client.sprite.Sprite;
import games.stendhal.client.sprite.SpriteStore;
+import games.stendhal.common.Debug;
import games.stendhal.common.Direction;
import java.awt.Color;
@@ -602,8 +603,7 @@
drawIdeas(g2d, x, y, height);
}
- // Enable this to debug entity view area
- if (false) {
+ if (Debug.SHOW_ENTITY_VIEW_AREA) {
g2d.setColor(Color.cyan);
g2d.drawRect(x, y, width, height);
}
Index: src/games/stendhal/common/Debug.java
===================================================================
RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/common/Debug.java,v
retrieving revision 1.79
diff -u -r1.79 Debug.java
--- src/games/stendhal/common/Debug.java 12 Nov 2009 21:48:35 -0000 1.79
+++ src/games/stendhal/common/Debug.java 20 Nov 2009 23:50:47 -0000
@@ -39,5 +39,8 @@
*/
boolean SHOW_LIST_SIZES = false;
-
+ /**
+ * it shows entity's view area
+ */
+ boolean SHOW_ENTITY_VIEW_AREA = false;
}
</source>
| |||