Застопорился на освоении вывода спрайта.
Текст и тайлы вывести могу. А спрайт - ни в какую.
Точнее экземпл с вики работает. А моё - не пашет. (компилит без ошибок)
Вот мой исходник.
Содержимое файла, задающего ресурсы.Код:#include <genesis.h> struct genresTiles { u16 *pal; //pointer to pal data u32 *tiles; //pointer to tiles data u16 width; //width in tiles u16 height; //height in tiles u16 compressedSize; //0 in this demo, more coming soon }; extern struct genresTiles title; struct genresSprites { u16 *pal; //pointer to pal data u32 **sprites; //pointer to sprites data u16 count; //nb sprites u16 width; //width of each sprite in pixels u16 height; //height of each sprite in pixels u16 size; //since we use width/height in pixel, useful info on sprite size //TODO : size is not SGDK compliant, you need to use size>>8 // will be fixed in coming release }; extern struct genresSprites bat1; #define TILE1 1 int main( ) { SpriteDef mySprite; u8 frame = 0; VDP_setPalette(PAL1, title.pal); // load tiles in VRAM // arg0 = tiles data // arg1 = index for first destination tile // arg2 = number of tiles to load // arg3 = use DMA (1) or not (0) VDP_loadTileData(title.tiles, TILE1, title.width*title.height, 0); // VDP_fillTileMapRectInc(BPLAN, TILE_ATTR_FULL(PAL1, 0, 0, 0, TILE1), 0, 0, title.width, title.height); VDP_resetSprites(); VDP_setSprite(0, 0, 0, bat1.size>>8, TILE_ATTR_FULL(PAL1,1,0,0,TILE1), 1 /* 0 */); // define the sprite (using a _spritedef to easily make Sonic move later) // define the sprite (using a _spritedef to easily make Sonic move later) mySprite.posx = 40; mySprite.posy = 40; mySprite.size = bat1.size>>8; mySprite.tile_attr = TILE_ATTR_FULL(PAL1,1,0,0,1); mySprite.link = 0; VDP_setSpriteP(0, &mySprite); while(1) { VDP_setSpriteP(0, &mySprite); VDP_updateSprites(); VDP_waitVSync(); } return 0; }
Обе битмапы 4-ёх битные.Код:BITMAP title "data/title.bmp" 0 SPRITE bat1 "data/bat.bmp" 56 16 0
title.bmp выводит без проблем.
bat.bmp - не отображает.
А вот исходник с вики по SGDK
http://sgdk.googlecode.com/svn/wiki/...itesGenRes.zip




Ответить с цитированием
Размещение рекламы на форуме способствует его дальнейшему развитию 
