/apps/examples/cirlce-raster: update

This commit is contained in:
veclavtalica 2025-02-28 17:35:58 +03:00
parent 09eac707c3
commit 844283c2fb
2 changed files with 5 additions and 4 deletions

View File

@ -13,4 +13,4 @@ set(SOURCE_FILES
state.h
)
use_townengine(${PROJECT_NAME} "${SOURCE_FILES}" ${CMAKE_CURRENT_SOURCE_DIR})
use_townengine("${SOURCE_FILES}" ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -116,9 +116,9 @@ void game_tick(void) {
input_action("up", "LCLICK");
input_action("down", "RCLICK");
if (input_action_just_pressed("up"))
if (input_action_pressed("up"))
state->r += 1;
if (input_action_just_pressed("down"))
if (input_action_pressed("down") && state->r > 2)
state->r -= 1;
int32_t const rsi = (int32_t)state->r * (int32_t)state->r;
@ -135,7 +135,8 @@ void game_tick(void) {
draw_circle(mouse_snap, state->r * 8, (Color){125, 125, 125, 125});
benchmark(state);
/* uncomment to see performance difference between variants */
// benchmark(state);
}