jni/src/gui/guiTable.cpp \
jni/src/guiscalingfilter.cpp \
jni/src/gui/guiVolumeChange.cpp \
+ jni/src/gui/profilergraph.cpp \
jni/src/httpfetch.cpp \
jni/src/hud.cpp \
jni/src/imagefilters.cpp \
void KeyCache::populate()
{
- key[KeyType::FORWARD] = getKeySetting("keymap_forward");
- key[KeyType::BACKWARD] = getKeySetting("keymap_backward");
- key[KeyType::LEFT] = getKeySetting("keymap_left");
- key[KeyType::RIGHT] = getKeySetting("keymap_right");
- key[KeyType::JUMP] = getKeySetting("keymap_jump");
- key[KeyType::SPECIAL1] = getKeySetting("keymap_special1");
- key[KeyType::SNEAK] = getKeySetting("keymap_sneak");
-
- key[KeyType::AUTOFORWARD] = getKeySetting("keymap_autoforward");
-
- key[KeyType::DROP] = getKeySetting("keymap_drop");
- key[KeyType::INVENTORY] = getKeySetting("keymap_inventory");
- key[KeyType::CHAT] = getKeySetting("keymap_chat");
- key[KeyType::CMD] = getKeySetting("keymap_cmd");
- key[KeyType::CMD_LOCAL] = getKeySetting("keymap_cmd_local");
- key[KeyType::CONSOLE] = getKeySetting("keymap_console");
- key[KeyType::MINIMAP] = getKeySetting("keymap_minimap");
- key[KeyType::FREEMOVE] = getKeySetting("keymap_freemove");
- key[KeyType::FASTMOVE] = getKeySetting("keymap_fastmove");
- key[KeyType::NOCLIP] = getKeySetting("keymap_noclip");
- key[KeyType::HOTBAR_PREV] = getKeySetting("keymap_hotbar_previous");
- key[KeyType::HOTBAR_NEXT] = getKeySetting("keymap_hotbar_next");
- key[KeyType::MUTE] = getKeySetting("keymap_mute");
- key[KeyType::INC_VOLUME] = getKeySetting("keymap_increase_volume");
- key[KeyType::DEC_VOLUME] = getKeySetting("keymap_decrease_volume");
- key[KeyType::CINEMATIC] = getKeySetting("keymap_cinematic");
- key[KeyType::SCREENSHOT] = getKeySetting("keymap_screenshot");
- key[KeyType::TOGGLE_HUD] = getKeySetting("keymap_toggle_hud");
- key[KeyType::TOGGLE_CHAT] = getKeySetting("keymap_toggle_chat");
- key[KeyType::TOGGLE_FORCE_FOG_OFF]
- = getKeySetting("keymap_toggle_force_fog_off");
- key[KeyType::TOGGLE_UPDATE_CAMERA]
- = getKeySetting("keymap_toggle_update_camera");
- key[KeyType::TOGGLE_DEBUG]
- = getKeySetting("keymap_toggle_debug");
- key[KeyType::TOGGLE_PROFILER]
- = getKeySetting("keymap_toggle_profiler");
- key[KeyType::CAMERA_MODE]
- = getKeySetting("keymap_camera_mode");
- key[KeyType::INCREASE_VIEWING_RANGE]
- = getKeySetting("keymap_increase_viewing_range_min");
- key[KeyType::DECREASE_VIEWING_RANGE]
- = getKeySetting("keymap_decrease_viewing_range_min");
- key[KeyType::RANGESELECT]
- = getKeySetting("keymap_rangeselect");
+ key[KeyType::FORWARD] = getKeySetting("keymap_forward");
+ key[KeyType::BACKWARD] = getKeySetting("keymap_backward");
+ key[KeyType::LEFT] = getKeySetting("keymap_left");
+ key[KeyType::RIGHT] = getKeySetting("keymap_right");
+ key[KeyType::JUMP] = getKeySetting("keymap_jump");
+ key[KeyType::SPECIAL1] = getKeySetting("keymap_special1");
+ key[KeyType::SNEAK] = getKeySetting("keymap_sneak");
+
+ key[KeyType::AUTOFORWARD] = getKeySetting("keymap_autoforward");
+
+ key[KeyType::DROP] = getKeySetting("keymap_drop");
+ key[KeyType::INVENTORY] = getKeySetting("keymap_inventory");
+ key[KeyType::CHAT] = getKeySetting("keymap_chat");
+ key[KeyType::CMD] = getKeySetting("keymap_cmd");
+ key[KeyType::CMD_LOCAL] = getKeySetting("keymap_cmd_local");
+ key[KeyType::CONSOLE] = getKeySetting("keymap_console");
+ key[KeyType::MINIMAP] = getKeySetting("keymap_minimap");
+ key[KeyType::FREEMOVE] = getKeySetting("keymap_freemove");
+ key[KeyType::FASTMOVE] = getKeySetting("keymap_fastmove");
+ key[KeyType::NOCLIP] = getKeySetting("keymap_noclip");
+ key[KeyType::HOTBAR_PREV] = getKeySetting("keymap_hotbar_previous");
+ key[KeyType::HOTBAR_NEXT] = getKeySetting("keymap_hotbar_next");
+ key[KeyType::MUTE] = getKeySetting("keymap_mute");
+ key[KeyType::INC_VOLUME] = getKeySetting("keymap_increase_volume");
+ key[KeyType::DEC_VOLUME] = getKeySetting("keymap_decrease_volume");
+ key[KeyType::CINEMATIC] = getKeySetting("keymap_cinematic");
+ key[KeyType::SCREENSHOT] = getKeySetting("keymap_screenshot");
+ key[KeyType::TOGGLE_HUD] = getKeySetting("keymap_toggle_hud");
+ key[KeyType::TOGGLE_CHAT] = getKeySetting("keymap_toggle_chat");
+ key[KeyType::TOGGLE_FORCE_FOG_OFF] = getKeySetting("keymap_toggle_force_fog_off");
+ key[KeyType::TOGGLE_UPDATE_CAMERA] = getKeySetting("keymap_toggle_update_camera");
+ key[KeyType::TOGGLE_DEBUG] = getKeySetting("keymap_toggle_debug");
+ key[KeyType::TOGGLE_PROFILER] = getKeySetting("keymap_toggle_profiler");
+ key[KeyType::CAMERA_MODE] = getKeySetting("keymap_camera_mode");
+ key[KeyType::INCREASE_VIEWING_RANGE] =
+ getKeySetting("keymap_increase_viewing_range_min");
+ key[KeyType::DECREASE_VIEWING_RANGE] =
+ getKeySetting("keymap_decrease_viewing_range_min");
+ key[KeyType::RANGESELECT] = getKeySetting("keymap_rangeselect");
key[KeyType::ZOOM] = getKeySetting("keymap_zoom");
key[KeyType::QUICKTUNE_NEXT] = getKeySetting("keymap_quicktune_next");
key[KeyType::QUICKTUNE_PREV] = getKeySetting("keymap_quicktune_prev");
- key[KeyType::QUICKTUNE_INC] = getKeySetting("keymap_quicktune_inc");
- key[KeyType::QUICKTUNE_DEC] = getKeySetting("keymap_quicktune_dec");
+ key[KeyType::QUICKTUNE_INC] = getKeySetting("keymap_quicktune_inc");
+ key[KeyType::QUICKTUNE_DEC] = getKeySetting("keymap_quicktune_dec");
for (int i = 0; i < 23; i++) {
std::string slot_key_name = "keymap_slot" + std::to_string(i + 1);
{
return (myrand() % (max - min + 1)) + min;
}
+
+void RandomInputHandler::step(float dtime)
+{
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 40);
+ keydown.toggle(getKeySetting("keymap_jump"));
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 40);
+ keydown.toggle(getKeySetting("keymap_special1"));
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 40);
+ keydown.toggle(getKeySetting("keymap_forward"));
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 40);
+ keydown.toggle(getKeySetting("keymap_left"));
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 20);
+ mousespeed = v2s32(Rand(-20, 20), Rand(-15, 20));
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 30);
+ leftdown = !leftdown;
+ if (leftdown)
+ leftclicked = true;
+ if (!leftdown)
+ leftreleased = true;
+ }
+ }
+ {
+ static float counter1 = 0;
+ counter1 -= dtime;
+ if (counter1 < 0.0) {
+ counter1 = 0.1 * Rand(1, 15);
+ rightdown = !rightdown;
+ if (rightdown)
+ rightclicked = true;
+ if (!rightdown)
+ rightreleased = true;
+ }
+ }
+ mousepos += mousespeed;
+}
* (up to 10x faster) key lookup is an asset. Other parts of the codebase
* (e.g. formspecs) should continue using getKeySetting().
*/
-struct KeyCache {
+struct KeyCache
+{
KeyCache()
{
class InputHandler
{
public:
- InputHandler() = default;
+ InputHandler()
+ {
+ keycache.handler = this;
+ keycache.populate();
+ }
virtual ~InputHandler() = default;
- virtual bool isKeyDown(const KeyPress &keyCode) = 0;
- virtual bool wasKeyDown(const KeyPress &keyCode) = 0;
+ virtual bool isKeyDown(GameKeyType k) = 0;
+ virtual bool wasKeyDown(GameKeyType k) = 0;
+ virtual bool cancelPressed() = 0;
virtual void listenForKey(const KeyPress &keyCode) {}
virtual void dontListenForKeys() {}
virtual void clear() {}
JoystickController joystick;
+ KeyCache keycache;
};
/*
Separated input handler
{
m_receiver->joystick = &joystick;
}
- virtual bool isKeyDown(const KeyPress &keyCode)
+ virtual bool isKeyDown(GameKeyType k)
+ {
+ return m_receiver->IsKeyDown(keycache.key[k]) || joystick.isKeyDown(k);
+ }
+ virtual bool wasKeyDown(GameKeyType k)
{
- return m_receiver->IsKeyDown(keyCode);
+ return m_receiver->WasKeyDown(keycache.key[k]) || joystick.wasKeyDown(k);
}
- virtual bool wasKeyDown(const KeyPress &keyCode)
+ virtual bool cancelPressed()
{
- return m_receiver->WasKeyDown(keyCode);
+ return wasKeyDown(KeyType::ESC) || m_receiver->WasKeyDown(CancelKey);
}
virtual void listenForKey(const KeyPress &keyCode)
{
virtual bool getLeftClicked()
{
- return m_receiver->leftclicked || joystick.getWasKeyDown(KeyType::MOUSE_L);
+ return m_receiver->leftclicked ||
+ joystick.getWasKeyDown(KeyType::MOUSE_L);
}
virtual bool getRightClicked()
{
- return m_receiver->rightclicked || joystick.getWasKeyDown(KeyType::MOUSE_R);
+ return m_receiver->rightclicked ||
+ joystick.getWasKeyDown(KeyType::MOUSE_R);
}
virtual void resetLeftClicked()
m_receiver->leftclicked = false;
joystick.clearWasKeyDown(KeyType::MOUSE_L);
}
- virtual void resetRightClicked() {
+ virtual void resetRightClicked()
+ {
m_receiver->rightclicked = false;
joystick.clearWasKeyDown(KeyType::MOUSE_R);
}
virtual bool getLeftReleased()
{
- return m_receiver->leftreleased || joystick.wasKeyReleased(KeyType::MOUSE_L);
+ return m_receiver->leftreleased ||
+ joystick.wasKeyReleased(KeyType::MOUSE_L);
}
virtual bool getRightReleased()
{
- return m_receiver->rightreleased || joystick.wasKeyReleased(KeyType::MOUSE_R);
+ return m_receiver->rightreleased ||
+ joystick.wasKeyReleased(KeyType::MOUSE_R);
}
virtual void resetLeftReleased()
public:
RandomInputHandler() = default;
- virtual bool isKeyDown(const KeyPress &keyCode) { return keydown[keyCode]; }
- virtual bool wasKeyDown(const KeyPress &keyCode) { return false; }
+ virtual bool isKeyDown(GameKeyType k) { return keydown[keycache.key[k]]; }
+ virtual bool wasKeyDown(GameKeyType k) { return false; }
+ virtual bool cancelPressed() { return false; }
virtual v2s32 getMousePos() { return mousepos; }
virtual void setMousePos(s32 x, s32 y) { mousepos = v2s32(x, y); }
virtual s32 getMouseWheel() { return 0; }
- virtual void step(float dtime)
- {
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 40);
- keydown.toggle(getKeySetting("keymap_jump"));
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 40);
- keydown.toggle(getKeySetting("keymap_special1"));
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 40);
- keydown.toggle(getKeySetting("keymap_forward"));
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 40);
- keydown.toggle(getKeySetting("keymap_left"));
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 20);
- mousespeed = v2s32(Rand(-20, 20), Rand(-15, 20));
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 30);
- leftdown = !leftdown;
- if (leftdown)
- leftclicked = true;
- if (!leftdown)
- leftreleased = true;
- }
- }
- {
- static float counter1 = 0;
- counter1 -= dtime;
- if (counter1 < 0.0) {
- counter1 = 0.1 * Rand(1, 15);
- rightdown = !rightdown;
- if (rightdown)
- rightclicked = true;
- if (!rightdown)
- rightreleased = true;
- }
- }
- mousepos += mousespeed;
- }
+ virtual void step(float dtime);
s32 Rand(s32 min, s32 max);
inline bool isKeyDown(GameKeyType k)
{
- return input->isKeyDown(keycache.key[k]) || input->joystick.isKeyDown(k);
+ return input->isKeyDown(k);
}
inline bool wasKeyDown(GameKeyType k)
{
- return input->wasKeyDown(keycache.key[k]) || input->joystick.wasKeyDown(k);
+ return input->wasKeyDown(k);
}
#ifdef __ANDROID__
*/
int crack_animation_length;
- KeyCache keycache;
-
IntervalLimiter profiler_interval;
/*
this->chat_backend = chat_backend;
this->simple_singleplayer_mode = simple_singleplayer_mode;
- keycache.handler = input;
- keycache.populate();
+ input->keycache.populate();
driver = device->getVideoDriver();
smgr = RenderingEngine::get_scene_manager();
break;
}
- if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ if (input->cancelPressed()) {
*connection_aborted = true;
infostream << "Connect aborted [Escape]" << std::endl;
break;
return false;
}
- if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ if (input->cancelPressed()) {
*aborted = true;
infostream << "Connect aborted [Escape]" << std::endl;
return false;
}
if (g_gamecallback->keyconfig_changed) {
- keycache.populate(); // update the cache with new settings
+ input->keycache.populate(); // update the cache with new settings
g_gamecallback->keyconfig_changed = false;
}
toggleAutoforward();
} else if (wasKeyDown(KeyType::INVENTORY)) {
openInventory();
- } else if (wasKeyDown(KeyType::ESC) || input->wasKeyDown(CancelKey)) {
+ } else if (input->cancelPressed()) {
if (!gui_chat_console->isOpenInhibited()) {
showPauseMenu();
}
if (!client->moddingEnabled()
|| !client->getScript()->on_inventory_open(fs_src->m_client->getInventory(inventoryloc))) {
TextDest *txt_dst = new TextDestPlayerInventory(client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src,
txt_dst);
cur_formname = "";
current_formspec->setFormSpec(fs_src->getForm(), inventoryloc);
// distinguish between the two in order to know when to use joysticks.
PlayerControl control(
- input->isKeyDown(keycache.key[KeyType::FORWARD]),
- input->isKeyDown(keycache.key[KeyType::BACKWARD]),
- input->isKeyDown(keycache.key[KeyType::LEFT]),
- input->isKeyDown(keycache.key[KeyType::RIGHT]),
+ input->isKeyDown(KeyType::FORWARD),
+ input->isKeyDown(KeyType::BACKWARD),
+ input->isKeyDown(KeyType::LEFT),
+ input->isKeyDown(KeyType::RIGHT),
isKeyDown(KeyType::JUMP),
isKeyDown(KeyType::SPECIAL1),
isKeyDown(KeyType::SNEAK),
TextDestPlayerInventory *txt_dst =
new TextDestPlayerInventory(client, *(event->show_formspec.formname));
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick,
fs_src, txt_dst);
cur_formname = *(event->show_formspec.formname);
}
FormspecFormSource *fs_src = new FormspecFormSource(*event->show_formspec.formspec);
LocalFormspecHandler *txt_dst =
new LocalFormspecHandler(*event->show_formspec.formname, client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src, txt_dst);
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src, txt_dst);
delete event->show_formspec.formspec;
delete event->show_formspec.formname;
&client->getEnv().getClientMap(), nodepos);
TextDest *txt_dst = new TextDestNodeMetadata(nodepos, client);
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src,
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src,
txt_dst);
cur_formname.clear();
FormspecFormSource *fs_src = new FormspecFormSource(os.str());
LocalFormspecHandler *txt_dst = new LocalFormspecHandler("MT_PAUSE_MENU");
- GUIFormSpecMenu::create(¤t_formspec, client, &input->joystick, fs_src, txt_dst);
+ GUIFormSpecMenu::create(current_formspec, client, &input->joystick, fs_src, txt_dst);
current_formspec->setFocus("btn_continue");
current_formspec->doPause = true;
}
#include "gettime.h"
#include "gettext.h"
#include "scripting_server.h"
+#include "mainmenumanager.h"
#include "porting.h"
#include "settings.h"
#include "client.h"
delete m_text_dst;
}
-void GUIFormSpecMenu::create(GUIFormSpecMenu **cur_formspec, Client *client,
+void GUIFormSpecMenu::create(GUIFormSpecMenu *&cur_formspec, Client *client,
JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest)
{
- if (*cur_formspec == 0) {
- *cur_formspec = new GUIFormSpecMenu(joystick, guiroot, -1, &g_menumgr,
+ if (cur_formspec == nullptr) {
+ cur_formspec = new GUIFormSpecMenu(joystick, guiroot, -1, &g_menumgr,
client, client->getTextureSource(), fs_src, txt_dest);
- (*cur_formspec)->doPause = false;
+ cur_formspec->doPause = false;
/*
Caution: do not call (*cur_formspec)->drop() here --
*/
} else {
- (*cur_formspec)->setFormSource(fs_src);
- (*cur_formspec)->setTextDest(txt_dest);
+ cur_formspec->setFormSource(fs_src);
+ cur_formspec->setTextDest(txt_dest);
}
}
~GUIFormSpecMenu();
- static void create(GUIFormSpecMenu **cur_formspec, Client *client,
+ static void create(GUIFormSpecMenu *&cur_formspec, Client *client,
JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest);
void setFormSpec(const std::string &formspec_string,
}
void ProfilerGraph::draw(s32 x_left, s32 y_bottom, video::IVideoDriver *driver,
- gui::IGUIFont *font) const
+ gui::IGUIFont *font) const
{
// Do *not* use UNORDERED_MAP here as the order needs
// to be the same for each call to prevent flickering
}
// Assign colors
- static const video::SColor usable_colors[] = {
- video::SColor(255, 255, 100, 100),
- video::SColor(255, 90, 225, 90),
- video::SColor(255, 100, 100, 255),
- video::SColor(255, 255, 150, 50),
- video::SColor(255, 220, 220, 100)
- };
+ static const video::SColor usable_colors[] = {video::SColor(255, 255, 100, 100),
+ video::SColor(255, 90, 225, 90),
+ video::SColor(255, 100, 100, 255),
+ video::SColor(255, 255, 150, 50),
+ video::SColor(255, 220, 220, 100)};
static const u32 usable_colors_count =
- sizeof(usable_colors) / sizeof(*usable_colors);
+ sizeof(usable_colors) / sizeof(*usable_colors);
u32 next_color_i = 0;
for (auto &i : m_meta) {
s32 textx2 = textx + 200 - 15;
s32 meta_i = 0;
- for (const auto &p: m_meta) {
+ for (const auto &p : m_meta) {
const std::string &id = p.first;
const Meta &meta = p.second;
s32 x = x_left;
char buf[10];
snprintf(buf, 10, "%.3g", show_max);
font->draw(utf8_to_wide(buf).c_str(),
- core::rect<s32>(textx, y - graphh,
- textx2, y - graphh + texth),
- meta.color);
+ core::rect<s32>(textx, y - graphh, textx2,
+ y - graphh + texth),
+ meta.color);
snprintf(buf, 10, "%.3g", show_min);
font->draw(utf8_to_wide(buf).c_str(),
- core::rect<s32>(textx, y - texth,
- textx2, y),
- meta.color);
+ core::rect<s32>(textx, y - texth, textx2, y), meta.color);
font->draw(utf8_to_wide(id).c_str(),
- core::rect<s32>(textx, y - graphh / 2 - texth / 2,
- textx2, y - graphh / 2 + texth / 2),
- meta.color);
+ core::rect<s32>(textx, y - graphh / 2 - texth / 2, textx2,
+ y - graphh / 2 + texth / 2),
+ meta.color);
s32 graph1y = y;
s32 graph1h = graphh;
bool relativegraph = (show_min != 0 && show_min != show_max);
for (const Piece &piece : m_log) {
float value = 0;
bool value_exists = false;
- Profiler::GraphValues::const_iterator k =
- piece.values.find(id);
+ Profiler::GraphValues::const_iterator k = piece.values.find(id);
if (k != piece.values.end()) {
value = k->second;
if (lastscaledvalue_exists) {
s32 ivalue1 = lastscaledvalue * graph1h;
s32 ivalue2 = scaledvalue * graph1h;
- driver->draw2DLine(v2s32(x - 1, graph1y - ivalue1),
- v2s32(x, graph1y - ivalue2), meta.color);
+ driver->draw2DLine(
+ v2s32(x - 1, graph1y - ivalue1),
+ v2s32(x, graph1y - ivalue2),
+ meta.color);
}
lastscaledvalue = scaledvalue;
} else {
s32 ivalue = scaledvalue * graph1h;
driver->draw2DLine(v2s32(x, graph1y),
- v2s32(x, graph1y - ivalue), meta.color);
+ v2s32(x, graph1y - ivalue), meta.color);
}
x++;
class ProfilerGraph
{
private:
- struct Piece {
+ struct Piece
+ {
Piece(Profiler::GraphValues v) : values(std::move(v)) {}
Profiler::GraphValues values;
};
- struct Meta {
+ struct Meta
+ {
float min;
float max;
video::SColor color;
Meta(float initial = 0,
- video::SColor color = video::SColor(255, 255, 255, 255)):
- min(initial),
- max(initial),
- color(color)
- {}
+ video::SColor color = video::SColor(255, 255, 255, 255)) :
+ min(initial),
+ max(initial), color(color)
+ {
+ }
};
std::deque<Piece> m_log;
+
public:
u32 m_log_max_size = 200;
void put(const Profiler::GraphValues &values);
void draw(s32 x_left, s32 y_bottom, video::IVideoDriver *driver,
- gui::IGUIFont *font) const;
+ gui::IGUIFont *font) const;
};