summaryrefslogtreecommitdiffstats
path: root/game/client
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
committeruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
commit6dc5194895b6bd61d19bf5c95021471784084325 (patch)
tree705c35b3a671a09fc52b406dca81e7761729ded6 /game/client
parent44d91043f268d93dd08e99c5855bd29f85dd61a7 (diff)
downloadvoxelius-6dc5194895b6bd61d19bf5c95021471784084325.tar.bz2
voxelius-6dc5194895b6bd61d19bf5c95021471784084325.zip
I forgot to set these to true in .clang-format
https://files.catbox.moe/909rig.gif
Diffstat (limited to 'game/client')
-rw-r--r--game/client/config/keybind.cc6
-rw-r--r--game/client/entity/player_look.cc3
-rw-r--r--game/client/entity/player_move.cc15
-rw-r--r--game/client/game.cc6
-rw-r--r--game/client/gui/chat.cc3
-rw-r--r--game/client/gui/direct_connection.cc6
-rw-r--r--game/client/gui/language.cc6
-rw-r--r--game/client/gui/main_menu.cc12
-rw-r--r--game/client/gui/play_menu.cc27
-rw-r--r--game/client/gui/settings.cc9
-rw-r--r--game/client/gui/splash.cc3
-rw-r--r--game/client/gui/window_title.cc3
-rw-r--r--game/client/main.cc21
-rw-r--r--game/client/program.cc3
-rw-r--r--game/client/resource/sound_effect.cc6
-rw-r--r--game/client/resource/texture_gui.cc15
-rw-r--r--game/client/session.cc3
-rw-r--r--game/client/sound/sound.cc12
-rw-r--r--game/client/toggles.cc15
-rw-r--r--game/client/world/chunk_mesher.cc33
-rw-r--r--game/client/world/chunk_renderer.cc3
-rw-r--r--game/client/world/player_target.cc3
-rw-r--r--game/client/world/voxel_atlas.cc3
23 files changed, 144 insertions, 72 deletions
diff --git a/game/client/config/keybind.cc b/game/client/config/keybind.cc
index 1cf896c..6bd8ef0 100644
--- a/game/client/config/keybind.cc
+++ b/game/client/config/keybind.cc
@@ -153,7 +153,8 @@ config::KeyBind::KeyBind(int default_value)
if(default_value == DEBUG_KEY) {
m_glfw_keycode = GLFW_KEY_UNKNOWN;
m_name = UNKNOWN_KEY_NAME;
- } else {
+ }
+ else {
m_glfw_keycode = default_value;
m_name = get_key_name(default_value);
}
@@ -183,7 +184,8 @@ void config::KeyBind::set_key(int keycode)
if(keycode == DEBUG_KEY) {
m_glfw_keycode = GLFW_KEY_UNKNOWN;
m_name = UNKNOWN_KEY_NAME;
- } else {
+ }
+ else {
m_glfw_keycode = keycode;
m_name = get_key_name(keycode);
}
diff --git a/game/client/entity/player_look.cc b/game/client/entity/player_look.cc
index 9326af2..c633922 100644
--- a/game/client/entity/player_look.cc
+++ b/game/client/entity/player_look.cc
@@ -142,7 +142,8 @@ void entity::player_look::update_late(void)
if(!globals::gui_screen && session::is_ingame()) {
glfwSetInputMode(globals::window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
glfwSetInputMode(globals::window, GLFW_RAW_MOUSE_MOTION, mouse_raw_input.get_value());
- } else {
+ }
+ else {
glfwSetInputMode(globals::window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
glfwSetInputMode(globals::window, GLFW_RAW_MOUSE_MOTION, false);
}
diff --git a/game/client/entity/player_move.cc b/game/client/entity/player_move.cc
index 65e8669..4b40efb 100644
--- a/game/client/entity/player_move.cc
+++ b/game/client/entity/player_move.cc
@@ -180,7 +180,8 @@ void entity::player_move::fixed_update(void)
if(new_speed > 0.01f) {
footsteps_distance += globals::fixed_frametime * new_speed;
- } else {
+ }
+ else {
footsteps_distance = 0.0f;
}
@@ -191,7 +192,8 @@ void entity::player_move::fixed_update(void)
footsteps_distance = 0.0f;
}
- } else {
+ }
+ else {
auto new_velocity = pm_air_move(wishdir, velocity_horizontal);
velocity.value.x = new_velocity.x;
velocity.value.z = new_velocity.z;
@@ -220,11 +222,13 @@ void entity::player_move::fixed_update(void)
// No considerable speed increase within
// the precision we use to draw the speedometer
gui::status_lines::set(gui::STATUS_DEBUG, new_speed_text, ImVec4(0.7f, 0.7f, 0.7f, 1.0f), 1.0f);
- } else if(speed_change < 0.0f) {
+ }
+ else if(speed_change < 0.0f) {
// Speed change is negative, we are actively
// slowing down; use the red color for the status line
gui::status_lines::set(gui::STATUS_DEBUG, new_speed_text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 1.0f);
- } else {
+ }
+ else {
// Speed change is positive, we are actively
// speeding up; use the green color for the status line
gui::status_lines::set(gui::STATUS_DEBUG, new_speed_text, ImVec4(0.0f, 1.0f, 0.0f, 1.0f), 1.0f);
@@ -258,7 +262,8 @@ void entity::player_move::update_late(void)
movement_direction.x += axis_move_sideways.get_value(io::gamepad::state, io::gamepad::deadzone.get_value());
movement_direction.z -= axis_move_forward.get_value(io::gamepad::state, io::gamepad::deadzone.get_value());
- } else {
+ }
+ else {
if(GLFW_PRESS == glfwGetKey(globals::window, key_move_forward.get_key())) {
movement_direction += DIR_FORWARD<float>;
}
diff --git a/game/client/game.cc b/game/client/game.cc
index 0418236..d5820f4 100644
--- a/game/client/game.cc
+++ b/game/client/game.cc
@@ -512,7 +512,8 @@ void client_game::update(void)
if(session::is_ingame()) {
if(toggles::get(TOGGLE_PM_FLIGHT)) {
globals::dimension->entities.remove<entity::Gravity>(globals::player);
- } else {
+ }
+ else {
globals::dimension->entities.emplace_or_replace<entity::Gravity>(globals::player);
}
}
@@ -574,7 +575,8 @@ void client_game::update_late(void)
if(client_game::vertical_sync.get_value()) {
glfwSwapInterval(1);
- } else {
+ }
+ else {
glfwSwapInterval(0);
}
}
diff --git a/game/client/gui/chat.cc b/game/client/gui/chat.cc
index 3cf0958..8c4ac26 100644
--- a/game/client/gui/chat.cc
+++ b/game/client/gui/chat.cc
@@ -215,7 +215,8 @@ void gui::client_chat::layout(void)
if(globals::gui_screen == GUI_CHAT) {
rect_alpha = 0.75f;
text_alpha = 1.00f;
- } else {
+ }
+ else {
rect_alpha = 0.50f * fadeout;
text_alpha = 1.00f * fadeout;
}
diff --git a/game/client/gui/direct_connection.cc b/game/client/gui/direct_connection.cc
index 8a09e48..0290bd3 100644
--- a/game/client/gui/direct_connection.cc
+++ b/game/client/gui/direct_connection.cc
@@ -55,13 +55,15 @@ static void connect_to_server(void)
if(!parts[0].empty()) {
parsed_hostname = parts[0];
- } else {
+ }
+ else {
parsed_hostname = std::string("localhost");
}
if(parts.size() >= 2) {
parsed_port = math::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 1024, UINT16_MAX);
- } else {
+ }
+ else {
parsed_port = protocol::PORT;
}
diff --git a/game/client/gui/language.cc b/game/client/gui/language.cc
index 04906b4..b5bdc7d 100644
--- a/game/client/gui/language.cc
+++ b/game/client/gui/language.cc
@@ -164,7 +164,8 @@ gui::LanguageIterator gui::language::find(const char* ietf)
const auto it = ietf_map.find(ietf);
if(it != ietf_map.cend()) {
return it->second;
- } else {
+ }
+ else {
return manifest.cend();
}
}
@@ -184,7 +185,8 @@ const char* gui::language::resolve(const char* key)
const auto it = language_map.find(key);
if(it != language_map.cend()) {
return it->second.c_str();
- } else {
+ }
+ else {
return key;
}
}
diff --git a/game/client/gui/main_menu.cc b/game/client/gui/main_menu.cc
index 7af1f10..37ee398 100644
--- a/game/client/gui/main_menu.cc
+++ b/game/client/gui/main_menu.cc
@@ -62,7 +62,8 @@ void gui::main_menu::init(void)
if(title->size.x > title->size.y) {
title_aspect = static_cast<float>(title->size.x) / static_cast<float>(title->size.y);
- } else {
+ }
+ else {
title_aspect = static_cast<float>(title->size.y) / static_cast<float>(title->size.x);
}
@@ -89,7 +90,8 @@ void gui::main_menu::layout(void)
if(session::is_ingame()) {
ImGui::Dummy(ImVec2(0.0f, 32.0f * globals::gui_scale));
- } else {
+ }
+ else {
auto reference_height = 0.225f * window_size.y;
auto image_width = math::min(window_size.x, reference_height * title_aspect);
auto image_height = image_width / title_aspect;
@@ -110,7 +112,8 @@ void gui::main_menu::layout(void)
}
ImGui::Spacing();
- } else {
+ }
+ else {
ImGui::SetCursorPosX(button_xpos);
if(ImGui::Button(str_play.c_str(), ImVec2(button_width, 0.0f))) {
@@ -138,7 +141,8 @@ void gui::main_menu::layout(void)
}
ImGui::Spacing();
- } else {
+ }
+ else {
ImGui::SetCursorPosX(button_xpos);
if(ImGui::Button(str_quit.c_str(), ImVec2(button_width, 0.0f))) {
diff --git a/game/client/gui/play_menu.cc b/game/client/gui/play_menu.cc
index 922dd4e..f2a8887 100644
--- a/game/client/gui/play_menu.cc
+++ b/game/client/gui/play_menu.cc
@@ -85,13 +85,15 @@ static void parse_hostname(ServerStatusItem* item, const std::string& hostname)
if(!parts[0].empty()) {
item->hostname = parts[0];
- } else {
+ }
+ else {
item->hostname = std::string("localhost");
}
if(parts.size() >= 2) {
item->port = math::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 1024, UINT16_MAX);
- } else {
+ }
+ else {
item->port = protocol::PORT;
}
}
@@ -125,7 +127,8 @@ static void edit_selected_server(void)
if(selected_server->port != protocol::PORT) {
input_hostname = std::format("{}:{}", selected_server->hostname, selected_server->port);
- } else {
+ }
+ else {
input_hostname = selected_server->hostname;
}
@@ -163,7 +166,8 @@ static void on_glfw_key(const io::GlfwKeyEvent& event)
if(editing_server) {
if(adding_server) {
remove_selected_server();
- } else {
+ }
+ else {
input_itemname.clear();
input_hostname.clear();
input_password.clear();
@@ -209,7 +213,8 @@ static void on_bother_response(const gui::BotherResponseEvent& event)
item->max_players = UINT16_MAX;
item->motd = str_status_fail;
item->status = item_status::FAILURE;
- } else {
+ }
+ else {
item->protocol_version = event.protocol_version;
item->num_players = event.num_players;
item->max_players = event.max_players;
@@ -270,7 +275,8 @@ static void layout_server_item(ServerStatusItem* item)
if(item->protocol_version < protocol::VERSION) {
ImGui::TextUnformatted(str_outdated_server.c_str(), str_outdated_server.c_str() + str_outdated_server.size());
- } else {
+ }
+ else {
ImGui::TextUnformatted(str_outdated_client.c_str(), str_outdated_client.c_str() + str_outdated_client.size());
}
@@ -359,7 +365,8 @@ static void layout_servers(void)
for(ServerStatusItem* item : servers_deque) {
if(editing_server && item == selected_server) {
layout_server_edit(item);
- } else {
+ }
+ else {
layout_server_item(item);
}
}
@@ -460,13 +467,15 @@ void gui::play_menu::init(void)
if(parts.size() >= 2) {
item->password = parts[1];
- } else {
+ }
+ else {
item->password = std::string();
}
if(parts.size() >= 3) {
item->name = parts[2].substr(0, MAX_SERVER_ITEM_NAME);
- } else {
+ }
+ else {
item->name = DEFAULT_SERVER_NAME;
}
diff --git a/game/client/gui/settings.cc b/game/client/gui/settings.cc
index 5c6b5eb..034db4c 100644
--- a/game/client/gui/settings.cc
+++ b/game/client/gui/settings.cc
@@ -315,7 +315,8 @@ void SettingValue_InputString::layout(void) const
if(allow_whitespace) {
flags = ImGuiInputTextFlags_AllowTabInput;
- } else {
+ }
+ else {
flags = 0;
}
@@ -379,7 +380,8 @@ void SettingValue_StepperInt::layout(void) const
if(current_value > max_value) {
value->set_value(min_value);
- } else {
+ }
+ else {
value->set_value(current_value);
}
@@ -409,7 +411,8 @@ void SettingValue_StepperUnsigned::layout(void) const
if(current_value > max_value) {
value->set_value(min_value);
- } else {
+ }
+ else {
value->set_value(current_value);
}
diff --git a/game/client/gui/splash.cc b/game/client/gui/splash.cc
index d6615ec..a144f97 100644
--- a/game/client/gui/splash.cc
+++ b/game/client/gui/splash.cc
@@ -61,7 +61,8 @@ void gui::client_splash::init(void)
if(texture) {
if(texture->size.x > texture->size.y) {
texture_aspect = static_cast<float>(texture->size.x) / static_cast<float>(texture->size.y);
- } else {
+ }
+ else {
texture_aspect = static_cast<float>(texture->size.y) / static_cast<float>(texture->size.x);
}
diff --git a/game/client/gui/window_title.cc b/game/client/gui/window_title.cc
index 5a5aca2..91e308f 100644
--- a/game/client/gui/window_title.cc
+++ b/game/client/gui/window_title.cc
@@ -14,7 +14,8 @@ void gui::window_title::update(void)
if(globals::sound_ctx && globals::sound_dev) {
title = std::format("Voxelius {}: {}", project_version_string, splash::get());
- } else {
+ }
+ else {
title = std::format("Voxelius {}: {} [NOSOUND]", project_version_string, splash::get());
}
diff --git a/game/client/main.cc b/game/client/main.cc
index 04ee832..cb3e209 100644
--- a/game/client/main.cc
+++ b/game/client/main.cc
@@ -207,11 +207,13 @@ int main(int argc, char** argv)
// information about buffer usage into the debug callback
static const std::uint32_t ignore_nvidia_131185 = 131185;
glDebugMessageControl(GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_OTHER, GL_DONT_CARE, 1, &ignore_nvidia_131185, GL_FALSE);
- } else {
+ }
+ else {
spdlog::warn("glad: nodebug command line parameter found");
spdlog::warn("glad: OpenGL errors will not be logged");
}
- } else {
+ }
+ else {
spdlog::warn("glad: KHR_debug extension not supported");
spdlog::warn("glad: OpenGL errors will not be logged");
}
@@ -256,18 +258,21 @@ int main(int argc, char** argv)
spdlog::warn("client: sound disabled [per command line]");
globals::sound_dev = nullptr;
globals::sound_ctx = nullptr;
- } else {
+ }
+ else {
if(!saladLoadALdefault()) {
spdlog::warn("client: sound disabled [openal loading failed]");
globals::sound_dev = nullptr;
globals::sound_ctx = nullptr;
- } else {
+ }
+ else {
globals::sound_dev = alcOpenDevice(nullptr);
if(globals::sound_dev == nullptr) {
spdlog::warn("client: sound disabled [no device]");
globals::sound_ctx = nullptr;
- } else {
+ }
+ else {
spdlog::info("sound: {}", reinterpret_cast<const char*>(alcGetString(globals::sound_dev, ALC_DEVICE_SPECIFIER)));
globals::sound_ctx = alcCreateContext(globals::sound_dev, nullptr);
@@ -276,7 +281,8 @@ int main(int argc, char** argv)
spdlog::warn("client: sound disabled [context creation failed]");
alcCloseDevice(globals::sound_dev);
globals::sound_dev = nullptr;
- } else {
+ }
+ else {
alcMakeContextCurrent(globals::sound_ctx);
}
}
@@ -340,7 +346,8 @@ int main(int argc, char** argv)
if(globals::fixed_frametime_us == UINT64_MAX) {
globals::fixed_framecount = 0;
globals::fixed_accumulator = 0;
- } else {
+ }
+ else {
globals::fixed_accumulator += globals::window_frametime_us;
globals::fixed_framecount = globals::fixed_accumulator / globals::fixed_frametime_us;
globals::fixed_accumulator %= globals::fixed_frametime_us;
diff --git a/game/client/program.cc b/game/client/program.cc
index 7b908af..17441e6 100644
--- a/game/client/program.cc
+++ b/game/client/program.cc
@@ -30,7 +30,8 @@ static void parse_source(const char* source, std::vector<std::string>& out_lines
out_lines.push_back(std::string());
line_number += 1UL;
- } else {
+ }
+ else {
out_lines.push_back(line);
line_number += 1UL;
}
diff --git a/game/client/resource/sound_effect.cc b/game/client/resource/sound_effect.cc
index e3a0a6a..0d987a5 100644
--- a/game/client/resource/sound_effect.cc
+++ b/game/client/resource/sound_effect.cc
@@ -17,7 +17,8 @@ static drwav_bool32 drwav_seek_physfs(void* file, int offset, drwav_seek_origin
{
if(origin == drwav_seek_origin_current) {
return PHYSFS_seek(reinterpret_cast<PHYSFS_File*>(file), PHYSFS_tell(reinterpret_cast<PHYSFS_File*>(file)) + offset);
- } else {
+ }
+ else {
return PHYSFS_seek(reinterpret_cast<PHYSFS_File*>(file), offset);
}
}
@@ -84,7 +85,8 @@ void resource::hard_cleanup<SoundEffect>(void)
for(const auto& it : resource_map) {
if(it.second.use_count() > 1L) {
spdlog::warn("resource: zombie resource [SoundEffect] {} [use_count={}]", it.first, it.second.use_count());
- } else {
+ }
+ else {
spdlog::debug("resource: releasing [SoundEffect] {}", it.first);
}
diff --git a/game/client/resource/texture_gui.cc b/game/client/resource/texture_gui.cc
index a931352..971e201 100644
--- a/game/client/resource/texture_gui.cc
+++ b/game/client/resource/texture_gui.cc
@@ -36,25 +36,29 @@ resource_ptr<TextureGUI> resource::load<TextureGUI>(const char* name, unsigned i
if(flags & TEXTURE_GUI_LOAD_CLAMP_S) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- } else {
+ }
+ else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
}
if(flags & TEXTURE_GUI_LOAD_CLAMP_T) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- } else {
+ }
+ else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
if(flags & TEXTURE_GUI_LOAD_LINEAR_MAG) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- } else {
+ }
+ else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
if(flags & TEXTURE_GUI_LOAD_LINEAR_MIN) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- } else {
+ }
+ else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
@@ -75,7 +79,8 @@ void resource::hard_cleanup<TextureGUI>(void)
for(const auto& it : resource_map) {
if(it.second.use_count() > 1L) {
spdlog::warn("resource: zombie resource [TextureGUI] {} [use_count={}]", it.first, it.second.use_count());
- } else {
+ }
+ else {
spdlog::debug("resource: releasing [TextureGUI] {}", it.first);
}
diff --git a/game/client/session.cc b/game/client/session.cc
index d3f4859..521e0c2 100644
--- a/game/client/session.cc
+++ b/game/client/session.cc
@@ -296,7 +296,8 @@ bool session::is_ingame(void)
{
if(globals::dimension) {
return globals::dimension->entities.valid(globals::player);
- } else {
+ }
+ else {
return false;
}
}
diff --git a/game/client/sound/sound.cc b/game/client/sound/sound.cc
index fa3cd19..f3bd5e2 100644
--- a/game/client/sound/sound.cc
+++ b/game/client/sound/sound.cc
@@ -99,7 +99,8 @@ void sound::play_generic(const char* sound, bool looping, float pitch)
{
if(sound) {
sound::play_generic(resource::load<SoundEffect>(sound), looping, pitch);
- } else {
+ }
+ else {
sound::play_generic(static_cast<const char*>(nullptr), looping, pitch);
}
}
@@ -108,7 +109,8 @@ void sound::play_entity(entt::entity entity, const char* sound, bool looping, fl
{
if(sound) {
sound::play_entity(entity, resource::load<SoundEffect>(sound), looping, pitch);
- } else {
+ }
+ else {
sound::play_entity(entity, static_cast<const char*>(nullptr), looping, pitch);
}
}
@@ -117,7 +119,8 @@ void sound::play_player(const char* sound, bool looping, float pitch)
{
if(sound) {
sound::play_player(resource::load<SoundEffect>(sound), looping, pitch);
- } else {
+ }
+ else {
sound::play_player(static_cast<const char*>(nullptr), looping, pitch);
}
}
@@ -126,7 +129,8 @@ void sound::play_ui(const char* sound, bool looping, float pitch)
{
if(sound) {
sound::play_ui(resource::load<SoundEffect>(sound), looping, pitch);
- } else {
+ }
+ else {
sound::play_ui(static_cast<const char*>(nullptr), looping, pitch);
}
}
diff --git a/game/client/toggles.cc b/game/client/toggles.cc
index f5d9561..96c4ae4 100644
--- a/game/client/toggles.cc
+++ b/game/client/toggles.cc
@@ -27,7 +27,8 @@ static void print_toggle_state(const ToggleInfo& info)
if(info.description) {
if(info.is_enabled) {
gui::client_chat::print(std::format("[toggles] {} ON", info.description));
- } else {
+ }
+ else {
gui::client_chat::print(std::format("[toggles] {} OFF", info.description));
}
}
@@ -38,7 +39,8 @@ static void toggle_value(ToggleInfo& info, toggle_type type)
if(info.is_enabled) {
info.is_enabled = false;
globals::dispatcher.trigger(ToggleDisabledEvent { type });
- } else {
+ }
+ else {
info.is_enabled = true;
globals::dispatcher.trigger(ToggleEnabledEvent { type });
}
@@ -124,7 +126,8 @@ void toggles::init_late(void)
for(toggle_type i = 0; i < TOGGLE_COUNT; ++i) {
if(toggle_infos[i].is_enabled) {
globals::dispatcher.trigger(ToggleEnabledEvent { i });
- } else {
+ }
+ else {
globals::dispatcher.trigger(ToggleDisabledEvent { i });
}
}
@@ -134,7 +137,8 @@ bool toggles::get(toggle_type type)
{
if(type < TOGGLE_COUNT) {
return toggle_infos[type].is_enabled;
- } else {
+ }
+ else {
return false;
}
}
@@ -145,7 +149,8 @@ void toggles::set(toggle_type type, bool value)
if(value) {
toggle_infos[type].is_enabled = true;
globals::dispatcher.trigger(ToggleEnabledEvent { type });
- } else {
+ }
+ else {
toggle_infos[type].is_enabled = false;
globals::dispatcher.trigger(ToggleDisabledEvent { type });
}
diff --git a/game/client/world/chunk_mesher.cc b/game/client/world/chunk_mesher.cc
index 5e70626..9f5ce6c 100644
--- a/game/client/world/chunk_mesher.cc
+++ b/game/client/world/chunk_mesher.cc
@@ -43,9 +43,11 @@ static const CachedChunkCoord get_cached_cpos(const chunk_pos& pivot, const chun
if(delta[0]) {
return nx[delta[0] + 1];
- } else if(delta[1]) {
+ }
+ else if(delta[1]) {
return ny[delta[1] + 1];
- } else {
+ }
+ else {
return nz[delta[2] + 1];
}
}
@@ -210,7 +212,8 @@ void GL_MeshingTask::finalize(void)
buffer.handle = 0;
buffer.size = 0;
}
- } else {
+ }
+ else {
if(!buffer.handle) {
glGenBuffers(1, &buffer.handle);
}
@@ -232,7 +235,8 @@ void GL_MeshingTask::finalize(void)
buffer.handle = 0;
buffer.size = 0;
}
- } else {
+ }
+ else {
if(!buffer.handle) {
glGenBuffers(1, &buffer.handle);
}
@@ -264,18 +268,22 @@ bool GL_MeshingTask::vis_test(voxel_id voxel, const world::VoxelInfo* info, cons
if(neighbour == NULL_VOXEL_ID) {
result = true;
- } else if(neighbour == voxel) {
+ }
+ else if(neighbour == voxel) {
result = false;
- } else if(auto neighbour_info = world::voxel_registry::find(neighbour)) {
+ }
+ else if(auto neighbour_info = world::voxel_registry::find(neighbour)) {
if(neighbour_info->blending != info->blending) {
// Voxel types that use blending are semi-transparent;
// this means they're rendered using a different setup
// and they must have visible faces with opaque voxels
result = neighbour_info->blending;
- } else {
+ }
+ else {
result = false;
}
- } else {
+ }
+ else {
result = false;
}
@@ -289,7 +297,8 @@ void GL_MeshingTask::push_quad_a(const world::VoxelInfo* info, const glm::fvec3&
if(info->blending) {
m_quads_b[vtex.cached_plane].push_back(make_chunk_quad(pos, size, facing, vtex.cached_offset, vtex.paths.size()));
- } else {
+ }
+ else {
m_quads_s[vtex.cached_plane].push_back(make_chunk_quad(pos, size, facing, vtex.cached_offset, vtex.paths.size()));
}
}
@@ -303,7 +312,8 @@ void GL_MeshingTask::push_quad_v(
if(info->blending) {
m_quads_b[vtex.cached_plane].push_back(make_chunk_quad(pos, size, facing, vtex.cached_offset + entropy_mod, 0));
- } else {
+ }
+ else {
m_quads_s[vtex.cached_plane].push_back(make_chunk_quad(pos, size, facing, vtex.cached_offset + entropy_mod, 0));
}
}
@@ -338,7 +348,8 @@ void GL_MeshingTask::make_cube(
if(vis & world::VIS_DOWN) {
push_quad_a(info, fpos, fsize, world::voxel_face::CUBE_BOTTOM);
}
- } else {
+ }
+ else {
if(vis & world::VIS_NORTH) {
push_quad_v(info, fpos, fsize, world::voxel_face::CUBE_NORTH, entropy);
}
diff --git a/game/client/world/chunk_renderer.cc b/game/client/world/chunk_renderer.cc
index 0962010..fe3a42e 100644
--- a/game/client/world/chunk_renderer.cc
+++ b/game/client/world/chunk_renderer.cc
@@ -94,7 +94,8 @@ void world::chunk_renderer::render(void)
if(toggles::get(TOGGLE_WIREFRAME)) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- } else {
+ }
+ else {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
diff --git a/game/client/world/player_target.cc b/game/client/world/player_target.cc
index 6da8129..a398eed 100644
--- a/game/client/world/player_target.cc
+++ b/game/client/world/player_target.cc
@@ -48,7 +48,8 @@ void world::player_target::update(void)
world::player_target::normal = voxel_pos();
world::player_target::info = nullptr;
} while(ray.distance < MAX_REACH);
- } else {
+ }
+ else {
world::player_target::voxel = NULL_VOXEL_ID;
world::player_target::coord = voxel_pos();
world::player_target::normal = voxel_pos();
diff --git a/game/client/world/voxel_atlas.cc b/game/client/world/voxel_atlas.cc
index c327deb..1018747 100644
--- a/game/client/world/voxel_atlas.cc
+++ b/game/client/world/voxel_atlas.cc
@@ -131,7 +131,8 @@ GLuint world::voxel_atlas::plane_texture(std::size_t plane_id)
{
if(plane_id < planes.size()) {
return planes[plane_id].gl_texture;
- } else {
+ }
+ else {
return 0;
}
}