Original Post
🔒 Locked
Texture Packs
Advertisement
1. use the windows resource system. I don''t so I''m not explaining how
2. create your own resource format
2a. You need something to convert textures into resources
2b. You need something to read resources into your game
Things to think about:
-You probably want to be able to create your textures by name so make sure your resources contain names (I do)
-Look into Hash structures, or create your own (I did)
-Encryption if you don''t want users to change your resources (I like it plugable)
-Multiple resource formats ( 1 for textures, 1 for models, 1 for maps) or 1 resource format containing all ( I did the later)
---------------------------
I may be getting older, but I refuse to grow up
2. create your own resource format
2a. You need something to convert textures into resources
2b. You need something to read resources into your game
Things to think about:
-You probably want to be able to create your textures by name so make sure your resources contain names (I do)
-Look into Hash structures, or create your own (I did)
-Encryption if you don''t want users to change your resources (I like it plugable)
-Multiple resource formats ( 1 for textures, 1 for models, 1 for maps) or 1 resource format containing all ( I did the later)
---------------------------
I may be getting older, but I refuse to grow up
You could simply concat all the raw data for each texture together to make one file. Of course you will need a header to identify textures etc.
the following is a c style struct to show how I would lay out a simple texture block:
struct Texture Pack Header
{
u32 VersionNumber;
u32 NumberOfTextures;
ATEXTURE textures[NumberOfTextures];
};
struct ATEXTURE
{
u32 Width, Height, Bpp, DataSize;
u8 Data[DataSize];
};
You the would open the file and read the data, parsing it as you go. ie read version number, check its ok, read number of textures, then for each texture read the data....
hope this is of some help
the following is a c style struct to show how I would lay out a simple texture block:
struct Texture Pack Header
{
u32 VersionNumber;
u32 NumberOfTextures;
ATEXTURE textures[NumberOfTextures];
};
struct ATEXTURE
{
u32 Width, Height, Bpp, DataSize;
u8 Data[DataSize];
};
You the would open the file and read the data, parsing it as you go. ie read version number, check its ok, read number of textures, then for each texture read the data....
hope this is of some help
Hi!
Have a look at http://www.flipcode.com/tutorials/tut_vfs01.shtml
McMc
Have a look at http://www.flipcode.com/tutorials/tut_vfs01.shtml
McMc
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement