Skip to content

Commit

Permalink
Release/0.0.7 alpha (#17)
Browse files Browse the repository at this point in the history
* Updates version to 0.0.7
  • Loading branch information
FiniteSingularity authored Mar 5, 2024
1 parent e755929 commit 0280353
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else()
cmake_minimum_required(VERSION 3.18)
endif()

project(obs-retro-effects VERSION 0.0.6)
project(obs-retro-effects VERSION 0.0.7)
set(PROJECT_FULL_NAME "Retro Effects")

# Set new UUIDs when you start to create a new plugin.
Expand Down
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
}
},
"name": "obs-retro-effects",
"version": "0.0.6"
"version": "0.0.7"
}
6 changes: 6 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ RetroEffects.CathodeBoot.TerminalLine="Terminal Line Settings"
RetroEffects.CathodeBoot.VertThick="Vertical Thickness"
RetroEffects.CathodeBoot.HorizThick="Horizontal Thickness"
RetroEffects.CathodeBoot.GlowSize="Glow Size"
RetroEffects.MatrixRain="Matrix Rain"
RetroEffects.MatrixRain.Scale="Scale"
RetroEffects.MatrixRain.NoiseShift="Nose Shift"
RetroEffects.MatrixRain.Colorize="Colorize?"
RetroEffects.MatrixRain.TextColor="Text Color"
RetroEffects.MatrixRain.BackgroundColor="Background Color"
60 changes: 39 additions & 21 deletions src/filters/matrix-rain.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ void matrix_rain_destroy(retro_effects_filter_data_t *filter)
gs_effect_destroy(data->effect_matrix_rain);
}

if (data->font_image) {
gs_image_file_free(data->font_image);
bfree(data->font_image);
}

obs_leave_graphics();

obs_data_t *settings = obs_source_get_settings(filter->base->context);
obs_data_unset_user_value(settings, "matrix_rain_scale");
obs_data_unset_user_value(settings, "matrix_rain_noise_shift");
obs_data_unset_user_value(settings, "matrix_rain_colorize");
obs_data_unset_user_value(settings, "matrix_rain_text_color");
obs_data_unset_user_value(settings, "matrix_rain_background_color");
obs_data_release(settings);

bfree(filter->active_filter_data);
Expand All @@ -41,16 +51,21 @@ void matrix_rain_filter_update(retro_effects_filter_data_t *data,
matrix_rain_load_effect(filter);
}

filter->scale = (float)obs_data_get_double(settings, "matrix_rain_scale");
filter->noise_shift = (float)obs_data_get_double(settings, "matrix_rain_noise_shift");
filter->scale =
(float)obs_data_get_double(settings, "matrix_rain_scale");
filter->noise_shift =
(float)obs_data_get_double(settings, "matrix_rain_noise_shift");
filter->colorize = obs_data_get_bool(settings, "matrix_rain_colorize");
vec4_from_rgba(&filter->text_color,
(uint32_t)obs_data_get_int(settings, "matrix_rain_text_color"));
(uint32_t)obs_data_get_int(settings,
"matrix_rain_text_color"));
vec4_from_rgba(&filter->background_color,
(uint32_t)obs_data_get_int(settings, "matrix_rain_background_color"));
(uint32_t)obs_data_get_int(
settings, "matrix_rain_background_color"));

struct dstr font_image_path = {0};
dstr_cat(&font_image_path, obs_get_module_data_path(obs_current_module()));
dstr_cat(&font_image_path,
obs_get_module_data_path(obs_current_module()));
dstr_cat(&font_image_path, "/images/ascii-font-2-200x30x10chars.png");

// Todo- compare if there was a change in mask_image_path
Expand All @@ -64,7 +79,8 @@ void matrix_rain_filter_update(retro_effects_filter_data_t *data,
obs_leave_graphics();
}
if (font_image_path.len > 0 && font_image_path.array) {
gs_image_file_init(filter->font_image, font_image_path.array);
gs_image_file_init(filter->font_image,
font_image_path.array);
obs_enter_graphics();
gs_image_file_init_texture(filter->font_image);
obs_leave_graphics();
Expand All @@ -75,22 +91,26 @@ void matrix_rain_filter_update(retro_effects_filter_data_t *data,
filter->font_texture_size.y = 30.0f;
filter->font_num_chars = 10.0f;
dstr_free(&font_image_path);

}

void matrix_rain_filter_defaults(obs_data_t *settings) {}
void matrix_rain_filter_defaults(obs_data_t *settings)
{
UNUSED_PARAMETER(settings);
}

void matrix_rain_filter_properties(retro_effects_filter_data_t *data,
obs_properties_t *props)
{
UNUSED_PARAMETER(data);
obs_properties_add_float_slider(
props, "matrix_rain_scale",
obs_module_text("RetroEffects.MatrixRain.Scale"), 0.1, 20.0, 0.1);
obs_module_text("RetroEffects.MatrixRain.Scale"), 0.1, 20.0,
0.1);

obs_properties_add_float_slider(
props, "matrix_rain_noise_shift",
obs_module_text("RetroEffects.MatrixRain.NoiseShift"), -4000.0, 4000.0,
0.1);
obs_module_text("RetroEffects.MatrixRain.NoiseShift"), -4000.0,
4000.0, 0.1);

obs_properties_add_bool(
props, "matrix_rain_colorize",
Expand All @@ -105,13 +125,13 @@ void matrix_rain_filter_properties(retro_effects_filter_data_t *data,
obs_module_text("RetroEffects.MatrixRain.BackgroundColor"));
}

void matrix_rain_filter_video_tick(retro_effects_filter_data_t *data, float seconds)
void matrix_rain_filter_video_tick(retro_effects_filter_data_t *data,
float seconds)
{
matrix_rain_filter_data_t *filter = data->active_filter_data;
filter->local_time += seconds;
}


void matrix_rain_filter_video_render(retro_effects_filter_data_t *data)
{
base_filter_data_t *base = data->base;
Expand Down Expand Up @@ -162,8 +182,7 @@ void matrix_rain_filter_video_render(retro_effects_filter_data_t *data)
filter->font_num_chars);
}
if (filter->param_scale) {
gs_effect_set_float(filter->param_scale,
filter->scale);
gs_effect_set_float(filter->param_scale, filter->scale);
}
if (filter->param_noise_shift) {
gs_effect_set_float(filter->param_noise_shift,
Expand All @@ -174,13 +193,11 @@ void matrix_rain_filter_video_render(retro_effects_filter_data_t *data)
filter->local_time);
}
if (filter->param_colorize) {
gs_effect_set_bool(filter->param_colorize,
filter->colorize);
gs_effect_set_bool(filter->param_colorize, filter->colorize);
}
if (filter->param_text_color) {
gs_effect_set_vec4(filter->param_text_color,
&filter->text_color);

}
if (filter->param_background_color) {
gs_effect_set_vec4(filter->param_background_color,
Expand Down Expand Up @@ -264,9 +281,11 @@ static void matrix_rain_load_effect(matrix_rain_filter_data_t *filter)
filter->param_uv_size = param;
} else if (strcmp(info.name, "font_image") == 0) {
filter->param_font_image = param;
} else if (strcmp(info.name, "font_texture_size") == 0) {
} else if (strcmp(info.name, "font_texture_size") ==
0) {
filter->param_font_texture_size = param;
} else if (strcmp(info.name, "font_texture_num_chars") == 0) {
} else if (strcmp(info.name,
"font_texture_num_chars") == 0) {
filter->param_font_texture_num_chars = param;
} else if (strcmp(info.name, "scale") == 0) {
filter->param_scale = param;
Expand All @@ -281,7 +300,6 @@ static void matrix_rain_load_effect(matrix_rain_filter_data_t *filter)
} else if (strcmp(info.name, "background_color") == 0) {
filter->param_background_color = param;
}

}
}
filter->loading_effect = false;
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#define PROJECT_VERSION "0.0.6"
#define PROJECT_VERSION "0.0.7"
#define PROJECT_VERSION_MAJOR 0
#define PROJECT_VERSION_MINOR 0
#define PROJECT_VERSION_PATCH 6
#define PROJECT_VERSION_PATCH 7

0 comments on commit 0280353

Please sign in to comment.