Menu

Voir les contributions

Cette section vous permet de consulter les contributions (messages, sujets et fichiers joints) d'un utilisateur. Vous ne pourrez voir que les contributions des zones auxquelles vous avez accès.

Voir les contributions Menu

Sujets - zenac

#1
How can I draw the same sprite two times in the same screen but using different colors? For example, in a fight "Ryu (white clothes) vs. Ryu (dark clothes)" in "Street Fighter II" or in a sport game (Lakers with yellow uniform and Celtics with green uniform). Considering that two objects have the same sprite, can I associate the first object to a palette and the second object to another different palette?
#2
I'm trying to convert "AnimatedSprite" project. The original project uses sprites with 16x16 pixels. I would like to make a new version using sprites with 8x8 (project "AnimatedSprite8x8") and another new version using sprites with 32x32 (project "AnimatedSprite32x32").

The original file "AnimatedSprite.c" can be seen at:
http://www.portabledev.com/media/SNES/PVSnesLib/doc/a00010.html

I have copied all the files of the original project to the other two new projects.

But there are some differences:

- The file "AnimatedSprite.c" was renamed: "AnimatedSprite8x8.c" and "AnimatedSprite32x32.c"

- The dimensions of the original file image ("sprites.bmp") are: 16x144 pixels. The new versions of this files have the following dimensions: 8x72 pixels (for AnimatedSprite8x8) and 32x288 (for AnimatedSprite32x32).

Then, I have changed some lines of the code:

AnimatedSprite.c (line 39)
char sprTiles[9]={0,2,4, 6,8,10, 12,14,32};  // Remeber that sprites are interleave with 128 pix width,

AnimatedSprite8x8.c (line 39)
char sprTiles[9]={0,1,2, 3,4,5, 6,7,8};

AnimatedSprite32x32.c (line 39)
char sprTiles[9]={0,4,8, 12,64,68, 72,76,128};


AnimatedSprite.c (line 50)
oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE16);

AnimatedSprite8x8.c (line 50)
oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE8);

AnimatedSprite32x32.c (line 50)
oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE32);


More changes in Makefile...

Makefile - AnimatedSprite (lines 63 to 65)

sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs16 -pc16 -po16 -n $<



Makefile - AnimatedSprite8x8 (lines 63 to 65)

sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs8 -pc16 -po16 -n $<



Makefile - AnimatedSprite32x32 (lines 63 to 65)

sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs32 -pc16 -po16 -n $<


When I run "AnimatedSprite8x8" and "AnimatedSprite32x32" the joystick moves the character, but the transparency effect does NOT work. The character is inside a visible square area.

Please, what have I forgotten?