mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Make screen rotation to be per-screen attribute (nw)
commented validation used to compare it to existing rotation flags
This commit is contained in:
parent
8e22b1d22f
commit
63844e14f5
@ -12,6 +12,7 @@
|
||||
#include "emuopts.h"
|
||||
#include "png.h"
|
||||
#include "rendutil.h"
|
||||
#include "validity.h"
|
||||
|
||||
|
||||
|
||||
@ -55,6 +56,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev
|
||||
m_yscale(1.0f),
|
||||
m_palette(*this),
|
||||
m_video_attributes(0),
|
||||
m_orientation(0),
|
||||
m_container(NULL),
|
||||
m_width(100),
|
||||
m_height(100),
|
||||
@ -238,6 +240,16 @@ void screen_device::static_set_video_attributes(device_t &device, UINT32 flags)
|
||||
screen_device &screen = downcast<screen_device &>(device);
|
||||
screen.m_video_attributes = flags;
|
||||
}
|
||||
//-------------------------------------------------
|
||||
// static_set_orientation - set the screen orientation
|
||||
//-------------------------------------------------
|
||||
|
||||
void screen_device::static_set_orientation(device_t &device, UINT32 orientation)
|
||||
{
|
||||
screen_device &screen = downcast<screen_device &>(device);
|
||||
screen.m_orientation = orientation;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_validity_check - verify device
|
||||
// configuration
|
||||
@ -269,6 +281,9 @@ void screen_device::device_validity_check(validity_checker &valid) const
|
||||
osd_printf_error("Screen does not have palette defined\n");
|
||||
if (m_palette != NULL && texformat == TEXFORMAT_RGB32)
|
||||
osd_printf_warning("Screen does not need palette defined\n");
|
||||
|
||||
// if (m_orientation != (valid.driver()->flags & ORIENTATION_MASK) && ((valid.driver()->flags & ORIENTATION_MASK)== ROT180))
|
||||
// osd_printf_error("Screen orientation does not match\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -181,11 +181,13 @@ public:
|
||||
static void static_set_screen_vblank(device_t &device, screen_vblank_delegate callback);
|
||||
static void static_set_palette(device_t &device, const char *tag);
|
||||
static void static_set_video_attributes(device_t &device, UINT32 flags);
|
||||
static void static_set_orientation(device_t &device, UINT32 orientation);
|
||||
|
||||
// information getters
|
||||
render_container &container() const { assert(m_container != NULL); return *m_container; }
|
||||
bitmap_ind8 &priority() { return m_priority; }
|
||||
palette_device *palette() { return m_palette; }
|
||||
UINT32 orientation() { return m_orientation; }
|
||||
|
||||
// dynamic configuration
|
||||
void configure(int width, int height, const rectangle &visarea, attoseconds_t frame_period);
|
||||
@ -266,6 +268,7 @@ private:
|
||||
screen_vblank_delegate m_screen_vblank; // screen vblank callback
|
||||
optional_device<palette_device> m_palette; // our palette
|
||||
UINT32 m_video_attributes; // flags describing the video system
|
||||
UINT32 m_orientation; // screen orientation
|
||||
|
||||
// internal state
|
||||
render_container * m_container; // pointer to our container
|
||||
@ -429,6 +432,8 @@ typedef device_type_iterator<&device_creator<screen_device>, screen_device> scre
|
||||
screen_device::static_set_palette(*device, FINDER_DUMMY_TAG);
|
||||
#define MCFG_SCREEN_VIDEO_ATTRIBUTES(_flags) \
|
||||
screen_device::static_set_video_attributes(*device, _flags);
|
||||
#define MCFG_SCREEN_ORIENTATION(_orientation) \
|
||||
screen_device::static_set_orientation(*device, _orientation);
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
// getters
|
||||
int errors() const { return m_errors; }
|
||||
int warnings() const { return m_warnings; }
|
||||
const game_driver *driver() const { return m_current_driver; }
|
||||
|
||||
// operations
|
||||
void check_driver(const game_driver &driver);
|
||||
|
Loading…
Reference in New Issue
Block a user