mouse button rotation + minor fixes
This commit is contained in:
parent
d5d5b3530d
commit
8ed66cfba8
@ -24,6 +24,7 @@ find_package(SDL2_mixer REQUIRED)
|
||||
find_package(SDL2_ttf REQUIRED)
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_C_FLAGS "-O2 -Wno-discarded-qualifiers -Wno-pointer-arith -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic -g")
|
||||
@ -32,7 +33,7 @@ else()
|
||||
set(CMAKE_C_FLAGS "-O2 -Wno-discarded-qualifiers -Wno-pointer-arith -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic")
|
||||
endif()
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW)
|
||||
target_link_libraries(${PROJECT_NAME} m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW OpenGL::GL)
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_C_FLAGS "-mwindows ${CMAKE_C_FLAGS}")
|
||||
|
@ -25,14 +25,16 @@ update_f(struct CRotation* self)
|
||||
if
|
||||
(
|
||||
keyboard_held(&game.keyboard, KEYBOARD_LEFT) ||
|
||||
keyboard_held(&game.keyboard, KEYBOARD_A)
|
||||
keyboard_held(&game.keyboard, KEYBOARD_A) ||
|
||||
mouse_held(&game.mouse, MOUSE_LEFT)
|
||||
)
|
||||
self->velocity += self->speed;
|
||||
|
||||
if
|
||||
(
|
||||
keyboard_held(&game.keyboard, KEYBOARD_RIGHT) ||
|
||||
keyboard_held(&game.keyboard, KEYBOARD_D)
|
||||
keyboard_held(&game.keyboard, KEYBOARD_D) ||
|
||||
mouse_held(&game.mouse, MOUSE_RIGHT)
|
||||
)
|
||||
self->velocity -= self->speed;
|
||||
|
||||
|
@ -428,10 +428,7 @@ void
|
||||
play_update_f(struct Play* self)
|
||||
{
|
||||
if (keyboard_press(&game.keyboard, KEYBOARD_P))
|
||||
{
|
||||
game.isPaused = !game.isPaused;
|
||||
printf("???\n");
|
||||
}
|
||||
|
||||
if (game.isPaused)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user