Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old May 18, 2012, 04:13   #1
Therem Harth
Knight
 
Join Date: Jan 2008
Posts: 730
Therem Harth is on a distinguished road
Chengband Win32 interface slow under Win7

Much, much slower than the Vanilla SDL interface anyway. It lags visibly when I force it to center the screen on the character... Are there any tricks for speeding it up on Windows 7?
Therem Harth is offline   Reply With Quote
Old May 18, 2012, 14:12   #2
chris
Knight
 
Join Date: Jan 2008
Posts: 544
chris is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
Much, much slower than the Vanilla SDL interface anyway. It lags visibly when I force it to center the screen on the character... Are there any tricks for speeding it up on Windows 7?
How about Vanilla using the main-win code?

At first glance the WM_PAINT handling seems very poorly designed as each tile character calls back to either term_pict_win or term_text_win. Each of these routines is designed to be self sufficient and runs a lot of code to set up and restore the DC over and over again. However, profiling on my machine shows that paints are being processed in debug mode in anywhere from 30ms to 70ms, so I'm not sure this is too bad after all (for drawing 3000 or so tiles).

For me, the main issue is the lack of double buffering. I can't use the center on screen option as all the flickering makes me sick (literally). I personally don't have a problem with the speed though the slowdown is noticeable.

I've been meaning to fix the double buffering issue for some time, but don't like wandering inside main-win.c
chris is offline   Reply With Quote
Old May 18, 2012, 15:04   #3
Therem Harth
Knight
 
Join Date: Jan 2008
Posts: 730
Therem Harth is on a distinguished road
Ah, alright... For now I've just turned off centering (and turned on highlighting so that I can always see where my @ is). Been breathed on from offscreen a few times, but nothing lethal so far.
Therem Harth is offline   Reply With Quote
Old May 18, 2012, 15:36   #4
chris
Knight
 
Join Date: Jan 2008
Posts: 544
chris is on a distinguished road
I'm working on a fix ... I confess to never looking at terminal code before.

I've learned so far that main-win draws directly to the window resulting in a very choppy update when centering the player. A better approach would be for the term_pict and term_text routines to draw to a memory buffer and then for TERM_XTRA_FRESH to blit the buffer to the window. This buffer could be stored in the extra terminal data.


Also, I've learned most drawing is done outside of the normal WM_PAINT processing and results in garbage if you drag another window on top of Chengband while playing. I can live with this since we have the Ctl+R redraw command.

EDIT: Actually, the problem here was in WM_PAINT processing which did a BeginPaint() EndPaint() and then an (erroneous) call to ValidateRect(). If WM_PAINT messages had queued up in the interim, this ValidateRect() call would cause them to be skipped.

Its a big job so no promises ...

Last edited by chris; May 18, 2012 at 19:53.
chris is offline   Reply With Quote
Old May 18, 2012, 18:00   #5
Therem Harth
Knight
 
Join Date: Jan 2008
Posts: 730
Therem Harth is on a distinguished road
'Tis alright. I wasn't looking to open up a can of worms, actually.
Therem Harth is offline   Reply With Quote
Old May 18, 2012, 19:17   #6
chris
Knight
 
Join Date: Jan 2008
Posts: 544
chris is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
'Tis alright. I wasn't looking to open up a can of worms, actually.
No big deal ... I meant to go in there at some point anyway.

I really can't tell if my changes have made a noticeable improvement! I tried downloading vanilla to compare, but it seems the same as Heng/Cheng when center player is turned on (3.3.0 which is the latest on oook). I'm not surprised since the main-win.c on github looks very similar to what I started with. Is it possible to download an SDL Angband for Windows?

EDIT: OK, I think the code is actually now noticeably faster. Its hard to tell in the dungeon, but when running in town or in the wilderness, I can definitely tell.

I no longer get a slight flicker, but having the whole world move is very hard for me to get used to. I don't think I can handle the center player option without getting nauseous, actually!

*Goes to bathroom to puke*

Last edited by chris; May 18, 2012 at 20:23.
chris is offline   Reply With Quote
Old May 18, 2012, 21:44   #7
Therem Harth
Knight
 
Join Date: Jan 2008
Posts: 730
Therem Harth is on a distinguished road
Yeah, forget about it then. BTW I'd offer to help but I know zilch about Win32 programming.
Therem Harth is offline   Reply With Quote
Old May 18, 2012, 21:47   #8
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 5,816
Derakon is on a distinguished road
Quote:
Originally Posted by Therem Harth View Post
Yeah, forget about it then. BTW I'd offer to help but I know zilch about Win32 programming.
Only one way to learn...
Derakon is online now   Reply With Quote
Old May 19, 2012, 18:55   #9
AnonymousHero
Knight
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 547
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Derakon View Post
Only one way to learn...
If main-win is actually using the Win32 API then I don't think we should encourage people to actually go in there without really good reasons .

The Win32 API is certainly not for the faint of heart.
AnonymousHero is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chengband / Entroband chem Variants 41 May 8, 2012 23:15
Differently arranged fonts [S, Win7] Fuma Variants 7 February 3, 2012 21:50
Getting the source for the current Chengband release? Therem Harth Variants 13 January 3, 2012 04:14
Bug report: / on numpad on win7 Remuz Development 6 July 8, 2011 14:16
[Chengband] The tale of a Wild Talent with a satisfying YASD kingvictory2003 Variants 5 December 14, 2010 19:00


All times are GMT +1. The time now is 23:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.