I wanted to create an easy to use & fast library that could
handle any given variable type(and files) without having to
write down a bunch of arrays(or LLs) for every single type.
That's how i actually started working on this project...
While i was working on it , i decided to add more cool
features , like , dumping the whole memory that the library
handles , in a compatible(by the library) package file,
with the ability to load it back(whole memory) or just
a specific entry(yes,it can be used even as a packer).
After many hours of work(Well,not that many :-P),the library
is able to perform the following tasks:
v1.0:
Code: Select all
+It does everything as fast as possible
+Any compatible type can be added(structures/ints/void pointers/char pointers/floats/quads(doubles))
+Any file can be easily imported as an entry(weee,you can code your own custom loaders for your game resources easily)
+Save the whole memory into a file(ATL PACKAGE)
+Load memory from ATL PACKAGE
+Load specific memory section from ATL PACKAGE
+Entries are hashed
+Detailed allocated memory information
What's new in v1.1:
Code: Select all
+ Updated ATL to 1.1
+ Replaced std io with native SceIo funcs
+ Fixed a small bug that could cause a memory leak when packing an external file
+ Added VFPU memcpy support(see header) ( [b]RAPHAEL'S IMPLEMENTATION[/b] )
+ Added the ability to change hash's seed value
+ Added entry reference counting
+ Added the ability to find the most "popular" node(ref'd most)
+ Added the ability to generate custom hash from a given string
+ Core functions which take as argument the hash ID of each node have been also added
(yes , in combination with custom hash function you can create your own hash table
to optimize a bit the process)
+ Added 6 new demo examples.
v1.2|F|
Code: Select all
-Updated core functions to ensure that the library will never
"hang" ,... even if used really bad.
+Added the ability to extract packed external file sources/registered types
to a single file.
+Added "atlGetAllocatedEntries" which returns the total
of allocated entries.
-Updated header.
-Updated common\*.h & added a proper function to handle input for the demo code samples.
-Updated atlRemoveEntry() to handle some special cases
+Added a new demo("demo samples\Unpacking data to external file sources").
Code: Select all
-Updated header
-Added a new demo( "Importing external sources to an existing ATL package" )
+You can now import external file sources to an existing package
without having to load it.
With this update , you can pack unlimited ammount of files , since you
don't have to bother about the available memory limit.
+Some final code optimizations
About the release:
The first public release comes with 6 demos , and
all the required files to use the library(the header & the lib file).
Some demo examples , to get an idea :
1.
Code: Select all
//Import external file source
atlInit(ATL_ENABLE_LOGGING);
atlAddEntryFromExternalSource("DEMO_TEXT.txt","text");
printf("----PACKED FILE----\n");
printf("%s \n : %d bytes\n",
(char*)atlFindEntry("text")->type,
atlFindEntry("text")->type_size);
printf("----PACKED FILE----\n");
atlShutdown();
Code: Select all
//Packing & accessing a custom vertex structure
atlInit(ATL_ENABLE_LOGGING);
struct Vertex* v1 = malloc(sizeof(struct Vertex));
v1->x = v1->y = v1->z = 255.0f;
atlAddEntry("vertex",//entry name(Will be hashed)
ATL_CAST_ENTRY(v1) ,//cast entry
sizeof(struct Vertex));//size in bytes
free(v1);
//test entry
printf("Vert size : %d bytes \n",atlFindEntry("vertex")->type_size);
struct Vertex* v2 = atlFindEntry("vertex")->type;
printf("x = %f \n",v2->x);
printf("y = %f \n",v2->y);
printf("z = %f \n",v2->z);
//endOfStory()
atlShutdown();
Code: Select all
//packing an integer type
atlInit(ATL_ENABLE_LOGGING);
int a = 9999999;
atlAddEntry("int_a",//entry name
atlIntToPtr(a), // int -> pointer
ATL_MAX_NUMERICAL_TYPE_DIGITS+1);//size
//print the results
printf("%d : %d bytes\n",
atlPtrToInt(atlFindEntry("int_a")->type),//grab entry & convert ptr -> int
atlFindEntry("int_a")->type_size);
atlShutdown();
Closing up
That's pretty much everything i had to say.
If you test the library , and find any bugs , please report them right here.
(I've been very careful with this project,but you never really know if something
bad is in the code,SO...lawl).
___Download ATL v1.3F:
http://www.sendspace.com/file/s9l3a4