4
4
mirror of https://github.com/H-uru/korman.git synced 2025-07-14 10:27:36 -04:00

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 :)
This commit is contained in:
2014-07-10 19:32:58 -04:00
parent 9424311c65
commit 3c0d2150b6
3 changed files with 3 additions and 10 deletions

View File

@ -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 // 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... // NPOT if we're being run on some kind of dinosaur...
imagesize_t dimensions = get_image_size(blImage); imagesize_t dimensions = get_image_size(blImage);
size_t width = pow(2., korlib::log2(static_cast<double>(std::get<0>(dimensions)))); size_t width = pow(2, log2(std::get<0>(dimensions)));
size_t height = pow(2., korlib::log2(static_cast<double>(std::get<1>(dimensions)))); size_t height = pow(2, log2(std::get<1>(dimensions)));
if (std::get<0>(dimensions) != width || std::get<1>(dimensions) != height) { 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), print("\tImage is not a POT (%dx%d)... resizing to %dx%d", std::get<0>(dimensions),
std::get<1>(dimensions), width, height); std::get<1>(dimensions), width, height);

View File

@ -77,13 +77,6 @@ namespace korlib
pyref attr = PyObject_GetAttrString(o, name); pyref attr = PyObject_GetAttrString(o, name);
return PyLong_AsSize_t(attr); 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 #endif // __KORLIB_UTILS_HPP

View File

@ -21,7 +21,7 @@ from . import operators
bl_info = { bl_info = {
"name": "Korman", "name": "Korman",
"author": "Guild of Writers", "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", "location": "File > Import-Export",
"description": "Exporter for Cyan Worlds' Plasma Engine", "description": "Exporter for Cyan Worlds' Plasma Engine",
"warning": "alpha", "warning": "alpha",