diff --git a/.gitignore b/.gitignore index 3c8bb81..2015183 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ obj/ orbvis *.glade~ builddir/ +version.h diff --git a/src/entity/earth.c b/src/entity/earth.c index 12a9cff..6d67dfe 100644 --- a/src/entity/earth.c +++ b/src/entity/earth.c @@ -83,9 +83,9 @@ void earth_init(void) model_init(&model, &obj_earth); shader_init(&shader, (const char *)res_shader_earth_vert, res_shader_earth_vert_len, (const char *)res_shader_earth_frag, res_shader_earth_frag_len, 2, (struct ShaderAttr[]){ - { LOCL_APOS, "in_pos" }, - { LOCL_ATEXCOORD, "in_uv" }, - }); + { LOCL_APOS, "in_pos" }, + { LOCL_ATEXCOORD, "in_uv" }, + }); texture_init_from_image(&texture_day, res_texture_earth_daymap_jpg, res_texture_earth_daymap_jpg_len, GL_TEXTURE0, GL_TEXTURE_2D); texture_init_from_image(&texture_night, res_texture_earth_nightmap_jpg, res_texture_earth_nightmap_jpg_len, GL_TEXTURE1, GL_TEXTURE_2D); diff --git a/src/entity/satellite.c b/src/entity/satellite.c index 41fdd06..8efac09 100644 --- a/src/entity/satellite.c +++ b/src/entity/satellite.c @@ -148,9 +148,9 @@ void satellite_init(void) vao_attr(&vao_orbits, &vbo_orbit_colors, LOCL_COLOR, 3, GL_FLOAT, sizeof(vec3), 0); shader_init(&shader, (const char *)res_shader_satellite_vert, res_shader_satellite_vert_len, (const char *)res_shader_satellite_frag, res_shader_satellite_frag_len, 2, (struct ShaderAttr[]){ - { LOCL_APOS, "in_pos" }, - { LOCL_COLOR, "in_color" }, - }); + { LOCL_APOS, "in_pos" }, + { LOCL_COLOR, "in_color" }, + }); alloc_orbit_arrays(); diff --git a/src/entity/sky.c b/src/entity/sky.c index f82c1d7..140fa4c 100644 --- a/src/entity/sky.c +++ b/src/entity/sky.c @@ -62,9 +62,9 @@ void sky_init(void) model_transform(&model); shader_init(&shader, (const char *)res_shader_sky_vert, res_shader_sky_vert_len, (const char *)res_shader_sky_frag, res_shader_sky_frag_len, 2, (struct ShaderAttr[]){ - { LOCL_APOS, "in_pos" }, - { LOCL_ATEXCOORD, "in_uv" }, - }); + { LOCL_APOS, "in_pos" }, + { LOCL_ATEXCOORD, "in_uv" }, + }); texture_init_from_image(&texture, res_texture_stars_jpg, res_texture_stars_jpg_len, GL_TEXTURE0, GL_TEXTURE_2D); diff --git a/src/meson.build b/src/meson.build index ac0c351..d562274 100644 --- a/src/meson.build +++ b/src/meson.build @@ -41,3 +41,10 @@ orbvis_incdir = include_directories([ 'ui', 'util', ]) + +conf_data = configuration_data() +conf_data.set('version', meson.project_version()) +configure_file(input: 'version.h.in', + output : 'version.h', + configuration : conf_data +) diff --git a/src/util/version.h b/src/version.h.in similarity index 76% rename from src/util/version.h rename to src/version.h.in index 087ef26..04b06c2 100644 --- a/src/util/version.h +++ b/src/version.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Wojciech Graj + * Copyright (c) 2023 Wojciech Graj * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,11 +15,7 @@ #ifndef __VERSION_H__ #define __VERSION_H__ -#include "type.h" - -#define VERSION_MAJOR 0 -#define VERSION_MINOR 2 -#define VERSION_PATCH 1 +#define VERSION_STRING "@version@" #ifdef DEBUG #define DEBUG_STRING "-debug" @@ -27,10 +23,6 @@ #define DEBUG_STRING #endif -#define VERSION_STRING \ - XSTR(VERSION_MAJOR) \ - "." XSTR(VERSION_MINOR) "." XSTR(VERSION_PATCH) DEBUG_STRING - #define ABOUT_STRING "OrbVis " VERSION_STRING "\nCopyright (c) 2022-2023 Wojciech Graj" \ "\nLicense GPLv2+: GNU GPL version 2 or later."