V35 Up!

10 replies to this topic
Posted 1+ years ago #1


V35 is now available!


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.

Posted 1+ years ago #2

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

Thanks a lot for this! =)

Posted 1+ years ago #3

Great! Thanks Mark!

Posted 1+ years ago #4

Thanks Mark - all working fine here.

Posted 1+ years ago #5

Fantastic! Thanks Mark!

Posted 1+ years ago #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()
	Method OnUpdate()
		stp = (stp + 1) Mod img.Width
		If KeyHit(KEY_RIGHT) Or KeyHit(KEY_UP)
			NUM_OBJECTS += 50
		If KeyHit(KEY_LEFT) Or KeyHit(KEY_DOWN)
	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
		frames += 1
		If frames > 50
			Local newtime = Millisecs()
			Local elapsed = Max(1, (newtime - time))
			FPS = Float(frames * 1000) / Float(elapsed)
			frames = 0
			time = newtime
		DrawText "Objects: " + NUM_OBJECTS, 0,0
		DrawText "FPS: " + Int(FPS), 0,30

Function Main()
	New MyApp
Posted 1+ years ago #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.

Posted 1+ years ago #8

You have to take care about this by yourself. It isn't worth it, I think you should go for Ogg.

Posted 1+ years ago #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.

Posted 1+ years ago #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.

Posted 1+ years ago #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.