ZLib based LoadFromZip
This commit is contained in:
parent
f03de195d0
commit
f7c8398239
@ -14,7 +14,7 @@
|
||||
|
||||
ZE_*.h files should only include this file and any other ZE_*.h files that they need, External Library or C/C++ Standard Library
|
||||
files should be included from within this file.
|
||||
$Id: ZE_Includes.h,v 1.17 2003/08/08 04:05:22 cozman Exp $<br>
|
||||
$Id: ZE_Includes.h,v 1.18 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -37,10 +37,8 @@
|
||||
#ifdef USE_SDL_MIXER
|
||||
#include "SDL_mixer.h"
|
||||
#endif
|
||||
#ifdef USE_PHYSFS
|
||||
#include "physfs.h"
|
||||
#include "external/physfsrwops.h"
|
||||
#endif
|
||||
|
||||
#include "../zlib/unzip.h"
|
||||
|
||||
#include <string> //used frequently
|
||||
#include <queue> //used by ZEngine for ZErrors
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
Definition file for ZEngine Utilities which are used throughout the engine and can be used in
|
||||
conjunction with ZEngine.
|
||||
<br>$Id: ZE_Utility.h,v 1.5 2003/06/11 00:15:25 cozman Exp $<br>
|
||||
<br>$Id: ZE_Utility.h,v 1.6 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -38,9 +38,7 @@ namespace ZE
|
||||
**/
|
||||
std::string FormatStr(const char *fmtstr, ...);
|
||||
|
||||
//////////
|
||||
//Memory//
|
||||
//////////
|
||||
SDL_RWops* RWFromZip(std::string zipname, std::string filename);
|
||||
|
||||
/*!
|
||||
\brief Properly free SDL_Surface.
|
||||
|
@ -13,7 +13,7 @@
|
||||
\brief Definition file for core ZEngine class.
|
||||
|
||||
ZEngine Game Engine core Engine definition.
|
||||
<br>$Id: ZE_ZEngine.h,v 1.49 2003/09/21 03:28:53 cozman Exp $<br>
|
||||
<br>$Id: ZE_ZEngine.h,v 1.50 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -174,16 +174,6 @@ class ZEngine
|
||||
void SetupSound(int rate, bool stereo);
|
||||
#endif
|
||||
|
||||
#ifdef USE_SDL_IMAGE
|
||||
/*!
|
||||
\brief Init Sound for ZEngine.
|
||||
|
||||
Initialize sound for ZEngine.
|
||||
**/
|
||||
bool InitSound();
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
\brief Create Display with predefined settings.
|
||||
|
||||
@ -503,28 +493,6 @@ class ZEngine
|
||||
**/
|
||||
void SetEventFilter(SDL_EventFilter filter);
|
||||
|
||||
#ifdef USE_PHYSFS
|
||||
////////////////////
|
||||
//Physfs Utilities//
|
||||
////////////////////
|
||||
/*!
|
||||
\brief Initialize PhysicsFS
|
||||
|
||||
Sets up PhysicsFS, must be called when application is started.
|
||||
\param argv argv[0] from application's main.
|
||||
**/
|
||||
void InitPhysFS(std::string argv);
|
||||
|
||||
/*!
|
||||
\brief Add Directory to PhysFS Search Path.
|
||||
|
||||
Add Directory to PhysicsFS search path, the path it looks in for files when attempting to load.
|
||||
\param dir Directory to add to search path.
|
||||
**/
|
||||
void AddPhysFSDir(std::string dir);
|
||||
|
||||
#endif //USE_PHYSFS
|
||||
|
||||
/////////////////
|
||||
//Error Logging//
|
||||
/////////////////
|
||||
@ -666,18 +634,6 @@ class ZEngine
|
||||
**/
|
||||
double RandDouble();
|
||||
|
||||
////////////////////////////
|
||||
//Data Loading + Unloading//
|
||||
////////////////////////////
|
||||
/*!
|
||||
\brief Load an Image.
|
||||
|
||||
Loads an Image to an ImageData class which keeps vital information on the Image.
|
||||
\param filename path to file to load.
|
||||
\return A SDL_Surface pointer to data.
|
||||
**/
|
||||
SDL_Surface* LoadImage(std::string filename);
|
||||
|
||||
#ifdef USE_SDL_MIXER
|
||||
/*!
|
||||
\brief Load a Sound
|
||||
|
@ -42,6 +42,8 @@ class ZFont
|
||||
TTF_Font *rFont;
|
||||
//! Filename, for resizing.
|
||||
std::string rFilename;
|
||||
//! Zip filename, for resizing when file was from archive.
|
||||
std::string rZipname;
|
||||
//! SDL_Color for current text color.
|
||||
SDL_Color rColor;
|
||||
//! SDL_Color for background color to be used in shaded draws.
|
||||
@ -85,10 +87,20 @@ class ZFont
|
||||
**/
|
||||
void Open(std::string filename, int size);
|
||||
|
||||
/*!
|
||||
\brief Opens a font from within a zip archive.
|
||||
|
||||
Open a font from within a zip archive using zlib and SDL_RWops.
|
||||
\param zipname Zip file to open image from.
|
||||
\param filename File to open as new image.
|
||||
\param size Size to use for font.
|
||||
**/
|
||||
void OpenFromZip(std::string zipname, std::string filename, int size);
|
||||
|
||||
/*!
|
||||
\brief Release font.
|
||||
|
||||
Release memory held by font.
|
||||
Release memory held by font. (Called by destructor).
|
||||
**/
|
||||
void Release();
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
\file ZE_ZImage.h
|
||||
\brief Definition file for ZImage.
|
||||
|
||||
Definition file for ZImage, the OpenGL version of the ZImage class for ZEngine.
|
||||
<br>$Id: ZE_ZImage.h,v 1.26 2003/09/07 20:59:20 cozman Exp $<br>
|
||||
Definition file for ZImage, the ZImage class for ZEngine.
|
||||
<br>$Id: ZE_ZImage.h,v 1.27 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -29,7 +29,7 @@ namespace ZE
|
||||
/*!
|
||||
\brief ZImage class for basic Image use.
|
||||
|
||||
ZImage image drawing class, class wraps common features of SDL_Surface. Inherited from ZObject.
|
||||
ZImage image drawing class, class wraps 2d textures under OpenGL or SDL_Surface under SDL.
|
||||
**/
|
||||
class ZImage
|
||||
{
|
||||
@ -130,11 +130,20 @@ class ZImage
|
||||
/*!
|
||||
\brief Opens a file.
|
||||
|
||||
Open a file using ZEngine. Loads into rImage member of class.
|
||||
\param filename File to open as rImage.
|
||||
Open an image file using ZEngine.
|
||||
\param filename File to open as new image.
|
||||
**/
|
||||
void Open(std::string filename);
|
||||
|
||||
/*!
|
||||
\brief Opens an image file from within a zip archive.
|
||||
|
||||
Open an image file from within a zip archive using zlib and SDL_RWops.
|
||||
\param zipname Zip file to open image from.
|
||||
\param filename File to open as new image.
|
||||
**/
|
||||
void OpenFromZip(std::string zipname, std::string filename);
|
||||
|
||||
/*!
|
||||
\brief Cuts part of an existing image to create a new image.
|
||||
|
||||
@ -179,7 +188,7 @@ class ZImage
|
||||
/*!
|
||||
\brief Releases image.
|
||||
|
||||
Frees memory via call to SDL_FreeSurface for the image.
|
||||
Frees memory for the image. (Called by destructor).
|
||||
**/
|
||||
void Release();
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
\brief Definition file for ZSound.
|
||||
|
||||
Definition file for ZSound, the Sound Effect wrapper for ZEngine.
|
||||
<br>$Id: ZE_ZSound.h,v 1.9 2003/06/11 00:15:26 cozman Exp $<br>
|
||||
<br>$Id: ZE_ZSound.h,v 1.10 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -80,6 +80,15 @@ class ZSound
|
||||
**/
|
||||
void Open(std::string filename);
|
||||
|
||||
/*!
|
||||
\brief Opens a sound effect file from within a zip archive.
|
||||
|
||||
Open a sound effect file from within a zip archive using zlib and SDL_RWops.
|
||||
\param zipname Zip file to open sound effect from.
|
||||
\param filename File to open as new sound effect.
|
||||
**/
|
||||
void OpenFromZip(std::string zipname, std::string filename);
|
||||
|
||||
/*!
|
||||
\brief Release sound effect.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Header file for ZEngine Game Engine from Concept of Zero, this is the file that programs that wish to
|
||||
utilize ZEngine should include.
|
||||
<br>$Id: ZEngine.h,v 1.31 2003/08/07 07:16:11 cozman Exp $<br>
|
||||
<br>$Id: ZEngine.h,v 1.32 2003/09/24 01:49:52 cozman Exp $<br>
|
||||
\author James Turk
|
||||
**/
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<br>
|
||||
-ZEngine is designed to provide a powerful yet easy to use 2D game engine in a well designed
|
||||
Object Oriented manner, and uses cross platform libraries such as SDL and OpenGL. (ZEngine can use SDL_ttf,SDL_image,
|
||||
SDL_mixer, and PhysFS all of which are cross platform as well as Open Source.)<br>
|
||||
and SDL_mixer all of which are cross platform as well as Open Source.)<br>
|
||||
-It is licensed under a BSD-style license, and anyone is free to suggest or implement changes
|
||||
to be added to the Engine, as well as modify the engine to their own needs or use it however they like.<br>
|
||||
-ZEngine now uses OpenGL rather than SDL to do 2D drawing, thus increasing the uses of the engine
|
||||
|
Loading…
Reference in New Issue
Block a user