[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Disable automatic redraw
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Disable automatic redraw

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Zahan   (3 posts)  [Biography] bio
Date Sat 12 Nov 2016 12:08 AM (UTC)
Message
Quote:

In practice, MUSHclient calls Redraw internally when new output arrives from the MUD (and is placed on the screen), and you do a WindowShow, and at various other spots.


Is there a way to disable the internal redraw on new output?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 12 Nov 2016 02:18 AM (UTC)
Message
New output to where? When text arrives from the MUD you want to see it don't you?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zahan   (3 posts)  [Biography] bio
Date Reply #2 on Sat 12 Nov 2016 02:43 AM (UTC)
Message
New output to the world.


I do want to still see the output, yes. I didn't realize that removing that redraw would stop the mud output from showing up. Perhaps I don't want to stop the redraw afterall.


Maybe it would help if I explain my issue. I find that I have an unreasonable amount of miniwindows, and it was slowing down mush's processing of output from the mud. I managed to recreate a noticeable slowdown by having as few as 10 miniwindows, completely blank, with no functions firing to fill them. Anything over 5, you start to see the process time climbing.

My thought was to stop the automatic redraw and then just call for which specific miniwindows needed to be redrawn at that moment by using the windowcreate/show combination. That would, in theory, allow me to keep my unreasonable amount of windows.

That all falls apart though, if it's connected to showing the mud output. I need the mud output still.

Hrm.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 12 Nov 2016 04:53 AM (UTC)
Message
10 windows with nothing in them shouldn't slow things down. When you draw inside a miniwindow it draws to an offscreen bitmap. Then when the main window is drawn it copies these bitmaps onto the output window in the desired spot.

The only reason I can think of for 10 to slow it down is if you have made them ridiculously large and/or turned on transparency.

Can you post code to reproduce this? I would like to look at how you set up the windows and what size they are.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zahan   (3 posts)  [Biography] bio
Date Reply #4 on Sat 12 Nov 2016 05:19 AM (UTC)

Amended on Sat 12 Nov 2016 07:19 AM (UTC) by Zahan

Message
I sized them 300x300.

I'd post the basic for-loop I used to test but it feels pointless since you just nailed it - they were flagged for transparency.

I turned off the transparency, redrew 30 of them, and no lag whatsoever to processing.

Very enlightening. Thank you.


Edit: here's the code anyway, for curiosity's sake.


-- function
function CreateTestWindow (win, z_order)
	WindowCreate (win, 10, 10, 300, 300, 1, 6, 0)
	WindowSetZOrder(win, z_order)
	WindowFont(win, "8", "Lucida Console", 8, false, false, false, false)
	WindowFont(win, "8b", "Lucida Console", 8, true, false, false, false)
	WindowFont(win, "9", "Lucida Console", 9, false, false, false, false)
	WindowFont(win, "9b", "Lucida Console", 9, true, false, false, false)
	WindowShow(win, true)
end

-- clear any existing
for i = 1, 50 do
	local win = "test"..i
	WindowShow(win, false)
end

-- draw test windows
for i = 1, 15 do
	local win = "test"..i
	CreateTestWindow(win, i)
	print("loading", win)
end
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,620 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]