src/osd/windows/drawd3d.c
| r13295 | r13296 | |
| 892 | 892 | |
| 893 | 893 | static void device_delete(d3d_info *d3d) |
| 894 | 894 | { |
| 895 | | // free our effects |
| 896 | | d3d->hlsl->delete_resources(); |
| 897 | | |
| 898 | 895 | // delete the HLSL interface |
| 899 | 896 | global_free(d3d->hlsl); |
| 900 | 897 | |
| 901 | | // free resources |
| 898 | // free our base resources |
| 902 | 899 | device_delete_resources(d3d); |
| 903 | 900 | |
| 901 | // free our effects |
| 902 | d3d->hlsl->delete_resources(); |
| 903 | |
| 904 | 904 | // free the device itself |
| 905 | 905 | if (d3d->device != NULL) |
| 906 | 906 | (*d3dintf->device.release)(d3d->device); |
| r13295 | r13296 | |
| 921 | 921 | d3d_texture_info *tex = d3d->texlist; |
| 922 | 922 | d3d->texlist = tex->next; |
| 923 | 923 | if (tex->d3dfinaltex != NULL) |
| 924 | { |
| 924 | 925 | (*d3dintf->texture.release)(tex->d3dfinaltex); |
| 926 | tex->d3dfinaltex = NULL; |
| 927 | } |
| 925 | 928 | if (tex->d3dtex != NULL && tex->d3dtex != tex->d3dfinaltex) |
| 929 | { |
| 926 | 930 | (*d3dintf->texture.release)(tex->d3dtex); |
| 931 | tex->d3dtex = NULL; |
| 932 | } |
| 927 | 933 | if (tex->d3dsurface != NULL) |
| 934 | { |
| 928 | 935 | (*d3dintf->surface.release)(tex->d3dsurface); |
| 936 | tex->d3dsurface = NULL; |
| 937 | } |
| 929 | 938 | global_free(tex); |
| 930 | 939 | } |
| 931 | 940 | |
src/osd/windows/d3dhlsl.c
| r13295 | r13296 | |
| 1 | 1 | //============================================================ |
| 2 | 2 | // |
| 3 | | // drawd3d.c - Win32 Direct3D HLSL implementation |
| 3 | // d3dhlsl.c - Win32 Direct3D HLSL implementation |
| 4 | 4 | // |
| 5 | 5 | //============================================================ |
| 6 | 6 | // |
| r13295 | r13296 | |
| 213 | 213 | |
| 214 | 214 | hlsl_info::~hlsl_info() |
| 215 | 215 | { |
| 216 | global_free(options); |
| 217 | |
| 218 | if(shadow_bitmap != NULL) |
| 219 | { |
| 220 | global_free(shadow_bitmap); |
| 221 | shadow_bitmap = NULL; |
| 222 | } |
| 216 | 223 | } |
| 217 | 224 | |
| 218 | 225 | |
| r13295 | r13296 | |
| 1734 | 1741 | if(target_in_use[index] != NULL) |
| 1735 | 1742 | { |
| 1736 | 1743 | d3d_texture_info *tex = target_in_use[index]; |
| 1737 | | |
| 1738 | | if(d3d->texlist == tex) |
| 1744 | bool found_in_active_list = false; |
| 1745 | d3d_texture_info *test_tex = d3d->texlist; |
| 1746 | while (test_tex != NULL) |
| 1739 | 1747 | { |
| 1740 | | d3d->texlist = tex->next; |
| 1741 | | if(d3d->texlist != NULL) |
| 1748 | if(test_tex == tex) |
| 1742 | 1749 | { |
| 1743 | | d3d->texlist->prev = NULL; |
| 1750 | found_in_active_list = true; |
| 1751 | break; |
| 1744 | 1752 | } |
| 1753 | test_tex = test_tex->next; |
| 1745 | 1754 | } |
| 1746 | | else |
| 1755 | |
| 1756 | // only clean up a texture if it won't be cleaned up by drawd3d |
| 1757 | if(!found_in_active_list) |
| 1747 | 1758 | { |
| 1748 | | if(tex->next != NULL) |
| 1759 | if (tex->d3dfinaltex != NULL) |
| 1749 | 1760 | { |
| 1750 | | tex->next->prev = tex->prev; |
| 1761 | (*d3dintf->texture.release)(tex->d3dfinaltex); |
| 1762 | tex->d3dfinaltex = NULL; |
| 1751 | 1763 | } |
| 1752 | | if(tex->prev != NULL) |
| 1764 | if (tex->d3dtex != NULL && tex->d3dtex != tex->d3dfinaltex) |
| 1753 | 1765 | { |
| 1754 | | tex->prev->next = tex->next; |
| 1766 | (*d3dintf->texture.release)(tex->d3dtex); |
| 1767 | tex->d3dtex = NULL; |
| 1755 | 1768 | } |
| 1769 | if (tex->d3dsurface != NULL) |
| 1770 | { |
| 1771 | (*d3dintf->surface.release)(tex->d3dsurface); |
| 1772 | } |
| 1773 | global_free(tex); |
| 1756 | 1774 | } |
| 1757 | | |
| 1758 | | if (tex->d3dfinaltex != NULL) |
| 1759 | | (*d3dintf->texture.release)(tex->d3dfinaltex); |
| 1760 | | if (tex->d3dtex != NULL && tex->d3dtex != tex->d3dfinaltex) |
| 1761 | | (*d3dintf->texture.release)(tex->d3dtex); |
| 1762 | | if (tex->d3dsurface != NULL) |
| 1763 | | (*d3dintf->surface.release)(tex->d3dsurface); |
| 1764 | | global_free(tex); |
| 1765 | 1775 | } |
| 1766 | 1776 | |
| 1767 | 1777 | if (prescaletexture0[index] != NULL) |