diff --git a/include/ZE_ZConfigFile.h b/include/ZE_ZConfigFile.h index 5cf1c03..cdfd7d5 100644 --- a/include/ZE_ZConfigFile.h +++ b/include/ZE_ZConfigFile.h @@ -13,7 +13,7 @@ File: Types/ZE_ZConfigFile.h
Description: Header file for ZEngine INI-Style Config Files.
Author(s): James Turk
-$Id: ZE_ZConfigFile.h,v 1.7 2003/02/10 03:19:37 cozman Exp $
+$Id: ZE_ZConfigFile.h,v 1.8 2003/02/10 04:07:04 cozman Exp $
\file ZE_ZConfigFile.h \brief Definition file for ZConfigFile. @@ -25,7 +25,7 @@ $Id: ZE_ZConfigFile.h,v 1.7 2003/02/10 03:19:37 cozman Exp $
#ifndef __ze_zconfigfile_h__ #define __ze_zconfigfile_h__ -#include "ZE_ZObject.h" //included even though ZCF isn't derived (to obtain all other needed headers) +#include "ZE_ZEngine.h" namespace ZE { @@ -35,13 +35,12 @@ namespace ZE ZConfigFile class for INI-style configuration files for games or applications. Inherited from ZObject. **/ -class ZConfigFile : public ZObject +class ZConfigFile { private: //Private Types// - /*! \brief ZConfigFile Variable class. @@ -71,11 +70,11 @@ class ZConfigFile : public ZObject list varList; }; + protected: //! List of sections of internal type. - list mFileLayout; - + list rFileLayout; //! Filename of file currently open. - string mFilename; + string rFilename; /*! \brief Reformat a string in a form more suitable to parsing. diff --git a/include/ZE_ZFont.h b/include/ZE_ZFont.h index 1ae234d..b236dc0 100644 --- a/include/ZE_ZFont.h +++ b/include/ZE_ZFont.h @@ -13,7 +13,7 @@ File: ZE_ZFont.h
Description: Header file for core ZEngine Font Object.
Author(s): James Turk
-$Id: ZE_ZFont.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
+$Id: ZE_ZFont.h,v 1.5 2003/02/10 04:07:04 cozman Exp $
\file ZE_ZFont.h \brief Definition file for ZFont. @@ -24,7 +24,7 @@ $Id: ZE_ZFont.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
#ifndef __ze_zfont_h__ #define __ze_zfont_h__ -#include "ZE_ZObject.h" +#include "ZE_ZEngine.h" #include "ZE_ZImage.h" #ifdef USE_SDL_TTF @@ -37,9 +37,11 @@ namespace ZE ZFont font container class, class wraps common features of SDL_TTF. Inherited from ZObject. **/ -class ZFont : public ZObject +class ZFont { protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; //! Pointer to font data. TTF_Font *rFont; //! Filename, for resizing. diff --git a/include/ZE_ZImage.h b/include/ZE_ZImage.h index d5e51f7..b2ee35c 100644 --- a/include/ZE_ZImage.h +++ b/include/ZE_ZImage.h @@ -13,7 +13,7 @@ File: ZE_ZImage.h
Description: Header file for core ZEngine Image and Texture Object.
Author(s): James Turk, Gamer Tazar
-$Id: ZE_ZImage.h,v 1.11 2003/01/25 19:56:05 cozman Exp $
+$Id: ZE_ZImage.h,v 1.12 2003/02/10 04:07:05 cozman Exp $
\file ZE_ZImage.h \brief Definition file for ZImage. @@ -24,7 +24,7 @@ $Id: ZE_ZImage.h,v 1.11 2003/01/25 19:56:05 cozman Exp $
#ifndef __ze_zimage_h__ #define __ze_zimage_h__ -#include "ZE_ZObject.h" +#include "ZE_ZEngine.h" namespace ZE { @@ -34,9 +34,11 @@ namespace ZE ZImage image drawing class, class wraps common features of SDL_Surface. Inherited from ZObject. **/ -class ZImage : public ZObject +class ZImage { protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; //! Texture lower X, used internally for flip. GLfloat rTexMinX; //! Texture lower Y, used internally for flip diff --git a/include/ZE_ZMusic.h b/include/ZE_ZMusic.h index f701292..aa7527e 100644 --- a/include/ZE_ZMusic.h +++ b/include/ZE_ZMusic.h @@ -13,7 +13,7 @@ File: ZE_ZMusic.h
Description: Header file for core ZEngine Music Wrapper Object.
Author(s): James Turk
-$Id: ZE_ZMusic.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
+$Id: ZE_ZMusic.h,v 1.5 2003/02/10 04:07:05 cozman Exp $
\file ZE_ZMusic.h \brief Definition file for ZMusic. @@ -24,7 +24,7 @@ $Id: ZE_ZMusic.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
#ifndef __ze_zmusic_h__ #define __ze_zmusic_h__ -#include "ZE_ZObject.h" +#include "ZE_ZEngine.h" #ifdef USE_SDL_MIXER @@ -36,9 +36,11 @@ namespace ZE ZMusic music class, class wraps common features for SDL_Mixer's Mix_Music. Inherited from ZObject. **/ -class ZMusic : public ZObject +class ZMusic { protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; //! Pointer to music data. Mix_Music *rMusic; diff --git a/include/ZE_ZRect.h b/include/ZE_ZRect.h index 7322638..eab6c9e 100644 --- a/include/ZE_ZRect.h +++ b/include/ZE_ZRect.h @@ -13,7 +13,7 @@ File: ZE_ZRect.h
Description: Header file for core ZEngine Rectangle Object.
Author(s): James Turk
-$Id: ZE_ZRect.h,v 1.5 2003/01/16 05:46:39 cozman Exp $
+$Id: ZE_ZRect.h,v 1.6 2003/02/10 04:07:05 cozman Exp $
\file ZE_ZRect.h \brief Definition file for ZRect. @@ -24,7 +24,7 @@ $Id: ZE_ZRect.h,v 1.5 2003/01/16 05:46:39 cozman Exp $
#ifndef __ze_zrect_h__ #define __ze_zrect_h__ -#include "ZE_ZObject.h" //included even though ZRect isn't derived (to obtain all other needed headers) +#include "ZE_ZEngine.h" namespace ZE { diff --git a/include/ZE_ZSound.h b/include/ZE_ZSound.h index bf8e2ab..240e1ab 100644 --- a/include/ZE_ZSound.h +++ b/include/ZE_ZSound.h @@ -13,7 +13,7 @@ File: ZE_ZSound.h
Description: Header file for core ZEngine Sound Wrapper Object.
Author(s): James Turk
-$Id: ZE_ZSound.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
+$Id: ZE_ZSound.h,v 1.5 2003/02/10 04:07:05 cozman Exp $
\file ZE_ZSound.h \brief Definition file for ZSound. @@ -24,7 +24,7 @@ $Id: ZE_ZSound.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
#ifndef __ze_zsound_h__ #define __ze_zsound_h__ -#include "ZE_ZObject.h" +#include "ZE_ZEngine.h" #ifdef USE_SDL_MIXER @@ -36,9 +36,11 @@ namespace ZE ZSound music class, class wraps common features for SDL_Mixer's Mix_Chunk. Inherited from ZObject. **/ -class ZSound : public ZObject +class ZSound { protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; //! Pointer to music data. Mix_Chunk* rSound; //! Channel ID Number from SDL_Mixer. diff --git a/include/ZE_ZTimer.h b/include/ZE_ZTimer.h index f212ecd..bff6363 100644 --- a/include/ZE_ZTimer.h +++ b/include/ZE_ZTimer.h @@ -13,7 +13,7 @@ File: ZE_ZTimer.h
Description: Header file for core ZEngine Timer Object.
Author(s): James Turk
-$Id: ZE_ZTimer.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
+$Id: ZE_ZTimer.h,v 1.5 2003/02/10 04:07:05 cozman Exp $
\file ZE_ZTimer.h \brief Definition file for ZTimer. @@ -24,7 +24,7 @@ $Id: ZE_ZTimer.h,v 1.4 2003/01/16 05:46:39 cozman Exp $
#ifndef __ze_ztimer_h__ #define __ze_ztimer_h__ -#include "ZE_ZObject.h" +#include "ZE_ZEngine.h" namespace ZE { @@ -34,9 +34,11 @@ namespace ZE ZTimer timing class, class wraps common features of SDL timer. Inherited from ZObject and tied to ZEngine main timer. **/ -class ZTimer : public ZObject +class ZTimer { protected: + //! Pointer to ZEngine Object + ZEngine* rEngine; //! Paused / Unpaused state of Timer bool rPaused; //! Using ZEngine timer or SDL global timer. diff --git a/src/ZE_ZConfigFile.cpp b/src/ZE_ZConfigFile.cpp index ead6791..ae33396 100644 --- a/src/ZE_ZConfigFile.cpp +++ b/src/ZE_ZConfigFile.cpp @@ -13,7 +13,7 @@ File: ZE_ZConfigFile.cpp
Description: Implementation source file for ZConfigFile, the ZEngine INI-Style Config File.
Author(s): James Turk
-$Id: ZE_ZConfigFile.cpp,v 1.5 2003/02/10 03:04:46 cozman Exp $
+$Id: ZE_ZConfigFile.cpp,v 1.6 2003/02/10 04:02:38 cozman Exp $
\file ZE_ZConfigFile.cpp \brief Source file for ZConfigFile. @@ -52,7 +52,7 @@ bool ZConfigFile::Exists(string sec) const sec = CleanString(sec); - for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) { if(CleanString((*secIter).section) == sec) return true; @@ -68,7 +68,7 @@ bool ZConfigFile::Exists(string sec, string var) const sec = CleanString(sec); var = CleanString(var); - for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) { if(CleanString((*secIter).section) == sec) { @@ -90,7 +90,7 @@ void ZConfigFile::SetVariable(string sec, string var, string val) if(Exists(CleanString(sec))) { sec = CleanString(sec); - for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) { if(CleanString((*secIter).section) == sec) //if this is the section { @@ -121,7 +121,7 @@ void ZConfigFile::SetVariable(string sec, string var, string val) { ZCF_Section tempSec; tempSec.section = sec; - mFileLayout.push_back(tempSec); + rFileLayout.push_back(tempSec); SetVariable(sec,var,val); } } @@ -136,7 +136,7 @@ string ZConfigFile::GetVariable(string sec, string var, string defVal) const if(Exists(sec)) { - for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) { if(CleanString((*secIter).section) == sec) //if this is the section { @@ -163,9 +163,9 @@ string ZConfigFile::GetVariable(string sec, string var, string defVal) const ZConfigFile::ZConfigFile() {} -ZConfigFile::ZConfigFile(string mFilename) +ZConfigFile::ZConfigFile(string rFilename) { - Process(mFilename); + Process(rFilename); } ZConfigFile::~ZConfigFile() @@ -175,12 +175,12 @@ ZConfigFile::~ZConfigFile() void ZConfigFile::Process(string filename) { - mFilename = filename; + rFilename = filename; - ifstream cfile(mFilename.c_str()); + ifstream cfile(rFilename.c_str()); string section, str, var, tmp; - mFileLayout.clear(); + rFileLayout.clear(); while(!cfile.eof() && cfile.is_open()) { @@ -317,14 +317,14 @@ void ZConfigFile::Flush() string secName; //in case the filename is already cleared somehow - if(mFilename.length()) + if(rFilename.length()) { - ofstream cfile(mFilename.c_str(), ios::out|ios::trunc); + ofstream cfile(rFilename.c_str(), ios::out|ios::trunc); if(cfile) { //iteration through sections - for(secIter = mFileLayout.begin(); secIter != mFileLayout.end(); secIter++) + for(secIter = rFileLayout.begin(); secIter != rFileLayout.end(); secIter++) { //ensure that section is valid secName = CleanString((*secIter).section); @@ -348,7 +348,7 @@ void ZConfigFile::Flush() void ZConfigFile::Close() { Flush(); - mFilename = ""; + rFilename = ""; } } diff --git a/src/ZE_ZFont.cpp b/src/ZE_ZFont.cpp index ca740e1..5b8d036 100644 --- a/src/ZE_ZFont.cpp +++ b/src/ZE_ZFont.cpp @@ -13,7 +13,7 @@ File: ZE_ZFont.cpp
Description: Implementation source file for core ZEngine Font Object.
Author(s): James Turk
-$Id: ZE_ZFont.cpp,v 1.5 2003/01/16 05:45:58 cozman Exp $
+$Id: ZE_ZFont.cpp,v 1.6 2003/02/10 04:02:38 cozman Exp $
\file ZE_ZFont.cpp \brief Source file for ZFont. @@ -28,9 +28,9 @@ $Id: ZE_ZFont.cpp,v 1.5 2003/01/16 05:45:58 cozman Exp $
namespace ZE { - ZFont::ZFont() { + rEngine = ZEngine::GetInstance(); rFont = NULL; rColor.r = rColor.g = rColor.b = rColor.unused = 255; rBGColor.r = rBGColor.g = rBGColor.b = rBGColor.unused = 0; @@ -38,6 +38,7 @@ ZFont::ZFont() ZFont::ZFont(string filename, int size) { + rEngine = ZEngine::GetInstance(); rFont = NULL; rColor.r = rColor.g = rColor.b = rColor.unused = 255; rBGColor.r = rBGColor.g = rBGColor.b = rBGColor.unused = 0; diff --git a/src/ZE_ZImage.cpp b/src/ZE_ZImage.cpp index 578e60d..9bc0aa5 100644 --- a/src/ZE_ZImage.cpp +++ b/src/ZE_ZImage.cpp @@ -13,7 +13,7 @@ File: ZE_ZImage.cpp
Description: Implementation source file for core ZEngine Image or Texture Object.
Author(s): James Turk, Gamer Tazar
-$Id: ZE_ZImage.cpp,v 1.23 2003/02/10 02:40:35 cozman Exp $
+$Id: ZE_ZImage.cpp,v 1.24 2003/02/10 04:02:38 cozman Exp $
\file ZE_ZImage.cpp \brief Source file for ZImage. @@ -28,14 +28,15 @@ namespace ZE ZImage::ZImage() { + rEngine = ZEngine::GetInstance(); rImage = NULL; rAlpha = 255; Release(); } -ZImage::ZImage(const ZImage &rhs) : - ZObject() +ZImage::ZImage(const ZImage &rhs) { + rEngine = ZEngine::GetInstance(); rImage = NULL; rAlpha = rhs.Alpha(); OpenFromImage(rhs.Surface(),0,0,(Sint16)rhs.Width(),(Sint16)rhs.Height()); @@ -43,6 +44,7 @@ ZImage::ZImage(const ZImage &rhs) : ZImage::ZImage(string filename) { + rEngine = ZEngine::GetInstance(); rImage = NULL; rAlpha = 255; Open(filename); @@ -50,6 +52,7 @@ ZImage::ZImage(string filename) ZImage::ZImage(SDL_Surface *surface) { + rEngine = ZEngine::GetInstance(); rImage = NULL; rAlpha = 255; Attach(surface); @@ -57,6 +60,7 @@ ZImage::ZImage(SDL_Surface *surface) ZImage::ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) { + rEngine = ZEngine::GetInstance(); rImage = NULL; rAlpha = 255; OpenFromImage(img,x,y,w,h); diff --git a/src/ZE_ZMusic.cpp b/src/ZE_ZMusic.cpp index d92aed2..7a898f3 100644 --- a/src/ZE_ZMusic.cpp +++ b/src/ZE_ZMusic.cpp @@ -13,7 +13,7 @@ File: ZE_ZMusic.cpp
Description: Implementation source file for core ZEngine Music Object.
Author(s): James Turk
-$Id: ZE_ZMusic.cpp,v 1.5 2003/01/16 05:45:58 cozman Exp $
+$Id: ZE_ZMusic.cpp,v 1.6 2003/02/10 04:02:38 cozman Exp $
\file ZE_ZMusic.cpp \brief Source file for ZMusic. @@ -32,11 +32,13 @@ const int ZMusic::LoopInfinite = -1; ZMusic::ZMusic() { + rEngine = ZEngine::GetInstance(); rMusic = NULL; } ZMusic::ZMusic(string filename) { + rEngine = ZEngine::GetInstance(); rMusic = NULL; Open(filename); } diff --git a/src/ZE_ZSound.cpp b/src/ZE_ZSound.cpp index 2968b52..b6e1e08 100644 --- a/src/ZE_ZSound.cpp +++ b/src/ZE_ZSound.cpp @@ -13,7 +13,7 @@ File: ZE_ZSound.cpp
Description: Implementation source file for core ZEngine Sound Object.
Author(s): James Turk
-$Id: ZE_ZSound.cpp,v 1.5 2003/01/16 05:45:58 cozman Exp $
+$Id: ZE_ZSound.cpp,v 1.6 2003/02/10 04:02:39 cozman Exp $
\file ZE_ZSound.cpp \brief Source file for ZSound. @@ -32,12 +32,14 @@ const int ZSound::LoopInfinite = -1; ZSound::ZSound() { + rEngine = ZEngine::GetInstance(); rSound = NULL; rChannelID = -1; //request channel ID } ZSound::ZSound(string filename) { + rEngine = ZEngine::GetInstance(); rSound = NULL; rChannelID = -1; //request channel ID Open(filename); diff --git a/src/ZE_ZTimer.cpp b/src/ZE_ZTimer.cpp index d1e36d1..056ad69 100644 --- a/src/ZE_ZTimer.cpp +++ b/src/ZE_ZTimer.cpp @@ -13,7 +13,7 @@ File: ZE_ZTimer.cpp
Description: Implementation source file for core ZEngine Timer Object.
Author(s): James Turk
-$Id: ZE_ZTimer.cpp,v 1.4 2003/01/16 05:45:58 cozman Exp $
+$Id: ZE_ZTimer.cpp,v 1.5 2003/02/10 04:02:39 cozman Exp $
\file ZE_ZTimer.cpp \brief Source file for ZTimer. @@ -36,6 +36,7 @@ Uint32 ZTimer::GetParentTime() const ZTimer::ZTimer(bool useZEngine) { + rEngine = ZEngine::GetInstance(); rUseZEngine = useZEngine; rPaused = false; Reset();