MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

krick
Get Fuzzy
Reged: 02/09/04
Posts: 4235
Send PM
Re: emucore.h rotation and mirroring defines
03/26/11 11:02 PM


I've started thinking about the rotation/mirror thing again.

I've looked through the latest MAME code and I see the following still being used in the GAME macro...

0
ORIENTATION_FLIP_X
ORIENTATION_FLIP_X ^ ROT270
ORIENTATION_FLIP_Y
ORIENTATION_FLIP_Y ^ ORIENTATION_FLIP_X
ORIENTATION_SWAP_XY
ROT0 | ORIENTATION_FLIP_X
ROT270|ORIENTATION_FLIP_X
ROT90 ^ ORIENTATION_FLIP_Y


I'd like to standardize these to one of the standard 8 cases I identified in the first post in this thread...

rotate 0
rotate 90
rotate 180
rotate 270
rotate 0 + flip x
rotate 90 + flip x
rotate 180 + flip x
rotate 270 + flip x

Which using MAME defines in the macro would be...

ROT0
ROT90
ROT180
ROT270
ROT0
ROT0^ORIENTATION_FLIP_X
ROT90^ORIENTATION_FLIP_X
ROT180^ORIENTATION_FLIP_X
ROT270^ORIENTATION_FLIP_X


I'd also like to introduce shorthand defines for the last four if that would be ok with MAMEdev...

ROT0_FLIPX
ROT90_FLIPX
ROT180_FLIPX
ROT270_FLIPX


If you think about it, the fundamental defines for orientation are...

#define ORIENTATION_FLIP_X 0x0001 /* mirror everything in the X direction */
#define ORIENTATION_FLIP_Y 0x0002 /* mirror everything in the Y direction */
#define ORIENTATION_SWAP_XY 0x0004 /* mirror along the top-left/bottom-right diagonal */

All the other defines are just combinations of the above for convenience, mainly used in the GAME macro.

I propose that we have 8 "convenience" defines...

#define ROT0 0
#define ROT90 (ORIENTATION_SWAP_XY | ORIENTATION_FLIP_X) /* rotate clockwise 90 degrees */
#define ROT180 (ORIENTATION_FLIP_X | ORIENTATION_FLIP_Y) /* rotate 180 degrees */
#define ROT270 (ORIENTATION_SWAP_XY | ORIENTATION_FLIP_Y) /* rotate counter-clockwise 90 degrees */

#define ROT0_FLIPX ORIENTATION_FLIP_X /* flip X axis */
#define ROT90_FLIPX ORIENTATION_SWAP_XY /* rotate clockwise 90 degrees and flip X axis */
#define ROT180_FLIPX ORIENTATION_FLIP_Y /* rotate 180 degrees and flip X axis */
#define ROT270_FLIPX (ORIENTATION_SWAP_XY | ORIENTATION_FLIP_Y | ORIENTATION_FLIP_X) /* rotate counter-clockwise 90 degrees and flip X axis */



Thoughts anyone?


GroovyMAME support forum on BYOAC







Entire thread
Subject Posted by Posted on
* mamecore.h rotation and mirroring defines krick 03/06/08 07:15 PM
. * Re: mamecore.h rotation and mirroring defines uRebelScum  03/06/08 08:53 PM
. * Re: mamecore.h rotation and mirroring defines krick  03/06/08 09:19 PM
. * Re: mamecore.h rotation and mirroring defines uRebelScum  03/07/08 02:02 AM
. * Re: mamecore.h rotation and mirroring defines krick  03/07/08 02:27 AM
. * Re: mamecore.h rotation and mirroring defines uRebelScum  03/07/08 03:17 AM
. * Re: emucore.h rotation and mirroring defines krick  03/26/11 11:02 PM
. * Re: emucore.h rotation and mirroring defines italieAdministrator  03/30/11 01:45 AM
. * Re: emucore.h rotation and mirroring defines mogli  03/28/11 08:39 PM
. * continued.... mogli  03/29/11 09:26 AM
. * Re: continued.... R. Belmont  03/29/11 03:28 PM
. * Re: continued.... Bryan Ischo  03/30/11 07:46 AM
. * Re: continued.... etabeta  03/30/11 08:06 AM
. * Re: continued.... Bryan Ischo  03/29/11 11:05 PM
. * Re: continued.... R. Belmont  03/30/11 03:49 AM
. * Re: continued.... Fever  03/30/11 10:32 PM
. * Re: continued.... R. Belmont  03/30/11 11:37 PM
. * Re: continued.... Olivier Galibert  03/31/11 09:18 AM
. * Re: continued.... Bryan Ischo  03/30/11 07:42 AM
. * Re: continued.... StevieWunderful  03/30/11 05:08 AM
. * Re: continued.... R. Belmont  03/30/11 03:23 PM
. * Re: continued.... StevieWunderful  03/30/11 04:41 PM
. * Re: continued.... italieAdministrator  03/31/11 02:40 AM
. * Re: continued.... StevieWunderful  03/31/11 08:41 AM
. * Closed. italieAdministrator  03/31/11 02:28 PM
. * Re: continued.... Bryan Ischo  03/30/11 07:44 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 191 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3132