diff --git a/include/ZE_ZEngine.h b/include/ZE_ZEngine.h
index fd1ccfc..77f8f6a 100644
--- a/include/ZE_ZEngine.h
+++ b/include/ZE_ZEngine.h
@@ -13,7 +13,7 @@
\brief Definition file for core ZEngine class.
ZEngine Game Engine core Engine definition.
-
$Id: ZE_ZEngine.h,v 1.55 2003/11/23 19:30:26 cozman Exp $
+
$Id: ZE_ZEngine.h,v 1.56 2003/12/14 22:36:09 cozman Exp $
\author James Turk
**/
@@ -86,8 +86,12 @@ class ZEngine
bool mPaused;
//! Keep track of if ZEngine should unpause on active event.
bool mUnpauseOnActive;
+
+#ifdef DEPRECIATED
//! Value framerate strives to be at, set by SetDesiredFramerate.
Uint8 mDesiredFramerate;
+#endif //DEPRECIATED
+
//! Time scheduled for next update (used for framerate locked movement).
Uint32 mNextUpdate;
//! Keep track of time game was last paused.
@@ -304,6 +308,7 @@ class ZEngine
**/
double GetFramerate();
+#ifdef DEPRECIATED
/*!
\brief Set Desired Framerate.
@@ -323,6 +328,7 @@ class ZEngine
\return Current setting for desired framerate.
**/
Uint8 GetDesiredFramerate();
+#endif //DEPRECIATED
/*!
\brief Check Engine Paused State.
diff --git a/src/ZE_ZEngine.cpp b/src/ZE_ZEngine.cpp
index 50cb926..d4ed030 100644
--- a/src/ZE_ZEngine.cpp
+++ b/src/ZE_ZEngine.cpp
@@ -13,7 +13,7 @@
\brief Central source file for ZEngine.
Actual implementation of ZEngine singleton class, the core of ZEngine.
-
$Id: ZE_ZEngine.cpp,v 1.65 2003/11/24 02:21:20 cozman Exp $
+
$Id: ZE_ZEngine.cpp,v 1.66 2003/12/14 22:36:50 cozman Exp $
\author James Turk
**/
@@ -29,7 +29,10 @@ ZEngine *ZEngine::sInstance=NULL;
ZEngine::ZEngine() :
mScreen(NULL), mFullscreen(true), mInitialized(false),
mPaused(false), mUnpauseOnActive(false),
- mDesiredFramerate(0), mNextUpdate(0), mLastPause(0), mPausedTime(0), mLastTime(0),
+#ifdef DEPRECIATED
+ mDesiredFramerate(0),
+#endif DEPRECIATED
+ mNextUpdate(0), mLastPause(0), mPausedTime(0), mLastTime(0),
mSecPerFrame(0.0),
mNeedReload(false), mActive(false), mQuit(false), mKeyIsPressed(NULL),
mMouseX(0), mMouseY(0), mMouseB(0),
@@ -281,6 +284,7 @@ void ZEngine::Update()
mSecPerFrame = (GetTime()-mLastTime)/1000.0;
mLastTime = GetTime();
+#ifdef DEPRECIATED
//framerate limiting//
if(mDesiredFramerate)
{
@@ -288,6 +292,7 @@ void ZEngine::Update()
SDL_Delay(mNextUpdate-mLastTime);
mNextUpdate = GetTime()+(1000/mDesiredFramerate);
}
+#endif //DEPRECIATED
}
#if (GFX_BACKEND == ZE_OGL)
@@ -377,6 +382,8 @@ double ZEngine::GetFramerate()
return mSecPerFrame ? 1/mSecPerFrame : 0; //avoid /0
}
+#ifdef DEPRECIATED
+
void ZEngine::SetDesiredFramerate(Uint8 rate)
{
mDesiredFramerate = rate;
@@ -387,6 +394,8 @@ Uint8 ZEngine::GetDesiredFramerate()
return mDesiredFramerate;
}
+#endif //DEPRECIATED
+
bool ZEngine::IsPaused()
{
return mPaused;
diff --git a/test/ZFontTest.cpp b/test/ZFontTest.cpp
index 53cad2d..bc3ff05 100644
--- a/test/ZFontTest.cpp
+++ b/test/ZFontTest.cpp
@@ -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: ZFontTest.cpp,v 1.18 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZFontTest.cpp,v 1.19 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZFontTest","bpp",32);
fs = cfg.GetBool("ZFontTest","fullscreen",false);
title = cfg.GetString("ZFontTest","title","ZFont Test");
- rate = cfg.GetInt("ZFontTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZImageTest.cpp b/test/ZImageTest.cpp
index 2d829df..a460ee2 100644
--- a/test/ZImageTest.cpp
+++ b/test/ZImageTest.cpp
@@ -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: ZImageTest.cpp,v 1.28 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZImageTest.cpp,v 1.29 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,9 +29,7 @@ bool Initialize()
bpp = cfg.GetInt("ZImageTest","bpp",32);
fs = cfg.GetBool("ZImageTest","fullscreen",true);
title = cfg.GetString("ZImageTest","title","ZImage Test");
- rate = cfg.GetInt("ZImageTest","framerate",60);
- engine->SetDesiredFramerate(rate);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
@@ -109,7 +107,7 @@ void Test()
engine->Clear(); //clear screen
//draw the images//
- alpha += alphaDelta*engine->GetFrameTime();
+ alpha += static_cast(alphaDelta*engine->GetFrameTime());
if(alpha >= 255 || alpha <= 0)
alphaDelta *= -1.0f;
image1.SetAlpha(static_cast(alpha));
@@ -117,7 +115,7 @@ void Test()
#if (GFX_BACKEND == ZE_OGL)
image2.DrawRotated(100,0,angle);
- angle+=(150*engine->GetFrameTime());
+ angle += static_cast(150*engine->GetFrameTime());
if(angle > 360)
angle = 0.0f;
#elif (GFX_BACKEND == ZE_SDL)
diff --git a/test/ZMouseTest.cpp b/test/ZMouseTest.cpp
index b9dfd16..37fdac9 100644
--- a/test/ZMouseTest.cpp
+++ b/test/ZMouseTest.cpp
@@ -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: ZMouseTest.cpp,v 1.20 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZMouseTest.cpp,v 1.21 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZMouseTest","bpp",32);
fs = cfg.GetBool("ZMouseTest","fullscreen",false);
title = cfg.GetString("ZMouseTest","title","ZMouse Test");
- rate = cfg.GetInt("ZMouseTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZMusicTest.cpp b/test/ZMusicTest.cpp
index d5f5c04..e944da3 100644
--- a/test/ZMusicTest.cpp
+++ b/test/ZMusicTest.cpp
@@ -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: ZMusicTest.cpp,v 1.20 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZMusicTest.cpp,v 1.21 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZMusicTest","bpp",32);
fs = cfg.GetBool("ZMusicTest","fullscreen",false);
title = cfg.GetString("ZMusicTest","title","ZMusic Test");
- rate = cfg.GetInt("ZMusicTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZParticleTest.cpp b/test/ZParticleTest.cpp
index 14ad49c..a364d8d 100755
--- a/test/ZParticleTest.cpp
+++ b/test/ZParticleTest.cpp
@@ -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: ZParticleTest.cpp,v 1.8 2003/11/24 01:58:23 cozman Exp $*/
+/*$Id: ZParticleTest.cpp,v 1.9 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZParticleTest","bpp",32);
fs = cfg.GetBool("ZParticleTest","fullscreen",false);
title = cfg.GetString("ZParticleTest","title","ZParticle Test");
- rate = cfg.GetInt("ZParticleTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZRectTest.cpp b/test/ZRectTest.cpp
index 0441861..02e556a 100644
--- a/test/ZRectTest.cpp
+++ b/test/ZRectTest.cpp
@@ -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: ZRectTest.cpp,v 1.21 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZRectTest.cpp,v 1.22 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZRectTest","bpp",32);
fs = cfg.GetBool("ZRectTest","fullscreen",false);
title = cfg.GetString("ZRectTest","title","ZRect Test");
- rate = cfg.GetInt("ZRectTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZSoundTest.cpp b/test/ZSoundTest.cpp
index 1a922ce..3e60d73 100644
--- a/test/ZSoundTest.cpp
+++ b/test/ZSoundTest.cpp
@@ -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: ZSoundTest.cpp,v 1.20 2003/11/24 22:59:18 cozman Exp $*/
+/*$Id: ZSoundTest.cpp,v 1.21 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZSoundTest","bpp",32);
fs = cfg.GetBool("ZSoundTest","fullscreen",false);
title = cfg.GetString("ZSoundTest","title","ZSound Test");
- rate = cfg.GetInt("ZSoundTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}
diff --git a/test/ZTimerTest.cpp b/test/ZTimerTest.cpp
index 9f25dde..45456c0 100644
--- a/test/ZTimerTest.cpp
+++ b/test/ZTimerTest.cpp
@@ -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.19 2003/11/24 02:17:32 cozman Exp $*/
+/*$Id: ZTimerTest.cpp,v 1.20 2003/12/14 22:35:35 cozman Exp $*/
#include
#include
@@ -20,7 +20,7 @@ bool Initialize()
{
ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
- int w,h,bpp,rate;
+ int w,h,bpp;
bool fs;
std::string title;
@@ -29,7 +29,6 @@ bool Initialize()
bpp = cfg.GetInt("ZTimerTest","bpp",32);
fs = cfg.GetBool("ZTimerTest","fullscreen",false);
title = cfg.GetString("ZTimerTest","title","ZTimer Test");
- rate = cfg.GetInt("ZTimerTest","framerate",60);
return engine->CreateDisplay(w,h,bpp,fs,title);
}