g++ fixes
This commit is contained in:
parent
454dda1a02
commit
5c4b2c0ea9
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
Definition file for VersinInfo class, simple class for containing and comparing
|
Definition file for VersinInfo class, simple class for containing and comparing
|
||||||
version numbers.
|
version numbers.
|
||||||
<br>$Id: VersionInfo.h,v 1.3 2003/06/11 00:15:24 cozman Exp $<br>
|
<br>$Id: VersionInfo.h,v 1.4 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -26,19 +26,20 @@
|
|||||||
/*!
|
/*!
|
||||||
\brief Class for holding version information.
|
\brief Class for holding version information.
|
||||||
|
|
||||||
Class for holding version information on a library.
|
Class for holding version information on a library. (Members capitalized because
|
||||||
|
g++ has issues with members named major and minor.)
|
||||||
**/
|
**/
|
||||||
class VersionInfo
|
class VersionInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Major version number.
|
//! Major version number.
|
||||||
unsigned int major;
|
unsigned int Major;
|
||||||
//! Minor version number, changes upon signifigant releases. (Often upon compatibility breaks.)
|
//! Minor version number, changes upon signifigant releases. (Often upon compatibility breaks.)
|
||||||
unsigned int minor;
|
unsigned int Minor;
|
||||||
//! Version release number, changes on every release.
|
//! Version release number, changes on every release.
|
||||||
unsigned int release;
|
unsigned int Release;
|
||||||
//! String Description of release. (Often blank.)
|
//! String Description of release. (Often blank.)
|
||||||
std::string extra;
|
std::string Extra;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Constructor for VersionInfo.
|
\brief Constructor for VersionInfo.
|
||||||
|
@ -48,5 +48,6 @@
|
|||||||
#include <list> //used by ZConfigFile
|
#include <list> //used by ZConfigFile
|
||||||
#include <fstream> //used by ZConfigFile
|
#include <fstream> //used by ZConfigFile
|
||||||
#include <cctype> //used in parsing
|
#include <cctype> //used in parsing
|
||||||
|
#include <cstdarg> //used in FormatStr
|
||||||
|
|
||||||
#endif //__ze_includes_h__
|
#endif //__ze_includes_h__
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
Definition and implementation file for ZEngine particle system class ZBaseParticleSystem.
|
Definition and implementation file for ZEngine particle system class ZBaseParticleSystem.
|
||||||
Due to problems with template classes the template implementation needs to be in the same file as the declaration.
|
Due to problems with template classes the template implementation needs to be in the same file as the declaration.
|
||||||
<br>$Id: ZE_ZBaseParticleSystem.h,v 1.4 2003/07/11 20:51:44 cozman Exp $<br>
|
<br>$Id: ZE_ZBaseParticleSystem.h,v 1.5 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class ZBaseParticleSystem
|
|||||||
When this resizes the array contents are moved to the new array, if it shrinks the array particles may be lost.
|
When this resizes the array contents are moved to the new array, if it shrinks the array particles may be lost.
|
||||||
\param max Maximum number of particles for system.
|
\param max Maximum number of particles for system.
|
||||||
**/
|
**/
|
||||||
void SetMaxParticles(int max);
|
void SetMaxParticles(unsigned int max);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets release rate of particles.
|
\brief Sets release rate of particles.
|
||||||
@ -191,7 +191,7 @@ class ZBaseParticleSystem
|
|||||||
Set number of particles to release per second.
|
Set number of particles to release per second.
|
||||||
\param rate Number of particles to release over the duration of one second.
|
\param rate Number of particles to release over the duration of one second.
|
||||||
**/
|
**/
|
||||||
void SetRate(int rate);
|
void SetRate(unsigned int rate);
|
||||||
};
|
};
|
||||||
|
|
||||||
//implementation//
|
//implementation//
|
||||||
@ -298,7 +298,7 @@ bool ZBaseParticleSystem<particleType>::Paused()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class particleType>
|
template <class particleType>
|
||||||
void ZBaseParticleSystem<particleType>::SetMaxParticles(int max)
|
void ZBaseParticleSystem<particleType>::SetMaxParticles(unsigned int max)
|
||||||
{
|
{
|
||||||
particleType *temp;
|
particleType *temp;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -341,7 +341,7 @@ void ZBaseParticleSystem<particleType>::SetMaxParticles(int max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class particleType>
|
template <class particleType>
|
||||||
void ZBaseParticleSystem<particleType>::SetRate(int rate)
|
void ZBaseParticleSystem<particleType>::SetRate(unsigned int rate)
|
||||||
{
|
{
|
||||||
rNumParticlesPerSec = rate;
|
rNumParticlesPerSec = rate;
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,10 @@
|
|||||||
\brief Definition file for core ZEngine class.
|
\brief Definition file for core ZEngine class.
|
||||||
|
|
||||||
ZEngine Game Engine core Engine definition.
|
ZEngine Game Engine core Engine definition.
|
||||||
<br>$Id: ZE_ZEngine.h,v 1.43 2003/07/11 20:51:44 cozman Exp $<br>
|
<br>$Id: ZE_ZEngine.h,v 1.44 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//revision on this is so high.. can this be lowered?
|
|
||||||
|
|
||||||
#ifndef __ze_zengine_h__
|
#ifndef __ze_zengine_h__
|
||||||
#define __ze_zengine_h__
|
#define __ze_zengine_h__
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
should suffice unless you want objects to have their ownrandom streams. This
|
should suffice unless you want objects to have their ownrandom streams. This
|
||||||
implementation is derived from the original mt19937ar.c source from
|
implementation is derived from the original mt19937ar.c source from
|
||||||
http://www.math.keio.ac.jp/matumoto/emt.html. See source of ZE_ZRandGen.cpp for license.
|
http://www.math.keio.ac.jp/matumoto/emt.html. See source of ZE_ZRandGen.cpp for license.
|
||||||
<br>$Id: ZE_ZRandGen.h,v 1.1 2003/07/05 01:05:47 cozman Exp $<br>
|
<br>$Id: ZE_ZRandGen.h,v 1.2 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class ZRandGen
|
|||||||
//! Each instance of the algorithm requires a state vector.
|
//! Each instance of the algorithm requires a state vector.
|
||||||
unsigned long rStateVector[N];
|
unsigned long rStateVector[N];
|
||||||
//! Used internally to traversing the rStateVector.
|
//! Used internally to traversing the rStateVector.
|
||||||
int rStateVectorIndex;
|
unsigned long rStateVectorIndex;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Workhorse of random generator, only used internally.
|
\brief Workhorse of random generator, only used internally.
|
||||||
@ -160,3 +160,4 @@ class ZRandGen
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif //__ze_zrandgen_h__
|
#endif //__ze_zrandgen_h__
|
||||||
|
|
||||||
|
@ -6,40 +6,40 @@
|
|||||||
|
|
||||||
Implementation file for VersinInfo class, simple class for containing and comparing
|
Implementation file for VersinInfo class, simple class for containing and comparing
|
||||||
version numbers.
|
version numbers.
|
||||||
<br>$Id: VersionInfo.cpp,v 1.4 2003/06/11 05:51:15 cozman Exp $<br>
|
<br>$Id: VersionInfo.cpp,v 1.5 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
VersionInfo::VersionInfo(unsigned int maj, unsigned int min, unsigned int rel, std::string ext) :
|
VersionInfo::VersionInfo(unsigned int maj, unsigned int min, unsigned int rel, std::string ext) :
|
||||||
major(maj), minor(min), release(rel), extra(ext)
|
Major(maj), Minor(min), Release(rel), Extra(ext)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string VersionInfo::GetString() const
|
std::string VersionInfo::GetString() const
|
||||||
{
|
{
|
||||||
if(extra.length())
|
if(Extra.length())
|
||||||
return ZE::FormatStr("%d.%d.%d [%s]",major,minor,release,extra.c_str());
|
return ZE::FormatStr("%d.%d.%d [%s]",Major,Minor,Release,Extra.c_str());
|
||||||
else
|
else
|
||||||
return ZE::FormatStr("%d.%d.%d",major,minor,release);
|
return ZE::FormatStr("%d.%d.%d",Major,Minor,Release);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VersionInfo::operator<(const VersionInfo &rhs) const
|
bool VersionInfo::operator<(const VersionInfo &rhs) const
|
||||||
{
|
{
|
||||||
//chained compares, compare numbers in order of importance
|
//chained compares, compare numbers in order of importance
|
||||||
if(this->major < rhs.major)
|
if(this->Major < rhs.Major)
|
||||||
return true;
|
return true;
|
||||||
else if(this->major == rhs.major)
|
else if(this->Major == rhs.Major)
|
||||||
{
|
{
|
||||||
if(this->minor < rhs.minor)
|
if(this->Minor < rhs.Minor)
|
||||||
return true;
|
return true;
|
||||||
else if(this->minor == rhs.minor)
|
else if(this->Minor == rhs.Minor)
|
||||||
{
|
{
|
||||||
if(this->release < rhs.release)
|
if(this->Release < rhs.Release)
|
||||||
return true;
|
return true;
|
||||||
else if(this->release == rhs.release)
|
else if(this->Release == rhs.Release)
|
||||||
{
|
{
|
||||||
return this->extra < rhs.extra; //just compare the strings at the end
|
return this->Extra < rhs.Extra; //just compare the strings at the end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
\brief Source file for ZEngine utility functions.
|
\brief Source file for ZEngine utility functions.
|
||||||
|
|
||||||
Source file containing open utilities for use inside and alongside ZEngine.
|
Source file containing open utilities for use inside and alongside ZEngine.
|
||||||
<br>$Id: ZE_Utility.cpp,v 1.9 2003/06/11 05:51:15 cozman Exp $<br>
|
<br>$Id: ZE_Utility.cpp,v 1.10 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
\brief Central source file for ZEngine.
|
\brief Central source file for ZEngine.
|
||||||
|
|
||||||
Actual implementation of ZEngine singleton class, the core of ZEngine.
|
Actual implementation of ZEngine singleton class, the core of ZEngine.
|
||||||
<br>$Id: ZE_ZEngine.cpp,v 1.51 2003/07/11 20:51:44 cozman Exp $<br>
|
<br>$Id: ZE_ZEngine.cpp,v 1.52 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -26,17 +26,17 @@ VersionInfo ZEngine::Version(0,8,4);
|
|||||||
ZEngine *ZEngine::sInstance=NULL;
|
ZEngine *ZEngine::sInstance=NULL;
|
||||||
|
|
||||||
ZEngine::ZEngine() :
|
ZEngine::ZEngine() :
|
||||||
mInitialized(false), mWidth(800), mHeight(600), mBPP(-1), mFullscreen(true),
|
mWidth(800), mHeight(600), mBPP(-1), mFullscreen(true), mInitialized(false),
|
||||||
#ifdef USE_SDL_MIXER
|
mScreen(NULL),
|
||||||
mRate(22050), mStereo(false),
|
mPaused(false), mUnpauseOnActive(false),
|
||||||
#endif
|
|
||||||
mNeedReload(false),mScreen(NULL),
|
|
||||||
mEventFilter(NULL), mActive(false), mQuit(false), mKeyIsPressed(NULL),
|
|
||||||
mMouseX(0), mMouseY(0), mMouseB(0),
|
|
||||||
mUnpauseOnActive(false), mPaused(false),
|
|
||||||
mDesiredFramerate(0), mNextUpdate(0), mLastPause(0), mPausedTime(0), mLastTime(0),
|
mDesiredFramerate(0), mNextUpdate(0), mLastPause(0), mPausedTime(0), mLastTime(0),
|
||||||
mSecPerFrame(0.0),
|
mSecPerFrame(0.0),
|
||||||
mLogAllErrors(true), mErrlog(stderr)
|
mNeedReload(false), mActive(false), mQuit(false), mKeyIsPressed(NULL),
|
||||||
|
mMouseX(0), mMouseY(0), mMouseB(0),
|
||||||
|
mLogAllErrors(true), mErrlog(stderr), mEventFilter(NULL)
|
||||||
|
#ifdef USE_SDL_MIXER
|
||||||
|
, mRate(22050), mStereo(false)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
for(int k = 0; k < SDLK_LAST; ++k)
|
for(int k = 0; k < SDLK_LAST; ++k)
|
||||||
mKeyPress[k] = false;
|
mKeyPress[k] = false;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
Implementation file for ZRandGen, an OO encapsulated version of the Mersenne Twister.
|
Implementation file for ZRandGen, an OO encapsulated version of the Mersenne Twister.
|
||||||
This implementation is derived from the original mt19937ar.c source from
|
This implementation is derived from the original mt19937ar.c source from
|
||||||
http://www.math.keio.ac.jp/matumoto/emt.html. See source for MT license.
|
http://www.math.keio.ac.jp/matumoto/emt.html. See source for MT license.
|
||||||
<br>$Id: ZE_ZRandGen.cpp,v 1.1 2003/07/05 00:58:08 cozman Exp $<br>
|
<br>$Id: ZE_ZRandGen.cpp,v 1.2 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk, some code from Mersenne Twister.
|
\author James Turk, some code from Mersenne Twister.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ unsigned long ZRandGen::genrand_int32()
|
|||||||
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
||||||
|
|
||||||
if (rStateVectorIndex >= N) { /* generate N words at one time */
|
if (rStateVectorIndex >= N) { /* generate N words at one time */
|
||||||
int kk;
|
unsigned int kk;
|
||||||
|
|
||||||
//removed uninitialized check, class initializes in constructor
|
//removed uninitialized check, class initializes in constructor
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
\brief Source file for ZTimer.
|
\brief Source file for ZTimer.
|
||||||
|
|
||||||
Implementation of ZTimer, the basic Timer class for ZEngine.
|
Implementation of ZTimer, the basic Timer class for ZEngine.
|
||||||
<br>$Id: ZE_ZTimer.cpp,v 1.9 2003/06/11 05:51:16 cozman Exp $<br>
|
<br>$Id: ZE_ZTimer.cpp,v 1.10 2003/07/12 01:25:42 cozman Exp $<br>
|
||||||
\author James Turk
|
\author James Turk
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -32,10 +32,9 @@ Uint32 ZTimer::GetParentTime() const
|
|||||||
|
|
||||||
ZTimer::ZTimer(bool useZEngine) :
|
ZTimer::ZTimer(bool useZEngine) :
|
||||||
rEngine(ZEngine::GetInstance()),
|
rEngine(ZEngine::GetInstance()),
|
||||||
rUseZEngine(useZEngine),
|
rUseZEngine(useZEngine)
|
||||||
rPaused(false)
|
|
||||||
{
|
{
|
||||||
Reset();
|
Reset(); //initializes other members
|
||||||
}
|
}
|
||||||
|
|
||||||
ZTimer::~ZTimer()
|
ZTimer::~ZTimer()
|
||||||
|
@ -9,7 +9,7 @@ This example file is in the public domain, it may be used with no restrictions.
|
|||||||
and the home of this Library is http://www.zengine.sourceforge.net
|
and the home of this Library is http://www.zengine.sourceforge.net
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*$Id: ZTimerTest.cpp,v 1.14 2003/07/10 20:45:39 cozman Exp $*/
|
/*$Id: ZTimerTest.cpp,v 1.15 2003/07/12 01:25:42 cozman Exp $*/
|
||||||
|
|
||||||
#include <ZEngine.h>
|
#include <ZEngine.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -45,7 +45,7 @@ void Test()
|
|||||||
|
|
||||||
//Open and Setup Font and Create Images and Timers//
|
//Open and Setup Font and Create Images and Timers//
|
||||||
ZImage text[5];
|
ZImage text[5];
|
||||||
ZFont font("data/almontew.ttf",48);
|
ZFont font("data/almontew.ttf",24);
|
||||||
ZTimer TimerOne, TimerTwo(false); //Timer Two is on the SDL Timer.
|
ZTimer TimerOne, TimerTwo(false); //Timer Two is on the SDL Timer.
|
||||||
|
|
||||||
//do this only once//
|
//do this only once//
|
||||||
@ -109,7 +109,7 @@ void Test()
|
|||||||
engine->Clear(); //clear screen
|
engine->Clear(); //clear screen
|
||||||
|
|
||||||
for(int i=0; i <= 4; i++)
|
for(int i=0; i <= 4; i++)
|
||||||
text[i].Draw(0,i*50);
|
text[i].Draw(0,i*30);
|
||||||
|
|
||||||
engine->Update(); //update the screen
|
engine->Update(); //update the screen
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user