I wanted to make a simple bug fix release for Apparat since I solved some bugs and issues. However there are two additional features that are worth mentioning. First of all Apparat comes now with an ASMifier tool. This allows you to let Apparat generate code from an existing SWF. It will create a file that contains a basic class structure with statements that you can directly use for __asm optimizations. You can also suppress all log output and turn Apparat into quiet mode by specifying -Dapparat.quiet=true.
Also worth mentioning: JITB ships now by default with Apparat. What does it mean? Quadruple-rainbow in your face. You can now run your SWF files with JITB if you follow the five golden steps to pure happiness:
- Download and install Scala 2.8.0
- Type
scalain a terminal, then typeprintln(System getProperty "java.library.path" split java.io.File.pathSeparatorChar mkString "\n")and remember one of the folders - Download LWJGL 2.5 and extract somewhere
- Copy the native libraries which are located in
lwjgl-2.5/native/YOUR OS/into one of the folders that the Scala command showed you - Open a terminal, go into the Apparat installation directory and type
./jitb some.swfto launch JITB
Now here is the problem. JITB is not complete and so it will probably fail with your SWF — In fact I can nearly gaurantee you that it will not launch your SWF. I included JITB basically because it already allows you to use GLSL shaders very easy and I know a lot of people would like to play around with that.
However I have created an archive of all files I showed at FOTB besides the files that came from David’s laptop since I do not have them on my machine. You might be interested in checking out Example12.as which is the one that uses GLSL shaders. If you want to compile your own version you will need to link apparat-ersatz.swc as an external library since it contains the ContinuousFileLoader and GLSLShader class. Happy hacking!
Update: Also read Ray tracing with Pixel Bender using JITB by David Laenarts for details on the FOTB demos.
I type the command “./jitb swfpath” and press Enter, but got a message:
no such file: apparat.jitb.JITB
Are you in the Apparat folder? Do you see that file in your system explorer?
Yes, I can find jitb & jitb.bat in the current folder, but can’t find apparat.jitb.JITB or apparat/jitb/JITB
Which OS? Windows? apparat.jitb.JITB is a class. There does not need to be a file.
Windows 7, I can’t find any source code in the folder apparat-1.0.RC7, there is a apparat-jitb-1.0.RC7.jar.
Yes, that one contains the class. I will check with Windows if the command is broken.
It works very well on Windows 7. How do you exactly start JITB? I simply type “jitb my.swf” and it starts.
Please remember you need Scala 2.8.0 and Java 1.6. To verify this you can type “java -version” and “scala -version” in a terminal.
Oh, yes. You are right, Joa.
I got the debug infomation after changing the terminal to the Window’s default, which before I used Cygwin to execute and fail always.
Thanks joa.
i cant run example11.swf on win7 and mac, other examples running fine
traceback here http://snipt.org/kmri/
Thank you kutu. I need to add javazoom to the list of included assemblies. Will be fixed in next release. Any MP3 playback is broken in that case.
Great stuff! I can’t wait to see Apparat’s magic. Can you show us an example of how to use Apparat to optimize a SWC library. I am not sure how to configure the workflow in Flash Builder 4.
Thanks a lot!
hi joa,
I am getting this error – I tried running the example02, running mac os x 10.6.3:
………
createPoint()Lflash/geom/Point;
00000 Example02 . . : : NEW flash/geom/Point
00001 Example02 . . : Point : DUP
00002 Example02 . . : Point Point : DCONST_0
00003 Example02 . . : Point Point D : DCONST_0
00004 Example02 . . : Point Point D D : INVOKESPECIAL flash/geom/Point. (DD)V
00005 Example02 . . : Point : ASTORE 2
00006 Example02 . Point : : ALOAD 2
00007 Example02 . Point : Point : ARETURN
[DEBUG] Using rectangular texture mode.
org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at org.lwjgl.opengl.GL11.glDisable(GL11.java:1057)
at apparat.jitb.JITB.runWithDisplay(JITB.scala:251)
at apparat.jitb.JITB.run(JITB.scala:145)
at apparat.jitb.JITB$.main(JITB.scala:98)
at apparat.jitb.JITB.main(JITB.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
….
A small window pops up for around 1sec, then it closes and I see this error in the console. So I think the lwjgl should be ok, otherwise I would not see any window? The swf seems to load fine…
I tried to narrow down the cause and copied all the lwigl libs into the apparat directory, tested the following example:
java -cp .:lwjgl.jar:lwjgl_test.jar:lwjgl_util.jar:lwjgl_fmod3.jar:lwjgl_devil.jar:jinput.jar: org.lwjgl.test.WindowCreationTest
This worked..
Do you have any idea what could cause that – help would be much appreciated. — Philipp