Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: Shockwave on January 17, 2007

Title: Dutch Colourz Source
Post by: Shockwave on January 17, 2007
I have decided to release the source code for the Surprise Productions intro "Dutch Colourz" I've converted it to work with standard tinyptc, graphics files included, music removed it will run in the editor, source code is in the attached rar file :)

Sorry about the messy code...
Title: Re: Dutch Colourz Source
Post by: .:] Druid [:. on January 17, 2007
Excellent idea Shock!  Karma boost! :)

I'll have a look soon and I thank you in advance for what i'll learn from those!
Title: Re: Dutch Colourz Source
Post by: rdc on January 17, 2007
Thanks! That will be instructive.
Title: Re: Dutch Colourz Source
Post by: MrP on January 18, 2007
very nice gesture..... karma++
Title: Re: Dutch Colourz Source
Post by: Rbz on January 18, 2007
Shock rulez x 2  :goodpost:
Title: Re: Dutch Colourz Source
Post by: Shockwave on January 18, 2007
Thanks :) I had been meaning to release this source for ages, hope that someone gets something out of it. The most interesting bit of it is the logo drawing code (modified from rbraz's example source in bmp2raw), it detects the edges of the logo at start up, saved a bag of processor time :)
Title: Re: Dutch Colourz Source
Post by: DrewPee on January 19, 2007
Nice code shockwave. Thanks for sharing, again!
Im busy with everyday life things at the mo but I am working on something new?!?!?
Hopefully will release something sooner rather than later.

Drew
Title: Re: Dutch Colourz Source
Post by: Shockwave on January 19, 2007
Looking forward to your next one mate, the last was cool!
Title: Re: Dutch Colourz Source
Post by: ninogenio on January 29, 2007
very cool stuff in there shockwave just had a chance to look through :goodpost:

btw our resizer routines are basically the same appart from yours does the cool sine wave ;)
Title: Re: Dutch Colourz Source
Post by: Clyde on January 29, 2007
It really is an astonishing production, and those effects are awesome.
Little lost when it comes to asm.
Title: Re: Dutch Colourz Source
Post by: ninogenio on January 29, 2007
if this is the peice of asm clyde

Code: [Select]
asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
end asm

basically it puts a color in eax(TC) puts a counter in ecx[slice] and a pointer in edi(PP)   .

edi is then a pointer to the screen and all that happens is it counts up to slice sort of like a for or while loop adding TC to PP and moving along one in PP till the value in slice is reached i think!   
Title: Re: Dutch Colourz Source
Post by: Clyde on January 29, 2007
Cool & thanks.
Title: Re: Dutch Colourz Source
Post by: Shockwave on January 30, 2007
I've used that little asm loop in a lot of things indeed. It speeds things up a fair bit. I think it was Fryer who put me onto it.

I just looked through that zoom routine again... It could be done faster using pointer arithmetic. This is a piece of code taken from something I'm working on at the moment, basically it takes an image and scales it's height. It would be very simple to include width as well.

This uses pointers and is very fast..

Code: [Select]
SUB DRAWSPLASH()
DIM P1 AS UINTEGER PTR
DIM P2 AS UINTEGER PTR
ERASE SCREEN_BUFFER
DIM AS INTEGER LY , LX , SLICE  , HCI
DIM AS DOUBLE  HEIGHT  , HEIGHTI, HSTRT
    IF TIMR<150 THEN SPLSH=SPLSH + 4
    IF TIMR>570 THEN SPLSH=SPLSH - 4
    HEIGHT = SPLSH
    HEIGHTI = WYRES/HEIGHT
    HSTRT = 0

FOR LY=((WYRES SHR 1)-(HEIGHT SHR 1)) TO ((WYRES  SHR 1)+(HEIGHT SHR 1))-1
    HCI = INT(HSTRT)
   
    P1=@SPLASH        (HCI * WXRES)
    P2=@SCREEN_BUFFER (LY * WXRES)
   
    FOR LX = 0 TO WXRES
        *P2 = *P1
        P1 +=1
        P2 +=1
    NEXT
    HSTRT = HSTRT + HEIGHTI
NEXT

END SUB