Enhanced viewport: zoom out, overlays & tooltips (r53_27127)

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

mmichalll
Engineer
Engineer
Posts: 10
Joined: 23 Mar 2010 21:37

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by mmichalll »

Hi
I have problem with zoom patch. I use this code

Code: Select all

patch -p1 -i zoom.patch
Here is screen my error.
If i use -p0 nothing happen.
What i doing wrong?

i use latest version of zoom patch zoom64_r17_for_trunk_23343 (rename to zoom.patch)
i use source code openttd-1.1.3
i have win 7 ultimate 64 bit
i use latest version mingw and svn from wiki.

(i try extra large map patch and work good)
Attachments
error.png
error.png (51.21 KiB) Viewed 7252 times
Last edited by mmichalll on 29 Nov 2011 16:09, edited 4 times in total.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by Eddi »

what's the version you want to apply this to? (output of "svn info" or somesuch)
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by TrueBrain »

Eddi wrote:what's the version you want to apply this to? (output of "svn info" or somesuch)
mmichalll wrote:(..)
i use source code openttd-1.1.3
(..)
As the patch might suggested, it is to be applied against r23343. Not against 1.1.3.
The only thing necessary for the triumph of evil is for good men to do nothing.
mmichalll
Engineer
Engineer
Posts: 10
Joined: 23 Mar 2010 21:37

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by mmichalll »

I dont understand. :((
I have used source code openottd-r23343 ? or what?
Last edited by mmichalll on 29 Nov 2011 16:32, edited 1 time in total.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by TrueBrain »

Seemly you understand perfectly :) Best is to use Subversion to get that revision. I suggest you read up how those things work if you are serious about applying this patch, otherwise just ask someone to make you a binary.
The only thing necessary for the triumph of evil is for good men to do nothing.
mmichalll
Engineer
Engineer
Posts: 10
Joined: 23 Mar 2010 21:37

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by mmichalll »

Hmm...
i read how this things work, Probably not good :?
When I tried to the extra large maps patch, work for the first time (i use same things like zoom patch). I compiled the game and for testing i played 2 game years

I want to make a game where they will be only two patches.

This zoom.patch is my second compilation in my life :shock:
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by HackaLittleBit »

Thanks MJP

I can tell you that this is a long desired feature. (see this topic).
It looks very promissing.

Maybe we can slowly get rid of small map. :roll:

Bug: Town names are not displayed at lower zoom levels.
EDIT: On second thought maybe thats a good thing. I can't read it anyhow on my screen.

EDIT2: Bug2: Building not allowed after certain zoom level.(or give message building not allowed)


Image
P.S. Try to keep your patch as small as posible or split it up in more smaller ones.

Regards HackaLittleBit
Attachments
townname.png
townname.png (102.69 KiB) Viewed 1178 times
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r17 for 23343

Post by MJP »

mmichalll> You might be interested by reading http://wiki.openttd.org/SVN#How_do_I_ge ... on_then.3F

HackaLittleBit> Beyond readability of town names, in realtime rendering mode, knowing if a text block is overlapped and must be redrawn would be quite difficult to do. But a tooltip with the name of the town below cursor could be a nice option.

Concerning bug2, I blocked the mouseclick signals in map mode to prevent costly errors (line 2064 of the current diff).

And dividing the patch is absolutely possible since there are 3 independant parts :
- extension of viewport to render like a map for higher zoom out levels
- filter to prevent marking dirty screenblocks when it changes nothing on the map
- tooltip for industry production (and maybe town names in the next version)

I'll try my best ;-)
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r18 for 23482

Post by MJP »

I'm not sure if this is really helpful but town names are now supported (in a way) in map mode :
town_tooltip.png
town_tooltip.png (12.2 KiB) Viewed 6993 times
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Patch: zooming out a viewport up to 64X // r18 for 23482

Post by Eddi »

what's wrong with showing them in small font, like normal?
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r19 for 23488

Post by MJP »

Well, you are right Eddi.
In fact, nothing prevents to mix custom and sprite based rendering.
So I let ViewportAddTownNames() do its job and that's all.

In the end, town names are:
- shown in 16X and 32X if the game option "Town names displayed" is checked
- never shown in 64X (way too messy)

The town name tooltip is enabled only if "Town names displayed" is unchecked.
town_tooltip2.png
town_tooltip2.png (17.89 KiB) Viewed 6937 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: Patch: zooming out a viewport up to 64X // r19 for 23488

Post by HackaLittleBit »

compile warning MingW32

Code: Select all

[SRC] Compiling viewport.cpp
src/viewport.cpp: In function 'void ViewportDrawMap(const ViewPort*)':

src/viewport.cpp:1427:66: warning: suggest parentheses around '+' in operand of '&'

	const uint colidxbase = n % _screen.width + n / _screen.width & 1;


src/viewport.cpp:1436:34: warning: suggest parentheses around '+' in operand of '&'

	uint colidx = j + colidxbase & 1;


EDIT1: For the rest little comments. Everything works smooth. Simply awfull. Thanks.
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r20 for 23587

Post by MJP »

HackaLittleBit> Thank you for testing! Those 2 warnings should be no more.

Concerning bridges and tunnels in r20, I let commented code in VpGetSmallMapColor() (see smallmap_gui.cpp) so anyone can test whatever colour they want. I think that the fixed black/yellow colours solution is the most readable of everything I tried, but let me know if you find something better.
bridgetunnel.png
bridgetunnel.png (6.31 KiB) Viewed 6824 times
And the enhancement of owner mode looks like this :
ownerslope.png
ownerslope.png (6.02 KiB) Viewed 6824 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: Patch: zooming out a viewport up to 64X // r20 for 23587

Post by HackaLittleBit »

You are showing tunnels.
Is that on purpose?
Glitch with map edge.
Colors of companies looks ok.
Regards
glitch.png
glitch.png (162.39 KiB) Viewed 6780 times
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r20 for 23587

Post by MJP »

HackaLittleBit wrote:You are showing tunnels.
Is that on purpose?
Yes, absolutely. But if it bothers you, now you can uncheck "Show tunnels on viewport map" in Advanced Settings -> Interface.
HackaLittleBit wrote:Glitch with map edge.
Thank you for reporting, it should be fixed in r21.
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: Patch: zooming out a viewport up to 64X // r21 for 23663

Post by adf88 »

Great job MJP. The patch comes very handy for me.

I would like to apply it over OpenTTD 1.1.4 and play multiplayer. Does the patch break network compatibility? Could you publish some older version which is closer to OpenTTD 1.1.4?

I have also a suggestion: it would be nice if we could control industries visibility like in the map window.
:] don't worry, be happy and checkout my patches
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Patch: zooming out a viewport up to 64X // r21 for 23663

Post by Eddi »

how about patching 1.2.0-beta1 and playing multiplayer with that? :)
adf88 wrote:I have also a suggestion: it would be nice if we could control industries visibility like in the map window.
that's what the transparency settings (Ctrl+X) should be for.
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r21 for 23663

Post by MJP »

I tried to clean up my code (see attached r21T2). Essentially I moved functions around.
EDIT: second version r21T2 is more compliant to OTTD coding style (and it has better variables names)

3 files are concerned:
- smallmap_colours.h (new file)
- smallmap_gui.cpp (now smaller)
- viewport.cpp (now bigger)

But I'm not sure what's best: in viewport.cpp, I use extern variables to access things declared in smallmap_gui.cpp.
Should I move these variables to smallmap_gui.h instead?
adf88 wrote:Does the patch break network compatibility?
AFAIK it breaks nothing related to multiplayer.
adf88 wrote:Could you publish some older version which is closer to OpenTTD 1.1.4?
I certainly can do that :) See zoom64_history_r1_to_r21.zip
adf88 wrote:I have also a suggestion: it would be nice if we could control industries visibility like in the map window.
The viewport map is already linked to the smallmap controls that show/hide specific industries. I may try to do a toolbar not tied to the smallmap...
Attachments
zoom64_r21T_for_r23672.zip
(24.84 KiB) Downloaded 181 times
zoom64_history_r1_to_r21.zip
(380.12 KiB) Downloaded 196 times
zoom64_r21T2_for_r23675.zip
(24.83 KiB) Downloaded 186 times
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r22 for 23686

Post by MJP »

Sorry if someone downloaded early r22, I missed a type change affecting 32bpp-anim (see commit of r23670). If you have major screen corruption with this blitter mode, please download r22 again.

(otherwise my previous question "Should I move these variables to smallmap_gui.h instead?" still seeks an answer)
MJP
Engineer
Engineer
Posts: 116
Joined: 12 Mar 2011 19:01

Re: Patch: zooming out a viewport up to 64X // r26 for 23768

Post by MJP »

When I scroll a viewport on a big map, I'm easily lost... but not anymore :)
r26 helps to understand where we are, as shown below:
show_scrolling_viewport.png
show_scrolling_viewport.png (166.81 KiB) Viewed 6424 times
Attachments
show_scrolling_viewport.png
show_scrolling_viewport.png (161.95 KiB) Viewed 6263 times
Last edited by MJP on 22 Jan 2012 21:58, edited 1 time in total.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 42 guests