LB Booster
Programming >> Compatibility with LB4 >> Blitting blank screen.
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1394042711

Blitting blank screen.
Post by Rod on Mar 5th, 2014, 5:05pm

Some of my blitting code works, but this code just shows a blank white screen instead of betty boop dancing?

http://webzoom.freewebs.com/gamebin/Betty.zip
Re: Blitting blank screen.
Post by Richard Russell on Mar 5th, 2014, 9:06pm

on Mar 5th, 2014, 5:05pm, Rod wrote:
http://webzoom.freewebs.com/gamebin/Betty.zip

That link just gives me a "This web page can't be displayed" message, so I can't offer any specific advice. In general, though, if you are blitting graphics using the Windows API you need to ensure you execute a wait statement afterwards. See the 'Troubleshooting' section of the LBB docs under "Compatibility with LBB may be impaired if you draw graphics using the Windows API.... ".

Richard.
Re: Blitting blank screen.
Post by Richard Russell on Mar 5th, 2014, 9:53pm

on Mar 5th, 2014, 5:05pm, Rod wrote:
Some of my blitting code works, but this code just shows a blank white screen instead of betty boop dancing?

http://webzoom.freewebs.com/gamebin/Betty.zip

OK, scrub my previous reply. I made a wild guess that perhaps your 'Betty.zip' should have been 'betty.zip', and I was right!

I've now looked at your code and the reason it doesn't work in LBB is that (for reasons I'm not entirely sure of at the moment) the two graphicboxes (#1.gb and #1.sk) are in the wrong Z-order. As a result the animation is hidden behind the skin.

The most straightforward workaround is to forcibly bring #1.gb in front of #1.sk, which you can do by adding this code immediately after the OPEN statement:

Code:
    hgb = hwnd(#1.gb)
    calldll #user32, "BringWindowToTop", hgb as ulong, r as long 

Compatibility with LB 4.04 is not impaired.

Edit: You could have made the 'hole' in skin.bmp the 'transparent' red colour, then the Z-order probably wouldn't have mattered.

Richard.
Re: Blitting blank screen.
Post by Richard Russell on Mar 6th, 2014, 08:21am

on Mar 5th, 2014, 9:53pm, Richard Russell wrote:
The most straightforward workaround is to forcibly bring #1.gb in front of #1.sk

Here's a simpler workaround: just reverse the order of the STYLEBITS commands:

Code:
    stylebits #1.gb, 0, _WS_BORDER, 0, 0
    stylebits #1.sk, 0, _WS_BORDER, 0, 0 

The order of the STYLEBITS commands shouldn't be significant, so this seems to be a bug in LBB. I will investigate.

Richard.

Re: Blitting blank screen.
Post by Richard Russell on Mar 6th, 2014, 4:13pm

on Mar 6th, 2014, 08:21am, Richard Russell wrote:
this seems to be a bug in LBB. I will investigate.

I can confirm it was a bug, although an extremely obscure one. I have uploaded a fixed version of LBB (2.51) to the usual place:

http://lbbooster.com/LBB.exe
http://lbbooster.com/LBBRUN.exe

You were very unlucky to encounter this bug. It only had an effect if all the following conditions were met:
Your betty.bas meets those conditions, but it's not very surprising that the bug - which has been present in all versions of LBB to date - has never been spotted previously!

Richard.