Make games that sell.
KResource
KResource:

#include "KresourceArchive.h"



KResource supports tar files.
You can create tar files with the 7zip utility.
Quick Reference

addArchive






void KResourceArchive::addArchive (const char*filename);
Sets an archive file for the load functions of PTK ( images and ini files ).

Example :
KResourceArchive::addArchive( "data.dat" ) ;

Advanced technique:
you can pack your own data in the tar archive and read it with:


KResource resData;
KResourceResult result;
char *buffer;
int size = 0;

strlwr( filename ) ;
result = resData.open (filename, K_RES_READ);
if (result != K_RES_OK) return NULL;

resData.seek (K_RES_END, 0);
result = resImage.tell (size);

if ((result != K_RES_OK) || (!size)) return NULL;
resData.seek (K_RES_BEGIN, 0);
buffer = new char [size];
resData.read (buffer, size);
resData.close ();



© 2003-2005, Phelios, inc. - All rights reserved.
Trademarks mentioned are the property of their respective owners.