Author Topic: StripSprite  (Read 1987 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
StripSprite
« on: May 21, 2011, 11:31:02 AM »
Hi Peter ....
I study your BitBlitter functions which you use in AUffo program.
And i see that you use for ship sprite raw file and work excellent on this way. :)

so here you load raw file,right?
Code: [Select]
LoadFile "aurel/strip.raw",StripRaw,3072
and here is function which use this raw file,right?
Code: [Select]
Sub StripSprite (byval x as long,byval y as long,byval f as long)
Dim c as long
For b=0 To 31
For a=0 To 31
z = b*96 + a
c = StripRaw(z+f*32)
iF c>0 Then SetPixel backhdc,a+x,b+y,StripTab(c)
Next: Next
End Sub

So my question is how i can instead of raw file use ordinary *bmp file?
For example i must draw bitmap in drawing program and save file as bitmap
which is easier for me ,and then use this bitmap file in program .
I don't know how create this raw file from bitmap?
And i think that this way will be far easer for other people.
Is work with raw file maby better option?

Another question is :
Is there a similiar way to create functions like LoadSprite ,MoveSprite etc...
This functions will be very useful and will simplified many things with sprites.

I hope that i dont ask to much... ::)

Aurel

  • Guest
Re: StripSprite
« Reply #1 on: May 21, 2011, 02:23:03 PM »
Quote
What game are you planning?  Is it Uffo 8 ?
I think you need it for Aurel Basic! There are now  'IF ELSE ENDIF' in Aurel Basic
;D

Hi Peter...

Yes i need them for both.
Thank you man :)

This is important:
Code: [Select]
Function LoadBitmap(byval BmpFile As String, byval wBmp as long, byval hBmp as long) As Long
Static bNr as long: bNr +=1
iF bNr >256 Then bNr =256 
BmpHnd(bNr) = LoadImage(0, BmpFile,0,0,0,16)
BmpHdc(bNr) = CreateCompatibleDC(sys_hdc)
SelectObject BmpHdc(bNr), BmpHnd(bNr)
BmpWide(bNr) = wBmp
BmpHigh(bNr) = hBmp
Function     = bNr
End Function

Sub Bitmap(byval Num As Long,byval x0 As Long, byval y0 As Long)
BitBlt BackHdc, x0, y0, BmpWide(Num), BmpHigh(Num), BmpHdc(Num),0,0,0xCC0020
End Sub