English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 20 January 2017, 16:57   #1
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
QBlit questions

I'm quite new to the forum so.. Hi to All!
I try Blitz2 (2.1) for few days now and I get quite good IMO results with it. but I stumbled upon a issue that I don't think I understand well.

I have a background (on a 32col image) and I put a shape on it.
When I use Blit command it works OK, as suspected.
using the command:

Blit a,MouseX,MouseY
it works OK. meaning that it puts a shape on mouse pos.

but when I do Qblit 0,a,MouseX,MouseY It puts a black rect around the main shape. (aligned to 16 pixels).I think I use Unqueue right (after VWait)
And my understanding was that using QBlit will erase the shape itself bt it will preserve the background graphics.

Is it normal behaviour of QBlit?
Do I really have to do doublebuffering (meaning to repaint all background)?
If so then what's the use of QBlit then?

TIA

ps. oh and I tried to set the cookie mode explicitly.
carrion is offline  
Old 20 January 2017, 17:02   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
Are your queues set up correctly?

Last edited by idrougge; 20 January 2017 at 17:02. Reason: spell
idrougge is offline  
Old 20 January 2017, 17:07   #3
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
hm I have one queue #0 set like:
Queue 0,50

I mean my programming is very simple I draw the background and that's it.
then in the main loop i move the shape with the mouse.
carrion is offline  
Old 20 January 2017, 17:43   #4
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
Actually, that is the way Unqueue works.

You need to either restore the background from another bitmap using that bitmap number as the second argument to Unqueue, or use BBlit which buffers the background.
idrougge is offline  
Old 20 January 2017, 17:52   #5
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
And then you also have to create a buffer instead of a Queue.

And then Unbuffer instead of Unqueue to delete the Bobs (and the background is restored)

Keep in mind this is considerably slower than doing a Unqueue / QBlit
Shatterhand is offline  
Old 20 January 2017, 19:02   #6
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
thank a lot guys it works with bblit and unbuffer but...

@shatterhand
ok. maybe it s slower but it works and I couldn't get it working with qblit and unquote? what did I do wrong?

I have a solution but I want to understand what i did wrong with Qblit and also the whole concept of Blit, Qblit, and BBlit.
carrion is offline  
Old 21 January 2017, 01:25   #7
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,338
You didn't do anything wrong with QBlit, that's simply how QBlit works.
idrougge is offline  
Old 21 January 2017, 01:40   #8
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Blit just put the shape on the bitmap.

QBlit puts the shape on the bitmap and adds it to a queue. When you empty the queue, all shapes are erased but BACKGROUND IS NOT RESTORED. You just erase everything.

BBlit puts the shape on the bitmap, but before it buffers the background it will overwrite to a buffer. When you empty the buffer, the shape is deleted and the background is restored.

QBlit is very useful when you know there's no background to restore. For example, I am working on a shoot'em up that uses Dual Playfield.. the background is at the back playfield and the main action happens at the front. I can use QBlit because there's no background to erase/restore , which is faster.

I also have another little prototype where enemies are always drawn where there's no background, so I can erase them safely, as I don't need to redraw everything after I erase the shapes
Shatterhand is offline  
Old 21 January 2017, 14:28   #9
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
thanks guys. appreciate the help.
please expect more questions from me, as I start to like blitz basic a lot
carrion is offline  
Old 21 January 2017, 22:28   #10
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 761
Perfect so I can learn from your questions too
tolkien is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
More questions... zerohour1974 New to Emulation or Amiga scene 18 27 March 2015 16:45
What would it take... (2 questions) alewis Amiga scene 0 26 July 2008 22:26
C/C++ questions pmc Coders. General 26 22 May 2007 03:22
A few questions! One1 New to Emulation or Amiga scene 2 30 October 2002 17:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:20.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13678 seconds with 13 queries