--- deliantra/Deliantra-Client/texcache.c 2006/07/04 23:23:32 1.1 +++ deliantra/Deliantra-Client/texcache.c 2007/04/27 21:27:51 1.3 @@ -8,6 +8,8 @@ int x, y, w, h; } tc_area; +extern int tc_generation; + void tc_get (tc_area *area, int width, int height); void tc_put (tc_area *area); void tc_clear (); @@ -16,6 +18,8 @@ #include +int tc_generation; + typedef struct tc_texture { struct tc_texture *next; GLuint name; @@ -41,10 +45,12 @@ while (first_texture) { tc_texture *next = first_texture->next; - glDeleteTextures (1, &first_texture->name); + del_texture (first_texture->name); g_slice_free (tc_texture, first_texture); first_texture = next; } + + ++tc_generation; } void @@ -73,7 +79,7 @@ match = g_slice_new (tc_texture); match->next = first_texture; first_texture = match; - glGenTextures (1, &match->name); + match->name = gen_texture (); match->avail = TC_HEIGHT; glBindTexture (GL_TEXTURE_2D, match->name);