diff options
author | SmileTheory <SmileTheory@gmail.com> | 2015-12-23 09:58:11 -0800 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:46:05 +0100 |
commit | cedfa02c6b3b17cda26202abf5e4dd32f9720cb5 (patch) | |
tree | fe92a0b799820983f70cfd5e09c939755124bbe4 /src/renderergl2/tr_bsp.c | |
parent | 19c44d9c50d6a3057e79007c779552d0eb7fe4ef (diff) |
OpenGL2: Replace r_exportCubemaps cvar with exportCubemaps command.
Diffstat (limited to 'src/renderergl2/tr_bsp.c')
-rw-r--r-- | src/renderergl2/tr_bsp.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/renderergl2/tr_bsp.c b/src/renderergl2/tr_bsp.c index 81463c66..960e9282 100644 --- a/src/renderergl2/tr_bsp.c +++ b/src/renderergl2/tr_bsp.c @@ -3068,13 +3068,9 @@ void R_AssignCubemapsToWorldSurfaces(void) } } -// FIXME: put this function declaration elsewhere -void R_SaveDDS(const char *filename, byte *pic, int width, int height, int depth); void R_RenderAllCubemaps(void) { - byte *data = NULL; - int sideSize = CUBE_MAP_SIZE * CUBE_MAP_SIZE * 4; int i, j; for (i = 0; i < tr.numCubemaps; i++) @@ -3082,9 +3078,6 @@ void R_RenderAllCubemaps(void) tr.cubemaps[i].image = R_CreateImage(va("*cubeMap%d", i), NULL, CUBE_MAP_SIZE, CUBE_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE | IMGFLAG_MIPMAP | IMGFLAG_CUBEMAP, GL_RGBA8); } - if (r_exportCubemaps->integer) - data = ri.Malloc(sideSize * 6); - for (i = 0; i < tr.numCubemaps; i++) { for (j = 0; j < 6; j++) @@ -3094,34 +3087,6 @@ void R_RenderAllCubemaps(void) R_IssuePendingRenderCommands(); R_InitNextFrame(); } - - if (r_exportCubemaps->integer) - { - char filename[MAX_QPATH]; - byte *p; - cubemap_t *cubemap = &tr.cubemaps[i]; - - // FIXME: do this in backEnd - FBO_Bind(tr.renderCubeFbo); - - p = data; - for (j = 0; j < 6; j++) - { - qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + j, cubemap->image->texnum, 0); - qglReadPixels(0, 0, CUBE_MAP_SIZE, CUBE_MAP_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, p); - p += sideSize; - } - FBO_Bind(NULL); - - Com_sprintf(filename, MAX_QPATH, "cubemaps/%s/%03d.dds", tr.world->baseName, backEnd.viewParms.targetFboCubemapIndex); - R_SaveDDS(filename, data, CUBE_MAP_SIZE, CUBE_MAP_SIZE, 6); - } - } - - if (r_exportCubemaps->integer) - { - ri.Cvar_Set("r_exportCubemaps", "0"); - ri.Free(data); } } |