Converter Restructuring and Misc. Bug Fix

Merged
#19 · Created  · Last updated

Merged pull request

Merged in _Enthalpy_/aao-game-creation-engine/glitch-hunt (pull request #19)

f70d559·Author: ·Closed by: ·2015-09-07

Description

  • Restructuring of converters to a template model.

  • Corrected the constants for "detention center ahead."


There are two “parts” to this commit. First, a rework of the converters to reduce redundancy. Secondly, various small glitch fixes necessary for the test cases to work on my version of PHP’s more stringent settings. I’ve tested all of this very, very extensively, with five test cases and repeated comparison of all original functions. Upon merge, Issue 125 can be marked as resolved.

Due to the extensive nature of this change, a comprehensive changelog is below.

PART ONE

__construct is invariant across the converters EXCEPT THAT FormattingDef1 sets profile_start to 0 initially, while the others initialize it at 1, AND if FormattingDef1 encounters a line starting with //Definition//, it sets profile_start to 1. Because the other definitions are guaranteed to have a line starting with //Definition// by TrialFileConverter, they use the same logic, but it simplifies for the non-Def1 versions. All converters now share the "expanded" form.

decodeDef#Strings has been renamed to decode. The old decodeDef4Strings and decodeDef5Strings were identical.

convertColourTags is invariant across the converters.

getFrame, getPlace, getEvidence, and getProfile were all removed, as was all_frames_fetched, frame_mode, and last_statement_with_press.

getProfleByLineNb is almost invariant between Def4 and Def5, but Def5 has an extra check for if images_externes_id exists in $line, which Def4 could use just as well, and they have different logic for selecting the voice. Def4’s check has been added to Def5, and an in isset check on $line[‘auto_voice’] determines which logic to use.

getEvidenceByLineNb is equivalent between Def4 and Def5.

getFrameByLineNb is also similar enough between Def4 and Def5 that a comparison can be made... They have different speaker_name, speaker_use_name, and speaker_id logic. Def5 has a check on $line[‘fond’][‘banc’], which Def4 can never have. The conversion is natural. Some values in Def4 were made key-value pairs of Def5’s infos_auteur. This has been accounted for. Def5 allows variable sync modes, while Def4 does not. This comes through $line[‘perso’][‘mode_animation’]. Startup mode is also different because ‘mode_animation’.

fetchAllFrames is invariant across the three converters.

FormattingDef1, Def4, and Def5 all have highly similar getTrialData functions, but with the following differences:

  • In Def1, scenes is set to 0 at the beginning of the function. In the others, it is set to this->scenes at the end. If the Def1 class has a scenes object that hashes 0 to 0, Def1's behavior is invariant under the current system, and Def4 and Def5's.

  • Def1 needs all_profiles_fetched set to true after handling profiles. Def4 and Def5 have no dependence on this variable, so they can share in this setting.

With some changes that don't impact performance, the three have identical getTrialData functions. Combined.

Many private functions are now protected.

PART TWO

The constants for legacy place conversion have been fixed.

External sprites that aren’t set custom sprites are now set to be no sprite in Def1.

Def2-4 trials now have popups.

Blank trials no longer no longer call non-existent delimiter indices.

Def5 corrected photographs to img instead of image for evidence_type. Fixed.

0 attachments

0 comments

Loading commits...