diff --git a/lib/framework/Makefile.am b/lib/framework/Makefile.am index cf7dc959a..fe71f3ee7 100644 --- a/lib/framework/Makefile.am +++ b/lib/framework/Makefile.am @@ -27,7 +27,6 @@ noinst_HEADERS = \ file.h \ fixedpoint.h \ frame.h \ - frameint.h \ frameresource.h \ geometry.h \ gettext.h \ diff --git a/lib/framework/frame.cpp b/lib/framework/frame.cpp index bfb9cc2f3..723a34282 100644 --- a/lib/framework/frame.cpp +++ b/lib/framework/frame.cpp @@ -32,7 +32,6 @@ #include -#include "frameint.h" #include "frameresource.h" #include "input.h" #include "physfs_ext.h" @@ -91,11 +90,6 @@ bool frameInitialise() return false; } - if (!screenInitialise()) - { - return false; - } - /* Initialise the input system */ inputInitialise(); @@ -135,9 +129,6 @@ void frameUpdate(void) */ void frameShutDown(void) { - debug(LOG_NEVER, "Screen shutdown!"); - screenShutDown(); - // Shutdown the resource stuff debug(LOG_NEVER, "No more resources!"); resShutDown(); diff --git a/lib/framework/frameint.h b/lib/framework/frameint.h deleted file mode 100644 index b2ce9bbef..000000000 --- a/lib/framework/frameint.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of Warzone 2100. - Copyright (C) 1999-2004 Eidos Interactive - Copyright (C) 2005-2013 Warzone 2100 Project - - Warzone 2100 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. - - Warzone 2100 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 Warzone 2100; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -/*! \file frameint.h - * \brief Internal definitions for the framework library. - */ -#ifndef _frameint_h -#define _frameint_h - -/* Check the header files have been included from frame.h if they - * are used outside of the framework library. - */ -#if !defined(_frame_h) && !defined(FRAME_LIB_INCLUDE) -#error Framework header files MUST be included from Frame.h ONLY. -#endif - -/* Initialise the double buffered display */ -extern bool screenInitialise(void); - -/* Release the DD objects */ -extern void screenShutDown(void); - -/* The Current screen size and bit depth */ -extern unsigned screenWidth; -extern unsigned screenHeight; - -#endif //_frameint_h diff --git a/lib/ivis_opengl/piefunc.cpp b/lib/ivis_opengl/piefunc.cpp index 261136fa9..dde14832c 100644 --- a/lib/ivis_opengl/piefunc.cpp +++ b/lib/ivis_opengl/piefunc.cpp @@ -22,7 +22,6 @@ */ #include "lib/framework/frame.h" -#include "lib/framework/frameint.h" #include "lib/framework/opengl.h" #include "lib/gamelib/gtime.h" diff --git a/lib/ivis_opengl/screen.cpp b/lib/ivis_opengl/screen.cpp index 365526036..6ef187cbb 100644 --- a/lib/ivis_opengl/screen.cpp +++ b/lib/ivis_opengl/screen.cpp @@ -33,7 +33,6 @@ #include #include "lib/ivis_opengl/png_util.h" #include "lib/ivis_opengl/tex.h" -#include "lib/framework/frameint.h" #include "lib/ivis_opengl/textdraw.h" #include "lib/ivis_opengl/piestate.h" #include "lib/ivis_opengl/pieblitfunc.h" diff --git a/lib/ivis_opengl/screen.h b/lib/ivis_opengl/screen.h index 35a978e88..3ce5d63d0 100644 --- a/lib/ivis_opengl/screen.h +++ b/lib/ivis_opengl/screen.h @@ -38,11 +38,8 @@ /* ------------------------------------------------------------------------------------------- */ -/* Legacy stuff - * - only used in the sequence video code we have not yet decided whether to port or to junk */ - -/* Set the colour for text */ -extern void screenSetTextColour(UBYTE red, UBYTE green, UBYTE blue); +extern unsigned screenWidth; +extern unsigned screenHeight; /* backDrop */ extern void screen_SetBackDropFromFile(const char* filename); @@ -77,6 +74,9 @@ enum PERF_POINT PERF_COUNT }; +bool screenInitialise(); +void screenShutDown(); + void wzPerfBegin(PERF_POINT pp, const char *descr); void wzPerfEnd(PERF_POINT pp); void wzPerfStart(); diff --git a/lib/qtgame/main_qt.cpp b/lib/qtgame/main_qt.cpp index b1633936b..5ca8c405f 100644 --- a/lib/qtgame/main_qt.cpp +++ b/lib/qtgame/main_qt.cpp @@ -26,7 +26,6 @@ #include "lib/framework/frame.h" #include "lib/ivis_opengl/pieclip.h" #include "src/warzoneconfig.h" -#include "lib/framework/frameint.h" #include "wzapp_qt.h" // used in crash reports & version info diff --git a/lib/qtgame/wzapp_qt.cpp b/lib/qtgame/wzapp_qt.cpp index 8856b8352..a4bf1f692 100644 --- a/lib/qtgame/wzapp_qt.cpp +++ b/lib/qtgame/wzapp_qt.cpp @@ -105,8 +105,8 @@ static bool mouseInWindow = false; static CURSOR lastCursor = CURSOR_ARROW; static bool crashing = false; -unsigned screenWidth = 0; // Declared in frameint.h. -unsigned screenHeight = 0; // Declared in frameint.h. +unsigned screenWidth = 0; // Declared in screen.h +unsigned screenHeight = 0; // Declared in screen.h static void inputAddBuffer(UDWORD key, utf_32_char unicode); static int WZkeyToQtKey(int code); diff --git a/lib/sdl/main_sdl.cpp b/lib/sdl/main_sdl.cpp index c87c169cc..22b012911 100644 --- a/lib/sdl/main_sdl.cpp +++ b/lib/sdl/main_sdl.cpp @@ -48,8 +48,8 @@ int main(int argc, char *argv[]) return realmain(argc, argv); } -unsigned screenWidth = 0; // Declared in frameint.h. -unsigned screenHeight = 0; // Declared in frameint.h. +unsigned screenWidth = 0; // Declared in screen.h +unsigned screenHeight = 0; // Declared in screen.h static unsigned screenDepth = 0; static SDL_Surface * screen = NULL; diff --git a/lib/sequence/sequence.cpp b/lib/sequence/sequence.cpp index a210f9e10..bd197627b 100644 --- a/lib/sequence/sequence.cpp +++ b/lib/sequence/sequence.cpp @@ -56,13 +56,13 @@ */ #include "lib/framework/frame.h" -#include "lib/framework/frameint.h" #include "lib/framework/opengl.h" #include "sequence.h" #include "timer.h" #include "lib/framework/math_ext.h" #include "lib/ivis_opengl/piestate.h" #include "lib/ivis_opengl/pieblitfunc.h" +#include "lib/ivis_opengl/screen.h" #include "lib/sound/audio.h" #include "lib/sound/openal_error.h" #include "lib/sound/mixer.h" diff --git a/lib/widget/button.cpp b/lib/widget/button.cpp index 8295969fa..b8b5d9e82 100644 --- a/lib/widget/button.cpp +++ b/lib/widget/button.cpp @@ -22,7 +22,6 @@ */ #include "lib/framework/frame.h" -#include "lib/framework/frameint.h" #include "widget.h" #include "widgint.h" #include "button.h" diff --git a/lib/widget/tip.cpp b/lib/widget/tip.cpp index 9196fc0e1..e51794dab 100644 --- a/lib/widget/tip.cpp +++ b/lib/widget/tip.cpp @@ -23,11 +23,10 @@ #include "lib/framework/frame.h" #include "lib/framework/wzapp.h" -#include "lib/framework/frameint.h" +#include "lib/ivis_opengl/screen.h" #include "widget.h" #include "widgint.h" #include "tip.h" -// FIXME Direct iVis implementation include! #include "lib/ivis_opengl/pieblitfunc.h" #include diff --git a/lib/widget/widget.cpp b/lib/widget/widget.cpp index bac2da5fa..14e4514e9 100644 --- a/lib/widget/widget.cpp +++ b/lib/widget/widget.cpp @@ -23,11 +23,11 @@ #include "lib/framework/frame.h" #include "lib/framework/string_ext.h" -#include "lib/framework/frameint.h" #include "lib/framework/utf.h" #include "lib/ivis_opengl/textdraw.h" #include "lib/ivis_opengl/pieblitfunc.h" #include "lib/ivis_opengl/piestate.h" +#include "lib/ivis_opengl/screen.h" #include "lib/gamelib/gtime.h" #include "widget.h" diff --git a/src/game.cpp b/src/game.cpp index 2ca5bb3f5..9ccf4318a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -28,7 +28,6 @@ #include "lib/framework/endian_hack.h" #include "lib/framework/wzconfig.h" #include "lib/framework/file.h" -#include "lib/framework/frameint.h" #include "lib/framework/physfs_ext.h" #include "lib/framework/strres.h" #include "lib/framework/opengl.h" diff --git a/src/init.cpp b/src/init.cpp index 2e4fd4e1e..14678e0de 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -728,6 +728,7 @@ void systemShutdown(void) debug(LOG_MAIN, "shutting down everything else"); pal_ShutDown(); // currently unused stub frameShutDown(); // close screen / SDL / resources / cursors / trig + screenShutDown(); closeConfig(); // "registry" close cleanSearchPath(); // clean PHYSFS search paths debug_exit(); // cleanup debug routines diff --git a/src/main.cpp b/src/main.cpp index 32de62868..53f55a9a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,6 @@ #endif // WZ_OS_WIN #include "lib/framework/input.h" -#include "lib/framework/frameint.h" #include "lib/framework/physfs_ext.h" #include "lib/exceptionhandler/exceptionhandler.h" #include "lib/exceptionhandler/dumpinfo.h" @@ -1262,6 +1261,10 @@ int realmain(int argc, char *argv[]) { return EXIT_FAILURE; } + if (!screenInitialise()) + { + return EXIT_FAILURE; + } war_SetWidth(pie_GetVideoBufferWidth()); war_SetHeight(pie_GetVideoBufferHeight()); diff --git a/src/multiint.cpp b/src/multiint.cpp index 24c277dc8..e28a42263 100644 --- a/src/multiint.cpp +++ b/src/multiint.cpp @@ -31,7 +31,6 @@ #include #include "lib/framework/frameresource.h" -#include "lib/framework/frameint.h" #include "lib/framework/file.h" #include "lib/framework/stdio_ext.h" diff --git a/src/multimenu.cpp b/src/multimenu.cpp index dafb7c149..a8ad7f6c6 100644 --- a/src/multimenu.cpp +++ b/src/multimenu.cpp @@ -60,7 +60,6 @@ #include "keymap.h" #include "keybind.h" #include "loop.h" -#include "lib/framework/frameint.h" #include "frontend.h" // //////////////////////////////////////////////////////////////////////////// diff --git a/src/seqdisp.cpp b/src/seqdisp.cpp index 649415b81..d055b9724 100644 --- a/src/seqdisp.cpp +++ b/src/seqdisp.cpp @@ -25,7 +25,6 @@ */ #include "lib/framework/frame.h" -#include "lib/framework/frameint.h" #include #include