]> git.lizzy.rs Git - minetest.git/blobdiff - src/drawscene.cpp
Let lighting be done only CPU side. Remove finalColorBlend implementation from shaders.
[minetest.git] / src / drawscene.cpp
index 218ddec68053de1585010456e60da20ecff228f6..9672affeae65841ae3b6e20b3a9c50d653a03316 100644 (file)
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "main.h" // for g_settings
 #include "settings.h"
 #include "clouds.h"
+#include "clientmap.h"
 #include "util/timetaker.h"
 
 typedef enum {
@@ -401,6 +402,7 @@ void draw_plain(Camera& camera, bool show_hud, Hud& hud,
                std::vector<aabb3f> hilightboxes, video::IVideoDriver* driver,
                bool draw_wield_tool, Client& client, gui::IGUIEnvironment* guienv)
 {
+       driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
 
        draw_selectionbox(driver, hud, hilightboxes, show_hud);
 
@@ -425,6 +427,13 @@ void draw_scene(video::IVideoDriver* driver, scene::ISceneManager* smgr,
                bool draw_crosshair = ((player->hud_flags & HUD_FLAG_CROSSHAIR_VISIBLE) &&
                                (camera.getCameraMode() != CAMERA_MODE_THIRD_FRONT));
 
+#ifdef HAVE_TOUCHSCREENGUI
+               try {
+                       draw_crosshair = !g_settings->getBool("touchtarget");
+               }
+               catch(SettingNotFoundException) {}
+#endif
+
                std::string draw_mode = g_settings->get("3d_mode");
 
                smgr->drawAll();
@@ -457,6 +466,14 @@ void draw_scene(video::IVideoDriver* driver, scene::ISceneManager* smgr,
                        draw_plain(camera, show_hud, hud, hilightboxes, driver,
                                        draw_wield_tool, client, guienv);
                }
+
+               /*
+                       Post effects
+               */
+               {
+                       client.getEnv().getClientMap().renderPostFx(camera.getCameraMode());
+               }
+
                //TODO how to make those 3d too
                if (show_hud)
                {