aboutsummaryrefslogtreecommitdiff
path: root/src/client/renderingengine.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
commit6ccb5835ff55d85156be91473c598eca9d6cb9a6 (patch)
tree7f1eaf8b94694c8e24e206909ba8f55a1ebfbb3e /src/client/renderingengine.cpp
parent244713971a976e43e8740b6a9d9d122e37020ef2 (diff)
downloaddragonfireclient-6ccb5835ff55d85156be91473c598eca9d6cb9a6.tar.xz
Revert "Make Lint Happy"
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
Diffstat (limited to 'src/client/renderingengine.cpp')
-rw-r--r--src/client/renderingengine.cpp67
1 files changed, 36 insertions, 31 deletions
diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp
index 0b7a242fa..1534289d4 100644
--- a/src/client/renderingengine.cpp
+++ b/src/client/renderingengine.cpp
@@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gettext.h"
#include "../gui/guiSkin.h"
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \
!defined(SERVER) && !defined(__HAIKU__)
#define XORG_USED
#endif
@@ -58,6 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
RenderingEngine *RenderingEngine::s_singleton = nullptr;
+
static gui::GUISkin *createSkin(gui::IGUIEnvironment *environment,
gui::EGUI_SKIN_TYPE type, video::IVideoDriver *driver)
{
@@ -66,7 +67,7 @@ static gui::GUISkin *createSkin(gui::IGUIEnvironment *environment,
gui::IGUIFont *builtinfont = environment->getBuiltInFont();
gui::IGUIFontBitmap *bitfont = nullptr;
if (builtinfont && builtinfont->getType() == gui::EGFT_BITMAP)
- bitfont = (gui::IGUIFontBitmap *)builtinfont;
+ bitfont = (gui::IGUIFontBitmap*)builtinfont;
gui::IGUISpriteBank *bank = 0;
skin->setFont(builtinfont);
@@ -79,6 +80,7 @@ static gui::GUISkin *createSkin(gui::IGUIEnvironment *environment,
return skin;
}
+
RenderingEngine::RenderingEngine(IEventReceiver *receiver)
{
sanity_check(!s_singleton);
@@ -104,7 +106,7 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
u32 i;
for (i = 0; i != drivers.size(); i++) {
if (!strcasecmp(driverstring.c_str(),
- RenderingEngine::getVideoDriverName(drivers[i]))) {
+ RenderingEngine::getVideoDriverName(drivers[i]))) {
driverType = drivers[i];
break;
}
@@ -132,10 +134,9 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
#endif
#if ENABLE_GLES
// there is no standardized path for these on desktop
- std::string rel_path = std::string("client") + DIR_DELIM + "shaders" + DIR_DELIM +
- "Irrlicht";
- params.OGLES2ShaderPath =
- (porting::path_share + DIR_DELIM + rel_path + DIR_DELIM).c_str();
+ std::string rel_path = std::string("client") + DIR_DELIM
+ + "shaders" + DIR_DELIM + "Irrlicht";
+ params.OGLES2ShaderPath = (porting::path_share + DIR_DELIM + rel_path + DIR_DELIM).c_str();
#endif
m_device = createDeviceEx(params);
@@ -143,8 +144,8 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
s_singleton = this;
- auto skin = createSkin(m_device->getGUIEnvironment(), gui::EGST_WINDOWS_METALLIC,
- driver);
+ auto skin = createSkin(m_device->getGUIEnvironment(),
+ gui::EGST_WINDOWS_METALLIC, driver);
m_device->getGUIEnvironment()->setSkin(skin);
skin->drop();
}
@@ -233,7 +234,8 @@ bool RenderingEngine::setupTopLevelWindow(const std::string &name)
/* Setting general properties for the top level window */
verbosestream << "Client: Configuring general top level"
- << " window properties" << std::endl;
+ << " window properties"
+ << std::endl;
bool result = setWindowIcon();
return result;
@@ -244,16 +246,17 @@ void RenderingEngine::setupTopLevelXorgWindow(const std::string &name)
#ifdef XORG_USED
const video::SExposedVideoData exposedData = driver->getExposedVideoData();
- Display *x11_dpl =
- reinterpret_cast<Display *>(exposedData.OpenGLLinux.X11Display);
+ Display *x11_dpl = reinterpret_cast<Display *>(exposedData.OpenGLLinux.X11Display);
if (x11_dpl == NULL) {
warningstream << "Client: Could not find X11 Display in ExposedVideoData"
- << std::endl;
+ << std::endl;
return;
}
verbosestream << "Client: Configuring X11-specific top level"
- << " window properties" << std::endl;
+ << " window properties"
+ << std::endl;
+
Window x11_win = reinterpret_cast<Window>(exposedData.OpenGLLinux.X11Window);
@@ -281,35 +284,38 @@ void RenderingEngine::setupTopLevelXorgWindow(const std::string &name)
// more, using gtk/gdk as the model it would seem that not using a FQDN is
// not an issue for modern Xorg window managers.
- verbosestream << "Client: Setting Xorg window manager Properties" << std::endl;
+ verbosestream << "Client: Setting Xorg window manager Properties"
+ << std::endl;
- XSetWMProperties(x11_dpl, x11_win, NULL, NULL, NULL, 0, NULL, NULL, NULL);
+ XSetWMProperties (x11_dpl, x11_win, NULL, NULL, NULL, 0, NULL, NULL, NULL);
// Set the _NET_WM_PID window property according to the EWMH spec. _NET_WM_PID
// (in conjunction with WM_CLIENT_MACHINE) can be used by window managers to
// force a shutdown of an application if it doesn't respond to the destroy
// window message.
- verbosestream << "Client: Setting Xorg _NET_WM_PID extened window manager "
- "property"
- << std::endl;
+ verbosestream << "Client: Setting Xorg _NET_WM_PID extened window manager property"
+ << std::endl;
Atom NET_WM_PID = XInternAtom(x11_dpl, "_NET_WM_PID", false);
pid_t pid = getpid();
- XChangeProperty(x11_dpl, x11_win, NET_WM_PID, XA_CARDINAL, 32, PropModeReplace,
- reinterpret_cast<unsigned char *>(&pid), 1);
+ XChangeProperty(x11_dpl, x11_win, NET_WM_PID,
+ XA_CARDINAL, 32, PropModeReplace,
+ reinterpret_cast<unsigned char *>(&pid),1);
// Set the WM_CLIENT_LEADER window property here. Minetest has only one
// window and that window will always be the leader.
- verbosestream << "Client: Setting Xorg WM_CLIENT_LEADER property" << std::endl;
+ verbosestream << "Client: Setting Xorg WM_CLIENT_LEADER property"
+ << std::endl;
Atom WM_CLIENT_LEADER = XInternAtom(x11_dpl, "WM_CLIENT_LEADER", false);
- XChangeProperty(x11_dpl, x11_win, WM_CLIENT_LEADER, XA_WINDOW, 32,
- PropModeReplace, reinterpret_cast<unsigned char *>(&x11_win), 1);
+ XChangeProperty (x11_dpl, x11_win, WM_CLIENT_LEADER,
+ XA_WINDOW, 32, PropModeReplace,
+ reinterpret_cast<unsigned char *>(&x11_win), 1);
#endif
}
@@ -537,8 +543,8 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text,
/*
Draws the menu scene including (optional) cloud background.
*/
-void RenderingEngine::_draw_menu_scene(
- gui::IGUIEnvironment *guienv, float dtime, bool clouds)
+void RenderingEngine::_draw_menu_scene(gui::IGUIEnvironment *guienv,
+ float dtime, bool clouds)
{
bool cloud_menu_background = clouds && g_settings->getBool("menu_clouds");
if (cloud_menu_background) {
@@ -598,11 +604,9 @@ void RenderingEngine::_finalize()
}
void RenderingEngine::_draw_scene(video::SColor skycolor, bool show_hud,
- bool show_minimap, bool draw_wield_tool, bool draw_crosshair,
- bool draw_tracers, bool draw_esp)
+ bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_tracers, bool draw_esp)
{
- core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair,
- draw_tracers, draw_esp);
+ core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair, draw_tracers, draw_esp);
}
const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
@@ -675,6 +679,7 @@ float RenderingEngine::getDisplayDensity()
#elif defined(_WIN32)
+
static float calcDisplayDensity(irr::video::IVideoDriver *driver)
{
HWND hWnd;
@@ -720,7 +725,7 @@ v2u32 RenderingEngine::getDisplaySize()
return deskres;
}
-#else // __ANDROID__
+#else // __ANDROID__
float RenderingEngine::getDisplayDensity()
{
return porting::getDisplayDensity();