Skip to content

Commit

Permalink
Rename the LCD effect to LCD Grid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arignir committed Dec 17, 2023
1 parent 38d2965 commit 4553086
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions include/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ struct app {
GLuint vbo;

GLuint program_color_correction;
GLuint program_lcd;
GLuint program_lcd_grid;

GLuint active_programs[MAX_GFX_PROGRAMS];
size_t active_programs_length;
Expand All @@ -211,7 +211,7 @@ struct app {
enum aspect_ratio aspect_ratio;
bool vsync;
bool color_correction;
bool lcd;
bool lcd_grid;
} video;

struct {
Expand Down
4 changes: 2 additions & 2 deletions include/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void gui_sdl_video_rebuild_pipeline(struct app *app);
/* gui/shaders/frag-color-correction.c */
extern char const *SHADER_FRAG_COLOR_CORRECTION;

/* gui/shaders/frag-lcd.c */
extern char const *SHADER_FRAG_LCD;
/* gui/shaders/frag-lcd-grid.c */
extern char const *SHADER_FRAG_LCD_GRID;

/* gui/shaders/vertex-common.c */
extern char const *SHADER_VERTEX_COMMON;
Expand Down
8 changes: 4 additions & 4 deletions source/gui/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ gui_config_load(
app->video.color_correction = b;
}

if (mjson_get_bool(data, data_len, "$.video.lcd", &b)) {
app->video.lcd = b;
if (mjson_get_bool(data, data_len, "$.video.lcd_grid", &b)) {
app->video.lcd_grid = b;
}

if (mjson_get_number(data, data_len, "$.video.texture_filter", &d)) {
Expand Down Expand Up @@ -231,7 +231,7 @@ gui_config_save(
"aspect_ratio": %d,
"vsync": %B,
"color_correction": %B,
"lcd": %B,
"lcd_grid": %B,
"texture_filter": %d
},

Expand All @@ -258,7 +258,7 @@ gui_config_save(
(int)app->video.aspect_ratio,
(int)app->video.vsync,
(int)app->video.color_correction,
(int)app->video.lcd,
(int)app->video.lcd_grid,
(int)app->gfx.texture_filter,
(int)app->audio.mute,
app->audio.level
Expand Down
2 changes: 1 addition & 1 deletion source/gui/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libgui = static_library(
'sdl/input.c',
'sdl/video.c',
'shaders/frag-color-correction.c',
'shaders/frag-lcd.c',
'shaders/frag-lcd-grid.c',
'shaders/vertex-common.c',
'windows/game.c',
'windows/keybinds.c',
Expand Down
6 changes: 3 additions & 3 deletions source/gui/sdl/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ gui_sdl_video_init(

/* Build all the available shaders */
app->gfx.program_color_correction = build_shader_program("color_correction", SHADER_FRAG_COLOR_CORRECTION, SHADER_VERTEX_COMMON);
app->gfx.program_lcd = build_shader_program("lcd", SHADER_FRAG_LCD, SHADER_VERTEX_COMMON);
app->gfx.program_lcd_grid = build_shader_program("lcd-grid", SHADER_FRAG_LCD_GRID, SHADER_VERTEX_COMMON);

/* Create the OpenGL objects required to build the pipeline */
glGenTextures(1, &app->gfx.game_texture_in);
Expand Down Expand Up @@ -265,8 +265,8 @@ gui_sdl_video_rebuild_pipeline(
++app->gfx.active_programs_length;
}

if (app->video.lcd) {
app->gfx.active_programs[app->gfx.active_programs_length] = app->gfx.program_lcd;
if (app->video.lcd_grid) {
app->gfx.active_programs[app->gfx.active_programs_length] = app->gfx.program_lcd_grid;
++app->gfx.active_programs_length;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
** LCD effect that shows the red/green/blue stripes for each pixel.
*/
char const *SHADER_FRAG_LCD = GLSL(
char const *SHADER_FRAG_LCD_GRID = GLSL(
layout(location = 0) out vec4 frag_color;

in vec2 v_uv;
Expand Down
4 changes: 2 additions & 2 deletions source/gui/windows/menubar.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ gui_win_menubar_video(
}

/* LCD Effect */
if (igMenuItemBool("LCD Effect", NULL, app->video.lcd, true)) {
app->video.lcd ^= 1;
if (igMenuItemBool("LCD Grid Effect", NULL, app->video.lcd_grid, true)) {
app->video.lcd_grid ^= 1;
gui_sdl_video_rebuild_pipeline(app);
}

Expand Down

0 comments on commit 4553086

Please sign in to comment.