Changeset - r23999:b45b5e31e9de
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 4 years ago 2019-12-26 18:36:23
nielsm@indvikleren.dk
Fix: Let bootstrap GUI work on Win32 with Uniscribe but no Freetype
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/bootstrap_gui.cpp
Show inline comments
 
@@ -2,25 +2,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD 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, version 2.
 
 * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file bootstrap_gui.cpp Barely used user interface for bootstrapping OpenTTD, i.e. downloading the required content. */
 

	
 
#include "stdafx.h"
 
#include "base_media_base.h"
 
#include "blitter/factory.hpp"
 

	
 
#if defined(WITH_FREETYPE)
 
#if defined(WITH_FREETYPE) || defined(WITH_UNISCRIBE)
 

	
 
#include "core/geometry_func.hpp"
 
#include "fontcache.h"
 
#include "gfx_func.h"
 
#include "network/network.h"
 
#include "network/network_content_gui.h"
 
#include "openttd.h"
 
#include "strings_func.h"
 
#include "video/video_driver.hpp"
 
#include "window_func.h"
 

	
 
#include "widgets/bootstrap_widget.h"
 
@@ -209,25 +209,25 @@ public:
 
 * This requires all kinds of trickery that is needed to avoid the use of
 
 * sprites from the base graphics set which are pretty interwoven.
 
 * @return True if a base set exists, otherwise false.
 
 */
 
bool HandleBootstrap()
 
{
 
	if (BaseGraphics::GetUsedSet() != nullptr) return true;
 

	
 
	/* No user interface, bail out with an error. */
 
	if (BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure;
 

	
 
	/* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */
 
#if defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(_WIN32) || defined(__APPLE__))
 
#if (defined(_WIN32) && defined(WITH_UNISCRIBE)) || (defined(WITH_FREETYPE) && (defined(WITH_FONTCONFIG) || defined(__APPLE__)))
 
	if (!_network_available) goto failure;
 

	
 
	/* First tell the game we're bootstrapping. */
 
	_game_mode = GM_BOOTSTRAP;
 

	
 
	/* Initialise the freetype font code. */
 
	InitializeUnicodeGlyphMap();
 
	/* Next "force" finding a suitable freetype font as the local font is missing. */
 
	CheckForMissingGlyphs(false);
 

	
 
	/* Initialise the palette. The biggest step is 'faking' some recolour sprites.
 
	 * This way the mauve and gray colours work and we can show the user interface. */
0 comments (0 inline, 0 general)