Permalink
Browse files

Formatting cleanup. Fix some memory leaks and uninitialized variables…

…. Fix extern const opStrings.
  • Loading branch information...
DerSaidin committed Aug 31, 2012
1 parent d291257 commit 8dc45f6bc81b2fab9eb7dc382ea961bf065b99b0
@@ -711,7 +711,7 @@ qhandle_t RE_RegisterAnimation(const char *name)
skelAnimation_t *anim;
byte *buffer;
int bufferLen;
- qboolean loaded = qfalse;
+ qboolean loaded = qfalse;
if(!name || !name[0])
{
@@ -909,8 +909,8 @@ void R_AddMD5Surfaces(trRefEntity_t * ent)
md5Surface_t *surface;
shader_t *shader;
int i;
- bool personalModel;
- int fogNum;
+ bool personalModel;
+ int fogNum;
model = tr.currentModel->md5;
@@ -1048,7 +1048,7 @@ void R_AddMD5Interactions(trRefEntity_t * ent, trRefLight_t * light)
md5Model_t *model;
md5Surface_t *surface;
shader_t *shader = 0;
- bool personalModel;
+ bool personalModel;
byte cubeSideBits = CUBESIDE_CLIPALL;
interactionType_t iaType = IA_DEFAULT;
@@ -836,6 +836,7 @@ static void R_LoadLightmaps(lump_t * l, const char *bspName)
image = R_AllocImage(va("%s/%s", mapName, lightmapFiles[i]), qtrue);
if(!image) {
+ Com_Dealloc(hdrImage);
break;
}
@@ -5168,11 +5169,11 @@ static void R_LoadNodesAndLeafs(lump_t * nodeLump, lump_t * leafLump)
dleaf_t *inLeaf;
bspNode_t *out;
int numNodes, numLeafs;
- srfVert_t *verts;
- srfTriangle_t *triangles;
+ srfVert_t *verts = NULL;
+ srfTriangle_t *triangles = NULL;
IBO_t *volumeIBO;
- vec3_t mins, maxs;
-// vec3_t offset = {0.01, 0.01, 0.01};
+ vec3_t mins, maxs;
+// vec3_t offset = {0.01, 0.01, 0.01};
ri.Printf(PRINT_ALL, "...loading nodes and leaves\n");
@@ -5368,11 +5369,11 @@ static void R_LoadNodesAndLeafs(lump_t * nodeLump, lump_t * leafLump)
if(triangles)
{
- ri.Hunk_FreeTempMemory(triangles);
+ ri.Hunk_FreeTempMemory(triangles);
}
if(verts)
{
- ri.Hunk_FreeTempMemory(verts);
+ ri.Hunk_FreeTempMemory(verts);
}
tess.multiDrawPrimitives = 0;
@@ -5504,7 +5505,7 @@ static void R_LoadFogs(lump_t * l, lump_t * brushesLump, lump_t * sidesLump)
int planeNum;
shader_t *shader;
float d;
- int firstSide;
+ int firstSide = 0;
ri.Printf(PRINT_ALL, "...loading fogs\n");
@@ -6668,7 +6669,7 @@ R_PrecacheInteractionSurface
*/
static void R_PrecacheInteractionSurface(bspSurface_t * surf, trRefLight_t * light)
{
- bool intersects;
+ bool intersects;
if(surf->lightCount == s_lightCount)
{
@@ -7429,12 +7430,12 @@ static void R_CreateVBOShadowMeshes(trRefLight_t * light)
int numCaches;
shader_t *shader, *oldShader;
- bool alphaTest, oldAlphaTest;
+ bool alphaTest, oldAlphaTest;
bspSurface_t *surface;
srfVBOMesh_t *vboSurf;
- vec3_t bounds[2];
+ vec3_t bounds[2];
if(!r_vboShadows->integer)
return;
@@ -717,7 +717,7 @@ image_t *R_LoadDDSImageData(void *pImageData, const char *name, int bits,
break;
default:
- ri.Printf(PRINT_WARNING, "R_LoadDDSImage: unsupported FOURCC 0x%08x, \"%s\"\n",
+ ri.Printf(PRINT_WARNING, "R_LoadDDSImage: unsupported FOURCC 0x%16x, \"%s\"\n",
ddsd->u4.ddpfPixelFormat.dwFourCC, name);
goto ret_error;
}
Oops, something went wrong.

0 comments on commit 8dc45f6

Please sign in to comment.