Small fix

This commit is contained in:
itqop 2024-05-15 13:26:17 +03:00
parent 587ce37b75
commit 9339e572a0
2 changed files with 31 additions and 40 deletions

View File

@ -10,8 +10,6 @@ void Game::onCreate(int screenW, int screenH)
isCreativeCamera = true;
updateWindowMetrics(screenW, screenH);
//create 2D renderer
renderer2d.create();
font.createFromFile(RESOURCES_PATH "roboto_black.ttf");
@ -21,9 +19,6 @@ void Game::onCreate(int screenW, int screenH)
chunkManager.setGridSize(10, glm::vec2{camera->getPosition().x, camera->getPosition().z});
//std::cout << chunkManager.bottomCorner.x << " " << chunkManager.bottomCorner.y << "\n";
//std::cout << chunkManager.topCorner.x << " " << chunkManager.topCorner.y << "\n";
arrowTexture.loadFromFile(RESOURCES_PATH "arrow.png");
skyBox.create();
@ -134,10 +129,6 @@ void Game::onUpdate(float deltaTime, const GameInput &input)
camera->getViewDirection()))
{
auto b = chunkManager.getBlockRaw(rayEnd);
if(b)
{
//std::cout << *b << "\n";
}
if(input.getKey(GameInput::RIGHT_CLICK).isReleased())
{

View File

@ -18,7 +18,7 @@
GameInput input;
void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods)
void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
{
auto setKey = [&action](GameInput::keys k)
@ -80,7 +80,7 @@ void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods
}
};
void mouseCallback(GLFWwindow* window, int key, int action, int mods)
void mouseCallback(GLFWwindow *window, int key, int action, int mods)
{
if (key == GLFW_MOUSE_BUTTON_LEFT)
@ -112,7 +112,7 @@ void mouseCallback(GLFWwindow* window, int key, int action, int mods)
}
}
void windowFocusCallback(GLFWwindow* window, int focused)
void windowFocusCallback(GLFWwindow *window, int focused)
{
if (!focused)
{
@ -120,7 +120,7 @@ void windowFocusCallback(GLFWwindow* window, int focused)
}
}
void windowSizeCallback(GLFWwindow* window, int x, int y)
void windowSizeCallback(GLFWwindow *window, int x, int y)
{
input.resetInputsToZero();
@ -132,13 +132,13 @@ int main()
#ifdef PLATFORM_WIN32
#ifdef _MSC_VER
#if INTERNAL_BUILD
{
{
AllocConsole();
auto f1 = freopen("conin$", "r", stdin);
auto f2 = freopen("conout$", "w", stdout);
auto f3 = freopen("conout$", "w", stderr);
std::cout.sync_with_stdio();
}
}
#endif
#endif
#endif
@ -177,11 +177,11 @@ int main()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
#pragma region movement
#pragma region movement
long newTime = clock();
float deltaTime = (float)(newTime - lastTime) / CLOCKS_PER_SEC;
lastTime = clock();
#pragma endregion
#pragma endregion
double xMouse, yMouse;
glfwGetCursorPos(wind, &xMouse, &yMouse);