SWORD25: Removed some more unused/unimplemented debug code

svn-id: r55595
This commit is contained in:
Filippos Karapetis 2011-01-28 17:02:02 +00:00
parent c63ff39a7f
commit 7ed5a92823
7 changed files with 4 additions and 191 deletions

View File

@ -1,68 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
*
* Licensed under GNU GPL v2
*
*/
#include "common/system.h"
#include "sword25/gfx/framecounter.h"
namespace Sword25 {
Framecounter::Framecounter(int updateFrequency) :
_FPS(0),
_FPSCount(0),
_lastUpdateTime(-1) {
setUpdateFrequency(updateFrequency);
}
void Framecounter::update() {
// Aktuellen Systemtimerstand auslesen
uint64 timer = g_system->getMillis() * 1000;
// Falls m_LastUpdateTime == -1 ist, wird der Frame-Counter zum ersten Mal aufgerufen und der aktuelle Systemtimer als erster
// Messzeitpunkt genommen.
if (_lastUpdateTime == -1)
_lastUpdateTime = timer;
else {
// Die Anzahl der Frames im aktuellen Messzeitraum wird erhöht.
_FPSCount++;
// Falls der Messzeitraum verstrichen ist, wird die durchschnittliche Framerate berechnet und ein neuer Messzeitraum begonnen.
if (timer - _lastUpdateTime >= _updateDelay) {
_FPS = static_cast<int>((1000000 * (uint64)_FPSCount) / (timer - _lastUpdateTime));
_lastUpdateTime = timer;
_FPSCount = 0;
}
}
}
} // End of namespace Sword25

View File

@ -1,99 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
*
* Licensed under GNU GPL v2
*
*/
#ifndef SWORD25_FRAMECOUNTER_H
#define SWORD25_FRAMECOUNTER_H
// Includes
#include "sword25/kernel/common.h"
namespace Sword25 {
/**
* A simple class that implements a frame counter
*/
class Framecounter {
private:
// TODO: This class should be rewritten based on Audio::Timestamp,
// which provides higher accuracy and avoids using 64 bit data types.
typedef unsigned long long uint64;
typedef signed long long int64;
enum {
DEFAULT_UPDATE_FREQUENCY = 10
};
public:
/**
* Creates a new BS_Framecounter object
* @param UpdateFrequency Specifies how often the frame counter should be updated in a sceond.
* The default value is 10.
*/
Framecounter(int updateFrequency = DEFAULT_UPDATE_FREQUENCY);
/**
* Determines how often the frame counter should be updated in a second.
* @param UpdateFrequency Specifies how often the frame counter should be updated in a second.
*/
inline void setUpdateFrequency(int updateFrequency);
/**
* This method must be called once per frame.
*/
void update();
/**
* Returns the current FPS value.
*/
int getFPS() const {
return _FPS;
}
private:
int _FPS;
int _FPSCount;
int64 _lastUpdateTime;
uint64 _updateDelay;
};
// Inlines
void Framecounter::setUpdateFrequency(int updateFrequency) {
// Frequency in time (converted to microseconds)
_updateDelay = 1000000 / updateFrequency;
}
} // End of namespace Sword25
#endif

View File

@ -72,7 +72,6 @@ GraphicEngine::GraphicEngine(Kernel *pKernel) :
_lastFrameDuration(0),
_timerActive(true),
_frameTimeSampleSlot(0),
_repaintedPixels(0),
_thumbnail(NULL),
ResourceService(pKernel) {
_frameTimeSamples.resize(FRAMETIME_SAMPLE_COUNT);
@ -183,9 +182,6 @@ bool GraphicEngine::endFrame() {
_debugLines.clear();
}
// Framecounter aktualisieren
_FPSCounter.update();
return true;
}

View File

@ -52,7 +52,6 @@
#include "sword25/kernel/common.h"
#include "sword25/kernel/resservice.h"
#include "sword25/kernel/persistable.h"
#include "sword25/gfx/framecounter.h"
#include "sword25/gfx/renderobjectptr.h"
#include "sword25/math/vertex.h"
@ -266,15 +265,6 @@ public:
*/
bool fill(const Common::Rect *fillRectPtr = 0, uint color = BS_RGB(0, 0, 0));
// Debugging Methods
int getFPSCount() const {
return _FPSCounter.getFPS();
}
int getRepaintedPixels() const {
return _repaintedPixels;
}
Graphics::Surface _backSurface;
Graphics::Surface *getSurface() { return &_backSurface; }
@ -342,12 +332,6 @@ protected:
int _bitDepth;
bool _windowed;
// Debugging Variables
// -------------------
Framecounter _FPSCounter;
uint _repaintedPixels;
/**
* Calculates the time since the last frame beginning has passed.
*/

View File

@ -346,7 +346,8 @@ static int isWindowed(lua_State *L) {
static int getFPSCount(lua_State *L) {
GraphicEngine *pGE = getGE();
lua_pushnumber(L, pGE->getFPSCount());
// Used in a debug function
lua_pushnumber(L, 0);
return 1;
}
@ -395,7 +396,8 @@ static int saveThumbnailScreenshot(lua_State *L) {
static int getRepaintedPixels(lua_State *L) {
GraphicEngine *pGE = getGE();
lua_pushnumber(L, static_cast<lua_Number>(pGE->getRepaintedPixels()));
// Used in a debug function.
lua_pushnumber(L, 0);
return 1;
}

View File

@ -53,7 +53,6 @@ public:
virtual ~ResourceService() {}
/**
* Loads a resource
* @return Returns the resource if successful, otherwise NULL

View File

@ -14,7 +14,6 @@ MODULE_OBJS := \
gfx/bitmap.o \
gfx/dynamicbitmap.o \
gfx/fontresource.o \
gfx/framecounter.o \
gfx/graphicengine.o \
gfx/graphicengine_script.o \
gfx/panel.o \