English Amiga Board


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

 
 
Thread Tools
Old 07 February 2014, 15:44   #1
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
[BlitzBasic] blit outside bitmap error

hi, i have a problem with this simple proggy :


Code:
NEWTYPE .bullets
x.q
y.q
End NEWTYPE



LoadShape 0,"q:bullet1",0

DEFTYPE .bullets bullet



BLITZ

BitMap 0,320,256,8
InitCopList 0,44,256,$10018,8,256,0
DisplayPalette 0,0
DisplayBitMap 0,0
CreateDisplay 0



bullet\x=1
bullet\y=1

Blit 0,bullet\x,bullet\y


Repeat
VWait                        ;
Until Joyb(0)=1              ;
End
the blitz compiler tells me... blit outside bitmap, but if the x and y of the blit is at 1,1 ? why?

also changing the blit to everything but 0,0 is incorrect

pls help me ;(
Raislin77it is offline  
Old 07 February 2014, 23:08   #2
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Not into Blitz so I could be 'barking up the wrong tree', but is the handle for the bullets at the top-left corner of the bullet graphic or the centre? If it's at the centre it would explain the error (as the left side of the bullet would be outside the bitmap).
Lonewolf10 is offline  
Old 07 February 2014, 23:25   #3
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Lonewolf10 View Post
Not into Blitz so I could be 'barking up the wrong tree', but is the handle for the bullets at the top-left corner of the bullet graphic or the centre? If it's at the centre it would explain the error (as the left side of the bullet would be outside the bitmap).

honestly i don't know, but even if it's in the middle, the 0,0 position would make an error, instead it's the only choice who doesn't summon an "exception"
Raislin77it is offline  
Old 07 February 2014, 23:29   #4
Graham Humphrey
Moderator
 
Graham Humphrey's Avatar
 
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,168
This might sound incredibly stupid but... did you save your shape graphic as a brush first and not as a whole image? That's the only thing I can think of off the top of my head - that would explain why it would blit at 0,0 (because at 320x256 it would exactly fit the bitmap) but why it flags an error at any other co-ordinates.
Graham Humphrey is offline  
Old 07 February 2014, 23:45   #5
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 874
just to check, does it work if you use Clipblit instead?
Coagulus is offline  
Old 07 February 2014, 23:51   #6
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Graham Humphrey View Post
This might sound incredibly stupid but... did you save your shape graphic as a brush first and not as a whole image? That's the only thing I can think of off the top of my head - that would explain why it would blit at 0,0 (because at 320x256 it would exactly fit the bitmap) but why it flags an error at any other co-ordinates.
here the file

http://www.sendspace.com/file/nk6c1y

i have saved it with redshapez, an it tells 10x10 pixels so i don't think it has saved the original 320x256 image


Quote:
Originally Posted by Coagulus View Post
just to check, does it work if you use Clipblit instead?
i haven't checked, tomorrow i will check

Last edited by prowler; 08 February 2014 at 00:48. Reason: Back-to-back posts merged.
Raislin77it is offline  
Old 08 February 2014, 00:01   #7
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Raislin77it View Post
here the file

http://www.sendspace.com/file/nk6c1y

i have saved it with redshapez, an it tells 10x10 pixels so i don't think it has saved the original 320x256 image
oh my god! if i create a bitmap 640x256 i can draw the shape even at x=100.......

so the shape is great than the iff file, but i've grabbed it...







i don't know what to think
Raislin77it is offline  
Old 08 February 2014, 08:30   #8
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 874
That file is (according to Dpaint) 320x256 in 256 colours that would be why 1,1 isn't working. I'd load the brush as a picture into dpaint/ppaint, then grab it in there in the correct size and save it.
Coagulus is offline  
Old 08 February 2014, 11:42   #9
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Coagulus View Post
That file is (according to Dpaint) 320x256 in 256 colours that would be why 1,1 isn't working. I'd load the brush as a picture into dpaint/ppaint, then grab it in there in the correct size and save it.

yes, saving with ppaint the bullet as a brush works, i need to investigate why with redshapez i wasn't able to save only the correct shape.

thanks to all
Raislin77it 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
Blitzbasic Games? fuzzylogic Amiga scene 9 13 November 2013 22:09
Blitz2 blit and block statements inside procedures htdreams Coders. Tutorials 4 29 April 2013 08:36
Can amiblitz (blitz basic2) blit an image per bitplane? Michael Parent Coders. General 7 29 October 2009 17:59
BlitzBasic problem AlfaRomeo Coders. General 5 01 May 2009 10:58
BlitzBasic (PC) LaundroMat Coders. General 9 23 June 2003 09:14

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 10:00.

Top

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