Page 1 of 1

Sort TILE primitives into GsOT?

Posted: June 22nd, 2013, 5:42 pm
by ddoodm
Hi guys. I'm working on a Tetris implementation as a bit of a learning experiment, and I'm developing a 'strafield' intro sequence now (which is mostly finished, but I want to rewrite it).

Rubbish static preview (looks a bit cooler when animated):
Image

Anyway, my question is:
I need to sort an array of TILE_1s into my GsOT, but there are no GsSort* methods for TILE primitives (or even standard primitives). I'm drawing them directly with DrawPrim right now, but that's going to get ambiguous real quick.

Is it possible to place the TILE_1s into my GsOT_TAG array manually? It's probably possible to use AddPrim with a u_long*, but that's not ideal. It'd be great to be able to sort them automagically with some kind of method that acts upon a GsOT.

Thanks for any help!

Re: Sort TILE primitives into GsOT?

Posted: June 23rd, 2013, 1:40 pm
by inc^lightforce

Re: Sort TILE primitives into GsOT?

Posted: June 23rd, 2013, 2:35 pm
by ddoodm
Thanks a million for that; your code is really elegant, and the stars look amazing too. Makes a lot of sense thanks to your great comments.

Re: Sort TILE primitives into GsOT?

Posted: June 23rd, 2013, 3:29 pm
by inc^lightforce
no problem. if you need a "3D starfield scroller" from the back into the front on Z Axis i can make a 2nd Script.
feel free to visit my Workshop for some other goodies here:
WORKSHOP CODING INTROS & DEMOS

Re: Sort TILE primitives into GsOT?

Posted: June 23rd, 2013, 4:28 pm
by ddoodm
Really appreciate your offer, but mine already scrolls along the Z. :) Wow, didn't know you had a workshop thing going on; going to have a look now!