Skip to content

Commit

Permalink
Revert 'Resolved Issue #4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chikaosolu Amaechi committed Jul 17, 2023
1 parent 437a592 commit 15dbf4a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
28 changes: 0 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,3 @@ if(MINGW)
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

# GTest setup
# do not want main included so it is a valid executable
#MESSAGE(STATUS "${SOURCE_FILES}")
FOREACH(item ${SOURCE_FILES})
IF(${item} MATCHES "src/main.c")
LIST(REMOVE_ITEM SOURCE_FILES ${item})
ENDIF(${item} MATCHES "src/main.c")
ENDFOREACH(item)
#MESSAGE(STATUS "${SOURCE_FILES}")

enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIR})
add_executable(
runTests
tests/tests.cpp
${SOURCE_FILES}
deps/glew/src/glew.c
deps/lodepng/lodepng.c
deps/noise/noise.c
deps/sqlite/sqlite3.c
deps/tinycthread/tinycthread.c)
target_link_libraries(runTests
${GTEST_BOTH_LIBRARIES}
pthread
dl glfw
${GLFW_LIBRARIES}
${CURL_LIBRARIES} )
2 changes: 1 addition & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define CRAFT_KEY_CHAT 't'
#define CRAFT_KEY_COMMAND '/'
#define CRAFT_KEY_SIGN '`'
#define CRAFT_KEY_RUN GLFW_KEY_LEFT_CONTROL

// advanced parameters
#define CREATE_CHUNK_RADIUS 10
#define RENDER_CHUNK_RADIUS 10
Expand Down
8 changes: 7 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2413,15 +2413,18 @@ void handle_movement(double dt) {
State *s = &g->players->state;
int sz = 0;
int sx = 0;
int isRunning = 0;
if (!g->typing) {
float m = dt * 1.0;
g->ortho = glfwGetKey(g->window, CRAFT_KEY_ORTHO) ? 64 : 0;
g->fov = glfwGetKey(g->window, CRAFT_KEY_ZOOM) ? 15 : 65;
<<<<<<< HEAD
if (glfwGetKey(g->window, CRAFT_KEY_FORWARD)) {
if(glfwGetKey(g->window, CRAFT_KEY_RUN)) isRunning = 1;
sz--;
}
=======
if (glfwGetKey(g->window, CRAFT_KEY_FORWARD)) sz--;
>>>>>>> parent of 6ca5a52 (issue #4)
if (glfwGetKey(g->window, CRAFT_KEY_BACKWARD)) sz++;
if (glfwGetKey(g->window, CRAFT_KEY_LEFT)) sx--;
if (glfwGetKey(g->window, CRAFT_KEY_RIGHT)) sx++;
Expand All @@ -2443,7 +2446,10 @@ void handle_movement(double dt) {
}
}
float speed = g->flying ? 20 : 5;
<<<<<<< HEAD
if(isRunning) speed*=1.5;
=======
>>>>>>> parent of 6ca5a52 (issue #4)
int estimate = roundf(sqrtf(
powf(vx * speed, 2) +
powf(vy * speed + ABS(dy) * 2, 2) +
Expand Down

0 comments on commit 15dbf4a

Please sign in to comment.