Build Templates (Copy&Paste) (r13911 + 0.6.3 + 0.6.2)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

@Dissy: Do you mean MiniIN?
Because the copy&paste feature never was within the nightlies ;)
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Post by PhilSophus »

When compiling on Linux with g++ (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) I get the following errors:

Code: Select all

[SRC] Compiling copy_paste.cpp
/home/pub/games/openttd/build/signal_autocomplete_trunk/src/copy_paste.cpp: In function 'void PasteArea(TileIndex, bool, bool, bool, bool)':
/home/pub/games/openttd/build/signal_autocomplete_trunk/src/copy_paste.cpp:282: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is bet
ter than the worst conversion for the second:
/home/pub/games/openttd/build/signal_autocomplete_trunk/src/copy_paste.cpp:282: note: candidate 1: operator<<(unsigned int, int) <built-in>
/home/pub/games/openttd/build/signal_autocomplete_trunk/src/rail.h:91: note: candidate 2: TrackBits operator<<(int, Track)
And the same error in approx. 240 more locations in the same file. I could turn it into a warning with the -fpermissive switch, but it would be better if this could be fixed.

Edit: And the same in viewport.cpp
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Thx for reporting.

Hmm, I'm not too familiar with C++,
but could you add the following line into "helpers.hpp(78)"?

Code: Select all

FORCEINLINE mask_t operator << (uint m, idx_t i) {return (mask_t)(m << (int)i);} \
so it looks like this in the end:

Code: Select all

/** probably redundant enum combining operators (as we have conversion functions)
 *  but the old code is full of such arithmetics */
# define DECLARE_ENUM_AS_BIT_INDEX(idx_t, mask_t) \
	FORCEINLINE mask_t operator << (uint m, idx_t i) {return (mask_t)(m << (int)i);} \
	FORCEINLINE mask_t operator << (int m, idx_t i) {return (mask_t)(m << (int)i);} \
	FORCEINLINE mask_t operator << (mask_t m, int i) {return (mask_t)(((int)m) << i);} \
	FORCEINLINE mask_t operator >> (mask_t m, int i) {return (mask_t)(((int)m) >> i);}
If it fixes your problem, I'll add it to the patch.
Dissy
Engineer
Engineer
Posts: 36
Joined: 19 Dec 2006 12:35
Contact:

Post by Dissy »

Frostregen wrote:@Dissy: Do you mean MiniIN?
Because the copy&paste feature never was within the nightlies ;)
ye sorry i only played miniINs :)
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Post by PhilSophus »

Frostregen wrote:Thx for reporting.

Hmm, I'm not too familiar with C++,
but could you add the following line into "helpers.hpp(78)"?

Code: Select all

FORCEINLINE mask_t operator << (uint m, idx_t i) {return (mask_t)(m << (int)i);} \
so it looks like this in the end:

Code: Select all

/** probably redundant enum combining operators (as we have conversion functions)
 *  but the old code is full of such arithmetics */
# define DECLARE_ENUM_AS_BIT_INDEX(idx_t, mask_t) \
	FORCEINLINE mask_t operator << (uint m, idx_t i) {return (mask_t)(m << (int)i);} \
	FORCEINLINE mask_t operator << (int m, idx_t i) {return (mask_t)(m << (int)i);} \
	FORCEINLINE mask_t operator << (mask_t m, int i) {return (mask_t)(((int)m) << i);} \
	FORCEINLINE mask_t operator >> (mask_t m, int i) {return (mask_t)(((int)m) >> i);}
If it fixes your problem, I'll add it to the patch.
Thank you. That seems to do the job. And nice to know these macros, quite useful.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

After a long time of abstinence the current linux-version is availible.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
dylf
Engineer
Engineer
Posts: 30
Joined: 14 Dec 2006 14:13

please help

Post by dylf »

Hey guys

Please help me installing this ad-on. I running version 0.5.0 RC5.
lawsonuw
Engineer
Engineer
Posts: 15
Joined: 25 Feb 2007 23:02

Post by lawsonuw »

Cudos on this plugin! It's a hell of a time saver. I sure hope this is getting into Trunk sometime.

I mostly use it when building up larger intersections from smaller repeated parts. Although I do have a few intersections that are small and standard enough to just copy/paste whole.

Keep up the awsome work!
And one intersection to rule them all.
DannyA
Engineer
Engineer
Posts: 108
Joined: 14 Sep 2006 03:51
Location: Australia

Post by DannyA »

Howdy,

I would like to use the copy and paste features in multiplayer internet games (v0.5.0) on both mac and windows.

Does copy & past run on a mac ok?

Is there somewhere I can get binaries which allow me to do this?

Or if I have to compile these binaries myself, will the latest version of the patch apply to the source for 0.5.0?

(P.S I don't have visual studio setup anymore to try, and haven't taken any interest openttd for the last 6-9 months so am not aware of any recent developments.)

Thanks, Danny
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

@lawsonuw:
Thx for appreciation :)

@DannyA:
It should run on a mac, but i never tried it.
You have to compile it for yourself,
because i don't have a mac and don't know how to crosscompile for it.

The current patch does NOT apply to 0.5.0 easily.
Mainly because of C++ branch merge and Makefile rewrite, which changed many filenames and file locations.
User avatar
Shrekko
Engineer
Engineer
Posts: 29
Joined: 19 Feb 2007 10:49
Location: Hoogland, the Netherlands

Post by Shrekko »

Why can't we post templates here :?
OpenTTD is cool,
Thank you all developers.
I hope that I'm one day something like you.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

It is because of the file-ending, which is not specifically allowed.
Pack your templates with some archiver, and try to post them again.

Please start another thread for exchanging/posting templates.

Bye,
Frostregen
DannyA
Engineer
Engineer
Posts: 108
Joined: 14 Sep 2006 03:51
Location: Australia

Post by DannyA »

Thanks for the info Frostregen, although it was not exactly what I was hoping to hear :)
I don't have a mac either - it's for a mate but maybe he'll find the patiance to get it working, but not me I think.
De_Ghost
Engineer
Engineer
Posts: 7
Joined: 19 Mar 2007 22:50

Post by De_Ghost »

can you compile a 0.5.0 or r8924 one?
i wanna play with my friend and he doesn't have nightly build
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

I guess you are lucky:

Win32 0.5.3 Package
Just extract it over your existing 0.5.3 install.

It is fully compatible with non-patched clients/servers.

hf,
Frostregen

-----
EDIT: Files removed. (0.6.0 is out)
Last edited by Frostregen on 03 Apr 2008 07:06, edited 15 times in total.
De_Ghost
Engineer
Engineer
Posts: 7
Joined: 19 Mar 2007 22:50

Post by De_Ghost »

i love you man :D
so does the 10 other ppl that dled it :D
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Post by Starbud »

i like it so much too, i will be playing online tomorrow and show what i have found.
Do you think we can have it implemented in the nightly version too?
The good thing about the nightly is that you can build diagonal tracks under bridges.
It often help me A LOT.
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

Cool! I hope they will merge this one into the trunk. If it is fit for it that is. :wink:

Question to a OTTD developer; is it within the OTTD coding style to be merged someday? :)
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Post by Starbud »

I have been playing with the copy&paste function today and i noticed that bridges become 2 tiles long atleast from my machine.
Anyone else who have had that experience?
Maybe it's just all my viruses on the specific machine doing a trick.

However in the MiniIN version of OTTD there is another copy&paste that can take bridges too.
MiniIN is suppose to have bugs in it but i rarely find any actually.
Link to the MiniIN versions of OTTD:
http://nightly.openttd.org/MiniIN/files/
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

About Bridges:
Which version does have this error - Nightly or 0.5.0?
Does your error mean your bridges will get 2 tiles long,
regardless of length before copy?

I'll have a look into it, maybe a bug from backporting to 0.5.0.

Btw, the "Mini-IN-Copy&Paste" was this patch too ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 16 guests