mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
HPL1: move hplMain to engine run
This commit is contained in:
parent
3c005d841e
commit
8a85e1c2b9
@ -19,6 +19,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hpl1/penumbra-overture/Init.h"
|
||||
#include "engine/engine.h"
|
||||
#include "hpl1/hpl1.h"
|
||||
#include "common/config-manager.h"
|
||||
@ -34,8 +35,6 @@
|
||||
#include "audio/mixer.h"
|
||||
#include "common/savefile.h"
|
||||
|
||||
extern int hplMain(const hpl::tString &asCommandLine);
|
||||
|
||||
namespace Hpl1 {
|
||||
|
||||
Hpl1Engine *g_engine;
|
||||
@ -58,7 +57,14 @@ Common::String Hpl1Engine::getGameId() const {
|
||||
}
|
||||
|
||||
Common::Error Hpl1Engine::run() {
|
||||
hplMain("");
|
||||
_gameInit = new cInit(); // TODO: remove allocation
|
||||
if (!_gameInit->Init("")) {
|
||||
delete _gameInit;
|
||||
return Common::kUnknownError; // TODO: better errors
|
||||
};
|
||||
_gameInit->Run();
|
||||
_gameInit->Exit();
|
||||
delete _gameInit;
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,8 @@
|
||||
|
||||
#include "hpl1/detection.h"
|
||||
|
||||
class cInit;
|
||||
|
||||
namespace Hpl1 {
|
||||
|
||||
struct Hpl1GameDescription;
|
||||
@ -45,6 +47,7 @@ class Hpl1Engine : public Engine {
|
||||
private:
|
||||
const ADGameDescription *_gameDescription;
|
||||
Common::RandomSource _randomSource;
|
||||
cInit* _gameInit;
|
||||
|
||||
protected:
|
||||
// Engine APIs
|
||||
|
@ -271,7 +271,6 @@ MODULE_OBJS := \
|
||||
penumbra-overture/Init.o \
|
||||
penumbra-overture/IntroStory.o \
|
||||
penumbra-overture/Inventory.o \
|
||||
penumbra-overture/Main.o \
|
||||
penumbra-overture/MainMenu.o \
|
||||
penumbra-overture/MapHandler.o \
|
||||
penumbra-overture/MapLoadText.o \
|
||||
|
@ -1,57 +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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2010 - Frictional Games
|
||||
*
|
||||
* This file is part of Penumbra Overture.
|
||||
*/
|
||||
|
||||
//#include <vld.h>
|
||||
|
||||
#include "hpl1/penumbra-overture/Init.h"
|
||||
|
||||
#if 0//def WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
int hplMain(const tString &asCommandLine) {
|
||||
cInit *pInit = hplNew(cInit, ());
|
||||
|
||||
bool bRet = pInit->Init(asCommandLine);
|
||||
|
||||
if (bRet == false) {
|
||||
hplDelete(pInit->mpGame);
|
||||
CreateMessageBoxW(_W("Error!"), pInit->msErrorMessage.c_str());
|
||||
OpenBrowserWindow(_W("http://support.frictionalgames.com"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
pInit->Run();
|
||||
|
||||
pInit->Exit();
|
||||
|
||||
hplDelete(pInit);
|
||||
|
||||
cMemoryManager::LogResults();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user