2010-01-03 23:58:59 +02:00
|
|
|
/* 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.
|
|
|
|
*
|
2010-01-14 12:24:12 +02:00
|
|
|
* MIT License:
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Alexei Svitkine, Eugene Sandulenko
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person
|
|
|
|
* obtaining a copy of this software and associated documentation
|
|
|
|
* files (the "Software"), to deal in the Software without
|
|
|
|
* restriction, including without limitation the rights to use,
|
|
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following
|
|
|
|
* conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
2010-01-03 23:58:59 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
#include "common/config-manager.h"
|
2011-05-30 04:25:59 +01:00
|
|
|
#include "common/debug-channels.h"
|
2011-05-30 04:28:09 +01:00
|
|
|
#include "common/error.h"
|
2010-01-03 23:58:59 +02:00
|
|
|
#include "common/file.h"
|
|
|
|
#include "common/fs.h"
|
2011-05-30 04:28:09 +01:00
|
|
|
|
|
|
|
#include "engines/util.h"
|
2015-12-15 11:12:44 +01:00
|
|
|
#include "gui/EventRecorder.h"
|
2010-01-03 23:58:59 +02:00
|
|
|
|
|
|
|
#include "wage/wage.h"
|
2010-01-11 00:44:27 +02:00
|
|
|
#include "wage/entities.h"
|
2010-01-07 23:52:31 +02:00
|
|
|
#include "wage/world.h"
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
namespace Wage {
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(syst), _gameDescription(desc) {
|
2011-05-30 04:02:48 +01:00
|
|
|
_rnd = new Common::RandomSource("wage");
|
2010-01-18 00:13:37 +02:00
|
|
|
|
|
|
|
_aim = -1;
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2011-05-30 04:21:13 +01:00
|
|
|
debug("WageEngine::WageEngine()");
|
2010-01-03 23:58:59 +02:00
|
|
|
}
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
WageEngine::~WageEngine() {
|
2011-05-30 04:21:13 +01:00
|
|
|
debug("WageEngine::~WageEngine()");
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2011-05-30 04:25:59 +01:00
|
|
|
DebugMan.clearAllDebugChannels();
|
2011-05-30 04:02:48 +01:00
|
|
|
delete _rnd;
|
2010-01-03 23:58:59 +02:00
|
|
|
}
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
Common::Error WageEngine::run() {
|
|
|
|
initGraphics(320, 200, false);
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
// Create debugger console. It requires GFX to be initialized
|
|
|
|
_console = new Console(this);
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2011-05-30 04:21:13 +01:00
|
|
|
debug("WageEngine::init");
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2011-05-30 04:32:51 +01:00
|
|
|
// Your main event loop should be (invoked from) here.
|
2011-05-30 04:31:15 +01:00
|
|
|
_resManager = new Common::MacResManager();
|
|
|
|
_resManager->open(getGameFile());
|
2010-01-07 23:52:31 +02:00
|
|
|
|
|
|
|
_world = new World();
|
|
|
|
|
|
|
|
if (!_world->loadWorld(_resManager))
|
|
|
|
return Common::kNoGameDataFoundError;
|
2015-12-15 11:12:44 +01:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
return Common::kNoError;
|
|
|
|
}
|
2010-01-07 23:52:31 +02:00
|
|
|
|
2010-01-03 23:58:59 +02:00
|
|
|
} // End of namespace Wage
|