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
|
||||
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
|
||||
**/
|
||||
|
||||
@ -26,19 +26,20 @@
|
||||
/*!
|
||||
\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
|
||||
{
|
||||
public:
|
||||
//! Major version number.
|
||||
unsigned int major;
|
||||
unsigned int Major;
|
||||
//! Minor version number, changes upon signifigant releases. (Often upon compatibility breaks.)
|
||||
unsigned int minor;
|
||||
unsigned int Minor;
|
||||
//! Version release number, changes on every release.
|
||||
unsigned int release;
|
||||
unsigned int Release;
|
||||
//! String Description of release. (Often blank.)
|
||||
std::string extra;
|
||||
std::string Extra;
|
||||
|
||||
/*!
|
||||
\brief Constructor for VersionInfo.
|
||||
|
@ -48,5 +48,6 @@
|
||||
#include <list> //used by ZConfigFile
|
||||
#include <fstream> //used by ZConfigFile
|
||||
#include <cctype> //used in parsing
|
||||
#include <cstdarg> //used in FormatStr
|
||||
|
||||
#endif //__ze_includes_h__
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
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.
|
||||
<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
|
||||
**/
|
||||
|
||||
@ -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.
|
||||
\param max Maximum number of particles for system.
|
||||
**/
|
||||
void SetMaxParticles(int max);
|
||||
void SetMaxParticles(unsigned int max);
|
||||
|
||||
/*!
|
||||
\brief Sets release rate of particles.
|
||||
@ -191,7 +191,7 @@ class ZBaseParticleSystem
|
||||
Set number of particles to release per second.
|
||||
\param rate Number of particles to release over the duration of one second.
|
||||
**/
|
||||
void SetRate(int rate);
|
||||
void SetRate(unsigned int rate);
|
||||
};
|
||||
|
||||
//implementation//
|
||||
@ -298,7 +298,7 @@ bool ZBaseParticleSystem<particleType>::Paused()
|
||||
}
|
||||
|
||||
template <class particleType>
|
||||
void ZBaseParticleSystem<particleType>::SetMaxParticles(int max)
|
||||
void ZBaseParticleSystem<particleType>::SetMaxParticles(unsigned int max)
|
||||
{
|
||||
particleType *temp;
|
||||
unsigned int i;
|
||||
@ -341,7 +341,7 @@ void ZBaseParticleSystem<particleType>::SetMaxParticles(int max)
|
||||
}
|
||||
|
||||
template <class particleType>
|
||||
void ZBaseParticleSystem<particleType>::SetRate(int rate)
|
||||
void ZBaseParticleSystem<particleType>::SetRate(unsigned int rate)
|
||||
{
|
||||
rNumParticlesPerSec = rate;
|
||||
}
|
||||
|
@ -13,12 +13,10 @@
|
||||
\brief Definition file for core ZEngine class.
|
||||
|
||||
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
|
||||
**/
|
||||
|
||||
//revision on this is so high.. can this be lowered?
|
||||
|
||||
#ifndef __ze_zengine_h__
|
||||
#define __ze_zengine_h__
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
should suffice unless you want objects to have their ownrandom streams. This
|
||||
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.
|
||||
<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
|
||||
**/
|
||||
|
||||
@ -56,7 +56,7 @@ class ZRandGen
|
||||
//! Each instance of the algorithm requires a state vector.
|
||||
unsigned long rStateVector[N];
|
||||
//! Used internally to traversing the rStateVector.
|
||||
int rStateVectorIndex;
|
||||
unsigned long rStateVectorIndex;
|
||||
|
||||
/*!
|
||||
\brief Workhorse of random generator, only used internally.
|
||||
@ -160,3 +160,4 @@ class ZRandGen
|
||||
}
|
||||
|
||||
#endif //__ze_zrandgen_h__
|
||||
|
||||
|
@ -6,40 +6,40 @@
|
||||
|
||||
Implementation file for VersinInfo class, simple class for containing and comparing
|
||||
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
|
||||
**/
|
||||
|
||||
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
|
||||
{
|
||||
if(extra.length())
|
||||
return ZE::FormatStr("%d.%d.%d [%s]",major,minor,release,extra.c_str());
|
||||
if(Extra.length())
|
||||
return ZE::FormatStr("%d.%d.%d [%s]",Major,Minor,Release,Extra.c_str());
|
||||
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
|
||||
{
|
||||
//chained compares, compare numbers in order of importance
|
||||
if(this->major < rhs.major)
|
||||
if(this->Major < rhs.Major)
|
||||
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;
|
||||
else if(this->minor == rhs.minor)
|
||||
else if(this->Minor == rhs.Minor)
|
||||
{
|
||||
if(this->release < rhs.release)
|
||||
if(this->Release < rhs.Release)
|
||||
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.
|
||||
|
||||
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
|
||||
**/
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
\brief Central source file for 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
|
||||
**/
|
||||
|
||||
@ -26,17 +26,17 @@ VersionInfo ZEngine::Version(0,8,4);
|
||||
ZEngine *ZEngine::sInstance=NULL;
|
||||
|
||||
ZEngine::ZEngine() :
|
||||
mInitialized(false), mWidth(800), mHeight(600), mBPP(-1), mFullscreen(true),
|
||||
#ifdef USE_SDL_MIXER
|
||||
mRate(22050), mStereo(false),
|
||||
#endif
|
||||
mNeedReload(false),mScreen(NULL),
|
||||
mEventFilter(NULL), mActive(false), mQuit(false), mKeyIsPressed(NULL),
|
||||
mMouseX(0), mMouseY(0), mMouseB(0),
|
||||
mUnpauseOnActive(false), mPaused(false),
|
||||
mWidth(800), mHeight(600), mBPP(-1), mFullscreen(true), mInitialized(false),
|
||||
mScreen(NULL),
|
||||
mPaused(false), mUnpauseOnActive(false),
|
||||
mDesiredFramerate(0), mNextUpdate(0), mLastPause(0), mPausedTime(0), mLastTime(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)
|
||||
mKeyPress[k] = false;
|
||||
|
@ -15,7 +15,7 @@
|
||||
Implementation file for ZRandGen, an OO encapsulated version of the Mersenne Twister.
|
||||
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.
|
||||
<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.
|
||||
**/
|
||||
|
||||
@ -81,7 +81,7 @@ unsigned long ZRandGen::genrand_int32()
|
||||
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
||||
|
||||
if (rStateVectorIndex >= N) { /* generate N words at one time */
|
||||
int kk;
|
||||
unsigned int kk;
|
||||
|
||||
//removed uninitialized check, class initializes in constructor
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
\brief Source file for ZTimer.
|
||||
|
||||
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
|
||||
**/
|
||||
|
||||
@ -32,10 +32,9 @@ Uint32 ZTimer::GetParentTime() const
|
||||
|
||||
ZTimer::ZTimer(bool useZEngine) :
|
||||
rEngine(ZEngine::GetInstance()),
|
||||
rUseZEngine(useZEngine),
|
||||
rPaused(false)
|
||||
rUseZEngine(useZEngine)
|
||||
{
|
||||
Reset();
|
||||
Reset(); //initializes other members
|
||||
}
|
||||
|
||||
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
|
||||
*******************************************************************************/
|
||||
|
||||
/*$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 <string>
|
||||
@ -45,7 +45,7 @@ void Test()
|
||||
|
||||
//Open and Setup Font and Create Images and Timers//
|
||||
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.
|
||||
|
||||
//do this only once//
|
||||
@ -109,7 +109,7 @@ void Test()
|
||||
engine->Clear(); //clear screen
|
||||
|
||||
for(int i=0; i <= 4; i++)
|
||||
text[i].Draw(0,i*50);
|
||||
text[i].Draw(0,i*30);
|
||||
|
||||
engine->Update(); //update the screen
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user