Move initGraphics and initCommonGFX from to new header.

These functions are only used internally be Engine subclasses, and
by moving them to a separate header we can reduce indirect header
dependencies.

svn-id: r48934
This commit is contained in:
Max Horn 2010-05-04 11:58:12 +00:00
parent 5568a8473b
commit b3e404109c
30 changed files with 109 additions and 27 deletions

View file

@ -31,6 +31,8 @@
#include "common/config-manager.h"
#include "common/random.h"
#include "engines/util.h"
#include "base/plugins.h"
#include "base/version.h"

View file

@ -30,6 +30,8 @@
#include "common/fs.h"
#include "common/system.h"
#include "engines/util.h"
#include "agos/debugger.h"
#include "agos/intern.h"
#include "agos/agos.h"

View file

@ -30,6 +30,8 @@
#include "common/config-manager.h"
#include "common/system.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "sound/mididrv.h"

View file

@ -30,6 +30,8 @@
#include "common/config-manager.h"
#include "common/system.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "sound/mididrv.h"

View file

@ -31,6 +31,8 @@
#include "common/keyboard.h"
#include "common/EventRecorder.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "graphics/font.h"

View file

@ -33,6 +33,8 @@
#include "base/plugins.h"
#include "base/version.h"
#include "engines/util.h"
#include "sound/mixer.h"
#include "drascula/drascula.h"

View file

@ -32,6 +32,7 @@
#include "engines/engine.h"
#include "engines/dialogs.h"
#include "engines/metaengine.h"
#include "engines/util.h"
#include "common/config-manager.h"
#include "common/debug.h"

View file

@ -28,8 +28,6 @@
#include "common/scummsys.h"
#include "common/error.h"
#include "common/str.h"
#include "common/list.h"
#include "graphics/pixelformat.h"
class OSystem;
@ -46,28 +44,6 @@ namespace GUI {
class Dialog;
}
/**
* Setup the backend's graphics mode.
*/
void initCommonGFX(bool defaultTo1XScaler);
/**
* Setup the backend's screen size and graphics mode.
*
* Shows an various warnings on certain backend graphics
* transaction failures (aspect switch, fullscreen switch, etc.).
*
* Errors out when backend is not able to switch to the specified
* mode.
*
* Defaults to 256 color paletted mode if no graphics format is provided.
* Uses the backend's preferred format if graphics format pointer is NULL.
* Finds the best compatible format if a list of graphics formats is provided.
*/
void initGraphics(int width, int height, bool defaultTo1xScaler);
void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format);
void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList);
/**
* Initializes graphics and shows error message.
*/

View file

@ -24,6 +24,9 @@
*/
#include "common/endian.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "graphics/fontman.h"
#include "graphics/surface.h"

View file

@ -25,6 +25,9 @@
#include "common/config-manager.h"
#include "common/events.h"
#include "engines/util.h"
#include "sound/mixer.h"
#include "groovie/groovie.h"

View file

@ -27,6 +27,8 @@
#include "common/endian.h"
#include "common/system.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "graphics/sjis.h"

View file

@ -28,6 +28,8 @@
#include "common/savefile.h"
#include "common/EventRecorder.h"
#include "engines/util.h"
#include "lure/luredefs.h"
#include "lure/surface.h"
#include "lure/lure.h"

View file

@ -58,7 +58,7 @@
#include "common/endian.h"
#include "common/system.h"
#include "common/config-manager.h"
#include "engines/engine.h"
#include "engines/util.h"
#include "graphics/surface.h"
#include "sound/mididrv.h"

View file

@ -33,6 +33,8 @@
#include "graphics/cursorman.h"
#include "engines/util.h"
#include "base/plugins.h"
#include "base/version.h"

View file

@ -29,6 +29,8 @@
#include "mohawk/riven.h"
#include "mohawk/riven_cursors.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "graphics/primitives.h"
#include "gui/message.h"

View file

@ -28,6 +28,8 @@
#include "common/events.h"
#include "engines/util.h"
namespace Mohawk {
MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) {

View file

@ -27,6 +27,7 @@
#include "common/system.h"
#include "common/file.h"
#include "graphics/primitives.h"
#include "engines/util.h"
#include "parallaction/input.h"
#include "parallaction/parallaction.h"

View file

@ -33,6 +33,8 @@
#include "common/events.h"
#include "common/EventRecorder.h"
#include "engines/util.h"
#include "queen/queen.h"
#include "queen/bankman.h"
#include "queen/command.h"

View file

@ -34,6 +34,7 @@
#include "common/system.h"
#include "graphics/cursorman.h"
#include "engines/util.h"
namespace Saga {

View file

@ -27,6 +27,7 @@
#include "common/util.h"
#include "common/system.h"
#include "graphics/surface.h"
#include "engines/util.h"
#include "sci/sci.h"
#include "sci/engine/state.h"

View file

@ -28,6 +28,8 @@
#include "common/config-manager.h"
#include "engines/advancedDetector.h"
#include "engines/util.h"
#include "sci/sci.h"
#include "sci/debug.h"
#include "sci/console.h"

View file

@ -29,6 +29,8 @@
#include "common/EventRecorder.h"
#include "common/system.h"
#include "engines/util.h"
#include "gui/message.h"
#include "gui/GuiManager.h"

View file

@ -47,6 +47,9 @@
#include "sound/mididrv.h"
#include "sound/mixer.h"
#include "engines/util.h"
#ifdef _WIN32_WCE
extern bool toolbar_drawn;

View file

@ -38,6 +38,8 @@
#include "common/config-manager.h"
#include "engines/util.h"
#include "gui/message.h"
#include "gui/GuiManager.h"

View file

@ -25,8 +25,6 @@
* $Id$
*/
#include "base/plugins.h"
#include "common/config-manager.h"
@ -38,6 +36,7 @@
#include "common/system.h"
#include "engines/metaengine.h"
#include "engines/util.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"

View file

@ -27,11 +27,16 @@
#include "common/events.h"
#include "common/savefile.h"
#include "common/system.h"
#include "engines/advancedDetector.h"
#include "engines/util.h"
#include "sound/mixer.h"
#include "sound/decoders/raw.h"
#include "graphics/cursorman.h"
#include "graphics/thumbnail.h"
#include "teenagent/console.h"
#include "teenagent/music.h"
#include "teenagent/objects.h"

View file

@ -35,6 +35,8 @@
#include "common/serializer.h"
#include "common/stream.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "base/plugins.h"

View file

@ -29,6 +29,7 @@
#include "common/EventRecorder.h"
#include "common/system.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "sound/mididrv.h"

View file

@ -27,6 +27,8 @@
#include "common/events.h"
#include "common/system.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "tucker/tucker.h"

54
engines/util.h Normal file
View file

@ -0,0 +1,54 @@
/* 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$
*/
#ifndef ENGINES_UTIL_H
#define ENGINES_UTIL_H
#include "common/scummsys.h"
#include "common/list.h"
#include "graphics/pixelformat.h"
/**
* Setup the backend's graphics mode.
*/
void initCommonGFX(bool defaultTo1XScaler);
/**
* Setup the backend's screen size and graphics mode.
*
* Shows an various warnings on certain backend graphics
* transaction failures (aspect switch, fullscreen switch, etc.).
*
* Errors out when backend is not able to switch to the specified
* mode.
*
* Defaults to 256 color paletted mode if no graphics format is provided.
* Uses the backend's preferred format if graphics format pointer is NULL.
* Finds the best compatible format if a list of graphics formats is provided.
*/
void initGraphics(int width, int height, bool defaultTo1xScaler);
void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format);
void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList);
#endif