1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# ####################################################################
5#  Copyright (C) 2005-2019 by the FIFE team
6#  http://www.fifengine.net
7#  This file is part of FIFE.
8#
9#  FIFE is free software; you can redistribute it and/or
10#  modify it under the terms of the GNU Lesser General Public
11#  License as published by the Free Software Foundation; either
12#  version 2.1 of the License, or (at your option) any later version.
13#
14#  This library is distributed in the hope that it will be useful,
15#  but WITHOUT ANY WARRANTY; without even the implied warranty of
16#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17#  Lesser General Public License for more details.
18#
19#  You should have received a copy of the GNU Lesser General Public
20#  License along with this library; if not, write to the
21#  Free Software Foundation, Inc.,
22#  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23# ####################################################################
24
25from __future__ import print_function
26import os, sys, unittest
27
28fife_path = os.path.join('..','..','engine','python')
29if os.path.isdir(fife_path) and fife_path not in sys.path:
30	sys.path.insert(0,fife_path)
31
32from fife import fife
33print("Using the FIFE python module found here: ", os.path.dirname(fife.__file__))
34
35from fife.extensions import fifelog
36
37def getEngine(minimized=False):
38	e = fife.Engine()
39	log = fifelog.LogManager(e, promptlog=False, filelog=True)
40	log.setVisibleModules('all')
41	s = e.getSettings()
42	s.setRenderBackend('OpenGL')
43	s.setDefaultFontPath('../data/FreeMono.ttf')
44	s.setDefaultFontGlyphs(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" +
45			".,!?-+/:();%`'*#=[]")
46	if minimized:
47		s.setScreenWidth(1)
48		s.setScreenHeight(1)
49	s.setDefaultFontSize(12)
50	e.init()
51	return e
52
53__all__ = []
54__all__.append('unittest')
55__all__.append('fife')
56__all__.append('fifelog')
57__all__.append('getEngine')
58