SDLGameEngine

include/sgeresource.h

Go to the documentation of this file.
00001 #ifndef _SGERESOURCE_H
00002 #define _SGERESOURCE_H
00003 
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00012 /*
00013  * Copyright (c) 2007 Heiko Irrgang
00014  *
00015  * The license and distribution terms for this file may be
00016  * found in the file COPYING in this distribution or at
00017  * http://93-interactive.com/cms/products/software/sdl-game-engine/license/
00018  */
00019 
00035 typedef struct {
00037         FILE *f;
00041         int numberOfFiles;
00043         char *archname;
00044         char **fileName;
00045         Uint32 *position;
00046         Uint32 *fileSize;
00047         char *encryptionkey;
00048 } SGEFILE;
00049 
00065 SGEFILE *sgeOpenFile(const char *filename, const char *encryptionkey);
00066 
00070 void sgeCloseFile(SGEFILE *f);
00071 
00073 void sgeEncryptBuffer(void *buffer, Uint32 length, const char *encryptionkey);
00075 #define sgeDecryptBuffer sgeEncryptBuffer
00076 
00088 void sgeCreateFile(const char *filename, char *filenames[], Uint32 numberOfFiles, const char *encryptionkey);
00089 
00096 int sgeGetFileIndex(SGEFILE *f, const char *filename);
00097 
00104 Uint32 sgeGetFileSize(SGEFILE *f, const char *filename);
00105 
00112 void *sgeReadFile(SGEFILE *f, const char *filename);
00113 
00123 SDL_Surface *sgeReadImage(SGEFILE *f, const char *filename);
00124 
00134 SDL_Surface *sgeReadImageMemory(SGEFILE *f, const char *filename);
00135 
00142 Mix_Chunk *sgeReadSound(SGEFILE *f, const char *filename);
00143 
00149 SDL_Surface *sgeDuplicateSDLSurface(SDL_Surface *s);
00150 
00151 // }@
00152 
00153 #ifdef __cplusplus
00154 }
00155 #endif
00156 
00157 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines