Shadowox
Active Member
Greetings,
I am trying to creating a simple program to extract the sprites from the Tibia.spr. From the original tibia client 7.4.
I have found this explanation but cant find find the transparent color 255 0 255, the value doesnt match:
[4] File Version
[2] Sprite Count
----Now we have sets of 4-bytes that contains the offset for each sprite.
[4] Contains the offset of the first sprite
[4] Contains the offset of the second sprite
[4] Contains the offset of the third sprite
----This continues for each sprite. (The number in Sprite Count.)
----After all of the offsets we start the data for the first sprite.
----Each sprite begins with the transparent-pixels' color. In this case, the Tibia client uses magenta so the three bytes returned are 255, 0, 255. You don't need this pixel when creating the bitmap.
[1] 255
[1] 0
[1] 255
----Note that I only tested that on maybe 10 sprites. So you may have to do more research to verify this.
----Now we get into the actual pixels for this sprite. (This is just an example sprite.)
[2] Number of transparent pixels
[2] Number of colored pixels (for this example we'll say it's 3)
[1] Red value of the first colored pixel
[1] Green value of the first colored pixel
[1] Blue value of the first colored pixel
[1] Red value of the second colored pixel
[1] Green value of the second colored pixel
[1] Blue value of the second colored pixel
[1] Red value of the third colored pixel
[1] Green value of the third colored pixel
[1] Blue value of the third colored pixel
[2] Number of transparent pixels
[2] Number of colored pixels
----Repeat for all transparent and colored pixels in the sprite. Once finished it will start at the next sprite, beginning with the 3 bytes I mentioned before.
I already found the spr file version which is 1102703238.
The number of sprites is 9999.
But the first and second offset doesnt point to the right place, am i doing something wrong? ill post the code.
I am trying to creating a simple program to extract the sprites from the Tibia.spr. From the original tibia client 7.4.
I have found this explanation but cant find find the transparent color 255 0 255, the value doesnt match:
[4] File Version
[2] Sprite Count
----Now we have sets of 4-bytes that contains the offset for each sprite.
[4] Contains the offset of the first sprite
[4] Contains the offset of the second sprite
[4] Contains the offset of the third sprite
----This continues for each sprite. (The number in Sprite Count.)
----After all of the offsets we start the data for the first sprite.
----Each sprite begins with the transparent-pixels' color. In this case, the Tibia client uses magenta so the three bytes returned are 255, 0, 255. You don't need this pixel when creating the bitmap.
[1] 255
[1] 0
[1] 255
----Note that I only tested that on maybe 10 sprites. So you may have to do more research to verify this.
----Now we get into the actual pixels for this sprite. (This is just an example sprite.)
[2] Number of transparent pixels
[2] Number of colored pixels (for this example we'll say it's 3)
[1] Red value of the first colored pixel
[1] Green value of the first colored pixel
[1] Blue value of the first colored pixel
[1] Red value of the second colored pixel
[1] Green value of the second colored pixel
[1] Blue value of the second colored pixel
[1] Red value of the third colored pixel
[1] Green value of the third colored pixel
[1] Blue value of the third colored pixel
[2] Number of transparent pixels
[2] Number of colored pixels
----Repeat for all transparent and colored pixels in the sprite. Once finished it will start at the next sprite, beginning with the 3 bytes I mentioned before.
I already found the spr file version which is 1102703238.
The number of sprites is 9999.
But the first and second offset doesnt point to the right place, am i doing something wrong? ill post the code.
Last edited: