Magic numbers, just say no (nw)

This commit is contained in:
Alex W. Jackson 2014-02-03 00:33:19 +00:00
parent 52c60d3549
commit ddc0eabd28
2 changed files with 7 additions and 4 deletions

View File

@ -85,7 +85,8 @@ video_manager::video_manager(running_machine &machine)
m_overall_real_ticks(0),
m_overall_emutime(attotime::zero),
m_overall_valid_counter(0),
m_throttle_rate(machine.options().throttle() ? 1.0f : 0.0f),
m_throttled(machine.options().throttle()),
m_throttle_rate(1.0f),
m_fastforward(false),
m_seconds_to_run(machine.options().seconds_to_run()),
m_auto_frameskip(machine.options().auto_frameskip()),
@ -1283,7 +1284,7 @@ bool video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bi
void video_manager::toggle_throttle()
{
set_throttle_rate(throttled() ? 0.0f : 1.0f);
set_throttled(!throttled());
}

View File

@ -61,13 +61,14 @@ public:
bool skip_this_frame() const { return m_skipping_this_frame; }
int speed_factor() const { return m_speed; }
int frameskip() const { return m_auto_frameskip ? -1 : m_frameskip_level; }
bool throttled() const { return throttle_rate() != 0; }
bool throttled() const { return m_throttled; }
float throttle_rate() const { return m_throttle_rate; }
bool fastforward() const { return m_fastforward; }
bool is_recording() const { return (m_mngfile != NULL || m_avifile != NULL); }
// setters
void set_frameskip(int frameskip);
void set_throttled(bool throttled = true) { m_throttled = throttled; }
void set_throttle_rate(float throttle_rate) { m_throttle_rate = throttle_rate; }
void set_fastforward(bool ffwd = true) { m_fastforward = ffwd; }
void set_output_changed() { m_output_changed = true; }
@ -142,7 +143,8 @@ private:
UINT32 m_overall_valid_counter; // number of consecutive valid time periods
// configuration
float m_throttle_rate; // target rate for throttling (0 = no throttle)
bool m_throttled; // flag: TRUE if we're currently throttled
float m_throttle_rate; // target rate for throttling
bool m_fastforward; // flag: TRUE if we're currently fast-forwarding
UINT32 m_seconds_to_run; // number of seconds to run before quitting
bool m_auto_frameskip; // flag: TRUE if we're automatically frameskipping