Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - MrP

Pages: [1]
General chat / Merry Christmas
« on: December 25, 2006 »
Just like to wish you all a very merry christmas.... All the best to you and to all your families, hope you all have a great christmas...... Free from work now til the new year, much cushion squashing and drinking to be done......

GFX & sound / An old Photoshop Effort
« on: December 01, 2006 »
Digging through some old stuff on the HD the other day and found some of my attempts when i was messing around with Photoshop a bit.... Anyways since theres a GFX section thought I'd share em.... I'll post some more if you like the first one......

[oversized attachment deleted by admin]

Challenges & Competitions / MATHCOMP: Swirlies
« on: November 28, 2006 »
OK Feel like a bit of a cheat now, but this is something I coded quite a while back when I was messing with blitz a lot. The effect hasn't really got a name so I just called it swirlies....

Anyways Instructions are on screen, probably best to press space a few times to see some different patterns..... and if you get a crap frame rate with the text on just toggle it off...

Enjoy, and sorry for the size of the file.... Hated blitz back then for the big exes, and now its back to haunt me..... (Source is included Enjoy!!!!!)

[oversized attachment deleted by admin]

Well I've almost finished converting my gfx drawing functions into assembly, and by god have I been up and down with it. But in the end its been worth it, the difference in performance is quite staggering really. so here at the moment is my pride and joy a fast full screen 640x480 alpha blend between two images. at the moment this clocks in at a tad over 2.6 millisecs to draw each image on my rig, so in theory at a refresh of 75hz you should be able to do at least four images at once without a hit in framerate. Not sure why coz it'd look stupid but anyways.... Have a look see what you think, and if you could please post back with framerate and some system specs.....

Cheers in advance......

[oversized attachment deleted by admin]

Freebasic / Inline ASM....
« on: August 25, 2006 »
been messing around with the inline asm thingy for the last few days.... jeez brings back memories, the last assembly i did was back on my good old atari ST....... Anyways heres my first little asm function that did something, (progressed a little now). Nothing special it just plots a pixel at a designated co-ordinate on screen. Well in fairness it actually writes 640x480 pixels in whatever color you pass to it. Nothing much I know but you've gotta start somewhere and you never know it might even be useful to someone....

Code: [Select]
screenres 640, 480, 32, 2, 1, 75

dim scr_ptr as integer ptr
screenset 0, 1
declare sub put_pixel(byval x as integer, byval y as integer, byval col as integer)

dim angle as single

dim shared fps_timer
fps_timer = timer
fps_counter = 0
while inkey$ = ""
    for y = 0 to 480
        for x = 0 to 640
            col = 255
            put_pixel(x, y, rgb(col, col, col))
        next x
    next y

    fps_counter = fps_counter + 1
    if timer - fps_timer > 1 then
        act_fps = fps_counter
        fps_counter = 0
        fps_timer = timer
    end if
    locate 1,1 : print act_fps

sub put_pixel(byval x as integer, byval y as integer, byval col as integer)
    dim scr_ptr as integer ptr
    scr_ptr = screenptr()
        mov eax, [x]            'pixel_x into eax
        mov ebx, [y]            'pixel_y into ebx
        mov ecx, [col]          'color into ecx
        mov edx, [scr_ptr]      'beginning of screen into edx
        imul ebx, 640           'evaluate screen y
        add eax, ebx            'then screen x
        imul eax, 4               'using integers so jump by 4
        add edx, eax            'update our pointer
        mov [edx], ecx          'write the pixel
    end asm
end sub

Freebasic / TinyPTC image loader
« on: August 16, 2006 »
First off Hello Everyone...... (download the file at the bottom to see what this thing actually does)

Been away for quite some time and its nice to come back and see so many familiar names. Used to do a little over at the dbf board and its nice to see that you've all got a new home. And very nice it is to I might add....

Well now i'm back for a while i've downloaded this freebasic thingy and to be honest I'm quite impressed with what it can do, and as such its prompted me to get back to coding again. (for how long I'm not sure!!!!!!)

Anyways after playing for a couple of weeks and getting familiar with the tinyptc api you begin to realise that you're going to have to do it all manually, and to be honest thats fine by me, so my first real project was to get some images loaded and get them whizzing about as only they can in a gfx demo.

As it stands this will load any uncompressed 32 bit tga image and display it correctly using the embedded per pixel alpha channel information (useful for nice anti-aliased edges and stuff - download the file to see it in action). eventually I will add other blending methods but first off I need some help and this is where I'm hoping somebody can help.......

I'm having trouble returning a pointer to an array defined in a funtion eg:-

declare function image_load("")

my_img = image_load("")

function image_load("")
    'load image and get width and height - this bit works   
    dim img_array(image_width, image_height) - this bit also works
    'put image data into array - this bit also works
    return img_array(0) - this bit im stuck with, also tried function = img_array(0)
end function

this is a very simplified version of whats really happening if you want the code i've got i'd be happy to post it but if anyone can just tell me how to return a pointer to an array and then use that pointer back in the main loop, well I'll be a happy bunny. I know it has to do with pointers and stuff, but since I've never used them before I'm a bit of a noob at it. Of course I will continue to bash at it but if anybody can give me a point (excuse the pun) in the right direction I would be most grateful. This will be released as code when I get it how I want it......

Many thanks in advance.... MrP.....

Pages: [1]