Merge pull request #468 from AttorneyOnline/fix/cont-hitch-mitigation
Mitigate hitching when using continuous playback, fix a botch in handling misc themes
This commit is contained in:
		
						commit
						5fd3ed0fea
					
				@ -308,7 +308,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  // Returns the dimensions of widget with specified identifier from p_file
 | 
			
		||||
  pos_size_type get_element_dimensions(QString p_identifier, QString p_file,
 | 
			
		||||
                                       QString p_char = "");
 | 
			
		||||
                                       QString p_misc = "");
 | 
			
		||||
 | 
			
		||||
  // Returns the value to you
 | 
			
		||||
  QString get_design_element(QString p_identifier, QString p_file,
 | 
			
		||||
 | 
			
		||||
@ -261,6 +261,15 @@ void CharLayer::start_playback(QString p_image)
 | 
			
		||||
 | 
			
		||||
void AOLayer::start_playback(QString p_image)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  if (!ao_app->is_continuous_enabled()) {
 | 
			
		||||
    continuous = false;
 | 
			
		||||
    force_continuous = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if ((last_path == p_image) && (!force_continuous))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG_MOVIE
 | 
			
		||||
  actual_time.restart();
 | 
			
		||||
#endif
 | 
			
		||||
@ -268,12 +277,6 @@ void AOLayer::start_playback(QString p_image)
 | 
			
		||||
  freeze();
 | 
			
		||||
  movie_frames.clear();
 | 
			
		||||
  movie_delays.clear();
 | 
			
		||||
 | 
			
		||||
  if (!ao_app->is_continuous_enabled()) {
 | 
			
		||||
    continuous = false;
 | 
			
		||||
    force_continuous = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  QString scaling_override =
 | 
			
		||||
      ao_app->read_design_ini("scaling", p_image + ".ini");
 | 
			
		||||
  if (scaling_override != "")
 | 
			
		||||
@ -289,10 +292,6 @@ void AOLayer::start_playback(QString p_image)
 | 
			
		||||
  m_reader.setFileName(p_image);
 | 
			
		||||
  if (m_reader.loopCount() == 0)
 | 
			
		||||
    play_once = true;
 | 
			
		||||
  if ((last_path == p_image) && (!force_continuous))
 | 
			
		||||
    continuous = true;
 | 
			
		||||
  else if ((last_path != p_image) && !force_continuous)
 | 
			
		||||
    continuous = false;
 | 
			
		||||
  if (!continuous)
 | 
			
		||||
    frame = 0;
 | 
			
		||||
  last_max_frames = max_frames;
 | 
			
		||||
 | 
			
		||||
@ -1160,7 +1160,7 @@ void Courtroom::set_size_and_pos(QWidget *p_widget, QString p_identifier,
 | 
			
		||||
  QString filename = "courtroom_design.ini";
 | 
			
		||||
 | 
			
		||||
  pos_size_type design_ini_result =
 | 
			
		||||
      ao_app->get_element_dimensions(p_identifier, filename, p_char);
 | 
			
		||||
      ao_app->get_element_dimensions(p_identifier, filename, ao_app->get_chat(p_char));
 | 
			
		||||
 | 
			
		||||
  if (design_ini_result.width < 0 || design_ini_result.height < 0) {
 | 
			
		||||
    qDebug() << "W: could not find \"" << p_identifier << "\" in " << filename;
 | 
			
		||||
 | 
			
		||||
@ -318,14 +318,14 @@ QPoint AOApplication::get_button_spacing(QString p_identifier, QString p_file)
 | 
			
		||||
 | 
			
		||||
pos_size_type AOApplication::get_element_dimensions(QString p_identifier,
 | 
			
		||||
                                                    QString p_file,
 | 
			
		||||
                                                    QString p_char)
 | 
			
		||||
                                                    QString p_misc)
 | 
			
		||||
{
 | 
			
		||||
  pos_size_type return_value;
 | 
			
		||||
  return_value.x = 0;
 | 
			
		||||
  return_value.y = 0;
 | 
			
		||||
  return_value.width = -1;
 | 
			
		||||
  return_value.height = -1;
 | 
			
		||||
  QString f_result = get_design_element(p_identifier, p_file, p_char);
 | 
			
		||||
  QString f_result = get_design_element(p_identifier, p_file, p_misc);
 | 
			
		||||
 | 
			
		||||
  QStringList sub_line_elements = f_result.split(",");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user