diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 6ef63739f..87d775c87 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -77,7 +77,7 @@ void R_ClearDrawSegs(void) // CPhipps - // Instead of clipsegs, let's try using an array with one entry for each column, // indicating whether it's blocked by a solid wall yet or not. -UINT8 *solidcol; +UINT8 *solidcol = NULL; void R_AllocClipSegMemory(void) { diff --git a/src/r_data.c b/src/r_data.c index 6c999d1ae..7afa1be73 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -94,17 +94,17 @@ static UINT32 **texturecolumnofs; // column offset lookup table for each texture UINT8 **texturecache; // graphics data for each generated full-size texture // texture width is a power of 2, so it can easily repeat along sidedefs using a simple mask -static INT32 *texturewidth; +static INT32 *texturewidth = NULL; -fixed_t *textureheight; // needed for texture pegging +fixed_t *textureheight = NULL; // needed for texture pegging -INT32 *texturetranslation; +INT32 *texturetranslation = NULL; // needed for pre rendering -sprcache_t *spritecachedinfo; +sprcache_t *spritecachedinfo = NULL; -lighttable_t *colormaps; -UINT8 *encoremap; +lighttable_t *colormaps = NULL; +UINT8 *encoremap = NULL; #ifdef HASINVERT UINT8 invertmap[256]; #endif diff --git a/src/r_main.cpp b/src/r_main.cpp index 4686036a7..33569fe80 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -88,7 +88,7 @@ INT32 viewangletox[FINEANGLES/2]; // The xtoviewangleangle[] table maps a screen pixel // to the lowest viewangle that maps back to x ranges // from clipangle to -clipangle. -angle_t *xtoviewangle; +angle_t *xtoviewangle = NULL; lighttable_t *scalelight[LIGHTLEVELS][MAXLIGHTSCALE]; lighttable_t *scalelightfixed[MAXLIGHTSCALE]; diff --git a/src/r_plane.cpp b/src/r_plane.cpp index bab6fcb6b..1adccfba1 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -46,15 +46,15 @@ // good night sweet prince //#define SHITPLANESPARENCY -visplane_t *visplanes[MAXVISPLANES]; +visplane_t *visplanes[MAXVISPLANES] = {}; static visplane_t *freetail; static visplane_t **freehead = &freetail; visplane_t *floorplane; visplane_t *ceilingplane; -visffloor_t visffloor[MAXFFLOORS]; -INT32 numffloors; +visffloor_t visffloor[MAXFFLOORS] = {}; +INT32 numffloors = 0; //SoM: 3/23/2000: Boom visplane hashing routine. #define visplane_hash(picnum,lightlevel,height) \ @@ -65,8 +65,8 @@ INT32 numffloors; // floorclip starts out SCREENHEIGHT // ceilingclip starts out -1 // -INT16 *floorclip, *ceilingclip; -fixed_t *frontscale; +INT16 *floorclip = NULL, *ceilingclip = NULL; +fixed_t *frontscale = NULL; // // spanstart holds the start of a plane span @@ -81,13 +81,13 @@ static INT32 *spanstart; // (this is to calculate yslopes only when really needed) // (when mouselookin', yslope is moving into yslopetab) // Check R_SetupFrame, R_SetViewSize for more... -fixed_t *yslopetab; -fixed_t *yslope; +fixed_t *yslopetab = NULL; +fixed_t *yslope = NULL; fixed_t basexscale, baseyscale; -static INT16 *ffloor_f_clip; -static INT16 *ffloor_c_clip; +static INT16 *ffloor_f_clip = NULL; +static INT16 *ffloor_c_clip = NULL; static void R_SetTiltedSpan(drawspandata_t* ds, INT32 span); static void R_SetSlopePlaneVectors(drawspandata_t* ds, visplane_t *pl, INT32 y, fixed_t xoff, fixed_t yoff); diff --git a/src/r_things.cpp b/src/r_things.cpp index f27b7e6a2..796f6c4a2 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -60,8 +60,8 @@ typedef struct static lighttable_t **spritelights; // constant arrays used for psprite clipping and initializing clipping -INT16 *negonearray; -INT16 *screenheightarray; +INT16 *negonearray = NULL; +INT16 *screenheightarray = NULL; // // INITIALIZATION FUNCTIONS @@ -539,8 +539,8 @@ void R_ClearSprites(void) visspritecount = numvisiblesprites = clippedvissprites = 0; } -static INT16 *vissprite_clipbot[MAXVISSPRITES >> VISSPRITECHUNKBITS]; -static INT16 *vissprite_cliptop[MAXVISSPRITES >> VISSPRITECHUNKBITS]; +static INT16 *vissprite_clipbot[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {0}; +static INT16 *vissprite_cliptop[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {0}; static void R_AllocVisSpriteChunkMemory(UINT32 chunk) { @@ -574,16 +574,16 @@ static vissprite_t overflowsprite; static vissprite_t *R_GetVisSprite(UINT32 num) { - UINT32 chunk = num >> VISSPRITECHUNKBITS; + UINT32 chunk = num >> VISSPRITECHUNKBITS; - // Allocate chunk if necessary - if (!visspritechunks[chunk]) - { - Z_Malloc(sizeof(vissprite_t) * VISSPRITESPERCHUNK, PU_LEVEL, &visspritechunks[chunk]); - R_AllocVisSpriteChunkMemory(chunk); - } + // Allocate chunk if necessary + if (!visspritechunks[chunk]) + { + Z_Malloc(sizeof(vissprite_t) * VISSPRITESPERCHUNK, PU_LEVEL, &visspritechunks[chunk]); + R_AllocVisSpriteChunkMemory(chunk); + } - return visspritechunks[chunk] + (num & VISSPRITEINDEXMASK); + return visspritechunks[chunk] + (num & VISSPRITEINDEXMASK); } static vissprite_t *R_NewVisSprite(void)