mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +00:00
Remove irr
namespace (#16309)
This commit is contained in:
parent
7e22c72492
commit
61551cfc3a
381 changed files with 680 additions and 1632 deletions
|
@ -599,7 +599,7 @@ void Camera::wield(const ItemStack &item)
|
|||
}
|
||||
}
|
||||
|
||||
void Camera::drawWieldedTool(irr::core::matrix4* translation)
|
||||
void Camera::drawWieldedTool(core::matrix4* translation)
|
||||
{
|
||||
// Clear Z buffer so that the wielded tool stays in front of world geometry
|
||||
m_wieldmgr->getVideoDriver()->clearBuffers(video::ECBF_DEPTH);
|
||||
|
@ -612,12 +612,12 @@ void Camera::drawWieldedTool(irr::core::matrix4* translation)
|
|||
cam->setFarValue(1000);
|
||||
if (translation != NULL)
|
||||
{
|
||||
irr::core::matrix4 startMatrix = cam->getAbsoluteTransformation();
|
||||
irr::core::vector3df focusPoint = (cam->getTarget()
|
||||
core::matrix4 startMatrix = cam->getAbsoluteTransformation();
|
||||
core::vector3df focusPoint = (cam->getTarget()
|
||||
- cam->getAbsolutePosition()).setLength(1)
|
||||
+ cam->getAbsolutePosition();
|
||||
|
||||
irr::core::vector3df camera_pos =
|
||||
core::vector3df camera_pos =
|
||||
(startMatrix * *translation).getTranslation();
|
||||
cam->setPosition(camera_pos);
|
||||
cam->updateAbsolutePosition();
|
||||
|
@ -685,7 +685,7 @@ void Camera::removeNametag(Nametag *nametag)
|
|||
|
||||
std::array<core::plane3d<f32>, 4> Camera::getFrustumCullPlanes() const
|
||||
{
|
||||
using irr::scene::SViewFrustum;
|
||||
using scene::SViewFrustum;
|
||||
const auto &frustum_planes = m_cameranode->getViewFrustum()->planes;
|
||||
return {
|
||||
frustum_planes[SViewFrustum::VF_LEFT_PLANE],
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
// Draw the wielded tool.
|
||||
// This has to happen *after* the main scene is drawn.
|
||||
// Warning: This clears the Z buffer.
|
||||
void drawWieldedTool(irr::core::matrix4* translation=NULL);
|
||||
void drawWieldedTool(core::matrix4* translation=NULL);
|
||||
|
||||
// Toggle the current camera mode
|
||||
void toggleCameraMode()
|
||||
|
|
|
@ -302,8 +302,8 @@ void ClientLauncher::init_input()
|
|||
|
||||
void ClientLauncher::init_joysticks()
|
||||
{
|
||||
irr::core::array<irr::SJoystickInfo> infos;
|
||||
std::vector<irr::SJoystickInfo> joystick_infos;
|
||||
core::array<SJoystickInfo> infos;
|
||||
std::vector<SJoystickInfo> joystick_infos;
|
||||
|
||||
// Make sure this is called maximum once per
|
||||
// irrlicht device, otherwise it will give you
|
||||
|
|
|
@ -26,12 +26,12 @@ class Client;
|
|||
class ITextureSource;
|
||||
class PartialMeshBuffer;
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class IMeshBuffer;
|
||||
}
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class LocalPlayer;
|
|||
struct ItemStack;
|
||||
class WieldMeshSceneNode;
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class IAnimatedMeshSceneNode;
|
||||
class ISceneNode;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
class IShaderSource;
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class ISceneManager;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
namespace irr::scene {
|
||||
namespace scene {
|
||||
class IMeshSceneNode;
|
||||
class IBillboardSceneNode;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "irrlichttypes_bloated.h"
|
||||
#include "clientsimpleobject.h"
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class ISceneManager;
|
||||
}
|
||||
|
|
|
@ -72,12 +72,12 @@ void FontEngine::clearCache()
|
|||
}
|
||||
}
|
||||
|
||||
irr::gui::IGUIFont *FontEngine::getFont(FontSpec spec)
|
||||
gui::IGUIFont *FontEngine::getFont(FontSpec spec)
|
||||
{
|
||||
return getFont(spec, false);
|
||||
}
|
||||
|
||||
irr::gui::IGUIFont *FontEngine::getFont(FontSpec spec, bool may_fail)
|
||||
gui::IGUIFont *FontEngine::getFont(FontSpec spec, bool may_fail)
|
||||
{
|
||||
if (spec.mode == FM_Unspecified) {
|
||||
spec.mode = s_default_font_mode;
|
||||
|
@ -310,7 +310,7 @@ gui::IGUIFont *FontEngine::initFont(FontSpec spec)
|
|||
<< " " << size << "pt" << std::endl;
|
||||
|
||||
// Grab the face.
|
||||
if (auto *face = irr::gui::SGUITTFace::loadFace(font_path)) {
|
||||
if (auto *face = gui::SGUITTFace::loadFace(font_path)) {
|
||||
auto *font = createFont(face);
|
||||
face->drop();
|
||||
return font;
|
||||
|
|
|
@ -13,11 +13,9 @@
|
|||
#include "irrString.h" // utf8_to_wide
|
||||
#include "threading/mutex_auto_lock.h"
|
||||
|
||||
namespace irr {
|
||||
namespace gui {
|
||||
class IGUIEnvironment;
|
||||
class IGUIFont;
|
||||
}
|
||||
namespace gui {
|
||||
class IGUIEnvironment;
|
||||
class IGUIFont;
|
||||
}
|
||||
|
||||
#define FONT_SIZE_UNSPECIFIED 0xFFFFFFFF
|
||||
|
@ -76,9 +74,9 @@ public:
|
|||
~FontEngine();
|
||||
|
||||
// Get best possible font specified by FontSpec
|
||||
irr::gui::IGUIFont *getFont(FontSpec spec);
|
||||
gui::IGUIFont *getFont(FontSpec spec);
|
||||
|
||||
irr::gui::IGUIFont *getFont(unsigned int font_size=FONT_SIZE_UNSPECIFIED,
|
||||
gui::IGUIFont *getFont(unsigned int font_size=FONT_SIZE_UNSPECIFIED,
|
||||
FontMode mode=FM_Unspecified)
|
||||
{
|
||||
FontSpec spec(font_size, mode, m_default_bold, m_default_italic);
|
||||
|
@ -148,7 +146,7 @@ public:
|
|||
void clearMediaFonts();
|
||||
|
||||
private:
|
||||
irr::gui::IGUIFont *getFont(FontSpec spec, bool may_fail);
|
||||
gui::IGUIFont *getFont(FontSpec spec, bool may_fail);
|
||||
|
||||
/** update content of font cache in case of a setting change made it invalid */
|
||||
void updateCache();
|
||||
|
@ -174,7 +172,7 @@ private:
|
|||
std::recursive_mutex m_font_mutex;
|
||||
|
||||
/** internal storage for caching fonts of different size */
|
||||
std::map<unsigned int, irr::gui::IGUIFont*> m_font_cache[FontSpec::MAX_VARIANTS];
|
||||
std::map<unsigned int, gui::IGUIFont*> m_font_cache[FontSpec::MAX_VARIANTS];
|
||||
|
||||
/** media-provided faces, indexed by filename (without extension) */
|
||||
std::unordered_map<std::string, irr_ptr<gui::SGUITTFace>> m_media_faces;
|
||||
|
|
|
@ -1013,7 +1013,7 @@ void Game::run()
|
|||
m_touch_simulate_aux1 = g_settings->getBool("fast_move")
|
||||
&& client->checkPrivilege("fast");
|
||||
|
||||
const irr::core::dimension2du initial_screen_size(
|
||||
const core::dimension2du initial_screen_size(
|
||||
g_settings->getU16("screen_w"),
|
||||
g_settings->getU16("screen_h")
|
||||
);
|
||||
|
@ -3385,10 +3385,10 @@ PointedThing Game::updatePointedThing(
|
|||
|
||||
// Modify final color a bit with time
|
||||
u32 timer = client->getEnv().getFrameTime() % 5000;
|
||||
float timerf = (float) (irr::core::PI * ((timer / 2500.0) - 0.5));
|
||||
float timerf = (float) (core::PI * ((timer / 2500.0) - 0.5));
|
||||
float sin_r = 0.08f * std::sin(timerf);
|
||||
float sin_g = 0.08f * std::sin(timerf + irr::core::PI * 0.5f);
|
||||
float sin_b = 0.08f * std::sin(timerf + irr::core::PI);
|
||||
float sin_g = 0.08f * std::sin(timerf + core::PI * 0.5f);
|
||||
float sin_b = 0.08f * std::sin(timerf + core::PI);
|
||||
c.setRed(core::clamp(core::round32(c.getRed() * (0.8 + sin_r)), 0, 255));
|
||||
c.setGreen(core::clamp(core::round32(c.getGreen() * (0.8 + sin_g)), 0, 255));
|
||||
c.setBlue(core::clamp(core::round32(c.getBlue() * (0.8 + sin_b)), 0, 255));
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <IGUIEnvironment.h>
|
||||
#include "game.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class Client;
|
||||
class EnrichedString;
|
||||
class GUIChatConsole;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <rect.h>
|
||||
#include <SColor.h>
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IImage;
|
||||
class ITexture;
|
||||
|
|
|
@ -394,9 +394,9 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
|||
(e->style & HUD_STYLE_MONO) ? FM_Mono : FM_Unspecified,
|
||||
e->style & HUD_STYLE_BOLD, e->style & HUD_STYLE_ITALIC));
|
||||
|
||||
irr::gui::CGUITTFont *ttfont = nullptr;
|
||||
if (textfont->getType() == irr::gui::EGFT_CUSTOM)
|
||||
ttfont = static_cast<irr::gui::CGUITTFont *>(textfont);
|
||||
gui::CGUITTFont *ttfont = nullptr;
|
||||
if (textfont->getType() == gui::EGFT_CUSTOM)
|
||||
ttfont = static_cast<gui::CGUITTFont *>(textfont);
|
||||
|
||||
video::SColor color(255, (e->number >> 16) & 0xFF,
|
||||
(e->number >> 8) & 0xFF,
|
||||
|
|
|
@ -20,12 +20,12 @@ class InventoryList;
|
|||
class LocalPlayer;
|
||||
struct ItemStack;
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class IMesh;
|
||||
}
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class ITexture;
|
||||
class IVideoDriver;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <rect.h>
|
||||
#include <SColor.h>
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class IImage;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <set>
|
||||
#include <string>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
// This file is only used for internal generation of images.
|
||||
// Use texturesource.h to handle textures.
|
||||
|
|
|
@ -111,7 +111,7 @@ void MyEventReceiver::setKeyDown(GameKeyType action, bool is_down)
|
|||
|
||||
bool MyEventReceiver::OnEvent(const SEvent &event)
|
||||
{
|
||||
if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
|
||||
if (event.EventType == EET_LOG_TEXT_EVENT) {
|
||||
static const LogLevel irr_loglev_conv[] = {
|
||||
LL_VERBOSE, // ELL_DEBUG
|
||||
LL_INFO, // ELL_INFORMATION
|
||||
|
@ -178,18 +178,18 @@ bool MyEventReceiver::OnEvent(const SEvent &event)
|
|||
}
|
||||
|
||||
// Remember whether each key is down or up
|
||||
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
|
||||
if (event.EventType == EET_KEY_INPUT_EVENT) {
|
||||
KeyPress keyCode(event.KeyInput);
|
||||
if (setKeyDown(keyCode, event.KeyInput.PressedDown))
|
||||
return true;
|
||||
} else if (g_touchcontrols && event.EventType == irr::EET_TOUCH_INPUT_EVENT) {
|
||||
} else if (g_touchcontrols && event.EventType == EET_TOUCH_INPUT_EVENT) {
|
||||
// In case of touchcontrols, we have to handle different events
|
||||
g_touchcontrols->translateEvent(event);
|
||||
return true;
|
||||
} else if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) {
|
||||
} else if (event.EventType == EET_JOYSTICK_INPUT_EVENT) {
|
||||
// joystick may be nullptr if game is launched with '--random-input' parameter
|
||||
return joystick && joystick->handleEvent(event.JoystickEvent);
|
||||
} else if (event.EventType == irr::EET_MOUSE_INPUT_EVENT) {
|
||||
} else if (event.EventType == EET_MOUSE_INPUT_EVENT) {
|
||||
// Handle mouse events
|
||||
switch (event.MouseInput.Event) {
|
||||
case EMIE_LMOUSE_PRESSED_DOWN:
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
class Client;
|
||||
struct ItemStack;
|
||||
typedef std::vector<video::SColor> Palette; // copied from src/client/texturesource.h
|
||||
namespace irr::video { class ITexture; }
|
||||
namespace video { class ITexture; }
|
||||
|
||||
// Caches data needed to draw an itemstack
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "util/string.h"
|
||||
#include "util/numeric.h"
|
||||
|
||||
bool JoystickButtonCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const
|
||||
bool JoystickButtonCmb::isTriggered(const SEvent::SJoystickEvent &ev) const
|
||||
{
|
||||
u32 buttons = ev.ButtonStates;
|
||||
|
||||
|
@ -18,7 +18,7 @@ bool JoystickButtonCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const
|
|||
return buttons == compare_mask;
|
||||
}
|
||||
|
||||
bool JoystickAxisCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const
|
||||
bool JoystickAxisCmb::isTriggered(const SEvent::SJoystickEvent &ev) const
|
||||
{
|
||||
s16 ax_val = ev.Axis[axis_to_compare];
|
||||
|
||||
|
@ -197,7 +197,7 @@ JoystickController::JoystickController()
|
|||
clear();
|
||||
}
|
||||
|
||||
void JoystickController::onJoystickConnect(const std::vector<irr::SJoystickInfo> &joystick_infos)
|
||||
void JoystickController::onJoystickConnect(const std::vector<SJoystickInfo> &joystick_infos)
|
||||
{
|
||||
s32 id = g_settings->getS32("joystick_id");
|
||||
std::string layout = g_settings->get("joystick_type");
|
||||
|
@ -229,7 +229,7 @@ void JoystickController::setLayoutFromControllerName(const std::string &name)
|
|||
}
|
||||
}
|
||||
|
||||
bool JoystickController::handleEvent(const irr::SEvent::SJoystickEvent &ev)
|
||||
bool JoystickController::handleEvent(const SEvent::SJoystickEvent &ev)
|
||||
{
|
||||
if (ev.Joystick != m_joystick_id)
|
||||
return false;
|
||||
|
|
|
@ -31,7 +31,7 @@ struct JoystickAxisLayout {
|
|||
|
||||
struct JoystickCombination {
|
||||
|
||||
virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const=0;
|
||||
virtual bool isTriggered(const SEvent::SJoystickEvent &ev) const=0;
|
||||
|
||||
GameKeyType key;
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ struct JoystickButtonCmb : public JoystickCombination {
|
|||
|
||||
virtual ~JoystickButtonCmb() = default;
|
||||
|
||||
virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const;
|
||||
virtual bool isTriggered(const SEvent::SJoystickEvent &ev) const;
|
||||
|
||||
u32 filter_mask;
|
||||
u32 compare_mask;
|
||||
|
@ -69,7 +69,7 @@ struct JoystickAxisCmb : public JoystickCombination {
|
|||
|
||||
virtual ~JoystickAxisCmb() = default;
|
||||
|
||||
bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const override;
|
||||
bool isTriggered(const SEvent::SJoystickEvent &ev) const override;
|
||||
|
||||
u16 axis_to_compare;
|
||||
|
||||
|
@ -91,9 +91,9 @@ class JoystickController {
|
|||
public:
|
||||
JoystickController();
|
||||
|
||||
void onJoystickConnect(const std::vector<irr::SJoystickInfo> &joystick_infos);
|
||||
void onJoystickConnect(const std::vector<SJoystickInfo> &joystick_infos);
|
||||
|
||||
bool handleEvent(const irr::SEvent::SJoystickEvent &ev);
|
||||
bool handleEvent(const SEvent::SJoystickEvent &ev);
|
||||
void clear();
|
||||
|
||||
void releaseAllKeys()
|
||||
|
|
|
@ -15,21 +15,21 @@
|
|||
|
||||
struct table_key {
|
||||
std::string Name; // An EKEY_CODE 'symbol' name as a string
|
||||
irr::EKEY_CODE Key;
|
||||
EKEY_CODE Key;
|
||||
wchar_t Char; // L'\0' means no character assigned
|
||||
std::string LangName; // empty string means it doesn't have a human description
|
||||
};
|
||||
|
||||
#define DEFINEKEY1(x, lang) /* Irrlicht key without character */ \
|
||||
{ #x, irr::x, L'\0', lang },
|
||||
{ #x, x, L'\0', lang },
|
||||
#define DEFINEKEY2(x, ch, lang) /* Irrlicht key with character */ \
|
||||
{ #x, irr::x, ch, lang },
|
||||
{ #x, x, ch, lang },
|
||||
#define DEFINEKEY3(ch) /* single Irrlicht key (e.g. KEY_KEY_X) */ \
|
||||
{ "KEY_KEY_" TOSTRING(ch), irr::KEY_KEY_ ## ch, (wchar_t) *TOSTRING(ch), TOSTRING(ch) },
|
||||
{ "KEY_KEY_" TOSTRING(ch), KEY_KEY_ ## ch, (wchar_t) *TOSTRING(ch), TOSTRING(ch) },
|
||||
#define DEFINEKEY4(ch) /* single Irrlicht function key (e.g. KEY_F3) */ \
|
||||
{ "KEY_F" TOSTRING(ch), irr::KEY_F ## ch, L'\0', "F" TOSTRING(ch) },
|
||||
{ "KEY_F" TOSTRING(ch), KEY_F ## ch, L'\0', "F" TOSTRING(ch) },
|
||||
#define DEFINEKEY5(ch) /* key without Irrlicht keycode */ \
|
||||
{ ch, irr::KEY_KEY_CODES_COUNT, (wchar_t) *ch, ch },
|
||||
{ ch, KEY_KEY_CODES_COUNT, (wchar_t) *ch, ch },
|
||||
|
||||
#define N_(text) text
|
||||
|
||||
|
@ -224,7 +224,7 @@ static std::vector<table_key> table = {
|
|||
DEFINEKEY5("_")
|
||||
};
|
||||
|
||||
static const table_key invalid_key = {"", irr::KEY_UNKNOWN, L'\0', ""};
|
||||
static const table_key invalid_key = {"", KEY_UNKNOWN, L'\0', ""};
|
||||
|
||||
#undef N_
|
||||
|
||||
|
@ -241,11 +241,11 @@ static const table_key &lookup_keychar(wchar_t Char)
|
|||
|
||||
// Create a new entry in the lookup table if one is not available.
|
||||
auto newsym = wide_to_utf8(std::wstring_view(&Char, 1));
|
||||
table_key new_key {newsym, irr::KEY_KEY_CODES_COUNT, Char, newsym};
|
||||
table_key new_key {newsym, KEY_KEY_CODES_COUNT, Char, newsym};
|
||||
return table.emplace_back(std::move(new_key));
|
||||
}
|
||||
|
||||
static const table_key &lookup_keykey(irr::EKEY_CODE key)
|
||||
static const table_key &lookup_keykey(EKEY_CODE key)
|
||||
{
|
||||
if (!Keycode::isValid(key))
|
||||
return invalid_key;
|
||||
|
@ -278,18 +278,18 @@ static const table_key &lookup_scancode(const u32 scancode)
|
|||
{
|
||||
auto key = RenderingEngine::get_raw_device()->getKeyFromScancode(scancode);
|
||||
return std::holds_alternative<EKEY_CODE>(key) ?
|
||||
lookup_keykey(std::get<irr::EKEY_CODE>(key)) :
|
||||
lookup_keykey(std::get<EKEY_CODE>(key)) :
|
||||
lookup_keychar(std::get<wchar_t>(key));
|
||||
}
|
||||
|
||||
static const table_key &lookup_scancode(const std::variant<u32, irr::EKEY_CODE> &scancode)
|
||||
static const table_key &lookup_scancode(const std::variant<u32, EKEY_CODE> &scancode)
|
||||
{
|
||||
return std::holds_alternative<irr::EKEY_CODE>(scancode) ?
|
||||
lookup_keykey(std::get<irr::EKEY_CODE>(scancode)) :
|
||||
return std::holds_alternative<EKEY_CODE>(scancode) ?
|
||||
lookup_keykey(std::get<EKEY_CODE>(scancode)) :
|
||||
lookup_scancode(std::get<u32>(scancode));
|
||||
}
|
||||
|
||||
void KeyPress::loadFromKey(irr::EKEY_CODE keycode, wchar_t keychar)
|
||||
void KeyPress::loadFromKey(EKEY_CODE keycode, wchar_t keychar)
|
||||
{
|
||||
scancode = RenderingEngine::get_raw_device()->getScancodeFromKey(Keycode(keycode, keychar));
|
||||
}
|
||||
|
@ -302,13 +302,13 @@ KeyPress::KeyPress(const std::string &name)
|
|||
loadFromKey(key.Key, key.Char);
|
||||
}
|
||||
|
||||
KeyPress::KeyPress(const irr::SEvent::SKeyInput &in)
|
||||
KeyPress::KeyPress(const SEvent::SKeyInput &in)
|
||||
{
|
||||
if (USE_SDL2) {
|
||||
if (in.SystemKeyCode)
|
||||
scancode.emplace<u32>(in.SystemKeyCode);
|
||||
else
|
||||
scancode.emplace<irr::EKEY_CODE>(in.Key);
|
||||
scancode.emplace<EKEY_CODE>(in.Key);
|
||||
} else {
|
||||
loadFromKey(in.Key, in.Char);
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ std::string KeyPress::name() const
|
|||
return formatScancode();
|
||||
}
|
||||
|
||||
irr::EKEY_CODE KeyPress::getKeycode() const
|
||||
EKEY_CODE KeyPress::getKeycode() const
|
||||
{
|
||||
return lookup_scancode(scancode).Key;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
KeyPress(const std::string &name);
|
||||
|
||||
KeyPress(const irr::SEvent::SKeyInput &in);
|
||||
KeyPress(const SEvent::SKeyInput &in);
|
||||
|
||||
// Get a string representation that is suitable for use in minetest.conf
|
||||
std::string sym() const;
|
||||
|
@ -29,7 +29,7 @@ public:
|
|||
std::string name() const;
|
||||
|
||||
// Get the corresponding keycode or KEY_UNKNOWN if one is not available
|
||||
irr::EKEY_CODE getKeycode() const;
|
||||
EKEY_CODE getKeycode() const;
|
||||
|
||||
// Get the corresponding keychar or '\0' if one is not available
|
||||
wchar_t getKeychar() const;
|
||||
|
@ -57,20 +57,20 @@ public:
|
|||
// Check whether the keypress is valid
|
||||
operator bool() const
|
||||
{
|
||||
return std::holds_alternative<irr::EKEY_CODE>(scancode) ?
|
||||
Keycode::isValid(std::get<irr::EKEY_CODE>(scancode)) :
|
||||
return std::holds_alternative<EKEY_CODE>(scancode) ?
|
||||
Keycode::isValid(std::get<EKEY_CODE>(scancode)) :
|
||||
std::get<u32>(scancode) != 0;
|
||||
}
|
||||
|
||||
static KeyPress getSpecialKey(const std::string &name);
|
||||
|
||||
private:
|
||||
using value_type = std::variant<u32, irr::EKEY_CODE>;
|
||||
using value_type = std::variant<u32, EKEY_CODE>;
|
||||
bool loadFromScancode(const std::string &name);
|
||||
void loadFromKey(irr::EKEY_CODE keycode, wchar_t keychar);
|
||||
void loadFromKey(EKEY_CODE keycode, wchar_t keychar);
|
||||
std::string formatScancode() const;
|
||||
|
||||
value_type scancode = irr::KEY_UNKNOWN;
|
||||
value_type scancode = KEY_UNKNOWN;
|
||||
|
||||
friend std::hash<KeyPress>;
|
||||
};
|
||||
|
|
|
@ -316,7 +316,7 @@ void final_color_blend(video::SColor *result,
|
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
b += emphase_blue_when_dark[irr::core::clamp((s32) ((r + g + b) / 3 * 255),
|
||||
b += emphase_blue_when_dark[core::clamp((s32) ((r + g + b) / 3 * 255),
|
||||
0, 255) / 8] / 255.0f;
|
||||
|
||||
result->setRed(core::clamp((s32) (r * 255.0f), 0, 255));
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace irr::video {
|
||||
namespace video {
|
||||
class IVideoDriver;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,15 +8,12 @@
|
|||
#include "SMaterialLayer.h"
|
||||
#include "nodedef.h"
|
||||
|
||||
namespace irr {
|
||||
namespace scene {
|
||||
class IAnimatedMesh;
|
||||
class IMesh;
|
||||
class IMeshBuffer;
|
||||
}
|
||||
namespace scene {
|
||||
class IAnimatedMesh;
|
||||
class IMesh;
|
||||
class IMeshBuffer;
|
||||
}
|
||||
|
||||
using namespace irr;
|
||||
|
||||
/*!
|
||||
* Applies shading to a color based on the surface's
|
||||
|
|
|
@ -481,7 +481,7 @@ video::ITexture *Minimap::getMinimapTexture()
|
|||
|
||||
map_image->fill(video::SColor(255, 0, 0, 0));
|
||||
image->copyTo(map_image,
|
||||
irr::core::vector2d<int> {
|
||||
core::vector2d<int> {
|
||||
((data->mode.map_size - (static_cast<int>(dim.Width))) >> 1)
|
||||
- data->pos.X / data->mode.scale,
|
||||
((data->mode.map_size - (static_cast<int>(dim.Height))) >> 1)
|
||||
|
|
|
@ -16,16 +16,14 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace irr {
|
||||
namespace video {
|
||||
class IVideoDriver;
|
||||
class IImage;
|
||||
class ITexture;
|
||||
}
|
||||
namespace video {
|
||||
class IVideoDriver;
|
||||
class IImage;
|
||||
class ITexture;
|
||||
}
|
||||
|
||||
namespace scene {
|
||||
class ISceneNode;
|
||||
}
|
||||
namespace scene {
|
||||
class ISceneNode;
|
||||
}
|
||||
|
||||
class Client;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <unordered_map>
|
||||
#include "../particles.h"
|
||||
|
||||
namespace irr::video {
|
||||
namespace video {
|
||||
class ITexture;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,7 @@
|
|||
#include "irr_v2d.h"
|
||||
#include <SColor.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class IrrlichtDevice;
|
||||
}
|
||||
class IrrlichtDevice;
|
||||
|
||||
class ShadowRenderer;
|
||||
class Camera;
|
||||
|
|
|
@ -18,7 +18,7 @@ class Client;
|
|||
class Hud;
|
||||
class ShadowRenderer;
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IRenderTarget;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ static inline auto getVideoDriverName(video::E_DRIVER_TYPE driver)
|
|||
return RenderingEngine::getVideoDriverInfo(driver).friendly_name;
|
||||
}
|
||||
|
||||
static irr::IrrlichtDevice *createDevice(SIrrlichtCreationParameters params, std::optional<video::E_DRIVER_TYPE> requested_driver)
|
||||
static IrrlichtDevice *createDevice(SIrrlichtCreationParameters params, std::optional<video::E_DRIVER_TYPE> requested_driver)
|
||||
{
|
||||
if (requested_driver) {
|
||||
params.DriverType = *requested_driver;
|
||||
|
@ -189,7 +189,7 @@ RenderingEngine::RenderingEngine(MyEventReceiver *receiver)
|
|||
|
||||
SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
|
||||
if (tracestream)
|
||||
params.LoggingLevel = irr::ELL_DEBUG;
|
||||
params.LoggingLevel = ELL_DEBUG;
|
||||
params.WindowSize = core::dimension2d<u32>(screen_w, screen_h);
|
||||
params.AntiAlias = fsaa;
|
||||
params.Fullscreen = fullscreen;
|
||||
|
@ -407,7 +407,7 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud,
|
|||
core->draw(skycolor, show_hud, draw_wield_tool, draw_crosshair);
|
||||
}
|
||||
|
||||
const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(irr::video::E_DRIVER_TYPE type)
|
||||
const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(video::E_DRIVER_TYPE type)
|
||||
{
|
||||
static const std::unordered_map<int, VideoDriverInfo> driver_info_map = {
|
||||
{(int)video::EDT_NULL, {"null", "NULL Driver"}},
|
||||
|
@ -432,7 +432,7 @@ float RenderingEngine::getDisplayDensity()
|
|||
}
|
||||
|
||||
void RenderingEngine::autosaveScreensizeAndCo(
|
||||
const irr::core::dimension2d<u32> initial_screen_size,
|
||||
const core::dimension2d<u32> initial_screen_size,
|
||||
const bool initial_window_maximized)
|
||||
{
|
||||
if (!g_settings->getBool("autosave_screensize"))
|
||||
|
@ -446,11 +446,11 @@ void RenderingEngine::autosaveScreensizeAndCo(
|
|||
// Don't save the fullscreen size, we want the windowed size.
|
||||
bool fullscreen = RenderingEngine::get_raw_device()->isFullscreen();
|
||||
// Screen size
|
||||
const irr::core::dimension2d<u32> current_screen_size =
|
||||
const core::dimension2d<u32> current_screen_size =
|
||||
RenderingEngine::get_video_driver()->getScreenSize();
|
||||
// Don't replace good value with (0, 0)
|
||||
if (!fullscreen &&
|
||||
current_screen_size != irr::core::dimension2d<u32>(0, 0) &&
|
||||
current_screen_size != core::dimension2d<u32>(0, 0) &&
|
||||
current_screen_size != initial_screen_size) {
|
||||
g_settings->setU16("screen_w", current_screen_size.Width);
|
||||
g_settings->setU16("screen_h", current_screen_size.Height);
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
|
||||
video::IVideoDriver *getVideoDriver() { return driver; }
|
||||
|
||||
static const VideoDriverInfo &getVideoDriverInfo(irr::video::E_DRIVER_TYPE type);
|
||||
static const VideoDriverInfo &getVideoDriverInfo(video::E_DRIVER_TYPE type);
|
||||
static float getDisplayDensity();
|
||||
|
||||
bool setupTopLevelWindow();
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
return m_device->getSceneManager();
|
||||
}
|
||||
|
||||
static irr::IrrlichtDevice *get_raw_device()
|
||||
static IrrlichtDevice *get_raw_device()
|
||||
{
|
||||
sanity_check(s_singleton && s_singleton->m_device);
|
||||
return s_singleton->m_device;
|
||||
|
@ -147,10 +147,10 @@ public:
|
|||
return s_singleton->core->get_shadow_renderer();
|
||||
return nullptr;
|
||||
}
|
||||
static std::vector<irr::video::E_DRIVER_TYPE> getSupportedVideoDrivers();
|
||||
static std::vector<video::E_DRIVER_TYPE> getSupportedVideoDrivers();
|
||||
|
||||
static void autosaveScreensizeAndCo(
|
||||
const irr::core::dimension2d<u32> initial_screen_size,
|
||||
const core::dimension2d<u32> initial_screen_size,
|
||||
const bool initial_window_maximized);
|
||||
|
||||
static PointerType getLastPointerType()
|
||||
|
@ -164,8 +164,8 @@ private:
|
|||
v2u32 _getWindowSize() const;
|
||||
|
||||
std::unique_ptr<RenderingCore> core;
|
||||
irr::IrrlichtDevice *m_device = nullptr;
|
||||
irr::video::IVideoDriver *driver;
|
||||
IrrlichtDevice *m_device = nullptr;
|
||||
video::IVideoDriver *driver;
|
||||
MyEventReceiver *m_receiver = nullptr;
|
||||
static RenderingEngine *s_singleton;
|
||||
};
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
Abstraction for updating uniforms used by shaders
|
||||
*/
|
||||
|
||||
namespace irr::video {
|
||||
namespace video {
|
||||
class IMaterialRendererServices;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "settings.h"
|
||||
#include "camera.h" // CameraModes
|
||||
|
||||
using namespace irr::core;
|
||||
using namespace core;
|
||||
|
||||
static video::SMaterial baseMaterial()
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ void Sky::render()
|
|||
video::SColor mooncolor2 = mooncolor2_f.toSColor();
|
||||
|
||||
// Calculate offset normalized to the X dimension of a 512x1 px tonemap
|
||||
float offset = (1.0 - fabs(sin((m_time_of_day - 0.5) * irr::core::PI))) * 511;
|
||||
float offset = (1.0 - fabs(sin((m_time_of_day - 0.5) * core::PI))) * 511;
|
||||
|
||||
if (m_sun_tonemap) {
|
||||
auto texel_color = m_sun_tonemap->getPixel(offset, 0);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#define SKY_MATERIAL_COUNT 12
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class IImage;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class IImage;
|
||||
class ITexture;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
#include <memory>
|
||||
#include "tile.h"
|
||||
|
||||
namespace irr::scene
|
||||
namespace scene
|
||||
{
|
||||
class ISceneManager;
|
||||
class IMesh;
|
||||
struct SMesh;
|
||||
}
|
||||
|
||||
using namespace irr;
|
||||
|
||||
|
||||
struct ItemStack;
|
||||
class Client;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue