Skip to content

Commit

Permalink
Merge pull request #468 from AttorneyOnline/fix/cont-hitch-mitigation
Browse files Browse the repository at this point in the history
Mitigate hitching when using continuous playback, fix a botch in handling misc themes
  • Loading branch information
oldmud0 authored Feb 14, 2021
2 parents fe00c6b + 36a1e26 commit 5fd3ed0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/aoapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class AOApplication : public QApplication {

// 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,
Expand Down
19 changes: 9 additions & 10 deletions src/aolayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,22 @@ 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
this->clear();
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 != "")
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/text_file_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(",");

Expand Down

0 comments on commit 5fd3ed0

Please sign in to comment.