Closing in on 2.7

Michael Rueger Michael.Rueger.-ND at disney.com
Tue Nov 30 00:00:34 UTC 1999


--------------3EA3B2BCF60167B3243AA255
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit




Dan Ingalls wrote:
>end it there for now.  If you have a burning need, or I've left out something that is important, please let me know offline.  On top of all this, I hope then to put 
>

Dan,

as I didn't see it in the updates here is the fix for the flash reader
enabling it to read most of the version 4 files.
A few people on the mailing list use it already.

Michael


-- 

 "To improve is to change, to be perfect is to change often." 
                                            Winston Churchill
+------------------------------------------------------------+
| Michael Rueger                                             |
| Phone: ++1 (818) 623 3283        Fax:   ++1 (818) 623 3559 |
+---------- Michael.Rueger.-ND at corp.go.com ------------------+
--------------3EA3B2BCF60167B3243AA255
Content-Type: text/plain; charset=us-ascii;
 name="FlashFileReader4-mir.cs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="FlashFileReader4-mir.cs"



"Change Set:		FlashFileReader4-mir
Date:			3 November 1999
Author:			Michael Rueger

Fixes a problem in the flash reader when reading version 4 files.
This is NOT a full version 4 implementation yet, but enables Squeak to read most version 4 files."!

!FlashFileReader methodsFor: 'private' stamp: 'mir 11/3/1999 15:25'!
maximumSupportedVersion
	^4! !

!FlashFileReader methodsFor: 'processing morphs' stamp: 'mir 11/2/1999 17:05'!
processMorphFillStylesFrom: data
	| nFills nColors rampIndex rampColor id fillStyleType color1 color2 matrix1 matrix2 ramp1 ramp2 |
	nFills _ data nextByte.
	nFills = 255 ifTrue:[nFills _ data nextWord].
	log ifNotNil:[log crtab; print: nFills; nextPutAll:' New fill styles'].
	1 to: nFills do:[:i|
		log ifNotNil:[log crtab: 2; print: i; nextPut:$:; tab].
		fillStyleType _ data nextByte.
		(fillStyleType = 0) ifTrue:["Solid fill"
			color1 _ data nextColor: true.
			color2 _ data nextColor: true.
			self recordMorphFill: i color1: color1 color2: color2.
			log ifNotNil:[log nextPutAll:'solid color '; print: color1; nextPutAll:' -- '; print: color2].
		].
		(fillStyleType anyMask: 16) ifTrue:["Gradient fill"
			"Read gradient matrix"
			matrix1 _ data nextMatrix.
			matrix2 _ data nextMatrix.
			"Read color ramp data"
			nColors _ data nextByte.
			ramp1 _ Array new: nColors.
			ramp2 _ Array new: nColors.
			log ifNotNil:[log nextPutAll:'Gradient fill with '; print: nColors; nextPutAll:' colors'].
			1 to: nColors do:[:j|
				rampIndex _ data nextByte.
				rampColor _ data nextColor: true.
				ramp1 at: j put: (rampIndex -> rampColor).
				rampIndex _ data nextByte.
				rampColor _ data nextColor: true.
				ramp2 at: j put: (rampIndex -> rampColor)].
			self recordMorphFill: i matrix1: matrix1 ramp1: ramp1 matrix2: matrix2 ramp2: ramp2 linear: (fillStyleType = 16).
			fillStyleType _ 0].
		(fillStyleType anyMask: 16r40) ifTrue:["Bit fill"
			"Read bitmap id"
			id _ data nextWord.
			"Read bitmap matrix"
			matrix1 _ data nextMatrix.
			matrix2 _ data nextMatrix.
			log ifNotNil:[log nextPutAll:'Bitmap fill id='; print: id].
			self recordMorphFill: i matrix1: matrix1 matrix2: matrix2 id: id clipped: (fillStyleType anyMask: 1).
			fillStyleType _ 0].
		fillStyleType = 0 ifFalse:[self error:'Unknown fill style: ',fillStyleType printString].
		self flushLog.
	].! !



--------------3EA3B2BCF60167B3243AA255--





More information about the Squeak-dev mailing list