static void cl_gecko_start( void ) { int i; cl_geckotexturepool = R_AllocTexturePool(); // recreate textures on module start for( i = 0 ; i < MAX_GECKO_INSTANCES ; i++ ) { clgecko_t *instance = &cl_geckoinstances[ i ]; if( instance->active ) { cl_gecko_linktexture( instance ); } } }
//extern qboolean r_loadfog; static void r_explosion_start(void) { int x, y; static unsigned char noise1[128][128], noise2[128][128], noise3[128][128], data[128][128][4]; explosiontexturepool = R_AllocTexturePool(); explosiontexture = NULL; //explosiontexturefog = NULL; fractalnoise(&noise1[0][0], 128, 32); fractalnoise(&noise2[0][0], 128, 4); fractalnoise(&noise3[0][0], 128, 4); for (y = 0;y < 128;y++) { for (x = 0;x < 128;x++) { int j, r, g, b, a; j = (noise1[y][x] * noise2[y][x]) * 3 / 256 - 128; r = (j * 512) / 256; g = (j * 256) / 256; b = (j * 128) / 256; a = noise3[y][x] * 3 - 128; data[y][x][2] = bound(0, r, 255); data[y][x][1] = bound(0, g, 255); data[y][x][0] = bound(0, b, 255); data[y][x][3] = bound(0, a, 255); } } explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_FORCELINEAR, -1, NULL); // if (r_loadfog) // { // for (y = 0;y < 128;y++) // for (x = 0;x < 128;x++) // data[y][x][0] = data[y][x][1] = data[y][x][2] = 255; // explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexture_fog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_FORCELINEAR, NULL); // } // note that explosions survive the restart }
static void r_sky_start(void) { skytexturepool = R_AllocTexturePool(); R_LoadSkyBox(); }