flash.Memory patch to switch from alchemy to byte array

201 views
Skip to first unread message

Sam MacPherson

unread,
May 31, 2012, 6:56:02 PM5/31/12
to haxe...@googlegroups.com
This is message to all of you out there who are developing with Stage3D and Domain Memory (aka Alchemy) with Haxe, but don't want to be locked into the license agreement (http://www.adobe.com/devnet/flashplayer/articles/premium-features.html) with adobe. If you have been using domain memory for a large project and don't want to bother with re-writing thousands of lines of code then feel free to apply this patch to std/flash/Memory.hx.

Patch: https://gist.github.com/2846851

This will use an actual byte array instead of domain memory which will of course be slower, but it does get you out of the license agreement. To use the above patch simply replace Memory.hx and compile with the "-D flash_no_alchemy" flag. I haven't tested it other than just running my game so let me know if there are bugs. 

Cambiata

unread,
Jun 1, 2012, 10:47:08 AM6/1/12
to haxe...@googlegroups.com
Nice job, thank you Sam!

Why don't you write another patch that could do the opposite?
I have a lot of ByteArray solutions that I would love to run using alchemy/Memory..! :-)

tom rhodes

unread,
Jun 1, 2012, 11:18:07 AM6/1/12
to haxe...@googlegroups.com
ha, i'm looking at some old animated gif encoding code i need for a project that is slow as hell even with ByteArray, the opposite would be awesome ;)


Sam MacPherson

unread,
Jun 1, 2012, 11:21:56 AM6/1/12
to haxe...@googlegroups.com
Np. Doing the opposite is definitely do-able, but would require a bit more work due to memory management issues. Since there is only 1 "byte array" for domain memory a memory manager needs to be built to handle allocation/deallocation/fragmentation/etc. It's an interesting thought though.

Cambiata

unread,
Jun 1, 2012, 11:30:20 AM6/1/12
to haxe...@googlegroups.com
Wow. :-)

Tarwin Stroh-Spijer

unread,
Jun 1, 2012, 3:14:54 PM6/1/12
to haxe...@googlegroups.com
Is there a memory manager by Polygonal ? 

https://github.com/polygonal/polygonal/tree/master/src/lib/de/polygonal/ds/mem 


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
cell: +1 650 842 0920
_______________________


On Fri, Jun 1, 2012 at 8:30 AM, Cambiata <jona...@gmail.com> wrote:
Wow. :-)

Michael Baczynski

unread,
Jun 1, 2012, 4:12:02 PM6/1/12
to haxe...@googlegroups.com
yes, you can just code against this API. See https://github.com/polygonal/polygonal/blob/master/src/lib/de/polygonal/gl/codec/JPEGEncode.hx  for an example. If you don't compile with -D alchemy, it will use the ByteArrays or Vectors instead. 
Reply all
Reply to author
Forward
0 new messages