Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / [DB 1.13] Function Rotate Image

Author
Message
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 30th Jun 2003 17:28
Hi I'm french and I still wait for DBP and I wrote a function to rotate an Image

I'm sorry but I do not speak a good english :-s

Principe:

The rotated image is bigger than the source one, so i have to create a bounding box (which i wont really create, i will make a memblock)

I also have to create a memblock from the source image

Then I check every pixel of the ROTATED image and I reverse every pixel rotation to get his coords in the source image

If the rotated pixel doesn't belong to the source image, i check the next, but if he does i just copy the pixel byte per byte.

It works in 32bits AND in 16bits because I don't care about the pixel's color, i just copy datas


Advices:

You can choose your source image to be the target one but you'll lose the original one and if you try to rotate it several times the bounding box wont stop to grow and it gonna be too slow.

For now, it's usefull if you want to rotate one or two sprite as small as a mario or a sonic.

It may work in DBP but i don't know, if it works, i'm sure it gonna work faster

Remember i'm french and i do not speak english very well
Pour des yeux déformés la vérité peut porter n visage grimaçant.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 30th Jun 2003 19:15
it works and it is very clever!!!

hi guys
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 30th Jun 2003 19:41
thanks, i'll post more functions

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.

Login to post a reply

Server time is: 2024-04-23 23:55:02
Your offset time is: 2024-04-23 23:55:02