From 09abf1b529b4226f585ecfbb20866715b901755b Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Dec 2021 13:34:22 +0800 Subject: +fpm --- .../libfixmath/fixsingen/fixsingen.depend | 44 +++++------ Client/ThirdParty/libfixmath/fixsingen/main.c | 88 +++++++++++----------- 2 files changed, 66 insertions(+), 66 deletions(-) (limited to 'Client/ThirdParty/libfixmath/fixsingen') diff --git a/Client/ThirdParty/libfixmath/fixsingen/fixsingen.depend b/Client/ThirdParty/libfixmath/fixsingen/fixsingen.depend index 5876a80..e0c975d 100644 --- a/Client/ThirdParty/libfixmath/fixsingen/fixsingen.depend +++ b/Client/ThirdParty/libfixmath/fixsingen/fixsingen.depend @@ -1,22 +1,22 @@ -# depslib dependency file v1.0 -1298649568 source:g:\vrfx\libfixmath\fixsingen\main.c - - - - - - -1298453688 g:\vrfx\libfixmath\\libfixmath\fixmath.h - "uint32.h" - "fract32.h" - "fix16.h" - -1298453688 g:\vrfx\libfixmath\\libfixmath\uint32.h - - -1298453688 g:\vrfx\libfixmath\\libfixmath\fract32.h - - -1298648502 g:\vrfx\libfixmath\\libfixmath\fix16.h - - +# depslib dependency file v1.0 +1298649568 source:g:\vrfx\libfixmath\fixsingen\main.c + + + + + + +1298453688 g:\vrfx\libfixmath\\libfixmath\fixmath.h + "uint32.h" + "fract32.h" + "fix16.h" + +1298453688 g:\vrfx\libfixmath\\libfixmath\uint32.h + + +1298453688 g:\vrfx\libfixmath\\libfixmath\fract32.h + + +1298648502 g:\vrfx\libfixmath\\libfixmath\fix16.h + + diff --git a/Client/ThirdParty/libfixmath/fixsingen/main.c b/Client/ThirdParty/libfixmath/fixsingen/main.c index 104b990..05461dc 100644 --- a/Client/ThirdParty/libfixmath/fixsingen/main.c +++ b/Client/ThirdParty/libfixmath/fixsingen/main.c @@ -1,44 +1,44 @@ -#include -#include -#include -#include -#include - -int main(int argc, char** argv) { - FILE* fp = fopen("fix16_trig_sin_lut.h", "wb"); - if(fp == NULL) { - fprintf(stderr, "Error: Unable to open file for writing.\n"); - return EXIT_FAILURE; - } - - // TODO - Store as uint16_t with a count to determine the end and return 1. - - fprintf(fp, "#ifndef __fix16_trig_sin_lut_h__\n"); - fprintf(fp, "#define __fix16_trig_sin_lut_h__\n"); - fprintf(fp, "\n"); - - fix16_t fix16_sin_lut_count = (fix16_pi >> 1); - fix16_t fix16_sin_lut[fix16_sin_lut_count]; - - uintptr_t i; - for(i = 0; i < fix16_sin_lut_count; i++) - fix16_sin_lut[i] = fix16_from_dbl(sin(fix16_to_dbl(i))); - for(i--; fix16_sin_lut[i] == fix16_one; i--, fix16_sin_lut_count--); - - fprintf(fp, "static const uint32_t _fix16_sin_lut_count = %"PRIi32";\n", fix16_sin_lut_count); - fprintf(fp, "static uint16_t _fix16_sin_lut[%"PRIi32"] = {", fix16_sin_lut_count); - - for(i = 0; i < fix16_sin_lut_count; i++) { - if((i & 7) == 0) - fprintf(fp, "\n\t"); - fprintf(fp, "%"PRIi32", ", fix16_sin_lut[i]); - } - fprintf(fp, "\n\t};\n"); - - fprintf(fp, "\n"); - fprintf(fp, "#endif\n"); - - fclose(fp); - - return EXIT_SUCCESS; -} +#include +#include +#include +#include +#include + +int main(int argc, char** argv) { + FILE* fp = fopen("fix16_trig_sin_lut.h", "wb"); + if(fp == NULL) { + fprintf(stderr, "Error: Unable to open file for writing.\n"); + return EXIT_FAILURE; + } + + // TODO - Store as uint16_t with a count to determine the end and return 1. + + fprintf(fp, "#ifndef __fix16_trig_sin_lut_h__\n"); + fprintf(fp, "#define __fix16_trig_sin_lut_h__\n"); + fprintf(fp, "\n"); + + fix16_t fix16_sin_lut_count = (fix16_pi >> 1); + fix16_t fix16_sin_lut[fix16_sin_lut_count]; + + uintptr_t i; + for(i = 0; i < fix16_sin_lut_count; i++) + fix16_sin_lut[i] = fix16_from_dbl(sin(fix16_to_dbl(i))); + for(i--; fix16_sin_lut[i] == fix16_one; i--, fix16_sin_lut_count--); + + fprintf(fp, "static const uint32_t _fix16_sin_lut_count = %"PRIi32";\n", fix16_sin_lut_count); + fprintf(fp, "static uint16_t _fix16_sin_lut[%"PRIi32"] = {", fix16_sin_lut_count); + + for(i = 0; i < fix16_sin_lut_count; i++) { + if((i & 7) == 0) + fprintf(fp, "\n\t"); + fprintf(fp, "%"PRIi32", ", fix16_sin_lut[i]); + } + fprintf(fp, "\n\t};\n"); + + fprintf(fp, "\n"); + fprintf(fp, "#endif\n"); + + fclose(fp); + + return EXIT_SUCCESS; +} -- cgit v1.1-26-g67d0