Negative pitch

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Negative pitch

Post by Anes »

I know, i know this is not an specific emulation question, but im using Allegro 5 cross platform lib to do multimedia "things".
The thing is that, at least in Windows, the bimaps locked have positive pitch. In linux its using opengl and the pitch is negative.

Since im implementing HQX algorithm i would like how is the memory layout of a negative pitched surface. So i can use HQX lib.
I have tried substracting all the screen to the pointer when the sourface is locked and my emu runs (linux) and i can only hear the sound.

I don't care if the surface has down-up fashion since i can use the Allegro API to invert it. Anyway, i don't know if its down-up or up-down.

I just want to give a valid pointer to HQX so it does the algorithm like a normal surface: up-top pixels being the first pixel.
ANes
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Re: Negative pitch

Post by Anes »

Sorry, i solved this problem by myself.
It was as easy as doint

Code: Select all

(height-1)* pitch
ANes
Post Reply