Merge pull request #22 from clasher113/main

Block render fix
This commit is contained in:
MihailRis 2023-11-20 22:28:12 +03:00 committed by GitHub
commit 0a196b0090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -69,7 +69,7 @@ void BlocksRenderer::face(const vec3& coord, float w, float h,
vertex(coord + axisX * w, region.u2, region.v1, lights[1] * tint);
vertex(coord + axisX * w + axisY * h, region.u2, region.v2, lights[2] * tint);
vertex(coord + axisY * h, region.u1, region.v2, lights[3] * tint);
index(0, 1, 3, 0, 2, 3);
index(0, 1, 3, 1, 2, 3);
}
void BlocksRenderer::face(const vec3& coord, float w, float h,

View File

@ -80,7 +80,17 @@ int keycode::NUM_LOCK = GLFW_KEY_NUM_LOCK;
int keycode::LEFT_BRACKET = GLFW_KEY_LEFT_BRACKET;
int keycode::RIGHT_BRACKET = GLFW_KEY_RIGHT_BRACKET;
#ifdef _WIN32
#include <windows.h>
#endif // _WIN32
const char* keycode::name(int code) {
#ifdef _WIN32
char name[64];
int result = GetKeyNameTextA(glfwGetKeyScancode(code) << 16, name, 64);
if (result == NULL) return "Unknown";
return name;
#else
const char* name = glfwGetKeyName(code, glfwGetKeyScancode(code));
if (name == nullptr) {
switch (code) {
@ -129,6 +139,7 @@ const char* keycode::name(int code) {
}
}
return name;
#endif // _WIN32
}
int mousecode::BUTTON_1 = GLFW_MOUSE_BUTTON_1;