Experimental v71c now up!

35 replies to this topic
Posted 10 months ago #26
Shinkiro1

Yes, Adam is right. Inline is just a suggestion anyway and the compiler is free to ignore it.

PS: If you want any class methods to be inlined you should declare them Final, virtual methods can't be inlined by the compiler (by gcc at least).

 
Posted 10 months ago #27
SLotman

I'm having problems after building my Alcatraz game for Win8. I'm testing it on the simulator (I don't have a WinRT tablet) and when I rotate it, the display gets messed up:

If I start the game on portrait mode it starts ok... (is there an option to lock it to landscape?), but if I rotate the simulator, this happens:

Same thing if the other way around: I start at landscape and rotate the device, to get this:

I'm using autofit, if that's anything - game works fine on all targets.
Another thing: even if I'm not in the simulator, the mouse position isn't updated properly.

I just have in my game:

#If TARGET="glfw" Or TARGET="html5" Or TARGET="win8" Or TARGET="flash" Or TARGET="xna"
    IGGraph.drawImage imgMouse, VMouseX(), VMouseY()
#End

But on Win8 the mouse position only gets an update when I'm pressing it down. Surely, at least on Win8 on PCs it shouldn't behave this way??
(IGGraph.drawImage is just a wrapper for DrawImage, nothing fancy about it)

Edit: Got a sample code to reproduce the problem:

Import autofit


Function Main()
	New Game
End Function

Class Game Extends App
	Method OnCreate()
		SetUpdateRate 30
		SetVirtualDisplay(800,600)
	End Method
	
	Method OnRender()
	   UpdateVirtualDisplay()
	   
		SetColor 255,0,0
		DrawRect 0,0,800,600
		
		SetColor 255,255,255
		DrawRect VMouseX(), VMouseY(),32,32
	End Method
	
	Method OnUpdate()
		If KeyHit(KEY_ESCAPE) Then Error ""
	End Method
End Class

Mouse won't move unless you press the left button, and if you rotate the display, it will be rendered in a wrong way.

Edit 2: Even locking the game to landscape mode in the manifest file, It is still rendered wrong when rotating: (apparently the simulator doesn't care if you lock the rotation or not...)

 
Posted 10 months ago #28
Gerry Quinn

I don't trust compilers to know when something should be inlined.

 
Posted 10 months ago #29
Shinkiro1

I don't trust compilers to know when something should be inlined.

Although it might be hard to admit, compilers are much smarter than us most of the time :P

 
Posted 10 months ago #30
Gerry Quinn

from http://stackoverflow.com/questions/8450030/can-modern-c-compilers-inline-functions-that-are-defined-in-a-cpp-file

"I jump between being impressed by my C++ compiler's (MSVC 2010) ingenuity and its stupidity. Some code that did pixel format conversion via templates, which would have resolved into 5-10 assembly instructions when properly inlined, got bloated into kilobytes(!) of nested function calls. At other times, it inlines so aggressively that whole classes disappear even though they contained non-trivial functionality."

And I'm pretty sure HTML5 wouldn't compile so fast if it used any sophisticated inlining algorithms.

 
Posted 10 months ago #31
AdamRedwoods

And I'm pretty sure HTML5 wouldn't compile so fast if it used any sophisticated inlining algorithms.

Mozilla has a great article on its js compiler. it's an interpreter at first, then as the program runs, it collects data and starts to compile sections at a time.
https://blog.mozilla.org/javascript/

I'm all for an inline declaration, but there are more important things that monkey needs at the moment.

 
Posted 10 months ago #32
Gerry Quinn

I agree, it is not as if we got Monkey so we could 'hit the metal' anyway!

I must experiment a bit and see if inlining would be useful - it's easy enough to test.

 
Posted 10 months ago #34
marksibly

> I'm having problems after building my Alcatraz game for Win8. I'm testing it on the simulator (I don't have a WinRT tablet) and when I rotate it, the display gets messed up:

I've just uploaded v71c which should have much better Win8 display orientation handling.

You can ignore the glitching in the simulator when display rotates - I've tested on a 'real' device and it's much smoother.

To 'lock' rotation, use the same config setting as win phone 8, eg: #WIN8_SCREEN_ORIENTATION=2 for landscape only.

 
Posted 10 months ago #35
MikeHart

Thank you so much for continously enhancing your product.

 
Posted 10 months ago #36
SLotman

Thanks Mark! As soon as I'm done with University tests this week, I'll try it!