Browse Source

Update to Blender 2.71

2.71 upgrades to MSVC++2013, so we can use the newfangled log2. This fixes
a rounding bug as well :)
pull/6/head
Adam Johnson 10 years ago
parent
commit
3c0d2150b6
  1. 4
      korlib/generate_mipmap.cpp
  2. 7
      korlib/utils.hpp
  3. 2
      korman/__init__.py

4
korlib/generate_mipmap.cpp

@ -179,8 +179,8 @@ extern "C" PyObject* generate_mipmap(PyObject*, PyObject* args)
// Step 1: Resize to POT (if needed) -- don't rely on GLU for this because it may not suppport
// NPOT if we're being run on some kind of dinosaur...
imagesize_t dimensions = get_image_size(blImage);
size_t width = pow(2., korlib::log2(static_cast<double>(std::get<0>(dimensions))));
size_t height = pow(2., korlib::log2(static_cast<double>(std::get<1>(dimensions))));
size_t width = pow(2, log2(std::get<0>(dimensions)));
size_t height = pow(2, log2(std::get<1>(dimensions)));
if (std::get<0>(dimensions) != width || std::get<1>(dimensions) != height) {
print("\tImage is not a POT (%dx%d)... resizing to %dx%d", std::get<0>(dimensions),
std::get<1>(dimensions), width, height);

7
korlib/utils.hpp

@ -77,13 +77,6 @@ namespace korlib
pyref attr = PyObject_GetAttrString(o, name);
return PyLong_AsSize_t(attr);
}
/** MSVC++ is not C99 compliant :( */
double log2(double v)
{
static double hack = log(2.);
return log(v) / hack;
}
};
#endif // __KORLIB_UTILS_HPP

2
korman/__init__.py

@ -21,7 +21,7 @@ from . import operators
bl_info = {
"name": "Korman",
"author": "Guild of Writers",
"blender": (2, 70, 0), # I can't be bothered to support old stuff
"blender": (2, 71, 0), # I can't be bothered to support old stuff
"location": "File > Import-Export",
"description": "Exporter for Cyan Worlds' Plasma Engine",
"warning": "alpha",

Loading…
Cancel
Save