mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
Merge branch 'MihailRis:main' into main
This commit is contained in:
commit
acb1f084f7
24 changed files with 69 additions and 47 deletions
|
|
@ -413,7 +413,7 @@ namespace audio {
|
|||
/// @brief Load audio file info and PCM data
|
||||
/// @param file audio file
|
||||
/// @param headerOnly read header only
|
||||
/// @throws std::runtime_error if I/O error ocurred or format is unknown
|
||||
/// @throws std::runtime_error if I/O error occurred or format is unknown
|
||||
/// @return PCM audio data
|
||||
std::unique_ptr<PCM> load_PCM(const io::path& file, bool headerOnly);
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ namespace audio {
|
|||
/// @param file audio file path
|
||||
/// @param keepPCM store PCM data in sound to make it accessible with
|
||||
/// Sound::getPCM
|
||||
/// @throws std::runtime_error if I/O error ocurred or format is unknown
|
||||
/// @throws std::runtime_error if I/O error occurred or format is unknown
|
||||
/// @return new Sound instance
|
||||
std::unique_ptr<Sound> load_sound(const io::path& file, bool keepPCM);
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ namespace audio {
|
|||
|
||||
/// @brief Open new PCM stream from file
|
||||
/// @param file audio file path
|
||||
/// @throws std::runtime_error if I/O error ocurred or format is unknown
|
||||
/// @throws std::runtime_error if I/O error occurred or format is unknown
|
||||
/// @return new PCMStream instance
|
||||
std::unique_ptr<PCMStream> open_PCM_stream(const io::path& file);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
if (in.fail()) {
|
||||
logger.error() << "Wav::load_pcm: I/O error ocurred";
|
||||
logger.error() << "Wav::load_pcm: I/O error occurred";
|
||||
return -1;
|
||||
}
|
||||
return in.gcount();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class Hud : public util::ObjectsKeeper {
|
|||
/// @brief Allow actual pause
|
||||
bool allowPause = true;
|
||||
bool debug = false;
|
||||
/// @brief UI element will be dynamicly positioned near to inventory or in screen center
|
||||
/// @brief UI element will be dynamically positioned near to inventory or in screen center
|
||||
std::shared_ptr<gui::UINode> secondUI;
|
||||
|
||||
std::shared_ptr<gui::UINode> debugMinimap;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace gui {
|
|||
virtual ~BasePanel() = default;
|
||||
|
||||
virtual void setOrientation(Orientation orientation) {
|
||||
this->mainScrollDir = orientation;
|
||||
this->orientation = orientation;
|
||||
refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ void Container::act(float delta) {
|
|||
|
||||
void Container::scrolled(int value) {
|
||||
auto size = getSize();
|
||||
bool isVertical = actualLengthY > size.y;
|
||||
bool isVertical = mainScrollDir == Orientation::VERTICAL;
|
||||
int diff = (isVertical ? actualLengthY - size.y : actualLengthX - size.x);
|
||||
int& scroll = (isVertical ? scrollY : scrollX);
|
||||
|
||||
|
|
@ -245,6 +245,7 @@ void Container::setSize(const glm::vec2& size) {
|
|||
for (auto& node : nodes) {
|
||||
node->reposition();
|
||||
}
|
||||
scrolled(0);
|
||||
}
|
||||
|
||||
int Container::getScrollStep() const {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace gui {
|
|||
int actualLengthY = 0;
|
||||
int actualLengthX = 0;
|
||||
bool scrollable = true;
|
||||
Orientation mainScrollDir = Orientation::VERTICAL;
|
||||
|
||||
bool isScrolling() const {
|
||||
return scrollbarTriggered;
|
||||
|
|
|
|||
|
|
@ -91,6 +91,12 @@ static int l_get_mouse_delta(lua::State* L) {
|
|||
return lua::pushvec2(L, engine->getInput().getCursor().delta);
|
||||
}
|
||||
|
||||
static int l_get_mouse_scroll(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
return lua::pushinteger(L, engine->getInput().getScroll());
|
||||
}
|
||||
|
||||
static int l_get_bindings(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
|
|
@ -181,6 +187,7 @@ const luaL_Reg inputlib[] = {
|
|||
{"add_callback", lua::wrap<l_add_callback>},
|
||||
{"get_mouse_pos", lua::wrap<l_get_mouse_pos>},
|
||||
{"get_mouse_delta", lua::wrap<l_get_mouse_delta>},
|
||||
{"get_mouse_scroll", lua::wrap<l_get_mouse_scroll>},
|
||||
{"get_bindings", lua::wrap<l_get_bindings>},
|
||||
{"get_binding_text", lua::wrap<l_get_binding_text>},
|
||||
{"is_active", lua::wrap<l_is_active>},
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ namespace lua {
|
|||
|
||||
if (found == usertypeNames.end()) {
|
||||
log_error(
|
||||
"usertype is not registred: " + std::string(typeid(T).name())
|
||||
"usertype is not registered: " + std::string(typeid(T).name())
|
||||
);
|
||||
} else if (getglobal(L, found->second)) {
|
||||
setmetatable(L);
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public:
|
|||
state = ConnectionState::CLOSED;
|
||||
break;
|
||||
} else if (size < 0) {
|
||||
logger.warning() << "an error ocurred while receiving from "
|
||||
logger.warning() << "an error occurred while receiving from "
|
||||
<< to_string(addr);
|
||||
auto error = handle_socket_error("recv(...) error");
|
||||
closesocket(descriptor);
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
#include "util/EnumMetadata.hpp"
|
||||
|
||||
enum class ParticleSpawnShape {
|
||||
/// @brief Coordinates are regulary distributed within
|
||||
/// @brief Coordinates are regularly distributed within
|
||||
/// the volume of a ball.
|
||||
BALL = 0,
|
||||
/// @brief Coordinates are regulary distributed on
|
||||
/// @brief Coordinates are regularly distributed on
|
||||
/// a sphere.
|
||||
SPHERE,
|
||||
/// @brief Coordinates are uniform distributed within
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace util {
|
|||
|
||||
/// @brief Simple heap implementation for memory-optimal sparse array of
|
||||
/// small different structures
|
||||
/// @note alignment is not impemented
|
||||
/// @note alignment is not implemented
|
||||
/// (impractical in the context of scripting and memory consumption)
|
||||
/// @tparam Tindex entry index type
|
||||
/// @tparam Tsize entry size type
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ void WorldRegions::processBlocksData(int x, int z, const BlockDataProc& func) {
|
|||
try {
|
||||
func(&blocksData, std::move(voxData));
|
||||
} catch (const std::exception& err) {
|
||||
logger.error() << "an error ocurred while processing blocks "
|
||||
logger.error() << "an error occurred while processing blocks "
|
||||
"data in chunk (" << gx << ", " << gz << "): " << err.what();
|
||||
blocksData = {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue