Skip to content

Commit 4631b75

Browse files
committed
Fix: Camera mode reset between data sets
1 parent bbf70d4 commit 4631b75

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('galaxy_visualization_raylib', 'c',
2-
version : '0.5.0',
2+
version : '0.5.1',
33
default_options : [
44
'c_std=c99',
55

shaders/bloom.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ out vec4 finalColor;
1010

1111
const float THRESHOLD = 0.2;
1212
const float SOFT_KNEE = 0.5;
13-
const float INTENSITY = 3.5;
14-
const float KERNEL_SCALE = 24.0;
13+
const float INTENSITY = 4.5;
14+
const float KERNEL_SCALE = 32.0;
1515

1616
vec3 sampleBright(vec2 uv)
1717
{

src/app.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ app_update(app_state_t *app_state, f64 dt)
6262
CloseWindow();
6363
}
6464

65+
draw_data_t prev_data = app_state->data_to_draw;
6566
if (IsKeyPressed(KEY_ONE))
6667
{
6768
app_state->data_to_draw = DRAW_DATA_A;
@@ -82,6 +83,18 @@ app_update(app_state_t *app_state, f64 dt)
8283
app_state->data_to_draw = DRAW_DATA_REDSHIFT;
8384
}
8485

86+
if (app_state->data_to_draw != prev_data)
87+
{
88+
bool prev_course = (prev_data == DRAW_DATA_A || prev_data == DRAW_DATA_B || prev_data == DRAW_DATA_ALL);
89+
bool next_course = (app_state->data_to_draw == DRAW_DATA_A || app_state->data_to_draw == DRAW_DATA_B || app_state->data_to_draw == DRAW_DATA_ALL);
90+
if (prev_course != next_course)
91+
{
92+
app_state->is_paused = false;
93+
app_state->main_camera.fovy = CAMERA_FOV;
94+
app_state->camera_zoom = CAMERA_INITIAL_ZOOM;
95+
}
96+
}
97+
8598
if (IsKeyPressed(KEY_R))
8699
{
87100
app_state->is_paused = !app_state->is_paused;

0 commit comments

Comments
 (0)