zengine/include/ZE_Macros.h

60 lines
1.6 KiB
C
Raw Normal View History

/*******************************************************************************
This file is Part of the ZEngine Library for SDL Game Development.
Copyright (C) 2002 ConceptOfZero.net
Licensed under the BSD License, see licensing.txt.
The maintainer of this library is James Turk (jturk@conceptofzero.net)
and the home of this Library is http://www.conceptofzero.net/
*******************************************************************************/
/*!
\par File Header:
File: ZE_Macros.h <br>
Description: Header file for ZEngine Macros. <br>
Author(s): James Turk <br>
2002-12-04 23:51:22 +00:00
$Id: ZE_Macros.h,v 1.3 2002/12/04 23:51:22 cozman Exp $<br>
\file ZE_Macros.h
\brief Definition file for ZEngine Macros
Definition file for ZEngine Macros which are used throughout the engine.
**/
#ifndef __ze_macros_h__
#define __ze_macros_h__
#include "ZE_Includes.h"
namespace ZE
{
2002-12-04 23:51:22 +00:00
/*!
Safely free an SDL_Surface* and set it to NULL.
**/
#define FreeImage(image) if(image){SDL_FreeSurface(image); image = NULL;}
#ifdef USE_SDL_MIXER
2002-12-04 23:51:22 +00:00
/*!
Safely free a Mix_Chunk* and set it to NULL.
**/
#define FreeSound(sound) if(sound){Mix_FreeChunk(sound); sound = NULL;}
2002-12-04 23:51:22 +00:00
/*!
Safely free a Mix_Music* and set it to NULL.
**/
#define FreeMusic(music) if(music){Mix_FreeMusic(music); music = NULL;}
#endif
#ifdef USE_SDL_TTF
2002-12-04 23:51:22 +00:00
/*!
Safely free a TTF_Font and set it to NULL.
**/
#define FreeFont(font) if(font){TTF_CloseFont(font); font = NULL;}
#endif
}
2002-12-03 04:11:41 +00:00
#endif //__ze_macros_h__