LB Booster
« Blitting blank screen. »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:35am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Blitting blank screen.  (Read 811 times)
Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx 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
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
« Last Edit: Mar 5th, 2014, 9:54pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Blitting blank screen.
« Reply #2 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.
« Last Edit: Mar 5th, 2014, 10:56pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
« Last Edit: Mar 6th, 2014, 11:04am by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls