Author |
Topic: Blitting blank screen. (Read 810 times) |
|
Rod
Full Member
member is offline
Gender:
Posts: 110
|
|
Blitting blank screen.
« Thread started 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
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Blitting blank screen.
« Reply #1 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.
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Blitting blank screen.
« Reply #2 on: Mar 5th, 2014, 9:53pm » |
|
on Mar 5th, 2014, 5:05pm, Rod wrote: 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.
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Blitting blank screen.
« Reply #3 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.
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Blitting blank screen.
« Reply #4 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:
You create two controls whose Z-order matters (which is usually the case only if they overlap).
Both controls have STYLEBITS statements.
The STYLEBITS statements appear before the statements which create the controls.
The order in which the STYLEBITS statements appear in the program is different from the order in which the controls themselves are created. 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.
|
|
Logged
|
|
|
|
|