-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|286|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




mike_g

Functions returning multiple results?

18th September 2007

I was skeptical about a Xor swap being faster than a swap using a temp variable so I made a test prog to time them. On my computer the temp swap always came out fastest. Admittedly only by around 15%, which isent really worth worrying about. Also using a s*snip*


mike_g

Functions returning multiple results?

18th September 2007

xor swapping, or its equivalent using + and - avoids using a temp variable, but its slower. If its something you plan on using intensively I'd do something like what agent smith posted.


mike_g

Site Updates - Aug/Sept 2007

18th September 2007

For me when this page loads. The book is drawn unscaled, it then takes some time for it to shrink. I'm using firefox here.


mike_g

navigating directories using strings?

18th September 2007

Oh yeah, I dident spot that o_0. I think it was probably a typo tho. Originally it was to check if the contents of the folder was:

if(strcmp(folder, "") == 0)


mike_g

navigating directories using strings?

18th September 2007

The last one I posted should have worked, as long as 'folder' was initialized to null. But if what you have works then use it. One thing tho is that it would be more portable using:
[code] if(strcmp(folder, "/") == 0)
{
folder[0]='/';
folder[1*snip*


mike_g

navigating directories using strings?

17th September 2007

I'm suprised it compiles. You may want to turn your warining levels up. They can tell you a lot of useful stuff.
If you change this line:
[code]if(strlen(folder) == 0)folder="/";[/code]
to this:
[code]if(strlen(folder) == 0) *folder='/';[/code]
I th*snip*


mike_g

Read/Write Pixel Help

17th September 2007

[quote]I feel it's also better practice to use GraphicsHeight/Width [/quote]
I would agree but for some reason in won't work on all computers. And thats including subtracting 1 from it, for arrays starting at 0.
[quote]I've just had a little peek into i*snip*


mike_g

Read/Write Pixel Help

17th September 2007

Not locking the buffer will be very slow, but it shouldent make blitz crash.
Tikihead: you arent using Read/WritePixelFast are you? If you are then you need to make sure that you are drawing inside the buffer, or the prog will likely crash. Maybe you cou*snip*


mike_g

Freebasic Stuff

16th September 2007

I downloaded Freebasic once, but I think I needed to get an IDE for it as everything was in a yucky looking console screen. I might download it again and have a go at making a prog or two with it. ATM I cant see myself getting too involved with it. But the*snip*


mike_g

navigating directories using strings?

16th September 2007

To set the filename the easiest way is probably to use strcpy() pass the pointer to the string as the first param, then the text to set it to as the second. IE:
[code]strcpy(file[0].filename, "data");[/code]
If you want to append to a string you can use *snip*


mike_g

QOTD: Laptop longevity?

11th September 2007

I think so. I never had a problem with my laptop battery until I went to australia for a year and left it behind. When I got back it was completely dead. Which could have had something to do with not charging it at all.


mike_g

Wot your Weakest in coding?

7th September 2007

Ingenium: I posted some code for A* pathfinding in the code snippets, just in case you want something to refer to. Its done in Blitz tho, and theres a couple of simple functions you'd need to add if you wanted to get it working in a game. Such as a functio*snip*


mike_g

Wot your Weakest in coding?

5th September 2007

For me its maths, and actually managing finish things I start.


mike_g

Non-Image Collisions

5th September 2007

I was always of the impression that the lines were not drawn. Also you would also need to draw more than one line to make sure the pixels don't leak through the diagonals.


mike_g

The New iPod

5th September 2007

[quote]if it can play audio files that arnt iTunes that is
I'm almost sure it can, as Apple is smart enough not to shave off such a huge user base. My 30Gig Video iPod can play any song--It just has to be added through iTunes.[/quote]
What if you wanted *snip*


mike_g

Non-Image Collisions

28th August 2007

Tikihead: Your VX and VY variables indicate that you plan on moving your points at angles. I hope you are aware that by doing this they will be able to seep through the boundaries via the diagonals.
Using a rough matrix like I suggested before, or checkin*snip*


mike_g

Non-Image Collisions

28th August 2007

Yeah Blitz rounding errors suck. Badly. It would be so much better if you could use double precision floats.


mike_g

Non-Image Collisions

28th August 2007

Diablo: I'm a little skeptical about the effectiveness of your code. First off in you program it dosent seem to detect collisions correctly on the second line:
(Image.png)
Also for each point it needs to run through all the lines checking each point ag*snip*


mike_g

Non-Image Collisions

28th August 2007

You could have a 2d array that for the screen that will hold a 1 or 0 dependant on if that point is on a line or not, then for each 'point' you and 1 with the co-ords on the array to see if its a hit or not.
It would take a bit of time to draw the array e*snip*


mike_g

Non-Image Collisions

28th August 2007

Do you mean when the point hits the line, or when the point passes one side of it?
For both you will probably be best off starting with a line drawing function. You can make one yourself fairly easily if you know the formula of a straight line.
Then you*snip*


mike_g

System Commands

27th August 2007

Oh yeah, that was what I saw. Cheers Jay.


mike_g

Loading/Modifying Pallettes of 256 color bitmaps

27th August 2007

I have noticed that big bitmaps sometimes do weird things on different systems. Probably to do with the graphics cards. Since 4096x8192 is bigger than any screen anyways could you not perhaps split it into, say, eighths and tile it?


mike_g

System Commands

27th August 2007

I think I have seen this done before, but I'm not sure. Is there any way of calling system commands in Blitz? And if its possible how can I do this?


mike_g

Fast Colour Blending Function

23rd August 2007

Heres a fast colour blending function using some techniques I was shown over on the DBF boards. I thought I would share it as its something I find it useful. It avoids floating point maths and RGB colour conversions.
[edit]Oh, and the alpha component shou*snip*


mike_g

That time of year again

23rd August 2007

Wow youre clever :o I only got 3 C's when I did my GCSEs, but that was a long time ago now.

Newer Posts More - Older Posts