Développement SNES > PVSnesLib English section
Trying to convert "AnimatedSprite" project for 8x8 and 32x32 pixels
zenac:
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)
--- Code: ---char sprTiles[9]={0,2,4, 6,8,10, 12,14,32}; // Remeber that sprites are interleave with 128 pix width,
--- Fin du code ---
AnimatedSprite8x8.c (line 39)
--- Code: ---char sprTiles[9]={0,1,2, 3,4,5, 6,7,8};
--- Fin du code ---
AnimatedSprite32x32.c (line 39)
--- Code: ---char sprTiles[9]={0,4,8, 12,64,68, 72,76,128};
--- Fin du code ---
AnimatedSprite.c (line 50)
--- Code: ---oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE16);
--- Fin du code ---
AnimatedSprite8x8.c (line 50)
--- Code: ---oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE8);
--- Fin du code ---
AnimatedSprite32x32.c (line 50)
--- Code: ---oamInitGfxSet(&gfxpsrite, (&gfxpsrite_end-&gfxpsrite), &palsprite, 0, 0x4000, OBJ_SIZE32);
--- Fin du code ---
More changes in Makefile...
Makefile - AnimatedSprite (lines 63 to 65)
--- Code: ---sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs16 -pc16 -po16 -n $<
--- Fin du code ---
Makefile - AnimatedSprite8x8 (lines 63 to 65)
--- Code: ---sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs8 -pc16 -po16 -n $<
--- Fin du code ---
Makefile - AnimatedSprite32x32 (lines 63 to 65)
--- Code: ---sprites.pic: sprites.bmp
@echo convert bitmap ... $(notdir $@)
$(GFXCONV) -gs32 -pc16 -po16 -n $<
--- Fin du code ---
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?
alekmaul:
Are you sure that transparent color is first color of your palette ?
zenac:
In fact, all the colors of my pictures are wrong.
I think I don't know how to change the line 65 of Makefile to make the right conversion of images of 8x8 pixels and 32x32 pixels...
Original "Makefile" (line 65)
--- Code: ---$(GFXCONV) -gs16 -pc16 -po16 -n $<
--- Fin du code ---
As I have written before, I have only changed the first argument (-gs16 changed to -gs8 and -gs32) of $(GFXCONV) in Makefile.
Please, what should I do? Should I make other changes besides Makefile?
alekmaul:
well, send me your bmp file, i will check if colors are OK, because you must have a 16 colors palette but your bmp file must be a 256 colors file (so yes, colors #17 ..255 are useless).
zenac:
My both picture files have the name "sprites.bmp". Here I changed the name to "sprites8x8" and "sprites32x32". The forum doesn't accept "bmp" files, so I have converted them to "png".
Navigation
[#] Page suivante
Sortir du mode mobile