aboutsummaryrefslogtreecommitdiff
path: root/src/client/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/render')
-rw-r--r--src/client/render/core.cpp37
-rw-r--r--src/client/render/interlaced.cpp4
-rw-r--r--src/client/render/plain.cpp4
-rw-r--r--src/client/render/sidebyside.cpp7
-rw-r--r--src/client/render/stereo.cpp4
5 files changed, 26 insertions, 30 deletions
diff --git a/src/client/render/core.cpp b/src/client/render/core.cpp
index a7644681e..223af5142 100644
--- a/src/client/render/core.cpp
+++ b/src/client/render/core.cpp
@@ -27,11 +27,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client/minimap.h"
#include "client/content_cao.h"
-RenderingCore::RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud) :
- device(_device), driver(device->getVideoDriver()),
- smgr(device->getSceneManager()), guienv(device->getGUIEnvironment()),
- client(_client), camera(client->getCamera()),
- mapper(client->getMinimap()), hud(_hud)
+RenderingCore::RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud)
+ : device(_device), driver(device->getVideoDriver()), smgr(device->getSceneManager()),
+ guienv(device->getGUIEnvironment()), client(_client), camera(client->getCamera()),
+ mapper(client->getMinimap()), hud(_hud)
{
screensize = driver->getScreenSize();
virtual_size = screensize;
@@ -56,8 +55,7 @@ void RenderingCore::updateScreenSize()
}
void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_minimap,
- bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers,
- bool _draw_esp)
+ bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers, bool _draw_esp)
{
v2u32 ss = driver->getScreenSize();
if (screensize != ss) {
@@ -71,7 +69,7 @@ void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_min
draw_crosshair = _draw_crosshair;
draw_tracers = _draw_tracers;
draw_esp = _draw_esp;
-
+
beforeDraw();
drawAll();
}
@@ -80,29 +78,29 @@ void RenderingCore::drawTracersAndESP()
{
ClientEnvironment &env = client->getEnv();
Camera *camera = client->getCamera();
-
+
v3f camera_offset = intToFloat(camera->getOffset(), BS);
-
+
v3f eye_pos = (camera->getPosition() + camera->getDirection() - camera_offset);
-
- video::SMaterial material, oldmaterial;
- oldmaterial = driver->getMaterial2D();
+
+ video::SMaterial material, oldmaterial;
+ oldmaterial = driver->getMaterial2D();
material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setFlag(video::EMF_ZBUFFER, false);
material.setFlag(video::EMF_ZWRITE_ENABLE, false);
driver->setMaterial(material);
-
+
auto allObjects = env.getAllActiveObjects();
for (auto &it : allObjects) {
ClientActiveObject *cao = it.second;
if (cao->isLocalPlayer() || cao->getParent())
continue;
GenericCAO *obj = dynamic_cast<GenericCAO *>(cao);
- if (!obj)
+ if (! obj)
continue;
aabb3f box;
- if (!obj->getSelectionBox(&box))
+ if (! obj->getSelectionBox(&box))
continue;
v3f pos = obj->getPosition();
pos -= camera_offset;
@@ -112,10 +110,9 @@ void RenderingCore::drawTracersAndESP()
if (draw_esp)
driver->draw3DBox(box, video::SColor(255, 255, 255, 255));
if (draw_tracers)
- driver->draw3DLine(
- eye_pos, pos, video::SColor(255, 255, 255, 255));
+ driver->draw3DLine(eye_pos, pos, video::SColor(255, 255, 255, 255));
}
-
+
driver->setMaterial(oldmaterial);
}
@@ -137,7 +134,7 @@ void RenderingCore::drawHUD()
if (show_hud) {
if (draw_crosshair)
hud->drawCrosshair();
-
+
hud->drawHotbar(client->getEnv().getLocalPlayer()->getWieldIndex());
hud->drawLuaElements(camera->getOffset());
camera->drawNametags();
diff --git a/src/client/render/interlaced.cpp b/src/client/render/interlaced.cpp
index c5d9c9c24..2aadadc17 100644
--- a/src/client/render/interlaced.cpp
+++ b/src/client/render/interlaced.cpp
@@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client/tile.h"
RenderingCoreInterlaced::RenderingCoreInterlaced(
- IrrlichtDevice *_device, Client *_client, Hud *_hud) :
- RenderingCoreStereo(_device, _client, _hud)
+ IrrlichtDevice *_device, Client *_client, Hud *_hud)
+ : RenderingCoreStereo(_device, _client, _hud)
{
initMaterial();
}
diff --git a/src/client/render/plain.cpp b/src/client/render/plain.cpp
index 8ac5e106b..a130a14eb 100644
--- a/src/client/render/plain.cpp
+++ b/src/client/render/plain.cpp
@@ -27,8 +27,8 @@ inline u32 scaledown(u32 coef, u32 size)
}
RenderingCorePlain::RenderingCorePlain(
- IrrlichtDevice *_device, Client *_client, Hud *_hud) :
- RenderingCore(_device, _client, _hud)
+ IrrlichtDevice *_device, Client *_client, Hud *_hud)
+ : RenderingCore(_device, _client, _hud)
{
scale = g_settings->getU16("undersampling");
}
diff --git a/src/client/render/sidebyside.cpp b/src/client/render/sidebyside.cpp
index 89e4b5e80..ed08810db 100644
--- a/src/client/render/sidebyside.cpp
+++ b/src/client/render/sidebyside.cpp
@@ -22,10 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <ICameraSceneNode.h>
#include "client/hud.h"
-RenderingCoreSideBySide::RenderingCoreSideBySide(IrrlichtDevice *_device, Client *_client,
- Hud *_hud, bool _horizontal, bool _flipped) :
- RenderingCoreStereo(_device, _client, _hud),
- horizontal(_horizontal), flipped(_flipped)
+RenderingCoreSideBySide::RenderingCoreSideBySide(
+ IrrlichtDevice *_device, Client *_client, Hud *_hud, bool _horizontal, bool _flipped)
+ : RenderingCoreStereo(_device, _client, _hud), horizontal(_horizontal), flipped(_flipped)
{
}
diff --git a/src/client/render/stereo.cpp b/src/client/render/stereo.cpp
index 99997c967..967b5a78f 100644
--- a/src/client/render/stereo.cpp
+++ b/src/client/render/stereo.cpp
@@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
RenderingCoreStereo::RenderingCoreStereo(
- IrrlichtDevice *_device, Client *_client, Hud *_hud) :
- RenderingCore(_device, _client, _hud)
+ IrrlichtDevice *_device, Client *_client, Hud *_hud)
+ : RenderingCore(_device, _client, _hud)
{
eye_offset = BS * g_settings->getFloat("3d_paralax_strength");
}