This commit is contained in:
Jindra Petk
2013-09-05 19:13:06 +02:00
3 changed files with 4 additions and 1 deletions

View File

@@ -2289,6 +2289,8 @@ public class SWFInputStream extends InputStream {
public MORPHGRADIENT readMORPHGRADIENT() throws IOException {
MORPHGRADIENT ret = new MORPHGRADIENT();
int numGradients = (int) readUI8();
ret.numGradientsExtra = numGradients & 0xf0; //some extra data. Are these the same as in GRADIENT or just obfuscator junk???
numGradients = numGradients & 0x0f;
ret.gradientRecords = new MORPHGRADRECORD[numGradients];
for (int i = 0; i < numGradients; i++) {
ret.gradientRecords[i] = readMORPHGRADRECORD();

View File

@@ -1471,7 +1471,7 @@ public class SWFOutputStream extends OutputStream {
* @throws IOException
*/
public void writeMORPHGRADIENT(MORPHGRADIENT value, int shapeNum) throws IOException {
writeUI8(value.gradientRecords.length);
writeUI8(value.gradientRecords.length + value.numGradientsExtra);
for (int i = 0; i < value.gradientRecords.length; i++) {
writeMORPHGRADRECORD(value.gradientRecords[i]);
}

View File

@@ -24,6 +24,7 @@ public class MORPHGRADIENT {
public int numGradients;
public MORPHGRADRECORD gradientRecords[];
public int numGradientsExtra;
public static RGBA morphColor(RGBA c1, RGBA c2, int ratio) {
int r = (c1.red + (c2.red - c1.red) * ratio / 65535);