31
Server.War2.ru / Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« on: December 15, 2015, 01:38:49 AM »
@xboi
I'll sink some time into this project since there seems to be some interest now...
Hold off on any threading changes... there are still lots of bigger issues.
1. Does "in-game" Broodwar have any open SDlgDialog windows?
2. For Each SDlgDialog window GdiTransparentBlt color converts the same 640x480 from 8bpp to 32bpp each time... Would it be faster to color convert once then GdiTransparentBlt out to all the windows?
3. Would it be faster to GdiTransparentBlt only the changed portions of the screen instead of the entire screen to every window... Unfortunately the game locks the entire screen so we don't immediately know where changes occur. However, since we know every unchanged scan line will be all 0xFE bytes... it should be possible to do a quick hash of a scan line to know if anything on that line has changed... which would allow us to quickly determine a bounding rect around changes which we could then intersect with the window rects thus allowing us to move much fewer bytes around.
4. The only thing we can do for "ddraw only mode" is switch to uploading to video memory with a real API, not GDI. But that means when switching from "mixed mode gdi/ddraw" to "ddraw only" we need to clear any gdi stuff... can we just paint the main window with a NULL_BRUSH or do we have to destroy and re-create the main window?
I'll sink some time into this project since there seems to be some interest now...
Hold off on any threading changes... there are still lots of bigger issues.
1. Does "in-game" Broodwar have any open SDlgDialog windows?
2. For Each SDlgDialog window GdiTransparentBlt color converts the same 640x480 from 8bpp to 32bpp each time... Would it be faster to color convert once then GdiTransparentBlt out to all the windows?
3. Would it be faster to GdiTransparentBlt only the changed portions of the screen instead of the entire screen to every window... Unfortunately the game locks the entire screen so we don't immediately know where changes occur. However, since we know every unchanged scan line will be all 0xFE bytes... it should be possible to do a quick hash of a scan line to know if anything on that line has changed... which would allow us to quickly determine a bounding rect around changes which we could then intersect with the window rects thus allowing us to move much fewer bytes around.
4. The only thing we can do for "ddraw only mode" is switch to uploading to video memory with a real API, not GDI. But that means when switching from "mixed mode gdi/ddraw" to "ddraw only" we need to clear any gdi stuff... can we just paint the main window with a NULL_BRUSH or do we have to destroy and re-create the main window?