Move CalcNumMips to common header so GL code can access it

This commit is contained in:
baldurk committed 2014-11-28 21:12:17 +00:00
1 parent c1c6d635d9
commit 4a79ac8039
4 files changed
+17 -17

No files matched your search

+15
View File
@@ -223,6 +223,21 @@ bool FindDiffRange(void *a, void *b, size_t bufSize, size_t &diffStart, size_t &
return diffStart < bufSize;
}
uint32_t CalcNumMips(int w, int h, int d)
{
int mipLevels = 1;
while(w > 1 || h > 1 || d > 1)
{
w = RDCMAX(1, w>>1);
h = RDCMAX(1, h>>1);
d = RDCMAX(1, d>>1);
mipLevels++;
}
return mipLevels;
}
static string &logfile()
{
static string fn;