V35 Up! [MONKEY NEWS]

Monkey Forums/Monkey Programming/V35 Up! [MONKEY NEWS]

marksibly(Posted 2011) [#1]
Hi,

V35 is now available!


Modules:

Mojo iOS sample loader now uses audio toolbox for mp3 support.

Mojo Html5 SetScissor fixed.

Added Mojo Music commands - see mojo.audio

Mojo Android volume control now always sets media volume.


Trans (1.06):

Fixed float literal 'e' notation.

Fixed BalanceTypes to generate an error instead of returning null.

Rearranged and tidied up post semant class validation code.

Fixed ObjectType.EqualsType to use new ClassDecl.EqualsClass method for generic class comparison fix.




Wagenheimer(Posted 2011) [#2]
Mojo iOS sample loader now uses audio toolbox for mp3 support!

Thanks a lot for this! =)


Xaron(Posted 2011) [#3]
Great! Thanks Mark!


dopeyrulz(Posted 2011) [#4]
Thanks Mark - all working fine here.


Qcat(Posted 2011) [#5]
Fantastic! Thanks Mark!


Pudsy(Posted 2011) [#6]
Thanks for the update.

Something strange seems to have happened with HTML5 performance though (haven't noticed any difference on Flash).

I'm getting significantly lower performance on just basic image drawing (not sure if that's the cause or just one visible effect).

Quick sample code below (not the prettiest but should suffice!). Stick any old image in the data folder as "image.png" - I used a 128x128 with alpha transparency.

Use cursor/arrow keys LEFT/RIGHT to change number of objects drawn.

Compiled with v34b I can easily hit 700 objects and still get 100 frames-per-sec.
With v35 I barely get 50 fps with 700 objects. Even with 0 objects, it doesn't seem to give a steady 100 fps on v35.

EDIT: Tested here with Firefox 4

EDIT: BTW I did delete the .build folder when switching between versions, so it's not that.

EDIT: More strangeness... if I close Monk IDE (v35) then open the HTML5 version in my browser, it runs as well as v34b did previously. The performance is still lower even if built with "debug" off, just only while Monk is open.

Import mojo

Global img:Image
Global NUM_OBJECTS = 50
Global stp = 0
Global FPS:Float
Global frames
Global time

Class MyApp Extends App

	Method OnCreate()
		SetUpdateRate 100
		img = LoadImage("image.png")		
		frames = 0
		time = Millisecs()
	End
	
	Method OnUpdate()
		stp = (stp + 1) Mod img.Width
		If KeyHit(KEY_RIGHT) Or KeyHit(KEY_UP)
			NUM_OBJECTS += 50
		Endif
		If KeyHit(KEY_LEFT) Or KeyHit(KEY_DOWN)
			NUM_OBJECTS = Max(0, NUM_OBJECTS - 50)
		Endif
	End
	
	Method OnRender()
		Cls 0,0,0
		Local x = stp
		Local y = 0
		For Local i:Int = 1 To NUM_OBJECTS
			DrawImage img, x,y
			x += img.Width
			While x > DeviceWidth()
				x -= DeviceWidth()
				y += img.Height
				While y > DeviceHeight()
					y -= DeviceHeight()
					x += 10
				Wend
			Wend
		Next
		frames += 1
		If frames > 50
			Local newtime = Millisecs()
			Local elapsed = Max(1, (newtime - time))
			FPS = Float(frames * 1000) / Float(elapsed)
			frames = 0
			time = newtime
		Endif
		DrawText "Objects: " + NUM_OBJECTS, 0,0
		DrawText "FPS: " + Int(FPS), 0,30
	End
	
End

Function Main()
	New MyApp
End



anawiki(Posted 2011) [#7]
Does it mean that we can play mp3 files without extra license? I remember lack of mp3 support for BlitzMax was due to licensing issues.


Xaron(Posted 2011) [#8]
You have to take care about this by yourself. It isn't worth it, I think you should go for Ogg.


anawiki(Posted 2011) [#9]
But at the moment Monkey doesn't support Ogg on iOS (am I right?), that's why I asked. I would be more than happy to use Ogg, since that's what we use on BMX.


JD0(Posted 2011) [#10]
Thousands of iOS games use MP3 files.. never heard of one paying for a license. Maybe apple does somewhere along the line.. You are using apple's official tools in the end anyways.


skid(Posted 2011) [#11]
Are you sure and how can you tell? I thought (and use) the standard audio formats on iOS for samples and music which are .caf and .m4a respectively.

Flash is the only platform I know of where Adobe have licensed the use of mp3 so that game authors are legally covered.