mouse_sync = on drives me mad

Posted By: Uhrwerk

mouse_sync = on drives me mad - 03/14/07 02:18

Hello everybody,

my question is, if there are any further limitations than the bitmaps dimensions. If i got the point correctly, the the bitmap has to be 32x32 in window mode and 32x16 in fullscreen mode. My bitmaps fullfill that, but the cursor still gets scaled strangely.

Are there any restrictions other than that? Are maybe alpha channels forbidden? I don't get the point here...
Posted By: HeelX

Re: mouse_sync = on drives me mad - 03/14/07 09:36

My advice: move away from native mouse_maps's. Assign a dummy bmap to mouse_map (1x1 pixel black or tga with alpha = 0) and use a panel that is being synchronized with the mousepointer.
By this you are able to circumvent the size limitation and any other sideeffects, plus you are free to use other cool features you can do normally just with panels, for example scaling. When you implement a resolution-free display with scaling all panels and stuff, the panel solution for mouse cursors will be useful, because you can scale the cursor panel as well so that the cursor is itself resolution independent as well.

If you want to keep the default button behaviour for panels, the attached panel needs an offset of +1/+1 pixel, other wise it would cover the mousemap/cursor and the buttons/entities can't receive mouse events. If you are smart enough, you can write your own mouse event functions and callbacks so that you have full functionality even with a panel solution. Just in case you dont care about offsets (maybe the cursor is under the attached panel).

I had also a lot of trouble with hardware cursor synchronization, so, I abandoned this and made it on my own which is quiet more satisfying than the GS mouse support.

Cheers
Christian
Posted By: Uhrwerk

Re: mouse_sync = on drives me mad - 03/14/07 14:10

Well, that's a lot of usefull tips. Thank you, Christian. I'll for sure have a look into this.

On the other hand: This can't be so hard. I'd really love to know what I am doing wrong. Creating two bitmaps with the correct dimenstions shouldn't be asked to much of me. :\
Posted By: HeelX

Re: mouse_sync = on drives me mad - 03/14/07 14:17

Did you tried it with 2 bitmaps (.bmp!) in both sizes.. does it work? Did you tested it the same with tgas with and without alpha channels? Did you checked the behaviour with DDS files and as well PCX?

If this an error, compile a testprogram and post it in the bughuntforum. If you need more information on the method I mentioned, you can still contact me.

cheers, Christian
Posted By: TWO

Re: mouse_sync = on drives me mad - 03/14/07 16:07

Wow, very nice tips
Posted By: Uhrwerk

Re: mouse_sync = on drives me mad - 03/14/07 17:25

Quote:

Did you tried it with 2 bitmaps (.bmp!) in both sizes.. does it work? Did you tested it the same with tgas with and without alpha channels? Did you checked the behaviour with DDS files and as well PCX?



Yes I tried both sizes, even vice versa as told in the manual. That doesn't work. Removing the alpha channels makes mouse_sync work, however, the size of the bitmaps then doesn't matter. I even tried exotic sizes like 40x40. Runs without problems, as soon as the alpha channel is removed. However, without an alphachannel the cursor looks really dumb.

Quote:

If this an error, compile a testprogram and post it in the bughuntforum. If you need more information on the method I mentioned, you can still contact me.



I guess that's the way to go. But I will run a few more testruns before posting this. Nothing is more embarassing than posting a bug which isn't a bug. Thank you for your kind offer. If required I'll make use of that.
Posted By: beegee

Re: mouse_sync = on drives me mad - 03/16/07 13:22

I can advice you don't use mouse_sync, because then the mouse cursor is faster than the A6 engine reacts. This means buttons will recognize the mouse cursor later. So, this function hasn't got any advantages.
Posted By: Uhrwerk

Re: mouse_sync = on drives me mad - 03/16/07 14:10

The cursor is updated several times a frame. That's true.However, that doesn't affect the way buttons work. It only makes your mouse movement smoother.

I've found out, that mouse_maps with mouse_enabled may contain alpha channels, but their values must always be 0 or 255, so that you gain something like a visibility bitmask.
Posted By: beegee

Re: mouse_sync = on drives me mad - 03/16/07 18:56

Quote:

The cursor is updated several times a frame. That's true.However, that doesn't affect the way buttons work. It only makes your mouse movement smoother.





Well the mouse cursor is updated several times a frame graphically. But, the running functions are executed only one time a frame. The complete engine only updates one time per frame. So if you got a frame rate of 60, the engine updates 60 times a second. The cursor on the other hand is as fast as the monitor screen refresh. And this value depends on your monitor. Normally 60 Hertz(60 times) on a LCD monitor. In this case you won't recognize any fake.

But if you got an fps value of 30 you see that the mouse cursor updates faster. 60 times the cursor, the engine 30 times. This means if you move your mouse quickly over buttons, they don't recognize any movement.

I've tested this months ago.
Posted By: Uhrwerk

Re: mouse_sync = on drives me mad - 03/16/07 21:06

Well, yes, if you're up to over events, then you're right. If you want to use click events only it doesn't matter.
© 2024 lite-C Forums