From 3affa487860cbc92f754377eb83d2b210a8abfc9 Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Wed, 31 Jan 2001 07:52:28 +0000 Subject: [PATCH] Whitespace, and a very minor tweak to dynamic texture generation. --- source/gl_dyn_part.c | 1 - source/gl_dyn_textures.c | 18 +++++++++++----- source/gl_screen.c | 6 +++--- source/gl_view.c | 5 +++-- source/quakefs.c | 45 ++++++++++++++++++++++------------------ 5 files changed, 44 insertions(+), 31 deletions(-) diff --git a/source/gl_dyn_part.c b/source/gl_dyn_part.c index 6d50acb..3753bc7 100644 --- a/source/gl_dyn_part.c +++ b/source/gl_dyn_part.c @@ -504,7 +504,6 @@ R_RocketTrail (int type, entity_t *ent) porg[j] = ent->old_origin[j] + ((rand () % 3) - 2); } ptype = pt_grav; - palpha = 255; break; case 6: // voor trail len -= 3; diff --git a/source/gl_dyn_textures.c b/source/gl_dyn_textures.c index beec86b..64b7211 100644 --- a/source/gl_dyn_textures.c +++ b/source/gl_dyn_textures.c @@ -64,10 +64,14 @@ GDT_InitDotParticleTexture (void) dx2 = x - 8; dx2 *= dx2; for (y = 0; y < 16; y++) { - data[y][x][0] = 255; dy = y - 8; d = 255 - 4 * (dx2 + dy * dy); - if (d<0) d = 0; + if (d<=0) { + d = 0; + data[y][x][0] = 0; + } else + data[y][x][0] = 255; + data[y][x][1] = (byte) d; } } @@ -93,20 +97,24 @@ GDT_InitSmokeParticleTexture (void) dy2 = y - 16; dy2 *= dy2; for (x = 0; x < 32; x++) { - data[y][x][0] = (noise1[y][x] >> 1) + 128; dx = x - 16; d = noise2[y][x] * 4 - 512; if (d > 0) { if (d > 255) d = 255; d = (d * (255 - (int) (dx * dx + dy2))) >> 8; - if (d < 0) + if (d <= 0) { d = 0; + data[y][x][0] = 0; + } else + data[y][x][0] = (noise1[y][x] >> 1) + 128; // if (d > 255) // d = 255; data[y][x][1] = (byte) d; - } else + } else { + data[y][x][0] = 0; //DESPAIR data[y][x][1] = 0; + } } } part_tex_smoke[i] = texture_extension_number++; diff --git a/source/gl_screen.c b/source/gl_screen.c index 38c0b38..648db2a 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -29,13 +29,13 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #ifdef HAVE_STRING_H -#include +# include #endif #ifdef HAVE_STRINGS_H -#include +# include #endif + #include #include "cl_parse.h" diff --git a/source/gl_view.c b/source/gl_view.c index 2712cde..2585492 100644 --- a/source/gl_view.c +++ b/source/gl_view.c @@ -30,11 +30,12 @@ # include "config.h" #endif #ifdef HAVE_STRING_H -#include +# include #endif #ifdef HAVE_STRINGS_H -#include +# include #endif + #include #include "glquake.h" diff --git a/source/quakefs.c b/source/quakefs.c index fcaecac..d06cf7d 100644 --- a/source/quakefs.c +++ b/source/quakefs.c @@ -32,35 +32,40 @@ #include #include -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif -#include +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif + +#include #include + #ifdef HAVE_FNMATCH_H -#define model_t sunmodel_t -#include -#undef model_t +# define model_t sunmodel_t +# include +# undef model_t #endif #ifdef WIN32 -#include +# include #endif #ifdef _MSC_VER -#define _POSIX_ +# define _POSIX_ #endif + #include #include "cmd.h" @@ -79,7 +84,7 @@ #include "va.h" #ifndef HAVE_FNMATCH_PROTO -int fnmatch (const char *__pattern, const char *__string, int __flags); + int fnmatch (const char *__pattern, const char *__string, int __flags); #endif