ULTIMA1: Move the game view into the Ultima1 namespace

This commit is contained in:
Paul Gilbert 2020-01-18 07:24:24 -08:00 committed by Paul Gilbert
parent c463f341c8
commit 56776d5d69
6 changed files with 122 additions and 8 deletions

View File

@ -51,6 +51,7 @@ MODULE_OBJS += \
ultima0/resources.o \
ultima1/core/map.o \
ultima1/core/resources.o \
ultima1/gfx/game_view.o \
ultima1/game.o \
ultima1/project_item.o
endif

View File

@ -22,10 +22,10 @@
#include "ultima/shared/early/ultima_game.h"
#include "ultima/shared/core/game_state.h"
#include "ultima/shared/gfx/game_view.h"
#include "ultima/shared/engine/resources.h"
#include "ultima/shared/early/ultima_early.h"
#include "ultima/shared/gfx/screen.h"
#include "ultima/shared/early/font_resources.h"
#include "ultima/shared/early/ultima_early.h"
namespace Ultima {
namespace Shared {
@ -35,8 +35,6 @@ EMPTY_MESSAGE_MAP(UltimaGame, Game);
UltimaGame::UltimaGame() : Game() {
_fontResources = new FontResources();
_gameState = new GameState();
_gameView = new GameView();
_gameView->addUnder(this);
setPalette();
}
@ -44,7 +42,6 @@ UltimaGame::UltimaGame() : Game() {
UltimaGame::~UltimaGame() {
delete _fontResources;
delete _gameState;
delete _gameView;
}
void UltimaGame::setPalette() {

View File

@ -21,6 +21,7 @@
*/
#include "ultima/ultima1/game.h"
#include "ultima/ultima1/gfx/game_view.h"
namespace Ultima {
namespace Ultima1 {
@ -28,6 +29,12 @@ namespace Ultima1 {
EMPTY_MESSAGE_MAP(Ultima1Game, Shared::UltimaGame);
Ultima1Game::Ultima1Game() : Shared::UltimaGame() {
_gameView = new GameView();
_gameView->addUnder(this);
}
Ultima1Game::~Ultima1Game() {
delete _gameView;
}
} // End of namespace Ultima1

View File

@ -28,15 +28,16 @@
namespace Ultima {
namespace Ultima1 {
class GameView;
class Ultima1Game : public Shared::UltimaGame {
DECLARE_MESSAGE_MAP;
public:
GameView *_gameView;
public:
CLASSDEF;
Ultima1Game();
virtual ~Ultima1Game() {}
virtual ~Ultima1Game();
};
} // End of namespace Ultima1

View File

@ -0,0 +1,51 @@
/* 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.
*
*/
#include "ultima/ultima1/gfx/game_view.h"
#include "ultima/shared/gfx/info.h"
#include "ultima/shared/gfx/status.h"
#include "ultima/shared/gfx/viewport_dungeon.h"
#include "ultima/shared/gfx/viewport_map.h"
namespace Ultima {
namespace Ultima1 {
GameView::GameView() {
_info = new Shared::Info();
_status = new Shared::Status();
_viewportDungeon = new Shared::ViewportDungeon();
_viewportMap = new Shared::ViewportMap();
_info->addUnder(this);
_status->addUnder(this);
_viewportDungeon->addUnder(this);
_viewportMap->addUnder(this);
}
GameView::~GameView() {
delete _info;
delete _status;
delete _viewportDungeon;
delete _viewportMap;
}
} // End of namespace Shared
} // End of namespace Ultima

View File

@ -0,0 +1,57 @@
/* 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.
*
*/
#ifndef ULTIMA_ULTIMA1_GFX_GAME_VIEW_H
#define ULTIMA_ULTIMA1_GFX_GAME_VIEW_H
#include "ultima/shared/gfx/visual_container.h"
namespace Ultima {
namespace Shared {
class Info;
class Status;
class ViewportDungeon;
class ViewportMap;
}
namespace Ultima1 {
/**
* This class implements a standard view screen that shows a status and log area, as well as either
* a map or dungeon view covering the bulk of the screen
*/
class GameView : public Shared::Gfx::VisualContainer {
private:
Shared::Info *_info;
Shared::Status *_status;
Shared::ViewportDungeon *_viewportDungeon;
Shared::ViewportMap *_viewportMap;
public:
GameView();
virtual ~GameView();
};
} // End of namespace Shared
} // End of namespace Xeen
#endif