trunk/src/emu/render.cpp
| r250295 | r250296 | |
| 925 | 925 | m_base_orientation(ROT0), |
| 926 | 926 | m_maxtexwidth(65536), |
| 927 | 927 | m_maxtexheight(65536), |
| 928 | | m_scale_primitives(true), |
| 929 | | m_offset_primitives(true) |
| 928 | m_transform_primitives(true) |
| 930 | 929 | { |
| 931 | 930 | // determine the base layer configuration based on options |
| 932 | 931 | m_base_layerconfig.set_backdrops_enabled(manager.machine().options().use_backdrops()); |
| r250295 | r250296 | |
| 1661 | 1660 | float yoffs = (container_xform.orientation & ORIENTATION_SWAP_XY) ? container.xoffset() : container.yoffset(); |
| 1662 | 1661 | if (container_xform.orientation & ORIENTATION_FLIP_X) xoffs = -xoffs; |
| 1663 | 1662 | if (container_xform.orientation & ORIENTATION_FLIP_Y) yoffs = -yoffs; |
| 1664 | | if (!m_scale_primitives) |
| 1663 | if (!m_transform_primitives) |
| 1665 | 1664 | { |
| 1666 | 1665 | xscale = 1.0f; |
| 1667 | 1666 | yscale = 1.0f; |
| 1668 | | } |
| 1669 | | if (!m_offset_primitives) |
| 1670 | | { |
| 1671 | 1667 | xoffs = 0.0f; |
| 1672 | 1668 | yoffs = 0.0f; |
| 1673 | 1669 | } |
trunk/src/emu/render.h
| r250295 | r250296 | |
| 898 | 898 | void set_orientation(int orientation) { m_orientation = orientation; } |
| 899 | 899 | void set_view(int viewindex); |
| 900 | 900 | void set_max_texture_size(int maxwidth, int maxheight); |
| 901 | | void set_scale_primitives(bool enable) { m_scale_primitives = enable; } |
| 902 | | void set_offset_primitives(bool enable) { m_offset_primitives = enable; } |
| 901 | void set_transform_primitives(bool transform_primitives) { m_transform_primitives = transform_primitives; } |
| 903 | 902 | |
| 904 | 903 | // layer config getters |
| 905 | 904 | bool backdrops_enabled() const { return m_layerconfig.backdrops_enabled(); } |
| r250295 | r250296 | |
| 998 | 997 | simple_list<render_container> m_debug_containers; // list of debug containers |
| 999 | 998 | INT32 m_clear_extent_count; // number of clear extents |
| 1000 | 999 | INT32 m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents |
| 1001 | | bool m_scale_primitives; // determines if the primitive shall be scaled/offset by screen settings, |
| 1002 | | bool m_offset_primitives; // otherwise the respective render API will handle it (default is true) |
| 1000 | bool m_transform_primitives; // determines if the primitives shall be scaled/offset by screen settings, |
| 1001 | // otherwise the respective render API will handle it (default is true) |
| 1003 | 1002 | |
| 1004 | 1003 | static render_screen_list s_empty_screen_list; |
| 1005 | 1004 | }; |
trunk/src/emu/video/vector.cpp
| r250295 | r250296 | |
| 131 | 131 | vector_device::vector_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 132 | 132 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 133 | 133 | device_video_interface(mconfig, *this), |
| 134 | | m_vector_list(NULL) |
| 134 | m_vector_list(NULL), |
| 135 | m_min_intensity(255), |
| 136 | m_max_intensity(0) |
| 135 | 137 | { |
| 136 | 138 | } |
| 137 | 139 | |
| 138 | 140 | vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 139 | 141 | : device_t(mconfig, VECTOR, "VECTOR", tag, owner, clock, "vector_device", __FILE__), |
| 140 | | device_video_interface(mconfig, *this), |
| 141 | | m_vector_list(NULL) |
| 142 | device_video_interface(mconfig, *this), |
| 143 | m_vector_list(NULL), |
| 144 | m_min_intensity(255), |
| 145 | m_max_intensity(0) |
| 142 | 146 | { |
| 143 | 147 | } |
| 144 | 148 | |
| r250295 | r250296 | |
| 221 | 225 | { |
| 222 | 226 | point *newpoint; |
| 223 | 227 | |
| 224 | | if (intensity > 255) |
| 225 | | { |
| 226 | | intensity = 255; |
| 227 | | } |
| 228 | intensity = MAX(0, MIN(255, intensity)); |
| 228 | 229 | |
| 230 | m_min_intensity = intensity > 0 ? MIN(m_min_intensity, intensity) : m_min_intensity; |
| 231 | m_max_intensity = intensity > 0 ? MAX(m_max_intensity, intensity) : m_max_intensity; |
| 232 | |
| 229 | 233 | if (m_flicker && (intensity > 0)) |
| 230 | 234 | { |
| 231 | 235 | float random = (float)(machine().rand() & 255) / 255.0f; // random value between 0.0 and 1.0 |
| 232 | 236 | |
| 233 | 237 | intensity -= (int)(intensity * random * m_flicker); |
| 234 | | if (intensity < 0) |
| 235 | | { |
| 236 | | intensity = 0; |
| 237 | | } |
| 238 | | if (intensity > 255) |
| 239 | | { |
| 240 | | intensity = 255; |
| 241 | | } |
| 238 | |
| 239 | intensity = MAX(0, MIN(255, intensity)); |
| 242 | 240 | } |
| 243 | 241 | |
| 244 | 242 | newpoint = &m_vector_list[m_vector_index]; |
| r250295 | r250296 | |
| 334 | 332 | } |
| 335 | 333 | else |
| 336 | 334 | { |
| 335 | float beam_intensity_width = m_beam_width_min; |
| 336 | |
| 337 | 337 | float intensity = (float)curpoint->intensity / 255.0f; |
| 338 | | float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight); |
| 339 | 338 | |
| 340 | | float beam_intensity_width = (m_beam_width_max - m_beam_width_min) * intensity_weight + m_beam_width_min; |
| 339 | // check for dynamic intensity |
| 340 | if (m_min_intensity != m_max_intensity) |
| 341 | { |
| 342 | float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight); |
| 343 | beam_intensity_width = (m_beam_width_max - m_beam_width_min) * intensity_weight + m_beam_width_min; |
| 344 | } |
| 345 | |
| 341 | 346 | float beam_width = beam_intensity_width * (1.0f / (float)VECTOR_WIDTH_DENOM); |
| 342 | 347 | |
| 343 | 348 | coords.x0 = ((float)lastx - xoffs) * xscale; |