Skip to content

Commit b774dac

Browse files
committed
CHANGE: SWF codec - all three read-PlaceObject* functions now returns first 6 values pointing to same data [Depth move/place ClassName CharacterId Matrix Cxform], to simplify its processing, event when the values may be NONE in older PlaceObject tag versions.
1 parent 6792776 commit b774dac

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/mezz/codec-swf.r

+9-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import module [
4242

4343
readPair: has[n][
4444
n: binary/read/with bin 'UB 5
45-
to-pair binary/read bin [FB :n FB :n]
45+
to pair! binary/read bin [FB :n FB :n]
4646
]
4747

4848
readSBPair: has[n][
@@ -372,14 +372,19 @@ import module [
372372
result
373373
]
374374

375+
;@@ NOTE: to simplify processing, first 6 values returned from PlaceObject* are always:
376+
;@@ [Depth move/place ClassName CharacterId Matrix Cxform]
375377
read-PlaceObject: has[id depth][
376378
binary/read bin [
377379
id: UI16LE ;ID of character to place
378380
depth: UI16LE ;Depth of character
379381
]
380382
reduce [
381-
id depth
382-
readMATRIX ;Transform matrix data
383+
depth
384+
none ; always place
385+
none ; always without ClassName
386+
id ; CharacterId
387+
readMATRIX ; Transform matrix data
383388
either tail? bin/buffer [none][readCXFORM] ;Color transform data
384389
]
385390
]
@@ -389,6 +394,7 @@ import module [
389394
reduce [
390395
binary/read bin 'UI16LE ;depth
391396
flags/7 ;TRUE = move, else place
397+
none ;ClassName (not exists)
392398
either flags/6 [binary/read bin 'UI16LE ][none] ;CharacterId
393399
either flags/5 [readMATRIX ][none] ;HasMatrix
394400
either flags/4 [readCXFORMa ][none] ;HasCxform

0 commit comments

Comments
 (0)