Minor code sync
parent
caa7ae51bb
commit
443332f33b
|
@ -277,9 +277,10 @@ void GameUI::updateChatSize()
|
|||
|
||||
const v2u32 &window_size = RenderingEngine::get_instance()->getWindowSize();
|
||||
|
||||
core::rect<s32> chat_size(10, chat_y, window_size.X - 20, 0);
|
||||
core::rect<s32> chat_size(10, chat_y,
|
||||
window_size.X - 20, 0);
|
||||
chat_size.LowerRightCorner.Y = std::min((s32)window_size.Y,
|
||||
m_guitext_chat->getTextHeight() + chat_y);
|
||||
m_guitext_chat->getTextHeight() + chat_y);
|
||||
|
||||
if (chat_size == m_current_chat_size)
|
||||
return;
|
||||
|
|
|
@ -203,8 +203,7 @@ Minimap::Minimap(Client *client)
|
|||
addMode(MINIMAP_TYPE_RADAR, 256);
|
||||
addMode(MINIMAP_TYPE_RADAR, 128);
|
||||
#else
|
||||
// Replicate old behaviour
|
||||
addMode(MINIMAP_TYPE_RADAR, 32);
|
||||
addMode(MINIMAP_TYPE_RADAR, 64);
|
||||
#endif
|
||||
|
||||
// Initialize minimap data
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (C) 2021 Minetest
|
|||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (C) 2021 Minetest
|
|||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -329,26 +329,19 @@ void GUIEngine::run()
|
|||
|
||||
driver->endScene();
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
bool keyboardActive;
|
||||
if (!porting::hasRealKeyboard())
|
||||
keyboardActive = m_menu->getAndroidUIInput();
|
||||
#endif
|
||||
|
||||
u32 frametime_min = 1000 / g_settings->getFloat("fps_max_unfocused")
|
||||
/ 2;
|
||||
|
||||
#ifdef __IOS__
|
||||
if (keyboardActive)
|
||||
frametime_min = 1000 / g_settings->getFloat("fps_max");
|
||||
#endif
|
||||
|
||||
u32 frametime_min = 1000 / (device->isWindowFocused()
|
||||
? g_settings->getFloat("fps_max")
|
||||
: g_settings->getFloat("fps_max_unfocused"));
|
||||
if (m_clouds_enabled)
|
||||
cloudPostProcess(frametime_min, device);
|
||||
else
|
||||
sleep_ms(frametime_min);
|
||||
|
||||
m_script->step();
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
m_menu->getAndroidUIInput();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (C) 2020 Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
|
|||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (C) 2020 Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
|
|||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -424,7 +424,6 @@ void GUIScrollBar::refreshControls()
|
|||
border_size = h < w * 4 ? 0 : w;
|
||||
|
||||
up_button = Environment->addButton(core::rect<s32>(0, 0, w, w), this);
|
||||
|
||||
if (m_textures.size() >= 3) {
|
||||
up_button->setImage(m_textures[2]);
|
||||
up_button->setScaleImage(true);
|
||||
|
@ -434,15 +433,15 @@ void GUIScrollBar::refreshControls()
|
|||
up_button->setSubElement(true);
|
||||
up_button->setTabStop(false);
|
||||
}
|
||||
|
||||
if (sprites && m_textures.size() < 3) {
|
||||
up_button->setSpriteBank(sprites);
|
||||
up_button->setSprite(EGBS_BUTTON_UP,
|
||||
s32(skin->getIcon(EGDI_CURSOR_UP)), current_icon_color);
|
||||
s32(skin->getIcon(EGDI_CURSOR_UP)),
|
||||
current_icon_color);
|
||||
up_button->setSprite(EGBS_BUTTON_DOWN,
|
||||
s32(skin->getIcon(EGDI_CURSOR_UP)), current_icon_color);
|
||||
s32(skin->getIcon(EGDI_CURSOR_UP)),
|
||||
current_icon_color);
|
||||
}
|
||||
|
||||
up_button->setRelativePosition(core::rect<s32>(0, 0, w, w));
|
||||
up_button->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT,
|
||||
EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
|
||||
|
@ -455,20 +454,19 @@ void GUIScrollBar::refreshControls()
|
|||
}
|
||||
|
||||
if (!down_button) {
|
||||
if (!down_button) {
|
||||
down_button->setSubElement(true);
|
||||
down_button->setTabStop(false);
|
||||
}
|
||||
down_button->setSubElement(true);
|
||||
down_button->setTabStop(false);
|
||||
}
|
||||
|
||||
if (sprites && m_textures.size() < 4) {
|
||||
down_button->setSpriteBank(sprites);
|
||||
down_button->setSprite(EGBS_BUTTON_UP,
|
||||
s32(skin->getIcon(EGDI_CURSOR_DOWN)), current_icon_color);
|
||||
s32(skin->getIcon(EGDI_CURSOR_DOWN)),
|
||||
current_icon_color);
|
||||
down_button->setSprite(EGBS_BUTTON_DOWN,
|
||||
s32(skin->getIcon(EGDI_CURSOR_DOWN)), current_icon_color);
|
||||
s32(skin->getIcon(EGDI_CURSOR_DOWN)),
|
||||
current_icon_color);
|
||||
}
|
||||
|
||||
down_button->setRelativePosition(
|
||||
core::rect<s32>(0, RelativeRect.getHeight() - w, w,
|
||||
RelativeRect.getHeight()));
|
||||
|
|
|
@ -1006,11 +1006,10 @@ void GUISkin::drawColoredIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
|
|||
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR >= 9
|
||||
if (icon == EGDI_CHECK_BOX_CHECKED) {
|
||||
// Scale checkbox check specifically
|
||||
// TODO other icons
|
||||
int radius = getSize(EGDS_CHECK_BOX_WIDTH) * .38;
|
||||
core::recti rect{position.X - radius, position.Y - radius, position.X + radius, position.Y + radius};
|
||||
SpriteBank->draw2DSprite(Icons[icon], rect, 0,
|
||||
&colors[gray? EGDC_GRAY_WINDOW_SYMBOL : EGDC_WINDOW_SYMBOL], currenttime - starttime, loop);
|
||||
&colors[gray ? EGDC_GRAY_WINDOW_SYMBOL : EGDC_WINDOW_SYMBOL], currenttime - starttime, loop);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -764,7 +764,7 @@ void GUITable::drawCell(const Cell *cell, video::SColor color,
|
|||
else
|
||||
source_rect.LowerRightCorner.Y = rowh;
|
||||
|
||||
video::SColor colors[] = {color,color,color,color};
|
||||
video::SColor colors[] = {color, color, color, color};
|
||||
|
||||
core::rect<s32> image_pos(dest_pos.X, dest_pos.Y,
|
||||
dest_pos.X + (image->getOriginalSize().Width * scale),
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "static_text.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include <IGUIFont.h>
|
||||
#include <IVideoDriver.h>
|
||||
|
@ -638,3 +639,6 @@ void StaticText::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWr
|
|||
#endif // USE_FREETYPE
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUIStaticText.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
|
@ -273,3 +276,5 @@ inline void setStaticText(irr::gui::IGUIStaticText *static_text, const wchar_t *
|
|||
{
|
||||
setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor()));
|
||||
}
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
|
|
@ -451,7 +451,8 @@ ServerEnvironment::ServerEnvironment(ServerMap *map,
|
|||
}
|
||||
}
|
||||
|
||||
/*if (player_backend_name == "files") {
|
||||
#ifdef SERVER
|
||||
if (player_backend_name == "files") {
|
||||
warningstream << "/!\\ You are using old player file backend. "
|
||||
<< "This backend is deprecated and will be removed in a future release /!\\"
|
||||
<< std::endl << "Switching to SQLite3 or PostgreSQL is advised, "
|
||||
|
@ -463,7 +464,8 @@ ServerEnvironment::ServerEnvironment(ServerMap *map,
|
|||
<< "This backend is deprecated and will be removed in a future release /!\\"
|
||||
<< std::endl << "Switching to LevelDB or SQLite3 is advised, "
|
||||
<< "please read http://wiki.minetest.net/Database_backends." << std::endl;
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
m_player_database = openPlayerDatabase(player_backend_name, path_world, conf);
|
||||
m_auth_database = openAuthDatabase(auth_backend_name, path_world, conf);
|
||||
|
|
|
@ -300,7 +300,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
|
|||
return pthread_processor_bind_np(PTHREAD_BIND_ADVISORY_NP,
|
||||
&answer, proc_number, getThreadHandle()) == 0;
|
||||
|
||||
#elif defined(__APPLE__) || defined(__IOS__)
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
struct thread_affinity_policy tapol;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (C) 2021 rubenwardy
|
|||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -51,7 +51,7 @@ static bool parseHexColorString(const std::string &value, video::SColor &color,
|
|||
static bool parseNamedColorString(const std::string &value, video::SColor &color);
|
||||
|
||||
#if defined(__ANDROID__) || defined(__APPLE__)
|
||||
// Android need manual caring to support the full character set possible with wchar_t
|
||||
// On Android iconv disagrees how big a wchar_t is for whatever reason
|
||||
const char *DEFAULT_ENCODING = "UTF-32LE";
|
||||
#else
|
||||
const char *DEFAULT_ENCODING = "WCHAR_T";
|
||||
|
@ -143,7 +143,6 @@ std::wstring utf8_to_wide(const std::string &input)
|
|||
out.resize(outbuf_size / sizeof(wchar_t));
|
||||
|
||||
#if defined(__ANDROID__) || defined(__APPLE__)
|
||||
// Android need manual caring to support the full character set possible with wchar_t
|
||||
SANITY_CHECK(sizeof(wchar_t) == 4);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue