summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2016-02-10 16:25:32 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:54:13 +0100
commite4a4b0b57899bde1f35565e18bcb9bb1b06f6320 (patch)
tree82dbf87041fc9d385223cfac1be0926c6c2b66c1 /src/renderergl2/tr_backend.c
parentd5ba7bb70ef327c8856165475b58e946c8fbd8ce (diff)
OpenGL2: Add named cubemaps and per-map env.json parsing.
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index ae475b02..f7720443 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -1675,7 +1675,16 @@ const void *RB_ExportCubemaps(const void *data)
p += sideSize;
}
- Com_sprintf(filename, MAX_QPATH, "cubemaps/%s/%03d.dds", tr.world->baseName, i);
+ if (cubemap->name[0])
+ {
+ COM_StripExtension(cubemap->name, filename, MAX_QPATH);
+ Q_strcat(filename, MAX_QPATH, ".dds");
+ }
+ else
+ {
+ Com_sprintf(filename, MAX_QPATH, "cubemaps/%s/%03d.dds", tr.world->baseName, i);
+ }
+
R_SaveDDS(filename, cubemapPixels, r_cubemapSize->integer, r_cubemapSize->integer, 6);
ri.Printf(PRINT_ALL, "Saved cubemap %d as %s\n", i, filename);
}