Removed CompressedGraphicMemory, Fixed memory leak
This commit is contained in:
parent
6fc9745be8
commit
a134fea46c
5 changed files with 4 additions and 12 deletions
src
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue