fix binary stream string reading and adjust presets panel height
This commit is contained in:
@@ -118,7 +118,7 @@ std::wstring BinaryStreamReader::rwstring(size_t len)
|
|||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
auto wptr = (uint16_t*)ptr;
|
auto wptr = (uint16_t*)ptr;
|
||||||
for (size_t i = len - 1; i >= 0 && len > 0; i--)
|
for (int i = (int)len - 1; i >= 0; i--)
|
||||||
if (wptr[i] == 0) len--;
|
if (wptr[i] == 0) len--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ void BinaryStreamWriter::wdbl(double v)
|
|||||||
|
|
||||||
void BinaryStreamWriter::wstring(std::string s)
|
void BinaryStreamWriter::wstring(std::string s)
|
||||||
{
|
{
|
||||||
wu32((int)s.size());
|
wu32((uint32_t)s.size());
|
||||||
write(s.data(), s.size());
|
write(s.data(), s.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ void BinaryStreamWriter::wstring_raw(std::string s)
|
|||||||
|
|
||||||
void BinaryStreamWriter::wwstring(std::wstring s)
|
void BinaryStreamWriter::wwstring(std::wstring s)
|
||||||
{
|
{
|
||||||
wu32((int)s.size());
|
wu32((uint32_t)s.size());
|
||||||
std::wstring_convert<std::codecvt_utf16<wchar_t, 0x10ffff>> converter;
|
std::wstring_convert<std::codecvt_utf16<wchar_t, 0x10ffff>> converter;
|
||||||
wstring_raw(converter.to_bytes(s));
|
wstring_raw(converter.to_bytes(s));
|
||||||
}
|
}
|
||||||
@@ -284,13 +284,13 @@ void BinaryStreamWriter::wwstring_raw(std::wstring s)
|
|||||||
|
|
||||||
void BinaryStreamWriter::wpascal(std::string s)
|
void BinaryStreamWriter::wpascal(std::string s)
|
||||||
{
|
{
|
||||||
wu8(s.size());
|
wu8((uint8_t)s.size());
|
||||||
write(s.data(), s.size());
|
write(s.data(), s.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinaryStreamWriter::wraw(std::vector<uint8_t> raw)
|
void BinaryStreamWriter::wraw(std::vector<uint8_t> raw)
|
||||||
{
|
{
|
||||||
wu32((int)raw.size());
|
wu32((uint32_t)raw.size());
|
||||||
write(raw.data(), raw.size());
|
write(raw.data(), raw.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void NodePanelQuick::handle_button_brush_click(Node* button)
|
|||||||
tick->SetSize(16, 32);
|
tick->SetSize(16, 32);
|
||||||
tick->SetPosition(pos.x, pos.y + (button->m_size.y - 32) * 0.5f);
|
tick->SetPosition(pos.x, pos.y + (button->m_size.y - 32) * 0.5f);
|
||||||
tick->set_image("data/ui/popup-tick.png");
|
tick->set_image("data/ui/popup-tick.png");
|
||||||
float hh = App::I.presets->m_container->m_children.size() > 10 ? App::I.height / App::I.zoom * .75f : 400.f;
|
float hh = App::I.presets->m_container->m_children.size() > 10 ? App::I.height - 90.f * App::I.zoom : 400.f;
|
||||||
App::I.presets->SetHeight(glm::max(hh, 400.f));
|
App::I.presets->SetHeight(glm::max(hh, 400.f));
|
||||||
root()->update();
|
root()->update();
|
||||||
if ((pos.y + App::I.presets->m_size.y) > screen.y)
|
if ((pos.y + App::I.presets->m_size.y) > screen.y)
|
||||||
|
|||||||
Reference in New Issue
Block a user