Reduce code duplication

svn-id: r23888
This commit is contained in:
Max Horn 2006-09-16 15:01:14 +00:00
parent 250133baf0
commit a2dc897fe5
16 changed files with 1 additions and 43 deletions

View File

@ -560,10 +560,6 @@ AgiEngine::~AgiEngine() {
delete _console;
}
void AgiEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int AgiEngine::init() {
// Initialize backend
_system->beginGFXTransaction();

View File

@ -229,8 +229,6 @@ extern const char *_savePath;
class AgiEngine : public ::Engine {
int _gameId;
void errorString(const char *buf_input, char *buf_output);
protected:
int init();
int go();

View File

@ -167,10 +167,6 @@ CineEngine::CineEngine(OSystem *syst) : Engine(syst) {
CineEngine::~CineEngine() {
}
void CineEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int CineEngine::init() {
// Initialize backend
_system->beginGFXTransaction();

View File

@ -55,8 +55,6 @@ enum CineGameId {
class CineEngine : public Engine {
int _gameId;
void errorString(const char *buf_input, char *buf_output);
protected:
int init();
int go();

View File

@ -204,10 +204,6 @@ GobEngine::~GobEngine() {
delete[] _startTot0;
}
void GobEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int GobEngine::go() {
_init->initGame(0);

View File

@ -82,8 +82,6 @@ enum {
};
class GobEngine : public Engine {
void errorString(const char *buf_input, char *buf_output);
protected:
int go();
int init();

View File

@ -411,10 +411,6 @@ KyraEngine_v1::~KyraEngine_v1() {
}
void KyraEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int KyraEngine::go() {
if (_features & GF_FLOPPY && !(_features & GF_AMIGA)) {

View File

@ -252,8 +252,6 @@ public:
virtual int setupGameFlags() = 0;
void errorString(const char *buf_input, char *buf_output);
Resource *resource() { return _res; }
Screen *screen() { return _screen; }
ScreenAnimator *animator() { return _animator; }

View File

@ -46,7 +46,7 @@ Debugger::Debugger(): Common::Debugger<Debugger>() {
DCmd_Register("hotspot", &Debugger::cmd_hotspot);
}
int Debugger::strToInt(const char *s) {
static int strToInt(const char *s) {
if (!*s)
// No string at all
return 0;

View File

@ -30,8 +30,6 @@ namespace Lure {
class KyraEngine;
class Debugger : public Common::Debugger<Debugger> {
private:
int strToInt(const char *s);
public:
Debugger();
virtual ~Debugger() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ

View File

@ -314,10 +314,6 @@ int LureEngine::go() {
return 0;
}
void LureEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
void LureEngine::quitGame() {
_system->quit();
}

View File

@ -60,7 +60,6 @@ public:
virtual int init();
virtual int go();
virtual void errorString(const char *buf_input, char *buf_output);
void quitGame();
uint32 features() { return _features; }

View File

@ -142,10 +142,6 @@ SagaEngine::~SagaEngine() {
delete _resource;
}
void SagaEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int SagaEngine::init() {
_soundVolume = ConfMan.getInt("sfx_volume") / 25;
_musicVolume = ConfMan.getInt("music_volume") / 25;

View File

@ -250,8 +250,6 @@ inline uint16 objectIndexToId(int type, int index) {
class SagaEngine : public Engine {
friend class Scene;
void errorString(const char *buf_input, char *buf_output);
protected:
int go();
int init();

View File

@ -131,10 +131,6 @@ namespace Sword1 {
SystemVars SwordEngine::_systemVars;
void SwordEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
SwordEngine::SwordEngine(OSystem *syst)
: Engine(syst) {

View File

@ -68,7 +68,6 @@ struct SystemVars {
};
class SwordEngine : public Engine {
void errorString(const char *buf_input, char *buf_output);
public:
SwordEngine(OSystem *syst);
virtual ~SwordEngine();