mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41: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
|
@ -137,7 +137,7 @@ private:
|
|||
// Enable clickable chat weblinks
|
||||
bool m_cache_clickable_chat_weblinks;
|
||||
// Color of clickable chat weblinks
|
||||
irr::video::SColor m_cache_chat_weblink_color;
|
||||
video::SColor m_cache_chat_weblink_color;
|
||||
|
||||
// Whether the lines were modified since last markLinesUnchanged()
|
||||
// Is always set to true when m_unformatted is modified, because that's what
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#define PATH_DELIM ":"
|
||||
#endif
|
||||
|
||||
namespace irr::io {
|
||||
namespace io {
|
||||
class IFileSystem;
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ const char *GetFilenameFromPath(const char *path);
|
|||
bool safeWriteToFile(const std::string &path, std::string_view content);
|
||||
|
||||
#if IS_CLIENT_BUILD
|
||||
bool extractZipFile(irr::io::IFileSystem *fs, const char *filename, const std::string &destination);
|
||||
bool extractZipFile(io::IFileSystem *fs, const char *filename, const std::string &destination);
|
||||
#endif
|
||||
|
||||
bool ReadFile(const std::string &path, std::string &out, bool log_error = false);
|
||||
|
|
|
@ -23,7 +23,7 @@ struct SubgameSpec;
|
|||
struct ModSpec;
|
||||
struct ModIPCStore;
|
||||
|
||||
namespace irr::scene {
|
||||
namespace scene {
|
||||
class IAnimatedMesh;
|
||||
class ISceneManager;
|
||||
}
|
||||
|
|
|
@ -236,25 +236,25 @@ public:
|
|||
return def;
|
||||
}
|
||||
|
||||
irr::core::rect<s32> getRect(Property prop, irr::core::rect<s32> def) const
|
||||
core::rect<s32> getRect(Property prop, core::rect<s32> def) const
|
||||
{
|
||||
const auto &val = properties[prop];
|
||||
if (val.empty())
|
||||
return def;
|
||||
|
||||
irr::core::rect<s32> rect;
|
||||
core::rect<s32> rect;
|
||||
if (!parseRect(val, &rect))
|
||||
return def;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
irr::core::rect<s32> getRect(Property prop) const
|
||||
core::rect<s32> getRect(Property prop) const
|
||||
{
|
||||
const auto &val = properties[prop];
|
||||
FATAL_ERROR_IF(val.empty(), "Unexpected missing property");
|
||||
|
||||
irr::core::rect<s32> rect;
|
||||
core::rect<s32> rect;
|
||||
parseRect(val, &rect);
|
||||
return rect;
|
||||
}
|
||||
|
@ -416,25 +416,25 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool parseRect(const std::string &value, irr::core::rect<s32> *parsed_rect) const
|
||||
bool parseRect(const std::string &value, core::rect<s32> *parsed_rect) const
|
||||
{
|
||||
irr::core::rect<s32> rect;
|
||||
core::rect<s32> rect;
|
||||
std::vector<std::string> v_rect = split(value, ',');
|
||||
|
||||
if (v_rect.size() == 1) {
|
||||
s32 x = stoi(v_rect[0]);
|
||||
rect.UpperLeftCorner = irr::core::vector2di(x, x);
|
||||
rect.LowerRightCorner = irr::core::vector2di(-x, -x);
|
||||
rect.UpperLeftCorner = core::vector2di(x, x);
|
||||
rect.LowerRightCorner = core::vector2di(-x, -x);
|
||||
} else if (v_rect.size() == 2) {
|
||||
s32 x = stoi(v_rect[0]);
|
||||
s32 y = stoi(v_rect[1]);
|
||||
rect.UpperLeftCorner = irr::core::vector2di(x, y);
|
||||
rect.LowerRightCorner = irr::core::vector2di(-x, -y);
|
||||
rect.UpperLeftCorner = core::vector2di(x, y);
|
||||
rect.LowerRightCorner = core::vector2di(-x, -y);
|
||||
// `-x` is interpreted as `w - x`
|
||||
} else if (v_rect.size() == 4) {
|
||||
rect.UpperLeftCorner = irr::core::vector2di(
|
||||
rect.UpperLeftCorner = core::vector2di(
|
||||
stoi(v_rect[0]), stoi(v_rect[1]));
|
||||
rect.LowerRightCorner = irr::core::vector2di(
|
||||
rect.LowerRightCorner = core::vector2di(
|
||||
stoi(v_rect[2]), stoi(v_rect[3]));
|
||||
} else {
|
||||
warningstream << "Invalid rectangle string format: \"" << value
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <IGUIElement.h>
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class ISimpleTextureSource;
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <IGUIEnvironment.h>
|
||||
#include "irr_v2d.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class ISimpleTextureSource;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <IGUIElement.h>
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class GUIBox : public gui::IGUIElement
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "StyleSpec.h"
|
||||
#include "util/numeric.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
using namespace gui;
|
||||
|
||||
// Multiply with a color to get the default corresponding hovered color
|
||||
|
@ -744,8 +744,8 @@ void GUIButton::setFromStyle(const StyleSpec& style)
|
|||
|
||||
IGUISkin *skin = Environment->getSkin();
|
||||
core::vector2d<s32> defaultPressOffset(
|
||||
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X),
|
||||
skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y));
|
||||
skin->getSize(gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X),
|
||||
skin->getSize(gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y));
|
||||
ContentOffset = style.getVector2i(StyleSpec::CONTENT_OFFSET, isPressed()
|
||||
? defaultPressOffset
|
||||
: core::vector2d<s32>(0));
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "SColor.h"
|
||||
#include "StyleSpec.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class ISimpleTextureSource;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "IVideoDriver.h"
|
||||
#include "StyleSpec.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
using namespace gui;
|
||||
|
||||
GUIButtonImage::GUIButtonImage(gui::IGUIEnvironment *environment,
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "guiAnimatedImage.h"
|
||||
#include "irr_ptr.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class GUIButtonImage : public GUIButton
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "IGUIEnvironment.h"
|
||||
#include "itemdef.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
using namespace gui;
|
||||
|
||||
GUIButtonItemImage::GUIButtonItemImage(gui::IGUIEnvironment *environment,
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "guiButton.h"
|
||||
#include "IGUIButton.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class Client;
|
||||
class GUIItemImage;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
#include "guiButtonKey.h"
|
||||
using namespace irr::gui;
|
||||
using namespace gui;
|
||||
|
||||
GUIButtonKey *GUIButtonKey::addButton(IGUIEnvironment *environment,
|
||||
const core::rect<s32> &rectangle, ISimpleTextureSource *tsrc,
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "util/string.h"
|
||||
#include "gettext.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class GUIButtonKey : public GUIButton
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ inline u32 clamp_u8(s32 value)
|
|||
return (u32) MYMIN(MYMAX(value, 0), 255);
|
||||
}
|
||||
|
||||
inline bool isInCtrlKeys(const irr::EKEY_CODE& kc)
|
||||
inline bool isInCtrlKeys(const EKEY_CODE& kc)
|
||||
{
|
||||
return kc == KEY_LCONTROL || kc == KEY_RCONTROL || kc == KEY_CONTROL;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ void GUIChatConsole::drawText()
|
|||
core::rect<s32> destrect(
|
||||
x, y, x + m_fontsize.X * fragment.text.size(), y + m_fontsize.Y);
|
||||
|
||||
if (m_font->getType() == irr::gui::EGFT_CUSTOM) {
|
||||
if (m_font->getType() == gui::EGFT_CUSTOM) {
|
||||
// Draw colored text if possible
|
||||
auto *tmp = static_cast<gui::CGUITTFont*>(m_font.get());
|
||||
tmp->draw(
|
||||
|
|
|
@ -707,7 +707,7 @@ void GUIEditBox::inputString(const core::stringw &str)
|
|||
bool GUIEditBox::processMouse(const SEvent &event)
|
||||
{
|
||||
switch (event.MouseInput.Event) {
|
||||
case irr::EMIE_LMOUSE_LEFT_UP:
|
||||
case EMIE_LMOUSE_LEFT_UP:
|
||||
if (Environment->hasFocus(this)) {
|
||||
m_cursor_pos = getCursorPos(
|
||||
event.MouseInput.X, event.MouseInput.Y);
|
||||
|
@ -719,7 +719,7 @@ bool GUIEditBox::processMouse(const SEvent &event)
|
|||
return true;
|
||||
}
|
||||
break;
|
||||
case irr::EMIE_MOUSE_MOVED: {
|
||||
case EMIE_MOUSE_MOVED: {
|
||||
if (m_mouse_marking) {
|
||||
m_cursor_pos = getCursorPos(
|
||||
event.MouseInput.X, event.MouseInput.Y);
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "guiScrollBar.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace irr;
|
||||
using namespace irr::gui;
|
||||
|
||||
using namespace gui;
|
||||
|
||||
class GUIEditBox : public IGUIEditBox
|
||||
{
|
||||
|
|
|
@ -503,7 +503,7 @@ void GUIEditBoxWithScrollBar::calculateScrollPos()
|
|||
return;
|
||||
|
||||
// get cursor area
|
||||
irr::u32 cursor_width = font->getDimension(L"_").Width;
|
||||
u32 cursor_width = font->getDimension(L"_").Width;
|
||||
core::stringw *txt_line = has_broken_text ? &m_broken_text[curs_line] : &Text;
|
||||
s32 cpos = has_broken_text ? m_cursor_pos - m_broken_text_positions[curs_line] : m_cursor_pos; // column
|
||||
s32 cstart = font->getDimension(txt_line->subString(0, cpos).c_str()).Width; // pixels from text-start
|
||||
|
@ -534,9 +534,9 @@ void GUIEditBoxWithScrollBar::calculateScrollPos()
|
|||
|
||||
// calculate vertical scrolling
|
||||
if (has_broken_text) {
|
||||
irr::u32 line_height = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
|
||||
u32 line_height = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
|
||||
// only up to 1 line fits?
|
||||
if (line_height >= (irr::u32)m_frame_rect.getHeight()) {
|
||||
if (line_height >= (u32)m_frame_rect.getHeight()) {
|
||||
m_vscroll_pos = 0;
|
||||
setTextRect(curs_line);
|
||||
s32 unscrolledPos = m_current_text_rect.UpperLeftCorner.Y;
|
||||
|
@ -627,7 +627,7 @@ void GUIEditBoxWithScrollBar::createVScrollBar()
|
|||
|
||||
m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16;
|
||||
|
||||
irr::core::rect<s32> scrollbarrect = m_frame_rect;
|
||||
core::rect<s32> scrollbarrect = m_frame_rect;
|
||||
scrollbarrect.UpperLeftCorner.X += m_frame_rect.getWidth() - m_scrollbar_width;
|
||||
m_vscrollbar = new GUIScrollBar(Environment, getParent(), -1,
|
||||
scrollbarrect, false, true, m_tsrc);
|
||||
|
@ -650,5 +650,5 @@ bool GUIEditBoxWithScrollBar::isDrawBackgroundEnabled() const { return false; }
|
|||
bool GUIEditBoxWithScrollBar::isDrawBorderEnabled() const { return false; }
|
||||
void GUIEditBoxWithScrollBar::setCursorChar(const wchar_t cursorChar) { }
|
||||
wchar_t GUIEditBoxWithScrollBar::getCursorChar() const { return '|'; }
|
||||
void GUIEditBoxWithScrollBar::setCursorBlinkTime(irr::u32 timeMs) { }
|
||||
irr::u32 GUIEditBoxWithScrollBar::getCursorBlinkTime() const { return 500; }
|
||||
void GUIEditBoxWithScrollBar::setCursorBlinkTime(u32 timeMs) { }
|
||||
u32 GUIEditBoxWithScrollBar::getCursorBlinkTime() const { return 500; }
|
||||
|
|
|
@ -37,8 +37,8 @@ public:
|
|||
virtual bool isDrawBorderEnabled() const;
|
||||
virtual void setCursorChar(const wchar_t cursorChar);
|
||||
virtual wchar_t getCursorChar() const;
|
||||
virtual void setCursorBlinkTime(irr::u32 timeMs);
|
||||
virtual irr::u32 getCursorBlinkTime() const;
|
||||
virtual void setCursorBlinkTime(u32 timeMs);
|
||||
virtual u32 getCursorBlinkTime() const;
|
||||
|
||||
protected:
|
||||
//! Breaks the single text line.
|
||||
|
|
|
@ -317,7 +317,7 @@ void GUIEngine::run()
|
|||
fog_end, fog_density, fog_pixelfog, fog_rangefog);
|
||||
}
|
||||
|
||||
const irr::core::dimension2d<u32> initial_screen_size(
|
||||
const core::dimension2d<u32> initial_screen_size(
|
||||
g_settings->getU16("screen_w"),
|
||||
g_settings->getU16("screen_h")
|
||||
);
|
||||
|
|
|
@ -254,7 +254,7 @@ private:
|
|||
void setTopleftText(const std::string &text);
|
||||
|
||||
/** pointer to gui element shown at topleft corner */
|
||||
irr::gui::IGUIStaticText *m_irr_toplefttext = nullptr;
|
||||
gui::IGUIStaticText *m_irr_toplefttext = nullptr;
|
||||
/** and text that is in it */
|
||||
EnrichedString m_toplefttext;
|
||||
|
||||
|
|
|
@ -1505,7 +1505,7 @@ void GUIFormSpecMenu::parsePwdField(parserData* data, const std::string &element
|
|||
e->setOverrideColor(style.getColor(StyleSpec::TEXTCOLOR, video::SColor(0xFFFFFFFF)));
|
||||
e->setOverrideFont(style.getFont());
|
||||
|
||||
irr::SEvent evt;
|
||||
SEvent evt;
|
||||
evt.EventType = EET_KEY_INPUT_EVENT;
|
||||
evt.KeyInput.Key = KEY_END;
|
||||
evt.KeyInput.Char = 0;
|
||||
|
@ -1560,7 +1560,7 @@ void GUIFormSpecMenu::createTextField(parserData *data, FieldSpec &spec,
|
|||
e->setWordWrap(true);
|
||||
e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_UPPERLEFT);
|
||||
} else {
|
||||
irr::SEvent evt;
|
||||
SEvent evt;
|
||||
evt.EventType = EET_KEY_INPUT_EVENT;
|
||||
evt.KeyInput.Key = KEY_END;
|
||||
evt.KeyInput.Char = 0;
|
||||
|
@ -2137,8 +2137,8 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data, const std::string &elemen
|
|||
|
||||
gui::IGUITabControl *e = Environment->addTabControl(rect,
|
||||
data->current_parent, show_background, show_border, spec.fid);
|
||||
e->setAlignment(irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_UPPERLEFT,
|
||||
irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_LOWERRIGHT);
|
||||
e->setAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_UPPERLEFT,
|
||||
gui::EGUIA_UPPERLEFT, gui::EGUIA_LOWERRIGHT);
|
||||
e->setTabHeight(geom.Y);
|
||||
|
||||
auto style = getDefaultStyleForElement("tabheader", name);
|
||||
|
@ -3400,7 +3400,7 @@ void GUIFormSpecMenu::getAndroidUIInput()
|
|||
return;
|
||||
|
||||
auto element_type = element->getType();
|
||||
if (dialog_type == porting::TEXT_INPUT && element_type == irr::gui::EGUIET_EDIT_BOX) {
|
||||
if (dialog_type == porting::TEXT_INPUT && element_type == gui::EGUIET_EDIT_BOX) {
|
||||
gui::IGUIEditBox *editbox = (gui::IGUIEditBox *)element;
|
||||
std::string text = porting::getInputDialogMessage();
|
||||
editbox->setText(utf8_to_wide(text).c_str());
|
||||
|
@ -3419,7 +3419,7 @@ void GUIFormSpecMenu::getAndroidUIInput()
|
|||
editbox->getParent()->OnEvent(enter);
|
||||
}
|
||||
} else if (dialog_type == porting::SELECTION_INPUT &&
|
||||
element_type == irr::gui::EGUIET_COMBO_BOX) {
|
||||
element_type == gui::EGUIET_COMBO_BOX) {
|
||||
auto dropdown = (gui::IGUIComboBox *) element;
|
||||
int selected = porting::getInputDialogSelection();
|
||||
dropdown->setAndSendSelected(selected);
|
||||
|
@ -3631,7 +3631,7 @@ void GUIFormSpecMenu::drawMenu()
|
|||
|
||||
|
||||
void GUIFormSpecMenu::showTooltip(const std::wstring &text,
|
||||
const irr::video::SColor &color, const irr::video::SColor &bgcolor)
|
||||
const video::SColor &color, const video::SColor &bgcolor)
|
||||
{
|
||||
EnrichedString ntext(text);
|
||||
ntext.setDefaultColor(color);
|
||||
|
@ -4024,7 +4024,7 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) {
|
||||
if (event.EventType == EET_JOYSTICK_INPUT_EVENT) {
|
||||
if (event.JoystickEvent.Joystick != m_joystick->getJoystickId())
|
||||
return false;
|
||||
|
||||
|
|
|
@ -136,8 +136,8 @@ class GUIFormSpecMenu : public GUIModalMenu
|
|||
struct TooltipSpec
|
||||
{
|
||||
TooltipSpec() = default;
|
||||
TooltipSpec(const std::wstring &a_tooltip, irr::video::SColor a_bgcolor,
|
||||
irr::video::SColor a_color):
|
||||
TooltipSpec(const std::wstring &a_tooltip, video::SColor a_bgcolor,
|
||||
video::SColor a_color):
|
||||
tooltip(translate_string(a_tooltip)),
|
||||
bgcolor(a_bgcolor),
|
||||
color(a_color)
|
||||
|
@ -145,8 +145,8 @@ class GUIFormSpecMenu : public GUIModalMenu
|
|||
}
|
||||
|
||||
std::wstring tooltip;
|
||||
irr::video::SColor bgcolor;
|
||||
irr::video::SColor color;
|
||||
video::SColor bgcolor;
|
||||
video::SColor color;
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -493,8 +493,8 @@ private:
|
|||
void tryClose();
|
||||
void trySubmitClose();
|
||||
|
||||
void showTooltip(const std::wstring &text, const irr::video::SColor &color,
|
||||
const irr::video::SColor &bgcolor);
|
||||
void showTooltip(const std::wstring &text, const video::SColor &color,
|
||||
const video::SColor &bgcolor);
|
||||
|
||||
/**
|
||||
* In formspec version < 2 the elements were not ordered properly. Some element
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
#include "mainmenumanager.h"
|
||||
#include "porting.h"
|
||||
|
||||
using namespace irr::gui;
|
||||
using namespace gui;
|
||||
|
||||
static bool check_color(const std::string &str)
|
||||
{
|
||||
irr::video::SColor color;
|
||||
video::SColor color;
|
||||
return parseColorString(str, color, false);
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,7 @@ void ParsedText::globalTag(const AttrsList &attrs)
|
|||
else if (attr.second == "middle")
|
||||
valign = ParsedText::VALIGN_MIDDLE;
|
||||
} else if (attr.first == "background") {
|
||||
irr::video::SColor color;
|
||||
video::SColor color;
|
||||
if (attr.second == "none") {
|
||||
background_type = BACKGROUND_NONE;
|
||||
} else if (parseColorString(attr.second, color, false)) {
|
||||
|
@ -630,7 +630,7 @@ TextDrawer::TextDrawer(const wchar_t *text, Client *client,
|
|||
if (e.font) {
|
||||
e.dim.Width = e.font->getDimension(e.text.c_str()).Width;
|
||||
e.dim.Height = e.font->getDimension(L"Yy").Height;
|
||||
if (e.font->getType() == irr::gui::EGFT_CUSTOM) {
|
||||
if (e.font->getType() == gui::EGFT_CUSTOM) {
|
||||
CGUITTFont *tmp = static_cast<CGUITTFont*>(e.font);
|
||||
e.baseline = e.dim.Height - 1 - tmp->getAscender() / 64;
|
||||
}
|
||||
|
@ -932,7 +932,7 @@ void TextDrawer::place(const core::rect<s32> &dest_rect)
|
|||
void TextDrawer::draw(const core::rect<s32> &clip_rect,
|
||||
const core::position2d<s32> &dest_offset)
|
||||
{
|
||||
irr::video::IVideoDriver *driver = m_guienv->getVideoDriver();
|
||||
video::IVideoDriver *driver = m_guienv->getVideoDriver();
|
||||
core::position2d<s32> offset = dest_offset;
|
||||
offset.Y += m_voffset;
|
||||
|
||||
|
@ -948,7 +948,7 @@ void TextDrawer::draw(const core::rect<s32> &clip_rect,
|
|||
switch (el.type) {
|
||||
case ParsedText::ELEMENT_SEPARATOR:
|
||||
case ParsedText::ELEMENT_TEXT: {
|
||||
irr::video::SColor color = el.color;
|
||||
video::SColor color = el.color;
|
||||
|
||||
for (auto tag : el.tags)
|
||||
if (&(*tag) == m_hovertag)
|
||||
|
@ -981,7 +981,7 @@ void TextDrawer::draw(const core::rect<s32> &clip_rect,
|
|||
if (texture != 0)
|
||||
m_guienv->getVideoDriver()->draw2DImage(
|
||||
texture, rect,
|
||||
irr::core::rect<s32>(
|
||||
core::rect<s32>(
|
||||
core::position2d<s32>(0, 0),
|
||||
texture->getOriginalSize()),
|
||||
&clip_rect, 0, true);
|
||||
|
@ -1021,7 +1021,7 @@ GUIHyperText::GUIHyperText(const wchar_t *text, IGUIEnvironment *environment,
|
|||
|
||||
m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16;
|
||||
|
||||
core::rect<s32> rect = irr::core::rect<s32>(
|
||||
core::rect<s32> rect = core::rect<s32>(
|
||||
RelativeRect.getWidth() - m_scrollbar_width, 0,
|
||||
RelativeRect.getWidth(), RelativeRect.getHeight());
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <IGUIEnvironment.h>
|
||||
#include "irr_v3d.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class ISimpleTextureSource;
|
||||
class Client;
|
||||
|
@ -86,8 +85,8 @@ public:
|
|||
|
||||
gui::IGUIFont *font;
|
||||
|
||||
irr::video::SColor color;
|
||||
irr::video::SColor hovercolor;
|
||||
video::SColor color;
|
||||
video::SColor hovercolor;
|
||||
bool underline;
|
||||
|
||||
s32 baseline = 0;
|
||||
|
@ -117,7 +116,7 @@ public:
|
|||
s32 margin = 3;
|
||||
ValignType valign = VALIGN_TOP;
|
||||
BackgroundType background_type = BACKGROUND_NONE;
|
||||
irr::video::SColor background_color;
|
||||
video::SColor background_color;
|
||||
|
||||
Tag m_root_tag;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <IGUIEnvironment.h>
|
||||
#include "irr_v2d.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class GUIFormSpecMenu;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <IGUIElement.h>
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class Client;
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ void GUIPasswordChange::getAndroidUIInput()
|
|||
e = getElementFromId(ID_newPassword2);
|
||||
m_jni_field_name.clear();
|
||||
|
||||
if (!e || e->getType() != irr::gui::EGUIET_EDIT_BOX)
|
||||
if (!e || e->getType() != gui::EGUIET_EDIT_BOX)
|
||||
return;
|
||||
|
||||
std::string text = porting::getInputDialogMessage();
|
||||
|
|
|
@ -74,7 +74,7 @@ void GUIFileSelectMenu::acceptInput()
|
|||
|
||||
bool GUIFileSelectMenu::OnEvent(const SEvent &event)
|
||||
{
|
||||
if (event.EventType == irr::EET_GUI_EVENT) {
|
||||
if (event.EventType == EET_GUI_EVENT) {
|
||||
switch (event.GUIEvent.EventType) {
|
||||
case gui::EGET_ELEMENT_CLOSED:
|
||||
case gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED:
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <IGUIElement.h>
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class GUIScene : public gui::IGUIElement
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ the arrow buttons where there is insufficient space.
|
|||
|
||||
class ISimpleTextureSource;
|
||||
|
||||
using namespace irr;
|
||||
|
||||
using namespace gui;
|
||||
|
||||
class GUIScrollBar : public IGUIElement
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "IGUIEnvironment.h"
|
||||
|
||||
namespace irr::gui {
|
||||
namespace gui {
|
||||
class IGUIStaticText;
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
|
|||
gui::IGUIElement *hovered =
|
||||
Environment->getRootGUIElement()->getElementFromPoint(
|
||||
core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y));
|
||||
if ((hovered) && (hovered->getType() == irr::gui::EGUIET_EDIT_BOX)) {
|
||||
if ((hovered) && (hovered->getType() == gui::EGUIET_EDIT_BOX)) {
|
||||
bool retval = hovered->OnEvent(event);
|
||||
if (retval)
|
||||
Environment->setFocus(hovered);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <IGUIFont.h>
|
||||
#include "profiler.h"
|
||||
|
||||
namespace irr::video {
|
||||
namespace video {
|
||||
class IVideoDriver;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,24 +18,22 @@
|
|||
#include "util/basic_macros.h"
|
||||
#include "client/keycode.h"
|
||||
|
||||
namespace irr
|
||||
class IrrlichtDevice;
|
||||
namespace gui
|
||||
{
|
||||
class IrrlichtDevice;
|
||||
namespace gui
|
||||
{
|
||||
class IGUIEnvironment;
|
||||
class IGUIImage;
|
||||
class IGUIStaticText;
|
||||
}
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
}
|
||||
class IGUIEnvironment;
|
||||
class IGUIImage;
|
||||
class IGUIStaticText;
|
||||
}
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
}
|
||||
|
||||
class ISimpleTextureSource;
|
||||
|
||||
using namespace irr::core;
|
||||
using namespace irr::gui;
|
||||
using namespace core;
|
||||
using namespace gui;
|
||||
|
||||
|
||||
enum class TapState
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <unordered_map>
|
||||
|
||||
class ISimpleTextureSource;
|
||||
namespace irr::gui
|
||||
namespace gui
|
||||
{
|
||||
class IGUIButton;
|
||||
class IGUIImage;
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
#include <unordered_map>
|
||||
|
||||
class ISimpleTextureSource;
|
||||
namespace irr::gui
|
||||
namespace gui
|
||||
{
|
||||
class IGUIStaticText;
|
||||
}
|
||||
namespace irr::video
|
||||
namespace video
|
||||
{
|
||||
class ITexture;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
template <typename T>
|
||||
std::shared_ptr<T> grab_gui_element(T *element)
|
||||
{
|
||||
static_assert(std::is_base_of_v<irr::gui::IGUIElement, T>,
|
||||
static_assert(std::is_base_of_v<gui::IGUIElement, T>,
|
||||
"grab_gui_element only works for IGUIElement");
|
||||
return std::shared_ptr<T>(element, [](T *e) {
|
||||
e->remove();
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -955,4 +954,3 @@ std::u32string CGUITTFont::convertWCharToU32String(const wchar_t* const charArra
|
|||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -46,12 +46,10 @@
|
|||
#include <map>
|
||||
#include <optional>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
// Manages the FT_Face cache.
|
||||
struct SGUITTFace : public irr::IReferenceCounted
|
||||
struct SGUITTFace : public IReferenceCounted
|
||||
{
|
||||
private:
|
||||
|
||||
|
@ -409,4 +407,3 @@ namespace gui
|
|||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <vector2d.h>
|
||||
#include <vector3d.h>
|
||||
|
||||
namespace irr::core {
|
||||
namespace core {
|
||||
|
||||
template <class T>
|
||||
std::ostream &operator<< (std::ostream &os, vector2d<T> vec)
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "CGUITTFont.h"
|
||||
#include "util/string.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
@ -97,7 +95,7 @@ void StaticText::draw()
|
|||
font->getDimension(str.c_str()).Width;
|
||||
}
|
||||
|
||||
if (font->getType() == irr::gui::EGFT_CUSTOM) {
|
||||
if (font->getType() == gui::EGFT_CUSTOM) {
|
||||
CGUITTFont *tmp = static_cast<CGUITTFont*>(font);
|
||||
tmp->draw(str,
|
||||
r, HAlign == EGUIA_CENTER, VAlign == EGUIA_CENTER,
|
||||
|
@ -319,7 +317,7 @@ void StaticText::updateText()
|
|||
elWidth -= 2*skin->getSize(EGDS_TEXT_DISTANCE_X);
|
||||
wchar_t c;
|
||||
|
||||
//std::vector<irr::video::SColor> colors;
|
||||
//std::vector<video::SColor> colors;
|
||||
|
||||
// We have to deal with right-to-left and left-to-right differently
|
||||
// However, most parts of the following code is the same, it's just
|
||||
|
@ -574,5 +572,3 @@ s32 StaticText::getTextWidth() const
|
|||
|
||||
|
||||
} // end namespace gui
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
#include <IGUIEnvironment.h>
|
||||
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -39,18 +36,18 @@ namespace gui
|
|||
//! destructor
|
||||
virtual ~StaticText();
|
||||
|
||||
static irr::gui::IGUIStaticText *add(
|
||||
irr::gui::IGUIEnvironment *guienv,
|
||||
static gui::IGUIStaticText *add(
|
||||
gui::IGUIEnvironment *guienv,
|
||||
const EnrichedString &text,
|
||||
const core::rect< s32 > &rectangle,
|
||||
bool border = false,
|
||||
bool wordWrap = true,
|
||||
irr::gui::IGUIElement *parent = NULL,
|
||||
gui::IGUIElement *parent = NULL,
|
||||
s32 id = -1,
|
||||
bool fillBackground = false)
|
||||
{
|
||||
parent = parent ? parent : guienv->getRootGUIElement();
|
||||
irr::gui::IGUIStaticText *result = new irr::gui::StaticText(
|
||||
gui::IGUIStaticText *result = new gui::StaticText(
|
||||
text, border, guienv, parent,
|
||||
id, rectangle, fillBackground);
|
||||
|
||||
|
@ -59,13 +56,13 @@ namespace gui
|
|||
return result;
|
||||
}
|
||||
|
||||
static irr::gui::IGUIStaticText *add(
|
||||
irr::gui::IGUIEnvironment *guienv,
|
||||
static gui::IGUIStaticText *add(
|
||||
gui::IGUIEnvironment *guienv,
|
||||
std::wstring_view text,
|
||||
const core::rect< s32 > &rectangle,
|
||||
bool border = false,
|
||||
bool wordWrap = true,
|
||||
irr::gui::IGUIElement *parent = NULL,
|
||||
gui::IGUIElement *parent = NULL,
|
||||
s32 id = -1,
|
||||
bool fillBackground = false)
|
||||
{
|
||||
|
@ -190,21 +187,19 @@ namespace gui
|
|||
|
||||
} // end namespace gui
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedString &text)
|
||||
inline void setStaticText(gui::IGUIStaticText *static_text, const EnrichedString &text)
|
||||
{
|
||||
// dynamic_cast not possible due to some distributions shipped
|
||||
// without rtti support in irrlicht
|
||||
if (static_text->hasType(irr::gui::EGUIET_ENRICHED_STATIC_TEXT)) {
|
||||
irr::gui::StaticText* stext = static_cast<irr::gui::StaticText*>(static_text);
|
||||
if (static_text->hasType(gui::EGUIET_ENRICHED_STATIC_TEXT)) {
|
||||
gui::StaticText* stext = static_cast<gui::StaticText*>(static_text);
|
||||
stext->setText(text);
|
||||
} else {
|
||||
static_text->setText(text.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
inline void setStaticText(irr::gui::IGUIStaticText *static_text, std::wstring_view text)
|
||||
inline void setStaticText(gui::IGUIStaticText *static_text, std::wstring_view text)
|
||||
{
|
||||
setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor()));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <cstdint>
|
||||
#include <irrTypes.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
#define S8_MIN INT8_MIN
|
||||
#define S16_MIN INT16_MIN
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#pragma once
|
||||
#include "SColor.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
/**
|
||||
* Parameters for automatic exposure compensation
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "SColor.h"
|
||||
#include "irr_v2d.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
struct SkyColor
|
||||
{
|
||||
|
|
|
@ -24,9 +24,9 @@ const auto gamespec = findSubgame("devtest");
|
|||
if (!gamespec.isValid())
|
||||
SKIP();
|
||||
|
||||
irr::SIrrlichtCreationParameters p;
|
||||
SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_NULL;
|
||||
auto *driver = irr::createDeviceEx(p);
|
||||
auto *driver = createDeviceEx(p);
|
||||
REQUIRE(driver);
|
||||
|
||||
auto *smgr = driver->getSceneManager();
|
||||
|
@ -74,7 +74,7 @@ SECTION("minimal triangle") {
|
|||
|
||||
SECTION("vertex coordinates are correct") {
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 3);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(0)->getVertices());
|
||||
CHECK(vertices[0].Pos == v3f {0.0f, 0.0f, 0.0f});
|
||||
CHECK(vertices[1].Pos == v3f {1.0f, 0.0f, 0.0f});
|
||||
|
@ -83,7 +83,7 @@ SECTION("minimal triangle") {
|
|||
|
||||
SECTION("vertex indices are correct") {
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getIndexCount() == 3);
|
||||
auto indices = static_cast<const irr::u16 *>(
|
||||
auto indices = static_cast<const u16 *>(
|
||||
mesh->getMeshBuffer(0)->getIndices());
|
||||
CHECK(indices[0] == 2);
|
||||
CHECK(indices[1] == 1);
|
||||
|
@ -93,7 +93,7 @@ SECTION("minimal triangle") {
|
|||
|
||||
auto check_cube_vertices = [](auto *meshbuf) {
|
||||
REQUIRE(meshbuf->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
meshbuf->getVertices());
|
||||
CHECK(vertices[0].Pos == v3f{-1.0f, -1.0f, -1.0f});
|
||||
CHECK(vertices[3].Pos == v3f{-1.0f, 1.0f, -1.0f});
|
||||
|
@ -112,7 +112,7 @@ SECTION("blender cube") {
|
|||
const auto mesh = loadMesh(path);
|
||||
REQUIRE(mesh);
|
||||
REQUIRE(mesh->getMeshBufferCount() == 1);
|
||||
auto *meshbuf = dynamic_cast<irr::scene::SSkinMeshBuffer *>(
|
||||
auto *meshbuf = dynamic_cast<scene::SSkinMeshBuffer *>(
|
||||
mesh->getMeshBuffer(0));
|
||||
REQUIRE(meshbuf);
|
||||
SECTION("vertex coordinates are correct") {
|
||||
|
@ -124,7 +124,7 @@ SECTION("blender cube") {
|
|||
|
||||
SECTION("vertex indices are correct") {
|
||||
REQUIRE(meshbuf->getIndexCount() == 36);
|
||||
auto indices = static_cast<const irr::u16 *>(
|
||||
auto indices = static_cast<const u16 *>(
|
||||
meshbuf->getIndices());
|
||||
CHECK(indices[0] == 16);
|
||||
CHECK(indices[1] == 5);
|
||||
|
@ -134,7 +134,7 @@ SECTION("blender cube") {
|
|||
|
||||
SECTION("vertex normals are correct") {
|
||||
REQUIRE(meshbuf->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
meshbuf->getVertices());
|
||||
CHECK(vertices[0].Normal == v3f{-1.0f, 0.0f, 0.0f});
|
||||
CHECK(vertices[1].Normal == v3f{0.0f, -1.0f, 0.0f});
|
||||
|
@ -147,7 +147,7 @@ SECTION("blender cube") {
|
|||
|
||||
SECTION("texture coords are correct") {
|
||||
REQUIRE(meshbuf->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
meshbuf->getVertices());
|
||||
CHECK(vertices[0].TCoords == v2f{0.375f, 1.0f});
|
||||
CHECK(vertices[1].TCoords == v2f{0.125f, 0.25f});
|
||||
|
@ -161,7 +161,7 @@ SECTION("blender cube scaled") {
|
|||
const auto mesh = loadMesh(model_stem + "blender_cube_scaled.gltf");
|
||||
REQUIRE(mesh);
|
||||
REQUIRE(mesh->getMeshBufferCount() == 1);
|
||||
auto *meshbuf = dynamic_cast<irr::scene::SSkinMeshBuffer *>(
|
||||
auto *meshbuf = dynamic_cast<scene::SSkinMeshBuffer *>(
|
||||
mesh->getMeshBuffer(0));
|
||||
REQUIRE(meshbuf);
|
||||
|
||||
|
@ -179,11 +179,11 @@ SECTION("blender cube matrix transform") {
|
|||
REQUIRE(mesh->getMeshBufferCount() == 1);
|
||||
|
||||
SECTION("Transformation is correct") {
|
||||
auto *meshbuf = dynamic_cast<irr::scene::SSkinMeshBuffer *>(
|
||||
auto *meshbuf = dynamic_cast<scene::SSkinMeshBuffer *>(
|
||||
mesh->getMeshBuffer(0));
|
||||
REQUIRE(meshbuf);
|
||||
REQUIRE(meshbuf->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
meshbuf->getVertices());
|
||||
const auto checkVertex = [&](const std::size_t i, v3f vec) {
|
||||
// The transform scales by (1, 2, 3) and translates by (4, 5, 6).
|
||||
|
@ -210,7 +210,7 @@ SECTION("snow man") {
|
|||
SECTION("vertex coordinates are correct for all buffers") {
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24);
|
||||
{
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(0)->getVertices());
|
||||
CHECK(vertices[0].Pos == v3f{3.0f, 24.0f, -3.0f});
|
||||
CHECK(vertices[3].Pos == v3f{3.0f, 18.0f, 3.0f});
|
||||
|
@ -223,7 +223,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(1)->getVertices());
|
||||
CHECK(vertices[2].Pos == v3f{5.0f, 10.0f, 5.0f});
|
||||
CHECK(vertices[3].Pos == v3f{5.0f, 0.0f, 5.0f});
|
||||
|
@ -236,7 +236,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(2)->getVertices());
|
||||
CHECK(vertices[1].Pos == v3f{4.0f, 10.0f, -4.0f});
|
||||
CHECK(vertices[2].Pos == v3f{4.0f, 18.0f, 4.0f});
|
||||
|
@ -252,7 +252,7 @@ SECTION("snow man") {
|
|||
SECTION("vertex indices are correct for all buffers") {
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getIndexCount() == 36);
|
||||
auto indices = static_cast<const irr::u16 *>(
|
||||
auto indices = static_cast<const u16 *>(
|
||||
mesh->getMeshBuffer(0)->getIndices());
|
||||
CHECK(indices[0] == 23);
|
||||
CHECK(indices[1] == 21);
|
||||
|
@ -261,7 +261,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(1)->getIndexCount() == 36);
|
||||
auto indices = static_cast<const irr::u16 *>(
|
||||
auto indices = static_cast<const u16 *>(
|
||||
mesh->getMeshBuffer(1)->getIndices());
|
||||
CHECK(indices[10] == 16);
|
||||
CHECK(indices[11] == 18);
|
||||
|
@ -270,7 +270,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(2)->getIndexCount() == 36);
|
||||
auto indices = static_cast<const irr::u16 *>(
|
||||
auto indices = static_cast<const u16 *>(
|
||||
mesh->getMeshBuffer(2)->getIndices());
|
||||
CHECK(indices[26] == 6);
|
||||
CHECK(indices[27] == 5);
|
||||
|
@ -283,7 +283,7 @@ SECTION("snow man") {
|
|||
SECTION("vertex normals are correct for all buffers") {
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(0)->getVertices());
|
||||
CHECK(vertices[0].Normal == v3f{1.0f, 0.0f, -0.0f});
|
||||
CHECK(vertices[1].Normal == v3f{1.0f, 0.0f, -0.0f});
|
||||
|
@ -294,7 +294,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(1)->getVertices());
|
||||
CHECK(vertices[0].Normal == v3f{1.0f, 0.0f, -0.0f});
|
||||
CHECK(vertices[1].Normal == v3f{1.0f, 0.0f, -0.0f});
|
||||
|
@ -305,7 +305,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(2)->getVertices());
|
||||
CHECK(vertices[3].Normal == v3f{1.0f, 0.0f, -0.0f});
|
||||
CHECK(vertices[4].Normal == v3f{-1.0f, 0.0f, -0.0f});
|
||||
|
@ -320,7 +320,7 @@ SECTION("snow man") {
|
|||
SECTION("texture coords are correct for all buffers") {
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(0)->getVertices());
|
||||
CHECK(vertices[0].TCoords == v2f{0.583333313f, 0.791666686f});
|
||||
CHECK(vertices[1].TCoords == v2f{0.583333313f, 0.666666686f});
|
||||
|
@ -331,7 +331,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(1)->getVertices());
|
||||
|
||||
CHECK(vertices[1].TCoords == v2f{0.0f, 0.791666686f});
|
||||
|
@ -343,7 +343,7 @@ SECTION("snow man") {
|
|||
}
|
||||
{
|
||||
REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24);
|
||||
auto vertices = static_cast<const irr::video::S3DVertex *>(
|
||||
auto vertices = static_cast<const video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(2)->getVertices());
|
||||
CHECK(vertices[10].TCoords == v2f{0.375f, 0.416666657f});
|
||||
CHECK(vertices[11].TCoords == v2f{0.375f, 0.583333313f});
|
||||
|
@ -360,7 +360,7 @@ SECTION("simple sparse accessor")
|
|||
{
|
||||
const auto mesh = loadMesh(model_stem + "simple_sparse_accessor.gltf");
|
||||
REQUIRE(mesh);
|
||||
const auto *vertices = reinterpret_cast<irr::video::S3DVertex *>(
|
||||
const auto *vertices = reinterpret_cast<video::S3DVertex *>(
|
||||
mesh->getMeshBuffer(0)->getVertices());
|
||||
const std::array<v3f, 14> expectedPositions = {
|
||||
// Lower
|
||||
|
@ -387,7 +387,7 @@ SECTION("simple sparse accessor")
|
|||
// https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/SimpleSkin
|
||||
SECTION("simple skin")
|
||||
{
|
||||
using SkinnedMesh = irr::scene::SkinnedMesh;
|
||||
using SkinnedMesh = scene::SkinnedMesh;
|
||||
const auto mesh = loadMesh(model_stem + "simple_skin.gltf");
|
||||
REQUIRE(mesh != nullptr);
|
||||
auto csm = dynamic_cast<const SkinnedMesh*>(mesh);
|
||||
|
@ -414,17 +414,17 @@ SECTION("simple skin")
|
|||
{
|
||||
const auto &transform = std::get<core::Transform>(parent->transform);
|
||||
CHECK(transform.translation == v3f(0, 0, 0));
|
||||
CHECK(transform.rotation == irr::core::quaternion());
|
||||
CHECK(transform.rotation == core::quaternion());
|
||||
CHECK(transform.scale == v3f(1, 1, 1));
|
||||
CHECK(parent->GlobalInversedMatrix == irr::core::matrix4());
|
||||
CHECK(parent->GlobalInversedMatrix == core::matrix4());
|
||||
}
|
||||
{
|
||||
const auto &transform = std::get<core::Transform>(child->transform);
|
||||
const v3f translation(0, 1, 0);
|
||||
CHECK(transform.translation == translation);
|
||||
CHECK(transform.rotation == irr::core::quaternion());
|
||||
CHECK(transform.rotation == core::quaternion());
|
||||
CHECK(transform.scale == v3f(1, 1, 1));
|
||||
irr::core::matrix4 inverseBindMatrix;
|
||||
core::matrix4 inverseBindMatrix;
|
||||
inverseBindMatrix.setTranslation(-translation);
|
||||
CHECK(child->GlobalInversedMatrix == inverseBindMatrix);
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ SECTION("simple skin")
|
|||
SECTION("weights are correct")
|
||||
{
|
||||
const auto weights = [&](const SkinnedMesh::SJoint *joint) {
|
||||
std::unordered_map<irr::u32, irr::f32> weights;
|
||||
std::unordered_map<u32, f32> weights;
|
||||
for (std::size_t i = 0; i < joint->Weights.size(); ++i) {
|
||||
const auto weight = joint->Weights[i];
|
||||
REQUIRE(weight.buffer_id == 0);
|
||||
|
@ -444,7 +444,7 @@ SECTION("simple skin")
|
|||
const auto parentWeights = weights(parent);
|
||||
const auto childWeights = weights(child);
|
||||
|
||||
const auto checkWeights = [&](irr::u32 index, irr::f32 parentWeight, irr::f32 childWeight) {
|
||||
const auto checkWeights = [&](u32 index, f32 parentWeight, f32 childWeight) {
|
||||
const auto getWeight = [](auto weights, auto index) {
|
||||
const auto it = weights.find(index);
|
||||
return it == weights.end() ? 0.0f : it->second;
|
||||
|
|
|
@ -25,9 +25,9 @@ const auto gamespec = findSubgame("devtest");
|
|||
if (!gamespec.isValid())
|
||||
SKIP();
|
||||
|
||||
irr::SIrrlichtCreationParameters p;
|
||||
SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_NULL;
|
||||
auto *driver = irr::createDeviceEx(p);
|
||||
auto *driver = createDeviceEx(p);
|
||||
|
||||
REQUIRE(driver);
|
||||
|
||||
|
@ -42,7 +42,7 @@ const static auto model_stem = gamespec.gamemods_path +
|
|||
DIR_DELIM + "testentities" + DIR_DELIM + "models" + DIR_DELIM + "testentities_";
|
||||
|
||||
SECTION("cool guy") {
|
||||
const auto *mesh = dynamic_cast<irr::scene::SkinnedMesh*>(loadMesh(model_stem + "cool_guy.x"));
|
||||
const auto *mesh = dynamic_cast<scene::SkinnedMesh*>(loadMesh(model_stem + "cool_guy.x"));
|
||||
REQUIRE(mesh);
|
||||
REQUIRE(mesh->getMeshBufferCount() == 1);
|
||||
|
||||
|
|
|
@ -71,28 +71,28 @@ void TestKeycode::testCreateFromString()
|
|||
void TestKeycode::testCreateFromSKeyInput()
|
||||
{
|
||||
KeyPress k;
|
||||
irr::SEvent::SKeyInput in;
|
||||
SEvent::SKeyInput in;
|
||||
|
||||
// Character key
|
||||
in.Key = irr::KEY_KEY_3;
|
||||
in.Key = KEY_KEY_3;
|
||||
in.Char = L'3';
|
||||
k = KeyPress(in);
|
||||
UASSERTEQ_STR(k.sym(), "KEY_KEY_3");
|
||||
|
||||
// Non-Character key
|
||||
in.Key = irr::KEY_RSHIFT;
|
||||
in.Key = KEY_RSHIFT;
|
||||
in.Char = L'\0';
|
||||
k = KeyPress(in);
|
||||
UASSERTEQ_STR(k.sym(), "KEY_RSHIFT");
|
||||
|
||||
// Irrlicht-unknown key
|
||||
in.Key = irr::KEY_KEY_CODES_COUNT;
|
||||
in.Key = KEY_KEY_CODES_COUNT;
|
||||
in.Char = L'?';
|
||||
k = KeyPress(in);
|
||||
UASSERTEQ_STR(k.sym(), "?");
|
||||
|
||||
// prefer_character mode
|
||||
in.Key = irr::KEY_COMMA;
|
||||
in.Key = KEY_COMMA;
|
||||
in.Char = L'G';
|
||||
k = KeyPress(in, true);
|
||||
UASSERTEQ_STR(k.sym(), "KEY_KEY_G");
|
||||
|
@ -105,15 +105,15 @@ void TestKeycode::testCompare()
|
|||
UASSERT(!(KeyPress("5") == KeyPress("KEY_NUMPAD5")));
|
||||
|
||||
// Matching char suffices
|
||||
// note: This is a real-world example, Irrlicht maps XK_equal to irr::KEY_PLUS on Linux
|
||||
irr::SEvent::SKeyInput in;
|
||||
in.Key = irr::KEY_PLUS;
|
||||
// note: This is a real-world example, Irrlicht maps XK_equal to KEY_PLUS on Linux
|
||||
SEvent::SKeyInput in;
|
||||
in.Key = KEY_PLUS;
|
||||
in.Char = L'=';
|
||||
UASSERT(KeyPress("=") == KeyPress(in));
|
||||
|
||||
// Matching keycode suffices
|
||||
irr::SEvent::SKeyInput in2;
|
||||
in.Key = in2.Key = irr::KEY_OEM_CLEAR;
|
||||
SEvent::SKeyInput in2;
|
||||
in.Key = in2.Key = KEY_OEM_CLEAR;
|
||||
in.Char = L'\0';
|
||||
in2.Char = L';';
|
||||
UASSERT(KeyPress(in) == KeyPress(in2));
|
||||
|
|
|
@ -370,7 +370,7 @@ void TestUtilities::testWrapRows()
|
|||
void TestUtilities::testEnrichedString()
|
||||
{
|
||||
EnrichedString str(L"Test bar");
|
||||
irr::video::SColor color(0xFF, 0, 0, 0xFF);
|
||||
video::SColor color(0xFF, 0, 0, 0xFF);
|
||||
|
||||
UASSERT(str.substr(1, 3).getString() == L"est");
|
||||
str += L" BUZZ";
|
||||
|
|
|
@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "debug.h"
|
||||
#include "log.h"
|
||||
|
||||
using namespace irr::video;
|
||||
using namespace video;
|
||||
|
||||
EnrichedString::EnrichedString()
|
||||
{
|
||||
|
@ -49,8 +49,8 @@ void EnrichedString::clear()
|
|||
m_colors.clear();
|
||||
m_has_background = false;
|
||||
m_default_length = 0;
|
||||
m_default_color = irr::video::SColor(255, 255, 255, 255);
|
||||
m_background = irr::video::SColor(0, 0, 0, 0);
|
||||
m_default_color = video::SColor(255, 255, 255, 255);
|
||||
m_background = video::SColor(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
EnrichedString &EnrichedString::operator=(std::wstring_view str)
|
||||
|
|
|
@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <vector>
|
||||
#include <SColor.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
class EnrichedString {
|
||||
public:
|
||||
|
|
|
@ -763,23 +763,23 @@ inline std::string str_join(const std::vector<std::string> &list,
|
|||
|
||||
#if IS_CLIENT_BUILD
|
||||
/**
|
||||
* Create a UTF8 std::string from an irr::core::stringw.
|
||||
* Create a UTF8 std::string from an core::stringw.
|
||||
*/
|
||||
[[nodiscard]]
|
||||
inline std::string stringw_to_utf8(const irr::core::stringw &input)
|
||||
inline std::string stringw_to_utf8(const core::stringw &input)
|
||||
{
|
||||
std::wstring_view sv(input.c_str(), input.size());
|
||||
return wide_to_utf8(sv);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an irr::core:stringw from a UTF8 std::string.
|
||||
* Create an core:stringw from a UTF8 std::string.
|
||||
*/
|
||||
[[nodiscard]]
|
||||
inline irr::core::stringw utf8_to_stringw(std::string_view input)
|
||||
inline core::stringw utf8_to_stringw(std::string_view input)
|
||||
{
|
||||
std::wstring str = utf8_to_wide(input);
|
||||
return irr::core::stringw(str.c_str(), str.size());
|
||||
return core::stringw(str.c_str(), str.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue