int Dx_FileRead_close(int fileHandle) { FileHandle *handle = (FileHandle *)PL_Handle_GetData(fileHandle, DXHANDLE_FILE); if (handle != NULL) { SDL_RWops *rwops = handle->rwops; SDL_RWclose(rwops); PL_Handle_ReleaseID(fileHandle, DXTRUE); return 0; } return -1; }
int PL_Texture_Release(int textureID) { TextureRef *textureref = (TextureRef*)PL_Handle_GetData(textureID, DXHANDLE_TEXTURE); if (textureref == NULL) { return -1; } textureref->refCount -= 1; if (textureref->refCount <= 0) { SDL_DestroyTexture(textureref->texture); PL_Handle_ReleaseID(textureID, DXTRUE); } return 0; }
void LunaFontSprite::Release(LFONTSPRITE lFontSpr) { LunaFontSprData *fontspr = (LunaFontSprData *)PL_Handle_GetData((int)lFontSpr, DXHANDLE_LUNAFONTSPRITE); if (fontspr != NULL) { int i; if (fontspr->sheetGraphs != NULL) { for (i = 0; i < fontspr->sheetCount; ++i) { PLG.Texture_Release(fontspr->sheetGraphs[i]); } DXFREE(fontspr->sheetGraphs); } if (fontspr->sheetSprites != NULL) { for (i = 0; i < fontspr->sheetCount; ++i) { LunaSprite::Release(fontspr->sheetSprites[i]); } DXFREE(fontspr->sheetSprites); } DXFREE(fontspr->lfdData); PL_Handle_ReleaseID(lFontSpr, DXTRUE); } }