I want to display a map. Let's say a dungeon for an hypothetic rpg.
I use sprite because I don't know how to use tile. I hoped it would have work the same ...
(I'm using SGL as usual).
So, I register 3 16x16 sprites (1 for the ground ,1 for the wall and 1 for a character).
And define multiple position for that sprite.
Then in my main file, I try to display all defined sprites.
But not all the sprites are not displayed, and I can't really see why.
I'm sure a clipping procedure will improve (but don't solve ?) this problem.
I believed that the Saturn could display unlimited sprites ...
What do you think about that ??
Source code + binary in the attachement.
I use sprite because I don't know how to use tile. I hoped it would have work the same ...
(I'm using SGL as usual).
So, I register 3 16x16 sprites (1 for the ground ,1 for the wall and 1 for a character).
Code:
SPR_ATTR attr[] = {
SPR_ATTRIBUTE(0,No_Palet,No_Gouraud,CL32KRGB|ECdis,sprNoflip), //ground1
SPR_ATTRIBUTE(1,No_Palet,No_Gouraud,CL32KRGB|ECdis,sprNoflip), //wall1
SPR_ATTRIBUTE(2,No_Palet,No_Gouraud,CL32KRGB|ECdis,sprNoflip), //face1
};
ANGLE angz[] = {
DEGtoANG( 0),
};
TEXTURE tex_spr[] = {
TEXDEF(16,16,0), //ground1
TEXDEF(16,32,256), //wall1
TEXDEF(16,27,768), //face1
};
PICTURE pic_spr[] = {
PICDEF(0,COL_32K,ground1),
PICDEF(1,COL_32K,wall1),
PICDEF(2,COL_32K,face1),
};
And define multiple position for that sprite.
Code:
FIXED playerpos[][XYZS] = {
{toFIXED( 0),toFIXED(100),toFIXED(168),toFIXED(1.0)},
};
FIXED wallpos[][XYZS] = {
{toFIXED(-32),toFIXED( 29),toFIXED(169),toFIXED(1.0)}, // 1
{toFIXED(-16),toFIXED( 29),toFIXED(169),toFIXED(1.0)}, //2
.....
{toFIXED( 48),toFIXED(-68),toFIXED(169),toFIXED(1.0)}, //12
};
FIXED groundpos[][XYZS] = {
{toFIXED( 0),toFIXED(100),toFIXED(169),toFIXED(1.0)}, //1 {toFIXED(-16),toFIXED(100),toFIXED(169),toFIXED(1.0)}, //2
.........
{toFIXED(-32),toFIXED(100),toFIXED(169),toFIXED(1.0)}, //130
};
Then in my main file, I try to display all defined sprites.
But not all the sprites are not displayed, and I can't really see why.
I'm sure a clipping procedure will improve (but don't solve ?) this problem.
I believed that the Saturn could display unlimited sprites ...
What do you think about that ??
Source code + binary in the attachement.