Page 1 of 5

45° rotated rectangle clearing / leveling patch

Posted: 23 Jun 2005 17:48
by Diadem
I made a patch that allows you to clear or level rectangle areas rotated 45°. This allows you to clear or level diagonal stretches of land. That, imho, makes constructing diagonal rails or roads a lot less bothersome.

I've tested the patch myself, and I can't find any problems with it anymore. If you find any, please tell me. Since my windows compiler won't compile with .png support I can't add screenshots. Feel free to add your own :)

A final note for the coders: As a bonus I added some extra comments here and there in the code in this patch.

[edit]
Oh, before I forget. Use ctrl to use this feature.

Posted: 23 Jun 2005 17:53
by Diadem
Some screenies of this feature (many thanks to HackyKid):

Posted: 23 Jun 2005 18:01
by Diadem
More Screenies:

Posted: 23 Jun 2005 18:19
by mkxx
Good work! Looking for use this in latest nightly ;o)

Posted: 23 Jun 2005 19:12
by Nanaki13
WOW :)
That's all I'll say about this patch.

Posted: 23 Jun 2005 21:21
by bobingabout
how do you control between diagonal and square flatterning?

Posted: 23 Jun 2005 21:48
by Jump
bobingabout wrote:how do you control between diagonal and square flatterning?
ctrl :)

Posted: 23 Jun 2005 21:57
by bobingabout
sounds simple. i supose "Activate these options" means "Use this feature".

Posted: 24 Jun 2005 09:47
by Diadem
bobingabout wrote:sounds simple. i supose "Activate these options" means "Use this feature".
Eh, yes, it does. I changed it now in the first post :)

Posted: 06 Jul 2005 15:50
by Heinz Humpelstrumpf
Very nice patch, but I had already made it :o

http://www.tt-forums.net/viewtopic.php?t=14264

That version of mine is not fixed for the newer releases as there was little interest in it an I have not so much time now.

Posted: 06 Jul 2005 17:01
by Diadem
Hmm, two different patches that do the same thing.

Well, my patch is newer (so less conflicts), and seems to work flawlessly. Also, my patch works for the dynamite tool as well. So to be honest, I don't see any reason to choose your patch over mine.

But of course you're welcome to look into my patch and improve it, if you spot anything that you did better than me, coding-wise.

this is a must have

Posted: 19 Jul 2005 22:18
by magnato
wonderful!
Everything that makes construction easier is a must have!
How can we novices download it and put it into action?

Posted: 21 Jul 2005 02:17
by Conditional Zenith
You can wait until it makes it into the integrated/nightly builds, or you can check the code out of SVN, apply the patch, and compile it yourself. If you want to try the latter, check out http://wiki.openttd.org/index.php/SVN#Source_code

Note that the diff is against revision 2478. You can try to apply it to a later version and it might work (it depends on whether the code this patch is for has been worked on since).

Good luck.

Posted: 04 Oct 2005 03:58
by DaleStan
In a different thread, SirkoZ wrote:Could someone update the 45° to the latest source,
Because I was getting tired of bughunting NFORenum:

Posted: 04 Oct 2005 08:48
by webfreakz.nl
great :D

I'll apply the patch asap 8)

Posted: 04 Oct 2005 08:57
by peter1138
Hmm, any chance of a patch without a huge #define?

Posted: 25 Apr 2007 01:41
by micomico
Rediffed against trunk r9715.

I'm posting the patch this in this old topic, because another recent topic about this patch is now locked.

Posted: 25 Apr 2007 11:52
by NukeBuster
micomico wrote:Rediffed against trunk r9715.

I'm posting the patch this in this old topic, because another recent topic about this patch is now locked.
I was hoping someone would rediff this one. Thanks A LOT!

Posted: 05 May 2007 19:18
by belugas
Reviving this patch is nice.
But will it EVER be fixed?
This huge macro is a big no-no...
Tip for the next patch (or the next patcher) : remove the macro and have a function instead.
Ho... and check comment/code style too...

Posted: 06 May 2007 15:48
by micomico
How does it look like now?

I think a function would complicate the code more in this case, but i've unfolded the macro and changed the code/comment style.