BLIT command

Previous topic - Next topic

AMC

Hi, Could I possibly suggest the following command:

blit s1,x1,y1,x2,y2,s2,x,y,m

Where s1 is the source screen and x1,y1,x2,y2 is the part of the bitmap to be copied and s2 is the destination at x,y
(Mainly for the purposes of software scrolling!)
Also a color masking option would be nice like $000000 but $FF00FF seems to be popular these days. :-;

*AMC*

XOR AX,AX - A Fast Zero... (Those were the days...)

Moru

#1
You can emulate this in GLBasic by using GRABSPRITE and DRAWSPRITE but I'm not sure how fast this would be :-)
I guess you could also use CREATESCREEN to draw all your grafics to a separate surface and then use DRAWSPRITE with this screen to draw it scrolling over the screen.

PeeJay

It may also be worth looking at the POLYVECTOR command for drawing parts of a graphic ....
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

Hemlos

Yes, POLYVECTOR handles an image with the texture coordinates, and color masking.

Bing ChatGpt is pretty smart :O

Kitty Hello

Or!
VIEWPORT x,y,w,h
DRAWSPRITE id, -x1, -y2
VIEWPORT 0,0,0,0

AMC

Thanks for all the help guys - sorted it!

BTW PeeJay, if you fancy a look at a remake of Boulderdash (Rock) goto www.amc.eclipse.co.uk - it is 15 years old and is coded 99% in assembler with a bit of Turbo Pascal to set up the memory model - also the sound doesn't work under XP, as we coded the SB16 directly. (69k download) but it is cool! - Wiki/Google the other (maybe main) coder - Leslie Benzies. R*

Any comments on a 15 year old bit of code would be quite interesting... (My brother & I are thinking of converting it to GLBasic).

*AMC*
XOR AX,AX - A Fast Zero... (Those were the days...)

AMC

Sorry Guys, I should have posted the reply I got from Gernot directly.
Here is his code...

CREATESCREEN 1,101,512,512 // make offscreen 1 512x512 and bind to sprite id 101
USESCREEN 1 // draw to sprite 101, offscreen 1
DRAWRECT 0,0,32,32,RGB(12,12,12) // draw
USESCREEN -1 // draw on back buffer
DRAWSPRITE 101, 55,55 // paste the rendered sprite
SHOWSCREEN
MOUSEWAIT

Hope my post helped others!

*AMC*
XOR AX,AX - A Fast Zero... (Those were the days...)