Code: Select all
#ifndef _RES_SPRITE_H_
#define _RES_SPRITE_H_
extern const SpriteDefinition sega_logo_sprite;
#endif // _RES_SPRITE_H_
Code: Select all
SPRITE sega_logo_sprite "sega_logo_spritesheet.png" 13 4 -1 10
Code: Select all
#include <genesis.h>
#include "gfx.h"
#include "sprite.h"
//Sets default values for VDP register
//Cleans video RAM
//Loads 4 default palettes ; Grey, Red, Green and Blue
//Loads a default font for text print need
//Initializes input handling
//Resets sound and music
//Loads a default sound driver
// Sprite structure
Sprite sprites[2];
int main( )
{
// Define variables
u16 ANIM_LOGO;
s16 posx = 111; //0x6F (Hex)
s16 posy = 88; //0x58 (Hex)
u16 palette[64];
u16 ind;
int counter = 0;
// Disable interrupts when accessing VDP
SYS_disableInts();
// Initialization
VDP_setScreenWidth320();
VDP_setScreenHeight240();
// Init sprites engine
SPR_init(16,256,256);
// Init logo sprite
ind = TILE_USERINDEX;
sprites[0] = SPR_addSprite(&sega_logo_sprite, posx, posy, TILE_ATTR(PAL0, TRUE, FALSE, FALSE)); //This is the only line I get an error on
//SPR_update(sprites, 1);
// Prepare palettes
memcpy(&palette[16], sega_logo_sprite.palette->data, 16 * 2);
VDP_setPalette(0, sega_logo_sprite.palette->data);
//Animation
SPR_setAnim(&sprites[0], ANIM_LOGO);
SYS_enableInts();
...
//Check Hik's SGDK Experiments thread for full code on the old version
}
main.c:36: error: incompatible types in assignment
main.c:109:2: warning: no newline at end of file
make: *** [out/main.o] Error 1