polygon is not drawn
Moderator: Stef
Re: polygon is not drawn
You didn't allocate it, and wrote to random memory. You really need to review your C basics.
Re: polygon is not drawn
Also I want to place sprite behind two layers.
1.) how to set offset address of sprite after:
2.) how to set attributes priority?
1.) how to set offset address of sprite after:
Code: Select all
u16 ind = BMP_FB1ENDTILEINDEX ;
ind += cabin.tileset->numTile;
2.) how to set attributes priority?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: polygon is not drawn
No, it's really overkill and you may not release it properly later.
Just use static structure for that:
Code: Select all
Line line;
line.pt1.x =0;
line.pt1.y =0;
line.pt2.x =100;
line.pt2.y =100;
line.col=10;
BMP_drawLine(&line);
Re: polygon is not drawn
I placed a sprite and artifacts appeared
Code: Select all
BMP_init(TRUE, BG_B, PAL1, TRUE);
BMP_setBufferCopy(TRUE);
SYS_enableInts();
u16 ind = BMP_FB1ENDTILEINDEX ; //TILE_USERINDEX;
VDP_setPalette(PAL0, cabin.palette->data);
VDP_drawImageEx(BG_A, &cabin, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, ind),0, 0, FALSE, TRUE);
ind += cabin.tileset->numTile;
SPR_init();
VDP_setPalette(PAL2, earth.palette->data);
sprites[0] = SPR_addSprite( &earth ,160, 100, TILE_ATTR(PAL2, FALSE, FALSE, FALSE));
SPR_setVRAMTileIndex(sprites[0],ind);
SPR_update();
SYS_doVBlankProcess();