Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started by: KrazyK on October 19, 2019
-
Another demo remake. This time one from ST Connexion from the Dream Demo called the Spotlight Demo.
This was one of the early fullscreen/overscan demos for 1989 and very nice it is too on a real ST.
Contains a 3 plane starfield, vu bars, a pourdown/up logo (finally managed to convert that part !), a bendy/disted rastered scrolltext with reflection in the bottom border, and a moving spotlight that shines on the big central logo.
Learned a few new trick in PureBasic converting this one that I will share once I comment the code. ;)
In the meantime though here's the 'finished' demo in the zip.
-
I dont know the original version.
However, really nice remake you did! K+
What language is it coded it?
Is this pure software rendering?
-
It's all written in purebasic using only the native commands. No opengl or sdl. Nothing like that. Just the standard Purebasic 2d sprite commands.
I'll be posting the code once I've had a further tinker with it to speed up the sprite prefetching.
-
Does it have dependencies (dll's)
Would be cool if I can check this on my g4-ppc 10.3.9 osx purebasic environment.
-
Does it have dependencies (dll's)
Would be cool if I can check this on my g4-ppc 10.3.9 osx purebasic environment.
The only dll it uses is the sndh replay which also reads the 3 sound channels which is windows only I'm afraid.
-
As promised, here's the PB source for the Spotlight Demo for you to tinker with and hopefully improve a bit.
I've already speeded up the prefetching of the sprites spotlight on the logo by 50% by moving a few lines around and creating a mask.
But if someone has a better way of drawing the spotlight sprite over the logo but not showing on the black background then i'm all ears as I couldn't think of another way of doing it.
I've commented it as much as possible and all spelling mistakes are obvoiusly intentional. ;D
-
Thanks for sharing. :goodpost:
But you say "Only native PB instructions"... And i see KK_DrawTransparentImage..
Please add a link to KK_xxxxx lib
I also see a small API (ShowCursor_) :trans:
-
Here's the transparent image drawing code from a previous post.
Import "msimg32.lib"
TransparentBlt( hdcDest, nXOriginDest, nYOriginDest, nWidthDest, hHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, crTransparent )
EndImport
ProcedureDLL KK_DrawTransparentImage(DestImage,SourceImage,xdest,ydest,transcol)
hdcSrc2 = CreateCompatibleDC_(DestImage)
SelectObject_(hdcSrc2, ImageID(SourceImage))
TransparentBlt(DestImage,xdest,ydest,ImageWidth(SourceImage),ImageHeight(SourceImage),hdcSrc2,0,0,ImageWidth(SourceImage),ImageHeight(SourceImage),transcol)
DeleteDC_(hdcSrc2)
EndProcedure
It is kind native as 'Import' is a native command. ;D I suppose what I mean is that it doesn't use other libraries like MP3D, SDL etc. I use the above code as I can never get the DrawAlphaImage command to work correctly no matter what I do. Need more practice with it I guess.