本文整理汇总了C++中HFree函数的典型用法代码示例。如果您正苦于以下问题:C++ HFree函数的具体用法?C++ HFree怎么用?C++ HFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TFB_UninitInput
void
TFB_UninitInput (void)
{
VControl_Uninit ();
HFree (controls);
HFree (kbdstate);
}
开发者ID:ex,项目名称:urquan-masters,代码行数:7,代码来源:input.c
示例2: _ReleaseCelData
BOOLEAN
_ReleaseCelData (void *handle)
{
DRAWABLE DrawablePtr;
int cel_ct;
FRAME FramePtr = NULL;
if ((DrawablePtr = handle) == 0)
return (FALSE);
cel_ct = DrawablePtr->MaxIndex + 1;
FramePtr = DrawablePtr->Frame;
HFree (handle);
if (FramePtr)
{
int i;
for (i = 0; i < cel_ct; i++)
{
TFB_Image *img = FramePtr[i].image;
if (img)
{
FramePtr[i].image = NULL;
TFB_DrawScreen_DeleteImage (img);
}
}
HFree (FramePtr);
}
return (TRUE);
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:31,代码来源:gfxload.c
示例3: TFB_DrawImage_Delete
void
TFB_DrawImage_Delete (TFB_Image *image)
{
if (image == 0)
{
log_add (log_Warning, "INTERNAL ERROR: Tried to delete a null image!");
/* Should we die here? */
return;
}
LockMutex (image->mutex);
TFB_DrawCanvas_Delete (image->NormalImg);
if (image->ScaledImg) {
TFB_DrawCanvas_Delete (image->ScaledImg);
}
if (image->Palette)
HFree (image->Palette);
UnlockMutex (image->mutex);
DestroyMutex (image->mutex);
HFree (image);
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:25,代码来源:tfb_draw.c
示例4: VideoDecoder_Free
void
VideoDecoder_Free (TFB_VideoDecoder *decoder)
{
if (!decoder)
return;
decoder->funcs->Close (decoder);
decoder->funcs->Term (decoder);
HFree (decoder->filename);
HFree (decoder);
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:12,代码来源:videodec.c
示例5: CreateThread_SDL
Thread
CreateThread_SDL (ThreadFunction func, void *data, SDWORD stackSize
#ifdef NAMED_SYNCHRO
, const char *name
#endif
)
{
TrueThread thread;
struct ThreadStartInfo *startInfo;
thread = (struct _thread *) HMalloc (sizeof *thread);
#ifdef NAMED_SYNCHRO
thread->name = name;
#endif
#ifdef PROFILE_THREADS
thread->startTime = GetTimeCounter ();
#endif
thread->localData = CreateThreadLocal ();
startInfo = (struct ThreadStartInfo *) HMalloc (sizeof (*startInfo));
startInfo->func = func;
startInfo->data = data;
startInfo->sem = SDL_CreateSemaphore (0);
startInfo->thread = thread;
thread->native = SDL_CreateThread (ThreadHelper, (void *) startInfo);
if (!(thread->native))
{
DestroyThreadLocal (thread->localData);
HFree (startInfo);
HFree (thread);
return NULL;
}
// The responsibility to free 'startInfo' and 'thread' is now by the new
// thread.
QueueThread (thread);
#ifdef DEBUG_THREADS
#if 0
log_add (log_Debug, "Thread '%s' created.", ThreadName (thread));
fflush (stderr);
#endif
#endif
// Signal to the new thread that the thread structure is ready
// and it can begin to use it.
SDL_SemPost (startInfo->sem);
(void) stackSize; /* Satisfying compiler (unused parameter) */
return thread;
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:53,代码来源:sdlthreads.c
示例6: DeleteCeosRecord
void DeleteCeosRecord(CeosRecord_t *record)
{
if(record)
{
if(record->Buffer)
{
HFree(record->Buffer);
record->Buffer = NULL;
}
HFree( record );
}
}
开发者ID:0004c,项目名称:node-gdal,代码行数:12,代码来源:ceos.c
示例7: destroy_SoundChunk_list
void
destroy_SoundChunk_list (TFB_SoundChunk *chunk)
{
TFB_SoundChunk *next = NULL;
for ( ; chunk; chunk = next)
{
next = chunk->next;
if (chunk->decoder)
SoundDecoder_Free (chunk->decoder);
HFree (chunk->text);
HFree (chunk);
}
}
开发者ID:ptaoussanis,项目名称:urquan-masters,代码行数:13,代码来源:trackplayer.c
示例8: ThreadHelper
static int
ThreadHelper (void *startInfo) {
ThreadFunction func;
void *data;
SDL_sem *sem;
TrueThread thread;
int result;
func = ((struct ThreadStartInfo *) startInfo)->func;
data = ((struct ThreadStartInfo *) startInfo)->data;
sem = ((struct ThreadStartInfo *) startInfo)->sem;
// Wait until the Thread structure is available.
SDL_SemWait (sem);
SDL_DestroySemaphore (sem);
thread = ((struct ThreadStartInfo *) startInfo)->thread;
HFree (startInfo);
result = (*func) (data);
#ifdef DEBUG_THREADS
log_add (log_Debug, "Thread '%s' done (returned %d).",
thread->name, result);
fflush (stderr);
#endif
UnQueueThread (thread);
DestroyThreadLocal (thread->localData);
FinishThread (thread);
/* Destroying the thread is the responsibility of ProcessThreadLifecycles() */
return result;
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:32,代码来源:sdlthreads.c
示例9: mixSDL_Uninit
void
mixSDL_Uninit (void)
{
int i;
UninitStreamDecoder ();
for (i = 0; i < NUM_SOUNDSOURCES; ++i)
{
if (soundSource[i].sample && soundSource[i].sample->decoder)
{
StopStream (i);
}
if (soundSource[i].sbuffer)
{
void *sbuffer = soundSource[i].sbuffer;
soundSource[i].sbuffer = NULL;
HFree (sbuffer);
}
DestroyMutex (soundSource[i].stream_mutex);
soundSource[i].stream_mutex = 0;
mixSDL_DeleteSources (1, &soundSource[i].handle);
}
SDL_CloseAudio ();
mixer_Uninit ();
SoundDecoder_Uninit ();
SDL_QuitSubSystem (SDL_INIT_AUDIO);
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:30,代码来源:audiodrv_sdl.c
示例10: copyError
/*
* Closes srcHandle if it's not -1.
* Closes dstHandle if it's not -1.
* Removes unlinkpath from the unlinkHandle dir if it's not NULL.
* Frees 'buf' if not NULL.
* Always returns -1.
* errno is what was before the call.
*/
static int
copyError(uio_Handle *srcHandle, uio_Handle *dstHandle,
uio_DirHandle *unlinkHandle, const char *unlinkPath, uint8 *buf)
{
int savedErrno;
savedErrno = errno;
log_add (log_Debug, "Error while copying: %s", strerror (errno));
if (srcHandle != NULL)
uio_close (srcHandle);
if (dstHandle != NULL)
uio_close (dstHandle);
if (unlinkPath != NULL)
uio_unlink (unlinkHandle, unlinkPath);
if (buf != NULL)
HFree(buf);
errno = savedErrno;
return -1;
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:33,代码来源:files.c
示例11: alloc_colormap
static inline TFB_ColorMap *
alloc_colormap (void)
// returns an addrefed object
{
TFB_ColorMap *map;
if (poolhead)
{ // have some spares
map = poolhead;
poolhead = map->next;
--poolcount;
}
else
{ // no spares, need a new one
map = HMalloc (sizeof (*map));
map->palette = AllocNativePalette ();
if (!map->palette)
{
HFree (map);
return NULL;
}
}
map->next = NULL;
map->index = -1;
map->refcount = 1;
map->version = 0;
return map;
}
开发者ID:jurchik,项目名称:project6014,代码行数:29,代码来源:cmap.c
示例12: ExtractInt
static void ExtractInt(CeosRecord_t *record, int type, unsigned int offset, unsigned int length, int *value)
{
void *buffer;
char format[32];
buffer = HMalloc( length + 1 );
switch(type)
{
case __CEOS_REC_TYP_A:
sprintf( format, "A%u", length );
GetCeosField( record, offset, format, buffer );
*value = atoi( buffer );
break;
case __CEOS_REC_TYP_B:
sprintf( format, "B%u", length );
#ifdef notdef
GetCeosField( record, offset, format, buffer );
if( length <= 4 )
CeosToNative( value, buffer, length, length );
else
*value = 0;
#else
GetCeosField( record, offset, format, value );
#endif
break;
case __CEOS_REC_TYP_I:
sprintf( format, "I%u", length );
GetCeosField( record, offset, format, value );
break;
}
HFree( buffer );
}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:35,代码来源:ceosrecipe.c
示例13: _ReleaseFontData
BOOLEAN
_ReleaseFontData (void *handle)
{
FONT font = (FONT) handle;
if (font == NULL)
return FALSE;
{
FONT_PAGE *page;
FONT_PAGE *nextPage;
for (page = font->fontPages; page != NULL; page = nextPage)
{
size_t charI;
for (charI = 0; charI < page->numChars; charI++)
{
TFB_Char *c = &page->charDesc[charI];
if (c->data == NULL)
continue;
// XXX: fix this if fonts get per-page data
// rather than per-char
TFB_DrawScreen_DeleteData (c->data);
}
nextPage = page->next;
FreeFontPage (page);
}
}
HFree (font);
return TRUE;
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:35,代码来源:gfxload.c
示例14: GetCodeResData
static void
GetCodeResData (const char *ship_id, RESOURCE_DATA *resdata)
{
BYTE which_res;
void *hData;
which_res = atoi (ship_id);
hData = HMalloc (sizeof (CODERES_STRUCT));
if (hData)
{
RaceDescInitFunc initFunc = CodeResToInitFunc (which_res);
RACE_DESC *RDPtr = (initFunc == NULL) ? NULL : (*initFunc)();
if (RDPtr == 0)
{
HFree (hData);
hData = 0;
}
else
{
CODERES_STRUCT *cs;
cs = (CODERES_STRUCT *) hData;
cs->data = *RDPtr; // Structure assignment.
}
}
resdata->ptr = hData;
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:27,代码来源:dummy.c
示例15: openAL_Uninit
void
openAL_Uninit (void)
{
int i;
UninitStreamDecoder ();
for (i = 0; i < NUM_SOUNDSOURCES; ++i)
{
if (soundSource[i].sample && soundSource[i].sample->decoder)
{
StopStream (i);
}
if (soundSource[i].sbuffer)
{
void *sbuffer = soundSource[i].sbuffer;
soundSource[i].sbuffer = NULL;
HFree (sbuffer);
}
DestroyMutex (soundSource[i].stream_mutex);
}
alcMakeContextCurrent (NULL);
alcDestroyContext (alcContext);
alcContext = NULL;
alcCloseDevice (alcDevice);
alcDevice = NULL;
SoundDecoder_Uninit ();
}
开发者ID:SirDifferential,项目名称:Shiver-Balance-Mod,代码行数:30,代码来源:audiodrv_openal.c
示例16: VideoDecoder_Load
TFB_VideoDecoder*
VideoDecoder_Load (uio_DirHandle *dir, const char *filename)
{
const char* pext;
TFB_RegVideoDecoder* info;
TFB_VideoDecoder* decoder;
if (!vd_inited)
return NULL;
pext = strrchr (filename, '.');
if (!pext)
{
log_add (log_Warning, "VideoDecoder_Load: Unknown file type");
return NULL;
}
++pext;
for (info = vd_decoders; info->used &&
(!info->ext || strcmp (info->ext, pext) != 0);
++info)
;
if (!info->ext)
{
log_add (log_Warning, "VideoDecoder_Load: Unsupported file type");
return NULL;
}
decoder = (TFB_VideoDecoder*) HCalloc (info->funcs->GetStructSize ());
decoder->funcs = info->funcs;
if (!decoder->funcs->Init (decoder, &vd_vidfmt))
{
log_add (log_Warning, "VideoDecoder_Load: "
"Cannot init '%s' decoder, code %d",
decoder->funcs->GetName (),
decoder->funcs->GetError (decoder));
HFree (decoder);
return NULL;
}
decoder->dir = dir;
decoder->filename = (char *) HMalloc (strlen (filename) + 1);
strcpy (decoder->filename, filename);
decoder->error = VIDEODECODER_OK;
if (!decoder->funcs->Open (decoder, dir, filename))
{
log_add (log_Warning, "VideoDecoder_Load: "
"'%s' decoder did not load %s, code %d",
decoder->funcs->GetName (), filename,
decoder->funcs->GetError (decoder));
VideoDecoder_Free (decoder);
return NULL;
}
return decoder;
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:59,代码来源:videodec.c
示例17: UninitMeleeLoadState
void
UninitMeleeLoadState (MELEE_STATE *pMS)
{
UninitLoadView (pMS);
UninitPreBuilt (pMS);
if (pMS->load.entryIndices != NULL)
HFree (pMS->load.entryIndices);
}
开发者ID:jurchik,项目名称:project6014,代码行数:8,代码来源:loadmele.c
示例18: sdluio_close
int
sdluio_close (SDL_RWops *context) {
int result;
result = uio_fclose ((uio_Stream *) context->hidden.unknown.data1);
HFree (context);
return result;
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:8,代码来源:sdluio.c
示例19: key_uninit
static void
key_uninit (void)
{
int i;
free_key_pool (pool);
for (i = 0; i < num_sdl_keys; i++)
bindings[i] = NULL;
HFree (bindings);
bindings = NULL;
pool = NULL;
#ifdef HAVE_JOYSTICK
for (i = 0; i < joycount; i++)
destroy_joystick (i);
HFree (joysticks);
#endif /* HAVE_JOYSTICK */
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:17,代码来源:vcontrol.c
示例20: destroy_joystick
static void
destroy_joystick (int index)
{
SDL_Joystick *stick = joysticks[index].stick;
if (stick)
{
SDL_JoystickClose (stick);
joysticks[index].stick = NULL;
HFree (joysticks[index].axes);
HFree (joysticks[index].buttons);
HFree (joysticks[index].hats);
joysticks[index].numaxes = joysticks[index].numbuttons = 0;
joysticks[index].axes = NULL;
joysticks[index].buttons = NULL;
joysticks[index].hats = NULL;
}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:17,代码来源:vcontrol.c
注:本文中的HFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论