]> git.lizzy.rs Git - minetest.git/blob - src/client/render/factory.cpp
Fix scaled world-aligned textures being aligned inconsistently for non-normal drawtypes
[minetest.git] / src / client / render / factory.cpp
1 /*
2 Minetest
3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2017 numzero, Lobachevskiy Vitaliy <numzer0@yandex.ru>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #include "factory.h"
22 #include "log.h"
23 #include "plain.h"
24 #include "anaglyph.h"
25 #include "interlaced.h"
26 #include "pageflip.h"
27 #include "sidebyside.h"
28
29 RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevice *device,
30                 Client *client, Hud *hud)
31 {
32         if (stereo_mode == "none")
33                 return new RenderingCorePlain(device, client, hud);
34         if (stereo_mode == "anaglyph")
35                 return new RenderingCoreAnaglyph(device, client, hud);
36         if (stereo_mode == "interlaced")
37                 return new RenderingCoreInterlaced(device, client, hud);
38 #ifdef STEREO_PAGEFLIP_SUPPORTED
39         if (stereo_mode == "pageflip")
40                 return new RenderingCorePageflip(device, client, hud);
41 #endif
42         if (stereo_mode == "sidebyside")
43                 return new RenderingCoreSideBySide(device, client, hud);
44         if (stereo_mode == "topbottom")
45                 return new RenderingCoreSideBySide(device, client, hud, true);
46         if (stereo_mode == "crossview")
47                 return new RenderingCoreSideBySide(device, client, hud, false, true);
48
49         // fallback to plain renderer
50         errorstream << "Invalid rendering mode: " << stereo_mode << std::endl;
51         return new RenderingCorePlain(device, client, hud);
52 }