Diagonal demolish / level land patch
Moderator: OpenTTD Developers
Diagonal demolish / level land patch
Below is an update of an old patch found here that was coded by Diadem.
What this patch does is it lets you demolish or level land diagonally when you use the control key.
At this stage it has only been updated to the current revision. If there are any bugs, coding advice or extra functionality related to this patch and it has merit i will more then likely be happy to make the related changes.
What this patch does is it lets you demolish or level land diagonally when you use the control key.
At this stage it has only been updated to the current revision. If there are any bugs, coding advice or extra functionality related to this patch and it has merit i will more then likely be happy to make the related changes.
- Attachments
-
- Diagonal_Clearing_v1.0_r9538.patch
- (18.37 KiB) Downloaded 307 times
-
- 1.PNG (59.84 KiB) Viewed 11216 times
-
- 2.PNG (62.91 KiB) Viewed 11213 times
Last edited by l_Blue_l on 03 Apr 2007 08:33, edited 1 time in total.
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
Some coding points:
- Don't use multi-line macros. In fact, don't use macros at all if you can avoid it.
- This is possibly outside the scope of the patch, but I think it would be better to send the start and finish co-ordinates to the DoCommand, rather than executing it for every tile that gets levelled.
- You can replace this (notice the corrected coding style too )
with this:
Code: Select all
if (_ctrl_pressed) { DoCommand(..., 1, ...); } else { DoCommand(..., 0, ...); }
Code: Select all
DoCommand(..., _ctrl_pressed ? 1 : 0, ...);
- Don't use all upper-case for function names; use e.g. IsInsideRotatedRectangle instead.
- Take care with spacing and brackets (the style we use is described here: http://wiki.openttd.org/index.php/Coding_style).
No-one's more important than the earthworm.
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
This is a really great addition, i was already waiting for someone to bring it up to the latest nightly.
It really saves A LOT of time while building diagonal track
It really saves A LOT of time while building diagonal track
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Code-style :
With C++, this is not needed change
Comments that are on one line (or spawn on more than more line) will be like this
and not
Functions/macros definitions should use the same type of comment
is bad. The following is the desired way
Maybe i'm wrong, but i think DO_CLEAR_AREA and others alike could be made a function by itself/themselves.
As for the patch itself, i still like it
With C++, this is not needed change
Code: Select all
-struct TileHighlightData {
+typedef struct TileHighlightData {
Code: Select all
/* Need to Mark odd and even tiles (compare with checkerboard: black and white squares) */
Code: Select all
// Need to Mark odd and even tiles (compare with checkerboard: black and white squares)
Code: Select all
+// Check to see if x,y lies within the selected 45° rotated rectangle.
+// Called by DrawTileSelection() immidiately below.
+bool IS_INSIDE_RR(int x, int y)
Code: Select all
+/**
+ * Check to see if x,y lies within the selected 45° rotated rectangle.
+ * Called by DrawTileSelection() immidiately below.
+ * @param x blablabla
+ * @param y blablabla
+ * @return another blablabla
+ */
+bool IS_INSIDE_RR(int x, int y)
As for the patch itself, i still like it
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
I agree. This must make it in the trunk as soon as possible.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
No, not as soon as possible.athanasios wrote:I agree. This must make it in the trunk as soon as possible.
It's not a question of life and death
When it it will be ready, and when the other devs agree on incorporation
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
I would note that this feature was first diffed against rev 2335. Two three three five. No, that's not a mistake; Diadem was not the first to implement this.
That's a long time for this to get in, if The Powers actually were interested in it.
That's a long time for this to get in, if The Powers actually were interested in it.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
I think it has in the mean time gotten old and wrong (code-wise).DaleStan wrote:Two three three five.
Some things are just laying around never to be impelemented and later when someone digs up an old feature it's 'too old to make it'. I say when something is good to get into the trunk, and demand for that specific feature is high, get it in immidiatly before it gets tagged as 'old'.
Or developers had a different idea about that feature (it was not good (code wise) to start with or for another reason and my rant here goes down with the fishies, but I know there are more people here with the same idea about 'old but high demanding' features that never made it.
Can someone clear it up a bit to take away all the clouds?
Got anything positive to add?DaleStan wrote:That's a long time for this to get in, if The Powers actually were interested in it.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
It becomes too old to make it because of all the changes in trunk. If it's in trunk it's the main developers maintaining it, if not it's the patch author, but someone has to do it either way. Just being in trunk doesn't mean that the code automatically becomes current, just that the maintenance becomes invisible to everyone who doesn't scrutinise all the trunk commits. That's why we have strict rules about the coding style, and why not everything gets committed to trunk.Mr. X wrote:Some things are just laying around never to be impelemented and later when someone digs up an old feature it's 'too old to make it'. I say when something is good to get into the trunk, and demand for that specific feature is high, get it in immidiatly before it gets tagged as 'old'.
No-one's more important than the earthworm.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Wise manl_Blue_l wrote:On a side note could all discussion that does not relate to this patch please discontinue.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
-
- Engineer
- Posts: 21
- Joined: 11 Feb 2007 17:18
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
Okay, that seems understandable, thanks for shedding some light on it.Maedhros wrote:It becomes too old to make it because of all the changes in trunk. If it's in trunk it's the main developers maintaining it, if not it's the patch author, but someone has to do it either way. Just being in trunk doesn't mean that the code automatically becomes current, just that the maintenance becomes invisible to everyone who doesn't scrutinise all the trunk commits. That's why we have strict rules about the coding style, and why not everything gets committed to trunk.Mr. X wrote:Some things are just laying around never to be impelemented and later when someone digs up an old feature it's 'too old to make it'. I say when something is good to get into the trunk, and demand for that specific feature is high, get it in immidiatly before it gets tagged as 'old'.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Search!Mikeyspike wrote:hey guys, havn't posted in a wile, but heres a realy noobish question, how do i install these patches?
thanks
Or read this : http://www.tt-forums.net/viewtopic.php?t=21678
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
-
- Engineer
- Posts: 21
- Joined: 11 Feb 2007 17:18
I guess I'm a little irritated that basically no one was interested it this back then, and now, all of a sudden, it's the best thing since sliced bread.richk67 wrote:Got anything positive to add?DaleStan wrote:That's a long time for this to get in, if The Powers actually were interested in it.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
This is what i wroteBelugas wrote:As for the patch itself, i still like it Wink
This is how you interpret it. Maybe you exagerate a bit my enthusiasm? Or maybe it was another post from somebody else that blew the fuse? DOn't know which one...Dalestan wrote:all of a sudden, it's the best thing since sliced bread.
I was aware of the patch "back then" and found it quite appealing, but was not in a postion to do anything about it.Dalestan wrote:basically no one was interested it this back then,
Now that i can "take it into trunk", things are a bit different.
Always put things in context, please
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Who is online
Users browsing this forum: No registered users and 25 guests