summaryrefslogtreecommitdiffstats
path: root/game/client/screenshot.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-06-25 00:44:36 +0500
committeruntodesu <kirill@untode.su>2025-06-25 00:44:36 +0500
commit88c01588aa0830e219eaa62588839e4d1e2883ce (patch)
tree602bb27dd3399aab4aae8c19630e3b7a8dac824b /game/client/screenshot.cc
parent99cf6cca8dbbc1e563c10cf0167432d3d8af9783 (diff)
downloadvoxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.tar.bz2
voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.zip
Clang-format the entire source code
Diffstat (limited to 'game/client/screenshot.cc')
-rw-r--r--game/client/screenshot.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/game/client/screenshot.cc b/game/client/screenshot.cc
index 5f2d91c..08b484b 100644
--- a/game/client/screenshot.cc
+++ b/game/client/screenshot.cc
@@ -1,4 +1,5 @@
#include "client/pch.hh"
+
#include "client/screenshot.hh"
#include "core/config.hh"
@@ -14,14 +15,14 @@
static ConfigKeyBind screenshot_key(GLFW_KEY_F2);
-static void stbi_png_physfs_callback(void *context, void *data, int size)
+static void stbi_png_physfs_callback(void* context, void* data, int size)
{
- PHYSFS_writeBytes(reinterpret_cast<PHYSFS_File *>(context), data, size);
+ PHYSFS_writeBytes(reinterpret_cast<PHYSFS_File*>(context), data, size);
}
-static void on_glfw_key(const GlfwKeyEvent &event)
+static void on_glfw_key(const GlfwKeyEvent& event)
{
- if(!globals::gui_keybind_ptr && !toggles::is_sequence_await) {
+ if(!globals::gui_keybind_ptr && !toggles::is_sequence_await) {
if(screenshot_key.equals(event.key) && (event.action == GLFW_PRESS)) {
screenshot::take();
return;
@@ -54,7 +55,7 @@ void screenshot::take(void)
// alignment value of sorts that might result in a corrupted
// image; we set GL_PACK_ALIGNMENT to 1, enabling byte-alignment
glPixelStorei(GL_PACK_ALIGNMENT, 1);
-
+
glReadPixels(0, 0, globals::width, globals::height, GL_RGB, GL_UNSIGNED_BYTE, pixels);
// Restore the old pack alignment value
@@ -71,7 +72,7 @@ void screenshot::take(void)
stbi_write_png_to_func(&stbi_png_physfs_callback, file, globals::width, globals::height, 3, pixels, stride);
spdlog::info("screenshot: wrote {}", filepath);
-
+
client_chat::print(fmt::format("{} {}", language::resolve("chat.screenshot_message"), filename));
PHYSFS_close(file);