initialize cache mutexes in right file

This commit is contained in:
Sean Barrett
2015-02-22 15:09:22 -08:00
parent cd17050ca4
commit 5a0dcc90d6
2 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,5 @@
// This file takes minecraft chunks (decoded by cave_parse) and
// uses stb_voxel_render to turn them into vertex buffers.
#define STB_GLEXT_DECLARE "glext_list.h"
#include "stb_gl.h"
@ -452,6 +454,7 @@ void reset_cache_size(int size)
cache_size = size;
}
// this must be called inside mutex
void deref_fastchunk(fast_chunk *fc)
{
if (fc) {
@ -672,6 +675,9 @@ void mesh_init(void)
{
int i;
chunk_cache_mutex = SDL_CreateMutex();
chunk_get_mutex = SDL_CreateMutex();
for (i=0; i < 256; ++i) {
memcpy(minecraft_tex1_for_blocktype[i], minecraft_info[i]+1, 6);
minecraft_trans_for_blocktype[i] = (minecraft_info[i][0] != C_solid && minecraft_info[i][0] != C_water);