Removed CompressedGraphicMemory, Fixed memory leak

This commit is contained in:
jsalmon3 2004-03-13 19:48:07 +00:00
parent 6fc9745be8
commit a134fea46c
5 changed files with 4 additions and 12 deletions

View file

@ -457,10 +457,6 @@ global void CreateGame(char* filename, WorldMap* map)
AllocatedGraphicMemory _C_
AllocatedGraphicMemory / 1024 _C_
AllocatedGraphicMemory / 1024 / 1024);
DebugLevel0("Compressed graphics uses %d bytes (%d KB, %d MB)\n" _C_
CompressedGraphicMemory _C_
CompressedGraphicMemory / 1024 _C_
CompressedGraphicMemory / 1024 / 1024);
CreateMinimap(); // create minimap for pud
InitMap(); // setup draw functions

View file

@ -66,7 +66,6 @@ typedef struct _unit_colors_ {
#ifdef DEBUG
extern unsigned AllocatedGraphicMemory; /// Allocated memory for objects
extern unsigned CompressedGraphicMemory;/// memory for compressed objects
#endif
/**

View file

@ -512,7 +512,7 @@ global void MakePlayerColorTexture(Graphic** g, Graphic* graphic, int frame,
** @todo FIXME: Higher quality resizing.
** FIXME: Works only with 8bit indexed graphic objects.
*/
global void ResizeGraphic(Graphic *g, int w, int h)
global void ResizeGraphic(Graphic* g, int w, int h)
{
int i;
int j;
@ -553,6 +553,7 @@ global void ResizeGraphic(Graphic *g, int w, int h)
g->Width = w;
g->Height = h;
free(g->Data);
g->Data = data;
}

View file

@ -420,17 +420,14 @@ global Graphic* LoadSprite(const char* name, int width, int height)
DebugCheck(width > g->Width || height > g->Height);
if (!width || !height || (g->Width / width) * width != g->Width ||
if ((g->Width / width) * width != g->Width ||
(g->Height / height) * height != g->Height) {
fprintf(stderr, "Invalid graphic (width, height) %s\n", name);
fprintf(stderr, "Expected: (%d,%d) Found: (%d,%d)\n",
width, height, g->Width, g->Height);
ExitFatal(1);
}
// Check if width and height fits.
DebugCheck((g->Width / width) * width != g->Width ||
(g->Height / height) * height != g->Height);
#ifdef USE_OPENGL
MakeTexture(g, width, height);
g->GraphicWidth = g->Width;

View file

@ -153,7 +153,6 @@ local Clip* ClipsGarbage; /// garbage-list of available clips
#ifdef DEBUG
global unsigned AllocatedGraphicMemory; /// Allocated memory for objects
global unsigned CompressedGraphicMemory;/// memory for compressed objects
#endif
/**