PDA

View Full Version : Urgent: Thinking about removing SO_TOPMOST and SO_BACKGROUND


kornalius
10-25-2006, 04:32 PM
SO_TOPMOST and SO_BACKGROUND are basically slowing done and adding too much complexity to the engine. We have layers that can do a marvelous job and are very fast for the engine.</p>

I see SO_TOPMOST and SO_BACKGROUND as superflous options, layer-ordering is far more flexible and way faster in the engine. By removing the two options, there should be some speed increase in the rendering too.</p>

Let me know what you think.</p>

matteo.m
10-25-2006, 05:47 PM
so if i clone some sprites and i move the first one on the screen wiht the pen , how i can make it to be on top of the other?

kornalius
10-25-2006, 05:50 PM
SetSpriteOrder(Sprite$, -1)

Will make the sprite on top of all default sprites (order = 0). You can make it background by setting it to 1.

You can then go further and use a wide range of order levels. Lets say order 1..10 are top level sprites, order 11..20 are normal level sprites and finally order 21..30 are background level sprites.

matteo.m
10-25-2006, 08:15 PM
Thanks kornalius... i'm going to use that instead the flag SO_TOPMOST.. so is fine for me the iproovement of the engine

matteo.m
10-25-2006, 08:48 PM
hi again ,, i guess i didnt understood, I paste some code i was checking changing as you suggested, the sprite is not working on top of the other...
WM_CLOSE:
// Shutdown the GameAPI.
ShutGameAPI(hWnd$);
WM_LBUTTONDOWN:
selected$ = spriteat(wParam$, lParam$, true);
if (selected$)
mx$ = wParam$ - SpriteX(selected$);
my$ = lParam$ - SpriteY(selected$);
AddSpriteOption(selected$, SO_PAUSED);
AddSpriteOption(selected$, SO_BLUR);
// AddSpriteOption(selected$, SO_TOPMOST);
SetSpriteOrder(selected$,-1);
end;

kornalius
10-25-2006, 09:30 PM
Sorry my fault the other way around. Lower values are at the bottom and greater values are at the top.

Try changing -1 to 1.

matteo.m
10-26-2006, 07:15 AM
working fine now, thank you

Solonn
10-26-2006, 07:45 AM
May be a good solution, going to try it on my program.

BSi
10-26-2006, 11:47 AM
I say let them go. All functionality that SO_TOPMOST and SO_BACKGROUND provides can be solved through SetSpriteOrder().

kornalius
10-26-2006, 03:04 PM
Ok, they are gone now. Simplifies the sorting engine (sorting sprites order) by 100%. I like it much better now.