Compare commits

...

3 Commits

Author SHA1 Message Date
TheBrokenRail f3755387e8 Improve Mouse Sensitivity On Wayland
CI / Build (AMD64, Server) (push) Successful in 12m9s Details
CI / Build (AMD64, Client) (push) Successful in 12m20s Details
CI / Build (ARM64, Server) (push) Successful in 12m35s Details
CI / Build (ARM64, Client) (push) Successful in 13m4s Details
CI / Build (ARMHF, Server) (push) Successful in 8m47s Details
CI / Build (ARMHF, Client) (push) Successful in 12m6s Details
CI / Test (Client) (push) Successful in 14m25s Details
CI / Test (Server) (push) Successful in 12m22s Details
CI / Release (push) Has been skipped Details
CI / Build Example Mods (push) Successful in 7m31s Details
2024-03-19 00:25:50 -04:00
TheBrokenRail b1b28defd5 Small Change 2024-03-19 00:12:26 -04:00
TheBrokenRail 18c5d34974 Ignore CLion Files 2024-03-19 00:12:26 -04:00
4 changed files with 13 additions and 5 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@
/qemu_*
/example-mods/out
/.testing-tmp
/cmake-build-*
/.idea

View File

@ -7,11 +7,11 @@
// The Actual Mod
HOOK(chat_handle_packet_send, void, (Minecraft *minecraft, ChatPacket *packet)) {
// Get Message
char *message = packet->message;
const char *message = packet->message.c_str();
if (message[0] == '/') {
// API Command
Gui *gui = &minecraft->gui;
std::string out = chat_send_api_command(minecraft, &message[1]);
std::string out = chat_send_api_command(minecraft, (char *) &message[1]);
if (out.length() > 0 && out[out.length() - 1] == '\n') {
out[out.length() - 1] = '\0';
}

View File

@ -40,6 +40,9 @@ static volatile int is_running = 0;
static int cursor_grabbed = 0;
static int cursor_visible = 1;
// Track If Raw Mouse Motion Is Enabled
static int raw_mouse_motion_enabled = 1;
// GLFW Code Not Needed In Headless Mode
#ifndef MCPI_HEADLESS_MODE
@ -236,6 +239,10 @@ static int ignore_relative_motion = 0;
// Convert Screen Coordinates To Pixels
static void convert_to_pixels(GLFWwindow *window, double *xpos, double *ypos) {
// Skip If Cursor Is Grabbed
if (cursor_grabbed && raw_mouse_motion_enabled) {
return;
}
// Get Window Size
int window_width;
int window_height;
@ -548,8 +555,7 @@ static void emit_events_after_is_interactable_change() {
#endif
// Track If Raw Mouse Motion Is Enabled
static int raw_mouse_motion_enabled = 1;
// Enable/Disable Raw Mouse Motion
void media_set_raw_mouse_motion_enabled(int enabled) {
raw_mouse_motion_enabled = enabled;
#ifndef MCPI_HEADLESS_MODE

View File

@ -97,7 +97,7 @@ struct chunk_data {
float distance;
};
#define MAX_CHUNKS_SIZE 24336
chunk_data data[MAX_CHUNKS_SIZE];
static chunk_data data[MAX_CHUNKS_SIZE];
static void sort_chunks(Chunk **chunks_begin, Chunk **chunks_end, DistanceChunkSorter sorter) {
// Calculate Distances
int chunks_size = chunks_end - chunks_begin;