|
|
#1 |
|
Knight
Join Date: Jan 2008
Posts: 632
![]() |
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?
__________________
The Great Wyrm of Law breathes litigation... |
|
|
|
|
|
#2 | |
|
Adept
Join Date: Jan 2008
Posts: 227
![]() |
Quote:
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
|
|
|
|
|
|
|
#3 |
|
Knight
Join Date: Jan 2008
Posts: 632
![]() |
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.
__________________
The Great Wyrm of Law breathes litigation... |
|
|
|
|
|
#4 |
|
Adept
Join Date: Jan 2008
Posts: 227
![]() |
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. |
|
|
|
|
|
#5 |
|
Knight
Join Date: Jan 2008
Posts: 632
![]() |
'Tis alright. I wasn't looking to open up a can of worms, actually.
__________________
The Great Wyrm of Law breathes litigation... |
|
|
|
|
|
#6 | |
|
Adept
Join Date: Jan 2008
Posts: 227
![]() |
Quote:
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. |
|
|
|
|
|
|
#7 |
|
Knight
Join Date: Jan 2008
Posts: 632
![]() |
Yeah, forget about it then. BTW I'd offer to help but I know zilch about Win32 programming.
__________________
The Great Wyrm of Law breathes litigation... |
|
|
|
|
|
#8 |
|
Prophet
Join Date: Dec 2009
Posts: 4,783
![]() |
|
|
|
|
|
|
#9 |
|
Swordsman
Join Date: Jun 2007
Posts: 342
![]() |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |