… | |
… | |
43 | slices [i].name = 0; |
43 | slices [i].name = 0; |
44 | |
44 | |
45 | while (first_texture) |
45 | while (first_texture) |
46 | { |
46 | { |
47 | tc_texture *next = first_texture->next; |
47 | tc_texture *next = first_texture->next; |
48 | glDeleteTextures (1, &first_texture->name); |
48 | del_texture (first_texture->name); |
49 | g_slice_free (tc_texture, first_texture); |
49 | g_slice_free (tc_texture, first_texture); |
50 | first_texture = next; |
50 | first_texture = next; |
51 | } |
51 | } |
52 | |
52 | |
53 | ++tc_generation; |
53 | ++tc_generation; |
… | |
… | |
77 | if (!match) |
77 | if (!match) |
78 | { |
78 | { |
79 | match = g_slice_new (tc_texture); |
79 | match = g_slice_new (tc_texture); |
80 | match->next = first_texture; |
80 | match->next = first_texture; |
81 | first_texture = match; |
81 | first_texture = match; |
82 | glGenTextures (1, &match->name); |
82 | match->name = gen_texture (); |
83 | match->avail = TC_HEIGHT; |
83 | match->avail = TC_HEIGHT; |
84 | |
84 | |
85 | glBindTexture (GL_TEXTURE_2D, match->name); |
85 | glBindTexture (GL_TEXTURE_2D, match->name); |
86 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
86 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
87 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
87 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |