ArrayBuffer support

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

User avatar
Rob
Posts: 53
Joined: 01 Jul 2017, 07:33

ArrayBuffer support

Postby Rob » 08 Oct 2018, 13:50

Is regular js Arrays the only accepted type to interact with SFSDataType.BYTE_ARRAY in SFSArrays/SFSObjects?

If so, I'd like to suggest you add ArrayBuffer (or at least a typed array) as a valid type as well in order to avoid unnecessary data conversions when the original data is already in ArrayBuffer format.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: ArrayBuffer support

Postby Lapo » 09 Oct 2018, 09:56

Hello,
yes I think you're right. The current version of the API is representing byte arrays as number arrays which is unoptimized.
Instead we could improve both putByteArray() and getByteArray() using the Uint8Array JS type, to keep memory usage in check and restrict types to actual bytes.

Makes sense?
Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Rob
Posts: 53
Joined: 01 Jul 2017, 07:33

Re: ArrayBuffer support

Postby Rob » 09 Oct 2018, 10:51

Yes that sounds like a good improvement.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: ArrayBuffer support

Postby Lapo » 09 Oct 2018, 15:48

Okay, we'll prepare a new release during the week.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: ArrayBuffer support

Postby Lapo » 10 Oct 2018, 08:41

UPDATE:
we've released the update for the Javascript API.
viewtopic.php?f=33&t=20902

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 14 guests